struct ath9k_htc_target_vif {
u8 index;
u8 des_bssid[ETH_ALEN];
- enum htc_opmode opmode;
+ __be32 opmode;
u8 myaddr[ETH_ALEN];
u8 bssid[ETH_ALEN];
u32 flags;
u32 flags_ext;
u16 ps_sta;
- u16 rtsthreshold;
+ __be16 rtsthreshold;
u8 ath_cap;
u8 node;
s8 mcast_rate;
u8 sta_index;
u8 vif_index;
u8 vif_sta;
- u16 flags; /* ATH_HTC_STA_* */
+ __be16 flags; /* ATH_HTC_STA_* */
u16 htcap;
u8 valid;
u16 capinfo;
struct ath9k_htc_target_rate {
u8 sta_index;
u8 isnew;
- u32 capflags;
+ __be32 capflags;
struct ath9k_htc_rate rates;
};
struct ath9k_htc_target_stats {
- u32 tx_shortretry;
- u32 tx_longretry;
- u32 tx_xretries;
- u32 ht_txunaggr_xretry;
- u32 ht_tx_xretries;
+ __be32 tx_shortretry;
+ __be32 tx_longretry;
+ __be32 tx_xretries;
+ __be32 ht_txunaggr_xretry;
+ __be32 ht_tx_xretries;
} __packed;
struct ath9k_htc_vif {
enum ath9k_int imask = 0;
int dtimperiod, dtimcount, sleepduration;
int cfpperiod, cfpcount, bmiss_timeout;
- u32 nexttbtt = 0, intval, tsftu, htc_imask = 0;
+ u32 nexttbtt = 0, intval, tsftu;
+ __be32 htc_imask = 0;
u64 tsf;
int num_beacons, offset, dtim_dec_count, cfp_dec_count;
int ret;
{
struct ath_common *common = ath9k_hw_common(priv->ah);
enum ath9k_int imask = 0;
- u32 nexttbtt, intval, htc_imask = 0;
+ u32 nexttbtt, intval;
+ __be32 htc_imask = 0;
int ret;
u8 cmd_rsp;
bool fastcc = true;
struct ieee80211_channel *channel = hw->conf.channel;
enum htc_phymode mode;
- u16 htc_mode;
+ __be16 htc_mode;
u8 cmd_rsp;
int ret;
priv->tgt_rate.sta_index = ista->index;
priv->tgt_rate.isnew = 1;
trate = priv->tgt_rate;
- priv->tgt_rate.capflags = caps;
+ priv->tgt_rate.capflags = cpu_to_be32(caps);
trate.capflags = cpu_to_be32(caps);
WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, &trate);
struct ath9k_htc_target_rate trate;
struct ath_common *common = ath9k_hw_common(priv->ah);
int ret;
+ u32 caps = be32_to_cpu(priv->tgt_rate.capflags);
u8 cmd_rsp;
memset(&trate, 0, sizeof(trate));
trate = priv->tgt_rate;
if (is_cw40)
- priv->tgt_rate.capflags |= WLAN_RC_40_FLAG;
+ caps |= WLAN_RC_40_FLAG;
else
- priv->tgt_rate.capflags &= ~WLAN_RC_40_FLAG;
+ caps &= ~WLAN_RC_40_FLAG;
- trate.capflags = cpu_to_be32(priv->tgt_rate.capflags);
+ priv->tgt_rate.capflags = cpu_to_be32(caps);
+ trate.capflags = cpu_to_be32(caps);
WMI_CMD_BUF(WMI_RC_RATE_UPDATE_CMDID, &trate);
if (ret) {
struct ath9k_channel *init_channel;
int ret = 0;
enum htc_phymode mode;
- u16 htc_mode;
+ __be16 htc_mode;
u8 cmd_rsp;
ath_print(common, ATH_DBG_CONFIG,
priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
}
- rx_status->mactime = rxbuf->rxstatus.rs_tstamp;
+ rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
rx_status->band = hw->conf.channel->band;
rx_status->freq = hw->conf.channel->center_freq;
rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR;
rxstatus = (struct ath_htc_rx_status *)skb->data;
- rxstatus->rs_tstamp = be64_to_cpu(rxstatus->rs_tstamp);
- rxstatus->rs_datalen = be16_to_cpu(rxstatus->rs_datalen);
- rxstatus->evm0 = be32_to_cpu(rxstatus->evm0);
- rxstatus->evm1 = be32_to_cpu(rxstatus->evm1);
- rxstatus->evm2 = be32_to_cpu(rxstatus->evm2);
-
- if (rxstatus->rs_datalen - (len - HTC_RX_FRAME_HEADER_SIZE) != 0) {
+ if (be16_to_cpu(rxstatus->rs_datalen) -
+ (len - HTC_RX_FRAME_HEADER_SIZE) != 0) {
ath_print(common, ATH_DBG_FATAL,
"Corrupted RX data len, dropping "
"(epid: %d, dlen: %d, skblen: %d)\n",
struct htc_frame_hdr *htc_hdr;
enum htc_endpoint_id epid;
struct htc_endpoint *endpoint;
- u16 *msg_id;
+ __be16 *msg_id;
if (!htc_handle || !skb)
return;
/* Handle trailer */
if (htc_hdr->flags & HTC_FLAGS_RECV_TRAILER) {
- if (be32_to_cpu(*(u32 *) skb->data) == 0x00C60000)
+ if (be32_to_cpu(*(__be32 *) skb->data) == 0x00C60000)
/* Move past the Watchdog pattern */
htc_hdr = (struct htc_frame_hdr *)(skb->data + 4);
}
/* Get the message ID */
- msg_id = (u16 *) ((void *) htc_hdr +
- sizeof(struct htc_frame_hdr));
+ msg_id = (__be16 *) ((void *) htc_hdr +
+ sizeof(struct htc_frame_hdr));
/* Now process HTC messages */
switch (be16_to_cpu(*msg_id)) {
struct htc_frame_hdr {
u8 endpoint_id;
u8 flags;
- u16 payload_len;
+ __be16 payload_len;
u8 control[4];
} __packed;
struct htc_ready_msg {
- u16 message_id;
- u16 credits;
- u16 credit_size;
+ __be16 message_id;
+ __be16 credits;
+ __be16 credit_size;
u8 max_endpoints;
u8 pad;
} __packed;
struct htc_config_pipe_msg {
- u16 message_id;
+ __be16 message_id;
u8 pipe_id;
u8 credits;
} __packed;
#define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 8)
struct htc_conn_svc_msg {
- u16 msg_id;
- u16 service_id;
- u16 con_flags;
+ __be16 msg_id;
+ __be16 service_id;
+ __be16 con_flags;
u8 dl_pipeid;
u8 ul_pipeid;
u8 svc_meta_len;
#define HTC_SERVICE_NO_MORE_EP 4
struct htc_conn_svc_rspmsg {
- u16 msg_id;
- u16 service_id;
+ __be16 msg_id;
+ __be16 service_id;
u8 status;
u8 endpoint_id;
- u16 max_msg_len;
+ __be16 max_msg_len;
u8 svc_meta_len;
u8 pad;
} __packed;
struct htc_comp_msg {
- u16 msg_id;
+ __be16 msg_id;
} __packed;
int htc_init(struct htc_target *target);
};
struct ath_htc_rx_status {
- u64 rs_tstamp;
- u16 rs_datalen;
+ __be64 rs_tstamp;
+ __be16 rs_datalen;
u8 rs_status;
u8 rs_phyerr;
int8_t rs_rssi;
u8 rs_num_delims;
u8 rs_flags;
u8 rs_dummy;
- u32 evm0;
- u32 evm1;
- u32 evm2;
+ __be32 evm0;
+ __be32 evm1;
+ __be32 evm2;
};
#define ATH9K_RXERR_CRC 0x01
void *wmi_event;
unsigned long flags;
#ifdef CONFIG_ATH9K_HTC_DEBUGFS
- u32 txrate;
+ __be32 txrate;
#endif
spin_lock_irqsave(&priv->wmi->wmi_lock, flags);
struct wmi_event_txrate {
- u32 txrate;
+ __be32 txrate;
struct {
u8 rssi_thresh;
u8 per;
} __packed;
struct wmi_cmd_hdr {
- u16 command_id;
- u16 seq_no;
+ __be16 command_id;
+ __be16 seq_no;
} __packed;
struct wmi_swba {
#define MAX_CMD_NUMBER 62
struct register_write {
- u32 reg;
- u32 val;
+ __be32 reg;
+ __be32 val;
};
struct wmi {