Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: align to fix warnings of line over 80 characters

Align to fix multiple warnings of line over 80 characters.
Issue detected by checkpatch tool.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191113110052.14855-1-jbi.octave@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jules Irenge and committed by
Greg Kroah-Hartman
8c7128c4 7a367489

+407 -195
+3 -1
drivers/staging/wfx/bus_sdio.c
··· 188 188 189 189 bus->func = func; 190 190 sdio_set_drvdata(func, bus); 191 - func->card->quirks |= MMC_QUIRK_LENIENT_FN0 | MMC_QUIRK_BLKSZ_FOR_BYTE_MODE | MMC_QUIRK_BROKEN_BYTE_MODE_512; 191 + func->card->quirks |= MMC_QUIRK_LENIENT_FN0 | 192 + MMC_QUIRK_BLKSZ_FOR_BYTE_MODE | 193 + MMC_QUIRK_BROKEN_BYTE_MODE_512; 192 194 193 195 sdio_claim_host(func); 194 196 ret = sdio_enable_func(func);
+2 -1
drivers/staging/wfx/data_rx.h
··· 13 13 struct wfx_vif; 14 14 struct sk_buff; 15 15 16 - void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, struct sk_buff *skb); 16 + void wfx_rx_cb(struct wfx_vif *wvif, struct hif_ind_rx *arg, 17 + struct sk_buff *skb); 17 18 18 19 #endif /* WFX_DATA_RX_H */
+10 -5
drivers/staging/wfx/debug.c
··· 72 72 return -EIO; 73 73 74 74 #define PUT_COUNTER(name) \ 75 - seq_printf(seq, "%24s %d\n", #name ":", le32_to_cpu(counters.count_##name)) 75 + seq_printf(seq, "%24s %d\n", #name ":",\ 76 + le32_to_cpu(counters.count_##name)) 76 77 77 78 PUT_COUNTER(tx_packets); 78 79 PUT_COUNTER(tx_multicast_frames); ··· 212 211 int ret; 213 212 }; 214 213 215 - static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user_buf, 214 + static ssize_t wfx_send_hif_msg_write(struct file *file, 215 + const char __user *user_buf, 216 216 size_t count, loff_t *ppos) 217 217 { 218 218 struct dbgfs_hif_msg *context = file->private_data; ··· 238 236 kfree(request); 239 237 return -EINVAL; 240 238 } 241 - context->ret = wfx_cmd_send(wdev, request, context->reply, sizeof(context->reply), false); 239 + context->ret = wfx_cmd_send(wdev, request, context->reply, 240 + sizeof(context->reply), false); 242 241 243 242 kfree(request); 244 243 complete(&context->complete); ··· 302 299 debugfs_create_file("counters", 0444, d, wdev, &wfx_counters_fops); 303 300 debugfs_create_file("rx_stats", 0444, d, wdev, &wfx_rx_stats_fops); 304 301 debugfs_create_file("send_pds", 0200, d, wdev, &wfx_send_pds_fops); 305 - debugfs_create_file("burn_slk_key", 0200, d, wdev, &wfx_burn_slk_key_fops); 306 - debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops); 302 + debugfs_create_file("burn_slk_key", 0200, d, wdev, 303 + &wfx_burn_slk_key_fops); 304 + debugfs_create_file("send_hif_msg", 0600, d, wdev, 305 + &wfx_send_hif_msg_fops); 307 306 308 307 return 0; 309 308 }
+45 -20
drivers/staging/wfx/fwio.c
··· 107 107 const char *data; 108 108 int ret; 109 109 110 - snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw, keyset_chip); 110 + snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw, 111 + keyset_chip); 111 112 ret = firmware_request_nowarn(fw, filename, wdev->dev); 112 113 if (ret) { 113 - dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", filename, wdev->pdata.file_fw); 114 - snprintf(filename, sizeof(filename), "%s.sec", wdev->pdata.file_fw); 114 + dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", 115 + filename, wdev->pdata.file_fw); 116 + snprintf(filename, sizeof(filename), "%s.sec", 117 + wdev->pdata.file_fw); 115 118 ret = request_firmware(fw, filename, wdev->dev); 116 119 if (ret) { 117 120 dev_err(wdev->dev, "can't load %s\n", filename); ··· 167 164 return -ETIMEDOUT; 168 165 } 169 166 if (ktime_compare(now, start)) 170 - dev_dbg(wdev->dev, "chip answer after %lldus\n", ktime_us_delta(now, start)); 167 + dev_dbg(wdev->dev, "chip answer after %lldus\n", 168 + ktime_us_delta(now, start)); 171 169 else 172 170 dev_dbg(wdev->dev, "chip answer immediately\n"); 173 171 return 0; ··· 192 188 if (ret < 0) 193 189 return ret; 194 190 now = ktime_get(); 195 - if (offs + DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE) 191 + if (offs + 192 + DNLD_BLOCK_SIZE - bytes_done < DNLD_FIFO_SIZE) 196 193 break; 197 194 if (ktime_after(now, ktime_add_ms(start, DCA_TIMEOUT))) 198 195 return -ETIMEDOUT; 199 196 } 200 197 if (ktime_compare(now, start)) 201 - dev_dbg(wdev->dev, "answer after %lldus\n", ktime_us_delta(now, start)); 198 + dev_dbg(wdev->dev, "answer after %lldus\n", 199 + ktime_us_delta(now, start)); 202 200 203 - ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE), 201 + ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO + 202 + (offs % DNLD_FIFO_SIZE), 204 203 data + offs, DNLD_BLOCK_SIZE); 205 204 if (ret < 0) 206 205 return ret; ··· 227 220 dev_info(wdev->dev, "no error reported by secure boot\n"); 228 221 } else { 229 222 sram_reg_read(wdev, WFX_ERR_INFO, &val32); 230 - if (val32 < ARRAY_SIZE(fwio_error_strings) && fwio_error_strings[val32]) 231 - dev_info(wdev->dev, "secure boot error: %s\n", fwio_error_strings[val32]); 223 + if (val32 < ARRAY_SIZE(fwio_error_strings) && 224 + fwio_error_strings[val32]) 225 + dev_info(wdev->dev, "secure boot error: %s\n", 226 + fwio_error_strings[val32]); 232 227 else 233 - dev_info(wdev->dev, "secure boot error: Unknown (0x%02x)\n", val32); 228 + dev_info(wdev->dev, 229 + "secure boot error: Unknown (0x%02x)\n", 230 + val32); 234 231 } 235 232 } 236 233 ··· 273 262 goto error; 274 263 275 264 sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); // Fifo init 276 - sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", FW_VERSION_SIZE); 277 - sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, FW_SIGNATURE_SIZE); 278 - sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + FW_SIGNATURE_SIZE, FW_HASH_SIZE); 265 + sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", 266 + FW_VERSION_SIZE); 267 + sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, 268 + FW_SIGNATURE_SIZE); 269 + sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, 270 + fw->data + fw_offset + FW_SIGNATURE_SIZE, 271 + FW_HASH_SIZE); 279 272 sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size); 280 273 sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING); 281 274 ret = wait_ncp_status(wdev, NCP_DOWNLOAD_PENDING); ··· 287 272 goto error; 288 273 289 274 start = ktime_get(); 290 - ret = upload_firmware(wdev, fw->data + header_size, fw->size - header_size); 275 + ret = upload_firmware(wdev, fw->data + header_size, 276 + fw->size - header_size); 291 277 if (ret) 292 278 goto error; 293 - dev_dbg(wdev->dev, "firmware load after %lldus\n", ktime_us_delta(ktime_get(), start)); 279 + dev_dbg(wdev->dev, "firmware load after %lldus\n", 280 + ktime_us_delta(ktime_get(), start)); 294 281 295 282 sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE); 296 283 ret = wait_ncp_status(wdev, NCP_AUTH_OK); ··· 327 310 }; 328 311 329 312 for (i = 0; i < ARRAY_SIZE(gpr_init); i++) { 330 - ret = igpr_reg_write(wdev, gpr_init[i].index, gpr_init[i].value); 313 + ret = igpr_reg_write(wdev, gpr_init[i].index, 314 + gpr_init[i].value); 331 315 if (ret < 0) 332 316 return ret; 333 - dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, gpr_init[i].value); 317 + dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, 318 + gpr_init[i].value); 334 319 } 335 320 return 0; 336 321 } ··· 367 348 368 349 hw_revision = FIELD_GET(CFG_DEVICE_ID_MAJOR, reg); 369 350 if (hw_revision == 0 || hw_revision > 2) { 370 - dev_err(wdev->dev, "bad hardware revision number: %d\n", hw_revision); 351 + dev_err(wdev->dev, "bad hardware revision number: %d\n", 352 + hw_revision); 371 353 return -ENODEV; 372 354 } 373 355 hw_type = FIELD_GET(CFG_DEVICE_ID_TYPE, reg); ··· 395 375 return -ETIMEDOUT; 396 376 } 397 377 } 398 - dev_dbg(wdev->dev, "chip wake up after %lldus\n", ktime_us_delta(now, start)); 378 + dev_dbg(wdev->dev, "chip wake up after %lldus\n", 379 + ktime_us_delta(now, start)); 399 380 400 381 ret = config_reg_write_bits(wdev, CFG_CPU_RESET, 0); 401 382 if (ret < 0) ··· 404 383 ret = load_firmware_secure(wdev); 405 384 if (ret < 0) 406 385 return ret; 407 - ret = config_reg_write_bits(wdev, CFG_DIRECT_ACCESS_MODE | CFG_IRQ_ENABLE_DATA | CFG_IRQ_ENABLE_WRDY, CFG_IRQ_ENABLE_DATA); 386 + ret = config_reg_write_bits(wdev, 387 + CFG_DIRECT_ACCESS_MODE | 388 + CFG_IRQ_ENABLE_DATA | 389 + CFG_IRQ_ENABLE_WRDY, 390 + CFG_IRQ_ENABLE_DATA); 408 391 return ret; 409 392 }
+53 -25
drivers/staging/wfx/hif_rx.c
··· 18 18 #include "secure_link.h" 19 19 #include "hif_api_cmd.h" 20 20 21 - static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 21 + static int hif_generic_confirm(struct wfx_dev *wdev, struct hif_msg *hif, 22 + void *buf) 22 23 { 23 24 // All confirm messages start with status 24 25 int status = le32_to_cpu(*((__le32 *) buf)); ··· 34 33 } 35 34 36 35 if (cmd != wdev->hif_cmd.buf_send->id) { 37 - dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n", 36 + dev_warn(wdev->dev, 37 + "chip response mismatch request: 0x%.2x vs 0x%.2x\n", 38 38 cmd, wdev->hif_cmd.buf_send->id); 39 39 return -EINVAL; 40 40 } ··· 72 70 return 0; 73 71 } 74 72 75 - static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 73 + static int hif_multi_tx_confirm(struct wfx_dev *wdev, struct hif_msg *hif, 74 + void *buf) 76 75 { 77 76 struct hif_cnf_multi_transmit *body = buf; 78 77 struct hif_cnf_tx *buf_loc = (struct hif_cnf_tx *) &body->tx_conf_payload; ··· 93 90 return 0; 94 91 } 95 92 96 - static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 93 + static int hif_startup_indication(struct wfx_dev *wdev, struct hif_msg *hif, 94 + void *buf) 97 95 { 98 96 struct hif_ind_startup *body = buf; 99 97 ··· 112 108 return 0; 113 109 } 114 110 115 - static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 111 + static int hif_wakeup_indication(struct wfx_dev *wdev, struct hif_msg *hif, 112 + void *buf) 116 113 { 117 114 if (!wdev->pdata.gpio_wakeup 118 115 || !gpiod_get_value(wdev->pdata.gpio_wakeup)) { ··· 123 118 return 0; 124 119 } 125 120 126 - static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 121 + static int hif_keys_indication(struct wfx_dev *wdev, struct hif_msg *hif, 122 + void *buf) 127 123 { 128 124 struct hif_ind_sl_exchange_pub_keys *body = buf; 129 125 ··· 137 131 return 0; 138 132 } 139 133 140 - static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf, struct sk_buff *skb) 134 + static int hif_receive_indication(struct wfx_dev *wdev, struct hif_msg *hif, 135 + void *buf, struct sk_buff *skb) 141 136 { 142 137 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 143 138 struct hif_ind_rx *body = buf; 144 139 145 140 if (!wvif) { 146 - dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", hif->interface); 141 + dev_warn(wdev->dev, "ignore rx data for non-existent vif %d\n", 142 + hif->interface); 147 143 return 0; 148 144 } 149 145 skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx)); ··· 154 146 return 0; 155 147 } 156 148 157 - static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 149 + static int hif_event_indication(struct wfx_dev *wdev, struct hif_msg *hif, 150 + void *buf) 158 151 { 159 152 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 160 153 struct hif_ind_event *body = buf; ··· 182 173 return 0; 183 174 } 184 175 185 - static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 176 + static int hif_pm_mode_complete_indication(struct wfx_dev *wdev, 177 + struct hif_msg *hif, void *buf) 186 178 { 187 179 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 188 180 ··· 193 183 return 0; 194 184 } 195 185 196 - static int hif_scan_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 186 + static int hif_scan_complete_indication(struct wfx_dev *wdev, 187 + struct hif_msg *hif, void *buf) 197 188 { 198 189 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 199 190 struct hif_ind_scan_cmpl *body = buf; ··· 205 194 return 0; 206 195 } 207 196 208 - static int hif_join_complete_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 197 + static int hif_join_complete_indication(struct wfx_dev *wdev, 198 + struct hif_msg *hif, void *buf) 209 199 { 210 200 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 211 201 ··· 216 204 return 0; 217 205 } 218 206 219 - static int hif_suspend_resume_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 207 + static int hif_suspend_resume_indication(struct wfx_dev *wdev, 208 + struct hif_msg *hif, void *buf) 220 209 { 221 210 struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); 222 211 struct hif_ind_suspend_resume_tx *body = buf; ··· 228 215 return 0; 229 216 } 230 217 231 - static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 218 + static int hif_error_indication(struct wfx_dev *wdev, struct hif_msg *hif, 219 + void *buf) 232 220 { 233 221 struct hif_ind_error *body = buf; 234 222 u8 *pRollback = (u8 *) body->data; ··· 237 223 238 224 switch (body->type) { 239 225 case HIF_ERROR_FIRMWARE_ROLLBACK: 240 - dev_err(wdev->dev, "asynchronous error: firmware rollback error %d\n", *pRollback); 226 + dev_err(wdev->dev, 227 + "asynchronous error: firmware rollback error %d\n", 228 + *pRollback); 241 229 break; 242 230 case HIF_ERROR_FIRMWARE_DEBUG_ENABLED: 243 231 dev_err(wdev->dev, "asynchronous error: firmware debug feature enabled\n"); 244 232 break; 245 233 case HIF_ERROR_OUTDATED_SESSION_KEY: 246 - dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", *pStatus); 234 + dev_err(wdev->dev, "asynchronous error: secure link outdated key: %#.8x\n", 235 + *pStatus); 247 236 break; 248 237 case HIF_ERROR_INVALID_SESSION_KEY: 249 238 dev_err(wdev->dev, "asynchronous error: invalid session key\n"); 250 239 break; 251 240 case HIF_ERROR_OOR_VOLTAGE: 252 - dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", *pStatus); 241 + dev_err(wdev->dev, "asynchronous error: out-of-range overvoltage: %#.8x\n", 242 + *pStatus); 253 243 break; 254 244 case HIF_ERROR_PDS_VERSION: 255 - dev_err(wdev->dev, "asynchronous error: wrong PDS payload or version: %#.8x\n", *pStatus); 245 + dev_err(wdev->dev, 246 + "asynchronous error: wrong PDS payload or version: %#.8x\n", 247 + *pStatus); 256 248 break; 257 249 default: 258 - dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", body->type); 250 + dev_err(wdev->dev, "asynchronous error: unknown (%d)\n", 251 + body->type); 259 252 break; 260 253 } 261 254 return 0; 262 255 } 263 256 264 - static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 257 + static int hif_generic_indication(struct wfx_dev *wdev, struct hif_msg *hif, 258 + void *buf) 265 259 { 266 260 struct hif_ind_generic *body = buf; 267 261 ··· 277 255 case HIF_GENERIC_INDICATION_TYPE_RAW: 278 256 return 0; 279 257 case HIF_GENERIC_INDICATION_TYPE_STRING: 280 - dev_info(wdev->dev, "firmware says: %s\n", (char *) body->indication_data.raw_data); 258 + dev_info(wdev->dev, "firmware says: %s\n", 259 + (char *) body->indication_data.raw_data); 281 260 return 0; 282 261 case HIF_GENERIC_INDICATION_TYPE_RX_STATS: 283 262 mutex_lock(&wdev->rx_stats_lock); 284 263 // Older firmware send a generic indication beside RxStats 285 264 if (!wfx_api_older_than(wdev, 1, 4)) 286 - dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", body->indication_data.rx_stats.current_temp); 287 - memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, sizeof(wdev->rx_stats)); 265 + dev_info(wdev->dev, "Rx test ongoing. Temperature: %d°C\n", 266 + body->indication_data.rx_stats.current_temp); 267 + memcpy(&wdev->rx_stats, &body->indication_data.rx_stats, 268 + sizeof(wdev->rx_stats)); 288 269 mutex_unlock(&wdev->rx_stats_lock); 289 270 return 0; 290 271 default: 291 - dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", body->indication_type); 272 + dev_err(wdev->dev, 273 + "generic_indication: unknown indication type: %#.8x\n", 274 + body->indication_type); 292 275 return -EIO; 293 276 } 294 277 } 295 278 296 - static int hif_exception_indication(struct wfx_dev *wdev, struct hif_msg *hif, void *buf) 279 + static int hif_exception_indication(struct wfx_dev *wdev, 280 + struct hif_msg *hif, void *buf) 297 281 { 298 282 size_t len = hif->len - 4; // drop header 299 283 dev_err(wdev->dev, "firmware exception\n");
+44 -22
drivers/staging/wfx/hif_tx.c
··· 24 24 mutex_init(&hif_cmd->key_renew_lock); 25 25 } 26 26 27 - static void wfx_fill_header(struct hif_msg *hif, int if_id, unsigned int cmd, size_t size) 27 + static void wfx_fill_header(struct hif_msg *hif, int if_id, unsigned int cmd, 28 + size_t size) 28 29 { 29 30 if (if_id == -1) 30 31 if_id = 2; ··· 48 47 return NULL; 49 48 } 50 49 51 - int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, size_t reply_len, bool async) 50 + int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, 51 + size_t reply_len, bool async) 52 52 { 53 53 const char *mib_name = ""; 54 54 const char *mib_sep = ""; ··· 102 100 wdev->hif_cmd.buf_send = NULL; 103 101 mutex_unlock(&wdev->hif_cmd.lock); 104 102 105 - if (ret && (cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) { 103 + if (ret && 104 + (cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) { 106 105 mib_name = get_mib_name(((u16 *) request)[2]); 107 106 mib_sep = "/"; 108 107 } ··· 173 170 return ret; 174 171 } 175 172 176 - int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t val_len) 173 + int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, 174 + size_t val_len) 177 175 { 178 176 int ret; 179 177 struct hif_msg *hif; ··· 187 183 ret = wfx_cmd_send(wdev, hif, reply, buf_len, false); 188 184 189 185 if (!ret && mib_id != reply->mib_id) { 190 - dev_warn(wdev->dev, "%s: confirmation mismatch request\n", __func__); 186 + dev_warn(wdev->dev, 187 + "%s: confirmation mismatch request\n", __func__); 191 188 ret = -EIO; 192 189 } 193 190 if (ret == -ENOMEM) 194 - dev_err(wdev->dev, "buffer is too small to receive %s (%zu < %d)\n", 191 + dev_err(wdev->dev, 192 + "buffer is too small to receive %s (%zu < %d)\n", 195 193 get_mib_name(mib_id), val_len, reply->length); 196 194 if (!ret) 197 195 memcpy(val, &reply->mib_data, reply->length); ··· 204 198 return ret; 205 199 } 206 200 207 - int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t val_len) 201 + int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, 202 + size_t val_len) 208 203 { 209 204 int ret; 210 205 struct hif_msg *hif; ··· 243 236 cpu_to_le32s(&body->min_channel_time); 244 237 cpu_to_le32s(&body->max_channel_time); 245 238 cpu_to_le32s(&body->tx_power_level); 246 - memcpy(ptr, arg->ssids, arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def)); 239 + memcpy(ptr, arg->ssids, 240 + arg->scan_req.num_of_ssi_ds * sizeof(struct hif_ssid_def)); 247 241 ssids = (struct hif_ssid_def *) ptr; 248 242 for (i = 0; i < body->num_of_ssi_ds; ++i) 249 243 cpu_to_le32s(&ssids[i].ssid_length); ··· 289 281 return ret; 290 282 } 291 283 292 - int hif_set_bss_params(struct wfx_vif *wvif, const struct hif_req_set_bss_params *arg) 284 + int hif_set_bss_params(struct wfx_vif *wvif, 285 + const struct hif_req_set_bss_params *arg) 293 286 { 294 287 int ret; 295 288 struct hif_msg *hif; 296 - struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), &hif); 289 + struct hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), 290 + &hif); 297 291 298 292 memcpy(body, arg, sizeof(*body)); 299 293 cpu_to_le16s(&body->aid); 300 294 cpu_to_le32s(&body->operational_rate_set); 301 - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, sizeof(*body)); 295 + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, 296 + sizeof(*body)); 302 297 ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); 303 298 kfree(hif); 304 299 return ret; ··· 319 308 if (wfx_api_older_than(wdev, 1, 5)) 320 309 // Legacy firmwares expect that add_key to be sent on right 321 310 // interface. 322 - wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body)); 311 + wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, 312 + sizeof(*body)); 323 313 else 324 314 wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body)); 325 315 ret = wfx_cmd_send(wdev, hif, NULL, 0, false); ··· 341 329 return ret; 342 330 } 343 331 344 - int hif_set_edca_queue_params(struct wfx_vif *wvif, const struct hif_req_edca_queue_params *arg) 332 + int hif_set_edca_queue_params(struct wfx_vif *wvif, 333 + const struct hif_req_edca_queue_params *arg) 345 334 { 346 335 int ret; 347 336 struct hif_msg *hif; 348 - struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), &hif); 337 + struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), 338 + &hif); 349 339 350 340 // NOTE: queues numerotation are not the same between WFx and Linux 351 341 memcpy(body, arg, sizeof(*body)); 352 342 cpu_to_le16s(&body->cw_min); 353 343 cpu_to_le16s(&body->cw_max); 354 344 cpu_to_le16s(&body->tx_op_limit); 355 - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, sizeof(*body)); 345 + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, 346 + sizeof(*body)); 356 347 ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); 357 348 kfree(hif); 358 349 return ret; ··· 394 379 { 395 380 int ret; 396 381 struct hif_msg *hif; 397 - struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), &hif); 382 + struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), 383 + &hif); 398 384 399 385 body->enable_beaconing = enable_beaconing ? 1 : 0; 400 - wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, sizeof(*body)); 386 + wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, 387 + sizeof(*body)); 401 388 ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); 402 389 kfree(hif); 403 390 return ret; ··· 438 421 return ret; 439 422 } 440 423 441 - int hif_sl_send_pub_keys(struct wfx_dev *wdev, const uint8_t *pubkey, const uint8_t *pubkey_hmac) 424 + int hif_sl_send_pub_keys(struct wfx_dev *wdev, const uint8_t *pubkey, 425 + const uint8_t *pubkey_hmac) 442 426 { 443 427 int ret; 444 428 struct hif_msg *hif; 445 - struct hif_req_sl_exchange_pub_keys *body = wfx_alloc_hif(sizeof(*body), &hif); 429 + struct hif_req_sl_exchange_pub_keys *body = wfx_alloc_hif(sizeof(*body), 430 + &hif); 446 431 447 432 body->algorithm = HIF_SL_CURVE25519; 448 433 memcpy(body->host_pub_key, pubkey, sizeof(body->host_pub_key)); 449 - memcpy(body->host_pub_key_mac, pubkey_hmac, sizeof(body->host_pub_key_mac)); 450 - wfx_fill_header(hif, -1, HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS, sizeof(*body)); 434 + memcpy(body->host_pub_key_mac, pubkey_hmac, 435 + sizeof(body->host_pub_key_mac)); 436 + wfx_fill_header(hif, -1, HIF_REQ_ID_SL_EXCHANGE_PUB_KEYS, 437 + sizeof(*body)); 451 438 ret = wfx_cmd_send(wdev, hif, NULL, 0, false); 452 439 kfree(hif); 453 440 // Compatibility with legacy secure link ··· 478 457 { 479 458 int ret; 480 459 struct hif_msg *hif; 481 - struct hif_req_set_sl_mac_key *body = wfx_alloc_hif(sizeof(*body), &hif); 460 + struct hif_req_set_sl_mac_key *body = wfx_alloc_hif(sizeof(*body), 461 + &hif); 482 462 483 463 memcpy(body->key_value, slk_key, sizeof(body->key_value)); 484 464 body->otp_or_ram = destination;
+7 -4
drivers/staging/wfx/hif_tx_mib.h
··· 57 57 return hif_read_mib(wdev, 0, HIF_MIB_ID_COUNTERS_TABLE, 58 58 arg, sizeof(struct hif_mib_count_table)); 59 59 } else { 60 - return hif_read_mib(wdev, 0, HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, 61 - arg, sizeof(struct hif_mib_extended_count_table)); 60 + return hif_read_mib(wdev, 0, 61 + HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg, 62 + sizeof(struct hif_mib_extended_count_table)); 62 63 } 63 64 } 64 65 ··· 113 112 .bcn_count = cpu_to_le32(beacon_count), 114 113 }; 115 114 return hif_write_mib(wvif->wdev, wvif->id, 116 - HIF_MIB_ID_BEACON_FILTER_ENABLE, &arg, sizeof(arg)); 115 + HIF_MIB_ID_BEACON_FILTER_ENABLE, 116 + &arg, sizeof(arg)); 117 117 } 118 118 119 119 static inline int hif_set_operational_mode(struct wfx_dev *wdev, ··· 175 173 static inline int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, 176 174 struct hif_mib_set_tx_rate_retry_policy *arg) 177 175 { 178 - size_t size = struct_size(arg, tx_rate_retry_policy, arg->num_tx_rate_policies); 176 + size_t size = struct_size(arg, tx_rate_retry_policy, 177 + arg->num_tx_rate_policies); 179 178 180 179 return hif_write_mib(wvif->wdev, wvif->id, 181 180 HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY, arg, size);
+28 -14
drivers/staging/wfx/hwio.c
··· 34 34 *val = ~0; // Never return undefined value 35 35 if (!tmp) 36 36 return -ENOMEM; 37 - ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, sizeof(u32)); 37 + ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, 38 + sizeof(u32)); 38 39 if (ret >= 0) 39 40 *val = le32_to_cpu(*tmp); 40 41 kfree(tmp); 41 42 if (ret) 42 - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); 43 + dev_err(wdev->dev, "%s: bus communication error: %d\n", 44 + __func__, ret); 43 45 return ret; 44 46 } 45 47 ··· 53 51 if (!tmp) 54 52 return -ENOMEM; 55 53 *tmp = cpu_to_le32(val); 56 - ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, tmp, sizeof(u32)); 54 + ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, tmp, 55 + sizeof(u32)); 57 56 kfree(tmp); 58 57 if (ret) 59 - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); 58 + dev_err(wdev->dev, "%s: bus communication error: %d\n", 59 + __func__, ret); 60 60 return ret; 61 61 } 62 62 ··· 106 102 return ret; 107 103 } 108 104 109 - static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, void *buf, size_t len) 105 + static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr, void *buf, 106 + size_t len) 110 107 { 111 108 int ret; 112 109 int i; ··· 157 152 return ret; 158 153 } 159 154 160 - static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr, const void *buf, size_t len) 155 + static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr, 156 + const void *buf, size_t len) 161 157 { 162 158 int ret; 163 159 ··· 171 165 return wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, buf, len); 172 166 } 173 167 174 - static int indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr, void *buf, size_t len) 168 + static int indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr, 169 + void *buf, size_t len) 175 170 { 176 171 int ret; 177 172 ··· 183 176 return ret; 184 177 } 185 178 186 - static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr, const void *buf, size_t len) 179 + static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr, 180 + const void *buf, size_t len) 187 181 { 188 182 int ret; 189 183 ··· 195 187 return ret; 196 188 } 197 189 198 - static int indirect_read32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 *val) 190 + static int indirect_read32_locked(struct wfx_dev *wdev, int reg, u32 addr, 191 + u32 *val) 199 192 { 200 193 int ret; 201 194 __le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL); ··· 212 203 return ret; 213 204 } 214 205 215 - static int indirect_write32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 val) 206 + static int indirect_write32_locked(struct wfx_dev *wdev, int reg, u32 addr, 207 + u32 val) 216 208 { 217 209 int ret; 218 210 __le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL); ··· 235 225 236 226 WARN((long) buf & 3, "%s: unaligned buffer", __func__); 237 227 wdev->hwbus_ops->lock(wdev->hwbus_priv); 238 - ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len); 228 + ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, 229 + WFX_REG_IN_OUT_QUEUE, buf, len); 239 230 _trace_io_read(WFX_REG_IN_OUT_QUEUE, buf, len); 240 231 wdev->hwbus_ops->unlock(wdev->hwbus_priv); 241 232 if (ret) 242 - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); 233 + dev_err(wdev->dev, "%s: bus communication error: %d\n", 234 + __func__, ret); 243 235 return ret; 244 236 } 245 237 ··· 251 239 252 240 WARN((long) buf & 3, "%s: unaligned buffer", __func__); 253 241 wdev->hwbus_ops->lock(wdev->hwbus_priv); 254 - ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len); 242 + ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, 243 + WFX_REG_IN_OUT_QUEUE, buf, len); 255 244 _trace_io_write(WFX_REG_IN_OUT_QUEUE, buf, len); 256 245 wdev->hwbus_ops->unlock(wdev->hwbus_priv); 257 246 if (ret) 258 - dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret); 247 + dev_err(wdev->dev, "%s: bus communication error: %d\n", 248 + __func__, ret); 259 249 return ret; 260 250 } 261 251
+7 -2
drivers/staging/wfx/hwio.h
··· 37 37 #define CFG_ERR_HOST_NO_IN_QUEUE 0x00000040 38 38 #define CFG_ERR_HOST_CRC_MISS 0x00000080 // only with SDIO 39 39 #define CFG_SPI_IGNORE_CS 0x00000080 // only with SPI 40 - #define CFG_WORD_MODE_MASK 0x00000300 // Bytes ordering (only writable in SPI): 41 - #define CFG_WORD_MODE0 0x00000000 // B1,B0,B3,B2 (In SPI, register address and CONFIG data always use this mode) 40 + /* Bytes ordering (only writable in SPI): */ 41 + #define CFG_WORD_MODE_MASK 0x00000300 42 + /* 43 + * B1,B0,B3,B2 (In SPI, register address and 44 + * CONFIG data always use this mode) 45 + */ 46 + #define CFG_WORD_MODE0 0x00000000 42 47 #define CFG_WORD_MODE1 0x00000100 // B3,B2,B1,B0 43 48 #define CFG_WORD_MODE2 0x00000200 // B0,B1,B2,B3 (SDIO) 44 49 #define CFG_DIRECT_ACCESS_MODE 0x00000400 // Direct or queue access mode
+16 -8
drivers/staging/wfx/key.c
··· 171 171 return -EINVAL; 172 172 k = &wdev->keys[idx]; 173 173 k->int_id = wvif->id; 174 - if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || key->cipher == WLAN_CIPHER_SUITE_WEP104) { 174 + if (key->cipher == WLAN_CIPHER_SUITE_WEP40 || 175 + key->cipher == WLAN_CIPHER_SUITE_WEP104) { 175 176 if (pairwise) 176 - k->type = fill_wep_pair(&k->key.wep_pairwise_key, key, sta->addr); 177 + k->type = fill_wep_pair(&k->key.wep_pairwise_key, key, 178 + sta->addr); 177 179 else 178 180 k->type = fill_wep_group(&k->key.wep_group_key, key); 179 181 } else if (key->cipher == WLAN_CIPHER_SUITE_TKIP) { 180 182 if (pairwise) 181 - k->type = fill_tkip_pair(&k->key.tkip_pairwise_key, key, sta->addr); 183 + k->type = fill_tkip_pair(&k->key.tkip_pairwise_key, key, 184 + sta->addr); 182 185 else 183 - k->type = fill_tkip_group(&k->key.tkip_group_key, key, &seq, wvif->vif->type); 186 + k->type = fill_tkip_group(&k->key.tkip_group_key, key, 187 + &seq, wvif->vif->type); 184 188 } else if (key->cipher == WLAN_CIPHER_SUITE_CCMP) { 185 189 if (pairwise) 186 - k->type = fill_ccmp_pair(&k->key.aes_pairwise_key, key, sta->addr); 190 + k->type = fill_ccmp_pair(&k->key.aes_pairwise_key, key, 191 + sta->addr); 187 192 else 188 - k->type = fill_ccmp_group(&k->key.aes_group_key, key, &seq); 193 + k->type = fill_ccmp_group(&k->key.aes_group_key, key, 194 + &seq); 189 195 } else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) { 190 196 if (pairwise) 191 - k->type = fill_sms4_pair(&k->key.wapi_pairwise_key, key, sta->addr); 197 + k->type = fill_sms4_pair(&k->key.wapi_pairwise_key, key, 198 + sta->addr); 192 199 else 193 200 k->type = fill_sms4_group(&k->key.wapi_group_key, key); 194 201 } else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { 195 - k->type = fill_aes_cmac_group(&k->key.igtk_group_key, key, &seq); 202 + k->type = fill_aes_cmac_group(&k->key.igtk_group_key, key, 203 + &seq); 196 204 } else { 197 205 dev_warn(wdev->dev, "unsupported key type %d\n", key->cipher); 198 206 wfx_free_key(wdev, idx);
+41 -20
drivers/staging/wfx/main.c
··· 99 99 .ht_cap = { 100 100 // Receive caps 101 101 .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | 102 - IEEE80211_HT_CAP_MAX_AMSDU | (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), 102 + IEEE80211_HT_CAP_MAX_AMSDU | 103 + (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), 103 104 .ht_supported = 1, 104 105 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K, 105 106 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, ··· 164 163 return false; 165 164 } 166 165 167 - struct gpio_desc *wfx_get_gpio(struct device *dev, int override, const char *label) 166 + struct gpio_desc *wfx_get_gpio(struct device *dev, int override, 167 + const char *label) 168 168 { 169 169 struct gpio_desc *ret; 170 170 char label_buf[256]; 171 171 172 172 if (override >= 0) { 173 173 snprintf(label_buf, sizeof(label_buf), "wfx_%s", label); 174 - ret = ERR_PTR(devm_gpio_request_one(dev, override, GPIOF_OUT_INIT_LOW, label_buf)); 174 + ret = ERR_PTR(devm_gpio_request_one(dev, override, 175 + GPIOF_OUT_INIT_LOW, 176 + label_buf)); 175 177 if (!ret) 176 178 ret = gpio_to_desc(override); 177 179 } else if (override == -1) { ··· 186 182 if (!ret || PTR_ERR(ret) == -ENOENT) 187 183 dev_warn(dev, "gpio %s is not defined\n", label); 188 184 else 189 - dev_warn(dev, "error while requesting gpio %s\n", label); 185 + dev_warn(dev, 186 + "error while requesting gpio %s\n", label); 190 187 ret = NULL; 191 188 } else { 192 - dev_dbg(dev, "using gpio %d for %s\n", desc_to_gpio(ret), label); 189 + dev_dbg(dev, 190 + "using gpio %d for %s\n", desc_to_gpio(ret), label); 193 191 } 194 192 return ret; 195 193 } ··· 221 215 buf[i] = 0; 222 216 dev_dbg(wdev->dev, "send PDS '%s}'\n", buf + start); 223 217 buf[i] = '}'; 224 - ret = hif_configuration(wdev, buf + start, i - start + 1); 218 + ret = hif_configuration(wdev, buf + start, 219 + i - start + 1); 225 220 if (ret == HIF_STATUS_FAILURE) { 226 221 dev_err(wdev->dev, "PDS bytes %d to %d: invalid data (unsupported options?)\n", start, i); 227 222 return -EINVAL; ··· 250 243 251 244 ret = request_firmware(&pds, wdev->pdata.file_pds, wdev->dev); 252 245 if (ret) { 253 - dev_err(wdev->dev, "can't load PDS file %s\n", wdev->pdata.file_pds); 246 + dev_err(wdev->dev, "can't load PDS file %s\n", 247 + wdev->pdata.file_pds); 254 248 return ret; 255 249 } 256 250 tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL); ··· 290 282 hw->queues = 4; 291 283 hw->max_rates = 8; 292 284 hw->max_rate_tries = 15; 293 - hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + sizeof(struct hif_msg) 285 + hw->extra_tx_headroom = sizeof(struct hif_sl_msg_hdr) + 286 + sizeof(struct hif_msg) 294 287 + sizeof(struct hif_req_tx) 295 288 + 4 /* alignment */ + 8 /* TKIP IV */; 296 289 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | ··· 306 297 hw->wiphy->iface_combinations = wfx_iface_combinations; 307 298 hw->wiphy->bands[NL80211_BAND_2GHZ] = devm_kmalloc(dev, sizeof(wfx_band_2ghz), GFP_KERNEL); 308 299 // FIXME: also copy wfx_rates and wfx_2ghz_chantable 309 - memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, sizeof(wfx_band_2ghz)); 300 + memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, 301 + sizeof(wfx_band_2ghz)); 310 302 311 303 wdev = hw->priv; 312 304 wdev->hw = hw; ··· 315 305 wdev->hwbus_ops = hwbus_ops; 316 306 wdev->hwbus_priv = hwbus_priv; 317 307 memcpy(&wdev->pdata, pdata, sizeof(*pdata)); 318 - of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds); 308 + of_property_read_string(dev->of_node, "config-file", 309 + &wdev->pdata.file_pds); 319 310 wdev->pdata.gpio_wakeup = wfx_get_gpio(dev, gpio_wakeup, "wakeup"); 320 311 wfx_sl_fill_pdata(dev, &wdev->pdata); 321 312 ··· 355 344 if (err) 356 345 goto err1; 357 346 358 - err = wait_for_completion_interruptible_timeout(&wdev->firmware_ready, 10 * HZ); 347 + err = wait_for_completion_interruptible_timeout(&wdev->firmware_ready, 348 + 10 * HZ); 359 349 if (err <= 0) { 360 350 if (err == 0) { 361 351 dev_err(wdev->dev, "timeout while waiting for startup indication. IRQ configuration error?\n"); ··· 371 359 dev_info(wdev->dev, "started firmware %d.%d.%d \"%s\" (API: %d.%d, keyset: %02X, caps: 0x%.8X)\n", 372 360 wdev->hw_caps.firmware_major, wdev->hw_caps.firmware_minor, 373 361 wdev->hw_caps.firmware_build, wdev->hw_caps.firmware_label, 374 - wdev->hw_caps.api_version_major, wdev->hw_caps.api_version_minor, 362 + wdev->hw_caps.api_version_major, 363 + wdev->hw_caps.api_version_minor, 375 364 wdev->keyset, *((u32 *) &wdev->hw_caps.capabilities)); 376 - snprintf(wdev->hw->wiphy->fw_version, sizeof(wdev->hw->wiphy->fw_version), 365 + snprintf(wdev->hw->wiphy->fw_version, 366 + sizeof(wdev->hw->wiphy->fw_version), 377 367 "%d.%d.%d", 378 368 wdev->hw_caps.firmware_major, 379 369 wdev->hw_caps.firmware_minor, 380 370 wdev->hw_caps.firmware_build); 381 371 382 372 if (wfx_api_older_than(wdev, 1, 0)) { 383 - dev_err(wdev->dev, "unsupported firmware API version (expect 1 while firmware returns %d)\n", 373 + dev_err(wdev->dev, 374 + "unsupported firmware API version (expect 1 while firmware returns %d)\n", 384 375 wdev->hw_caps.api_version_major); 385 376 err = -ENOTSUPP; 386 377 goto err1; ··· 391 376 392 377 err = wfx_sl_init(wdev); 393 378 if (err && wdev->hw_caps.capabilities.link_mode == SEC_LINK_ENFORCED) { 394 - dev_err(wdev->dev, "chip require secure_link, but can't negociate it\n"); 379 + dev_err(wdev->dev, 380 + "chip require secure_link, but can't negociate it\n"); 395 381 goto err1; 396 382 } 397 383 ··· 402 386 wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[13].flags |= IEEE80211_CHAN_DISABLED; 403 387 } 404 388 405 - dev_dbg(wdev->dev, "sending configuration file %s\n", wdev->pdata.file_pds); 389 + dev_dbg(wdev->dev, "sending configuration file %s\n", 390 + wdev->pdata.file_pds); 406 391 err = wfx_send_pdata_pds(wdev); 407 392 if (err < 0) 408 393 goto err1; 409 394 410 395 wdev->pdata.gpio_wakeup = gpio_saved; 411 396 if (wdev->pdata.gpio_wakeup) { 412 - dev_dbg(wdev->dev, "enable 'quiescent' power mode with gpio %d and PDS file %s\n", 413 - desc_to_gpio(wdev->pdata.gpio_wakeup), wdev->pdata.file_pds); 397 + dev_dbg(wdev->dev, 398 + "enable 'quiescent' power mode with gpio %d and PDS file %s\n", 399 + desc_to_gpio(wdev->pdata.gpio_wakeup), 400 + wdev->pdata.file_pds); 414 401 gpiod_set_value(wdev->pdata.gpio_wakeup, 1); 415 402 control_reg_write(wdev, 0); 416 403 hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT); ··· 430 411 ether_addr_copy(wdev->addresses[i].addr, macaddr); 431 412 wdev->addresses[i].addr[ETH_ALEN - 1] += i; 432 413 } else { 433 - ether_addr_copy(wdev->addresses[i].addr, wdev->hw_caps.mac_addr[i]); 414 + ether_addr_copy(wdev->addresses[i].addr, 415 + wdev->hw_caps.mac_addr[i]); 434 416 } 435 417 if (!is_valid_ether_addr(wdev->addresses[i].addr)) { 436 418 dev_warn(wdev->dev, "using random MAC address\n"); 437 419 eth_random_addr(wdev->addresses[i].addr); 438 420 } 439 - dev_info(wdev->dev, "MAC address %d: %pM\n", i, wdev->addresses[i].addr); 421 + dev_info(wdev->dev, "MAC address %d: %pM\n", i, 422 + wdev->addresses[i].addr); 440 423 } 441 424 wdev->hw->wiphy->n_addresses = ARRAY_SIZE(wdev->addresses); 442 425 wdev->hw->wiphy->addresses = wdev->addresses;
+21 -10
drivers/staging/wfx/queue.c
··· 42 42 !wdev->hif.tx_buffers_used, 43 43 msecs_to_jiffies(3000)); 44 44 if (!ret) { 45 - dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", wdev->hif.tx_buffers_used); 45 + dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", 46 + wdev->hif.tx_buffers_used); 46 47 wfx_pending_dump_old_frames(wdev, 3000); 47 48 // FIXME: drop pending frames here 48 49 wdev->chip_frozen = 1; ··· 122 121 } while (!done); 123 122 } 124 123 125 - static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff_head *gc_list) 124 + static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, 125 + struct sk_buff_head *gc_list) 126 126 { 127 127 int i; 128 128 struct sk_buff *item; ··· 191 189 ret = skb_queue_len(&queue->queue); 192 190 } else { 193 191 ret = 0; 194 - for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); ++i, bit <<= 1) { 192 + for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); 193 + ++i, bit <<= 1) { 195 194 if (link_id_map & bit) 196 195 ret += queue->link_map_cache[i]; 197 196 } ··· 201 198 return ret; 202 199 } 203 200 204 - void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) 201 + void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, 202 + struct sk_buff *skb) 205 203 { 206 204 struct wfx_queue_stats *stats = &wdev->tx_queue_stats; 207 205 struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); ··· 319 315 skb_queue_walk(&stats->pending, skb) { 320 316 tx_priv = wfx_skb_tx_priv(skb); 321 317 req = wfx_skb_txreq(skb); 322 - if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, limit_ms))) { 318 + if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, 319 + limit_ms))) { 323 320 if (first) { 324 321 dev_info(wdev->dev, "frames stuck in firmware since %dms or more:\n", 325 322 limit_ms); ··· 334 329 spin_unlock_bh(&stats->pending.lock); 335 330 } 336 331 337 - unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb) 332 + unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, 333 + struct sk_buff *skb) 338 334 { 339 335 ktime_t now = ktime_get(); 340 336 struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); ··· 382 376 case NL80211_IFTYPE_AP: 383 377 if (!wvif->state) { 384 378 action = do_drop; 385 - } else if (!(BIT(tx_priv->raw_link_id) & (BIT(0) | wvif->link_id_map))) { 379 + } else if (!(BIT(tx_priv->raw_link_id) & 380 + (BIT(0) | wvif->link_id_map))) { 386 381 dev_warn(wvif->wdev->dev, "a frame with expired link-id is dropped\n"); 387 382 action = do_drop; 388 383 } ··· 469 462 /* override winner if bursting */ 470 463 if (winner >= 0 && wvif->wdev->tx_burst_idx >= 0 && 471 464 winner != wvif->wdev->tx_burst_idx && 472 - !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], tx_allowed_mask & urgent) && 465 + !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], 466 + tx_allowed_mask & urgent) && 473 467 wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[wvif->wdev->tx_burst_idx], tx_allowed_mask)) 474 468 winner = wvif->wdev->tx_burst_idx; 475 469 ··· 544 536 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 545 537 spin_lock_bh(&wvif->ps_state_lock); 546 538 547 - not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, &vif_tx_allowed_mask, &vif_more); 539 + not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, 540 + &vif_tx_allowed_mask, 541 + &vif_more); 548 542 549 543 if (wvif->mcast_buffered && (not_found || !vif_more) && 550 - (wvif->mcast_tx || !wvif->sta_asleep_mask)) { 544 + (wvif->mcast_tx || 545 + !wvif->sta_asleep_mask)) { 551 546 wvif->mcast_buffered = false; 552 547 if (wvif->mcast_tx) { 553 548 wvif->mcast_tx = false;
+4 -2
drivers/staging/wfx/queue.h
··· 47 47 void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); 48 48 struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); 49 49 50 - void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); 50 + void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, 51 + struct sk_buff *skb); 51 52 size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); 52 53 53 54 struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); 54 55 int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); 55 56 int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); 56 - unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); 57 + unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, 58 + struct sk_buff *skb); 57 59 void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms); 58 60 59 61 #endif /* WFX_QUEUE_H */
+10 -5
drivers/staging/wfx/scan.c
··· 12 12 #include "sta.h" 13 13 #include "hif_tx_mib.h" 14 14 15 - static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, bool aborted) 15 + static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw, 16 + bool aborted) 16 17 { 17 18 struct cfg80211_scan_info info = { 18 19 .aborted = aborted ? 1 : 0, ··· 160 159 161 160 if (!wvif->scan.req || wvif->scan.curr == wvif->scan.end) { 162 161 if (wvif->scan.output_power != wvif->wdev->output_power) 163 - hif_set_output_power(wvif, wvif->wdev->output_power * 10); 162 + hif_set_output_power(wvif, 163 + wvif->wdev->output_power * 10); 164 164 165 165 if (wvif->scan.status < 0) 166 166 dev_warn(wvif->wdev->dev, "scan failed\n"); ··· 174 172 wfx_scan_restart_delayed(wvif); 175 173 wfx_tx_unlock(wvif->wdev); 176 174 mutex_unlock(&wvif->wdev->conf_mutex); 177 - __ieee80211_scan_completed_compat(wvif->wdev->hw, wvif->scan.status ? 1 : 0); 175 + __ieee80211_scan_completed_compat(wvif->wdev->hw, 176 + wvif->scan.status ? 1 : 0); 178 177 up(&wvif->scan.lock); 179 178 if (wvif->state == WFX_STATE_STA && 180 179 !(wvif->powersave_mode.pm_mode.enter_psm)) ··· 214 211 scan.scan_req.scan_flags.fbg = 1; 215 212 } 216 213 217 - scan.ch = kcalloc(scan.scan_req.num_of_channels, sizeof(u8), GFP_KERNEL); 214 + scan.ch = kcalloc(scan.scan_req.num_of_channels, 215 + sizeof(u8), GFP_KERNEL); 218 216 219 217 if (!scan.ch) { 220 218 wvif->scan.status = -ENOMEM; ··· 277 273 278 274 void wfx_scan_timeout(struct work_struct *work) 279 275 { 280 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, scan.timeout.work); 276 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 277 + scan.timeout.work); 281 278 282 279 if (atomic_xchg(&wvif->scan.in_progress, 0)) { 283 280 if (wvif->scan.status > 0) {
+90 -43
drivers/staging/wfx/sta.c
··· 100 100 skb = ieee80211_nullfunc_get(wvif->wdev->hw, wvif->vif, false); 101 101 if (!skb) 102 102 goto end; 103 - memset(IEEE80211_SKB_CB(skb), 0, sizeof(*IEEE80211_SKB_CB(skb))); 103 + memset(IEEE80211_SKB_CB(skb), 0, 104 + sizeof(*IEEE80211_SKB_CB(skb))); 104 105 IEEE80211_SKB_CB(skb)->control.vif = wvif->vif; 105 106 IEEE80211_SKB_CB(skb)->driver_rates[0].idx = 0; 106 107 IEEE80211_SKB_CB(skb)->driver_rates[0].count = 1; ··· 178 177 for (i = 0; i < fp->num_addresses; i++) { 179 178 filter_addr_val.condition_idx = i; 180 179 filter_addr_val.address_type = HIF_MAC_ADDR_A1; 181 - ether_addr_copy(filter_addr_val.mac_address, fp->address_list[i]); 182 - ret = hif_set_mac_addr_condition(wvif, &filter_addr_val); 180 + ether_addr_copy(filter_addr_val.mac_address, 181 + fp->address_list[i]); 182 + ret = hif_set_mac_addr_condition(wvif, 183 + &filter_addr_val); 183 184 if (ret) 184 185 return ret; 185 186 config.mac_cond |= 1 << i; ··· 246 243 bf_ctrl.bcn_count = 1; 247 244 n_filter_ies = 0; 248 245 } else if (!is_sta) { 249 - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP; 246 + bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | 247 + HIF_BEACON_FILTER_AUTO_ERP; 250 248 bf_ctrl.bcn_count = 0; 251 249 n_filter_ies = 2; 252 250 } else { ··· 258 254 259 255 ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req); 260 256 if (!ret) 261 - ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies); 257 + ret = hif_set_beacon_filter_table(wvif, n_filter_ies, 258 + filter_ies); 262 259 if (!ret) 263 - ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, bf_ctrl.bcn_count); 260 + ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, 261 + bf_ctrl.bcn_count); 264 262 if (!ret) 265 263 ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); 266 264 if (ret) ··· 271 265 272 266 static void wfx_update_filtering_work(struct work_struct *work) 273 267 { 274 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_filtering_work); 268 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 269 + update_filtering_work); 275 270 276 271 wfx_update_filtering(wvif); 277 272 } 278 273 279 - u64 wfx_prepare_multicast(struct ieee80211_hw *hw, struct netdev_hw_addr_list *mc_list) 274 + u64 wfx_prepare_multicast(struct ieee80211_hw *hw, 275 + struct netdev_hw_addr_list *mc_list) 280 276 { 281 277 int i; 282 278 struct netdev_hw_addr *ha; ··· 288 280 289 281 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 290 282 memset(&wvif->mcast_filter, 0x00, sizeof(wvif->mcast_filter)); 291 - if (!count || count > ARRAY_SIZE(wvif->mcast_filter.address_list)) 283 + if (!count || 284 + count > ARRAY_SIZE(wvif->mcast_filter.address_list)) 292 285 continue; 293 286 294 287 i = 0; 295 288 netdev_hw_addr_list_for_each(ha, mc_list) { 296 - ether_addr_copy(wvif->mcast_filter.address_list[i], ha->addr); 289 + ether_addr_copy(wvif->mcast_filter.address_list[i], 290 + ha->addr); 297 291 i++; 298 292 } 299 293 wvif->mcast_filter.enable = true; ··· 317 307 318 308 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 319 309 down(&wvif->scan.lock); 320 - wvif->filter_bssid = (*total_flags & (FIF_OTHER_BSS | FIF_PROBE_REQ)) ? 0 : 1; 310 + wvif->filter_bssid = (*total_flags & 311 + (FIF_OTHER_BSS | FIF_PROBE_REQ)) ? 0 : 1; 321 312 wvif->disable_beacon_filter = !(*total_flags & FIF_PROBE_REQ); 322 313 wfx_fwd_probe_req(wvif, true); 323 314 wfx_update_filtering(wvif); ··· 392 381 pm.pm_mode.fast_psm = 0; 393 382 } 394 383 395 - if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300))) 396 - dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n"); 384 + if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, 385 + msecs_to_jiffies(300))) 386 + dev_warn(wvif->wdev->dev, 387 + "timeout while waiting of set_pm_mode_complete\n"); 397 388 ret = hif_set_pm(wvif, &pm); 398 389 // FIXME: why ? 399 390 if (-ETIMEDOUT == wvif->scan.status) ··· 455 442 wvif = (struct wfx_vif *) vif->drv_priv; 456 443 if (wvif->vif->type == NL80211_IFTYPE_MONITOR) 457 444 drop = true; 458 - if (wvif->vif->type == NL80211_IFTYPE_AP && !wvif->enable_beacon) 445 + if (wvif->vif->type == NL80211_IFTYPE_AP && 446 + !wvif->enable_beacon) 459 447 drop = true; 460 448 } 461 449 ··· 508 494 */ 509 495 wvif->delayed_link_loss = 1; 510 496 /* Also start a watchdog. */ 511 - schedule_delayed_work(&wvif->bss_loss_work, 5 * HZ); 497 + schedule_delayed_work(&wvif->bss_loss_work, 498 + 5 * HZ); 512 499 } 513 500 break; 514 501 case HIF_EVENT_IND_BSSREGAINED: ··· 517 502 cancel_work_sync(&wvif->unjoin_work); 518 503 break; 519 504 case HIF_EVENT_IND_RCPI_RSSI: 520 - wfx_event_report_rssi(wvif, event->evt.event_data.rcpi_rssi); 505 + wfx_event_report_rssi(wvif, 506 + event->evt.event_data.rcpi_rssi); 521 507 break; 522 508 case HIF_EVENT_IND_PS_MODE_ERROR: 523 - dev_warn(wvif->wdev->dev, "error while processing power save request\n"); 509 + dev_warn(wvif->wdev->dev, 510 + "error while processing power save request\n"); 524 511 break; 525 512 default: 526 - dev_warn(wvif->wdev->dev, "unhandled event indication: %.2x\n", event->evt.event_id); 513 + dev_warn(wvif->wdev->dev, 514 + "unhandled event indication: %.2x\n", 515 + event->evt.event_id); 527 516 break; 528 517 } 529 518 } ··· 536 517 537 518 static void wfx_bss_loss_work(struct work_struct *work) 538 519 { 539 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, bss_loss_work.work); 520 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 521 + bss_loss_work.work); 540 522 541 523 ieee80211_connection_loss(wvif->vif); 542 524 } 543 525 544 526 static void wfx_bss_params_work(struct work_struct *work) 545 527 { 546 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, bss_params_work); 528 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 529 + bss_params_work); 547 530 548 531 mutex_lock(&wvif->wdev->conf_mutex); 549 532 wvif->bss_params.bss_flags.lost_count_only = 1; ··· 556 535 557 536 static void wfx_set_beacon_wakeup_period_work(struct work_struct *work) 558 537 { 559 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_beacon_wakeup_period_work); 538 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 539 + set_beacon_wakeup_period_work); 560 540 561 - hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, wvif->dtim_period); 541 + hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, 542 + wvif->dtim_period); 562 543 } 563 544 564 545 static void wfx_do_unjoin(struct wfx_vif *wvif) ··· 569 546 570 547 if (atomic_read(&wvif->scan.in_progress)) { 571 548 if (wvif->delayed_unjoin) 572 - dev_dbg(wvif->wdev->dev, "delayed unjoin is already scheduled\n"); 549 + dev_dbg(wvif->wdev->dev, 550 + "delayed unjoin is already scheduled\n"); 573 551 else 574 552 wvif->delayed_unjoin = true; 575 553 goto done; ··· 612 588 mutex_unlock(&wvif->wdev->conf_mutex); 613 589 } 614 590 615 - static void wfx_set_mfp(struct wfx_vif *wvif, struct cfg80211_bss *bss) 591 + static void wfx_set_mfp(struct wfx_vif *wvif, 592 + struct cfg80211_bss *bss) 616 593 { 617 594 const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16); 618 595 const int pairwise_cipher_suite_size = 4 / sizeof(u16); ··· 654 629 .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, 655 630 .probe_for_join = 1, 656 631 .atim_window = 0, 657 - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates), 632 + .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, 633 + conf->basic_rates), 658 634 }; 659 635 660 636 if (wvif->channel->flags & IEEE80211_CHAN_NO_IR) ··· 666 640 667 641 bssid = wvif->vif->bss_conf.bssid; 668 642 669 - bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, bssid, NULL, 0, 643 + bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, 644 + bssid, NULL, 0, 670 645 IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); 671 646 672 647 if (!bss && !conf->ibss_joined) { ··· 843 816 .beacon_interval = conf->beacon_int, 844 817 .dtim_period = conf->dtim_period, 845 818 .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG, 846 - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates), 819 + .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, 820 + conf->basic_rates), 847 821 }; 848 822 849 823 memset(start.ssid, 0, sizeof(start.ssid)); ··· 956 928 return ht_info->ht_cap.ampdu_density; 957 929 } 958 930 959 - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) 931 + static void wfx_join_finalize(struct wfx_vif *wvif, 932 + struct ieee80211_bss_conf *info) 960 933 { 961 934 struct ieee80211_sta *sta = NULL; 962 935 struct hif_mib_set_association_mode association_mode = { }; ··· 981 952 rcu_read_unlock(); 982 953 983 954 /* Non Greenfield stations present */ 984 - if (wvif->ht_info.operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) 955 + if (wvif->ht_info.operation_mode & 956 + IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) 985 957 hif_dual_cts_protection(wvif, true); 986 958 else 987 959 hif_dual_cts_protection(wvif, false); ··· 1041 1011 filter.condition_idx = i; 1042 1012 if (i < nb_arp_addr) { 1043 1013 // Caution: type of arp_addr_list[i] is __be32 1044 - memcpy(filter.ipv4_address, &info->arp_addr_list[i], sizeof(filter.ipv4_address)); 1014 + memcpy(filter.ipv4_address, 1015 + &info->arp_addr_list[i], 1016 + sizeof(filter.ipv4_address)); 1045 1017 filter.arp_enable = HIF_ARP_NS_FILTERING_ENABLE; 1046 1018 } else { 1047 1019 filter.arp_enable = HIF_ARP_NS_FILTERING_DISABLE; ··· 1060 1028 wfx_upload_beacon(wvif); 1061 1029 } 1062 1030 1063 - if (changed & BSS_CHANGED_BEACON_ENABLED && wvif->state != WFX_STATE_IBSS) { 1031 + if (changed & BSS_CHANGED_BEACON_ENABLED && 1032 + wvif->state != WFX_STATE_IBSS) { 1064 1033 if (wvif->enable_beacon != info->enable_beacon) { 1065 1034 hif_beacon_transmit(wvif, info->enable_beacon); 1066 1035 wvif->enable_beacon = info->enable_beacon; ··· 1094 1061 1095 1062 if (changed & 1096 1063 (BSS_CHANGED_ASSOC | BSS_CHANGED_BSSID | 1097 - BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | BSS_CHANGED_HT)) { 1064 + BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | 1065 + BSS_CHANGED_HT)) { 1098 1066 if (info->assoc) { 1099 1067 if (wvif->state < WFX_STATE_PRE_STA) { 1100 1068 ieee80211_connection_loss(vif); ··· 1111 1077 if (info->assoc || info->ibss_joined) 1112 1078 wfx_join_finalize(wvif, info); 1113 1079 else 1114 - memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); 1080 + memset(&wvif->bss_params, 0, 1081 + sizeof(wvif->bss_params)); 1115 1082 } 1116 1083 } 1117 1084 ··· 1167 1132 hif_set_rcpi_rssi_threshold(wvif, &th); 1168 1133 } 1169 1134 1170 - if (changed & BSS_CHANGED_TXPOWER && info->txpower != wdev->output_power) { 1135 + if (changed & BSS_CHANGED_TXPOWER && 1136 + info->txpower != wdev->output_power) { 1171 1137 wdev->output_power = info->txpower; 1172 1138 hif_set_output_power(wvif, wdev->output_power * 10); 1173 1139 } ··· 1283 1247 1284 1248 static void wfx_mcast_start_work(struct work_struct *work) 1285 1249 { 1286 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, mcast_start_work); 1250 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 1251 + mcast_start_work); 1287 1252 long tmo = wvif->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); 1288 1253 1289 1254 cancel_work_sync(&wvif->mcast_stop_work); ··· 1299 1262 1300 1263 static void wfx_mcast_stop_work(struct work_struct *work) 1301 1264 { 1302 - struct wfx_vif *wvif = container_of(work, struct wfx_vif, mcast_stop_work); 1265 + struct wfx_vif *wvif = container_of(work, struct wfx_vif, 1266 + mcast_stop_work); 1303 1267 1304 1268 if (wvif->aid0_bit_set) { 1305 1269 del_timer_sync(&wvif->mcast_timeout); ··· 1348 1310 if (!arg->suspend_resume_flags.resume) 1349 1311 wvif->mcast_tx = false; 1350 1312 else 1351 - wvif->mcast_tx = wvif->aid0_bit_set && wvif->mcast_buffered; 1313 + wvif->mcast_tx = wvif->aid0_bit_set && 1314 + wvif->mcast_buffered; 1352 1315 if (wvif->mcast_tx) { 1353 1316 cancel_tmo = true; 1354 1317 wfx_bh_request_tx(wvif->wdev); ··· 1397 1358 return 0; 1398 1359 } 1399 1360 1400 - void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1361 + void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, 1362 + struct ieee80211_vif *vif, 1401 1363 struct ieee80211_chanctx_conf *conf) 1402 1364 { 1403 1365 struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; ··· 1432 1392 if (changed & IEEE80211_CONF_CHANGE_PS) { 1433 1393 wvif = NULL; 1434 1394 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 1435 - memset(&wvif->powersave_mode, 0, sizeof(wvif->powersave_mode)); 1395 + memset(&wvif->powersave_mode, 0, 1396 + sizeof(wvif->powersave_mode)); 1436 1397 if (conf->flags & IEEE80211_CONF_PS) { 1437 1398 wvif->powersave_mode.pm_mode.enter_psm = 1; 1438 1399 if (conf->dynamic_ps_timeout > 0) { 1439 1400 wvif->powersave_mode.pm_mode.fast_psm = 1; 1440 - // Firmware does not support more than 128ms 1401 + /* 1402 + * Firmware does not support more than 1403 + * 128ms 1404 + */ 1441 1405 wvif->powersave_mode.fast_psm_idle_period = 1442 - min(conf->dynamic_ps_timeout * 2, 255); 1406 + min(conf->dynamic_ps_timeout * 1407 + 2, 255); 1443 1408 } 1444 1409 } 1445 1410 if (wvif->state == WFX_STATE_STA && wvif->bss_params.aid) ··· 1560 1515 1561 1516 init_completion(&wvif->set_pm_mode_complete); 1562 1517 complete(&wvif->set_pm_mode_complete); 1563 - INIT_WORK(&wvif->set_beacon_wakeup_period_work, wfx_set_beacon_wakeup_period_work); 1518 + INIT_WORK(&wvif->set_beacon_wakeup_period_work, 1519 + wfx_set_beacon_wakeup_period_work); 1564 1520 INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work); 1565 1521 INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work); 1566 1522 INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); ··· 1571 1525 1572 1526 hif_set_macaddr(wvif, vif->addr); 1573 1527 for (i = 0; i < IEEE80211_NUM_ACS; i++) { 1574 - memcpy(&wvif->edca.params[i], &default_edca_params[i], sizeof(default_edca_params[i])); 1528 + memcpy(&wvif->edca.params[i], &default_edca_params[i], 1529 + sizeof(default_edca_params[i])); 1575 1530 wvif->edca.uapsd_enable[i] = false; 1576 1531 hif_set_edca_queue_params(wvif, &wvif->edca.params[i]); 1577 1532 }
+4 -2
drivers/staging/wfx/sta.h
··· 86 86 struct ieee80211_chanctx_conf *conf, u32 changed); 87 87 int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 88 88 struct ieee80211_chanctx_conf *conf); 89 - void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 89 + void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, 90 + struct ieee80211_vif *vif, 90 91 struct ieee80211_chanctx_conf *conf); 91 92 92 93 // WSM Callbacks 93 - void wfx_suspend_resume(struct wfx_vif *wvif, struct hif_ind_suspend_resume_tx *arg); 94 + void wfx_suspend_resume(struct wfx_vif *wvif, 95 + struct hif_ind_suspend_resume_tx *arg); 94 96 95 97 // Other Helpers 96 98 void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad);
+18 -9
drivers/staging/wfx/traces.h
··· 177 177 else 178 178 __entry->msg_type = "REQ"; 179 179 if (!is_recv && 180 - (__entry->msg_id == HIF_REQ_ID_READ_MIB || __entry->msg_id == HIF_REQ_ID_WRITE_MIB)) { 180 + (__entry->msg_id == HIF_REQ_ID_READ_MIB || 181 + __entry->msg_id == HIF_REQ_ID_WRITE_MIB)) { 181 182 __entry->mib = le16_to_cpup((u16 *) hif->body); 182 183 header_len = 4; 183 184 } else { 184 185 __entry->mib = -1; 185 186 header_len = 0; 186 187 } 187 - __entry->buf_len = min_t(int, __entry->msg_len, sizeof(__entry->buf)) 188 + __entry->buf_len = min_t(int, __entry->msg_len, 189 + sizeof(__entry->buf)) 188 190 - sizeof(struct hif_msg) - header_len; 189 191 memcpy(__entry->buf, hif->body + header_len, __entry->buf_len); 190 192 ), ··· 205 203 DEFINE_EVENT(hif_data, hif_send, 206 204 TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), 207 205 TP_ARGS(hif, tx_fill_level, is_recv)); 208 - #define _trace_hif_send(hif, tx_fill_level) trace_hif_send(hif, tx_fill_level, false) 206 + #define _trace_hif_send(hif, tx_fill_level)\ 207 + trace_hif_send(hif, tx_fill_level, false) 209 208 DEFINE_EVENT(hif_data, hif_recv, 210 209 TP_PROTO(struct hif_msg *hif, int tx_fill_level, bool is_recv), 211 210 TP_ARGS(hif, tx_fill_level, is_recv)); 212 - #define _trace_hif_recv(hif, tx_fill_level) trace_hif_recv(hif, tx_fill_level, true) 211 + #define _trace_hif_recv(hif, tx_fill_level)\ 212 + trace_hif_recv(hif, tx_fill_level, true) 213 213 214 214 #define wfx_reg_list_enum \ 215 215 wfx_reg_name(WFX_REG_CONFIG, "CONFIG") \ ··· 245 241 __entry->reg = reg; 246 242 __entry->addr = addr; 247 243 __entry->msg_len = len; 248 - __entry->buf_len = min_t(int, sizeof(__entry->buf), __entry->msg_len); 244 + __entry->buf_len = min_t(int, sizeof(__entry->buf), 245 + __entry->msg_len); 249 246 memcpy(__entry->buf, io_buf, __entry->buf_len); 250 247 if (addr >= 0) 251 248 snprintf(__entry->addr_str, 10, "/%08x", addr); ··· 264 259 DEFINE_EVENT(io_data, io_write, 265 260 TP_PROTO(int reg, int addr, const void *io_buf, size_t len), 266 261 TP_ARGS(reg, addr, io_buf, len)); 267 - #define _trace_io_ind_write(reg, addr, io_buf, len) trace_io_write(reg, addr, io_buf, len) 262 + #define _trace_io_ind_write(reg, addr, io_buf, len)\ 263 + trace_io_write(reg, addr, io_buf, len) 268 264 #define _trace_io_write(reg, io_buf, len) trace_io_write(reg, -1, io_buf, len) 269 265 DEFINE_EVENT(io_data, io_read, 270 266 TP_PROTO(int reg, int addr, const void *io_buf, size_t len), 271 267 TP_ARGS(reg, addr, io_buf, len)); 272 - #define _trace_io_ind_read(reg, addr, io_buf, len) trace_io_read(reg, addr, io_buf, len) 268 + #define _trace_io_ind_read(reg, addr, io_buf, len)\ 269 + trace_io_read(reg, addr, io_buf, len) 273 270 #define _trace_io_read(reg, io_buf, len) trace_io_read(reg, -1, io_buf, len) 274 271 275 272 DECLARE_EVENT_CLASS(io_data32, ··· 355 348 __entry->release ? "release" : "keep" 356 349 ) 357 350 ); 358 - #define _trace_bh_stats(ind, req, cnf, busy, release) trace_bh_stats(ind, req, cnf, busy, release) 351 + #define _trace_bh_stats(ind, req, cnf, busy, release)\ 352 + trace_bh_stats(ind, req, cnf, busy, release) 359 353 360 354 TRACE_EVENT(tx_stats, 361 355 TP_PROTO(struct hif_cnf_tx *tx_cnf, struct sk_buff *skb, int delay), ··· 373 365 ), 374 366 TP_fast_assign( 375 367 // Keep sync with wfx_rates definition in main.c 376 - static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13 }; 368 + static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 369 + 10, 11, 12, 13 }; 377 370 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 378 371 struct ieee80211_tx_rate *rates = tx_info->driver_rates; 379 372 int i;
+4 -2
drivers/staging/wfx/wfx.h
··· 141 141 } 142 142 vif_id = array_index_nospec(vif_id, ARRAY_SIZE(wdev->vif)); 143 143 if (!wdev->vif[vif_id]) { 144 - dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", vif_id); 144 + dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", 145 + vif_id); 145 146 return NULL; 146 147 } 147 148 return (struct wfx_vif *) wdev->vif[vif_id]->drv_priv; 148 149 } 149 150 150 - static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, struct wfx_vif *cur) 151 + static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, 152 + struct wfx_vif *cur) 151 153 { 152 154 int i; 153 155 int mark = 0;