diff options
Diffstat (limited to 'drivers/staging/gdm72xx')
-rw-r--r-- | drivers/staging/gdm72xx/gdm_qos.c | 6 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/gdm_sdio.c | 8 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/gdm_usb.c | 31 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/gdm_wimax.c | 18 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/gdm_wimax.h | 1 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/netlink_k.c | 17 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/sdio_boot.c | 1 | ||||
-rw-r--r-- | drivers/staging/gdm72xx/usb_boot.c | 3 |
8 files changed, 37 insertions, 48 deletions
diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c index 0217680..80bde05 100644 --- a/drivers/staging/gdm72xx/gdm_qos.c +++ b/drivers/staging/gdm72xx/gdm_qos.c @@ -11,7 +11,6 @@ * GNU General Public License for more details. */ -#include <linux/version.h> #include <linux/etherdevice.h> #include <asm/byteorder.h> @@ -196,7 +195,7 @@ static u32 chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 *Stream, u8 *port) return 0; } -static u32 get_qos_index(struct nic *nic, u8* iph, u8* tcpudph) +static u32 get_qos_index(struct nic *nic, u8 *iph, u8 *tcpudph) { u32 IP_Ver, Header_Len, i; struct qos_cb_s *qcb = &nic->qos; @@ -241,8 +240,7 @@ static u32 extract_qos_list(struct nic *nic, struct list_head *head) qcb->csr[i].QoSBufCount++; if (!list_empty(&qcb->qos_list[i])) - wprintk("QoS Index(%d) " - "is piled!!\n", i); + wprintk("QoS Index(%d) is piled!!\n", i); } } } diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c index e1a3dd2..3e43c01 100644 --- a/drivers/staging/gdm72xx/gdm_sdio.c +++ b/drivers/staging/gdm72xx/gdm_sdio.c @@ -14,7 +14,6 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/kernel.h> -#include <linux/version.h> #include <linux/mmc/core.h> #include <linux/mmc/card.h> @@ -665,20 +664,17 @@ static int sdio_wimax_probe(struct sdio_func *func, if (ret) return ret; - phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL); + phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL); if (phy_dev == NULL) { ret = -ENOMEM; goto out; } - sdev = kmalloc(sizeof(*sdev), GFP_KERNEL); + sdev = kzalloc(sizeof(*sdev), GFP_KERNEL); if (sdev == NULL) { ret = -ENOMEM; goto out; } - memset(phy_dev, 0, sizeof(*phy_dev)); - memset(sdev, 0, sizeof(*sdev)); - phy_dev->priv_dev = (void *)sdev; phy_dev->send_func = gdm_sdio_send; phy_dev->rcv_func = gdm_sdio_receive; diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c index 1e9dc0d..d48d49c 100644 --- a/drivers/staging/gdm72xx/gdm_usb.c +++ b/drivers/staging/gdm72xx/gdm_usb.c @@ -12,10 +12,10 @@ */ #include <linux/module.h> -#include <linux/version.h> #include <linux/kernel.h> #include <linux/usb.h> #include <asm/byteorder.h> +#include <linux/kthread.h> #include "gdm_usb.h" #include "gdm_wimax.h" @@ -270,20 +270,17 @@ static void release_usb(struct usbwm_dev *udev) } } -static void gdm_usb_send_complete(struct urb *urb) +static void __gdm_usb_send_complete(struct urb *urb) { struct usb_tx *t = urb->context; struct tx_cxt *tx = t->tx_cxt; u8 *pkt = t->buf; u16 cmd_evt; - unsigned long flags; /* Completion by usb_unlink_urb */ if (urb->status == -ECONNRESET) return; - spin_lock_irqsave(&tx->lock, flags); - if (t->callback) t->callback(t->cb_data); @@ -295,7 +292,16 @@ static void gdm_usb_send_complete(struct urb *urb) put_tx_struct(tx, t); else free_tx_struct(t); +} +static void gdm_usb_send_complete(struct urb *urb) +{ + struct usb_tx *t = urb->context; + struct tx_cxt *tx = t->tx_cxt; + unsigned long flags; + + spin_lock_irqsave(&tx->lock, flags); + __gdm_usb_send_complete(urb); spin_unlock_irqrestore(&tx->lock, flags); } @@ -411,7 +417,7 @@ out: send_fail: t->callback = NULL; - gdm_usb_send_complete(t->urb); + __gdm_usb_send_complete(t->urb); spin_unlock_irqrestore(&tx->lock, flags); return ret; } @@ -540,7 +546,7 @@ static void do_pm_control(struct work_struct *work) if (ret) { t->callback = NULL; - gdm_usb_send_complete(t->urb); + __gdm_usb_send_complete(t->urb); } } } @@ -584,20 +590,17 @@ static int gdm_usb_probe(struct usb_interface *intf, goto out; } - phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL); + phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL); if (phy_dev == NULL) { ret = -ENOMEM; goto out; } - udev = kmalloc(sizeof(*udev), GFP_KERNEL); + udev = kzalloc(sizeof(*udev), GFP_KERNEL); if (udev == NULL) { ret = -ENOMEM; goto out; } - memset(phy_dev, 0, sizeof(*phy_dev)); - memset(udev, 0, sizeof(*udev)); - if (idProduct == 0x7205 || idProduct == 0x7206) udev->padding = GDM7205_PADDING; else @@ -742,7 +745,7 @@ static int k_mode_thread(void *arg) if (ret) { t->callback = NULL; - gdm_usb_send_complete(t->urb); + __gdm_usb_send_complete(t->urb); } } @@ -775,7 +778,7 @@ static struct usb_driver gdm_usb_driver = { static int __init usb_gdm_wimax_init(void) { #ifdef CONFIG_WIMAX_GDM72XX_K_MODE - kernel_thread(k_mode_thread, NULL, CLONE_KERNEL); + kthread_run(k_mode_thread, NULL, "WiMax_thread"); #endif /* CONFIG_WIMAX_GDM72XX_K_MODE */ return usb_register(&gdm_usb_driver); } diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index f1936b9..0716efc 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -11,7 +11,6 @@ * GNU General Public License for more details. */ -#include <linux/version.h> #include <linux/etherdevice.h> #include <asm/byteorder.h> #include <linux/ip.h> @@ -256,17 +255,15 @@ static void gdm_wimax_event_rcv(struct net_device *dev, u16 type, void *msg, static int gdm_wimax_event_init(void) { - if (wm_event.ref_cnt == 0) { + if (!wm_event.ref_cnt) { wm_event.sock = netlink_init(NETLINK_WIMAX, gdm_wimax_event_rcv); + if (wm_event.sock) + wm_event.ref_cnt++; INIT_LIST_HEAD(&wm_event.evtq); INIT_LIST_HEAD(&wm_event.freeq); INIT_WORK(&wm_event.ws, __gdm_wimax_event_send); spin_lock_init(&wm_event.evt_lock); - } - - if (wm_event.sock) { - wm_event.ref_cnt++; return 0; } @@ -745,13 +742,8 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf, "[%x/%d]\n", __func__, T, L); return -1; } - printk(KERN_INFO - "MAC change [%02x:%02x:%02x:%02x:%02x:%02x]" - "->[%02x:%02x:%02x:%02x:%02x:%02x]\n", - dev->dev_addr[0], dev->dev_addr[1], - dev->dev_addr[2], dev->dev_addr[3], - dev->dev_addr[4], dev->dev_addr[5], - V[0], V[1], V[2], V[3], V[4], V[5]); + printk(KERN_INFO "MAC change [%pM]->[%pM]\n", + dev->dev_addr, V); memcpy(dev->dev_addr, V, dev->addr_len); return 1; } diff --git a/drivers/staging/gdm72xx/gdm_wimax.h b/drivers/staging/gdm72xx/gdm_wimax.h index 023e649..6ec0ab4 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.h +++ b/drivers/staging/gdm72xx/gdm_wimax.h @@ -15,7 +15,6 @@ #define __GDM_WIMAX_H__ #include <linux/netdevice.h> -#include <linux/version.h> #include <linux/types.h> #include "wm_ioctl.h" #if defined(CONFIG_WIMAX_GDM72XX_QOS) diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c index 5166513..3abb31d 100644 --- a/drivers/staging/gdm72xx/netlink_k.c +++ b/drivers/staging/gdm72xx/netlink_k.c @@ -11,7 +11,6 @@ * GNU General Public License for more details. */ -#include <linux/version.h> #include <linux/module.h> #include <linux/etherdevice.h> #include <linux/netlink.h> @@ -88,13 +87,15 @@ struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type, void *msg, int len)) { struct sock *sock; + struct netlink_kernel_cfg cfg = { + .input = netlink_rcv, + }; #if !defined(DEFINE_MUTEX) init_MUTEX(&netlink_mutex); #endif - sock = netlink_kernel_create(&init_net, unit, 0, netlink_rcv, NULL, - THIS_MODULE); + sock = netlink_kernel_create(&init_net, unit, THIS_MODULE, &cfg); if (sock) rcv_cb = cb; @@ -127,8 +128,12 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) } seq++; - nlh = NLMSG_PUT(skb, 0, seq, type, len); - memcpy(NLMSG_DATA(nlh), msg, len); + nlh = nlmsg_put(skb, 0, seq, type, len, 0); + if (!nlh) { + kfree_skb(skb); + return -EMSGSIZE; + } + memcpy(nlmsg_data(nlh), msg, len); NETLINK_CB(skb).pid = 0; NETLINK_CB(skb).dst_group = 0; @@ -144,7 +149,5 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) } ret = 0; } - -nlmsg_failure: return ret; } diff --git a/drivers/staging/gdm72xx/sdio_boot.c b/drivers/staging/gdm72xx/sdio_boot.c index 5d48479..65624bc 100644 --- a/drivers/staging/gdm72xx/sdio_boot.c +++ b/drivers/staging/gdm72xx/sdio_boot.c @@ -12,7 +12,6 @@ */ #include <linux/module.h> -#include <linux/version.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/mm.h> diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c index b366a54..e3dbd5a 100644 --- a/drivers/staging/gdm72xx/usb_boot.c +++ b/drivers/staging/gdm72xx/usb_boot.c @@ -13,7 +13,6 @@ #include <linux/uaccess.h> #include <linux/module.h> -#include <linux/version.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/usb.h> @@ -174,7 +173,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid) filp = filp_open(img_name, O_RDONLY | O_LARGEFILE, 0); if (IS_ERR(filp)) { printk(KERN_ERR "Can't find %s.\n", img_name); - ret = -ENOENT; + ret = PTR_ERR(filp); goto restore_fs; } |