Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[NET] ATM: Fix whitespace errors.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YOSHIFUJI Hideaki and committed by
David S. Miller
f7d57453 ed4477b9

+287 -287
+7 -7
net/atm/atm_sysfs.c
··· 30 30 31 31 static ssize_t show_atmaddress(struct class_device *cdev, char *buf) 32 32 { 33 - unsigned long flags; 33 + unsigned long flags; 34 34 char *pos = buf; 35 35 struct atm_dev *adev = to_atm_dev(cdev); 36 - struct atm_dev_addr *aaddr; 36 + struct atm_dev_addr *aaddr; 37 37 int bin[] = { 1, 2, 10, 6, 1 }, *fmt = bin; 38 38 int i, j; 39 39 40 - spin_lock_irqsave(&adev->lock, flags); 41 - list_for_each_entry(aaddr, &adev->local, entry) { 40 + spin_lock_irqsave(&adev->lock, flags); 41 + list_for_each_entry(aaddr, &adev->local, entry) { 42 42 for(i = 0, j = 0; i < ATM_ESA_LEN; ++i, ++j) { 43 43 if (j == *fmt) { 44 44 pos += sprintf(pos, "."); ··· 49 49 } 50 50 pos += sprintf(pos, "\n"); 51 51 } 52 - spin_unlock_irqrestore(&adev->lock, flags); 52 + spin_unlock_irqrestore(&adev->lock, flags); 53 53 54 54 return pos - buf; 55 55 } ··· 61 61 62 62 pos += sprintf(pos, "%d\n", 63 63 adev->signal == ATM_PHY_SIG_LOST ? 0 : 1); 64 - 64 + 65 65 return pos - buf; 66 66 } 67 67 ··· 86 86 link_rate = adev->link_rate * 8 * 53; 87 87 } 88 88 pos += sprintf(pos, "%d\n", link_rate); 89 - 89 + 90 90 return pos - buf; 91 91 } 92 92
+2 -2
net/atm/br2684.c
··· 182 182 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc; 183 183 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev); 184 184 if (!atm_may_send(atmvcc, skb->truesize)) { 185 - /* we free this here for now, because we cannot know in a higher 185 + /* we free this here for now, because we cannot know in a higher 186 186 layer whether the skb point it supplied wasn't freed yet. 187 187 now, it always is. 188 188 */ ··· 718 718 719 719 ++*pos; 720 720 721 - brd = list_entry(brd->br2684_devs.next, 721 + brd = list_entry(brd->br2684_devs.next, 722 722 struct br2684_dev, br2684_devs); 723 723 return (&brd->br2684_devs != &br2684_devs) ? brd : NULL; 724 724 }
+17 -17
net/atm/common.c
··· 109 109 struct atm_vcc *vcc = atm_sk(sk); 110 110 111 111 return (vcc->qos.txtp.max_sdu + 112 - atomic_read(&sk->sk_wmem_alloc)) <= sk->sk_sndbuf; 112 + atomic_read(&sk->sk_wmem_alloc)) <= sk->sk_sndbuf; 113 113 } 114 114 115 115 static void vcc_write_space(struct sock *sk) 116 - { 116 + { 117 117 read_lock(&sk->sk_callback_lock); 118 118 119 119 if (vcc_writable(sk)) { ··· 131 131 .owner = THIS_MODULE, 132 132 .obj_size = sizeof(struct atm_vcc), 133 133 }; 134 - 134 + 135 135 int vcc_create(struct socket *sock, int protocol, int family) 136 136 { 137 137 struct sock *sk; ··· 359 359 return error; 360 360 vcc->dev = dev; 361 361 write_lock_irq(&vcc_sklist_lock); 362 - if (test_bit(ATM_DF_REMOVED, &dev->flags) || 362 + if (test_bit(ATM_DF_REMOVED, &dev->flags) || 363 363 (error = find_ci(vcc, &vpi, &vci))) { 364 364 write_unlock_irq(&vcc_sklist_lock); 365 365 goto fail_module_put; ··· 494 494 if (!skb) 495 495 return error; 496 496 497 - copied = skb->len; 497 + copied = skb->len; 498 498 if (copied > size) { 499 - copied = size; 499 + copied = size; 500 500 msg->msg_flags |= MSG_TRUNC; 501 501 } 502 502 503 - error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 504 - if (error) 505 - return error; 506 - sock_recv_timestamp(msg, sk, skb); 507 - DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize); 508 - atm_return(vcc, skb->truesize); 509 - skb_free_datagram(sk, skb); 510 - return copied; 503 + error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); 504 + if (error) 505 + return error; 506 + sock_recv_timestamp(msg, sk, skb); 507 + DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize); 508 + atm_return(vcc, skb->truesize); 509 + skb_free_datagram(sk, skb); 510 + return copied; 511 511 } 512 512 513 513 ··· 675 675 int error; 676 676 677 677 if (!qos->txtp.traffic_class && !qos->rxtp.traffic_class) 678 - return -EINVAL; 678 + return -EINVAL; 679 679 if (qos->txtp.traffic_class != qos->rxtp.traffic_class && 680 680 qos->txtp.traffic_class && qos->rxtp.traffic_class && 681 681 qos->txtp.traffic_class != ATM_ANYCLASS && ··· 786 786 printk(KERN_ERR "atmsvc_init() failed with %d\n", error); 787 787 goto out_atmpvc_exit; 788 788 } 789 - if ((error = atm_proc_init()) < 0) { 789 + if ((error = atm_proc_init()) < 0) { 790 790 printk(KERN_ERR "atm_proc_init() failed with %d\n",error); 791 791 goto out_atmsvc_exit; 792 792 } 793 - if ((error = atm_sysfs_init()) < 0) { 793 + if ((error = atm_sysfs_init()) < 0) { 794 794 printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error); 795 795 goto out_atmproc_exit; 796 796 }
+1 -1
net/atm/common.h
··· 1 1 /* net/atm/common.h - ATM sockets (common part for PVC and SVC) */ 2 - 2 + 3 3 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 4 4 5 5
+1 -1
net/atm/ioctl.c
··· 76 76 } 77 77 skb = skb_peek(&sk->sk_receive_queue); 78 78 error = put_user(skb ? skb->len : 0, 79 - (int __user *)argp) ? -EFAULT : 0; 79 + (int __user *)argp) ? -EFAULT : 0; 80 80 goto done; 81 81 } 82 82 case SIOCGSTAMP: /* borrowed from IP */
+10 -10
net/atm/lec.c
··· 1 1 /* 2 - * lec.c: Lan Emulation driver 2 + * lec.c: Lan Emulation driver 3 3 * 4 4 * Marko Kiiskila <mkiiskila@yahoo.com> 5 5 */ ··· 1457 1457 static void lec_arp_check_expire(struct work_struct *work); 1458 1458 static void lec_arp_expire_arp(unsigned long data); 1459 1459 1460 - /* 1460 + /* 1461 1461 * Arp table funcs 1462 1462 */ 1463 1463 ··· 1473 1473 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { 1474 1474 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]); 1475 1475 } 1476 - INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); 1477 - INIT_HLIST_HEAD(&priv->lec_no_forward); 1478 - INIT_HLIST_HEAD(&priv->mcast_fwds); 1476 + INIT_HLIST_HEAD(&priv->lec_arp_empty_ones); 1477 + INIT_HLIST_HEAD(&priv->lec_no_forward); 1478 + INIT_HLIST_HEAD(&priv->mcast_fwds); 1479 1479 spin_lock_init(&priv->lec_arp_lock); 1480 1480 INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire); 1481 1481 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL); ··· 1770 1770 spin_unlock_irqrestore(&priv->lec_arp_lock, flags); 1771 1771 } 1772 1772 1773 - /* 1773 + /* 1774 1774 * Find entry by mac_address 1775 1775 */ 1776 1776 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, ··· 1949 1949 1950 1950 /* 1951 1951 * Try to find vcc where mac_address is attached. 1952 - * 1952 + * 1953 1953 */ 1954 1954 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv, 1955 1955 unsigned char *mac_to_find, int is_rdesc, ··· 2075 2075 } 2076 2076 2077 2077 /* 2078 - * Notifies: Response to arp_request (atm_addr != NULL) 2078 + * Notifies: Response to arp_request (atm_addr != NULL) 2079 2079 */ 2080 2080 static void 2081 2081 lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr, ··· 2176 2176 } 2177 2177 2178 2178 /* 2179 - * Notifies: Vcc setup ready 2179 + * Notifies: Vcc setup ready 2180 2180 */ 2181 2181 static void 2182 2182 lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data, ··· 2380 2380 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { 2381 2381 entry->flush_tran_id = tran_id; 2382 2382 DPRINTK("Set flush transaction id to %lx for %p\n", 2383 - tran_id, entry); 2383 + tran_id, entry); 2384 2384 } 2385 2385 } 2386 2386 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
+2 -2
net/atm/lec.h
··· 52 52 53 53 /* 54 54 * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType 55 - * frames. 55 + * frames. 56 56 * 57 57 * 1. Dix Ethernet EtherType frames encoded by placing EtherType 58 58 * field in h_type field. Data follows immediatelly after header. 59 59 * 2. LLC Data frames whose total length, including LLC field and data, 60 - * but not padding required to meet the minimum data frame length, 60 + * but not padding required to meet the minimum data frame length, 61 61 * is less than 1536(0x0600) MUST be encoded by placing that length 62 62 * in the h_type field. The LLC field follows header immediatelly. 63 63 * 3. LLC data frames longer than this maximum MUST be encoded by placing
+65 -65
net/atm/mpc.c
··· 32 32 #include "resources.h" 33 33 34 34 /* 35 - * mpc.c: Implementation of MPOA client kernel part 35 + * mpc.c: Implementation of MPOA client kernel part 36 36 */ 37 37 38 38 #if 0 ··· 80 80 0xaa, 0xaa, 0x03, 81 81 {0x00, 0x00, 0x5e}, 82 82 {0x00, 0x03} /* For MPOA control PDUs */ 83 - }; 83 + }; 84 84 static struct llc_snap_hdr llc_snap_mpoa_data = { 85 85 0xaa, 0xaa, 0x03, 86 86 {0x00, 0x00, 0x00}, 87 87 {0x08, 0x00} /* This is for IP PDUs only */ 88 - }; 88 + }; 89 89 static struct llc_snap_hdr llc_snap_mpoa_data_tagged = { 90 90 0xaa, 0xaa, 0x03, 91 91 {0x00, 0x00, 0x00}, 92 92 {0x88, 0x4c} /* This is for tagged data PDUs */ 93 - }; 93 + }; 94 94 95 95 static struct notifier_block mpoa_notifier = { 96 96 mpoa_event_listener, ··· 106 106 static struct mpoa_client *find_mpc_by_itfnum(int itf) 107 107 { 108 108 struct mpoa_client *mpc; 109 - 109 + 110 110 mpc = mpcs; /* our global linked list */ 111 111 while (mpc != NULL) { 112 112 if (mpc->dev_num == itf) 113 113 return mpc; 114 - mpc = mpc->next; 114 + mpc = mpc->next; 115 115 } 116 116 117 117 return NULL; /* not found */ ··· 120 120 static struct mpoa_client *find_mpc_by_vcc(struct atm_vcc *vcc) 121 121 { 122 122 struct mpoa_client *mpc; 123 - 123 + 124 124 mpc = mpcs; /* our global linked list */ 125 125 while (mpc != NULL) { 126 126 if (mpc->mpoad_vcc == vcc) ··· 134 134 static struct mpoa_client *find_mpc_by_lec(struct net_device *dev) 135 135 { 136 136 struct mpoa_client *mpc; 137 - 137 + 138 138 mpc = mpcs; /* our global linked list */ 139 139 while (mpc != NULL) { 140 140 if (mpc->dev == dev) ··· 190 190 } 191 191 192 192 return qos; 193 - } 193 + } 194 194 195 195 /* 196 196 * Returns 0 for failure ··· 245 245 246 246 sprintf(name, "lec%d", itf); 247 247 dev = dev_get_by_name(name); 248 - 248 + 249 249 return dev; 250 250 } 251 251 ··· 265 265 mpc->parameters.mpc_p2 = MPC_P2; 266 266 memset(mpc->parameters.mpc_p3,0,sizeof(mpc->parameters.mpc_p3)); 267 267 mpc->parameters.mpc_p4 = MPC_P4; 268 - mpc->parameters.mpc_p5 = MPC_P5; 268 + mpc->parameters.mpc_p5 = MPC_P5; 269 269 mpc->parameters.mpc_p6 = MPC_P6; 270 - 270 + 271 271 mpcs = mpc; 272 - 272 + 273 273 return mpc; 274 274 } 275 275 276 276 /* 277 277 * 278 278 * start_mpc() puts the MPC on line. All the packets destined 279 - * to the lec underneath us are now being monitored and 279 + * to the lec underneath us are now being monitored and 280 280 * shortcuts will be established. 281 281 * 282 282 */ 283 283 static void start_mpc(struct mpoa_client *mpc, struct net_device *dev) 284 284 { 285 - 286 - dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name); 285 + 286 + dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name); 287 287 if (dev->hard_start_xmit == NULL) { 288 288 printk("mpoa: (%s) start_mpc: dev->hard_start_xmit == NULL, not starting\n", 289 289 dev->name); ··· 297 297 298 298 static void stop_mpc(struct mpoa_client *mpc) 299 299 { 300 - 301 - dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name); 300 + 301 + dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name); 302 302 303 303 /* Lets not nullify lec device's dev->hard_start_xmit */ 304 304 if (mpc->dev->hard_start_xmit != mpc_send_packet) { ··· 309 309 mpc->dev->hard_start_xmit = mpc->old_hard_start_xmit; 310 310 mpc->old_hard_start_xmit = NULL; 311 311 /* close_shortcuts(mpc); ??? FIXME */ 312 - 312 + 313 313 return; 314 314 } 315 315 ··· 358 358 uint8_t length, mpoa_device_type, number_of_mps_macs; 359 359 uint8_t *end_of_tlvs; 360 360 struct mpoa_client *mpc; 361 - 361 + 362 362 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */ 363 363 dprintk("mpoa: (%s) lane2_assoc_ind: received TLV(s), ", dev->name); 364 364 dprintk("total length of all TLVs %d\n", sizeoftlvs); ··· 377 377 printk("TLV value extends past its buffer, aborting parse\n"); 378 378 return; 379 379 } 380 - 380 + 381 381 if (type == 0) { 382 382 printk("mpoa: (%s) lane2_assoc_ind: TLV type was 0, returning\n", dev->name); 383 383 return; ··· 412 412 continue; /* someone should read the spec */ 413 413 } 414 414 dprintk("this MPS has %d MAC addresses\n", number_of_mps_macs); 415 - 415 + 416 416 /* ok, now we can go and tell our daemon the control address of MPS */ 417 417 send_set_mps_ctrl_addr(tlvs, mpc); 418 - 418 + 419 419 tlvs = copy_macs(mpc, mac_addr, tlvs, number_of_mps_macs, mpoa_device_type); 420 420 if (tlvs == NULL) return; 421 421 } ··· 474 474 iph = (struct iphdr *)buff; 475 475 ipaddr = iph->daddr; 476 476 477 - ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr); 477 + ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr); 478 478 479 479 entry = mpc->in_ops->get(ipaddr, mpc); 480 480 if (entry == NULL) { ··· 483 483 return 1; 484 484 } 485 485 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN){ /* threshold not exceeded or VCC not ready */ 486 - ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name); 486 + ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name); 487 487 mpc->in_ops->put(entry); 488 488 return 1; 489 489 } 490 490 491 - ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name); 491 + ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name); 492 492 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */ 493 493 if (iph->ttl <= 1) { 494 - ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl); 494 + ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl); 495 495 mpc->in_ops->put(entry); 496 496 return 1; 497 497 } ··· 529 529 struct mpoa_client *mpc; 530 530 struct ethhdr *eth; 531 531 int i = 0; 532 - 532 + 533 533 mpc = find_mpc_by_lec(dev); /* this should NEVER fail */ 534 534 if(mpc == NULL) { 535 535 printk("mpoa: (%s) mpc_send_packet: no MPC found\n", dev->name); ··· 549 549 550 550 non_ip: 551 551 retval = mpc->old_hard_start_xmit(skb,dev); 552 - 552 + 553 553 return retval; 554 554 } 555 555 ··· 569 569 ipaddr = ioc_data.ipaddr; 570 570 if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF) 571 571 return -EINVAL; 572 - 572 + 573 573 mpc = find_mpc_by_itfnum(ioc_data.dev_num); 574 574 if (mpc == NULL) 575 575 return -EINVAL; 576 - 576 + 577 577 if (ioc_data.type == MPC_SOCKET_INGRESS) { 578 578 in_entry = mpc->in_ops->get(ipaddr, mpc); 579 579 if (in_entry == NULL || in_entry->entry_state < INGRESS_RESOLVED) { ··· 604 604 struct mpoa_client *mpc; 605 605 in_cache_entry *in_entry; 606 606 eg_cache_entry *eg_entry; 607 - 607 + 608 608 mpc = find_mpc_by_lec(dev); 609 609 if (mpc == NULL) { 610 610 printk("mpoa: (%s) mpc_vcc_close: close for unknown MPC\n", dev->name); ··· 640 640 struct mpoa_client *mpc; 641 641 __be32 tag; 642 642 char *tmp; 643 - 643 + 644 644 ddprintk("mpoa: (%s) mpc_push:\n", dev->name); 645 645 if (skb == NULL) { 646 646 dprintk("mpoa: (%s) mpc_push: null skb, closing VCC\n", dev->name); 647 647 mpc_vcc_close(vcc, dev); 648 648 return; 649 649 } 650 - 650 + 651 651 skb->dev = dev; 652 652 if (memcmp(skb->data, &llc_snap_mpoa_ctrl, sizeof(struct llc_snap_hdr)) == 0) { 653 653 struct sock *sk = sk_atm(vcc); ··· 693 693 dev_kfree_skb_any(skb); 694 694 return; 695 695 } 696 - 696 + 697 697 /* 698 698 * See if ingress MPC is using shortcut we opened as a return channel. 699 699 * This means we have a bi-directional vcc opened by us. 700 - */ 700 + */ 701 701 if (eg->shortcut == NULL) { 702 702 eg->shortcut = vcc; 703 703 printk("mpoa: (%s) mpc_push: egress SVC in use\n", dev->name); ··· 743 743 struct mpoa_client *mpc; 744 744 struct lec_priv *priv; 745 745 int err; 746 - 746 + 747 747 if (mpcs == NULL) { 748 748 init_timer(&mpc_timer); 749 749 mpc_timer_refresh(); ··· 755 755 return err; 756 756 } 757 757 } 758 - 758 + 759 759 mpc = find_mpc_by_itfnum(arg); 760 760 if (mpc == NULL) { 761 761 dprintk("mpoa: mpoad_attach: allocating new mpc for itf %d\n", arg); ··· 776 776 dev_put(mpc->dev); 777 777 mpc->dev = NULL; 778 778 } else 779 - priv->lane2_ops->associate_indicator = lane2_assoc_ind; 779 + priv->lane2_ops->associate_indicator = lane2_assoc_ind; 780 780 } 781 781 782 782 mpc->mpoad_vcc = vcc; ··· 788 788 if (mpc->dev) { 789 789 char empty[ATM_ESA_LEN]; 790 790 memset(empty, 0, ATM_ESA_LEN); 791 - 791 + 792 792 start_mpc(mpc, mpc->dev); 793 793 /* set address if mpcd e.g. gets killed and restarted. 794 794 * If we do not do it now we have to wait for the next LE_ARP ··· 806 806 struct k_message mesg; 807 807 808 808 memcpy (mpc->mps_ctrl_addr, addr, ATM_ESA_LEN); 809 - 809 + 810 810 mesg.type = SET_MPS_CTRL_ADDR; 811 811 memcpy(mesg.MPS_ctrl, addr, ATM_ESA_LEN); 812 812 msg_to_mpoad(&mesg, mpc); ··· 828 828 printk("mpoa: mpoad_close: close for non-present mpoad\n"); 829 829 return; 830 830 } 831 - 831 + 832 832 mpc->mpoad_vcc = NULL; 833 833 if (mpc->dev) { 834 834 struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv; ··· 844 844 atm_return(vcc, skb->truesize); 845 845 kfree_skb(skb); 846 846 } 847 - 847 + 848 848 printk("mpoa: (%s) going down\n", 849 849 (mpc->dev) ? mpc->dev->name : "<unknown>"); 850 850 module_put(THIS_MODULE); ··· 857 857 */ 858 858 static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb) 859 859 { 860 - 860 + 861 861 struct mpoa_client *mpc = find_mpc_by_vcc(vcc); 862 862 struct k_message *mesg = (struct k_message*)skb->data; 863 863 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); 864 - 864 + 865 865 if (mpc == NULL) { 866 866 printk("mpoa: msg_from_mpoad: no mpc found\n"); 867 867 return 0; ··· 938 938 skb_put(skb, sizeof(struct k_message)); 939 939 memcpy(skb->data, mesg, sizeof(struct k_message)); 940 940 atm_force_charge(mpc->mpoad_vcc, skb->truesize); 941 - 941 + 942 942 sk = sk_atm(mpc->mpoad_vcc); 943 943 skb_queue_tail(&sk->sk_receive_queue, skb); 944 944 sk->sk_data_ready(sk, skb->len); ··· 955 955 dev = (struct net_device *)dev_ptr; 956 956 if (dev->name == NULL || strncmp(dev->name, "lec", 3)) 957 957 return NOTIFY_DONE; /* we are only interested in lec:s */ 958 - 958 + 959 959 switch (event) { 960 960 case NETDEV_REGISTER: /* a new lec device was allocated */ 961 961 priv = (struct lec_priv *)dev->priv; ··· 1043 1043 mpc->in_ops->put(entry); 1044 1044 return; 1045 1045 } 1046 - 1046 + 1047 1047 if(entry->entry_state == INGRESS_INVALID){ 1048 1048 entry->entry_state = INGRESS_RESOLVING; 1049 1049 msg->type = SND_MPOA_RES_RQST; ··· 1053 1053 mpc->in_ops->put(entry); 1054 1054 return; 1055 1055 } 1056 - 1056 + 1057 1057 printk("mpoa: (%s) MPOA_trigger_rcvd: entry already in resolving state\n", 1058 1058 (mpc->dev) ? mpc->dev->name : "<unknown>"); 1059 1059 mpc->in_ops->put(entry); ··· 1062 1062 1063 1063 /* 1064 1064 * Things get complicated because we have to check if there's an egress 1065 - * shortcut with suitable traffic parameters we could use. 1065 + * shortcut with suitable traffic parameters we could use. 1066 1066 */ 1067 1067 static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry) 1068 1068 { ··· 1079 1079 else if(eg_entry->shortcut->qos.txtp.max_pcr > 0) 1080 1080 entry->shortcut = eg_entry->shortcut; 1081 1081 } 1082 - if(entry->shortcut){ 1082 + if(entry->shortcut){ 1083 1083 dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip)); 1084 1084 client->eg_ops->put(eg_entry); 1085 1085 return; ··· 1094 1094 { 1095 1095 msg->qos = qos->qos; 1096 1096 printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name); 1097 - } 1097 + } 1098 1098 else memset(&msg->qos,0,sizeof(struct atm_qos)); 1099 1099 msg_to_mpoad(msg, client); 1100 1100 return; ··· 1111 1111 printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name); 1112 1112 return; 1113 1113 } 1114 - ddprintk(" entry_state = %d ", entry->entry_state); 1114 + ddprintk(" entry_state = %d ", entry->entry_state); 1115 1115 1116 1116 if (entry->entry_state == INGRESS_RESOLVED) { 1117 1117 printk("\nmpoa: (%s) MPOA_res_reply_rcvd for RESOLVED entry!\n", mpc->dev->name); ··· 1126 1126 ddprintk("entry->shortcut = %p\n", entry->shortcut); 1127 1127 1128 1128 if(entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL){ 1129 - entry->entry_state = INGRESS_RESOLVED; 1129 + entry->entry_state = INGRESS_RESOLVED; 1130 1130 mpc->in_ops->put(entry); 1131 1131 return; /* Shortcut already open... */ 1132 1132 } ··· 1137 1137 mpc->in_ops->put(entry); 1138 1138 return; 1139 1139 } 1140 - 1140 + 1141 1141 check_qos_and_open_shortcut(msg, mpc, entry); 1142 1142 entry->entry_state = INGRESS_RESOLVED; 1143 1143 mpc->in_ops->put(entry); ··· 1169 1169 } while (entry != NULL); 1170 1170 1171 1171 return; 1172 - } 1172 + } 1173 1173 1174 1174 static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc) 1175 1175 { 1176 1176 __be32 cache_id = msg->content.eg_info.cache_id; 1177 1177 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc); 1178 - 1178 + 1179 1179 if (entry == NULL) { 1180 1180 dprintk("mpoa: (%s) egress_purge_rcvd: purge for a non-existing entry\n", mpc->dev->name); 1181 1181 return; ··· 1188 1188 mpc->eg_ops->put(entry); 1189 1189 1190 1190 return; 1191 - } 1191 + } 1192 1192 1193 1193 static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry) 1194 1194 { ··· 1259 1259 { 1260 1260 uint16_t holding_time; 1261 1261 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc); 1262 - 1262 + 1263 1263 holding_time = msg->content.eg_info.holding_time; 1264 1264 dprintk("mpoa: (%s) MPOA_cache_impos_rcvd: entry = %p, holding_time = %u\n", 1265 1265 mpc->dev->name, entry, holding_time); ··· 1272 1272 mpc->eg_ops->update(entry, holding_time); 1273 1273 return; 1274 1274 } 1275 - 1275 + 1276 1276 write_lock_irq(&mpc->egress_lock); 1277 1277 mpc->eg_ops->remove_entry(entry, mpc); 1278 1278 write_unlock_irq(&mpc->egress_lock); 1279 1279 1280 1280 mpc->eg_ops->put(entry); 1281 - 1281 + 1282 1282 return; 1283 1283 } 1284 1284 ··· 1328 1328 return; 1329 1329 } 1330 1330 client->number_of_mps_macs = 1; 1331 - 1331 + 1332 1332 return; 1333 1333 } 1334 1334 ··· 1364 1364 mpc_timer.data = mpc_timer.expires; 1365 1365 mpc_timer.function = mpc_cache_check; 1366 1366 add_timer(&mpc_timer); 1367 - 1367 + 1368 1368 return; 1369 1369 } 1370 1370 ··· 1373 1373 struct mpoa_client *mpc = mpcs; 1374 1374 static unsigned long previous_resolving_check_time; 1375 1375 static unsigned long previous_refresh_time; 1376 - 1376 + 1377 1377 while( mpc != NULL ){ 1378 1378 mpc->in_ops->clear_count(mpc); 1379 1379 mpc->eg_ops->clear_expired(mpc); ··· 1388 1388 mpc = mpc->next; 1389 1389 } 1390 1390 mpc_timer_refresh(); 1391 - 1391 + 1392 1392 return; 1393 1393 } 1394 1394
+19 -19
net/atm/mpc.h
··· 12 12 int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc); 13 13 14 14 struct mpoa_client { 15 - struct mpoa_client *next; 16 - struct net_device *dev; /* lec in question */ 17 - int dev_num; /* e.g. 2 for lec2 */ 18 - int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); 19 - struct atm_vcc *mpoad_vcc; /* control channel to mpoad */ 20 - uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */ 21 - uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */ 15 + struct mpoa_client *next; 16 + struct net_device *dev; /* lec in question */ 17 + int dev_num; /* e.g. 2 for lec2 */ 18 + int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev); 19 + struct atm_vcc *mpoad_vcc; /* control channel to mpoad */ 20 + uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */ 21 + uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */ 22 22 23 - rwlock_t ingress_lock; 24 - struct in_cache_ops *in_ops; /* ingress cache operations */ 25 - in_cache_entry *in_cache; /* the ingress cache of this MPC */ 23 + rwlock_t ingress_lock; 24 + struct in_cache_ops *in_ops; /* ingress cache operations */ 25 + in_cache_entry *in_cache; /* the ingress cache of this MPC */ 26 26 27 - rwlock_t egress_lock; 28 - struct eg_cache_ops *eg_ops; /* egress cache operations */ 29 - eg_cache_entry *eg_cache; /* the egress cache of this MPC */ 27 + rwlock_t egress_lock; 28 + struct eg_cache_ops *eg_ops; /* egress cache operations */ 29 + eg_cache_entry *eg_cache; /* the egress cache of this MPC */ 30 30 31 - uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */ 32 - int number_of_mps_macs; /* number of the above MAC addresses */ 33 - struct mpc_parameters parameters; /* parameters for this client */ 31 + uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */ 32 + int number_of_mps_macs; /* number of the above MAC addresses */ 33 + struct mpc_parameters parameters; /* parameters for this client */ 34 34 }; 35 35 36 36 37 37 struct atm_mpoa_qos { 38 - struct atm_mpoa_qos *next; 39 - __be32 ipaddr; 40 - struct atm_qos qos; 38 + struct atm_mpoa_qos *next; 39 + __be32 ipaddr; 40 + struct atm_qos qos; 41 41 }; 42 42 43 43
+2 -2
net/atm/mpoa_caches.c
··· 369 369 while (entry != NULL){ 370 370 if (entry->shortcut == vcc) { 371 371 atomic_inc(&entry->use); 372 - read_unlock_irqrestore(&mpc->egress_lock, flags); 372 + read_unlock_irqrestore(&mpc->egress_lock, flags); 373 373 return entry; 374 374 } 375 375 entry = entry->next; ··· 388 388 while(entry != NULL){ 389 389 if(entry->latest_ip_addr == ipaddr) { 390 390 atomic_inc(&entry->use); 391 - read_unlock_irq(&mpc->egress_lock); 391 + read_unlock_irq(&mpc->egress_lock); 392 392 return entry; 393 393 } 394 394 entry = entry->next;
+49 -49
net/atm/mpoa_caches.h
··· 12 12 void atm_mpoa_init_cache(struct mpoa_client *mpc); 13 13 14 14 typedef struct in_cache_entry { 15 - struct in_cache_entry *next; 16 - struct in_cache_entry *prev; 17 - struct timeval tv; 18 - struct timeval reply_wait; 19 - struct timeval hold_down; 20 - uint32_t packets_fwded; 21 - uint16_t entry_state; 22 - uint32_t retry_time; 23 - uint32_t refresh_time; 24 - uint32_t count; 25 - struct atm_vcc *shortcut; 26 - uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; 27 - struct in_ctrl_info ctrl_info; 28 - atomic_t use; 15 + struct in_cache_entry *next; 16 + struct in_cache_entry *prev; 17 + struct timeval tv; 18 + struct timeval reply_wait; 19 + struct timeval hold_down; 20 + uint32_t packets_fwded; 21 + uint16_t entry_state; 22 + uint32_t retry_time; 23 + uint32_t refresh_time; 24 + uint32_t count; 25 + struct atm_vcc *shortcut; 26 + uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; 27 + struct in_ctrl_info ctrl_info; 28 + atomic_t use; 29 29 } in_cache_entry; 30 30 31 31 struct in_cache_ops{ 32 - in_cache_entry *(*add_entry)(__be32 dst_ip, 33 - struct mpoa_client *client); 34 - in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client); 35 - in_cache_entry *(*get_with_mask)(__be32 dst_ip, 32 + in_cache_entry *(*add_entry)(__be32 dst_ip, 33 + struct mpoa_client *client); 34 + in_cache_entry *(*get)(__be32 dst_ip, struct mpoa_client *client); 35 + in_cache_entry *(*get_with_mask)(__be32 dst_ip, 36 36 struct mpoa_client *client, 37 37 __be32 mask); 38 - in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, 39 - struct mpoa_client *client); 40 - void (*put)(in_cache_entry *entry); 41 - void (*remove_entry)(in_cache_entry *delEntry, 38 + in_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, 39 + struct mpoa_client *client); 40 + void (*put)(in_cache_entry *entry); 41 + void (*remove_entry)(in_cache_entry *delEntry, 42 42 struct mpoa_client *client ); 43 - int (*cache_hit)(in_cache_entry *entry, 44 - struct mpoa_client *client); 45 - void (*clear_count)(struct mpoa_client *client); 46 - void (*check_resolving)(struct mpoa_client *client); 47 - void (*refresh)(struct mpoa_client *client); 48 - void (*destroy_cache)(struct mpoa_client *mpc); 43 + int (*cache_hit)(in_cache_entry *entry, 44 + struct mpoa_client *client); 45 + void (*clear_count)(struct mpoa_client *client); 46 + void (*check_resolving)(struct mpoa_client *client); 47 + void (*refresh)(struct mpoa_client *client); 48 + void (*destroy_cache)(struct mpoa_client *mpc); 49 49 }; 50 50 51 51 typedef struct eg_cache_entry{ 52 - struct eg_cache_entry *next; 53 - struct eg_cache_entry *prev; 54 - struct timeval tv; 55 - uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; 56 - struct atm_vcc *shortcut; 57 - uint32_t packets_rcvd; 58 - uint16_t entry_state; 59 - __be32 latest_ip_addr; /* The src IP address of the last packet */ 60 - struct eg_ctrl_info ctrl_info; 61 - atomic_t use; 52 + struct eg_cache_entry *next; 53 + struct eg_cache_entry *prev; 54 + struct timeval tv; 55 + uint8_t MPS_ctrl_ATM_addr[ATM_ESA_LEN]; 56 + struct atm_vcc *shortcut; 57 + uint32_t packets_rcvd; 58 + uint16_t entry_state; 59 + __be32 latest_ip_addr; /* The src IP address of the last packet */ 60 + struct eg_ctrl_info ctrl_info; 61 + atomic_t use; 62 62 } eg_cache_entry; 63 63 64 64 struct eg_cache_ops{ 65 - eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client); 66 - eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client); 67 - eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client); 68 - eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client); 69 - eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client); 70 - void (*put)(eg_cache_entry *entry); 71 - void (*remove_entry)(eg_cache_entry *entry, struct mpoa_client *client); 72 - void (*update)(eg_cache_entry *entry, uint16_t holding_time); 73 - void (*clear_expired)(struct mpoa_client *client); 74 - void (*destroy_cache)(struct mpoa_client *mpc); 65 + eg_cache_entry *(*add_entry)(struct k_message *msg, struct mpoa_client *client); 66 + eg_cache_entry *(*get_by_cache_id)(__be32 cache_id, struct mpoa_client *client); 67 + eg_cache_entry *(*get_by_tag)(__be32 cache_id, struct mpoa_client *client); 68 + eg_cache_entry *(*get_by_vcc)(struct atm_vcc *vcc, struct mpoa_client *client); 69 + eg_cache_entry *(*get_by_src_ip)(__be32 ipaddr, struct mpoa_client *client); 70 + void (*put)(eg_cache_entry *entry); 71 + void (*remove_entry)(eg_cache_entry *entry, struct mpoa_client *client); 72 + void (*update)(eg_cache_entry *entry, uint16_t holding_time); 73 + void (*clear_expired)(struct mpoa_client *client); 74 + void (*destroy_cache)(struct mpoa_client *mpc); 75 75 }; 76 76 77 77 ··· 85 85 /* VCC states */ 86 86 87 87 #define OPEN 1 88 - #define CLOSED 0 88 + #define CLOSED 0 89 89 90 90 /* Egress cache entry states */ 91 91
+44 -44
net/atm/mpoa_proc.c
··· 2 2 #ifdef CONFIG_PROC_FS 3 3 #include <linux/errno.h> 4 4 #include <linux/kernel.h> 5 - #include <linux/string.h> 5 + #include <linux/string.h> 6 6 #include <linux/mm.h> 7 7 #include <linux/module.h> 8 8 #include <linux/proc_fs.h> ··· 16 16 17 17 /* 18 18 * mpoa_proc.c: Implementation MPOA client's proc 19 - * file system statistics 19 + * file system statistics 20 20 */ 21 21 22 22 #if 1 ··· 32 32 33 33 static int proc_mpc_open(struct inode *inode, struct file *file); 34 34 static ssize_t proc_mpc_write(struct file *file, const char __user *buff, 35 - size_t nbytes, loff_t *ppos); 35 + size_t nbytes, loff_t *ppos); 36 36 37 37 static int parse_qos(const char *buff); 38 38 ··· 52 52 * Returns the state of an ingress cache entry as a string 53 53 */ 54 54 static const char *ingress_state_string(int state){ 55 - switch(state) { 55 + switch(state) { 56 56 case INGRESS_RESOLVING: 57 - return "resolving "; 57 + return "resolving "; 58 58 break; 59 59 case INGRESS_RESOLVED: 60 - return "resolved "; 60 + return "resolved "; 61 61 break; 62 62 case INGRESS_INVALID: 63 - return "invalid "; 63 + return "invalid "; 64 64 break; 65 65 case INGRESS_REFRESHING: 66 - return "refreshing "; 66 + return "refreshing "; 67 67 break; 68 68 default: 69 69 return ""; ··· 74 74 * Returns the state of an egress cache entry as a string 75 75 */ 76 76 static const char *egress_state_string(int state){ 77 - switch(state) { 77 + switch(state) { 78 78 case EGRESS_RESOLVED: 79 - return "resolved "; 79 + return "resolved "; 80 80 break; 81 81 case EGRESS_PURGE: 82 - return "purge "; 82 + return "purge "; 83 83 break; 84 84 case EGRESS_INVALID: 85 - return "invalid "; 85 + return "invalid "; 86 86 break; 87 87 default: 88 88 return ""; ··· 135 135 return 0; 136 136 } 137 137 138 - seq_printf(m, "\nInterface %d:\n\n", mpc->dev_num); 138 + seq_printf(m, "\nInterface %d:\n\n", mpc->dev_num); 139 139 seq_printf(m, "Ingress Entries:\nIP address State Holding time Packets fwded VPI VCI\n"); 140 140 do_gettimeofday(&now); 141 141 ··· 163 163 egress_state_string(eg_entry->entry_state), 164 164 (eg_entry->ctrl_info.holding_time-(now.tv_sec-eg_entry->tv.tv_sec)), 165 165 eg_entry->packets_rcvd); 166 - 166 + 167 167 /* latest IP address */ 168 168 temp = (unsigned char *)&eg_entry->latest_ip_addr; 169 169 sprintf(ip_string, "%d.%d.%d.%d", temp[0], temp[1], temp[2], temp[3]); ··· 190 190 } 191 191 192 192 static ssize_t proc_mpc_write(struct file *file, const char __user *buff, 193 - size_t nbytes, loff_t *ppos) 193 + size_t nbytes, loff_t *ppos) 194 194 { 195 - char *page, *p; 195 + char *page, *p; 196 196 unsigned len; 197 197 198 - if (nbytes == 0) 198 + if (nbytes == 0) 199 199 return 0; 200 200 201 - if (nbytes >= PAGE_SIZE) 201 + if (nbytes >= PAGE_SIZE) 202 202 nbytes = PAGE_SIZE-1; 203 203 204 - page = (char *)__get_free_page(GFP_KERNEL); 205 - if (!page) 204 + page = (char *)__get_free_page(GFP_KERNEL); 205 + if (!page) 206 206 return -ENOMEM; 207 207 208 - for (p = page, len = 0; len < nbytes; p++, len++) { 209 - if (get_user(*p, buff++)) { 208 + for (p = page, len = 0; len < nbytes; p++, len++) { 209 + if (get_user(*p, buff++)) { 210 210 free_page((unsigned long)page); 211 211 return -EFAULT; 212 212 } 213 - if (*p == '\0' || *p == '\n') 214 - break; 215 - } 213 + if (*p == '\0' || *p == '\n') 214 + break; 215 + } 216 216 217 - *p = '\0'; 217 + *p = '\0'; 218 218 219 219 if (!parse_qos(page)) 220 - printk("mpoa: proc_mpc_write: could not parse '%s'\n", page); 220 + printk("mpoa: proc_mpc_write: could not parse '%s'\n", page); 221 221 222 - free_page((unsigned long)page); 223 - 224 - return len; 222 + free_page((unsigned long)page); 223 + 224 + return len; 225 225 } 226 226 227 227 static int parse_qos(const char *buff) 228 228 { 229 - /* possible lines look like this 230 - * add 130.230.54.142 tx=max_pcr,max_sdu rx=max_pcr,max_sdu 231 - */ 232 - unsigned char ip[4]; 229 + /* possible lines look like this 230 + * add 130.230.54.142 tx=max_pcr,max_sdu rx=max_pcr,max_sdu 231 + */ 232 + unsigned char ip[4]; 233 233 int tx_pcr, tx_sdu, rx_pcr, rx_sdu; 234 - __be32 ipaddr; 235 - struct atm_qos qos; 236 - 237 - memset(&qos, 0, sizeof(struct atm_qos)); 234 + __be32 ipaddr; 235 + struct atm_qos qos; 236 + 237 + memset(&qos, 0, sizeof(struct atm_qos)); 238 238 239 239 if (sscanf(buff, "del %hhu.%hhu.%hhu.%hhu", 240 240 ip, ip+1, ip+2, ip+3) == 4) { ··· 250 250 ip, ip+1, ip+2, ip+3, &tx_pcr, &tx_sdu, &rx_pcr, &rx_sdu) != 8) 251 251 return 0; 252 252 253 - ipaddr = *(__be32 *)ip; 253 + ipaddr = *(__be32 *)ip; 254 254 qos.txtp.traffic_class = ATM_CBR; 255 255 qos.txtp.max_pcr = tx_pcr; 256 256 qos.txtp.max_sdu = tx_sdu; 257 257 qos.rxtp.traffic_class = ATM_CBR; 258 258 qos.rxtp.max_pcr = rx_pcr; 259 259 qos.rxtp.max_sdu = rx_sdu; 260 - qos.aal = ATM_AAL5; 260 + qos.aal = ATM_AAL5; 261 261 dprintk("mpoa: mpoa_proc.c: parse_qos(): setting qos paramameters to tx=%d,%d rx=%d,%d\n", 262 262 qos.txtp.max_pcr, 263 263 qos.txtp.max_sdu, ··· 276 276 { 277 277 struct proc_dir_entry *p; 278 278 279 - p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root); 279 + p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root); 280 280 if (!p) { 281 - printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); 282 - return -ENOMEM; 283 - } 281 + printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME); 282 + return -ENOMEM; 283 + } 284 284 p->proc_fops = &mpc_file_operations; 285 285 p->owner = THIS_MODULE; 286 286 return 0;
+29 -29
net/atm/proc.c
··· 86 86 break; 87 87 } 88 88 l--; 89 - } 89 + } 90 90 try_again: 91 91 for (; sk; sk = sk_next(sk)) { 92 92 l -= compare_family(sk, family); ··· 205 205 seq_printf(seq, "%p ", vcc); 206 206 if (!vcc->dev) 207 207 seq_printf(seq, "Unassigned "); 208 - else 208 + else 209 209 seq_printf(seq, "%3d %3d %5d ", vcc->dev->number, vcc->vpi, 210 210 vcc->vci); 211 211 switch (sk->sk_family) { ··· 249 249 static char atm_dev_banner[] = 250 250 "Itf Type ESI/\"MAC\"addr " 251 251 "AAL(TX,err,RX,err,drop) ... [refcnt]\n"; 252 - 252 + 253 253 if (v == (void *)1) 254 254 seq_puts(seq, atm_dev_banner); 255 255 else { ··· 257 257 258 258 atm_dev_info(seq, dev); 259 259 } 260 - return 0; 260 + return 0; 261 261 } 262 - 262 + 263 263 static struct seq_operations atm_dev_seq_ops = { 264 264 .start = atm_dev_seq_start, 265 265 .next = atm_dev_seq_next, 266 266 .stop = atm_dev_seq_stop, 267 267 .show = atm_dev_seq_show, 268 268 }; 269 - 269 + 270 270 static int atm_dev_seq_open(struct inode *inode, struct file *file) 271 271 { 272 272 return seq_open(file, &atm_dev_seq_ops); 273 273 } 274 - 274 + 275 275 static struct file_operations devices_seq_fops = { 276 276 .open = atm_dev_seq_open, 277 277 .read = seq_read, ··· 281 281 282 282 static int pvc_seq_show(struct seq_file *seq, void *v) 283 283 { 284 - static char atm_pvc_banner[] = 284 + static char atm_pvc_banner[] = 285 285 "Itf VPI VCI AAL RX(PCR,Class) TX(PCR,Class)\n"; 286 286 287 287 if (v == (void *)1) ··· 316 316 317 317 static int vcc_seq_show(struct seq_file *seq, void *v) 318 318 { 319 - if (v == (void *)1) { 320 - seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", 321 - "Address ", "Itf VPI VCI Fam Flags Reply " 322 - "Send buffer Recv buffer [refcnt]\n"); 323 - } else { 324 - struct vcc_state *state = seq->private; 325 - struct atm_vcc *vcc = atm_sk(state->sk); 326 - 327 - vcc_info(seq, vcc); 328 - } 329 - return 0; 319 + if (v == (void *)1) { 320 + seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", 321 + "Address ", "Itf VPI VCI Fam Flags Reply " 322 + "Send buffer Recv buffer [refcnt]\n"); 323 + } else { 324 + struct vcc_state *state = seq->private; 325 + struct atm_vcc *vcc = atm_sk(state->sk); 326 + 327 + vcc_info(seq, vcc); 328 + } 329 + return 0; 330 330 } 331 - 331 + 332 332 static struct seq_operations vcc_seq_ops = { 333 - .start = vcc_seq_start, 334 - .next = vcc_seq_next, 335 - .stop = vcc_seq_stop, 336 - .show = vcc_seq_show, 333 + .start = vcc_seq_start, 334 + .next = vcc_seq_next, 335 + .stop = vcc_seq_stop, 336 + .show = vcc_seq_show, 337 337 }; 338 - 338 + 339 339 static int vcc_seq_open(struct inode *inode, struct file *file) 340 340 { 341 - return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); 341 + return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); 342 342 } 343 - 343 + 344 344 static struct file_operations vcc_seq_fops = { 345 345 .open = vcc_seq_open, 346 346 .read = seq_read, ··· 350 350 351 351 static int svc_seq_show(struct seq_file *seq, void *v) 352 352 { 353 - static char atm_svc_banner[] = 353 + static char atm_svc_banner[] = 354 354 "Itf VPI VCI State Remote\n"; 355 355 356 356 if (v == (void *)1) ··· 472 472 static struct atm_proc_entry *e; 473 473 474 474 for (e = atm_proc_ents; e->name; e++) { 475 - if (e->dirent) 475 + if (e->dirent) 476 476 remove_proc_entry(e->name, atm_proc_root); 477 477 } 478 478 remove_proc_entry("net/atm", NULL);
+2 -2
net/atm/pvc.c
··· 72 72 73 73 74 74 static int pvc_getsockopt(struct socket *sock, int level, int optname, 75 - char __user *optval, int __user *optlen) 75 + char __user *optval, int __user *optlen) 76 76 { 77 77 struct sock *sk = sock->sk; 78 78 int error; ··· 91 91 struct atm_vcc *vcc = ATM_SD(sock); 92 92 93 93 if (!vcc->dev || !test_bit(ATM_VF_ADDR,&vcc->flags)) return -ENOTCONN; 94 - *sockaddr_len = sizeof(struct sockaddr_atmpvc); 94 + *sockaddr_len = sizeof(struct sockaddr_atmpvc); 95 95 addr = (struct sockaddr_atmpvc *) sockaddr; 96 96 addr->sap_family = AF_ATMPVC; 97 97 addr->sap_addr.itf = vcc->dev->number;
+3 -3
net/atm/raw.c
··· 56 56 * still work 57 57 */ 58 58 if (!capable(CAP_NET_ADMIN) && 59 - (((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) != 60 - ((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT))) 59 + (((u32 *) skb->data)[0] & (ATM_HDR_VPI_MASK | ATM_HDR_VCI_MASK)) != 60 + ((vcc->vpi << ATM_HDR_VPI_SHIFT) | (vcc->vci << ATM_HDR_VCI_SHIFT))) 61 61 { 62 62 kfree_skb(skb); 63 63 return -EADDRNOTAVAIL; 64 - } 64 + } 65 65 return vcc->dev->ops->send(vcc,skb); 66 66 } 67 67
+8 -8
net/atm/resources.c
··· 142 142 set_bit(ATM_DF_REMOVED, &dev->flags); 143 143 144 144 /* 145 - * if we remove current device from atm_devs list, new device 146 - * with same number can appear, such we need deregister proc, 145 + * if we remove current device from atm_devs list, new device 146 + * with same number can appear, such we need deregister proc, 147 147 * release async all vccs and remove them from vccs list too 148 148 */ 149 149 mutex_lock(&atm_dev_mutex); ··· 228 228 *tmp_p++ = dev->number; 229 229 } 230 230 mutex_unlock(&atm_dev_mutex); 231 - error = ((copy_to_user(buf, tmp_buf, size)) || 231 + error = ((copy_to_user(buf, tmp_buf, size)) || 232 232 put_user(size, &iobuf->length)) 233 233 ? -EFAULT : 0; 234 234 kfree(tmp_buf); ··· 247 247 if (!(dev = try_then_request_module(atm_dev_lookup(number), 248 248 "atm-device-%d", number))) 249 249 return -ENODEV; 250 - 250 + 251 251 switch (cmd) { 252 252 case ATM_GETTYPE: 253 253 size = strlen(dev->type) + 1; ··· 390 390 goto done; 391 391 } 392 392 } 393 - 393 + 394 394 if (size) 395 395 error = put_user(size, &sioc->length) 396 396 ? -EFAULT : 0; ··· 414 414 415 415 void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) 416 416 { 417 - mutex_lock(&atm_dev_mutex); 417 + mutex_lock(&atm_dev_mutex); 418 418 return *pos ? dev_get_idx(*pos) : (void *) 1; 419 419 } 420 420 421 421 void atm_dev_seq_stop(struct seq_file *seq, void *v) 422 422 { 423 - mutex_unlock(&atm_dev_mutex); 423 + mutex_unlock(&atm_dev_mutex); 424 424 } 425 - 425 + 426 426 void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) 427 427 { 428 428 ++*pos;
+2 -2
net/atm/signaling.h
··· 1 1 /* net/atm/signaling.h - ATM signaling */ 2 - 2 + 3 3 /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ 4 - 4 + 5 5 6 6 #ifndef NET_ATM_SIGNALING_H 7 7 #define NET_ATM_SIGNALING_H
+24 -24
net/atm/svc.c
··· 89 89 clear_bit(ATM_VF_READY, &vcc->flags); 90 90 /* VCC pointer is used as a reference, so we must not free it 91 91 (thereby subjecting it to re-use) before all pending connections 92 - are closed */ 92 + are closed */ 93 93 svc_disconnect(vcc); 94 94 vcc_release(sock); 95 95 } ··· 144 144 error = -EUNATCH; 145 145 goto out; 146 146 } 147 - if (!sk->sk_err) 147 + if (!sk->sk_err) 148 148 set_bit(ATM_VF_BOUND,&vcc->flags); 149 149 error = -sk->sk_err; 150 150 out: ··· 229 229 * This is tricky: 230 230 * Kernel ---close--> Demon 231 231 * Kernel <--close--- Demon 232 - * or 232 + * or 233 233 * Kernel ---close--> Demon 234 234 * Kernel <--error--- Demon 235 235 * or ··· 470 470 } 471 471 set_bit(ATM_VF_HASSAP, &vcc->flags); 472 472 break; 473 - case SO_MULTIPOINT: 473 + case SO_MULTIPOINT: 474 474 if (level != SOL_ATM || optlen != sizeof(int)) { 475 475 error = -EINVAL; 476 476 goto out; 477 477 } 478 - if (get_user(value, (int __user *) optval)) { 479 - error = -EFAULT; 478 + if (get_user(value, (int __user *) optval)) { 479 + error = -EFAULT; 480 480 goto out; 481 481 } 482 482 if (value == 1) { ··· 486 486 } else { 487 487 error = -EINVAL; 488 488 } 489 - break; 489 + break; 490 490 default: 491 491 error = vcc_setsockopt(sock, level, optname, 492 492 optval, optlen); ··· 539 539 set_bit(ATM_VF_WAITING, &vcc->flags); 540 540 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); 541 541 sigd_enq(vcc, as_addparty, NULL, NULL, 542 - (struct sockaddr_atmsvc *) sockaddr); 542 + (struct sockaddr_atmsvc *) sockaddr); 543 543 if (flags & O_NONBLOCK) { 544 544 finish_wait(sk->sk_sleep, &wait); 545 545 error = -EINPROGRESS; ··· 587 587 588 588 static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) 589 589 { 590 - int error, ep_ref; 591 - struct sockaddr_atmsvc sa; 590 + int error, ep_ref; 591 + struct sockaddr_atmsvc sa; 592 592 struct atm_vcc *vcc = ATM_SD(sock); 593 - 593 + 594 594 switch (cmd) { 595 - case ATM_ADDPARTY: 596 - if (!test_bit(ATM_VF_SESSION, &vcc->flags)) 597 - return -EINVAL; 598 - if (copy_from_user(&sa, (void __user *) arg, sizeof(sa))) 595 + case ATM_ADDPARTY: 596 + if (!test_bit(ATM_VF_SESSION, &vcc->flags)) 597 + return -EINVAL; 598 + if (copy_from_user(&sa, (void __user *) arg, sizeof(sa))) 599 599 return -EFAULT; 600 - error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0); 601 - break; 602 - case ATM_DROPPARTY: 603 - if (!test_bit(ATM_VF_SESSION, &vcc->flags)) 604 - return -EINVAL; 605 - if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int))) 600 + error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0); 601 + break; 602 + case ATM_DROPPARTY: 603 + if (!test_bit(ATM_VF_SESSION, &vcc->flags)) 604 + return -EINVAL; 605 + if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int))) 606 606 return -EFAULT; 607 - error = svc_dropparty(sock, ep_ref); 608 - break; 609 - default: 607 + error = svc_dropparty(sock, ep_ref); 608 + break; 609 + default: 610 610 error = vcc_ioctl(sock, cmd, arg); 611 611 } 612 612