aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2007-06-13 21:11:11 -0400
committerGuido Guenther <agx@sigxcpu.org>2007-06-14 10:11:07 +0200
commite9af9feea34aded2590105d6da13de575e2fc025 (patch)
tree027da6216617d3ffd2b70a741f04ca3349342443
parent66eecc9d6348e934e51bf51a86e63e5502473c33 (diff)
[PATCH] Fix more instances of bad formatting
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r--at76_usb.c60
1 files changed, 36 insertions, 24 deletions
diff --git a/at76_usb.c b/at76_usb.c
index edc002b..af8369b 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -241,7 +241,7 @@ static int at76_dfu_download_block(struct dfu_ctx *ctx, u8 *buffer, int bytes,
memcpy(tmpbuf, buffer, bytes);
- result = usb_control_msg(udev, usb_sndctrlpipe(udev,0),
+ result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
DFU_DNLOAD,
USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE,
block, /* Value */
@@ -299,7 +299,8 @@ static struct dfu_ctx *at76_dfu_alloc_ctx(struct usb_device *udev)
{
struct dfu_ctx *ctx;
- ctx = kmalloc(sizeof(struct dfu_ctx) + DFU_PACKETSIZE, GFP_KERNEL|GFP_DMA);
+ ctx = kmalloc(sizeof(struct dfu_ctx) + DFU_PACKETSIZE,
+ GFP_KERNEL | GFP_DMA);
if (ctx) {
ctx->udev = udev;
ctx->buf = &(ctx[1]);
@@ -642,7 +643,7 @@ static inline int at76_get_hw_cfg_rfmd(struct usb_device *udev,
static inline int get_hw_cfg_intersil(struct usb_device *udev,
union at76_hwcfg *buf, int buf_size)
{
- return usb_control_msg(udev, usb_rcvctrlpipe(udev,0),
+ return usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
0x33, INTERFACE_VENDOR_REQUEST_IN,
((0x09 << 8) | 0x02), 0,
buf, buf_size, USB_CTRL_GET_TIMEOUT);
@@ -709,10 +710,10 @@ static int at76_get_hw_config(struct at76_priv *priv)
static struct reg_domain const *at76_get_reg_domain(u16 code)
{
static struct reg_domain const fd_tab[] = {
- {0x10, "FCC (U.S)", 0x7ff}, /* ch 1-11 */
+ {0x10, "FCC (USA)", 0x7ff}, /* ch 1-11 */
{0x20, "IC (Canada)", 0x7ff}, /* ch 1-11 */
- {0x30, "ETSI (Europe - (Spain+France)", 0x1fff}, /* ch 1-13 */
- {0x31, "Spain", 0x600}, /* ch 10,11 */
+ {0x30, "ETSI (Europe except Spain and France)", 0x1fff}, /* ch 1-13 */
+ {0x31, "Spain", 0x600}, /* ch 10-11 */
{0x32, "France", 0x1e00}, /* ch 10-13 */
{0x40, "MKK (Japan)", 0x2000}, /* ch 14 */
{0x41, "MKK1 (Japan)", 0x3fff}, /* ch 1-14 */
@@ -1573,7 +1574,7 @@ static int at76_start_ibss(struct at76_priv *priv)
ret = at76_wait_completion(priv, CMD_START_IBSS);
if (ret != CMD_STATUS_COMPLETE) {
- err("%s start_ibss failed to complete,%d",
+ err("%s start_ibss failed to complete, %d",
priv->netdev->name, ret);
return ret;
}
@@ -1867,7 +1868,8 @@ static int at76_assoc_req(struct at76_priv *priv, struct bss_info *bss)
tlv = req->info_element;
/* make wireless header */
- mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_ASSOC_REQ);
+ mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+ IEEE80211_STYPE_ASSOC_REQ);
mgmt->duration_id = cpu_to_le16(0x8000);
memcpy(mgmt->addr1, bss->bssid, ETH_ALEN);
@@ -1945,7 +1947,8 @@ static int at76_reassoc_req(struct at76_priv *priv, struct bss_info *curr_bss,
/* make wireless header */
/* jal: encrypt this packet if wep_enabled is TRUE ??? */
- mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_REASSOC_REQ);
+ mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+ IEEE80211_STYPE_REASSOC_REQ);
mgmt->duration_id = cpu_to_le16(0x8000);
memcpy(mgmt->addr1, new_bss->bssid, ETH_ALEN);
memcpy(mgmt->addr2, priv->netdev->dev_addr, ETH_ALEN);
@@ -1978,7 +1981,7 @@ static int at76_reassoc_req(struct at76_priv *priv, struct bss_info *curr_bss,
next_ie(&tlv);
/* init. at76_priv tx header */
- tx_buffer->wlength = cpu_to_le16((u8 *)tlv-(u8 *)mgmt);
+ tx_buffer->wlength = cpu_to_le16((u8 *)tlv - (u8 *)mgmt);
tlv = req->info_element;
len = min_t(int, IW_ESSID_MAX_SIZE, tlv->len);
@@ -2015,7 +2018,8 @@ static int at76_disassoc_req(struct at76_priv *priv, struct bss_info *bss)
mgmt = &req->header;
/* make wireless header */
- mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT|IEEE80211_STYPE_AUTH);
+ mgmt->frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
+ IEEE80211_STYPE_AUTH);
mgmt->duration_id = cpu_to_le16(0x8000);
memcpy(mgmt->addr1, bss->bssid, ETH_ALEN);
memcpy(mgmt->addr2, priv->netdev->dev_addr, ETH_ALEN);
@@ -2252,7 +2256,7 @@ static void at76_delete_device(struct at76_priv *priv)
/* signal to _stop() that the device is gone */
priv->device_unplugged = 1;
- at76_dbg(DBG_PROC_ENTRY, "%s: ENTER",__FUNCTION__);
+ at76_dbg(DBG_PROC_ENTRY, "%s: ENTER", __FUNCTION__);
if (priv->netdev_registered) {
unregister_netdev(priv->netdev);
@@ -3719,7 +3723,7 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev)
int submit_len;
struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
struct ieee80211_hdr_3addr *i802_11_hdr =
- (struct ieee80211_hdr_3addr *)&(tx_buffer->packet);
+ (struct ieee80211_hdr_3addr *)(&tx_buffer->packet);
u8 *payload = tx_buffer->packet + sizeof(struct ieee80211_hdr_3addr);
if (netif_queue_stopped(netdev)) {
@@ -3757,8 +3761,10 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev)
if (skb->data[2 * ETH_ALEN + 2] == rfc1042sig[0] &&
skb->data[2 * ETH_ALEN + 2 + 1] == rfc1042sig[1]) {
/* higher layer delivered SNAP header - keep it */
- memcpy(payload, skb->data + 2*ETH_ALEN+2, skb->len - 2*ETH_ALEN -2);
- wlen = sizeof(struct ieee80211_hdr_3addr) + skb->len - 2*ETH_ALEN -2;
+ memcpy(payload, skb->data + 2 * ETH_ALEN + 2,
+ skb->len - 2 * ETH_ALEN - 2);
+ wlen = sizeof(struct ieee80211_hdr_3addr) + skb->len -
+ 2 * ETH_ALEN - 2;
} else {
err("%s: %s: no support for non-SNAP 802.2 packets "
"(DSAP x%02x SSAP x%02x cntrl x%02x)",
@@ -3773,9 +3779,9 @@ static int at76_tx(struct sk_buff *skb, struct net_device *netdev)
/* add RFC 1042 header in front */
memcpy(payload, rfc1042sig, sizeof(rfc1042sig));
memcpy(payload + sizeof(rfc1042sig),
- skb->data + 2*ETH_ALEN, skb->len - 2*ETH_ALEN);
+ skb->data + 2 * ETH_ALEN, skb->len - 2 * ETH_ALEN);
wlen = sizeof(struct ieee80211_hdr_3addr) + sizeof(rfc1042sig) +
- skb->len - 2*ETH_ALEN;
+ skb->len - 2 * ETH_ALEN;
}
/* make wireless header */
@@ -5066,7 +5072,8 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
if (priv->curr_bss == NULL)
goto rx_mgmt_beacon_end;
if (!compare_ether_addr(priv->curr_bss->bssid, mgmt->addr3)) {
- mod_timer(&priv->mgmt_timer, jiffies+BEACON_TIMEOUT*HZ);
+ mod_timer(&priv->mgmt_timer,
+ jiffies + BEACON_TIMEOUT * HZ);
priv->curr_bss->rssi = buf->rssi;
priv->beacons_received++;
goto rx_mgmt_beacon_end;
@@ -5089,9 +5096,11 @@ static void at76_rx_mgmt_beacon(struct at76_priv *priv,
if (match == NULL) {
/* haven't found the bss in the list */
- if ((match=kmalloc(sizeof(struct bss_info), GFP_ATOMIC)) == NULL) {
- at76_dbg(DBG_BSS_TABLE, "%s: cannot kmalloc new bss info (%zd byte)",
- priv->netdev->name, sizeof(struct bss_info));
+ match = kmalloc(sizeof(struct bss_info), GFP_ATOMIC);
+ if (!match) {
+ at76_dbg(DBG_BSS_TABLE,
+ "%s: cannot kmalloc new bss info (%zd byte)",
+ priv->netdev->name, sizeof(struct bss_info));
goto rx_mgmt_beacon_end;
}
memset(match, 0, sizeof(*match));
@@ -5533,7 +5542,9 @@ static struct sk_buff *at76_check_for_rx_frags(struct at76_priv *priv)
/* determining the oldest entry doesn't cope with jiffies wrapping
but I don't care to delete a young entry at these rare moments ... */
- for(i=0,bptr=priv->rx_data,optr=NULL; i < NR_RX_DATA_BUF; i++,bptr++) {
+ bptr = priv->rx_data;
+ optr = NULL;
+ for (i = 0; i < NR_RX_DATA_BUF; i++, bptr++) {
if (bptr->skb != NULL) {
if (!compare_ether_addr(i802_11_hdr->addr2, bptr->sender))
break;
@@ -5561,14 +5572,15 @@ static struct sk_buff *at76_check_for_rx_frags(struct at76_priv *priv)
if (bptr->seqnr == seqnr) {
int left;
/* the fragment has the current sequence number */
- if (((bptr->fragnr+1)&0xf) == fragnr) {
+ if (((bptr->fragnr + 1) & 0xf) == fragnr) {
bptr->last_rx = jiffies;
/* the next following fragment number ->
add the data at the end */
/* is & 0xf necessary above ??? */
/* for test only ??? */
- if ((left=skb_tailroom(bptr->skb)) < data_len) {
+ left = skb_tailroom(bptr->skb);
+ if (left < data_len) {
info("%s: only %d byte free (need %d)",
priv->netdev->name, left, data_len);
} else