ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

 
Start a new topic Add Reply
> Modifying Bluetooth Kext, To Enable Off/On Toggle in Bluetooth
prasys
post Jun 1 2009, 12:44 PM
Post #1
I've noticed that on some laptops (with Broadcom or CSI - Cambridge Silicon Radio) - the software off/on switch doesn't work. This is just to enable it so that its possible to power off the radio. I've tested it and it does indeed power down the radio. However your milage may vary and it may or may not work. Depending on your system

First up , take note of your Device ID and Product ID (Make sure Bluetooth is powered on before doing this). This can be found in System Profiler

For Instance

Bluetooth Dongle
CODE
Product ID:    0x1004
  Vendor ID:    0x1131


Now convert these IDs from Base 16 (Hex) to Base 10 (Dec). There are many ways to do this , either by using OSX' calculator , scientific calculator or simply using this site to do it for you ( http://www.parkenet.com/apl/HexDecConverter.html). Take note of your Vendor ID and Product ID in Dec

fire up nano or any other text editor and navigate to

/System/Library/Extensions/IOBluetoothFamily.kext/Contents/PlugIns/BroadcomUSBBluetoothHCIController.kext (For Broadcom)
/System/Library/Extensions/IOBluetoothFamily.kext/Contents/PlugIns/CSRUSBBluetoothHCIController.kext (For CSI)

Open up Info.plist find



CODE
        <key>idProduct</key>
            <integer>33284</integer>
            <key>idVendor</key>
            <integer>1452</integer>



Simply replace the integer value with yours respectively. Both idProduct and idVendor respectively and do make sure that its in base 10 . Save it , exit it and simply clear your kextcache or reboot with -f (to rebuild kextcache). This should enable radio off/on toggle with your Broadcom or CSI Radio which is commonly found on netbooks , laptops and such.
Dell Dimension 9100 | Intel Pentium D 830 3.00Ghz | 4GB 533Mhz RAM | 750GB combined HDD storage | GeForce 8600GT (EFI strings) | ST9200 HD Audio (AppleHDA.kext from OSX 10.4.4) | D-link GWL-520G+ Rev B1 | OSX 10.5.7 (Voodoo Kernel - 9.7.0) , Win Vista ,Debian etch , Win XP
MSI Wind U100-835MY | Intel Atom N280 1.66Ghz | 2GB 667Mhz RAM | 160GB HDD | GMA 950 (patched kext) | ALC88x Audio (VoodooHDA) | AR242x (AR5006EXS) | CSR Bluetooth | OSX 10.5.7 (Retail Disc install) + WinXP
iBook G4 | PPC G4 7447A 1.06Ghz | 512MB DDR1 | 30GB HDD | AC97 audio | ATI Mobility Radeon 9200 | BCM4311 Apple Airport | OSX 10.5.7
Mac Mini G4 | PPC G4 7447A 1.42Ghz | 1GB DDR1 | 100GB HDD | AC97 audio | ATI Radeon 9200 | BCM Bluetooth (BTO) | OSX 10.5.7 + ubuntu 8.04
MikeTheMilkman
post Jun 3 2009, 11:15 PM
Post #2
o.0 very nice, I must try this!
QUOTE
The task ahead of you is never as great as the strength within you.
2 Systems running OS X. Laptop and PC.
prasys
post Jun 5 2009, 05:59 AM
Post #3
Slice , if you're reading this. I would be needing your help in patching this. I am trying to find a way to cut "power from device" when its turned off. Instead of in "idle" , like how it does in Windows. This goes to anyone who is willing to help. This way we can get a proper bluetooth shutdown fix on laptops !

just to add , I've found out that it indeed shuts off the bluetooth radio but it doesn't cut the power to bluetooth dongle/USB device. I've to find a way to shut the device completely as it does in Linux/Windows. Generally when you select disable bluetooth it shuts off the hardware completely (as in no current being supplied to the device)

This post has been edited by prasys: Jun 5 2009, 01:45 PM
Dell Dimension 9100 | Intel Pentium D 830 3.00Ghz | 4GB 533Mhz RAM | 750GB combined HDD storage | GeForce 8600GT (EFI strings) | ST9200 HD Audio (AppleHDA.kext from OSX 10.4.4) | D-link GWL-520G+ Rev B1 | OSX 10.5.7 (Voodoo Kernel - 9.7.0) , Win Vista ,Debian etch , Win XP
MSI Wind U100-835MY | Intel Atom N280 1.66Ghz | 2GB 667Mhz RAM | 160GB HDD | GMA 950 (patched kext) | ALC88x Audio (VoodooHDA) | AR242x (AR5006EXS) | CSR Bluetooth | OSX 10.5.7 (Retail Disc install) + WinXP
iBook G4 | PPC G4 7447A 1.06Ghz | 512MB DDR1 | 30GB HDD | AC97 audio | ATI Mobility Radeon 9200 | BCM4311 Apple Airport | OSX 10.5.7
Mac Mini G4 | PPC G4 7447A 1.42Ghz | 1GB DDR1 | 100GB HDD | AC97 audio | ATI Radeon 9200 | BCM Bluetooth (BTO) | OSX 10.5.7 + ubuntu 8.04
Hagar
post Jun 6 2009, 05:31 PM
Post #4
I put together a plist-only kext for my s10e that applies this. It's currently set to 8528 2652, I'd be interested to know if it works for anyone else.

Attached File  BroadcomUSBBluetoothHCIInjector.kext.zip ( 2.19K ) Number of downloads: 352
This Time We're Doing it RIGHT


Slice
post Jun 13 2009, 10:54 AM
Post #5
I also add my idProduct to info.plist and got messages
QUOTE
Jun 13 10:26:39 localhost kernel[0]: E:[AppleUSBBluetoothHCIController][FindInterfaces] bulk IN pipe open failed!
Jun 13 10:26:39 localhost kernel[0]: E:[AppleUSBBluetoothHCIController][FindInterfaces] some interface pipes were not found. Device is no good as a transport
Jun 13 10:26:39 localhost kernel[0]: E:[AppleUSBBluetoothHCIController][initHardware] failedExit.
Jun 13 10:26:39 localhost kernel[0]: SendHCIRequest failed, error (0xe00002c0)E:[AppleUSBBluetoothHCIController][FindInterfaces] bulk IN pipe open failed!
Jun 13 10:26:39 localhost kernel[0]: E:[AppleUSBBluetoothHCIController][FindInterfaces] some interface pipes were not found. Device is no good as a transport
Jun 13 10:26:39 localhost kernel[0]: E:[AppleUSBBluetoothHCIController][initHardware] failedExit.
Jun 13 10:26:39 localhost kernel[0]: SendHCIRequest failed, error (0xe00002c0)[HCIController][configurePM] power parent ready after 1 tries

and I have new devices in my ioreg
CODE
    | |   |   +-o IOUSBCompositeDevice@5d230000  <class IOUSBDevice, registered, matched, active, busy 0, retain 8>
    | |   |     | {
    | |   |     |   "bNumConfigurations" = 0x1
    | |   |     |   "sessionID" = 0x651bd46a
    | |   |     |   "bcdDevice" = 0x100
    | |   |     |   "USB Address" = 0x5
    | |   |     |   "iProduct" = 0x0
    | |   |     |   "bDeviceClass" = 0x0
    | |   |     |   "bMaxPacketSize0" = 0x8
    | |   |     |   "Need contiguous memory for isoch" = Yes
    | |   |     |   "IOUserClientClass" = "IOUSBDeviceUserClientV2"
    | |   |     |   "idVendor" = 0xa5c
    | |   |     |   "PortUsingExtraPowerForWake" = 0x0
    | |   |     |   "PortNum" = 0x3
    | |   |     |   "Bus Power Available" = 0x32
    | |   |     |   "Device Speed" = 0x1
    | |   |     |   "USB Product Name" = "Bluetooth USB Host Controller"
    | |   |     |   "Requested Power" = 0x0
    | |   |     |   "non-removable" = "yes"
    | |   |     |   "locationID" = 0x5d230000
    | |   |     |   "USB Vendor Name" = "Broadcom Corp"
    | |   |     |   "idProduct" = 0x4503
    | |   |     |   "bDeviceProtocol" = 0x0
    | |   |     |   "iManufacturer" = 0x1
    | |   |     |   "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
    | |   |     |   "iSerialNumber" = 0x0
    | |   |     |   "IOGeneralInterest" = "IOCommand is not serializable"
    | |   |     |   "bDeviceSubClass" = 0x0
    | |   |     |   "Low Power Displayed" = No
    | |   |     | }
    | |   |     |

and also in System Profiler.
But I don't know what is changed globally.
Shutdown works almost fine.
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
prasys
post Jun 30 2009, 10:23 AM
Post #6
QUOTE (Slice @ Jun 13 2009, 06:54 PM) *
I also add my idProduct to info.plist and got messages

and I have new devices in my ioreg
CODE
    | |   |   +-o IOUSBCompositeDevice@5d230000  <class IOUSBDevice, registered, matched, active, busy 0, retain 8>
    | |   |     | {
    | |   |     |   "bNumConfigurations" = 0x1
    | |   |     |   "sessionID" = 0x651bd46a
    | |   |     |   "bcdDevice" = 0x100
    | |   |     |   "USB Address" = 0x5
    | |   |     |   "iProduct" = 0x0
    | |   |     |   "bDeviceClass" = 0x0
    | |   |     |   "bMaxPacketSize0" = 0x8
    | |   |     |   "Need contiguous memory for isoch" = Yes
    | |   |     |   "IOUserClientClass" = "IOUSBDeviceUserClientV2"
    | |   |     |   "idVendor" = 0xa5c
    | |   |     |   "PortUsingExtraPowerForWake" = 0x0
    | |   |     |   "PortNum" = 0x3
    | |   |     |   "Bus Power Available" = 0x32
    | |   |     |   "Device Speed" = 0x1
    | |   |     |   "USB Product Name" = "Bluetooth USB Host Controller"
    | |   |     |   "Requested Power" = 0x0
    | |   |     |   "non-removable" = "yes"
    | |   |     |   "locationID" = 0x5d230000
    | |   |     |   "USB Vendor Name" = "Broadcom Corp"
    | |   |     |   "idProduct" = 0x4503
    | |   |     |   "bDeviceProtocol" = 0x0
    | |   |     |   "iManufacturer" = 0x1
    | |   |     |   "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
    | |   |     |   "iSerialNumber" = 0x0
    | |   |     |   "IOGeneralInterest" = "IOCommand is not serializable"
    | |   |     |   "bDeviceSubClass" = 0x0
    | |   |     |   "Low Power Displayed" = No
    | |   |     | }
    | |   |     |

and also in System Profiler.
But I don't know what is changed globally.
Shutdown works almost fine.

I am guessing we are getting somewhere. Do you think with this its possible for us to shut down the radio like how windows does it
Dell Dimension 9100 | Intel Pentium D 830 3.00Ghz | 4GB 533Mhz RAM | 750GB combined HDD storage | GeForce 8600GT (EFI strings) | ST9200 HD Audio (AppleHDA.kext from OSX 10.4.4) | D-link GWL-520G+ Rev B1 | OSX 10.5.7 (Voodoo Kernel - 9.7.0) , Win Vista ,Debian etch , Win XP
MSI Wind U100-835MY | Intel Atom N280 1.66Ghz | 2GB 667Mhz RAM | 160GB HDD | GMA 950 (patched kext) | ALC88x Audio (VoodooHDA) | AR242x (AR5006EXS) | CSR Bluetooth | OSX 10.5.7 (Retail Disc install) + WinXP
iBook G4 | PPC G4 7447A 1.06Ghz | 512MB DDR1 | 30GB HDD | AC97 audio | ATI Mobility Radeon 9200 | BCM4311 Apple Airport | OSX 10.5.7
Mac Mini G4 | PPC G4 7447A 1.42Ghz | 1GB DDR1 | 100GB HDD | AC97 audio | ATI Radeon 9200 | BCM Bluetooth (BTO) | OSX 10.5.7 + ubuntu 8.04
Slice
post Jul 10 2009, 12:16 PM
Post #7
QUOTE (prasys @ Jun 30 2009, 10:23 AM) *
I am guessing we are getting somewhere. Do you think with this its possible for us to shut down the radio like how windows does it

Don't know where thre is a button. I can switch off mechanically.
I found something new with this patch
Attached File  Picture_2.png ( 40.19K ) Number of downloads: 282
i3-2120 GA-H61M-S1 UEFI, Radeon HD6670-UEFI, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
prasys
post Jul 19 2009, 04:16 AM
Post #8
QUOTE (Slice @ Jul 10 2009, 08:16 PM) *
Don't know where thre is a button. I can switch off mechanically.
I found something new with this patch
Attached File  Picture_2.png ( 40.19K ) Number of downloads: 282

So it does speak with our hardware.

Things which I've found , software switch control is done in IOPCIFamily (for wifi) and as for usb its kinda done there. In PCs , switching off bluetooth means unplugging the usb device and in real macs , its done by turning off the bluetooth radio (but doing in pc yields no effect). This is what I've found out so far

Slice , i am guessing we're getting somewhere. For your information , this patch fixes issue with iPhone 3G/3GS internet sharing thingy whereby before this it was impossible to connect. i am guessing it does add something to somewhere

Dell Dimension 9100 | Intel Pentium D 830 3.00Ghz | 4GB 533Mhz RAM | 750GB combined HDD storage | GeForce 8600GT (EFI strings) | ST9200 HD Audio (AppleHDA.kext from OSX 10.4.4) | D-link GWL-520G+ Rev B1 | OSX 10.5.7 (Voodoo Kernel - 9.7.0) , Win Vista ,Debian etch , Win XP
MSI Wind U100-835MY | Intel Atom N280 1.66Ghz | 2GB 667Mhz RAM | 160GB HDD | GMA 950 (patched kext) | ALC88x Audio (VoodooHDA) | AR242x (AR5006EXS) | CSR Bluetooth | OSX 10.5.7 (Retail Disc install) + WinXP
iBook G4 | PPC G4 7447A 1.06Ghz | 512MB DDR1 | 30GB HDD | AC97 audio | ATI Mobility Radeon 9200 | BCM4311 Apple Airport | OSX 10.5.7
Mac Mini G4 | PPC G4 7447A 1.42Ghz | 1GB DDR1 | 100GB HDD | AC97 audio | ATI Radeon 9200 | BCM Bluetooth (BTO) | OSX 10.5.7 + ubuntu 8.04
ZAFFE
post Oct 7 2010, 01:34 PM
Post #9
don't work for me sad.gif

Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: