extern void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
extern void WILC_WFI_p2p_rx(struct net_device *dev, uint8_t *buff, uint32_t size);
-static void *internal_alloc(uint32_t size, uint32_t flag);
static void linux_wlan_tx_complete(void *priv, int status);
void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset);
static int mac_init_fn(struct net_device *ndev);
void printk_later(const char *format, ...)
{
va_list args;
+
va_start(args, format);
ps8current += vsprintf(ps8current, format, args);
va_end(args);
irqreturn_t isr_bh_routine(int irq, void *userdata)
{
linux_wlan_t *nic;
+
nic = (linux_wlan_t *)userdata;
#else
static void isr_bh_routine(struct work_struct *work)
{
perInterface_wlan_t *nic;
+
nic = (perInterface_wlan_t *)container_of(work, linux_wlan_t, rx_work_queue);
#endif
{
if (msc <= 4000000) {
u32 u32Temp = msc * 1000;
+
usleep_range(u32Temp, u32Temp);
} else {
msleep(msc);
PRINT_D(INIT_DBG, "%d\n", *buff);
}
-static void *linux_wlan_malloc_atomic(uint32_t sz)
-{
- char *pntr = NULL;
- pntr = kmalloc(sz, GFP_ATOMIC);
- PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
- return (void *)pntr;
-
-}
-static void *linux_wlan_malloc(uint32_t sz)
-{
- char *pntr = NULL;
- pntr = kmalloc(sz, GFP_KERNEL);
- PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
- return (void *)pntr;
-}
-
-void linux_wlan_free(void *vp)
-{
- if (vp != NULL) {
- PRINT_D(MEM_DBG, "Freeing %p\n", vp);
- kfree(vp);
- }
-}
-
-static void *internal_alloc(uint32_t size, uint32_t flag)
-{
- char *pntr = NULL;
- pntr = kmalloc(size, flag);
- PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", size, pntr);
- return (void *)pntr;
-}
-
static void linux_wlan_init_lock(char *lockName, void *plock, int count)
{
sema_init((struct semaphore *)plock, count);
static int linux_wlan_lock_timeout(void *vp, u32 timeout)
{
int error = -1;
+
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
if (vp != NULL)
error = down_timeout((struct semaphore *)vp, msecs_to_jiffies(timeout));
static void linux_wlan_spin_lock(void *vp, unsigned long *flags)
{
unsigned long lflags;
+
PRINT_D(SPIN_DEBUG, "Lock spin %p\n", vp);
if (vp != NULL) {
spin_lock_irqsave((spinlock_t *)vp, lflags);
static void linux_wlan_spin_unlock(void *vp, unsigned long *flags)
{
unsigned long lflags = *flags;
+
PRINT_D(SPIN_DEBUG, "Unlock spin %p\n", vp);
if (vp != NULL) {
spin_unlock_irqrestore((spinlock_t *)vp, lflags);
goto _fail_;
}
- *(int *)c_val = (u32)pstrWFIDrv;
+ *(int *)c_val = 1;
if (!g_linux_wlan->oup.wlan_cfg_set(1, WID_SET_DRV_HANDLER, c_val, 4, 0, 0))
goto _fail_;
goto _fail_;
c_val[0] = 1; /* Enable N with immediate block ack. */
- if (!g_linux_wlan->oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, (u32)pstrWFIDrv))
+ if (!g_linux_wlan->oup.wlan_cfg_set(0, WID_11N_IMMEDIATE_BA_ENABLED, c_val, 1, 1, 1))
goto _fail_;
return 0;
nwi->os_func.os_sleep = linux_wlan_msleep;
nwi->os_func.os_atomic_sleep = linux_wlan_atomic_msleep;
nwi->os_func.os_debug = linux_wlan_dbg;
- nwi->os_func.os_malloc = linux_wlan_malloc;
- nwi->os_func.os_malloc_atomic = linux_wlan_malloc_atomic;
- nwi->os_func.os_free = linux_wlan_free;
nwi->os_func.os_lock = linux_wlan_lock;
nwi->os_func.os_unlock = linux_wlan_unlock;
nwi->os_func.os_wait = linux_wlan_lock_timeout;
{
int ret = 0;
+
PRINT_D(INIT_DBG, "Initializing Threads ...\n");
#if (RX_BH_TYPE == RX_BH_WORK_QUEUE)
uint8_t wilc1000_prepare_11b_core(wilc_wlan_inp_t *nwi, wilc_wlan_oup_t *nwo, linux_wlan_t *nic)
{
uint8_t trials = 0;
+
while ((core_11b_ready() && (READY_CHECK_THRESHOLD > (trials++)))) {
PRINT_D(INIT_DBG, "11b core not ready yet: %u\n", trials);
wilc_wlan_deinit(nic);
int ret = 0;
wilc_wlan_inp_t nwi;
wilc_wlan_oup_t nwo;
+
sdio_unregister_driver(&wilc_bus);
linux_wlan_device_detection(0);
if (g_linux_wlan->oup.wlan_cfg_get(1, WID_FIRMWARE_VERSION, 1, 0)) {
int size;
char Firmware_ver[20];
+
size = g_linux_wlan->oup.wlan_cfg_get_value(
WID_FIRMWARE_VERSION,
Firmware_ver, sizeof(Firmware_ver));
Set_machw_change_vir_if(false);
host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
- PRINT_D(INIT_DBG, "Mac address: %x:%x:%x:%x:%x:%x\n", mac_add[0], mac_add[1], mac_add[2],
- mac_add[3], mac_add[4], mac_add[5]);
+ PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
/* loop through the NUM of supported devices and set the MAC address */
for (i = 0; i < g_linux_wlan->u8NoIfcs; i++) {
{
linux_wlan_t *nic;
+
nic = netdev_priv(ndev);
/*initialize platform*/
struct WILC_WFI_priv *priv;
tstrWILC_WFIDrv *pstrWFIDrv;
int i = 0;
+
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
pstrWFIDrv = (tstrWILC_WFIDrv *)priv->hWILCWFIDrv;
{
struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;
+
if (status == 1)
PRINT_D(TX_DBG, "Packet sent successfully - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
else
PRINT_D(TX_DBG, "Couldn't send packet - Size = %d - Address = %p - SKB = %p\n", pv_data->size, pv_data->buff, pv_data->skb);
/* Free the SK Buffer, its work is done */
dev_kfree_skb(pv_data->skb);
- linux_wlan_free(pv_data);
+ kfree(pv_data);
}
int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
char *pu8UdpBuffer;
struct iphdr *ih;
struct ethhdr *eth_h;
+
nic = netdev_priv(ndev);
PRINT_D(INT_DBG, "\n========\n IntUH: %d - IntBH: %d - IntCld: %d\n========\n", int_rcvdU, int_rcvdB, int_clrd);
return 0;
}
- tx_data = (struct tx_complete_data *)internal_alloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
+ tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
if (tx_data == NULL) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb);