Release 4.11 drivers/staging/vt6656/mac.c
/*
* Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* File: mac.c
*
* Purpose: MAC routines
*
* Author: Tevin Chen
*
* Date: May 21, 1996
*
* Functions:
*
* Revision History:
*/
#include <linux/etherdevice.h>
#include "desc.h"
#include "mac.h"
#include "usbpipe.h"
/*
* Description:
* Write MAC Multicast Address Mask
*
* Parameters:
* In:
* mc_filter (mac filter)
* Out:
* none
*
* Return Value: none
*
*/
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Malcolm Priestley | 25 | 56.82% | 5 | 71.43% |
Forest Bond | 18 | 40.91% | 1 | 14.29% |
Andres More | 1 | 2.27% | 1 | 14.29% |
Total | 44 | 100.00% | 7 | 100.00% |
/*
* Description:
* Shut Down MAC
*
* Parameters:
* In:
* Out:
* none
*
*
*/
void vnt_mac_shutdown(struct vnt_private *priv)
{
vnt_control_out(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 17 | 68.00% | 1 | 16.67% |
Malcolm Priestley | 7 | 28.00% | 4 | 66.67% |
Marcos Paulo de Souza | 1 | 4.00% | 1 | 16.67% |
Total | 25 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 62.75% | 1 | 16.67% |
Malcolm Priestley | 19 | 37.25% | 5 | 83.33% |
Total | 51 | 100.00% | 6 | 100.00% |
/*
* Description:
* Disable the Key Entry by MISCFIFO
*
* Parameters:
* In:
* dwIoBase - Base Address for MAC
*
* Out:
* none
*
* Return Value: none
*
*/
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 18 | 56.25% | 1 | 16.67% |
Malcolm Priestley | 14 | 43.75% | 5 | 83.33% |
Total | 32 | 100.00% | 6 | 100.00% |
/*
* Description:
* Set the Key by MISCFIFO
*
* Parameters:
* In:
* dwIoBase - Base Address for MAC
*
* Out:
* none
*
* 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)
{
struct vnt_mac_set_key set_key;
u16 offset;
offset = MISCFIFO_KEYETRY0;
offset += entry_idx * MISCFIFO_KEYENTRYSIZE;
set_key.u.write.key_ctl = cpu_to_le16(key_ctl);
ether_addr_copy(set_key.u.write.addr, addr);
/* swap over swap[0] and swap[1] to get correct write order */
swap(set_key.u.swap[0], set_key.u.swap[1]);
memcpy(set_key.key, key, WLAN_KEY_LEN_CCMP);
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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Malcolm Priestley | 100 | 65.36% | 8 | 66.67% |
Forest Bond | 49 | 32.03% | 1 | 8.33% |
Andres More | 3 | 1.96% | 2 | 16.67% |
Aya Mahfouz | 1 | 0.65% | 1 | 8.33% |
Total | 153 | 100.00% | 12 | 100.00% |
void vnt_mac_reg_bits_off(struct vnt_private *priv, u8 reg_ofs, u8 bits)
{
u8 data[2];
data[0] = 0;
data[1] = bits;
vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data),
data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 59.26% | 1 | 16.67% |
Malcolm Priestley | 22 | 40.74% | 5 | 83.33% |
Total | 54 | 100.00% | 6 | 100.00% |
void vnt_mac_reg_bits_on(struct vnt_private *priv, u8 reg_ofs, u8 bits)
{
u8 data[2];
data[0] = bits;
data[1] = bits;
vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, reg_ofs,
MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 31 | 57.41% | 1 | 16.67% |
Malcolm Priestley | 23 | 42.59% | 5 | 83.33% |
Total | 54 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 43 | 63.24% | 1 | 14.29% |
Malcolm Priestley | 23 | 33.82% | 5 | 71.43% |
Andres More | 2 | 2.94% | 1 | 14.29% |
Total | 68 | 100.00% | 7 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 17 | 58.62% | 1 | 16.67% |
Malcolm Priestley | 12 | 41.38% | 5 | 83.33% |
Total | 29 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 66.67% | 1 | 16.67% |
Malcolm Priestley | 16 | 33.33% | 5 | 83.33% |
Total | 48 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 66.67% | 1 | 16.67% |
Malcolm Priestley | 16 | 33.33% | 5 | 83.33% |
Total | 48 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 66.67% | 1 | 16.67% |
Malcolm Priestley | 16 | 33.33% | 5 | 83.33% |
Total | 48 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 32 | 66.67% | 1 | 16.67% |
Malcolm Priestley | 16 | 33.33% | 5 | 83.33% |
Total | 48 | 100.00% | 6 | 100.00% |
void 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);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 43 | 66.15% | 1 | 16.67% |
Malcolm Priestley | 22 | 33.85% | 5 | 83.33% |
Total | 65 | 100.00% | 6 | 100.00% |
void vnt_mac_set_led(struct vnt_private *priv, u8 state, u8 led)
{
u8 data[2];
data[0] = led;
data[1] = state;
vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_PAPEDELAY,
MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Malcolm Priestley | 54 | 100.00% | 1 | 100.00% |
Total | 54 | 100.00% | 1 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Forest Bond | 438 | 52.27% | 1 | 2.17% |
Malcolm Priestley | 387 | 46.18% | 39 | 84.78% |
Andres More | 6 | 0.72% | 3 | 6.52% |
Aya Mahfouz | 4 | 0.48% | 1 | 2.17% |
Marcos Paulo de Souza | 2 | 0.24% | 1 | 2.17% |
Othmar Pasteka | 1 | 0.12% | 1 | 2.17% |
Total | 838 | 100.00% | 46 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.