help

杜文冲 chonghui1001 at 163.com
Thu Oct 25 15:55:54 UTC 2012







--
杜文冲:武汉理工大学计算机科学与技术学院科学与技术专业0802班
E-mail:  chonghui1001 at 163.com
电话:  027-86581598
手机 : 13657280101



At 2012-10-24 18:33:25,kernel-team-request at lists.ubuntu.com wrote:
>Send kernel-team mailing list submissions to
>	kernel-team at lists.ubuntu.com
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	https://lists.ubuntu.com/mailman/listinfo/kernel-team
>or, via email, send a message with subject or body 'help' to
>	kernel-team-request at lists.ubuntu.com
>
>You can reach the person managing the list at
>	kernel-team-owner at lists.ubuntu.com
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of kernel-team digest..."
>
>
>Today's Topics:
>
>   1. [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all but
>      armel/armhf (Tim Gardner)
>   2. Re: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth: Getting ID
>      from	descriptor instead of matched rule (Brad Figg)
>   3. Ack: Re: [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all
>      but	armel/armhf (Herton Ronaldo Krzesinski)
>   4. APPLIED: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth:
>      Getting ID	from descriptor instead of matched rule (Tim Gardner)
>   5. APPLIED: [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all
>      but	armel/armhf (Tim Gardner)
>   6. Re: APPLIED: [RFC][Precise][PATCH 0/2] UBUNTU: SAUCE:
>      Bluetooth:	Support for loading Broadcom bluetooth firmware
>      (Tim Gardner)
>   7. NAK: [PATCH Quantal SRU] Revert "UBUNTU: [Config] Disable
>      vt6656" (Tim Gardner)
>   8. The Daily Bug Report for Wednesday, 24. October 2012 05:41
>      UTC (brad.figg at canonical.com)
>   9. Re: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth: Getting ID
>      from	descriptor instead of matched rule (Jesse Sung)
>  10. [Quantal][PATCH 1/3] UBUNTU: SAUCE: Bluetooth: Add a
>      load_firmware	callback to struct hci_dev (Jesse Sung)
>  11. [Quantal][PATCH 2/3] UBUNTU: SAUCE: Bluetooth: Implement
>      broadcom	patchram firmware loader (Jesse Sung)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Tue, 23 Oct 2012 08:56:37 -0600
>From: Tim Gardner <tim.gardner at canonical.com>
>To: kernel-team at lists.ubuntu.com
>Subject: [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all but
>	armel/armhf
>Message-ID:
>	<1351004197-5434-1-git-send-email-tim.gardner at canonical.com>
>
>BugLink: http://bugs.launchpad.net/bugs/1047527
>
>This restores OTG behavior as it is in Precise.
>
>Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
>---
> debian.master/config/amd64/config.common.amd64     |    1 +
> debian.master/config/armel/config.common.armel     |    1 +
> debian.master/config/armhf/config.common.armhf     |    1 +
> debian.master/config/config.common.ubuntu          |    1 -
> debian.master/config/i386/config.common.i386       |    1 +
> debian.master/config/powerpc/config.common.powerpc |    1 +
> debian.master/config/ppc64/config.common.ppc64     |    1 +
> 7 files changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/debian.master/config/amd64/config.common.amd64 b/debian.master/config/amd64/config.common.amd64
>index 23a18ff..db194af 100644
>--- a/debian.master/config/amd64/config.common.amd64
>+++ b/debian.master/config/amd64/config.common.amd64
>@@ -246,6 +246,7 @@ CONFIG_USB_MUSB_TUSB6010=m
> # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
> # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
> CONFIG_USB_OHCI_HCD_PLATFORM=y
>+# CONFIG_USB_OTG is not set
> CONFIG_VFAT_FS=y
> CONFIG_VGASTATE=m
> CONFIG_VGA_ARB_MAX_GPUS=16
>diff --git a/debian.master/config/armel/config.common.armel b/debian.master/config/armel/config.common.armel
>index e76ed0a..a7b5ba6 100644
>--- a/debian.master/config/armel/config.common.armel
>+++ b/debian.master/config/armel/config.common.armel
>@@ -246,6 +246,7 @@ CONFIG_USB_MUSB_HDRC=m
> # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
> # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
> # CONFIG_USB_OHCI_HCD_PLATFORM is not set
>+CONFIG_USB_OTG=y
> CONFIG_VFAT_FS=y
> # CONFIG_VGASTATE is not set
> # CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
>diff --git a/debian.master/config/armhf/config.common.armhf b/debian.master/config/armhf/config.common.armhf
>index 58fa449..ca4e604 100644
>--- a/debian.master/config/armhf/config.common.armhf
>+++ b/debian.master/config/armhf/config.common.armhf
>@@ -92,6 +92,7 @@ CONFIG_TWL4030_USB=y
> # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
> # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
> # CONFIG_USB_OHCI_HCD_PLATFORM is not set
>+CONFIG_USB_OTG=y
> CONFIG_VFAT_FS=y
> # CONFIG_VGASTATE is not set
> # CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
>diff --git a/debian.master/config/config.common.ubuntu b/debian.master/config/config.common.ubuntu
>index 44b36e4..473591a 100644
>--- a/debian.master/config/config.common.ubuntu
>+++ b/debian.master/config/config.common.ubuntu
>@@ -5912,7 +5912,6 @@ CONFIG_USB_OHCI_HCD_PPC_OF=y
> CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
> CONFIG_USB_OHCI_LITTLE_ENDIAN=y
> # CONFIG_USB_OMAP is not set
>-CONFIG_USB_OTG=y
> # CONFIG_USB_OTG_BLACKLIST_HUB is not set
> CONFIG_USB_OTG_UTILS=y
> # CONFIG_USB_OTG_WHITELIST is not set
>diff --git a/debian.master/config/i386/config.common.i386 b/debian.master/config/i386/config.common.i386
>index 0dd1848..d1bb7fd 100644
>--- a/debian.master/config/i386/config.common.i386
>+++ b/debian.master/config/i386/config.common.i386
>@@ -245,6 +245,7 @@ CONFIG_USB_MUSB_TUSB6010=m
> # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
> # CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
> CONFIG_USB_OHCI_HCD_PLATFORM=y
>+# CONFIG_USB_OTG is not set
> CONFIG_VFAT_FS=y
> CONFIG_VGASTATE=m
> CONFIG_VGA_ARB_MAX_GPUS=16
>diff --git a/debian.master/config/powerpc/config.common.powerpc b/debian.master/config/powerpc/config.common.powerpc
>index 5a41232..9ee3c7e 100644
>--- a/debian.master/config/powerpc/config.common.powerpc
>+++ b/debian.master/config/powerpc/config.common.powerpc
>@@ -239,6 +239,7 @@ CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
> CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
> CONFIG_USB_OHCI_HCD_PLATFORM=y
> # CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
>+# CONFIG_USB_OTG is not set
> CONFIG_VFAT_FS=m
> CONFIG_VGASTATE=m
> CONFIG_VGA_ARB_MAX_GPUS=16
>diff --git a/debian.master/config/ppc64/config.common.ppc64 b/debian.master/config/ppc64/config.common.ppc64
>index fd03351..6e5f058 100644
>--- a/debian.master/config/ppc64/config.common.ppc64
>+++ b/debian.master/config/ppc64/config.common.ppc64
>@@ -274,6 +274,7 @@ CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
> CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
> CONFIG_USB_OHCI_HCD_PLATFORM=y
> CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
>+# CONFIG_USB_OTG is not set
> CONFIG_VFAT_FS=m
> CONFIG_VGASTATE=m
> CONFIG_VGA_ARB_MAX_GPUS=64
>-- 
>1.7.9.5
>
>
>
>
>------------------------------
>
>Message: 2
>Date: Tue, 23 Oct 2012 08:18:55 -0700
>From: Brad Figg <brad.figg at canonical.com>
>To: Jesse Sung <jesse.sung at canonical.com>
>Cc: kernel-team at lists.ubuntu.com
>Subject: Re: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth: Getting ID
>	from	descriptor instead of matched rule
>Message-ID: <5086B55F.8050406 at canonical.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>On 10/23/2012 02:05 AM, Jesse Sung wrote:
>> From: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>>
>> BugLink: https://launchpad.net/bugs/1065400
>>
>> Since the matched rule could be specified by
>> USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE(),
>> use the ID in descriptor to make sure we can really get
>> the correct one.
>>
>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>> ---
>>   drivers/bluetooth/btusb.c |    3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 96baae6..ba88eb4 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -944,7 +944,8 @@ static void btusb_load_firmware(struct hci_dev *hdev)
>>   		return;
>>
>>   	snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
>> -			id->idVendor, id->idProduct);
>> +			le16_to_cpu(udev->descriptor.idVendor),
>> +			le16_to_cpu(udev->descriptor.idProduct));
>>   	if (request_firmware(&fw, (const char *) filename, &udev->dev) < 0) {
>>   		BT_INFO("can't load firmware, may not work correctly");
>>   		return;
>>
>
>Have these patches been sent upstream?
>
>-- 
>Brad Figg brad.figg at canonical.com http://www.canonical.com
>
>
>
>------------------------------
>
>Message: 3
>Date: Tue, 23 Oct 2012 13:55:05 -0200
>From: Herton Ronaldo Krzesinski <herton.krzesinski at canonical.com>
>To: Tim Gardner <tim.gardner at canonical.com>
>Cc: kernel-team at lists.ubuntu.com
>Subject: Ack: Re: [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all
>	but	armel/armhf
>Message-ID: <20121023155505.GA3024 at herton-Z68MA-D2H-B3>
>Content-Type: text/plain; charset=us-ascii
>
>
>-- 
>[]'s
>Herton
>
>
>
>------------------------------
>
>Message: 4
>Date: Tue, 23 Oct 2012 10:03:38 -0600
>From: Tim Gardner <tim.gardner at canonical.com>
>To: Jesse Sung <jesse.sung at canonical.com>
>Cc: kernel-team at lists.ubuntu.com
>Subject: APPLIED: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth:
>	Getting ID	from descriptor instead of matched rule
>Message-ID: <5086BFDA.3080804 at canonical.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>-- 
>Tim Gardner tim.gardner at canonical.com
>
>
>
>------------------------------
>
>Message: 5
>Date: Tue, 23 Oct 2012 10:12:06 -0600
>From: Tim Gardner <tim.gardner at canonical.com>
>To: kernel-team at lists.ubuntu.com
>Subject: APPLIED: [PATCH] UBUNTU: [Config] CONFIG_USB_OTG=n for all
>	but	armel/armhf
>Message-ID: <5086C1D6.4090304 at canonical.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
>-- 
>Tim Gardner tim.gardner at canonical.com
>
>
>
>------------------------------
>
>Message: 6
>Date: Tue, 23 Oct 2012 10:20:09 -0600
>From: Tim Gardner <tim.gardner at canonical.com>
>To: Jesse Sung <jesse.sung at canonical.com>
>Cc: kernel-team at lists.ubuntu.com
>Subject: Re: APPLIED: [RFC][Precise][PATCH 0/2] UBUNTU: SAUCE:
>	Bluetooth:	Support for loading Broadcom bluetooth firmware
>Message-ID: <5086C3B9.8060402 at canonical.com>
>Content-Type: text/plain; charset=UTF-8; format=flowed
>
>On 10/23/2012 02:59 AM, Jesse Sung wrote:
>> 2012/10/23 Tim Gardner <tim.gardner at canonical.com>:
>>> What would you like to do about Quantal and Raring ?
>>
>> Thank you. :)
>>
>> There are two more patches needed for this issue, I'll send them out later.
>> Also I'll send out a series of patches against Quantal.
>>
>> For Raring, should we keep this issue open for now, to see if we can
>> get a long-term solution from upstream before Raring is released?
>>
>
>You'll have to get it done in time for the 3.8 merge window, which means 
>cooking in linux-next for at least a week or so.
>
>rtg
>-- 
>Tim Gardner tim.gardner at canonical.com
>
>
>
>------------------------------
>
>Message: 7
>Date: Tue, 23 Oct 2012 14:42:21 -0600
>From: Tim Gardner <tim.gardner at canonical.com>
>To: kernel-team at lists.ubuntu.com
>Subject: NAK: [PATCH Quantal SRU] Revert "UBUNTU: [Config] Disable
>	vt6656"
>Message-ID: <5087012D.6090901 at canonical.com>
>Content-Type: text/plain; charset=ISO-8859-1
>
>On 10/19/2012 12:22 PM, Tim Gardner wrote:
>> This reverts commit 05276ce80836e944e77fff141ce3fb717663ddc6.
>> 
>> BugLink: http://bugs.launchpad.net/bugs/162671
>> 
>> Seems this was carried over from Oneiric->Precise
>> 
>> Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
>> ---
>>  drivers/staging/Makefile |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
>> index 3b32dd9..a987b3a 100644
>> --- a/drivers/staging/Makefile
>> +++ b/drivers/staging/Makefile
>> @@ -27,7 +27,7 @@ obj-$(CONFIG_LINE6_USB)		+= line6/
>>  obj-$(CONFIG_USB_SERIAL_QUATECH2)	+= serqt_usb2/
>>  obj-$(CONFIG_OCTEON_ETHERNET)	+= octeon/
>>  obj-$(CONFIG_VT6655)		+= vt6655/
>> -#obj-$(CONFIG_VT6656)		+= vt6656/
>> +obj-$(CONFIG_VT6656)		+= vt6656/
>>  obj-$(CONFIG_VME_BUS)		+= vme/
>>  obj-$(CONFIG_IPACK_BUS)		+= ipack/
>>  obj-$(CONFIG_DX_SEP)            += sep/
>> 
>
>I'm going retract this patch until this staging driver is sufficiently
>stable that it can run a 64bit instance.
>
>See
>https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/162671/comments/81
>
>rtg
>-- 
>Tim Gardner tim.gardner at canonical.com
>
>
>
>------------------------------
>
>Message: 8
>From: brad.figg at canonical.com
>To: kernel-team at lists.ubuntu.com
>Subject: The Daily Bug Report for Wednesday, 24. October 2012 05:41
>	UTC
>Message-ID:
>	<mailman.36871.1351074806.1124.kernel-team at lists.ubuntu.com>
>Content-Type: text/plain; charset="us-ascii"
>
>The Daily Bug Report
>Wednesday, 24. October 2012 05:41 UTC
>
>The linux package acquired 12 new bugs in the last 24 hrs.
>
>Bug       Title                                                           Series      Importance      Status           Assignee
>-------   ------------------------------------------------------------    --------    ------------    -------------    ---------------------
>1052530   Slowdown after Kernel upgrade?                                  lucid       Medium          Incomplete       Unassigned
>1070199   [ASUS K53BR] bluetooth doesn't work                             quantal     Medium          Confirmed        Anthony Wong
>1070232   Login screen is completely black but functional with kern...    quantal     Medium          Incomplete       Unassigned
>1070249   [ASUS K53BR] HDMI audio doesn't work                            quantal     Medium          Confirmed        Anthony Wong
>1070253   Ubuntu 12.10 keeps crashing with kernel 3.5 (not with 3.2)      quantal     High            Incomplete       Unassigned
>1070366   Black screen: "unable to handle kernel NULL pointer deref...    quantal     Medium          Incomplete       Unassigned
>1070389   Ubuntu bugs                                                     quantal     Undecided       New              Unassigned
>1070453   ASIX USB-Ethernet driver noticably slow, dropping packets...    quantal     Medium          Incomplete       Unassigned
>1070627   Can't resume from suspend on HP Pavilion dv7                    precise     Medium          Incomplete       Unassigned
>1070656   kernel 3.5.0-17-generic crashes xorg-intel (drm) 10 times...    quantal     Undecided       Confirmed        Unassigned
>1070676   linux ubuntu bug                                                quantal     Undecided       New              Unassigned
>951990    BUG: unable to handle kernel paging request at 0000400414...    precise     Undecided       Incomplete       Unassigned
>
>An online version of this report can be found at: http://people.canonical.com/~kernel/reports/1-day-new.html
>
>
>
>The Top 10 Hot List Bugs (based on bug heat)
>
>Bug       Title                                                           Series      Importance      Status           Heat     Assignee
>-------   ------------------------------------------------------------    --------    ------------    -------------    -----    ---------------------
>1056969   USB accessories stop working                                    precise     High            Incomplete       12       Seth Forshee
>1016170   No login screen unless "quiet splash" removed from boot line    quantal     High            Confirmed        10       Unknown
>
>The full Kernel Team Host List can be found at: http://people.canonical.com/~kernel/reports/_kernel_hot_.html
>
>
>
>------------------------------
>
>Message: 9
>Date: Wed, 24 Oct 2012 17:39:36 +0800
>From: Jesse Sung <jesse.sung at canonical.com>
>To: Brad Figg <brad.figg at canonical.com>
>Cc: kernel-team at lists.ubuntu.com
>Subject: Re: [Precise][PATCH 1/2] UBUNTU: SAUCE: Bluetooth: Getting ID
>	from	descriptor instead of matched rule
>Message-ID:
>	<CAH10aOg-u5dkis9deGTLzd3d-5b_Y_B+aZZL7DT-GWgp5zCO9w at mail.gmail.com>
>Content-Type: text/plain; charset=UTF-8
>
>2012/10/23 Brad Figg <brad.figg at canonical.com>:
>> On 10/23/2012 02:05 AM, Jesse Sung wrote:
>>>
>>> From: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>>>
>>> BugLink: https://launchpad.net/bugs/1065400
>>>
>>> Since the matched rule could be specified by
>>> USB_VENDOR_AND_INTERFACE_INFO() instead of USB_DEVICE(),
>>> use the ID in descriptor to make sure we can really get
>>> the correct one.
>>>
>>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>>> ---
>>>   drivers/bluetooth/btusb.c |    3 ++-
>>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>>> index 96baae6..ba88eb4 100644
>>> --- a/drivers/bluetooth/btusb.c
>>> +++ b/drivers/bluetooth/btusb.c
>>> @@ -944,7 +944,8 @@ static void btusb_load_firmware(struct hci_dev *hdev)
>>>                 return;
>>>
>>>         snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
>>> -                       id->idVendor, id->idProduct);
>>> +                       le16_to_cpu(udev->descriptor.idVendor),
>>> +                       le16_to_cpu(udev->descriptor.idProduct));
>>>         if (request_firmware(&fw, (const char *) filename, &udev->dev) <
>>> 0) {
>>>                 BT_INFO("can't load firmware, may not work correctly");
>>>                 return;
>>>
>>
>> Have these patches been sent upstream?
>
>These are against previous broadcom patchram patches, which are rejected
>by upstream [1]. So they will not be sent upstream.
>
>[1] http://marc.info/?t=134933604300005&r=1&w=2
>
>
>
>------------------------------
>
>Message: 10
>Date: Wed, 24 Oct 2012 18:32:54 +0800
>From: Jesse Sung <jesse.sung at canonical.com>
>To: kernel-team at lists.ubuntu.com
>Subject: [Quantal][PATCH 1/3] UBUNTU: SAUCE: Bluetooth: Add a
>	load_firmware	callback to struct hci_dev
>Message-ID:
>	<1351074776-5182-1-git-send-email-jesse.sung at canonical.com>
>
>From: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>
>BugLink: https://launchpad.net/bugs/1065400
>
>load_firmware will be called at the end of hci_dev_open() if it
>is defined. How, when, and the mutual exclusion for firmware loading
>is inplemented in device driver.
>
>Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>---
> include/net/bluetooth/hci_core.h |    1 +
> net/bluetooth/hci_core.c         |    2 ++
> 2 files changed, 3 insertions(+)
>
>diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
>index 9fc7728..c278d6a 100644
>--- a/include/net/bluetooth/hci_core.h
>+++ b/include/net/bluetooth/hci_core.h
>@@ -282,6 +282,7 @@ struct hci_dev {
> 	int (*send)(struct sk_buff *skb);
> 	void (*notify)(struct hci_dev *hdev, unsigned int evt);
> 	int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
>+	void (*load_firmware)(struct hci_dev *hdev);
> };
> 
> struct hci_conn {
>diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
>index 730ff46..074a842 100644
>--- a/net/bluetooth/hci_core.c
>+++ b/net/bluetooth/hci_core.c
>@@ -744,6 +744,8 @@ int hci_dev_open(__u16 dev)
> done:
> 	hci_req_unlock(hdev);
> 	hci_dev_put(hdev);
>+	if (!ret && hdev->load_firmware)
>+		hdev->load_firmware(hdev);
> 	return ret;
> }
> 
>-- 
>1.7.10.4
>
>
>
>
>------------------------------
>
>Message: 11
>Date: Wed, 24 Oct 2012 18:32:55 +0800
>From: Jesse Sung <jesse.sung at canonical.com>
>To: kernel-team at lists.ubuntu.com
>Subject: [Quantal][PATCH 2/3] UBUNTU: SAUCE: Bluetooth: Implement
>	broadcom	patchram firmware loader
>Message-ID:
>	<1351074776-5182-2-git-send-email-jesse.sung at canonical.com>
>
>From: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>
>BugLink: https://launchpad.net/bugs/1065400
>
>There is an user space firmware loading tool which can be found at
>http://marc.info/?l=linux-bluetooth&m=132039175324993&w=2
>
>This tool requires hci device to do the firmware loading, but this
>may cause some race condition between patchram tool and bluetoothd
>or something that also works on hci interface.
>
>Also it needs some hooks to make firmware loads after bootup, s3,
>s4, rfkill, and device hotplug events. Implement this loader in kernel
>module would make things more easier.
>
>The supported firmware is in hcd format, which is a collection of
>hci commands. The download process would be:
>1. reset command
>2. download command
>3. firmware image in hcd file
>4. reset command
>
>/sys/kernel/debug/usb/devices before loading firmware:
>T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
>D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
>P:  Vendor=0a5c ProdID=21d3 Rev= 1.12
>S:  Manufacturer=Broadcom Corp
>S:  Product=BCM43142A0
>S:  SerialNumber=3859F9D6199A
>C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
>I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
>E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
>I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
>I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
>I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
>I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
>I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
>I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
>E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
>E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
>I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
>
>/sys/kernel/debug/usb/devices after loading firmware:
>T:  Bus=01 Lev=02 Prnt=02 Port=04 Cnt=02 Dev#=  4 Spd=12   MxCh= 0
>D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
>P:  Vendor=0a5c ProdID=21d3 Rev= 1.12
>S:  Manufacturer=Broadcom Corp
>S:  Product=BCM43142A0
>S:  SerialNumber=3859F9D6199A
>C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
>I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
>E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
>I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
>I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
>I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
>I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
>I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
>I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
>E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
>E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
>I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
>E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
>E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
>I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
>
>Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>
>---
> drivers/bluetooth/btusb.c |   78 +++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 75 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>index 71d80bf..6e09ca3 100644
>--- a/drivers/bluetooth/btusb.c
>+++ b/drivers/bluetooth/btusb.c
>@@ -31,6 +31,8 @@
> #include <linux/skbuff.h>
> 
> #include <linux/usb.h>
>+#include <linux/delay.h>
>+#include <linux/firmware.h>
> 
> #include <net/bluetooth/bluetooth.h>
> #include <net/bluetooth/hci_core.h>
>@@ -55,6 +57,7 @@ static struct usb_driver btusb_driver;
> #define BTUSB_BROKEN_ISOC	0x20
> #define BTUSB_WRONG_SCO_MTU	0x40
> #define BTUSB_ATH3012		0x80
>+#define BTUSB_BCM_PATCHRAM	0x100
> 
> static struct usb_device_id btusb_table[] = {
> 	/* Generic Bluetooth USB device */
>@@ -105,13 +108,13 @@ static struct usb_device_id btusb_table[] = {
> 
> 	/* Broadcom BCM20702A0 */
> 	{ USB_DEVICE(0x0489, 0xe042) },
>-	{ USB_DEVICE(0x413c, 0x8197) },
>+	{ USB_DEVICE(0x413c, 0x8197), .driver_info = BTUSB_BCM_PATCHRAM },
> 
> 	/* Foxconn - Hon Hai */
>-	{ USB_VENDOR_AND_INTERFACE_INFO(0x0489, 0xff, 0x01, 0x01) },
>+	{ USB_VENDOR_AND_INTERFACE_INFO(0x0489, 0xff, 0x01, 0x01), .driver_info = BTUSB_BCM_PATCHRAM },
> 
> 	/*Broadcom devices with vendor specific id */
>-	{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) },
>+	{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01), .driver_info = BTUSB_BCM_PATCHRAM },
> 
> 	{ }	/* Terminating entry */
> };
>@@ -212,12 +215,14 @@ static struct usb_device_id blacklist_table[] = {
> #define BTUSB_ISOC_RUNNING	2
> #define BTUSB_SUSPENDING	3
> #define BTUSB_DID_ISO_RESUME	4
>+#define BTUSB_FIRMWARE_DONE	5
> 
> struct btusb_data {
> 	struct hci_dev       *hdev;
> 	struct usb_device    *udev;
> 	struct usb_interface *intf;
> 	struct usb_interface *isoc;
>+	const struct usb_device_id *id;
> 
> 	spinlock_t lock;
> 
>@@ -922,6 +927,70 @@ static void btusb_waker(struct work_struct *work)
> 	usb_autopm_put_interface(data->intf);
> }
> 
>+#define PATCHRAM_TIMEOUT	1000
>+#define PATCHRAM_NAME_LEN	20
>+
>+static void btusb_load_firmware(struct hci_dev *hdev)
>+{
>+	struct btusb_data *data = hci_get_drvdata(hdev);
>+	struct usb_device *udev = data->udev;
>+	const struct usb_device_id *id = data->id;
>+	size_t pos = 0;
>+	int err = 0;
>+	char filename[PATCHRAM_NAME_LEN];
>+	const struct firmware *fw;
>+
>+	unsigned char reset_cmd[] = { 0x03, 0x0c, 0x00 };
>+	unsigned char download_cmd[] = { 0x2e, 0xfc, 0x00 };
>+
>+	if (!(id->driver_info & BTUSB_BCM_PATCHRAM))
>+		return;
>+	if (test_and_set_bit(BTUSB_FIRMWARE_DONE, &data->flags))
>+		return;
>+
>+	snprintf(filename, PATCHRAM_NAME_LEN, "fw-%04x_%04x.hcd",
>+			le16_to_cpu(udev->descriptor.idVendor),
>+			le16_to_cpu(udev->descriptor.idProduct));
>+	if (request_firmware(&fw, (const char *) filename, &udev->dev) < 0) {
>+		BT_INFO("can't load firmware, may not work correctly");
>+		return;
>+	}
>+
>+	if (usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, USB_TYPE_CLASS, 0, 0,
>+		reset_cmd, sizeof(reset_cmd), PATCHRAM_TIMEOUT) < 0) {
>+		err = -1;
>+		goto out;
>+	}
>+	msleep(300);
>+
>+	if (usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, USB_TYPE_CLASS, 0, 0,
>+		download_cmd, sizeof(download_cmd), PATCHRAM_TIMEOUT) < 0) {
>+		err = -1;
>+		goto out;
>+	}
>+	msleep(300);
>+
>+	while (pos < fw->size) {
>+		size_t len;
>+		len = fw->data[pos + 2] + 3;
>+		if ((pos + len > fw->size) ||
>+			(usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0,
>+			USB_TYPE_CLASS, 0, 0, (void *)fw->data + pos, len,
>+			PATCHRAM_TIMEOUT) < 0)) {
>+			err = -1;
>+			goto out;
>+		}
>+		pos += len;
>+	}
>+
>+	err = (usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, USB_TYPE_CLASS, 0, 0,
>+		reset_cmd, sizeof(reset_cmd), PATCHRAM_TIMEOUT) < 0);
>+out:
>+	if (err)
>+		BT_INFO("fail to load firmware, may not work correctly");
>+	release_firmware(fw);
>+}
>+
> static int btusb_probe(struct usb_interface *intf,
> 				const struct usb_device_id *id)
> {
>@@ -1009,6 +1078,8 @@ static int btusb_probe(struct usb_interface *intf,
> 	init_usb_anchor(&data->isoc_anchor);
> 	init_usb_anchor(&data->deferred);
> 
>+	data->id = id;
>+
> 	hdev = hci_alloc_dev();
> 	if (!hdev) {
> 		kfree(data);
>@@ -1027,6 +1098,7 @@ static int btusb_probe(struct usb_interface *intf,
> 	hdev->flush    = btusb_flush;
> 	hdev->send     = btusb_send_frame;
> 	hdev->notify   = btusb_notify;
>+	hdev->load_firmware = btusb_load_firmware;
> 
> 	/* Interface numbers are hardcoded in the specification */
> 	data->isoc = usb_ifnum_to_if(data->udev, 1);
>-- 
>1.7.10.4
>
>
>
>
>------------------------------
>
>-- 
>kernel-team mailing list
>kernel-team at lists.ubuntu.com
>https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
>
>End of kernel-team Digest, Vol 93, Issue 53
>*******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20121025/12d6e84d/attachment.html>


More information about the kernel-team mailing list