| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 6 | | - * under the terms of version 2 of the GNU General Public License as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 12 | | - * more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 15 | | - * this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 16 | | - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA |
|---|
| 17 | 5 | * |
|---|
| 18 | 6 | * Modifications for inclusion into the Linux staging tree are |
|---|
| 19 | 7 | * Copyright(c) 2010 Larry Finger. All rights reserved. |
|---|
| .. | .. |
|---|
| 290 | 278 | |
|---|
| 291 | 279 | #define GetAddr4Ptr(pbuf) ((unsigned char *)((addr_t)(pbuf) + 24)) |
|---|
| 292 | 280 | |
|---|
| 293 | | - |
|---|
| 294 | | - |
|---|
| 295 | | -static inline int IS_MCAST(unsigned char *da) |
|---|
| 296 | | -{ |
|---|
| 297 | | - if ((*da) & 0x01) |
|---|
| 298 | | - return true; |
|---|
| 299 | | - else |
|---|
| 300 | | - return false; |
|---|
| 301 | | -} |
|---|
| 302 | | - |
|---|
| 303 | | - |
|---|
| 304 | 281 | static inline unsigned char *get_da(unsigned char *pframe) |
|---|
| 305 | 282 | { |
|---|
| 306 | 283 | unsigned char *da; |
|---|
| .. | .. |
|---|
| 322 | 299 | } |
|---|
| 323 | 300 | return da; |
|---|
| 324 | 301 | } |
|---|
| 325 | | - |
|---|
| 326 | 302 | |
|---|
| 327 | 303 | static inline unsigned char *get_sa(unsigned char *pframe) |
|---|
| 328 | 304 | { |
|---|
| .. | .. |
|---|
| 369 | 345 | return sa; |
|---|
| 370 | 346 | } |
|---|
| 371 | 347 | |
|---|
| 372 | | - |
|---|
| 373 | | - |
|---|
| 374 | 348 | /*----------------------------------------------------------------------------- |
|---|
| 375 | 349 | * Below is for the security related definition |
|---|
| 376 | 350 | *----------------------------------------------------------------------------- |
|---|
| .. | .. |
|---|
| 399 | 373 | #define _BEACON_IE_OFFSET_ 12 |
|---|
| 400 | 374 | |
|---|
| 401 | 375 | #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ |
|---|
| 402 | | - |
|---|
| 403 | | -#define _SSID_IE_ 0 |
|---|
| 404 | | -#define _SUPPORTEDRATES_IE_ 1 |
|---|
| 405 | | -#define _DSSET_IE_ 3 |
|---|
| 406 | | -#define _IBSS_PARA_IE_ 6 |
|---|
| 407 | | -#define _ERPINFO_IE_ 42 |
|---|
| 408 | | -#define _EXT_SUPPORTEDRATES_IE_ 50 |
|---|
| 409 | | - |
|---|
| 410 | | -#define _HT_CAPABILITY_IE_ 45 |
|---|
| 411 | | -#define _HT_EXTRA_INFO_IE_ 61 |
|---|
| 412 | | -#define _HT_ADD_INFO_IE_ 61 /* _HT_EXTRA_INFO_IE_ */ |
|---|
| 413 | | - |
|---|
| 414 | | -#define _VENDOR_SPECIFIC_IE_ 221 |
|---|
| 415 | | - |
|---|
| 416 | | -#define _RESERVED47_ 47 |
|---|
| 417 | | - |
|---|
| 418 | 376 | |
|---|
| 419 | 377 | /* --------------------------------------------------------------------------- |
|---|
| 420 | 378 | * Below is the fixed elements... |
|---|
| .. | .. |
|---|
| 459 | 417 | #define _WMM_IE_Length_ 7 /* for WMM STA */ |
|---|
| 460 | 418 | #define _WMM_Para_Element_Length_ 24 |
|---|
| 461 | 419 | |
|---|
| 462 | | - |
|---|
| 463 | 420 | /*----------------------------------------------------------------------------- |
|---|
| 464 | 421 | * Below is the definition for 802.11n |
|---|
| 465 | 422 | *------------------------------------------------------------------------------ |
|---|
| 466 | 423 | */ |
|---|
| 467 | | - |
|---|
| 468 | | -/* block-ack parameters */ |
|---|
| 469 | | -#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
|---|
| 470 | | -#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C |
|---|
| 471 | | -#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFC0 |
|---|
| 472 | | -#define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 |
|---|
| 473 | | -#define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 |
|---|
| 474 | 424 | |
|---|
| 475 | 425 | #define SetOrderBit(pbuf) ({ \ |
|---|
| 476 | 426 | *(__le16 *)(pbuf) |= cpu_to_le16(_ORDER_); \ |
|---|
| .. | .. |
|---|
| 479 | 429 | #define GetOrderBit(pbuf) (((*(__le16 *)(pbuf)) & \ |
|---|
| 480 | 430 | le16_to_cpu(_ORDER_)) != 0) |
|---|
| 481 | 431 | |
|---|
| 482 | | - |
|---|
| 483 | | -/** |
|---|
| 484 | | - * struct ieee80211_bar - HT Block Ack Request |
|---|
| 485 | | - * |
|---|
| 486 | | - * This structure refers to "HT BlockAckReq" as |
|---|
| 487 | | - * described in 802.11n draft section 7.2.1.7.1 |
|---|
| 488 | | - */ |
|---|
| 489 | | -struct ieee80211_bar { |
|---|
| 490 | | - __le16 frame_control; |
|---|
| 491 | | - __le16 duration; |
|---|
| 492 | | - unsigned char ra[6]; |
|---|
| 493 | | - unsigned char ta[6]; |
|---|
| 494 | | - __le16 control; |
|---|
| 495 | | - __le16 start_seq_num; |
|---|
| 496 | | -} __packed; |
|---|
| 497 | | - |
|---|
| 498 | | -/* 802.11 BAR control masks */ |
|---|
| 499 | | -#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
|---|
| 500 | | -#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 |
|---|
| 501 | | - |
|---|
| 502 | | - |
|---|
| 503 | 432 | /* |
|---|
| 504 | | - * struct ieee80211_ht_cap - HT capabilities |
|---|
| 433 | + * struct rtl_ieee80211_ht_cap - HT capabilities |
|---|
| 505 | 434 | * |
|---|
| 506 | 435 | * This structure refers to "HT capabilities element" as |
|---|
| 507 | 436 | * described in 802.11n draft section 7.3.2.52 |
|---|
| 508 | 437 | */ |
|---|
| 509 | 438 | |
|---|
| 510 | | -struct ieee80211_ht_cap { |
|---|
| 439 | +struct rtl_ieee80211_ht_cap { |
|---|
| 511 | 440 | __le16 cap_info; |
|---|
| 512 | 441 | unsigned char ampdu_params_info; |
|---|
| 513 | 442 | unsigned char supp_mcs_set[16]; |
|---|
| .. | .. |
|---|
| 517 | 446 | } __packed; |
|---|
| 518 | 447 | |
|---|
| 519 | 448 | /** |
|---|
| 520 | | - * struct ieee80211_ht_cap - HT additional information |
|---|
| 449 | + * struct ieee80211_ht_addt_info - HT additional information |
|---|
| 521 | 450 | * |
|---|
| 522 | 451 | * This structure refers to "HT information element" as |
|---|
| 523 | 452 | * described in 802.11n draft section 7.3.2.53 |
|---|
| .. | .. |
|---|
| 529 | 458 | __le16 stbc_param; |
|---|
| 530 | 459 | unsigned char basic_set[16]; |
|---|
| 531 | 460 | } __packed; |
|---|
| 532 | | - |
|---|
| 533 | | -/* 802.11n HT capabilities masks */ |
|---|
| 534 | | -#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 |
|---|
| 535 | | -#define IEEE80211_HT_CAP_SM_PS 0x000C |
|---|
| 536 | | -#define IEEE80211_HT_CAP_GRN_FLD 0x0010 |
|---|
| 537 | | -#define IEEE80211_HT_CAP_SGI_20 0x0020 |
|---|
| 538 | | -#define IEEE80211_HT_CAP_SGI_40 0x0040 |
|---|
| 539 | | -#define IEEE80211_HT_CAP_TX_STBC 0x0080 |
|---|
| 540 | | -#define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
|---|
| 541 | | -#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
|---|
| 542 | | -#define IEEE80211_HT_CAP_DSSSCCK40 0x1000 |
|---|
| 543 | | -/* 802.11n HT capability AMPDU settings */ |
|---|
| 544 | | -#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 |
|---|
| 545 | | -#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C |
|---|
| 546 | | -/* 802.11n HT capability MSC set */ |
|---|
| 547 | | -#define IEEE80211_SUPP_MCS_SET_UEQM 4 |
|---|
| 548 | | -#define IEEE80211_HT_CAP_MAX_STREAMS 4 |
|---|
| 549 | | -#define IEEE80211_SUPP_MCS_SET_LEN 10 |
|---|
| 550 | | -/* maximum streams the spec allows */ |
|---|
| 551 | | -#define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01 |
|---|
| 552 | | -#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02 |
|---|
| 553 | | -#define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C |
|---|
| 554 | | -#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10 |
|---|
| 555 | | -/* 802.11n HT IE masks */ |
|---|
| 556 | | -#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 |
|---|
| 557 | | -#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00 |
|---|
| 558 | | -#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01 |
|---|
| 559 | | -#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03 |
|---|
| 560 | | -#define IEEE80211_HT_IE_CHA_WIDTH 0x04 |
|---|
| 561 | | -#define IEEE80211_HT_IE_HT_PROTECTION 0x0003 |
|---|
| 562 | | -#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 |
|---|
| 563 | | -#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 |
|---|
| 564 | | - |
|---|
| 565 | | -/* |
|---|
| 566 | | - * A-PMDU buffer sizes |
|---|
| 567 | | - * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) |
|---|
| 568 | | - */ |
|---|
| 569 | | -#define IEEE80211_MIN_AMPDU_BUF 0x8 |
|---|
| 570 | | - |
|---|
| 571 | | - |
|---|
| 572 | | -/* Spatial Multiplexing Power Save Modes */ |
|---|
| 573 | | -#define WLAN_HT_CAP_SM_PS_STATIC 0 |
|---|
| 574 | | -#define WLAN_HT_CAP_SM_PS_DYNAMIC 1 |
|---|
| 575 | | -#define WLAN_HT_CAP_SM_PS_INVALID 2 |
|---|
| 576 | | -#define WLAN_HT_CAP_SM_PS_DISABLED 3 |
|---|
| 577 | 461 | |
|---|
| 578 | 462 | #endif /* _WIFI_H_ */ |
|---|
| 579 | 463 | |
|---|