Re: [PATCH 2/2] [v19 2/2] wireless: Initial driver submission for pureLiFi STA devices

kernel test robot
2021-10-24T17:59:31Z

[-- Attachment #1: Type: text/plain, Size: 5475 bytes --]

Hi Srinivasan,

I love your patch! Yet something to improve:

[auto build test ERROR on kvalo-wireless-drivers-next/master]
[also build test ERROR on kvalo-wireless-drivers/master jberg-mac80211/master v5.15-rc6]
[cannot apply to jberg-mac80211-next/master next-20211022]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Srinivasan-Raju/nl80211-Add-LC-placeholder-band-definition-to-enum-nl80211_band/20211012-215200
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/7a077cc97d6f22264e6c9ac98d9e904ca908ccba
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Srinivasan-Raju/nl80211-Add-LC-placeholder-band-definition-to-enum-nl80211_band/20211012-215200
git checkout 7a077cc97d6f22264e6c9ac98d9e904ca908ccba
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

drivers/net/wireless/purelifi/plfxlc/mac.c: In function 'purelifi_mac_rx':
>> drivers/net/wireless/purelifi/plfxlc/mac.c:424:28: error: variable 'min_exp_seq_nmb' set but not used [-Werror=unused-but-set-variable]
424 | static unsigned short int min_exp_seq_nmb;
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

vim +/min_exp_seq_nmb +424 drivers/net/wireless/purelifi/plfxlc/mac.c

412
413 int purelifi_mac_rx(struct ieee80211_hw *hw, const u8 *buffer,
414 unsigned int length)
415 {
416 struct purelifi_mac *mac = purelifi_hw_mac(hw);
417 struct ieee80211_rx_status stats;
418 const struct rx_status *status;
419 struct sk_buff *skb;
420 int bad_frame = 0;
421 __le16 fc;
422 int need_padding;
423 unsigned int payload_length;
> 424 static unsigned short int min_exp_seq_nmb;
425 int sidx;
426 struct purelifi_usb_tx *tx;
427 /* Packet blockade during disabled interface. */
428 if (!mac->vif)
429 return 0;
430
431 memset(&stats, 0, sizeof(stats));
432 status = (struct rx_status *)buffer;
433
434 stats.flag = 0;
435 stats.freq = 2412;
436 stats.band = NL80211_BAND_LC;
437 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10;
438
439 stats.signal = mac->rssi;
440
441 if (status->rate_idx > 7)
442 stats.rate_idx = 0;
443 else
444 stats.rate_idx = status->rate_idx;
445
446 mac->crc_errors = be64_to_cpu(status->crc_error_count);
447
448 if (!bad_frame &&
449 purelifi_filter_ack(hw, (struct ieee80211_hdr *)buffer, &stats) &&
450 !mac->pass_ctrl)
451 return 0;
452
453 buffer += sizeof(struct rx_status);
454 payload_length = get_unaligned_be32(buffer);
455
456 /* MTU = 1500, MAC header = 36, CRC = 4, sum = 1540 */
457 if (payload_length > 1560) {
458 dev_err(purelifi_mac_dev(mac), " > MTU %u\n", payload_length);
459 return 0;
460 }
461 buffer += sizeof(u32);
462
463 fc = get_unaligned((__le16 *)buffer);
464 need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
465
466 tx = &mac->chip.usb.tx;
467
468 for (sidx = 0; sidx < MAX_STA_NUM - 1; sidx++) {
469 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN))
470 continue;
471 if (tx->station[sidx].flag & STATION_CONNECTED_FLAG) {
472 tx->station[sidx].flag |= STATION_HEARTBEAT_FLAG;
473 break;
474 }
475 }
476
477 if (sidx == MAX_STA_NUM - 1) {
478 for (sidx = 0; sidx < MAX_STA_NUM - 1; sidx++) {
479 if (tx->station[sidx].flag & STATION_CONNECTED_FLAG)
480 continue;
481 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN);
482 tx->station[sidx].flag |= STATION_CONNECTED_FLAG;
483 tx->station[sidx].flag |= STATION_HEARTBEAT_FLAG;
484 break;
485 }
486 }
487
488 switch (buffer[0]) {
489 case IEEE80211_STYPE_PROBE_REQ:
490 dev_dbg(purelifi_mac_dev(mac), "Probe request\n");
491 break;
492 case IEEE80211_STYPE_ASSOC_REQ:
493 dev_dbg(purelifi_mac_dev(mac), "Association request\n");
494 break;
495 case IEEE80211_STYPE_AUTH:
496 dev_dbg(purelifi_mac_dev(mac), "Authentication req\n");
497 min_exp_seq_nmb = 0;
498 break;
499 case IEEE80211_FTYPE_DATA:
500 dev_dbg(purelifi_mac_dev(mac), "802.11 data frame\n");
501 break;
502 }
503
504 skb = dev_alloc_skb(payload_length + (need_padding ? 2 : 0));
505 if (!skb)
506 return -ENOMEM;
507
508 if (need_padding)
509 /* Make sure that the payload data is 4 byte aligned. */
510 skb_reserve(skb, 2);
511
512 skb_put_data(skb, buffer, payload_length);
513 memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
514 ieee80211_rx_irqsafe(hw, skb);
515 return 0;
516 }
517

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 66087 bytes --]