2 * CDC network driver ioctl/indication encoding
3 * Broadcom 802.11abg Networking Device Driver
5 * Definitions subject to change without notice.
7 * Copyright (C) 2009, Broadcom Corporation
10 * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
11 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
12 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
13 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
15 * $Id: bcmcdc.h,v 13.14 2007/11/21 02:07:16 Exp $
17 #include <proto/ethernet.h>
19 typedef struct cdc_ioctl
{
20 uint32 cmd
; /* ioctl command value */
21 uint32 len
; /* lower 16: output buflen; upper 16: input buflen (excludes header) */
22 uint32 flags
; /* flag defns given below */
23 uint32 status
; /* status code returned from the device */
26 /* Max valid buffer size that can be sent to the dongle */
27 #define CDC_MAX_MSG_SIZE ETHER_MAX_LEN
29 /* len field is divided into input and output buffer lengths */
30 #define CDCL_IOC_OUTLEN_MASK 0x0000FFFF /* maximum or expected response length, */
31 /* excluding IOCTL header */
32 #define CDCL_IOC_OUTLEN_SHIFT 0
33 #define CDCL_IOC_INLEN_MASK 0xFFFF0000 /* input buffer length, excluding IOCTL header */
34 #define CDCL_IOC_INLEN_SHIFT 16
36 /* CDC flag definitions */
37 #define CDCF_IOC_ERROR 0x01 /* 0=success, 1=ioctl cmd failed */
38 #define CDCF_IOC_SET 0x02 /* 0=get, 1=set cmd */
39 #define CDCF_IOC_ID_MASK 0xFFFF0000 /* used to uniquely id an ioctl req/resp pairing */
40 #define CDCF_IOC_ID_SHIFT 16 /* # of bits of shift for ID Mask */
42 /* Convenient extraction of message ID */
43 #define CDC_IOC_ID(flags) (((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
48 * The BDC header is used on data packets to convey priority across USB.
51 #define BDC_HEADER_LEN 4
53 #define BDC_PROTO_VER 1 /* Protocol version */
55 #define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */
56 #define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */
58 #define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */
59 #define BDC_FLAG_SUM_GOOD 0x04 /* Dongle has verified good RX checksums */
61 #define BDC_FLAG__UNUSED 0x03 /* Unassigned */
63 #define BDC_PRIORITY_MASK 0x7
66 uint8 flags
; /* Flags */
67 uint8 priority
; /* 802.1d Priority (low 3 bits) */