Commit 0a60014b authored by Siva Rebbagondla's avatar Siva Rebbagondla Committed by Kalle Valo

rsi: miscallaneous changes for 9116 and common

Below changes are done:
* Device 80MHz clock should be disabled for 9116 in 20MHz band.
* Default edca parameters should be used initially before
  connection.
* Default TA aggregation is 3 for 9116.
* Bootup parameters should be loaded first when channel is
  changed.
* 4 byte register writes are possible for 9116.
Signed-off-by: default avatarSiva Rebbagondla <siva8118@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 17ff2c79
...@@ -424,6 +424,10 @@ static int rsi_load_radio_caps(struct rsi_common *common) ...@@ -424,6 +424,10 @@ static int rsi_load_radio_caps(struct rsi_common *common)
} }
radio_caps->radio_info |= radio_id; radio_caps->radio_info |= radio_id;
if (adapter->device_model == RSI_DEV_9116 &&
common->channel_width == BW_20MHZ)
radio_caps->radio_cfg_info &= ~0x3;
radio_caps->sifs_tx_11n = cpu_to_le16(SIFS_TX_11N_VALUE); radio_caps->sifs_tx_11n = cpu_to_le16(SIFS_TX_11N_VALUE);
radio_caps->sifs_tx_11b = cpu_to_le16(SIFS_TX_11B_VALUE); radio_caps->sifs_tx_11b = cpu_to_le16(SIFS_TX_11B_VALUE);
radio_caps->slot_rx_11n = cpu_to_le16(SHORT_SLOT_VALUE); radio_caps->slot_rx_11n = cpu_to_le16(SHORT_SLOT_VALUE);
...@@ -439,14 +443,16 @@ static int rsi_load_radio_caps(struct rsi_common *common) ...@@ -439,14 +443,16 @@ static int rsi_load_radio_caps(struct rsi_common *common)
} }
for (ii = 0; ii < NUM_EDCA_QUEUES; ii++) { for (ii = 0; ii < NUM_EDCA_QUEUES; ii++) {
radio_caps->qos_params[ii].cont_win_min_q = if (common->edca_params[ii].cw_max > 0) {
cpu_to_le16(common->edca_params[ii].cw_min); radio_caps->qos_params[ii].cont_win_min_q =
radio_caps->qos_params[ii].cont_win_max_q = cpu_to_le16(common->edca_params[ii].cw_min);
cpu_to_le16(common->edca_params[ii].cw_max); radio_caps->qos_params[ii].cont_win_max_q =
radio_caps->qos_params[ii].aifsn_val_q = cpu_to_le16(common->edca_params[ii].cw_max);
cpu_to_le16((common->edca_params[ii].aifs) << 8); radio_caps->qos_params[ii].aifsn_val_q =
radio_caps->qos_params[ii].txop_q = cpu_to_le16(common->edca_params[ii].aifs << 8);
cpu_to_le16(common->edca_params[ii].txop); radio_caps->qos_params[ii].txop_q =
cpu_to_le16(common->edca_params[ii].txop);
}
} }
radio_caps->qos_params[BROADCAST_HW_Q].txop_q = cpu_to_le16(0xffff); radio_caps->qos_params[BROADCAST_HW_Q].txop_q = cpu_to_le16(0xffff);
...@@ -1026,6 +1032,11 @@ static int rsi_send_reset_mac(struct rsi_common *common) ...@@ -1026,6 +1032,11 @@ static int rsi_send_reset_mac(struct rsi_common *common)
mgmt_frame->desc_word[1] = cpu_to_le16(RESET_MAC_REQ); mgmt_frame->desc_word[1] = cpu_to_le16(RESET_MAC_REQ);
mgmt_frame->desc_word[4] = cpu_to_le16(RETRY_COUNT << 8); mgmt_frame->desc_word[4] = cpu_to_le16(RETRY_COUNT << 8);
#define RSI_9116_DEF_TA_AGGR 3
if (common->priv->device_model == RSI_DEV_9116)
mgmt_frame->desc_word[3] |=
cpu_to_le16(RSI_9116_DEF_TA_AGGR << 8);
skb_put(skb, FRAME_DESC_SZ); skb_put(skb, FRAME_DESC_SZ);
return rsi_send_internal_mgmt_frame(common, skb); return rsi_send_internal_mgmt_frame(common, skb);
......
...@@ -213,7 +213,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, ...@@ -213,7 +213,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev,
*/ */
static int rsi_usb_reg_write(struct usb_device *usbdev, static int rsi_usb_reg_write(struct usb_device *usbdev,
u32 reg, u32 reg,
u16 value, u32 value,
u16 len) u16 len)
{ {
u8 *usb_reg_buf; u8 *usb_reg_buf;
...@@ -226,17 +226,17 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, ...@@ -226,17 +226,17 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
if (!usb_reg_buf) if (!usb_reg_buf)
return status; return status;
usb_reg_buf[0] = (value & 0x00ff); usb_reg_buf[0] = (cpu_to_le32(value) & 0x00ff);
usb_reg_buf[1] = (value & 0xff00) >> 8; usb_reg_buf[1] = (cpu_to_le32(value) & 0xff00) >> 8;
usb_reg_buf[2] = 0x0; usb_reg_buf[2] = (cpu_to_le32(value) & 0x00ff0000) >> 16;
usb_reg_buf[3] = 0x0; usb_reg_buf[3] = (cpu_to_le32(value) & 0xff000000) >> 24;
status = usb_control_msg(usbdev, status = usb_control_msg(usbdev,
usb_sndctrlpipe(usbdev, 0), usb_sndctrlpipe(usbdev, 0),
USB_VENDOR_REGISTER_WRITE, USB_VENDOR_REGISTER_WRITE,
RSI_USB_REQ_OUT, RSI_USB_REQ_OUT,
((reg & 0xffff0000) >> 16), ((cpu_to_le32(reg) & 0xffff0000) >> 16),
(reg & 0xffff), (cpu_to_le32(reg) & 0xffff),
(void *)usb_reg_buf, (void *)usb_reg_buf,
len, len,
USB_CTRL_SET_TIMEOUT); USB_CTRL_SET_TIMEOUT);
...@@ -263,8 +263,10 @@ static void rsi_rx_done_handler(struct urb *urb) ...@@ -263,8 +263,10 @@ static void rsi_rx_done_handler(struct urb *urb)
struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)rx_cb->data; struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)rx_cb->data;
int status = -EINVAL; int status = -EINVAL;
if (urb->status) if (urb->status) {
goto out; dev_kfree_skb(rx_cb->rx_skb);
return;
}
if (urb->actual_length <= 0 || if (urb->actual_length <= 0 ||
urb->actual_length > rx_cb->rx_skb->len) { urb->actual_length > rx_cb->rx_skb->len) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment