X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=include%2Fshared%2Ffwcmd.h;h=9443c802b25b8578f6afd2b2cb66243ab47f34f1;hp=b222260c757ec677a5c4dfda2e8d1cf1474d692c;hb=500397585d53a08f83d1798c0e871c91667a2be3;hpb=7ef9f67b548f4d70c70c6714851a1cce87a9f4b5 diff --git a/include/shared/fwcmd.h b/include/shared/fwcmd.h index b222260..9443c80 100644 --- a/include/shared/fwcmd.h +++ b/include/shared/fwcmd.h @@ -1,10 +1,10 @@ /* - * Atheros AR9170 driver + * Shared Atheros AR9170 Header * - * firmware command interface definitions + * Firmware command interface definitions * * Copyright 2008, Johannes Berg - * Copyright 2009, 2010, Christian Lamparter + * Copyright 2009-2011 Christian Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,8 +51,11 @@ enum carl9170_cmd_oids { CARL9170_CMD_ECHO = 0x02, CARL9170_CMD_SWRST = 0x03, CARL9170_CMD_REBOOT = 0x04, - CARL9170_CMD_FLUSH_CAB = 0x05, + CARL9170_CMD_BCN_CTRL = 0x05, CARL9170_CMD_READ_TSF = 0x06, + CARL9170_CMD_RX_FILTER = 0x07, + CARL9170_CMD_WOL = 0x08, + CARL9170_CMD_TALLY = 0x09, /* CAM */ CARL9170_CMD_EKEY = 0x10, @@ -71,7 +74,7 @@ enum carl9170_cmd_oids { CARL9170_CMD_ASYNC_FLAG), CARL9170_CMD_REBOOT_ASYNC = (CARL9170_CMD_REBOOT | CARL9170_CMD_ASYNC_FLAG), - CARL9170_CMD_FLUSH_CAB_ASYNC = (CARL9170_CMD_FLUSH_CAB | + CARL9170_CMD_BCN_CTRL_ASYNC = (CARL9170_CMD_BCN_CTRL | CARL9170_CMD_ASYNC_FLAG), CARL9170_CMD_PSM_ASYNC = (CARL9170_CMD_PSM | CARL9170_CMD_ASYNC_FLAG), @@ -96,13 +99,13 @@ struct carl9170_set_key_cmd { __le16 type; u8 macAddr[6]; u32 key[4]; -} __packed; +} __packed __aligned(4); #define CARL9170_SET_KEY_CMD_SIZE 28 struct carl9170_disable_key_cmd { __le16 user; __le16 padding; -} __packed; +} __packed __aligned(4); #define CARL9170_DISABLE_KEY_CMD_SIZE 4 struct carl9170_u32_list { @@ -153,14 +156,46 @@ struct carl9170_psm { } __packed; #define CARL9170_PSM_SIZE 4 -struct carl9170_cab_flush_cmd { +struct carl9170_rx_filter_cmd { + __le32 rx_filter; +} __packed; +#define CARL9170_RX_FILTER_CMD_SIZE 4 + +#define CARL9170_RX_FILTER_BAD 0x01 +#define CARL9170_RX_FILTER_OTHER_RA 0x02 +#define CARL9170_RX_FILTER_DECRY_FAIL 0x04 +#define CARL9170_RX_FILTER_CTL_OTHER 0x08 +#define CARL9170_RX_FILTER_CTL_PSPOLL 0x10 +#define CARL9170_RX_FILTER_CTL_BACKR 0x20 +#define CARL9170_RX_FILTER_MGMT 0x40 +#define CARL9170_RX_FILTER_DATA 0x80 +#define CARL9170_RX_FILTER_EVERYTHING (~0) + +struct carl9170_bcn_ctrl_cmd { __le32 vif_id; __le32 mode; + __le32 bcn_addr; + __le32 bcn_len; } __packed; -#define CARL9170_CAB_FLUSH_CMD_SIZE 8 +#define CARL9170_BCN_CTRL_CMD_SIZE 16 + +#define CARL9170_BCN_CTRL_DRAIN 0 +#define CARL9170_BCN_CTRL_CAB_TRIGGER 1 + +struct carl9170_wol_cmd { + __le32 flags; + u8 mac[6]; + u8 bssid[6]; + __le32 null_interval; + __le32 free_for_use2; + __le32 mask; + u8 pattern[32]; +} __packed; + +#define CARL9170_WOL_CMD_SIZE 60 -#define CARL9170_CAB_FLUSH_DRAIN 0 -#define CARL9170_CAB_FLUSH_CAB_TRIGGER 1 +#define CARL9170_WOL_DISCONNECT 1 +#define CARL9170_WOL_MAGIC_PKT 2 struct carl9170_cmd_head { union { @@ -185,10 +220,12 @@ struct carl9170_cmd { struct carl9170_write_reg wreg; struct carl9170_rf_init rf_init; struct carl9170_psm psm; - struct carl9170_cab_flush_cmd cab_flush; + struct carl9170_wol_cmd wol; + struct carl9170_bcn_ctrl_cmd bcn_ctrl; + struct carl9170_rx_filter_cmd rx_filter; u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; } __packed; -} __packed; +} __packed __aligned(4); #define CARL9170_TX_STATUS_QUEUE 3 #define CARL9170_TX_STATUS_QUEUE_S 0 @@ -198,6 +235,7 @@ struct carl9170_cmd { #define CARL9170_TX_STATUS_TRIES (7 << CARL9170_TX_STATUS_TRIES_S) #define CARL9170_TX_STATUS_SUCCESS 0x80 +#ifdef __CARL9170FW__ /* * NOTE: * Both structs [carl9170_tx_status and _carl9170_tx_status] @@ -214,6 +252,8 @@ struct carl9170_tx_status { u8 tries:3; u8 success:1; } __packed; +#endif /* __CARL9170FW__ */ + struct _carl9170_tx_status { /* * This version should be immune to all alignment bugs. @@ -247,6 +287,15 @@ struct carl9170_tsf_rsp { } __packed; #define CARL9170_TSF_RSP_SIZE 8 +struct carl9170_tally_rsp { + __le32 active; + __le32 cca; + __le32 tx_time; + __le32 rx_total; + __le32 rx_overrun; + __le32 tick; +} __packed; + struct carl9170_rsp { struct carl9170_cmd_head hdr; @@ -254,13 +303,16 @@ struct carl9170_rsp { struct carl9170_rf_init_result rf_init_res; struct carl9170_u32_list rreg_res; struct carl9170_u32_list echo; +#ifdef __CARL9170FW__ struct carl9170_tx_status tx_status[0]; +#endif /* __CARL9170FW__ */ struct _carl9170_tx_status _tx_status[0]; struct carl9170_gpio gpio; struct carl9170_tsf_rsp tsf; struct carl9170_psm psm; + struct carl9170_tally_rsp tally; u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN]; } __packed; -} __packed; +} __packed __aligned(4); #endif /* __CARL9170_SHARED_FWCMD_H */