diff options
Diffstat (limited to 'drivers/staging/vt6656/mac.c')
-rw-r--r-- | drivers/staging/vt6656/mac.c | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c index 5cacf6e60e90..639172fad0f3 100644 --- a/drivers/staging/vt6656/mac.c +++ b/drivers/staging/vt6656/mac.c @@ -35,12 +35,13 @@ * Return Value: none * */ -void vnt_mac_set_filter(struct vnt_private *priv, u64 mc_filter) +int vnt_mac_set_filter(struct vnt_private *priv, u64 mc_filter) { __le64 le_mc = cpu_to_le64(mc_filter); - vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_MAR0, - MESSAGE_REQUEST_MACREG, sizeof(le_mc), (u8 *)&le_mc); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_MAR0, + MESSAGE_REQUEST_MACREG, sizeof(le_mc), + (u8 *)&le_mc); } /* @@ -54,20 +55,21 @@ void vnt_mac_set_filter(struct vnt_private *priv, u64 mc_filter) * * */ -void vnt_mac_shutdown(struct vnt_private *priv) +int vnt_mac_shutdown(struct vnt_private *priv) { - vnt_control_out(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL); + return vnt_control_out(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL); } -void vnt_mac_set_bb_type(struct vnt_private *priv, u8 type) +int vnt_mac_set_bb_type(struct vnt_private *priv, u8 type) { u8 data[2]; data[0] = type; data[1] = EnCFG_BBType_MASK; - vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), + data); } /* @@ -84,10 +86,10 @@ void vnt_mac_set_bb_type(struct vnt_private *priv, u8 type) * Return Value: none * */ -void vnt_mac_disable_keyentry(struct vnt_private *priv, u8 entry_idx) +int vnt_mac_disable_keyentry(struct vnt_private *priv, u8 entry_idx) { - vnt_control_out(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0, - sizeof(entry_idx), &entry_idx); + return vnt_control_out(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0, + sizeof(entry_idx), &entry_idx); } /* @@ -104,8 +106,8 @@ void vnt_mac_disable_keyentry(struct vnt_private *priv, u8 entry_idx) * Return Value: none * */ -void vnt_mac_set_keyentry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx, - u32 key_idx, u8 *addr, u8 *key) +int vnt_mac_set_keyentry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx, + u32 key_idx, u8 *addr, u8 *key) { struct vnt_mac_set_key set_key; u16 offset; @@ -124,9 +126,9 @@ void vnt_mac_set_keyentry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx, dev_dbg(&priv->usb->dev, "offset %d key ctl %d set key %24ph\n", offset, key_ctl, (u8 *)&set_key); - vnt_control_out(priv, MESSAGE_TYPE_SETKEY, offset, - (u16)key_idx, sizeof(struct vnt_mac_set_key), - (u8 *)&set_key); + return vnt_control_out(priv, MESSAGE_TYPE_SETKEY, offset, + (u16)key_idx, sizeof(struct vnt_mac_set_key), + (u8 *)&set_key); } int vnt_mac_reg_bits_off(struct vnt_private *priv, u8 reg_ofs, u8 bits) @@ -151,76 +153,76 @@ int vnt_mac_reg_bits_on(struct vnt_private *priv, u8 reg_ofs, u8 bits) MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_write_word(struct vnt_private *priv, u8 reg_ofs, u16 word) +int vnt_mac_write_word(struct vnt_private *priv, u8 reg_ofs, u16 word) { u8 data[2]; data[0] = (u8)(word & 0xff); data[1] = (u8)(word >> 8); - vnt_control_out(priv, MESSAGE_TYPE_WRITE, reg_ofs, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE, reg_ofs, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_set_bssid_addr(struct vnt_private *priv, u8 *addr) +int vnt_mac_set_bssid_addr(struct vnt_private *priv, u8 *addr) { - vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_BSSID0, - MESSAGE_REQUEST_MACREG, ETH_ALEN, addr); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_BSSID0, + MESSAGE_REQUEST_MACREG, ETH_ALEN, addr); } -void vnt_mac_enable_protect_mode(struct vnt_private *priv) +int vnt_mac_enable_protect_mode(struct vnt_private *priv) { u8 data[2]; data[0] = EnCFG_ProtectMd; data[1] = EnCFG_ProtectMd; - vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_disable_protect_mode(struct vnt_private *priv) +int vnt_mac_disable_protect_mode(struct vnt_private *priv) { u8 data[2]; data[0] = 0; data[1] = EnCFG_ProtectMd; - vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_enable_barker_preamble_mode(struct vnt_private *priv) +int vnt_mac_enable_barker_preamble_mode(struct vnt_private *priv) { u8 data[2]; data[0] = EnCFG_BarkerPream; data[1] = EnCFG_BarkerPream; - vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_disable_barker_preamble_mode(struct vnt_private *priv) +int vnt_mac_disable_barker_preamble_mode(struct vnt_private *priv) { u8 data[2]; data[0] = 0; data[1] = EnCFG_BarkerPream; - vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } -void vnt_mac_set_beacon_interval(struct vnt_private *priv, u16 interval) +int vnt_mac_set_beacon_interval(struct vnt_private *priv, u16 interval) { u8 data[2]; data[0] = (u8)(interval & 0xff); data[1] = (u8)(interval >> 8); - vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_BI, - MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); + return vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_BI, + MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data); } int vnt_mac_set_led(struct vnt_private *priv, u8 state, u8 led) |