/* * Copyright (c) 2004-2011 Atheros Communications Inc. * Copyright (c) 2011 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* NOTE: service ID of 0x0000 is reserved and should never be used */ #define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP, 1) #define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 0) #define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 1) #define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 2) #define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 3) #define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP, 4) #define WMI_MAX_SERVICES 5
#define WMM_NUM_AC 4
/* reserved and used to flush ALL packets */ #define HTC_TX_PACKET_TAG_ALL 0 #define HTC_SERVICE_TX_PACKET_TAG 1 #define HTC_TX_PACKET_TAG_USER_DEFINED (HTC_SERVICE_TX_PACKET_TAG + 9)
/* more packets on this endpoint are being fetched */ #define HTC_RX_FLAGS_INDICATE_MORE_PKTS (1 << 0)
/* TODO.. for BMI */ #define ENDPOINT1 0 /* TODO -remove me, but we have to fix BMI first */ #define HTC_MAILBOX_NUM_MAX 4
/* enable send bundle padding for this endpoint */ #define HTC_FLGS_TX_BNDL_PAD_EN (1 << 0) #define HTC_EP_ACTIVE ((u32) (1u << 31))
/* * The frame header length and message formats defined herein were selected * to accommodate optimal alignment for target processing. This reduces * code size and improves performance. Any changes to the header length may * alter the alignment and cause exceptions on the target. When adding to * the messagestructures insure that fields are properly aligned.
*/
/* HTC frame header * * NOTE: do not remove or re-arrange the fields, these are minimally * required to take advantage of 4-byte lookaheads in some hardware * implementations.
*/ struct htc_frame_hdr {
struct_group_tagged(htc_frame_look_ahead, header, union { struct {
u8 eid;
u8 flags;
/* length of data (including trailer) that follows the header */
__le16 payld_len;
/* * NOTE: The lk_ahd array is guarded by a pre_valid * and Post Valid guard bytes. The pre_valid bytes must * equal the inverse of the post_valid byte.
*/ struct htc_lookahead_report {
u8 pre_valid;
u8 lk_ahd[4];
u8 post_valid;
} __packed;
/* caller's per packet specific context */ void *pkt_cntxt;
/* * the true buffer start , the caller can store the real * buffer start here. In receive callbacks, the HTC layer * sets buf to the start of the payload past the header. * This field allows the caller to reset buf when it recycles * receive packets back to HTC.
*/
u8 *buf_start;
/* * Pointer to the start of the buffer. In the transmit * direction this points to the start of the payload. In the * receive direction, however, the buffer when queued up * points to the start of the HTC header but when returned * to the caller points to the start of the payload
*/
u8 *buf;
u32 buf_len;
/* actual length of payload */
u32 act_len;
/* endpoint that this packet was sent/recv'd from */ enum htc_endpoint_id endpoint;
/* completion status */
int status; union { struct htc_tx_packet_info tx; struct htc_rx_packet_info rx;
} info;
/* * optimization for network-oriented data, the HTC packet * can pass the network buffer corresponding to the HTC packet * lower layers may optimized the transfer knowing this is * a network buffer
*/ struct sk_buff *skb;
};
/* endpoint for this distributionstruct (set by HTC) */ enum htc_endpoint_id endpoint;
u32 dist_flags;
/* * credits for normal operation, anything above this * indicates the endpoint is over-subscribed.
*/ int cred_norm;
/* floor for credit distribution */ int cred_min;
int cred_assngd;
/* current credits available */ int credits;
/* * pending credits to distribute on this endpoint, this * is set by HTC when credit reports arrive. The credit * distribution functions sets this to zero when it distributes * the credits.
*/ int cred_to_dist;
/* * the number of credits that the current pending TX packet needs * to transmit. This is set by HTC when endpoint needs credits in * order to transmit.
*/ int seek_cred;
/* size in bytes of each credit */ int cred_sz;
/* credits required for a maximum sized messages */ int cred_per_msg;
/* reserved for HTC use */ struct htc_endpoint *htc_ep;
/* * current depth of TX queue , i.e. messages waiting for credits * This field is valid only when HTC_CREDIT_DIST_ACTIVITY_CHANGE * or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint * that has non-zero credits to recover.
*/ int txq_depth;
};
/* * credit distribution code that is passed into the distribution function, * there are mandatory and optional codes that must be handled
*/ enum htc_credit_dist_reason {
HTC_CREDIT_DIST_SEND_COMPLETE = 0,
HTC_CREDIT_DIST_ACTIVITY_CHANGE = 1,
HTC_CREDIT_DIST_SEEK_CREDITS,
};
struct ath6kl_htc_credit_info { int total_avail_credits; int cur_free_credits;
/* list of lowest priority endpoints */ struct list_head lowestpri_ep_dist;
};
/* endpoint statistics */ struct htc_endpoint_stats { /* * number of times the host set the credit-low flag in a send * message on this endpoint
*/
u32 cred_low_indicate;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.