~ubuntu-branches/ubuntu/intrepid/jockey/intrepid-proposed

« back to all changes in this revision

Viewing changes to data/handlers/b43.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-10-02 20:44:09 UTC
  • Revision ID: james.westby@ubuntu.com-20081002204409-0xw7wkc3a9pfk3b9
Tags: 0.5~beta1-0ubuntu2
* Merge some bug fixes from trunk:
  - ui.py: Fix "not installed" -> "not activated" string inconsistency.
    (LP: #274697)
  - Fix typos in German translation.
  - Add and use enabled/disabled/free icons from Kenneth Wimer.
  - Fix jockey-kde crash when no drivers are available. [Alberto]
  - Report indefinite progress if the handler does long non-package
    operations (such as rebuilding initramfs), instead of freezing the UI.
  - UI: Select first driver by default, and keep selection after
    enable/disable. (LP: #274699)
  - jockey-kde: Fix display of window text and subtext, and adapt it to
    driver changes. (LP: #274558)
  - Avoid flickering the progress bar dialog for very fast detect() calls.
  - jockey-kde: Fix indeterminate progress bar behaviour, and fix "Searching
    for drivers..." progress bar at startup.
  - kde/ManagerWindowKDE4.ui: Drop the expander next to the window heading,
    it prevented proper resizing. (LP: #274700)
  - Various test suite fixes.
* data/handlers/b43.py: Do not show the driver as "in use" if the firmware
  is not installed.
* Add data/handlers/broadcom_wl.py: Handler for the alternative Broadcom
  'wl' module. Enabling this will automatically blacklist b43 and bcm43xx.
  (LP: #263097)
* data/handlers/b43.py: Remove blacklist-bcm43 on activation.
* data/handlers/b43.py: Add (derived) handler for b43legacy. (LP: #247495)
* data/handlers/b43.py: Actually call the firmware fetching script after the
  -fwcutter installation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# Author: Martin Pitt <martin.pitt@ubuntu.com>
3
3
# License: GPL v2 or later
4
4
 
5
 
import re, os.path, logging
 
5
import re, os.path, logging, subprocess
6
6
from glob import glob
7
7
 
8
 
from jockey.handlers import KernelModuleHandler, FirmwareHandler
 
8
from jockey.handlers import KernelModuleHandler
9
9
 
10
10
class B43Handler(KernelModuleHandler):
11
11
    '''Handler for Broadcom Wifi chipsets which use the b43 module and
24
24
        return KernelModuleHandler.enabled(self) and \
25
25
            len(glob('/lib/firmware/b43/*.fw')) > 0
26
26
 
 
27
    def used(self):
 
28
        '''Return if the handler is currently in use.'''
 
29
 
 
30
        return KernelModuleHandler.used(self) and \
 
31
            len(glob('/lib/firmware/b43/*.fw')) > 0
 
32
 
27
33
    def id(self):
28
34
        '''Return an unique identifier of the handler.'''
29
35
 
31
37
        if self.driver_vendor:
32
38
            i += ':' + self.driver_vendor.replace(' ', '_')
33
39
        return i
 
40
 
 
41
    def enable(self):
 
42
        '''Remove blacklist produced by BroadcomWLHandler.'''
 
43
 
 
44
        bl_file = '/etc/modprobe.d/blacklist-bcm43'
 
45
        if os.path.exists(bl_file):
 
46
            os.unlink(bl_file)
 
47
            OSLib.inst._load_module_blacklist()
 
48
            subprocess.call(['/usr/sbin/update-initramfs', '-u'])
 
49
 
 
50
        KernelModuleHandler.enable(self)
 
51
        if os.path.exists('/usr/share/b43-fwcutter/install_bcm43xx_firmware.sh'):
 
52
            subprocess.call(['/usr/share/b43-fwcutter/install_bcm43xx_firmware.sh'])
 
53
 
 
54
class B43LegacyHandler(B43Handler):
 
55
    '''Handler for Broadcom Wifi chipsets which use the b43legacy module and
 
56
    b43-fwcutter.'''
 
57
 
 
58
    def __init__(self, ui):
 
59
        KernelModuleHandler.__init__(self, ui, 'b43legacy')
 
60
        self.package = 'b43-fwcutter'