diff options
Diffstat (limited to 'drivers/net/wireless/rtl818x/rtl8180/rtl8180.h')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8180/rtl8180.h | 76 |
1 files changed, 65 insertions, 11 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h index 30523314da43..291a55970d1a 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h +++ b/drivers/net/wireless/rtl818x/rtl8180/rtl8180.h | |||
@@ -24,27 +24,64 @@ | |||
24 | #define ANAPARAM_PWR1_SHIFT 20 | 24 | #define ANAPARAM_PWR1_SHIFT 20 |
25 | #define ANAPARAM_PWR1_MASK (0x7F << ANAPARAM_PWR1_SHIFT) | 25 | #define ANAPARAM_PWR1_MASK (0x7F << ANAPARAM_PWR1_SHIFT) |
26 | 26 | ||
27 | /* rtl8180/rtl8185 have 3 queue + beacon queue. | ||
28 | * mac80211 can use just one, + beacon = 2 tot. | ||
29 | */ | ||
30 | #define RTL8180_NR_TX_QUEUES 2 | ||
31 | |||
32 | /* rtl8187SE have 6 queues + beacon queues | ||
33 | * mac80211 can use 4 QoS data queue, + beacon = 5 tot | ||
34 | */ | ||
35 | #define RTL8187SE_NR_TX_QUEUES 5 | ||
36 | |||
37 | /* for array static allocation, it is the max of above */ | ||
38 | #define RTL818X_NR_TX_QUEUES 5 | ||
39 | |||
27 | struct rtl8180_tx_desc { | 40 | struct rtl8180_tx_desc { |
28 | __le32 flags; | 41 | __le32 flags; |
29 | __le16 rts_duration; | 42 | __le16 rts_duration; |
30 | __le16 plcp_len; | 43 | __le16 plcp_len; |
31 | __le32 tx_buf; | 44 | __le32 tx_buf; |
32 | __le32 frame_len; | 45 | union{ |
46 | __le32 frame_len; | ||
47 | struct { | ||
48 | __le16 frame_len_se; | ||
49 | __le16 frame_duration; | ||
50 | } __packed; | ||
51 | } __packed; | ||
33 | __le32 next_tx_desc; | 52 | __le32 next_tx_desc; |
34 | u8 cw; | 53 | u8 cw; |
35 | u8 retry_limit; | 54 | u8 retry_limit; |
36 | u8 agc; | 55 | u8 agc; |
37 | u8 flags2; | 56 | u8 flags2; |
38 | u32 reserved[2]; | 57 | /* rsvd for 8180/8185. |
58 | * valid for 8187se but we dont use it | ||
59 | */ | ||
60 | u32 reserved; | ||
61 | /* all rsvd for 8180/8185 */ | ||
62 | __le16 flags3; | ||
63 | __le16 frag_qsize; | ||
64 | } __packed; | ||
65 | |||
66 | struct rtl818x_rx_cmd_desc { | ||
67 | __le32 flags; | ||
68 | u32 reserved; | ||
69 | __le32 rx_buf; | ||
39 | } __packed; | 70 | } __packed; |
40 | 71 | ||
41 | struct rtl8180_rx_desc { | 72 | struct rtl8180_rx_desc { |
42 | __le32 flags; | 73 | __le32 flags; |
43 | __le32 flags2; | 74 | __le32 flags2; |
44 | union { | 75 | __le64 tsft; |
45 | __le32 rx_buf; | 76 | |
46 | __le64 tsft; | 77 | } __packed; |
47 | }; | 78 | |
79 | struct rtl8187se_rx_desc { | ||
80 | __le32 flags; | ||
81 | __le64 tsft; | ||
82 | __le32 flags2; | ||
83 | __le32 flags3; | ||
84 | u32 reserved[3]; | ||
48 | } __packed; | 85 | } __packed; |
49 | 86 | ||
50 | struct rtl8180_tx_ring { | 87 | struct rtl8180_tx_ring { |
@@ -71,28 +108,45 @@ struct rtl8180_priv { | |||
71 | 108 | ||
72 | /* rtl8180 driver specific */ | 109 | /* rtl8180 driver specific */ |
73 | spinlock_t lock; | 110 | spinlock_t lock; |
74 | struct rtl8180_rx_desc *rx_ring; | 111 | void *rx_ring; |
112 | u8 rx_ring_sz; | ||
75 | dma_addr_t rx_ring_dma; | 113 | dma_addr_t rx_ring_dma; |
76 | unsigned int rx_idx; | 114 | unsigned int rx_idx; |
77 | struct sk_buff *rx_buf[32]; | 115 | struct sk_buff *rx_buf[32]; |
78 | struct rtl8180_tx_ring tx_ring[4]; | 116 | struct rtl8180_tx_ring tx_ring[RTL818X_NR_TX_QUEUES]; |
79 | struct ieee80211_channel channels[14]; | 117 | struct ieee80211_channel channels[14]; |
80 | struct ieee80211_rate rates[12]; | 118 | struct ieee80211_rate rates[12]; |
81 | struct ieee80211_supported_band band; | 119 | struct ieee80211_supported_band band; |
120 | struct ieee80211_tx_queue_params queue_param[4]; | ||
82 | struct pci_dev *pdev; | 121 | struct pci_dev *pdev; |
83 | u32 rx_conf; | 122 | u32 rx_conf; |
84 | 123 | u8 slot_time; | |
85 | int r8185; | 124 | u16 ack_time; |
125 | |||
126 | enum { | ||
127 | RTL818X_CHIP_FAMILY_RTL8180, | ||
128 | RTL818X_CHIP_FAMILY_RTL8185, | ||
129 | RTL818X_CHIP_FAMILY_RTL8187SE, | ||
130 | } chip_family; | ||
86 | u32 anaparam; | 131 | u32 anaparam; |
87 | u16 rfparam; | 132 | u16 rfparam; |
88 | u8 csthreshold; | 133 | u8 csthreshold; |
89 | 134 | u8 mac_addr[ETH_ALEN]; | |
135 | u8 rf_type; | ||
136 | u8 xtal_out; | ||
137 | u8 xtal_in; | ||
138 | u8 xtal_cal; | ||
139 | u8 thermal_meter_val; | ||
140 | u8 thermal_meter_en; | ||
141 | u8 antenna_diversity_en; | ||
142 | u8 antenna_diversity_default; | ||
90 | /* sequence # */ | 143 | /* sequence # */ |
91 | u16 seqno; | 144 | u16 seqno; |
92 | }; | 145 | }; |
93 | 146 | ||
94 | void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); | 147 | void rtl8180_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data); |
95 | void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam); | 148 | void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam); |
149 | void rtl8180_set_anaparam2(struct rtl8180_priv *priv, u32 anaparam2); | ||
96 | 150 | ||
97 | static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr) | 151 | static inline u8 rtl818x_ioread8(struct rtl8180_priv *priv, u8 __iomem *addr) |
98 | { | 152 | { |