aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--at76_usb.c29
-rw-r--r--at76_usb.h4
2 files changed, 15 insertions, 18 deletions
diff --git a/at76_usb.c b/at76_usb.c
index a60cf25..4f495eb 100644
--- a/at76_usb.c
+++ b/at76_usb.c
@@ -620,7 +620,7 @@ static int at76_get_op_mode(struct usb_device *udev)
/* this loads a block of the second part of the firmware */
static inline int at76_load_ext_fw_block(struct usb_device *udev,
- int i, unsigned char *buf, int bsize)
+ int i, void *buf, int bsize)
{
return usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
0x0e, DEVICE_VENDOR_REQUEST_OUT,
@@ -628,7 +628,7 @@ static inline int at76_load_ext_fw_block(struct usb_device *udev,
}
static inline int at76_get_hw_cfg_rfmd(struct usb_device *udev,
- unsigned char *buf, int buf_size)
+ union at76_hwcfg *buf, int buf_size)
{
return usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
0x33, INTERFACE_VENDOR_REQUEST_IN,
@@ -637,9 +637,8 @@ static inline int at76_get_hw_cfg_rfmd(struct usb_device *udev,
}
/* Intersil boards use a different "value" for GetHWConfig requests */
-static inline
-int get_hw_cfg_intersil(struct usb_device *udev,
- unsigned char *buf, int buf_size)
+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),
0x33, INTERFACE_VENDOR_REQUEST_IN,
@@ -663,7 +662,7 @@ static int at76_get_hw_config(struct at76_priv *dev)
case BOARDTYPE_503_INTERSIL_3861:
case BOARDTYPE_503_INTERSIL_3863:
- ret = get_hw_cfg_intersil(dev->udev, (unsigned char *)&hwcfg->i, sizeof(hwcfg->i));
+ ret = get_hw_cfg_intersil(dev->udev, hwcfg, sizeof(hwcfg->i));
if (ret < 0)
break;
memcpy(dev->mac_addr, hwcfg->i.mac_addr, ETH_ALEN);
@@ -675,7 +674,7 @@ static int at76_get_hw_config(struct at76_priv *dev)
case BOARDTYPE_503_RFMD:
case BOARDTYPE_503_RFMD_ACC:
- ret = at76_get_hw_cfg_rfmd(dev->udev, (unsigned char *)&hwcfg->r3, sizeof(hwcfg->r3));
+ ret = at76_get_hw_cfg_rfmd(dev->udev, hwcfg, sizeof(hwcfg->r3));
if (ret < 0)
break;
memcpy(dev->cr20_values, hwcfg->r3.cr20_values, 14);
@@ -691,7 +690,7 @@ static int at76_get_hw_config(struct at76_priv *dev)
case BOARDTYPE_505_RFMD:
case BOARDTYPE_505_RFMD_2958:
case BOARDTYPE_505A_RFMD_2958:
- ret = at76_get_hw_cfg_rfmd(dev->udev, (unsigned char *)&hwcfg->r5, sizeof(hwcfg->r5));
+ ret = at76_get_hw_cfg_rfmd(dev->udev, hwcfg, sizeof(hwcfg->r5));
if (ret < 0)
break;
memcpy(dev->cr39_values, hwcfg->r5.cr39_values, 14);
@@ -812,7 +811,7 @@ static int at76_download_external_fw(struct usb_device *udev, u8 *buf, int size)
}
static int at76_set_card_command(struct usb_device *udev, int cmd,
- unsigned char *buf, int buf_size)
+ void *buf, int buf_size)
{
int ret;
struct at76_command *cmd_buf =
@@ -1536,8 +1535,7 @@ static int at76_start_scan(struct at76_priv *dev, int use_essid, int ir_step)
le16_to_cpu(scan.min_channel_time),
le16_to_cpu(scan.max_channel_time));
- return at76_set_card_command(dev->udev, CMD_SCAN,
- (unsigned char *)&scan, sizeof(scan));
+ return at76_set_card_command(dev->udev, CMD_SCAN, &scan, sizeof(scan));
}
static int at76_start_ibss(struct at76_priv *dev)
@@ -1551,8 +1549,8 @@ static int at76_start_ibss(struct at76_priv *dev)
bss.bss_type = ADHOC_MODE;
bss.channel = dev->channel;
- return at76_set_card_command(dev->udev, CMD_START_IBSS,
- (unsigned char*)&bss, sizeof(struct at76_start_bss));
+ return at76_set_card_command(dev->udev, CMD_START_IBSS, &bss,
+ sizeof(struct at76_start_bss));
}
/* idx points into dev->bss */
@@ -1573,8 +1571,7 @@ static int at76_join_bss(struct at76_priv *dev, struct bss_info *ptr)
at76_dbg(DBG_PROGRESS, "%s join addr %s ssid %s type %d ch %d timeout %d",
dev->netdev->name, mac2str(join.bssid),
join.essid, join.bss_type, join.channel, le16_to_cpu(join.timeout));
- return at76_set_card_command(dev->udev, CMD_JOIN,
- (unsigned char*)&join,
+ return at76_set_card_command(dev->udev, CMD_JOIN, &join,
sizeof(struct at76_join));
}
@@ -4306,7 +4303,7 @@ static int at76_startup_device(struct at76_priv *dev)
ccfg->short_preamble = dev->preamble_type;
ccfg->beacon_period = cpu_to_le16(dev->beacon_period);
- ret = at76_set_card_command(dev->udev, CMD_STARTUP, (unsigned char *)&dev->card_config,
+ ret = at76_set_card_command(dev->udev, CMD_STARTUP, &dev->card_config,
sizeof(struct at76_card_config));
if (ret < 0) {
err("%s: at76_set_card_command failed: %d", dev->netdev->name, ret);
diff --git a/at76_usb.h b/at76_usb.h
index a9bae2e..944e41f 100644
--- a/at76_usb.h
+++ b/at76_usb.h
@@ -475,7 +475,7 @@ struct at76_priv {
struct sk_buff *rx_skb; /* skbuff for receiving packets */
__u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */
- unsigned char *bulk_out_buffer; /* the buffer to send data */
+ void *bulk_out_buffer; /* the buffer to send data */
int bulk_out_size; /* the size of the send buffer */
struct urb *write_urb; /* the urb used to send data */
struct urb *read_urb;
@@ -492,7 +492,7 @@ struct at76_priv {
struct tasklet_struct tasklet;
struct urb *rx_urb; /* tmp urb pointer for rx_tasklet */
- unsigned char *ctrl_buffer;
+ void *ctrl_buffer;
struct urb *ctrl_urb;
u8 op_mode;