diff options
author | John W. Linville <linville@tuxdriver.com> | 2014-04-10 09:58:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-04-10 09:58:06 -0400 |
commit | 029d3ac9722d23e4f3b65656878cb3e4d9e280d4 (patch) | |
tree | a36c7979ab8735455128fd34e678bc6888d5c2ea /drivers/net/wireless/rsi | |
parent | f34c4a35d87949fbb0e0f31eba3c054e9f8199ba (diff) | |
parent | 5869e795e07ded955744ab99765d0f183f825f97 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Diffstat (limited to 'drivers/net/wireless/rsi')
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_core.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_debugfs.c | 35 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_mgmt.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_sdio.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_usb.c | 26 |
6 files changed, 49 insertions, 37 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c index e89535e86caf..1a8d32138593 100644 --- a/drivers/net/wireless/rsi/rsi_91x_core.c +++ b/drivers/net/wireless/rsi/rsi_91x_core.c | |||
@@ -102,10 +102,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | get_queue_num: | 104 | get_queue_num: |
105 | q_num = 0; | ||
106 | recontend_queue = false; | 105 | recontend_queue = false; |
107 | 106 | ||
108 | q_num = rsi_determine_min_weight_queue(common); | 107 | q_num = rsi_determine_min_weight_queue(common); |
108 | |||
109 | q_len = skb_queue_len(&common->tx_queue[ii]); | 109 | q_len = skb_queue_len(&common->tx_queue[ii]); |
110 | ii = q_num; | 110 | ii = q_num; |
111 | 111 | ||
@@ -118,7 +118,9 @@ get_queue_num: | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | common->tx_qinfo[q_num].pkt_contended = 0; | 121 | if (q_num < NUM_EDCA_QUEUES) |
122 | common->tx_qinfo[q_num].pkt_contended = 0; | ||
123 | |||
122 | /* Adjust the back off values for all queues again */ | 124 | /* Adjust the back off values for all queues again */ |
123 | recontend_queue = rsi_recalculate_weights(common); | 125 | recontend_queue = rsi_recalculate_weights(common); |
124 | 126 | ||
diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c index 7e4ef4554411..c466246a323f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c | |||
@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) | |||
289 | const struct rsi_dbg_files *files; | 289 | const struct rsi_dbg_files *files; |
290 | 290 | ||
291 | dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); | 291 | dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); |
292 | if (!dev_dbgfs) | ||
293 | return -ENOMEM; | ||
294 | |||
292 | adapter->dfsentry = dev_dbgfs; | 295 | adapter->dfsentry = dev_dbgfs; |
293 | 296 | ||
294 | snprintf(devdir, sizeof(devdir), "%s", | 297 | snprintf(devdir, sizeof(devdir), "%s", |
295 | wiphy_name(adapter->hw->wiphy)); | 298 | wiphy_name(adapter->hw->wiphy)); |
296 | dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL); | ||
297 | 299 | ||
298 | if (IS_ERR(dev_dbgfs->subdir)) { | 300 | dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL); |
299 | if (dev_dbgfs->subdir == ERR_PTR(-ENODEV)) | ||
300 | rsi_dbg(ERR_ZONE, | ||
301 | "%s:Debugfs has not been mounted\n", __func__); | ||
302 | else | ||
303 | rsi_dbg(ERR_ZONE, "debugfs:%s not created\n", devdir); | ||
304 | 301 | ||
305 | adapter->dfsentry = NULL; | 302 | if (!dev_dbgfs->subdir) { |
306 | kfree(dev_dbgfs); | 303 | kfree(dev_dbgfs); |
307 | return (int)PTR_ERR(dev_dbgfs->subdir); | 304 | return -ENOMEM; |
308 | } else { | 305 | } |
309 | for (ii = 0; ii < adapter->num_debugfs_entries; ii++) { | 306 | |
310 | files = &dev_debugfs_files[ii]; | 307 | for (ii = 0; ii < adapter->num_debugfs_entries; ii++) { |
311 | dev_dbgfs->rsi_files[ii] = | 308 | files = &dev_debugfs_files[ii]; |
312 | debugfs_create_file(files->name, | 309 | dev_dbgfs->rsi_files[ii] = |
313 | files->perms, | 310 | debugfs_create_file(files->name, |
314 | dev_dbgfs->subdir, | 311 | files->perms, |
315 | common, | 312 | dev_dbgfs->subdir, |
316 | &files->fops); | 313 | common, |
317 | } | 314 | &files->fops); |
318 | } | 315 | } |
319 | return 0; | 316 | return 0; |
320 | } | 317 | } |
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 2361a6849ad7..73694295648f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c | |||
@@ -738,7 +738,7 @@ int rsi_hal_load_key(struct rsi_common *common, | |||
738 | * | 738 | * |
739 | * Return: 0 on success, corresponding error code on failure. | 739 | * Return: 0 on success, corresponding error code on failure. |
740 | */ | 740 | */ |
741 | static u8 rsi_load_bootup_params(struct rsi_common *common) | 741 | static int rsi_load_bootup_params(struct rsi_common *common) |
742 | { | 742 | { |
743 | struct sk_buff *skb; | 743 | struct sk_buff *skb; |
744 | struct rsi_boot_params *boot_params; | 744 | struct rsi_boot_params *boot_params; |
@@ -1272,6 +1272,7 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) | |||
1272 | { | 1272 | { |
1273 | s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff); | 1273 | s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff); |
1274 | u16 msg_type = (msg[2]); | 1274 | u16 msg_type = (msg[2]); |
1275 | int ret; | ||
1275 | 1276 | ||
1276 | rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n", | 1277 | rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n", |
1277 | __func__, msg_len, msg_type); | 1278 | __func__, msg_len, msg_type); |
@@ -1284,8 +1285,9 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) | |||
1284 | if (common->fsm_state == FSM_CARD_NOT_READY) { | 1285 | if (common->fsm_state == FSM_CARD_NOT_READY) { |
1285 | rsi_set_default_parameters(common); | 1286 | rsi_set_default_parameters(common); |
1286 | 1287 | ||
1287 | if (rsi_load_bootup_params(common)) | 1288 | ret = rsi_load_bootup_params(common); |
1288 | return -ENOMEM; | 1289 | if (ret) |
1290 | return ret; | ||
1289 | else | 1291 | else |
1290 | common->fsm_state = FSM_BOOT_PARAMS_SENT; | 1292 | common->fsm_state = FSM_BOOT_PARAMS_SENT; |
1291 | } else { | 1293 | } else { |
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 852453f386e2..2e39d38d6a9e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c | |||
@@ -756,12 +756,13 @@ fail: | |||
756 | static void rsi_disconnect(struct sdio_func *pfunction) | 756 | static void rsi_disconnect(struct sdio_func *pfunction) |
757 | { | 757 | { |
758 | struct rsi_hw *adapter = sdio_get_drvdata(pfunction); | 758 | struct rsi_hw *adapter = sdio_get_drvdata(pfunction); |
759 | struct rsi_91x_sdiodev *dev = | 759 | struct rsi_91x_sdiodev *dev; |
760 | (struct rsi_91x_sdiodev *)adapter->rsi_dev; | ||
761 | 760 | ||
762 | if (!adapter) | 761 | if (!adapter) |
763 | return; | 762 | return; |
764 | 763 | ||
764 | dev = (struct rsi_91x_sdiodev *)adapter->rsi_dev; | ||
765 | |||
765 | dev->write_fail = 2; | 766 | dev->write_fail = 2; |
766 | rsi_mac80211_detach(adapter); | 767 | rsi_mac80211_detach(adapter); |
767 | 768 | ||
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c index f1cb99cafed8..20d11ccfffe3 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | |||
@@ -247,7 +247,7 @@ static int rsi_process_pkt(struct rsi_common *common) | |||
247 | if (!common->rx_data_pkt) { | 247 | if (!common->rx_data_pkt) { |
248 | rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n", | 248 | rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n", |
249 | __func__); | 249 | __func__); |
250 | return -1; | 250 | return -ENOMEM; |
251 | } | 251 | } |
252 | 252 | ||
253 | status = rsi_sdio_host_intf_read_pkt(adapter, | 253 | status = rsi_sdio_host_intf_read_pkt(adapter, |
@@ -260,12 +260,10 @@ static int rsi_process_pkt(struct rsi_common *common) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | status = rsi_read_pkt(common, rcv_pkt_len); | 262 | status = rsi_read_pkt(common, rcv_pkt_len); |
263 | kfree(common->rx_data_pkt); | ||
264 | return status; | ||
265 | 263 | ||
266 | fail: | 264 | fail: |
267 | kfree(common->rx_data_pkt); | 265 | kfree(common->rx_data_pkt); |
268 | return -1; | 266 | return status; |
269 | } | 267 | } |
270 | 268 | ||
271 | /** | 269 | /** |
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index bb1bf96670eb..4c46e5631e2f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c | |||
@@ -154,24 +154,30 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, | |||
154 | u16 *value, | 154 | u16 *value, |
155 | u16 len) | 155 | u16 len) |
156 | { | 156 | { |
157 | u8 temp_buf[4]; | 157 | u8 *buf; |
158 | int status = 0; | 158 | int status = -ENOMEM; |
159 | |||
160 | buf = kmalloc(0x04, GFP_KERNEL); | ||
161 | if (!buf) | ||
162 | return status; | ||
159 | 163 | ||
160 | status = usb_control_msg(usbdev, | 164 | status = usb_control_msg(usbdev, |
161 | usb_rcvctrlpipe(usbdev, 0), | 165 | usb_rcvctrlpipe(usbdev, 0), |
162 | USB_VENDOR_REGISTER_READ, | 166 | USB_VENDOR_REGISTER_READ, |
163 | USB_TYPE_VENDOR, | 167 | USB_TYPE_VENDOR, |
164 | ((reg & 0xffff0000) >> 16), (reg & 0xffff), | 168 | ((reg & 0xffff0000) >> 16), (reg & 0xffff), |
165 | (void *)temp_buf, | 169 | (void *)buf, |
166 | len, | 170 | len, |
167 | HZ * 5); | 171 | HZ * 5); |
168 | 172 | ||
169 | *value = (temp_buf[0] | (temp_buf[1] << 8)); | 173 | *value = (buf[0] | (buf[1] << 8)); |
170 | if (status < 0) { | 174 | if (status < 0) { |
171 | rsi_dbg(ERR_ZONE, | 175 | rsi_dbg(ERR_ZONE, |
172 | "%s: Reg read failed with error code :%d\n", | 176 | "%s: Reg read failed with error code :%d\n", |
173 | __func__, status); | 177 | __func__, status); |
174 | } | 178 | } |
179 | kfree(buf); | ||
180 | |||
175 | return status; | 181 | return status; |
176 | } | 182 | } |
177 | 183 | ||
@@ -190,8 +196,12 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, | |||
190 | u16 value, | 196 | u16 value, |
191 | u16 len) | 197 | u16 len) |
192 | { | 198 | { |
193 | u8 usb_reg_buf[4]; | 199 | u8 *usb_reg_buf; |
194 | int status = 0; | 200 | int status = -ENOMEM; |
201 | |||
202 | usb_reg_buf = kmalloc(0x04, GFP_KERNEL); | ||
203 | if (!usb_reg_buf) | ||
204 | return status; | ||
195 | 205 | ||
196 | usb_reg_buf[0] = (value & 0x00ff); | 206 | usb_reg_buf[0] = (value & 0x00ff); |
197 | usb_reg_buf[1] = (value & 0xff00) >> 8; | 207 | usb_reg_buf[1] = (value & 0xff00) >> 8; |
@@ -212,6 +222,8 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, | |||
212 | "%s: Reg write failed with error code :%d\n", | 222 | "%s: Reg write failed with error code :%d\n", |
213 | __func__, status); | 223 | __func__, status); |
214 | } | 224 | } |
225 | kfree(usb_reg_buf); | ||
226 | |||
215 | return status; | 227 | return status; |
216 | } | 228 | } |
217 | 229 | ||
@@ -286,7 +298,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter, | |||
286 | return -ENOMEM; | 298 | return -ENOMEM; |
287 | 299 | ||
288 | while (count) { | 300 | while (count) { |
289 | transfer = min_t(int, count, 4096); | 301 | transfer = (u8)(min_t(u32, count, 4096)); |
290 | memcpy(buf, data, transfer); | 302 | memcpy(buf, data, transfer); |
291 | status = usb_control_msg(dev->usbdev, | 303 | status = usb_control_msg(dev->usbdev, |
292 | usb_sndctrlpipe(dev->usbdev, 0), | 304 | usb_sndctrlpipe(dev->usbdev, 0), |