* ath9k_htc firmware @ 2016-06-03 17:26 bruce m beach 2016-06-04 5:54 ` Oleksij Rempel 0 siblings, 1 reply; 7+ messages in thread From: bruce m beach @ 2016-06-03 17:26 UTC (permalink / raw) To: linux-wireless; +Cc: ath9k_htc_fw Hello All I am still working on cleaning up ath9k_htc firmware build tree for about 6 months now ( and looks like I'll be doing this for all eternity**2 ) and am not clear myself what I'm looking for right now. I'm looking for some kind of simple request in the ath9k_htc driver, through the usb ep0, like a memory read on the card, where a urb is sent with the resulting chain of events. The simpler the better. The simplest. Bruce ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ath9k_htc firmware 2016-06-03 17:26 ath9k_htc firmware bruce m beach @ 2016-06-04 5:54 ` Oleksij Rempel 2016-06-04 5:58 ` Fwd: " Oleksij Rempel 2016-06-04 19:44 ` bruce m beach 0 siblings, 2 replies; 7+ messages in thread From: Oleksij Rempel @ 2016-06-04 5:54 UTC (permalink / raw) To: bruce m beach, linux-wireless; +Cc: ath9k_htc_fw [-- Attachment #1.1: Type: text/plain, Size: 1977 bytes --] Am 03.06.2016 um 19:26 schrieb bruce m beach: > Hello All > > I am still working on cleaning up ath9k_htc firmware build tree for about 6 > months now ( and looks like I'll be doing this for all eternity**2 ) and am > not clear myself what I'm looking for right now. > > I'm looking for some kind of simple request in the ath9k_htc driver, through > the usb ep0, like a memory read on the card, where a urb is sent with > the resulting chain of events. The simpler the better. The simplest. For EP0 on drivers site: static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) { int transfer, err; const void *data = hif_dev->fw_data; size_t len = hif_dev->fw_size; u32 addr = AR9271_FIRMWARE; u8 *buf = kzalloc(4096, GFP_KERNEL); u32 firm_offset; if (!buf) return -ENOMEM; while (len) { transfer = min_t(size_t, len, 4096); memcpy(buf, data, transfer); err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0), FIRMWARE_DOWNLOAD, 0x40 | USB_DIR_OUT, addr >> 8, 0, buf, transfer, HZ); ============================================================================= On side of pre installed firmware, the code looks like this: open-ath9k-htc-firmware/sboot/magpie_1_1/sboot/hif/usb/src/usb_api.c LOCAL void VendorCommand(void) { #define cUSB_REQ_DOWNLOAD 0x30 #define cUSB_REQ_DOWNLOAD_COMP 0x31 #define cUSB_REQ_BOOT 0x32 #define cUSB_REQ_RESERVED_1 0x33 #define cUSB_REQ_RESERVED_2 0x34 #define cUSB_REQ_FLASH_READ 0x35 #define cUSB_REQ_FLASH_READ_COMP 0x36 //#define ZM_FIRMWARE_ADDR 0x200000 void (*funcPtr)(void); uint16_t *text_addr = 0; uint32_t ep0_data = 0x0; ... [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 213 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Fwd: Re: ath9k_htc firmware 2016-06-04 5:54 ` Oleksij Rempel @ 2016-06-04 5:58 ` Oleksij Rempel 2016-06-04 19:44 ` bruce m beach 1 sibling, 0 replies; 7+ messages in thread From: Oleksij Rempel @ 2016-06-04 5:58 UTC (permalink / raw) To: ath9k-devel, brucembeach, ath9k_htc_fw, linux-wireless@vger.kernel.org [-- Attachment #1.1: Type: text/plain, Size: 1989 bytes --] Am 03.06.2016 um 19:26 schrieb bruce m beach: > Hello All > > I am still working on cleaning up ath9k_htc firmware build tree for about 6 > months now ( and looks like I'll be doing this for all eternity**2 ) and am > not clear myself what I'm looking for right now. > > I'm looking for some kind of simple request in the ath9k_htc driver, through > the usb ep0, like a memory read on the card, where a urb is sent with > the resulting chain of events. The simpler the better. The simplest. For EP0 on drivers site: static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) { int transfer, err; const void *data = hif_dev->fw_data; size_t len = hif_dev->fw_size; u32 addr = AR9271_FIRMWARE; u8 *buf = kzalloc(4096, GFP_KERNEL); u32 firm_offset; if (!buf) return -ENOMEM; while (len) { transfer = min_t(size_t, len, 4096); memcpy(buf, data, transfer); err = usb_control_msg(hif_dev->udev, usb_sndctrlpipe(hif_dev->udev, 0), FIRMWARE_DOWNLOAD, 0x40 | USB_DIR_OUT, addr >> 8, 0, buf, transfer, HZ); ============================================================================= On side of pre installed firmware, the code looks like this: open-ath9k-htc-firmware/sboot/magpie_1_1/sboot/hif/usb/src/usb_api.c LOCAL void VendorCommand(void) { #define cUSB_REQ_DOWNLOAD 0x30 #define cUSB_REQ_DOWNLOAD_COMP 0x31 #define cUSB_REQ_BOOT 0x32 #define cUSB_REQ_RESERVED_1 0x33 #define cUSB_REQ_RESERVED_2 0x34 #define cUSB_REQ_FLASH_READ 0x35 #define cUSB_REQ_FLASH_READ_COMP 0x36 //#define ZM_FIRMWARE_ADDR 0x200000 void (*funcPtr)(void); uint16_t *text_addr = 0; uint32_t ep0_data = 0x0; ... [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 213 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* ath9k_htc firmware 2016-06-04 5:54 ` Oleksij Rempel 2016-06-04 5:58 ` Fwd: " Oleksij Rempel @ 2016-06-04 19:44 ` bruce m beach 2016-06-04 20:25 ` Oleksij Rempel 2016-06-04 20:27 ` Oleksij Rempel 1 sibling, 2 replies; 7+ messages in thread From: bruce m beach @ 2016-06-04 19:44 UTC (permalink / raw) To: Oleksij Rempel; +Cc: ath9k-devel, ath9k_htc_fw, linux-wireless >> I'm looking for some kind of simple request in the ath9k_htc driver, through >> the usb ep0, like a memory read on the card, where a urb is sent with >> the resulting chain of events. The simpler the better. The simplest. > For EP0 on drivers site: > static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) > { > int transfer, err; > const void *data = hif_dev->fw_data; > size_t len = hif_dev->fw_size; > u32 addr = AR9271_FIRMWARE; > u8 *buf = kzalloc(4096, GFP_KERNEL); > u32 firm_offset; > ... What about the code for setting and resetting leds ??? Bruce ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ath9k_htc firmware 2016-06-04 19:44 ` bruce m beach @ 2016-06-04 20:25 ` Oleksij Rempel 2016-06-04 20:27 ` Oleksij Rempel 1 sibling, 0 replies; 7+ messages in thread From: Oleksij Rempel @ 2016-06-04 20:25 UTC (permalink / raw) To: bruce m beach; +Cc: ath9k-devel, ath9k_htc_fw, linux-wireless Am 04.06.2016 um 21:44 schrieb bruce m beach: >>> I'm looking for some kind of simple request in the ath9k_htc driver, through >>> the usb ep0, like a memory read on the card, where a urb is sent with >>> the resulting chain of events. The simpler the better. The simplest. > >> For EP0 on drivers site: >> static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) >> { >> int transfer, err; >> const void *data = hif_dev->fw_data; >> size_t len = hif_dev->fw_size; >> u32 addr = AR9271_FIRMWARE; >> u8 *buf = kzalloc(4096, GFP_KERNEL); >> u32 firm_offset; >> ... > > What about the code for setting and resetting leds ??? > > Bruce > It is EP3/EP4 and it is not working without firmware. Here is one example how you can add new command to firmware: https://github.com/olerem/open-ath9k-htc-firmware/commit/c73c159303e30a28e2d3dc05ba0d2d15504e5fad And for kernel driver: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8badb50cfab6d433622dbfd5a90b6adf27333107 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: ath9k_htc firmware 2016-06-04 19:44 ` bruce m beach 2016-06-04 20:25 ` Oleksij Rempel @ 2016-06-04 20:27 ` Oleksij Rempel 2016-06-09 15:14 ` bruce m beach 1 sibling, 1 reply; 7+ messages in thread From: Oleksij Rempel @ 2016-06-04 20:27 UTC (permalink / raw) To: bruce m beach; +Cc: ath9k-devel, ath9k_htc_fw, linux-wireless [-- Attachment #1.1: Type: text/plain, Size: 1137 bytes --] Am 04.06.2016 um 21:44 schrieb bruce m beach: >>> I'm looking for some kind of simple request in the ath9k_htc driver, through >>> the usb ep0, like a memory read on the card, where a urb is sent with >>> the resulting chain of events. The simpler the better. The simplest. > >> For EP0 on drivers site: >> static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev) >> { >> int transfer, err; >> const void *data = hif_dev->fw_data; >> size_t len = hif_dev->fw_size; >> u32 addr = AR9271_FIRMWARE; >> u8 *buf = kzalloc(4096, GFP_KERNEL); >> u32 firm_offset; >> ... > > What about the code for setting and resetting leds ??? > > Bruce It is EP3/EP4 and it is not working without firmware. Here is one example how you can add new command to firmware: https://github.com/olerem/open-ath9k-htc-firmware/commit/c73c159303e30a28e2d3dc05ba0d2d15504e5fad And for kernel driver: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=8badb50cfab6d433622dbfd5a90b6adf27333107 PS: Grr... today i send message from wrong email. Sorry for the spam -- Regards, Oleksij [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 213 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* ath9k_htc firmware 2016-06-04 20:27 ` Oleksij Rempel @ 2016-06-09 15:14 ` bruce m beach 0 siblings, 0 replies; 7+ messages in thread From: bruce m beach @ 2016-06-09 15:14 UTC (permalink / raw) To: Oleksij Rempel; +Cc: ath9k-devel, ath9k_htc_fw, linux-wireless > Here is one example how you can add new command to firmware: > https://github.com/olerem/open-ath9k-htc-firmware/commit >> /c73c159303e30a28e2d3dc05ba0d2d15504e5fad Thanks for the example. Seems clear as to how it works. Currently I'm looking at anything to do with these tables, which I'll be at it for the next month or so. Going back to the original question I see that the reason that I didn't find very much in terms of traffic on EP0 is that there isn't very much traffic on EP0 so that answers that. Currently the real problem that I'm having is that I can't open a USBLIB FD out in userland while the kernel driver is attached. I can talk to the stick without the driver but while the driver is attached it blocks the access and I would very much like to disable that block. Bruce ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-06-09 15:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-06-03 17:26 ath9k_htc firmware bruce m beach 2016-06-04 5:54 ` Oleksij Rempel 2016-06-04 5:58 ` Fwd: " Oleksij Rempel 2016-06-04 19:44 ` bruce m beach 2016-06-04 20:25 ` Oleksij Rempel 2016-06-04 20:27 ` Oleksij Rempel 2016-06-09 15:14 ` bruce m beach
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).