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

staging: rtl8712: use common ieee80211 constants

Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Use the
common ones, rename where necessary and remove unused.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200701164213.4205-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Michael Straube and committed by
Greg Kroah-Hartman
bd7a168a ee53f6dd

+5 -56
+1 -1
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
··· 1411 1411 pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2); 1412 1412 memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2); 1413 1413 bw_40MHz = (le16_to_cpu(pht_capie->cap_info) & 1414 - IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0; 1414 + IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1 : 0; 1415 1415 short_GI = (le16_to_cpu(pht_capie->cap_info) & 1416 1416 (IEEE80211_HT_CAP_SGI_20 | 1417 1417 IEEE80211_HT_CAP_SGI_40)) ? 1 : 0;
+4 -4
drivers/staging/rtl8712/rtl871x_mlme.c
··· 1660 1660 } 1661 1661 out_len = *pout_len; 1662 1662 memset(&ht_capie, 0, sizeof(struct rtl_ieee80211_ht_cap)); 1663 - ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH | 1663 + ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH_20_40 | 1664 1664 IEEE80211_HT_CAP_SGI_20 | 1665 1665 IEEE80211_HT_CAP_SGI_40 | 1666 1666 IEEE80211_HT_CAP_TX_STBC | 1667 1667 IEEE80211_HT_CAP_MAX_AMSDU | 1668 1668 IEEE80211_HT_CAP_DSSSCCK40); 1669 - ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR & 1670 - 0x03) | (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00); 1669 + ht_capie.ampdu_params_info = (IEEE80211_HT_AMPDU_PARM_FACTOR & 1670 + 0x03) | (IEEE80211_HT_AMPDU_PARM_DENSITY & 0x00); 1671 1671 r8712_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, 1672 1672 sizeof(struct rtl_ieee80211_ht_cap), 1673 1673 (unsigned char *)&ht_capie, pout_len); ··· 1705 1705 if (p && len > 0) { 1706 1706 pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2); 1707 1707 max_ampdu_sz = (pht_capie->ampdu_params_info & 1708 - IEEE80211_HT_CAP_AMPDU_FACTOR); 1708 + IEEE80211_HT_AMPDU_PARM_FACTOR); 1709 1709 /* max_ampdu_sz (kbytes); */ 1710 1710 max_ampdu_sz = 1 << (max_ampdu_sz + 3); 1711 1711 phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
-51
drivers/staging/rtl8712/wifi.h
··· 437 437 *------------------------------------------------------------------------------ 438 438 */ 439 439 440 - /* block-ack parameters */ 441 - #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 442 - #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C 443 - #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 444 - #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 445 - #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 446 - 447 440 #define SetOrderBit(pbuf) ({ \ 448 441 *(__le16 *)(pbuf) |= cpu_to_le16(_ORDER_); \ 449 442 }) ··· 473 480 __le16 stbc_param; 474 481 unsigned char basic_set[16]; 475 482 } __packed; 476 - 477 - /* 802.11n HT capabilities masks */ 478 - #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 479 - #define IEEE80211_HT_CAP_SM_PS 0x000C 480 - #define IEEE80211_HT_CAP_GRN_FLD 0x0010 481 - #define IEEE80211_HT_CAP_SGI_20 0x0020 482 - #define IEEE80211_HT_CAP_SGI_40 0x0040 483 - #define IEEE80211_HT_CAP_TX_STBC 0x0080 484 - #define IEEE80211_HT_CAP_DELAY_BA 0x0400 485 - #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 486 - #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 487 - /* 802.11n HT capability AMPDU settings */ 488 - #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 489 - #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C 490 - /* 802.11n HT capability MSC set */ 491 - #define IEEE80211_SUPP_MCS_SET_UEQM 4 492 - #define IEEE80211_HT_CAP_MAX_STREAMS 4 493 - #define IEEE80211_SUPP_MCS_SET_LEN 10 494 - /* maximum streams the spec allows */ 495 - #define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 496 - #define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 497 - #define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C 498 - #define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 499 - /* 802.11n HT IE masks */ 500 - #define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 501 - #define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 502 - #define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 503 - #define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 504 - #define IEEE80211_HT_IE_CHA_WIDTH 0x04 505 - #define IEEE80211_HT_IE_HT_PROTECTION 0x0003 506 - #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 507 - #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 508 - 509 - /* 510 - * A-PMDU buffer sizes 511 - * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) 512 - */ 513 - #define IEEE80211_MIN_AMPDU_BUF 0x8 514 - 515 - /* Spatial Multiplexing Power Save Modes */ 516 - #define WLAN_HT_CAP_SM_PS_STATIC 0 517 - #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 518 - #define WLAN_HT_CAP_SM_PS_INVALID 2 519 - #define WLAN_HT_CAP_SM_PS_DISABLED 3 520 483 521 484 #endif /* _WIFI_H_ */ 522 485