From 3927ccc8d5cae271f475a05b6fdab492bb514d71 Mon Sep 17 00:00:00 2001 From: Mike Kershaw / Dragorn Date: Thu, 24 Aug 2023 11:27:24 -0400 Subject: [PATCH] wificoconut: Bulk rename s8/u8 s16/u16 s32/u32 to stdint xintxx_t names, to make different compilers and system headers more happy --- .../capture_hak5_coconut.c | 2 +- .../libwifiuserspace/kernel/cfg80211.h | 46 +- .../libwifiuserspace/kernel/crc_ccit.c | 8 +- .../libwifiuserspace/kernel/crc_ccit.h | 12 +- .../libwifiuserspace/kernel/etherdevice.h | 20 +- .../libwifiuserspace/kernel/ieee80211.h | 40 +- .../kernel/ieee80211_radiotap.h | 6 +- .../libwifiuserspace/kernel/le_byteshift.h | 32 +- .../libwifiuserspace/kernel/log2.h | 2 +- .../libwifiuserspace/kernel/mac80211.h | 198 ++++----- .../libwifiuserspace/kernel/nl80211.h | 6 +- .../libwifiuserspace/kernel/types.h | 12 +- .../libwifiuserspace/rt2800usb/rt2800.h | 20 +- .../libwifiuserspace/rt2800usb/rt2800lib.c | 396 +++++++++--------- .../libwifiuserspace/rt2800usb/rt2800lib.h | 58 +-- .../libwifiuserspace/rt2800usb/rt2800usb.c | 48 +-- .../libwifiuserspace/rt2800usb/rt2x00.h | 94 ++--- .../libwifiuserspace/rt2800usb/rt2x00lib.h | 8 +- .../libwifiuserspace/rt2800usb/rt2x00mac.c | 2 +- .../libwifiuserspace/rt2800usb/rt2x00queue.h | 8 +- .../libwifiuserspace/rt2800usb/rt2x00reg.h | 12 +- .../libwifiuserspace/rt2800usb/rt2x00usb.c | 32 +- .../libwifiuserspace/rt2800usb/rt2x00usb.h | 42 +- 23 files changed, 552 insertions(+), 552 deletions(-) diff --git a/capture_hak5_wifi_coconut/capture_hak5_coconut.c b/capture_hak5_wifi_coconut/capture_hak5_coconut.c index fa2a8e57e..7afb34f6f 100644 --- a/capture_hak5_wifi_coconut/capture_hak5_coconut.c +++ b/capture_hak5_wifi_coconut/capture_hak5_coconut.c @@ -239,7 +239,7 @@ int coconut_rx_packet(struct userspace_wifi_context *context, .flags = 0, .channel_freq = htole16(ieee80211_channel_to_frequency(signal->channel, signal->band)), .channel_flags = 0, - .antsignal = (u8) signal->signal, + .antsignal = (uint8_t) signal->signal, }, }; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.h index 5ee453434..ff8ed9b99 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.h @@ -48,14 +48,14 @@ */ struct ieee80211_channel { enum nl80211_band band; - u32 center_freq; - u16 hw_value; - u32 flags; + uint32_t center_freq; + uint16_t hw_value; + uint32_t flags; int max_antenna_gain; int max_power; int max_reg_power; bool beacon_found; - u32 orig_flags; + uint32_t orig_flags; int orig_mag, orig_mpwr; enum nl80211_dfs_state dfs_state; unsigned long dfs_state_entered; @@ -73,8 +73,8 @@ struct ieee80211_channel { struct cfg80211_chan_def { struct ieee80211_channel *chan; enum nl80211_chan_width width; - u32 center_freq1; - u32 center_freq2; + uint32_t center_freq1; + uint32_t center_freq2; } ; /** @@ -92,9 +92,9 @@ struct cfg80211_chan_def { * short preamble is used */ struct ieee80211_rate { - u32 flags; - u16 bitrate; - u16 hw_value, hw_value_short; + uint32_t flags; + uint16_t bitrate; + uint16_t hw_value, hw_value_short; }; /** @@ -110,10 +110,10 @@ struct ieee80211_rate { * @mcs: Supported MCS rates */ struct ieee80211_sta_ht_cap { - u16 cap; /* use IEEE80211_HT_CAP_ */ + uint16_t cap; /* use IEEE80211_HT_CAP_ */ bool ht_supported; - u8 ampdu_factor; - u8 ampdu_density; + uint8_t ampdu_factor; + uint8_t ampdu_density; struct ieee80211_mcs_info mcs; }; @@ -129,7 +129,7 @@ struct ieee80211_sta_ht_cap { */ struct ieee80211_sta_vht_cap { bool vht_supported; - u32 cap; /* use IEEE80211_VHT_CAP_ */ + uint32_t cap; /* use IEEE80211_VHT_CAP_ */ struct ieee80211_vht_mcs_info vht_mcs; }; @@ -150,7 +150,7 @@ struct ieee80211_sta_he_cap { bool has_he; struct ieee80211_he_cap_elem he_cap_elem; struct ieee80211_he_mcs_nss_supp he_mcs_nss_supp; - u8 ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN]; + uint8_t ppe_thres[IEEE80211_HE_PPE_THRES_MAX_LEN]; }; #define IEEE80211_MAX_CHAINS 4 @@ -214,14 +214,14 @@ enum rate_info_bw { * only valid if bw is %RATE_INFO_BW_HE_RU) */ struct rate_info { - u8 flags; - u8 mcs; - u16 legacy; - u8 nss; - u8 bw; - u8 he_gi; - u8 he_dcm; - u8 he_ru_alloc; + uint8_t flags; + uint8_t mcs; + uint16_t legacy; + uint8_t nss; + uint8_t bw; + uint8_t he_gi; + uint8_t he_dcm; + uint8_t he_ru_alloc; }; /** @@ -307,7 +307,7 @@ struct ieee80211_supported_band { int n_bitrates; struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_vht_cap vht_cap; - u16 n_iftype_data; + uint16_t n_iftype_data; const struct ieee80211_sband_iftype_data *iftype_data; }; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.c b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.c index 331bd5384..648aa8d52 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.c @@ -15,7 +15,7 @@ * be seen in entry 128, 0x8408. This corresponds to x^0 + x^5 + x^12. * Add the implicit x^16, and you have the standard CRC-CCITT. */ -u16 const crc_ccitt_table[256] = { +uint16_t const crc_ccitt_table[256] = { 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, @@ -54,7 +54,7 @@ u16 const crc_ccitt_table[256] = { * Similar table to calculate CRC16 variant known as CRC-CCITT-FALSE * Reflected bits order, does not augment final value. */ -u16 const crc_ccitt_false_table[256] = { +uint16_t const crc_ccitt_false_table[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, @@ -96,7 +96,7 @@ u16 const crc_ccitt_false_table[256] = { * @buffer: data pointer * @len: number of bytes in the buffer */ -u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) +uint16_t crc_ccitt(uint16_t crc, uint8_t const *buffer, size_t len) { while (len--) crc = crc_ccitt_byte(crc, *buffer++); @@ -110,7 +110,7 @@ u16 crc_ccitt(u16 crc, u8 const *buffer, size_t len) * @buffer: data pointer * @len: number of bytes in the buffer */ -u16 crc_ccitt_false(u16 crc, u8 const *buffer, size_t len) +uint16_t crc_ccitt_false(uint16_t crc, uint8_t const *buffer, size_t len) { while (len--) crc = crc_ccitt_false_byte(crc, *buffer++); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.h index a61f79b05..dc9129371 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/crc_ccit.h @@ -11,18 +11,18 @@ #include "kernel/types.h" -extern u16 const crc_ccitt_table[256]; -extern u16 const crc_ccitt_false_table[256]; +extern uint16_t const crc_ccitt_table[256]; +extern uint16_t const crc_ccitt_false_table[256]; -extern u16 crc_ccitt(u16 crc, const u8 *buffer, size_t len); -extern u16 crc_ccitt_false(u16 crc, const u8 *buffer, size_t len); +extern uint16_t crc_ccitt(uint16_t crc, const uint8_t *buffer, size_t len); +extern uint16_t crc_ccitt_false(uint16_t crc, const uint8_t *buffer, size_t len); -static inline u16 crc_ccitt_byte(u16 crc, const u8 c) +static inline uint16_t crc_ccitt_byte(uint16_t crc, const uint8_t c) { return (crc >> 8) ^ crc_ccitt_table[(crc ^ c) & 0xff]; } -static inline u16 crc_ccitt_false_byte(u16 crc, const u8 c) +static inline uint16_t crc_ccitt_false_byte(uint16_t crc, const uint8_t c) { return (crc << 8) ^ crc_ccitt_false_table[(crc >> 8) ^ c]; } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h index 0b86868b2..b4cd4b5b3 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h @@ -30,7 +30,7 @@ #include "kernel/types.h" /* Reserved Ethernet Addresses per IEEE 802.1Q */ -static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = +static const uint8_t eth_reserved_addr_base[ETH_ALEN] __aligned(2) = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; #define eth_stp_addr eth_reserved_addr_base @@ -41,16 +41,16 @@ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per * IEEE 802.1Q 8.6.3 Frame filtering. * - * Please note: addr must be aligned to u16. + * Please note: addr must be aligned to uint16_t. */ -static inline bool is_link_local_ether_addr(const u8 *addr) +static inline bool is_link_local_ether_addr(const uint8_t *addr) { __be16 *a = (__be16 *)addr; static const __be16 *b = (const __be16 *)eth_reserved_addr_base; __be16 m = cpu_to_be16(0xfff0); #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) - return (((*(const u32 *)addr) ^ (*(const u32 *)b)) | + return (((*(const uint32_t *)addr) ^ (*(const uint32_t *)b)) | (__force int)((a[2] ^ b[2]) & m)) == 0; #else return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; @@ -63,16 +63,16 @@ static inline bool is_link_local_ether_addr(const u8 *addr) * * Return true if the address is all zeroes. * - * Please note: addr must be aligned to u16. + * Please note: addr must be aligned to uint16_t. */ -static inline bool is_zero_ether_addr(const u8 *addr) +static inline bool is_zero_ether_addr(const uint8_t *addr) { #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) - return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0; + return ((*(const uint32_t *)addr) | (*(const uint16_t *)(addr + 4))) == 0; #else - return (*(const u16 *)(addr + 0) | - *(const u16 *)(addr + 2) | - *(const u16 *)(addr + 4)) == 0; + return (*(const uint16_t *)(addr + 0) | + *(const uint16_t *)(addr + 2) | + *(const uint16_t *)(addr + 4)) == 0; #endif } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h index 58034d606..49af1cdee 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h @@ -303,10 +303,10 @@ * @tx_params: TX parameters */ struct ieee80211_mcs_info { - u8 rx_mask[IEEE80211_HT_MCS_MASK_LEN]; + uint8_t rx_mask[IEEE80211_HT_MCS_MASK_LEN]; __le16 rx_highest; - u8 tx_params; - u8 reserved[3]; + uint8_t tx_params; + uint8_t reserved[3]; } __packed; /* 802.11n HT capability MSC set */ @@ -338,14 +338,14 @@ struct ieee80211_mcs_info { */ struct ieee80211_ht_cap { __le16 cap_info; - u8 ampdu_params_info; + uint8_t ampdu_params_info; /* 16 bytes MCS information */ struct ieee80211_mcs_info mcs; __le16 extended_ht_cap_info; __le32 tx_BF_cap_info; - u8 antenna_selection_info; + uint8_t antenna_selection_info; } __packed; /* 802.11n HT capabilities masks (for cap_info) */ @@ -412,8 +412,8 @@ struct ieee80211_vht_mcs_info { * described in P802.11ax_D4.0 section 9.4.2.242.2 and 9.4.2.242.3 */ struct ieee80211_he_cap_elem { - u8 mac_cap_info[6]; - u8 phy_cap_info[11]; + uint8_t mac_cap_info[6]; + uint8_t phy_cap_info[11]; } __packed; /** @@ -480,29 +480,29 @@ struct ieee80211_hdr { __le16 frame_control; __le16 duration_id; struct_group(addrs, - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; + uint8_t addr1[ETH_ALEN]; + uint8_t addr2[ETH_ALEN]; + uint8_t addr3[ETH_ALEN]; ); __le16 seq_ctrl; - u8 addr4[ETH_ALEN]; + uint8_t addr4[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_hdr_3addr { __le16 frame_control; __le16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; + uint8_t addr1[ETH_ALEN]; + uint8_t addr2[ETH_ALEN]; + uint8_t addr3[ETH_ALEN]; __le16 seq_ctrl; } __packed __aligned(2); struct ieee80211_qos_hdr { __le16 frame_control; __le16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 addr3[ETH_ALEN]; + uint8_t addr1[ETH_ALEN]; + uint8_t addr2[ETH_ALEN]; + uint8_t addr3[ETH_ALEN]; __le16 seq_ctrl; __le16 qos_ctrl; } __packed __aligned(2); @@ -510,10 +510,10 @@ struct ieee80211_qos_hdr { struct ieee80211_trigger { __le16 frame_control; __le16 duration; - u8 ra[ETH_ALEN]; - u8 ta[ETH_ALEN]; + uint8_t ra[ETH_ALEN]; + uint8_t ta[ETH_ALEN]; __le64 common_info; - u8 variable[]; + uint8_t variable[]; } __packed __aligned(2); /** diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h index 4ee3dc425..63c021962 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h @@ -305,8 +305,8 @@ enum ieee80211_radiotap_he_bits { struct ieee80211_radiotap_he_mu { __le16 flags1, flags2; - u8 ru_ch1[4]; - u8 ru_ch2[4]; + uint8_t ru_ch1[4]; + uint8_t ru_ch2[4]; }; enum ieee80211_radiotap_he_mu_bits { @@ -358,7 +358,7 @@ enum ieee80211_radiotap_zero_len_psdu_type { /** * ieee80211_get_radiotap_len - get radiotap header length */ -static inline u16 ieee80211_get_radiotap_len(const char *data) +static inline uint16_t ieee80211_get_radiotap_len(const char *data) { struct ieee80211_radiotap_header *hdr = (struct ieee80211_radiotap_header *)data; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h index 7b5be7970..2d2a2a684 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h @@ -9,68 +9,68 @@ #include "kernel/types.h" -static inline u16 __get_unaligned_le16(const u8 *p) +static inline uint16_t __get_unaligned_le16(const uint8_t *p) { return p[0] | p[1] << 8; } -static inline u32 __get_unaligned_le32(const u8 *p) +static inline uint32_t __get_unaligned_le32(const uint8_t *p) { return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; } -static inline u64 __get_unaligned_le64(const u8 *p) +static inline u64 __get_unaligned_le64(const uint8_t *p) { return (u64)__get_unaligned_le32(p + 4) << 32 | __get_unaligned_le32(p); } -static inline void __put_unaligned_le16(u16 val, u8 *p) +static inline void __put_unaligned_le16(uint16_t val, uint8_t *p) { *p++ = val; *p++ = val >> 8; } -static inline void __put_unaligned_le32(u32 val, u8 *p) +static inline void __put_unaligned_le32(uint32_t val, uint8_t *p) { __put_unaligned_le16(val >> 16, p + 2); __put_unaligned_le16(val, p); } -static inline void __put_unaligned_le64(u64 val, u8 *p) +static inline void __put_unaligned_le64(u64 val, uint8_t *p) { __put_unaligned_le32(val >> 32, p + 4); __put_unaligned_le32(val, p); } -static inline u16 get_unaligned_le16(const void *p) +static inline uint16_t get_unaligned_le16(const void *p) { - return __get_unaligned_le16((const u8 *)p); + return __get_unaligned_le16((const uint8_t *)p); } -static inline u32 get_unaligned_le32(const void *p) +static inline uint32_t get_unaligned_le32(const void *p) { - return __get_unaligned_le32((const u8 *)p); + return __get_unaligned_le32((const uint8_t *)p); } static inline u64 get_unaligned_le64(const void *p) { - return __get_unaligned_le64((const u8 *)p); + return __get_unaligned_le64((const uint8_t *)p); } -static inline void put_unaligned_le16(u16 val, void *p) +static inline void put_unaligned_le16(uint16_t val, void *p) { - __put_unaligned_le16(val, (u8 *) p); + __put_unaligned_le16(val, (uint8_t *) p); } -static inline void put_unaligned_le32(u32 val, void *p) +static inline void put_unaligned_le32(uint32_t val, void *p) { - __put_unaligned_le32(val, (u8 *) p); + __put_unaligned_le32(val, (uint8_t *) p); } static inline void put_unaligned_le64(u64 val, void *p) { - __put_unaligned_le64(val, (u8 *) p); + __put_unaligned_le64(val, (uint8_t *) p); } #endif /* _USERSPACE_LINUX_UNALIGNED_LE_BYTESHIFT_H */ diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h index a0c3a9d55..c0a770d7a 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h @@ -23,7 +23,7 @@ */ #ifndef CONFIG_ARCH_HAS_ILOG2_U32 static inline const -int __ilog2_u32(u32 n) +int __ilog2_u32(uint32_t n) { return __fls(n) - 1; } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h index ced24a09a..021d97a1e 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h @@ -98,14 +98,14 @@ enum ieee80211_filter_flags { */ struct ieee80211_key_conf { atomic64_t tx_pn; - u32 cipher; - u8 icv_len; - u8 iv_len; - u8 hw_key_idx; - s8 keyidx; - u16 flags; - u8 keylen; - u8 key[0]; + uint32_t cipher; + uint8_t icv_len; + uint8_t iv_len; + uint8_t hw_key_idx; + int8_t keyidx; + uint16_t flags; + uint8_t keylen; + uint8_t key[0]; }; /** @@ -176,13 +176,13 @@ enum ieee80211_smps_mode { * otherwise each channel context has the number of chains listed. */ struct ieee80211_conf { - u32 flags; + uint32_t flags; int power_level, dynamic_ps_timeout; - u16 listen_interval; - u8 ps_dtim_period; + uint16_t listen_interval; + uint8_t ps_dtim_period; - u8 long_frame_max_tx_count, short_frame_max_tx_count; + uint8_t long_frame_max_tx_count, short_frame_max_tx_count; struct cfg80211_chan_def chandef; bool radar_enabled; @@ -601,30 +601,30 @@ struct ieee80211_hw { int sta_data_size; int chanctx_data_size; int txq_data_size; - u16 queues; - u16 max_listen_interval; - s8 max_signal; - u8 max_rates; - u8 max_report_rates; - u8 max_rate_tries; - u16 max_rx_aggregation_subframes; - u16 max_tx_aggregation_subframes; - u8 max_tx_fragments; - u8 offchannel_tx_hw_queue; - u8 radiotap_mcs_details; - u16 radiotap_vht_details; + uint16_t queues; + uint16_t max_listen_interval; + int8_t max_signal; + uint8_t max_rates; + uint8_t max_report_rates; + uint8_t max_rate_tries; + uint16_t max_rx_aggregation_subframes; + uint16_t max_tx_aggregation_subframes; + uint8_t max_tx_fragments; + uint8_t offchannel_tx_hw_queue; + uint8_t radiotap_mcs_details; + uint16_t radiotap_vht_details; struct { int units_pos; - s16 accuracy; + int16_t accuracy; } radiotap_timestamp; netdev_features_t netdev_features; - u8 uapsd_queues; - u8 uapsd_max_sp_len; - u8 n_cipher_schemes; + uint8_t uapsd_queues; + uint8_t uapsd_max_sp_len; + uint8_t n_cipher_schemes; const struct ieee80211_cipher_scheme *cipher_schemes; - u8 max_nan_de_entries; - u8 tx_sk_pacing_shift; - u8 weight_multiplier; + uint8_t max_nan_de_entries; + uint8_t tx_sk_pacing_shift; + uint8_t weight_multiplier; }; /** @@ -721,8 +721,8 @@ enum ieee80211_bss_change { * @position: 2 bits per group id indicating the position in the group */ struct ieee80211_mu_group_data { - u8 membership[WLAN_MEMBERSHIP_LEN]; - u8 position[WLAN_USER_POSITION_LEN]; + uint8_t membership[WLAN_MEMBERSHIP_LEN]; + uint8_t position[WLAN_USER_POSITION_LEN]; }; /** @@ -839,39 +839,39 @@ struct ieee80211_mu_group_data { * in order to discover all the nontransmitted BSSIDs in the set. */ struct ieee80211_bss_conf { - const u8 *bssid; - u8 bss_color; - u8 htc_trig_based_pkt_ext; + const uint8_t *bssid; + uint8_t bss_color; + uint8_t htc_trig_based_pkt_ext; bool multi_sta_back_32bit; bool uora_exists; bool ack_enabled; - u8 uora_ocw_range; - u16 frame_time_rts_th; + uint8_t uora_ocw_range; + uint16_t frame_time_rts_th; bool he_support; bool twt_requester; /* association related data */ bool assoc, ibss_joined; bool ibss_creator; - u16 aid; + uint16_t aid; /* erp related data */ bool use_cts_prot; bool use_short_preamble; bool use_short_slot; bool enable_beacon; - u8 dtim_period; - u16 beacon_int; - u16 assoc_capability; + uint8_t dtim_period; + uint16_t beacon_int; + uint16_t assoc_capability; u64 sync_tsf; - u32 sync_device_ts; - u8 sync_dtim_count; - u32 basic_rates; + uint32_t sync_device_ts; + uint8_t sync_dtim_count; + uint32_t basic_rates; struct ieee80211_rate *beacon_rate; int mcast_rate[NUM_NL80211_BANDS]; - u16 ht_operation_mode; - s32 cqm_rssi_thold; - u32 cqm_rssi_hyst; - s32 cqm_rssi_low; - s32 cqm_rssi_high; + uint16_t ht_operation_mode; + int32_t cqm_rssi_thold; + uint32_t cqm_rssi_hyst; + int32_t cqm_rssi_low; + int32_t cqm_rssi_high; struct cfg80211_chan_def chandef; struct ieee80211_mu_group_data mu_group; __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; @@ -879,24 +879,24 @@ struct ieee80211_bss_conf { bool qos; bool idle; bool ps; - u8 ssid[IEEE80211_MAX_SSID_LEN]; + uint8_t ssid[IEEE80211_MAX_SSID_LEN]; size_t ssid_len; bool hidden_ssid; int txpower; enum nl80211_tx_power_setting txpower_type; struct ieee80211_p2p_noa_attr p2p_noa_attr; bool allow_p2p_go_ps; - u16 max_idle_period; + uint16_t max_idle_period; bool protected_keep_alive; bool ftm_responder; struct ieee80211_ftm_responder_params *ftmr_params; /* Multiple BSSID data */ bool nontransmitted; - u8 transmitter_bssid[ETH_ALEN]; - u8 bssid_index; - u8 bssid_indicator; + uint8_t transmitter_bssid[ETH_ALEN]; + uint8_t bssid_index; + uint8_t bssid_indicator; bool ema_ap; - u8 profile_periodicity; + uint8_t profile_periodicity; }; /** @@ -920,11 +920,11 @@ struct ieee80211_chanctx_conf { struct cfg80211_chan_def def; struct cfg80211_chan_def min_def; - u8 rx_chains_static, rx_chains_dynamic; + uint8_t rx_chains_static, rx_chains_dynamic; bool radar_enabled; - u8 drv_priv[0] __aligned(sizeof(void *)); + uint8_t drv_priv[0] __aligned(sizeof(void *)); }; /** @@ -992,19 +992,19 @@ enum ieee80211_vif_flags { struct ieee80211_vif { enum nl80211_iftype type; struct ieee80211_bss_conf bss_conf; - u8 addr[ETH_ALEN] __aligned(2); + uint8_t addr[ETH_ALEN] __aligned(2); bool p2p; bool csa_active; bool mu_mimo_owner; - u8 cab_queue; - u8 hw_queue[IEEE80211_NUM_ACS]; + uint8_t cab_queue; + uint8_t hw_queue[IEEE80211_NUM_ACS]; struct ieee80211_txq *txq; struct ieee80211_chanctx_conf __rcu *chanctx_conf; - u32 driver_flags; + uint32_t driver_flags; #ifdef CONFIG_MAC80211_DEBUGFS struct dentry *debugfs_dir; @@ -1015,7 +1015,7 @@ struct ieee80211_vif { bool txqs_stopped[IEEE80211_NUM_ACS]; /* must be last */ - u8 drv_priv[0] __aligned(sizeof(void *)); + uint8_t drv_priv[0] __aligned(sizeof(void *)); }; /** @@ -1072,7 +1072,7 @@ enum ieee80211_sta_rx_bandwidth { */ struct rcu_head { /* MSVC doesn't like empty structs, so give it some junk here */ - u8 junk; + uint8_t junk; }; /** @@ -1085,11 +1085,11 @@ struct rcu_head { struct ieee80211_sta_rates { struct rcu_head rcu_head; struct { - s8 idx; - u8 count; - u8 count_cts; - u8 count_rts; - u16 flags; + int8_t idx; + uint8_t count; + uint8_t count_cts; + uint8_t count_rts; + uint16_t flags; } rate[IEEE80211_TX_RATE_TABLE_SIZE]; }; @@ -1107,7 +1107,7 @@ struct ieee80211_sta_rates { * per peer TPC. */ struct ieee80211_sta_txpwr { - s16 power; + int16_t power; enum nl80211_tx_power_setting type; }; @@ -1159,24 +1159,24 @@ struct ieee80211_sta_txpwr { * the last entry (%IEEE80211_NUM_TIDS) is used for non-data frames */ struct ieee80211_sta { - u32 supp_rates[NUM_NL80211_BANDS]; - u8 addr[ETH_ALEN]; - u16 aid; + uint32_t supp_rates[NUM_NL80211_BANDS]; + uint8_t addr[ETH_ALEN]; + uint16_t aid; struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_vht_cap vht_cap; struct ieee80211_sta_he_cap he_cap; - u16 max_rx_aggregation_subframes; + uint16_t max_rx_aggregation_subframes; bool wme; - u8 uapsd_queues; - u8 max_sp; - u8 rx_nss; + uint8_t uapsd_queues; + uint8_t max_sp; + uint8_t rx_nss; enum ieee80211_sta_rx_bandwidth bandwidth; enum ieee80211_smps_mode smps_mode; struct ieee80211_sta_rates __rcu *rates; bool tdls; bool tdls_initiator; bool mfp; - u8 max_amsdu_subframes; + uint8_t max_amsdu_subframes; /** * @max_amsdu_len: @@ -1193,16 +1193,16 @@ struct ieee80211_sta { * driver. This is defined by the spec (IEEE 802.11-2012 section * 8.3.2.2 NOTE 2). */ - u16 max_amsdu_len; + uint16_t max_amsdu_len; bool support_p2p_ps; - u16 max_rc_amsdu_len; - u16 max_tid_amsdu_len[IEEE80211_NUM_TIDS]; + uint16_t max_rc_amsdu_len; + uint16_t max_tid_amsdu_len[IEEE80211_NUM_TIDS]; struct ieee80211_sta_txpwr txpwr; struct ieee80211_txq *txq[IEEE80211_NUM_TIDS + 1]; /* must be last */ - u8 drv_priv[0] __aligned(sizeof(void *)); + uint8_t drv_priv[0] __aligned(sizeof(void *)); }; static inline bool @@ -1314,23 +1314,23 @@ enum mac80211_rx_encoding { struct ieee80211_rx_status { u64 mactime; u64 boottime_ns; - u32 device_timestamp; - u32 ampdu_reference; - u32 flag; - u16 freq; - u8 enc_flags; - u8 encoding:2, bw:3, he_ru:3; - u8 he_gi:2, he_dcm:1; - u8 rate_idx; - u8 nss; - u8 rx_flags; - u8 band; - u8 antenna; - s8 signal; - u8 chains; - s8 chain_signal[IEEE80211_MAX_CHAINS]; - u8 ampdu_delimiter_crc; - u8 zero_length_psdu_type; + uint32_t device_timestamp; + uint32_t ampdu_reference; + uint32_t flag; + uint16_t freq; + uint8_t enc_flags; + uint8_t encoding:2, bw:3, he_ru:3; + uint8_t he_gi:2, he_dcm:1; + uint8_t rate_idx; + uint8_t nss; + uint8_t rx_flags; + uint8_t band; + uint8_t antenna; + int8_t signal; + uint8_t chains; + int8_t chain_signal[IEEE80211_MAX_CHAINS]; + uint8_t ampdu_delimiter_crc; + uint8_t zero_length_psdu_type; }; /** diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h index e313bb786..9206771e8 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h @@ -164,15 +164,15 @@ enum nl80211_iftype { #define IEEE80211_P2P_NOA_DESC_MAX 4 struct ieee80211_p2p_noa_desc { - u8 count; + uint8_t count; __le32 duration; __le32 interval; __le32 start_time; } __packed; struct ieee80211_p2p_noa_attr { - u8 index; - u8 oppps_ctwindow; + uint8_t index; + uint8_t oppps_ctwindow; struct ieee80211_p2p_noa_desc desc[IEEE80211_P2P_NOA_DESC_MAX]; } __packed; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h index 745414847..ecfa97583 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h @@ -10,14 +10,14 @@ #include -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; +typedef uint8_t uint8_t; +typedef uint16_t uint16_t; +typedef uint32_t uint32_t; typedef uint64_t u64; -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; +typedef int8_t int8_t; +typedef int16_t int16_t; +typedef int32_t int32_t; typedef int64_t s64; #ifndef LIBWIFIUSERSPACE_EXCLUDE_TYPES diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h index 845d5f79f..cc862e0de 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h @@ -2030,25 +2030,25 @@ #define MAC_IVEIV_ENTRY(__idx) \ (MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry))) #define MAC_WCID_ATTR_ENTRY(__idx) \ - (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32))) + (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(uint32_t))) #define SHARED_KEY_ENTRY(__idx) \ (SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry))) #define SHARED_KEY_MODE_ENTRY(__idx) \ - (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32))) + (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(uint32_t))) struct mac_wcid_entry { - u8 mac[6]; - u8 reserved[2]; + uint8_t mac[6]; + uint8_t reserved[2]; } __packed; struct hw_key_entry { - u8 key[16]; - u8 tx_mic[8]; - u8 rx_mic[8]; + uint8_t key[16]; + uint8_t tx_mic[8]; + uint8_t rx_mic[8]; } __packed; struct mac_iveiv_entry { - u8 iv[8]; + uint8_t iv[8]; } __packed; /* @@ -3208,11 +3208,11 @@ enum rt2800_eeprom_word { #define MAC_IVEIV_ENTRY(__idx) \ (MAC_IVEIV_TABLE_BASE + ((__idx) * sizeof(struct mac_iveiv_entry))) #define MAC_WCID_ATTR_ENTRY(__idx) \ - (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(u32))) + (MAC_WCID_ATTRIBUTE_BASE + ((__idx) * sizeof(uint32_t))) #define SHARED_KEY_ENTRY(__idx) \ (SHARED_KEY_TABLE_BASE + ((__idx) * sizeof(struct hw_key_entry))) #define SHARED_KEY_MODE_ENTRY(__idx) \ - (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(u32))) + (SHARED_KEY_MODE_BASE + ((__idx) * sizeof(uint32_t))) #endif /* ifndef RT2800_H */ diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.c index 218c86040..7801a3e20 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.c @@ -82,9 +82,9 @@ static inline bool rt2800_is_305x_soc(struct rt2x00_dev *rt2x00dev) { } static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev, - const unsigned int word, const u8 value) + const unsigned int word, const uint8_t value) { - u32 reg; + uint32_t reg; mutex_lock(&rt2x00dev->csr_mutex); @@ -106,10 +106,10 @@ static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev, mutex_unlock(&rt2x00dev->csr_mutex); } -static u8 rt2800_bbp_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) +static uint8_t rt2800_bbp_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) { - u32 reg = 0; - u8 value; + uint32_t reg = 0; + uint8_t value; mutex_lock(&rt2x00dev->csr_mutex); @@ -142,9 +142,9 @@ static u8 rt2800_bbp_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) static void rt2800_rfcsr_write(struct rt2x00_dev *rt2x00dev, - const unsigned int word, const u8 value) + const unsigned int word, const uint8_t value) { - u32 reg; + uint32_t reg; mutex_lock(&rt2x00dev->csr_mutex); @@ -182,31 +182,31 @@ static void rt2800_rfcsr_write(struct rt2x00_dev *rt2x00dev, mutex_unlock(&rt2x00dev->csr_mutex); } -static void rt2800_rfcsr_write_bank(struct rt2x00_dev *rt2x00dev, const u8 bank, - const unsigned int reg, const u8 value) +static void rt2800_rfcsr_write_bank(struct rt2x00_dev *rt2x00dev, const uint8_t bank, + const unsigned int reg, const uint8_t value) { rt2800_rfcsr_write(rt2x00dev, (reg | (bank << 6)), value); } static void rt2800_rfcsr_write_chanreg(struct rt2x00_dev *rt2x00dev, - const unsigned int reg, const u8 value) + const unsigned int reg, const uint8_t value) { rt2800_rfcsr_write_bank(rt2x00dev, 4, reg, value); rt2800_rfcsr_write_bank(rt2x00dev, 6, reg, value); } static void rt2800_rfcsr_write_dccal(struct rt2x00_dev *rt2x00dev, - const unsigned int reg, const u8 value) + const unsigned int reg, const uint8_t value) { rt2800_rfcsr_write_bank(rt2x00dev, 5, reg, value); rt2800_rfcsr_write_bank(rt2x00dev, 7, reg, value); } -static u8 rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev, +static uint8_t rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) { - u32 reg; - u8 value; + uint32_t reg; + uint8_t value; mutex_lock(&rt2x00dev->csr_mutex); @@ -256,16 +256,16 @@ static u8 rt2800_rfcsr_read(struct rt2x00_dev *rt2x00dev, return value; } -static u8 rt2800_rfcsr_read_bank(struct rt2x00_dev *rt2x00dev, const u8 bank, +static uint8_t rt2800_rfcsr_read_bank(struct rt2x00_dev *rt2x00dev, const uint8_t bank, const unsigned int reg) { return rt2800_rfcsr_read(rt2x00dev, (reg | (bank << 6))); } static void rt2800_rf_write(struct rt2x00_dev *rt2x00dev, - const unsigned int word, const u32 value) + const unsigned int word, const uint32_t value) { - u32 reg; + uint32_t reg; mutex_lock(&rt2x00dev->csr_mutex); @@ -289,9 +289,9 @@ static void rt2800_rf_write(struct rt2x00_dev *rt2x00dev, static void rt2800_bbp_write_with_rx_chain(struct rt2x00_dev *rt2x00dev, const unsigned int word, - const u8 value) + const uint8_t value) { - u8 chain, reg; + uint8_t chain, reg; for (chain = 0; chain < rt2x00dev->default_ant.rx_chain_num; chain++) { reg = rt2800_bbp_read(rt2x00dev, 27); @@ -423,7 +423,7 @@ static void *rt2800_eeprom_addr(struct rt2x00_dev *rt2x00dev, return rt2x00_eeprom_addr(rt2x00dev, index); } -static u16 rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, +static uint16_t rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, const enum rt2800_eeprom_word word) { unsigned int index; @@ -432,14 +432,14 @@ static u16 rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, } static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev, - const enum rt2800_eeprom_word word, u16 data) { + const enum rt2800_eeprom_word word, uint16_t data) { unsigned int index; index = rt2800_eeprom_word_index(rt2x00dev, word); rt2x00_eeprom_write(rt2x00dev, index, data); } -static u16 rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, +static uint16_t rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, const enum rt2800_eeprom_word array, unsigned int offset) { unsigned int index; @@ -449,7 +449,7 @@ static u16 rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, } static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; int i, count; reg = rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL); @@ -506,9 +506,9 @@ static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev) { } void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, - const u8 command, const u8 token, - const u8 arg0, const u8 arg1) { - u32 reg; + const uint8_t command, const uint8_t token, + const uint8_t arg0, const uint8_t arg1) { + uint32_t reg; mutex_lock(&rt2x00dev->csr_mutex); @@ -533,7 +533,7 @@ void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, int rt2800_wait_csr_ready(struct rt2x00_dev *rt2x00dev) { unsigned int i = 0; - u32 reg; + uint32_t reg; for (i = 0; i < REGISTER_BUSY_COUNT; i++) { reg = rt2800_register_read(rt2x00dev, MAC_CSR0); @@ -548,7 +548,7 @@ int rt2800_wait_csr_ready(struct rt2x00_dev *rt2x00dev) { int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev) { unsigned int i; - u32 reg; + uint32_t reg; /* * Some devices are really slow to respond here. Wait a whole second @@ -568,8 +568,8 @@ int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev) { } int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev) { - u32 reg; - u16 efuse_ctrl_reg; + uint32_t reg; + uint16_t efuse_ctrl_reg; if (rt2x00_rt(rt2x00dev, RT3290)) efuse_ctrl_reg = EFUSE_CTRL_3290; @@ -581,12 +581,12 @@ int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev) { } static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i) { - u32 reg; - u16 efuse_ctrl_reg; - u16 efuse_data0_reg; - u16 efuse_data1_reg; - u16 efuse_data2_reg; - u16 efuse_data3_reg; + uint32_t reg; + uint16_t efuse_ctrl_reg; + uint16_t efuse_data0_reg; + uint16_t efuse_data1_reg; + uint16_t efuse_data2_reg; + uint16_t efuse_data3_reg; if (rt2x00_rt(rt2x00dev, RT3290)) { efuse_ctrl_reg = EFUSE_CTRL_3290; @@ -613,19 +613,19 @@ static void rt2800_efuse_read(struct rt2x00_dev *rt2x00dev, unsigned int i) { /* Apparently the data is read from end to start */ reg = rt2800_register_read_lock(rt2x00dev, efuse_data3_reg); /* The returned value is in CPU order, but eeprom is le */ - *(u32 *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg); + *(uint32_t *)&rt2x00dev->eeprom[i] = cpu_to_le32(reg); reg = rt2800_register_read_lock(rt2x00dev, efuse_data2_reg); - *(u32 *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); + *(uint32_t *)&rt2x00dev->eeprom[i + 2] = cpu_to_le32(reg); reg = rt2800_register_read_lock(rt2x00dev, efuse_data1_reg); - *(u32 *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg); + *(uint32_t *)&rt2x00dev->eeprom[i + 4] = cpu_to_le32(reg); reg = rt2800_register_read_lock(rt2x00dev, efuse_data0_reg); - *(u32 *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg); + *(uint32_t *)&rt2x00dev->eeprom[i + 6] = cpu_to_le32(reg); } int rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev) { unsigned int i; - for (i = 0; i < EEPROM_SIZE / sizeof(u16); i += 8) + for (i = 0; i < EEPROM_SIZE / sizeof(uint16_t); i += 8) rt2800_efuse_read(rt2x00dev, i); return 0; @@ -635,10 +635,10 @@ int rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev) { * Configuration handlers. */ static void rt2800_config_wcid(struct rt2x00_dev *rt2x00dev, - const u8 *address, + const uint8_t *address, int wcid) { struct mac_wcid_entry wcid_entry; - u32 offset; + uint32_t offset; offset = MAC_WCID_ENTRY(wcid); @@ -651,16 +651,16 @@ static void rt2800_config_wcid(struct rt2x00_dev *rt2x00dev, } static void rt2800_delete_wcid_attr(struct rt2x00_dev *rt2x00dev, int wcid) { - u32 offset; + uint32_t offset; offset = MAC_WCID_ATTR_ENTRY(wcid); rt2800_register_write(rt2x00dev, offset, 0); } #if 0 static void rt2800_config_wcid_attr_bssidx(struct rt2x00_dev *rt2x00dev, - int wcid, u32 bssidx) { - u32 offset = MAC_WCID_ATTR_ENTRY(wcid); - u32 reg; + int wcid, uint32_t bssidx) { + uint32_t offset = MAC_WCID_ATTR_ENTRY(wcid); + uint32_t reg; /* * The BSS Idx numbers is split in a main value of 3 bits, @@ -677,8 +677,8 @@ static void rt2800_config_wcid_attr_cipher(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_crypto *crypto, struct ieee80211_key_conf *key) { struct mac_iveiv_entry iveiv_entry; - u32 offset; - u32 reg; + uint32_t offset; + uint32_t reg; /* * Gutted to simply clear the keys, we never set it since we @@ -717,9 +717,9 @@ static inline void rt2800_clear_beacon_register(struct rt2x00_dev *rt2x00dev, static void rt2800_config_3572bt_ant(struct rt2x00_dev *rt2x00dev) { - u32 reg; - u16 eeprom; - u8 led_ctrl, led_g_mode, led_r_mode; + uint32_t reg; + uint16_t eeprom; + uint8_t led_ctrl, led_g_mode, led_r_mode; reg = rt2800_register_read(rt2x00dev, GPIO_SWITCH); if (rt2x00dev->curr_band == NL80211_BAND_5GHZ) { @@ -752,9 +752,9 @@ static void rt2800_config_3572bt_ant(struct rt2x00_dev *rt2x00dev) static void rt2800_set_ant_diversity(struct rt2x00_dev *rt2x00dev, enum antenna ant) { - u32 reg; - u8 eesk_pin = (ant == ANTENNA_A) ? 1 : 0; - u8 gpio_bit3 = (ant == ANTENNA_A) ? 0 : 1; + uint32_t reg; + uint8_t eesk_pin = (ant == ANTENNA_A) ? 1 : 0; + uint8_t gpio_bit3 = (ant == ANTENNA_A) ? 0 : 1; if (rt2x00_is_pci(rt2x00dev)) { reg = rt2800_register_read(rt2x00dev, E2PROM_CSR); @@ -772,9 +772,9 @@ static void rt2800_set_ant_diversity(struct rt2x00_dev *rt2x00dev, void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant) { - u8 r1; - u8 r3; - u16 eeprom; + uint8_t r1; + uint8_t r3; + uint16_t eeprom; rt2x00_info(rt2x00dev, "Configuring rt2800 antenna\n"); @@ -854,7 +854,7 @@ EXPORT_SYMBOL_GPL(rt2800_config_ant); static void rt2800_config_lna_gain(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_conf *libconf) { - u16 eeprom; + uint16_t eeprom; short lna_gain; if (libconf->rf.channel <= 14) { @@ -894,11 +894,11 @@ static void rt2800_config_lna_gain(struct rt2x00_dev *rt2x00dev, static void rt2800_freq_cal_mode1(struct rt2x00_dev *rt2x00dev) { - u8 freq_offset, prev_freq_offset; - u8 rfcsr, prev_rfcsr; + uint8_t freq_offset, prev_freq_offset; + uint8_t rfcsr, prev_rfcsr; freq_offset = rt2x00_get_field8(rt2x00dev->freq_offset, RFCSR17_CODE); - freq_offset = min_t(u8, freq_offset, FREQ_OFFSET_BOUND); + freq_offset = min_t(uint8_t, freq_offset, FREQ_OFFSET_BOUND); rfcsr = rt2800_rfcsr_read(rt2x00dev, 17); prev_rfcsr = rfcsr; @@ -998,7 +998,7 @@ static void rt2800_config_channel_rf3xxx(struct rt2x00_dev *rt2x00dev, struct channel_info *info) { struct rt2800_drv_data *drv_data = (struct rt2800_drv_data *) rt2x00dev->drv_data; - u8 rfcsr, calib_tx, calib_rx; + uint8_t rfcsr, calib_tx, calib_rx; rt2800_rfcsr_write(rt2x00dev, 2, rf->rf1); @@ -1076,8 +1076,8 @@ static void rt2800_config_channel_rf3052(struct rt2x00_dev *rt2x00dev, struct channel_info *info) { struct rt2800_drv_data *drv_data = (struct rt2800_drv_data *) rt2x00dev->drv_data; - u8 rfcsr; - u32 reg; + uint8_t rfcsr; + uint32_t reg; if (rf->channel <= 14) { rt2800_bbp_write(rt2x00dev, 25, drv_data->bbp25); @@ -1248,10 +1248,10 @@ static void rt2800_config_channel_rf3053(struct rt2x00_dev *rt2x00dev, struct channel_info *info) { struct rt2800_drv_data *drv_data = (struct rt2800_drv_data *) rt2x00dev->drv_data; - u8 txrx_agc_fc; - u8 txrx_h20m; - u8 rfcsr; - u8 bbp; + uint8_t txrx_agc_fc; + uint8_t txrx_h20m; + uint8_t rfcsr; + uint8_t bbp; const bool txbf_enabled = false; /* TODO */ /* TODO: use TX{0,1,2}FinePowerControl values from EEPROM */ @@ -1544,9 +1544,9 @@ static void rt2800_config_channel_rf3853(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u8 rfcsr; - u8 bbp; - u8 pwr1, pwr2, pwr3; + uint8_t rfcsr; + uint8_t bbp; + uint8_t pwr1, pwr2, pwr3; const bool txbf_enabled = false; /* TODO */ @@ -1752,7 +1752,7 @@ static void rt2800_config_channel_rf3290(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u8 rfcsr; + uint8_t rfcsr; rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); @@ -1789,7 +1789,7 @@ static void rt2800_config_channel_rf3322(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u8 rfcsr; + uint8_t rfcsr; rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); @@ -1837,7 +1837,7 @@ static void rt2800_config_channel_rf53xx(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u8 rfcsr; + uint8_t rfcsr; int idx = rf->channel-1; rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); @@ -1935,8 +1935,8 @@ static void rt2800_config_channel_rf55xx(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u8 rfcsr, ep_reg; - u32 reg; + uint8_t rfcsr, ep_reg; + uint32_t reg; int power_bound; rt2x00_info(rt2x00dev, "channel_rf55xx config channel %u\n", rf->channel); @@ -2213,8 +2213,8 @@ static void rt2800_config_channel_rf7620(struct rt2x00_dev *rt2x00dev, struct channel_info *info) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u8 rx_agc_fc, tx_agc_fc; - u8 rfcsr; + uint8_t rx_agc_fc, tx_agc_fc; + uint8_t rfcsr; /* Frequeny plan setting */ /* Rdiv setting (set 0x03 if Xtal==20) @@ -2370,10 +2370,10 @@ static void rt2800_config_channel_rf7620(struct rt2x00_dev *rt2x00dev, static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev, struct ieee80211_channel *chan, int power_level) { - u16 eeprom, target_power, max_power; - u32 mac_sys_ctrl, mac_status; - u32 reg; - u8 bbp; + uint16_t eeprom, target_power, max_power; + uint32_t mac_sys_ctrl, mac_status; + uint32_t reg; + uint8_t bbp; int i; /* hardware unit is 0.5dBm, limited to 23.5dBm */ @@ -2451,7 +2451,7 @@ static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev, */ void rt2800_link_stats(struct rt2x00_dev *rt2x00dev, struct link_qual *qual) { - u32 reg; + uint32_t reg; /* * Update FCS error count from register. @@ -2461,9 +2461,9 @@ void rt2800_link_stats(struct rt2x00_dev *rt2x00dev, struct link_qual *qual) } EXPORT_SYMBOL_GPL(rt2800_link_stats); -static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev) +static uint8_t rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev) { - u8 vgc; + uint8_t vgc; if (rt2x00dev->curr_band == NL80211_BAND_2GHZ) { if (rt2x00_rt(rt2x00dev, RT3070) || @@ -2498,7 +2498,7 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev) } static inline void rt2800_set_vgc(struct rt2x00_dev *rt2x00dev, - struct link_qual *qual, u8 vgc_level) + struct link_qual *qual, uint8_t vgc_level) { if (qual->vgc_level != vgc_level) { if (rt2x00_rt(rt2x00dev, RT3572) || @@ -2525,9 +2525,9 @@ void rt2800_reset_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual) EXPORT_SYMBOL_GPL(rt2800_reset_tuner); void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, - const u32 count) + const uint32_t count) { - u8 vgc; + uint8_t vgc; if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) return; @@ -2575,8 +2575,8 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner); */ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) { struct rt2800_drv_data *drv_data = (struct rt2800_drv_data *) rt2x00dev->drv_data; - u32 reg; - u16 eeprom; + uint32_t reg; + uint16_t eeprom; unsigned int i; int ret; @@ -3072,7 +3072,7 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) { static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev) { unsigned int i; - u32 reg; + uint32_t reg; for (i = 0; i < REGISTER_BUSY_COUNT; i++) { reg = rt2800_register_read(rt2x00dev, MAC_STATUS_CFG); @@ -3089,7 +3089,7 @@ static int rt2800_wait_bbp_rf_ready(struct rt2x00_dev *rt2x00dev) static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev) { unsigned int i; - u8 value; + uint8_t value; /* * BBP was enabled after firmware was loaded, @@ -3111,7 +3111,7 @@ static int rt2800_wait_bbp_ready(struct rt2x00_dev *rt2x00dev) } int rt2800_rfkill_poll(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; if (rt2x00_rt(rt2x00dev, RT3290)) { reg = rt2800_register_read(rt2x00dev, WLAN_FUN_CTRL); @@ -3124,7 +3124,7 @@ int rt2800_rfkill_poll(struct rt2x00_dev *rt2x00dev) { static void rt2800_bbp4_mac_if_ctrl(struct rt2x00_dev *rt2x00dev) { - u8 value; + uint8_t value; value = rt2800_bbp_read(rt2x00dev, 4); rt2x00_set_field8(&value, BBP4_MAC_IF_CTRL, 1); @@ -3139,7 +3139,7 @@ static void rt2800_init_freq_calibration(struct rt2x00_dev *rt2x00dev) static void rt2800_init_bbp_5592_glrt(struct rt2x00_dev *rt2x00dev) { - static const u8 glrt_table[] = { + static const uint8_t glrt_table[] = { 0xE0, 0x1F, 0X38, 0x32, 0x08, 0x28, 0x19, 0x0A, 0xFF, 0x00, /* 128 ~ 137 */ 0x16, 0x10, 0x10, 0x0B, 0x36, 0x2C, 0x26, 0x24, 0x42, 0x36, /* 138 ~ 147 */ 0x30, 0x2D, 0x4C, 0x46, 0x3D, 0x40, 0x3E, 0x42, 0x3D, 0x40, /* 148 ~ 157 */ @@ -3180,8 +3180,8 @@ static void rt2800_init_bbp_early(struct rt2x00_dev *rt2x00dev) static void rt2800_disable_unused_dac_adc(struct rt2x00_dev *rt2x00dev) { - u16 eeprom; - u8 value; + uint16_t eeprom; + uint8_t value; value = rt2800_bbp_read(rt2x00dev, 138); eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0); @@ -3309,7 +3309,7 @@ static void rt2800_init_bbp_30xx(struct rt2x00_dev *rt2x00dev) static void rt2800_init_bbp_3290(struct rt2x00_dev *rt2x00dev) { - u8 value; + uint8_t value; rt2800_bbp4_mac_if_ctrl(rt2x00dev); @@ -3605,8 +3605,8 @@ static void rt2800_init_bbp_3883(struct rt2x00_dev *rt2x00dev) static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) { int ant, div_mode; - u16 eeprom; - u8 value; + uint16_t eeprom; + uint8_t value; rt2800_bbp4_mac_if_ctrl(rt2x00dev); @@ -3679,7 +3679,7 @@ static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) /* check if this is a Bluetooth combo card */ if (rt2x00_has_cap_bt_coexist(rt2x00dev)) { - u32 reg; + uint32_t reg; reg = rt2800_register_read(rt2x00dev, GPIO_CTRL); rt2x00_set_field32(®, GPIO_CTRL_DIR3, 0); @@ -3714,8 +3714,8 @@ static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev) static void rt2800_init_bbp_5592(struct rt2x00_dev *rt2x00dev) { int ant, div_mode; - u16 eeprom; - u8 value; + uint16_t eeprom; + uint8_t value; rt2800_init_bbp_early(rt2x00dev); @@ -3786,20 +3786,20 @@ static void rt2800_init_bbp_5592(struct rt2x00_dev *rt2x00dev) } static void rt2800_bbp_glrt_write(struct rt2x00_dev *rt2x00dev, - const u8 reg, const u8 value) + const uint8_t reg, const uint8_t value) { rt2800_bbp_write(rt2x00dev, 195, reg); rt2800_bbp_write(rt2x00dev, 196, value); } static void rt2800_bbp_dcoc_write(struct rt2x00_dev *rt2x00dev, - const u8 reg, const u8 value) + const uint8_t reg, const uint8_t value) { rt2800_bbp_write(rt2x00dev, 158, reg); rt2800_bbp_write(rt2x00dev, 159, value); } -static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg) +static uint8_t rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const uint8_t reg) { rt2800_bbp_write(rt2x00dev, 158, reg); return rt2800_bbp_read(rt2x00dev, 159); @@ -3807,7 +3807,7 @@ static u8 rt2800_bbp_dcoc_read(struct rt2x00_dev *rt2x00dev, const u8 reg) static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev) { - u8 bbp; + uint8_t bbp; /* Apply Maximum Likelihood Detection (MLD) for 2 stream case */ bbp = rt2800_bbp_read(rt2x00dev, 105); @@ -4012,9 +4012,9 @@ static void rt2800_init_bbp_6352(struct rt2x00_dev *rt2x00dev) static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) { unsigned int i; - u16 eeprom; - u8 reg_id; - u8 value; + uint16_t eeprom; + uint8_t reg_id; + uint8_t value; if (rt2800_is_305x_soc(rt2x00dev)) rt2800_init_bbp_305x_soc(rt2x00dev); @@ -4075,23 +4075,23 @@ static void rt2800_init_bbp(struct rt2x00_dev *rt2x00dev) static void rt2800_led_open_drain_enable(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; reg = rt2800_register_read(rt2x00dev, OPT_14_CSR); rt2x00_set_field32(®, OPT_14_CSR_BIT0, 1); rt2800_register_write(rt2x00dev, OPT_14_CSR, reg); } -static u8 rt2800_init_rx_filter(struct rt2x00_dev *rt2x00dev, bool bw40, - u8 filter_target) +static uint8_t rt2800_init_rx_filter(struct rt2x00_dev *rt2x00dev, bool bw40, + uint8_t filter_target) { unsigned int i; - u8 bbp; - u8 rfcsr; - u8 passband; - u8 stopband; - u8 overtuned = 0; - u8 rfcsr24 = (bw40) ? 0x27 : 0x07; + uint8_t bbp; + uint8_t rfcsr; + uint8_t passband; + uint8_t stopband; + uint8_t overtuned = 0; + uint8_t rfcsr24 = (bw40) ? 0x27 : 0x07; rt2800_rfcsr_write(rt2x00dev, 24, rfcsr24); @@ -4150,7 +4150,7 @@ static u8 rt2800_init_rx_filter(struct rt2x00_dev *rt2x00dev, bool bw40, static void rt2800_rf_init_calibration(struct rt2x00_dev *rt2x00dev, const unsigned int rf_reg) { - u8 rfcsr; + uint8_t rfcsr; rfcsr = rt2800_rfcsr_read(rt2x00dev, rf_reg); rt2x00_set_field8(&rfcsr, FIELD8(0x80), 1); @@ -4163,9 +4163,9 @@ static void rt2800_rf_init_calibration(struct rt2x00_dev *rt2x00dev, static void rt2800_rx_filter_calibration(struct rt2x00_dev *rt2x00dev) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u8 filter_tgt_bw20; - u8 filter_tgt_bw40; - u8 rfcsr, bbp; + uint8_t filter_tgt_bw20; + uint8_t filter_tgt_bw40; + uint8_t rfcsr, bbp; /* * TODO: sync filter_tgt values with vendor driver @@ -4209,8 +4209,8 @@ static void rt2800_rx_filter_calibration(struct rt2x00_dev *rt2x00dev) static void rt2800_normal_mode_setup_3xxx(struct rt2x00_dev *rt2x00dev) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u8 min_gain, rfcsr, bbp; - u16 eeprom; + uint8_t min_gain, rfcsr, bbp; + uint16_t eeprom; rfcsr = rt2800_rfcsr_read(rt2x00dev, 17); @@ -4280,8 +4280,8 @@ static void rt2800_normal_mode_setup_3xxx(struct rt2x00_dev *rt2x00dev) static void rt2800_normal_mode_setup_3593(struct rt2x00_dev *rt2x00dev) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u8 rfcsr; - u8 tx_gain; + uint8_t rfcsr; + uint8_t tx_gain; rfcsr = rt2800_rfcsr_read(rt2x00dev, 50); rt2x00_set_field8(&rfcsr, RFCSR50_TX_LO2_EN, 0); @@ -4315,8 +4315,8 @@ static void rt2800_normal_mode_setup_3593(struct rt2x00_dev *rt2x00dev) static void rt2800_normal_mode_setup_5xxx(struct rt2x00_dev *rt2x00dev) { - u8 reg; - u16 eeprom; + uint8_t reg; + uint16_t eeprom; /* Turn off unused DAC1 and ADC1 to reduce power consumption */ reg = rt2800_bbp_read(rt2x00dev, 138); @@ -4382,9 +4382,9 @@ static void rt2800_init_rfcsr_305x_soc(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_30xx(struct rt2x00_dev *rt2x00dev) { - u8 rfcsr; - u16 eeprom; - u32 reg; + uint8_t rfcsr; + uint16_t eeprom; + uint32_t reg; /* XXX vendor driver do this only for 3070 */ rt2800_rf_init_calibration(rt2x00dev, 30); @@ -4452,7 +4452,7 @@ static void rt2800_init_rfcsr_30xx(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3290(struct rt2x00_dev *rt2x00dev) { - u8 rfcsr; + uint8_t rfcsr; rt2800_rf_init_calibration(rt2x00dev, 2); @@ -4517,7 +4517,7 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) &rt2x00dev->cap_flags); int tx1_ext_pa = test_bit(CAPABILITY_EXTERNAL_PA_TX1, &rt2x00dev->cap_flags); - u8 rfcsr; + uint8_t rfcsr; rt2800_rf_init_calibration(rt2x00dev, 30); @@ -4612,7 +4612,7 @@ static void rt2800_init_rfcsr_3352(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3390(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; rt2800_rf_init_calibration(rt2x00dev, 30); @@ -4664,8 +4664,8 @@ static void rt2800_init_rfcsr_3390(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3572(struct rt2x00_dev *rt2x00dev) { - u8 rfcsr; - u32 reg; + uint8_t rfcsr; + uint32_t reg; rt2800_rf_init_calibration(rt2x00dev, 30); @@ -4722,7 +4722,7 @@ static void rt2800_init_rfcsr_3572(struct rt2x00_dev *rt2x00dev) static void rt3593_post_bbp_init(struct rt2x00_dev *rt2x00dev) { - u8 bbp; + uint8_t bbp; bool txbf_enabled = false; /* FIXME */ bbp = rt2800_bbp_read(rt2x00dev, 105); @@ -4770,8 +4770,8 @@ static void rt3593_post_bbp_init(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3593(struct rt2x00_dev *rt2x00dev) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u32 reg; - u8 rfcsr; + uint32_t reg; + uint8_t rfcsr; /* Disable GPIO #4 and #7 function for LAN PE control */ reg = rt2800_register_read(rt2x00dev, GPIO_SWITCH); @@ -4922,7 +4922,7 @@ static void rt2800_init_rfcsr_5350(struct rt2x00_dev *rt2x00dev) static void rt2800_init_rfcsr_3883(struct rt2x00_dev *rt2x00dev) { - u8 rfcsr; + uint8_t rfcsr; /* TODO: get the actual ECO value from the SoC */ const unsigned int eco = 5; @@ -5270,7 +5270,7 @@ static void rt2800_init_rfcsr_5592(struct rt2x00_dev *rt2x00dev) static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, bool set_bw, bool is_ht40) { - u8 bbp_val; + uint8_t bbp_val; bbp_val = rt2800_bbp_read(rt2x00dev, 21); bbp_val |= 0x1; @@ -5292,7 +5292,7 @@ static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev, static int rt2800_rf_lp_config(struct rt2x00_dev *rt2x00dev, bool btxcal) { - u8 rf_val; + uint8_t rf_val; if (btxcal) rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x04); @@ -5338,7 +5338,7 @@ static int rt2800_rf_lp_config(struct rt2x00_dev *rt2x00dev, bool btxcal) static char rt2800_lp_tx_filter_bw_cal(struct rt2x00_dev *rt2x00dev) { unsigned int cnt; - u8 bbp_val; + uint8_t bbp_val; char cal_val; rt2800_bbp_dcoc_write(rt2x00dev, 0, 0x82); @@ -5365,21 +5365,21 @@ static void rt2800_bw_filter_calibration(struct rt2x00_dev *rt2x00dev, bool btxcal) { struct rt2800_drv_data *drv_data = rt2x00dev->drv_data; - u8 tx_agc_fc = 0, rx_agc_fc = 0, cmm_agc_fc; - u8 filter_target; - u8 tx_filter_target_20m = 0x09, tx_filter_target_40m = 0x02; - u8 rx_filter_target_20m = 0x27, rx_filter_target_40m = 0x31; + uint8_t tx_agc_fc = 0, rx_agc_fc = 0, cmm_agc_fc; + uint8_t filter_target; + uint8_t tx_filter_target_20m = 0x09, tx_filter_target_40m = 0x02; + uint8_t rx_filter_target_20m = 0x27, rx_filter_target_40m = 0x31; int loop = 0, is_ht40, cnt; - u8 bbp_val, rf_val; + uint8_t bbp_val, rf_val; char cal_r32_init, cal_r32_val, cal_diff; - u8 saverfb5r00, saverfb5r01, saverfb5r03, saverfb5r04, saverfb5r05; - u8 saverfb5r06, saverfb5r07; - u8 saverfb5r08, saverfb5r17, saverfb5r18, saverfb5r19, saverfb5r20; - u8 saverfb5r37, saverfb5r38, saverfb5r39, saverfb5r40, saverfb5r41; - u8 saverfb5r42, saverfb5r43, saverfb5r44, saverfb5r45, saverfb5r46; - u8 saverfb5r58, saverfb5r59; - u8 savebbp159r0, savebbp159r2, savebbpr23; - u32 MAC_RF_CONTROL0, MAC_RF_BYPASS0; + uint8_t saverfb5r00, saverfb5r01, saverfb5r03, saverfb5r04, saverfb5r05; + uint8_t saverfb5r06, saverfb5r07; + uint8_t saverfb5r08, saverfb5r17, saverfb5r18, saverfb5r19, saverfb5r20; + uint8_t saverfb5r37, saverfb5r38, saverfb5r39, saverfb5r40, saverfb5r41; + uint8_t saverfb5r42, saverfb5r43, saverfb5r44, saverfb5r45, saverfb5r46; + uint8_t saverfb5r58, saverfb5r59; + uint8_t savebbp159r0, savebbp159r2, savebbpr23; + uint32_t MAC_RF_CONTROL0, MAC_RF_BYPASS0; /* Save MAC registers */ MAC_RF_CONTROL0 = rt2800_register_read(rt2x00dev, RF_CONTROL0); @@ -5928,8 +5928,8 @@ static void rt2800_init_rfcsr(struct rt2x00_dev *rt2x00dev) } int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev) { - u32 reg; - u16 word; + uint32_t reg; + uint16_t word; /* * Initialize MAC registers. @@ -6015,7 +6015,7 @@ int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev) { } void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; rt2800_disable_wpdma(rt2x00dev); @@ -6030,8 +6030,8 @@ void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev) { int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) { - u16 word; - u8 default_lna_gain; + uint16_t word; + uint8_t default_lna_gain; int retval; /* @@ -6166,9 +6166,9 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev) int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) { - u16 value; - u16 eeprom; - u16 rf; + uint16_t value; + uint16_t eeprom; + uint16_t rf; /* * Read EEPROM word for configuration. @@ -6330,7 +6330,7 @@ int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev) } void rt2800_disable_wpdma(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; reg = rt2800_register_read(rt2x00dev, WPDMA_GLO_CFG); rt2x00_set_field32(®, WPDMA_GLO_CFG_ENABLE_TX_DMA, 0); @@ -6341,9 +6341,9 @@ void rt2800_disable_wpdma(struct rt2x00_dev *rt2x00dev) { rt2800_register_write(rt2x00dev, WPDMA_GLO_CFG, reg); } -static bool rt2800_check_firmware_crc(const u8 *data, const size_t len) { - u16 fw_crc; - u16 crc; +static bool rt2800_check_firmware_crc(const uint8_t *data, const size_t len) { + uint16_t fw_crc; + uint16_t crc; /* * The last 2 bytes in the firmware array are the crc checksum itself, @@ -6373,7 +6373,7 @@ static bool rt2800_check_firmware_crc(const u8 *data, const size_t len) { } int rt2800_check_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len) { + const uint8_t *data, const size_t len) { size_t offset = 0; size_t fw_len; bool multiple; @@ -6425,9 +6425,9 @@ int rt2800_check_firmware(struct rt2x00_dev *rt2x00dev, } int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len) { + const uint8_t *data, const size_t len) { unsigned int i; - u32 reg; + uint32_t reg; int retval; if (rt2x00_rt(rt2x00dev, RT3290)) { @@ -6508,7 +6508,7 @@ int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, void rt2800_config_filter(struct rt2x00_dev *rt2x00dev, const unsigned int filter_flags) { - u32 reg; + uint32_t reg; /* Modified to never drop packets not to me, etc */ @@ -6549,10 +6549,10 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev, { bool any_sta_nongf = !!(erp->ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); - u8 protection = erp->ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION; - u8 mm20_mode, mm40_mode, gf20_mode, gf40_mode; - u16 mm20_rate, mm40_rate, gf20_rate, gf40_rate; - u32 reg; + uint8_t protection = erp->ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION; + uint8_t mm20_mode, mm40_mode, gf20_mode, gf40_mode; + uint16_t mm20_rate, mm40_rate, gf20_rate, gf40_rate; + uint32_t reg; /* default protection rate for HT20: OFDM 24M */ mm20_rate = gf20_rate = 0x4004; @@ -6643,7 +6643,7 @@ static void rt2800_config_ht_opmode(struct rt2x00_dev *rt2x00dev, void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, struct rt2x00intf_conf *conf, const unsigned int flags) { - u32 reg; + uint32_t reg; bool update_bssid = false; if (flags & CONFIG_UPDATE_TYPE) { @@ -6686,7 +6686,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, update_bssid = true; } - if (!is_zero_ether_addr((const u8 *)conf->mac)) { + if (!is_zero_ether_addr((const uint8_t *)conf->mac)) { reg = le32_to_cpu(conf->mac[1]); rt2x00_set_field32(®, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff); conf->mac[1] = cpu_to_le32(reg); @@ -6697,7 +6697,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, } if ((flags & CONFIG_UPDATE_BSSID) || update_bssid) { - if (!is_zero_ether_addr((const u8 *)conf->bssid)) { + if (!is_zero_ether_addr((const uint8_t *)conf->bssid)) { reg = le32_to_cpu(conf->bssid[1]); rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3); rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 0); @@ -6711,8 +6711,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) { - u32 tx_pin; - u8 rfcsr; + uint32_t tx_pin; + uint8_t rfcsr; unsigned long min_sleep = 0; /* @@ -6842,9 +6842,9 @@ void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev) EXPORT_SYMBOL_GPL(rt2800_vco_calibration); void rt2800_config_erp(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_erp *erp, - u32 changed) + uint32_t changed) { - u32 reg; + uint32_t reg; if (changed & BSS_CHANGED_ERP_PREAMBLE) { reg = rt2800_register_read(rt2x00dev, AUTO_RSP_CFG); @@ -6891,7 +6891,7 @@ EXPORT_SYMBOL_GPL(rt2800_config_erp); static void rt2800_iq_calibrate(struct rt2x00_dev *rt2x00dev, int channel) { - u8 cal; + uint8_t cal; /* TX0 IQ Gain */ rt2800_bbp_write(rt2x00dev, 158, 0x2c); @@ -6978,7 +6978,7 @@ static void rt2800_iq_calibrate(struct rt2x00_dev *rt2x00dev, int channel) static void rt3883_bbp_adjust(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf) { - u8 bbp; + uint8_t bbp; bbp = (rf->channel > 14) ? 0x48 : 0x38; rt2800_bbp_write_with_rx_chain(rt2x00dev, 66, bbp); @@ -7010,9 +7010,9 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, struct rf_channel *rf, struct channel_info *info) { - u32 reg; - u32 tx_pin; - u8 bbp, rfcsr; + uint32_t reg; + uint32_t tx_pin; + uint8_t bbp, rfcsr; rt2x00_info(rt2x00dev, "Configuring channel\n"); @@ -7399,7 +7399,7 @@ static void rt2800_config_ps(struct rt2x00_dev *rt2x00dev, enum dev_state state = (libconf->conf->flags & IEEE80211_CONF_PS) ? STATE_SLEEP : STATE_AWAKE; - u32 reg; + uint32_t reg; if (state == STATE_SLEEP) { rt2800_register_write(rt2x00dev, AUTOWAKEUP_CFG, 0); @@ -7543,7 +7543,7 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev) void rt2x00link_reset_tuner(struct rt2x00_dev *rt2x00dev, bool antenna) { struct link_qual *qual = &rt2x00dev->link.qual; - u8 vgc_level = qual->vgc_level_reg; + uint8_t vgc_level = qual->vgc_level_reg; if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) return; @@ -7608,12 +7608,12 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, rt2x00dev->ops->lib->start_queue(rt2x00dev); } -static u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, +static uint16_t rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, struct ieee80211_conf *conf) { struct hw_mode_spec *spec = &rt2x00dev->spec; int center_channel; - u16 i; + uint16_t i; /* * Initialize center channel to current channel. @@ -7641,7 +7641,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, unsigned int ieee80211_flags) { struct rt2x00lib_conf libconf; - u16 hw_value; + uint16_t hw_value; rt2x00_info(rt2x00dev, "rt2x00lib_config flags %u\n", ieee80211_flags); @@ -7690,9 +7690,9 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, int rt2800_probe_rt(struct rt2x00_dev *rt2x00dev) { - u32 reg; - u32 rt; - u32 rev; + uint32_t reg; + uint32_t rt; + uint32_t rev; if (rt2x00_rt(rt2x00dev, RT3290)) reg = rt2800_register_read(rt2x00dev, MAC_CSR0_3290); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.h index 1c6e72fcc..d13693a91 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800lib.h @@ -21,58 +21,58 @@ /* RT2800 driver data structure */ struct rt2800_drv_data { - u8 calibration_bw20; - u8 calibration_bw40; + uint8_t calibration_bw20; + uint8_t calibration_bw40; char rx_calibration_bw20; char rx_calibration_bw40; char tx_calibration_bw20; char tx_calibration_bw40; - u8 bbp25; - u8 bbp26; - u8 txmixer_gain_24g; - u8 txmixer_gain_5g; - u8 max_psdu; + uint8_t bbp25; + uint8_t bbp26; + uint8_t txmixer_gain_24g; + uint8_t txmixer_gain_5g; + uint8_t max_psdu; unsigned int tbtt_tick; unsigned int ampdu_factor_cnt[4]; }; struct rt2800_ops { - u32 (*register_read)(struct rt2x00_dev *rt2x00dev, + uint32_t (*register_read)(struct rt2x00_dev *rt2x00dev, const unsigned int offset); - u32 (*register_read_lock)(struct rt2x00_dev *rt2x00dev, + uint32_t (*register_read_lock)(struct rt2x00_dev *rt2x00dev, const unsigned int offset); void (*register_write)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, u32 value); + const unsigned int offset, uint32_t value); void (*register_write_lock)(struct rt2x00_dev *rt2x00dev, - const unsigned int offset, u32 value); + const unsigned int offset, uint32_t value); void (*register_multiread)(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - void *value, const u32 length); + void *value, const uint32_t length); void (*register_multiwrite)(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - const void *value, const u32 length); + const void *value, const uint32_t length); int (*regbusy_read)(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - const struct rt2x00_field32 field, u32 *reg); + const struct rt2x00_field32 field, uint32_t *reg); int (*read_eeprom)(struct rt2x00_dev *rt2x00dev); bool (*hwcrypt_disabled)(struct rt2x00_dev *rt2x00dev); int (*drv_write_firmware)(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len); + const uint8_t *data, const size_t len); int (*drv_init_registers)(struct rt2x00_dev *rt2x00dev); }; -static inline u32 rt2800_register_read(struct rt2x00_dev *rt2x00dev, +static inline uint32_t rt2800_register_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; return rt2800ops->register_read(rt2x00dev, offset); } -static inline u32 rt2800_register_read_lock(struct rt2x00_dev *rt2x00dev, +static inline uint32_t rt2800_register_read_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; @@ -81,7 +81,7 @@ static inline u32 rt2800_register_read_lock(struct rt2x00_dev *rt2x00dev, static inline void rt2800_register_write(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - u32 value) { + uint32_t value) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; rt2800ops->register_write(rt2x00dev, offset, value); @@ -89,7 +89,7 @@ static inline void rt2800_register_write(struct rt2x00_dev *rt2x00dev, static inline void rt2800_register_write_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - u32 value) { + uint32_t value) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; rt2800ops->register_write_lock(rt2x00dev, offset, value); @@ -97,7 +97,7 @@ static inline void rt2800_register_write_lock(struct rt2x00_dev *rt2x00dev, static inline void rt2800_register_multiread(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - void *value, const u32 length) { + void *value, const uint32_t length) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; rt2800ops->register_multiread(rt2x00dev, offset, value, length); @@ -106,7 +106,7 @@ static inline void rt2800_register_multiread(struct rt2x00_dev *rt2x00dev, static inline void rt2800_register_multiwrite(struct rt2x00_dev *rt2x00dev, const unsigned int offset, const void *value, - const u32 length) { + const uint32_t length) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; rt2800ops->register_multiwrite(rt2x00dev, offset, value, length); @@ -115,7 +115,7 @@ static inline void rt2800_register_multiwrite(struct rt2x00_dev *rt2x00dev, static inline int rt2800_regbusy_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset, const struct rt2x00_field32 field, - u32 *reg) { + uint32_t *reg) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; return rt2800ops->regbusy_read(rt2x00dev, offset, field, reg); @@ -134,7 +134,7 @@ static inline bool rt2800_hwcrypt_disabled(struct rt2x00_dev *rt2x00dev) { } static inline int rt2800_drv_write_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len) { + const uint8_t *data, const size_t len) { const struct rt2800_ops *rt2800ops = (const struct rt2800_ops *) rt2x00dev->ops->drv; return rt2800ops->drv_write_firmware(rt2x00dev, data, len); @@ -169,11 +169,11 @@ void rt2800_config(struct rt2x00_dev *rt2x00dev, void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, struct rt2x00intf_conf *conf, const unsigned int flags); void rt2800_config_erp(struct rt2x00_dev *rt2x00dev, struct rt2x00lib_erp *erp, - u32 changed); + uint32_t changed); void rt2800_link_stats(struct rt2x00_dev *rt2x00dev, struct link_qual *qual); void rt2800_reset_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual); void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, - const u32 count); + const uint32_t count); void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev); void rt2800_vco_calibration(struct rt2x00_dev *rt2x00dev); @@ -183,16 +183,16 @@ void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev); void rt2800_disable_wpdma(struct rt2x00_dev *rt2x00dev); void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, - const u8 command, const u8 token, - const u8 arg0, const u8 arg1); + const uint8_t command, const uint8_t token, + const uint8_t arg0, const uint8_t arg1); int rt2800_wait_csr_ready(struct rt2x00_dev *rt2x00dev); int rt2800_wait_wpdma_ready(struct rt2x00_dev *rt2x00dev); int rt2800_check_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len); + const uint8_t *data, const size_t len); int rt2800_load_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len); + const uint8_t *data, const size_t len); int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev); int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c index 286f0b828..671ff66be 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c @@ -520,7 +520,7 @@ static const struct usb_device_id rt2800usb_device_table[] = { */ int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) { __le32 *reg; - u32 fw_mode; + uint32_t fw_mode; int ret; reg = (__le32 *) malloc(sizeof(__le32)); @@ -554,10 +554,10 @@ static char *rt2800usb_get_firmware_name(struct rt2x00_dev *rt2x00dev) { } static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len) { + const uint8_t *data, const size_t len) { int status; - u32 offset; - u32 length; + uint32_t offset; + uint32_t length; int retval; /* @@ -617,7 +617,7 @@ static int rt2800usb_write_firmware(struct rt2x00_dev *rt2x00dev, */ static void rt2800usb_start_queue(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; rt2x00_info(rt2x00dev, "Starting RX queue\n"); @@ -632,7 +632,7 @@ static void rt2800usb_start_queue(struct rt2x00_dev *rt2x00dev) */ static void rt2800usb_stop_queue(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; rt2x00_info(rt2x00dev, "Stopping RX queue\n"); @@ -645,7 +645,7 @@ static void rt2800usb_stop_queue(struct rt2x00_dev *rt2x00dev) * Device state switch handlers. */ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev) { - u32 reg; + uint32_t reg; rt2x00_info(rt2x00dev, "rt2800usb_init_registers\n"); @@ -672,7 +672,7 @@ static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev) { } static int rt2800usb_enable_radio(struct rt2x00_dev *rt2x00dev) { - u32 reg = 0; + uint32_t reg = 0; if (unlikely(rt2800_wait_wpdma_ready(rt2x00dev))) return -EIO; @@ -912,7 +912,7 @@ static void *rt2800_eeprom_addr(struct rt2x00_dev *rt2x00dev, } #endif -static u16 rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, +static uint16_t rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, const enum rt2800_eeprom_word word) { unsigned int index; @@ -923,7 +923,7 @@ static u16 rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, #if 0 static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev, - const enum rt2800_eeprom_word word, u16 data) + const enum rt2800_eeprom_word word, uint16_t data) { unsigned int index; @@ -931,7 +931,7 @@ static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev, rt2x00_eeprom_write(rt2x00dev, index, data); } -static u16 rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, +static uint16_t rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, const enum rt2800_eeprom_word array, unsigned int offset) { @@ -1046,7 +1046,7 @@ static void rt2x00lib_channel(struct ieee80211_channel *entry, } static void rt2x00lib_rate(struct ieee80211_rate *entry, - const u16 index, const struct rt2x00_rate *rate) + const uint16_t index, const struct rt2x00_rate *rate) { entry->flags = 0; entry->bitrate = rate->bitrate; @@ -1510,7 +1510,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) struct hw_mode_spec *spec = &rt2x00dev->spec; struct channel_info *info; unsigned int tx_chains, rx_chains; - u32 reg; + uint32_t reg; /* * Gutted for userspace mode @@ -1869,7 +1869,7 @@ void rt2800_get_txwi_rxwi_size(struct rt2x00_dev *rt2x00dev, * @desc: Base descriptor address * @word: Word index from where the descriptor should be read. */ -static inline __le32 _rt2x00_desc_read(__le32 *desc, const u8 word) +static inline __le32 _rt2x00_desc_read(__le32 *desc, const uint8_t word) { return desc[word]; } @@ -1880,20 +1880,20 @@ static inline __le32 _rt2x00_desc_read(__le32 *desc, const u8 word) * @desc: Base descriptor address * @word: Word index from where the descriptor should be read. */ -static inline u32 rt2x00_desc_read(__le32 *desc, const u8 word) +static inline uint32_t rt2x00_desc_read(__le32 *desc, const uint8_t word) { return le32_to_cpu(_rt2x00_desc_read(desc, word)); } -static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, u32 rxwi_w2) +static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, uint32_t rxwi_w2) { - s8 rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); - s8 rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); - s8 rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); - u16 eeprom; - u8 offset0; - u8 offset1; - u8 offset2; + int8_t rssi0 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI0); + int8_t rssi1 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI1); + int8_t rssi2 = rt2x00_get_field32(rxwi_w2, RXWI_W2_RSSI2); + uint16_t eeprom; + uint8_t offset0; + uint8_t offset1; + uint8_t offset2; if (rt2x00dev->curr_band == NL80211_BAND_2GHZ) { eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_RSSI_BG); @@ -1957,7 +1957,7 @@ void rt2800usb_libusb_transfer_fn(struct libusb_transfer *transfer) { __le32 *rxi = (__le32 *) workbuf; __le32 *rxd; - u32 word; + uint32_t word; unsigned int rx_pkt_len; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h index 7e8d3ad45..c112bd410 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h @@ -160,7 +160,7 @@ enum rt2x00_chip_intf { * The chipset combination is important for determining device capabilities. */ struct rt2x00_chip { - u16 rt; + uint16_t rt; #define RT2460 0x2460 #define RT2560 0x2560 #define RT2570 0x2570 @@ -184,8 +184,8 @@ struct rt2x00_chip { #define RT5592 0x5592 #define RT6352 0x6352 /* WSOC 2.4GHz */ - u16 rf; - u16 rev; + uint16_t rf; + uint16_t rev; enum rt2x00_chip_intf intf; }; @@ -195,10 +195,10 @@ struct rt2x00_chip { */ struct rf_channel { int channel; - u32 rf1; - u32 rf2; - u32 rf3; - u32 rf4; + uint32_t rf1; + uint32_t rf2; + uint32_t rf3; + uint32_t rf4; }; /* @@ -220,8 +220,8 @@ struct channel_info { struct antenna_setup { enum antenna rx; enum antenna tx; - u8 rx_chain_num; - u8 tx_chain_num; + uint8_t rx_chain_num; + uint8_t tx_chain_num; }; /* @@ -252,8 +252,8 @@ struct link_qual { * number of BBP register reads to reduce register access * overhead. For this reason we store both values here. */ - u8 vgc_level; - u8 vgc_level_reg; + uint8_t vgc_level; + uint8_t vgc_level_reg; /* * Statistics required for Signal quality calculation. @@ -355,13 +355,13 @@ struct rt2x00lib_crypto { enum cipher cipher; enum set_key_cmd cmd; - const u8 *address; + const uint8_t *address; - u32 bssidx; + uint32_t bssidx; - u8 key[16]; - u8 tx_mic[8]; - u8 rx_mic[8]; + uint8_t key[16]; + uint8_t tx_mic[8]; + uint8_t rx_mic[8]; int wcid; }; @@ -404,7 +404,7 @@ struct rt2x00lib_erp { int short_preamble; int cts_protection; - u32 basic_rates; + uint32_t basic_rates; int slot_time; @@ -413,8 +413,8 @@ struct rt2x00lib_erp { short difs; short eifs; - u16 beacon_int; - u16 ht_opmode; + uint16_t beacon_int; + uint16_t ht_opmode; }; DECLARE_EWMA(rssi, 10, 8) @@ -464,7 +464,7 @@ struct link { * The number of times the link has been tuned * since the radio has been switched on. */ - u32 count; + uint32_t count; /* * Quality measurement values. @@ -585,7 +585,7 @@ struct rt2x00_dev { * This field should be accessed by using * rt2x00_rf_read() and rt2x00_rf_write(). */ - u32 *rf; + uint32_t *rf; /* * Last set channel data @@ -613,27 +613,27 @@ struct rt2x00_dev { /* * Current TX power value. */ - u16 tx_power; + uint16_t tx_power; /* * Rssi <-> Dbm offset */ - u8 rssi_offset; + uint8_t rssi_offset; /* * Frequency offset. */ - u8 freq_offset; + uint8_t freq_offset; /* * LED reg cache */ - u16 led_mcu_reg; + uint16_t led_mcu_reg; /* * MAC address */ - u8 *mac; + uint8_t *mac; /* * station count (should just be 1) @@ -687,9 +687,9 @@ struct rt2x00lib_ops { int (*probe_hw) (struct rt2x00_dev *rt2x00dev); char *(*get_firmware_name) (struct rt2x00_dev *rt2x00dev); int (*check_firmware) (struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len); + const uint8_t *data, const size_t len); int (*load_firmware) (struct rt2x00_dev *rt2x00dev, - const u8 *data, const size_t len); + const uint8_t *data, const size_t len); /* * Device initialization/deinitialization handlers. @@ -715,7 +715,7 @@ struct rt2x00lib_ops { void (*reset_tuner) (struct rt2x00_dev *rt2x00dev, struct link_qual *qual); void (*link_tuner) (struct rt2x00_dev *rt2x00dev, - struct link_qual *qual, const u32 count); + struct link_qual *qual, const uint32_t count); void (*gain_calibration) (struct rt2x00_dev *rt2x00dev); void (*vco_calibration) (struct rt2x00_dev *rt2x00dev); @@ -746,7 +746,7 @@ struct rt2x00lib_ops { void (*config_erp) (struct rt2x00_dev *rt2x00dev, struct rt2x00lib_erp *erp, - u32 changed); + uint32_t changed); void (*config_ant) (struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant); void (*config) (struct rt2x00_dev *rt2x00dev, @@ -796,7 +796,7 @@ struct rt2x00_ops { * Chipset handlers */ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, - const u16 rt, const u16 rf, const u16 rev) { + const uint16_t rt, const uint16_t rf, const uint16_t rev) { rt2x00dev->chip.rt = rt; rt2x00dev->chip.rf = rf; rt2x00dev->chip.rev = rev; @@ -807,7 +807,7 @@ static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev, } static inline void rt2x00_set_rt(struct rt2x00_dev *rt2x00dev, - const u16 rt, const u16 rev) { + const uint16_t rt, const uint16_t rev) { rt2x00dev->chip.rt = rt; rt2x00dev->chip.rev = rev; @@ -815,37 +815,37 @@ static inline void rt2x00_set_rt(struct rt2x00_dev *rt2x00dev, rt2x00dev->chip.rt, rt2x00dev->chip.rev); } -static inline void rt2x00_set_rf(struct rt2x00_dev *rt2x00dev, const u16 rf) { +static inline void rt2x00_set_rf(struct rt2x00_dev *rt2x00dev, const uint16_t rf) { rt2x00dev->chip.rf = rf; rt2x00_info(rt2x00dev, "RF chipset %04x detected\n", rt2x00dev->chip.rf); } -static inline bool rt2x00_rt(struct rt2x00_dev *rt2x00dev, const u16 rt) { +static inline bool rt2x00_rt(struct rt2x00_dev *rt2x00dev, const uint16_t rt) { return (rt2x00dev->chip.rt == rt); } -static inline bool rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf) { +static inline bool rt2x00_rf(struct rt2x00_dev *rt2x00dev, const uint16_t rf) { return (rt2x00dev->chip.rf == rf); } -static inline u16 rt2x00_rev(struct rt2x00_dev *rt2x00dev) { +static inline uint16_t rt2x00_rev(struct rt2x00_dev *rt2x00dev) { return rt2x00dev->chip.rev; } static inline bool rt2x00_rt_rev(struct rt2x00_dev *rt2x00dev, - const u16 rt, const u16 rev) { + const uint16_t rt, const uint16_t rev) { return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) == rev); } static inline bool rt2x00_rt_rev_lt(struct rt2x00_dev *rt2x00dev, - const u16 rt, const u16 rev) { + const uint16_t rt, const uint16_t rev) { return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) < rev); } static inline bool rt2x00_rt_rev_gte(struct rt2x00_dev *rt2x00dev, - const u16 rt, const u16 rev) { + const uint16_t rt, const uint16_t rev) { return (rt2x00_rt(rt2x00dev, rt) && rt2x00_rev(rt2x00dev) >= rev); } @@ -971,36 +971,36 @@ static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev, return (void *)&rt2x00dev->eeprom[word]; } -static inline u16 rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev, +static inline uint16_t rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) { return le16_to_cpu(rt2x00dev->eeprom[word]); } static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev, - const unsigned int word, u16 data) { + const unsigned int word, uint16_t data) { rt2x00dev->eeprom[word] = cpu_to_le16(data); } -static inline u8 rt2x00_eeprom_byte(struct rt2x00_dev *rt2x00dev, +static inline uint8_t rt2x00_eeprom_byte(struct rt2x00_dev *rt2x00dev, const unsigned int byte) { - return *(((u8 *)rt2x00dev->eeprom) + byte); + return *(((uint8_t *)rt2x00dev->eeprom) + byte); } /* * Generic RF access. * The RF is being accessed by word index. */ -static inline u32 rt2x00_rf_read(struct rt2x00_dev *rt2x00dev, +static inline uint32_t rt2x00_rf_read(struct rt2x00_dev *rt2x00dev, const unsigned int word) { - BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(u32)); + BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(uint32_t)); return rt2x00dev->rf[word - 1]; } static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev, - const unsigned int word, u32 data) + const unsigned int word, uint32_t data) { - BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(u32)); + BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(uint32_t)); rt2x00dev->rf[word - 1] = data; } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00lib.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00lib.h index 67e11bacd..7da37aeef 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00lib.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00lib.h @@ -39,7 +39,7 @@ struct rt2x00_rate { extern const struct rt2x00_rate rt2x00_supported_rates[12]; -static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) +static inline const struct rt2x00_rate *rt2x00_get_rate(const uint16_t hw_value) { return &rt2x00_supported_rates[hw_value & 0xff]; } @@ -47,7 +47,7 @@ static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) #define RATE_MCS(__mode, __mcs) \ ((((__mode) & 0x00ff) << 8) | ((__mcs) & 0x00ff)) -static inline int rt2x00_get_rate_mcs(const u16 mcs_value) +static inline int rt2x00_get_rate_mcs(const uint16_t mcs_value) { return (mcs_value & 0x00ff); } @@ -66,11 +66,11 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, enum nl80211_iftype type, - const u8 *mac, const u8 *bssid); + const uint8_t *mac, const uint8_t *bssid); void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, struct ieee80211_bss_conf *conf, - u32 changed); + uint32_t changed); void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, struct antenna_setup ant); void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00mac.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00mac.c index 057c99cbb..49fa63bfe 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00mac.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00mac.c @@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(rt2x00mac_add_interface); void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf, enum nl80211_iftype type, - const u8 *mac, const u8 *bssid) + const uint8_t *mac, const uint8_t *bssid) { /* diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h index 50e04d3e6..9ab63ed8f 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h @@ -83,12 +83,12 @@ struct rxdone_entry_desc { int size; int flags; int dev_flags; - u16 rate_mode; - u16 enc_flags; + uint16_t rate_mode; + uint16_t enc_flags; enum mac80211_rx_encoding encoding; enum rate_info_bw bw; - u8 cipher; - u8 cipher_status; + uint8_t cipher; + uint8_t cipher_status; __le32 iv[2]; __le32 icv; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00reg.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00reg.h index 3584d608b..e7cb28961 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00reg.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00reg.h @@ -149,18 +149,18 @@ enum firmware_errors { * inside the register while making sure the process remains byte order safe. */ struct rt2x00_field8 { - u8 bit_offset; - u8 bit_mask; + uint8_t bit_offset; + uint8_t bit_mask; }; struct rt2x00_field16 { - u16 bit_offset; - u16 bit_mask; + uint16_t bit_offset; + uint16_t bit_mask; }; struct rt2x00_field32 { - u32 bit_offset; - u32 bit_mask; + uint32_t bit_offset; + uint32_t bit_mask; }; /* diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c index cf63bc16d..57b0a5073 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c @@ -32,9 +32,9 @@ * Interfacing with the HW. */ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, const u16 value, - void *buffer, const u16 buffer_length, + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, const uint16_t value, + void *buffer, const uint16_t buffer_length, const int timeout) { struct libusb_device_handle *usb_dev = rt2x00dev->dev; @@ -122,13 +122,13 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, } int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, void *buffer, - const u16 buffer_length) + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, void *buffer, + const uint16_t buffer_length) { int status = 0; unsigned char *tb; - u16 off, len, bsize; + uint16_t off, len, bsize; mutex_lock(&rt2x00dev->csr_mutex); @@ -136,7 +136,7 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, off = offset; len = buffer_length; while (len && !status) { - bsize = min_t(u16, CSR_CACHE_SIZE, len); + bsize = min_t(uint16_t, CSR_CACHE_SIZE, len); status = rt2x00usb_vendor_req_buff_lock(rt2x00dev, request, requesttype, off, tb, bsize, REGISTER_TIMEOUT); @@ -158,9 +158,9 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, * Userspace buff_lock doesn't do any locking */ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, void *buffer, - const u16 buffer_length, const int timeout) + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, void *buffer, + const uint16_t buffer_length, const int timeout) { int status; @@ -191,7 +191,7 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset, const struct rt2x00_field32 field, - u32 *reg) { + uint32_t *reg) { unsigned int i; if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) @@ -214,7 +214,7 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, struct rt2x00_async_read_data { __le32 reg; struct rt2x00_dev *rt2x00dev; - bool (*callback)(struct rt2x00_dev *, int, u32); + bool (*callback)(struct rt2x00_dev *, int, uint32_t); }; /* @@ -223,7 +223,7 @@ struct rt2x00_async_read_data { */ void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - bool (*callback)(struct rt2x00_dev*, int, u32)) { + bool (*callback)(struct rt2x00_dev*, int, uint32_t)) { struct libusb_device_handle *usb_dev = rt2x00dev->dev; struct rt2x00_async_read_data *rd; int status; @@ -242,7 +242,7 @@ void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, */ do { status = libusb_control_transfer(usb_dev, USB_VENDOR_REQUEST_IN, USB_MULTI_READ, - 0, cpu_to_le16(offset), (unsigned char *) &rd->reg, cpu_to_le16(sizeof(u32)), REGISTER_TIMEOUT); + 0, cpu_to_le16(offset), (unsigned char *) &rd->reg, cpu_to_le16(sizeof(uint32_t)), REGISTER_TIMEOUT); if (rd->callback(rd->rt2x00dev, status, le32_to_cpu(rd->reg))) continue; @@ -380,7 +380,7 @@ int rt2x00usb_alloc_reg(struct rt2x00_dev *rt2x00dev) { return -ENOMEM; } - rt2x00dev->rf = (u32 *) malloc(rt2x00dev->ops->rf_size); + rt2x00dev->rf = (uint32_t *) malloc(rt2x00dev->ops->rf_size); if (!rt2x00dev->rf) { free(rt2x00dev->csr.cache); free(rt2x00dev->eeprom); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h index f25a93d0d..ba00e0327 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h @@ -62,9 +62,9 @@ enum rt2x00usb_mode_offset { * to unexpected behavior depending on the architecture. */ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, const u16 value, - void *buffer, const u16 buffer_length, + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, const uint16_t value, + void *buffer, const uint16_t buffer_length, const int timeout); /** @@ -85,9 +85,9 @@ int rt2x00usb_vendor_request(struct rt2x00_dev *rt2x00dev, * which has been allocated properly. */ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, void *buffer, - const u16 buffer_length); + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, void *buffer, + const uint16_t buffer_length); /** * rt2x00usb_vendor_request_buff - Send register command to device (buffered) @@ -103,9 +103,9 @@ int rt2x00usb_vendor_request_buff(struct rt2x00_dev *rt2x00dev, * if the usb_cache_mutex is already held. */ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, - const u8 request, const u8 requesttype, - const u16 offset, void *buffer, - const u16 buffer_length, const int timeout); + const uint8_t request, const uint8_t requesttype, + const uint16_t offset, void *buffer, + const uint16_t buffer_length, const int timeout); /** * rt2x00usb_vendor_request_sw - Send single register command to device @@ -120,9 +120,9 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, * don't have to worry about kmalloc here. */ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev, - const u8 request, - const u16 offset, - const u16 value, + const uint8_t request, + const uint16_t offset, + const uint16_t value, const int timeout) { return rt2x00usb_vendor_request(rt2x00dev, request, USB_VENDOR_REQUEST_OUT, offset, @@ -140,7 +140,7 @@ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev, * kmalloc for correct handling inside the kernel USB layer. */ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev, - __le16 *eeprom, const u16 length) { + __le16 *eeprom, const uint16_t length) { return rt2x00usb_vendor_request(rt2x00dev, USB_EEPROM_READ, USB_VENDOR_REQUEST_IN, 0, 0, eeprom, length, EEPROM_TIMEOUT); @@ -154,7 +154,7 @@ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev, * This function is a simple wrapper for 32bit register access * through rt2x00usb_vendor_request_buff(). */ -static inline u32 rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, +static inline uint32_t rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { __le32 reg = 0; rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, @@ -171,7 +171,7 @@ static inline u32 rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, * This function is a simple wrapper for 32bit register access * through rt2x00usb_vendor_req_buff_lock(). */ -static inline u32 rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, +static inline uint32_t rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { __le32 reg = 0; rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_READ, @@ -192,7 +192,7 @@ static inline u32 rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, */ static inline void rt2x00usb_register_multiread(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - void *value, const u32 length) { + void *value, const uint32_t length) { rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, USB_VENDOR_REQUEST_IN, offset, value, length); @@ -209,7 +209,7 @@ static inline void rt2x00usb_register_multiread(struct rt2x00_dev *rt2x00dev, */ static inline void rt2x00usb_register_write(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - u32 value) { + uint32_t value) { __le32 reg = cpu_to_le32(value); rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_WRITE, USB_VENDOR_REQUEST_OUT, offset, @@ -227,7 +227,7 @@ static inline void rt2x00usb_register_write(struct rt2x00_dev *rt2x00dev, */ static inline void rt2x00usb_register_write_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - u32 value) { + uint32_t value) { __le32 reg = cpu_to_le32(value); rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_WRITE, USB_VENDOR_REQUEST_OUT, offset, @@ -247,7 +247,7 @@ static inline void rt2x00usb_register_write_lock(struct rt2x00_dev *rt2x00dev, static inline void rt2x00usb_register_multiwrite(struct rt2x00_dev *rt2x00dev, const unsigned int offset, const void *value, - const u32 length) { + const uint32_t length) { rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_WRITE, USB_VENDOR_REQUEST_OUT, offset, (void *)value, length); @@ -269,7 +269,7 @@ static inline void rt2x00usb_register_multiwrite(struct rt2x00_dev *rt2x00dev, int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset, const struct rt2x00_field32 field, - u32 *reg); + uint32_t *reg); /** * rt2x00usb_register_read_async - Asynchronously read 32bit register word @@ -286,7 +286,7 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, */ void rt2x00usb_register_read_async(struct rt2x00_dev *rt2x00dev, const unsigned int offset, - bool (*callback)(struct rt2x00_dev*, int, u32)); + bool (*callback)(struct rt2x00_dev*, int, uint32_t)); int rt2x00usb_alloc_reg(struct rt2x00_dev *rt2x00dev); void rt2x00usb_free(struct rt2x00_dev *rt2x00dev); From 82e0ca25d54af40e59fe7f3e08c60ef02c8b51a3 Mon Sep 17 00:00:00 2001 From: Mike Kershaw / Dragorn Date: Fri, 29 Sep 2023 10:27:00 -0400 Subject: [PATCH] coconut: rename all types from kernel types to stdint or otherwise custom types (u8 -> uint8_t, etc. __le16 -> ___le16) to prevent conflicts on some platforms --- .../libwifiuserspace/kernel/bitops.h | 6 +- .../libwifiuserspace/kernel/cfg80211.c | 2 +- .../libwifiuserspace/kernel/etherdevice.h | 6 +- .../libwifiuserspace/kernel/ieee80211.h | 146 +++++++++--------- .../kernel/ieee80211_radiotap.h | 10 +- .../libwifiuserspace/kernel/le_byteshift.h | 10 +- .../libwifiuserspace/kernel/log2.h | 2 +- .../libwifiuserspace/kernel/mac80211.h | 8 +- .../libwifiuserspace/kernel/nl80211.h | 6 +- .../libwifiuserspace/kernel/types.h | 31 +--- .../libwifiuserspace/kernel/usb.h | 24 +-- .../libwifiuserspace/rt2800usb/rt2800.h | 10 +- .../libwifiuserspace/rt2800usb/rt2800usb.c | 20 +-- .../libwifiuserspace/rt2800usb/rt2800usb.h | 4 +- .../libwifiuserspace/rt2800usb/rt2x00.h | 6 +- .../libwifiuserspace/rt2800usb/rt2x00queue.h | 6 +- .../libwifiuserspace/rt2800usb/rt2x00usb.c | 4 +- .../libwifiuserspace/rt2800usb/rt2x00usb.h | 10 +- 18 files changed, 147 insertions(+), 164 deletions(-) diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/bitops.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/bitops.h index a5407d119..a53794f2a 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/bitops.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/bitops.h @@ -37,7 +37,7 @@ static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr) /* * Kluge swab16 */ -static inline __u16 ___swab16(__u16 x) +static inline uint64_t ___swab16(uint16_t x) { return x<<8 | x>>8; } @@ -83,9 +83,9 @@ static int __fls(unsigned int x) return r; } -static int __fls64(__u64 x) +static int __fls64(uint64_t x) { - __u32 h = x >> 32; + uint32_t h = x >> 32; if (h) return __fls(h) + 32; return __fls(x); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.c b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.c index e54ce2051..9b1ab6a55 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/cfg80211.c @@ -64,7 +64,7 @@ int ieee80211_frequency_to_channel(int freq) } EXPORT_SYMBOL(ieee80211_frequency_to_channel); -unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc) +unsigned int __attribute_const__ ieee80211_hdrlen(___le16 fc) { unsigned int hdrlen = 24; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h index b4cd4b5b3..fb9d2a5b1 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/etherdevice.h @@ -45,9 +45,9 @@ static const uint8_t eth_reserved_addr_base[ETH_ALEN] __aligned(2) = */ static inline bool is_link_local_ether_addr(const uint8_t *addr) { - __be16 *a = (__be16 *)addr; - static const __be16 *b = (const __be16 *)eth_reserved_addr_base; - __be16 m = cpu_to_be16(0xfff0); + ___be16 *a = (___be16 *)addr; + static const ___be16 *b = (const ___be16 *)eth_reserved_addr_base; + ___be16 m = cpu_to_be16(0xfff0); #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) return (((*(const uint32_t *)addr) ^ (*(const uint32_t *)b)) | diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h index 49af1cdee..bd58b5985 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211.h @@ -136,7 +136,7 @@ #define IEEE80211_NDP_FTYPE_PAGING 6 #define IEEE80211_NDP_FTYPE_PREQ 7 -#define SM64(f, v) ((((u64)v) << f##_S) & f) +#define SM64(f, v) ((((uint64_t)v) << f##_S) & f) /* NDP CMAC frame fields */ #define IEEE80211_NDP_FTYPE 0x0000000000000007 @@ -304,7 +304,7 @@ */ struct ieee80211_mcs_info { uint8_t rx_mask[IEEE80211_HT_MCS_MASK_LEN]; - __le16 rx_highest; + ___le16 rx_highest; uint8_t tx_params; uint8_t reserved[3]; } __packed; @@ -337,14 +337,14 @@ struct ieee80211_mcs_info { * described in 802.11n D5.0 7.3.2.57 */ struct ieee80211_ht_cap { - __le16 cap_info; + ___le16 cap_info; uint8_t ampdu_params_info; /* 16 bytes MCS information */ struct ieee80211_mcs_info mcs; - __le16 extended_ht_cap_info; - __le32 tx_BF_cap_info; + ___le16 extended_ht_cap_info; + ___le32 tx_BF_cap_info; uint8_t antenna_selection_info; } __packed; @@ -399,10 +399,10 @@ struct ieee80211_ht_cap { * Capability. */ struct ieee80211_vht_mcs_info { - __le16 rx_mcs_map; - __le16 rx_highest; - __le16 tx_mcs_map; - __le16 tx_highest; + ___le16 rx_mcs_map; + ___le16 rx_highest; + ___le16 tx_mcs_map; + ___le16 tx_highest; } __packed; /** @@ -457,12 +457,12 @@ enum ieee80211_he_mcs_support { * channel width 80p80MHz. */ struct ieee80211_he_mcs_nss_supp { - __le16 rx_mcs_80; - __le16 tx_mcs_80; - __le16 rx_mcs_160; - __le16 tx_mcs_160; - __le16 rx_mcs_80p80; - __le16 tx_mcs_80p80; + ___le16 rx_mcs_80; + ___le16 tx_mcs_80; + ___le16 rx_mcs_160; + ___le16 tx_mcs_160; + ___le16 rx_mcs_80p80; + ___le16 tx_mcs_80p80; } __packed; /* for operation_mode */ @@ -477,42 +477,42 @@ struct ieee80211_he_mcs_nss_supp { #define IEEE80211_HT_OP_MODE_CCFS2_MASK 0x1fe0 struct ieee80211_hdr { - __le16 frame_control; - __le16 duration_id; + ___le16 frame_control; + ___le16 duration_id; struct_group(addrs, uint8_t addr1[ETH_ALEN]; uint8_t addr2[ETH_ALEN]; uint8_t addr3[ETH_ALEN]; ); - __le16 seq_ctrl; + ___le16 seq_ctrl; uint8_t addr4[ETH_ALEN]; } __packed __aligned(2); struct ieee80211_hdr_3addr { - __le16 frame_control; - __le16 duration_id; + ___le16 frame_control; + ___le16 duration_id; uint8_t addr1[ETH_ALEN]; uint8_t addr2[ETH_ALEN]; uint8_t addr3[ETH_ALEN]; - __le16 seq_ctrl; + ___le16 seq_ctrl; } __packed __aligned(2); struct ieee80211_qos_hdr { - __le16 frame_control; - __le16 duration_id; + ___le16 frame_control; + ___le16 duration_id; uint8_t addr1[ETH_ALEN]; uint8_t addr2[ETH_ALEN]; uint8_t addr3[ETH_ALEN]; - __le16 seq_ctrl; - __le16 qos_ctrl; + ___le16 seq_ctrl; + ___le16 qos_ctrl; } __packed __aligned(2); struct ieee80211_trigger { - __le16 frame_control; - __le16 duration; + ___le16 frame_control; + ___le16 duration; uint8_t ra[ETH_ALEN]; uint8_t ta[ETH_ALEN]; - __le64 common_info; + ___le64 common_info; uint8_t variable[]; } __packed __aligned(2); @@ -520,7 +520,7 @@ struct ieee80211_trigger { * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_tods(__le16 fc) +static inline bool ieee80211_has_tods(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0; } @@ -529,7 +529,7 @@ static inline bool ieee80211_has_tods(__le16 fc) * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_fromds(__le16 fc) +static inline bool ieee80211_has_fromds(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0; } @@ -538,9 +538,9 @@ static inline bool ieee80211_has_fromds(__le16 fc) * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_a4(__le16 fc) +static inline bool ieee80211_has_a4(___le16 fc) { - __le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); + ___le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); return (fc & tmp) == tmp; } @@ -548,7 +548,7 @@ static inline bool ieee80211_has_a4(__le16 fc) * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_morefrags(__le16 fc) +static inline bool ieee80211_has_morefrags(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0; } @@ -557,7 +557,7 @@ static inline bool ieee80211_has_morefrags(__le16 fc) * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_retry(__le16 fc) +static inline bool ieee80211_has_retry(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0; } @@ -566,7 +566,7 @@ static inline bool ieee80211_has_retry(__le16 fc) * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_pm(__le16 fc) +static inline bool ieee80211_has_pm(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0; } @@ -575,7 +575,7 @@ static inline bool ieee80211_has_pm(__le16 fc) * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_moredata(__le16 fc) +static inline bool ieee80211_has_moredata(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0; } @@ -584,7 +584,7 @@ static inline bool ieee80211_has_moredata(__le16 fc) * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_protected(__le16 fc) +static inline bool ieee80211_has_protected(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0; } @@ -593,7 +593,7 @@ static inline bool ieee80211_has_protected(__le16 fc) * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_has_order(__le16 fc) +static inline bool ieee80211_has_order(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0; } @@ -602,7 +602,7 @@ static inline bool ieee80211_has_order(__le16 fc) * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_mgmt(__le16 fc) +static inline bool ieee80211_is_mgmt(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT); @@ -612,7 +612,7 @@ static inline bool ieee80211_is_mgmt(__le16 fc) * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_ctl(__le16 fc) +static inline bool ieee80211_is_ctl(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL); @@ -622,7 +622,7 @@ static inline bool ieee80211_is_ctl(__le16 fc) * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_data(__le16 fc) +static inline bool ieee80211_is_data(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == cpu_to_le16(IEEE80211_FTYPE_DATA); @@ -632,7 +632,7 @@ static inline bool ieee80211_is_data(__le16 fc) * ieee80211_is_ext - check if type is IEEE80211_FTYPE_EXT * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_ext(__le16 fc) +static inline bool ieee80211_is_ext(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == cpu_to_le16(IEEE80211_FTYPE_EXT); @@ -643,7 +643,7 @@ static inline bool ieee80211_is_ext(__le16 fc) * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_data_qos(__le16 fc) +static inline bool ieee80211_is_data_qos(___le16 fc) { /* * mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need @@ -657,7 +657,7 @@ static inline bool ieee80211_is_data_qos(__le16 fc) * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_data_present(__le16 fc) +static inline bool ieee80211_is_data_present(___le16 fc) { /* * mask with 0x40 and test that that bit is clear to only return true @@ -671,7 +671,7 @@ static inline bool ieee80211_is_data_present(__le16 fc) * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_assoc_req(__le16 fc) +static inline bool ieee80211_is_assoc_req(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ); @@ -681,7 +681,7 @@ static inline bool ieee80211_is_assoc_req(__le16 fc) * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_assoc_resp(__le16 fc) +static inline bool ieee80211_is_assoc_resp(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP); @@ -691,7 +691,7 @@ static inline bool ieee80211_is_assoc_resp(__le16 fc) * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_reassoc_req(__le16 fc) +static inline bool ieee80211_is_reassoc_req(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ); @@ -701,7 +701,7 @@ static inline bool ieee80211_is_reassoc_req(__le16 fc) * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_reassoc_resp(__le16 fc) +static inline bool ieee80211_is_reassoc_resp(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP); @@ -711,7 +711,7 @@ static inline bool ieee80211_is_reassoc_resp(__le16 fc) * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_probe_req(__le16 fc) +static inline bool ieee80211_is_probe_req(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ); @@ -721,7 +721,7 @@ static inline bool ieee80211_is_probe_req(__le16 fc) * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_probe_resp(__le16 fc) +static inline bool ieee80211_is_probe_resp(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); @@ -731,7 +731,7 @@ static inline bool ieee80211_is_probe_resp(__le16 fc) * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_beacon(__le16 fc) +static inline bool ieee80211_is_beacon(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); @@ -742,7 +742,7 @@ static inline bool ieee80211_is_beacon(__le16 fc) * IEEE80211_STYPE_S1G_BEACON * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_s1g_beacon(__le16 fc) +static inline bool ieee80211_is_s1g_beacon(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == @@ -754,7 +754,7 @@ static inline bool ieee80211_is_s1g_beacon(__le16 fc) * IEEE80211_STYPE_S1G_BEACON && IEEE80211_S1G_BCN_NEXT_TBTT * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_next_tbtt_present(__le16 fc) +static inline bool ieee80211_next_tbtt_present(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_EXT | IEEE80211_STYPE_S1G_BEACON) && @@ -766,7 +766,7 @@ static inline bool ieee80211_next_tbtt_present(__le16 fc) * true for S1G beacons when they're short. * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_s1g_short_beacon(__le16 fc) +static inline bool ieee80211_is_s1g_short_beacon(___le16 fc) { return ieee80211_is_s1g_beacon(fc) && ieee80211_next_tbtt_present(fc); } @@ -775,7 +775,7 @@ static inline bool ieee80211_is_s1g_short_beacon(__le16 fc) * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_atim(__le16 fc) +static inline bool ieee80211_is_atim(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM); @@ -785,7 +785,7 @@ static inline bool ieee80211_is_atim(__le16 fc) * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_disassoc(__le16 fc) +static inline bool ieee80211_is_disassoc(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC); @@ -795,7 +795,7 @@ static inline bool ieee80211_is_disassoc(__le16 fc) * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_auth(__le16 fc) +static inline bool ieee80211_is_auth(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); @@ -805,7 +805,7 @@ static inline bool ieee80211_is_auth(__le16 fc) * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_deauth(__le16 fc) +static inline bool ieee80211_is_deauth(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); @@ -815,7 +815,7 @@ static inline bool ieee80211_is_deauth(__le16 fc) * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_action(__le16 fc) +static inline bool ieee80211_is_action(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); @@ -825,7 +825,7 @@ static inline bool ieee80211_is_action(__le16 fc) * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_back_req(__le16 fc) +static inline bool ieee80211_is_back_req(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ); @@ -835,7 +835,7 @@ static inline bool ieee80211_is_back_req(__le16 fc) * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_back(__le16 fc) +static inline bool ieee80211_is_back(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK); @@ -845,7 +845,7 @@ static inline bool ieee80211_is_back(__le16 fc) * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_pspoll(__le16 fc) +static inline bool ieee80211_is_pspoll(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); @@ -855,7 +855,7 @@ static inline bool ieee80211_is_pspoll(__le16 fc) * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_rts(__le16 fc) +static inline bool ieee80211_is_rts(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); @@ -865,7 +865,7 @@ static inline bool ieee80211_is_rts(__le16 fc) * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_cts(__le16 fc) +static inline bool ieee80211_is_cts(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); @@ -875,7 +875,7 @@ static inline bool ieee80211_is_cts(__le16 fc) * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_ack(__le16 fc) +static inline bool ieee80211_is_ack(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK); @@ -885,7 +885,7 @@ static inline bool ieee80211_is_ack(__le16 fc) * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_cfend(__le16 fc) +static inline bool ieee80211_is_cfend(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND); @@ -895,7 +895,7 @@ static inline bool ieee80211_is_cfend(__le16 fc) * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_cfendack(__le16 fc) +static inline bool ieee80211_is_cfendack(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK); @@ -905,7 +905,7 @@ static inline bool ieee80211_is_cfendack(__le16 fc) * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_nullfunc(__le16 fc) +static inline bool ieee80211_is_nullfunc(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); @@ -915,7 +915,7 @@ static inline bool ieee80211_is_nullfunc(__le16 fc) * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_qos_nullfunc(__le16 fc) +static inline bool ieee80211_is_qos_nullfunc(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); @@ -925,7 +925,7 @@ static inline bool ieee80211_is_qos_nullfunc(__le16 fc) * ieee80211_is_trigger - check if frame is trigger frame * @fc: frame control field in little-endian byteorder */ -static inline bool ieee80211_is_trigger(__le16 fc) +static inline bool ieee80211_is_trigger(___le16 fc) { return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_TRIGGER); @@ -935,7 +935,7 @@ static inline bool ieee80211_is_trigger(__le16 fc) * ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame * @fc: frame control bytes in little-endian byteorder */ -static inline bool ieee80211_is_any_nullfunc(__le16 fc) +static inline bool ieee80211_is_any_nullfunc(___le16 fc) { return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); } @@ -944,7 +944,7 @@ static inline bool ieee80211_is_any_nullfunc(__le16 fc) * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU * @fc: frame control field in little-endian byteorder */ -static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc) +static inline bool ieee80211_is_bufferable_mmpdu(___le16 fc) { /* IEEE 802.11-2012, definition of "bufferable management frame"; * note that this ignores the IBSS special case. */ @@ -958,7 +958,7 @@ static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc) * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set * @seq_ctrl: frame sequence control bytes in little-endian byteorder */ -static inline bool ieee80211_is_first_frag(__le16 seq_ctrl) +static inline bool ieee80211_is_first_frag(___le16 seq_ctrl) { return (seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0; } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h index 63c021962..2234d2219 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/ieee80211_radiotap.h @@ -38,12 +38,12 @@ struct ieee80211_radiotap_header { /** * @it_len: overall radiotap header length */ - __le16 it_len; + ___le16 it_len; /** * @it_present: (first) present word */ - __le32 it_present; + ___le32 it_present; } __packed; /* version is always 0 */ @@ -210,7 +210,7 @@ enum ieee80211_radiotap_timestamp_flags { }; struct ieee80211_radiotap_he { - __le16 data1, data2, data3, data4, data5, data6; + ___le16 data1, data2, data3, data4, data5, data6; }; enum ieee80211_radiotap_he_bits { @@ -304,7 +304,7 @@ enum ieee80211_radiotap_he_bits { }; struct ieee80211_radiotap_he_mu { - __le16 flags1, flags2; + ___le16 flags1, flags2; uint8_t ru_ch1[4]; uint8_t ru_ch2[4]; }; @@ -346,7 +346,7 @@ enum ieee80211_radiotap_lsig_data2 { }; struct ieee80211_radiotap_lsig { - __le16 data1, data2; + ___le16 data1, data2; }; enum ieee80211_radiotap_zero_len_psdu_type { diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h index 2d2a2a684..8d799daaf 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/le_byteshift.h @@ -19,9 +19,9 @@ static inline uint32_t __get_unaligned_le32(const uint8_t *p) return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24; } -static inline u64 __get_unaligned_le64(const uint8_t *p) +static inline uint64_t __get_unaligned_le64(const uint8_t *p) { - return (u64)__get_unaligned_le32(p + 4) << 32 | + return (uint64_t)__get_unaligned_le32(p + 4) << 32 | __get_unaligned_le32(p); } @@ -37,7 +37,7 @@ static inline void __put_unaligned_le32(uint32_t val, uint8_t *p) __put_unaligned_le16(val, p); } -static inline void __put_unaligned_le64(u64 val, uint8_t *p) +static inline void __put_unaligned_le64(uint64_t val, uint8_t *p) { __put_unaligned_le32(val >> 32, p + 4); __put_unaligned_le32(val, p); @@ -53,7 +53,7 @@ static inline uint32_t get_unaligned_le32(const void *p) return __get_unaligned_le32((const uint8_t *)p); } -static inline u64 get_unaligned_le64(const void *p) +static inline uint64_t get_unaligned_le64(const void *p) { return __get_unaligned_le64((const uint8_t *)p); } @@ -68,7 +68,7 @@ static inline void put_unaligned_le32(uint32_t val, void *p) __put_unaligned_le32(val, (uint8_t *) p); } -static inline void put_unaligned_le64(u64 val, void *p) +static inline void put_unaligned_le64(uint64_t val, void *p) { __put_unaligned_le64(val, (uint8_t *) p); } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h index c0a770d7a..19a679c47 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/log2.h @@ -31,7 +31,7 @@ int __ilog2_u32(uint32_t n) #ifndef CONFIG_ARCH_HAS_ILOG2_U64 static inline const -int __ilog2_u64(u64 n) +int __ilog2_u64(uint64_t n) { return __fls64(n) - 1; } diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h index 021d97a1e..3578621b3 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/mac80211.h @@ -861,7 +861,7 @@ struct ieee80211_bss_conf { uint8_t dtim_period; uint16_t beacon_int; uint16_t assoc_capability; - u64 sync_tsf; + uint64_t sync_tsf; uint32_t sync_device_ts; uint8_t sync_dtim_count; uint32_t basic_rates; @@ -874,7 +874,7 @@ struct ieee80211_bss_conf { int32_t cqm_rssi_high; struct cfg80211_chan_def chandef; struct ieee80211_mu_group_data mu_group; - __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; + ___be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; int arp_addr_cnt; bool qos; bool idle; @@ -1312,8 +1312,8 @@ enum mac80211_rx_encoding { * @zero_length_psdu_type: radiotap type of the 0-length PSDU */ struct ieee80211_rx_status { - u64 mactime; - u64 boottime_ns; + uint64_t mactime; + uint64_t boottime_ns; uint32_t device_timestamp; uint32_t ampdu_reference; uint32_t flag; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h index 9206771e8..7a6c5a209 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/nl80211.h @@ -165,9 +165,9 @@ enum nl80211_iftype { struct ieee80211_p2p_noa_desc { uint8_t count; - __le32 duration; - __le32 interval; - __le32 start_time; + ___le32 duration; + ___le32 interval; + ___le32 start_time; } __packed; struct ieee80211_p2p_noa_attr { diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h index ecfa97583..17d30a64e 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/types.h @@ -10,23 +10,6 @@ #include -typedef uint8_t uint8_t; -typedef uint16_t uint16_t; -typedef uint32_t uint32_t; -typedef uint64_t u64; - -typedef int8_t int8_t; -typedef int16_t int16_t; -typedef int32_t int32_t; -typedef int64_t s64; - -#ifndef LIBWIFIUSERSPACE_EXCLUDE_TYPES -typedef uint8_t __u8; -typedef uint16_t __u16; -typedef uint32_t __u32; -typedef uint64_t __u64; -#endif - /* * We lose the atomic stuff */ @@ -37,18 +20,18 @@ typedef int64_t atomic_t; * We lose the automagic endian checking and have to make sure * we do it ourselves properly. */ -typedef __u16 __le16; -typedef __u32 __le32; -typedef __u64 __le64; +typedef uint16_t ___le16; +typedef uint32_t ___le32; +typedef uint64_t ___le64; -typedef __u16 __be16; -typedef __u32 __be32; -typedef __u64 __be64; +typedef uint16_t ___be16; +typedef uint32_t ___be32; +typedef uint64_t ___be64; /* * Not going to make a whole netdev defs file for one def */ -typedef u64 netdev_features_t; +typedef uint64_t netdev_features_t; #endif /* ifndef TYPES_H */ diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/usb.h b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/usb.h index 27ecfd7ec..3eb4407cb 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/kernel/usb.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/kernel/usb.h @@ -89,26 +89,26 @@ */ struct usb_device_id { /* which fields to match against? */ - __u16 match_flags; + uint16_t match_flags; /* Used for product specific matches; range is inclusive */ - __u16 idVendor; - __u16 idProduct; - __u16 bcdDevice_lo; - __u16 bcdDevice_hi; + uint16_t idVendor; + uint16_t idProduct; + uint16_t bcdDevice_lo; + uint16_t bcdDevice_hi; /* Used for device class matches */ - __u8 bDeviceClass; - __u8 bDeviceSubClass; - __u8 bDeviceProtocol; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; /* Used for interface class matches */ - __u8 bInterfaceClass; - __u8 bInterfaceSubClass; - __u8 bInterfaceProtocol; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; /* Used for vendor-specific interface matches */ - __u8 bInterfaceNumber; + uint8_t bInterfaceNumber; }; /* Some useful macros to use to create struct usb_device_id */ diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h index cc862e0de..8d4ada9bc 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800.h @@ -3022,12 +3022,12 @@ enum rt2800_eeprom_word { * DMA descriptor defines. */ -#define TXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) -#define TXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32)) +#define TXWI_DESC_SIZE_4WORDS (4 * sizeof(___le32)) +#define TXWI_DESC_SIZE_5WORDS (5 * sizeof(___le32)) -#define RXWI_DESC_SIZE_4WORDS (4 * sizeof(__le32)) -#define RXWI_DESC_SIZE_5WORDS (5 * sizeof(__le32)) -#define RXWI_DESC_SIZE_6WORDS (6 * sizeof(__le32)) +#define RXWI_DESC_SIZE_4WORDS (4 * sizeof(___le32)) +#define RXWI_DESC_SIZE_5WORDS (5 * sizeof(___le32)) +#define RXWI_DESC_SIZE_6WORDS (6 * sizeof(___le32)) /* * TX WI structure diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c index 671ff66be..ec31392dc 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.c @@ -519,11 +519,11 @@ static const struct usb_device_id rt2800usb_device_table[] = { * Firmware functions */ int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) { - __le32 *reg; + ___le32 *reg; uint32_t fw_mode; int ret; - reg = (__le32 *) malloc(sizeof(__le32)); + reg = (___le32 *) malloc(sizeof(___le32)); if (reg == NULL) return -ENOMEM; @@ -534,7 +534,7 @@ int rt2800usb_autorun_detect(struct rt2x00_dev *rt2x00dev) { */ ret = rt2x00usb_vendor_request(rt2x00dev, USB_DEVICE_MODE, USB_VENDOR_REQUEST_IN, 0, - USB_MODE_AUTORUN, reg, sizeof(__le32), + USB_MODE_AUTORUN, reg, sizeof(___le32), REGISTER_TIMEOUT_FIRMWARE); fw_mode = le32_to_cpu(*reg); @@ -1869,7 +1869,7 @@ void rt2800_get_txwi_rxwi_size(struct rt2x00_dev *rt2x00dev, * @desc: Base descriptor address * @word: Word index from where the descriptor should be read. */ -static inline __le32 _rt2x00_desc_read(__le32 *desc, const uint8_t word) +static inline ___le32 _rt2x00_desc_read(___le32 *desc, const uint8_t word) { return desc[word]; } @@ -1880,7 +1880,7 @@ static inline __le32 _rt2x00_desc_read(__le32 *desc, const uint8_t word) * @desc: Base descriptor address * @word: Word index from where the descriptor should be read. */ -static inline uint32_t rt2x00_desc_read(__le32 *desc, const uint8_t word) +static inline uint32_t rt2x00_desc_read(___le32 *desc, const uint8_t word) { return le32_to_cpu(_rt2x00_desc_read(desc, word)); } @@ -1955,8 +1955,8 @@ void rt2800usb_libusb_transfer_fn(struct libusb_transfer *transfer) { unsigned char *workbuf = transfer->buffer; unsigned int workbuf_len = transfer->actual_length; - __le32 *rxi = (__le32 *) workbuf; - __le32 *rxd; + ___le32 *rxi = (___le32 *) workbuf; + ___le32 *rxd; uint32_t word; unsigned int rx_pkt_len; @@ -2031,12 +2031,12 @@ void rt2800usb_libusb_transfer_fn(struct libusb_transfer *transfer) { workbuf = workbuf + RXINFO_DESC_SIZE; workbuf_len -= RXINFO_DESC_SIZE; - rxd = (__le32 *)(workbuf + rx_pkt_len); + rxd = (___le32 *)(workbuf + rx_pkt_len); /* * It is now safe to read the descriptor on all architectures. */ - word = rt2x00_desc_read((__le32 *) rxd, 0); + word = rt2x00_desc_read((___le32 *) rxd, 0); if (rt2x00_get_field32(word, RXD_W0_L2PAD)) pad = 1; @@ -2056,7 +2056,7 @@ void rt2800usb_libusb_transfer_fn(struct libusb_transfer *transfer) { workbuf_len -= pad; */ - rxi = (__le32 *) workbuf; + rxi = (___le32 *) workbuf; word = rt2x00_desc_read(rxi, 0); mpdu_sz = rt2x00_get_field32(word, RXWI_W0_MPDU_TOTAL_BYTE_COUNT); diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.h index f3bdcc518..71b08799a 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2800usb.h @@ -23,8 +23,8 @@ /* * DMA descriptor defines. */ -#define TXINFO_DESC_SIZE (1 * sizeof(__le32)) -#define RXINFO_DESC_SIZE (1 * sizeof(__le32)) +#define TXINFO_DESC_SIZE (1 * sizeof(___le32)) +#define RXINFO_DESC_SIZE (1 * sizeof(___le32)) /* * TX Info structure diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h index c112bd410..6478e9836 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00.h @@ -393,8 +393,8 @@ struct rt2x00intf_conf { * This will also make it easier for the driver to write * the data to the device. */ - __le32 mac[2]; - __le32 bssid[2]; + ___le32 mac[2]; + ___le32 bssid[2]; }; /* @@ -575,7 +575,7 @@ struct rt2x00_dev { /* * EEPROM data. */ - __le16 *eeprom; + ___le16 *eeprom; /* * Active RF register values. diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h index 9ab63ed8f..86df49344 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00queue.h @@ -77,7 +77,7 @@ enum rxdone_entry_desc_flags { * @icv: ICV data used during decryption. */ struct rxdone_entry_desc { - u64 timestamp; + uint64_t timestamp; int signal; int rssi; int size; @@ -90,8 +90,8 @@ struct rxdone_entry_desc { uint8_t cipher; uint8_t cipher_status; - __le32 iv[2]; - __le32 icv; + ___le32 iv[2]; + ___le32 icv; }; #endif /* ifndef RT2X00QUEUE_H */ diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c index 57b0a5073..a97a71c66 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.c @@ -212,7 +212,7 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev, } struct rt2x00_async_read_data { - __le32 reg; + ___le32 reg; struct rt2x00_dev *rt2x00dev; bool (*callback)(struct rt2x00_dev *, int, uint32_t); }; @@ -374,7 +374,7 @@ int rt2x00usb_alloc_reg(struct rt2x00_dev *rt2x00dev) { return -ENOMEM; } - rt2x00dev->eeprom = (__le16*) malloc(rt2x00dev->ops->eeprom_size); + rt2x00dev->eeprom = (___le16*) malloc(rt2x00dev->ops->eeprom_size); if (!rt2x00dev->eeprom) { free(rt2x00dev->csr.cache); return -ENOMEM; diff --git a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h index ba00e0327..35a16e089 100644 --- a/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h +++ b/capture_hak5_wifi_coconut/libwifiuserspace/rt2800usb/rt2x00usb.h @@ -140,7 +140,7 @@ static inline int rt2x00usb_vendor_request_sw(struct rt2x00_dev *rt2x00dev, * kmalloc for correct handling inside the kernel USB layer. */ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev, - __le16 *eeprom, const uint16_t length) { + ___le16 *eeprom, const uint16_t length) { return rt2x00usb_vendor_request(rt2x00dev, USB_EEPROM_READ, USB_VENDOR_REQUEST_IN, 0, 0, eeprom, length, EEPROM_TIMEOUT); @@ -156,7 +156,7 @@ static inline int rt2x00usb_eeprom_read(struct rt2x00_dev *rt2x00dev, */ static inline uint32_t rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { - __le32 reg = 0; + ___le32 reg = 0; rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_READ, USB_VENDOR_REQUEST_IN, offset, ®, sizeof(reg)); @@ -173,7 +173,7 @@ static inline uint32_t rt2x00usb_register_read(struct rt2x00_dev *rt2x00dev, */ static inline uint32_t rt2x00usb_register_read_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset) { - __le32 reg = 0; + ___le32 reg = 0; rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_READ, USB_VENDOR_REQUEST_IN, offset, ®, sizeof(reg), REGISTER_TIMEOUT); @@ -210,7 +210,7 @@ static inline void rt2x00usb_register_multiread(struct rt2x00_dev *rt2x00dev, static inline void rt2x00usb_register_write(struct rt2x00_dev *rt2x00dev, const unsigned int offset, uint32_t value) { - __le32 reg = cpu_to_le32(value); + ___le32 reg = cpu_to_le32(value); rt2x00usb_vendor_request_buff(rt2x00dev, USB_MULTI_WRITE, USB_VENDOR_REQUEST_OUT, offset, ®, sizeof(reg)); @@ -228,7 +228,7 @@ static inline void rt2x00usb_register_write(struct rt2x00_dev *rt2x00dev, static inline void rt2x00usb_register_write_lock(struct rt2x00_dev *rt2x00dev, const unsigned int offset, uint32_t value) { - __le32 reg = cpu_to_le32(value); + ___le32 reg = cpu_to_le32(value); rt2x00usb_vendor_req_buff_lock(rt2x00dev, USB_MULTI_WRITE, USB_VENDOR_REQUEST_OUT, offset, ®, sizeof(reg), REGISTER_TIMEOUT);