Skip to content

Commit

Permalink
ath6kl: add the device ID on the data command packet
Browse files Browse the repository at this point in the history
The firmware expects the device ID to be added on the
data and command packets sent to firmware for AR6003 v2.1.1.

Signed-off-by: Naveen Singh <nsingh@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Naveen Singh authored and Greg Kroah-Hartman committed Apr 25, 2011
1 parent f3379c3 commit 26e58b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 22 additions & 1 deletion drivers/staging/ath6kl/include/common/wmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ typedef enum {
#define WMI_DATA_HDR_GET_META(h) (((h)->info2 >> WMI_DATA_HDR_META_SHIFT) & WMI_DATA_HDR_META_MASK)
#define WMI_DATA_HDR_SET_META(h, _v) ((h)->info2 = ((h)->info2 & ~(WMI_DATA_HDR_META_MASK << WMI_DATA_HDR_META_SHIFT)) | ((_v) << WMI_DATA_HDR_META_SHIFT))

/* Macros for operating on WMI_DATA_HDR (info3) field */
#define WMI_DATA_HDR_DEVID_MASK 0xF
#define WMI_DATA_HDR_DEVID_SHIFT 0
#define GET_DEVID(_v) ((_v) & WMI_DATA_HDR_DEVID_MASK)

#define WMI_DATA_HDR_GET_DEVID(h) \
(((h)->info3 >> WMI_DATA_HDR_DEVID_SHIFT) & WMI_DATA_HDR_DEVID_MASK)
#define WMI_DATA_HDR_SET_DEVID(h, _v) \
((h)->info3 = ((h)->info3 & ~(WMI_DATA_HDR_DEVID_MASK << WMI_DATA_HDR_DEVID_SHIFT)) | (GET_DEVID(_v) << WMI_DATA_HDR_DEVID_SHIFT))

typedef PREPACK struct {
s8 rssi;
u8 info; /* usage of 'info' field(8-bit):
Expand All @@ -171,7 +181,7 @@ typedef PREPACK struct {
* b12 - A-MSDU?
* b15:b13 - META_DATA_VERSION 0 - 7
*/
u16 reserved;
u16 info3;
} POSTPACK WMI_DATA_HDR;

/*
Expand Down Expand Up @@ -255,6 +265,17 @@ typedef PREPACK struct {


#define WMI_GET_DEVICE_ID(info1) ((info1) & 0xF)
/* Macros for operating on WMI_CMD_HDR (info1) field */
#define WMI_CMD_HDR_DEVID_MASK 0xF
#define WMI_CMD_HDR_DEVID_SHIFT 0
#define GET_CMD_DEVID(_v) ((_v) & WMI_CMD_HDR_DEVID_MASK)

#define WMI_CMD_HDR_GET_DEVID(h) \
(((h)->info1 >> WMI_CMD_HDR_DEVID_SHIFT) & WMI_CMD_HDR_DEVID_MASK)
#define WMI_CMD_HDR_SET_DEVID(h, _v) \
((h)->info1 = ((h)->info1 & \
~(WMI_CMD_HDR_DEVID_MASK << WMI_CMD_HDR_DEVID_SHIFT)) | \
(GET_CMD_DEVID(_v) << WMI_CMD_HDR_DEVID_SHIFT))

/*
* Control Path
Expand Down
4 changes: 3 additions & 1 deletion drivers/staging/ath6kl/wmi/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, u8 msgType, bool bMoreData,
}

WMI_DATA_HDR_SET_META(dtHdr, metaVersion);
//dtHdr->rssi = 0;

dtHdr->info3 = 0;

return (0);
}
Expand Down Expand Up @@ -2986,6 +2987,7 @@ wmi_dataSync_send(struct wmi_t *wmip, void *osbuf, HTC_ENDPOINT_ID eid)
dtHdr->info =
(SYNC_MSGTYPE & WMI_DATA_HDR_MSG_TYPE_MASK) << WMI_DATA_HDR_MSG_TYPE_SHIFT;

dtHdr->info3 = 0;
A_DPRINTF(DBG_WMI, (DBGFMT "Enter - eid %d\n", DBGARG, eid));

return (A_WMI_CONTROL_TX(wmip->wmi_devt, osbuf, eid));
Expand Down

0 comments on commit 26e58b5

Please sign in to comment.