2 * Copyright (c) 2014 Redpine Signals Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <linux/module.h>
19 #include <net/rsi_91x.h>
24 /* Default operating mode is wlan STA + BT */
25 static u16 dev_oper_mode
= DEV_OPMODE_STA_BT_DUAL
;
26 module_param(dev_oper_mode
, ushort
, 0444);
27 MODULE_PARM_DESC(dev_oper_mode
,
28 "1[Wi-Fi], 4[BT], 8[BT LE], 5[Wi-Fi STA + BT classic]\n"
29 "9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n"
30 "6[AP + BT classic], 14[AP + BT classic + BT LE]");
32 static int rsi_rx_urb_submit(struct rsi_hw
*adapter
, u8 ep_num
);
35 * rsi_usb_card_write() - This function writes to the USB Card.
36 * @adapter: Pointer to the adapter structure.
37 * @buf: Pointer to the buffer from where the data has to be taken.
38 * @len: Length to be written.
39 * @endpoint: Type of endpoint.
41 * Return: status: 0 on success, a negative error code on failure.
43 static int rsi_usb_card_write(struct rsi_hw
*adapter
,
48 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
50 u8
*seg
= dev
->tx_buffer
;
52 int ep
= dev
->bulkout_endpoint_addr
[endpoint
- 1];
54 memset(seg
, 0, len
+ RSI_USB_TX_HEAD_ROOM
);
55 memcpy(seg
+ RSI_USB_TX_HEAD_ROOM
, buf
, len
);
56 len
+= RSI_USB_TX_HEAD_ROOM
;
58 status
= usb_bulk_msg(dev
->usbdev
,
59 usb_sndbulkpipe(dev
->usbdev
, ep
),
67 "Card write failed with error code :%10d\n", status
);
74 * rsi_write_multiple() - This function writes multiple bytes of information
76 * @adapter: Pointer to the adapter structure.
77 * @addr: Address of the register.
78 * @data: Pointer to the data that has to be written.
79 * @count: Number of multiple bytes to be written.
81 * Return: 0 on success, a negative error code on failure.
83 static int rsi_write_multiple(struct rsi_hw
*adapter
,
88 struct rsi_91x_usbdev
*dev
;
96 dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
100 return rsi_usb_card_write(adapter
, data
, count
, endpoint
);
104 * rsi_find_bulk_in_and_out_endpoints() - This function initializes the bulk
105 * endpoints to the device.
106 * @interface: Pointer to the USB interface structure.
107 * @adapter: Pointer to the adapter structure.
109 * Return: ret_val: 0 on success, -ENOMEM on failure.
111 static int rsi_find_bulk_in_and_out_endpoints(struct usb_interface
*interface
,
112 struct rsi_hw
*adapter
)
114 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
115 struct usb_host_interface
*iface_desc
;
116 struct usb_endpoint_descriptor
*endpoint
;
118 int ii
, bin_found
= 0, bout_found
= 0;
120 iface_desc
= &(interface
->altsetting
[0]);
122 for (ii
= 0; ii
< iface_desc
->desc
.bNumEndpoints
; ++ii
) {
123 endpoint
= &(iface_desc
->endpoint
[ii
].desc
);
125 if (!dev
->bulkin_endpoint_addr
[bin_found
] &&
126 (endpoint
->bEndpointAddress
& USB_DIR_IN
) &&
127 ((endpoint
->bmAttributes
& USB_ENDPOINT_XFERTYPE_MASK
) ==
128 USB_ENDPOINT_XFER_BULK
)) {
129 buffer_size
= endpoint
->wMaxPacketSize
;
130 dev
->bulkin_size
[bin_found
] = buffer_size
;
131 dev
->bulkin_endpoint_addr
[bin_found
] =
132 endpoint
->bEndpointAddress
;
136 if (!dev
->bulkout_endpoint_addr
[bout_found
] &&
137 !(endpoint
->bEndpointAddress
& USB_DIR_IN
) &&
138 ((endpoint
->bmAttributes
& USB_ENDPOINT_XFERTYPE_MASK
) ==
139 USB_ENDPOINT_XFER_BULK
)) {
140 buffer_size
= endpoint
->wMaxPacketSize
;
141 dev
->bulkout_endpoint_addr
[bout_found
] =
142 endpoint
->bEndpointAddress
;
143 dev
->bulkout_size
[bout_found
] = buffer_size
;
147 if (bin_found
>= MAX_BULK_EP
|| bout_found
>= MAX_BULK_EP
)
151 if (!(dev
->bulkin_endpoint_addr
[0]) &&
152 dev
->bulkout_endpoint_addr
[0])
158 #define RSI_USB_REQ_OUT (USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE)
159 #define RSI_USB_REQ_IN (USB_TYPE_VENDOR | USB_DIR_IN | USB_RECIP_DEVICE)
161 /* rsi_usb_reg_read() - This function reads data from given register address.
162 * @usbdev: Pointer to the usb_device structure.
163 * @reg: Address of the register to be read.
164 * @value: Value to be read.
165 * @len: length of data to be read.
167 * Return: status: 0 on success, a negative error code on failure.
169 static int rsi_usb_reg_read(struct usb_device
*usbdev
,
175 int status
= -ENOMEM
;
177 if (len
> RSI_USB_CTRL_BUF_SIZE
)
180 buf
= kmalloc(RSI_USB_CTRL_BUF_SIZE
, GFP_KERNEL
);
184 status
= usb_control_msg(usbdev
,
185 usb_rcvctrlpipe(usbdev
, 0),
186 USB_VENDOR_REGISTER_READ
,
188 ((reg
& 0xffff0000) >> 16), (reg
& 0xffff),
191 USB_CTRL_GET_TIMEOUT
);
193 *value
= (buf
[0] | (buf
[1] << 8));
196 "%s: Reg read failed with error code :%d\n",
205 * rsi_usb_reg_write() - This function writes the given data into the given
207 * @usbdev: Pointer to the usb_device structure.
208 * @reg: Address of the register.
209 * @value: Value to write.
210 * @len: Length of data to be written.
212 * Return: status: 0 on success, a negative error code on failure.
214 static int rsi_usb_reg_write(struct usb_device
*usbdev
,
220 int status
= -ENOMEM
;
222 if (len
> RSI_USB_CTRL_BUF_SIZE
)
225 usb_reg_buf
= kmalloc(RSI_USB_CTRL_BUF_SIZE
, GFP_KERNEL
);
229 usb_reg_buf
[0] = (value
& 0x00ff);
230 usb_reg_buf
[1] = (value
& 0xff00) >> 8;
231 usb_reg_buf
[2] = 0x0;
232 usb_reg_buf
[3] = 0x0;
234 status
= usb_control_msg(usbdev
,
235 usb_sndctrlpipe(usbdev
, 0),
236 USB_VENDOR_REGISTER_WRITE
,
238 ((reg
& 0xffff0000) >> 16),
242 USB_CTRL_SET_TIMEOUT
);
245 "%s: Reg write failed with error code :%d\n",
254 * rsi_rx_done_handler() - This function is called when a packet is received
255 * from USB stack. This is callback to recieve done.
256 * @urb: Received URB.
260 static void rsi_rx_done_handler(struct urb
*urb
)
262 struct rx_usb_ctrl_block
*rx_cb
= urb
->context
;
263 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)rx_cb
->data
;
264 int status
= -EINVAL
;
269 if (urb
->actual_length
<= 0 ||
270 urb
->actual_length
> rx_cb
->rx_skb
->len
) {
271 rsi_dbg(INFO_ZONE
, "%s: Invalid packet length = %d\n",
272 __func__
, urb
->actual_length
);
275 if (skb_queue_len(&dev
->rx_q
) >= RSI_MAX_RX_PKTS
) {
276 rsi_dbg(INFO_ZONE
, "Max RX packets reached\n");
279 skb_trim(rx_cb
->rx_skb
, urb
->actual_length
);
280 skb_queue_tail(&dev
->rx_q
, rx_cb
->rx_skb
);
282 rsi_set_event(&dev
->rx_thread
.event
);
286 if (rsi_rx_urb_submit(dev
->priv
, rx_cb
->ep_num
))
287 rsi_dbg(ERR_ZONE
, "%s: Failed in urb submission", __func__
);
290 dev_kfree_skb(rx_cb
->rx_skb
);
294 * rsi_rx_urb_submit() - This function submits the given URB to the USB stack.
295 * @adapter: Pointer to the adapter structure.
297 * Return: 0 on success, a negative error code on failure.
299 static int rsi_rx_urb_submit(struct rsi_hw
*adapter
, u8 ep_num
)
301 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
302 struct rx_usb_ctrl_block
*rx_cb
= &dev
->rx_cb
[ep_num
- 1];
303 struct urb
*urb
= rx_cb
->rx_urb
;
306 u8 dword_align_bytes
= 0;
308 #define RSI_MAX_RX_USB_PKT_SIZE 3000
309 skb
= dev_alloc_skb(RSI_MAX_RX_USB_PKT_SIZE
);
312 skb_reserve(skb
, MAX_DWORD_ALIGN_BYTES
);
313 skb_put(skb
, RSI_MAX_RX_USB_PKT_SIZE
- MAX_DWORD_ALIGN_BYTES
);
314 dword_align_bytes
= (unsigned long)skb
->data
& 0x3f;
315 if (dword_align_bytes
> 0)
316 skb_push(skb
, dword_align_bytes
);
317 urb
->transfer_buffer
= skb
->data
;
320 usb_fill_bulk_urb(urb
,
322 usb_rcvbulkpipe(dev
->usbdev
,
323 dev
->bulkin_endpoint_addr
[ep_num
- 1]),
324 urb
->transfer_buffer
,
329 status
= usb_submit_urb(urb
, GFP_KERNEL
);
331 rsi_dbg(ERR_ZONE
, "%s: Failed in urb submission\n", __func__
);
336 static int rsi_usb_read_register_multiple(struct rsi_hw
*adapter
, u32 addr
,
339 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
347 buf
= kzalloc(RSI_USB_BUF_SIZE
, GFP_KERNEL
);
352 transfer
= min_t(u16
, count
, RSI_USB_BUF_SIZE
);
353 status
= usb_control_msg(dev
->usbdev
,
354 usb_rcvctrlpipe(dev
->usbdev
, 0),
355 USB_VENDOR_REGISTER_READ
,
357 ((addr
& 0xffff0000) >> 16),
358 (addr
& 0xffff), (void *)buf
,
359 transfer
, USB_CTRL_GET_TIMEOUT
);
362 "Reg read failed with error code :%d\n",
367 memcpy(data
, buf
, transfer
);
377 * rsi_usb_write_register_multiple() - This function writes multiple bytes of
378 * information to multiple registers.
379 * @adapter: Pointer to the adapter structure.
380 * @addr: Address of the register.
381 * @data: Pointer to the data that has to be written.
382 * @count: Number of multiple bytes to be written on to the registers.
384 * Return: status: 0 on success, a negative error code on failure.
386 static int rsi_usb_write_register_multiple(struct rsi_hw
*adapter
, u32 addr
,
389 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
394 buf
= kzalloc(RSI_USB_BUF_SIZE
, GFP_KERNEL
);
399 transfer
= min_t(u16
, count
, RSI_USB_BUF_SIZE
);
400 memcpy(buf
, data
, transfer
);
401 status
= usb_control_msg(dev
->usbdev
,
402 usb_sndctrlpipe(dev
->usbdev
, 0),
403 USB_VENDOR_REGISTER_WRITE
,
405 ((addr
& 0xffff0000) >> 16),
409 USB_CTRL_SET_TIMEOUT
);
412 "Reg write failed with error code :%d\n",
427 *rsi_usb_host_intf_write_pkt() - This function writes the packet to the
429 * @adapter: Pointer to the adapter structure.
430 * @pkt: Pointer to the data to be written on to the card.
431 * @len: Length of the data to be written on to the card.
433 * Return: 0 on success, a negative error code on failure.
435 static int rsi_usb_host_intf_write_pkt(struct rsi_hw
*adapter
,
439 u32 queueno
= ((pkt
[1] >> 4) & 0x7);
442 endpoint
= ((queueno
== RSI_WIFI_MGMT_Q
|| queueno
== RSI_WIFI_DATA_Q
||
443 queueno
== RSI_COEX_Q
) ? WLAN_EP
: BT_EP
);
445 return rsi_write_multiple(adapter
,
451 static int rsi_usb_master_reg_read(struct rsi_hw
*adapter
, u32 reg
,
454 struct usb_device
*usbdev
=
455 ((struct rsi_91x_usbdev
*)adapter
->rsi_dev
)->usbdev
;
459 ret
= rsi_usb_reg_read(usbdev
, reg
, &temp
, len
);
467 static int rsi_usb_master_reg_write(struct rsi_hw
*adapter
,
469 unsigned long value
, u16 len
)
471 struct usb_device
*usbdev
=
472 ((struct rsi_91x_usbdev
*)adapter
->rsi_dev
)->usbdev
;
474 return rsi_usb_reg_write(usbdev
, reg
, value
, len
);
477 static int rsi_usb_load_data_master_write(struct rsi_hw
*adapter
,
479 u32 instructions_sz
, u16 block_size
,
487 num_blocks
= instructions_sz
/ block_size
;
488 rsi_dbg(INFO_ZONE
, "num_blocks: %d\n", num_blocks
);
490 for (cur_indx
= 0, i
= 0; i
< num_blocks
; i
++, cur_indx
+= block_size
) {
491 memcpy(temp_buf
, ta_firmware
+ cur_indx
, block_size
);
492 status
= rsi_usb_write_register_multiple(adapter
, base_address
,
498 rsi_dbg(INFO_ZONE
, "%s: loading block: %d\n", __func__
, i
);
499 base_address
+= block_size
;
502 if (instructions_sz
% block_size
) {
503 memset(temp_buf
, 0, block_size
);
504 memcpy(temp_buf
, ta_firmware
+ cur_indx
,
505 instructions_sz
% block_size
);
506 status
= rsi_usb_write_register_multiple
507 (adapter
, base_address
,
509 instructions_sz
% block_size
);
513 "Written Last Block in Address 0x%x Successfully\n",
519 static struct rsi_host_intf_ops usb_host_intf_ops
= {
520 .write_pkt
= rsi_usb_host_intf_write_pkt
,
521 .read_reg_multiple
= rsi_usb_read_register_multiple
,
522 .write_reg_multiple
= rsi_usb_write_register_multiple
,
523 .master_reg_read
= rsi_usb_master_reg_read
,
524 .master_reg_write
= rsi_usb_master_reg_write
,
525 .load_data_master_write
= rsi_usb_load_data_master_write
,
529 * rsi_deinit_usb_interface() - This function deinitializes the usb interface.
530 * @adapter: Pointer to the adapter structure.
534 static void rsi_deinit_usb_interface(struct rsi_hw
*adapter
)
536 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
538 rsi_kill_thread(&dev
->rx_thread
);
540 usb_free_urb(dev
->rx_cb
[0].rx_urb
);
541 if (adapter
->priv
->coex_mode
> 1)
542 usb_free_urb(dev
->rx_cb
[1].rx_urb
);
544 kfree(dev
->tx_buffer
);
547 static int rsi_usb_init_rx(struct rsi_hw
*adapter
)
549 struct rsi_91x_usbdev
*dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
550 struct rx_usb_ctrl_block
*rx_cb
;
553 num_rx_cb
= (adapter
->priv
->coex_mode
> 1 ? 2 : 1);
555 for (idx
= 0; idx
< num_rx_cb
; idx
++) {
556 rx_cb
= &dev
->rx_cb
[idx
];
558 rx_cb
->rx_urb
= usb_alloc_urb(0, GFP_KERNEL
);
559 if (!rx_cb
->rx_urb
) {
560 rsi_dbg(ERR_ZONE
, "Failed alloc rx urb[%d]\n", idx
);
563 rx_cb
->ep_num
= idx
+ 1;
564 rx_cb
->data
= (void *)dev
;
566 skb_queue_head_init(&dev
->rx_q
);
567 rsi_init_event(&dev
->rx_thread
.event
);
568 if (rsi_create_kthread(adapter
->priv
, &dev
->rx_thread
,
569 rsi_usb_rx_thread
, "RX-Thread")) {
570 rsi_dbg(ERR_ZONE
, "%s: Unable to init rx thrd\n", __func__
);
577 usb_free_urb(dev
->rx_cb
[0].rx_urb
);
578 if (adapter
->priv
->coex_mode
> 1)
579 usb_free_urb(dev
->rx_cb
[1].rx_urb
);
585 * rsi_init_usb_interface() - This function initializes the usb interface.
586 * @adapter: Pointer to the adapter structure.
587 * @pfunction: Pointer to USB interface structure.
589 * Return: 0 on success, a negative error code on failure.
591 static int rsi_init_usb_interface(struct rsi_hw
*adapter
,
592 struct usb_interface
*pfunction
)
594 struct rsi_91x_usbdev
*rsi_dev
;
597 rsi_dev
= kzalloc(sizeof(*rsi_dev
), GFP_KERNEL
);
601 adapter
->rsi_dev
= rsi_dev
;
602 rsi_dev
->usbdev
= interface_to_usbdev(pfunction
);
603 rsi_dev
->priv
= (void *)adapter
;
605 if (rsi_find_bulk_in_and_out_endpoints(pfunction
, adapter
)) {
610 adapter
->device
= &pfunction
->dev
;
611 usb_set_intfdata(pfunction
, adapter
);
613 rsi_dev
->tx_buffer
= kmalloc(2048, GFP_KERNEL
);
614 if (!rsi_dev
->tx_buffer
) {
619 if (rsi_usb_init_rx(adapter
)) {
620 rsi_dbg(ERR_ZONE
, "Failed to init RX handle\n");
625 rsi_dev
->tx_blk_size
= 252;
626 adapter
->block_size
= rsi_dev
->tx_blk_size
;
628 /* Initializing function callbacks */
629 adapter
->check_hw_queue_status
= rsi_usb_check_queue_status
;
630 adapter
->determine_event_timeout
= rsi_usb_event_timeout
;
631 adapter
->rsi_host_intf
= RSI_HOST_INTF_USB
;
632 adapter
->host_intf_ops
= &usb_host_intf_ops
;
634 #ifdef CONFIG_RSI_DEBUGFS
635 /* In USB, one less than the MAX_DEBUGFS_ENTRIES entries is required */
636 adapter
->num_debugfs_entries
= (MAX_DEBUGFS_ENTRIES
- 1);
639 rsi_dbg(INIT_ZONE
, "%s: Enabled the interface\n", __func__
);
643 kfree(rsi_dev
->tx_buffer
);
651 static int usb_ulp_read_write(struct rsi_hw
*adapter
, u16 addr
, u32 data
,
656 ret
= rsi_usb_master_reg_write
657 (adapter
, RSI_GSPI_DATA_REG1
,
658 ((addr
<< 6) | ((data
>> 16) & 0xffff)), 2);
662 ret
= rsi_usb_master_reg_write(adapter
, RSI_GSPI_DATA_REG0
,
667 /* Initializing GSPI for ULP read/writes */
668 rsi_usb_master_reg_write(adapter
, RSI_GSPI_CTRL_REG0
,
669 RSI_GSPI_CTRL_REG0_VALUE
, 2);
671 ret
= rsi_usb_master_reg_write(adapter
, RSI_GSPI_CTRL_REG1
,
672 ((len_in_bits
- 1) | RSI_GSPI_TRIG
), 2);
681 static int rsi_reset_card(struct rsi_hw
*adapter
)
685 rsi_dbg(INFO_ZONE
, "Resetting Card...\n");
686 rsi_usb_master_reg_write(adapter
, RSI_TA_HOLD_REG
, 0xE, 4);
688 /* This msleep will ensure Thread-Arch processor to go to hold
689 * and any pending dma transfers to rf in device to finish.
693 ret
= rsi_usb_master_reg_write(adapter
, SWBL_REGOUT
,
694 RSI_FW_WDT_DISABLE_REQ
,
695 RSI_COMMON_REG_SIZE
);
697 rsi_dbg(ERR_ZONE
, "Disabling firmware watchdog timer failed\n");
701 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_1
,
702 RSI_ULP_WRITE_2
, 32);
705 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_2
,
706 RSI_ULP_WRITE_0
, 32);
709 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_DELAY_TIMER_1
,
710 RSI_ULP_WRITE_50
, 32);
713 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_DELAY_TIMER_2
,
714 RSI_ULP_WRITE_0
, 32);
717 ret
= usb_ulp_read_write(adapter
, RSI_WATCH_DOG_TIMER_ENABLE
,
718 RSI_ULP_TIMER_ENABLE
, 32);
722 rsi_dbg(INFO_ZONE
, "Reset card done\n");
726 rsi_dbg(ERR_ZONE
, "Reset card failed\n");
731 * rsi_probe() - This function is called by kernel when the driver provided
732 * Vendor and device IDs are matched. All the initialization
734 * @pfunction: Pointer to the USB interface structure.
735 * @id: Pointer to the usb_device_id structure.
737 * Return: 0 on success, a negative error code on failure.
739 static int rsi_probe(struct usb_interface
*pfunction
,
740 const struct usb_device_id
*id
)
742 struct rsi_hw
*adapter
;
743 struct rsi_91x_usbdev
*dev
;
747 rsi_dbg(INIT_ZONE
, "%s: Init function called\n", __func__
);
749 adapter
= rsi_91x_init(dev_oper_mode
);
751 rsi_dbg(ERR_ZONE
, "%s: Failed to init os intf ops\n",
755 adapter
->rsi_host_intf
= RSI_HOST_INTF_USB
;
757 status
= rsi_init_usb_interface(adapter
, pfunction
);
759 rsi_dbg(ERR_ZONE
, "%s: Failed to init usb interface\n",
764 rsi_dbg(ERR_ZONE
, "%s: Initialized os intf ops\n", __func__
);
766 dev
= (struct rsi_91x_usbdev
*)adapter
->rsi_dev
;
768 status
= rsi_usb_reg_read(dev
->usbdev
, FW_STATUS_REG
, &fw_status
, 2);
775 rsi_dbg(INIT_ZONE
, "Loading firmware...\n");
776 status
= rsi_hal_device_init(adapter
);
778 rsi_dbg(ERR_ZONE
, "%s: Failed in device init\n",
782 rsi_dbg(INIT_ZONE
, "%s: Device Init Done\n", __func__
);
785 status
= rsi_rx_urb_submit(adapter
, WLAN_EP
);
789 if (adapter
->priv
->coex_mode
> 1) {
790 status
= rsi_rx_urb_submit(adapter
, BT_EP
);
797 rsi_deinit_usb_interface(adapter
);
799 rsi_91x_deinit(adapter
);
800 rsi_dbg(ERR_ZONE
, "%s: Failed in probe...Exiting\n", __func__
);
805 * rsi_disconnect() - This function performs the reverse of the probe function,
806 * it deinitialize the driver structure.
807 * @pfunction: Pointer to the USB interface structure.
811 static void rsi_disconnect(struct usb_interface
*pfunction
)
813 struct rsi_hw
*adapter
= usb_get_intfdata(pfunction
);
818 rsi_mac80211_detach(adapter
);
819 rsi_reset_card(adapter
);
820 rsi_deinit_usb_interface(adapter
);
821 rsi_91x_deinit(adapter
);
823 rsi_dbg(INFO_ZONE
, "%s: Deinitialization completed\n", __func__
);
827 static int rsi_suspend(struct usb_interface
*intf
, pm_message_t message
)
829 /* Not yet implemented */
833 static int rsi_resume(struct usb_interface
*intf
)
835 /* Not yet implemented */
840 static const struct usb_device_id rsi_dev_table
[] = {
841 { USB_DEVICE(RSI_USB_VID_9113
, RSI_USB_PID_9113
) },
845 static struct usb_driver rsi_driver
= {
846 .name
= "RSI-USB WLAN",
848 .disconnect
= rsi_disconnect
,
849 .id_table
= rsi_dev_table
,
851 .suspend
= rsi_suspend
,
852 .resume
= rsi_resume
,
856 module_usb_driver(rsi_driver
);
858 MODULE_AUTHOR("Redpine Signals Inc");
859 MODULE_DESCRIPTION("Common USB layer for RSI drivers");
860 MODULE_SUPPORTED_DEVICE("RSI-91x");
861 MODULE_DEVICE_TABLE(usb
, rsi_dev_table
);
862 MODULE_FIRMWARE(FIRMWARE_RSI9113
);
863 MODULE_VERSION("0.1");
864 MODULE_LICENSE("Dual BSD/GPL");