Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bef7a0f authored by Mithlesh Thukral's avatar Mithlesh Thukral Committed by Greg Kroah-Hartman
Browse files

Staging: otus : checkpatch.pl cleanup for some more .c files



Second lot of checkpatch.pl error and warning fixes for .c files of
otus driver in staging tree.
(Externs would be removed in a seperate patch)

Signed-off-by: default avatarMithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b767fa1d
Loading
Loading
Loading
Loading
+17 −18
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ extern u8_t zfLnxCreateThread(zdev_t *dev);

/* Definition of Wireless Extension */

//wireless extension helper functions
/* wireless extension helper functions */
extern int usbdrv_ioctl_setessid(struct net_device *dev, struct iw_point *erq);
extern int usbdrv_ioctl_setrts(struct net_device *dev, struct iw_param *rrq);
/* Wireless Extension Handler functions */
@@ -282,8 +282,8 @@ static struct iw_handler_def p80211wext_handler_def = {
};

/* WDS */
//struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER];
//void zfInitWdsStruct(void);
/* struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER]; */
/* void zfInitWdsStruct(void);	*/

/* VAP */
struct zsVapStruct vap[ZM_VAP_PORT_NUMBER];
@@ -314,13 +314,11 @@ irqreturn_t usbdrv_intr(int irq, void *dev_inst, struct pt_regs *regs)
        return IRQ_NONE;

    /* the device is closed, don't continue or else bad things may happen. */
    if (!netif_running(dev)) {
    if (!netif_running(dev))
        return IRQ_NONE;
    }

    if (macp->driver_isolated) {
    if (macp->driver_isolated)
        return IRQ_NONE;
    }

#if (WLAN_HOSTIF == WLAN_PCI)
    //zfiIsrPci(dev);
@@ -340,9 +338,11 @@ int usbdrv_open(struct net_device *dev)

    printk("Enter open()\n");

//#ifndef CONFIG_SMP
//    read_lock(&(macp->isolate_lock));
//#endif
/*
 * #ifndef CONFIG_SMP
 *   read_lock(&(macp->isolate_lock));
 * #endif
 */
    if (macp->driver_isolated) {
        rc = -EBUSY;
        goto exit;
@@ -393,11 +393,11 @@ int usbdrv_open(struct net_device *dev)
    dev->dev_addr[4] = addr[4];
    dev->dev_addr[5] = addr[5];
#endif
    //zfwMacAddressNotify() will be called to setup dev->dev_addr[]
    /* zfwMacAddressNotify() will be called to setup dev->dev_addr[] */

    zfLnxCreateThread(dev);

    mod_timer(&(macp->hbTimer10ms), jiffies + (1*HZ)/100);   //10 ms
    mod_timer(&(macp->hbTimer10ms), jiffies + (1*HZ)/100);   /* 10 ms */

    netif_carrier_on(dev);

@@ -425,15 +425,15 @@ int usbdrv_open(struct net_device *dev)

    #if ZM_SHARE_AUTH == 1
    zfiWlanSetAuthenticationMode(dev, 1);
    #endif //#if ZM_SHARE_AUTH == 1
  #endif //#if ZM_WEP_MOME == 1
    #endif /* #if ZM_SHARE_AUTH == 1 */
  #endif /* #if ZM_WEP_MOME == 1 */

#elif ZM_PIBSS_MODE == 1
    zfiWlanSetWlanMode(dev, ZM_MODE_PSEUDO);
#else
    zfiWlanSetWlanMode(dev, ZM_MODE_INFRASTRUCTURE);
#endif
    //zfiWlanSetChannel(dev, ZM_CHANNEL, FALSE);
    /* zfiWlanSetChannel(dev, ZM_CHANNEL, FALSE); */
    zfiWlanSetFrequency(dev, 2462000, FALSE);
    zfiWlanSetRtsThreshold(dev, 32767);
    zfiWlanSetFragThreshold(dev, 0);
@@ -1128,8 +1128,7 @@ u8_t zfLnxClearStructs(struct net_device *dev)

    printk(KERN_ERR "TxQCnt: %d\n", TxQCnt);

    for(ii = 0; ii < TxQCnt; ii++)
    {
    for (ii = 0; ii < TxQCnt; ii++) {
        UsbTxQ_t *TxQ = zfLnxGetUsbTxBuffer(dev);

        printk(KERN_ERR "dev_kfree_skb_any\n");
+10 −10
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ void zfwBufFree(zdev_t* dev, zbuf_t* buf, u16_t status)
/* Called to adjust buffer size and head pointer */
u16_t zfwBufRemoveHead(zdev_t *dev, zbuf_t *buf, u16_t size)
{
    //zm_assert(buf->len > size);
    /* zm_assert(buf->len > size); */

    buf->data += size;
    buf->len -= size;
+183 −167
Original line number Diff line number Diff line
@@ -37,9 +37,10 @@ u16_t zfLnxAuthNotify(zdev_t* dev, u16_t* macAddr)
	return 0;
}

u16_t zfLnxAsocNotify(zdev_t* dev, u16_t* macAddr, u8_t* body, u16_t bodySize, u16_t port)
u16_t zfLnxAsocNotify(zdev_t *dev, u16_t *macAddr, u8_t *body, u16_t bodySize,
			 u16_t port)
{
//#ifdef ZM_HOSTAPD_SUPPORT
/* #ifdef ZM_HOSTAPD_SUPPORT	*/
	struct usbdrv_private *macp = dev->ml_priv;
	union iwreq_data wreq;
	u8_t *addr = (u8_t *) macAddr;
@@ -51,10 +52,8 @@ u16_t zfLnxAsocNotify(zdev_t* dev, u16_t* macAddr, u8_t* body, u16_t bodySize, u
	printk(KERN_DEBUG "join_event of MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);

    for(i = 0; i < ZM_OAL_MAX_STA_SUPPORT; i++)
    {
        for(j = 0; j < IEEE80211_ADDR_LEN; j++)
        {
	for (i = 0; i < ZM_OAL_MAX_STA_SUPPORT; i++) {
		for (j = 0; j < IEEE80211_ADDR_LEN; j++) {
			if ((macp->stawpaie[i].wpa_macaddr[j] != 0) &&
				(macp->stawpaie[i].wpa_macaddr[j] != addr[j]))
				break;
@@ -62,35 +61,44 @@ u16_t zfLnxAsocNotify(zdev_t* dev, u16_t* macAddr, u8_t* body, u16_t bodySize, u
		if (j == 6)
			break;
	}
    if (i < ZM_OAL_MAX_STA_SUPPORT)
    {
        //printk("zfwAsocNotify - store wpa ie in macp, index = %d\n", i);
        memcpy(macp->stawpaie[i].wpa_macaddr, macAddr, IEEE80211_ADDR_LEN);
	if (i < ZM_OAL_MAX_STA_SUPPORT) {
		/*
		 * printk("zfwAsocNotify - store wpa ie in macp,
		 * 	index = %d\n", i);
		 */
		memcpy(macp->stawpaie[i].wpa_macaddr, macAddr,
			IEEE80211_ADDR_LEN);
		memcpy(macp->stawpaie[i].wpa_ie, body, bodySize);
	}
    //if(macp->cardSetting.BssType == INFRASTRUCTURE_BSS) {
    //            //wireless_send_event(macp->device, SIOCGIWSCAN, &wreq, NULL);
    //    wireless_send_event(macp->device, SIOCGIWAP, &wreq, NULL);
    //}
    //else if(macp->cardSetting.BssType == AP_BSS) {
//        if (port == 0)
//        {
	/*
	 * if(macp->cardSetting.BssType == INFRASTRUCTURE_BSS) {
	 * wireless_send_event(macp->device, SIOCGIWSCAN, &wreq, NULL);
	 *	wireless_send_event(macp->device, SIOCGIWAP, &wreq, NULL);
	 * }
	 * else if(macp->cardSetting.BssType == AP_BSS) {
	 *	if (port == 0)
	 *	{
	 */
			wireless_send_event(dev, IWEVREGISTERED, &wreq, NULL);
//        }
//        else
//        {
//            /* Check whether the VAP device is valid */
//            if (vap[port].dev != NULL)
//            {
//                wireless_send_event(vap[port].dev, IWEVREGISTERED, &wreq, NULL);
//            }
//            else
//            {
//                printk(KERN_ERR "Can' find a valid VAP device, port: %d\n", port);
//            }
//        }
    //}
//#endif
	/*
	 *	}
	 *	else
	 *	{
	 *		 Check whether the VAP device is valid
	 *		if (vap[port].dev != NULL)
	 *		{
	 *			wireless_send_event(vap[port].dev,
	 *					IWEVREGISTERED, &wreq, NULL);
	 *		}
	 *		else
	 *		{
	 *			printk(KERN_ERR "Can' find a valid VAP device,
	 *				 port: %d\n", port);
	 *		}
	 *	}
	 * }
	 */
/* #endif	*/

	return 0;
}
@@ -138,26 +146,27 @@ void zfLnxConnectNotify(zdev_t* dev, u16_t status, u16_t* bssid)
	u8_t *addr = (u8_t *) bssid;
	struct usbdrv_private *macp = dev->ml_priv;

    if (bssid != NULL)
    {
	if (bssid != NULL) {
		memset(&wreq, 0, sizeof(wreq));
		if (status == ZM_STATUS_MEDIA_CONNECT)
			memcpy(wreq.addr.sa_data, bssid, ETH_ALEN);
		wreq.addr.sa_family = ARPHRD_ETHER;

        if (status == ZM_STATUS_MEDIA_CONNECT)
        {
		if (status == ZM_STATUS_MEDIA_CONNECT) {
#ifdef ZM_CONFIG_BIG_ENDIAN
            printk(KERN_DEBUG "Connected to AP, MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
                    addr[1], addr[0], addr[3], addr[2], addr[5], addr[4]);
			printk(KERN_DEBUG "Connected to AP, MAC:"
				"%02x:%02x:%02x:%02x:%02x:%02x\n",
				addr[1], addr[0], addr[3], addr[2],
				addr[5], addr[4]);
#else
            printk(KERN_DEBUG "Connected to AP, MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
                    addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
			printk(KERN_DEBUG "Connected to AP, MAC:"
				 "%02x:%02x:%02x:%02x:%02x:%02x\n",
				addr[0], addr[1], addr[2], addr[3],
				addr[4], addr[5]);
#endif

			netif_start_queue(dev);
        }
        else if ((status == ZM_STATUS_MEDIA_DISCONNECT) ||
		} else if ((status == ZM_STATUS_MEDIA_DISCONNECT) ||
			    (status == ZM_STATUS_MEDIA_DISABLED) ||
			    (status == ZM_STATUS_MEDIA_CONNECTION_DISABLED) ||
			    (status == ZM_STATUS_MEDIA_CONNECTION_RESET) ||
@@ -166,8 +175,7 @@ void zfLnxConnectNotify(zdev_t* dev, u16_t status, u16_t* bssid)
			    (status == ZM_STATUS_MEDIA_DISCONNECT_DISASOC) ||
			   (status == ZM_STATUS_MEDIA_DISCONNECT_BEACON_MISS) ||
			    (status == ZM_STATUS_MEDIA_DISCONNECT_NOT_FOUND) ||
	         (status == ZM_STATUS_MEDIA_DISCONNECT_TIMEOUT))
        {
			    (status == ZM_STATUS_MEDIA_DISCONNECT_TIMEOUT)) {
			printk(KERN_DEBUG "Disconnection Notify\n");

			netif_stop_queue(dev);
@@ -177,29 +185,33 @@ void zfLnxConnectNotify(zdev_t* dev, u16_t status, u16_t* bssid)
	macp->adapterState = status;

		if (zfiWlanQueryWlanMode(dev) == ZM_MODE_INFRASTRUCTURE) {
        //            //wireless_send_event(dev, SIOCGIWSCAN, &wreq, NULL);
			/*wireless_send_event(dev, SIOCGIWSCAN, &wreq, NULL);*/
			wireless_send_event(dev, SIOCGIWAP, &wreq, NULL);
        }
        else if(zfiWlanQueryWlanMode(dev) == ZM_MODE_AP) {
            //if (port == 0)
            //{
                wireless_send_event(dev, IWEVREGISTERED, &wreq, NULL);
            //}
            //else
            //{
            //    /* Check whether the VAP device is valid */
            //    if (vap[port].dev != NULL)
            //    {
            //        wireless_send_event(vap[port].dev, IWEVREGISTERED, &wreq, NULL);
            //    }
            //    else
            //    {
            //        printk(KERN_ERR "Can' find a valid VAP device, port: %d\n", port);
            //    }
            //}
		} else if (zfiWlanQueryWlanMode(dev) == ZM_MODE_AP) {
			/*
			 * if (port == 0)
			 * {
			 *	wireless_send_event(dev, IWEVREGISTERED,
			 *				 &wreq, NULL);
			 * }
			 * else
			 * {
			 *	Check whether the VAP device is valid
			 *	if (vap[port].dev != NULL)
			 *	{
			 *		wireless_send_event(vap[port].dev,
		 *				 IWEVREGISTERED, &wreq, NULL);
			 *	}
			 *	else
			 *	{
			 *		printk(KERN_ERR "Can' find a valid VAP"
			 *			" device, port: %d\n", port);
			 *	}
			 * }
			*/
		}
	}
    //return 0;
	/* return 0;	*/
}

void zfLnxScanNotify(zdev_t *dev, struct zsScanResult *result)
@@ -212,7 +224,7 @@ void zfLnxStatisticsNotify(zdev_t* dev, struct zsStastics* result)
	return;
}

//void zfwMicFailureNotify(zdev_t* dev, u8_t* message, u16_t event)
/* void zfwMicFailureNotify(zdev_t *dev, u8_t *message, u16_t event) */
void zfLnxMicFailureNotify(zdev_t *dev, u16_t *addr, u16_t status)
{
	static const char *tag = "MLME-MICHAELMICFAILURE.indication";
@@ -220,14 +232,14 @@ void zfLnxMicFailureNotify(zdev_t* dev, u16_t* addr, u16_t status)
	char buf[128];

	/* TODO: needed parameters: count, type, src address */
	//snprintf(buf, sizeof(buf), "%s(%scast addr=%s)", tag,
	//    (status == ZM_MIC_GROUP_ERROR) ?  "broad" : "uni",
	//    ether_sprintf((u8_t *)addr));
	/*
	 * snprintf(buf, sizeof(buf), "%s(%scast addr=%s)", tag,
	 *	(status == ZM_MIC_GROUP_ERROR) ?  "broad" : "uni",
	 *	ether_sprintf((u8_t *)addr));
	 */

	if (zfiWlanQueryWlanMode(dev) == ZM_MODE_INFRASTRUCTURE)
	{
		strcpy(buf, tag);
	}

	memset(&wrqu, 0, sizeof(wrqu));
	wrqu.data.length = strlen(buf);
@@ -242,16 +254,19 @@ void zfLnxApMicFailureNotify(zdev_t* dev, u8_t* addr, zbuf_t* buf)
	memset(&wreq, 0, sizeof(wreq));
	memcpy(wreq.addr.sa_data, addr, ETH_ALEN);
	wreq.addr.sa_family = ARPHRD_ETHER;
    printk(KERN_DEBUG "zfwApMicFailureNotify(), MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
	printk(KERN_DEBUG "zfwApMicFailureNotify(), "
			"MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
			addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);

	return;
}

// status = 0  => partner lost
//        = 1  => partner alive
//void zfwIbssPartnerNotify(zdev_t* dev, u8_t status)
void zfLnxIbssPartnerNotify(zdev_t* dev, u16_t status, struct zsPartnerNotifyEvent *event)
/*
 * status = 0  => partner lost
 *		= 1  => partner alive
 * void zfwIbssPartnerNotify(zdev_t* dev, u8_t status)
 */
void zfLnxIbssPartnerNotify(zdev_t *dev, u16_t status,
				struct zsPartnerNotifyEvent *event)
{
}

@@ -270,7 +285,8 @@ void zfLnxSendCompleteIndication(zdev_t* dev, zbuf_t* buf)
}


void zfLnxRestoreBufData(zdev_t* dev, zbuf_t* buf) {
void zfLnxRestoreBufData(zdev_t *dev, zbuf_t *buf)
{

}
/* Leave an empty line below to remove warning message on some compiler */
+29 −32
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
#include <linux/netlink.h>
#include <net/iw_handler.h>

//extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER];
/* extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER];	*/
extern struct zsVapStruct vap[ZM_VAP_PORT_NUMBER];
extern u16_t zfLnxGetVapId(zdev_t *dev);

@@ -43,17 +43,12 @@ u16_t zfwGetVapId(zdev_t* dev)
void zfwSleep(zdev_t *dev, u32_t ms)
{
	if (in_interrupt() == 0)
    {
		mdelay(ms);
    }
    else
    {
	else {
		int ii;
		int iter = 100000 * ms;

        for (ii = 0; ii < iter; ii++)
        {

		for (ii = 0; ii < iter; ii++) {
		}
	}
}
@@ -87,12 +82,14 @@ asmlinkage u16_t zfwBufReadHalfWord(zdev_t* dev, zbuf_t* buf, u16_t offset)
	return zmw_cpu_to_le16(*(u16_t *)((u8_t *)buf->data+offset));
}

asmlinkage void zfwBufWriteByte(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t value)
asmlinkage void zfwBufWriteByte(zdev_t *dev, zbuf_t *buf, u16_t offset,
				u8_t value)
{
	*(u8_t *)((u8_t *)buf->data+offset) = value;
}

asmlinkage void zfwBufWriteHalfWord(zdev_t* dev, zbuf_t* buf, u16_t offset, u16_t value)
asmlinkage void zfwBufWriteHalfWord(zdev_t *dev, zbuf_t *buf, u16_t offset,
					u16_t value)
{
	*(u16_t *)((u8_t *)buf->data+offset) = zmw_cpu_to_le16(value);
}
+98 −112
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <net/iw_handler.h>


//extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER];
/* extern struct zsWdsStruct wds[ZM_WDS_PORT_NUMBER]; 	*/
extern struct zsVapStruct vap[ZM_VAP_PORT_NUMBER];


@@ -44,27 +44,25 @@ void zfLnxRecv80211(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* addInfo)
	zbuf_t *skb1;
	struct usbdrv_private *macp = dev->ml_priv;

    //frameCtrl = zmw_buf_readb(dev, buf, 0);
	/* frameCtrl = zmw_buf_readb(dev, buf, 0);	*/
	frameCtrl = *(u8_t *)((u8_t *)buf->data);
	frameType = frameCtrl & 0xf;
	frameSubtype = frameCtrl & 0xf0;

    if ((frameType == 0x0) && (macp->forwardMgmt))
    {
        switch (frameSubtype)
        {
	if ((frameType == 0x0) && (macp->forwardMgmt)) {
		switch (frameSubtype) {
			/* Beacon */
		case 0x80:
			/* Probe response */
		case 0x50:
			skb1 = skb_copy(buf, GFP_ATOMIC);
                if(skb1 != NULL)
                {
			if (skb1 != NULL) {
				skb1->dev = dev;
				skb1->mac_header = skb1->data;
				skb1->ip_summed = CHECKSUM_NONE;
				skb1->pkt_type = PACKET_OTHERHOST;
	            skb1->protocol = __constant_htons(0x0019);  /* ETH_P_80211_RAW */
				/* ETH_P_80211_RAW */
				skb1->protocol = __constant_htons(0x0019);
				netif_rx(skb1);
			}
			break;
@@ -84,7 +82,7 @@ void zfLnxRecvEth(zdev_t* dev, zbuf_t* buf, u16_t port)
#ifdef ZM_AVOID_UDP_LARGE_PACKET_FAIL
	zbuf_t *new_buf;

    //new_buf = dev_alloc_skb(2048);
	/* new_buf = dev_alloc_skb(2048);	*/
	new_buf = dev_alloc_skb(buf->len);

#ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -101,21 +99,15 @@ void zfLnxRecvEth(zdev_t* dev, zbuf_t* buf, u16_t port)
	/* Free buffer */
	dev_kfree_skb_any(buf);

    if (port == 0)
    {
	if (port == 0) {
		new_buf->dev = dev;
		new_buf->protocol = eth_type_trans(new_buf, dev);
    }
    else
    {
	} else {
		/* VAP */
        if (vap[0].dev != NULL)
        {
		if (vap[0].dev != NULL) {
			new_buf->dev = vap[0].dev;
			new_buf->protocol = eth_type_trans(new_buf, vap[0].dev);
        }
        else
        {
		} else {
			new_buf->dev = dev;
			new_buf->protocol = eth_type_trans(new_buf, dev);
		}
@@ -126,21 +118,15 @@ void zfLnxRecvEth(zdev_t* dev, zbuf_t* buf, u16_t port)

	switch (netif_rx(new_buf))
#else
    if (port == 0)
    {
	if (port == 0) {
		buf->dev = dev;
		buf->protocol = eth_type_trans(buf, dev);
    }
    else
    {
	} else {
		/* VAP */
        if (vap[0].dev != NULL)
        {
		if (vap[0].dev != NULL) {
			buf->dev = vap[0].dev;
			buf->protocol = eth_type_trans(buf, vap[0].dev);
        }
        else
        {
		} else {
			buf->dev = dev;
			buf->protocol = eth_type_trans(buf, dev);
		}
Loading