aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_hostif.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-09 10:32:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-09 10:32:39 -0700
commiteafdca4d7010a0e019aaaace3dd71b432a69b54c (patch)
tree0206168276ece10426dbbef7b3de7e8d84c8674d /drivers/staging/ks7010/ks_hostif.h
parentMerge tag 'libnvdimm-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm (diff)
parentstaging: ipx: delete it from the tree (diff)
downloadlinux-dev-eafdca4d7010a0e019aaaace3dd71b432a69b54c.tar.xz
linux-dev-eafdca4d7010a0e019aaaace3dd71b432a69b54c.zip
Merge tag 'staging-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO updates from Greg KH: "Here is the big staging and IIO driver update for 4.18-rc1. It was delayed as I wanted to make sure the final driver deletions did not cause any major merge issues, and all now looks good. There are a lot of patches here, just over 1000. The diffstat summary shows the major changes here: 1007 files changed, 16828 insertions(+), 227770 deletions(-) Because of this, we might be close to shrinking the overall kernel source code size for two releases in a row. There was loads of work in this release cycle, primarily: - tons of ks7010 driver cleanups - lots of mt7621 driver fixes and cleanups - most driver cleanups - wilc1000 fixes and cleanups - lots and lots of IIO driver cleanups and new additions - debugfs cleanups for all staging drivers - lots of other staging driver cleanups and fixes, the shortlog has the full details. but the big user-visable things here are the removal of 3 chunks of code: - ncpfs and ipx were removed on schedule, no one has cared about this code since it moved to staging last year, and if it needs to come back, it can be reverted. - lustre file system is removed. I've ranted at the lustre developers about once a year for the past 5 years, with no real forward progress at all to clean things up and get the code into the "real" part of the kernel. Given that the lustre developers continue to work on an external tree and try to port those changes to the in-kernel tree every once in a while, this whole thing really really is not working out at all. So I'm deleting it so that the developers can spend the time working in their out-of-tree location and get things cleaned up properly to get merged into the tree correctly at a later date. Because of these file removals, you will have merge issues on some of these files (2 in the ipx code, 1 in the ncpfs code, and 1 in the atomisp driver). Just delete those files, it's a simple merge :) All of this has been in linux-next for a while with no reported problems" * tag 'staging-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1011 commits) staging: ipx: delete it from the tree ncpfs: remove uapi .h files ncpfs: remove Documentation ncpfs: remove compat functionality staging: ncpfs: delete it staging: lustre: delete the filesystem from the tree. staging: vc04_services: no need to save the log debufs dentries staging: vc04_services: vchiq_debugfs_log_entry can be a void * staging: vc04_services: remove struct vchiq_debugfs_info staging: vc04_services: move client dbg directory into static variable staging: vc04_services: remove odd vchiq_debugfs_top() wrapper staging: vc04_services: no need to check debugfs return values staging: mt7621-gpio: reorder includes alphabetically staging: mt7621-gpio: change gc_map to don't use pointers staging: mt7621-gpio: use GPIOF_DIR_OUT and GPIOF_DIR_IN macros instead of custom values staging: mt7621-gpio: change 'to_mediatek_gpio' to make just a one line return staging: mt7621-gpio: dt-bindings: update documentation for #interrupt-cells property staging: mt7621-gpio: update #interrupt-cells for the gpio node staging: mt7621-gpio: dt-bindings: complete documentation for the gpio staging: mt7621-dts: add missing properties to gpio node ...
Diffstat (limited to 'drivers/staging/ks7010/ks_hostif.h')
-rw-r--r--drivers/staging/ks7010/ks_hostif.h465
1 files changed, 220 insertions, 245 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.h b/drivers/staging/ks7010/ks_hostif.h
index 2f918b11b337..ca7dc8f5166c 100644
--- a/drivers/staging/ks7010/ks_hostif.h
+++ b/drivers/staging/ks7010/ks_hostif.h
@@ -1,12 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Driver for KeyStream wireless LAN
*
* Copyright (c) 2005-2008 KeyStream Corp.
* Copyright (C) 2009 Renesas Technology Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
*/
#ifndef _KS_HOSTIF_H_
@@ -67,7 +64,7 @@ struct hostif_hdr {
__le16 event;
} __packed;
-struct hostif_data_request_t {
+struct hostif_data_request {
struct hostif_hdr header;
__le16 auth_type;
#define TYPE_DATA 0x0000
@@ -76,85 +73,127 @@ struct hostif_data_request_t {
u8 data[0];
} __packed;
-struct hostif_data_indication_t {
- struct hostif_hdr header;
- __le16 auth_type;
-/* #define TYPE_DATA 0x0000 */
#define TYPE_PMK1 0x0001
#define TYPE_GMK1 0x0002
#define TYPE_GMK2 0x0003
- __le16 reserved;
- u8 data[0];
-} __packed;
#define CHANNEL_LIST_MAX_SIZE 14
-struct channel_list_t {
+struct channel_list {
u8 size;
u8 body[CHANNEL_LIST_MAX_SIZE];
u8 pad;
} __packed;
-/* MIB Attribute */
-#define DOT11_MAC_ADDRESS 0x21010100 /* MAC Address (R) */
-#define DOT11_PRODUCT_VERSION 0x31024100 /* FirmWare Version (R) */
-#define DOT11_RTS_THRESHOLD 0x21020100 /* RTS Threshold (R/W) */
-#define DOT11_FRAGMENTATION_THRESHOLD 0x21050100 /* Fragment Threshold (R/W) */
-#define DOT11_PRIVACY_INVOKED 0x15010100 /* WEP ON/OFF (W) */
-#define DOT11_WEP_DEFAULT_KEY_ID 0x15020100 /* WEP Index (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE1 0x13020101 /* WEP Key#1(TKIP AES: PairwiseTemporalKey) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE2 0x13020102 /* WEP Key#2(TKIP AES: GroupKey1) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE3 0x13020103 /* WEP Key#3(TKIP AES: GroupKey2) (W) */
-#define DOT11_WEP_DEFAULT_KEY_VALUE4 0x13020104 /* WEP Key#4 (W) */
-#define DOT11_WEP_LIST 0x13020100 /* WEP LIST */
-#define DOT11_DESIRED_SSID 0x11090100 /* SSID */
-#define DOT11_CURRENT_CHANNEL 0x45010100 /* channel set */
-#define DOT11_OPERATION_RATE_SET 0x11110100 /* rate set */
-
-#define LOCAL_AP_SEARCH_INTEAVAL 0xF1010100 /* AP search interval (R/W) */
-#define LOCAL_CURRENTADDRESS 0xF1050100 /* MAC Address change (W) */
-#define LOCAL_MULTICAST_ADDRESS 0xF1060100 /* Multicast Address (W) */
-#define LOCAL_MULTICAST_FILTER 0xF1060200 /* Multicast Address Filter enable/disable (W) */
-#define LOCAL_SEARCHED_AP_LIST 0xF1030100 /* AP list (R) */
-#define LOCAL_LINK_AP_STATUS 0xF1040100 /* Link AP status (R) */
-#define LOCAL_PACKET_STATISTICS 0xF1020100 /* tx,rx packets statistics */
-#define LOCAL_AP_SCAN_LIST_TYPE_SET 0xF1030200 /* AP_SCAN_LIST_TYPE */
-
-#define DOT11_RSN_ENABLED 0x15070100 /* WPA enable/disable (W) */
-#define LOCAL_RSN_MODE 0x56010100 /* RSN mode WPA/WPA2 (W) */
-#define DOT11_RSN_CONFIG_MULTICAST_CIPHER 0x51040100 /* GroupKeyCipherSuite (W) */
-#define DOT11_RSN_CONFIG_UNICAST_CIPHER 0x52020100 /* PairwiseKeyCipherSuite (W) */
-#define DOT11_RSN_CONFIG_AUTH_SUITE 0x53020100 /* AuthenticationKeyManagementSuite (W) */
-#define DOT11_RSN_CONFIG_VERSION 0x51020100 /* RSN version (W) */
-#define LOCAL_RSN_CONFIG_ALL 0x5F010100 /* RSN CONFIG ALL (W) */
-#define DOT11_PMK_TSC 0x55010100 /* PMK_TSC (W) */
-#define DOT11_GMK1_TSC 0x55010101 /* GMK1_TSC (W) */
-#define DOT11_GMK2_TSC 0x55010102 /* GMK2_TSC (W) */
-#define DOT11_GMK3_TSC 0x55010103 /* GMK3_TSC */
-#define LOCAL_PMK 0x58010100 /* Pairwise Master Key cache (W) */
-
-#define LOCAL_REGION 0xF10A0100 /* Region setting */
-
-#ifdef WPS
-#define LOCAL_WPS_ENABLE 0xF10B0100 /* WiFi Protected Setup */
-#define LOCAL_WPS_PROBE_REQ 0xF10C0100 /* WPS Probe Request */
-#endif /* WPS */
-
-#define LOCAL_GAIN 0xF10D0100 /* Carrer sense threshold for demo ato show */
-#define LOCAL_EEPROM_SUM 0xF10E0100 /* EEPROM checksum information */
-
-struct hostif_mib_get_request_t {
+/**
+ * enum mib_attribute - Management Information Base attribute
+ * Attribute value used for accessing and updating MIB
+ *
+ * @DOT11_MAC_ADDRESS: MAC Address (R)
+ * @DOT11_PRODUCT_VERSION: FirmWare Version (R)
+ * @DOT11_RTS_THRESHOLD: RTS Threshold (R/W)
+ * @DOT11_FRAGMENTATION_THRESHOLD: Fragment Threshold (R/W)
+ * @DOT11_PRIVACY_INVOKED: WEP ON/OFF (W)
+ * @DOT11_WEP_DEFAULT_KEY_ID: WEP Index (W)
+ * @DOT11_WEP_DEFAULT_KEY_VALUE1: WEP Key#1(TKIP AES: PairwiseTemporalKey) (W)
+ * @DOT11_WEP_DEFAULT_KEY_VALUE2: WEP Key#2(TKIP AES: GroupKey1) (W)
+ * @DOT11_WEP_DEFAULT_KEY_VALUE3: WEP Key#3(TKIP AES: GroupKey2) (W)
+ * @DOT11_WEP_DEFAULT_KEY_VALUE4: WEP Key#4 (W)
+ * @DOT11_WEP_LIST: WEP LIST
+ * @DOT11_DESIRED_SSID: SSID
+ * @DOT11_CURRENT_CHANNEL: channel set
+ * @DOT11_OPERATION_RATE_SET: rate set
+ * @LOCAL_AP_SEARCH_INTERVAL: AP search interval (R/W)
+ * @LOCAL_CURRENTADDRESS: MAC Address change (W)
+ * @LOCAL_MULTICAST_ADDRESS: Multicast Address (W)
+ * @LOCAL_MULTICAST_FILTER: Multicast Address Filter enable/disable (W)
+ * @LOCAL_SEARCHED_AP_LIST: AP list (R)
+ * @LOCAL_LINK_AP_STATUS: Link AP status (R)
+ * @LOCAL_PACKET_STATISTICS: tx,rx packets statistics
+ * @LOCAL_AP_SCAN_LIST_TYPE_SET: AP_SCAN_LIST_TYPE
+ * @DOT11_RSN_ENABLED: WPA enable/disable (W)
+ * @LOCAL_RSN_MODE: RSN mode WPA/WPA2 (W)
+ * @DOT11_RSN_CONFIG_MULTICAST_CIPHER: GroupKeyCipherSuite (W)
+ * @DOT11_RSN_CONFIG_UNICAST_CIPHER: PairwiseKeyCipherSuite (W)
+ * @DOT11_RSN_CONFIG_AUTH_SUITE: AuthenticationKeyManagementSuite (W)
+ * @DOT11_RSN_CONFIG_VERSION: RSN version (W)
+ * @LOCAL_RSN_CONFIG_ALL: RSN CONFIG ALL (W)
+ * @DOT11_PMK_TSC: PMK_TSC (W)
+ * @DOT11_GMK1_TSC: GMK1_TSC (W)
+ * @DOT11_GMK2_TSC: GMK2_TSC (W)
+ * @DOT11_GMK3_TSC: GMK3_TSC
+ * @LOCAL_PMK: Pairwise Master Key cache (W)
+ * @LOCAL_REGION: Region setting
+ * @LOCAL_WPS_ENABLE: WiFi Protected Setup
+ * @LOCAL_WPS_PROBE_REQ: WPS Probe Request
+ * @LOCAL_GAIN: Carrer sense threshold for demo ato show
+ * @LOCAL_EEPROM_SUM: EEPROM checksum information
+ */
+enum mib_attribute {
+ DOT11_MAC_ADDRESS = 0x21010100,
+ DOT11_PRODUCT_VERSION = 0x31024100,
+ DOT11_RTS_THRESHOLD = 0x21020100,
+ DOT11_FRAGMENTATION_THRESHOLD = 0x21050100,
+ DOT11_PRIVACY_INVOKED = 0x15010100,
+ DOT11_WEP_DEFAULT_KEY_ID = 0x15020100,
+ DOT11_WEP_DEFAULT_KEY_VALUE1 = 0x13020101,
+ DOT11_WEP_DEFAULT_KEY_VALUE2 = 0x13020102,
+ DOT11_WEP_DEFAULT_KEY_VALUE3 = 0x13020103,
+ DOT11_WEP_DEFAULT_KEY_VALUE4 = 0x13020104,
+ DOT11_WEP_LIST = 0x13020100,
+ DOT11_DESIRED_SSID = 0x11090100,
+ DOT11_CURRENT_CHANNEL = 0x45010100,
+ DOT11_OPERATION_RATE_SET = 0x11110100,
+ LOCAL_AP_SEARCH_INTERVAL = 0xF1010100,
+ LOCAL_CURRENTADDRESS = 0xF1050100,
+ LOCAL_MULTICAST_ADDRESS = 0xF1060100,
+ LOCAL_MULTICAST_FILTER = 0xF1060200,
+ LOCAL_SEARCHED_AP_LIST = 0xF1030100,
+ LOCAL_LINK_AP_STATUS = 0xF1040100,
+ LOCAL_PACKET_STATISTICS = 0xF1020100,
+ LOCAL_AP_SCAN_LIST_TYPE_SET = 0xF1030200,
+ DOT11_RSN_ENABLED = 0x15070100,
+ LOCAL_RSN_MODE = 0x56010100,
+ DOT11_RSN_CONFIG_MULTICAST_CIPHER = 0x51040100,
+ DOT11_RSN_CONFIG_UNICAST_CIPHER = 0x52020100,
+ DOT11_RSN_CONFIG_AUTH_SUITE = 0x53020100,
+ DOT11_RSN_CONFIG_VERSION = 0x51020100,
+ LOCAL_RSN_CONFIG_ALL = 0x5F010100,
+ DOT11_PMK_TSC = 0x55010100,
+ DOT11_GMK1_TSC = 0x55010101,
+ DOT11_GMK2_TSC = 0x55010102,
+ DOT11_GMK3_TSC = 0x55010103,
+ LOCAL_PMK = 0x58010100,
+ LOCAL_REGION = 0xF10A0100,
+ LOCAL_WPS_ENABLE = 0xF10B0100,
+ LOCAL_WPS_PROBE_REQ = 0xF10C0100,
+ LOCAL_GAIN = 0xF10D0100,
+ LOCAL_EEPROM_SUM = 0xF10E0100
+};
+
+struct hostif_mib_get_request {
struct hostif_hdr header;
__le32 mib_attribute;
} __packed;
-struct hostif_mib_value_t {
+/**
+ * enum mib_data_type - Message Information Base data type.
+ * @MIB_VALUE_TYPE_NULL: NULL type
+ * @MIB_VALUE_TYPE_INT: INTEGER type
+ * @MIB_VALUE_TYPE_BOOL: BOOL type
+ * @MIB_VALUE_TYPE_COUNT32: unused
+ * @MIB_VALUE_TYPE_OSTRING: Chunk of memory
+ */
+enum mib_data_type {
+ MIB_VALUE_TYPE_NULL = 0,
+ MIB_VALUE_TYPE_INT,
+ MIB_VALUE_TYPE_BOOL,
+ MIB_VALUE_TYPE_COUNT32,
+ MIB_VALUE_TYPE_OSTRING
+};
+
+struct hostif_mib_value {
__le16 size;
__le16 type;
-#define MIB_VALUE_TYPE_NULL 0
-#define MIB_VALUE_TYPE_INT 1
-#define MIB_VALUE_TYPE_BOOL 2
-#define MIB_VALUE_TYPE_COUNT32 3
-#define MIB_VALUE_TYPE_OSTRING 4
u8 body[0];
} __packed;
@@ -166,22 +205,16 @@ struct hostif_mib_get_confirm_t {
#define MIB_READ_ONLY 2
#define MIB_WRITE_ONLY 3
__le32 mib_attribute;
- struct hostif_mib_value_t mib_value;
+ struct hostif_mib_value mib_value;
} __packed;
struct hostif_mib_set_request_t {
struct hostif_hdr header;
__le32 mib_attribute;
- struct hostif_mib_value_t mib_value;
-} __packed;
-
-struct hostif_mib_set_confirm_t {
- struct hostif_hdr header;
- __le32 mib_status;
- __le32 mib_attribute;
+ struct hostif_mib_value mib_value;
} __packed;
-struct hostif_power_mgmt_request_t {
+struct hostif_power_mgmt_request {
struct hostif_hdr header;
__le32 mode;
#define POWER_ACTIVE 1
@@ -206,12 +239,7 @@ enum power_mgmt_mode_type {
/* #define RESULT_ALREADY_RUNNING 3 */
#define RESULT_ALREADY_RUNNING 7
-struct hostif_power_mgmt_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
-struct hostif_start_request_t {
+struct hostif_start_request {
struct hostif_hdr header;
__le16 mode;
#define MODE_PSEUDO_ADHOC 0
@@ -220,43 +248,38 @@ struct hostif_start_request_t {
#define MODE_ADHOC 3
} __packed;
-struct hostif_start_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
-struct ssid_t {
+struct ssid {
u8 size;
u8 body[IEEE80211_MAX_SSID_LEN];
u8 ssid_pad;
} __packed;
#define RATE_SET_MAX_SIZE 16
-struct rate_set8_t {
+struct rate_set8 {
u8 size;
u8 body[8];
u8 rate_pad;
} __packed;
-struct fh_parms_t {
+struct fh_parms {
__le16 dwell_time;
u8 hop_set;
u8 hop_pattern;
u8 hop_index;
} __packed;
-struct ds_parms_t {
+struct ds_parms {
u8 channel;
} __packed;
-struct cf_parms_t {
+struct cf_parms {
u8 count;
u8 period;
__le16 max_duration;
__le16 dur_remaining;
} __packed;
-struct ibss_parms_t {
+struct ibss_parms {
__le16 atim_window;
} __packed;
@@ -270,13 +293,13 @@ struct erp_params_t {
u8 erp_info;
} __packed;
-struct rate_set16_t {
+struct rate_set16 {
u8 size;
u8 body[16];
u8 rate_pad;
} __packed;
-struct ap_info_t {
+struct ap_info {
u8 bssid[6]; /* +00 */
u8 rssi; /* +06 */
u8 sq; /* +07 */
@@ -291,7 +314,7 @@ struct ap_info_t {
/* +1032 */
} __packed;
-struct link_ap_info_t {
+struct link_ap_info {
u8 bssid[6]; /* +00 */
u8 rssi; /* +06 */
u8 sq; /* +07 */
@@ -299,14 +322,14 @@ struct link_ap_info_t {
u8 pad0; /* +09 */
__le16 beacon_period; /* +10 */
__le16 capability; /* +12 */
- struct rate_set8_t rate_set; /* +14 */
- struct fh_parms_t fh_parameter; /* +24 */
- struct ds_parms_t ds_parameter; /* +29 */
- struct cf_parms_t cf_parameter; /* +30 */
- struct ibss_parms_t ibss_parameter; /* +36 */
+ struct rate_set8 rate_set; /* +14 */
+ struct fh_parms fh_parameter; /* +24 */
+ struct ds_parms ds_parameter; /* +29 */
+ struct cf_parms cf_parameter; /* +30 */
+ struct ibss_parms ibss_parameter; /* +36 */
struct erp_params_t erp_parameter; /* +38 */
u8 pad1; /* +39 */
- struct rate_set8_t ext_rate_set; /* +40 */
+ struct rate_set8 ext_rate_set; /* +40 */
u8 DTIM_period; /* +50 */
u8 rsn_mode; /* +51 */
#define RSN_MODE_NONE 0
@@ -318,23 +341,13 @@ struct link_ap_info_t {
} __packed rsn;
} __packed;
-struct hostif_connect_indication_t {
- struct hostif_hdr header;
- __le16 connect_code;
#define RESULT_CONNECT 0
#define RESULT_DISCONNECT 1
- struct link_ap_info_t link_ap_info;
-} __packed;
-struct hostif_stop_request_t {
+struct hostif_stop_request {
struct hostif_hdr header;
} __packed;
-struct hostif_stop_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
#define D_11B_ONLY_MODE 0
#define D_11G_ONLY_MODE 1
#define D_11BG_COMPATIBLE_MODE 2
@@ -343,98 +356,78 @@ struct hostif_stop_confirm_t {
#define CTS_MODE_FALSE 0
#define CTS_MODE_TRUE 1
-struct hostif_request_t {
+struct hostif_request {
__le16 phy_type;
__le16 cts_mode;
__le16 scan_type;
__le16 capability;
- struct rate_set16_t rate_set;
+ struct rate_set16 rate_set;
} __packed;
/**
- * struct hostif_ps_adhoc_set_request_t - pseudo adhoc mode
+ * struct hostif_ps_adhoc_set_request - pseudo adhoc mode
* @capability: bit5 : preamble
* bit6 : pbcc - Not supported always 0
* bit10 : ShortSlotTime
* bit13 : DSSS-OFDM - Not supported always 0
*/
-struct hostif_ps_adhoc_set_request_t {
+struct hostif_ps_adhoc_set_request {
struct hostif_hdr header;
- struct hostif_request_t request;
+ struct hostif_request request;
__le16 channel;
} __packed;
-struct hostif_ps_adhoc_set_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
#define AUTH_TYPE_OPEN_SYSTEM 0
#define AUTH_TYPE_SHARED_KEY 1
/**
- * struct hostif_infrastructure_set_request_t
+ * struct hostif_infrastructure_set_request
* @capability: bit5 : preamble
* bit6 : pbcc - Not supported always 0
* bit10 : ShortSlotTime
* bit13 : DSSS-OFDM - Not supported always 0
*/
-struct hostif_infrastructure_set_request_t {
+struct hostif_infrastructure_set_request {
struct hostif_hdr header;
- struct hostif_request_t request;
- struct ssid_t ssid;
+ struct hostif_request request;
+ struct ssid ssid;
__le16 beacon_lost_count;
__le16 auth_type;
- struct channel_list_t channel_list;
+ struct channel_list channel_list;
u8 bssid[ETH_ALEN];
} __packed;
-struct hostif_infrastructure_set_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
/**
- * struct hostif_adhoc_set_request_t
+ * struct hostif_adhoc_set_request
* @capability: bit5 : preamble
* bit6 : pbcc - Not supported always 0
* bit10 : ShortSlotTime
* bit13 : DSSS-OFDM - Not supported always 0
*/
-struct hostif_adhoc_set_request_t {
+struct hostif_adhoc_set_request {
struct hostif_hdr header;
- struct hostif_request_t request;
- struct ssid_t ssid;
+ struct hostif_request request;
+ struct ssid ssid;
__le16 channel;
} __packed;
/**
- * struct hostif_adhoc_set2_request_t
+ * struct hostif_adhoc_set2_request
* @capability: bit5 : preamble
* bit6 : pbcc - Not supported always 0
* bit10 : ShortSlotTime
* bit13 : DSSS-OFDM - Not supported always 0
*/
-struct hostif_adhoc_set2_request_t {
+struct hostif_adhoc_set2_request {
struct hostif_hdr header;
- struct hostif_request_t request;
+ struct hostif_request request;
__le16 reserved;
- struct ssid_t ssid;
- struct channel_list_t channel_list;
+ struct ssid ssid;
+ struct channel_list channel_list;
u8 bssid[ETH_ALEN];
} __packed;
-struct hostif_adhoc_set_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
-struct last_associate_t {
- u8 type;
- u8 status;
-} __packed;
-
-struct association_request_t {
+struct association_request {
u8 type;
u8 pad;
__le16 capability;
@@ -443,7 +436,7 @@ struct association_request_t {
__le16 req_ies_size;
} __packed;
-struct association_response_t {
+struct association_response {
u8 type;
u8 pad;
__le16 capability;
@@ -452,15 +445,7 @@ struct association_response_t {
__le16 resp_ies_size;
} __packed;
-struct hostif_associate_indication_t {
- struct hostif_hdr header;
- struct association_request_t assoc_req;
- struct association_response_t assoc_resp;
- /* followed by (req_ies_size + resp_ies_size) octets of data */
- /* reqIEs data *//* respIEs data */
-} __packed;
-
-struct hostif_bss_scan_request_t {
+struct hostif_bss_scan_request {
struct hostif_hdr header;
u8 scan_type;
#define ACTIVE_SCAN 0
@@ -468,17 +453,11 @@ struct hostif_bss_scan_request_t {
u8 pad[3];
__le32 ch_time_min;
__le32 ch_time_max;
- struct channel_list_t channel_list;
- struct ssid_t ssid;
+ struct channel_list channel_list;
+ struct ssid ssid;
} __packed;
-struct hostif_bss_scan_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
- __le16 reserved;
-} __packed;
-
-struct hostif_phy_information_request_t {
+struct hostif_phy_information_request {
struct hostif_hdr header;
__le16 type;
#define NORMAL_TYPE 0
@@ -486,43 +465,21 @@ struct hostif_phy_information_request_t {
__le16 time; /* unit 100ms */
} __packed;
-struct hostif_phy_information_confirm_t {
- struct hostif_hdr header;
- u8 rssi;
- u8 sq;
- u8 noise;
- u8 link_speed;
- __le32 tx_frame;
- __le32 rx_frame;
- __le32 tx_error;
- __le32 rx_error;
-} __packed;
-
enum sleep_mode_type {
SLP_ACTIVE,
SLP_SLEEP
};
-struct hostif_sleep_request_t {
+struct hostif_sleep_request {
struct hostif_hdr header;
} __packed;
-struct hostif_sleep_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
-struct hostif_mic_failure_request_t {
+struct hostif_mic_failure_request {
struct hostif_hdr header;
__le16 failure_count;
__le16 timer;
} __packed;
-struct hostif_mic_failure_confirm_t {
- struct hostif_hdr header;
- __le16 result_code;
-} __packed;
-
#define BASIC_RATE 0x80
#define RATE_MASK 0x7F
@@ -541,34 +498,54 @@ struct hostif_mic_failure_confirm_t {
#define TX_RATE_FIXED 5
/* 11b rate */
-#define TX_RATE_1M (uint8_t)(10 / 5) /* 11b 11g basic rate */
-#define TX_RATE_2M (uint8_t)(20 / 5) /* 11b 11g basic rate */
-#define TX_RATE_5M (uint8_t)(55 / 5) /* 11g basic rate */
-#define TX_RATE_11M (uint8_t)(110 / 5) /* 11g basic rate */
+#define TX_RATE_1M (u8)(10 / 5) /* 11b 11g basic rate */
+#define TX_RATE_2M (u8)(20 / 5) /* 11b 11g basic rate */
+#define TX_RATE_5M (u8)(55 / 5) /* 11g basic rate */
+#define TX_RATE_11M (u8)(110 / 5) /* 11g basic rate */
/* 11g rate */
-#define TX_RATE_6M (uint8_t)(60 / 5) /* 11g basic rate */
-#define TX_RATE_12M (uint8_t)(120 / 5) /* 11g basic rate */
-#define TX_RATE_24M (uint8_t)(240 / 5) /* 11g basic rate */
-#define TX_RATE_9M (uint8_t)(90 / 5)
-#define TX_RATE_18M (uint8_t)(180 / 5)
-#define TX_RATE_36M (uint8_t)(360 / 5)
-#define TX_RATE_48M (uint8_t)(480 / 5)
-#define TX_RATE_54M (uint8_t)(540 / 5)
-
-#define IS_11B_RATE(A) (((A & RATE_MASK) == TX_RATE_1M) || ((A & RATE_MASK) == TX_RATE_2M) || \
- ((A & RATE_MASK) == TX_RATE_5M) || ((A & RATE_MASK) == TX_RATE_11M))
+#define TX_RATE_6M (u8)(60 / 5) /* 11g basic rate */
+#define TX_RATE_12M (u8)(120 / 5) /* 11g basic rate */
+#define TX_RATE_24M (u8)(240 / 5) /* 11g basic rate */
+#define TX_RATE_9M (u8)(90 / 5)
+#define TX_RATE_18M (u8)(180 / 5)
+#define TX_RATE_36M (u8)(360 / 5)
+#define TX_RATE_48M (u8)(480 / 5)
+#define TX_RATE_54M (u8)(540 / 5)
+
+static inline bool is_11b_rate(u8 rate)
+{
+ return (((rate & RATE_MASK) == TX_RATE_1M) ||
+ ((rate & RATE_MASK) == TX_RATE_2M) ||
+ ((rate & RATE_MASK) == TX_RATE_5M) ||
+ ((rate & RATE_MASK) == TX_RATE_11M));
+}
-#define IS_OFDM_RATE(A) (((A & RATE_MASK) == TX_RATE_6M) || ((A & RATE_MASK) == TX_RATE_12M) || \
- ((A & RATE_MASK) == TX_RATE_24M) || ((A & RATE_MASK) == TX_RATE_9M) || \
- ((A & RATE_MASK) == TX_RATE_18M) || ((A & RATE_MASK) == TX_RATE_36M) || \
- ((A & RATE_MASK) == TX_RATE_48M) || ((A & RATE_MASK) == TX_RATE_54M))
+static inline bool is_ofdm_rate(u8 rate)
+{
+ return (((rate & RATE_MASK) == TX_RATE_6M) ||
+ ((rate & RATE_MASK) == TX_RATE_12M) ||
+ ((rate & RATE_MASK) == TX_RATE_24M) ||
+ ((rate & RATE_MASK) == TX_RATE_9M) ||
+ ((rate & RATE_MASK) == TX_RATE_18M) ||
+ ((rate & RATE_MASK) == TX_RATE_36M) ||
+ ((rate & RATE_MASK) == TX_RATE_48M) ||
+ ((rate & RATE_MASK) == TX_RATE_54M));
+}
-#define IS_11BG_RATE(A) (IS_11B_RATE(A) || IS_OFDM_RATE(A))
+static inline bool is_11bg_rate(u8 rate)
+{
+ return (is_11b_rate(rate) || is_ofdm_rate(rate));
+}
-#define IS_OFDM_EXT_RATE(A) (((A & RATE_MASK) == TX_RATE_9M) || ((A & RATE_MASK) == TX_RATE_18M) || \
- ((A & RATE_MASK) == TX_RATE_36M) || ((A & RATE_MASK) == TX_RATE_48M) || \
- ((A & RATE_MASK) == TX_RATE_54M))
+static inline bool is_ofdm_ext_rate(u8 rate)
+{
+ return (((rate & RATE_MASK) == TX_RATE_9M) ||
+ ((rate & RATE_MASK) == TX_RATE_18M) ||
+ ((rate & RATE_MASK) == TX_RATE_36M) ||
+ ((rate & RATE_MASK) == TX_RATE_48M) ||
+ ((rate & RATE_MASK) == TX_RATE_54M));
+}
enum connect_status_type {
CONNECT_STATUS,
@@ -588,19 +565,25 @@ enum multicast_filter_type {
#define NIC_MAX_MCAST_LIST 32
-/* macro function */
#define HIF_EVENT_MASK 0xE800
-#define IS_HIF_IND(_EVENT) ((_EVENT & HIF_EVENT_MASK) == 0xE800 && \
- ((_EVENT & ~HIF_EVENT_MASK) == 0x0001 || \
- (_EVENT & ~HIF_EVENT_MASK) == 0x0006 || \
- (_EVENT & ~HIF_EVENT_MASK) == 0x000C || \
- (_EVENT & ~HIF_EVENT_MASK) == 0x0011 || \
- (_EVENT & ~HIF_EVENT_MASK) == 0x0012))
-
-#define IS_HIF_CONF(_EVENT) ((_EVENT & HIF_EVENT_MASK) == 0xE800 && \
- (_EVENT & ~HIF_EVENT_MASK) > 0x0000 && \
- (_EVENT & ~HIF_EVENT_MASK) < 0x0012 && \
- !IS_HIF_IND(_EVENT))
+
+static inline bool is_hif_ind(unsigned short event)
+{
+ return (((event & HIF_EVENT_MASK) == HIF_EVENT_MASK) &&
+ (((event & ~HIF_EVENT_MASK) == 0x0001) ||
+ ((event & ~HIF_EVENT_MASK) == 0x0006) ||
+ ((event & ~HIF_EVENT_MASK) == 0x000C) ||
+ ((event & ~HIF_EVENT_MASK) == 0x0011) ||
+ ((event & ~HIF_EVENT_MASK) == 0x0012)));
+}
+
+static inline bool is_hif_conf(unsigned short event)
+{
+ return (((event & HIF_EVENT_MASK) == HIF_EVENT_MASK) &&
+ ((event & ~HIF_EVENT_MASK) > 0x0000) &&
+ ((event & ~HIF_EVENT_MASK) < 0x0012) &&
+ !is_hif_ind(event));
+}
#ifdef __KERNEL__
@@ -610,7 +593,7 @@ enum multicast_filter_type {
int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb);
void hostif_receive(struct ks_wlan_private *priv, unsigned char *p,
unsigned int size);
-void hostif_sme_enqueue(struct ks_wlan_private *priv, uint16_t event);
+void hostif_sme_enqueue(struct ks_wlan_private *priv, u16 event);
int hostif_init(struct ks_wlan_private *priv);
void hostif_exit(struct ks_wlan_private *priv);
int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
@@ -622,19 +605,11 @@ void send_packet_complete(struct ks_wlan_private *priv, struct sk_buff *skb);
void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv);
int ks_wlan_hw_power_save(struct ks_wlan_private *priv);
-static
-inline int hif_align_size(int size)
+#define KS7010_SIZE_ALIGNMENT 32
+
+static inline size_t hif_align_size(size_t size)
{
-#ifdef KS_ATOM
- if (size < 1024)
- size = 1024;
-#endif
-#ifdef DEVICE_ALIGNMENT
- return (size % DEVICE_ALIGNMENT) ? size + DEVICE_ALIGNMENT -
- (size % DEVICE_ALIGNMENT) : size;
-#else
- return size;
-#endif
+ return ALIGN(size, KS7010_SIZE_ALIGNMENT);
}
#endif /* __KERNEL__ */