ath9k_htc oddity
I've been using the ethool -i output a lot recently and have been very much enjoying it, however I've noticed some oddity. My ath9k_htc card, Ubiquiti Wifistation-EXT, doesn't have good output while using compat-wireless stable 2.6.39-rc1.
flea scripts # ethtool -i wlan15
driver: usb
version: 2.6.37-pentoo-r6-grsec
firmware-version: N/A
bus-info: 2-5
Not only is the driver listed incorrectly, but the firmware-version is not listed at all. Is it just me?
[ 861.541279] usb 2-5: new high speed USB device using ehci_hcd and address 6 [ 861.976633] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 862.244517] usb 2-5: ath9k_htc: HTC initialized with 33 credits [ 862.661693] ath: EEPROM regdomain: 0x0 [ 862.661698] ath: EEPROM indicates default country code should be used [ 862.661701] ath: doing EEPROM country->regdmn map search [ 862.661705] ath: country maps to regdmn code: 0x3a [ 862.661708] ath: Country alpha2 being used: US [ 862.661711] ath: Regpair used: 0x3a ...removed cfg80211 regdomain stuff... [ 862.663179] ieee80211 phy3: Atheros AR9271 Rev:1 [ 862.664976] Registered led device: ath9k-phy3::radio [ 862.664999] Registered led device: ath9k-phy3::assoc [ 862.665141] Registered led device: ath9k-phy3::tx [ 862.665163] Registered led device: ath9k-phy3::rx [ 862.665166] usb 2-5: ath9k_htc: USB layer initialized
Thanks,
Rick Farina
Quoted 12 lines · Richard Farina
I've been using the ethool -i output a lot recently and have been very much enjoying it, however I've noticed some oddity. My
ath9k_htccard, Ubiquiti Wifistation-EXT, doesn't have good output while using compat-wireless stable 2.6.39-rc1.flea scripts # ethtool -i wlan15
driver: usb
version: 2.6.37-pentoo-r6-grsec
firmware-version: N/A
bus-info: 2-5
Quoted 2 lines
Not only is the driver listed incorrectly, but the firmware-version is not listed at all. Is it just me?
The driver name/bus-info is wrong because the wrong device pointer is used when registering the wireless device.
The firmware version is N/A because, well, the FW has no version. :)
I have a patch queued up and ethtool show this now:
(This requires a FW update ...)
sujith@atheros-dev ~ $ ethtool -i wlan0
driver: ath9k_htc
version: 2.6.39-rc2-wl
firmware-version: 1.0
bus-info: 1-3:1.0
commit d3ce084bd9ce550d80fc0e92dd91393ca02d3429
Author: Sujith Manoharan <[email protected]> Date: Wed Apr 6 09:23:50 2011 +0530
ath9k_htc: Add a WMI command to get the firmware version
Also, update the wiphy information and use the correct device pointer when registering. This would fix ethtool.
drivers/net/wireless/ath/ath9k/hif_usb.c +2 -2
@@ -1035,7 +1035,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, } ret =ath9k_htc_hw_init (hif_dev->htc_handle, - &hif_dev->udev->dev, hif_dev->device_id, + &interface->dev, hif_dev->device_id, hif_dev->udev->product, id->driver_info);if (ret) { ret = -EINVAL ;
@@ -1153,7 +1153,7 @@ fail_resume:#endif static struct usb_driver ath9k_hif_usb_driver = { - .name ="ath9k_hif_usb" , + .name =KBUILD_MODNAME , .probe = ath9k_hif_usb_probe, .disconnect = ath9k_hif_usb_disconnect, #ifdef CONFIG_PM
drivers/net/wireless/ath/ath9k/htc.h +3 -0
@@ -388,6 +388,9 @@ struct ath9k_htc_priv {struct htc_target *htc;struct wmi *wmi; +u16 fw_version_major; +u16 fw_version_minor; +enum htc_endpoint_id wmi_cmd_ep;enum htc_endpoint_id beacon_ep;enum htc_endpoint_id cab_ep;
drivers/net/wireless/ath/ath9k/htc_drv_init.c +32 -0
@@ -782,6 +782,32 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,SET_IEEE80211_PERM_ADDR (hw, common->macaddr); } +static int ath9k_init_firmware_version (struct ath9k_htc_priv *priv) +{ +struct ieee80211_hw *hw = priv->hw; +struct wmi_fw_version cmd_rsp; +int ret; + +memset (&cmd_rsp,0 ,sizeof (cmd_rsp)); + +WMI_CMD (WMI_GET_FW_VERSION ); +if (ret) +return -EINVAL ; + + priv->fw_version_major =be16_to_cpu (cmd_rsp.major); + priv->fw_version_minor =be16_to_cpu (cmd_rsp.minor); + +snprintf (hw->wiphy->fw_version,ETHTOOL_BUSINFO_LEN ,"%d.%d" , + priv->fw_version_major, + priv->fw_version_minor); + +dev_info (priv->dev,"ath9k_htc: FW Version: %d.%d\n" , + priv->fw_version_major, + priv->fw_version_minor); + +return 0 ; +} +static int ath9k_init_device (struct ath9k_htc_priv *priv,u16 devid,char *product,u32 drv_info) {
@@ -801,6 +827,10 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv, common =ath9k_hw_common (ah);ath9k_set_hw_capab (priv, hw); + error =ath9k_init_firmware_version (priv); +if (error !=0 ) + goto err_fw; +/* Initialize regulatory */ error =ath_regd_init (&common->regulatory, priv->hw->wiphy, ath9k_reg_notifier);
@@ -861,6 +891,8 @@ err_rx: err_tx:/* Nothing */ err_regd: +/* Nothing */ +err_fw:ath9k_deinit_priv (priv); err_init:return error;
drivers/net/wireless/ath/ath9k/wmi.c +2 -0
@@ -23,6 +23,8 @@ static const char *wmi_cmd_to_name(enum wmi_cmd_id wmi_cmd)return "WMI_ECHO_CMDID" ;case WMI_ACCESS_MEMORY_CMDID :return "WMI_ACCESS_MEMORY_CMDID" ; +case WMI_GET_FW_VERSION : +return "WMI_GET_FW_VERSION" ;case WMI_DISABLE_INTR_CMDID :return "WMI_DISABLE_INTR_CMDID" ;case WMI_ENABLE_INTR_CMDID :
drivers/net/wireless/ath/ath9k/wmi.h +6 -0
@@ -31,11 +31,17 @@ struct wmi_cmd_hdr {__be16 seq_no; } __packed; +struct wmi_fw_version { +__be16 major; +__be16 minor; + +} __packed;enum wmi_cmd_id {WMI_ECHO_CMDID =0x0001 ,WMI_ACCESS_MEMORY_CMDID ,/* Commands to Target */ +WMI_GET_FW_VERSION ,WMI_DISABLE_INTR_CMDID ,WMI_ENABLE_INTR_CMDID ,WMI_RX_LINK_CMDID ,
Quoted 20 lines · Sujith
Quoted 12 lines · Richard Farina
I've been using the ethool -i output a lot recently and have been very much enjoying it, however I've noticed some oddity. My
ath9k_htccard, Ubiquiti Wifistation-EXT, doesn't have good output while using compat-wireless stable 2.6.39-rc1.flea scripts # ethtool -i wlan15
driver: usb
version: 2.6.37-pentoo-r6-grsec
firmware-version: N/A
bus-info: 2-5Quoted 2 lines
Not only is the driver listed incorrectly, but the firmware-version is not listed at all. Is it just me?
The driver name/bus-info is wrong because the wrong device pointer is used when registering the wireless device.
The firmware version is N/A because, well, the FW has no version. :)
Quoted 8 lines
I have a patch queued up and ethtool show this now:
(This requires a FW update ...)sujith@atheros-dev ~ $ ethtool -i wlan0
driver:ath9k_htc
version: 2.6.39-rc2-wl
firmware-version: 1.0
bus-info: 1-3:1.0
The following commit causes extreme sadness:
[ 4094.241243] usb 2-5: new high speed USB device using ehci_hcd and address 3 [ 4095.550452] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4095.816072] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 credits [ 4159.812888] usb 2-5: USB disconnect, address 3 [ 4159.929317] ath: Couldn't reset chip [ 4159.929321] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929323] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929340] Failed to initialize the device [ 4160.012603] ath9k_htc: probe of 2-5:1.0 failed with error -22 [ 4160.012771] usbcore: registered new interface driver ath9k_htc [ 4163.595059] usb 2-5: new high speed USB device using ehci_hcd and address 4 [ 4164.018920] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4164.284420] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 credits
I'm guessing because I need the mentioned firmware update? Where can I get it? Or better yet can you (this is almost laughable considering the ralink thread right now) get it into linux-firmware? Or is the needed firmware update an unstable thing?
Either way I can wait on the firmware-version fix but where can I find the patch that shows fixes the "driver: usb" issue? Your obviously shows properly :-)
Thanks,
Rick Farina
Quoted 142 lines
commit
d3ce084bd9ce550d80fc0e92dd91393ca02d3429Author: Sujith Manoharan<[email protected]> Date: Wed Apr 6 09:23:50 2011 +0530
ath9k_htc: Add a WMI command to get the firmware versionAlso, update the wiphy information and use the correct device pointer when registering. This would fix ethtool.
Signed-off-by Sujith Manoharan<[email protected]>drivers/net/wireless/ath/ath9k/hif_usb.c +2
-2@@ -1035,7 +1035,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface, } ret =ath9k_htc_hw_init (hif_dev->htc_handle, - &hif_dev->udev->dev, hif_dev->device_id, + &interface->dev, hif_dev->device_id, hif_dev->udev->product, id->driver_info);if (ret) { ret = -EINVAL ;@@ -1153,7 +1153,7 @@ fail_resume:#endif static struct usb_driver ath9k_hif_usb_driver = { - .name ="ath9k_hif_usb" , + .name =KBUILD_MODNAME , .probe = ath9k_hif_usb_probe, .disconnect = ath9k_hif_usb_disconnect, #ifdef CONFIG_PMdrivers/net/wireless/ath/ath9k/htc.h +3
-0@@ -388,6 +388,9 @@ struct ath9k_htc_priv {struct htc_target *htc;struct wmi *wmi; +u16 fw_version_major; +u16 fw_version_minor; +enum htc_endpoint_id wmi_cmd_ep;enum htc_endpoint_id beacon_ep;enum htc_endpoint_id cab_ep;drivers/net/wireless/ath/ath9k/htc_drv_init.c +32
-0@@ -782,6 +782,32 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,SET_IEEE80211_PERM_ADDR (hw, common->macaddr); } +static int ath9k_init_firmware_version (struct ath9k_htc_priv *priv) +{ +struct ieee80211_hw *hw = priv->hw; +struct wmi_fw_version cmd_rsp; +int ret; + +memset (&cmd_rsp,0 ,sizeof (cmd_rsp)); + +WMI_CMD (WMI_GET_FW_VERSION ); +if (ret) +return -EINVAL ; + + priv->fw_version_major =be16_to_cpu (cmd_rsp.major); + priv->fw_version_minor =be16_to_cpu (cmd_rsp.minor); + +snprintf (hw->wiphy->fw_version,ETHTOOL_BUSINFO_LEN ,"%d.%d" , + priv->fw_version_major, + priv->fw_version_minor); + +dev_info (priv->dev,"ath9k_htc: FW Version: %d.%d\n" , + priv->fw_version_major, + priv->fw_version_minor); + +return 0 ; +} +static int ath9k_init_device (struct ath9k_htc_priv *priv,u16 devid,char *product,u32 drv_info) {@@ -801,6 +827,10 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv, common =ath9k_hw_common (ah);ath9k_set_hw_capab (priv, hw); + error =ath9k_init_firmware_version (priv); +if (error !=0 ) + goto err_fw; +/* Initialize regulatory */ error =ath_regd_init (&common->regulatory, priv->hw->wiphy, ath9k_reg_notifier);@@ -861,6 +891,8 @@ err_rx: err_tx:/* Nothing */ err_regd: +/* Nothing */ +err_fw:ath9k_deinit_priv (priv); err_init:return error;drivers/net/wireless/ath/ath9k/wmi.c +2
-0@@ -23,6 +23,8 @@ static const char *wmi_cmd_to_name(enum wmi_cmd_id wmi_cmd)return "WMI_ECHO_CMDID" ;case WMI_ACCESS_MEMORY_CMDID :return "WMI_ACCESS_MEMORY_CMDID" ; +case WMI_GET_FW_VERSION : +return "WMI_GET_FW_VERSION" ;case WMI_DISABLE_INTR_CMDID :return "WMI_DISABLE_INTR_CMDID" ;case WMI_ENABLE_INTR_CMDID :drivers/net/wireless/ath/ath9k/wmi.h +6
-0@@ -31,11 +31,17 @@ struct wmi_cmd_hdr {__be16 seq_no; } __packed; +struct wmi_fw_version { +__be16 major; +__be16 minor; + +} __packed;enum wmi_cmd_id {WMI_ECHO_CMDID =0x0001 ,WMI_ACCESS_MEMORY_CMDID ,/* Commands to Target */ +WMI_GET_FW_VERSION ,WMI_DISABLE_INTR_CMDID ,WMI_ENABLE_INTR_CMDID ,WMI_RX_LINK_CMDID ,
Quoted 17 lines · Richard Farina
The following commit causes extreme sadness:
[ 4094.241243] usb 2-5: new high speed USB device using ehci_hcd and address 3 [ 4095.550452] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4095.816072] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 credits [ 4159.812888] usb 2-5: USB disconnect, address 3 [ 4159.929317] ath: Couldn't reset chip [ 4159.929321] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929323] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929340] Failed to initialize the device [ 4160.012603] ath9k_htc: probe of 2-5:1.0 failed with error -22 [ 4160.012771] usbcore: registered new interface driver ath9k_htc [ 4163.595059] usb 2-5: new high speed USB device using ehci_hcd and address 4 [ 4164.018920] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4164.284420] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 credits
Quoted 4 lines
I'm guessing because I need the mentioned firmware update? Where can I get it? Or better yet can you (this is almost laughable considering the ralink thread right now) get it into linux-firmware? Or is the needed firmware update an unstable thing?
The new FW has to be formally/officially tested before it is merged into linux-firmware.
Quoted 3 lines
Either way I can wait on the firmware-version fix but where can I find the patch that shows fixes the "driver: usb" issue? Your obviously shows properly :-)
http://linuxwireless.org/en/users/Drivers/ath9k_htc
Sujith
Quoted 5 lines · Sujith
Quoted 3 lines
Either way I can wait on the firmware-version fix but where can I find the patch that shows fixes the "driver: usb" issue? Your obviously shows properly :-)
In the AP/P2P section.
Sujith
Quoted 22 lines · Sujith
Quoted 17 lines · Richard Farina
The following commit causes extreme sadness:
[ 4094.241243] usb 2-5: new high speed USB device using ehci_hcd and address 3 [ 4095.550452] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4095.816072] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 credits [ 4159.812888] usb 2-5: USB disconnect, address 3 [ 4159.929317] ath: Couldn't reset chip [ 4159.929321] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929323] ath: Unable to initialize hardware; initialization status: -5 [ 4159.929340] Failed to initialize the device [ 4160.012603] ath9k_htc: probe of 2-5:1.0 failed with error -22 [ 4160.012771] usbcore: registered new interface driver ath9k_htc [ 4163.595059] usb 2-5: new high speed USB device using ehci_hcd and address 4 [ 4164.018920] usb 2-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51312 [ 4164.284420] ath9k_htc 2-5:1.0: ath9k_htc: HTC initialized with 33 creditsQuoted 4 lines
I'm guessing because I need the mentioned firmware update? Where can I get it? Or better yet can you (this is almost laughable considering the ralink thread right now) get it into linux-firmware? Or is the needed firmware update an unstable thing?
Quoted 7 lines
The new FW has to be formally/officially tested before it is merged into linux-firmware.
Quoted 3 lines
Either way I can wait on the firmware-version fix but where can I find the patch that shows fixes the "driver: usb" issue? Your obviously shows properly :-)
Sorry for being a bit dim on this but which part of this exactly fixes the ethtool driver function? I'm guessing it is in the patchset and the firmware is only required if I want to detect the firmware version? Or do I really need experimental firmware to make it detect the driver properly?
Also, when you say experimental do you mean it's all pretty experimental or just the AP stuff is? I'm guessing the firmware is based on the current firmware so the station mode et al should be (approximately) as stable at the released firmware and only the AP parts are experimental.
Thanks,
Rick Farina
Quoted 2 lines
Sujith
Quoted 5 lines · Richard Farina
Sorry for being a bit dim on this but which part of this exactly fixes the ethtool driver function? I'm guessing it is in the patchset and the firmware is only required if I want to detect the firmware version? Or do I really need experimental firmware to make it detect the driver properly?
The ethtool fix is part of the patchset (specifically patch no. 3), and the new FW is required if the patchset is used.
Quoted 4 lines
Also, when you say experimental do you mean it's all pretty experimental or just the AP stuff is? I'm guessing the firmware is based on the current firmware so the station mode et al should be (approximately) as stable at the released firmware and only the AP parts are experimental.
Yes, the new version is based on the current FW and the AP stuff is experimental. Station mode should ideally not have any problems, but since the firmware has had a fairly invasive cleanup, one can never know. :)
Sujith
Quoted 8 lines · Sujith
Quoted 5 lines · Richard Farina
Sorry for being a bit dim on this but which part of this exactly fixes the ethtool driver function? I'm guessing it is in the patchset and the firmware is only required if I want to detect the firmware version? Or do I really need experimental firmware to make it detect the driver properly?
The ethtool fix is part of the patchset (specifically patch no. 3), and the new FW is required if the patchset is used.
Patch number 3 seems to fix only the firmware version grabbing. Am I misunderstanding the part or is the driver name grabbing fixed somewhere else in a different place? In linus tree driver shows as "usb", Your ethtool output showed driver properly as "ath9k_htc".
-Rick
Quoted 10 lines
Quoted 4 lines
Also, when you say experimental do you mean it's all pretty experimental or just the AP stuff is? I'm guessing the firmware is based on the current firmware so the station mode et al should be (approximately) as stable at the released firmware and only the AP parts are experimental.
Yes, the new version is based on the current FW and the AP stuff is experimental. Station mode should ideally not have any problems, but since the firmware has had a fairly invasive cleanup, one can never know. :)
Sujith