aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/cw1200/wsm.h
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2013-06-20 23:03:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-06-24 14:44:24 -0400
commit7258416c517c79b2ebb30b61d8c6807a04dc6b25 (patch)
tree6c547d02cdbc49bbc2ce8d3824d83cd14c71a15b /drivers/net/wireless/cw1200/wsm.h
parent5d9e3bc21c57d600b706a31454d5cf2f68c24f53 (diff)
cw1200: Fix up a large pile of sparse warnings
Most of these relate to endianness problems, and are purely cosmetic. But a couple of them were legit -- listen interval parsing and some of the rate selection code would malfunction on BE systems. There's still one cosmetic warning remaining, in the (admittedly) ugly code in cw1200_spi.c. It's there because the hardware needs 16-bit SPI transfers, but many SPI controllers only operate 8 bits at a time. If there's a cleaner way of handling this, I'm all ears. Signed-off-by: Solomon Peachy <pizza@shaftnet.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/cw1200/wsm.h')
-rw-r--r--drivers/net/wireless/cw1200/wsm.h45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/net/wireless/cw1200/wsm.h b/drivers/net/wireless/cw1200/wsm.h
index 2816171f7a1d..7afc613c3706 100644
--- a/drivers/net/wireless/cw1200/wsm.h
+++ b/drivers/net/wireless/cw1200/wsm.h
@@ -806,7 +806,7 @@ struct wsm_tx {
806 struct wsm_hdr hdr; 806 struct wsm_hdr hdr;
807 807
808 /* Packet identifier that meant to be used in completion. */ 808 /* Packet identifier that meant to be used in completion. */
809 __le32 packet_id; 809 u32 packet_id; /* Note this is actually a cookie */
810 810
811 /* WSM_TRANSMIT_RATE_... */ 811 /* WSM_TRANSMIT_RATE_... */
812 u8 max_tx_rate; 812 u8 max_tx_rate;
@@ -825,18 +825,18 @@ struct wsm_tx {
825 u8 flags; 825 u8 flags;
826 826
827 /* Should be 0. */ 827 /* Should be 0. */
828 __le32 reserved; 828 u32 reserved;
829 829
830 /* The elapsed time in TUs, after the initial transmission */ 830 /* The elapsed time in TUs, after the initial transmission */
831 /* of an MSDU, after which further attempts to transmit */ 831 /* of an MSDU, after which further attempts to transmit */
832 /* the MSDU shall be terminated. Overrides the global */ 832 /* the MSDU shall be terminated. Overrides the global */
833 /* dot11MaxTransmitMsduLifeTime setting [optional] */ 833 /* dot11MaxTransmitMsduLifeTime setting [optional] */
834 /* Device will set the default value if this is 0. */ 834 /* Device will set the default value if this is 0. */
835 __le32 expire_time; 835 u32 expire_time;
836 836
837 /* WSM_HT_TX_... */ 837 /* WSM_HT_TX_... */
838 __le32 ht_tx_parameters; 838 __le32 ht_tx_parameters;
839}; 839} __packed;
840 840
841/* = sizeof(generic hi hdr) + sizeof(wsm hdr) + sizeof(alignment) */ 841/* = sizeof(generic hi hdr) + sizeof(wsm hdr) + sizeof(alignment) */
842#define WSM_TX_EXTRA_HEADROOM (28) 842#define WSM_TX_EXTRA_HEADROOM (28)
@@ -846,10 +846,10 @@ struct wsm_tx {
846 846
847struct wsm_rx { 847struct wsm_rx {
848 /* WSM_STATUS_... */ 848 /* WSM_STATUS_... */
849 __le32 status; 849 u32 status;
850 850
851 /* Specifies the channel of the received packet. */ 851 /* Specifies the channel of the received packet. */
852 __le16 channel_number; 852 u16 channel_number;
853 853
854 /* WSM_TRANSMIT_RATE_... */ 854 /* WSM_TRANSMIT_RATE_... */
855 u8 rx_rate; 855 u8 rx_rate;
@@ -859,11 +859,8 @@ struct wsm_rx {
859 u8 rcpi_rssi; 859 u8 rcpi_rssi;
860 860
861 /* WSM_RX_STATUS_... */ 861 /* WSM_RX_STATUS_... */
862 __le32 flags; 862 u32 flags;
863 863};
864 /* Payload */
865 u8 data[0];
866} __packed;
867 864
868/* = sizeof(generic hi hdr) + sizeof(wsm hdr) */ 865/* = sizeof(generic hi hdr) + sizeof(wsm hdr) */
869#define WSM_RX_EXTRA_HEADROOM (16) 866#define WSM_RX_EXTRA_HEADROOM (16)
@@ -1119,22 +1116,22 @@ int wsm_set_tx_queue_params(struct cw1200_common *priv,
1119#define WSM_EDCA_PARAMS_RESP_ID 0x0413 1116#define WSM_EDCA_PARAMS_RESP_ID 0x0413
1120struct wsm_edca_queue_params { 1117struct wsm_edca_queue_params {
1121 /* CWmin (in slots) for the access class. */ 1118 /* CWmin (in slots) for the access class. */
1122 __le16 cwmin; 1119 u16 cwmin;
1123 1120
1124 /* CWmax (in slots) for the access class. */ 1121 /* CWmax (in slots) for the access class. */
1125 __le16 cwmax; 1122 u16 cwmax;
1126 1123
1127 /* AIFS (in slots) for the access class. */ 1124 /* AIFS (in slots) for the access class. */
1128 __le16 aifns; 1125 u16 aifns;
1129 1126
1130 /* TX OP Limit (in microseconds) for the access class. */ 1127 /* TX OP Limit (in microseconds) for the access class. */
1131 __le16 txop_limit; 1128 u16 txop_limit;
1132 1129
1133 /* dot11MaxReceiveLifetime to be used for the specified */ 1130 /* dot11MaxReceiveLifetime to be used for the specified */
1134 /* the access class. Overrides the global */ 1131 /* the access class. Overrides the global */
1135 /* dot11MaxReceiveLifetime value */ 1132 /* dot11MaxReceiveLifetime value */
1136 __le32 max_rx_lifetime; 1133 u32 max_rx_lifetime;
1137} __packed; 1134};
1138 1135
1139struct wsm_edca_params { 1136struct wsm_edca_params {
1140 /* NOTE: index is a linux queue id. */ 1137 /* NOTE: index is a linux queue id. */
@@ -1147,12 +1144,12 @@ struct wsm_edca_params {
1147 __uapsd) \ 1144 __uapsd) \
1148 do { \ 1145 do { \
1149 struct wsm_edca_queue_params *p = &(__edca)->params[__queue]; \ 1146 struct wsm_edca_queue_params *p = &(__edca)->params[__queue]; \
1150 p->cwmin = (__cw_min); \ 1147 p->cwmin = __cw_min; \
1151 p->cwmax = (__cw_max); \ 1148 p->cwmax = __cw_max; \
1152 p->aifns = (__aifs); \ 1149 p->aifns = __aifs; \
1153 p->txop_limit = ((__txop) * TXOP_UNIT); \ 1150 p->txop_limit = ((__txop) * TXOP_UNIT); \
1154 p->max_rx_lifetime = (__lifetime); \ 1151 p->max_rx_lifetime = __lifetime; \
1155 (__edca)->uapsd_enable[__queue] = (__uapsd); \ 1152 (__edca)->uapsd_enable[__queue] = (__uapsd); \
1156 } while (0) 1153 } while (0)
1157 1154
1158int wsm_set_edca_params(struct cw1200_common *priv, 1155int wsm_set_edca_params(struct cw1200_common *priv,
@@ -1475,7 +1472,7 @@ static inline int wsm_set_template_frame(struct cw1200_common *priv,
1475 u8 *p = skb_push(arg->skb, 4); 1472 u8 *p = skb_push(arg->skb, 4);
1476 p[0] = arg->frame_type; 1473 p[0] = arg->frame_type;
1477 p[1] = arg->rate; 1474 p[1] = arg->rate;
1478 ((u16 *)p)[1] = __cpu_to_le16(arg->skb->len - 4); 1475 ((__le16 *)p)[1] = __cpu_to_le16(arg->skb->len - 4);
1479 ret = wsm_write_mib(priv, WSM_MIB_ID_TEMPLATE_FRAME, p, arg->skb->len); 1476 ret = wsm_write_mib(priv, WSM_MIB_ID_TEMPLATE_FRAME, p, arg->skb->len);
1480 skb_pull(arg->skb, 4); 1477 skb_pull(arg->skb, 4);
1481 return ret; 1478 return ret;