~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/staging/brcm80211/brcmfmac/bcmcdc.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2010 Broadcom Corporation
 
3
 *
 
4
 * Permission to use, copy, modify, and/or distribute this software for any
 
5
 * purpose with or without fee is hereby granted, provided that the above
 
6
 * copyright notice and this permission notice appear in all copies.
 
7
 *
 
8
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 
9
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 
10
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 
11
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
12
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 
13
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 
14
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
15
 */
 
16
#include <linux/if_ether.h>
 
17
 
 
18
typedef struct cdc_ioctl {
 
19
        u32 cmd;                /* ioctl command value */
 
20
        u32 len;                /* lower 16: output buflen; upper 16:
 
21
                                 input buflen (excludes header) */
 
22
        u32 flags;              /* flag defns given below */
 
23
        u32 status;             /* status code returned from the device */
 
24
} cdc_ioctl_t;
 
25
 
 
26
/* Max valid buffer size that can be sent to the dongle */
 
27
#define CDC_MAX_MSG_SIZE        (ETH_FRAME_LEN+ETH_FCS_LEN)
 
28
 
 
29
/* len field is divided into input and output buffer lengths */
 
30
#define CDCL_IOC_OUTLEN_MASK   0x0000FFFF       /* maximum or expected
 
31
                                                 response length, */
 
32
                                           /* excluding IOCTL header */
 
33
#define CDCL_IOC_OUTLEN_SHIFT  0
 
34
#define CDCL_IOC_INLEN_MASK    0xFFFF0000       /* input buffer length,
 
35
                                                 excluding IOCTL header */
 
36
#define CDCL_IOC_INLEN_SHIFT   16
 
37
 
 
38
/* CDC flag definitions */
 
39
#define CDCF_IOC_ERROR          0x01    /* 0=success, 1=ioctl cmd failed */
 
40
#define CDCF_IOC_SET            0x02    /* 0=get, 1=set cmd */
 
41
#define CDCF_IOC_IF_MASK        0xF000  /* I/F index */
 
42
#define CDCF_IOC_IF_SHIFT       12
 
43
#define CDCF_IOC_ID_MASK        0xFFFF0000      /* used to uniquely id an ioctl
 
44
                                                 req/resp pairing */
 
45
#define CDCF_IOC_ID_SHIFT       16      /* # of bits of shift for ID Mask */
 
46
 
 
47
#define CDC_IOC_IF_IDX(flags)   \
 
48
        (((flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT)
 
49
#define CDC_IOC_ID(flags)       \
 
50
        (((flags) & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT)
 
51
 
 
52
#define CDC_GET_IF_IDX(hdr) \
 
53
        ((int)((((hdr)->flags) & CDCF_IOC_IF_MASK) >> CDCF_IOC_IF_SHIFT))
 
54
#define CDC_SET_IF_IDX(hdr, idx) \
 
55
        ((hdr)->flags = (((hdr)->flags & ~CDCF_IOC_IF_MASK) | \
 
56
        ((idx) << CDCF_IOC_IF_SHIFT)))
 
57
 
 
58
/*
 
59
 * BDC header
 
60
 *
 
61
 *   The BDC header is used on data packets to convey priority across USB.
 
62
 */
 
63
 
 
64
#define BDC_HEADER_LEN          4
 
65
 
 
66
#define BDC_PROTO_VER           1       /* Protocol version */
 
67
 
 
68
#define BDC_FLAG_VER_MASK       0xf0    /* Protocol version mask */
 
69
#define BDC_FLAG_VER_SHIFT      4       /* Protocol version shift */
 
70
 
 
71
#define BDC_FLAG__UNUSED        0x03    /* Unassigned */
 
72
#define BDC_FLAG_SUM_GOOD       0x04    /* Dongle has verified good
 
73
                                         RX checksums */
 
74
#define BDC_FLAG_SUM_NEEDED     0x08    /* Dongle needs to do TX checksums */
 
75
 
 
76
#define BDC_PRIORITY_MASK       0x7
 
77
 
 
78
#define BDC_FLAG2_FC_FLAG       0x10    /* flag to indicate if pkt contains */
 
79
                                                /* FLOW CONTROL info only */
 
80
#define BDC_PRIORITY_FC_SHIFT   4       /* flow control info shift */
 
81
 
 
82
#define BDC_FLAG2_IF_MASK       0x0f    /* APSTA: interface on which the
 
83
                                         packet was received */
 
84
#define BDC_FLAG2_IF_SHIFT      0
 
85
 
 
86
#define BDC_GET_IF_IDX(hdr) \
 
87
        ((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT))
 
88
#define BDC_SET_IF_IDX(hdr, idx) \
 
89
        ((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \
 
90
        ((idx) << BDC_FLAG2_IF_SHIFT)))
 
91
 
 
92
struct bdc_header {
 
93
        u8 flags;               /* Flags */
 
94
        u8 priority;            /* 802.1d Priority 0:2 bits, 4:7 flow
 
95
                                 control info for usb */
 
96
        u8 flags2;
 
97
        u8 rssi;
 
98
};