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

staging: wfx: avoid c99 comments

The wfx driver is a network driver. C99 comments are prohibited in this
part of the kernel.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20210913130203.1903622-28-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
63aac5db 9885474d

+205 -175
+12 -10
drivers/staging/wfx/bh.c
··· 32 32 } 33 33 for (;;) { 34 34 gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1); 35 - // completion.h does not provide any function to wait 36 - // completion without consume it (a kind of 37 - // wait_for_completion_done_timeout()). So we have to emulate 38 - // it. 35 + /* completion.h does not provide any function to wait 36 + * completion without consume it (a kind of 37 + * wait_for_completion_done_timeout()). So we have to emulate 38 + * it. 39 + */ 39 40 if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, 40 41 msecs_to_jiffies(2))) { 41 42 complete(&wdev->hif.ctrl_ready); 42 43 return; 43 44 } else if (max_retry-- > 0) { 44 - // Older firmwares have a race in sleep/wake-up process. 45 - // Redo the process is sufficient to unfreeze the 46 - // chip. 45 + /* Older firmwares have a race in sleep/wake-up process. 46 + * Redo the process is sufficient to unfreeze the 47 + * chip. 48 + */ 47 49 dev_err(wdev->dev, "timeout while wake up chip\n"); 48 50 gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0); 49 51 usleep_range(2000, 2500); ··· 76 74 WARN(read_len > round_down(0xFFF, 2) * sizeof(u16), 77 75 "%s: request exceed the chip capability", __func__); 78 76 79 - // Add 2 to take into account piggyback size 77 + /* Add 2 to take into account piggyback size */ 80 78 alloc_len = wdev->hwbus_ops->align_size(wdev->hwbus_priv, read_len + 2); 81 79 skb = dev_alloc_skb(alloc_len); 82 80 if (!skb) ··· 121 119 } 122 120 123 121 skb_put(skb, le16_to_cpu(hif->len)); 124 - // wfx_handle_rx takes care on SKB livetime 122 + /* wfx_handle_rx takes care on SKB livetime */ 125 123 wfx_handle_rx(wdev, skb); 126 124 if (!wdev->hif.tx_buffers_used) 127 125 wake_up(&wdev->hif.tx_buffers_empty); ··· 150 148 ctrl_reg = 0; 151 149 if (!(ctrl_reg & CTRL_NEXT_LEN_MASK)) 152 150 return i; 153 - // ctrl_reg units are 16bits words 151 + /* ctrl_reg units are 16bits words */ 154 152 len = (ctrl_reg & CTRL_NEXT_LEN_MASK) * 2; 155 153 piggyback = rx_helper(wdev, len, num_cnf); 156 154 if (piggyback < 0)
+4 -4
drivers/staging/wfx/bus_sdio.c
··· 67 67 /* Use queue mode buffers */ 68 68 if (reg_id == WFX_REG_IN_OUT_QUEUE) 69 69 sdio_addr |= bus->buf_id_tx << 7; 70 - // FIXME: discards 'const' qualifier for src 70 + /* FIXME: discards 'const' qualifier for src */ 71 71 ret = sdio_memcpy_toio(bus->func, sdio_addr, (void *)src, count); 72 72 if (!ret && reg_id == WFX_REG_IN_OUT_QUEUE) 73 73 bus->buf_id_tx = (bus->buf_id_tx + 1) % 32; ··· 198 198 } else { 199 199 dev_warn(&func->dev, 200 200 "device is not declared in DT, features will be limited\n"); 201 - // FIXME: ignore VID/PID and only rely on device tree 201 + /* FIXME: ignore VID/PID and only rely on device tree */ 202 202 // return -ENODEV; 203 203 } 204 204 ··· 210 210 211 211 sdio_claim_host(func); 212 212 ret = sdio_enable_func(func); 213 - // Block of 64 bytes is more efficient than 512B for frame sizes < 4k 213 + /* Block of 64 bytes is more efficient than 512B for frame sizes < 4k */ 214 214 sdio_set_block_size(func, 64); 215 215 sdio_release_host(func); 216 216 if (ret) ··· 251 251 #define SDIO_DEVICE_ID_SILABS_WF200 0x1000 252 252 static const struct sdio_device_id wfx_sdio_ids[] = { 253 253 { SDIO_DEVICE(SDIO_VENDOR_ID_SILABS, SDIO_DEVICE_ID_SILABS_WF200) }, 254 - // FIXME: ignore VID/PID and only rely on device tree 254 + /* FIXME: ignore VID/PID and only rely on device tree */ 255 255 // { SDIO_DEVICE(SDIO_ANY_ID, SDIO_ANY_ID) }, 256 256 { }, 257 257 };
+7 -5
drivers/staging/wfx/bus_spi.c
··· 86 86 { 87 87 struct wfx_spi_priv *bus = priv; 88 88 u16 regaddr = (addr << 12) | (count / 2); 89 - // FIXME: use a bounce buffer 89 + /* FIXME: use a bounce buffer */ 90 90 u16 *src16 = (void *)src; 91 91 int ret, i; 92 92 struct spi_message m; ··· 104 104 105 105 cpu_to_le16s(&regaddr); 106 106 107 - // Register address and CONFIG content always use 16bit big endian 108 - // ("BADC" order) 107 + /* Register address and CONFIG content always use 16bit big endian 108 + * ("BADC" order) 109 + */ 109 110 if (bus->need_swab) 110 111 swab16s(&regaddr); 111 112 if (bus->need_swab && addr == WFX_REG_CONFIG) ··· 164 163 165 164 static size_t wfx_spi_align_size(void *priv, size_t size) 166 165 { 167 - // Most of SPI controllers avoid DMA if buffer size is not 32bit aligned 166 + /* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned 167 + */ 168 168 return ALIGN(size, 4); 169 169 } 170 170 ··· 189 187 ret = spi_setup(func); 190 188 if (ret) 191 189 return ret; 192 - // Trace below is also displayed by spi_setup() if compiled with DEBUG 190 + /* Trace below is also displayed by spi_setup() if compiled with DEBUG */ 193 191 dev_dbg(&func->dev, "SPI params: CS=%d, mode=%d bits/word=%d speed=%d\n", 194 192 func->chip_select, func->mode, func->bits_per_word, 195 193 func->max_speed_hz);
+3 -2
drivers/staging/wfx/data_rx.c
··· 76 76 if (arg->encryp) 77 77 hdr->flag |= RX_FLAG_DECRYPTED; 78 78 79 - // Block ack negotiation is offloaded by the firmware. However, 80 - // re-ordering must be done by the mac80211. 79 + /* Block ack negotiation is offloaded by the firmware. However, 80 + * re-ordering must be done by the mac80211. 81 + */ 81 82 if (ieee80211_is_action(frame->frame_control) && 82 83 mgmt->u.action.category == WLAN_CATEGORY_BACK && 83 84 skb->len > IEEE80211_MIN_ACTION_SIZE) {
+30 -26
drivers/staging/wfx/data_tx.c
··· 31 31 } 32 32 return rate->idx + 14; 33 33 } 34 - // The device only support 2GHz, else band information should be 35 - // retrieved from ieee80211_tx_info 34 + /* The device only support 2GHz, else band information should be 35 + * retrieved from ieee80211_tx_info 36 + */ 36 37 band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; 37 38 if (rate->idx >= band->n_bitrates) { 38 39 WARN(1, "wrong rate->idx value: %d", rate->idx); ··· 58 57 break; 59 58 WARN_ON(rates[i].count > 15); 60 59 rateid = wfx_get_hw_rate(wdev, &rates[i]); 61 - // Pack two values in each byte of policy->rates 60 + /* Pack two values in each byte of policy->rates */ 62 61 count = rates[i].count; 63 62 if (rateid % 2) 64 63 count <<= 4; ··· 239 238 int i; 240 239 bool finished; 241 240 242 - // Firmware is not able to mix rates with different flags 241 + /* Firmware is not able to mix rates with different flags */ 243 242 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { 244 243 if (rates[0].flags & IEEE80211_TX_RC_SHORT_GI) 245 244 rates[i].flags |= IEEE80211_TX_RC_SHORT_GI; ··· 249 248 rates[i].flags &= ~IEEE80211_TX_RC_USE_RTS_CTS; 250 249 } 251 250 252 - // Sort rates and remove duplicates 251 + /* Sort rates and remove duplicates */ 253 252 do { 254 253 finished = true; 255 254 for (i = 0; i < IEEE80211_TX_MAX_RATES - 1; i++) { ··· 269 268 } 270 269 } 271 270 } while (!finished); 272 - // Ensure that MCS0 or 1Mbps is present at the end of the retry list 271 + /* Ensure that MCS0 or 1Mbps is present at the end of the retry list */ 273 272 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { 274 273 if (rates[i].idx == 0) 275 274 break; 276 275 if (rates[i].idx == -1) { 277 276 rates[i].idx = 0; 278 - rates[i].count = 8; // == hw->max_rate_tries 277 + rates[i].count = 8; /* == hw->max_rate_tries */ 279 278 rates[i].flags = rates[i - 1].flags & 280 279 IEEE80211_TX_RC_MCS; 281 280 break; 282 281 } 283 282 } 284 - // All retries use long GI 283 + /* All retries use long GI */ 285 284 for (i = 1; i < IEEE80211_TX_MAX_RATES; i++) 286 285 rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI; 287 286 } ··· 343 342 WARN(queue_id >= IEEE80211_NUM_ACS, "unsupported queue_id"); 344 343 wfx_tx_fixup_rates(tx_info->driver_rates); 345 344 346 - // From now tx_info->control is unusable 345 + /* From now tx_info->control is unusable */ 347 346 memset(tx_info->rate_driver_data, 0, sizeof(struct wfx_tx_priv)); 348 - // Fill tx_priv 347 + /* Fill tx_priv */ 349 348 tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; 350 349 tx_priv->icv_size = wfx_tx_get_icv_len(hw_key); 351 350 352 - // Fill hif_msg 351 + /* Fill hif_msg */ 353 352 WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb"); 354 353 WARN(offset & 1, "attempt to transmit an unaligned frame"); 355 354 skb_put(skb, tx_priv->icv_size); ··· 367 366 return -EIO; 368 367 } 369 368 370 - // Fill tx request 369 + /* Fill tx request */ 371 370 req = (struct hif_req_tx *)hif_msg->body; 372 - // packet_id just need to be unique on device. 32bits are more than 373 - // necessary for that task, so we tae advantage of it to add some extra 374 - // data for debug. 371 + /* packet_id just need to be unique on device. 32bits are more than 372 + * necessary for that task, so we tae advantage of it to add some extra 373 + * data for debug. 374 + */ 375 375 req->packet_id = atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF; 376 376 req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16; 377 377 req->packet_id |= queue_id << 28; 378 378 379 379 req->fc_offset = offset; 380 - // Queue index are inverted between firmware and Linux 380 + /* Queue index are inverted between firmware and Linux */ 381 381 req->queue_id = 3 - queue_id; 382 382 req->peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); 383 383 req->retry_policy_index = wfx_tx_get_retry_policy_id(wvif, tx_info); ··· 388 386 if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) 389 387 req->after_dtim = 1; 390 388 391 - // Auxiliary operations 389 + /* Auxiliary operations */ 392 390 wfx_tx_queues_put(wvif, skb); 393 391 if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) 394 392 schedule_work(&wvif->update_tim_work); ··· 410 408 compiletime_assert(sizeof(struct wfx_tx_priv) <= driver_data_room, 411 409 "struct tx_priv is too large"); 412 410 WARN(skb->next || skb->prev, "skb is already member of a list"); 413 - // control.vif can be NULL for injected frames 411 + /* control.vif can be NULL for injected frames */ 414 412 if (tx_info->control.vif) 415 413 wvif = (struct wfx_vif *)tx_info->control.vif->drv_priv; 416 414 else 417 415 wvif = wvif_iterate(wdev, NULL); 418 416 if (WARN_ON(!wvif)) 419 417 goto drop; 420 - // Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any 421 - // BlockAck session management frame. The check below exist just in case. 418 + /* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any 419 + * BlockAck session management frame. The check below exist just in case. 420 + */ 422 421 if (ieee80211_is_action_back(hdr)) { 423 422 dev_info(wdev->dev, "drop BA action\n"); 424 423 goto drop; ··· 460 457 461 458 tx_count = arg->ack_failures; 462 459 if (!arg->status || arg->ack_failures) 463 - tx_count += 1; // Also report success 460 + tx_count += 1; /* Also report success */ 464 461 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { 465 462 rate = &tx_info->status.rates[i]; 466 463 if (rate->idx < 0) ··· 508 505 if (!wvif) 509 506 return; 510 507 511 - // Note that wfx_pending_get_pkt_us_delay() get data from tx_info 508 + /* Note that wfx_pending_get_pkt_us_delay() get data from tx_info */ 512 509 _trace_tx_stats(arg, skb, wfx_pending_get_pkt_us_delay(wdev, skb)); 513 510 wfx_tx_fill_rates(wdev, tx_info, arg); 514 511 skb_trim(skb, skb->len - tx_priv->icv_size); 515 512 516 - // From now, you can touch to tx_info->status, but do not touch to 517 - // tx_priv anymore 518 - // FIXME: use ieee80211_tx_info_clear_status() 513 + /* From now, you can touch to tx_info->status, but do not touch to 514 + * tx_priv anymore 515 + */ 516 + /* FIXME: use ieee80211_tx_info_clear_status() */ 519 517 memset(tx_info->rate_driver_data, 0, sizeof(tx_info->rate_driver_data)); 520 518 memset(tx_info->pad, 0, sizeof(tx_info->pad)); 521 519 ··· 531 527 } else if (arg->status == HIF_STATUS_TX_FAIL_REQUEUE) { 532 528 WARN(!arg->requeue, "incoherent status and result_flags"); 533 529 if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { 534 - wvif->after_dtim_tx_allowed = false; // DTIM period elapsed 530 + wvif->after_dtim_tx_allowed = false; /* DTIM period elapsed */ 535 531 schedule_work(&wvif->update_tim_work); 536 532 } 537 533 tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
+1 -1
drivers/staging/wfx/data_tx.h
··· 27 27 28 28 struct tx_policy_cache { 29 29 struct tx_policy cache[HIF_TX_RETRY_POLICY_MAX]; 30 - // FIXME: use a trees and drop hash from tx_policy 30 + /* FIXME: use a trees and drop hash from tx_policy */ 31 31 struct list_head used; 32 32 struct list_head free; 33 33 spinlock_t lock;
+7 -5
drivers/staging/wfx/debug.c
··· 256 256 if (count < sizeof(struct hif_msg)) 257 257 return -EINVAL; 258 258 259 - // wfx_cmd_send() checks that reply buffer is wide enough, but does not 260 - // return precise length read. User have to know how many bytes should 261 - // be read. Filling reply buffer with a memory pattern may help user. 259 + /* wfx_cmd_send() checks that reply buffer is wide enough, but does not 260 + * return precise length read. User have to know how many bytes should 261 + * be read. Filling reply buffer with a memory pattern may help user. 262 + */ 262 263 memset(context->reply, 0xFF, sizeof(context->reply)); 263 264 request = memdup_user(user_buf, count); 264 265 if (IS_ERR(request)) ··· 289 288 return ret; 290 289 if (context->ret < 0) 291 290 return context->ret; 292 - // Be careful, write() is waiting for a full message while read() 293 - // only returns a payload 291 + /* Be careful, write() is waiting for a full message while read() 292 + * only returns a payload 293 + */ 294 294 if (copy_to_user(user_buf, context->reply, count)) 295 295 return -EFAULT; 296 296
+12 -11
drivers/staging/wfx/fwio.c
··· 14 14 #include "wfx.h" 15 15 #include "hwio.h" 16 16 17 - // Addresses below are in SRAM area 17 + /* Addresses below are in SRAM area */ 18 18 #define WFX_DNLD_FIFO 0x09004000 19 19 #define DNLD_BLOCK_SIZE 0x0400 20 - #define DNLD_FIFO_SIZE 0x8000 // (32 * DNLD_BLOCK_SIZE) 21 - // Download Control Area (DCA) 20 + #define DNLD_FIFO_SIZE 0x8000 /* (32 * DNLD_BLOCK_SIZE) */ 21 + /* Download Control Area (DCA) */ 22 22 #define WFX_DCA_IMAGE_SIZE 0x0900C000 23 23 #define WFX_DCA_PUT 0x0900C004 24 24 #define WFX_DCA_GET 0x0900C008 ··· 58 58 #define ERR_ECC_PUB_KEY 0x11 59 59 #define ERR_MAC_KEY 0x18 60 60 61 - #define DCA_TIMEOUT 50 // milliseconds 62 - #define WAKEUP_TIMEOUT 200 // milliseconds 61 + #define DCA_TIMEOUT 50 /* milliseconds */ 62 + #define WAKEUP_TIMEOUT 200 /* milliseconds */ 63 63 64 64 static const char * const fwio_errors[] = { 65 65 [ERR_INVALID_SEC_TYPE] = "Invalid section type or wrong encryption", ··· 125 125 126 126 data = (*fw)->data; 127 127 if (memcmp(data, "KEYSET", 6) != 0) { 128 - // Legacy firmware format 128 + /* Legacy firmware format */ 129 129 *file_offset = 0; 130 130 keyset_file = 0x90; 131 131 } else { ··· 207 207 if (ret < 0) 208 208 return ret; 209 209 210 - // The device seems to not support writing 0 in this register 211 - // during first loop 210 + /* The device seems to not support writing 0 in this register 211 + * during first loop 212 + */ 212 213 offs += DNLD_BLOCK_SIZE; 213 214 ret = sram_reg_write(wdev, WFX_DCA_PUT, offs); 214 215 if (ret < 0) ··· 266 265 if (ret) 267 266 goto error; 268 267 269 - sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); // Fifo init 268 + sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); /* Fifo init */ 270 269 sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", 271 270 FW_VERSION_SIZE); 272 271 sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset, ··· 290 289 291 290 sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE); 292 291 ret = wait_ncp_status(wdev, NCP_AUTH_OK); 293 - // Legacy ROM support 292 + /* Legacy ROM support */ 294 293 if (ret < 0) 295 294 ret = wait_ncp_status(wdev, NCP_PUB_KEY_RDY); 296 295 if (ret < 0) ··· 335 334 { 336 335 int ret; 337 336 int hw_revision, hw_type; 338 - int wakeup_timeout = 50; // ms 337 + int wakeup_timeout = 50; /* ms */ 339 338 ktime_t now, start; 340 339 u32 reg; 341 340
+7 -5
drivers/staging/wfx/hif_api_cmd.h
··· 134 134 u8 num_of_channels; 135 135 __le32 min_channel_time; 136 136 __le32 max_channel_time; 137 - __le32 tx_power_level; // signed value 137 + __le32 tx_power_level; /* signed value */ 138 138 struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS]; 139 139 u8 channel_list[]; 140 140 } __packed; ··· 174 174 }; 175 175 176 176 struct hif_req_tx { 177 - // packet_id is not interpreted by the device, so it is not necessary to 178 - // declare it little endian 177 + /* packet_id is not interpreted by the device, so it is not necessary to 178 + * declare it little endian 179 + */ 179 180 u32 packet_id; 180 181 u8 max_tx_rate; 181 182 u8 queue_id:2; ··· 212 211 213 212 struct hif_cnf_tx { 214 213 __le32 status; 215 - // packet_id is copied from struct hif_req_tx without been interpreted 216 - // by the device, so it is not necessary to declare it little endian 214 + /* packet_id is copied from struct hif_req_tx without been interpreted 215 + * by the device, so it is not necessary to declare it little endian 216 + */ 217 217 u32 packet_id; 218 218 u8 txed_rate; 219 219 u8 ack_failures;
+9 -8
drivers/staging/wfx/hif_api_general.h
··· 114 114 }; 115 115 116 116 struct hif_ind_startup { 117 - // As the others, this struct is interpreted as little endian by the 118 - // device. However, this struct is also used by the driver. We prefer to 119 - // declare it in native order and doing byte swap on reception. 117 + /* As the others, this struct is interpreted as little endian by the 118 + * device. However, this struct is also used by the driver. We prefer to 119 + * declare it in native order and doing byte swap on reception. 120 + */ 120 121 __le32 status; 121 122 u16 hardware_id; 122 123 u8 opn[14]; ··· 194 193 __le32 throughput; 195 194 __le32 nb_rx_by_rate[API_RATE_NUM_ENTRIES]; 196 195 __le16 per[API_RATE_NUM_ENTRIES]; 197 - __le16 snr[API_RATE_NUM_ENTRIES]; // signed value 198 - __le16 rssi[API_RATE_NUM_ENTRIES]; // signed value 199 - __le16 cfo[API_RATE_NUM_ENTRIES]; // signed value 196 + __le16 snr[API_RATE_NUM_ENTRIES]; /* signed value */ 197 + __le16 rssi[API_RATE_NUM_ENTRIES]; /* signed value */ 198 + __le16 cfo[API_RATE_NUM_ENTRIES]; /* signed value */ 200 199 __le32 date; 201 200 __le32 pwr_clk_freq; 202 201 u8 is_ext_pwr_clk; ··· 206 205 struct hif_tx_power_loop_info { 207 206 __le16 tx_gain_dig; 208 207 __le16 tx_gain_pa; 209 - __le16 target_pout; // signed value 210 - __le16 p_estimation; // signed value 208 + __le16 target_pout; /* signed value */ 209 + __le16 p_estimation; /* signed value */ 211 210 __le16 vpdet; 212 211 u8 measurement_index; 213 212 u8 reserved;
+1 -1
drivers/staging/wfx/hif_api_mib.h
··· 209 209 } __packed; 210 210 211 211 struct hif_mib_current_tx_power_level { 212 - __le32 power_level; // signed value 212 + __le32 power_level; /* signed value */ 213 213 } __packed; 214 214 215 215 struct hif_mib_non_erp_protection {
+9 -8
drivers/staging/wfx/hif_rx.c
··· 19 19 static int hif_generic_confirm(struct wfx_dev *wdev, 20 20 const struct hif_msg *hif, const void *buf) 21 21 { 22 - // All confirm messages start with status 22 + /* All confirm messages start with status */ 23 23 int status = le32_to_cpup((__le32 *)buf); 24 24 int cmd = hif->id; 25 - int len = le16_to_cpu(hif->len) - 4; // drop header 25 + int len = le16_to_cpu(hif->len) - 4; /* drop header */ 26 26 27 27 WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error"); 28 28 ··· 244 244 return 0; 245 245 case HIF_GENERIC_INDICATION_TYPE_RX_STATS: 246 246 mutex_lock(&wdev->rx_stats_lock); 247 - // Older firmware send a generic indication beside RxStats 247 + /* Older firmware send a generic indication beside RxStats */ 248 248 if (!wfx_api_older_than(wdev, 1, 4)) 249 249 dev_info(wdev->dev, "Rx test ongoing. Temperature: %d degrees C\n", 250 250 body->data.rx_stats.current_temp); ··· 297 297 "bus clock is too slow (<1kHz)" }, 298 298 { HIF_ERROR_HIF_RX_DATA_TOO_LARGE, 299 299 "HIF message too large" }, 300 - // Following errors only exists in old firmware versions: 300 + /* Following errors only exists in old firmware versions: */ 301 301 { HIF_ERROR_HIF_TX_QUEUE_FULL, 302 302 "HIF messages queue is full" }, 303 303 { HIF_ERROR_HIF_BUS, ··· 374 374 { HIF_IND_ID_GENERIC, hif_generic_indication }, 375 375 { HIF_IND_ID_ERROR, hif_error_indication }, 376 376 { HIF_IND_ID_EXCEPTION, hif_exception_indication }, 377 - // FIXME: allocate skb_p from hif_receive_indication and make it generic 377 + /* FIXME: allocate skb_p from hif_receive_indication and make it generic */ 378 378 //{ HIF_IND_ID_RX, hif_receive_indication }, 379 379 }; 380 380 ··· 385 385 int hif_id = hif->id; 386 386 387 387 if (hif_id == HIF_IND_ID_RX) { 388 - // hif_receive_indication take care of skb lifetime 388 + /* hif_receive_indication take care of skb lifetime */ 389 389 hif_receive_indication(wdev, hif, hif->body, skb); 390 390 return; 391 391 } 392 - // Note: mutex_is_lock cause an implicit memory barrier that protect 393 - // buf_send 392 + /* Note: mutex_is_lock cause an implicit memory barrier that protect 393 + * buf_send 394 + */ 394 395 if (mutex_is_locked(&wdev->hif_cmd.lock) && 395 396 wdev->hif_cmd.buf_send && 396 397 wdev->hif_cmd.buf_send->id == hif_id) {
+18 -14
drivers/staging/wfx/hif_tx.c
··· 55 55 int vif = request->interface; 56 56 int ret; 57 57 58 - // Do not wait for any reply if chip is frozen 58 + /* Do not wait for any reply if chip is frozen */ 59 59 if (wdev->chip_frozen) 60 60 return -ETIMEDOUT; 61 61 62 62 mutex_lock(&wdev->hif_cmd.lock); 63 63 WARN(wdev->hif_cmd.buf_send, "data locking error"); 64 64 65 - // Note: call to complete() below has an implicit memory barrier that 66 - // hopefully protect buf_send 65 + /* Note: call to complete() below has an implicit memory barrier that 66 + * hopefully protect buf_send 67 + */ 67 68 wdev->hif_cmd.buf_send = request; 68 69 wdev->hif_cmd.buf_recv = reply; 69 70 wdev->hif_cmd.len_recv = reply_len; ··· 73 72 wfx_bh_request_tx(wdev); 74 73 75 74 if (no_reply) { 76 - // Chip won't reply. Give enough time to the wq to send the 77 - // buffer. 75 + /* Chip won't reply. Give enough time to the wq to send the 76 + * buffer. 77 + */ 78 78 msleep(100); 79 79 wdev->hif_cmd.buf_send = NULL; 80 80 mutex_unlock(&wdev->hif_cmd.lock); ··· 119 117 return ret; 120 118 } 121 119 122 - // This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any 123 - // request anymore. Obviously, only call this function during device unregister. 120 + /* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any 121 + * request anymore. Obviously, only call this function during device unregister. 122 + */ 124 123 int hif_shutdown(struct wfx_dev *wdev) 125 124 { 126 125 int ret; ··· 280 277 { 281 278 int ret; 282 279 struct hif_msg *hif; 283 - // body associated to HIF_REQ_ID_STOP_SCAN is empty 280 + /* body associated to HIF_REQ_ID_STOP_SCAN is empty */ 284 281 wfx_alloc_hif(0, &hif); 285 282 286 283 if (!hif) ··· 344 341 { 345 342 int ret; 346 343 struct hif_msg *hif; 347 - // FIXME: only send necessary bits 344 + /* FIXME: only send necessary bits */ 348 345 struct hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif); 349 346 350 347 if (!hif) 351 348 return -ENOMEM; 352 - // FIXME: swap bytes as necessary in body 349 + /* FIXME: swap bytes as necessary in body */ 353 350 memcpy(body, arg, sizeof(*body)); 354 351 if (wfx_api_older_than(wdev, 1, 5)) 355 - // Legacy firmwares expect that add_key to be sent on right 356 - // interface. 352 + /* Legacy firmwares expect that add_key to be sent on right 353 + * interface. 354 + */ 357 355 wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, 358 356 sizeof(*body)); 359 357 else ··· 398 394 body->cw_max = cpu_to_le16(arg->cw_max); 399 395 body->tx_op_limit = cpu_to_le16(arg->txop * USEC_PER_TXOP); 400 396 body->queue_id = 3 - queue; 401 - // API 2.0 has changed queue IDs values 397 + /* API 2.0 has changed queue IDs values */ 402 398 if (wfx_api_older_than(wvif->wdev, 2, 0) && queue == IEEE80211_AC_BE) 403 399 body->queue_id = HIF_QUEUE_ID_BACKGROUND; 404 400 if (wfx_api_older_than(wvif->wdev, 2, 0) && queue == IEEE80211_AC_BK) ··· 423 419 return -ENOMEM; 424 420 if (ps) { 425 421 body->enter_psm = 1; 426 - // Firmware does not support more than 128ms 422 + /* Firmware does not support more than 128ms */ 427 423 body->fast_psm_idle_period = min(dynamic_ps_timeout * 2, 255); 428 424 if (body->fast_psm_idle_period) 429 425 body->fast_psm = 1;
+2 -2
drivers/staging/wfx/hif_tx_mib.c
··· 68 68 struct hif_mib_extended_count_table *arg) 69 69 { 70 70 if (wfx_api_older_than(wdev, 1, 3)) { 71 - // extended_count_table is wider than count_table 71 + /* extended_count_table is wider than count_table */ 72 72 memset(arg, 0xFF, sizeof(*arg)); 73 73 return hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE, 74 74 arg, sizeof(struct hif_mib_count_table)); ··· 246 246 }; 247 247 248 248 if (addr) { 249 - // Caution: type of addr is __be32 249 + /* Caution: type of addr is __be32 */ 250 250 memcpy(arg.ipv4_address, addr, sizeof(arg.ipv4_address)); 251 251 arg.arp_enable = HIF_ARP_NS_FILTERING_ENABLE; 252 252 }
+3 -3
drivers/staging/wfx/hwio.c
··· 31 31 int ret; 32 32 __le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL); 33 33 34 - *val = ~0; // Never return undefined value 34 + *val = ~0; /* Never return undefined value */ 35 35 if (!tmp) 36 36 return -ENOMEM; 37 37 ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, ··· 153 153 154 154 err: 155 155 if (ret < 0) 156 - memset(buf, 0xFF, len); // Never return undefined value 156 + memset(buf, 0xFF, len); /* Never return undefined value */ 157 157 return ret; 158 158 } 159 159 ··· 335 335 { 336 336 int ret; 337 337 338 - *val = ~0; // Never return undefined value 338 + *val = ~0; /* Never return undefined value */ 339 339 ret = write32_locked(wdev, WFX_REG_SET_GEN_R_W, IGPR_RW | index << 24); 340 340 if (ret) 341 341 return ret;
+8 -8
drivers/staging/wfx/hwio.h
··· 27 27 int ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val); 28 28 int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val); 29 29 30 - #define CFG_ERR_SPI_FRAME 0x00000001 // only with SPI 31 - #define CFG_ERR_SDIO_BUF_MISMATCH 0x00000001 // only with SDIO 30 + #define CFG_ERR_SPI_FRAME 0x00000001 /* only with SPI */ 31 + #define CFG_ERR_SDIO_BUF_MISMATCH 0x00000001 /* only with SDIO */ 32 32 #define CFG_ERR_BUF_UNDERRUN 0x00000002 33 33 #define CFG_ERR_DATA_IN_TOO_LARGE 0x00000004 34 34 #define CFG_ERR_HOST_NO_OUT_QUEUE 0x00000008 35 35 #define CFG_ERR_BUF_OVERRUN 0x00000010 36 36 #define CFG_ERR_DATA_OUT_TOO_LARGE 0x00000020 37 37 #define CFG_ERR_HOST_NO_IN_QUEUE 0x00000040 38 - #define CFG_ERR_HOST_CRC_MISS 0x00000080 // only with SDIO 39 - #define CFG_SPI_IGNORE_CS 0x00000080 // only with SPI 40 - #define CFG_BYTE_ORDER_MASK 0x00000300 // only writable with SPI 38 + #define CFG_ERR_HOST_CRC_MISS 0x00000080 /* only with SDIO */ 39 + #define CFG_SPI_IGNORE_CS 0x00000080 /* only with SPI */ 40 + #define CFG_BYTE_ORDER_MASK 0x00000300 /* only writable with SPI */ 41 41 #define CFG_BYTE_ORDER_BADC 0x00000000 42 42 #define CFG_BYTE_ORDER_DCBA 0x00000100 43 - #define CFG_BYTE_ORDER_ABCD 0x00000200 // SDIO always use this value 43 + #define CFG_BYTE_ORDER_ABCD 0x00000200 /* SDIO always use this value */ 44 44 #define CFG_DIRECT_ACCESS_MODE 0x00000400 45 45 #define CFG_PREFETCH_AHB 0x00000800 46 46 #define CFG_DISABLE_CPU_CLK 0x00001000 47 47 #define CFG_PREFETCH_SRAM 0x00002000 48 48 #define CFG_CPU_RESET 0x00004000 49 - #define CFG_SDIO_DISABLE_IRQ 0x00008000 // only with SDIO 49 + #define CFG_SDIO_DISABLE_IRQ 0x00008000 /* only with SDIO */ 50 50 #define CFG_IRQ_ENABLE_DATA 0x00010000 51 51 #define CFG_IRQ_ENABLE_WRDY 0x00020000 52 52 #define CFG_CLK_RISE_EDGE 0x00040000 53 - #define CFG_SDIO_DISABLE_CRC_CHK 0x00080000 // only with SDIO 53 + #define CFG_SDIO_DISABLE_CRC_CHK 0x00080000 /* only with SDIO */ 54 54 #define CFG_RESERVED 0x00F00000 55 55 #define CFG_DEVICE_ID_MAJOR 0x07000000 56 56 #define CFG_DEVICE_ID_RESERVED 0x78000000
+2 -2
drivers/staging/wfx/key.c
··· 84 84 memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data)); 85 85 keybuf += sizeof(msg->tkip_key_data); 86 86 if (iftype == NL80211_IFTYPE_AP) 87 - // Use Tx MIC Key 87 + /* Use Tx MIC Key */ 88 88 memcpy(msg->rx_mic_key, keybuf + 0, sizeof(msg->rx_mic_key)); 89 89 else 90 - // Use Rx MIC Key 90 + /* Use Rx MIC Key */ 91 91 memcpy(msg->rx_mic_key, keybuf + 8, sizeof(msg->rx_mic_key)); 92 92 return HIF_KEY_TYPE_TKIP_GROUP; 93 93 }
+7 -6
drivers/staging/wfx/main.c
··· 92 92 .bitrates = wfx_rates, 93 93 .n_bitrates = ARRAY_SIZE(wfx_rates), 94 94 .ht_cap = { 95 - // Receive caps 95 + /* Receive caps */ 96 96 .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | 97 97 IEEE80211_HT_CAP_MAX_AMSDU | 98 98 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), ··· 100 100 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K, 101 101 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE, 102 102 .mcs = { 103 - .rx_mask = { 0xFF }, // MCS0 to MCS7 103 + .rx_mask = { 0xFF }, /* MCS0 to MCS7 */ 104 104 .rx_highest = cpu_to_le16(72), 105 105 .tx_params = IEEE80211_HT_MCS_TX_DEFINED, 106 106 }, ··· 294 294 hw->wiphy->n_iface_combinations = ARRAY_SIZE(wfx_iface_combinations); 295 295 hw->wiphy->iface_combinations = wfx_iface_combinations; 296 296 hw->wiphy->bands[NL80211_BAND_2GHZ] = devm_kmalloc(dev, sizeof(wfx_band_2ghz), GFP_KERNEL); 297 - // FIXME: also copy wfx_rates and wfx_2ghz_chantable 297 + /* FIXME: also copy wfx_rates and wfx_2ghz_chantable */ 298 298 memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, 299 299 sizeof(wfx_band_2ghz)); 300 300 ··· 336 336 int err; 337 337 struct gpio_desc *gpio_saved; 338 338 339 - // During first part of boot, gpio_wakeup cannot yet been used. So 340 - // prevent bh() to touch it. 339 + /* During first part of boot, gpio_wakeup cannot yet been used. So 340 + * prevent bh() to touch it. 341 + */ 341 342 gpio_saved = wdev->pdata.gpio_wakeup; 342 343 wdev->pdata.gpio_wakeup = NULL; 343 344 wdev->poll_irq = true; ··· 361 360 goto err0; 362 361 } 363 362 364 - // FIXME: fill wiphy::hw_version 363 + /* FIXME: fill wiphy::hw_version */ 365 364 dev_info(wdev->dev, "started firmware %d.%d.%d \"%s\" (API: %d.%d, keyset: %02X, caps: 0x%.8X)\n", 366 365 wdev->hw_caps.firmware_major, wdev->hw_caps.firmware_minor, 367 366 wdev->hw_caps.firmware_build, wdev->hw_caps.firmware_label,
+15 -12
drivers/staging/wfx/queue.c
··· 32 32 { 33 33 int ret; 34 34 35 - // Do not wait for any reply if chip is frozen 35 + /* Do not wait for any reply if chip is frozen */ 36 36 if (wdev->chip_frozen) 37 37 return; 38 38 ··· 45 45 dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", 46 46 wdev->hif.tx_buffers_used); 47 47 wfx_pending_dump_old_frames(wdev, 3000); 48 - // FIXME: drop pending frames here 48 + /* FIXME: drop pending frames here */ 49 49 wdev->chip_frozen = true; 50 50 } 51 51 mutex_unlock(&wdev->hif_cmd.lock); ··· 60 60 61 61 void wfx_tx_queues_init(struct wfx_vif *wvif) 62 62 { 63 - // The device is in charge to respect the details of the QoS parameters. 64 - // The driver just ensure that it roughtly respect the priorities to 65 - // avoid any shortage. 63 + /* The device is in charge to respect the details of the QoS parameters. 64 + * The driver just ensure that it roughtly respect the priorities to 65 + * avoid any shortage. 66 + */ 66 67 const int priorities[IEEE80211_NUM_ACS] = { 1, 2, 64, 128 }; 67 68 int i; 68 69 ··· 218 217 if (wvif->vif->type != NL80211_IFTYPE_AP) 219 218 return false; 220 219 for (i = 0; i < IEEE80211_NUM_ACS; ++i) 221 - // Note: since only AP can have mcast frames in queue and only 222 - // one vif can be AP, all queued frames has same interface id 220 + /* Note: since only AP can have mcast frames in queue and only 221 + * one vif can be AP, all queued frames has same interface id 222 + */ 223 223 if (!skb_queue_empty_lockless(&wvif->tx_queue[i].cab)) 224 224 return true; 225 225 return false; ··· 239 237 struct hif_msg *hif; 240 238 struct sk_buff *skb; 241 239 242 - // sort the queues 240 + /* sort the queues */ 243 241 wvif = NULL; 244 242 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 245 243 for (i = 0; i < IEEE80211_NUM_ACS; i++) { ··· 261 259 skb = skb_dequeue(&queues[i]->cab); 262 260 if (!skb) 263 261 continue; 264 - // Note: since only AP can have mcast frames in queue 265 - // and only one vif can be AP, all queued frames has 266 - // same interface id 262 + /* Note: since only AP can have mcast frames in queue 263 + * and only one vif can be AP, all queued frames has 264 + * same interface id 265 + */ 267 266 hif = (struct hif_msg *)skb->data; 268 267 WARN_ON(hif->interface != wvif->id); 269 268 WARN_ON(queues[i] != ··· 273 270 trace_queues_stats(wdev, queues[i]); 274 271 return skb; 275 272 } 276 - // No more multicast to sent 273 + /* No more multicast to sent */ 277 274 wvif->after_dtim_tx_allowed = false; 278 275 schedule_work(&wvif->update_tim_work); 279 276 }
+1 -1
drivers/staging/wfx/queue.h
··· 16 16 17 17 struct wfx_queue { 18 18 struct sk_buff_head normal; 19 - struct sk_buff_head cab; // Content After (DTIM) Beacon 19 + struct sk_buff_head cab; /* Content After (DTIM) Beacon */ 20 20 atomic_t pending_frames; 21 21 int priority; 22 22 };
+42 -36
drivers/staging/wfx/sta.c
··· 24 24 { 25 25 int i; 26 26 u32 ret = 0; 27 - // The device only supports 2GHz 27 + /* The device only supports 2GHz */ 28 28 struct ieee80211_supported_band *sband = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]; 29 29 30 30 for (i = 0; i < sband->n_bitrates; i++) { ··· 51 51 void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd) 52 52 { 53 53 if (cmd == STA_NOTIFY_AWAKE) { 54 - // Device recover normal temperature 54 + /* Device recover normal temperature */ 55 55 if (cancel_delayed_work(&wdev->cooling_timeout_work)) 56 56 wfx_tx_unlock(wdev); 57 57 } else { 58 - // Device is too hot 58 + /* Device is too hot */ 59 59 schedule_delayed_work(&wdev->cooling_timeout_work, 10 * HZ); 60 60 wfx_tx_lock(wdev); 61 61 } ··· 103 103 struct wfx_dev *wdev = hw->priv; 104 104 bool filter_bssid, filter_prbreq, filter_beacon; 105 105 106 - // Notes: 107 - // - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered 108 - // - PS-Poll (FIF_PSPOLL) are never filtered 109 - // - RTS, CTS and Ack (FIF_CONTROL) are always filtered 110 - // - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered 111 - // - Firmware does (yet) allow to forward unicast traffic sent to 112 - // other stations (aka. promiscuous mode) 106 + /* Notes: 107 + * - Probe responses (FIF_BCN_PRBRESP_PROMISC) are never filtered 108 + * - PS-Poll (FIF_PSPOLL) are never filtered 109 + * - RTS, CTS and Ack (FIF_CONTROL) are always filtered 110 + * - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered 111 + * - Firmware does (yet) allow to forward unicast traffic sent to 112 + * other stations (aka. promiscuous mode) 113 + */ 113 114 *total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS | 114 115 FIF_PROBE_REQ | FIF_PSPOLL; 115 116 ··· 118 117 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 119 118 mutex_lock(&wvif->scan_lock); 120 119 121 - // Note: FIF_BCN_PRBRESP_PROMISC covers probe response and 122 - // beacons from other BSS 120 + /* Note: FIF_BCN_PRBRESP_PROMISC covers probe response and 121 + * beacons from other BSS 122 + */ 123 123 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) 124 124 filter_beacon = false; 125 125 else ··· 132 130 else 133 131 filter_bssid = true; 134 132 135 - // In AP mode, chip can reply to probe request itself 133 + /* In AP mode, chip can reply to probe request itself */ 136 134 if (*total_flags & FIF_PROBE_REQ && 137 135 wvif->vif->type == NL80211_IFTYPE_AP) { 138 136 dev_dbg(wdev->dev, "do not forward probe request in AP mode\n"); ··· 163 161 chan1 = wdev_to_wvif(wvif->wdev, 1)->vif->bss_conf.chandef.chan; 164 162 if (chan0 && chan1 && wvif->vif->type != NL80211_IFTYPE_AP) { 165 163 if (chan0->hw_value == chan1->hw_value) { 166 - // It is useless to enable PS if channels are the same. 164 + /* It is useless to enable PS if channels are the same. */ 167 165 if (enable_ps) 168 166 *enable_ps = false; 169 167 if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps) 170 168 dev_info(wvif->wdev->dev, "ignoring requested PS mode"); 171 169 return -1; 172 170 } else { 173 - // It is necessary to enable PS if channels 174 - // are different. 171 + /* It is necessary to enable PS if channels 172 + * are different. 173 + */ 175 174 if (enable_ps) 176 175 *enable_ps = true; 177 176 if (wvif->wdev->force_ps_timeout > -1) ··· 308 305 if (vif->type == NL80211_IFTYPE_STATION) 309 306 hif_set_mfp(wvif, sta->mfp, sta->mfp); 310 307 311 - // In station mode, the firmware interprets new link-id as a TDLS peer. 308 + /* In station mode, the firmware interprets new link-id as a TDLS peer */ 312 309 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) 313 310 return 0; 314 311 sta_priv->link_id = ffz(wvif->link_id_map); ··· 326 323 struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; 327 324 struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; 328 325 329 - // See note in wfx_sta_add() 326 + /* See note in wfx_sta_add() */ 330 327 if (!sta_priv->link_id) 331 328 return 0; 332 - // FIXME add a mutex? 329 + /* FIXME add a mutex? */ 333 330 hif_map_link(wvif, true, sta->addr, sta_priv->link_id, false); 334 331 wvif->link_id_map &= ~BIT(sta_priv->link_id); 335 332 return 0; ··· 424 421 return; 425 422 } 426 423 427 - rcu_read_lock(); // protect ssidie 424 + rcu_read_lock(); /* protect ssidie */ 428 425 if (bss) 429 426 ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID); 430 427 if (ssidie) { ··· 460 457 int ampdu_density = 0; 461 458 bool greenfield = false; 462 459 463 - rcu_read_lock(); // protect sta 460 + rcu_read_lock(); /* protect sta */ 464 461 if (info->bssid && !info->ibss_joined) 465 462 sta = ieee80211_find_sta(wvif->vif, info->bssid); 466 463 if (sta && sta->ht_cap.ht_supported) ··· 474 471 hif_set_association_mode(wvif, ampdu_density, greenfield, 475 472 info->use_short_preamble); 476 473 hif_keep_alive_period(wvif, 0); 477 - // beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use 478 - // the same value. 474 + /* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use 475 + * the same value. 476 + */ 479 477 hif_set_bss_params(wvif, info->aid, 7); 480 478 hif_set_beacon_wakeup_period(wvif, 1, 1); 481 479 wfx_update_pm(wvif); ··· 500 496 501 497 static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable) 502 498 { 503 - // Driver has Content After DTIM Beacon in queue. Driver is waiting for 504 - // a signal from the firmware. Since we are going to stop to send 505 - // beacons, this signal will never happens. See also 506 - // wfx_suspend_resume_mc() 499 + /* Driver has Content After DTIM Beacon in queue. Driver is waiting for 500 + * a signal from the firmware. Since we are going to stop to send 501 + * beacons, this signal will never happens. See also 502 + * wfx_suspend_resume_mc() 503 + */ 507 504 if (!enable && wfx_tx_queues_has_cab(wvif)) { 508 505 wvif->after_dtim_tx_allowed = true; 509 506 wfx_bh_request_tx(wvif->wdev); ··· 544 539 __func__); 545 540 hif_set_beacon_wakeup_period(wvif, info->dtim_period, 546 541 info->dtim_period); 547 - // We temporary forwarded beacon for join process. It is now no 548 - // more necessary. 542 + /* We temporary forwarded beacon for join process. It is now no 543 + * more necessary. 544 + */ 549 545 wfx_filter_beacon(wvif, true); 550 546 } 551 547 ··· 668 662 struct ieee80211_vif *vif, 669 663 struct ieee80211_ampdu_params *params) 670 664 { 671 - // Aggregation is implemented fully in firmware 665 + /* Aggregation is implemented fully in firmware */ 672 666 switch (params->action) { 673 667 case IEEE80211_AMPDU_RX_START: 674 668 case IEEE80211_AMPDU_RX_STOP: 675 - // Just acknowledge it to enable frame re-ordering 669 + /* Just acknowledge it to enable frame re-ordering */ 676 670 return 0; 677 671 default: 678 - // Leave the firmware doing its business for tx aggregation 672 + /* Leave the firmware doing its business for tx aggregation */ 679 673 return -EOPNOTSUPP; 680 674 } 681 675 } ··· 747 741 return -EOPNOTSUPP; 748 742 } 749 743 750 - // FIXME: prefer use of container_of() to get vif 744 + /* FIXME: prefer use of container_of() to get vif */ 751 745 wvif->vif = vif; 752 746 wvif->wdev = wdev; 753 747 754 - wvif->link_id_map = 1; // link-id 0 is reserved for multicast 748 + wvif->link_id_map = 1; /* link-id 0 is reserved for multicast */ 755 749 INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); 756 750 INIT_DELAYED_WORK(&wvif->beacon_loss_work, wfx_beacon_loss_work); 757 751 ··· 781 775 782 776 wvif = NULL; 783 777 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 784 - // Combo mode does not support Block Acks. We can re-enable them 778 + /* Combo mode does not support Block Acks. We can re-enable them */ 785 779 if (wvif_count(wdev) == 1) 786 780 hif_set_block_ack_policy(wvif, 0xFF, 0xFF); 787 781 else ··· 813 807 814 808 wvif = NULL; 815 809 while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { 816 - // Combo mode does not support Block Acks. We can re-enable them 810 + /* Combo mode does not support Block Acks. We can re-enable them */ 817 811 if (wvif_count(wdev) == 1) 818 812 hif_set_block_ack_policy(wvif, 0xFF, 0xFF); 819 813 else
+3 -3
drivers/staging/wfx/sta.h
··· 18 18 int vif_id; 19 19 }; 20 20 21 - // mac80211 interface 21 + /* mac80211 interface */ 22 22 int wfx_start(struct ieee80211_hw *hw); 23 23 void wfx_stop(struct ieee80211_hw *hw); 24 24 int wfx_config(struct ieee80211_hw *hw, u32 changed); ··· 59 59 struct ieee80211_vif *vif, 60 60 struct ieee80211_chanctx_conf *conf); 61 61 62 - // Hardware API Callbacks 62 + /* Hardware API Callbacks */ 63 63 void wfx_cooling_timeout_work(struct work_struct *work); 64 64 void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd); 65 65 void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); 66 66 void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi); 67 67 int wfx_update_pm(struct wfx_vif *wvif); 68 68 69 - // Other Helpers 69 + /* Other Helpers */ 70 70 void wfx_reset(struct wfx_vif *wvif); 71 71 u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates); 72 72
+1 -1
drivers/staging/wfx/traces.h
··· 378 378 __array(int, tx_count, 4) 379 379 ), 380 380 TP_fast_assign( 381 - // Keep sync with wfx_rates definition in main.c 381 + /* Keep sync with wfx_rates definition in main.c */ 382 382 static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 383 383 10, 11, 12, 13 }; 384 384 const struct ieee80211_tx_info *tx_info =
+1 -1
drivers/staging/wfx/wfx.h
··· 22 22 #include "queue.h" 23 23 #include "hif_tx.h" 24 24 25 - #define USEC_PER_TXOP 32 // see struct ieee80211_tx_queue_params 25 + #define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */ 26 26 #define USEC_PER_TU 1024 27 27 28 28 struct hwbus_ops;