2 * Atheros AR9170 driver
6 * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2009, Christian Lamparter <chunkeey@web.de>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; see the file COPYING. If not, see
21 * http://www.gnu.org/licenses/.
23 * This file incorporates work covered by the following copyright and
25 * Copyright (c) 2007-2008 Atheros Communications, Inc.
27 * Permission to use, copy, modify, and/or distribute this software for any
28 * purpose with or without fee is hereby granted, provided that the above
29 * copyright notice and this permission notice appear in all copies.
31 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
32 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
33 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
34 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
35 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
36 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
37 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40 #include <linux/module.h>
41 #include <linux/usb.h>
42 #include <linux/firmware.h>
43 #include <linux/etherdevice.h>
44 #include <net/mac80211.h>
50 MODULE_AUTHOR("Johannes Berg <johannes@sipsolutions.net>");
51 MODULE_AUTHOR("Christian Lamparter <chunkeey@web.de>");
52 MODULE_LICENSE("GPL");
53 MODULE_DESCRIPTION("Atheros AR9170 802.11n USB wireless");
54 MODULE_FIRMWARE("ar9170.fw");
55 MODULE_FIRMWARE("ar9170-1.fw");
56 MODULE_FIRMWARE("ar9170-2.fw");
58 enum ar9170_requirements
{
59 AR9170_REQ_FW1_ONLY
= 1,
62 static struct usb_device_id ar9170_usb_ids
[] = {
64 { USB_DEVICE(0x0cf3, 0x9170) },
66 { USB_DEVICE(0x0cf3, 0x1001) },
68 { USB_DEVICE(0xcace, 0x0300) },
70 { USB_DEVICE(0x07d1, 0x3c10) },
71 /* Netgear WNDA3100 */
72 { USB_DEVICE(0x0846, 0x9010) },
73 /* Netgear WN111 v2 */
74 { USB_DEVICE(0x0846, 0x9001) },
76 { USB_DEVICE(0x0ace, 0x1221) },
78 { USB_DEVICE(0x0586, 0x3417) },
80 { USB_DEVICE(0x0cde, 0x0023) },
82 { USB_DEVICE(0x0cde, 0x0026) },
84 { USB_DEVICE(0x083a, 0xf522) },
86 { USB_DEVICE(0x2019, 0x5304) },
87 /* IO-Data WNGDNUS2 */
88 { USB_DEVICE(0x04bb, 0x093f) },
89 /* AVM FRITZ!WLAN USB Stick N */
90 { USB_DEVICE(0x057C, 0x8401) },
91 /* AVM FRITZ!WLAN USB Stick N 2.4 */
92 { USB_DEVICE(0x057C, 0x8402), .driver_info
= AR9170_REQ_FW1_ONLY
},
97 MODULE_DEVICE_TABLE(usb
, ar9170_usb_ids
);
99 static void ar9170_usb_submit_urb(struct ar9170_usb
*aru
)
105 if (unlikely(!IS_STARTED(&aru
->common
)))
108 spin_lock_irqsave(&aru
->tx_urb_lock
, flags
);
109 if (aru
->tx_submitted_urbs
>= AR9170_NUM_TX_URBS
) {
110 spin_unlock_irqrestore(&aru
->tx_urb_lock
, flags
);
113 aru
->tx_submitted_urbs
++;
115 urb
= usb_get_from_anchor(&aru
->tx_pending
);
117 aru
->tx_submitted_urbs
--;
118 spin_unlock_irqrestore(&aru
->tx_urb_lock
, flags
);
122 spin_unlock_irqrestore(&aru
->tx_urb_lock
, flags
);
124 aru
->tx_pending_urbs
--;
125 usb_anchor_urb(urb
, &aru
->tx_submitted
);
127 err
= usb_submit_urb(urb
, GFP_ATOMIC
);
129 if (ar9170_nag_limiter(&aru
->common
))
130 dev_err(&aru
->udev
->dev
, "submit_urb failed (%d).\n",
133 usb_unanchor_urb(urb
);
134 aru
->tx_submitted_urbs
--;
135 ar9170_tx_callback(&aru
->common
, urb
->context
);
141 static void ar9170_usb_tx_urb_complete_frame(struct urb
*urb
)
143 struct sk_buff
*skb
= urb
->context
;
144 struct ar9170_usb
*aru
= (struct ar9170_usb
*)
145 usb_get_intfdata(usb_ifnum_to_if(urb
->dev
, 0));
147 if (unlikely(!aru
)) {
148 dev_kfree_skb_irq(skb
);
152 aru
->tx_submitted_urbs
--;
154 ar9170_tx_callback(&aru
->common
, skb
);
156 ar9170_usb_submit_urb(aru
);
159 static void ar9170_usb_tx_urb_complete(struct urb
*urb
)
163 static void ar9170_usb_irq_completed(struct urb
*urb
)
165 struct ar9170_usb
*aru
= urb
->context
;
167 switch (urb
->status
) {
168 /* everything is fine */
183 ar9170_handle_command_response(&aru
->common
, urb
->transfer_buffer
,
187 usb_anchor_urb(urb
, &aru
->rx_submitted
);
188 if (usb_submit_urb(urb
, GFP_ATOMIC
)) {
189 usb_unanchor_urb(urb
);
196 usb_buffer_free(aru
->udev
, 64, urb
->transfer_buffer
, urb
->transfer_dma
);
199 static void ar9170_usb_rx_completed(struct urb
*urb
)
201 struct sk_buff
*skb
= urb
->context
;
202 struct ar9170_usb
*aru
= (struct ar9170_usb
*)
203 usb_get_intfdata(usb_ifnum_to_if(urb
->dev
, 0));
209 switch (urb
->status
) {
210 /* everything is fine */
225 skb_put(skb
, urb
->actual_length
);
226 ar9170_rx(&aru
->common
, skb
);
229 skb_reset_tail_pointer(skb
);
232 usb_anchor_urb(urb
, &aru
->rx_submitted
);
233 err
= usb_submit_urb(urb
, GFP_ATOMIC
);
235 usb_unanchor_urb(urb
);
242 dev_kfree_skb_irq(skb
);
245 static int ar9170_usb_prep_rx_urb(struct ar9170_usb
*aru
,
246 struct urb
*urb
, gfp_t gfp
)
250 skb
= __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE
+ 32, gfp
);
254 /* reserve some space for mac80211's radiotap */
255 skb_reserve(skb
, 32);
257 usb_fill_bulk_urb(urb
, aru
->udev
,
258 usb_rcvbulkpipe(aru
->udev
, AR9170_EP_RX
),
259 skb
->data
, min(skb_tailroom(skb
),
260 AR9170_MAX_RX_BUFFER_SIZE
),
261 ar9170_usb_rx_completed
, skb
);
266 static int ar9170_usb_alloc_rx_irq_urb(struct ar9170_usb
*aru
)
268 struct urb
*urb
= NULL
;
272 /* initialize interrupt endpoint */
273 urb
= usb_alloc_urb(0, GFP_KERNEL
);
277 ibuf
= usb_buffer_alloc(aru
->udev
, 64, GFP_KERNEL
, &urb
->transfer_dma
);
281 usb_fill_int_urb(urb
, aru
->udev
,
282 usb_rcvintpipe(aru
->udev
, AR9170_EP_IRQ
), ibuf
,
283 64, ar9170_usb_irq_completed
, aru
, 1);
284 urb
->transfer_flags
|= URB_NO_TRANSFER_DMA_MAP
;
286 usb_anchor_urb(urb
, &aru
->rx_submitted
);
287 err
= usb_submit_urb(urb
, GFP_KERNEL
);
289 usb_unanchor_urb(urb
);
290 usb_buffer_free(aru
->udev
, 64, urb
->transfer_buffer
,
299 static int ar9170_usb_alloc_rx_bulk_urbs(struct ar9170_usb
*aru
)
305 for (i
= 0; i
< AR9170_NUM_RX_URBS
; i
++) {
307 urb
= usb_alloc_urb(0, GFP_KERNEL
);
311 err
= ar9170_usb_prep_rx_urb(aru
, urb
, GFP_KERNEL
);
317 usb_anchor_urb(urb
, &aru
->rx_submitted
);
318 err
= usb_submit_urb(urb
, GFP_KERNEL
);
320 usb_unanchor_urb(urb
);
321 dev_kfree_skb_any((void *) urb
->transfer_buffer
);
328 /* the device now waiting for a firmware. */
329 aru
->common
.state
= AR9170_IDLE
;
334 usb_kill_anchored_urbs(&aru
->rx_submitted
);
338 static int ar9170_usb_flush(struct ar9170
*ar
)
340 struct ar9170_usb
*aru
= (void *) ar
;
345 aru
->common
.state
= AR9170_IDLE
;
347 usb_wait_anchor_empty_timeout(&aru
->tx_pending
,
348 msecs_to_jiffies(800));
349 while ((urb
= usb_get_from_anchor(&aru
->tx_pending
))) {
350 ar9170_tx_callback(&aru
->common
, (void *) urb
->context
);
354 /* lets wait a while until the tx - queues are dried out */
355 ret
= usb_wait_anchor_empty_timeout(&aru
->tx_submitted
,
356 msecs_to_jiffies(100));
360 usb_kill_anchored_urbs(&aru
->tx_submitted
);
362 if (IS_ACCEPTING_CMD(ar
))
363 aru
->common
.state
= AR9170_STARTED
;
368 static void ar9170_usb_cancel_urbs(struct ar9170_usb
*aru
)
372 aru
->common
.state
= AR9170_UNKNOWN_STATE
;
374 err
= ar9170_usb_flush(&aru
->common
);
376 dev_err(&aru
->udev
->dev
, "stuck tx urbs!\n");
378 usb_poison_anchored_urbs(&aru
->tx_submitted
);
379 usb_poison_anchored_urbs(&aru
->rx_submitted
);
382 static int ar9170_usb_exec_cmd(struct ar9170
*ar
, enum ar9170_cmd cmd
,
383 unsigned int plen
, void *payload
,
384 unsigned int outlen
, void *out
)
386 struct ar9170_usb
*aru
= (void *) ar
;
387 struct urb
*urb
= NULL
;
391 if (unlikely(!IS_ACCEPTING_CMD(ar
)))
394 if (WARN_ON(plen
> AR9170_MAX_CMD_LEN
- 4))
397 urb
= usb_alloc_urb(0, GFP_ATOMIC
);
401 ar
->cmdbuf
[0] = cpu_to_le32(plen
);
402 ar
->cmdbuf
[0] |= cpu_to_le32(cmd
<< 8);
403 /* writing multiple regs fills this buffer already */
404 if (plen
&& payload
!= (u8
*)(&ar
->cmdbuf
[1]))
405 memcpy(&ar
->cmdbuf
[1], payload
, plen
);
407 spin_lock_irqsave(&aru
->common
.cmdlock
, flags
);
408 aru
->readbuf
= (u8
*)out
;
409 aru
->readlen
= outlen
;
410 spin_unlock_irqrestore(&aru
->common
.cmdlock
, flags
);
412 usb_fill_int_urb(urb
, aru
->udev
,
413 usb_sndbulkpipe(aru
->udev
, AR9170_EP_CMD
),
414 aru
->common
.cmdbuf
, plen
+ 4,
415 ar9170_usb_tx_urb_complete
, NULL
, 1);
417 usb_anchor_urb(urb
, &aru
->tx_submitted
);
418 err
= usb_submit_urb(urb
, GFP_ATOMIC
);
420 usb_unanchor_urb(urb
);
426 err
= wait_for_completion_timeout(&aru
->cmd_wait
, HZ
);
432 if (aru
->readlen
!= outlen
) {
440 /* Maybe the device was removed in the second we were waiting? */
441 if (IS_STARTED(ar
)) {
442 dev_err(&aru
->udev
->dev
, "no command feedback "
443 "received (%d).\n", err
);
445 /* provide some maybe useful debug information */
446 print_hex_dump_bytes("ar9170 cmd: ", DUMP_PREFIX_NONE
,
447 aru
->common
.cmdbuf
, plen
+ 4);
451 /* invalidate to avoid completing the next prematurely */
452 spin_lock_irqsave(&aru
->common
.cmdlock
, flags
);
455 spin_unlock_irqrestore(&aru
->common
.cmdlock
, flags
);
462 static int ar9170_usb_tx(struct ar9170
*ar
, struct sk_buff
*skb
)
464 struct ar9170_usb
*aru
= (struct ar9170_usb
*) ar
;
467 if (unlikely(!IS_STARTED(ar
))) {
468 /* Seriously, what were you drink... err... thinking!? */
472 urb
= usb_alloc_urb(0, GFP_ATOMIC
);
476 usb_fill_bulk_urb(urb
, aru
->udev
,
477 usb_sndbulkpipe(aru
->udev
, AR9170_EP_TX
),
479 ar9170_usb_tx_urb_complete_frame
, skb
);
480 urb
->transfer_flags
|= URB_ZERO_PACKET
;
482 usb_anchor_urb(urb
, &aru
->tx_pending
);
483 aru
->tx_pending_urbs
++;
487 ar9170_usb_submit_urb(aru
);
491 static void ar9170_usb_callback_cmd(struct ar9170
*ar
, u32 len
, void *buffer
)
493 struct ar9170_usb
*aru
= (void *) ar
;
497 if (unlikely(!buffer
))
500 in
= le32_to_cpup((__le32
*)buffer
);
501 out
= le32_to_cpu(ar
->cmdbuf
[0]);
503 /* mask off length byte */
506 if (aru
->readlen
>= 0) {
507 /* add expected length */
510 /* add obtained length */
515 * Some commands (e.g: AR9170_CMD_FREQUENCY) have a variable response
516 * length and we cannot predict the correct length in advance.
517 * So we only check if we provided enough space for the data.
519 if (unlikely(out
< in
)) {
520 dev_warn(&aru
->udev
->dev
, "received invalid command response "
521 "got %d bytes, instead of %d bytes "
522 "and the resp length is %d bytes\n",
524 print_hex_dump_bytes("ar9170 invalid resp: ",
525 DUMP_PREFIX_OFFSET
, buffer
, len
);
527 * Do not complete, then the command times out,
528 * and we get a stack trace from there.
533 spin_lock_irqsave(&aru
->common
.cmdlock
, flags
);
534 if (aru
->readbuf
&& len
> 0) {
535 memcpy(aru
->readbuf
, buffer
+ 4, len
- 4);
538 complete(&aru
->cmd_wait
);
539 spin_unlock_irqrestore(&aru
->common
.cmdlock
, flags
);
542 static int ar9170_usb_upload(struct ar9170_usb
*aru
, const void *data
,
543 size_t len
, u32 addr
, bool complete
)
546 u8
*buf
= kmalloc(4096, GFP_KERNEL
);
552 transfer
= min_t(int, len
, 4096);
553 memcpy(buf
, data
, transfer
);
555 err
= usb_control_msg(aru
->udev
, usb_sndctrlpipe(aru
->udev
, 0),
556 0x30 /* FW DL */, 0x40 | USB_DIR_OUT
,
557 addr
>> 8, 0, buf
, transfer
, 1000);
571 err
= usb_control_msg(aru
->udev
, usb_sndctrlpipe(aru
->udev
, 0),
572 0x31 /* FW DL COMPLETE */,
573 0x40 | USB_DIR_OUT
, 0, 0, NULL
, 0, 5000);
579 static int ar9170_usb_request_firmware(struct ar9170_usb
*aru
)
583 err
= request_firmware(&aru
->firmware
, "ar9170.fw",
586 aru
->init_values
= NULL
;
590 if (aru
->req_one_stage_fw
) {
591 dev_err(&aru
->udev
->dev
, "ar9170.fw firmware file "
592 "not found and is required for this device\n");
596 dev_err(&aru
->udev
->dev
, "ar9170.fw firmware file "
597 "not found, trying old firmware...\n");
599 err
= request_firmware(&aru
->init_values
, "ar9170-1.fw",
602 dev_err(&aru
->udev
->dev
, "file with init values not found.\n");
606 err
= request_firmware(&aru
->firmware
, "ar9170-2.fw", &aru
->udev
->dev
);
608 release_firmware(aru
->init_values
);
609 dev_err(&aru
->udev
->dev
, "firmware file not found.\n");
616 static int ar9170_usb_reset(struct ar9170_usb
*aru
)
618 int ret
, lock
= (aru
->intf
->condition
!= USB_INTERFACE_BINDING
);
621 ret
= usb_lock_device_for_reset(aru
->udev
, aru
->intf
);
623 dev_err(&aru
->udev
->dev
, "unable to lock device "
624 "for reset (%d).\n", ret
);
629 ret
= usb_reset_device(aru
->udev
);
631 usb_unlock_device(aru
->udev
);
633 /* let it rest - for a second - */
639 static int ar9170_usb_upload_firmware(struct ar9170_usb
*aru
)
643 if (!aru
->init_values
)
644 goto upload_fw_start
;
646 /* First, upload initial values to device RAM */
647 err
= ar9170_usb_upload(aru
, aru
->init_values
->data
,
648 aru
->init_values
->size
, 0x102800, false);
650 dev_err(&aru
->udev
->dev
, "firmware part 1 "
651 "upload failed (%d).\n", err
);
657 /* Then, upload the firmware itself and start it */
658 return ar9170_usb_upload(aru
, aru
->firmware
->data
, aru
->firmware
->size
,
662 static int ar9170_usb_init_transport(struct ar9170_usb
*aru
)
664 struct ar9170
*ar
= (void *) &aru
->common
;
667 ar9170_regwrite_begin(ar
);
669 /* Set USB Rx stream mode MAX packet number to 2 */
670 ar9170_regwrite(AR9170_USB_REG_MAX_AGG_UPLOAD
, 0x4);
672 /* Set USB Rx stream mode timeout to 10us */
673 ar9170_regwrite(AR9170_USB_REG_UPLOAD_TIME_CTL
, 0x80);
675 ar9170_regwrite_finish();
677 err
= ar9170_regwrite_result();
679 dev_err(&aru
->udev
->dev
, "USB setup failed (%d).\n", err
);
684 static void ar9170_usb_stop(struct ar9170
*ar
)
686 struct ar9170_usb
*aru
= (void *) ar
;
689 if (IS_ACCEPTING_CMD(ar
))
690 aru
->common
.state
= AR9170_STOPPED
;
692 ret
= ar9170_usb_flush(ar
);
694 dev_err(&aru
->udev
->dev
, "kill pending tx urbs.\n");
696 usb_poison_anchored_urbs(&aru
->tx_submitted
);
700 * So far we freed all tx urbs, but we won't dare to touch any rx urbs.
701 * Else we would end up with a unresponsive device...
705 static int ar9170_usb_open(struct ar9170
*ar
)
707 struct ar9170_usb
*aru
= (void *) ar
;
710 usb_unpoison_anchored_urbs(&aru
->tx_submitted
);
711 err
= ar9170_usb_init_transport(aru
);
713 usb_poison_anchored_urbs(&aru
->tx_submitted
);
717 aru
->common
.state
= AR9170_IDLE
;
721 static int ar9170_usb_init_device(struct ar9170_usb
*aru
)
725 err
= ar9170_usb_alloc_rx_irq_urb(aru
);
729 err
= ar9170_usb_alloc_rx_bulk_urbs(aru
);
733 err
= ar9170_usb_upload_firmware(aru
);
735 err
= ar9170_echo_test(&aru
->common
, 0x60d43110);
737 /* force user invention, by disabling the device */
738 err
= usb_driver_set_configuration(aru
->udev
, -1);
739 dev_err(&aru
->udev
->dev
, "device is in a bad state. "
740 "please reconnect it!\n");
748 ar9170_usb_cancel_urbs(aru
);
754 static bool ar9170_requires_one_stage(const struct usb_device_id
*id
)
756 if (!id
->driver_info
)
758 if (id
->driver_info
== AR9170_REQ_FW1_ONLY
)
763 static int ar9170_usb_probe(struct usb_interface
*intf
,
764 const struct usb_device_id
*id
)
766 struct ar9170_usb
*aru
;
768 struct usb_device
*udev
;
771 aru
= ar9170_alloc(sizeof(*aru
));
777 udev
= interface_to_usbdev(intf
);
783 aru
->req_one_stage_fw
= ar9170_requires_one_stage(id
);
785 usb_set_intfdata(intf
, aru
);
786 SET_IEEE80211_DEV(ar
->hw
, &udev
->dev
);
788 init_usb_anchor(&aru
->rx_submitted
);
789 init_usb_anchor(&aru
->tx_pending
);
790 init_usb_anchor(&aru
->tx_submitted
);
791 init_completion(&aru
->cmd_wait
);
792 spin_lock_init(&aru
->tx_urb_lock
);
794 aru
->tx_pending_urbs
= 0;
795 aru
->tx_submitted_urbs
= 0;
797 aru
->common
.stop
= ar9170_usb_stop
;
798 aru
->common
.flush
= ar9170_usb_flush
;
799 aru
->common
.open
= ar9170_usb_open
;
800 aru
->common
.tx
= ar9170_usb_tx
;
801 aru
->common
.exec_cmd
= ar9170_usb_exec_cmd
;
802 aru
->common
.callback_cmd
= ar9170_usb_callback_cmd
;
805 udev
->reset_resume
= 1;
806 #endif /* CONFIG_PM */
807 err
= ar9170_usb_reset(aru
);
811 err
= ar9170_usb_request_firmware(aru
);
815 err
= ar9170_usb_init_device(aru
);
819 err
= ar9170_usb_open(ar
);
823 err
= ar9170_register(ar
, &udev
->dev
);
832 ar9170_usb_cancel_urbs(aru
);
835 release_firmware(aru
->init_values
);
836 release_firmware(aru
->firmware
);
839 usb_set_intfdata(intf
, NULL
);
841 ieee80211_free_hw(ar
->hw
);
846 static void ar9170_usb_disconnect(struct usb_interface
*intf
)
848 struct ar9170_usb
*aru
= usb_get_intfdata(intf
);
853 aru
->common
.state
= AR9170_IDLE
;
854 ar9170_unregister(&aru
->common
);
855 ar9170_usb_cancel_urbs(aru
);
857 release_firmware(aru
->init_values
);
858 release_firmware(aru
->firmware
);
860 usb_put_dev(aru
->udev
);
861 usb_set_intfdata(intf
, NULL
);
862 ieee80211_free_hw(aru
->common
.hw
);
866 static int ar9170_suspend(struct usb_interface
*intf
,
867 pm_message_t message
)
869 struct ar9170_usb
*aru
= usb_get_intfdata(intf
);
874 aru
->common
.state
= AR9170_IDLE
;
875 ar9170_usb_cancel_urbs(aru
);
880 static int ar9170_resume(struct usb_interface
*intf
)
882 struct ar9170_usb
*aru
= usb_get_intfdata(intf
);
888 usb_unpoison_anchored_urbs(&aru
->rx_submitted
);
889 usb_unpoison_anchored_urbs(&aru
->tx_submitted
);
891 err
= ar9170_usb_init_device(aru
);
895 err
= ar9170_usb_open(&aru
->common
);
902 aru
->common
.state
= AR9170_IDLE
;
903 ar9170_usb_cancel_urbs(aru
);
907 #endif /* CONFIG_PM */
909 static struct usb_driver ar9170_driver
= {
911 .probe
= ar9170_usb_probe
,
912 .disconnect
= ar9170_usb_disconnect
,
913 .id_table
= ar9170_usb_ids
,
916 .suspend
= ar9170_suspend
,
917 .resume
= ar9170_resume
,
918 .reset_resume
= ar9170_resume
,
919 #endif /* CONFIG_PM */
922 static int __init
ar9170_init(void)
924 return usb_register(&ar9170_driver
);
927 static void __exit
ar9170_exit(void)
929 usb_deregister(&ar9170_driver
);
932 module_init(ar9170_init
);
933 module_exit(ar9170_exit
);