diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-15 03:52:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-15 03:52:37 -0400 |
commit | f42a44494bcdf03fc851c03d438464d59c0ceaf5 (patch) | |
tree | 986ea7b54e9fc79a64863fd7e92eabd99ffd37a3 /include | |
parent | 63fe46da9c380b3f2bbdf3765044649517cc717c (diff) | |
parent | ef85ad541f9a6ccd3f89ec73f92b2d6f45a9d3e8 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ieee80211.h | 32 | ||||
-rw-r--r-- | include/net/mac80211.h | 47 |
2 files changed, 51 insertions, 28 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 0b5e03eae6d2..a9102bc78b61 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -552,16 +552,17 @@ enum ieee80211_back_parties { | |||
552 | */ | 552 | */ |
553 | static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) | 553 | static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) |
554 | { | 554 | { |
555 | u8 *raw = (u8 *) hdr; | 555 | __le16 fc = hdr->frame_control; |
556 | u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */ | 556 | fc &= cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); |
557 | 557 | ||
558 | switch (tofrom) { | 558 | switch (fc) { |
559 | case 2: | 559 | case __constant_cpu_to_le16(IEEE80211_FCTL_FROMDS): |
560 | return hdr->addr3; | 560 | return hdr->addr3; |
561 | case 3: | 561 | case __constant_cpu_to_le16(IEEE80211_FCTL_TODS|IEEE80211_FCTL_FROMDS): |
562 | return hdr->addr4; | 562 | return hdr->addr4; |
563 | default: | ||
564 | return hdr->addr2; | ||
563 | } | 565 | } |
564 | return hdr->addr2; | ||
565 | } | 566 | } |
566 | 567 | ||
567 | /** | 568 | /** |
@@ -577,12 +578,13 @@ static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) | |||
577 | */ | 578 | */ |
578 | static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) | 579 | static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) |
579 | { | 580 | { |
580 | u8 *raw = (u8 *) hdr; | 581 | __le16 fc = hdr->frame_control; |
581 | u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */ | 582 | fc &= cpu_to_le16(IEEE80211_FCTL_TODS); |
582 | 583 | ||
583 | if (to_ds) | 584 | if (fc) |
584 | return hdr->addr3; | 585 | return hdr->addr3; |
585 | return hdr->addr1; | 586 | else |
587 | return hdr->addr1; | ||
586 | } | 588 | } |
587 | 589 | ||
588 | /** | 590 | /** |
@@ -595,8 +597,8 @@ static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) | |||
595 | */ | 597 | */ |
596 | static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr) | 598 | static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr) |
597 | { | 599 | { |
598 | return (le16_to_cpu(hdr->frame_control) & | 600 | __le16 fc = hdr->frame_control; |
599 | IEEE80211_FCTL_MOREFRAGS) != 0; | 601 | return !!(fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)); |
600 | } | 602 | } |
601 | 603 | ||
602 | #endif /* IEEE80211_H */ | 604 | #endif /* IEEE80211_H */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 75a34609eed7..909956c97c44 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -336,13 +336,16 @@ enum mac80211_rx_flags { | |||
336 | * The low-level driver should provide this information (the subset | 336 | * The low-level driver should provide this information (the subset |
337 | * supported by hardware) to the 802.11 code with each received | 337 | * supported by hardware) to the 802.11 code with each received |
338 | * frame. | 338 | * frame. |
339 | * | ||
339 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function | 340 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
340 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | 341 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. |
341 | * @band: the active band when this frame was received | 342 | * @band: the active band when this frame was received |
342 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz | 343 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
343 | * @ssi: signal strength when receiving this frame | 344 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
344 | * @signal: used as 'qual' in statistics reporting | 345 | * unspecified depending on the hardware capabilities flags |
345 | * @noise: PHY noise when receiving this frame | 346 | * @IEEE80211_HW_SIGNAL_* |
347 | * @noise: noise when receiving this frame, in dBm. | ||
348 | * @qual: overall signal quality indication, in percent (0-100). | ||
346 | * @antenna: antenna used | 349 | * @antenna: antenna used |
347 | * @rate_idx: index of data rate into band's supported rates | 350 | * @rate_idx: index of data rate into band's supported rates |
348 | * @flag: %RX_FLAG_* | 351 | * @flag: %RX_FLAG_* |
@@ -351,9 +354,9 @@ struct ieee80211_rx_status { | |||
351 | u64 mactime; | 354 | u64 mactime; |
352 | enum ieee80211_band band; | 355 | enum ieee80211_band band; |
353 | int freq; | 356 | int freq; |
354 | int ssi; | ||
355 | int signal; | 357 | int signal; |
356 | int noise; | 358 | int noise; |
359 | int qual; | ||
357 | int antenna; | 360 | int antenna; |
358 | int rate_idx; | 361 | int rate_idx; |
359 | int flag; | 362 | int flag; |
@@ -392,7 +395,8 @@ enum ieee80211_tx_status_flags { | |||
392 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 395 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
393 | * @ampdu_ack_map: block ack bit map for the aggregation. | 396 | * @ampdu_ack_map: block ack bit map for the aggregation. |
394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 397 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
395 | * @ack_signal: signal strength of the ACK frame | 398 | * @ack_signal: signal strength of the ACK frame either in dBm, dB or unspec |
399 | * depending on hardware capabilites flags @IEEE80211_HW_SIGNAL_* | ||
396 | */ | 400 | */ |
397 | struct ieee80211_tx_status { | 401 | struct ieee80211_tx_status { |
398 | struct ieee80211_tx_control control; | 402 | struct ieee80211_tx_control control; |
@@ -703,6 +707,25 @@ enum ieee80211_tkip_key_type { | |||
703 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: | 707 | * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: |
704 | * Hardware is not capable of receiving frames with short preamble on | 708 | * Hardware is not capable of receiving frames with short preamble on |
705 | * the 2.4 GHz band. | 709 | * the 2.4 GHz band. |
710 | * | ||
711 | * @IEEE80211_HW_SIGNAL_UNSPEC: | ||
712 | * Hardware can provide signal values but we don't know its units. We | ||
713 | * expect values between 0 and @max_signal. | ||
714 | * If possible please provide dB or dBm instead. | ||
715 | * | ||
716 | * @IEEE80211_HW_SIGNAL_DB: | ||
717 | * Hardware gives signal values in dB, decibel difference from an | ||
718 | * arbitrary, fixed reference. We expect values between 0 and @max_signal. | ||
719 | * If possible please provide dBm instead. | ||
720 | * | ||
721 | * @IEEE80211_HW_SIGNAL_DBM: | ||
722 | * Hardware gives signal values in dBm, decibel difference from | ||
723 | * one milliwatt. This is the preferred method since it is standardized | ||
724 | * between different devices. @max_signal does not need to be set. | ||
725 | * | ||
726 | * @IEEE80211_HW_NOISE_DBM: | ||
727 | * Hardware can provide noise (radio interference) values in units dBm, | ||
728 | * decibel difference from one milliwatt. | ||
706 | */ | 729 | */ |
707 | enum ieee80211_hw_flags { | 730 | enum ieee80211_hw_flags { |
708 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, | 731 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, |
@@ -710,6 +733,10 @@ enum ieee80211_hw_flags { | |||
710 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 733 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
711 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 734 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
712 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, | 735 | IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, |
736 | IEEE80211_HW_SIGNAL_UNSPEC = 1<<5, | ||
737 | IEEE80211_HW_SIGNAL_DB = 1<<6, | ||
738 | IEEE80211_HW_SIGNAL_DBM = 1<<7, | ||
739 | IEEE80211_HW_NOISE_DBM = 1<<8, | ||
713 | }; | 740 | }; |
714 | 741 | ||
715 | /** | 742 | /** |
@@ -740,12 +767,8 @@ enum ieee80211_hw_flags { | |||
740 | * | 767 | * |
741 | * @channel_change_time: time (in microseconds) it takes to change channels. | 768 | * @channel_change_time: time (in microseconds) it takes to change channels. |
742 | * | 769 | * |
743 | * @max_rssi: Maximum value for ssi in RX information, use | 770 | * @max_signal: Maximum value for signal (rssi) in RX information, used |
744 | * negative numbers for dBm and 0 to indicate no support. | 771 | * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB |
745 | * | ||
746 | * @max_signal: like @max_rssi, but for the signal value. | ||
747 | * | ||
748 | * @max_noise: like @max_rssi, but for the noise value. | ||
749 | * | 772 | * |
750 | * @queues: number of available hardware transmit queues for | 773 | * @queues: number of available hardware transmit queues for |
751 | * data packets. WMM/QoS requires at least four, these | 774 | * data packets. WMM/QoS requires at least four, these |
@@ -775,9 +798,7 @@ struct ieee80211_hw { | |||
775 | int channel_change_time; | 798 | int channel_change_time; |
776 | int vif_data_size; | 799 | int vif_data_size; |
777 | u16 queues, ampdu_queues; | 800 | u16 queues, ampdu_queues; |
778 | s8 max_rssi; | ||
779 | s8 max_signal; | 801 | s8 max_signal; |
780 | s8 max_noise; | ||
781 | }; | 802 | }; |
782 | 803 | ||
783 | /** | 804 | /** |