summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/capi/capi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 21:04:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-20 21:04:47 -0700
commit3b59bf081622b6446db77ad06c93fe23677bc533 (patch)
tree3f4bb5a27c90cc86994a1f6d3c53fbf9208003cb /drivers/isdn/capi/capi.c
parente45836fafe157df137a837093037f741ad8f4c90 (diff)
parentbbdb32cb5b73597386913d052165423b9d736145 (diff)
downloadtalos-obmc-linux-3b59bf081622b6446db77ad06c93fe23677bc533.tar.gz
talos-obmc-linux-3b59bf081622b6446db77ad06c93fe23677bc533.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking merge from David Miller: "1) Move ixgbe driver over to purely page based buffering on receive. From Alexander Duyck. 2) Add receive packet steering support to e1000e, from Bruce Allan. 3) Convert TCP MD5 support over to RCU, from Eric Dumazet. 4) Reduce cpu usage in handling out-of-order TCP packets on modern systems, also from Eric Dumazet. 5) Support the IP{,V6}_UNICAST_IF socket options, making the wine folks happy, from Erich Hoover. 6) Support VLAN trunking from guests in hyperv driver, from Haiyang Zhang. 7) Support byte-queue-limtis in r8169, from Igor Maravic. 8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but was never properly implemented, Jiri Benc fixed that. 9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang. 10) Support kernel side dump filtering by ctmark in netfilter ctnetlink, from Pablo Neira Ayuso. 11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker. 12) Add new peek socket options to assist with socket migration, from Pavel Emelyanov. 13) Add sch_plug packet scheduler whose queue is controlled by userland daemons using explicit freeze and release commands. From Shriram Rajagopalan. 14) Fix FCOE checksum offload handling on transmit, from Yi Zou." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits) Fix pppol2tp getsockname() Remove printk from rds_sendmsg ipv6: fix incorrent ipv6 ipsec packet fragment cpsw: Hook up default ndo_change_mtu. net: qmi_wwan: fix build error due to cdc-wdm dependecy netdev: driver: ethernet: Add TI CPSW driver netdev: driver: ethernet: add cpsw address lookup engine support phy: add am79c874 PHY support mlx4_core: fix race on comm channel bonding: send igmp report for its master fs_enet: Add MPC5125 FEC support and PHY interface selection net: bpf_jit: fix BPF_S_LDX_B_MSH compilation net: update the usage of CHECKSUM_UNNECESSARY fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso ixgbe: Fix issues with SR-IOV loopback when flow control is disabled net/hyperv: Fix the code handling tx busy ixgbe: fix namespace issues when FCoE/DCB is not enabled rtlwifi: Remove unused ETH_ADDR_LEN defines igbvf: Use ETH_ALEN ... Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.
Diffstat (limited to 'drivers/isdn/capi/capi.c')
-rw-r--r--drivers/isdn/capi/capi.c180
1 files changed, 90 insertions, 90 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 3a7905b06e53..b902794bbf07 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -25,7 +25,7 @@
#include <linux/tty.h>
#include <linux/netdevice.h>
#include <linux/ppp_defs.h>
-#include <linux/if_ppp.h>
+#include <linux/ppp-ioctl.h>
#include <linux/skbuff.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
@@ -164,7 +164,7 @@ static int capiminor_del_ack(struct capiminor *mp, u16 datahandle)
spin_lock_bh(&mp->ackqlock);
list_for_each_entry_safe(p, tmp, &mp->ackqueue, list) {
- if (p->datahandle == datahandle) {
+ if (p->datahandle == datahandle) {
list_del(&p->list);
mp->nack--;
spin_unlock_bh(&mp->ackqlock);
@@ -199,8 +199,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci)
unsigned int minor;
mp = kzalloc(sizeof(*mp), GFP_KERNEL);
- if (!mp) {
- printk(KERN_ERR "capi: can't alloc capiminor\n");
+ if (!mp) {
+ printk(KERN_ERR "capi: can't alloc capiminor\n");
return NULL;
}
@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb)
struct sk_buff *nskb;
nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
if (nskb) {
- u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
+ u16 datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
capimsg_setu16(s, 2, mp->ap->applid);
@@ -418,7 +418,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
pr_debug("capi: currently no receiver\n");
return -1;
}
-
+
ld = tty_ldisc_ref(tty);
if (!ld) {
/* fatal error, do not requeue */
@@ -459,7 +459,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb)
ld->ops->receive_buf(tty, skb->data, NULL, skb->len);
} else {
printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
- errcode);
+ errcode);
kfree_skb(nskb);
if (errcode == CAPI_SENDQUEUEFULL)
@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
goto unlock_out;
}
if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
- datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
+ datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
pr_debug("capi_signal: DATA_B3_IND %u len=%d\n",
datahandle, skb->len-CAPIMSG_LEN(skb->data));
skb_queue_tail(&mp->inqueue, skb);
@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
} else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) {
- datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4);
+ datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4);
pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n",
datahandle,
- CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2));
+ CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
kfree_skb(skb);
capiminor_del_ack(mp, datahandle);
tty = tty_port_tty_get(&mp->port);
@@ -669,7 +669,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (file->f_flags & O_NONBLOCK)
return -EAGAIN;
err = wait_event_interruptible(cdev->recvwait,
- (skb = skb_dequeue(&cdev->recvqueue)));
+ (skb = skb_dequeue(&cdev->recvqueue)));
if (err)
return err;
}
@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
}
static unsigned int
-capi_poll(struct file *file, poll_table * wait)
+capi_poll(struct file *file, poll_table *wait)
{
struct capidev *cdev = file->private_data;
unsigned int mask = 0;
@@ -786,75 +786,75 @@ register_out:
return retval;
case CAPI_GET_VERSION:
- {
- if (copy_from_user(&data.contr, argp,
- sizeof(data.contr)))
- return -EFAULT;
- cdev->errcode = capi20_get_version(data.contr, &data.version);
- if (cdev->errcode)
- return -EIO;
- if (copy_to_user(argp, &data.version,
- sizeof(data.version)))
- return -EFAULT;
- }
- return 0;
+ {
+ if (copy_from_user(&data.contr, argp,
+ sizeof(data.contr)))
+ return -EFAULT;
+ cdev->errcode = capi20_get_version(data.contr, &data.version);
+ if (cdev->errcode)
+ return -EIO;
+ if (copy_to_user(argp, &data.version,
+ sizeof(data.version)))
+ return -EFAULT;
+ }
+ return 0;
case CAPI_GET_SERIAL:
- {
- if (copy_from_user(&data.contr, argp,
- sizeof(data.contr)))
- return -EFAULT;
- cdev->errcode = capi20_get_serial (data.contr, data.serial);
- if (cdev->errcode)
- return -EIO;
- if (copy_to_user(argp, data.serial,
- sizeof(data.serial)))
- return -EFAULT;
- }
- return 0;
+ {
+ if (copy_from_user(&data.contr, argp,
+ sizeof(data.contr)))
+ return -EFAULT;
+ cdev->errcode = capi20_get_serial(data.contr, data.serial);
+ if (cdev->errcode)
+ return -EIO;
+ if (copy_to_user(argp, data.serial,
+ sizeof(data.serial)))
+ return -EFAULT;
+ }
+ return 0;
case CAPI_GET_PROFILE:
- {
- if (copy_from_user(&data.contr, argp,
- sizeof(data.contr)))
- return -EFAULT;
+ {
+ if (copy_from_user(&data.contr, argp,
+ sizeof(data.contr)))
+ return -EFAULT;
- if (data.contr == 0) {
- cdev->errcode = capi20_get_profile(data.contr, &data.profile);
- if (cdev->errcode)
- return -EIO;
+ if (data.contr == 0) {
+ cdev->errcode = capi20_get_profile(data.contr, &data.profile);
+ if (cdev->errcode)
+ return -EIO;
- retval = copy_to_user(argp,
- &data.profile.ncontroller,
- sizeof(data.profile.ncontroller));
+ retval = copy_to_user(argp,
+ &data.profile.ncontroller,
+ sizeof(data.profile.ncontroller));
- } else {
- cdev->errcode = capi20_get_profile(data.contr, &data.profile);
- if (cdev->errcode)
- return -EIO;
+ } else {
+ cdev->errcode = capi20_get_profile(data.contr, &data.profile);
+ if (cdev->errcode)
+ return -EIO;
- retval = copy_to_user(argp, &data.profile,
- sizeof(data.profile));
- }
- if (retval)
- return -EFAULT;
+ retval = copy_to_user(argp, &data.profile,
+ sizeof(data.profile));
}
- return 0;
+ if (retval)
+ return -EFAULT;
+ }
+ return 0;
case CAPI_GET_MANUFACTURER:
- {
- if (copy_from_user(&data.contr, argp,
- sizeof(data.contr)))
- return -EFAULT;
- cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
- if (cdev->errcode)
- return -EIO;
+ {
+ if (copy_from_user(&data.contr, argp,
+ sizeof(data.contr)))
+ return -EFAULT;
+ cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
+ if (cdev->errcode)
+ return -EIO;
- if (copy_to_user(argp, data.manufacturer,
- sizeof(data.manufacturer)))
- return -EFAULT;
+ if (copy_to_user(argp, data.manufacturer,
+ sizeof(data.manufacturer)))
+ return -EFAULT;
- }
- return 0;
+ }
+ return 0;
case CAPI_GET_ERRCODE:
data.errcode = cdev->errcode;
cdev->errcode = CAPI_NOERROR;
@@ -871,15 +871,15 @@ register_out:
return -ENXIO;
case CAPI_MANUFACTURER_CMD:
- {
- struct capi_manufacturer_cmd mcmd;
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
- if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
- return -EFAULT;
- return capi20_manufacturer(mcmd.cmd, mcmd.data);
- }
- return 0;
+ {
+ struct capi_manufacturer_cmd mcmd;
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+ if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
+ return -EFAULT;
+ return capi20_manufacturer(mcmd.cmd, mcmd.data);
+ }
+ return 0;
case CAPI_SET_FLAGS:
case CAPI_CLR_FLAGS: {
@@ -1066,7 +1066,7 @@ static int capinc_tty_write(struct tty_struct *tty,
mp->outbytes += skb->len;
}
- skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_ATOMIC);
+ skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + count, GFP_ATOMIC);
if (!skb) {
printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n");
spin_unlock_bh(&mp->outlock);
@@ -1107,7 +1107,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch)
invoke_send = true;
}
- skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+CAPI_MAX_BLKSIZE, GFP_ATOMIC);
+ skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC);
if (skb) {
skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
*(skb_put(skb, 1)) = ch;
@@ -1171,12 +1171,12 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty)
}
static int capinc_tty_ioctl(struct tty_struct *tty,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
}
-static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
+static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
{
pr_debug("capinc_tty_set_termios\n");
}
@@ -1339,18 +1339,18 @@ static inline void capinc_tty_exit(void) { }
*/
static int capi20_proc_show(struct seq_file *m, void *v)
{
- struct capidev *cdev;
+ struct capidev *cdev;
struct list_head *l;
mutex_lock(&capidev_list_lock);
list_for_each(l, &capidev_list) {
cdev = list_entry(l, struct capidev, list);
seq_printf(m, "0 %d %lu %lu %lu %lu\n",
- cdev->ap.applid,
- cdev->ap.nrecvctlpkt,
- cdev->ap.nrecvdatapkt,
- cdev->ap.nsentctlpkt,
- cdev->ap.nsentdatapkt);
+ cdev->ap.applid,
+ cdev->ap.nrecvctlpkt,
+ cdev->ap.nrecvdatapkt,
+ cdev->ap.nsentctlpkt,
+ cdev->ap.nsentdatapkt);
}
mutex_unlock(&capidev_list_lock);
return 0;
@@ -1445,9 +1445,9 @@ static int __init capi_init(void)
proc_init();
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
- compileinfo = " (middleware)";
+ compileinfo = " (middleware)";
#else
- compileinfo = " (no middleware)";
+ compileinfo = " (no middleware)";
#endif
printk(KERN_NOTICE "CAPI 2.0 started up with major %d%s\n",
capi_major, compileinfo);
OpenPOWER on IntegriCloud