aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Cahill <ben.m.cahill@intel.com>2007-11-28 22:10:10 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:05:33 -0500
commit2054a00bb83409345d14a944e25c15e6ea317651 (patch)
tree451c6fcc7642649070a816bee4260bb0da48fb77
parent80cc0c382db318de88577eff027d5c4097abef81 (diff)
iwlwifi: add comments to QOS and ADD_STA commands
Add comments to QOS and ADD_STA commands Signed-off-by: Ben Cahill <ben.m.cahill@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h97
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-commands.h99
2 files changed, 165 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index 4a8fc6878cff..4885971a1536 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -445,6 +445,23 @@ struct iwl3945_csa_notification {
445 * Quality-of-Service (QOS) Commands & Responses: 445 * Quality-of-Service (QOS) Commands & Responses:
446 * 446 *
447 *****************************************************************************/ 447 *****************************************************************************/
448
449/**
450 * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM
451 * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd
452 *
453 * @cw_min: Contention window, start value in numbers of slots.
454 * Should be a power-of-2, minus 1. Device's default is 0x0f.
455 * @cw_max: Contention window, max value in numbers of slots.
456 * Should be a power-of-2, minus 1. Device's default is 0x3f.
457 * @aifsn: Number of slots in Arbitration Interframe Space (before
458 * performing random backoff timing prior to Tx). Device default 1.
459 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
460 *
461 * Device will automatically increase contention window by (2*CW) + 1 for each
462 * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
463 * value, to cap the CW value.
464 */
448struct iwl3945_ac_qos { 465struct iwl3945_ac_qos {
449 __le16 cw_min; 466 __le16 cw_min;
450 __le16 cw_max; 467 __le16 cw_max;
@@ -458,14 +475,14 @@ struct iwl3945_ac_qos {
458#define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02) 475#define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02)
459#define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10) 476#define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10)
460 477
461/* 478/* Number of Access Categories (AC) (EDCA), queues 0..3 */
462 * TXFIFO Queue number defines
463 */
464/* number of Access categories (AC) (EDCA), queues 0..3 */
465#define AC_NUM 4 479#define AC_NUM 4
466 480
467/* 481/*
468 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) 482 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
483 *
484 * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs
485 * 0: Background, 1: Best Effort, 2: Video, 3: Voice.
469 */ 486 */
470struct iwl3945_qosparam_cmd { 487struct iwl3945_qosparam_cmd {
471 __le32 qos_flags; 488 __le32 qos_flags;
@@ -480,22 +497,21 @@ struct iwl3945_qosparam_cmd {
480/* 497/*
481 * Multi station support 498 * Multi station support
482 */ 499 */
500
501/* Special, dedicated locations within device's station table */
483#define IWL_AP_ID 0 502#define IWL_AP_ID 0
484#define IWL_MULTICAST_ID 1 503#define IWL_MULTICAST_ID 1
485#define IWL_STA_ID 2 504#define IWL_STA_ID 2
486
487#define IWL3945_BROADCAST_ID 24 505#define IWL3945_BROADCAST_ID 24
488#define IWL3945_STATION_COUNT 25 506#define IWL3945_STATION_COUNT 25
489 507
490#define IWL4965_BROADCAST_ID 31
491#define IWL4965_STATION_COUNT 32
492
493#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ 508#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
494#define IWL_INVALID_STATION 255 509#define IWL_INVALID_STATION 255
495 510
496#define STA_FLG_TX_RATE_MSK __constant_cpu_to_le32(1<<2); 511#define STA_FLG_TX_RATE_MSK __constant_cpu_to_le32(1<<2);
497#define STA_FLG_PWR_SAVE_MSK __constant_cpu_to_le32(1<<8); 512#define STA_FLG_PWR_SAVE_MSK __constant_cpu_to_le32(1<<8);
498 513
514/* Use in mode field. 1: modify existing entry, 0: add new station entry */
499#define STA_CONTROL_MODIFY_MSK 0x01 515#define STA_CONTROL_MODIFY_MSK 0x01
500 516
501/* key flags __le16*/ 517/* key flags __le16*/
@@ -508,13 +524,10 @@ struct iwl3945_qosparam_cmd {
508#define STA_KEY_FLG_KEYID_POS 8 524#define STA_KEY_FLG_KEYID_POS 8
509#define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800) 525#define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800)
510 526
511/* modify flags */ 527/* Flags indicate whether to modify vs. don't change various station params */
512#define STA_MODIFY_KEY_MASK 0x01 528#define STA_MODIFY_KEY_MASK 0x01
513#define STA_MODIFY_TID_DISABLE_TX 0x02 529#define STA_MODIFY_TID_DISABLE_TX 0x02
514#define STA_MODIFY_TX_RATE_MSK 0x04 530#define STA_MODIFY_TX_RATE_MSK 0x04
515#define STA_MODIFY_ADDBA_TID_MSK 0x08
516#define STA_MODIFY_DELBA_TID_MSK 0x10
517#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
518 531
519/* 532/*
520 * Antenna masks: 533 * Antenna masks:
@@ -537,6 +550,18 @@ struct iwl3945_keyinfo {
537 u8 key[16]; /* 16-byte unicast decryption key */ 550 u8 key[16]; /* 16-byte unicast decryption key */
538} __attribute__ ((packed)); 551} __attribute__ ((packed));
539 552
553/**
554 * struct sta_id_modify
555 * @addr[ETH_ALEN]: station's MAC address
556 * @sta_id: index of station in uCode's station table
557 * @modify_mask: STA_MODIFY_*, 1: modify, 0: don't change
558 *
559 * Driver selects unused table index when adding new station,
560 * or the index to a pre-existing station entry when modifying that station.
561 * Some indexes have special purposes (IWL_AP_ID, index 0, is for AP).
562 *
563 * modify_mask flags select which parameters to modify vs. leave alone.
564 */
540struct sta_id_modify { 565struct sta_id_modify {
541 u8 addr[ETH_ALEN]; 566 u8 addr[ETH_ALEN];
542 __le16 reserved1; 567 __le16 reserved1;
@@ -547,29 +572,67 @@ struct sta_id_modify {
547 572
548/* 573/*
549 * REPLY_ADD_STA = 0x18 (command) 574 * REPLY_ADD_STA = 0x18 (command)
575 *
576 * The device contains an internal table of per-station information,
577 * with info on security keys, aggregation parameters, and Tx rates for
578 * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD,
579 * 3945 uses REPLY_RATE_SCALE to set up rate tables).
580 *
581 * REPLY_ADD_STA sets up the table entry for one station, either creating
582 * a new entry, or modifying a pre-existing one.
583 *
584 * NOTE: RXON command (without "associated" bit set) wipes the station table
585 * clean. Moving into RF_KILL state does this also. Driver must set up
586 * new station table before transmitting anything on the RXON channel
587 * (except active scans or active measurements; those commands carry
588 * their own txpower/rate setup data).
589 *
590 * When getting started on a new channel, driver must set up the
591 * IWL_BROADCAST_ID entry (last entry in the table). For a client
592 * station in a BSS, once an AP is selected, driver sets up the AP STA
593 * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP
594 * are all that are needed for a BSS client station. If the device is
595 * used as AP, or in an IBSS network, driver must set up station table
596 * entries for all STAs in network, starting with index IWL_STA_ID.
550 */ 597 */
551struct iwl3945_addsta_cmd { 598struct iwl3945_addsta_cmd {
552 u8 mode; 599 u8 mode; /* 1: modify existing, 0: add new station */
553 u8 reserved[3]; 600 u8 reserved[3];
554 struct sta_id_modify sta; 601 struct sta_id_modify sta;
555 struct iwl3945_keyinfo key; 602 struct iwl3945_keyinfo key;
556 __le32 station_flags; 603 __le32 station_flags; /* STA_FLG_* */
557 __le32 station_flags_msk; 604 __le32 station_flags_msk; /* STA_FLG_* */
605
606 /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID)
607 * corresponding to bit (e.g. bit 5 controls TID 5).
608 * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */
558 __le16 tid_disable_tx; 609 __le16 tid_disable_tx;
610
559 __le16 rate_n_flags; 611 __le16 rate_n_flags;
612
613 /* TID for which to add block-ack support.
614 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
560 u8 add_immediate_ba_tid; 615 u8 add_immediate_ba_tid;
616
617 /* TID for which to remove block-ack support.
618 * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */
561 u8 remove_immediate_ba_tid; 619 u8 remove_immediate_ba_tid;
620
621 /* Starting Sequence Number for added block-ack support.
622 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
562 __le16 add_immediate_ba_ssn; 623 __le16 add_immediate_ba_ssn;
563} __attribute__ ((packed)); 624} __attribute__ ((packed));
564 625
626#define ADD_STA_SUCCESS_MSK 0x1
627#define ADD_STA_NO_ROOM_IN_TABLE 0x2
628#define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4
565/* 629/*
566 * REPLY_ADD_STA = 0x18 (response) 630 * REPLY_ADD_STA = 0x18 (response)
567 */ 631 */
568struct iwl3945_add_sta_resp { 632struct iwl3945_add_sta_resp {
569 u8 status; 633 u8 status; /* ADD_STA_* */
570} __attribute__ ((packed)); 634} __attribute__ ((packed));
571 635
572#define ADD_STA_SUCCESS_MSK 0x1
573 636
574/****************************************************************************** 637/******************************************************************************
575 * (4) 638 * (4)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
index 0813e3e3ef67..44addea5062b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-commands.h
@@ -650,6 +650,23 @@ struct iwl4965_csa_notification {
650 * Quality-of-Service (QOS) Commands & Responses: 650 * Quality-of-Service (QOS) Commands & Responses:
651 * 651 *
652 *****************************************************************************/ 652 *****************************************************************************/
653
654/**
655 * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM
656 * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd
657 *
658 * @cw_min: Contention window, start value in numbers of slots.
659 * Should be a power-of-2, minus 1. Device's default is 0x0f.
660 * @cw_max: Contention window, max value in numbers of slots.
661 * Should be a power-of-2, minus 1. Device's default is 0x3f.
662 * @aifsn: Number of slots in Arbitration Interframe Space (before
663 * performing random backoff timing prior to Tx). Device default 1.
664 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
665 *
666 * Device will automatically increase contention window by (2*CW) + 1 for each
667 * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
668 * value, to cap the CW value.
669 */
653struct iwl4965_ac_qos { 670struct iwl4965_ac_qos {
654 __le16 cw_min; 671 __le16 cw_min;
655 __le16 cw_max; 672 __le16 cw_max;
@@ -663,14 +680,14 @@ struct iwl4965_ac_qos {
663#define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02) 680#define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02)
664#define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10) 681#define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10)
665 682
666/* 683/* Number of Access Categories (AC) (EDCA), queues 0..3 */
667 * TXFIFO Queue number defines
668 */
669/* number of Access categories (AC) (EDCA), queues 0..3 */
670#define AC_NUM 4 684#define AC_NUM 4
671 685
672/* 686/*
673 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) 687 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
688 *
689 * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs
690 * 0: Background, 1: Best Effort, 2: Video, 3: Voice.
674 */ 691 */
675struct iwl4965_qosparam_cmd { 692struct iwl4965_qosparam_cmd {
676 __le32 qos_flags; 693 __le32 qos_flags;
@@ -685,13 +702,11 @@ struct iwl4965_qosparam_cmd {
685/* 702/*
686 * Multi station support 703 * Multi station support
687 */ 704 */
705
706/* Special, dedicated locations within device's station table */
688#define IWL_AP_ID 0 707#define IWL_AP_ID 0
689#define IWL_MULTICAST_ID 1 708#define IWL_MULTICAST_ID 1
690#define IWL_STA_ID 2 709#define IWL_STA_ID 2
691
692#define IWL3945_BROADCAST_ID 24
693#define IWL3945_STATION_COUNT 25
694
695#define IWL4965_BROADCAST_ID 31 710#define IWL4965_BROADCAST_ID 31
696#define IWL4965_STATION_COUNT 32 711#define IWL4965_STATION_COUNT 32
697 712
@@ -708,6 +723,7 @@ struct iwl4965_qosparam_cmd {
708#define STA_FLG_AGG_MPDU_DENSITY_POS (23) 723#define STA_FLG_AGG_MPDU_DENSITY_POS (23)
709#define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23) 724#define STA_FLG_AGG_MPDU_DENSITY_MSK __constant_cpu_to_le32(7 << 23)
710 725
726/* Use in mode field. 1: modify existing entry, 0: add new station entry */
711#define STA_CONTROL_MODIFY_MSK 0x01 727#define STA_CONTROL_MODIFY_MSK 0x01
712 728
713/* key flags __le16*/ 729/* key flags __le16*/
@@ -720,12 +736,15 @@ struct iwl4965_qosparam_cmd {
720#define STA_KEY_FLG_KEYID_POS 8 736#define STA_KEY_FLG_KEYID_POS 8
721#define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800) 737#define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800)
722 738
723/* modify flags */ 739/* Flags indicate whether to modify vs. don't change various station params */
724#define STA_MODIFY_KEY_MASK 0x01 740#define STA_MODIFY_KEY_MASK 0x01
725#define STA_MODIFY_TID_DISABLE_TX 0x02 741#define STA_MODIFY_TID_DISABLE_TX 0x02
726#define STA_MODIFY_TX_RATE_MSK 0x04 742#define STA_MODIFY_TX_RATE_MSK 0x04
727#define STA_MODIFY_ADDBA_TID_MSK 0x08 743#define STA_MODIFY_ADDBA_TID_MSK 0x08
728#define STA_MODIFY_DELBA_TID_MSK 0x10 744#define STA_MODIFY_DELBA_TID_MSK 0x10
745
746/* Receiver address (actually, Rx station's index into station table),
747 * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */
729#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) 748#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
730 749
731struct iwl4965_keyinfo { 750struct iwl4965_keyinfo {
@@ -737,6 +756,18 @@ struct iwl4965_keyinfo {
737 u8 key[16]; /* 16-byte unicast decryption key */ 756 u8 key[16]; /* 16-byte unicast decryption key */
738} __attribute__ ((packed)); 757} __attribute__ ((packed));
739 758
759/**
760 * struct sta_id_modify
761 * @addr[ETH_ALEN]: station's MAC address
762 * @sta_id: index of station in uCode's station table
763 * @modify_mask: STA_MODIFY_*, 1: modify, 0: don't change
764 *
765 * Driver selects unused table index when adding new station,
766 * or the index to a pre-existing station entry when modifying that station.
767 * Some indexes have special purposes (IWL_AP_ID, index 0, is for AP).
768 *
769 * modify_mask flags select which parameters to modify vs. leave alone.
770 */
740struct sta_id_modify { 771struct sta_id_modify {
741 u8 addr[ETH_ALEN]; 772 u8 addr[ETH_ALEN];
742 __le16 reserved1; 773 __le16 reserved1;
@@ -747,30 +778,70 @@ struct sta_id_modify {
747 778
748/* 779/*
749 * REPLY_ADD_STA = 0x18 (command) 780 * REPLY_ADD_STA = 0x18 (command)
781 *
782 * The device contains an internal table of per-station information,
783 * with info on security keys, aggregation parameters, and Tx rates for
784 * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD,
785 * 3945 uses REPLY_RATE_SCALE to set up rate tables).
786 *
787 * REPLY_ADD_STA sets up the table entry for one station, either creating
788 * a new entry, or modifying a pre-existing one.
789 *
790 * NOTE: RXON command (without "associated" bit set) wipes the station table
791 * clean. Moving into RF_KILL state does this also. Driver must set up
792 * new station table before transmitting anything on the RXON channel
793 * (except active scans or active measurements; those commands carry
794 * their own txpower/rate setup data).
795 *
796 * When getting started on a new channel, driver must set up the
797 * IWL_BROADCAST_ID entry (last entry in the table). For a client
798 * station in a BSS, once an AP is selected, driver sets up the AP STA
799 * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP
800 * are all that are needed for a BSS client station. If the device is
801 * used as AP, or in an IBSS network, driver must set up station table
802 * entries for all STAs in network, starting with index IWL_STA_ID.
750 */ 803 */
751struct iwl4965_addsta_cmd { 804struct iwl4965_addsta_cmd {
752 u8 mode; 805 u8 mode; /* 1: modify existing, 0: add new station */
753 u8 reserved[3]; 806 u8 reserved[3];
754 struct sta_id_modify sta; 807 struct sta_id_modify sta;
755 struct iwl4965_keyinfo key; 808 struct iwl4965_keyinfo key;
756 __le32 station_flags; 809 __le32 station_flags; /* STA_FLG_* */
757 __le32 station_flags_msk; 810 __le32 station_flags_msk; /* STA_FLG_* */
811
812 /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID)
813 * corresponding to bit (e.g. bit 5 controls TID 5).
814 * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */
758 __le16 tid_disable_tx; 815 __le16 tid_disable_tx;
816
759 __le16 reserved1; 817 __le16 reserved1;
818
819 /* TID for which to add block-ack support.
820 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
760 u8 add_immediate_ba_tid; 821 u8 add_immediate_ba_tid;
822
823 /* TID for which to remove block-ack support.
824 * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */
761 u8 remove_immediate_ba_tid; 825 u8 remove_immediate_ba_tid;
826
827 /* Starting Sequence Number for added block-ack support.
828 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
762 __le16 add_immediate_ba_ssn; 829 __le16 add_immediate_ba_ssn;
830
763 __le32 reserved2; 831 __le32 reserved2;
764} __attribute__ ((packed)); 832} __attribute__ ((packed));
765 833
834#define ADD_STA_SUCCESS_MSK 0x1
835#define ADD_STA_NO_ROOM_IN_TABLE 0x2
836#define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4
837#define ADD_STA_MODIFY_NON_EXIST_STA 0x8
766/* 838/*
767 * REPLY_ADD_STA = 0x18 (response) 839 * REPLY_ADD_STA = 0x18 (response)
768 */ 840 */
769struct iwl4965_add_sta_resp { 841struct iwl4965_add_sta_resp {
770 u8 status; 842 u8 status; /* ADD_STA_* */
771} __attribute__ ((packed)); 843} __attribute__ ((packed));
772 844
773#define ADD_STA_SUCCESS_MSK 0x1
774 845
775/****************************************************************************** 846/******************************************************************************
776 * (4) 847 * (4)