Release 4.7 drivers/staging/wilc1000/linux_wlan.c
#include "wilc_wfi_cfgoperations.h"
#include "wilc_wlan_if.h"
#include "wilc_wlan.h"
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/gpio.h>
#include <linux/kthread.h>
#include <linux/firmware.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/etherdevice.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/semaphore.h>
#include <linux/completion.h>
static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr);
static struct notifier_block g_dev_notifier = {
.notifier_call = dev_state_ev_handler
};
static struct semaphore close_exit_sync;
static int wlan_deinit_locks(struct net_device *dev);
static void wlan_deinitialize_threads(struct net_device *dev);
static void linux_wlan_tx_complete(void *priv, int status);
static int mac_init_fn(struct net_device *ndev);
static struct net_device_stats *mac_stats(struct net_device *dev);
static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd);
static void wilc_set_multicast_list(struct net_device *dev);
bool wilc_enable_ps = true;
static const struct net_device_ops wilc_netdev_ops = {
.ndo_init = mac_init_fn,
.ndo_open = wilc_mac_open,
.ndo_stop = wilc_mac_close,
.ndo_start_xmit = wilc_mac_xmit,
.ndo_do_ioctl = mac_ioctl,
.ndo_get_stats = mac_stats,
.ndo_set_rx_mode = wilc_set_multicast_list,
};
static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct in_ifaddr *dev_iface = ptr;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
struct net_device *dev;
u8 *ip_addr_buf;
struct wilc_vif *vif;
u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0";
if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
return NOTIFY_DONE;
if (memcmp(dev_iface->ifa_label, "wlan0", 5) &&
memcmp(dev_iface->ifa_label, "p2p0", 4))
return NOTIFY_DONE;
dev = (struct net_device *)dev_iface->ifa_dev->dev;
if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
return NOTIFY_DONE;
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
if (!priv)
return NOTIFY_DONE;
hif_drv = (struct host_if_drv *)priv->hif_drv;
vif = netdev_priv(dev);
if (!vif || !hif_drv)
return NOTIFY_DONE;
switch (event) {
case NETDEV_UP:
if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 1;
wilc_optaining_ip = false;
del_timer(&wilc_during_ip_timer);
}
if (wilc_enable_ps)
wilc_set_power_mgmt(vif, 1, 0);
netdev_dbg(dev, "[%s] Up IP\n", dev_iface->ifa_label);
ip_addr_buf = (char *)&dev_iface->ifa_address;
netdev_dbg(dev, "IP add=%d:%d:%d:%d\n",
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx);
break;
case NETDEV_DOWN:
if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 0;
wilc_optaining_ip = false;
}
if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
wilc_set_power_mgmt(vif, 0, 0);
wilc_resolve_disconnect_aberration(vif);
netdev_dbg(dev, "[%s] Down IP\n", dev_iface->ifa_label);
ip_addr_buf = null_ip;
netdev_dbg(dev, "IP add=%d:%d:%d:%d\n",
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx);
break;
default:
break;
}
return NOTIFY_DONE;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 347 | 81.65% | 1 | 6.25% |
leo kim | leo kim | 41 | 9.65% | 7 | 43.75% |
glen lee | glen lee | 20 | 4.71% | 2 | 12.50% |
arnd bergmann | arnd bergmann | 9 | 2.12% | 1 | 6.25% |
greg kroah-hartman | greg kroah-hartman | 3 | 0.71% | 2 | 12.50% |
chandra s gorentla | chandra s gorentla | 2 | 0.47% | 1 | 6.25% |
dean lee | dean lee | 2 | 0.47% | 1 | 6.25% |
chaehyun lim | chaehyun lim | 1 | 0.24% | 1 | 6.25% |
| Total | 425 | 100.00% | 16 | 100.00% |
static irqreturn_t isr_uh_routine(int irq, void *user_data)
{
struct wilc_vif *vif;
struct wilc *wilc;
struct net_device *dev = user_data;
vif = netdev_priv(dev);
wilc = vif->wilc;
if (wilc->close) {
netdev_err(dev, "Can't handle UH interrupt\n");
return IRQ_HANDLED;
}
return IRQ_WAKE_THREAD;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
glen lee | glen lee | 31 | 48.44% | 2 | 50.00% |
johnny kim | johnny kim | 29 | 45.31% | 1 | 25.00% |
leo kim | leo kim | 4 | 6.25% | 1 | 25.00% |
| Total | 64 | 100.00% | 4 | 100.00% |
static irqreturn_t isr_bh_routine(int irq, void *userdata)
{
struct wilc_vif *vif;
struct wilc *wilc;
struct net_device *dev = userdata;
vif = netdev_priv(userdata);
wilc = vif->wilc;
if (wilc->close) {
netdev_err(dev, "Can't handle BH interrupt\n");
return IRQ_HANDLED;
}
wilc_handle_isr(wilc);
return IRQ_HANDLED;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 29 | 42.03% | 1 | 14.29% |
glen lee | glen lee | 28 | 40.58% | 4 | 57.14% |
leo kim | leo kim | 11 | 15.94% | 1 | 14.29% |
arnd bergmann | arnd bergmann | 1 | 1.45% | 1 | 14.29% |
| Total | 69 | 100.00% | 7 | 100.00% |
static int init_irq(struct net_device *dev)
{
int ret = 0;
struct wilc_vif *vif;
struct wilc *wl;
vif = netdev_priv(dev);
wl = vif->wilc;
if ((gpio_request(wl->gpio, "WILC_INTR") == 0) &&
(gpio_direction_input(wl->gpio) == 0)) {
wl->dev_irq_num = gpio_to_irq(wl->gpio);
} else {
ret = -1;
netdev_err(dev, "could not obtain gpio for WILC_INTR\n");
}
if (ret != -1 && request_threaded_irq(wl->dev_irq_num,
isr_uh_routine,
isr_bh_routine,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
"WILC_IRQ", dev) < 0) {
netdev_err(dev, "Failed to request IRQ GPIO: %d\n", wl->gpio);
gpio_free(wl->gpio);
ret = -1;
} else {
netdev_dbg(dev,
"IRQ request succeeded IRQ-NUM= %d on GPIO: %d\n",
wl->dev_irq_num, wl->gpio);
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 108 | 64.67% | 1 | 14.29% |
glen lee | glen lee | 25 | 14.97% | 3 | 42.86% |
arnd bergmann | arnd bergmann | 22 | 13.17% | 1 | 14.29% |
leo kim | leo kim | 9 | 5.39% | 1 | 14.29% |
tony cho | tony cho | 3 | 1.80% | 1 | 14.29% |
| Total | 167 | 100.00% | 7 | 100.00% |
static void deinit_irq(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
/* Deintialize IRQ */
if (wilc->dev_irq_num) {
free_irq(wilc->dev_irq_num, wilc);
gpio_free(wilc->gpio);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
glen lee | glen lee | 28 | 47.46% | 2 | 40.00% |
johnny kim | johnny kim | 26 | 44.07% | 1 | 20.00% |
arnd bergmann | arnd bergmann | 4 | 6.78% | 1 | 20.00% |
tony cho | tony cho | 1 | 1.69% | 1 | 20.00% |
| Total | 59 | 100.00% | 5 | 100.00% |
int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout)
{
/* FIXME: replace with mutex_lock or wait_for_completion */
int error = -1;
if (vp)
error = down_timeout(vp,
msecs_to_jiffies(timeout));
return error;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 35 | 81.40% | 1 | 33.33% |
arnd bergmann | arnd bergmann | 7 | 16.28% | 1 | 33.33% |
chaehyun lim | chaehyun lim | 1 | 2.33% | 1 | 33.33% |
| Total | 43 | 100.00% | 3 | 100.00% |
void wilc_mac_indicate(struct wilc *wilc, int flag)
{
int status;
if (flag == WILC_MAC_INDICATE_STATUS) {
wilc_wlan_cfg_get_val(WID_STATUS,
(unsigned char *)&status, 4);
if (wilc->mac_status == WILC_MAC_STATUS_INIT) {
wilc->mac_status = status;
up(&wilc->sync_event);
} else {
wilc->mac_status = status;
}
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 60 | 83.33% | 1 | 20.00% |
glen lee | glen lee | 10 | 13.89% | 2 | 40.00% |
arnd bergmann | arnd bergmann | 1 | 1.39% | 1 | 20.00% |
greg kroah-hartman | greg kroah-hartman | 1 | 1.39% | 1 | 20.00% |
| Total | 72 | 100.00% | 5 | 100.00% |
static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
{
u8 *bssid, *bssid1;
int i = 0;
bssid = mac_header + 10;
bssid1 = mac_header + 4;
for (i = 0; i < wilc->vif_num; i++) {
if (wilc->vif[i]->mode == STATION_MODE)
if (ether_addr_equal_unaligned(bssid,
wilc->vif[i]->bssid))
return wilc->vif[i]->ndev;
if (wilc->vif[i]->mode == AP_MODE)
if (ether_addr_equal_unaligned(bssid1,
wilc->vif[i]->bssid))
return wilc->vif[i]->ndev;
}
return NULL;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 81 | 58.27% | 1 | 6.67% |
glen lee | glen lee | 33 | 23.74% | 3 | 20.00% |
leo kim | leo kim | 11 | 7.91% | 5 | 33.33% |
tony cho | tony cho | 11 | 7.91% | 4 | 26.67% |
chaehyun lim | chaehyun lim | 2 | 1.44% | 1 | 6.67% |
arnd bergmann | arnd bergmann | 1 | 0.72% | 1 | 6.67% |
| Total | 139 | 100.00% | 15 | 100.00% |
int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
{
int i = 0;
int ret = -1;
struct wilc_vif *vif;
struct wilc *wilc;
vif = netdev_priv(wilc_netdev);
wilc = vif->wilc;
for (i = 0; i < wilc->vif_num; i++)
if (wilc->vif[i]->ndev == wilc_netdev) {
memcpy(wilc->vif[i]->bssid, bssid, 6);
wilc->vif[i]->mode = mode;
ret = 0;
break;
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 65 | 56.03% | 1 | 8.33% |
glen lee | glen lee | 42 | 36.21% | 4 | 33.33% |
tony cho | tony cho | 5 | 4.31% | 4 | 33.33% |
leo kim | leo kim | 2 | 1.72% | 1 | 8.33% |
chaehyun lim | chaehyun lim | 1 | 0.86% | 1 | 8.33% |
arnd bergmann | arnd bergmann | 1 | 0.86% | 1 | 8.33% |
| Total | 116 | 100.00% | 12 | 100.00% |
int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc)
{
u8 i = 0;
u8 null_bssid[6] = {0};
u8 ret_val = 0;
for (i = 0; i < wilc->vif_num; i++)
if (memcmp(wilc->vif[i]->bssid, null_bssid, 6))
ret_val++;
return ret_val;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 55 | 79.71% | 1 | 12.50% |
arnd bergmann | arnd bergmann | 7 | 10.14% | 2 | 25.00% |
chaehyun lim | chaehyun lim | 3 | 4.35% | 1 | 12.50% |
tony cho | tony cho | 3 | 4.35% | 3 | 37.50% |
glen lee | glen lee | 1 | 1.45% | 1 | 12.50% |
| Total | 69 | 100.00% | 8 | 100.00% |
static int linux_wlan_txq_task(void *vp)
{
int ret, txq_count;
struct wilc_vif *vif;
struct wilc *wl;
struct net_device *dev = vp;
vif = netdev_priv(dev);
wl = vif->wilc;
complete(&wl->txq_thread_started);
while (1) {
down(&wl->txq_event);
if (wl->close) {
complete(&wl->txq_thread_started);
while (!kthread_should_stop())
schedule();
break;
}
do {
ret = wilc_wlan_handle_txq(dev, &txq_count);
if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
if (netif_queue_stopped(wl->vif[0]->ndev))
netif_wake_queue(wl->vif[0]->ndev);
if (netif_queue_stopped(wl->vif[1]->ndev))
netif_wake_queue(wl->vif[1]->ndev);
}
} while (ret == WILC_TX_ERR_NO_BUF && !wl->close);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 124 | 68.51% | 1 | 10.00% |
glen lee | glen lee | 46 | 25.41% | 5 | 50.00% |
tony cho | tony cho | 8 | 4.42% | 2 | 20.00% |
leo kim | leo kim | 2 | 1.10% | 1 | 10.00% |
greg kroah-hartman | greg kroah-hartman | 1 | 0.55% | 1 | 10.00% |
| Total | 181 | 100.00% | 10 | 100.00% |
int wilc_wlan_get_firmware(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
int chip_id, ret = 0;
const struct firmware *wilc_firmware;
char *firmware;
vif = netdev_priv(dev);
wilc = vif->wilc;
chip_id = wilc_get_chipid(wilc, false);
if (chip_id < 0x1003a0)
firmware = FIRMWARE_1002;
else
firmware = FIRMWARE_1003;
netdev_info(dev, "loading firmware %s\n", firmware);
if (!(&vif->ndev->dev))
goto _fail_;
if (request_firmware(&wilc_firmware, firmware, wilc->dev) != 0) {
netdev_err(dev, "%s - firmare not available\n", firmware);
ret = -1;
goto _fail_;
}
wilc->firmware = wilc_firmware;
_fail_:
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 86 | 59.72% | 1 | 10.00% |
glen lee | glen lee | 49 | 34.03% | 4 | 40.00% |
leo kim | leo kim | 6 | 4.17% | 2 | 20.00% |
arnd bergmann | arnd bergmann | 1 | 0.69% | 1 | 10.00% |
chris park | chris park | 1 | 0.69% | 1 | 10.00% |
tony cho | tony cho | 1 | 0.69% | 1 | 10.00% |
| Total | 144 | 100.00% | 10 | 100.00% |
static int linux_wlan_start_firmware(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
int ret = 0;
vif = netdev_priv(dev);
wilc = vif->wilc;
ret = wilc_wlan_start(wilc);
if (ret < 0)
return ret;
ret = wilc_lock_timeout(wilc, &wilc->sync_event, 5000);
if (ret)
return ret;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 38 | 48.10% | 1 | 16.67% |
glen lee | glen lee | 28 | 35.44% | 3 | 50.00% |
leo kim | leo kim | 7 | 8.86% | 1 | 16.67% |
arnd bergmann | arnd bergmann | 6 | 7.59% | 1 | 16.67% |
| Total | 79 | 100.00% | 6 | 100.00% |
static int wilc1000_firmware_download(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
int ret = 0;
vif = netdev_priv(dev);
wilc = vif->wilc;
if (!wilc->firmware) {
netdev_err(dev, "Firmware buffer is NULL\n");
return -ENOBUFS;
}
ret = wilc_wlan_firmware_download(wilc, wilc->firmware->data,
wilc->firmware->size);
if (ret < 0)
return ret;
release_firmware(wilc->firmware);
wilc->firmware = NULL;
netdev_dbg(dev, "Download Succeeded\n");
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 53 | 48.18% | 1 | 9.09% |
glen lee | glen lee | 36 | 32.73% | 4 | 36.36% |
leo kim | leo kim | 11 | 10.00% | 2 | 18.18% |
tony cho | tony cho | 6 | 5.45% | 2 | 18.18% |
arnd bergmann | arnd bergmann | 3 | 2.73% | 1 | 9.09% |
chandra s gorentla | chandra s gorentla | 1 | 0.91% | 1 | 9.09% |
| Total | 110 | 100.00% | 11 | 100.00% |
static int linux_wlan_init_test_config(struct net_device *dev,
struct wilc_vif *vif)
{
unsigned char c_val[64];
struct wilc *wilc = vif->wilc;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
netdev_dbg(dev, "Start configuring Firmware\n");
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
hif_drv = (struct host_if_drv *)priv->hif_drv;
netdev_dbg(dev, "Host = %p\n", hif_drv);
wilc_get_chipid(wilc, false);
*(int *)c_val = 1;
if (!wilc_wlan_cfg_set(vif, 1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0))
goto _fail_;
c_val[0] = 0;
if (!wilc_wlan_cfg_set(vif, 0, WID_PC_TEST_MODE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = INFRASTRUCTURE;
if (!wilc_wlan_cfg_set(vif, 0, WID_BSS_TYPE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = RATE_AUTO;
if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_TX_RATE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = G_MIXED_11B_2_MODE;
if (!wilc_wlan_cfg_set(vif, 0, WID_11G_OPERATING_MODE, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_CURRENT_CHANNEL, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = G_SHORT_PREAMBLE;
if (!wilc_wlan_cfg_set(vif, 0, WID_PREAMBLE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = AUTO_PROT;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_PROT_MECH, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = ACTIVE_SCAN;
if (!wilc_wlan_cfg_set(vif, 0, WID_SCAN_TYPE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = SITE_SURVEY_OFF;
if (!wilc_wlan_cfg_set(vif, 0, WID_SITE_SURVEY, c_val, 1, 0, 0))
goto _fail_;
*((int *)c_val) = 0xffff;
if (!wilc_wlan_cfg_set(vif, 0, WID_RTS_THRESHOLD, c_val, 2, 0, 0))
goto _fail_;
*((int *)c_val) = 2346;
if (!wilc_wlan_cfg_set(vif, 0, WID_FRAG_THRESHOLD, c_val, 2, 0, 0))
goto _fail_;
c_val[0] = 0;
if (!wilc_wlan_cfg_set(vif, 0, WID_BCAST_SSID, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_QOS_ENABLE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = NO_POWERSAVE;
if (!wilc_wlan_cfg_set(vif, 0, WID_POWER_MANAGEMENT, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = NO_SECURITY; /* NO_ENCRYPT, 0x79 */
if (!wilc_wlan_cfg_set(vif, 0, WID_11I_MODE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = OPEN_SYSTEM;
if (!wilc_wlan_cfg_set(vif, 0, WID_AUTH_TYPE, c_val, 1, 0, 0))
goto _fail_;
strcpy(c_val, "123456790abcdef1234567890");
if (!wilc_wlan_cfg_set(vif, 0, WID_WEP_KEY_VALUE, c_val,
(strlen(c_val) + 1), 0, 0))
goto _fail_;
strcpy(c_val, "12345678");
if (!wilc_wlan_cfg_set(vif, 0, WID_11I_PSK, c_val, (strlen(c_val)), 0,
0))
goto _fail_;
strcpy(c_val, "password");
if (!wilc_wlan_cfg_set(vif, 0, WID_1X_KEY, c_val, (strlen(c_val) + 1),
0, 0))
goto _fail_;
c_val[0] = 192;
c_val[1] = 168;
c_val[2] = 1;
c_val[3] = 112;
if (!wilc_wlan_cfg_set(vif, 0, WID_1X_SERV_ADDR, c_val, 4, 0, 0))
goto _fail_;
c_val[0] = 3;
if (!wilc_wlan_cfg_set(vif, 0, WID_LISTEN_INTERVAL, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 3;
if (!wilc_wlan_cfg_set(vif, 0, WID_DTIM_PERIOD, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = NORMAL_ACK;
if (!wilc_wlan_cfg_set(vif, 0, WID_ACK_POLICY, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 0;
if (!wilc_wlan_cfg_set(vif, 0, WID_USER_CONTROL_ON_TX_POWER, c_val, 1,
0, 0))
goto _fail_;
c_val[0] = 48;
if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11A, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = 28;
if (!wilc_wlan_cfg_set(vif, 0, WID_TX_POWER_LEVEL_11B, c_val, 1, 0,
0))
goto _fail_;
*((int *)c_val) = 100;
if (!wilc_wlan_cfg_set(vif, 0, WID_BEACON_INTERVAL, c_val, 2, 0, 0))
goto _fail_;
c_val[0] = REKEY_DISABLE;
if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_POLICY, c_val, 1, 0, 0))
goto _fail_;
*((int *)c_val) = 84600;
if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PERIOD, c_val, 4, 0, 0))
goto _fail_;
*((int *)c_val) = 500;
if (!wilc_wlan_cfg_set(vif, 0, WID_REKEY_PACKET_COUNT, c_val, 4, 0,
0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_SHORT_SLOT_ALLOWED, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = G_SELF_CTS_PROT;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ERP_PROT_TYPE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_ENABLE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = HT_MIXED_MODE;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OPERATING_MODE, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_TXOP_PROT_DISABLE, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = DETECT_PROTECT_REPORT;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_OBSS_NONHT_DETECTION, c_val, 1,
0, 0))
goto _fail_;
c_val[0] = RTS_CTS_NONHT_PROT;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_HT_PROT_TYPE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 0;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_RIFS_PROT_ENABLE, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = MIMO_MODE;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_SMPS_MODE, c_val, 1, 0, 0))
goto _fail_;
c_val[0] = 7;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_CURRENT_TX_MCS, c_val, 1, 0,
0))
goto _fail_;
c_val[0] = 1;
if (!wilc_wlan_cfg_set(vif, 0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1,
1, 1))
goto _fail_;
return 0;
_fail_:
return -1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 1263 | 89.01% | 3 | 18.75% |
glen lee | glen lee | 139 | 9.80% | 5 | 31.25% |
leo kim | leo kim | 12 | 0.85% | 4 | 25.00% |
arnd bergmann | arnd bergmann | 2 | 0.14% | 1 | 6.25% |
chris park | chris park | 1 | 0.07% | 1 | 6.25% |
tony cho | tony cho | 1 | 0.07% | 1 | 6.25% |
chaehyun lim | chaehyun lim | 1 | 0.07% | 1 | 6.25% |
| Total | 1419 | 100.00% | 16 | 100.00% |
void wilc1000_wlan_deinit(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wl;
vif = netdev_priv(dev);
wl = vif->wilc;
if (!wl) {
netdev_err(dev, "wl is NULL\n");
return;
}
if (wl->initialized) {
netdev_info(dev, "Deinitializing wilc1000...\n");
if (!wl->dev_irq_num &&
wl->hif_func->disable_interrupt) {
mutex_lock(&wl->hif_cs);
wl->hif_func->disable_interrupt(wl);
mutex_unlock(&wl->hif_cs);
}
if (&wl->txq_event)
up(&wl->txq_event);
wlan_deinitialize_threads(dev);
deinit_irq(dev);
wilc_wlan_stop(wl);
wilc_wlan_cleanup(dev);
wlan_deinit_locks(dev);
wl->initialized = false;
netdev_dbg(dev, "wilc1000 deinitialization Done\n");
} else {
netdev_dbg(dev, "wilc1000 is not initialized\n");
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 75 | 45.18% | 1 | 5.56% |
glen lee | glen lee | 58 | 34.94% | 10 | 55.56% |
arnd bergmann | arnd bergmann | 24 | 14.46% | 3 | 16.67% |
leo kim | leo kim | 4 | 2.41% | 1 | 5.56% |
tony cho | tony cho | 3 | 1.81% | 2 | 11.11% |
greg kroah-hartman | greg kroah-hartman | 2 | 1.20% | 1 | 5.56% |
| Total | 166 | 100.00% | 18 | 100.00% |
static int wlan_init_locks(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wl;
vif = netdev_priv(dev);
wl = vif->wilc;
mutex_init(&wl->hif_cs);
mutex_init(&wl->rxq_cs);
spin_lock_init(&wl->txq_spinlock);
sema_init(&wl->txq_add_to_head_cs, 1);
sema_init(&wl->txq_event, 0);
sema_init(&wl->cfg_event, 0);
sema_init(&wl->sync_event, 0);
init_completion(&wl->txq_thread_started);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 66 | 60.55% | 1 | 11.11% |
glen lee | glen lee | 33 | 30.28% | 2 | 22.22% |
greg kroah-hartman | greg kroah-hartman | 7 | 6.42% | 3 | 33.33% |
tony cho | tony cho | 1 | 0.92% | 1 | 11.11% |
arnd bergmann | arnd bergmann | 1 | 0.92% | 1 | 11.11% |
leo kim | leo kim | 1 | 0.92% | 1 | 11.11% |
| Total | 109 | 100.00% | 9 | 100.00% |
static int wlan_deinit_locks(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
if (&wilc->hif_cs)
mutex_destroy(&wilc->hif_cs);
if (&wilc->rxq_cs)
mutex_destroy(&wilc->rxq_cs);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 35 | 52.24% | 1 | 20.00% |
glen lee | glen lee | 29 | 43.28% | 2 | 40.00% |
greg kroah-hartman | greg kroah-hartman | 2 | 2.99% | 1 | 20.00% |
tony cho | tony cho | 1 | 1.49% | 1 | 20.00% |
| Total | 67 | 100.00% | 5 | 100.00% |
static int wlan_initialize_threads(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wilc;
vif = netdev_priv(dev);
wilc = vif->wilc;
wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev,
"K_TXQ_TASK");
if (!wilc->txq_thread) {
netdev_err(dev, "couldn't create TXQ thread\n");
wilc->close = 0;
return -ENOBUFS;
}
wait_for_completion(&wilc->txq_thread_started);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 45 | 51.14% | 1 | 12.50% |
glen lee | glen lee | 31 | 35.23% | 3 | 37.50% |
leo kim | leo kim | 11 | 12.50% | 3 | 37.50% |
arnd bergmann | arnd bergmann | 1 | 1.14% | 1 | 12.50% |
| Total | 88 | 100.00% | 8 | 100.00% |
static void wlan_deinitialize_threads(struct net_device *dev)
{
struct wilc_vif *vif;
struct wilc *wl;
vif = netdev_priv(dev);
wl = vif->wilc;
wl->close = 1;
if (&wl->txq_event)
up(&wl->txq_event);
if (wl->txq_thread) {
kthread_stop(wl->txq_thread);
wl->txq_thread = NULL;
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 43 | 56.58% | 1 | 20.00% |
glen lee | glen lee | 31 | 40.79% | 2 | 40.00% |
greg kroah-hartman | greg kroah-hartman | 1 | 1.32% | 1 | 20.00% |
tony cho | tony cho | 1 | 1.32% | 1 | 20.00% |
| Total | 76 | 100.00% | 5 | 100.00% |
int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif)
{
int ret = 0;
struct wilc *wl = vif->wilc;
if (!wl->initialized) {
wl->mac_status = WILC_MAC_STATUS_INIT;
wl->close = 0;
wlan_init_locks(dev);
ret = wilc_wlan_init(dev);
if (ret < 0) {
ret = -EIO;
goto _fail_locks_;
}
if (wl->gpio >= 0 && init_irq(dev)) {
ret = -EIO;
goto _fail_locks_;
}
ret = wlan_initialize_threads(dev);
if (ret < 0) {
ret = -EIO;
goto _fail_wilc_wlan_;
}
if (!wl->dev_irq_num &&
wl->hif_func->enable_interrupt &&
wl->hif_func->enable_interrupt(wl)) {
ret = -EIO;
goto _fail_irq_init_;
}
if (wilc_wlan_get_firmware(dev)) {
ret = -EIO;
goto _fail_irq_enable_;
}
ret = wilc1000_firmware_download(dev);
if (ret < 0) {
ret = -EIO;
goto _fail_irq_enable_;
}
ret = linux_wlan_start_firmware(dev);
if (ret < 0) {
ret = -EIO;
goto _fail_irq_enable_;
}
if (wilc_wlan_cfg_get(vif, 1, WID_FIRMWARE_VERSION, 1, 0)) {
int size;
char firmware_ver[20];
size = wilc_wlan_cfg_get_val(WID_FIRMWARE_VERSION,
firmware_ver,
sizeof(firmware_ver));
firmware_ver[size] = '\0';
netdev_dbg(dev, "Firmware Ver = %s\n", firmware_ver);
}
ret = linux_wlan_init_test_config(dev, vif);
if (ret < 0) {
netdev_err(dev, "Failed to configure firmware\n");
ret = -EIO;
goto _fail_fw_start_;
}
wl->initialized = true;
return 0;
_fail_fw_start_:
wilc_wlan_stop(wl);
_fail_irq_enable_:
if (!wl->dev_irq_num &&
wl->hif_func->disable_interrupt)
wl->hif_func->disable_interrupt(wl);
_fail_irq_init_:
if (wl->dev_irq_num)
deinit_irq(dev);
wlan_deinitialize_threads(dev);
_fail_wilc_wlan_:
wilc_wlan_cleanup(dev);
_fail_locks_:
wlan_deinit_locks(dev);
netdev_err(dev, "WLAN Iinitialization FAILED\n");
} else {
netdev_dbg(dev, "wilc1000 already initialized\n");
}
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 276 | 69.17% | 1 | 3.45% |
arnd bergmann | arnd bergmann | 52 | 13.03% | 4 | 13.79% |
glen lee | glen lee | 40 | 10.03% | 21 | 72.41% |
leo kim | leo kim | 16 | 4.01% | 1 | 3.45% |
tony cho | tony cho | 15 | 3.76% | 2 | 6.90% |
| Total | 399 | 100.00% | 29 | 100.00% |
static int mac_init_fn(struct net_device *ndev)
{
netif_start_queue(ndev);
netif_stop_queue(ndev);
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 23 | 95.83% | 1 | 50.00% |
arnd bergmann | arnd bergmann | 1 | 4.17% | 1 | 50.00% |
| Total | 24 | 100.00% | 2 | 100.00% |
int wilc_mac_open(struct net_device *ndev)
{
struct wilc_vif *vif;
unsigned char mac_add[ETH_ALEN] = {0};
int ret = 0;
int i = 0;
struct wilc *wl;
vif = netdev_priv(ndev);
wl = vif->wilc;
if (!wl || !wl->dev) {
netdev_err(ndev, "device not ready\n");
return -ENODEV;
}
netdev_dbg(ndev, "MAC OPEN[%p]\n", ndev);
ret = wilc_init_host_int(ndev);
if (ret < 0)
return ret;
ret = wilc1000_wlan_init(ndev, vif);
if (ret < 0) {
wilc_deinit_host_int(ndev);
return ret;
}
for (i = 0; i < wl->vif_num; i++) {
if (ndev == wl->vif[i]->ndev) {
if (vif->iftype == AP_MODE) {
wilc_set_wfi_drv_handler(vif,
wilc_get_vif_idx(vif),
0);
} else if (!wilc_wlan_get_num_conn_ifcs(wl)) {
wilc_set_wfi_drv_handler(vif,
wilc_get_vif_idx(vif),
wl->open_ifcs);
} else {
if (memcmp(wl->vif[i ^ 1]->bssid,
wl->vif[i ^ 1]->src_addr, 6))
wilc_set_wfi_drv_handler(vif,
wilc_get_vif_idx(vif),
0);
else
wilc_set_wfi_drv_handler(vif,
wilc_get_vif_idx(vif),
1);
}
wilc_set_operation_mode(vif, vif->iftype);
wilc_get_mac_address(vif, mac_add);
netdev_dbg(ndev, "Mac address: %pM\n", mac_add);
memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN);
break;
}
}
memcpy(ndev->dev_addr, wl->vif[i]->src_addr, ETH_ALEN);
if (!is_valid_ether_addr(ndev->dev_addr)) {
netdev_err(ndev, "Wrong MAC address\n");
wilc_deinit_host_int(ndev);
wilc1000_wlan_deinit(ndev);
return -EINVAL;
}
wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
vif->ndev->ieee80211_ptr,
vif->frame_reg[0].type,
vif->frame_reg[0].reg);
wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy,
vif->ndev->ieee80211_ptr,
vif->frame_reg[1].type,
vif->frame_reg[1].reg);
netif_wake_queue(ndev);
wl->open_ifcs++;
vif->mac_opened = 1;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 199 | 44.72% | 1 | 4.00% |
glen lee | glen lee | 183 | 41.12% | 7 | 28.00% |
leo kim | leo kim | 29 | 6.52% | 6 | 24.00% |
chandra s gorentla | chandra s gorentla | 19 | 4.27% | 1 | 4.00% |
chaehyun lim | chaehyun lim | 8 | 1.80% | 4 | 16.00% |
tony cho | tony cho | 5 | 1.12% | 4 | 16.00% |
arnd bergmann | arnd bergmann | 2 | 0.45% | 2 | 8.00% |
| Total | 445 | 100.00% | 25 | 100.00% |
static struct net_device_stats *mac_stats(struct net_device *dev)
{
struct wilc_vif *vif = netdev_priv(dev);
return &vif->netstats;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 24 | 82.76% | 1 | 33.33% |
glen lee | glen lee | 4 | 13.79% | 1 | 33.33% |
arnd bergmann | arnd bergmann | 1 | 3.45% | 1 | 33.33% |
| Total | 29 | 100.00% | 3 | 100.00% |
static void wilc_set_multicast_list(struct net_device *dev)
{
struct netdev_hw_addr *ha;
struct wilc_vif *vif;
int i = 0;
vif = netdev_priv(dev);
if (dev->flags & IFF_PROMISC)
return;
if ((dev->flags & IFF_ALLMULTI) ||
(dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
wilc_setup_multicast_filter(vif, false, 0);
return;
}
if ((dev->mc.count) == 0) {
wilc_setup_multicast_filter(vif, true, 0);
return;
}
netdev_for_each_mc_addr(ha, dev) {
memcpy(wilc_multicast_mac_addr_list[i], ha->addr, ETH_ALEN);
netdev_dbg(dev, "Entry[%d]: %x:%x:%x:%x:%x:%x\n", i,
wilc_multicast_mac_addr_list[i][0],
wilc_multicast_mac_addr_list[i][1],
wilc_multicast_mac_addr_list[i][2],
wilc_multicast_mac_addr_list[i][3],
wilc_multicast_mac_addr_list[i][4],
wilc_multicast_mac_addr_list[i][5]);
i++;
}
wilc_setup_multicast_filter(vif, true, (dev->mc.count));
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 162 | 83.08% | 1 | 16.67% |
glen lee | glen lee | 17 | 8.72% | 1 | 16.67% |
arnd bergmann | arnd bergmann | 10 | 5.13% | 1 | 16.67% |
dean lee | dean lee | 3 | 1.54% | 1 | 16.67% |
leo kim | leo kim | 2 | 1.03% | 1 | 16.67% |
chaehyun lim | chaehyun lim | 1 | 0.51% | 1 | 16.67% |
| Total | 195 | 100.00% | 6 | 100.00% |
static void linux_wlan_tx_complete(void *priv, int status)
{
struct tx_complete_data *pv_data = priv;
dev_kfree_skb(pv_data->skb);
kfree(pv_data);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 31 | 96.88% | 1 | 50.00% |
greg kroah-hartman | greg kroah-hartman | 1 | 3.12% | 1 | 50.00% |
| Total | 32 | 100.00% | 2 | 100.00% |
int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
{
struct wilc_vif *vif;
struct tx_complete_data *tx_data = NULL;
int queue_count;
char *udp_buf;
struct iphdr *ih;
struct ethhdr *eth_h;
struct wilc *wilc;
vif = netdev_priv(ndev);
wilc = vif->wilc;
if (skb->dev != ndev) {
netdev_err(ndev, "Packet not destined to this device\n");
return 0;
}
tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
if (!tx_data) {
dev_kfree_skb(skb);
netif_wake_queue(ndev);
return 0;
}
tx_data->buff = skb->data;
tx_data->size = skb->len;
tx_data->skb = skb;
eth_h = (struct ethhdr *)(skb->data);
if (eth_h->h_proto == 0x8e88)
netdev_dbg(ndev, "EAPOL transmitted\n");
ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));
udp_buf = (char *)ih + sizeof(struct iphdr);
if ((udp_buf[1] == 68 && udp_buf[3] == 67) ||
(udp_buf[1] == 67 && udp_buf[3] == 68))
netdev_dbg(ndev, "DHCP Message transmitted, type:%x %x %x\n",
udp_buf[248], udp_buf[249], udp_buf[250]);
vif->netstats.tx_packets++;
vif->netstats.tx_bytes += tx_data->size;
tx_data->bssid = wilc->vif[vif->idx]->bssid;
queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
tx_data->buff, tx_data->size,
linux_wlan_tx_complete);
if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
netif_stop_queue(wilc->vif[0]->ndev);
netif_stop_queue(wilc->vif[1]->ndev);
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 285 | 82.85% | 1 | 5.56% |
glen lee | glen lee | 27 | 7.85% | 5 | 27.78% |
leo kim | leo kim | 24 | 6.98% | 7 | 38.89% |
tony cho | tony cho | 6 | 1.74% | 3 | 16.67% |
arnd bergmann | arnd bergmann | 1 | 0.29% | 1 | 5.56% |
greg kroah-hartman | greg kroah-hartman | 1 | 0.29% | 1 | 5.56% |
| Total | 344 | 100.00% | 18 | 100.00% |
int wilc_mac_close(struct net_device *ndev)
{
struct wilc_priv *priv;
struct wilc_vif *vif;
struct host_if_drv *hif_drv;
struct wilc *wl;
vif = netdev_priv(ndev);
if (!vif || !vif->ndev || !vif->ndev->ieee80211_ptr ||
!vif->ndev->ieee80211_ptr->wiphy)
return 0;
priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
wl = vif->wilc;
if (!priv)
return 0;
hif_drv = (struct host_if_drv *)priv->hif_drv;
netdev_dbg(ndev, "Mac close\n");
if (!wl)
return 0;
if (!hif_drv)
return 0;
if ((wl->open_ifcs) > 0)
wl->open_ifcs--;
else
return 0;
if (vif->ndev) {
netif_stop_queue(vif->ndev);
wilc_deinit_host_int(vif->ndev);
}
if (wl->open_ifcs == 0) {
netdev_dbg(ndev, "Deinitializing wilc1000\n");
wl->close = 1;
wilc1000_wlan_deinit(ndev);
WILC_WFI_deinit_mon_interface();
}
up(&close_exit_sync);
vif->mac_opened = 0;
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 154 | 71.96% | 1 | 7.14% |
glen lee | glen lee | 38 | 17.76% | 4 | 28.57% |
leo kim | leo kim | 18 | 8.41% | 5 | 35.71% |
chaehyun lim | chaehyun lim | 2 | 0.93% | 2 | 14.29% |
greg kroah-hartman | greg kroah-hartman | 1 | 0.47% | 1 | 7.14% |
arnd bergmann | arnd bergmann | 1 | 0.47% | 1 | 7.14% |
| Total | 214 | 100.00% | 14 | 100.00% |
static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
{
u8 *buff = NULL;
s8 rssi;
u32 size = 0, length = 0;
struct wilc_vif *vif;
s32 ret = 0;
struct wilc *wilc;
vif = netdev_priv(ndev);
wilc = vif->wilc;
if (!wilc->initialized)
return 0;
switch (cmd) {
case SIOCSIWPRIV:
{
struct iwreq *wrq = (struct iwreq *)req;
size = wrq->u.data.length;
if (size && wrq->u.data.pointer) {
buff = memdup_user(wrq->u.data.pointer,
wrq->u.data.length);
if (IS_ERR(buff))
return PTR_ERR(buff);
if (strncasecmp(buff, "RSSI", length) == 0) {
ret = wilc_get_rssi(vif, &rssi);
netdev_info(ndev, "RSSI :%d\n", rssi);
rssi += 5;
snprintf(buff, size, "rssi %d", rssi);
if (copy_to_user(wrq->u.data.pointer, buff, size)) {
netdev_err(ndev, "failed to copy\n");
ret = -EFAULT;
goto done;
}
}
}
}
break;
default:
{
netdev_info(ndev, "Command - %d - has been received\n", cmd);
ret = -EOPNOTSUPP;
goto done;
}
}
done:
kfree(buff);
return ret;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 218 | 80.74% | 1 | 6.25% |
glen lee | glen lee | 18 | 6.67% | 3 | 18.75% |
leo kim | leo kim | 13 | 4.81% | 3 | 18.75% |
hari prasath gujulan elango | hari prasath gujulan elango | 12 | 4.44% | 1 | 6.25% |
chaehyun lim | chaehyun lim | 3 | 1.11% | 3 | 18.75% |
sudip mukherjee | sudip mukherjee | 2 | 0.74% | 1 | 6.25% |
arnd bergmann | arnd bergmann | 2 | 0.74% | 2 | 12.50% |
greg kroah-hartman | greg kroah-hartman | 1 | 0.37% | 1 | 6.25% |
tony cho | tony cho | 1 | 0.37% | 1 | 6.25% |
| Total | 270 | 100.00% | 16 | 100.00% |
void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
{
unsigned int frame_len = 0;
int stats;
unsigned char *buff_to_send = NULL;
struct sk_buff *skb;
struct net_device *wilc_netdev;
struct wilc_vif *vif;
if (!wilc)
return;
wilc_netdev = get_if_handler(wilc, buff);
if (!wilc_netdev)
return;
buff += pkt_offset;
vif = netdev_priv(wilc_netdev);
if (size > 0) {
frame_len = size;
buff_to_send = buff;
skb = dev_alloc_skb(frame_len);
if (!skb)
return;
skb->dev = wilc_netdev;
memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
skb->protocol = eth_type_trans(skb, wilc_netdev);
vif->netstats.rx_packets++;
vif->netstats.rx_bytes += frame_len;
skb->ip_summed = CHECKSUM_UNNECESSARY;
stats = netif_rx(skb);
netdev_dbg(wilc_netdev, "netif_rx ret value is: %d\n", stats);
}
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 152 | 84.44% | 1 | 9.09% |
glen lee | glen lee | 13 | 7.22% | 3 | 27.27% |
leo kim | leo kim | 11 | 6.11% | 4 | 36.36% |
chaehyun lim | chaehyun lim | 3 | 1.67% | 2 | 18.18% |
arnd bergmann | arnd bergmann | 1 | 0.56% | 1 | 9.09% |
| Total | 180 | 100.00% | 11 | 100.00% |
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size)
{
int i = 0;
struct wilc_vif *vif;
for (i = 0; i < wilc->vif_num; i++) {
vif = netdev_priv(wilc->vif[i]->ndev);
if (vif->monitor_flag) {
WILC_WFI_monitor_rx(buff, size);
return;
}
}
vif = netdev_priv(wilc->vif[1]->ndev);
if ((buff[0] == vif->frame_reg[0].type && vif->frame_reg[0].reg) ||
(buff[0] == vif->frame_reg[1].type && vif->frame_reg[1].reg))
WILC_WFI_p2p_rx(wilc->vif[1]->ndev, buff, size);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 119 | 76.28% | 1 | 9.09% |
glen lee | glen lee | 22 | 14.10% | 3 | 27.27% |
tony cho | tony cho | 7 | 4.49% | 3 | 27.27% |
leo kim | leo kim | 6 | 3.85% | 2 | 18.18% |
chaehyun lim | chaehyun lim | 2 | 1.28% | 2 | 18.18% |
| Total | 156 | 100.00% | 11 | 100.00% |
void wilc_netdev_cleanup(struct wilc *wilc)
{
int i = 0;
struct wilc_vif *vif[NUM_CONCURRENT_IFC];
if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
unregister_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
vif[i] = netdev_priv(wilc->vif[i]->ndev);
}
if (wilc && wilc->firmware) {
release_firmware(wilc->firmware);
wilc->firmware = NULL;
}
if (wilc && (wilc->vif[0]->ndev || wilc->vif[1]->ndev)) {
wilc_lock_timeout(wilc, &close_exit_sync, 5 * 1000);
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
if (wilc->vif[i]->ndev)
if (vif[i]->mac_opened)
wilc_mac_close(wilc->vif[i]->ndev);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
unregister_netdev(wilc->vif[i]->ndev);
wilc_free_wiphy(wilc->vif[i]->ndev);
free_netdev(wilc->vif[i]->ndev);
}
}
kfree(wilc);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
tony cho | tony cho | 198 | 80.16% | 2 | 20.00% |
glen lee | glen lee | 36 | 14.57% | 4 | 40.00% |
leo kim | leo kim | 8 | 3.24% | 1 | 10.00% |
arnd bergmann | arnd bergmann | 5 | 2.02% | 3 | 30.00% |
| Total | 247 | 100.00% | 10 | 100.00% |
EXPORT_SYMBOL_GPL(wilc_netdev_cleanup);
int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
int gpio, const struct wilc_hif_func *ops)
{
int i, ret;
struct wilc_vif *vif;
struct net_device *ndev;
struct wilc *wl;
sema_init(&close_exit_sync, 0);
wl = kzalloc(sizeof(*wl), GFP_KERNEL);
if (!wl)
return -ENOMEM;
*wilc = wl;
wl->io_type = io_type;
wl->gpio = gpio;
wl->hif_func = ops;
register_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
ndev = alloc_etherdev(sizeof(struct wilc_vif));
if (!ndev)
return -ENOMEM;
vif = netdev_priv(ndev);
memset(vif, 0, sizeof(struct wilc_vif));
if (i == 0)
strcpy(ndev->name, "wlan%d");
else
strcpy(ndev->name, "p2p%d");
vif->idx = wl->vif_num;
vif->wilc = *wilc;
wl->vif[i] = vif;
wl->vif[wl->vif_num]->ndev = ndev;
wl->vif_num++;
ndev->netdev_ops = &wilc_netdev_ops;
{
struct wireless_dev *wdev;
wdev = wilc_create_wiphy(ndev, dev);
if (dev)
SET_NETDEV_DEV(ndev, dev);
if (!wdev) {
netdev_err(ndev, "Can't register WILC Wiphy\n");
return -1;
}
vif->ndev->ieee80211_ptr = wdev;
vif->ndev->ml_priv = vif;
wdev->netdev = vif->ndev;
vif->netstats.rx_packets = 0;
vif->netstats.tx_packets = 0;
vif->netstats.rx_bytes = 0;
vif->netstats.tx_bytes = 0;
}
ret = register_netdev(ndev);
if (ret)
return ret;
vif->iftype = STATION_MODE;
vif->mac_opened = 0;
}
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 226 | 61.75% | 1 | 3.85% |
arnd bergmann | arnd bergmann | 57 | 15.57% | 6 | 23.08% |
glen lee | glen lee | 41 | 11.20% | 6 | 23.08% |
tony cho | tony cho | 15 | 4.10% | 5 | 19.23% |
chaehyun lim | chaehyun lim | 11 | 3.01% | 3 | 11.54% |
amitoj kaur chawla | amitoj kaur chawla | 10 | 2.73% | 1 | 3.85% |
leo kim | leo kim | 5 | 1.37% | 3 | 11.54% |
greg kroah-hartman | greg kroah-hartman | 1 | 0.27% | 1 | 3.85% |
| Total | 366 | 100.00% | 26 | 100.00% |
EXPORT_SYMBOL_GPL(wilc_netdev_init);
MODULE_LICENSE("GPL");
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
johnny kim | johnny kim | 4744 | 69.70% | 3 | 2.00% |
glen lee | glen lee | 1141 | 16.76% | 59 | 39.33% |
tony cho | tony cho | 294 | 4.32% | 11 | 7.33% |
leo kim | leo kim | 267 | 3.92% | 32 | 21.33% |
arnd bergmann | arnd bergmann | 243 | 3.57% | 14 | 9.33% |
chaehyun lim | chaehyun lim | 39 | 0.57% | 14 | 9.33% |
chandra s gorentla | chandra s gorentla | 22 | 0.32% | 2 | 1.33% |
greg kroah-hartman | greg kroah-hartman | 22 | 0.32% | 9 | 6.00% |
hari prasath gujulan elango | hari prasath gujulan elango | 12 | 0.18% | 1 | 0.67% |
amitoj kaur chawla | amitoj kaur chawla | 10 | 0.15% | 1 | 0.67% |
dean lee | dean lee | 7 | 0.10% | 1 | 0.67% |
chris park | chris park | 2 | 0.03% | 1 | 0.67% |
sudip mukherjee | sudip mukherjee | 2 | 0.03% | 1 | 0.67% |
guenter roeck | guenter roeck | 1 | 0.01% | 1 | 0.67% |
| Total | 6806 | 100.00% | 150 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.