Changeset 56c0930 in mainline for uspace/drv/bus/usb/ar9271/htc.h


Ignore:
Timestamp:
2015-02-20T14:33:29Z (10 years ago)
Author:
Jan Kolarik <kolarik@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4cb0148
Parents:
ab365c4
Message:

Started writing TX and RX handlers, VIF init, setting RX filter, PLL init and calibration, some corrections. Added HW values array initialization, registered diagnostic polling fibril. But still not receiving any packets…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ar9271/htc.h

    rab365c4 r56c0930  
    3737#define ATHEROS_HTC_H
    3838
     39#include <ieee80211.h>
    3940#include <usb/dev/driver.h>
    4041#include <sys/types.h>
     42#include <nic.h>
    4143
    4244#include "ath.h"
    4345
    44 #define MAX_RESPONSE_LENGTH 64
     46#define HTC_RTS_THRESHOLD 2304
     47#define HTC_MAX_AMPDU 0xFFFF
    4548
    4649/**
     
    6568        HTC_SERVICE_NO_MORE_EP
    6669} htc_response_status_code_t;
     70
     71/**
     72 * HTC operating mode definition
     73 */
     74typedef enum {
     75        HTC_OPMODE_ADHOC = 0,
     76        HTC_OPMODE_STATION = 1,
     77        HTC_OPMODE_MESH = 2,
     78        HTC_OPMODE_AP = 6
     79} htc_operating_mode_t;
    6780
    6881/**
     
    98111        fibril_mutex_t tx_lock;
    99112       
     113        /** Pointer to related IEEE 802.11 device */
     114        ieee80211_dev_t *ieee80211_dev;
     115       
    100116        /** Pointer to Atheros WiFi device structure */
    101117        ath_t *ath_device;
     
    113129        /* Message payload starts after the header. */
    114130} __attribute__((packed)) htc_frame_header_t;
     131
     132/**
     133 * HTC management TX frame header structure
     134 */
     135typedef struct {
     136        uint8_t node_idx;
     137        uint8_t vif_idx;
     138        uint8_t tidno;
     139        uint8_t flags;
     140        uint8_t key_type;
     141        uint8_t keyix;
     142        uint8_t cookie;
     143        uint8_t pad;
     144} __attribute__((packed)) htc_tx_management_header_t;
    115145
    116146/**
     
    163193
    164194/**
     195 * HTC new virtual interface message
     196 */
     197typedef struct {
     198        uint8_t index;
     199        uint8_t op_mode;
     200        uint8_t addr[ETH_ADDR];
     201        uint8_t ath_cap;
     202        uint16_t rts_thres;             /**< Big Endian value! */
     203        uint8_t pad;
     204} __attribute__((packed)) htc_vif_msg_t;
     205
     206/**
     207 * HTC new station message
     208 */
     209typedef struct {
     210        uint8_t addr[ETH_ADDR];
     211        uint8_t bssid[ETH_ADDR];
     212        uint8_t sta_index;
     213        uint8_t vif_index;
     214        uint8_t is_vif_sta;
     215               
     216        uint16_t flags;         /**< Big Endian value! */
     217        uint16_t ht_cap;        /**< Big Endian value! */
     218        uint16_t max_ampdu;     /**< Big Endian value! */
     219       
     220        uint8_t pad;
     221} __attribute__((packed)) htc_sta_msg_t;
     222
     223/**
    165224 * HTC setup complete message structure
    166225 */
     
    169228} __attribute__((packed)) htc_setup_complete_msg_t;
    170229
    171 extern int htc_device_init(ath_t *ath_device, htc_device_t *htc_device);
     230extern int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,
     231        htc_device_t *htc_device);
    172232extern int htc_init(htc_device_t *htc_device);
    173 extern int htc_read_message(htc_device_t *htc_device, void *buffer,
     233extern int htc_init_new_vif(htc_device_t *htc_device);
     234extern int htc_read_control_message(htc_device_t *htc_device, void *buffer,
    174235        size_t buffer_size, size_t *transferred_size);
    175 extern int htc_send_message(htc_device_t *htc_device, void *buffer,
     236extern int htc_read_data_message(htc_device_t *htc_device, void *buffer,
     237        size_t buffer_size, size_t *transferred_size);
     238extern int htc_send_control_message(htc_device_t *htc_device, void *buffer,
    176239        size_t buffer_size, uint8_t endpoint_id);
     240extern int htc_send_data_message(htc_device_t *htc_device, void *buffer,
     241        size_t buffer_size, uint8_t endpoint_id);
    177242
    178243#endif  /* ATHEROS_HTC_H */
Note: See TracChangeset for help on using the changeset viewer.