diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2011-02-11 15:27:46 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-02-11 16:16:37 -0500 |
commit | 62e63975f47fcc0ebcaca04669098fe3ca7b20a2 (patch) | |
tree | 727edc69707087aecaf2c7443e8747b91795fee4 /drivers/net/wireless/rtlwifi/wifi.h | |
parent | caebbb7a4ac3e31b259954b757b15b8f0ac708d5 (diff) |
rtlwifi: Modify core routines
The rtlwifi core needs some changes before inclusion of a driver
for the RTL8192CU USB device.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: <chaoming_li@realsil.com.cn>
Signed-off-by: <george0505@realtek.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/wifi.h')
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index d44d79613d2..ef44b75a66d 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/firmware.h> | 34 | #include <linux/firmware.h> |
35 | #include <linux/version.h> | 35 | #include <linux/version.h> |
36 | #include <linux/etherdevice.h> | 36 | #include <linux/etherdevice.h> |
37 | #include <linux/usb.h> | ||
37 | #include <net/mac80211.h> | 38 | #include <net/mac80211.h> |
38 | #include "debug.h" | 39 | #include "debug.h" |
39 | 40 | ||
@@ -118,6 +119,9 @@ enum hardware_type { | |||
118 | HARDWARE_TYPE_NUM | 119 | HARDWARE_TYPE_NUM |
119 | }; | 120 | }; |
120 | 121 | ||
122 | #define IS_HARDWARE_TYPE_8192CE(rtlhal) \ | ||
123 | (rtlhal->hw_type == HARDWARE_TYPE_RTL8192CE) | ||
124 | |||
121 | enum scan_operation_backup_opt { | 125 | enum scan_operation_backup_opt { |
122 | SCAN_OPT_BACKUP = 0, | 126 | SCAN_OPT_BACKUP = 0, |
123 | SCAN_OPT_RESTORE, | 127 | SCAN_OPT_RESTORE, |
@@ -768,6 +772,7 @@ struct rtl_tid_data { | |||
768 | struct rtl_priv; | 772 | struct rtl_priv; |
769 | struct rtl_io { | 773 | struct rtl_io { |
770 | struct device *dev; | 774 | struct device *dev; |
775 | struct mutex bb_mutex; | ||
771 | 776 | ||
772 | /*PCI MEM map */ | 777 | /*PCI MEM map */ |
773 | unsigned long pci_mem_end; /*shared mem end */ | 778 | unsigned long pci_mem_end; /*shared mem end */ |
@@ -779,10 +784,14 @@ struct rtl_io { | |||
779 | void (*write8_async) (struct rtl_priv *rtlpriv, u32 addr, u8 val); | 784 | void (*write8_async) (struct rtl_priv *rtlpriv, u32 addr, u8 val); |
780 | void (*write16_async) (struct rtl_priv *rtlpriv, u32 addr, u16 val); | 785 | void (*write16_async) (struct rtl_priv *rtlpriv, u32 addr, u16 val); |
781 | void (*write32_async) (struct rtl_priv *rtlpriv, u32 addr, u32 val); | 786 | void (*write32_async) (struct rtl_priv *rtlpriv, u32 addr, u32 val); |
787 | int (*writeN_async) (struct rtl_priv *rtlpriv, u32 addr, u16 len, | ||
788 | u8 *pdata); | ||
782 | 789 | ||
783 | u8(*read8_sync) (struct rtl_priv *rtlpriv, u32 addr); | 790 | u8(*read8_sync) (struct rtl_priv *rtlpriv, u32 addr); |
784 | u16(*read16_sync) (struct rtl_priv *rtlpriv, u32 addr); | 791 | u16(*read16_sync) (struct rtl_priv *rtlpriv, u32 addr); |
785 | u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr); | 792 | u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr); |
793 | int (*readN_sync) (struct rtl_priv *rtlpriv, u32 addr, u16 len, | ||
794 | u8 *pdata); | ||
786 | 795 | ||
787 | }; | 796 | }; |
788 | 797 | ||
@@ -1101,6 +1110,7 @@ struct rtl_tcb_desc { | |||
1101 | struct rtl_hal_ops { | 1110 | struct rtl_hal_ops { |
1102 | int (*init_sw_vars) (struct ieee80211_hw *hw); | 1111 | int (*init_sw_vars) (struct ieee80211_hw *hw); |
1103 | void (*deinit_sw_vars) (struct ieee80211_hw *hw); | 1112 | void (*deinit_sw_vars) (struct ieee80211_hw *hw); |
1113 | void (*read_chip_version)(struct ieee80211_hw *hw); | ||
1104 | void (*read_eeprom_info) (struct ieee80211_hw *hw); | 1114 | void (*read_eeprom_info) (struct ieee80211_hw *hw); |
1105 | void (*interrupt_recognized) (struct ieee80211_hw *hw, | 1115 | void (*interrupt_recognized) (struct ieee80211_hw *hw, |
1106 | u32 *p_inta, u32 *p_intb); | 1116 | u32 *p_inta, u32 *p_intb); |
@@ -1129,7 +1139,8 @@ struct rtl_hal_ops { | |||
1129 | void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, | 1139 | void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, |
1130 | bool b_firstseg, bool b_lastseg, | 1140 | bool b_firstseg, bool b_lastseg, |
1131 | struct sk_buff *skb); | 1141 | struct sk_buff *skb); |
1132 | bool(*query_rx_desc) (struct ieee80211_hw *hw, | 1142 | bool (*cmd_send_packet)(struct ieee80211_hw *hw, struct sk_buff *skb); |
1143 | bool(*query_rx_desc) (struct ieee80211_hw *hw, | ||
1133 | struct rtl_stats *stats, | 1144 | struct rtl_stats *stats, |
1134 | struct ieee80211_rx_status *rx_status, | 1145 | struct ieee80211_rx_status *rx_status, |
1135 | u8 *pdesc, struct sk_buff *skb); | 1146 | u8 *pdesc, struct sk_buff *skb); |
@@ -1166,6 +1177,7 @@ struct rtl_intf_ops { | |||
1166 | 1177 | ||
1167 | int (*adapter_tx) (struct ieee80211_hw *hw, struct sk_buff *skb); | 1178 | int (*adapter_tx) (struct ieee80211_hw *hw, struct sk_buff *skb); |
1168 | int (*reset_trx_ring) (struct ieee80211_hw *hw); | 1179 | int (*reset_trx_ring) (struct ieee80211_hw *hw); |
1180 | bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb); | ||
1169 | 1181 | ||
1170 | /*pci */ | 1182 | /*pci */ |
1171 | void (*disable_aspm) (struct ieee80211_hw *hw); | 1183 | void (*disable_aspm) (struct ieee80211_hw *hw); |
@@ -1179,11 +1191,35 @@ struct rtl_mod_params { | |||
1179 | int sw_crypto; | 1191 | int sw_crypto; |
1180 | }; | 1192 | }; |
1181 | 1193 | ||
1194 | struct rtl_hal_usbint_cfg { | ||
1195 | /* data - rx */ | ||
1196 | u32 in_ep_num; | ||
1197 | u32 rx_urb_num; | ||
1198 | u32 rx_max_size; | ||
1199 | |||
1200 | /* op - rx */ | ||
1201 | void (*usb_rx_hdl)(struct ieee80211_hw *, struct sk_buff *); | ||
1202 | void (*usb_rx_segregate_hdl)(struct ieee80211_hw *, struct sk_buff *, | ||
1203 | struct sk_buff_head *); | ||
1204 | |||
1205 | /* tx */ | ||
1206 | void (*usb_tx_cleanup)(struct ieee80211_hw *, struct sk_buff *); | ||
1207 | int (*usb_tx_post_hdl)(struct ieee80211_hw *, struct urb *, | ||
1208 | struct sk_buff *); | ||
1209 | struct sk_buff *(*usb_tx_aggregate_hdl)(struct ieee80211_hw *, | ||
1210 | struct sk_buff_head *); | ||
1211 | |||
1212 | /* endpoint mapping */ | ||
1213 | int (*usb_endpoint_mapping)(struct ieee80211_hw *hw); | ||
1214 | u16 (*usb_mq_to_hwq)(u16 fc, u16 mac80211_queue_index); | ||
1215 | }; | ||
1216 | |||
1182 | struct rtl_hal_cfg { | 1217 | struct rtl_hal_cfg { |
1183 | char *name; | 1218 | char *name; |
1184 | char *fw_name; | 1219 | char *fw_name; |
1185 | struct rtl_hal_ops *ops; | 1220 | struct rtl_hal_ops *ops; |
1186 | struct rtl_mod_params *mod_params; | 1221 | struct rtl_mod_params *mod_params; |
1222 | struct rtl_hal_usbint_cfg *usb_interface_cfg; | ||
1187 | 1223 | ||
1188 | /*this map used for some registers or vars | 1224 | /*this map used for some registers or vars |
1189 | defined int HAL but used in MAIN */ | 1225 | defined int HAL but used in MAIN */ |
@@ -1202,6 +1238,7 @@ struct rtl_locks { | |||
1202 | spinlock_t rf_ps_lock; | 1238 | spinlock_t rf_ps_lock; |
1203 | spinlock_t rf_lock; | 1239 | spinlock_t rf_lock; |
1204 | spinlock_t lps_lock; | 1240 | spinlock_t lps_lock; |
1241 | spinlock_t tx_urb_lock; | ||
1205 | }; | 1242 | }; |
1206 | 1243 | ||
1207 | struct rtl_works { | 1244 | struct rtl_works { |
@@ -1437,10 +1474,8 @@ Set subfield of little-endian 4-byte value to specified value. */ | |||
1437 | (_os).octet = (u8 *)(_octet); \ | 1474 | (_os).octet = (u8 *)(_octet); \ |
1438 | (_os).length = (_len); | 1475 | (_os).length = (_len); |
1439 | 1476 | ||
1440 | #define CP_MACADDR(des, src) \ | 1477 | #define CP_MACADDR(des, src) \ |
1441 | ((des)[0] = (src)[0], (des)[1] = (src)[1],\ | 1478 | memcpy((des), (src), ETH_ALEN) |
1442 | (des)[2] = (src)[2], (des)[3] = (src)[3],\ | ||
1443 | (des)[4] = (src)[4], (des)[5] = (src)[5]) | ||
1444 | 1479 | ||
1445 | static inline u8 rtl_read_byte(struct rtl_priv *rtlpriv, u32 addr) | 1480 | static inline u8 rtl_read_byte(struct rtl_priv *rtlpriv, u32 addr) |
1446 | { | 1481 | { |