···182182 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;183183 DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);184184 if (!atm_may_send(atmvcc, skb->truesize)) {185185- /* we free this here for now, because we cannot know in a higher 185185+ /* we free this here for now, because we cannot know in a higher186186 layer whether the skb point it supplied wasn't freed yet.187187 now, it always is.188188 */···718718719719 ++*pos;720720721721- brd = list_entry(brd->br2684_devs.next, 721721+ brd = list_entry(brd->br2684_devs.next,722722 struct br2684_dev, br2684_devs);723723 return (&brd->br2684_devs != &br2684_devs) ? brd : NULL;724724}
···11/*22- * lec.c: Lan Emulation driver 22+ * lec.c: Lan Emulation driver33 *44 * Marko Kiiskila <mkiiskila@yahoo.com>55 */···14571457static void lec_arp_check_expire(struct work_struct *work);14581458static void lec_arp_expire_arp(unsigned long data);1459145914601460-/* 14601460+/*14611461 * Arp table funcs14621462 */14631463···14731473 for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {14741474 INIT_HLIST_HEAD(&priv->lec_arp_tables[i]);14751475 }14761476- INIT_HLIST_HEAD(&priv->lec_arp_empty_ones);14771477- INIT_HLIST_HEAD(&priv->lec_no_forward);14781478- INIT_HLIST_HEAD(&priv->mcast_fwds);14761476+ INIT_HLIST_HEAD(&priv->lec_arp_empty_ones);14771477+ INIT_HLIST_HEAD(&priv->lec_no_forward);14781478+ INIT_HLIST_HEAD(&priv->mcast_fwds);14791479 spin_lock_init(&priv->lec_arp_lock);14801480 INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire);14811481 schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL);···17701770 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);17711771}1772177217731773-/* 17731773+/*17741774 * Find entry by mac_address17751775 */17761776static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,···1949194919501950/*19511951 * Try to find vcc where mac_address is attached.19521952- * 19521952+ *19531953 */19541954static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,19551955 unsigned char *mac_to_find, int is_rdesc,···20752075}2076207620772077/*20782078- * Notifies: Response to arp_request (atm_addr != NULL) 20782078+ * Notifies: Response to arp_request (atm_addr != NULL)20792079 */20802080static void20812081lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,···21762176}2177217721782178/*21792179- * Notifies: Vcc setup ready 21792179+ * Notifies: Vcc setup ready21802180 */21812181static void21822182lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,···23802380 if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) {23812381 entry->flush_tran_id = tran_id;23822382 DPRINTK("Set flush transaction id to %lx for %p\n",23832383- tran_id, entry);23832383+ tran_id, entry);23842384 }23852385 }23862386 spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
+2-2
net/atm/lec.h
···52525353/*5454 * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType5555- * frames. 5555+ * frames.5656 *5757 * 1. Dix Ethernet EtherType frames encoded by placing EtherType5858 * field in h_type field. Data follows immediatelly after header.5959 * 2. LLC Data frames whose total length, including LLC field and data,6060- * but not padding required to meet the minimum data frame length, 6060+ * but not padding required to meet the minimum data frame length,6161 * is less than 1536(0x0600) MUST be encoded by placing that length6262 * in the h_type field. The LLC field follows header immediatelly.6363 * 3. LLC data frames longer than this maximum MUST be encoded by placing
+65-65
net/atm/mpc.c
···3232#include "resources.h"33333434/*3535- * mpc.c: Implementation of MPOA client kernel part 3535+ * mpc.c: Implementation of MPOA client kernel part3636 */37373838#if 0···8080 0xaa, 0xaa, 0x03,8181 {0x00, 0x00, 0x5e},8282 {0x00, 0x03} /* For MPOA control PDUs */8383-}; 8383+};8484static struct llc_snap_hdr llc_snap_mpoa_data = {8585 0xaa, 0xaa, 0x03,8686 {0x00, 0x00, 0x00},8787 {0x08, 0x00} /* This is for IP PDUs only */8888-}; 8888+};8989static struct llc_snap_hdr llc_snap_mpoa_data_tagged = {9090 0xaa, 0xaa, 0x03,9191 {0x00, 0x00, 0x00},9292 {0x88, 0x4c} /* This is for tagged data PDUs */9393-}; 9393+};94949595static struct notifier_block mpoa_notifier = {9696 mpoa_event_listener,···106106static struct mpoa_client *find_mpc_by_itfnum(int itf)107107{108108 struct mpoa_client *mpc;109109-109109+110110 mpc = mpcs; /* our global linked list */111111 while (mpc != NULL) {112112 if (mpc->dev_num == itf)113113 return mpc;114114- mpc = mpc->next; 114114+ mpc = mpc->next;115115 }116116117117 return NULL; /* not found */···120120static struct mpoa_client *find_mpc_by_vcc(struct atm_vcc *vcc)121121{122122 struct mpoa_client *mpc;123123-123123+124124 mpc = mpcs; /* our global linked list */125125 while (mpc != NULL) {126126 if (mpc->mpoad_vcc == vcc)···134134static struct mpoa_client *find_mpc_by_lec(struct net_device *dev)135135{136136 struct mpoa_client *mpc;137137-137137+138138 mpc = mpcs; /* our global linked list */139139 while (mpc != NULL) {140140 if (mpc->dev == dev)···190190 }191191192192 return qos;193193-} 193193+}194194195195/*196196 * Returns 0 for failure···245245246246 sprintf(name, "lec%d", itf);247247 dev = dev_get_by_name(name);248248-248248+249249 return dev;250250}251251···265265 mpc->parameters.mpc_p2 = MPC_P2;266266 memset(mpc->parameters.mpc_p3,0,sizeof(mpc->parameters.mpc_p3));267267 mpc->parameters.mpc_p4 = MPC_P4;268268- mpc->parameters.mpc_p5 = MPC_P5; 268268+ mpc->parameters.mpc_p5 = MPC_P5;269269 mpc->parameters.mpc_p6 = MPC_P6;270270-270270+271271 mpcs = mpc;272272-272272+273273 return mpc;274274}275275276276/*277277 *278278 * start_mpc() puts the MPC on line. All the packets destined279279- * to the lec underneath us are now being monitored and 279279+ * to the lec underneath us are now being monitored and280280 * shortcuts will be established.281281 *282282 */283283static void start_mpc(struct mpoa_client *mpc, struct net_device *dev)284284{285285-286286- dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name); 285285+286286+ dprintk("mpoa: (%s) start_mpc:\n", mpc->dev->name);287287 if (dev->hard_start_xmit == NULL) {288288 printk("mpoa: (%s) start_mpc: dev->hard_start_xmit == NULL, not starting\n",289289 dev->name);···297297298298static void stop_mpc(struct mpoa_client *mpc)299299{300300-301301- dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name); 300300+301301+ dprintk("mpoa: (%s) stop_mpc:", mpc->dev->name);302302303303 /* Lets not nullify lec device's dev->hard_start_xmit */304304 if (mpc->dev->hard_start_xmit != mpc_send_packet) {···309309 mpc->dev->hard_start_xmit = mpc->old_hard_start_xmit;310310 mpc->old_hard_start_xmit = NULL;311311 /* close_shortcuts(mpc); ??? FIXME */312312-312312+313313 return;314314}315315···358358 uint8_t length, mpoa_device_type, number_of_mps_macs;359359 uint8_t *end_of_tlvs;360360 struct mpoa_client *mpc;361361-361361+362362 mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */363363 dprintk("mpoa: (%s) lane2_assoc_ind: received TLV(s), ", dev->name);364364 dprintk("total length of all TLVs %d\n", sizeoftlvs);···377377 printk("TLV value extends past its buffer, aborting parse\n");378378 return;379379 }380380-380380+381381 if (type == 0) {382382 printk("mpoa: (%s) lane2_assoc_ind: TLV type was 0, returning\n", dev->name);383383 return;···412412 continue; /* someone should read the spec */413413 }414414 dprintk("this MPS has %d MAC addresses\n", number_of_mps_macs);415415-415415+416416 /* ok, now we can go and tell our daemon the control address of MPS */417417 send_set_mps_ctrl_addr(tlvs, mpc);418418-418418+419419 tlvs = copy_macs(mpc, mac_addr, tlvs, number_of_mps_macs, mpoa_device_type);420420 if (tlvs == NULL) return;421421 }···474474 iph = (struct iphdr *)buff;475475 ipaddr = iph->daddr;476476477477- ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr); 477477+ ddprintk("mpoa: (%s) send_via_shortcut: ipaddr 0x%x\n", mpc->dev->name, ipaddr);478478479479 entry = mpc->in_ops->get(ipaddr, mpc);480480 if (entry == NULL) {···483483 return 1;484484 }485485 if (mpc->in_ops->cache_hit(entry, mpc) != OPEN){ /* threshold not exceeded or VCC not ready */486486- ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name); 486486+ ddprintk("mpoa: (%s) send_via_shortcut: cache_hit: returns != OPEN\n", mpc->dev->name);487487 mpc->in_ops->put(entry);488488 return 1;489489 }490490491491- ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name); 491491+ ddprintk("mpoa: (%s) send_via_shortcut: using shortcut\n", mpc->dev->name);492492 /* MPOA spec A.1.4, MPOA client must decrement IP ttl at least by one */493493 if (iph->ttl <= 1) {494494- ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl); 494494+ ddprintk("mpoa: (%s) send_via_shortcut: IP ttl = %u, using LANE\n", mpc->dev->name, iph->ttl);495495 mpc->in_ops->put(entry);496496 return 1;497497 }···529529 struct mpoa_client *mpc;530530 struct ethhdr *eth;531531 int i = 0;532532-532532+533533 mpc = find_mpc_by_lec(dev); /* this should NEVER fail */534534 if(mpc == NULL) {535535 printk("mpoa: (%s) mpc_send_packet: no MPC found\n", dev->name);···549549550550 non_ip:551551 retval = mpc->old_hard_start_xmit(skb,dev);552552-552552+553553 return retval;554554}555555···569569 ipaddr = ioc_data.ipaddr;570570 if (ioc_data.dev_num < 0 || ioc_data.dev_num >= MAX_LEC_ITF)571571 return -EINVAL;572572-572572+573573 mpc = find_mpc_by_itfnum(ioc_data.dev_num);574574 if (mpc == NULL)575575 return -EINVAL;576576-576576+577577 if (ioc_data.type == MPC_SOCKET_INGRESS) {578578 in_entry = mpc->in_ops->get(ipaddr, mpc);579579 if (in_entry == NULL || in_entry->entry_state < INGRESS_RESOLVED) {···604604 struct mpoa_client *mpc;605605 in_cache_entry *in_entry;606606 eg_cache_entry *eg_entry;607607-607607+608608 mpc = find_mpc_by_lec(dev);609609 if (mpc == NULL) {610610 printk("mpoa: (%s) mpc_vcc_close: close for unknown MPC\n", dev->name);···640640 struct mpoa_client *mpc;641641 __be32 tag;642642 char *tmp;643643-643643+644644 ddprintk("mpoa: (%s) mpc_push:\n", dev->name);645645 if (skb == NULL) {646646 dprintk("mpoa: (%s) mpc_push: null skb, closing VCC\n", dev->name);647647 mpc_vcc_close(vcc, dev);648648 return;649649 }650650-650650+651651 skb->dev = dev;652652 if (memcmp(skb->data, &llc_snap_mpoa_ctrl, sizeof(struct llc_snap_hdr)) == 0) {653653 struct sock *sk = sk_atm(vcc);···693693 dev_kfree_skb_any(skb);694694 return;695695 }696696-696696+697697 /*698698 * See if ingress MPC is using shortcut we opened as a return channel.699699 * This means we have a bi-directional vcc opened by us.700700- */ 700700+ */701701 if (eg->shortcut == NULL) {702702 eg->shortcut = vcc;703703 printk("mpoa: (%s) mpc_push: egress SVC in use\n", dev->name);···743743 struct mpoa_client *mpc;744744 struct lec_priv *priv;745745 int err;746746-746746+747747 if (mpcs == NULL) {748748 init_timer(&mpc_timer);749749 mpc_timer_refresh();···755755 return err;756756 }757757 }758758-758758+759759 mpc = find_mpc_by_itfnum(arg);760760 if (mpc == NULL) {761761 dprintk("mpoa: mpoad_attach: allocating new mpc for itf %d\n", arg);···776776 dev_put(mpc->dev);777777 mpc->dev = NULL;778778 } else779779- priv->lane2_ops->associate_indicator = lane2_assoc_ind; 779779+ priv->lane2_ops->associate_indicator = lane2_assoc_ind;780780 }781781782782 mpc->mpoad_vcc = vcc;···788788 if (mpc->dev) {789789 char empty[ATM_ESA_LEN];790790 memset(empty, 0, ATM_ESA_LEN);791791-791791+792792 start_mpc(mpc, mpc->dev);793793 /* set address if mpcd e.g. gets killed and restarted.794794 * If we do not do it now we have to wait for the next LE_ARP···806806 struct k_message mesg;807807808808 memcpy (mpc->mps_ctrl_addr, addr, ATM_ESA_LEN);809809-809809+810810 mesg.type = SET_MPS_CTRL_ADDR;811811 memcpy(mesg.MPS_ctrl, addr, ATM_ESA_LEN);812812 msg_to_mpoad(&mesg, mpc);···828828 printk("mpoa: mpoad_close: close for non-present mpoad\n");829829 return;830830 }831831-831831+832832 mpc->mpoad_vcc = NULL;833833 if (mpc->dev) {834834 struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv;···844844 atm_return(vcc, skb->truesize);845845 kfree_skb(skb);846846 }847847-847847+848848 printk("mpoa: (%s) going down\n",849849 (mpc->dev) ? mpc->dev->name : "<unknown>");850850 module_put(THIS_MODULE);···857857 */858858static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb)859859{860860-860860+861861 struct mpoa_client *mpc = find_mpc_by_vcc(vcc);862862 struct k_message *mesg = (struct k_message*)skb->data;863863 atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);864864-864864+865865 if (mpc == NULL) {866866 printk("mpoa: msg_from_mpoad: no mpc found\n");867867 return 0;···938938 skb_put(skb, sizeof(struct k_message));939939 memcpy(skb->data, mesg, sizeof(struct k_message));940940 atm_force_charge(mpc->mpoad_vcc, skb->truesize);941941-941941+942942 sk = sk_atm(mpc->mpoad_vcc);943943 skb_queue_tail(&sk->sk_receive_queue, skb);944944 sk->sk_data_ready(sk, skb->len);···955955 dev = (struct net_device *)dev_ptr;956956 if (dev->name == NULL || strncmp(dev->name, "lec", 3))957957 return NOTIFY_DONE; /* we are only interested in lec:s */958958-958958+959959 switch (event) {960960 case NETDEV_REGISTER: /* a new lec device was allocated */961961 priv = (struct lec_priv *)dev->priv;···10431043 mpc->in_ops->put(entry);10441044 return;10451045 }10461046-10461046+10471047 if(entry->entry_state == INGRESS_INVALID){10481048 entry->entry_state = INGRESS_RESOLVING;10491049 msg->type = SND_MPOA_RES_RQST;···10531053 mpc->in_ops->put(entry);10541054 return;10551055 }10561056-10561056+10571057 printk("mpoa: (%s) MPOA_trigger_rcvd: entry already in resolving state\n",10581058 (mpc->dev) ? mpc->dev->name : "<unknown>");10591059 mpc->in_ops->put(entry);···1062106210631063/*10641064 * Things get complicated because we have to check if there's an egress10651065- * shortcut with suitable traffic parameters we could use. 10651065+ * shortcut with suitable traffic parameters we could use.10661066 */10671067static void check_qos_and_open_shortcut(struct k_message *msg, struct mpoa_client *client, in_cache_entry *entry)10681068{···10791079 else if(eg_entry->shortcut->qos.txtp.max_pcr > 0)10801080 entry->shortcut = eg_entry->shortcut;10811081 }10821082- if(entry->shortcut){10821082+ if(entry->shortcut){10831083 dprintk("mpoa: (%s) using egress SVC to reach %u.%u.%u.%u\n",client->dev->name, NIPQUAD(dst_ip));10841084 client->eg_ops->put(eg_entry);10851085 return;···10941094 {10951095 msg->qos = qos->qos;10961096 printk("mpoa: (%s) trying to get a CBR shortcut\n",client->dev->name);10971097- }10971097+ }10981098 else memset(&msg->qos,0,sizeof(struct atm_qos));10991099 msg_to_mpoad(msg, client);11001100 return;···11111111 printk("\nmpoa: (%s) ARGH, received res. reply for an entry that doesn't exist.\n", mpc->dev->name);11121112 return;11131113 }11141114- ddprintk(" entry_state = %d ", entry->entry_state); 11141114+ ddprintk(" entry_state = %d ", entry->entry_state);1115111511161116 if (entry->entry_state == INGRESS_RESOLVED) {11171117 printk("\nmpoa: (%s) MPOA_res_reply_rcvd for RESOLVED entry!\n", mpc->dev->name);···11261126 ddprintk("entry->shortcut = %p\n", entry->shortcut);1127112711281128 if(entry->entry_state == INGRESS_RESOLVING && entry->shortcut != NULL){11291129- entry->entry_state = INGRESS_RESOLVED; 11291129+ entry->entry_state = INGRESS_RESOLVED;11301130 mpc->in_ops->put(entry);11311131 return; /* Shortcut already open... */11321132 }···11371137 mpc->in_ops->put(entry);11381138 return;11391139 }11401140-11401140+11411141 check_qos_and_open_shortcut(msg, mpc, entry);11421142 entry->entry_state = INGRESS_RESOLVED;11431143 mpc->in_ops->put(entry);···11691169 } while (entry != NULL);1170117011711171 return;11721172-} 11721172+}1173117311741174static void egress_purge_rcvd(struct k_message *msg, struct mpoa_client *mpc)11751175{11761176 __be32 cache_id = msg->content.eg_info.cache_id;11771177 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(cache_id, mpc);11781178-11781178+11791179 if (entry == NULL) {11801180 dprintk("mpoa: (%s) egress_purge_rcvd: purge for a non-existing entry\n", mpc->dev->name);11811181 return;···11881188 mpc->eg_ops->put(entry);1189118911901190 return;11911191-} 11911191+}1192119211931193static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)11941194{···12591259{12601260 uint16_t holding_time;12611261 eg_cache_entry *entry = mpc->eg_ops->get_by_cache_id(msg->content.eg_info.cache_id, mpc);12621262-12621262+12631263 holding_time = msg->content.eg_info.holding_time;12641264 dprintk("mpoa: (%s) MPOA_cache_impos_rcvd: entry = %p, holding_time = %u\n",12651265 mpc->dev->name, entry, holding_time);···12721272 mpc->eg_ops->update(entry, holding_time);12731273 return;12741274 }12751275-12751275+12761276 write_lock_irq(&mpc->egress_lock);12771277 mpc->eg_ops->remove_entry(entry, mpc);12781278 write_unlock_irq(&mpc->egress_lock);1279127912801280 mpc->eg_ops->put(entry);12811281-12811281+12821282 return;12831283}12841284···13281328 return;13291329 }13301330 client->number_of_mps_macs = 1;13311331-13311331+13321332 return;13331333}13341334···13641364 mpc_timer.data = mpc_timer.expires;13651365 mpc_timer.function = mpc_cache_check;13661366 add_timer(&mpc_timer);13671367-13671367+13681368 return;13691369}13701370···13731373 struct mpoa_client *mpc = mpcs;13741374 static unsigned long previous_resolving_check_time;13751375 static unsigned long previous_refresh_time;13761376-13761376+13771377 while( mpc != NULL ){13781378 mpc->in_ops->clear_count(mpc);13791379 mpc->eg_ops->clear_expired(mpc);···13881388 mpc = mpc->next;13891389 }13901390 mpc_timer_refresh();13911391-13911391+13921392 return;13931393}13941394
+19-19
net/atm/mpc.h
···1212int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);13131414struct mpoa_client {1515- struct mpoa_client *next;1616- struct net_device *dev; /* lec in question */1717- int dev_num; /* e.g. 2 for lec2 */1818- int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);1919- struct atm_vcc *mpoad_vcc; /* control channel to mpoad */2020- uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */2121- uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */1515+ struct mpoa_client *next;1616+ struct net_device *dev; /* lec in question */1717+ int dev_num; /* e.g. 2 for lec2 */1818+ int (*old_hard_start_xmit)(struct sk_buff *skb, struct net_device *dev);1919+ struct atm_vcc *mpoad_vcc; /* control channel to mpoad */2020+ uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */2121+ uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */22222323- rwlock_t ingress_lock;2424- struct in_cache_ops *in_ops; /* ingress cache operations */2525- in_cache_entry *in_cache; /* the ingress cache of this MPC */2323+ rwlock_t ingress_lock;2424+ struct in_cache_ops *in_ops; /* ingress cache operations */2525+ in_cache_entry *in_cache; /* the ingress cache of this MPC */26262727- rwlock_t egress_lock;2828- struct eg_cache_ops *eg_ops; /* egress cache operations */2929- eg_cache_entry *eg_cache; /* the egress cache of this MPC */2727+ rwlock_t egress_lock;2828+ struct eg_cache_ops *eg_ops; /* egress cache operations */2929+ eg_cache_entry *eg_cache; /* the egress cache of this MPC */30303131- uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */3232- int number_of_mps_macs; /* number of the above MAC addresses */3333- struct mpc_parameters parameters; /* parameters for this client */3131+ uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */3232+ int number_of_mps_macs; /* number of the above MAC addresses */3333+ struct mpc_parameters parameters; /* parameters for this client */3434};353536363737struct atm_mpoa_qos {3838- struct atm_mpoa_qos *next;3939- __be32 ipaddr;4040- struct atm_qos qos;3838+ struct atm_mpoa_qos *next;3939+ __be32 ipaddr;4040+ struct atm_qos qos;4141};42424343
···142142 set_bit(ATM_DF_REMOVED, &dev->flags);143143144144 /*145145- * if we remove current device from atm_devs list, new device 146146- * with same number can appear, such we need deregister proc, 145145+ * if we remove current device from atm_devs list, new device146146+ * with same number can appear, such we need deregister proc,147147 * release async all vccs and remove them from vccs list too148148 */149149 mutex_lock(&atm_dev_mutex);···228228 *tmp_p++ = dev->number;229229 }230230 mutex_unlock(&atm_dev_mutex);231231- error = ((copy_to_user(buf, tmp_buf, size)) ||231231+ error = ((copy_to_user(buf, tmp_buf, size)) ||232232 put_user(size, &iobuf->length))233233 ? -EFAULT : 0;234234 kfree(tmp_buf);···247247 if (!(dev = try_then_request_module(atm_dev_lookup(number),248248 "atm-device-%d", number)))249249 return -ENODEV;250250-250250+251251 switch (cmd) {252252 case ATM_GETTYPE:253253 size = strlen(dev->type) + 1;···390390 goto done;391391 }392392 }393393-393393+394394 if (size)395395 error = put_user(size, &sioc->length)396396 ? -EFAULT : 0;···414414415415void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos)416416{417417- mutex_lock(&atm_dev_mutex);417417+ mutex_lock(&atm_dev_mutex);418418 return *pos ? dev_get_idx(*pos) : (void *) 1;419419}420420421421void atm_dev_seq_stop(struct seq_file *seq, void *v)422422{423423- mutex_unlock(&atm_dev_mutex);423423+ mutex_unlock(&atm_dev_mutex);424424}425425-425425+426426void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos)427427{428428 ++*pos;
+2-2
net/atm/signaling.h
···11/* net/atm/signaling.h - ATM signaling */22-22+33/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */44-44+5566#ifndef NET_ATM_SIGNALING_H77#define NET_ATM_SIGNALING_H
+24-24
net/atm/svc.c
···8989 clear_bit(ATM_VF_READY, &vcc->flags);9090 /* VCC pointer is used as a reference, so we must not free it9191 (thereby subjecting it to re-use) before all pending connections9292- are closed */9292+ are closed */9393 svc_disconnect(vcc);9494 vcc_release(sock);9595 }···144144 error = -EUNATCH;145145 goto out;146146 }147147- if (!sk->sk_err)147147+ if (!sk->sk_err)148148 set_bit(ATM_VF_BOUND,&vcc->flags);149149 error = -sk->sk_err;150150out:···229229 * This is tricky:230230 * Kernel ---close--> Demon231231 * Kernel <--close--- Demon232232- * or232232+ * or233233 * Kernel ---close--> Demon234234 * Kernel <--error--- Demon235235 * or···470470 }471471 set_bit(ATM_VF_HASSAP, &vcc->flags);472472 break;473473- case SO_MULTIPOINT:473473+ case SO_MULTIPOINT:474474 if (level != SOL_ATM || optlen != sizeof(int)) {475475 error = -EINVAL;476476 goto out;477477 }478478- if (get_user(value, (int __user *) optval)) {479479- error = -EFAULT;478478+ if (get_user(value, (int __user *) optval)) {479479+ error = -EFAULT;480480 goto out;481481 }482482 if (value == 1) {···486486 } else {487487 error = -EINVAL;488488 }489489- break;489489+ break;490490 default:491491 error = vcc_setsockopt(sock, level, optname,492492 optval, optlen);···539539 set_bit(ATM_VF_WAITING, &vcc->flags);540540 prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);541541 sigd_enq(vcc, as_addparty, NULL, NULL,542542- (struct sockaddr_atmsvc *) sockaddr);542542+ (struct sockaddr_atmsvc *) sockaddr);543543 if (flags & O_NONBLOCK) {544544 finish_wait(sk->sk_sleep, &wait);545545 error = -EINPROGRESS;···587587588588static int svc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)589589{590590- int error, ep_ref;591591- struct sockaddr_atmsvc sa;590590+ int error, ep_ref;591591+ struct sockaddr_atmsvc sa;592592 struct atm_vcc *vcc = ATM_SD(sock);593593-593593+594594 switch (cmd) {595595- case ATM_ADDPARTY:596596- if (!test_bit(ATM_VF_SESSION, &vcc->flags))597597- return -EINVAL;598598- if (copy_from_user(&sa, (void __user *) arg, sizeof(sa)))595595+ case ATM_ADDPARTY:596596+ if (!test_bit(ATM_VF_SESSION, &vcc->flags))597597+ return -EINVAL;598598+ if (copy_from_user(&sa, (void __user *) arg, sizeof(sa)))599599 return -EFAULT;600600- error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0);601601- break;602602- case ATM_DROPPARTY:603603- if (!test_bit(ATM_VF_SESSION, &vcc->flags))604604- return -EINVAL;605605- if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int)))600600+ error = svc_addparty(sock, (struct sockaddr *) &sa, sizeof(sa), 0);601601+ break;602602+ case ATM_DROPPARTY:603603+ if (!test_bit(ATM_VF_SESSION, &vcc->flags))604604+ return -EINVAL;605605+ if (copy_from_user(&ep_ref, (void __user *) arg, sizeof(int)))606606 return -EFAULT;607607- error = svc_dropparty(sock, ep_ref);608608- break;609609- default:607607+ error = svc_dropparty(sock, ep_ref);608608+ break;609609+ default:610610 error = vcc_ioctl(sock, cmd, arg);611611 }612612