From owner-svn-src-all@FreeBSD.ORG Sun Mar 18 19:35:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 202131065673; Sun, 18 Mar 2012 19:35:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B33B8FC14; Sun, 18 Mar 2012 19:35:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2IJZUdm033082; Sun, 18 Mar 2012 19:35:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2IJZUbr033080; Sun, 18 Mar 2012 19:35:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201203181935.q2IJZUbr033080@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 Mar 2012 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233129 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:35:31 -0000 Author: adrian Date: Sun Mar 18 19:35:30 2012 New Revision: 233129 URL: http://svn.freebsd.org/changeset/base/233129 Log: Add a missing endian conversion. Modified: head/sys/net80211/ieee80211_alq.h Modified: head/sys/net80211/ieee80211_alq.h ============================================================================== --- head/sys/net80211/ieee80211_alq.h Sun Mar 18 19:28:52 2012 (r233128) +++ head/sys/net80211/ieee80211_alq.h Sun Mar 18 19:35:30 2012 (r233129) @@ -27,7 +27,10 @@ #ifndef __IEEE80211_ALQ_H__ #define __IEEE80211_ALQ_H__ -#define IEEE80211_ALQ_PAYLOAD_SIZE 24 +/* + * 64 byte ieee80211_alq_rec size. + */ +#define IEEE80211_ALQ_PAYLOAD_SIZE 52 /* * timestamp @@ -50,4 +53,124 @@ struct ieee80211_alq_rec { extern void ieee80211_alq_log(struct ieee80211vap *vap, uint8_t op, u_char *p, int l); +/* + * Debugging entry points + */ + +/* + * This should be called by the driver on each RX frame. + */ +#define IEEE80211_ALQ_OP_RXFRAME 0x1 +#define IEEE80211_ALQ_OP_TXFRAME 0x2 +#define IEEE80211_ALQ_OP_TXCOMPLETE 0x3 +#define IEEE80211_ALQ_OP_TX_BAW 0x4 + +/* Driver-specific - for descriptor contents, etc */ +#define IEEE80211_ALQ_OP_RX_DESC 0x81 +#define IEEE80211_ALQ_OP_TX_DESC 0x82 +#define IEEE80211_ALQ_OP_TX_DESCCOMP 0x83 + +struct ieee80211_alq_rx_frame_struct { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint8_t rxq; /* Driver-specific RX queue */ + uint8_t pad[3]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + +struct ieee80211_alq_tx_frame { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint32_t tx_flags; /* Driver-specific TX flags */ + uint8_t txq; /* Driver-specific TX queue */ + uint8_t pad[3]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + +struct ieee80211_alq_tx_frame_complete { + uint64_t tsf; /* Network order */ + uintptr_t bf; /* Driver-specific buffer ptr */ + uint8_t txq; /* Driver-specific TX queue */ + uint8_t txstatus; /* driver-specific TX status */ + uint8_t pad[2]; /* Pad alignment */ + struct ieee80211_qosframe wh; /* XXX 4 bytes, QoS? */ +}; + + +/* + * This is used for frame RX. + */ +static inline void +ieee80211_alq_rx_frame(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t rxq) +{ + struct ieee80211_alq_rx_frame_struct rf; + + memset(&rf, 0, sizeof(rf)); + rf.tsf = htole64(tsf); + rf.bf = (uintptr_t) bf; + rf.rxq = rxq; + memcpy(&rf.wh, wh, sizeof(struct ieee80211_qosframe)); + ieee80211_alq_log(vap, IEEE80211_ALQ_OP_RXFRAME, (char *) &rf, + sizeof(rf)); +} + +/* + * Frame TX scheduling + */ +static inline void +ieee80211_alq_tx_frame(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, + uint32_t tx_flags) +{ + +} + +/* + * Frame TX completion + */ +static inline void +ieee80211_alq_tx_frame_comp(struct ieee80211vap *vap, + struct ieee80211_frame *wh, uint64_t tsf, void *bf, uint8_t txq, + uint8_t tx_status) +{ + +} + +struct ieee80211_alq_tx_baw_note_struct { + uintptr_t bf; + uint8_t tid; + uint8_t what; + uint16_t baw; + uint16_t wnd; + uint16_t new_baw; +}; + +/* + * TX BAW noting - add, remove, etc + */ + +#define IEEE80211_ALQ_TX_BAW_ADD 0x1 +#define IEEE80211_ALQ_TX_BAW_COMPLETE 0x2 + +static inline void +ieee80211_alq_tx_baw_note(struct ieee80211vap *vap, + struct ieee80211_frame *wh, void *bf, uint8_t tid, uint8_t what, + uint16_t baw, uint16_t wnd, uint16_t new_baw) +{ + struct ieee80211_alq_tx_baw_note_struct tb; + + memset(&tb, 0, sizeof(tb)); + + tb.bf = (uintptr_t) bf; + tb.tid = tid; + tb.what = what; + tb.baw = htons(baw); + tb.wnd = htons(wnd); + tb.new_baw = htons(new_baw); + + ieee80211_alq_log(vap, IEEE80211_ALQ_OP_TX_BAW, (char *) &tb, + sizeof(tb)); +} + #endif /* __IEEE80211_ALQ_H__ */