diff options
| author | Hante Meuleman <meuleman@broadcom.com> | 2013-11-29 06:25:21 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2013-12-02 14:25:25 -0500 |
| commit | aec87ce2f38c54dc7ef9bff2038e3b102a4e6c0c (patch) | |
| tree | 7bd303320ff4d61ffc26a86769dac5acebcd1eae | |
| parent | 5ca85216b173ebac0aa523e4dd826d82d530a465 (diff) | |
brcmfmac: Use consistent naming for BCDC.
The BCDC protocol layer is using a mix of naming of CDC, BDC and
BCDC. Use the name BCDC consistenly over all functions, defines
and variables. This patch does not change code functionality.
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
| -rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/bcdc.c | 195 | ||||
| -rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h | 2 | ||||
| -rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h | 4 |
3 files changed, 95 insertions, 106 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c index b5a252908777..06848e426f9a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | #include "proto.h" | 33 | #include "proto.h" |
| 34 | #include "bcdc.h" | 34 | #include "bcdc.h" |
| 35 | 35 | ||
| 36 | struct brcmf_proto_cdc_dcmd { | 36 | struct brcmf_proto_bcdc_dcmd { |
| 37 | __le32 cmd; /* dongle command value */ | 37 | __le32 cmd; /* dongle command value */ |
| 38 | __le32 len; /* lower 16: output buflen; | 38 | __le32 len; /* lower 16: output buflen; |
| 39 | * upper 16: input buflen (excludes header) */ | 39 | * upper 16: input buflen (excludes header) */ |
| @@ -42,47 +42,47 @@ struct brcmf_proto_cdc_dcmd { | |||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | /* Max valid buffer size that can be sent to the dongle */ | 44 | /* Max valid buffer size that can be sent to the dongle */ |
| 45 | #define CDC_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN) | 45 | #define BCDC_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN) |
| 46 | 46 | ||
| 47 | /* CDC flag definitions */ | 47 | /* BCDC flag definitions */ |
| 48 | #define CDC_DCMD_ERROR 0x01 /* 1=cmd failed */ | 48 | #define BCDC_DCMD_ERROR 0x01 /* 1=cmd failed */ |
| 49 | #define CDC_DCMD_SET 0x02 /* 0=get, 1=set cmd */ | 49 | #define BCDC_DCMD_SET 0x02 /* 0=get, 1=set cmd */ |
| 50 | #define CDC_DCMD_IF_MASK 0xF000 /* I/F index */ | 50 | #define BCDC_DCMD_IF_MASK 0xF000 /* I/F index */ |
| 51 | #define CDC_DCMD_IF_SHIFT 12 | 51 | #define BCDC_DCMD_IF_SHIFT 12 |
| 52 | #define CDC_DCMD_ID_MASK 0xFFFF0000 /* id an cmd pairing */ | 52 | #define BCDC_DCMD_ID_MASK 0xFFFF0000 /* id an cmd pairing */ |
| 53 | #define CDC_DCMD_ID_SHIFT 16 /* ID Mask shift bits */ | 53 | #define BCDC_DCMD_ID_SHIFT 16 /* ID Mask shift bits */ |
| 54 | #define CDC_DCMD_ID(flags) \ | 54 | #define BCDC_DCMD_ID(flags) \ |
| 55 | (((flags) & CDC_DCMD_ID_MASK) >> CDC_DCMD_ID_SHIFT) | 55 | (((flags) & BCDC_DCMD_ID_MASK) >> BCDC_DCMD_ID_SHIFT) |
| 56 | 56 | ||
| 57 | /* | 57 | /* |
| 58 | * BDC header - Broadcom specific extension of CDC. | 58 | * BCDC header - Broadcom specific extension of CDC. |
| 59 | * Used on data packets to convey priority across USB. | 59 | * Used on data packets to convey priority across USB. |
| 60 | */ | 60 | */ |
| 61 | #define BDC_HEADER_LEN 4 | 61 | #define BCDC_HEADER_LEN 4 |
| 62 | #define BDC_PROTO_VER 2 /* Protocol version */ | 62 | #define BCDC_PROTO_VER 2 /* Protocol version */ |
| 63 | #define BDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */ | 63 | #define BCDC_FLAG_VER_MASK 0xf0 /* Protocol version mask */ |
| 64 | #define BDC_FLAG_VER_SHIFT 4 /* Protocol version shift */ | 64 | #define BCDC_FLAG_VER_SHIFT 4 /* Protocol version shift */ |
| 65 | #define BDC_FLAG_SUM_GOOD 0x04 /* Good RX checksums */ | 65 | #define BCDC_FLAG_SUM_GOOD 0x04 /* Good RX checksums */ |
| 66 | #define BDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */ | 66 | #define BCDC_FLAG_SUM_NEEDED 0x08 /* Dongle needs to do TX checksums */ |
| 67 | #define BDC_PRIORITY_MASK 0x7 | 67 | #define BCDC_PRIORITY_MASK 0x7 |
| 68 | #define BDC_FLAG2_IF_MASK 0x0f /* packet rx interface in APSTA */ | 68 | #define BCDC_FLAG2_IF_MASK 0x0f /* packet rx interface in APSTA */ |
| 69 | #define BDC_FLAG2_IF_SHIFT 0 | 69 | #define BCDC_FLAG2_IF_SHIFT 0 |
| 70 | 70 | ||
| 71 | #define BDC_GET_IF_IDX(hdr) \ | 71 | #define BCDC_GET_IF_IDX(hdr) \ |
| 72 | ((int)((((hdr)->flags2) & BDC_FLAG2_IF_MASK) >> BDC_FLAG2_IF_SHIFT)) | 72 | ((int)((((hdr)->flags2) & BCDC_FLAG2_IF_MASK) >> BCDC_FLAG2_IF_SHIFT)) |
| 73 | #define BDC_SET_IF_IDX(hdr, idx) \ | 73 | #define BCDC_SET_IF_IDX(hdr, idx) \ |
| 74 | ((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \ | 74 | ((hdr)->flags2 = (((hdr)->flags2 & ~BCDC_FLAG2_IF_MASK) | \ |
| 75 | ((idx) << BDC_FLAG2_IF_SHIFT))) | 75 | ((idx) << BCDC_FLAG2_IF_SHIFT))) |
| 76 | 76 | ||
| 77 | /** | 77 | /** |
| 78 | * struct brcmf_proto_bdc_header - BDC header format | 78 | * struct brcmf_proto_bcdc_header - BCDC header format |
| 79 | * | 79 | * |
| 80 | * @flags: flags contain protocol and checksum info. | 80 | * @flags: flags contain protocol and checksum info. |
| 81 | * @priority: 802.1d priority and USB flow control info (bit 4:7). | 81 | * @priority: 802.1d priority and USB flow control info (bit 4:7). |
| 82 | * @flags2: additional flags containing dongle interface index. | 82 | * @flags2: additional flags containing dongle interface index. |
| 83 | * @data_offset: start of packet data. header is following by firmware signals. | 83 | * @data_offset: start of packet data. header is following by firmware signals. |
| 84 | */ | 84 | */ |
| 85 | struct brcmf_proto_bdc_header { | 85 | struct brcmf_proto_bcdc_header { |
| 86 | u8 flags; | 86 | u8 flags; |
| 87 | u8 priority; | 87 | u8 priority; |
| 88 | u8 flags2; | 88 | u8 flags2; |
| @@ -91,7 +91,7 @@ struct brcmf_proto_bdc_header { | |||
| 91 | 91 | ||
| 92 | /* | 92 | /* |
| 93 | * maximum length of firmware signal data between | 93 | * maximum length of firmware signal data between |
| 94 | * the BDC header and packet data in the tx path. | 94 | * the BCDC header and packet data in the tx path. |
| 95 | */ | 95 | */ |
| 96 | #define BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES 12 | 96 | #define BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES 12 |
| 97 | 97 | ||
| @@ -109,42 +109,42 @@ struct brcmf_proto_bdc_header { | |||
| 109 | struct brcmf_bcdc { | 109 | struct brcmf_bcdc { |
| 110 | u16 reqid; | 110 | u16 reqid; |
| 111 | u8 bus_header[BUS_HEADER_LEN]; | 111 | u8 bus_header[BUS_HEADER_LEN]; |
| 112 | struct brcmf_proto_cdc_dcmd msg; | 112 | struct brcmf_proto_bcdc_dcmd msg; |
| 113 | unsigned char buf[BRCMF_DCMD_MAXLEN + ROUND_UP_MARGIN]; | 113 | unsigned char buf[BRCMF_DCMD_MAXLEN + ROUND_UP_MARGIN]; |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr) | 116 | static int brcmf_proto_bcdc_msg(struct brcmf_pub *drvr) |
| 117 | { | 117 | { |
| 118 | struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd; | 118 | struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd; |
| 119 | int len = le32_to_cpu(bcdc->msg.len) + | 119 | int len = le32_to_cpu(bcdc->msg.len) + |
| 120 | sizeof(struct brcmf_proto_cdc_dcmd); | 120 | sizeof(struct brcmf_proto_bcdc_dcmd); |
| 121 | 121 | ||
| 122 | brcmf_dbg(CDC, "Enter\n"); | 122 | brcmf_dbg(BCDC, "Enter\n"); |
| 123 | 123 | ||
| 124 | /* NOTE : cdc->msg.len holds the desired length of the buffer to be | 124 | /* NOTE : bcdc->msg.len holds the desired length of the buffer to be |
| 125 | * returned. Only up to CDC_MAX_MSG_SIZE of this buffer area | 125 | * returned. Only up to BCDC_MAX_MSG_SIZE of this buffer area |
| 126 | * is actually sent to the dongle | 126 | * is actually sent to the dongle |
| 127 | */ | 127 | */ |
| 128 | if (len > CDC_MAX_MSG_SIZE) | 128 | if (len > BCDC_MAX_MSG_SIZE) |
| 129 | len = CDC_MAX_MSG_SIZE; | 129 | len = BCDC_MAX_MSG_SIZE; |
| 130 | 130 | ||
| 131 | /* Send request */ | 131 | /* Send request */ |
| 132 | return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&bcdc->msg, len); | 132 | return brcmf_bus_txctl(drvr->bus_if, (unsigned char *)&bcdc->msg, len); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len) | 135 | static int brcmf_proto_bcdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len) |
| 136 | { | 136 | { |
| 137 | int ret; | 137 | int ret; |
| 138 | struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd; | 138 | struct brcmf_bcdc *bcdc = (struct brcmf_bcdc *)drvr->proto->pd; |
| 139 | 139 | ||
| 140 | brcmf_dbg(CDC, "Enter\n"); | 140 | brcmf_dbg(BCDC, "Enter\n"); |
| 141 | len += sizeof(struct brcmf_proto_cdc_dcmd); | 141 | len += sizeof(struct brcmf_proto_bcdc_dcmd); |
| 142 | do { | 142 | do { |
| 143 | ret = brcmf_bus_rxctl(drvr->bus_if, (unsigned char *)&bcdc->msg, | 143 | ret = brcmf_bus_rxctl(drvr->bus_if, (unsigned char *)&bcdc->msg, |
| 144 | len); | 144 | len); |
| 145 | if (ret < 0) | 145 | if (ret < 0) |
| 146 | break; | 146 | break; |
| 147 | } while (CDC_DCMD_ID(le32_to_cpu(bcdc->msg.flags)) != id); | 147 | } while (BCDC_DCMD_ID(le32_to_cpu(bcdc->msg.flags)) != id); |
| 148 | 148 | ||
| 149 | return ret; | 149 | return ret; |
| 150 | } | 150 | } |
| @@ -154,40 +154,40 @@ brcmf_proto_bcdc_query_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd, | |||
| 154 | void *buf, uint len) | 154 | void *buf, uint len) |
| 155 | { | 155 | { |
