Changeset 8a64320e in mainline for uspace/lib/ieee80211/include/ieee80211.h
- Timestamp:
- 2015-04-23T23:40:14Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dcba819
- Parents:
- 09044cb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ieee80211/include/ieee80211.h
r09044cb r8a64320e 27 27 */ 28 28 29 /** 29 /** 30 30 * @addtogroup libieee80211 31 31 * @{ … … 43 43 #include <ops/ieee80211.h> 44 44 45 #define DEVICE_CATEGORY_IEEE80211 "ieee80211"45 #define DEVICE_CATEGORY_IEEE80211 "ieee80211" 46 46 47 47 struct ieee80211_dev; … … 49 49 50 50 /** Initial channel frequency. */ 51 #define IEEE80211_FIRST_FREQ 241251 #define IEEE80211_FIRST_FREQ 2412 52 52 53 53 /** Max supported channel frequency. */ 54 #define IEEE80211_MAX_FREQ 247255 56 /* Gap between IEEE80211 channels in MHz. */57 #define IEEE80211_CHANNEL_GAP 558 59 /* Max AMPDU factor. */60 #define IEEE80211_MAX_AMPDU_FACTOR 1361 62 /* Max authentication password length. */63 #define IEEE80211_MAX_PASSW_LEN 6454 #define IEEE80211_MAX_FREQ 2472 55 56 /** Gap between IEEE80211 channels in MHz. */ 57 #define IEEE80211_CHANNEL_GAP 5 58 59 /** Max AMPDU factor. */ 60 #define IEEE80211_MAX_AMPDU_FACTOR 13 61 62 /** Max authentication password length. */ 63 #define IEEE80211_MAX_PASSW_LEN 64 64 64 65 65 /** IEEE 802.11 b/g supported data rates in units of 500 kb/s. */ … … 97 97 /** IEEE 802.11 callback functions. */ 98 98 typedef struct { 99 /** 100 * Function that is called at device initalization. This should 101 * get device into running state. 102 * 103 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 104 * 105 * @return EOK if succeed, negative error code otherwise. 99 /** unction that is called at device initalization. 100 * 101 * This should get device into running state. 102 * 103 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 104 * 105 * @return EOK if succeed, negative error code otherwise. 106 * 106 107 */ 107 108 int (*start)(struct ieee80211_dev *); 108 109 109 /** 110 * Scan neighborhood for networks. There should be implemented 111 * scanning of whole bandwidth. Incoming results are processed by 112 * IEEE 802.11 framework itself. 113 * 114 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 115 * 116 * @return EOK if succeed, negative error code otherwise. 110 /** Scan neighborhood for networks. 111 * 112 * There should be implemented scanning of whole bandwidth. 113 * Incoming results are processed by IEEE 802.11 framework itself. 114 * 115 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 116 * 117 * @return EOK if succeed, negative error code otherwise. 118 * 117 119 */ 118 120 int (*scan)(struct ieee80211_dev *); 119 121 120 /** 121 * Handler for TX frames to be send from device. This should be 122 * called for every frame that has to be send from IEEE 802.11 device. 123 * 124 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 125 * @param buffer Buffer with data to be send. 126 * @param buffer_size Size of buffer. 127 * 128 * @return EOK if succeed, negative error code otherwise. 122 /** Handler for TX frames to be send from device. 123 * 124 * This should be called for every frame that has to be send 125 * from IEEE 802.11 device. 126 * 127 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 128 * @param buffer Buffer with data to be send. 129 * @param buffer_size Size of buffer. 130 * 131 * @return EOK if succeed, negative error code otherwise. 132 * 129 133 */ 130 134 int (*tx_handler)(struct ieee80211_dev *, void *, size_t); 131 135 132 /** 133 * Set device operating frequency to given value.134 * 135 * @param ieee80211_dev Pointer to IEEE 802.11 device structure.136 * @param freq New device operating frequency.137 * 138 * @return EOK if succeed, negative error code otherwise.136 /** Set device operating frequency to given value. 137 * 138 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 139 * @param freq New device operating frequency. 140 * 141 * @return EOK if succeed, negative error code otherwise. 142 * 139 143 */ 140 144 int (*set_freq)(struct ieee80211_dev *, uint16_t); 141 145 142 /** 143 * Callback to inform device about BSSID change.144 * 145 * @param ieee80211_dev Pointer to IEEE 802.11 device structure.146 * @param connected True if connected to new BSSID, otherwise false.147 * 148 * @return EOK if succeed, negative error code otherwise.146 /** Callback to inform device about BSSID change. 147 * 148 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 149 * @param connected True if connected to new BSSID, otherwise false. 150 * 151 * @return EOK if succeed, negative error code otherwise. 152 * 149 153 */ 150 154 int (*bssid_change)(struct ieee80211_dev *, bool); 151 155 152 /** 153 * Callback to setup encryption key in IEEE 802.11 device. 154 * 155 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 156 * @param key_conf Key config structure. 157 * @param insert True to insert this key to device, false to remove it. 158 * 159 * @return EOK if succeed, negative error code otherwise. 160 */ 161 int (*key_config)(struct ieee80211_dev *, 162 ieee80211_key_config_t *key_conf, bool); 156 /** Callback to setup encryption key in IEEE 802.11 device. 157 * 158 * @param ieee80211_dev Pointer to IEEE 802.11 device structure. 159 * @param key_conf Key config structure. 160 * @param insert True to insert this key to device, 161 * false to remove it. 162 * 163 * @return EOK if succeed, negative error code otherwise. 164 * 165 */ 166 int (*key_config)(struct ieee80211_dev *, 167 ieee80211_key_config_t *key_conf, bool); 163 168 } ieee80211_ops_t; 164 169 165 170 /* Initialization functions. */ 166 171 extern ieee80211_dev_t *ieee80211_device_create(void); 167 extern int ieee80211_device_init(ieee80211_dev_t *ieee80211_dev, 168 ddf_dev_t *ddf_dev); 169 extern int ieee80211_init(ieee80211_dev_t *ieee80211_dev, 170 ieee80211_ops_t *ieee80211_ops, ieee80211_iface_t *ieee80211_iface, 171 nic_iface_t *ieee80211_nic_iface, ddf_dev_ops_t *ieee80211_dev_ops); 172 extern int ieee80211_device_init(ieee80211_dev_t *, ddf_dev_t *); 173 extern int ieee80211_init(ieee80211_dev_t *, ieee80211_ops_t *, 174 ieee80211_iface_t *, nic_iface_t *, ddf_dev_ops_t *); 172 175 173 176 /* Getters & setters, queries & reports. */ 174 extern void *ieee80211_get_specific(ieee80211_dev_t *ieee80211_dev); 175 extern void ieee80211_set_specific(ieee80211_dev_t *ieee80211_dev, 176 void *specific); 177 extern ddf_dev_t *ieee80211_get_ddf_dev(ieee80211_dev_t* ieee80211_dev); 178 extern ieee80211_operating_mode_t 179 ieee80211_query_current_op_mode(ieee80211_dev_t *ieee80211_dev); 180 extern uint16_t ieee80211_query_current_freq(ieee80211_dev_t *ieee80211_dev); 181 extern void ieee80211_query_bssid(ieee80211_dev_t* ieee80211_dev, 182 nic_address_t *bssid); 183 extern bool ieee80211_is_connected(ieee80211_dev_t* ieee80211_dev); 184 extern void ieee80211_report_current_op_mode(ieee80211_dev_t *ieee80211_dev, 185 ieee80211_operating_mode_t op_mode); 186 extern void ieee80211_report_current_freq(ieee80211_dev_t *ieee80211_dev, 187 uint16_t freq); 188 extern uint16_t ieee80211_get_aid(ieee80211_dev_t* ieee80211_dev); 189 extern int ieee80211_get_pairwise_security(ieee80211_dev_t* ieee80211_dev); 190 extern bool ieee80211_is_ready(ieee80211_dev_t* ieee80211_dev); 191 extern void ieee80211_set_ready(ieee80211_dev_t* ieee80211_dev, bool ready); 192 extern bool ieee80211_query_using_key(ieee80211_dev_t* ieee80211_dev); 193 extern void ieee80211_setup_key_confirm(ieee80211_dev_t* ieee80211_dev, 194 bool using_key); 195 196 extern bool ieee80211_is_data_frame(uint16_t frame_ctrl); 197 extern bool ieee80211_is_mgmt_frame(uint16_t frame_ctrl); 198 extern bool ieee80211_is_beacon_frame(uint16_t frame_ctrl); 199 extern bool ieee80211_is_probe_response_frame(uint16_t frame_ctrl); 200 extern bool ieee80211_is_auth_frame(uint16_t frame_ctrl); 201 extern bool ieee80211_is_assoc_response_frame(uint16_t frame_ctrl); 177 extern void *ieee80211_get_specific(ieee80211_dev_t *); 178 extern void ieee80211_set_specific(ieee80211_dev_t *, void *); 179 extern ddf_dev_t *ieee80211_get_ddf_dev(ieee80211_dev_t *); 180 extern ieee80211_operating_mode_t 181 ieee80211_query_current_op_mode(ieee80211_dev_t *); 182 extern uint16_t ieee80211_query_current_freq(ieee80211_dev_t *); 183 extern void ieee80211_query_bssid(ieee80211_dev_t *, nic_address_t *); 184 extern bool ieee80211_is_connected(ieee80211_dev_t *); 185 extern void ieee80211_report_current_op_mode(ieee80211_dev_t *, 186 ieee80211_operating_mode_t); 187 extern void ieee80211_report_current_freq(ieee80211_dev_t *, uint16_t); 188 extern uint16_t ieee80211_get_aid(ieee80211_dev_t *); 189 extern int ieee80211_get_pairwise_security(ieee80211_dev_t *); 190 extern bool ieee80211_is_ready(ieee80211_dev_t *); 191 extern void ieee80211_set_ready(ieee80211_dev_t *, bool); 192 extern bool ieee80211_query_using_key(ieee80211_dev_t *); 193 extern void ieee80211_setup_key_confirm(ieee80211_dev_t *, bool); 194 195 extern bool ieee80211_is_data_frame(uint16_t); 196 extern bool ieee80211_is_mgmt_frame(uint16_t); 197 extern bool ieee80211_is_beacon_frame(uint16_t); 198 extern bool ieee80211_is_probe_response_frame(uint16_t); 199 extern bool ieee80211_is_auth_frame(uint16_t); 200 extern bool ieee80211_is_assoc_response_frame(uint16_t); 202 201 203 202 /* Worker functions. */ 204 extern int ieee80211_rx_handler(ieee80211_dev_t *ieee80211_dev, void *buffer, 205 size_t buffer_size); 206 207 #endif // LIB_IEEE80211_H 203 extern int ieee80211_rx_handler(ieee80211_dev_t *, void *, size_t); 204 205 #endif 208 206 209 207 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.