## Automatically generated incremental diff ## From: linux-2.4.22-bk36 ## To: linux-2.4.22-bk37 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.4.22-bk36/Makefile linux-2.4.22-bk37/Makefile --- linux-2.4.22-bk36/Makefile 2003-10-20 02:49:32.000000000 -0700 +++ linux-2.4.22-bk37/Makefile 2003-10-20 02:49:36.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 22 -EXTRAVERSION = -bk36 +EXTRAVERSION = -bk37 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -urN linux-2.4.22-bk36/arch/i386/kernel/apic.c linux-2.4.22-bk37/arch/i386/kernel/apic.c --- linux-2.4.22-bk36/arch/i386/kernel/apic.c 2003-10-20 02:49:32.000000000 -0700 +++ linux-2.4.22-bk37/arch/i386/kernel/apic.c 2003-10-20 02:49:36.000000000 -0700 @@ -502,10 +502,18 @@ __save_flags(flags); __cli(); + + /* + * Make sure the APICBASE points to the right address + * + * FIXME! This will be wrong if we ever support suspend on + * SMP! We'll need to do this as part of the CPU restore! + */ rdmsr(MSR_IA32_APICBASE, l, h); l &= ~MSR_IA32_APICBASE_BASE; - l |= MSR_IA32_APICBASE_ENABLE | APIC_DEFAULT_PHYS_BASE; + l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; wrmsr(MSR_IA32_APICBASE, l, h); + apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED); apic_write(APIC_ID, apic_pm_state.apic_id); apic_write(APIC_DFR, apic_pm_state.apic_dfr); @@ -674,6 +682,12 @@ } set_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability); mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; + + /* The BIOS may have set up the APIC at some other address */ + rdmsr(MSR_IA32_APICBASE, l, h); + if (l & MSR_IA32_APICBASE_ENABLE) + mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; + if (nmi_watchdog != NMI_NONE) nmi_watchdog = NMI_LOCAL_APIC; diff -urN linux-2.4.22-bk36/arch/sparc/kernel/devices.c linux-2.4.22-bk37/arch/sparc/kernel/devices.c --- linux-2.4.22-bk36/arch/sparc/kernel/devices.c 2002-11-28 15:53:12.000000000 -0800 +++ linux-2.4.22-bk37/arch/sparc/kernel/devices.c 2003-10-20 02:49:36.000000000 -0700 @@ -15,7 +15,7 @@ #include #include -struct prom_cpuinfo linux_cpus[32]; +struct prom_cpuinfo linux_cpus[NR_CPUS]; int linux_num_cpus = 0; extern void cpu_probe(void); diff -urN linux-2.4.22-bk36/arch/sparc64/defconfig linux-2.4.22-bk37/arch/sparc64/defconfig --- linux-2.4.22-bk36/arch/sparc64/defconfig 2003-10-20 02:49:33.000000000 -0700 +++ linux-2.4.22-bk37/arch/sparc64/defconfig 2003-10-20 02:49:36.000000000 -0700 @@ -21,6 +21,7 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SMP=y +CONFIG_NR_CPUS=32 CONFIG_SPARC64=y CONFIG_HOTPLUG=y CONFIG_HAVE_DEC_LOCK=y @@ -58,7 +59,6 @@ CONFIG_BINFMT_MISC=m # CONFIG_SUNOS_EMUL is not set CONFIG_SOLARIS_EMUL=m -CONFIG_NR_CPUS=32 # # Parallel port support @@ -255,6 +255,32 @@ CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_COMPAT_IPFWADM=m CONFIG_IP_NF_NAT_NEEDED=y + +# +# IP: Virtual Server Configuration +# +CONFIG_IP_VS=m +# CONFIG_IP_VS_DEBUG is not set +CONFIG_IP_VS_TAB_BITS=12 + +# +# IPVS scheduler +# +CONFIG_IP_VS_RR=m +CONFIG_IP_VS_WRR=m +CONFIG_IP_VS_LC=m +CONFIG_IP_VS_WLC=m +CONFIG_IP_VS_LBLC=m +CONFIG_IP_VS_LBLCR=m +CONFIG_IP_VS_DH=m +CONFIG_IP_VS_SH=m +CONFIG_IP_VS_SED=m +CONFIG_IP_VS_NQ=m + +# +# IPVS application helper +# +CONFIG_IP_VS_FTP=m CONFIG_IPV6=m # @@ -280,6 +306,15 @@ CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m # CONFIG_KHTTPD is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +CONFIG_IPV6_SCTP__=m +CONFIG_IP_SCTP=m +# CONFIG_SCTP_ADLER32 is not set +# CONFIG_SCTP_DBG_MSG is not set +# CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_ATM is not set CONFIG_VLAN_8021Q=m @@ -566,6 +601,7 @@ # CONFIG_AMD8111_ETH is not set CONFIG_ADAPTEC_STARFIRE=m # CONFIG_APRICOT is not set +CONFIG_B44=m # CONFIG_CS89x0 is not set CONFIG_TULIP=m # CONFIG_TULIP_MWI is not set @@ -593,7 +629,6 @@ CONFIG_SUNDANCE=m CONFIG_SUNDANCE_MMIO=y # CONFIG_TLAN is not set -# CONFIG_TC35815 is not set CONFIG_VIA_RHINE=m # CONFIG_VIA_RHINE_MMIO is not set CONFIG_WINBOND_840=m @@ -845,6 +880,8 @@ # CONFIG_MIDI_VIA82CXXX is not set # CONFIG_SOUND_OSS is not set # CONFIG_SOUND_TVMIXER is not set +CONFIG_SOUND_AD1980=m +CONFIG_SOUND_WM97XX=m # # USB support @@ -984,7 +1021,17 @@ CONFIG_USB_TIGL=m # CONFIG_USB_BRLVGER is not set CONFIG_USB_LCD=m -# CONFIG_USB_SPEEDTOUCH is not set + +# +# Support for USB gadgets +# +CONFIG_USB_GADGET=y + +# +# USB Peripheral Controller Drivers +# +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_GADGET_CONTROLLER is not set # # Bluetooth support @@ -997,7 +1044,6 @@ CONFIG_BLUEZ_BNEP=m CONFIG_BLUEZ_BNEP_MC_FILTER=y CONFIG_BLUEZ_BNEP_PROTO_FILTER=y -CONFIG_BLUEZ_CMTP=m # # Bluetooth device drivers @@ -1009,6 +1055,7 @@ CONFIG_BLUEZ_HCIUART_H4=y CONFIG_BLUEZ_HCIUART_BCSP=y CONFIG_BLUEZ_HCIUART_BCSP_TXCRC=y +CONFIG_BLUEZ_HCIBFUSB=m # CONFIG_BLUEZ_HCIDTL1 is not set # CONFIG_BLUEZ_HCIBT3C is not set # CONFIG_BLUEZ_HCIBLUECARD is not set @@ -1030,6 +1077,7 @@ # CONFIG_DEBUG_BUGVERBOSE is not set # CONFIG_DEBUG_DCFLUSH is not set # CONFIG_STACK_DEBUG is not set +CONFIG_LOG_BUF_SHIFT=0 # # Cryptographic options @@ -1047,6 +1095,7 @@ CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m +CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_DEFLATE=y # CONFIG_CRYPTO_TEST is not set @@ -1056,3 +1105,4 @@ CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y +CONFIG_FW_LOADER=m diff -urN linux-2.4.22-bk36/arch/sparc64/kernel/entry.S linux-2.4.22-bk37/arch/sparc64/kernel/entry.S --- linux-2.4.22-bk36/arch/sparc64/kernel/entry.S 2003-10-20 02:49:33.000000000 -0700 +++ linux-2.4.22-bk37/arch/sparc64/kernel/entry.S 2003-10-20 02:49:36.000000000 -0700 @@ -1754,8 +1754,8 @@ cmp %o0, -ENOIOCTLCMD sllx %g2, 32, %g2 bgeu,pn %xcc, 1f - andcc %l0, 0x02, %l6 +80: andn %g3, %g2, %g3 /* System call success, clear Carry condition code. */ stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] bne,pn %icc, linux_syscall_trace2 @@ -1765,9 +1765,21 @@ stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 1: + /* Really a failure? Check if force_successful_syscall_return() + * was invoked. + */ + ldx [%curptr + AOFF_task_thread + AOFF_thread_flags], %l0 + andcc %l0, SPARC_FLAG_SYS_SUCCESS, %g0 + be,pt %icc, 1f + andcc %l6, 0x02, %g0 + andn %l0, SPARC_FLAG_SYS_SUCCESS, %l0 + ba,pt %xcc, 80b + stx %l0, [%curptr + AOFF_task_thread + AOFF_thread_flags] + /* System call failure, set Carry condition code. * Also, get abs(errno) to return to the process. */ +1: sub %g0, %o0, %o0 or %g3, %g2, %g3 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] diff -urN linux-2.4.22-bk36/drivers/atm/atmtcp.c linux-2.4.22-bk37/drivers/atm/atmtcp.c --- linux-2.4.22-bk36/drivers/atm/atmtcp.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.22-bk37/drivers/atm/atmtcp.c 2003-10-20 02:49:36.000000000 -0700 @@ -153,9 +153,9 @@ static int atmtcp_v_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg) { - unsigned long flags; struct atm_cirange ci; struct atm_vcc *vcc; + struct sock *s; if (cmd != ATM_SETCIRANGE) return -ENOIOCTLCMD; if (copy_from_user(&ci,(void *) arg,sizeof(ci))) return -EFAULT; @@ -163,14 +163,18 @@ if (ci.vci_bits == ATM_CI_MAX) ci.vci_bits = MAX_VCI_BITS; if (ci.vpi_bits > MAX_VPI_BITS || ci.vpi_bits < 0 || ci.vci_bits > MAX_VCI_BITS || ci.vci_bits < 0) return -EINVAL; - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->dev != dev) + continue; if ((vcc->vpi >> ci.vpi_bits) || (vcc->vci >> ci.vci_bits)) { - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EBUSY; } - spin_unlock_irqrestore(&dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); dev->ci_range = ci; return 0; } @@ -233,9 +237,9 @@ static void atmtcp_c_close(struct atm_vcc *vcc) { - unsigned long flags; struct atm_dev *atmtcp_dev; struct atmtcp_dev_data *dev_data; + struct sock *s; struct atm_vcc *walk; atmtcp_dev = (struct atm_dev *) vcc->dev_data; @@ -246,19 +250,23 @@ kfree(dev_data); shutdown_atm_dev(atmtcp_dev); vcc->dev_data = NULL; - spin_lock_irqsave(&atmtcp_dev->lock, flags); - for (walk = atmtcp_dev->vccs; walk; walk = walk->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != atmtcp_dev) + continue; wake_up(&walk->sleep); - spin_unlock_irqrestore(&atmtcp_dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); } static int atmtcp_c_send(struct atm_vcc *vcc,struct sk_buff *skb) { - unsigned long flags; struct atm_dev *dev; struct atmtcp_hdr *hdr; - struct atm_vcc *out_vcc; + struct sock *s; + struct atm_vcc *out_vcc = NULL; struct sk_buff *new_skb; int result = 0; @@ -270,13 +278,17 @@ (struct atmtcp_control *) skb->data); goto done; } - spin_lock_irqsave(&dev->lock, flags); - for (out_vcc = dev->vccs; out_vcc; out_vcc = out_vcc->next) + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + out_vcc = s->protinfo.af_atm; + if (out_vcc->dev != dev) + continue; if (out_vcc->vpi == ntohs(hdr->vpi) && out_vcc->vci == ntohs(hdr->vci) && out_vcc->qos.rxtp.traffic_class != ATM_NONE) break; - spin_unlock_irqrestore(&dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); if (!out_vcc) { atomic_inc(&vcc->stats->tx_err); goto done; @@ -366,7 +378,7 @@ if (itf != -1) dev = atm_dev_lookup(itf); if (dev) { if (dev->ops != &atmtcp_v_dev_ops) { - atm_dev_release(dev); + atm_dev_put(dev); return -EMEDIUMTYPE; } if (PRIV(dev)->vcc) return -EBUSY; @@ -378,7 +390,8 @@ if (error) return error; } PRIV(dev)->vcc = vcc; - bind_vcc(vcc,&atmtcp_control_dev); + vcc->dev = &atmtcp_control_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); vcc->dev_data = dev; @@ -402,7 +415,7 @@ dev = atm_dev_lookup(itf); if (!dev) return -ENODEV; if (dev->ops != &atmtcp_v_dev_ops) { - atm_dev_release(dev); + atm_dev_put(dev); return -EMEDIUMTYPE; } dev_data = PRIV(dev); @@ -410,7 +423,7 @@ dev_data->persist = 0; if (PRIV(dev)->vcc) return 0; kfree(dev_data); - atm_dev_release(dev); + atm_dev_put(dev); shutdown_atm_dev(dev); return 0; } diff -urN linux-2.4.22-bk36/drivers/atm/eni.c linux-2.4.22-bk37/drivers/atm/eni.c --- linux-2.4.22-bk36/drivers/atm/eni.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.22-bk37/drivers/atm/eni.c 2003-10-20 02:49:36.000000000 -0700 @@ -1887,10 +1887,10 @@ static int get_ci(struct atm_vcc *vcc,short *vpi,int *vci) { - unsigned long flags; + struct sock *s; struct atm_vcc *walk; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) *vpi = 0; if (*vci == ATM_VCI_ANY) { for (*vci = ATM_NOT_RSV_VCI; *vci < NR_VCI; (*vci)++) { @@ -1898,40 +1898,47 @@ ENI_DEV(vcc->dev)->rx_map[*vci]) continue; if (vcc->qos.txtp.traffic_class != ATM_NONE) { - for (walk = vcc->dev->vccs; walk; - walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci && walk->qos.txtp.traffic_class != ATM_NONE) break; - if (walk) continue; + } + if (s) continue; } break; } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return *vci == NR_VCI ? -EADDRINUSE : 0; } if (*vci == ATM_VCI_UNSPEC) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } if (vcc->qos.rxtp.traffic_class != ATM_NONE && ENI_DEV(vcc->dev)->rx_map[*vci]) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } if (vcc->qos.txtp.traffic_class == ATM_NONE) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } - for (walk = vcc->dev->vccs; walk; walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vci == *vci && walk->qos.txtp.traffic_class != ATM_NONE) { - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + } + read_unlock(&vcc_sklist_lock); return 0; } @@ -2139,7 +2146,7 @@ static int eni_proc_read(struct atm_dev *dev,loff_t *pos,char *page) { - unsigned long flags; + struct sock *s; static const char *signal[] = { "LOST","unknown","okay" }; struct eni_dev *eni_dev = ENI_DEV(dev); struct atm_vcc *vcc; @@ -2212,11 +2219,15 @@ return sprintf(page,"%10sbacklog %u packets\n","", skb_queue_len(&tx->backlog)); } - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) { - struct eni_vcc *eni_vcc = ENI_VCC(vcc); + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + struct eni_vcc *eni_vcc; int length; + vcc = s->protinfo.af_atm; + if (vcc->dev != dev) + continue; + eni_vcc = ENI_VCC(vcc); if (--left) continue; length = sprintf(page,"vcc %4d: ",vcc->vci); if (eni_vcc->rx) { @@ -2231,10 +2242,10 @@ length += sprintf(page+length,"tx[%d], txing %d bytes", eni_vcc->tx->index,eni_vcc->txing); page[length] = '\n'; - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); return length+1; } - spin_unlock_irqrestore(&dev->lock, flags); + read_unlock(&vcc_sklist_lock); for (i = 0; i < eni_dev->free_len; i++) { struct eni_free *fe = eni_dev->free_list+i; unsigned long offset; diff -urN linux-2.4.22-bk36/drivers/atm/fore200e.c linux-2.4.22-bk37/drivers/atm/fore200e.c --- linux-2.4.22-bk36/drivers/atm/fore200e.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.22-bk37/drivers/atm/fore200e.c 2003-10-20 02:49:36.000000000 -0700 @@ -1077,18 +1077,22 @@ static struct atm_vcc* fore200e_find_vcc(struct fore200e* fore200e, struct rpd* rpd) { - unsigned long flags; + struct sock *s; struct atm_vcc* vcc; - spin_lock_irqsave(&fore200e->atm_dev->lock, flags); - for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) { - - if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) - break; + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->dev != fore200e->atm_dev) + continue; + if (vcc->vpi == rpd->atm_header.vpi && vcc->vci == rpd->atm_header.vci) { + read_unlock(&vcc_sklist_lock); + return vcc; + } } - spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags); - - return vcc; + read_unlock(&vcc_sklist_lock); + + return NULL; } @@ -1357,20 +1361,23 @@ static int fore200e_walk_vccs(struct atm_vcc *vcc, short *vpi, int *vci) { - unsigned long flags; struct atm_vcc* walk; + struct sock *s; /* find a free VPI */ - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) { - for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) { + for (*vpi = 0, s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vpi)++; - walk = vcc->dev->vccs; + s = vcc_sklist; } } } @@ -1378,16 +1385,19 @@ /* find a free VCI */ if (*vci == ATM_VCI_ANY) { - for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; walk = walk->next) { + for (*vci = ATM_NOT_RSV_VCI, s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vpi = *vpi) && (walk->vci == *vci)) { *vci = walk->vci + 1; - walk = vcc->dev->vccs; + s = vcc_sklist; } } } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } @@ -2649,7 +2659,7 @@ static int fore200e_proc_read(struct atm_dev *dev,loff_t* pos,char* page) { - unsigned long flags; + struct sock *s; struct fore200e* fore200e = FORE200E_DEV(dev); int len, left = *pos; @@ -2896,8 +2906,12 @@ len = sprintf(page,"\n" " VCCs:\n address\tVPI.VCI:AAL\t(min/max tx PDU size) (min/max rx PDU size)\n"); - spin_lock_irqsave(&fore200e->atm_dev->lock, flags); - for (vcc = fore200e->atm_dev->vccs; vcc; vcc = vcc->next) { + read_lock(&vcc_sklist_lock); + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + + if (vcc->dev != fore200e->atm_dev) + continue; fore200e_vcc = FORE200E_VCC(vcc); @@ -2911,7 +2925,7 @@ fore200e_vcc->rx_max_pdu ); } - spin_unlock_irqrestore(&fore200e->atm_dev->lock, flags); + read_unlock(&vcc_sklist_lock); return len; } diff -urN linux-2.4.22-bk36/drivers/atm/he.c linux-2.4.22-bk37/drivers/atm/he.c --- linux-2.4.22-bk36/drivers/atm/he.c 2003-10-20 02:49:33.000000000 -0700 +++ linux-2.4.22-bk37/drivers/atm/he.c 2003-10-20 02:49:36.000000000 -0700 @@ -323,25 +323,25 @@ he_writel_rcm(dev, val, 0x00000 | (cid << 3) | 7) static __inline__ struct atm_vcc* -he_find_vcc(struct he_dev *he_dev, unsigned cid) +__find_vcc(struct he_dev *he_dev, unsigned cid) { - unsigned long flags; struct atm_vcc *vcc; + struct sock *s; short vpi; int vci; vpi = cid >> he_dev->vcibits; vci = cid & ((1 << he_dev->vcibits) - 1); - spin_lock_irqsave(&he_dev->atm_dev->lock, flags); - for (vcc = he_dev->atm_dev->vccs; vcc; vcc = vcc->next) - if (vcc->vci == vci && vcc->vpi == vpi - && vcc->qos.rxtp.traffic_class != ATM_NONE) { - spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags); - return vcc; - } + for (s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->vci == vci && vcc->vpi == vpi && + vcc->dev == he_dev->atm_dev && + vcc->qos.rxtp.traffic_class != ATM_NONE) { + return vcc; + } + } - spin_unlock_irqrestore(&he_dev->atm_dev->lock, flags); return NULL; } @@ -1777,6 +1777,7 @@ int pdus_assembled = 0; int updated = 0; + read_lock(&vcc_sklist_lock); while (he_dev->rbrq_head != rbrq_tail) { ++updated; @@ -1803,7 +1804,7 @@ cid = RBRQ_CID(he_dev->rbrq_head); if (cid != lastcid) - vcc = he_find_vcc(he_dev, cid); + vcc = __find_vcc(he_dev, cid); lastcid = cid; if (vcc == NULL) { @@ -1942,6 +1943,7 @@ RBRQ_MASK(++he_dev->rbrq_head)); } + read_unlock(&vcc_sklist_lock); if (updated) { if (updated > he_dev->rbrq_peak) diff -urN linux-2.4.22-bk36/drivers/atm/idt77252.c linux-2.4.22-bk37/drivers/atm/idt77252.c --- linux-2.4.22-bk36/drivers/atm/idt77252.c 2003-08-25 04:44:41.000000000 -0700 +++ linux-2.4.22-bk37/drivers/atm/idt77252.c 2003-10-20 02:49:36.000000000 -0700 @@ -2404,37 +2404,43 @@ static int idt77252_find_vcc(struct atm_vcc *vcc, short *vpi, int *vci) { - unsigned long flags; + struct sock *s; struct atm_vcc *walk; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi == ATM_VPI_ANY) { *vpi = 0; - walk = vcc->dev->vccs; - while (walk) { + s = vcc_sklist; + while (s) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vpi)++; - walk = vcc->dev->vccs; + s = vcc_sklist; continue; } - walk = walk->next; + s = s->next; } } if (*vci == ATM_VCI_ANY) { *vci = ATM_NOT_RSV_VCI; - walk = vcc->dev->vccs; - while (walk) { + s = vcc_sklist; + while (s) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if ((walk->vci == *vci) && (walk->vpi == *vpi)) { (*vci)++; - walk = vcc->dev->vccs; + s = vcc_sklist; continue; } - walk = walk->next; + s = s->next; } } - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } diff -urN linux-2.4.22-bk36/drivers/net/irda/act200l.c linux-2.4.22-bk37/drivers/net/irda/act200l.c --- linux-2.4.22-bk36/drivers/net/irda/act200l.c 2002-11-28 15:53:13.000000000 -0800 +++ linux-2.4.22-bk37/drivers/net/irda/act200l.c 2003-10-20 02:49:37.000000000 -0700 @@ -106,7 +106,7 @@ static void act200l_open(dongle_t *self, struct qos_info *qos) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Power on the dongle */ self->set_dtr_rts(self->dev, TRUE, TRUE); @@ -120,7 +120,7 @@ static void act200l_close(dongle_t *self) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Power off the dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); @@ -141,7 +141,7 @@ __u8 control[3]; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self->speed_task = task; @@ -158,7 +158,7 @@ } break; case IRDA_TASK_CHILD_WAIT: - WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); + WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__); ret = -1; break; case IRDA_TASK_CHILD_DONE: @@ -203,7 +203,7 @@ self->speed_task = NULL; break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->speed_task = NULL; ret = -1; @@ -233,7 +233,7 @@ }; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self->reset_task = task; @@ -269,7 +269,7 @@ self->reset_task = NULL; break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->reset_task = NULL; ret = -1; diff -urN linux-2.4.22-bk36/drivers/net/irda/irda-usb.c linux-2.4.22-bk37/drivers/net/irda/irda-usb.c --- linux-2.4.22-bk36/drivers/net/irda/irda-usb.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22-bk37/drivers/net/irda/irda-usb.c 2003-10-20 02:49:37.000000000 -0700 @@ -339,7 +339,7 @@ int res, mtt; int err = 1; /* Failed */ - IRDA_DEBUG(4, __FUNCTION__ "() on %s\n", netdev->name); + IRDA_DEBUG(4, "%s() on %s\n", __FUNCTION__, netdev->name); netif_stop_queue(netdev); @@ -542,7 +542,7 @@ (self->new_xbofs != self->xbofs)) { /* We haven't changed speed yet (because of * IUC_SPEED_BUG), so do it now - Jean II */ - IRDA_DEBUG(1, __FUNCTION__ "(), Changing speed now...\n"); + IRDA_DEBUG(1, "%s(), Changing speed now...\n", __FUNCTION__); irda_usb_change_speed_xbofs(self); } else { /* New speed and xbof is now commited in hardware */ diff -urN linux-2.4.22-bk36/drivers/net/irda/ma600.c linux-2.4.22-bk37/drivers/net/irda/ma600.c --- linux-2.4.22-bk36/drivers/net/irda/ma600.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22-bk37/drivers/net/irda/ma600.c 2003-10-20 02:49:37.000000000 -0700 @@ -86,13 +86,13 @@ int __init ma600_init(void) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); return irda_device_register_dongle(&dongle); } void __exit ma600_cleanup(void) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); irda_device_unregister_dongle(&dongle); } @@ -105,7 +105,7 @@ */ static void ma600_open(dongle_t *self, struct qos_info *qos) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); qos->baud_rate.bits &= IR_2400|IR_9600|IR_19200|IR_38400 |IR_57600|IR_115200; @@ -123,7 +123,7 @@ static void ma600_close(dongle_t *self) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Power off dongle */ self->set_dtr_rts(self->dev, FALSE, FALSE); @@ -184,12 +184,12 @@ __u8 byte_echo; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(task != NULL, return -1;); if (self->speed_task && self->speed_task != task) { - IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n"); + IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__); return MSECS_TO_JIFFIES(10); } else { self->speed_task = task; @@ -215,7 +215,7 @@ break; case IRDA_TASK_CHILD_WAIT: - WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); + WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__); ret = -1; break; @@ -246,7 +246,7 @@ if(byte != byte_echo) { /* if control byte != echo, I don't know what to do */ - printk(KERN_WARNING __FUNCTION__ "() control byte written != read!\n"); + printk(KERN_WARNING "%s() control byte written != read!\n", __FUNCTION__); printk(KERN_WARNING "control byte = 0x%c%c\n", hexTbl[(byte>>4)&0x0f], hexTbl[byte&0x0f]); printk(KERN_WARNING "byte echo = 0x%c%c\n", @@ -254,7 +254,7 @@ hexTbl[byte_echo & 0x0f]); #ifndef NDEBUG } else { - IRDA_DEBUG(2, __FUNCTION__ "() control byte write read OK\n"); + IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__); #endif } @@ -273,7 +273,7 @@ break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->speed_task = NULL; ret = -1; @@ -298,12 +298,12 @@ dongle_t *self = (dongle_t *) task->instance; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(task != NULL, return -1;); if (self->reset_task && self->reset_task != task) { - IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n"); + IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__); return MSECS_TO_JIFFIES(10); } else self->reset_task = task; @@ -326,7 +326,7 @@ self->reset_task = NULL; break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->reset_task = NULL; ret = -1; diff -urN linux-2.4.22-bk36/drivers/net/irda/mcp2120.c linux-2.4.22-bk37/drivers/net/irda/mcp2120.c --- linux-2.4.22-bk36/drivers/net/irda/mcp2120.c 2002-11-28 15:53:13.000000000 -0800 +++ linux-2.4.22-bk37/drivers/net/irda/mcp2120.c 2003-10-20 02:49:37.000000000 -0700 @@ -110,7 +110,7 @@ } break; case IRDA_TASK_CHILD_WAIT: - WARNING(__FUNCTION__ "(), resetting dongle timed out!\n"); + WARNING("%s(), resetting dongle timed out!\n", __FUNCTION__); ret = -1; break; case IRDA_TASK_CHILD_DONE: @@ -158,7 +158,7 @@ //printk("mcp2120_change_speed irda_task_wait\n"); break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->speed_task = NULL; ret = -1; @@ -213,7 +213,7 @@ self->reset_task = NULL; break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__ , task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->reset_task = NULL; ret = -1; diff -urN linux-2.4.22-bk36/drivers/net/irda/nsc-ircc.c linux-2.4.22-bk37/drivers/net/irda/nsc-ircc.c --- linux-2.4.22-bk36/drivers/net/irda/nsc-ircc.c 2002-11-28 15:53:13.000000000 -0800 +++ linux-2.4.22-bk37/drivers/net/irda/nsc-ircc.c 2003-10-20 02:49:37.000000000 -0700 @@ -700,7 +700,7 @@ switch_bank(iobase, BANK3); version = inb(iobase+MID); - IRDA_DEBUG(2, __FUNCTION__ "() Driver %s Found chip version %02x\n", + IRDA_DEBUG(2, "%s() Driver %s Found chip version %02x\n", __FUNCTION__, driver_name, version); /* Should be 0x2? */ diff -urN linux-2.4.22-bk36/drivers/net/sunhme.c linux-2.4.22-bk37/drivers/net/sunhme.c --- linux-2.4.22-bk36/drivers/net/sunhme.c 2003-08-25 04:44:42.000000000 -0700 +++ linux-2.4.22-bk37/drivers/net/sunhme.c 2003-10-20 02:49:37.000000000 -0700 @@ -2968,7 +2968,7 @@ dev_addr[0] = 0x08; dev_addr[1] = 0x00; dev_addr[2] = 0x20; - get_random_bytes(dev_addr, 3); + get_random_bytes(&dev_addr[3], 3); return; } #endif /* !(__sparc__) */ diff -urN linux-2.4.22-bk36/drivers/sbus/char/bbc_envctrl.c linux-2.4.22-bk37/drivers/sbus/char/bbc_envctrl.c --- linux-2.4.22-bk36/drivers/sbus/char/bbc_envctrl.c 2003-06-13 07:51:36.000000000 -0700 +++ linux-2.4.22-bk37/drivers/sbus/char/bbc_envctrl.c 2003-10-20 02:49:37.000000000 -0700 @@ -59,7 +59,7 @@ * before the hardware based power-off event is triggered. */ -/* These settings are in celcius. We use these defaults only +/* These settings are in Celsius. We use these defaults only * if we cannot interrogate the cpu-fru SEEPROM. */ struct temp_limits { diff -urN linux-2.4.22-bk36/drivers/sbus/char/cpwatchdog.c linux-2.4.22-bk37/drivers/sbus/char/cpwatchdog.c --- linux-2.4.22-bk36/drivers/sbus/char/cpwatchdog.c 2001-10-10 23:42:47.000000000 -0700 +++ linux-2.4.22-bk37/drivers/sbus/char/cpwatchdog.c 2003-10-20 02:49:37.000000000 -0700 @@ -544,7 +544,7 @@ static void wd_pingtimer(struct wd_timer* pTimer) { if(wd_readb(&pTimer->regs->status) & WD_S_RUNNING) { - wd_readb(&pTimer->regs->dcntr); + wd_readw(&pTimer->regs->dcntr); } } diff -urN linux-2.4.22-bk36/drivers/sbus/char/envctrl.c linux-2.4.22-bk37/drivers/sbus/char/envctrl.c --- linux-2.4.22-bk36/drivers/sbus/char/envctrl.c 2003-06-13 07:51:36.000000000 -0700 +++ linux-2.4.22-bk37/drivers/sbus/char/envctrl.c 2003-10-20 02:49:37.000000000 -0700 @@ -1125,7 +1125,7 @@ } err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); - if (err) + if (err < 0) goto out_deregister; return 0; diff -urN linux-2.4.22-bk36/include/asm-sparc/atomic.h linux-2.4.22-bk37/include/asm-sparc/atomic.h --- linux-2.4.22-bk36/include/asm-sparc/atomic.h 2001-10-30 15:08:11.000000000 -0800 +++ linux-2.4.22-bk37/include/asm-sparc/atomic.h 2003-10-20 02:49:37.000000000 -0700 @@ -48,10 +48,13 @@ #define atomic_set(v, i) (((v)->counter) = ((i) << 8)) #endif -static __inline__ int __atomic_add(int i, atomic_t *v) +static inline int __atomic_add(int i, atomic_t *v) { register volatile int *ptr asm("g1"); register int increment asm("g2"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g7"); ptr = &v->counter; increment = i; @@ -60,17 +63,20 @@ "mov %%o7, %%g4\n\t" "call ___atomic_add\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (increment) + : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) : "0" (increment), "r" (ptr) - : "g3", "g4", "g7", "memory", "cc"); + : "memory", "cc"); return increment; } -static __inline__ int __atomic_sub(int i, atomic_t *v) +static inline int __atomic_sub(int i, atomic_t *v) { register volatile int *ptr asm("g1"); register int increment asm("g2"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g7"); ptr = &v->counter; increment = i; @@ -79,9 +85,9 @@ "mov %%o7, %%g4\n\t" "call ___atomic_sub\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (increment) + : "=&r" (increment), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3) : "0" (increment), "r" (ptr) - : "g3", "g4", "g7", "memory", "cc"); + : "memory", "cc"); return increment; } diff -urN linux-2.4.22-bk36/include/asm-sparc/bitops.h linux-2.4.22-bk37/include/asm-sparc/bitops.h --- linux-2.4.22-bk36/include/asm-sparc/bitops.h 2001-12-21 09:42:03.000000000 -0800 +++ linux-2.4.22-bk37/include/asm-sparc/bitops.h 2003-10-20 02:49:37.000000000 -0700 @@ -21,10 +21,14 @@ * within the first byte. Sparc is BIG-Endian. Unless noted otherwise * all bit-ops return 0 if bit was previously clear and != 0 otherwise. */ -static __inline__ int test_and_set_bit(unsigned long nr, volatile void *addr) +static inline int test_and_set_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -33,17 +37,21 @@ "mov %%o7, %%g4\n\t" "call ___set_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "memory", "cc"); + : "memory", "cc"); return mask != 0; } -static __inline__ void set_bit(unsigned long nr, volatile void *addr) +static inline void set_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -52,15 +60,19 @@ "mov %%o7, %%g4\n\t" "call ___set_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "memory", "cc"); } -static __inline__ int test_and_clear_bit(unsigned long nr, volatile void *addr) +static inline int test_and_clear_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -69,17 +81,21 @@ "mov %%o7, %%g4\n\t" "call ___clear_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "memory", "cc"); + : "memory", "cc"); return mask != 0; } -static __inline__ void clear_bit(unsigned long nr, volatile void *addr) +static inline void clear_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -88,15 +104,19 @@ "mov %%o7, %%g4\n\t" "call ___clear_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "memory", "cc"); } -static __inline__ int test_and_change_bit(unsigned long nr, volatile void *addr) +static inline int test_and_change_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -105,17 +125,21 @@ "mov %%o7, %%g4\n\t" "call ___change_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "memory", "cc"); + : "memory", "cc"); return mask != 0; } -static __inline__ void change_bit(unsigned long nr, volatile void *addr) +static inline void change_bit(unsigned long nr, volatile void *addr) { register unsigned long mask asm("g2"); register unsigned long *ADDR asm("g1"); + register int tmp1 asm("g3"); + register int tmp2 asm("g4"); + register int tmp3 asm("g5"); + register int tmp4 asm("g7"); ADDR = ((unsigned long *) addr) + (nr >> 5); mask = 1 << (nr & 31); @@ -124,15 +148,15 @@ "mov %%o7, %%g4\n\t" "call ___change_bit\n\t" " add %%o7, 8, %%o7\n" - : "=&r" (mask) + : "=&r" (mask), "=r" (tmp1), "=r" (tmp2), "=r" (tmp3), "=r" (tmp4) : "0" (mask), "r" (ADDR) - : "g3", "g4", "g5", "g7", "cc"); + : "memory", "cc"); } /* * non-atomic versions */ -static __inline__ void __set_bit(int nr, volatile void *addr) +static inline void __set_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -140,7 +164,7 @@ *p |= mask; } -static __inline__ void __clear_bit(int nr, volatile void *addr) +static inline void __clear_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -148,7 +172,7 @@ *p &= ~mask; } -static __inline__ void __change_bit(int nr, volatile void *addr) +static inline void __change_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -156,7 +180,7 @@ *p ^= mask; } -static __inline__ int __test_and_set_bit(int nr, volatile void *addr) +static inline int __test_and_set_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -166,7 +190,7 @@ return (old & mask) != 0; } -static __inline__ int __test_and_clear_bit(int nr, volatile void *addr) +static inline int __test_and_clear_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -176,7 +200,7 @@ return (old & mask) != 0; } -static __inline__ int __test_and_change_bit(int nr, volatile void *addr) +static inline int __test_and_change_bit(int nr, volatile void *addr) { unsigned long mask = 1UL << (nr & 0x1f); unsigned long *p = ((unsigned long *)addr) + (nr >> 5); @@ -190,13 +214,13 @@ #define smp_mb__after_clear_bit() do { } while(0) /* The following routine need not be atomic. */ -static __inline__ int test_bit(int nr, __const__ void *addr) +static inline int test_bit(int nr, __const__ void *addr) { return (1 & (((__const__ unsigned int *) addr)[nr >> 5] >> (nr & 31))) != 0; } /* The easy/cheese version for now. */ -static __inline__ unsigned long ffz(unsigned long word) +static inline unsigned long ffz(unsigned long word) { unsigned long result = 0; @@ -227,7 +251,7 @@ * 'size' bits, starting the search at bit 'offset'. This is largely based * on Linus's ALPHA routines, which are pretty portable BTW. */ -static __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) +static inline unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long result = offset & ~31UL; @@ -272,7 +296,7 @@ #define find_first_zero_bit(addr, size) \ find_next_zero_bit((addr), (size), 0) -static __inline__ int test_le_bit(int nr, __const__ void * addr) +static inline int test_le_bit(int nr, __const__ void * addr) { __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; return (ADDR[nr >> 3] >> (nr & 7)) & 1; @@ -281,7 +305,7 @@ /* * non-atomic versions */ -static __inline__ void __set_le_bit(int nr, void *addr) +static inline void __set_le_bit(int nr, void *addr) { unsigned char *ADDR = (unsigned char *)addr; @@ -289,7 +313,7 @@ *ADDR |= 1 << (nr & 0x07); } -static __inline__ void __clear_le_bit(int nr, void *addr) +static inline void __clear_le_bit(int nr, void *addr) { unsigned char *ADDR = (unsigned char *)addr; @@ -297,7 +321,7 @@ *ADDR &= ~(1 << (nr & 0x07)); } -static __inline__ int __test_and_set_le_bit(int nr, void *addr) +static inline int __test_and_set_le_bit(int nr, void *addr) { int mask, retval; unsigned char *ADDR = (unsigned char *)addr; @@ -309,7 +333,7 @@ return retval; } -static __inline__ int __test_and_clear_le_bit(int nr, void *addr) +static inline int __test_and_clear_le_bit(int nr, void *addr) { int mask, retval; unsigned char *ADDR = (unsigned char *)addr; @@ -321,7 +345,7 @@ return retval; } -static __inline__ unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset) +static inline unsigned long find_next_zero_le_bit(void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 5); unsigned long result = offset & ~31UL; diff -urN linux-2.4.22-bk36/include/asm-sparc/checksum.h linux-2.4.22-bk37/include/asm-sparc/checksum.h --- linux-2.4.22-bk36/include/asm-sparc/checksum.h 2002-08-02 17:39:45.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/checksum.h 2003-10-20 02:49:37.000000000 -0700 @@ -48,23 +48,26 @@ extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *); -extern __inline__ unsigned int +static inline unsigned int csum_partial_copy_nocheck (const char *src, char *dst, int len, unsigned int sum) { register unsigned int ret asm("o0") = (unsigned int)src; register char *d asm("o1") = dst; register int l asm("g1") = len; - + __asm__ __volatile__ ( "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" - " mov %4, %%g7\n" - : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (sum) : - "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); + " mov %6, %%g7\n" + : "=&r" (ret), "=&r" (d), "=&r" (l) + : "0" (ret), "1" (d), "2" (l), "r" (sum) + : "o2", "o3", "o4", "o5", "o7", + "g2", "g3", "g4", "g5", "g7", + "memory", "cc"); return ret; } -extern __inline__ unsigned int +static inline unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *err) { @@ -85,14 +88,16 @@ ".previous\n" "1:\n\t" "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" - " st %5, [%%sp + 64]\n" - : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) : - "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); + " st %8, [%%sp + 64]\n" + : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s) + : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err) + : "o2", "o3", "o4", "o5", "o7", "g2", "g3", "g4", "g5", + "cc", "memory"); return ret; } } -extern __inline__ unsigned int +static inline unsigned int csum_partial_copy_to_user(const char *src, char *dst, int len, unsigned int sum, int *err) { @@ -112,9 +117,12 @@ ".previous\n" "1:\n\t" "call " C_LABEL_STR(__csum_partial_copy_sparc_generic) "\n\t" - " st %5, [%%sp + 64]\n" - : "=r" (ret) : "0" (ret), "r" (d), "r" (l), "r" (s), "r" (err) : - "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "g4", "g5", "g7"); + " st %8, [%%sp + 64]\n" + : "=&r" (ret), "=&r" (d), "=&r" (l), "=&r" (s) + : "0" (ret), "1" (d), "2" (l), "3" (s), "r" (err) + : "o2", "o3", "o4", "o5", "o7", + "g2", "g3", "g4", "g5", + "cc", "memory"); return ret; } } @@ -125,8 +133,8 @@ /* ihl is always 5 or greater, almost always is 5, and iph is word aligned * the majority of the time. */ -extern __inline__ unsigned short ip_fast_csum(__const__ unsigned char *iph, - unsigned int ihl) +static inline unsigned short ip_fast_csum(const unsigned char *iph, + unsigned int ihl) { unsigned short sum; @@ -163,7 +171,7 @@ } /* Fold a partial checksum without adding pseudo headers. */ -extern __inline__ unsigned int csum_fold(unsigned int sum) +static inline unsigned int csum_fold(unsigned int sum) { unsigned int tmp; @@ -177,11 +185,11 @@ return sum; } -extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, - unsigned long daddr, - unsigned int len, - unsigned short proto, - unsigned int sum) +static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, + unsigned long daddr, + unsigned int len, + unsigned short proto, + unsigned int sum) { __asm__ __volatile__("addcc\t%1, %0, %0\n\t" "addxcc\t%2, %0, %0\n\t" @@ -209,11 +217,11 @@ #define _HAVE_ARCH_IPV6_CSUM -static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, - struct in6_addr *daddr, - __u32 len, - unsigned short proto, - unsigned int sum) +static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr, + struct in6_addr *daddr, + __u32 len, + unsigned short proto, + unsigned int sum) { __asm__ __volatile__ ( "addcc %3, %4, %%g4\n\t" @@ -244,7 +252,7 @@ } /* this routine is used for miscellaneous IP-like checksums, mainly in icmp.c */ -extern __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len) +static inline unsigned short ip_compute_csum(unsigned char * buff, int len) { return csum_fold(csum_partial(buff, len, 0)); } diff -urN linux-2.4.22-bk36/include/asm-sparc/pgtsun4.h linux-2.4.22-bk37/include/asm-sparc/pgtsun4.h --- linux-2.4.22-bk36/include/asm-sparc/pgtsun4.h 2000-06-19 17:59:39.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/pgtsun4.h 2003-10-20 02:49:37.000000000 -0700 @@ -76,7 +76,7 @@ #ifndef __ASSEMBLY__ -extern __inline__ unsigned long sun4c_get_synchronous_error(void) +static inline unsigned long sun4c_get_synchronous_error(void) { unsigned long sync_err; @@ -86,7 +86,7 @@ return sync_err; } -extern __inline__ unsigned long sun4c_get_synchronous_address(void) +static inline unsigned long sun4c_get_synchronous_address(void) { unsigned long sync_addr; @@ -97,7 +97,7 @@ } /* SUN4 pte, segmap, and context manipulation */ -extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) +static inline unsigned long sun4c_get_segmap(unsigned long addr) { register unsigned long entry; @@ -107,14 +107,15 @@ return entry; } -extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry) +static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry) { __asm__ __volatile__("\n\tstha %1, [%0] %2; nop; nop; nop;\n\t" : : "r" (addr), "r" (entry), - "i" (ASI_SEGMAP)); + "i" (ASI_SEGMAP) + : "memory"); } -extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) +static inline unsigned long sun4c_get_pte(unsigned long addr) { register unsigned long entry; @@ -124,14 +125,15 @@ return entry; } -extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry) +static inline void sun4c_put_pte(unsigned long addr, unsigned long entry) { __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : : "r" (addr), - "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)); + "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE) + : "memory"); } -extern __inline__ int sun4c_get_context(void) +static inline int sun4c_get_context(void) { register int ctx; @@ -142,10 +144,11 @@ return ctx; } -extern __inline__ int sun4c_set_context(int ctx) +static inline int sun4c_set_context(int ctx) { __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : : - "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)); + "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL) + : "memory"); return ctx; } diff -urN linux-2.4.22-bk36/include/asm-sparc/pgtsun4c.h linux-2.4.22-bk37/include/asm-sparc/pgtsun4c.h --- linux-2.4.22-bk36/include/asm-sparc/pgtsun4c.h 2000-06-19 17:59:39.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/pgtsun4c.h 2003-10-20 02:49:37.000000000 -0700 @@ -75,7 +75,7 @@ #ifndef __ASSEMBLY__ -extern __inline__ unsigned long sun4c_get_synchronous_error(void) +static inline unsigned long sun4c_get_synchronous_error(void) { unsigned long sync_err; @@ -85,7 +85,7 @@ return sync_err; } -extern __inline__ unsigned long sun4c_get_synchronous_address(void) +static inline unsigned long sun4c_get_synchronous_address(void) { unsigned long sync_addr; @@ -96,7 +96,7 @@ } /* SUN4C pte, segmap, and context manipulation */ -extern __inline__ unsigned long sun4c_get_segmap(unsigned long addr) +static inline unsigned long sun4c_get_segmap(unsigned long addr) { register unsigned long entry; @@ -107,15 +107,16 @@ return entry; } -extern __inline__ void sun4c_put_segmap(unsigned long addr, unsigned long entry) +static inline void sun4c_put_segmap(unsigned long addr, unsigned long entry) { __asm__ __volatile__("\n\tstba %1, [%0] %2; nop; nop; nop;\n\t" : : "r" (addr), "r" (entry), - "i" (ASI_SEGMAP)); + "i" (ASI_SEGMAP) + : "memory"); } -extern __inline__ unsigned long sun4c_get_pte(unsigned long addr) +static inline unsigned long sun4c_get_pte(unsigned long addr) { register unsigned long entry; @@ -125,14 +126,15 @@ return entry; } -extern __inline__ void sun4c_put_pte(unsigned long addr, unsigned long entry) +static inline void sun4c_put_pte(unsigned long addr, unsigned long entry) { __asm__ __volatile__("\n\tsta %1, [%0] %2; nop; nop; nop;\n\t" : : "r" (addr), - "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE)); + "r" ((entry & ~(_SUN4C_PAGE_PRESENT))), "i" (ASI_PTE) + : "memory"); } -extern __inline__ int sun4c_get_context(void) +static inline int sun4c_get_context(void) { register int ctx; @@ -143,10 +145,11 @@ return ctx; } -extern __inline__ int sun4c_set_context(int ctx) +static inline int sun4c_set_context(int ctx) { __asm__ __volatile__("\n\tstba %0, [%1] %2; nop; nop; nop;\n\t" : : - "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL)); + "r" (ctx), "r" (AC_CONTEXT), "i" (ASI_CONTROL) + : "memory"); return ctx; } diff -urN linux-2.4.22-bk36/include/asm-sparc/processor.h linux-2.4.22-bk37/include/asm-sparc/processor.h --- linux-2.4.22-bk36/include/asm-sparc/processor.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/processor.h 2003-10-20 02:49:37.000000000 -0700 @@ -140,8 +140,12 @@ "std\t%%g0, [%0 + %3 + 0x30]\n\t" "st\t%1, [%0 + %3 + 0x38]\n\t" "st\t%%g0, [%0 + %3 + 0x3c]" - : : "r" (regs), "r" (sp - sizeof(struct reg_window)), "r" (zero), - "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))); + : /* no outputs */ + : "r" (regs), + "r" (sp - sizeof(struct reg_window)), + "r" (zero), + "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])) + : "memory"); } /* Free all resources held by a thread. */ diff -urN linux-2.4.22-bk36/include/asm-sparc/ross.h linux-2.4.22-bk37/include/asm-sparc/ross.h --- linux-2.4.22-bk36/include/asm-sparc/ross.h 1998-01-12 15:15:54.000000000 -0800 +++ linux-2.4.22-bk37/include/asm-sparc/ross.h 2003-10-20 02:49:37.000000000 -0700 @@ -96,27 +96,29 @@ #ifndef __ASSEMBLY__ -extern __inline__ unsigned int get_ross_icr(void) +static inline unsigned int get_ross_icr(void) { unsigned int icreg; __asm__ __volatile__(".word 0x8347c000\n\t" /* rd %iccr, %g1 */ - "mov %%g1, %0\n\t" : - "=r" (icreg) : : - "g1", "memory"); + "mov %%g1, %0\n\t" + : "=r" (icreg) + : /* no inputs */ + : "g1", "memory"); return icreg; } -extern __inline__ void put_ross_icr(unsigned int icreg) +static inline void put_ross_icr(unsigned int icreg) { __asm__ __volatile__("or %%g0, %0, %%g1\n\t" ".word 0xbf806000\n\t" /* wr %g1, 0x0, %iccr */ "nop\n\t" "nop\n\t" - "nop\n\t" : : - "r" (icreg) : - "g1", "memory"); + "nop\n\t" + : /* no outputs */ + : "r" (icreg) + : "g1", "memory"); return; } @@ -124,52 +126,62 @@ /* HyperSparc specific cache flushing. */ /* This is for the on-chip instruction cache. */ -extern __inline__ void hyper_flush_whole_icache(void) +static inline void hyper_flush_whole_icache(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_FLUSH_IWHOLE)); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_FLUSH_IWHOLE) + : "memory"); return; } extern int vac_cache_size; extern int vac_line_size; -extern __inline__ void hyper_clear_all_tags(void) +static inline void hyper_clear_all_tags(void) { unsigned long addr; for(addr = 0; addr < vac_cache_size; addr += vac_line_size) - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_DATAC_TAG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_DATAC_TAG) + : "memory"); } -extern __inline__ void hyper_flush_unconditional_combined(void) +static inline void hyper_flush_unconditional_combined(void) { unsigned long addr; - for(addr = 0; addr < vac_cache_size; addr += vac_line_size) - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_FLUSH_CTX)); + for (addr = 0; addr < vac_cache_size; addr += vac_line_size) + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_FLUSH_CTX) + : "memory"); } -extern __inline__ void hyper_flush_cache_user(void) +static inline void hyper_flush_cache_user(void) { unsigned long addr; - for(addr = 0; addr < vac_cache_size; addr += vac_line_size) - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_FLUSH_USER)); + for (addr = 0; addr < vac_cache_size; addr += vac_line_size) + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_FLUSH_USER) + : "memory"); } -extern __inline__ void hyper_flush_cache_page(unsigned long page) +static inline void hyper_flush_cache_page(unsigned long page) { unsigned long end; page &= PAGE_MASK; end = page + PAGE_SIZE; - while(page < end) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (page), "i" (ASI_M_FLUSH_PAGE)); + while (page < end) { + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (page), "i" (ASI_M_FLUSH_PAGE) + : "memory"); page += vac_line_size; } } diff -urN linux-2.4.22-bk36/include/asm-sparc/swift.h linux-2.4.22-bk37/include/asm-sparc/swift.h --- linux-2.4.22-bk36/include/asm-sparc/swift.h 1996-11-09 00:30:13.000000000 -0800 +++ linux-2.4.22-bk37/include/asm-sparc/swift.h 2003-10-20 02:49:37.000000000 -0700 @@ -27,68 +27,80 @@ #define SWIFT_EN 0x00000001 /* MMU enable */ /* Bits [13:5] select one of 512 instruction cache tags */ -extern __inline__ void swift_inv_insn_tag(unsigned long addr) +static inline void swift_inv_insn_tag(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_TXTC_TAG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_TXTC_TAG) + : "memory"); } /* Bits [12:4] select one of 512 data cache tags */ -extern __inline__ void swift_inv_data_tag(unsigned long addr) +static inline void swift_inv_data_tag(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_DATAC_TAG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_DATAC_TAG) + : "memory"); } -extern __inline__ void swift_flush_dcache(void) +static inline void swift_flush_dcache(void) { unsigned long addr; - for(addr = 0; addr < 0x2000; addr += 0x10) + for (addr = 0; addr < 0x2000; addr += 0x10) swift_inv_data_tag(addr); } -extern __inline__ void swift_flush_icache(void) +static inline void swift_flush_icache(void) { unsigned long addr; - for(addr = 0; addr < 0x4000; addr += 0x20) + for (addr = 0; addr < 0x4000; addr += 0x20) swift_inv_insn_tag(addr); } -extern __inline__ void swift_idflash_clear(void) +static inline void swift_idflash_clear(void) { unsigned long addr; - for(addr = 0; addr < 0x2000; addr += 0x10) { + for (addr = 0; addr < 0x2000; addr += 0x10) { swift_inv_insn_tag(addr<<1); swift_inv_data_tag(addr); } } /* Swift is so broken, it isn't even safe to use the following. */ -extern __inline__ void swift_flush_page(unsigned long page) +static inline void swift_flush_page(unsigned long page) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (page), "i" (ASI_M_FLUSH_PAGE)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (page), "i" (ASI_M_FLUSH_PAGE) + : "memory"); } -extern __inline__ void swift_flush_segment(unsigned long addr) +static inline void swift_flush_segment(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_FLUSH_SEG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_FLUSH_SEG) + : "memory"); } -extern __inline__ void swift_flush_region(unsigned long addr) +static inline void swift_flush_region(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_FLUSH_REGION)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_FLUSH_REGION) + : "memory"); } -extern __inline__ void swift_flush_context(void) +static inline void swift_flush_context(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_FLUSH_CTX)); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_FLUSH_CTX) + : "memory"); } #endif /* !(_SPARC_SWIFT_H) */ diff -urN linux-2.4.22-bk36/include/asm-sparc/system.h linux-2.4.22-bk37/include/asm-sparc/system.h --- linux-2.4.22-bk36/include/asm-sparc/system.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/system.h 2003-10-20 02:49:37.000000000 -0700 @@ -217,7 +217,7 @@ "wr %0, %2, %%psr\n\t" "nop; nop; nop;\n" "1:\n" - : "=r" (retval) + : "=&r" (retval) : "r" (__new_psr), "i" (PSR_PIL) : "g1", "g2", "memory", "cc"); @@ -315,7 +315,8 @@ #ifdef CONFIG_SMP __asm__ __volatile__("swap [%2], %0" : "=&r" (val) - : "0" (val), "r" (m)); + : "0" (val), "r" (m) + : "memory"); return val; #else register unsigned long *ptr asm("g1"); diff -urN linux-2.4.22-bk36/include/asm-sparc/tsunami.h linux-2.4.22-bk37/include/asm-sparc/tsunami.h --- linux-2.4.22-bk36/include/asm-sparc/tsunami.h 1996-11-09 00:30:19.000000000 -0800 +++ linux-2.4.22-bk37/include/asm-sparc/tsunami.h 2003-10-20 02:49:37.000000000 -0700 @@ -45,16 +45,20 @@ #define TSUNAMI_NF 0x00000002 #define TSUNAMI_ME 0x00000001 -extern __inline__ void tsunami_flush_icache(void) +static inline void tsunami_flush_icache(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_IC_FLCLEAR) : "memory"); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_IC_FLCLEAR) + : "memory"); } -extern __inline__ void tsunami_flush_dcache(void) +static inline void tsunami_flush_dcache(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_DC_FLCLEAR) : "memory"); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_DC_FLCLEAR) + : "memory"); } #endif /* !(_SPARC_TSUNAMI_H) */ diff -urN linux-2.4.22-bk36/include/asm-sparc/turbosparc.h linux-2.4.22-bk37/include/asm-sparc/turbosparc.h --- linux-2.4.22-bk36/include/asm-sparc/turbosparc.h 1998-10-04 10:22:44.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/turbosparc.h 2003-10-20 02:49:37.000000000 -0700 @@ -59,60 +59,64 @@ #ifndef __ASSEMBLY__ /* Bits [13:5] select one of 512 instruction cache tags */ -extern __inline__ void turbosparc_inv_insn_tag(unsigned long addr) +static inline void turbosparc_inv_insn_tag(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_TXTC_TAG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_TXTC_TAG) + : "memory"); } /* Bits [13:5] select one of 512 data cache tags */ -extern __inline__ void turbosparc_inv_data_tag(unsigned long addr) +static inline void turbosparc_inv_data_tag(unsigned long addr) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (addr), "i" (ASI_M_DATAC_TAG)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (addr), "i" (ASI_M_DATAC_TAG) + : "memory"); } -extern __inline__ void turbosparc_flush_icache(void) +static inline void turbosparc_flush_icache(void) { unsigned long addr; - for(addr = 0; addr < 0x4000; addr += 0x20) + for (addr = 0; addr < 0x4000; addr += 0x20) turbosparc_inv_insn_tag(addr); } -extern __inline__ void turbosparc_flush_dcache(void) +static inline void turbosparc_flush_dcache(void) { unsigned long addr; - for(addr = 0; addr < 0x4000; addr += 0x20) + for (addr = 0; addr < 0x4000; addr += 0x20) turbosparc_inv_data_tag(addr); } -extern __inline__ void turbosparc_idflash_clear(void) +static inline void turbosparc_idflash_clear(void) { unsigned long addr; - for(addr = 0; addr < 0x4000; addr += 0x20) { + for (addr = 0; addr < 0x4000; addr += 0x20) { turbosparc_inv_insn_tag(addr); turbosparc_inv_data_tag(addr); } } -extern __inline__ void turbosparc_set_ccreg(unsigned long regval) +static inline void turbosparc_set_ccreg(unsigned long regval) { - __asm__ __volatile__("sta %0, [%1] %2\n\t" : : - "r" (regval), "r" (0x600), - "i" (ASI_M_MMUREGS)); + __asm__ __volatile__("sta %0, [%1] %2\n\t" + : /* no outputs */ + : "r" (regval), "r" (0x600), "i" (ASI_M_MMUREGS) + : "memory"); } -extern __inline__ unsigned long turbosparc_get_ccreg(void) +static inline unsigned long turbosparc_get_ccreg(void) { unsigned long regval; - __asm__ __volatile__("lda [%1] %2, %0\n\t" : - "=r" (regval) : - "r" (0x600), - "i" (ASI_M_MMUREGS)); + __asm__ __volatile__("lda [%1] %2, %0\n\t" + : "=r" (regval) + : "r" (0x600), "i" (ASI_M_MMUREGS)); return regval; } diff -urN linux-2.4.22-bk36/include/asm-sparc/vac-ops.h linux-2.4.22-bk37/include/asm-sparc/vac-ops.h --- linux-2.4.22-bk36/include/asm-sparc/vac-ops.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/vac-ops.h 2003-10-20 02:49:37.000000000 -0700 @@ -108,27 +108,29 @@ extern struct sun4c_vac_props sun4c_vacinfo; /* sun4c_enable_vac() enables the sun4c virtual address cache. */ -extern __inline__ void sun4c_enable_vac(void) +static inline void sun4c_enable_vac(void) { - __asm__ __volatile__("lduba [%0] %1, %%g1\n\t" - "or %%g1, %2, %%g1\n\t" - "stba %%g1, [%0] %1\n\t" : : - "r" ((unsigned int) AC_SENABLE), - "i" (ASI_CONTROL), "i" (SENABLE_CACHE) : - "g1"); - sun4c_vacinfo.on = 1; + __asm__ __volatile__("lduba [%0] %1, %%g1\n\t" + "or %%g1, %2, %%g1\n\t" + "stba %%g1, [%0] %1\n\t" + : /* no outputs */ + : "r" ((unsigned int) AC_SENABLE), + "i" (ASI_CONTROL), "i" (SENABLE_CACHE) + : "g1", "memory"); + sun4c_vacinfo.on = 1; } /* sun4c_disable_vac() disables the virtual address cache. */ -extern __inline__ void sun4c_disable_vac(void) +static inline void sun4c_disable_vac(void) { - __asm__ __volatile__("lduba [%0] %1, %%g1\n\t" - "andn %%g1, %2, %%g1\n\t" - "stba %%g1, [%0] %1\n\t" : : - "r" ((unsigned int) AC_SENABLE), - "i" (ASI_CONTROL), "i" (SENABLE_CACHE) : - "g1"); - sun4c_vacinfo.on = 0; + __asm__ __volatile__("lduba [%0] %1, %%g1\n\t" + "andn %%g1, %2, %%g1\n\t" + "stba %%g1, [%0] %1\n\t" + : /* no outputs */ + : "r" ((unsigned int) AC_SENABLE), + "i" (ASI_CONTROL), "i" (SENABLE_CACHE) + : "g1", "memory"); + sun4c_vacinfo.on = 0; } #endif /* !(_SPARC_VAC_OPS_H) */ diff -urN linux-2.4.22-bk36/include/asm-sparc/viking.h linux-2.4.22-bk37/include/asm-sparc/viking.h --- linux-2.4.22-bk36/include/asm-sparc/viking.h 1997-04-23 19:01:28.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc/viking.h 2003-10-20 02:49:37.000000000 -0700 @@ -110,48 +110,57 @@ #ifndef __ASSEMBLY__ -extern __inline__ void viking_flush_icache(void) +static inline void viking_flush_icache(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_IC_FLCLEAR)); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_IC_FLCLEAR) + : "memory"); } -extern __inline__ void viking_flush_dcache(void) +static inline void viking_flush_dcache(void) { - __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : : - "i" (ASI_M_DC_FLCLEAR)); + __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" + : /* no outputs */ + : "i" (ASI_M_DC_FLCLEAR) + : "memory"); } -extern __inline__ void viking_unlock_icache(void) +static inline void viking_unlock_icache(void) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (0x80000000), "i" (ASI_M_IC_FLCLEAR)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (0x80000000), "i" (ASI_M_IC_FLCLEAR) + : "memory"); } -extern __inline__ void viking_unlock_dcache(void) +static inline void viking_unlock_dcache(void) { - __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : : - "r" (0x80000000), "i" (ASI_M_DC_FLCLEAR)); + __asm__ __volatile__("sta %%g0, [%0] %1\n\t" + : /* no outputs */ + : "r" (0x80000000), "i" (ASI_M_DC_FLCLEAR) + : "memory"); } -extern __inline__ void viking_set_bpreg(unsigned long regval) +static inline void viking_set_bpreg(unsigned long regval) { - __asm__ __volatile__("sta %0, [%%g0] %1\n\t" : : - "r" (regval), - "i" (ASI_M_ACTION)); + __asm__ __volatile__("sta %0, [%%g0] %1\n\t" + : /* no outputs */ + : "r" (regval), "i" (ASI_M_ACTION) + : "memory"); } -extern __inline__ unsigned long viking_get_bpreg(void) +static inline unsigned long viking_get_bpreg(void) { unsigned long regval; - __asm__ __volatile__("lda [%%g0] %1, %0\n\t" : - "=r" (regval) : - "i" (ASI_M_ACTION)); + __asm__ __volatile__("lda [%%g0] %1, %0\n\t" + : "=r" (regval) + : "i" (ASI_M_ACTION)); return regval; } -extern __inline__ void viking_get_dcache_ptag(int set, int block, +static inline void viking_get_dcache_ptag(int set, int block, unsigned long *data) { unsigned long ptag = ((set & 0x7f) << 5) | ((block & 0x3) << 26) | @@ -160,15 +169,15 @@ __asm__ __volatile__ ("ldda [%2] %3, %%g2\n\t" "or %%g0, %%g2, %0\n\t" - "or %%g0, %%g3, %1\n\t" : - "=r" (info), "=r" (page) : - "r" (ptag), "i" (ASI_M_DATAC_TAG) : - "g2", "g3"); + "or %%g0, %%g3, %1\n\t" + : "=r" (info), "=r" (page) + : "r" (ptag), "i" (ASI_M_DATAC_TAG) + : "g2", "g3"); data[0] = info; data[1] = page; } -extern __inline__ void viking_mxcc_turn_off_parity(unsigned long *mregp, +static inline void viking_mxcc_turn_off_parity(unsigned long *mregp, unsigned long *mxcc_cregp) { unsigned long mreg = *mregp; @@ -190,30 +199,32 @@ "2:\n\t" "sta %0, [%%g0] %3\n\t" "sta %1, [%2] %4\n" - "1:\n\t" : : - "r" (mreg), "r" (mxcc_creg), - "r" (MXCC_CREG), "i" (ASI_M_MMUREGS), - "i" (ASI_M_MXCC) : "g2", "cc"); + "1:\n\t" + : /* no output */ + : "r" (mreg), "r" (mxcc_creg), + "r" (MXCC_CREG), "i" (ASI_M_MMUREGS), + "i" (ASI_M_MXCC) + : "g2", "memory", "cc"); *mregp = mreg; *mxcc_cregp = mxcc_creg; } -extern __inline__ unsigned long viking_hwprobe(unsigned long vaddr) +static inline unsigned long viking_hwprobe(unsigned long vaddr) { unsigned long val; vaddr &= PAGE_MASK; /* Probe all MMU entries. */ - __asm__ __volatile__("lda [%1] %2, %0\n\t" : - "=r" (val) : - "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); + __asm__ __volatile__("lda [%1] %2, %0\n\t" + : "=r" (val) + : "r" (vaddr | 0x400), "i" (ASI_M_FLUSH_PROBE)); if (!val) return 0; /* Probe region. */ - __asm__ __volatile__("lda [%1] %2, %0\n\t" : - "=r" (val) : - "r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE)); + __asm__ __volatile__("lda [%1] %2, %0\n\t" + : "=r" (val) + : "r" (vaddr | 0x200), "i" (ASI_M_FLUSH_PROBE)); if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) { vaddr &= ~SRMMU_PGDIR_MASK; vaddr >>= PAGE_SHIFT; @@ -221,9 +232,9 @@ } /* Probe segment. */ - __asm__ __volatile__("lda [%1] %2, %0\n\t" : - "=r" (val) : - "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE)); + __asm__ __volatile__("lda [%1] %2, %0\n\t" + : "=r" (val) + : "r" (vaddr | 0x100), "i" (ASI_M_FLUSH_PROBE)); if ((val & SRMMU_ET_MASK) == SRMMU_ET_PTE) { vaddr &= ~SRMMU_PMD_MASK; vaddr >>= PAGE_SHIFT; @@ -231,9 +242,9 @@ } /* Probe page. */ - __asm__ __volatile__("lda [%1] %2, %0\n\t" : - "=r" (val) : - "r" (vaddr), "i" (ASI_M_FLUSH_PROBE)); + __asm__ __volatile__("lda [%1] %2, %0\n\t" + : "=r" (val) + : "r" (vaddr), "i" (ASI_M_FLUSH_PROBE)); return val; } diff -urN linux-2.4.22-bk36/include/asm-sparc64/processor.h linux-2.4.22-bk37/include/asm-sparc64/processor.h --- linux-2.4.22-bk36/include/asm-sparc64/processor.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc64/processor.h 2003-10-20 02:49:37.000000000 -0700 @@ -109,6 +109,7 @@ #define SPARC_FLAG_NEWCHILD 0x08 /* task is just-spawned child process */ #define SPARC_FLAG_PERFCTR 0x10 /* task has performance counters active */ #define SPARC_FLAG_ABI_PENDING 0x20 /* change of SPARC_FLAG_32BIT pending */ +#define SPARC_FLAG_SYS_SUCCESS 0x40 /* Force successful syscall return. */ #define FAULT_CODE_WRITE 0x01 /* Write access, implies D-TLB */ #define FAULT_CODE_DTLB 0x02 /* Miss happened in D-TLB */ diff -urN linux-2.4.22-bk36/include/asm-sparc64/ptrace.h linux-2.4.22-bk37/include/asm-sparc64/ptrace.h --- linux-2.4.22-bk36/include/asm-sparc64/ptrace.h 2003-06-13 07:51:38.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc64/ptrace.h 2003-10-20 02:49:37.000000000 -0700 @@ -97,6 +97,10 @@ #define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) #define instruction_pointer(regs) ((regs)->tpc) extern void show_regs(struct pt_regs *); +#define force_successful_syscall_return() \ +do { \ + current->thread.flags |= SPARC_FLAG_SYS_SUCCESS; \ +} while (0) #endif #else /* __ASSEMBLY__ */ diff -urN linux-2.4.22-bk36/include/asm-sparc64/visasm.h linux-2.4.22-bk37/include/asm-sparc64/visasm.h --- linux-2.4.22-bk36/include/asm-sparc64/visasm.h 2001-04-26 22:17:26.000000000 -0700 +++ linux-2.4.22-bk37/include/asm-sparc64/visasm.h 2003-10-20 02:49:37.000000000 -0700 @@ -19,7 +19,8 @@ andcc %o5, (FPRS_FEF|FPRS_DU), %g0; \ be,pt %icc, 297f; \ sethi %hi(297f), %g7; \ - ba,pt %xcc, VISenter; \ + sethi %hi(VISenter), %g1; \ + jmpl %g1 + %lo(VISenter), %g0; \ or %g7, %lo(297f), %g7; \ 297: wr %g0, FPRS_FEF, %fprs; \ @@ -34,7 +35,8 @@ andcc %o5, FPRS_FEF, %g0; \ be,pt %icc, 297f; \ sethi %hi(298f), %g7; \ - ba,pt %xcc, VISenterhalf; \ + sethi %hi(VISenterhalf), %g1; \ + jmpl %g1 + %lo(VISenterhalf), %g0; \ or %g7, %lo(298f), %g7; \ clr %o5; \ 297: wr %o5, FPRS_FEF, %fprs; \ @@ -50,7 +52,8 @@ " andcc %%o5, %0, %%g0\n" " be,pt %%icc, 299f\n" " sethi %%hi(298f), %%g7\n" -" ba VISenter ! Note. This cannot be bp, as it may be too far from VISenter.\n" +" sethi %%hi(VISenter), %%g1\n" +" jmpl %%g1 + %%lo(VISenter), %%g0\n" " or %%g7, %%lo(298f), %%g7\n" " 298: wr %%g0, 0, %%fprs\n" " 299:\n" diff -urN linux-2.4.22-bk36/include/linux/atmdev.h linux-2.4.22-bk37/include/linux/atmdev.h --- linux-2.4.22-bk36/include/linux/atmdev.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/include/linux/atmdev.h 2003-10-20 02:49:37.000000000 -0700 @@ -296,15 +296,11 @@ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ wait_queue_head_t sleep; /* if socket is busy */ struct sock *sk; /* socket backpointer */ - struct atm_vcc *prev,*next; /* SVC part --- may move later ------------------------------------- */ short itf; /* interface number */ struct sockaddr_atmsvc local; struct sockaddr_atmsvc remote; void (*callback)(struct atm_vcc *vcc); - struct sk_buff_head listenq; - int backlog_quota; /* number of connection requests we */ - /* can still accept */ int reply; /* also used by ATMTCP */ /* Multipoint part ------------------------------------------------- */ struct atm_vcc *session; /* session VCC descriptor */ @@ -330,8 +326,6 @@ /* (NULL) */ const char *type; /* device type name */ int number; /* device index */ - struct atm_vcc *vccs; /* VCC table (or NULL) */ - struct atm_vcc *last; /* last VCC (or undefined) */ void *dev_data; /* per-device data */ void *phy_data; /* private PHY date */ atm_dev_flags_t flags; /* device flags (ATM_DF_*) */ @@ -400,6 +394,9 @@ unsigned long atm_options; /* ATM layer options */ }; +extern struct sock *vcc_sklist; +extern rwlock_t vcc_sklist_lock; + #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, @@ -407,7 +404,8 @@ struct atm_dev *atm_dev_lookup(int number); void atm_dev_deregister(struct atm_dev *dev); void shutdown_atm_dev(struct atm_dev *dev); -void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev); +void vcc_insert_socket(struct sock *sk); +void vcc_remove_socket(struct sock *sk); /* @@ -445,7 +443,7 @@ } -static inline void atm_dev_release(struct atm_dev *dev) +static inline void atm_dev_put(struct atm_dev *dev) { atomic_dec(&dev->refcnt); @@ -461,7 +459,7 @@ int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci); int atm_pcr_goal(struct atm_trafprm *tp); -void atm_async_release_vcc(struct atm_vcc *vcc,int reply); +void vcc_release_async(struct atm_vcc *vcc, int reply); #endif /* __KERNEL__ */ diff -urN linux-2.4.22-bk36/net/atm/atm_misc.c linux-2.4.22-bk37/net/atm/atm_misc.c --- linux-2.4.22-bk36/net/atm/atm_misc.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/atm_misc.c 2003-10-20 02:49:38.000000000 -0700 @@ -45,15 +45,20 @@ static int check_ci(struct atm_vcc *vcc,short vpi,int vci) { + struct sock *s; struct atm_vcc *walk; - for (walk = vcc->dev->vccs; walk; walk = walk->next) + for (s = vcc_sklist; s; s = s->next) { + walk = s->protinfo.af_atm; + if (walk->dev != vcc->dev) + continue; if (test_bit(ATM_VF_ADDR,&walk->flags) && walk->vpi == vpi && walk->vci == vci && ((walk->qos.txtp.traffic_class != ATM_NONE && vcc->qos.txtp.traffic_class != ATM_NONE) || (walk->qos.rxtp.traffic_class != ATM_NONE && vcc->qos.rxtp.traffic_class != ATM_NONE))) return -EADDRINUSE; + } /* allow VCCs with same VPI/VCI iff they don't collide on TX/RX (but we may refuse such sharing for other reasons, e.g. if protocol requires to have both channels) */ @@ -63,17 +68,16 @@ int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci) { - unsigned long flags; static short p = 0; /* poor man's per-device cache */ static int c = 0; short old_p; int old_c; int err; - spin_lock_irqsave(&vcc->dev->lock, flags); + read_lock(&vcc_sklist_lock); if (*vpi != ATM_VPI_ANY && *vci != ATM_VCI_ANY) { err = check_ci(vcc,*vpi,*vci); - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return err; } /* last scan may have left values out of bounds for current device */ @@ -88,7 +92,7 @@ if (!check_ci(vcc,p,c)) { *vpi = p; *vci = c; - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return 0; } if (*vci == ATM_VCI_ANY) { @@ -103,7 +107,7 @@ } } while (old_p != p || old_c != c); - spin_unlock_irqrestore(&vcc->dev->lock, flags); + read_unlock(&vcc_sklist_lock); return -EADDRINUSE; } diff -urN linux-2.4.22-bk36/net/atm/clip.c linux-2.4.22-bk37/net/atm/clip.c --- linux-2.4.22-bk36/net/atm/clip.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/clip.c 2003-10-20 02:49:38.000000000 -0700 @@ -144,8 +144,8 @@ DPRINTK("releasing vcc %p->%p of " "entry %p\n",clip_vcc,clip_vcc->vcc, entry); - atm_async_release_vcc(clip_vcc->vcc, - -ETIMEDOUT); + vcc_release_async(clip_vcc->vcc, + -ETIMEDOUT); } if (entry->vccs || time_before(jiffies, entry->expires)) { @@ -740,7 +740,8 @@ set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); /* allow replies and avoid getting closed if signaling dies */ - bind_vcc(vcc,&atmarpd_dev); + vcc->dev = &atmarpd_dev; + vcc_insert_socket(vcc->sk); vcc->push = NULL; vcc->pop = NULL; /* crash */ vcc->push_oam = NULL; /* crash */ diff -urN linux-2.4.22-bk36/net/atm/common.c linux-2.4.22-bk37/net/atm/common.c --- linux-2.4.22-bk36/net/atm/common.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/common.c 2003-10-20 02:49:38.000000000 -0700 @@ -178,6 +178,38 @@ #endif +struct sock *vcc_sklist; +rwlock_t vcc_sklist_lock = RW_LOCK_UNLOCKED; + +void __vcc_insert_socket(struct sock *sk) +{ + sk->next = vcc_sklist; + if (sk->next) + vcc_sklist->pprev = &sk->next; + vcc_sklist = sk; + sk->pprev = &vcc_sklist; +} + +void vcc_insert_socket(struct sock *sk) +{ + write_lock_irq(&vcc_sklist_lock); + __vcc_insert_socket(sk); + write_unlock_irq(&vcc_sklist_lock); +} + +void vcc_remove_socket(struct sock *sk) +{ + write_lock_irq(&vcc_sklist_lock); + if (sk->pprev) { + if (sk->next) + sk->next->pprev = sk->pprev; + *sk->pprev = sk->next; + sk->pprev = NULL; + } + write_unlock_irq(&vcc_sklist_lock); +} + + static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size) { struct sk_buff *skb; @@ -194,16 +226,46 @@ } -int atm_create(struct socket *sock,int protocol,int family) +EXPORT_SYMBOL(vcc_sklist); +EXPORT_SYMBOL(vcc_sklist_lock); +EXPORT_SYMBOL(vcc_insert_socket); +EXPORT_SYMBOL(vcc_remove_socket); + +static void vcc_sock_destruct(struct sock *sk) { + struct atm_vcc *vcc = sk->protinfo.af_atm; + + if (atomic_read(&vcc->sk->rmem_alloc)) + printk(KERN_DEBUG "vcc_sock_destruct: rmem leakage (%d bytes) detected.\n", atomic_read(&sk->rmem_alloc)); + + if (atomic_read(&vcc->sk->wmem_alloc)) + printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) detected.\n", atomic_read(&sk->wmem_alloc)); + + kfree(sk->protinfo.af_atm); +} + +int vcc_create(struct socket *sock, int protocol, int family) +{ struct sock *sk; struct atm_vcc *vcc; sock->sk = NULL; - if (sock->type == SOCK_STREAM) return -EINVAL; - if (!(sk = alloc_atm_vcc_sk(family))) return -ENOMEM; - vcc = sk->protinfo.af_atm; - memset(&vcc->flags,0,sizeof(vcc->flags)); + if (sock->type == SOCK_STREAM) + return -EINVAL; + sk = sk_alloc(family, GFP_KERNEL, 1); + if (!sk) + return -ENOMEM; + sock_init_data(NULL, sk); + + vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL); + if (!vcc) { + sk_free(sk); + return -ENOMEM; + } + + memset(vcc, 0, sizeof(*vcc)); + vcc->sk = sk; + vcc->dev = NULL; vcc->callback = NULL; memset(&vcc->local,0,sizeof(struct sockaddr_atmsvc)); @@ -217,23 +279,28 @@ vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->atm_options = vcc->aal_options = 0; init_waitqueue_head(&vcc->sleep); - skb_queue_head_init(&vcc->listenq); sk->sleep = &vcc->sleep; + sk->destruct = vcc_sock_destruct; sock->sk = sk; return 0; } -void atm_release_vcc_sk(struct sock *sk,int free_sk) +static void vcc_destroy_socket(struct sock *sk) { struct atm_vcc *vcc; struct sk_buff *skb; vcc = sk->protinfo.af_atm; - clear_bit(ATM_VF_READY,&vcc->flags); + clear_bit(ATM_VF_READY, &vcc->flags); if (vcc->dev) { - if (vcc->dev->ops->close) vcc->dev->ops->close(vcc); - if (vcc->push) vcc->push(vcc,NULL); /* atmarpd has no push */ + if (vcc->dev->ops->close) + vcc->dev->ops->close(vcc); + if (vcc->push) + vcc->push(vcc, NULL); /* atmarpd has no push */ + + vcc_remove_socket(sk); /* no more receive */ + while ((skb = skb_dequeue(&vcc->sk->receive_queue))) { atm_return(vcc,skb->truesize); kfree_skb(skb); @@ -241,35 +308,36 @@ if (vcc->dev->ops->owner) __MOD_DEC_USE_COUNT(vcc->dev->ops->owner); - atm_dev_release(vcc->dev); - if (atomic_read(&vcc->sk->rmem_alloc)) - printk(KERN_WARNING "atm_release_vcc: strange ... " - "rmem_alloc == %d after closing\n", - atomic_read(&vcc->sk->rmem_alloc)); - bind_vcc(vcc,NULL); + atm_dev_put(vcc->dev); } - - if (free_sk) free_atm_vcc_sk(sk); } -int atm_release(struct socket *sock) +int vcc_release(struct socket *sock) { - if (sock->sk) - atm_release_vcc_sk(sock->sk,1); + struct sock *sk = sock->sk; + + if (sk) { + lock_sock(sk); + vcc_destroy_socket(sock->sk); + release_sock(sk); + sock_put(sk); + } + return 0; } -void atm_async_release_vcc(struct atm_vcc *vcc,int reply) +void vcc_release_async(struct atm_vcc *vcc, int reply) { - set_bit(ATM_VF_CLOSE,&vcc->flags); + set_bit(ATM_VF_CLOSE, &vcc->flags); vcc->reply = reply; + vcc->sk->err = -reply; wake_up(&vcc->sleep); } -EXPORT_SYMBOL(atm_async_release_vcc); +EXPORT_SYMBOL(vcc_release_async); static int adjust_tp(struct atm_trafprm *tp,unsigned char aal) @@ -298,8 +366,8 @@ } -static int atm_do_connect_dev(struct atm_vcc *vcc,struct atm_dev *dev,int vpi, - int vci) +static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, int vpi, + int vci) { int error; @@ -310,7 +378,10 @@ if (vci > 0 && vci < ATM_NOT_RSV_VCI && !capable(CAP_NET_BIND_SERVICE)) return -EPERM; error = 0; - bind_vcc(vcc,dev); + if (!try_inc_mod_count(dev->ops->owner)) + return -ENODEV; + vcc->dev = dev; + vcc_insert_socket(vcc->sk); switch (vcc->qos.aal) { case ATM_AAL0: error = atm_init_aal0(vcc); @@ -333,53 +404,50 @@ } if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->qos.aal); if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); - if (error) { - bind_vcc(vcc,NULL); - return error; - } + if (error) + goto fail; DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); - if (!try_inc_mod_count(dev->ops->owner)) - return -ENODEV; if (dev->ops->open) { - error = dev->ops->open(vcc,vpi,vci); - if (error) { - if (dev->ops->owner) - __MOD_DEC_USE_COUNT(dev->ops->owner); - bind_vcc(vcc,NULL); - return error; - } + if ((error = dev->ops->open(vcc,vpi,vci))) + goto fail; } return 0; + +fail: + vcc_remove_socket(vcc->sk); + if (dev->ops->owner) + __MOD_DEC_USE_COUNT(dev->ops->owner); + /* ensure we get dev module ref count correct */ + vcc->dev = NULL; + return error; + } -static int atm_do_connect(struct atm_vcc *vcc,int itf,int vpi,int vci) +int vcc_connect(struct socket *sock, int itf, short vpi, int vci) { struct atm_dev *dev; - int return_val; - - dev = atm_dev_lookup(itf); - if (!dev) - return_val = -ENODEV; - else { - return_val = atm_do_connect_dev(vcc,dev,vpi,vci); - if (return_val) atm_dev_release(dev); - } - - return return_val; -} + struct atm_vcc *vcc = ATM_SD(sock); + int error; + DPRINTK("vcc_connect (vpi %d, vci %d)\n",vpi,vci); + if (sock->state == SS_CONNECTED) + return -EISCONN; + if (sock->state != SS_UNCONNECTED) + return -EINVAL; + if (!(vpi || vci)) + return -EINVAL; -int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci) -{ if (vpi != ATM_VPI_UNSPEC && vci != ATM_VCI_UNSPEC) clear_bit(ATM_VF_PARTIAL,&vcc->flags); - else if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) return -EINVAL; - DPRINTK("atm_connect (TX: cl %d,bw %d-%d,sdu %d; " + else + if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) + return -EINVAL; + DPRINTK("vcc_connect (TX: cl %d,bw %d-%d,sdu %d; " "RX: cl %d,bw %d-%d,sdu %d,AAL %s%d)\n", vcc->qos.txtp.traffic_class,vcc->qos.txtp.min_pcr, vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu, @@ -387,143 +455,142 @@ vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu, vcc->qos.aal == ATM_AAL5 ? "" : vcc->qos.aal == ATM_AAL0 ? "" : " ??? code ",vcc->qos.aal == ATM_AAL0 ? 0 : vcc->qos.aal); - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) + return -EBADFD; if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) return -EINVAL; if (itf != ATM_ITF_ANY) { - int error; - - error = atm_do_connect(vcc,itf,vpi,vci); - if (error) return error; - } - else { - struct atm_dev *dev = NULL; + dev = atm_dev_lookup(itf); + if (!dev) + return -ENODEV; + error = __vcc_connect(vcc, dev, vpi, vci); + if (error) { + atm_dev_put(dev); + return error; + } + } else { struct list_head *p, *next; + dev = NULL; spin_lock(&atm_dev_lock); list_for_each_safe(p, next, &atm_devs) { dev = list_entry(p, struct atm_dev, dev_list); atm_dev_hold(dev); spin_unlock(&atm_dev_lock); - if (!atm_do_connect_dev(vcc,dev,vpi,vci)) + if (!__vcc_connect(vcc, dev, vpi, vci)) break; - atm_dev_release(dev); + atm_dev_put(dev); dev = NULL; spin_lock(&atm_dev_lock); } spin_unlock(&atm_dev_lock); - if (!dev) return -ENODEV; + if (!dev) + return -ENODEV; } if (vpi == ATM_VPI_UNSPEC || vci == ATM_VCI_UNSPEC) set_bit(ATM_VF_PARTIAL,&vcc->flags); - return 0; -} - - -int atm_connect(struct socket *sock,int itf,short vpi,int vci) -{ - int error; - - DPRINTK("atm_connect (vpi %d, vci %d)\n",vpi,vci); - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state != SS_UNCONNECTED) return -EINVAL; - if (!(vpi || vci)) return -EINVAL; - error = atm_connect_vcc(ATM_SD(sock),itf,vpi,vci); - if (error) return error; if (test_bit(ATM_VF_READY,&ATM_SD(sock)->flags)) sock->state = SS_CONNECTED; return 0; } -int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len, - int flags,struct scm_cookie *scm) +int vcc_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags, struct scm_cookie *scm) { - DECLARE_WAITQUEUE(wait,current); - struct atm_vcc *vcc; - struct sk_buff *skb; - int eff_len,error; - void *buff; - int size; - - if (sock->state != SS_CONNECTED) return -ENOTCONN; - if (flags & ~MSG_DONTWAIT) return -EOPNOTSUPP; - if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */ - buff = m->msg_iov->iov_base; - size = m->msg_iov->iov_len; - vcc = ATM_SD(sock); - add_wait_queue(&vcc->sleep,&wait); - set_current_state(TASK_INTERRUPTIBLE); - error = 1; /* <= 0 is error */ - while (!(skb = skb_dequeue(&vcc->sk->receive_queue))) { - if (test_bit(ATM_VF_RELEASED,&vcc->flags) || - test_bit(ATM_VF_CLOSE,&vcc->flags)) { - error = vcc->reply; - break; - } - if (!test_bit(ATM_VF_READY,&vcc->flags)) { - error = 0; - break; - } - if (flags & MSG_DONTWAIT) { - error = -EAGAIN; - break; - } - schedule(); - set_current_state(TASK_INTERRUPTIBLE); - if (signal_pending(current)) { - error = -ERESTARTSYS; - break; - } - } - set_current_state(TASK_RUNNING); - remove_wait_queue(&vcc->sleep,&wait); - if (error <= 0) return error; - sock_recv_timestamp(m, vcc->sk, skb); - eff_len = skb->len > size ? size : skb->len; - if (skb->len > size) /* Not fit ? Report it... */ - m->msg_flags |= MSG_TRUNC; + struct sock *sk = sock->sk; + struct atm_vcc *vcc; + struct sk_buff *skb; + int copied, error = -EINVAL; + + if (sock->state != SS_CONNECTED) + return -ENOTCONN; + if (flags & ~MSG_DONTWAIT) /* only handle MSG_DONTWAIT */ + return -EOPNOTSUPP; + vcc = ATM_SD(sock); + if (test_bit(ATM_VF_RELEASED,&vcc->flags) || + test_bit(ATM_VF_CLOSE,&vcc->flags)) + return vcc->reply; + if (!test_bit(ATM_VF_READY, &vcc->flags)) + return 0; + + skb = skb_recv_datagram(sk, flags, flags & MSG_DONTWAIT, &error); + if (!skb) + return error; + + copied = skb->len; + if (copied > size) { + copied = size; + msg->msg_flags |= MSG_TRUNC; + } + + error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); + if (error) + return error; + sock_recv_timestamp(msg, sk, skb); if (vcc->dev->ops->feedback) - vcc->dev->ops->feedback(vcc,skb,(unsigned long) skb->data, - (unsigned long) buff,eff_len); - DPRINTK("RcvM %d -= %d\n",atomic_read(&vcc->sk->rmem_alloc),skb->truesize); - atm_return(vcc,skb->truesize); - error = copy_to_user(buff,skb->data,eff_len) ? -EFAULT : 0; - kfree_skb(skb); - return error ? error : eff_len; + vcc->dev->ops->feedback(vcc, skb, (unsigned long) skb->data, + (unsigned long) msg->msg_iov->iov_base, copied); + DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize); + atm_return(vcc, skb->truesize); + skb_free_datagram(sk, skb); + return copied; } + + - -int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, - struct scm_cookie *scm) +int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len, + struct scm_cookie *scm) { + struct sock *sk = sock->sk; DECLARE_WAITQUEUE(wait,current); - struct atm_vcc *vcc; - struct sk_buff *skb; - int eff,error; - const void *buff; - int size; - - if (sock->state != SS_CONNECTED) return -ENOTCONN; - if (m->msg_name) return -EISCONN; - if (m->msg_iovlen != 1) return -ENOSYS; /* fix this later @@@ */ - buff = m->msg_iov->iov_base; - size = m->msg_iov->iov_len; - vcc = ATM_SD(sock); - if (test_bit(ATM_VF_RELEASED,&vcc->flags) || - test_bit(ATM_VF_CLOSE,&vcc->flags)) - return vcc->reply; - if (!test_bit(ATM_VF_READY,&vcc->flags)) return -EPIPE; - if (!size) return 0; - if (size < 0 || size > vcc->qos.txtp.max_sdu) return -EMSGSIZE; - /* verify_area is done by net/socket.c */ - eff = (size+3) & ~3; /* align to word boundary */ - add_wait_queue(&vcc->sleep,&wait); + struct atm_vcc *vcc; + struct sk_buff *skb; + int eff,error; + const void *buff; + int size; + + lock_sock(sk); + if (sock->state != SS_CONNECTED) { + error = -ENOTCONN; + goto out; + } + if (m->msg_name) { + error = -EISCONN; + goto out; + } + if (m->msg_iovlen != 1) { + error = -ENOSYS; /* fix this later @@@ */ + goto out; + } + buff = m->msg_iov->iov_base; + size = m->msg_iov->iov_len; + vcc = ATM_SD(sock); + if (test_bit(ATM_VF_RELEASED, &vcc->flags) || + test_bit(ATM_VF_CLOSE, &vcc->flags)) { + error = vcc->reply; + goto out; + } + if (!test_bit(ATM_VF_READY, &vcc->flags)) { + error = -EPIPE; + goto out; + } + if (!size) { + error = 0; + goto out; + } + if (size < 0 || size > vcc->qos.txtp.max_sdu) { + error = -EMSGSIZE; + goto out; + } + /* verify_area is done by net/socket.c */ + eff = (size+3) & ~3; /* align to word boundary */ + add_wait_queue(&vcc->sleep,&wait); set_current_state(TASK_INTERRUPTIBLE); - error = 0; - while (!(skb = alloc_tx(vcc,eff))) { - if (m->msg_flags & MSG_DONTWAIT) { + error = 0; + while (!(skb = alloc_tx(vcc,eff))) { + if (m->msg_flags & MSG_DONTWAIT) { error = -EAGAIN; break; } @@ -545,16 +612,21 @@ } set_current_state(TASK_RUNNING); remove_wait_queue(&vcc->sleep,&wait); - if (error) return error; + if (error) + goto out; skb->dev = NULL; /* for paths shared with net_device interfaces */ ATM_SKB(skb)->atm_options = vcc->atm_options; if (copy_from_user(skb_put(skb,size),buff,size)) { kfree_skb(skb); - return -EFAULT; + error = -EFAULT; + goto out; } if (eff != size) memset(skb->data+size,0,eff-size); error = vcc->dev->ops->send(vcc,skb); - return error ? error : size; + error = error ? error : size; +out: + release_sock(sk); + return error; } @@ -566,7 +638,7 @@ vcc = ATM_SD(sock); poll_wait(file,&vcc->sleep,wait); mask = 0; - if (skb_peek(&vcc->sk->receive_queue) || skb_peek(&vcc->listenq)) + if (skb_peek(&vcc->sk->receive_queue)) mask |= POLLIN | POLLRDNORM; if (test_bit(ATM_VF_RELEASED,&vcc->flags) || test_bit(ATM_VF_CLOSE,&vcc->flags)) @@ -915,14 +987,16 @@ return check_tp(&qos->rxtp); } - -static int atm_do_setsockopt(struct socket *sock,int level,int optname, - void *optval,int optlen) +int vcc_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) { struct atm_vcc *vcc; unsigned long value; int error; + if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname)) + return -EINVAL; + vcc = ATM_SD(sock); switch (optname) { case SO_ATMQOS: @@ -956,10 +1030,16 @@ } -static int atm_do_getsockopt(struct socket *sock,int level,int optname, - void *optval,int optlen) +int vcc_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) { struct atm_vcc *vcc; + int len; + + if (get_user(len, optlen)) + return -EFAULT; + if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname)) + return -EINVAL; vcc = ATM_SD(sock); switch (optname) { @@ -990,28 +1070,7 @@ break; } if (!vcc->dev || !vcc->dev->ops->getsockopt) return -EINVAL; - return vcc->dev->ops->getsockopt(vcc,level,optname,optval,optlen); -} - - -int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, - int optlen) -{ - if (__SO_LEVEL_MATCH(optname, level) && optlen != __SO_SIZE(optname)) - return -EINVAL; - return atm_do_setsockopt(sock,level,optname,optval,optlen); -} - - -int atm_getsockopt(struct socket *sock,int level,int optname, - char *optval,int *optlen) -{ - int len; - - if (get_user(len,optlen)) return -EFAULT; - if (__SO_LEVEL_MATCH(optname, level) && len != __SO_SIZE(optname)) - return -EINVAL; - return atm_do_getsockopt(sock,level,optname,optval,len); + return vcc->dev->ops->getsockopt(vcc, level, optname, optval, len); } diff -urN linux-2.4.22-bk36/net/atm/common.h linux-2.4.22-bk37/net/atm/common.h --- linux-2.4.22-bk36/net/atm/common.h 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/common.h 2003-10-20 02:49:38.000000000 -0700 @@ -10,22 +10,20 @@ #include /* for poll_table */ -int atm_create(struct socket *sock,int protocol,int family); -int atm_release(struct socket *sock); -int atm_connect(struct socket *sock,int itf,short vpi,int vci); -int atm_recvmsg(struct socket *sock,struct msghdr *m,int total_len, - int flags,struct scm_cookie *scm); -int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, - struct scm_cookie *scm); +int vcc_create(struct socket *sock, int protocol, int family); +int vcc_release(struct socket *sock); +int vcc_connect(struct socket *sock, int itf, short vpi, int vci); +int vcc_recvmsg(struct socket *sock, struct msghdr *msg, + int size, int flags, struct scm_cookie *scm); +int vcc_sendmsg(struct socket *sock, struct msghdr *m, int total_len, + struct scm_cookie *scm); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); -int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, - int optlen); -int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, - int *optlen); +int vcc_setsockopt(struct socket *sock, int level, int optname, char *optval, + int optlen); +int vcc_getsockopt(struct socket *sock, int level, int optname, char *optval, + int *optlen); -int atm_connect_vcc(struct atm_vcc *vcc,int itf,short vpi,int vci); -void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_shutdown_dev(struct atm_dev *dev); void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)); diff -urN linux-2.4.22-bk36/net/atm/lec.c linux-2.4.22-bk37/net/atm/lec.c --- linux-2.4.22-bk36/net/atm/lec.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/lec.c 2003-10-20 02:49:38.000000000 -0700 @@ -45,7 +45,7 @@ #include "lec.h" #include "lec_arpc.h" -#include "resources.h" /* for bind_vcc() */ +#include "resources.h" #if 0 #define DPRINTK printk @@ -818,7 +818,8 @@ lec_arp_init(priv); priv->itfnum = i; /* LANE2 addition */ priv->lecd = vcc; - bind_vcc(vcc, &lecatm_dev); + vcc->dev = &lecatm_dev; + vcc_insert_socket(vcc->sk); vcc->proto_data = dev_lec[i]; set_bit(ATM_VF_META,&vcc->flags); @@ -1092,7 +1093,7 @@ clear_bit(ATM_VF_READY,&entry->vcc->flags); entry->vcc->push(entry->vcc, NULL); #endif - atm_async_release_vcc(entry->vcc, -EPIPE); + vcc_release_async(entry->vcc, -EPIPE); entry->vcc = NULL; } if (entry->recv_vcc) { @@ -1102,7 +1103,7 @@ clear_bit(ATM_VF_READY,&entry->recv_vcc->flags); entry->recv_vcc->push(entry->recv_vcc, NULL); #endif - atm_async_release_vcc(entry->recv_vcc, -EPIPE); + vcc_release_async(entry->recv_vcc, -EPIPE); entry->recv_vcc = NULL; } } diff -urN linux-2.4.22-bk36/net/atm/mpc.c linux-2.4.22-bk37/net/atm/mpc.c --- linux-2.4.22-bk36/net/atm/mpc.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/mpc.c 2003-10-20 02:49:38.000000000 -0700 @@ -28,7 +28,7 @@ #include "lec.h" #include "mpc.h" -#include "resources.h" /* for bind_vcc() */ +#include "resources.h" /* * mpc.c: Implementation of MPOA client kernel part @@ -787,7 +787,8 @@ } mpc->mpoad_vcc = vcc; - bind_vcc(vcc, &mpc_dev); + vcc->dev = &mpc_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); diff -urN linux-2.4.22-bk36/net/atm/mpoa_caches.c linux-2.4.22-bk37/net/atm/mpoa_caches.c --- linux-2.4.22-bk36/net/atm/mpoa_caches.c 2000-04-14 09:48:47.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/mpoa_caches.c 2003-10-20 02:49:38.000000000 -0700 @@ -212,7 +212,7 @@ client->eg_ops->put(eg_entry); return; } - atm_async_release_vcc(vcc, -EPIPE); + vcc_release_async(vcc, -EPIPE); } return; @@ -447,7 +447,7 @@ client->in_ops->put(in_entry); return; } - atm_async_release_vcc(vcc, -EPIPE); + vcc_release_async(vcc, -EPIPE); } return; diff -urN linux-2.4.22-bk36/net/atm/proc.c linux-2.4.22-bk37/net/atm/proc.c --- linux-2.4.22-bk36/net/atm/proc.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/proc.c 2003-10-20 02:49:38.000000000 -0700 @@ -332,9 +332,7 @@ static int atm_pvc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; struct atm_vcc *vcc; int left, clip_info = 0; @@ -347,24 +345,20 @@ if (try_atm_clip_ops()) clip_info = 1; #endif - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) { - pvc_info(vcc,buf,clip_info); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->sk->family == PF_ATMPVC && vcc->dev && !left--) { + pvc_info(vcc,buf,clip_info); + read_unlock(&vcc_sklist_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info && atm_clip_ops->owner) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (clip_info && atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) if (clip_info && atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); @@ -375,10 +369,8 @@ static int atm_vc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; struct atm_vcc *vcc; + struct sock *s; int left; if (!pos) @@ -386,20 +378,16 @@ "Address"," Itf VPI VCI Fam Flags Reply Send buffer" " Recv buffer\n"); left = pos-1; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (!left--) { - vc_info(vcc,buf); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (!left--) { + vc_info(vcc,buf); + read_unlock(&vcc_sklist_lock); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); return 0; } @@ -407,29 +395,23 @@ static int atm_svc_info(loff_t pos,char *buf) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; struct atm_vcc *vcc; int left; if (!pos) return sprintf(buf,"Itf VPI VCI State Remote\n"); left = pos-1; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - for (vcc = dev->vccs; vcc; vcc = vcc->next) - if (vcc->sk->family == PF_ATMSVC && !left--) { - svc_info(vcc,buf); - spin_unlock_irqrestore(&dev->lock, flags); - spin_unlock(&atm_dev_lock); - return strlen(buf); - } - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + vcc = s->protinfo.af_atm; + if (vcc->sk->family == PF_ATMSVC && !left--) { + svc_info(vcc,buf); + read_unlock(&vcc_sklist_lock); + return strlen(buf); + } } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); return 0; } diff -urN linux-2.4.22-bk36/net/atm/pvc.c linux-2.4.22-bk37/net/atm/pvc.c --- linux-2.4.22-bk36/net/atm/pvc.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/pvc.c 2003-10-20 02:49:38.000000000 -0700 @@ -18,10 +18,6 @@ #include "resources.h" /* devs and vccs */ #include "common.h" /* common for PVCs and SVCs */ -#ifndef NULL -#define NULL 0 -#endif - static int pvc_shutdown(struct socket *sock,int how) { @@ -32,20 +28,29 @@ static int pvc_bind(struct socket *sock,struct sockaddr *sockaddr, int sockaddr_len) { + struct sock *sk = sock->sk; struct sockaddr_atmpvc *addr; struct atm_vcc *vcc; + int error; if (sockaddr_len != sizeof(struct sockaddr_atmpvc)) return -EINVAL; addr = (struct sockaddr_atmpvc *) sockaddr; if (addr->sap_family != AF_ATMPVC) return -EAFNOSUPPORT; + lock_sock(sk); vcc = ATM_SD(sock); - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) { + error = -EBADFD; + goto out; + } if (test_bit(ATM_VF_PARTIAL,&vcc->flags)) { if (vcc->vpi != ATM_VPI_UNSPEC) addr->sap_addr.vpi = vcc->vpi; if (vcc->vci != ATM_VCI_UNSPEC) addr->sap_addr.vci = vcc->vci; } - return atm_connect(sock,addr->sap_addr.itf,addr->sap_addr.vpi, - addr->sap_addr.vci); + error = vcc_connect(sock, addr->sap_addr.itf, addr->sap_addr.vpi, + addr->sap_addr.vci); +out: + release_sock(sk); + return error; } @@ -55,6 +60,31 @@ return pvc_bind(sock,sockaddr,sockaddr_len); } +static int pvc_setsockopt(struct socket *sock, int level, int optname, + char *optval, int optlen) +{ + struct sock *sk = sock->sk; + int error; + + lock_sock(sk); + error = vcc_setsockopt(sock, level, optname, optval, optlen); + release_sock(sk); + return error; +} + + +static int pvc_getsockopt(struct socket *sock, int level, int optname, + char *optval, int *optlen) +{ + struct sock *sk = sock->sk; + int error; + + lock_sock(sk); + error = vcc_getsockopt(sock, level, optname, optval, optlen); + release_sock(sk); + return error; +} + static int pvc_getname(struct socket *sock,struct sockaddr *sockaddr, int *sockaddr_len,int peer) @@ -73,10 +103,10 @@ } -static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = { +static struct proto_ops pvc_proto_ops = { .family = PF_ATMPVC, - .release = atm_release, + .release = vcc_release, .bind = pvc_bind, .connect = pvc_connect, .socketpair = sock_no_socketpair, @@ -86,23 +116,19 @@ .ioctl = vcc_ioctl, .listen = sock_no_listen, .shutdown = pvc_shutdown, - .setsockopt = atm_setsockopt, - .getsockopt = atm_getsockopt, - .sendmsg = atm_sendmsg, - .recvmsg = atm_recvmsg, + .setsockopt = pvc_setsockopt, + .getsockopt = pvc_getsockopt, + .sendmsg = vcc_sendmsg, + .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; -#include -SOCKOPS_WRAP(pvc_proto, PF_ATMPVC); - - static int pvc_create(struct socket *sock,int protocol) { sock->ops = &pvc_proto_ops; - return atm_create(sock,protocol,PF_ATMPVC); + return vcc_create(sock, protocol, PF_ATMPVC); } diff -urN linux-2.4.22-bk36/net/atm/resources.c linux-2.4.22-bk37/net/atm/resources.c --- linux-2.4.22-bk36/net/atm/resources.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/resources.c 2003-10-20 02:49:38.000000000 -0700 @@ -19,11 +19,6 @@ #include "addr.h" -#ifndef NULL -#define NULL 0 -#endif - - LIST_HEAD(atm_devs); spinlock_t atm_dev_lock = SPIN_LOCK_UNLOCKED; @@ -90,7 +85,7 @@ spin_lock(&atm_dev_lock); if (number != -1) { if ((inuse = __atm_dev_lookup(number))) { - atm_dev_release(inuse); + atm_dev_put(inuse); spin_unlock(&atm_dev_lock); __free_atm_dev(dev); return NULL; @@ -99,13 +94,11 @@ } else { dev->number = 0; while ((inuse = __atm_dev_lookup(dev->number))) { - atm_dev_release(inuse); + atm_dev_put(inuse); dev->number++; } } - dev->vccs = dev->last = NULL; - dev->dev_data = NULL; - barrier(); + dev->ops = ops; if (flags) dev->flags = *flags; @@ -140,7 +133,8 @@ unsigned long warning_time; #ifdef CONFIG_PROC_FS - if (dev->ops->proc_read) atm_proc_dev_deregister(dev); + if (dev->ops->proc_read) + atm_proc_dev_deregister(dev); #endif spin_lock(&atm_dev_lock); list_del(&dev->dev_list); @@ -400,87 +394,12 @@ ? -EFAULT : 0; } done: - atm_dev_release(dev); + atm_dev_put(dev); return error; } - -/* Handler for sk->destruct, invoked by sk_free() */ -static void atm_free_sock(struct sock *sk) -{ - kfree(sk->protinfo.af_atm); -} - -struct sock *alloc_atm_vcc_sk(int family) -{ - struct sock *sk; - struct atm_vcc *vcc; - - sk = sk_alloc(family, GFP_KERNEL, 1); - if (!sk) - return NULL; - vcc = sk->protinfo.af_atm = kmalloc(sizeof(*vcc), GFP_KERNEL); - if (!vcc) { - sk_free(sk); - return NULL; - } - sock_init_data(NULL, sk); - sk->destruct = atm_free_sock; - memset(vcc, 0, sizeof(*vcc)); - vcc->sk = sk; - - return sk; -} - - -static void unlink_vcc(struct atm_vcc *vcc) -{ - unsigned long flags; - if (vcc->dev) { - spin_lock_irqsave(&vcc->dev->lock, flags); - if (vcc->prev) - vcc->prev->next = vcc->next; - else - vcc->dev->vccs = vcc->next; - - if (vcc->next) - vcc->next->prev = vcc->prev; - else - vcc->dev->last = vcc->prev; - spin_unlock_irqrestore(&vcc->dev->lock, flags); - } -} - - - -void free_atm_vcc_sk(struct sock *sk) -{ - unlink_vcc(sk->protinfo.af_atm); - sk_free(sk); -} - - -void bind_vcc(struct atm_vcc *vcc,struct atm_dev *dev) -{ - unsigned long flags; - - unlink_vcc(vcc); - vcc->dev = dev; - if (dev) { - spin_lock_irqsave(&dev->lock, flags); - vcc->next = NULL; - vcc->prev = dev->last; - if (dev->vccs) dev->last->next = vcc; - else dev->vccs = vcc; - dev->last = vcc; - spin_unlock_irqrestore(&dev->lock, flags); - } -} - - EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); EXPORT_SYMBOL(atm_dev_lookup); EXPORT_SYMBOL(shutdown_atm_dev); -EXPORT_SYMBOL(bind_vcc); diff -urN linux-2.4.22-bk36/net/atm/resources.h linux-2.4.22-bk37/net/atm/resources.h --- linux-2.4.22-bk36/net/atm/resources.h 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/resources.h 2003-10-20 02:49:38.000000000 -0700 @@ -14,8 +14,6 @@ extern spinlock_t atm_dev_lock; -struct sock *alloc_atm_vcc_sk(int family); -void free_atm_vcc_sk(struct sock *sk); int atm_dev_ioctl(unsigned int cmd, unsigned long arg); diff -urN linux-2.4.22-bk36/net/atm/signaling.c linux-2.4.22-bk37/net/atm/signaling.c --- linux-2.4.22-bk36/net/atm/signaling.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/signaling.c 2003-10-20 02:49:38.000000000 -0700 @@ -124,26 +124,31 @@ clear_bit(ATM_VF_REGIS,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags); vcc->reply = msg->reply; + vcc->sk->err = -msg->reply; break; case as_indicate: vcc = *(struct atm_vcc **) &msg->listen_vcc; DPRINTK("as_indicate!!!\n"); - if (!vcc->backlog_quota) { + lock_sock(vcc->sk); + if (vcc->sk->ack_backlog == vcc->sk->max_ack_backlog) { sigd_enq(0,as_reject,vcc,NULL,NULL); - return 0; + goto as_indicate_complete; } - vcc->backlog_quota--; - skb_queue_tail(&vcc->listenq,skb); + vcc->sk->ack_backlog++; + skb_queue_tail(&vcc->sk->receive_queue,skb); if (vcc->callback) { DPRINTK("waking vcc->sleep 0x%p\n", &vcc->sleep); vcc->callback(vcc); } +as_indicate_complete: + release_sock(vcc->sk); return 0; case as_close: set_bit(ATM_VF_RELEASED,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags); vcc->reply = msg->reply; + vcc->sk->err = -msg->reply; break; case as_modify: modify_qos(vcc,msg); @@ -194,25 +199,21 @@ } -static void purge_vccs(struct atm_vcc *vcc) +static void purge_vcc(struct atm_vcc *vcc) { - while (vcc) { - if (vcc->sk->family == PF_ATMSVC && - !test_bit(ATM_VF_META,&vcc->flags)) { - set_bit(ATM_VF_RELEASED,&vcc->flags); - vcc->reply = -EUNATCH; - wake_up(&vcc->sleep); - } - vcc = vcc->next; + if (vcc->sk->family == PF_ATMSVC && + !test_bit(ATM_VF_META, &vcc->flags)) { + set_bit(ATM_VF_RELEASED, &vcc->flags); + vcc->reply = -EUNATCH; + vcc->sk->err = EUNATCH; + wake_up(&vcc->sleep); } } static void sigd_close(struct atm_vcc *vcc) { - unsigned long flags; - struct atm_dev *dev; - struct list_head *p; + struct sock *s; DPRINTK("sigd_close\n"); sigd = NULL; @@ -220,14 +221,14 @@ printk(KERN_ERR "sigd_close: closing with requests pending\n"); skb_queue_purge(&vcc->sk->receive_queue); - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - spin_lock_irqsave(&dev->lock, flags); - purge_vccs(dev->vccs); - spin_unlock_irqrestore(&dev->lock, flags); + read_lock(&vcc_sklist_lock); + for(s = vcc_sklist; s; s = s->next) { + struct atm_vcc *vcc = s->protinfo.af_atm; + + if (vcc->dev) + purge_vcc(vcc); } - spin_unlock(&atm_dev_lock); + read_unlock(&vcc_sklist_lock); } @@ -250,7 +251,8 @@ if (sigd) return -EADDRINUSE; DPRINTK("sigd_attach\n"); sigd = vcc; - bind_vcc(vcc,&sigd_dev); + vcc->dev = &sigd_dev; + vcc_insert_socket(vcc->sk); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); wake_up(&sigd_sleep); diff -urN linux-2.4.22-bk36/net/atm/svc.c linux-2.4.22-bk37/net/atm/svc.c --- linux-2.4.22-bk36/net/atm/svc.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/atm/svc.c 2003-10-20 02:49:38.000000000 -0700 @@ -75,7 +75,7 @@ } /* beware - socket is still in use by atmsigd until the last as_indicate has been answered */ - while ((skb = skb_dequeue(&vcc->listenq))) { + while ((skb = skb_dequeue(&vcc->sk->receive_queue))) { DPRINTK("LISTEN REL\n"); sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); dev_kfree_skb(skb); @@ -89,18 +89,21 @@ static int svc_release(struct socket *sock) { + struct sock *sk = sock->sk; struct atm_vcc *vcc; - if (!sock->sk) return 0; - vcc = ATM_SD(sock); - DPRINTK("svc_release %p\n",vcc); - clear_bit(ATM_VF_READY,&vcc->flags); - atm_release_vcc_sk(sock->sk,0); - svc_disconnect(vcc); - /* VCC pointer is used as a reference, so we must not free it - (thereby subjecting it to re-use) before all pending connections - are closed */ - free_atm_vcc_sk(sock->sk); + if (sk) { + vcc = ATM_SD(sock); + DPRINTK("svc_release %p\n", vcc); + clear_bit(ATM_VF_READY, &vcc->flags); + /* VCC pointer is used as a reference, so we must not free it + (thereby subjecting it to re-use) before all pending connections + are closed */ + sock_hold(sk); + vcc_release(sock); + svc_disconnect(vcc); + sock_put(sk); + } return 0; } @@ -109,20 +112,39 @@ int sockaddr_len) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct sockaddr_atmsvc *addr; struct atm_vcc *vcc; + int error; - if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL; - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state != SS_UNCONNECTED) return -EINVAL; + if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) + return -EINVAL; + lock_sock(sk); + if (sock->state == SS_CONNECTED) { + error = -EISCONN; + goto out; + } + if (sock->state != SS_UNCONNECTED) { + error = -EINVAL; + goto out; + } vcc = ATM_SD(sock); - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + if (test_bit(ATM_VF_SESSION, &vcc->flags)) { + error = -EINVAL; + goto out; + } addr = (struct sockaddr_atmsvc *) sockaddr; - if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT; + if (addr->sas_family != AF_ATMSVC) { + error = -EAFNOSUPPORT; + goto out; + } clear_bit(ATM_VF_BOUND,&vcc->flags); /* failing rebind will kill old binding */ /* @@@ check memory (de)allocation on rebind */ - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) { + error = -EBADFD; + goto out; + } vcc->local = *addr; vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); @@ -133,9 +155,16 @@ } remove_wait_queue(&vcc->sleep,&wait); clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */ - if (!sigd) return -EUNATCH; - if (!vcc->reply) set_bit(ATM_VF_BOUND,&vcc->flags); - return vcc->reply; + if (!sigd) { + error = -EUNATCH; + goto out; + } + if (!vcc->reply) + set_bit(ATM_VF_BOUND,&vcc->flags); + error = vcc->reply; +out: + release_sock(sk); + return error; } @@ -143,31 +172,60 @@ int sockaddr_len,int flags) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct sockaddr_atmsvc *addr; struct atm_vcc *vcc = ATM_SD(sock); int error; DPRINTK("svc_connect %p\n",vcc); - if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) return -EINVAL; - if (sock->state == SS_CONNECTED) return -EISCONN; - if (sock->state == SS_CONNECTING) { - if (vcc->reply == WAITING) return -EALREADY; - sock->state = SS_UNCONNECTED; - if (vcc->reply) return vcc->reply; + lock_sock(sk); + if (sockaddr_len != sizeof(struct sockaddr_atmsvc)) { + error = -EINVAL; + goto out; } - else { - int error; - if (sock->state != SS_UNCONNECTED) return -EINVAL; - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + switch (sock->state) { + default: + error = -EINVAL; + goto out; + case SS_CONNECTED: + error = -EISCONN; + goto out; + case SS_CONNECTING: + if (vcc->reply == WAITING) { + error = -EALREADY; + goto out; + } + sock->state = SS_UNCONNECTED; + if (vcc->reply) { + error = vcc->reply; + goto out; + } + break; + case SS_UNCONNECTED: + if (test_bit(ATM_VF_SESSION, &vcc->flags)) { + error = -EINVAL; + goto out; + } addr = (struct sockaddr_atmsvc *) sockaddr; - if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT; - if (!test_bit(ATM_VF_HASQOS,&vcc->flags)) return -EBADFD; + if (addr->sas_family != AF_ATMSVC) { + error = -EAFNOSUPPORT; + goto out; + } + if (!test_bit(ATM_VF_HASQOS, &vcc->flags)) { + error = -EBADFD; + goto out; + } if (vcc->qos.txtp.traffic_class == ATM_ANYCLASS || - vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) - return -EINVAL; + vcc->qos.rxtp.traffic_class == ATM_ANYCLASS) { + error = -EINVAL; + goto out; + } if (!vcc->qos.txtp.traffic_class && - !vcc->qos.rxtp.traffic_class) return -EINVAL; + !vcc->qos.rxtp.traffic_class) { + error = -EINVAL; + goto out; + } vcc->remote = *addr; vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); @@ -175,7 +233,8 @@ if (flags & O_NONBLOCK) { remove_wait_queue(&vcc->sleep,&wait); sock->state = SS_CONNECTING; - return -EINPROGRESS; + error = -EINPROGRESS; + goto out; } error = 0; while (vcc->reply == WAITING && sigd) { @@ -214,9 +273,16 @@ break; } remove_wait_queue(&vcc->sleep,&wait); - if (error) return error; - if (!sigd) return -EUNATCH; - if (vcc->reply) return vcc->reply; + if (error) + goto out; + if (!sigd) { + error = -EUNATCH; + goto out; + } + if (vcc->reply) { + error = vcc->reply; + goto out; + } } /* * Not supported yet @@ -229,9 +295,11 @@ /* * #endif */ - if (!(error = atm_connect(sock,vcc->itf,vcc->vpi,vcc->vci))) + if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci))) sock->state = SS_CONNECTED; else (void) svc_disconnect(vcc); +out: + release_sock(sk); return error; } @@ -239,11 +307,17 @@ static int svc_listen(struct socket *sock,int backlog) { DECLARE_WAITQUEUE(wait,current); + struct sock *sk = sock->sk; struct atm_vcc *vcc = ATM_SD(sock); + int error; DPRINTK("svc_listen %p\n",vcc); + lock_sock(sk); /* let server handle listen on unbound sockets */ - if (test_bit(ATM_VF_SESSION,&vcc->flags)) return -EINVAL; + if (test_bit(ATM_VF_SESSION,&vcc->flags)) { + error = -EINVAL; + goto out; + } vcc->reply = WAITING; add_wait_queue(&vcc->sleep,&wait); sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local); @@ -252,24 +326,33 @@ schedule(); } remove_wait_queue(&vcc->sleep,&wait); - if (!sigd) return -EUNATCH; + if (!sigd) { + error = -EUNATCH; + goto out; + } set_bit(ATM_VF_LISTEN,&vcc->flags); - vcc->backlog_quota = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; - return vcc->reply; + vcc->sk->max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; + error = vcc->reply; +out: + release_sock(sk); + return error; } static int svc_accept(struct socket *sock,struct socket *newsock,int flags) { + struct sock *sk = sock->sk; struct sk_buff *skb; struct atmsvc_msg *msg; struct atm_vcc *old_vcc = ATM_SD(sock); struct atm_vcc *new_vcc; int error; + lock_sock(sk); + error = svc_create(newsock,0); if (error) - return error; + goto out; new_vcc = ATM_SD(newsock); @@ -278,7 +361,7 @@ DECLARE_WAITQUEUE(wait,current); add_wait_queue(&old_vcc->sleep,&wait); - while (!(skb = skb_dequeue(&old_vcc->listenq)) && sigd) { + while (!(skb = skb_dequeue(&old_vcc->sk->receive_queue)) && sigd) { if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break; if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) { error = old_vcc->reply; @@ -288,30 +371,36 @@ error = -EAGAIN; break; } - set_current_state(TASK_INTERRUPTIBLE); + release_sock(sk); schedule(); + lock_sock(sk); if (signal_pending(current)) { error = -ERESTARTSYS; break; } } remove_wait_queue(&old_vcc->sleep,&wait); - if (error) return error; - if (!skb) return -EUNATCH; + if (error) + goto out; + if (!skb) { + error = -EUNATCH; + goto out; + } msg = (struct atmsvc_msg *) skb->data; new_vcc->qos = msg->qos; set_bit(ATM_VF_HASQOS,&new_vcc->flags); new_vcc->remote = msg->svc; new_vcc->local = msg->local; new_vcc->sap = msg->sap; - error = atm_connect(newsock,msg->pvc.sap_addr.itf, - msg->pvc.sap_addr.vpi,msg->pvc.sap_addr.vci); + error = vcc_connect(newsock, msg->pvc.sap_addr.itf, + msg->pvc.sap_addr.vpi, msg->pvc.sap_addr.vci); dev_kfree_skb(skb); - old_vcc->backlog_quota++; + old_vcc->sk->ack_backlog--; if (error) { sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL, &old_vcc->qos,error); - return error == -EAGAIN ? -EBUSY : error; + error = error == -EAGAIN ? -EBUSY : error; + goto out; } /* wait should be short, so we ignore the non-blocking flag */ new_vcc->reply = WAITING; @@ -319,15 +408,25 @@ sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL); while (new_vcc->reply == WAITING && sigd) { set_current_state(TASK_UNINTERRUPTIBLE); + release_sock(sk); schedule(); + lock_sock(sk); } remove_wait_queue(&new_vcc->sleep,&wait); - if (!sigd) return -EUNATCH; + if (!sigd) { + error = -EUNATCH; + goto out; + } if (!new_vcc->reply) break; - if (new_vcc->reply != -ERESTARTSYS) return new_vcc->reply; + if (new_vcc->reply != -ERESTARTSYS) { + error = new_vcc->reply; + goto out; + } } newsock->state = SS_CONNECTED; - return 0; +out: + release_sock(sk); + return error; } @@ -365,33 +464,57 @@ static int svc_setsockopt(struct socket *sock,int level,int optname, char *optval,int optlen) { + struct sock *sk = sock->sk; struct atm_vcc *vcc; + int error = 0; if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP || - optlen != sizeof(struct atm_sap)) - return atm_setsockopt(sock,level,optname,optval,optlen); + optlen != sizeof(struct atm_sap)) { + error = vcc_setsockopt(sock, level, optname, optval, optlen); + goto out; + } vcc = ATM_SD(sock); - if (copy_from_user(&vcc->sap,optval,optlen)) return -EFAULT; - set_bit(ATM_VF_HASSAP,&vcc->flags); - return 0; + if (copy_from_user(&vcc->sap, optval, optlen)) { + error = -EFAULT; + goto out; + } + set_bit(ATM_VF_HASSAP, &vcc->flags); +out: + release_sock(sk); + return error; } static int svc_getsockopt(struct socket *sock,int level,int optname, char *optval,int *optlen) { - int len; + struct sock *sk = sock->sk; + int error = 0, len; - if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) - return atm_getsockopt(sock,level,optname,optval,optlen); - if (get_user(len,optlen)) return -EFAULT; - if (len != sizeof(struct atm_sap)) return -EINVAL; - return copy_to_user(optval,&ATM_SD(sock)->sap,sizeof(struct atm_sap)) ? - -EFAULT : 0; + lock_sock(sk); + if (!__SO_LEVEL_MATCH(optname, level) || optname != SO_ATMSAP) { + error = vcc_getsockopt(sock, level, optname, optval, optlen); + goto out; + } + if (get_user(len, optlen)) { + error = -EFAULT; + goto out; + } + if (len != sizeof(struct atm_sap)) { + error = -EINVAL; + goto out; + } + if (copy_to_user(optval, &ATM_SD(sock)->sap, sizeof(struct atm_sap))) { + error = -EFAULT; + goto out; + } +out: + release_sock(sk); + return error; } -static struct proto_ops SOCKOPS_WRAPPED(svc_proto_ops) = { +static struct proto_ops svc_proto_ops = { .family = PF_ATMSVC, .release = svc_release, @@ -406,22 +529,19 @@ .shutdown = svc_shutdown, .setsockopt = svc_setsockopt, .getsockopt = svc_getsockopt, - .sendmsg = atm_sendmsg, - .recvmsg = atm_recvmsg, + .sendmsg = vcc_sendmsg, + .recvmsg = vcc_recvmsg, .mmap = sock_no_mmap, .sendpage = sock_no_sendpage, }; -#include -SOCKOPS_WRAP(svc_proto, PF_ATMSVC); - static int svc_create(struct socket *sock,int protocol) { int error; sock->ops = &svc_proto_ops; - error = atm_create(sock,protocol,AF_ATMSVC); + error = vcc_create(sock, protocol, AF_ATMSVC); if (error) return error; ATM_SD(sock)->callback = svc_callback; ATM_SD(sock)->local.sas_family = AF_ATMSVC; diff -urN linux-2.4.22-bk36/net/ipv4/ip_output.c linux-2.4.22-bk37/net/ipv4/ip_output.c --- linux-2.4.22-bk36/net/ipv4/ip_output.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/ipv4/ip_output.c 2003-10-20 02:49:38.000000000 -0700 @@ -879,6 +879,7 @@ #endif #ifdef CONFIG_NETFILTER skb2->nfmark = skb->nfmark; + skb2->nfcache = skb->nfcache; /* Connection association is same as pre-frag packet */ skb2->nfct = skb->nfct; nf_conntrack_get(skb2->nfct); diff -urN linux-2.4.22-bk36/net/ipv4/ipvs/ip_vs_ctl.c linux-2.4.22-bk37/net/ipv4/ipvs/ip_vs_ctl.c --- linux-2.4.22-bk36/net/ipv4/ipvs/ip_vs_ctl.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/ipv4/ipvs/ip_vs_ctl.c 2003-10-20 02:49:38.000000000 -0700 @@ -653,6 +653,15 @@ } +static inline void +__ip_vs_zero_stats(struct ip_vs_stats *stats) +{ + spin_lock_bh(&stats->lock); + memset(stats, 0, (char *)&stats->lock - (char *)stats); + spin_unlock_bh(&stats->lock); + ip_vs_zero_estimator(stats); +} + /* * Update a destination in the given service */ @@ -699,6 +708,7 @@ } else { if (dest->svc != svc) { __ip_vs_unbind_svc(dest); + __ip_vs_zero_stats(&dest->stats); __ip_vs_bind_svc(dest, svc); } } @@ -1282,15 +1292,6 @@ /* * Zero counters in a service or all services */ -static inline void -__ip_vs_zero_stats(struct ip_vs_stats *stats) -{ - spin_lock_bh(&stats->lock); - memset(stats, 0, (char *)&stats->lock - (char *)stats); - spin_unlock_bh(&stats->lock); - ip_vs_zero_estimator(stats); -} - static int ip_vs_zero_service(struct ip_vs_service *svc) { struct list_head *l; diff -urN linux-2.4.22-bk36/net/ipv4/ipvs/ip_vs_ftp.c linux-2.4.22-bk37/net/ipv4/ipvs/ip_vs_ftp.c --- linux-2.4.22-bk36/net/ipv4/ipvs/ip_vs_ftp.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/ipv4/ipvs/ip_vs_ftp.c 2003-10-20 02:49:38.000000000 -0700 @@ -304,11 +304,12 @@ */ IP_VS_DBG(1-debug, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n", ip_vs_proto_name(iph->protocol), - NIPQUAD(to), ntohs(port), NIPQUAD(iph->daddr), 0); + NIPQUAD(to), ntohs(port), + NIPQUAD(cp->vaddr), ntohs(cp->vport) - 1); n_cp = ip_vs_conn_in_get(iph->protocol, to, port, - iph->daddr, htons(ntohs(cp->vport)-1)); + cp->vaddr, htons(ntohs(cp->vport)-1)); if (!n_cp) { n_cp = ip_vs_conn_new(IPPROTO_TCP, to, port, diff -urN linux-2.4.22-bk36/net/ipv4/netfilter/ip_nat_helper.c linux-2.4.22-bk37/net/ipv4/netfilter/ip_nat_helper.c --- linux-2.4.22-bk36/net/ipv4/netfilter/ip_nat_helper.c 2003-10-20 02:49:34.000000000 -0700 +++ linux-2.4.22-bk37/net/ipv4/netfilter/ip_nat_helper.c 2003-10-20 02:49:38.000000000 -0700 @@ -233,6 +233,13 @@ newudplen = udplen - match_len + rep_len; newlen = iph->ihl*4 + newudplen; + /* UDP helpers might accidentally mangle the wrong packet */ + if (udplen < sizeof(*udph) + match_offset + match_len) { + if (net_ratelimit()) + printk("ip_nat_mangle_udp_packet: undersized packet\n"); + return 0; + } + if (newlen > 65535) { if (net_ratelimit()) printk("ip_nat_mangle_udp_packet: nat'ed packet " diff -urN linux-2.4.22-bk36/net/ipv6/netfilter/ip6t_ipv6header.c linux-2.4.22-bk37/net/ipv6/netfilter/ip6t_ipv6header.c --- linux-2.4.22-bk36/net/ipv6/netfilter/ip6t_ipv6header.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/ipv6/netfilter/ip6t_ipv6header.c 2003-10-20 02:49:38.000000000 -0700 @@ -129,20 +129,13 @@ return 1; } -static void -ipv6header_destroy(void *matchinfo, - unsigned int matchinfosize) -{ - return; -} - static struct ip6t_match ip6t_ipv6header_match = { { NULL, NULL }, "ipv6header", &ipv6header_match, &ipv6header_checkentry, - &ipv6header_destroy, + NULL, THIS_MODULE }; diff -urN linux-2.4.22-bk36/net/irda/af_irda.c linux-2.4.22-bk37/net/irda/af_irda.c --- linux-2.4.22-bk36/net/irda/af_irda.c 2002-11-28 15:53:16.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/af_irda.c 2003-10-20 02:49:38.000000000 -0700 @@ -98,7 +98,7 @@ struct sock *sk; int err; - IRDA_DEBUG(3, __FUNCTION__ "()\n"); + IRDA_DEBUG(3, "%s()\n", __FUNCTION__); self = (struct irda_sock *) instance; ASSERT(self != NULL, return -1;); @@ -108,7 +108,7 @@ err = sock_queue_rcv_skb(sk, skb); if (err) { - IRDA_DEBUG(1, __FUNCTION__ "(), error: no more mem!\n"); + IRDA_DEBUG(1, "%s(), error: no more mem!\n", __FUNCTION__); self->rx_flow = FLOW_STOP; /* When we return error, TTP will need to requeue the skb */ @@ -132,7 +132,7 @@ self = (struct irda_sock *) instance; - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); /* Don't care about it, but let's not leak it */ if(skb) @@ -194,7 +194,7 @@ self = (struct irda_sock *) instance; - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); sk = self->sk; if (sk == NULL) @@ -210,14 +210,14 @@ switch (sk->type) { case SOCK_STREAM: if (max_sdu_size != 0) { - ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n"); + ERROR("%s(), max_sdu_size must be 0\n", __FUNCTION__); return; } self->max_data_size = irttp_get_max_seg_size(self->tsap); break; case SOCK_SEQPACKET: if (max_sdu_size == 0) { - ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n"); + ERROR("%s(), max_sdu_size cannot be 0\n", __FUNCTION__); return; } self->max_data_size = max_sdu_size; @@ -226,7 +226,7 @@ self->max_data_size = irttp_get_max_seg_size(self->tsap); }; - IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", + IRDA_DEBUG(2, "%s(), max_data_size=%d\n", __FUNCTION__, self->max_data_size); memcpy(&self->qos_tx, qos, sizeof(struct qos_info)); @@ -253,7 +253,7 @@ self = (struct irda_sock *) instance; - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); sk = self->sk; if (sk == NULL) @@ -269,14 +269,14 @@ switch (sk->type) { case SOCK_STREAM: if (max_sdu_size != 0) { - ERROR(__FUNCTION__ "(), max_sdu_size must be 0\n"); + ERROR("%s(), max_sdu_size must be 0\n", __FUNCTION__); return; } self->max_data_size = irttp_get_max_seg_size(self->tsap); break; case SOCK_SEQPACKET: if (max_sdu_size == 0) { - ERROR(__FUNCTION__ "(), max_sdu_size cannot be 0\n"); + ERROR("%s(), max_sdu_size cannot be 0\n", __FUNCTION__); return; } self->max_data_size = max_sdu_size; @@ -285,7 +285,7 @@ self->max_data_size = irttp_get_max_seg_size(self->tsap); }; - IRDA_DEBUG(2, __FUNCTION__ "(), max_data_size=%d\n", + IRDA_DEBUG(2, "%s(), max_data_size=%d\n", __FUNCTION__ self->max_data_size); memcpy(&self->qos_tx, qos, sizeof(struct qos_info)); @@ -304,13 +304,13 @@ { struct sk_buff *skb; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); skb = dev_alloc_skb(64); if (skb == NULL) { - IRDA_DEBUG(0, __FUNCTION__ "() Unable to allocate sk_buff!\n"); + IRDA_DEBUG(0, "%s() Unable to allocate sk_buff!\n", __FUNCTION__); return; } @@ -331,7 +331,7 @@ struct irda_sock *self; struct sock *sk; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irda_sock *) instance; ASSERT(self != NULL, return;); @@ -341,17 +341,16 @@ switch (flow) { case FLOW_STOP: - IRDA_DEBUG(1, __FUNCTION__ "(), IrTTP wants us to slow down\n"); + IRDA_DEBUG(1, "%s(), IrTTP wants us to slow down\n", __FUNCTION__); self->tx_flow = flow; break; case FLOW_START: self->tx_flow = flow; - IRDA_DEBUG(1, __FUNCTION__ - "(), IrTTP wants us to start again\n"); + IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", __FUNCTION__); wake_up_interruptible(sk->sleep); break; default: - IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown flow command!\n"); + IRDA_DEBUG( 0, "%s(), Unknown flow command!\n", __FUNCTION__); /* Unknown flow command, better stop */ self->tx_flow = flow; break; @@ -373,11 +372,11 @@ self = (struct irda_sock *) priv; if (!self) { - WARNING(__FUNCTION__ "(), lost myself!\n"); + WARNING("%s(), lost myself!\n", __FUNCTION__); return; } - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); /* We probably don't need to make any more queries */ iriap_close(self->iriap); @@ -385,7 +384,7 @@ /* Check if request succeeded */ if (result != IAS_SUCCESS) { - IRDA_DEBUG(1, __FUNCTION__ "(), IAS query failed! (%d)\n", + IRDA_DEBUG(1, "%s(), IAS query failed! (%d)\n", __FUNCTION__ result); self->errno = result; /* We really need it later */ @@ -419,11 +418,11 @@ { struct irda_sock *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irda_sock *) priv; if (!self) { - WARNING(__FUNCTION__ "(), lost myself!\n"); + WARNING("%s(), lost myself!\n", __FUNCTION__); return; } @@ -456,7 +455,7 @@ { struct irda_sock *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irda_sock *) priv; ASSERT(self != NULL, return;); @@ -481,7 +480,7 @@ notify_t notify; if (self->tsap) { - WARNING(__FUNCTION__ "(), busy!\n"); + WARNING("%s(), busy!\n", __FUNCTION__); return -EBUSY; } @@ -499,7 +498,7 @@ self->tsap = irttp_open_tsap(tsap_sel, DEFAULT_INITIAL_CREDIT, ¬ify); if (self->tsap == NULL) { - IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate TSAP!\n"); + IRDA_DEBUG( 0, "%s(), Unable to allocate TSAP!\n", __FUNCTION__); return -ENOMEM; } /* Remember which TSAP selector we actually got */ @@ -520,7 +519,7 @@ notify_t notify; if (self->lsap) { - WARNING(__FUNCTION__ "(), busy!\n"); + WARNING("%s(), busy!\n", __FUNCTION__); return -EBUSY; } @@ -532,7 +531,7 @@ self->lsap = irlmp_open_lsap(LSAP_CONNLESS, ¬ify, pid); if (self->lsap == NULL) { - IRDA_DEBUG( 0, __FUNCTION__ "(), Unable to allocate LSAP!\n"); + IRDA_DEBUG( 0, "%s(), Unable to allocate LSAP!\n", __FUNCTION__); return -ENOMEM; } @@ -553,12 +552,12 @@ */ static int irda_find_lsap_sel(struct irda_sock *self, char *name) { - IRDA_DEBUG(2, __FUNCTION__ "(%p, %s)\n", self, name); + IRDA_DEBUG(2, "%s(%p, %s)\n", __FUNCTION__, self, name); ASSERT(self != NULL, return -1;); if (self->iriap) { - WARNING(__FUNCTION__ "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); return -EBUSY; } @@ -591,7 +590,7 @@ /* Get the remote TSAP selector */ switch (self->ias_result->type) { case IAS_INTEGER: - IRDA_DEBUG(4, __FUNCTION__ "() int=%d\n", + IRDA_DEBUG(4, "%s() int=%d\n", __FUNCTION__, self->ias_result->t.integer); if (self->ias_result->t.integer != -1) @@ -601,7 +600,7 @@ break; default: self->dtsap_sel = 0; - IRDA_DEBUG(0, __FUNCTION__ "(), bad type!\n"); + IRDA_DEBUG(0, "%s(), bad type!\n", __FUNCTION__); break; } if (self->ias_result) @@ -639,7 +638,7 @@ __u32 daddr = DEV_ADDR_ANY; /* Address we found the service on */ __u8 dtsap_sel = 0x0; /* TSAP associated with it */ - IRDA_DEBUG(2, __FUNCTION__ "(), name=%s\n", name); + IRDA_DEBUG(2, "%s(), name=%s\n", __FUNCTION__, name); ASSERT(self != NULL, return -1;); @@ -661,7 +660,7 @@ /* Try the address in the log */ self->daddr = discoveries[i].daddr; self->saddr = 0x0; - IRDA_DEBUG(1, __FUNCTION__ "(), trying daddr = %08x\n", + IRDA_DEBUG(1, "%s(), trying daddr = %08x\n", __FUNCTION__, self->daddr); /* Query remote LM-IAS for this service */ @@ -670,9 +669,8 @@ case 0: /* We found the requested service */ if(daddr != DEV_ADDR_ANY) { - IRDA_DEBUG(1, __FUNCTION__ - "(), discovered service ''%s'' in two different devices !!!\n", - name); + IRDA_DEBUG(1, "%s(), discovered service ''%s'' in two different devices !!!\n", + __FUNCTION__, name); self->daddr = DEV_ADDR_ANY; kfree(discoveries); return(-ENOTUNIQ); @@ -686,8 +684,7 @@ break; default: /* Something bad did happen :-( */ - IRDA_DEBUG(0, __FUNCTION__ - "(), unexpected IAS query failure\n"); + IRDA_DEBUG(0, "%s(), unexpected IAS query failure\n", __FUNCTION__); self->daddr = DEV_ADDR_ANY; kfree(discoveries); return(-EHOSTUNREACH); @@ -699,9 +696,8 @@ /* Check out what we found */ if(daddr == DEV_ADDR_ANY) { - IRDA_DEBUG(1, __FUNCTION__ - "(), cannot discover service ''%s'' in any device !!!\n", - name); + IRDA_DEBUG(1, "%s(), cannot discover service ''%s'' in any device !!!\n", + __FUNCTION__, name); self->daddr = DEV_ADDR_ANY; return(-EADDRNOTAVAIL); } @@ -711,9 +707,8 @@ self->saddr = 0x0; self->dtsap_sel = dtsap_sel; - IRDA_DEBUG(1, __FUNCTION__ - "(), discovered requested service ''%s'' at address %08x\n", - name, self->daddr); + IRDA_DEBUG(1, "%s(), discovered requested service ''%s'' at address %08x\n", + __FUNCTION__, name, self->daddr); return 0; } @@ -744,8 +739,8 @@ saddr.sir_addr = self->saddr; } - IRDA_DEBUG(1, __FUNCTION__ "(), tsap_sel = %#x\n", saddr.sir_lsap_sel); - IRDA_DEBUG(1, __FUNCTION__ "(), addr = %08x\n", saddr.sir_addr); + IRDA_DEBUG(1, "%s(), tsap_sel = %#x\n", __FUNCTION__, saddr.sir_lsap_sel); + IRDA_DEBUG(1, "%s(), addr = %08x\n", __FUNCTION__, saddr.sir_addr); /* uaddr_len come to us uninitialised */ *uaddr_len = sizeof (struct sockaddr_irda); @@ -764,7 +759,7 @@ { struct sock *sk = sock->sk; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if ((sk->type != SOCK_STREAM) && (sk->type != SOCK_SEQPACKET) && (sk->type != SOCK_DGRAM)) @@ -796,7 +791,7 @@ self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); if (addr_len != sizeof(struct sockaddr_irda)) return -EINVAL; @@ -806,8 +801,7 @@ if ((sk->type == SOCK_DGRAM) && (sk->protocol == IRDAPROTO_ULTRA)) { self->pid = addr->sir_lsap_sel; if (self->pid & 0x80) { - IRDA_DEBUG(0, __FUNCTION__ - "(), extension in PID not supp!\n"); + IRDA_DEBUG(0, "%s(), extension in PID not supp!\n", __FUNCTION__); return -EOPNOTSUPP; } err = irda_open_lsap(self, self->pid); @@ -852,7 +846,7 @@ struct sk_buff *skb; int err; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); @@ -898,7 +892,7 @@ /* Now attach up the new socket */ new->tsap = irttp_dup(self->tsap, new); if (!new->tsap) { - IRDA_DEBUG(0, __FUNCTION__ "(), dup failed!\n"); + IRDA_DEBUG(0, "%s(), dup failed!\n", __FUNCTION__); return -1; } @@ -959,7 +953,7 @@ self = sk->protinfo.irda; - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); /* Don't allow connect for Ultra sockets */ if ((sk->type == SOCK_DGRAM) && (sk->protocol == IRDAPROTO_ULTRA)) @@ -989,19 +983,18 @@ /* Try to find one suitable */ err = irda_discover_daddr_and_lsap_sel(self, addr->sir_name); if (err) { - IRDA_DEBUG(0, __FUNCTION__ - "(), auto-connect failed!\n"); + IRDA_DEBUG(0, "%s(), auto-connect failed!\n", __FUNCTION__); return err; } } else { /* Use the one provided by the user */ self->daddr = addr->sir_addr; - IRDA_DEBUG(1, __FUNCTION__ "(), daddr = %08x\n", self->daddr); + IRDA_DEBUG(1, "%s(), daddr = %08x\n", __FUNCTION__, self->daddr); /* Query remote LM-IAS */ err = irda_find_lsap_sel(self, addr->sir_name); if (err) { - IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n"); + IRDA_DEBUG(0, "%s(), connect failed!\n", __FUNCTION__); return err; } } @@ -1019,7 +1012,7 @@ self->saddr, self->daddr, NULL, self->max_sdu_size_rx, NULL); if (err) { - IRDA_DEBUG(0, __FUNCTION__ "(), connect failed!\n"); + IRDA_DEBUG(0, "%s(), connect failed!\n", __FUNCTION__); return err; } @@ -1064,7 +1057,7 @@ struct sock *sk; struct irda_sock *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Check for valid socket type */ switch (sock->type) { @@ -1088,7 +1081,7 @@ } memset(self, 0, sizeof(struct irda_sock)); - IRDA_DEBUG(2, __FUNCTION__ "() : self is %p\n", self); + IRDA_DEBUG(2, "%s() : self is %p\n", __FUNCTION__, self); init_waitqueue_head(&self->query_wait); @@ -1122,7 +1115,7 @@ self->max_sdu_size_rx = TTP_SAR_UNBOUND; break; default: - ERROR(__FUNCTION__ "(), protocol not supported!\n"); + ERROR("%s(), protocol not supported!\n", __FUNCTION__); return -ESOCKTNOSUPPORT; } break; @@ -1151,7 +1144,7 @@ */ void irda_destroy_socket(struct irda_sock *self) { - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); ASSERT(self != NULL, return;); @@ -1197,7 +1190,7 @@ { struct sock *sk = sock->sk; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (sk == NULL) return 0; @@ -1266,7 +1259,7 @@ unsigned char *asmptr; int err; - IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len); + IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); /* Note : socket.c set MSG_EOR on SEQPACKET sockets */ if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR)) @@ -1285,7 +1278,7 @@ /* Check if IrTTP is wants us to slow down */ while (self->tx_flow == FLOW_STOP) { - IRDA_DEBUG(2, __FUNCTION__ "(), IrTTP is busy, going to sleep!\n"); + IRDA_DEBUG(2, "%s(), IrTTP is busy, going to sleep!\n", __FUNCTION__); interruptible_sleep_on(sk->sleep); /* Check if we are still connected */ @@ -1298,8 +1291,7 @@ /* Check that we don't send out to big frames */ if (len > self->max_data_size) { - IRDA_DEBUG(2, __FUNCTION__ - "(), Chopping frame from %d to %d bytes!\n", len, + IRDA_DEBUG(2, "%s(), Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, self->max_data_size); len = self->max_data_size; } @@ -1320,7 +1312,7 @@ */ err = irttp_data_request(self->tsap, skb); if (err) { - IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err); + IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err); return err; } /* Tell client how much data we actually sent */ @@ -1341,7 +1333,7 @@ struct sk_buff *skb; int copied, err; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); @@ -1355,8 +1347,7 @@ copied = skb->len; if (copied > size) { - IRDA_DEBUG(2, __FUNCTION__ - "(), Received truncated frame (%d < %d)!\n", + IRDA_DEBUG(2, "%s(), Received truncated frame (%d < %d)!\n", __FUNCTION__, copied, size); copied = size; msg->msg_flags |= MSG_TRUNC; @@ -1373,7 +1364,7 @@ */ if (self->rx_flow == FLOW_STOP) { if ((atomic_read(&sk->rmem_alloc) << 2) <= sk->rcvbuf) { - IRDA_DEBUG(2, __FUNCTION__ "(), Starting IrTTP\n"); + IRDA_DEBUG(2, "%s(), Starting IrTTP\n", __FUNCTION__); self->rx_flow = FLOW_START; irttp_flow_request(self->tsap, FLOW_START); } @@ -1412,7 +1403,7 @@ int copied = 0; int target = 1; - IRDA_DEBUG(3, __FUNCTION__ "()\n"); + IRDA_DEBUG(3, "%s()\n", __FUNCTION__); self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); @@ -1472,14 +1463,14 @@ /* put the skb back if we didn't use it up.. */ if (skb->len) { - IRDA_DEBUG(1, __FUNCTION__ "(), back on q!\n"); + IRDA_DEBUG(1, "%s(), back on q!\n", __FUNCTION__); skb_queue_head(&sk->receive_queue, skb); break; } kfree_skb(skb); } else { - IRDA_DEBUG(0, __FUNCTION__ "() questionable!?\n"); + IRDA_DEBUG(0, "%s() questionable!?\n", __FUNCTION__); /* put message back and return */ skb_queue_head(&sk->receive_queue, skb); @@ -1495,7 +1486,7 @@ */ if (self->rx_flow == FLOW_STOP) { if ((atomic_read(&sk->rmem_alloc) << 2) <= sk->rcvbuf) { - IRDA_DEBUG(2, __FUNCTION__ "(), Starting IrTTP\n"); + IRDA_DEBUG(2, "%s(), Starting IrTTP\n", __FUNCTION__); self->rx_flow = FLOW_START; irttp_flow_request(self->tsap, FLOW_START); } @@ -1520,7 +1511,7 @@ unsigned char *asmptr; int err; - IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len); + IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); if (msg->msg_flags & ~MSG_DONTWAIT) return -EINVAL; @@ -1541,8 +1532,8 @@ * service, so we have no fragmentation and no coalescence */ if (len > self->max_data_size) { - IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! " - "Chopping frame from %d to %d bytes!\n", len, + IRDA_DEBUG(0, "%s(), Warning to much data! " + "Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, self->max_data_size); len = self->max_data_size; } @@ -1554,7 +1545,7 @@ skb_reserve(skb, self->max_header_size); - IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n"); + IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); asmptr = skb->h.raw = skb_put(skb, len); memcpy_fromiovec(asmptr, msg->msg_iov, len); @@ -1564,7 +1555,7 @@ */ err = irttp_udata_request(self->tsap, skb); if (err) { - IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err); + IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err); return err; } return len; @@ -1586,7 +1577,7 @@ unsigned char *asmptr; int err; - IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len); + IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__, len); if (msg->msg_flags & ~MSG_DONTWAIT) return -EINVAL; @@ -1604,8 +1595,8 @@ * service, so we have no fragmentation and no coalescence */ if (len > self->max_data_size) { - IRDA_DEBUG(0, __FUNCTION__ "(), Warning to much data! " - "Chopping frame from %d to %d bytes!\n", len, + IRDA_DEBUG(0, "%s(), Warning to much data! " + "Chopping frame from %d to %d bytes!\n", __FUNCTION__, len, self->max_data_size); len = self->max_data_size; } @@ -1617,13 +1608,13 @@ skb_reserve(skb, self->max_header_size); - IRDA_DEBUG(4, __FUNCTION__ "(), appending user data\n"); + IRDA_DEBUG(4, "%s(), appending user data\n", __FUNCTION__); asmptr = skb->h.raw = skb_put(skb, len); memcpy_fromiovec(asmptr, msg->msg_iov, len); err = irlmp_connless_data_request(self->lsap, skb); if (err) { - IRDA_DEBUG(0, __FUNCTION__ "(), err=%d\n", err); + IRDA_DEBUG(0, "%s(), err=%d\n", __FUNCTION__, err); return err; } return len; @@ -1644,7 +1635,7 @@ self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); - IRDA_DEBUG(1, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(1, "%s(%p)\n", __FUNCTION__, self); sk->state = TCP_CLOSE; sk->shutdown |= SEND_SHUTDOWN; @@ -1682,7 +1673,7 @@ unsigned int mask; struct irda_sock *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = sk->protinfo.irda; poll_wait(file, sk->sleep, wait); @@ -1692,7 +1683,7 @@ if (sk->err) mask |= POLLERR; if (sk->shutdown & RCV_SHUTDOWN) { - IRDA_DEBUG(0, __FUNCTION__ "(), POLLHUP\n"); + IRDA_DEBUG(0, "%s(), POLLHUP\n", __FUNCTION__); mask |= POLLHUP; } @@ -1706,7 +1697,7 @@ switch (sk->type) { case SOCK_STREAM: if (sk->state == TCP_CLOSE) { - IRDA_DEBUG(0, __FUNCTION__ "(), POLLHUP\n"); + IRDA_DEBUG(0, "%s(), POLLHUP\n", __FUNCTION__); mask |= POLLHUP; } @@ -1745,7 +1736,7 @@ { struct sock *sk = sock->sk; - IRDA_DEBUG(4, __FUNCTION__ "(), cmd=%#x\n", cmd); + IRDA_DEBUG(4, "%s(), cmd=%#x\n", __FUNCTION__, cmd); switch (cmd) { case TIOCOUTQ: { @@ -1792,7 +1783,7 @@ case SIOCSIFMETRIC: return -EINVAL; default: - IRDA_DEBUG(1, __FUNCTION__ "(), doing device ioctl!\n"); + IRDA_DEBUG(1, "%s(), doing device ioctl!\n", __FUNCTION__); return dev_ioctl(cmd, (void *) arg); } @@ -1819,7 +1810,7 @@ self = sk->protinfo.irda; ASSERT(self != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); if (level != SOL_IRLMP) return -ENOPROTOOPT; @@ -1981,8 +1972,7 @@ /* Check is the user space own the object */ if(ias_attr->value->owner != IAS_USER_ATTR) { - IRDA_DEBUG(1, __FUNCTION__ - "(), attempting to delete a kernel attribute\n"); + IRDA_DEBUG(1, "%s(), attempting to delete a kernel attribute\n", __FUNCTION__); kfree(ias_opt); return -EPERM; } @@ -2000,13 +1990,11 @@ /* Only possible for a seqpacket service (TTP with SAR) */ if (sk->type != SOCK_SEQPACKET) { - IRDA_DEBUG(2, __FUNCTION__ - "(), setting max_sdu_size = %d\n", opt); + IRDA_DEBUG(2, "%s(), setting max_sdu_size = %d\n", __FUNCTION__, opt); self->max_sdu_size_rx = opt; } else { - WARNING(__FUNCTION__ - "(), not allowed to set MAXSDUSIZE for this " - "socket type!\n"); + WARNING("%s(), not allowed to set MAXSDUSIZE for this " + "socket type!\n", __FUNCTION__); return -ENOPROTOOPT; } break; @@ -2123,7 +2111,7 @@ self = sk->protinfo.irda; - IRDA_DEBUG(2, __FUNCTION__ "(%p)\n", self); + IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); if (level != SOL_IRLMP) return -ENOPROTOOPT; @@ -2283,8 +2271,7 @@ /* Check that we can proceed with IAP */ if (self->iriap) { - WARNING(__FUNCTION__ - "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); kfree(ias_opt); return -EBUSY; } @@ -2365,8 +2352,7 @@ /* Wait until a node is discovered */ if (!self->cachediscovery) { - IRDA_DEBUG(1, __FUNCTION__ - "(), nothing discovered yet, going to sleep...\n"); + IRDA_DEBUG(1, "%s(), nothing discovered yet, going to sleep...\n", __FUNCTION__); /* Set watchdog timer to expire in ms. */ self->watchdog.function = irda_discovery_timeout; @@ -2381,12 +2367,10 @@ if(timer_pending(&(self->watchdog))) del_timer(&(self->watchdog)); - IRDA_DEBUG(1, __FUNCTION__ - "(), ...waking up !\n"); + IRDA_DEBUG(1, "%s(), ...waking up !\n", __FUNCTION__); } else - IRDA_DEBUG(1, __FUNCTION__ - "(), found immediately !\n"); + IRDA_DEBUG(1, "%s(), found immediately !\n", __FUNCTION__); /* Tell IrLMP that we have been notified */ irlmp_update_client(self->ckey, self->mask, NULL, NULL, NULL); @@ -2527,11 +2511,11 @@ switch (event) { case NETDEV_UP: - IRDA_DEBUG(3, __FUNCTION__ "(), NETDEV_UP\n"); + IRDA_DEBUG(3, "%s(), NETDEV_UP\n", __FUNCTION__); /* irda_dev_device_up(dev); */ break; case NETDEV_DOWN: - IRDA_DEBUG(3, __FUNCTION__ "(), NETDEV_DOWN\n"); + IRDA_DEBUG(3, "%s(), NETDEV_DOWN\n", __FUNCTION__); /* irda_kill_by_device(dev); */ /* irda_rt_device_down(dev); */ /* irda_dev_device_down(dev); */ diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_core.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_core.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_core.c 2003-06-13 07:51:39.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_core.c 2003-10-20 02:49:38.000000000 -0700 @@ -63,7 +63,7 @@ { ircomm = hashbin_new(HB_LOCAL); if (ircomm == NULL) { - ERROR(__FUNCTION__ "(), can't allocate hashbin!\n"); + ERROR("%s(), can't allocate hashbin!\n", __FUNCTION__); return -ENOMEM; } @@ -79,7 +79,7 @@ #ifdef MODULE void ircomm_cleanup(void) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); hashbin_delete(ircomm, (FREE_FUNC) __ircomm_close); @@ -100,7 +100,7 @@ struct ircomm_cb *self = NULL; int ret; - IRDA_DEBUG(2, __FUNCTION__ "(), service_type=0x%02x\n", + IRDA_DEBUG(2, "%s(), service_type=0x%02x\n", __FUNCTION__, service_type); ASSERT(ircomm != NULL, return NULL;); @@ -144,7 +144,7 @@ */ static int __ircomm_close(struct ircomm_cb *self) { - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2,"%s()\n", __FUNCTION__); /* Disconnect link if any */ ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, NULL, NULL); @@ -180,7 +180,7 @@ ASSERT(self != NULL, return -EIO;); ASSERT(self->magic == IRCOMM_MAGIC, return -EIO;); - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); entry = hashbin_remove(ircomm, self->line, NULL); @@ -203,7 +203,7 @@ struct ircomm_info info; int ret; - IRDA_DEBUG(2 , __FUNCTION__"()\n"); + IRDA_DEBUG(2 ,"%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_MAGIC, return -1;); @@ -230,7 +230,7 @@ { int clen = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Check if the packet contains data on the control channel */ if (skb->len > 0) @@ -246,7 +246,7 @@ info->qos, info->max_data_size, info->max_header_size, skb); else { - IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n"); + IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -264,7 +264,7 @@ ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_MAGIC, return -1;); - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ret = ircomm_do_event(self, IRCOMM_CONNECT_RESPONSE, userdata, NULL); @@ -280,7 +280,7 @@ void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb, struct ircomm_info *info) { - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4,"%s()\n", __FUNCTION__); if (self->notify.connect_confirm ) self->notify.connect_confirm(self->notify.instance, @@ -288,7 +288,7 @@ info->max_data_size, info->max_header_size, skb); else { - IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n"); + IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -303,7 +303,7 @@ { int ret; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4,"%s()\n", __FUNCTION__); ASSERT(self != NULL, return -EFAULT;); ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;); @@ -322,14 +322,14 @@ */ void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(skb->len > 0, return;); if (self->notify.data_indication) self->notify.data_indication(self->notify.instance, self, skb); else { - IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n"); + IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -362,8 +362,7 @@ if (skb->len) ircomm_data_indication(self, skb); else { - IRDA_DEBUG(4, __FUNCTION__ - "(), data was control info only!\n"); + IRDA_DEBUG(4, "%s(), data was control info only!\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -378,7 +377,7 @@ { int ret; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -EFAULT;); ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;); @@ -400,7 +399,7 @@ { struct sk_buff *ctrl_skb; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ctrl_skb = skb_clone(skb, GFP_ATOMIC); if (!ctrl_skb) @@ -414,7 +413,7 @@ self->notify.udata_indication(self->notify.instance, self, ctrl_skb); else { - IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n"); + IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -430,7 +429,7 @@ struct ircomm_info info; int ret; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_MAGIC, return -1;); @@ -449,7 +448,7 @@ void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb, struct ircomm_info *info) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(info != NULL, return;); @@ -457,7 +456,7 @@ self->notify.disconnect_indication(self->notify.instance, self, info->reason, skb); } else { - IRDA_DEBUG(0, __FUNCTION__ "(), missing handler\n"); + IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -470,7 +469,7 @@ */ void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_event.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_event.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_event.c 2001-03-02 11:12:12.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_event.c 2003-10-20 02:49:38.000000000 -0700 @@ -107,7 +107,7 @@ ircomm_connect_indication(self, skb, info); break; default: - IRDA_DEBUG(4, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(4,"%s(), unknown event: %s\n", __FUNCTION__, ircomm_event[event]); if (skb) dev_kfree_skb(skb); @@ -139,7 +139,7 @@ ircomm_disconnect_indication(self, skb, info); break; default: - IRDA_DEBUG(0, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(0, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_event[event]); if (skb) dev_kfree_skb(skb); @@ -174,7 +174,7 @@ ircomm_disconnect_indication(self, skb, info); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), unknown event = %s\n", + IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__, ircomm_event[event]); if (skb) dev_kfree_skb(skb); @@ -218,7 +218,7 @@ ret = self->issue.disconnect_request(self, skb, info); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), unknown event = %s\n", + IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__, ircomm_event[event]); if (skb) dev_kfree_skb(skb); @@ -236,7 +236,7 @@ int ircomm_do_event(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info) { - IRDA_DEBUG(4, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(4, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_state[self->state], ircomm_event[event]); return (*state[self->state])(self, event, skb, info); @@ -252,6 +252,6 @@ { self->state = state; - IRDA_DEBUG(4, __FUNCTION__": next state=%s, service type=%d\n", + IRDA_DEBUG(4, "%s: next state=%s, service type=%d\n", __FUNCTION__, ircomm_state[self->state], self->service_type); } diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_lmp.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_lmp.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_lmp.c 2002-02-25 11:38:14.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_lmp.c 2003-10-20 02:49:38.000000000 -0700 @@ -49,7 +49,7 @@ { notify_t notify; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* Register callbacks */ irda_notify_init(¬ify); @@ -62,7 +62,7 @@ self->lsap = irlmp_open_lsap(LSAP_ANY, ¬ify, 0); if (!self->lsap) { - IRDA_DEBUG(0,__FUNCTION__"failed to allocate tsap\n"); + IRDA_DEBUG(0, "%s failed to allocate tsap\n", __FUNCTION__); return -1; } self->slsap_sel = self->lsap->slsap_sel; @@ -90,7 +90,7 @@ { int ret = 0; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ret = irlmp_connect_request(self->lsap, info->dlsap_sel, info->saddr, info->daddr, NULL, userdata); @@ -108,7 +108,7 @@ struct sk_buff *skb; int ret; - IRDA_DEBUG(0, __FUNCTION__"()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* Any userdata supplied? */ if (userdata == NULL) { @@ -139,7 +139,7 @@ struct sk_buff *skb; int ret; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); if (!userdata) { skb = dev_alloc_skb(64); @@ -172,13 +172,13 @@ cb = (struct irda_skb_cb *) skb->cb; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); line = cb->line; self = (struct ircomm_cb *) hashbin_find(ircomm, line, NULL); if (!self) { - IRDA_DEBUG(2, __FUNCTION__ "(), didn't find myself\n"); + IRDA_DEBUG(2, "%s(), didn't find myself\n", __FUNCTION__); return; } @@ -188,7 +188,7 @@ self->pkt_count--; if ((self->pkt_count < 2) && (self->flow_status == FLOW_STOP)) { - IRDA_DEBUG(2, __FUNCTION__ "(), asking TTY to start again!\n"); + IRDA_DEBUG(2, "%s(), asking TTY to start again!\n", __FUNCTION__); self->flow_status = FLOW_START; if (self->notify.flow_indication) self->notify.flow_indication(self->notify.instance, @@ -214,12 +214,12 @@ cb->line = self->line; - IRDA_DEBUG(4, __FUNCTION__"(), sending frame\n"); + IRDA_DEBUG(4, "%s(), sending frame\n", __FUNCTION__); skb->destructor = ircomm_lmp_flow_control; if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) { - IRDA_DEBUG(2, __FUNCTION__ "(), asking TTY to slow down!\n"); + IRDA_DEBUG(2, "%s(), asking TTY to slow down!\n", __FUNCTION__); self->flow_status = FLOW_STOP; if (self->notify.flow_indication) self->notify.flow_indication(self->notify.instance, @@ -227,7 +227,7 @@ } ret = irlmp_data_request(self->lsap, skb); if (ret) { - ERROR(__FUNCTION__ "(), failed\n"); + ERROR("%s(), failed\n", __FUNCTION__); dev_kfree_skb(skb); } @@ -245,7 +245,7 @@ { struct ircomm_cb *self = (struct ircomm_cb *) instance; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_MAGIC, return -1;); @@ -272,7 +272,7 @@ struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; - IRDA_DEBUG(0, __FUNCTION__"()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); @@ -302,7 +302,7 @@ struct ircomm_cb *self = (struct ircomm_cb *)instance; struct ircomm_info info; - IRDA_DEBUG(0, __FUNCTION__"()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); @@ -329,7 +329,7 @@ struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; - IRDA_DEBUG(0, __FUNCTION__"()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_param.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_param.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_param.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_param.c 2003-10-20 02:49:38.000000000 -0700 @@ -118,7 +118,7 @@ struct sk_buff *skb; int count; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); @@ -152,7 +152,7 @@ count = irda_param_insert(self, pi, skb->tail, skb_tailroom(skb), &ircomm_param_info); if (count < 0) { - WARNING(__FUNCTION__ "(), no room for parameter!\n"); + WARNING("%s(), no room for parameter!\n", __FUNCTION__); restore_flags(flags); return -1; } @@ -160,7 +160,7 @@ restore_flags(flags); - IRDA_DEBUG(2, __FUNCTION__ "(), skb->len=%d\n", skb->len); + IRDA_DEBUG(2, "%s(), skb->len=%d\n", __FUNCTION__, skb->len); if (flush) { /* ircomm_tty_do_softint will take care of the rest */ @@ -195,11 +195,10 @@ /* Find all common service types */ service_type &= self->service_type; if (!service_type) { - IRDA_DEBUG(2, __FUNCTION__ - "(), No common service type to use!\n"); + IRDA_DEBUG(2, "%s(), No common service type to use!\n", __FUNCTION__); return -1; } - IRDA_DEBUG(0, __FUNCTION__ "(), services in common=%02x\n", + IRDA_DEBUG(0, __FUNCTION__ "%s(), services in common=%02x\n", __FUNCTION__, service_type); /* @@ -214,7 +213,7 @@ else if (service_type & IRCOMM_3_WIRE_RAW) self->settings.service_type = IRCOMM_3_WIRE_RAW; - IRDA_DEBUG(0, __FUNCTION__ "(), resulting service type=0x%02x\n", + IRDA_DEBUG(0, "%s(), resulting service type=0x%02x\n", __FUNCTION__, self->settings.service_type); /* @@ -257,7 +256,7 @@ else { self->settings.port_type = (__u8) param->pv.i; - IRDA_DEBUG(0, __FUNCTION__ "(), port type=%d\n", + IRDA_DEBUG(0, "%s(), port type=%d\n", __FUNCTION__, self->settings.port_type); } return 0; @@ -277,9 +276,9 @@ ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); if (get) { - IRDA_DEBUG(0, __FUNCTION__ "(), not imp!\n"); + IRDA_DEBUG(0, "%s(), not imp!\n", __FUNCTION__); } else { - IRDA_DEBUG(0, __FUNCTION__ "(), port-name=%s\n", param->pv.c); + IRDA_DEBUG(0, "%s(), port-name=%s\n", __FUNCTION__, param->pv.c); strncpy(self->settings.port_name, param->pv.c, 32); } @@ -304,7 +303,7 @@ else self->settings.data_rate = param->pv.i; - IRDA_DEBUG(2, __FUNCTION__ "(), data rate = %d\n", param->pv.i); + IRDA_DEBUG(2, "%s(), data rate = %d\n", __FUNCTION__, param->pv.i); return 0; } @@ -350,7 +349,7 @@ else self->settings.flow_control = (__u8) param->pv.i; - IRDA_DEBUG(1, __FUNCTION__ "(), flow control = 0x%02x\n", (__u8) param->pv.i); + IRDA_DEBUG(1, "%s(), flow control = 0x%02x\n", __FUNCTION__, (__u8) param->pv.i); return 0; } @@ -376,7 +375,7 @@ self->settings.xonxoff[1] = (__u16) param->pv.i >> 8; } - IRDA_DEBUG(0, __FUNCTION__ "(), XON/XOFF = 0x%02x,0x%02x\n", + IRDA_DEBUG(0, "%s(), XON/XOFF = 0x%02x,0x%02x\n", __FUNCTION__, param->pv.i & 0xff, param->pv.i >> 8); return 0; @@ -403,7 +402,7 @@ self->settings.enqack[1] = (__u16) param->pv.i >> 8; } - IRDA_DEBUG(0, __FUNCTION__ "(), ENQ/ACK = 0x%02x,0x%02x\n", + IRDA_DEBUG(0, "%s(), ENQ/ACK = 0x%02x,0x%02x\n", __FUNCTION__, param->pv.i & 0xff, param->pv.i >> 8); return 0; @@ -418,7 +417,7 @@ static int ircomm_param_line_status(void *instance, irda_param_t *param, int get) { - IRDA_DEBUG(2, __FUNCTION__ "(), not impl.\n"); + IRDA_DEBUG(2, "%s(), not impl.\n", __FUNCTION__); return 0; } @@ -477,7 +476,7 @@ struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; __u8 dce; - IRDA_DEBUG(1, __FUNCTION__ "(), dce = 0x%02x\n", (__u8) param->pv.i); + IRDA_DEBUG(1, "%s(), dce = 0x%02x\n", __FUNCTION__, (__u8) param->pv.i); dce = (__u8) param->pv.i; @@ -489,7 +488,7 @@ /* Check if any of the settings have changed */ if (dce & 0x0f) { if (dce & IRCOMM_DELTA_CTS) { - IRDA_DEBUG(2, __FUNCTION__ "(), CTS \n"); + IRDA_DEBUG(2, "%s(), CTS \n", __FUNCTION__); } } diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_ttp.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_ttp.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_ttp.c 2001-03-02 11:12:12.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_ttp.c 2003-10-20 02:49:38.000000000 -0700 @@ -49,7 +49,7 @@ { notify_t notify; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* Register callbacks */ irda_notify_init(¬ify); @@ -64,7 +64,7 @@ self->tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, ¬ify); if (!self->tsap) { - IRDA_DEBUG(0, __FUNCTION__"failed to allocate tsap\n"); + IRDA_DEBUG(0, "%s failed to allocate tsap\n", __FUNCTION__); return -1; } self->slsap_sel = self->tsap->stsap_sel; @@ -92,7 +92,7 @@ { int ret = 0; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ret = irttp_connect_request(self->tsap, info->dlsap_sel, info->saddr, info->daddr, NULL, @@ -110,7 +110,7 @@ { int ret; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ret = irttp_connect_response(self->tsap, TTP_SAR_DISABLE, skb); @@ -133,7 +133,7 @@ ASSERT(skb != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__"(), clen=%d\n", clen); + IRDA_DEBUG(2, "%s(), clen=%d\n", __FUNCTION__, clen); /* * Insert clen field, currently we either send data only, or control @@ -146,7 +146,7 @@ ret = irttp_data_request(self->tsap, skb); if (ret) { - ERROR(__FUNCTION__ "(), failed\n"); + ERROR("%s(), failed\n", __FUNCTION__); dev_kfree_skb(skb); } @@ -164,7 +164,7 @@ { struct ircomm_cb *self = (struct ircomm_cb *) instance; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_MAGIC, return -1;); @@ -184,7 +184,7 @@ struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); @@ -192,7 +192,7 @@ ASSERT(qos != NULL, return;); if (max_sdu_size != TTP_SAR_DISABLE) { - ERROR(__FUNCTION__ "(), SAR not allowed for IrCOMM!\n"); + ERROR("%s(), SAR not allowed for IrCOMM!\n", __FUNCTION__); dev_kfree_skb(skb); return; } @@ -221,7 +221,7 @@ struct ircomm_cb *self = (struct ircomm_cb *)instance; struct ircomm_info info; - IRDA_DEBUG(4, __FUNCTION__"()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); @@ -229,7 +229,7 @@ ASSERT(qos != NULL, return;); if (max_sdu_size != TTP_SAR_DISABLE) { - ERROR(__FUNCTION__ "(), SAR not allowed for IrCOMM!\n"); + ERROR("%s(), SAR not allowed for IrCOMM!\n", __FUNCTION__); dev_kfree_skb(skb); return; } @@ -272,7 +272,7 @@ struct ircomm_cb *self = (struct ircomm_cb *) instance; struct ircomm_info info; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); @@ -292,7 +292,7 @@ { struct ircomm_cb *self = (struct ircomm_cb *) instance; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_MAGIC, return;); diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_tty_attach.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_tty_attach.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_tty_attach.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_tty_attach.c 2003-10-20 02:49:38.000000000 -0700 @@ -126,14 +126,14 @@ */ int ircomm_tty_attach_cable(struct ircomm_tty_cb *self) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); /* Check if somebody has already connected to us */ if (ircomm_is_connected(self->ircomm)) { - IRDA_DEBUG(0, __FUNCTION__ "(), already connected!\n"); + IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__); return 0; } @@ -144,7 +144,7 @@ /* Check if somebody has already connected to us */ if (ircomm_is_connected(self->ircomm)) { - IRDA_DEBUG(0, __FUNCTION__ "(), already connected!\n"); + IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__); return 0; } @@ -161,7 +161,7 @@ */ void ircomm_tty_detach_cable(struct ircomm_tty_cb *self) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -203,7 +203,7 @@ __u8 oct_seq[6]; __u16 hints; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -258,16 +258,16 @@ * Set default values, but only if the application for some reason * haven't set them already */ - IRDA_DEBUG(2, __FUNCTION__ "(), data-rate = %d\n", + IRDA_DEBUG(2, "%s(), data-rate = %d\n", __FUNCTION__, self->settings.data_rate); if (!self->settings.data_rate) self->settings.data_rate = 9600; - IRDA_DEBUG(2, __FUNCTION__ "(), data-format = %d\n", + IRDA_DEBUG(2, "%s(), data-format = %d\n", __FUNCTION__, self->settings.data_format); if (!self->settings.data_format) self->settings.data_format = IRCOMM_WSIZE_8; /* 8N1 */ - IRDA_DEBUG(2, __FUNCTION__ "(), flow-control = %d\n", + IRDA_DEBUG(2, "%s(), flow-control = %d\n", __FUNCTION__, self->settings.flow_control); /*self->settings.flow_control = IRCOMM_RTS_CTS_IN|IRCOMM_RTS_CTS_OUT;*/ @@ -312,7 +312,7 @@ struct ircomm_tty_cb *self; struct ircomm_tty_info info; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Important note : * We need to drop all passive discoveries. @@ -354,7 +354,7 @@ { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -384,7 +384,7 @@ { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) priv; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -395,13 +395,13 @@ /* Check if request succeeded */ if (result != IAS_SUCCESS) { - IRDA_DEBUG(4, __FUNCTION__ "(), got NULL value!\n"); + IRDA_DEBUG(4, "%s(), got NULL value!\n", __FUNCTION__); return; } switch (value->type) { case IAS_OCT_SEQ: - IRDA_DEBUG(2, __FUNCTION__"(), got octet sequence\n"); + IRDA_DEBUG(2, "%s(), got octet sequence\n", __FUNCTION__); irda_param_extract_all(self, value->t.oct_seq, value->len, &ircomm_param_info); @@ -411,21 +411,21 @@ break; case IAS_INTEGER: /* Got LSAP selector */ - IRDA_DEBUG(2, __FUNCTION__"(), got lsapsel = %d\n", + IRDA_DEBUG(2, "%s(), got lsapsel = %d\n", __FUNCTION__, value->t.integer); if (value->t.integer == -1) { - IRDA_DEBUG(0, __FUNCTION__"(), invalid value!\n"); + IRDA_DEBUG(0, "%s(), invalid value!\n", __FUNCTION__); } else self->dlsap_sel = value->t.integer; ircomm_tty_do_event(self, IRCOMM_TTY_GOT_LSAPSEL, NULL, NULL); break; case IAS_MISSING: - IRDA_DEBUG(0, __FUNCTION__"(), got IAS_MISSING\n"); + IRDA_DEBUG(0, "%s(), got IAS_MISSING\n", __FUNCTION__); break; default: - IRDA_DEBUG(0, __FUNCTION__"(), got unknown type!\n"); + IRDA_DEBUG(0, "%s(), got unknown type!\n", __FUNCTION__); break; } irias_delete_value(value); @@ -445,7 +445,7 @@ { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -476,7 +476,7 @@ struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; int clen; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -505,7 +505,7 @@ */ void ircomm_tty_link_established(struct ircomm_tty_cb *self) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -580,7 +580,7 @@ { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) data; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); @@ -601,7 +601,7 @@ { int ret = 0; - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); switch (event) { case IRCOMM_TTY_ATTACH_CABLE: @@ -616,8 +616,7 @@ self->saddr = info->saddr; if (self->iriap) { - WARNING(__FUNCTION__ - "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); return -EBUSY; } @@ -645,7 +644,7 @@ ircomm_tty_next_state(self, IRCOMM_TTY_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -665,7 +664,7 @@ { int ret = 0; - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); switch (event) { @@ -674,8 +673,7 @@ self->saddr = info->saddr; if (self->iriap) { - WARNING(__FUNCTION__ - "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); return -EBUSY; } @@ -717,7 +715,7 @@ ircomm_tty_next_state(self, IRCOMM_TTY_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -737,14 +735,13 @@ { int ret = 0; - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); switch (event) { case IRCOMM_TTY_GOT_PARAMETERS: if (self->iriap) { - WARNING(__FUNCTION__ - "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); return -EBUSY; } @@ -774,7 +771,7 @@ ircomm_tty_next_state(self, IRCOMM_TTY_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -794,7 +791,7 @@ { int ret = 0; - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); switch (event) { @@ -822,7 +819,7 @@ ircomm_tty_next_state(self, IRCOMM_TTY_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -842,7 +839,7 @@ { int ret = 0; - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); switch (event) { @@ -874,7 +871,7 @@ ircomm_tty_next_state(self, IRCOMM_TTY_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -911,13 +908,13 @@ self->settings.dce = IRCOMM_DELTA_CD; ircomm_tty_check_modem_status(self); } else { - IRDA_DEBUG(0, __FUNCTION__ "(), hanging up!\n"); + IRDA_DEBUG(0, "%s(), hanging up!\n", __FUNCTION__); if (self->tty) tty_hangup(self->tty); } break; default: - IRDA_DEBUG(2, __FUNCTION__"(), unknown event: %s\n", + IRDA_DEBUG(2, "%s(), unknown event: %s\n", __FUNCTION__, ircomm_tty_event[event]); return -EINVAL; } @@ -936,7 +933,7 @@ ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); - IRDA_DEBUG(2, __FUNCTION__": state=%s, event=%s\n", + IRDA_DEBUG(2, "%s: state=%s, event=%s\n", __FUNCTION__, ircomm_tty_state[self->state], ircomm_tty_event[event]); return (*state[self->state])(self, event, skb, info); @@ -955,7 +952,7 @@ self->state = state; - IRDA_DEBUG(2, __FUNCTION__": next state=%s, service type=%d\n", + IRDA_DEBUG(2, "%s: next state=%s, service type=%d\n", __FUNCTION__, ircomm_tty_state[self->state], self->service_type); } diff -urN linux-2.4.22-bk36/net/irda/ircomm/ircomm_tty_ioctl.c linux-2.4.22-bk37/net/irda/ircomm/ircomm_tty_ioctl.c --- linux-2.4.22-bk36/net/irda/ircomm/ircomm_tty_ioctl.c 2002-11-28 15:53:16.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/ircomm/ircomm_tty_ioctl.c 2003-10-20 02:49:38.000000000 -0700 @@ -59,7 +59,7 @@ unsigned cflag, cval; int baud; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (!self->tty || !self->tty->termios || !self->ircomm) return; @@ -96,7 +96,7 @@ self->settings.flow_control |= IRCOMM_RTS_CTS_IN; /* This got me. Bummer. Jean II */ if (self->service_type == IRCOMM_3_WIRE_RAW) - WARNING(__FUNCTION__ "(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n"); + WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __FUNCTION__); } else { self->flags &= ~ASYNC_CTS_FLOW; self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; @@ -152,7 +152,7 @@ struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; unsigned int cflag = tty->termios->c_cflag; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if ((cflag == old_termios->c_cflag) && (RELEVANT_IFLAG(tty->termios->c_iflag) == @@ -201,7 +201,7 @@ { unsigned int result; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); result = ((self->settings.dte & IRCOMM_RTS) ? TIOCM_RTS : 0) | ((self->settings.dte & IRCOMM_DTR) ? TIOCM_DTR : 0) @@ -225,7 +225,7 @@ unsigned int arg; __u8 old_rts, old_dtr; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); @@ -287,7 +287,7 @@ if (!retinfo) return -EFAULT; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); memset(&info, 0, sizeof(info)); info.line = self->line; @@ -323,7 +323,7 @@ struct serial_struct new_serial; struct ircomm_tty_cb old_state, *state; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); if (copy_from_user(&new_serial,new_info,sizeof(new_serial))) return -EFAULT; @@ -397,7 +397,7 @@ struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && @@ -426,7 +426,7 @@ break; case TIOCGICOUNT: - IRDA_DEBUG(0, __FUNCTION__ "(), TIOCGICOUNT not impl!\n"); + IRDA_DEBUG(0, "%s(), TIOCGICOUNT not impl!\n", __FUNCTION__); #if 0 save_flags(flags); cli(); cnow = driver->icount; diff -urN linux-2.4.22-bk36/net/irda/irda_device.c linux-2.4.22-bk37/net/irda/irda_device.c --- linux-2.4.22-bk36/net/irda/irda_device.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irda_device.c 2003-10-20 02:49:38.000000000 -0700 @@ -174,7 +174,7 @@ void irda_device_cleanup(void) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); hashbin_delete(tasks, (FREE_FUNC) __irda_task_delete); hashbin_delete(dongles, NULL); @@ -190,7 +190,7 @@ { struct irlap_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "(%s)\n", status ? "TRUE" : "FALSE"); + IRDA_DEBUG(4, "%s(%s)\n", __FUNCTION__, status ? "TRUE" : "FALSE"); self = (struct irlap_cb *) dev->atalk_ptr; @@ -215,11 +215,11 @@ struct if_irda_req req; int ret; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (!dev->do_ioctl) { - ERROR(__FUNCTION__ "(), do_ioctl not impl. by " - "device driver\n"); + ERROR("%s(), do_ioctl not impl. by " + "device driver\n", __FUNCTION__); return -1; } @@ -236,11 +236,11 @@ struct if_irda_req req; int ret; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (!dev->do_ioctl) { - ERROR(__FUNCTION__ "(), do_ioctl not impl. by " - "device driver\n"); + ERROR("%s(), do_ioctl not impl. by " + "device driver\n", __FUNCTION__); return -1; } @@ -262,11 +262,11 @@ struct if_irda_req req; int ret; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (!dev->do_ioctl) { - ERROR(__FUNCTION__ "(), do_ioctl not impl. by " - "device driver\n"); + ERROR("%s(), do_ioctl not impl. by " + "device driver\n", __FUNCTION__); return -1; } @@ -279,7 +279,7 @@ void irda_task_next_state(struct irda_task *task, IRDA_TASK_STATE state) { - IRDA_DEBUG(2, __FUNCTION__ "(), state = %s\n", task_state[state]); + IRDA_DEBUG(2, "%s(), state = %s\n", __FUNCTION__, task_state[state]); task->state = state; } @@ -313,7 +313,7 @@ int count = 0; int timeout; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(task != NULL, return -1;); ASSERT(task->magic == IRDA_TASK_MAGIC, return -1;); @@ -322,14 +322,14 @@ do { timeout = task->function(task); if (count++ > 100) { - ERROR(__FUNCTION__ "(), error in task handler!\n"); + ERROR("%s(), error in task handler!\n", __FUNCTION__); irda_task_delete(task); return TRUE; } } while ((timeout == 0) && (task->state != IRDA_TASK_DONE)); if (timeout < 0) { - ERROR(__FUNCTION__ "(), Error executing task!\n"); + ERROR("%s(), Error executing task!\n", __FUNCTION__); irda_task_delete(task); return TRUE; } @@ -361,8 +361,7 @@ irda_task_timer_expired); finished = FALSE; } else { - IRDA_DEBUG(0, __FUNCTION__ - "(), not finished, and no timeout!\n"); + IRDA_DEBUG(0, "%s(), not finished, and no timeout!\n", __FUNCTION__); finished = FALSE; } @@ -391,7 +390,7 @@ struct irda_task *task; int ret; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); task = kmalloc(sizeof(struct irda_task), GFP_ATOMIC); if (!task) @@ -428,7 +427,7 @@ { struct irda_task *task; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); task = (struct irda_task *) data; @@ -547,7 +546,7 @@ { /* Check if this dongle has been registred before */ if (hashbin_find(dongles, new->type, NULL)) { - MESSAGE(__FUNCTION__ "(), Dongle already registered\n"); + MESSAGE("%s(), Dongle already registered\n", __FUNCTION__); return 0; } @@ -569,7 +568,7 @@ node = hashbin_remove(dongles, dongle->type, NULL); if (!node) { - ERROR(__FUNCTION__ "(), dongle not found!\n"); + ERROR("%s(), dongle not found!\n", __FUNCTION__); return; } } @@ -586,11 +585,11 @@ struct if_irda_req req; int ret; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); if (!dev->do_ioctl) { - ERROR(__FUNCTION__ "(), set_raw_mode not impl. by " - "device driver\n"); + ERROR("%s(), set_raw_mode not impl. by " + "device driver\n", __FUNCTION__); return -1; } diff -urN linux-2.4.22-bk36/net/irda/irias_object.c linux-2.4.22-bk37/net/irda/irias_object.c --- linux-2.4.22-bk36/net/irda/irias_object.c 2001-10-04 18:41:09.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irias_object.c 2003-10-20 02:49:38.000000000 -0700 @@ -59,7 +59,7 @@ /* Allocate new string */ new_str = kmalloc(len + 1, GFP_ATOMIC); if (new_str == NULL) { - WARNING(__FUNCTION__"(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); return NULL; } @@ -80,12 +80,12 @@ { struct ias_object *obj; - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); obj = (struct ias_object *) kmalloc(sizeof(struct ias_object), GFP_ATOMIC); if (obj == NULL) { - IRDA_DEBUG(0, __FUNCTION__ "(), Unable to allocate object!\n"); + IRDA_DEBUG(0, "%s(), Unable to allocate object!\n", __FUNCTION__); return NULL; } memset(obj, 0, sizeof( struct ias_object)); @@ -272,7 +272,7 @@ /* Find object */ obj = hashbin_find(objects, 0, obj_name); if (obj == NULL) { - WARNING(__FUNCTION__ "(), Unable to find object: %s\n", + WARNING("%s(), Unable to find object: %s\n", __FUNCTION__, obj_name); return -1; } @@ -280,14 +280,13 @@ /* Find attribute */ attrib = hashbin_find(obj->attribs, 0, attrib_name); if (attrib == NULL) { - WARNING(__FUNCTION__ "(), Unable to find attribute: %s\n", + WARNING("%s(), Unable to find attribute: %s\n", __FUNCTION__, attrib_name); return -1; } if ( attrib->value->type != new_value->type) { - IRDA_DEBUG( 0, __FUNCTION__ - "(), changing value type not allowed!\n"); + IRDA_DEBUG( 0, "%s(), changing value type not allowed!\n", __FUNCTION__); return -1; } @@ -319,7 +318,7 @@ attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { - WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n"); + WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__); return; } memset(attrib, 0, sizeof( struct ias_attrib)); @@ -354,8 +353,7 @@ attrib = (struct ias_attrib *) kmalloc(sizeof(struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { - WARNING(__FUNCTION__ - "(), Unable to allocate attribute!\n"); + WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__); return; } memset(attrib, 0, sizeof( struct ias_attrib)); @@ -388,7 +386,7 @@ attrib = (struct ias_attrib *) kmalloc(sizeof( struct ias_attrib), GFP_ATOMIC); if (attrib == NULL) { - WARNING(__FUNCTION__ "(), Unable to allocate attribute!\n"); + WARNING("%s(), Unable to allocate attribute!\n", __FUNCTION__); return; } memset(attrib, 0, sizeof( struct ias_attrib)); @@ -413,7 +411,7 @@ value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); if (value == NULL) { - WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); return NULL; } memset(value, 0, sizeof(struct ias_value)); @@ -438,7 +436,7 @@ value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); if (value == NULL) { - WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); return NULL; } memset( value, 0, sizeof( struct ias_value)); @@ -465,7 +463,7 @@ value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); if (value == NULL) { - WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); return NULL; } memset(value, 0, sizeof(struct ias_value)); @@ -478,7 +476,7 @@ value->t.oct_seq = kmalloc(len, GFP_ATOMIC); if (value->t.oct_seq == NULL){ - WARNING(__FUNCTION__"(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); kfree(value); return NULL; } @@ -492,7 +490,7 @@ value = kmalloc(sizeof(struct ias_value), GFP_ATOMIC); if (value == NULL) { - WARNING(__FUNCTION__ "(), Unable to kmalloc!\n"); + WARNING("%s(), Unable to kmalloc!\n", __FUNCTION__); return NULL; } memset(value, 0, sizeof(struct ias_value)); @@ -511,7 +509,7 @@ */ void irias_delete_value(struct ias_value *value) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(value != NULL, return;); @@ -531,7 +529,7 @@ kfree(value->t.oct_seq); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), Unknown value type!\n"); + IRDA_DEBUG(0, "%s(), Unknown value type!\n", __FUNCTION__); break; } kfree(value); diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_client.c linux-2.4.22-bk37/net/irda/irlan/irlan_client.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_client.c 2002-11-28 15:53:16.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_client.c 2003-10-20 02:49:38.000000000 -0700 @@ -71,7 +71,7 @@ { struct irlan_cb *self = (struct irlan_cb *) data; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -90,7 +90,7 @@ void irlan_client_start_kick_timer(struct irlan_cb *self, int timeout) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); irda_start_timer(&self->client.kick_timer, timeout, (void *) self, irlan_client_kick_timer_expired); @@ -104,7 +104,7 @@ */ void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr) { - IRDA_DEBUG(1, __FUNCTION__ "()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -116,7 +116,7 @@ if ((self->client.state != IRLAN_IDLE) || (self->provider.access_type == ACCESS_DIRECT)) { - IRDA_DEBUG(0, __FUNCTION__ "(), already awake!\n"); + IRDA_DEBUG(0, "%s(), already awake!\n", __FUNCTION__); return; } @@ -125,7 +125,7 @@ self->daddr = daddr; if (self->disconnect_reason == LM_USER_REQUEST) { - IRDA_DEBUG(0, __FUNCTION__ "(), still stopped by user\n"); + IRDA_DEBUG(0, "%s(), still stopped by user\n", __FUNCTION__); return; } @@ -152,7 +152,7 @@ struct irlan_cb *self; __u32 saddr, daddr; - IRDA_DEBUG(1, __FUNCTION__"()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); ASSERT(irlan != NULL, return;); ASSERT(discovery != NULL, return;); @@ -174,7 +174,7 @@ if (self) { ASSERT(self->magic == IRLAN_MAGIC, return;); - IRDA_DEBUG(1, __FUNCTION__ "(), Found instance (%08x)!\n", + IRDA_DEBUG(1, "%s(), Found instance (%08x)!\n", __FUNCTION__, daddr); irlan_client_wakeup(self, saddr, daddr); @@ -192,7 +192,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irlan_cb *) instance; @@ -203,7 +203,7 @@ irlan_do_client_event(self, IRLAN_DATA_INDICATION, skb); /* Ready for a new command */ - IRDA_DEBUG(2, __FUNCTION__ "(), clearing tx_busy\n"); + IRDA_DEBUG(2, "%s(), clearing tx_busy\n", __FUNCTION__); self->client.tx_busy = FALSE; /* Check if we have some queued commands waiting to be sent */ @@ -220,7 +220,7 @@ struct tsap_cb *tsap; struct sk_buff *skb; - IRDA_DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason); + IRDA_DEBUG(4, "%s(), reason=%d\n", __FUNCTION__, reason); self = (struct irlan_cb *) instance; tsap = (struct tsap_cb *) sap; @@ -252,7 +252,7 @@ struct tsap_cb *tsap; notify_t notify; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -272,7 +272,7 @@ tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, ¬ify); if (!tsap) { - IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n"); + IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__); return; } self->client.tsap_ctrl = tsap; @@ -292,7 +292,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct irlan_cb *) instance; @@ -318,7 +318,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -361,13 +361,13 @@ ASSERT(skb != NULL, return;); - IRDA_DEBUG(4, __FUNCTION__ "() skb->len=%d\n", (int) skb->len); + IRDA_DEBUG(4, "%s() skb->len=%d\n", __FUNCTION__, (int) skb->len); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); if (!skb) { - ERROR( __FUNCTION__ "(), Got NULL skb!\n"); + ERROR("%s(), Got NULL skb!\n", __FUNCTION__); return; } frame = skb->data; @@ -392,7 +392,7 @@ /* How many parameters? */ count = frame[1]; - IRDA_DEBUG(4, __FUNCTION__ "(), got %d parameters\n", count); + IRDA_DEBUG(4, "%s(), got %d parameters\n", __FUNCTION__, count); ptr = frame+2; @@ -400,7 +400,7 @@ for (i=0; imagic == IRLAN_MAGIC, return;); @@ -462,7 +462,7 @@ else if (strcmp(value, "HOSTED") == 0) self->client.access_type = ACCESS_HOSTED; else { - IRDA_DEBUG(2, __FUNCTION__ "(), unknown access type!\n"); + IRDA_DEBUG(2, "%s(), unknown access type!\n", __FUNCTION__); } } /* IRLAN version */ @@ -484,14 +484,14 @@ memcpy(&tmp_cpu, value, 2); /* Align value */ le16_to_cpus(&tmp_cpu); /* Convert to host order */ self->client.recv_arb_val = tmp_cpu; - IRDA_DEBUG(2, __FUNCTION__ "(), receive arb val=%d\n", + IRDA_DEBUG(2, "%s(), receive arb val=%d\n", __FUNCTION__, self->client.recv_arb_val); } if (strcmp(param, "MAX_FRAME") == 0) { memcpy(&tmp_cpu, value, 2); /* Align value */ le16_to_cpus(&tmp_cpu); /* Convert to host order */ self->client.max_frame = tmp_cpu; - IRDA_DEBUG(4, __FUNCTION__ "(), max frame=%d\n", + IRDA_DEBUG(4, "%s(), max frame=%d\n", __FUNCTION__, self->client.max_frame); } @@ -526,7 +526,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(priv != NULL, return;); @@ -539,7 +539,7 @@ /* Check if request succeeded */ if (result != IAS_SUCCESS) { - IRDA_DEBUG(2, __FUNCTION__ "(), got NULL value!\n"); + IRDA_DEBUG(2, "%s(), got NULL value!\n", __FUNCTION__); irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, NULL); return; @@ -557,7 +557,7 @@ irias_delete_value(value); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), unknown type!\n"); + IRDA_DEBUG(2, "%s(), unknown type!\n", __FUNCTION__); break; } irlan_do_client_event(self, IRLAN_IAS_PROVIDER_NOT_AVAIL, NULL); diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_client_event.c linux-2.4.22-bk37/net/irda/irlan/irlan_client_event.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_client_event.c 2000-11-27 18:07:31.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_client_event.c 2003-10-20 02:49:38.000000000 -0700 @@ -92,7 +92,7 @@ static int irlan_client_state_idle(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRLAN_MAGIC, return -1;); @@ -100,8 +100,7 @@ switch (event) { case IRLAN_DISCOVERY_INDICATION: if (self->client.iriap) { - WARNING(__FUNCTION__ - "(), busy with a previous query\n"); + WARNING("%s(), busy with a previous query\n", __FUNCTION__); return -EBUSY; } @@ -114,10 +113,10 @@ "IrLAN", "IrDA:TinyTP:LsapSel"); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(4, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -136,7 +135,7 @@ static int irlan_client_state_query(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRLAN_MAGIC, return -1;); @@ -154,7 +153,7 @@ irlan_next_client_state(self, IRLAN_CONN); break; case IRLAN_IAS_PROVIDER_NOT_AVAIL: - IRDA_DEBUG(2, __FUNCTION__ "(), IAS_PROVIDER_NOT_AVAIL\n"); + IRDA_DEBUG(2, "%s(), IAS_PROVIDER_NOT_AVAIL\n", __FUNCTION__); irlan_next_client_state(self, IRLAN_IDLE); /* Give the client a kick! */ @@ -167,10 +166,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__"(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -189,7 +188,7 @@ static int irlan_client_state_conn(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -204,10 +203,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -224,7 +223,7 @@ static int irlan_client_state_info(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -244,10 +243,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -266,7 +265,7 @@ static int irlan_client_state_media(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -281,10 +280,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -305,7 +304,7 @@ { struct qos_info qos; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -344,7 +343,7 @@ irlan_next_client_state(self, IRLAN_DATA); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), unknown access type!\n"); + IRDA_DEBUG(2, "%s(), unknown access type!\n", __FUNCTION__); break; } break; @@ -353,10 +352,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } @@ -376,7 +375,7 @@ static int irlan_client_state_wait(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -390,10 +389,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -407,7 +406,7 @@ { struct qos_info qos; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -429,7 +428,7 @@ } else if (self->client.recv_arb_val > self->provider.send_arb_val) { - IRDA_DEBUG(2, __FUNCTION__ "(), lost the battle :-(\n"); + IRDA_DEBUG(2, "%s(), lost the battle :-(\n", __FUNCTION__); } break; case IRLAN_DATA_CONNECT_INDICATION: @@ -440,10 +439,10 @@ irlan_next_client_state(self, IRLAN_IDLE); break; case IRLAN_WATCHDOG_TIMEOUT: - IRDA_DEBUG(2, __FUNCTION__ "(), IRLAN_WATCHDOG_TIMEOUT\n"); + IRDA_DEBUG(2, "%s(), IRLAN_WATCHDOG_TIMEOUT\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -462,7 +461,7 @@ static int irlan_client_state_data(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRLAN_MAGIC, return -1;); @@ -476,7 +475,7 @@ irlan_next_client_state(self, IRLAN_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -494,7 +493,7 @@ static int irlan_client_state_close(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (skb) dev_kfree_skb(skb); @@ -511,7 +510,7 @@ static int irlan_client_state_sync(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (skb) dev_kfree_skb(skb); diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_common.c linux-2.4.22-bk37/net/irda/irlan/irlan_common.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_common.c 2002-02-25 11:38:14.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_common.c 2003-10-20 02:49:38.000000000 -0700 @@ -122,7 +122,7 @@ struct irlan_cb *new; __u16 hints; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* Allocate master structure */ irlan = hashbin_new(HB_LOCAL); if (irlan == NULL) { @@ -133,7 +133,7 @@ create_proc_info_entry("irlan", 0, proc_irda, irlan_proc_read); #endif /* CONFIG_PROC_FS */ - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); hints = irlmp_service_to_hint(S_LAN); /* Register with IrLMP as a client */ @@ -157,7 +157,7 @@ void irlan_cleanup(void) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); irlmp_unregister_client(ckey); irlmp_unregister_service(skey); @@ -181,7 +181,7 @@ { int i=0; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* Check if we should call the device eth or irlan */ if (!eth) { @@ -192,7 +192,7 @@ } if (register_netdev(&self->dev) != 0) { - IRDA_DEBUG(2, __FUNCTION__ "(), register_netdev() failed!\n"); + IRDA_DEBUG(2, "%s(), register_netdev() failed!\n", __FUNCTION__); return -1; } return 0; @@ -208,7 +208,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(irlan != NULL, return NULL;); /* @@ -264,7 +264,7 @@ { struct sk_buff *skb; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -301,7 +301,7 @@ struct irlan_cb *self; struct tsap_cb *tsap; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irlan_cb *) instance; tsap = (struct tsap_cb *) sap; @@ -390,7 +390,7 @@ struct irlan_cb *self; struct tsap_cb *tsap; - IRDA_DEBUG(0, __FUNCTION__ "(), reason=%d\n", reason); + IRDA_DEBUG(0, "%s(), reason=%d\n", __FUNCTION__, reason); self = (struct irlan_cb *) instance; tsap = (struct tsap_cb *) sap; @@ -409,22 +409,22 @@ switch (reason) { case LM_USER_REQUEST: /* User request */ - IRDA_DEBUG(2, __FUNCTION__ "(), User requested\n"); + IRDA_DEBUG(2, "%s(), User requested\n", __FUNCTION__); break; case LM_LAP_DISCONNECT: /* Unexpected IrLAP disconnect */ - IRDA_DEBUG(2, __FUNCTION__ "(), Unexpected IrLAP disconnect\n"); + IRDA_DEBUG(2, "%s(), Unexpected IrLAP disconnect\n", __FUNCTION__); break; case LM_CONNECT_FAILURE: /* Failed to establish IrLAP connection */ - IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP connect failed\n"); + IRDA_DEBUG(2, "%s(), IrLAP connect failed\n", __FUNCTION__); break; case LM_LAP_RESET: /* IrLAP reset */ - IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP reset\n"); + IRDA_DEBUG(2, "%s(), IrLAP reset\n", __FUNCTION__); break; case LM_INIT_DISCONNECT: - IRDA_DEBUG(2, __FUNCTION__ "(), IrLMP connect failed\n"); + IRDA_DEBUG(2, "%s(), IrLMP connect failed\n", __FUNCTION__); break; default: - ERROR(__FUNCTION__ "(), Unknown disconnect reason\n"); + ERROR("%s(), Unknown disconnect reason\n", __FUNCTION__); break; } @@ -446,7 +446,7 @@ struct tsap_cb *tsap; notify_t notify; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -468,7 +468,7 @@ tsap = irttp_open_tsap(LSAP_ANY, DEFAULT_INITIAL_CREDIT, ¬ify); if (!tsap) { - IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n"); + IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__); return; } self->tsap_data = tsap; @@ -482,7 +482,7 @@ void irlan_close_tsaps(struct irlan_cb *self) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -572,7 +572,7 @@ { struct sk_buff *skb; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); if (irda_lock(&self->client.tx_busy) == FALSE) return -EBUSY; @@ -591,7 +591,7 @@ dev_kfree_skb(skb); return -1; } - IRDA_DEBUG(2, __FUNCTION__ "(), sending ...\n"); + IRDA_DEBUG(2, "%s(), sending ...\n", __FUNCTION__); return irttp_data_request(self->client.tsap_ctrl, skb); } @@ -604,7 +604,7 @@ */ void irlan_ctrl_data_request(struct irlan_cb *self, struct sk_buff *skb) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Queue command */ skb_queue_tail(&self->client.txq, skb); @@ -624,7 +624,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -656,7 +656,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -688,7 +688,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -727,7 +727,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -765,7 +765,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -804,7 +804,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -844,7 +844,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -879,7 +879,7 @@ struct sk_buff *skb; __u8 *frame; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -964,7 +964,7 @@ int n=0; if (skb == NULL) { - IRDA_DEBUG(2, __FUNCTION__ "(), Got NULL skb\n"); + IRDA_DEBUG(2, "%s(), Got NULL skb\n", __FUNCTION__); return 0; } @@ -981,7 +981,7 @@ ASSERT(value_len > 0, return 0;); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown parameter type!\n"); + IRDA_DEBUG(2, "%s(), Unknown parameter type!\n", __FUNCTION__); return 0; break; } @@ -991,7 +991,7 @@ /* Make space for data */ if (skb_tailroom(skb) < (param_len+value_len+3)) { - IRDA_DEBUG(2, __FUNCTION__ "(), No more space at end of skb\n"); + IRDA_DEBUG(2, "%s(), No more space at end of skb\n", __FUNCTION__); return 0; } skb_put(skb, param_len+value_len+3); @@ -1038,13 +1038,13 @@ __u16 val_len; int n=0; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* get length of parameter name (1 byte) */ name_len = buf[n++]; if (name_len > 254) { - IRDA_DEBUG(2, __FUNCTION__ "(), name_len > 254\n"); + IRDA_DEBUG(2, "%s(), name_len > 254\n", __FUNCTION__); return -RSP_INVALID_COMMAND_FORMAT; } @@ -1061,7 +1061,7 @@ le16_to_cpus(&val_len); n+=2; if (val_len > 1016) { - IRDA_DEBUG(2, __FUNCTION__ "(), parameter length to long\n"); + IRDA_DEBUG(2, "%s(), parameter length to long\n", __FUNCTION__); return -RSP_INVALID_COMMAND_FORMAT; } *len = val_len; diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_eth.c linux-2.4.22-bk37/net/irda/irlan/irlan_eth.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_eth.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_eth.c 2003-10-20 02:49:38.000000000 -0700 @@ -51,7 +51,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(2, __FUNCTION__"()\n"); + IRDA_DEBUG(2,"%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); @@ -109,7 +109,7 @@ { struct irlan_cb *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); @@ -143,7 +143,7 @@ struct irlan_cb *self = (struct irlan_cb *) dev->priv; struct sk_buff *skb; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Stop device */ netif_stop_queue(dev); @@ -354,14 +354,14 @@ self = dev->priv; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); /* Check if data channel has been connected yet */ if (self->client.state != IRLAN_DATA) { - IRDA_DEBUG(1, __FUNCTION__ "(), delaying!\n"); + IRDA_DEBUG(1, "%s(), delaying!\n", __FUNCTION__); return; } @@ -371,20 +371,20 @@ } else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) { /* Disable promiscuous mode, use normal mode. */ - IRDA_DEBUG(4, __FUNCTION__ "(), Setting multicast filter\n"); + IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __FUNCTION__); /* hardware_set_filter(NULL); */ irlan_set_multicast_filter(self, TRUE); } else if (dev->mc_count) { - IRDA_DEBUG(4, __FUNCTION__ "(), Setting multicast filter\n"); + IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __FUNCTION__); /* Walk the address list, and load the filter */ /* hardware_set_filter(dev->mc_list); */ irlan_set_multicast_filter(self, TRUE); } else { - IRDA_DEBUG(4, __FUNCTION__ "(), Clearing multicast filter\n"); + IRDA_DEBUG(4, "%s(), Clearing multicast filter\n", __FUNCTION__); irlan_set_multicast_filter(self, FALSE); } diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_event.c linux-2.4.22-bk37/net/irda/irlan/irlan_event.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_event.c 1999-11-02 17:07:55.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_event.c 2003-10-20 02:49:38.000000000 -0700 @@ -40,7 +40,7 @@ void irlan_next_client_state(struct irlan_cb *self, IRLAN_STATE state) { - IRDA_DEBUG(2, __FUNCTION__"(), %s\n", irlan_state[state]); + IRDA_DEBUG(2, "%s(), %s\n", __FUNCTION__, irlan_state[state]); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); @@ -50,7 +50,7 @@ void irlan_next_provider_state(struct irlan_cb *self, IRLAN_STATE state) { - IRDA_DEBUG(2, __FUNCTION__"(), %s\n", irlan_state[state]); + IRDA_DEBUG(2, "%s(), %s\n", __FUNCTION__, irlan_state[state]); ASSERT(self != NULL, return;); ASSERT(self->magic == IRLAN_MAGIC, return;); diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_filter.c linux-2.4.22-bk37/net/irda/irlan/irlan_filter.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_filter.c 1999-11-02 17:07:55.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_filter.c 2003-10-20 02:49:38.000000000 -0700 @@ -143,7 +143,7 @@ { __u8 *bytes; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); bytes = value; @@ -156,7 +156,7 @@ * This is experimental!! DB. */ if (strcmp(param, "MODE") == 0) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); self->use_udata = TRUE; return; } diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_provider.c linux-2.4.22-bk37/net/irda/irlan/irlan_provider.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_provider.c 2001-03-02 11:12:12.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_provider.c 2003-10-20 02:49:38.000000000 -0700 @@ -70,7 +70,7 @@ struct irlan_cb *self; __u8 code; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct irlan_cb *) instance; @@ -99,15 +99,15 @@ irlan_do_provider_event(self, IRLAN_FILTER_CONFIG_CMD, skb); break; case CMD_RECONNECT_DATA_CHAN: - IRDA_DEBUG(2, __FUNCTION__"(), Got RECONNECT_DATA_CHAN command\n"); - IRDA_DEBUG(2, __FUNCTION__"(), NOT IMPLEMENTED\n"); + IRDA_DEBUG(2, "%s(), Got RECONNECT_DATA_CHAN command\n", __FUNCTION__); + IRDA_DEBUG(2, "%s(), NOT IMPLEMENTED\n", __FUNCTION__); break; case CMD_CLOSE_DATA_CHAN: IRDA_DEBUG(2, "Got CLOSE_DATA_CHAN command!\n"); - IRDA_DEBUG(2, __FUNCTION__"(), NOT IMPLEMENTED\n"); + IRDA_DEBUG(2, "%s(), NOT IMPLEMENTED\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown command!\n"); + IRDA_DEBUG(2, "%s(), Unknown command!\n", __FUNCTION__); break; } return 0; @@ -129,7 +129,7 @@ struct tsap_cb *tsap; __u32 saddr, daddr; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); self = (struct irlan_cb *) instance; tsap = (struct tsap_cb *) sap; @@ -182,7 +182,7 @@ struct irlan_cb *self; struct tsap_cb *tsap; - IRDA_DEBUG(4, __FUNCTION__ "(), reason=%d\n", reason); + IRDA_DEBUG(4, "%s(), reason=%d\n", __FUNCTION__, reason); self = (struct irlan_cb *) instance; tsap = (struct tsap_cb *) sap; @@ -236,7 +236,7 @@ ASSERT(skb != NULL, return -RSP_PROTOCOL_ERROR;); - IRDA_DEBUG(4, __FUNCTION__ "(), skb->len=%d\n", (int)skb->len); + IRDA_DEBUG(4, "%s(), skb->len=%d\n", __FUNCTION__, (int)skb->len); ASSERT(self != NULL, return -RSP_PROTOCOL_ERROR;); ASSERT(self->magic == IRLAN_MAGIC, return -RSP_PROTOCOL_ERROR;); @@ -266,7 +266,7 @@ for (i=0; imagic == IRLAN_MAGIC, return;); @@ -316,7 +316,7 @@ irlan_insert_string_param(skb, "MEDIA", "802.5"); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), unknown media type!\n"); + IRDA_DEBUG(2, "%s(), unknown media type!\n", __FUNCTION__); break; } irlan_insert_short_param(skb, "IRLAN_VER", 0x0101); @@ -340,7 +340,7 @@ irlan_insert_string_param(skb, "ACCESS_TYPE", "HOSTED"); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown access type\n"); + IRDA_DEBUG(2, "%s(), Unknown access type\n", __FUNCTION__); break; } irlan_insert_short_param(skb, "MAX_FRAME", 0x05ee); @@ -361,7 +361,7 @@ handle_filter_request(self, skb); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown command!\n"); + IRDA_DEBUG(2, "%s(), Unknown command!\n", __FUNCTION__); break; } @@ -379,7 +379,7 @@ struct tsap_cb *tsap; notify_t notify; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRLAN_MAGIC, return -1;); @@ -400,7 +400,7 @@ tsap = irttp_open_tsap(LSAP_ANY, 1, ¬ify); if (!tsap) { - IRDA_DEBUG(2, __FUNCTION__ "(), Got no tsap!\n"); + IRDA_DEBUG(2, "%s(), Got no tsap!\n", __FUNCTION__); return -1; } self->provider.tsap_ctrl = tsap; diff -urN linux-2.4.22-bk36/net/irda/irlan/irlan_provider_event.c linux-2.4.22-bk37/net/irda/irlan/irlan_provider_event.c --- linux-2.4.22-bk36/net/irda/irlan/irlan_provider_event.c 1999-11-02 17:07:55.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlan/irlan_provider_event.c 2003-10-20 02:49:38.000000000 -0700 @@ -72,7 +72,7 @@ static int irlan_provider_state_idle(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -82,7 +82,7 @@ irlan_next_provider_state( self, IRLAN_INFO); break; default: - IRDA_DEBUG(4, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(4, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -101,7 +101,7 @@ { int ret; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -147,7 +147,7 @@ irlan_next_provider_state(self, IRLAN_IDLE); break; default: - IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG( 0, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -166,7 +166,7 @@ static int irlan_provider_state_open(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -186,7 +186,7 @@ irlan_next_provider_state(self, IRLAN_IDLE); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(2, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) @@ -205,7 +205,7 @@ static int irlan_provider_state_data(struct irlan_cb *self, IRLAN_EVENT event, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRLAN_MAGIC, return -1;); @@ -221,7 +221,7 @@ irlan_next_provider_state(self, IRLAN_IDLE); break; default: - IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG( 0, "%s(), Unknown event %d\n", __FUNCTION__, event); break; } if (skb) diff -urN linux-2.4.22-bk36/net/irda/irlap_event.c linux-2.4.22-bk37/net/irda/irlap_event.c --- linux-2.4.22-bk36/net/irda/irlap_event.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irlap_event.c 2003-10-20 02:49:38.000000000 -0700 @@ -217,7 +217,7 @@ } else self->fast_RR = FALSE; - IRDA_DEBUG(3, __FUNCTION__ "(), timeout=%d (%ld)\n", timeout, jiffies); + IRDA_DEBUG(3, "%s(), timeout=%d (%ld)\n", __FUNCTION__, timeout, jiffies); #endif /* CONFIG_IRDA_FAST_RR */ if (timeout == 0) @@ -241,7 +241,7 @@ if (!self || self->magic != LAP_MAGIC) return; - IRDA_DEBUG(3, __FUNCTION__ "(), event = %s, state = %s\n", + IRDA_DEBUG(3, "%s(), event = %s, state = %s\n", __FUNCTION__, irlap_event[event], irlap_state[self->state]); ret = (*state[self->state])(self, event, skb, info); @@ -259,7 +259,7 @@ * try to disconnect link if we send any data frames, since * that will change the state away form XMIT */ - IRDA_DEBUG(2, __FUNCTION__ "() : queue len = %d\n", + IRDA_DEBUG(2, "%s() : queue len = %d\n", __FUNCTION__, skb_queue_len(&self->txq)); if (skb_queue_len(&self->txq)) { @@ -353,8 +353,7 @@ /* Note : this will never happen, because we test * media busy in irlap_connect_request() and * postpone the event... - Jean II */ - IRDA_DEBUG(0, __FUNCTION__ - "(), CONNECT_REQUEST: media busy!\n"); + IRDA_DEBUG(0, "%s(), CONNECT_REQUEST: media busy!\n", __FUNCTION__); /* Always switch state before calling upper layers */ irlap_next_state(self, LAP_NDM); @@ -380,15 +379,15 @@ irlap_connect_indication(self, skb); } else { - IRDA_DEBUG(0, __FUNCTION__ "(), SNRM frame does not " - "contain an I field!\n"); + IRDA_DEBUG(0, "%s(), SNRM frame does not " + "contain an I field!\n", __FUNCTION__); } break; case DISCOVERY_REQUEST: ASSERT(info != NULL, return -1;); if (self->media_busy) { - IRDA_DEBUG(0, __FUNCTION__ "(), media busy!\n"); + IRDA_DEBUG(0, "%s(), media busy!\n", __FUNCTION__); /* irlap->log.condition = MEDIA_BUSY; */ /* This will make IrLMP try again */ @@ -450,7 +449,7 @@ * log (and post an event). * Jean II */ - IRDA_DEBUG(1, __FUNCTION__ "(), Receiving final discovery request, missed the discovery slots :-(\n"); + IRDA_DEBUG(1, "%s(), Receiving final discovery request, missed the discovery slots :-(\n", __FUNCTION__); /* Last discovery request -> in the log */ irlap_discovery_indication(self, info->discovery); @@ -526,8 +525,7 @@ case RECV_UI_FRAME: /* Only accept broadcast frames in NDM mode */ if (info->caddr != CBROADCAST) { - IRDA_DEBUG(0, __FUNCTION__ - "(), not a broadcast frame!\n"); + IRDA_DEBUG(0, "%s(), not a broadcast frame!\n", __FUNCTION__); } else irlap_unitdata_indication(self, skb); break; @@ -543,10 +541,10 @@ irlap_send_test_frame(self, CBROADCAST, info->daddr, skb); break; case RECV_TEST_RSP: - IRDA_DEBUG(0, __FUNCTION__ "() not implemented!\n"); + IRDA_DEBUG(0, "%s() not implemented!\n", __FUNCTION__); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -1; @@ -574,13 +572,13 @@ ASSERT(info != NULL, return -1;); ASSERT(info->discovery != NULL, return -1;); - IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", + IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__, info->discovery->daddr); if (!self->discovery_log) { - WARNING(__FUNCTION__ "(), discovery log is gone! " + WARNING("%s(), discovery log is gone! " "maybe the discovery timeout has been set to " - "short?\n"); + "short?\n", __FUNCTION__); break; } hashbin_insert(self->discovery_log, @@ -605,7 +603,7 @@ ASSERT(info != NULL, return -1;); - IRDA_DEBUG(1, __FUNCTION__ "(), Receiving discovery request (s = %d) while performing discovery :-(\n", info->s); + IRDA_DEBUG(1, "%s(), Receiving discovery request (s = %d) while performing discovery :-(\n", __FUNCTION__, info->s); /* Last discovery request ? */ if (info->s == 0xff) @@ -619,9 +617,8 @@ * timing requirements. */ if (irda_device_is_receiving(self->netdev) && !self->add_wait) { - IRDA_DEBUG(2, __FUNCTION__ - "(), device is slow to answer, " - "waiting some more!\n"); + IRDA_DEBUG(2, "%s(), device is slow to answer, " + "waiting some more!\n", __FUNCTION__); irlap_start_slot_timer(self, MSECS_TO_JIFFIES(10)); self->add_wait = TRUE; return ret; @@ -657,7 +654,7 @@ } break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -1; @@ -679,14 +676,14 @@ discovery_t *discovery_rsp; int ret=0; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); switch (event) { case QUERY_TIMER_EXPIRED: - IRDA_DEBUG(2, __FUNCTION__ "(), QUERY_TIMER_EXPIRED <%ld>\n", + IRDA_DEBUG(2, "%s(), QUERY_TIMER_EXPIRED <%ld>\n", __FUNCTION__, jiffies); irlap_next_state(self, LAP_NDM); break; @@ -715,7 +712,7 @@ } break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, + IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event, irlap_event[event]); ret = -1; @@ -736,7 +733,7 @@ { int ret = 0; - IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[ event]); + IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[ event]); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -796,19 +793,18 @@ break; case RECV_DISCOVERY_XID_CMD: - IRDA_DEBUG(3, __FUNCTION__ - "(), event RECV_DISCOVER_XID_CMD!\n"); + IRDA_DEBUG(3, "%s(), event RECV_DISCOVER_XID_CMD!\n", __FUNCTION__); irlap_next_state(self, LAP_NDM); break; case DISCONNECT_REQUEST: - IRDA_DEBUG(0, __FUNCTION__ "(), Disconnect request!\n"); + IRDA_DEBUG(0, "%s(), Disconnect request!\n", __FUNCTION__); irlap_send_dm_frame(self); irlap_next_state( self, LAP_NDM); irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, + IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event, irlap_event[event]); ret = -1; @@ -830,7 +826,7 @@ { int ret = 0; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -859,7 +855,7 @@ self->retry_count++; break; case RECV_SNRM_CMD: - IRDA_DEBUG(4, __FUNCTION__ "(), SNRM battle!\n"); + IRDA_DEBUG(4, "%s(), SNRM battle!\n", __FUNCTION__); ASSERT(skb != NULL, return 0;); ASSERT(info != NULL, return 0;); @@ -940,7 +936,7 @@ irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, %s\n", event, + IRDA_DEBUG(1, "%s(), Unknown event %d, %s\n", __FUNCTION__, event, irlap_event[event]); ret = -1; @@ -958,7 +954,7 @@ static int irlap_state_offline(struct irlap_cb *self, IRLAP_EVENT event, struct sk_buff *skb, struct irlap_info *info) { - IRDA_DEBUG( 0, __FUNCTION__ "(), Unknown event\n"); + IRDA_DEBUG( 0, "%s(), Unknown event\n", __FUNCTION__); return -1; } @@ -989,9 +985,8 @@ * speed and turn-around-time. */ if (skb->len > self->bytes_left) { - IRDA_DEBUG(4, __FUNCTION__ - "(), Not allowed to transmit more " - "bytes!\n"); + IRDA_DEBUG(4, "%s(), Not allowed to transmit more " + "bytes!\n", __FUNCTION__); skb_queue_head(&self->txq, skb_get(skb)); /* * We should switch state to LAP_NRM_P, but @@ -1029,8 +1024,7 @@ self->fast_RR = FALSE; #endif /* CONFIG_IRDA_FAST_RR */ } else { - IRDA_DEBUG(4, __FUNCTION__ - "(), Unable to send! remote busy?\n"); + IRDA_DEBUG(4, "%s(), Unable to send! remote busy?\n", __FUNCTION__); skb_queue_head(&self->txq, skb_get(skb)); /* @@ -1041,7 +1035,7 @@ } break; case POLL_TIMER_EXPIRED: - IRDA_DEBUG(3, __FUNCTION__ "(), POLL_TIMER_EXPIRED (%ld)\n", + IRDA_DEBUG(3, "%s(), POLL_TIMER_EXPIRED (%ld)\n", __FUNCTION__, jiffies); irlap_send_rr_frame(self, CMD_FRAME); /* Return to NRM properly - Jean II */ @@ -1067,7 +1061,7 @@ * when we return... - Jean II */ break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(0, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -EINVAL; @@ -1086,7 +1080,7 @@ { int ret = 0; - IRDA_DEBUG(1, __FUNCTION__ "()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -1121,7 +1115,7 @@ } break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d\n", event); + IRDA_DEBUG(1, "%s(), Unknown event %d\n", __FUNCTION__, event); ret = -1; break; @@ -1234,8 +1228,7 @@ /* Keep state */ irlap_next_state(self, LAP_NRM_P); } else { - IRDA_DEBUG(4, __FUNCTION__ - "(), missing or duplicate frame!\n"); + IRDA_DEBUG(4, "%s(), missing or duplicate frame!\n", __FUNCTION__); /* Update Nr received */ irlap_update_nr_received(self, info->nr); @@ -1299,8 +1292,7 @@ if ((ns_status == NS_UNEXPECTED) && (nr_status == NR_UNEXPECTED)) { - IRDA_DEBUG(4, __FUNCTION__ - "(), unexpected nr and ns!\n"); + IRDA_DEBUG(4, "%s(), unexpected nr and ns!\n", __FUNCTION__); if (info->pf) { /* Resend rejected frames */ irlap_resend_rejected_frames(self, CMD_FRAME); @@ -1339,9 +1331,8 @@ } break; } - IRDA_DEBUG(1, __FUNCTION__ "(), Not implemented!\n"); - IRDA_DEBUG(1, __FUNCTION__ - "(), event=%s, ns_status=%d, nr_status=%d\n", + IRDA_DEBUG(1, "%s(), Not implemented!\n", __FUNCTION__); + IRDA_DEBUG(1, "%s(), event=%s, ns_status=%d, nr_status=%d\n", __FUNCTION__, irlap_event[ event], ns_status, nr_status); break; case RECV_UI_FRAME: @@ -1353,7 +1344,7 @@ del_timer(&self->final_timer); irlap_data_indication(self, skb, TRUE); irlap_next_state(self, LAP_XMIT_P); - printk(__FUNCTION__ "(): RECV_UI_FRAME: next state %s\n", irlap_state[self->state]); + printk("%s(): RECV_UI_FRAME: next state %s\n", __FUNCTION__, irlap_state[self->state]); irlap_start_poll_timer(self, self->poll_timeout); } break; @@ -1406,8 +1397,8 @@ irlap_next_state(self, LAP_NRM_P); } else if (ret == NR_INVALID) { - IRDA_DEBUG(1, __FUNCTION__ "(), Received RR with " - "invalid nr !\n"); + IRDA_DEBUG(1, "%s(), Received RR with " + "invalid nr !\n", __FUNCTION__); del_timer(&self->final_timer); irlap_next_state(self, LAP_RESET_WAIT); @@ -1507,7 +1498,7 @@ irlap_start_final_timer(self, self->final_timeout); break; case RECV_RD_RSP: - IRDA_DEBUG(1, __FUNCTION__ "(), RECV_RD_RSP\n"); + IRDA_DEBUG(1, "%s(), RECV_RD_RSP\n", __FUNCTION__); irlap_flush_all_queues(self); irlap_next_state(self, LAP_XMIT_P); @@ -1515,7 +1506,7 @@ irlap_disconnect_request(self); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(1, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -1; @@ -1536,7 +1527,7 @@ { int ret = 0; - IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]); + IRDA_DEBUG(3, "%s(), event = %s\n", __FUNCTION__, irlap_event[event]); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -1562,7 +1553,7 @@ irlap_next_state( self, LAP_PCLOSE); break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -1; @@ -1583,7 +1574,7 @@ { int ret = 0; - IRDA_DEBUG(3, __FUNCTION__ "(), event = %s\n", irlap_event[event]); + IRDA_DEBUG(3, "%s(), event = %s\n", __FUNCTION__, irlap_event[event]); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -1641,7 +1632,7 @@ * state */ if (!info) { - IRDA_DEBUG(3, __FUNCTION__ "(), RECV_SNRM_CMD\n"); + IRDA_DEBUG(3, "%s(), RECV_SNRM_CMD\n", __FUNCTION__); irlap_initiate_connection_state(self); irlap_wait_min_turn_around(self, &self->qos_tx); irlap_send_ua_response_frame(self, &self->qos_rx); @@ -1649,12 +1640,11 @@ irlap_start_wd_timer(self, self->wd_timeout); irlap_next_state(self, LAP_NDM); } else { - IRDA_DEBUG(0, __FUNCTION__ - "(), SNRM frame contained an I field!\n"); + IRDA_DEBUG(0, "%s(), SNRM frame contained an I field!\n", __FUNCTION__); } break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(1, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -1; @@ -1675,7 +1665,7 @@ { int ret = 0; - IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[event]); + IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[event]); ASSERT(self != NULL, return -ENODEV;); ASSERT(self->magic == LAP_MAGIC, return -EBADR;); @@ -1731,7 +1721,7 @@ ret = -EPROTO; } } else { - IRDA_DEBUG(2, __FUNCTION__ "(), Unable to send!\n"); + IRDA_DEBUG(2, "%s(), Unable to send!\n", __FUNCTION__); skb_queue_head(&self->txq, skb_get(skb)); ret = -EPROTO; } @@ -1747,7 +1737,7 @@ * when we return... - Jean II */ break; default: - IRDA_DEBUG(2, __FUNCTION__ "(), Unknown event %s\n", + IRDA_DEBUG(2, "%s(), Unknown event %s\n", __FUNCTION__, irlap_event[event]); ret = -EINVAL; @@ -1770,7 +1760,7 @@ int nr_status; int ret = 0; - IRDA_DEBUG(4, __FUNCTION__ "(), event=%s\n", irlap_event[ event]); + IRDA_DEBUG(4, "%s(), event=%s\n", __FUNCTION__, irlap_event[ event]); ASSERT(self != NULL, return -1;); ASSERT(self->magic == LAP_MAGIC, return -1;); @@ -1778,8 +1768,8 @@ switch (event) { case RECV_I_CMD: /* Optimize for the common case */ /* FIXME: must check for remote_busy below */ - IRDA_DEBUG(4, __FUNCTION__ "(), event=%s nr=%d, vs=%d, ns=%d, " - "vr=%d, pf=%d\n", irlap_event[event], info->nr, + IRDA_DEBUG(4, "%s(), event=%s nr=%d, vs=%d, ns=%d, " + "vr=%d, pf=%d\n", __FUNCTION__, irlap_event[event], info->nr, self->vs, info->ns, self->vr, info->pf); self->retry_count = 0; @@ -2011,21 +2001,19 @@ /* Keep state */ irlap_next_state(self, LAP_NRM_S); } else { - IRDA_DEBUG(1, __FUNCTION__ - "(), invalid nr not implemented!\n"); + IRDA_DEBUG(1, "%s(), invalid nr not implemented!\n", __FUNCTION__); } break; case RECV_SNRM_CMD: /* SNRM frame is not allowed to contain an I-field */ if (!info) { del_timer(&self->wd_timer); - IRDA_DEBUG(1, __FUNCTION__ "(), received SNRM cmd\n"); + IRDA_DEBUG(1, "%s(), received SNRM cmd\n", __FUNCTION__); irlap_next_state(self, LAP_RESET_CHECK); irlap_reset_indication(self); } else { - IRDA_DEBUG(0, __FUNCTION__ - "(), SNRM frame contained an I-field!\n"); + IRDA_DEBUG(0, "%s(), SNRM frame contained an I-field!\n", __FUNCTION__); } break; @@ -2057,7 +2045,7 @@ * which explain why we use (self->N2 / 2) here !!! * Jean II */ - IRDA_DEBUG(1, __FUNCTION__ "(), retry_count = %d\n", + IRDA_DEBUG(1, "%s(), retry_count = %d\n", __FUNCTION__, self->retry_count); if (self->retry_count < (self->N2 / 2)) { @@ -2110,7 +2098,7 @@ irlap_send_test_frame(self, self->caddr, info->daddr, skb); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", + IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__, event, irlap_event[event]); ret = -EINVAL; @@ -2130,7 +2118,7 @@ { int ret = 0; - IRDA_DEBUG(1, __FUNCTION__ "()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -ENODEV;); ASSERT(self->magic == LAP_MAGIC, return -EBADR;); @@ -2168,7 +2156,7 @@ irlap_disconnect_indication(self, LAP_DISC_INDICATION); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", + IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__, event, irlap_event[event]); ret = -EINVAL; @@ -2184,7 +2172,7 @@ { int ret = 0; - IRDA_DEBUG(1, __FUNCTION__ "(), event=%s\n", irlap_event[event]); + IRDA_DEBUG(1, "%s(), event=%s\n", __FUNCTION__, irlap_event[event]); ASSERT(self != NULL, return -ENODEV;); ASSERT(self->magic == LAP_MAGIC, return -EBADR;); @@ -2205,7 +2193,7 @@ irlap_next_state(self, LAP_SCLOSE); break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown event %d, (%s)\n", + IRDA_DEBUG(1, "%s(), Unknown event %d, (%s)\n", __FUNCTION__, event, irlap_event[event]); ret = -EINVAL; diff -urN linux-2.4.22-bk36/net/irda/irlap_frame.c linux-2.4.22-bk37/net/irda/irlap_frame.c --- linux-2.4.22-bk36/net/irda/irlap_frame.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irlap_frame.c 2003-10-20 02:49:38.000000000 -0700 @@ -167,8 +167,7 @@ /* Check if the new connection address is valid */ if ((info->caddr == 0x00) || (info->caddr == 0xfe)) { - IRDA_DEBUG(3, __FUNCTION__ - "(), invalid connection address!\n"); + IRDA_DEBUG(3, "%s(), invalid connection address!\n", __FUNCTION__); return; } @@ -178,7 +177,7 @@ /* Only accept if addressed directly to us */ if (info->saddr != self->saddr) { - IRDA_DEBUG(2, __FUNCTION__ "(), not addressed to us!\n"); + IRDA_DEBUG(2, "%s(), not addressed to us!\n", __FUNCTION__); return; } irlap_do_event(self, RECV_SNRM_CMD, skb, info); @@ -200,7 +199,7 @@ struct ua_frame *frame; int ret; - IRDA_DEBUG(2, __FUNCTION__ "() <%ld>\n", jiffies); + IRDA_DEBUG(2, "%s() <%ld>\n", __FUNCTION__, jiffies); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); @@ -275,7 +274,7 @@ struct sk_buff *skb = NULL; __u8 *frame; - IRDA_DEBUG(3, __FUNCTION__ "()\n"); + IRDA_DEBUG(3, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); @@ -306,7 +305,7 @@ __u32 bcast = BROADCAST; __u8 *info; - IRDA_DEBUG(4, __FUNCTION__ "(), s=%d, S=%d, command=%d\n", s, S, + IRDA_DEBUG(4, "%s(), s=%d, S=%d, command=%d\n", __FUNCTION__, s, S, command); ASSERT(self != NULL, return;); @@ -398,7 +397,7 @@ __u8 *discovery_info; char *text; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); @@ -410,13 +409,12 @@ /* Make sure frame is addressed to us */ if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) { - IRDA_DEBUG(0, __FUNCTION__ - "(), frame is not addressed to us!\n"); + IRDA_DEBUG(0, "%s(), frame is not addressed to us!\n", __FUNCTION__); return; } if ((discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC)) == NULL) { - WARNING(__FUNCTION__ "(), kmalloc failed!\n"); + WARNING("%s(), kmalloc failed!\n", __FUNCTION__); return; } memset(discovery, 0, sizeof(discovery_t)); @@ -425,7 +423,7 @@ discovery->saddr = self->saddr; discovery->timestamp = jiffies; - IRDA_DEBUG(4, __FUNCTION__ "(), daddr=%08x\n", discovery->daddr); + IRDA_DEBUG(4, "%s(), daddr=%08x\n", __FUNCTION__, discovery->daddr); discovery_info = skb_pull(skb, sizeof(struct xid_frame)); @@ -476,8 +474,7 @@ /* Make sure frame is addressed to us */ if ((info->saddr != self->saddr) && (info->saddr != BROADCAST)) { - IRDA_DEBUG(0, __FUNCTION__ - "(), frame is not addressed to us!\n"); + IRDA_DEBUG(0, "%s(), frame is not addressed to us!\n", __FUNCTION__); return; } @@ -509,7 +506,7 @@ if (info->s == 0xff) { /* Check if things are sane at this point... */ if((discovery_info == NULL) || (skb->len < 3)) { - ERROR(__FUNCTION__ "(), discovery frame to short!\n"); + ERROR("%s(), discovery frame to short!\n", __FUNCTION__); return; } @@ -518,7 +515,7 @@ */ discovery = kmalloc(sizeof(discovery_t), GFP_ATOMIC); if (!discovery) { - WARNING(__FUNCTION__ "(), unable to malloc!\n"); + WARNING("%s(), unable to malloc!\n", __FUNCTION__); return; } @@ -642,7 +639,7 @@ frame[2] = 0; - IRDA_DEBUG(4, __FUNCTION__ "(), vr=%d, %ld\n",self->vr, jiffies); + IRDA_DEBUG(4, "%s(), vr=%d, %ld\n", __FUNCTION__, self->vr, jiffies); irlap_queue_xmit(self, skb); } @@ -658,7 +655,7 @@ { info->nr = skb->data[1] >> 5; - IRDA_DEBUG(4, __FUNCTION__ "(), nr=%d, %ld\n", info->nr, jiffies); + IRDA_DEBUG(4, "%s(), nr=%d, %ld\n", __FUNCTION__, info->nr, jiffies); if (command) irlap_do_event(self, RECV_RNR_CMD, skb, info); @@ -669,7 +666,7 @@ static void irlap_recv_rej_frame(struct irlap_cb *self, struct sk_buff *skb, struct irlap_info *info, int command) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); info->nr = skb->data[1] >> 5; @@ -683,7 +680,7 @@ static void irlap_recv_srej_frame(struct irlap_cb *self, struct sk_buff *skb, struct irlap_info *info, int command) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); info->nr = skb->data[1] >> 5; @@ -697,7 +694,7 @@ static void irlap_recv_disc_frame(struct irlap_cb *self, struct sk_buff *skb, struct irlap_info *info, int command) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* Check if this is a command or a response frame */ if (command) @@ -754,7 +751,7 @@ irlap_send_i_frame( self, tx_skb, CMD_FRAME); } else { - IRDA_DEBUG(4, __FUNCTION__ "(), sending unreliable frame\n"); + IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__); irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); self->window -= 1; } @@ -803,7 +800,7 @@ irlap_send_i_frame(self, tx_skb, CMD_FRAME); } else { - IRDA_DEBUG(4, __FUNCTION__ "(), sending unreliable frame\n"); + IRDA_DEBUG(4, "%s(), sending unreliable frame\n", __FUNCTION__); if (self->ack_required) { irlap_send_ui_frame(self, skb_get(skb), self->caddr, CMD_FRAME); @@ -952,7 +949,7 @@ /* tx_skb = skb_clone( skb, GFP_ATOMIC); */ tx_skb = skb_copy(skb, GFP_ATOMIC); if (!tx_skb) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to copy\n"); + IRDA_DEBUG(0, "%s(), unable to copy\n", __FUNCTION__); return; } /* Unlink tx_skb from list */ @@ -987,7 +984,7 @@ */ while (skb_queue_len( &self->txq) > 0) { - IRDA_DEBUG(0, __FUNCTION__ "(), sending additional frames!\n"); + IRDA_DEBUG(0, "%s(), sending additional frames!\n", __FUNCTION__); if ((skb_queue_len( &self->txq) > 0) && (self->window > 0)) { skb = skb_dequeue( &self->txq); @@ -1032,7 +1029,7 @@ /* tx_skb = skb_clone( skb, GFP_ATOMIC); */ tx_skb = skb_copy(skb, GFP_ATOMIC); if (!tx_skb) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to copy\n"); + IRDA_DEBUG(0, "%s(), unable to copy\n", __FUNCTION__); return; } /* Unlink tx_skb from list */ @@ -1058,7 +1055,7 @@ void irlap_send_ui_frame(struct irlap_cb *self, struct sk_buff *skb, __u8 caddr, int command) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); @@ -1118,7 +1115,7 @@ static void irlap_recv_ui_frame(struct irlap_cb *self, struct sk_buff *skb, struct irlap_info *info) { - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); info->pf = skb->data[1] & PF_BIT; /* Final bit */ @@ -1137,7 +1134,7 @@ __u8 *frame; int w, x, y, z; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LAP_MAGIC, return;); @@ -1226,15 +1223,14 @@ { struct test_frame *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); frame = (struct test_frame *) skb->data; /* Broadcast frames must carry saddr and daddr fields */ if (info->caddr == CBROADCAST) { if (skb->len < sizeof(struct test_frame)) { - IRDA_DEBUG(0, __FUNCTION__ - "() test frame to short!\n"); + IRDA_DEBUG(0, "%s() test frame to short!\n", __FUNCTION__); return; } @@ -1281,7 +1277,7 @@ /* Check if frame is large enough for parsing */ if (skb->len < 2) { - ERROR(__FUNCTION__ "(), frame to short!\n"); + ERROR("%s(), frame to short!\n", __FUNCTION__); dev_kfree_skb(skb); return -1; } @@ -1296,7 +1292,7 @@ /* First we check if this frame has a valid connection address */ if ((info.caddr != self->caddr) && (info.caddr != CBROADCAST)) { - IRDA_DEBUG(0, __FUNCTION__ "(), wrong connection address!\n"); + IRDA_DEBUG(0, "%s(), wrong connection address!\n", __FUNCTION__); goto out; } /* @@ -1330,8 +1326,7 @@ irlap_recv_srej_frame(self, skb, &info, command); break; default: - WARNING(__FUNCTION__ - "() Unknown S-frame %02x received!\n", + WARNING("%s() Unknown S-frame %02x received!\n", __FUNCTION__, info.control); break; } @@ -1369,7 +1364,7 @@ irlap_recv_ui_frame(self, skb, &info); break; default: - WARNING(__FUNCTION__ "(), Unknown frame %02x received!\n", + WARNING("%s(), Unknown frame %02x received!\n", __FUNCTION__, info.control); break; } diff -urN linux-2.4.22-bk36/net/irda/irlmp_frame.c linux-2.4.22-bk37/net/irda/irlmp_frame.c --- linux-2.4.22-bk36/net/irda/irlmp_frame.c 2002-11-28 15:53:16.000000000 -0800 +++ linux-2.4.22-bk37/net/irda/irlmp_frame.c 2003-10-20 02:49:38.000000000 -0700 @@ -45,7 +45,7 @@ skb->data[1] = slsap; if (expedited) { - IRDA_DEBUG(4, __FUNCTION__ "(), sending expedited data\n"); + IRDA_DEBUG(4, "%s(), sending expedited data\n", __FUNCTION__); irlap_data_request(self->irlap, skb, TRUE); } else irlap_data_request(self->irlap, skb, FALSE); @@ -61,7 +61,7 @@ { __u8 *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); @@ -96,7 +96,7 @@ __u8 dlsap_sel; /* Destination LSAP address */ __u8 *fp; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); @@ -116,9 +116,9 @@ * it in a different way than other established connections. */ if ((fp[0] & CONTROL_BIT) && (fp[2] == CONNECT_CMD)) { - IRDA_DEBUG(3, __FUNCTION__ "(), incoming connection, " + IRDA_DEBUG(3, "%s(), incoming connection, " "source LSAP=%d, dest LSAP=%d\n", - slsap_sel, dlsap_sel); + __FUNCTION__, slsap_sel, dlsap_sel); /* Try to find LSAP among the unconnected LSAPs */ lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, CONNECT_CMD, @@ -126,7 +126,7 @@ /* Maybe LSAP was already connected, so try one more time */ if (!lsap) { - IRDA_DEBUG(1, __FUNCTION__ "(), incoming connection for LSAP already connected\n"); + IRDA_DEBUG(1, "%s(), incoming connection for LSAP already connected\n", __FUNCTION__); lsap = irlmp_find_lsap(self, dlsap_sel, slsap_sel, 0, self->lsaps); } @@ -136,14 +136,12 @@ if (lsap == NULL) { IRDA_DEBUG(2, "IrLMP, Sorry, no LSAP for received frame!\n"); - IRDA_DEBUG(2, __FUNCTION__ - "(), slsap_sel = %02x, dlsap_sel = %02x\n", slsap_sel, + IRDA_DEBUG(2, "%s(), slsap_sel = %02x, dlsap_sel = %02x\n", __FUNCTION__, slsap_sel, dlsap_sel); if (fp[0] & CONTROL_BIT) { - IRDA_DEBUG(2, __FUNCTION__ - "(), received control frame %02x\n", fp[2]); + IRDA_DEBUG(2, "%s(), received control frame %02x\n", __FUNCTION__, fp[2]); } else { - IRDA_DEBUG(2, __FUNCTION__ "(), received data frame\n"); + IRDA_DEBUG(2, "%s(), received data frame\n", __FUNCTION__); } dev_kfree_skb(skb); return; @@ -162,8 +160,7 @@ irlmp_do_lsap_event(lsap, LM_CONNECT_CONFIRM, skb); break; case DISCONNECT: - IRDA_DEBUG(4, __FUNCTION__ - "(), Disconnect indication!\n"); + IRDA_DEBUG(4, "%s(), Disconnect indication!\n", __FUNCTION__); irlmp_do_lsap_event(lsap, LM_DISCONNECT_INDICATION, skb); break; @@ -176,8 +173,7 @@ dev_kfree_skb(skb); break; default: - IRDA_DEBUG(0, __FUNCTION__ - "(), Unknown control frame %02x\n", fp[2]); + IRDA_DEBUG(0, "%s(), Unknown control frame %02x\n", __FUNCTION__, fp[2]); dev_kfree_skb(skb); break; } @@ -211,7 +207,7 @@ __u8 pid; /* Protocol identifier */ __u8 *fp; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); @@ -228,7 +224,7 @@ pid = fp[2]; if (pid & 0x80) { - IRDA_DEBUG(0, __FUNCTION__ "(), extension in PID not supp!\n"); + IRDA_DEBUG(0, "%s(), extension in PID not supp!\n", __FUNCTION__); dev_kfree_skb(skb); return; @@ -236,7 +232,7 @@ /* Check if frame is addressed to the connectionless LSAP */ if ((slsap_sel != LSAP_CONNLESS) || (dlsap_sel != LSAP_CONNLESS)) { - IRDA_DEBUG(0, __FUNCTION__ "(), dropping frame!\n"); + IRDA_DEBUG(0, "%s(), dropping frame!\n", __FUNCTION__); dev_kfree_skb(skb); return; @@ -258,7 +254,7 @@ if (lsap) irlmp_connless_data_indication(lsap, skb); else { - IRDA_DEBUG(0, __FUNCTION__ "(), found no matching LSAP!\n"); + IRDA_DEBUG(0, "%s(), found no matching LSAP!\n", __FUNCTION__); dev_kfree_skb(skb); } } @@ -275,7 +271,7 @@ LAP_REASON reason, struct sk_buff *userdata) { - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(lap != NULL, return;); ASSERT(lap->magic == LMP_LAP_MAGIC, return;); @@ -303,7 +299,7 @@ __u32 daddr, struct qos_info *qos, struct sk_buff *skb) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* Copy QoS settings for this session */ self->qos = qos; @@ -324,7 +320,7 @@ void irlmp_link_connect_confirm(struct lap_cb *self, struct qos_info *qos, struct sk_buff *userdata) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); @@ -391,7 +387,7 @@ */ void irlmp_link_discovery_confirm(struct lap_cb *self, hashbin_t *log) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == LMP_LAP_MAGIC, return;); diff -urN linux-2.4.22-bk36/net/irda/irnet/irnet.h linux-2.4.22-bk37/net/irda/irnet/irnet.h --- linux-2.4.22-bk36/net/irda/irnet/irnet.h 2003-06-13 07:51:39.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irnet/irnet.h 2003-10-20 02:49:38.000000000 -0700 @@ -324,27 +324,27 @@ /* All error messages (will show up in the normal logs) */ #define DERROR(dbg, args...) \ {if(DEBUG_##dbg) \ - printk(KERN_INFO "irnet: " __FUNCTION__ "(): " args);} + printk(KERN_INFO "irnet: %s(): ", __FUNCTION__); printk(args);} /* Normal debug message (will show up in /var/log/debug) */ #define DEBUG(dbg, args...) \ {if(DEBUG_##dbg) \ - printk(KERN_DEBUG "irnet: " __FUNCTION__ "(): " args);} + printk(KERN_DEBUG "irnet: %s(): ", __FUNCTION__); printk(args);} /* Entering a function (trace) */ #define DENTER(dbg, args...) \ {if(DEBUG_##dbg) \ - printk(KERN_DEBUG "irnet: ->" __FUNCTION__ args);} + printk(KERN_DEBUG "irnet: ->%s", __FUNCTION__); printk(args);} /* Entering and exiting a function in one go (trace) */ #define DPASS(dbg, args...) \ {if(DEBUG_##dbg) \ - printk(KERN_DEBUG "irnet: <>" __FUNCTION__ args);} + printk(KERN_DEBUG "irnet: <>%s", __FUNCTION__); printk(args);} /* Exiting a function (trace) */ #define DEXIT(dbg, args...) \ {if(DEBUG_##dbg) \ - printk(KERN_DEBUG "irnet: <-" __FUNCTION__ "()" args);} + printk(KERN_DEBUG "irnet: <-%s()", __FUNCTION__); printk(args);} /* Exit a function with debug */ #define DRETURN(ret, dbg, args...) \ diff -urN linux-2.4.22-bk36/net/irda/irqueue.c linux-2.4.22-bk37/net/irda/irqueue.c --- linux-2.4.22-bk36/net/irda/irqueue.c 2001-07-04 11:50:38.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irqueue.c 2003-10-20 02:49:38.000000000 -0700 @@ -154,7 +154,7 @@ unsigned long flags = 0; int bin; - IRDA_DEBUG( 4, __FUNCTION__"()\n"); + IRDA_DEBUG( 4,"%s()\n", __FUNCTION__); ASSERT( hashbin != NULL, return;); ASSERT( hashbin->magic == HB_MAGIC, return;); @@ -308,7 +308,7 @@ unsigned long flags = 0; irda_queue_t* entry; - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); ASSERT( hashbin != NULL, return NULL;); ASSERT( hashbin->magic == HB_MAGIC, return NULL;); @@ -407,7 +407,7 @@ int bin; __u32 hashv; - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); ASSERT( hashbin != NULL, return NULL;); ASSERT( hashbin->magic == HB_MAGIC, return NULL;); @@ -553,7 +553,7 @@ */ static void __enqueue_last( irda_queue_t **queue, irda_queue_t* element) { - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); /* * Check if queue is empty. @@ -596,7 +596,7 @@ void enqueue_first(irda_queue_t **queue, irda_queue_t* element) { - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); /* * Check if queue is empty. diff -urN linux-2.4.22-bk36/net/irda/irttp.c linux-2.4.22-bk37/net/irda/irttp.c --- linux-2.4.22-bk36/net/irda/irttp.c 2003-06-13 07:51:39.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/irttp.c 2003-10-20 02:49:38.000000000 -0700 @@ -94,7 +94,7 @@ irttp->tsaps = hashbin_new(HB_LOCAL); if (!irttp->tsaps) { - ERROR(__FUNCTION__ "(), can't allocate IrTTP hashbin!\n"); + ERROR("%s(), can't allocate IrTTP hashbin!\n", __FUNCTION__); return -ENOMEM; } @@ -165,7 +165,7 @@ if (!self || self->magic != TTP_TSAP_MAGIC) return; - IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self); + IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self); /* Try to make some progress, especially on Tx side - Jean II */ irttp_run_rx_queue(self); @@ -206,7 +206,7 @@ { struct sk_buff* skb; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); @@ -239,7 +239,7 @@ ASSERT(self != NULL, return NULL;); ASSERT(self->magic == TTP_TSAP_MAGIC, return NULL;); - IRDA_DEBUG(2, __FUNCTION__ "(), self->rx_sdu_size=%d\n", + IRDA_DEBUG(2, "%s(), self->rx_sdu_size=%d\n", __FUNCTION__, self->rx_sdu_size); skb = dev_alloc_skb(TTP_HEADER + self->rx_sdu_size); @@ -262,9 +262,9 @@ dev_kfree_skb(frag); } - IRDA_DEBUG(2, __FUNCTION__ "(), frame len=%d\n", n); + IRDA_DEBUG(2, "%s(), frame len=%d\n", __FUNCTION__, n); - IRDA_DEBUG(2, __FUNCTION__ "(), rx_sdu_size=%d\n", self->rx_sdu_size); + IRDA_DEBUG(2, "%s(), rx_sdu_size=%d\n", __FUNCTION__, self->rx_sdu_size); ASSERT(n <= self->rx_sdu_size, return NULL;); /* Set the new length */ @@ -287,7 +287,7 @@ struct sk_buff *frag; __u8 *frame; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); @@ -297,7 +297,7 @@ * Split frame into a number of segments */ while (skb->len > self->max_seg_size) { - IRDA_DEBUG(2, __FUNCTION__ "(), fragmenting ...\n"); + IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__); /* Make new segment */ frag = dev_alloc_skb(self->max_seg_size+self->max_header_size); @@ -321,7 +321,7 @@ skb_queue_tail(&self->tx_queue, frag); } /* Queue what is left of the original skb */ - IRDA_DEBUG(2, __FUNCTION__ "(), queuing last segment\n"); + IRDA_DEBUG(2, "%s(), queuing last segment\n", __FUNCTION__); frame = skb_push(skb, TTP_HEADER); frame[0] = 0x00; /* Clear more bit */ @@ -352,7 +352,7 @@ else self->tx_max_sdu_size = param->pv.i; - IRDA_DEBUG(1, __FUNCTION__ "(), MaxSduSize=%d\n", param->pv.i); + IRDA_DEBUG(1, "%s(), MaxSduSize=%d\n", __FUNCTION__, param->pv.i); return 0; } @@ -380,13 +380,13 @@ * JeanII */ if((stsap_sel != LSAP_ANY) && ((stsap_sel < 0x01) || (stsap_sel >= 0x70))) { - IRDA_DEBUG(0, __FUNCTION__ "(), invalid tsap!\n"); + IRDA_DEBUG(0, "%s(), invalid tsap!\n", __FUNCTION__); return NULL; } self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); if (self == NULL) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc!\n"); + IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__); return NULL; } memset(self, 0, sizeof(struct tsap_cb)); @@ -421,7 +421,7 @@ */ lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0); if (lsap == NULL) { - WARNING(__FUNCTION__ "(), unable to allocate LSAP!!\n"); + WARNING("%s(), unable to allocate LSAP!!\n", __FUNCTION__); return NULL; } @@ -431,7 +431,7 @@ * the stsap_sel we have might not be valid anymore */ self->stsap_sel = lsap->slsap_sel; - IRDA_DEBUG(4, __FUNCTION__ "(), stsap_sel=%02x\n", self->stsap_sel); + IRDA_DEBUG(4, "%s(), stsap_sel=%02x\n", __FUNCTION__, self->stsap_sel); self->notify = *notify; self->lsap = lsap; @@ -488,7 +488,7 @@ { struct tsap_cb *tsap; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); @@ -497,7 +497,7 @@ if (self->connected) { /* Check if disconnect is not pending */ if (!test_bit(0, &self->disconnect_pend)) { - WARNING(__FUNCTION__ "(), TSAP still connected!\n"); + WARNING("%s(), TSAP still connected!\n", __FUNCTION__); irttp_disconnect_request(self, NULL, P_NORMAL); } self->close_pend = TRUE; @@ -533,16 +533,16 @@ ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); ASSERT(skb != NULL, return -1;); - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* Check that nothing bad happens */ if ((skb->len == 0) || (!self->connected)) { - IRDA_DEBUG(1, __FUNCTION__ "(), No data, or not connected\n"); + IRDA_DEBUG(1, "%s(), No data, or not connected\n", __FUNCTION__); return -1; } if (skb->len > self->max_seg_size) { - IRDA_DEBUG(1, __FUNCTION__ "(), UData is to large for IrLAP!\n"); + IRDA_DEBUG(1, "%s(), UData is to large for IrLAP!\n", __FUNCTION__); return -1; } @@ -566,12 +566,12 @@ ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); ASSERT(skb != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ " : queue len = %d\n", + IRDA_DEBUG(2, "%s : queue len = %d\n", __FUNCTION__, skb_queue_len(&self->tx_queue)); /* Check that nothing bad happens */ if ((skb->len == 0) || (!self->connected)) { - WARNING(__FUNCTION__ "(), No data, or not connected\n"); + WARNING("%s(), No data, or not connected\n", __FUNCTION__); return -ENOTCONN; } @@ -580,8 +580,7 @@ * inside an IrLAP frame */ if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) { - ERROR(__FUNCTION__ - "(), SAR disabled, and data is to large for IrLAP!\n"); + ERROR("%s(), SAR disabled, and data is to large for IrLAP!\n", __FUNCTION__); return -EMSGSIZE; } @@ -593,8 +592,8 @@ (self->tx_max_sdu_size != TTP_SAR_UNBOUND) && (skb->len > self->tx_max_sdu_size)) { - ERROR(__FUNCTION__ "(), SAR enabled, " - "but data is larger than TxMaxSduSize!\n"); + ERROR("%s(), SAR enabled, " + "but data is larger than TxMaxSduSize!\n", __FUNCTION__); return -EMSGSIZE; } /* @@ -665,7 +664,7 @@ unsigned long flags; int n; - IRDA_DEBUG(2, __FUNCTION__ "() : send_credit = %d, queue_len = %d\n", + IRDA_DEBUG(2, "%s() : send_credit = %d, queue_len = %d\n", __FUNCTION__, self->send_credit, skb_queue_len(&self->tx_queue)); /* Get exclusive access to the tx queue, otherwise don't touch it */ @@ -773,7 +772,7 @@ ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); - IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", + IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__, self->send_credit, self->avail_credit, self->remote_credit); /* Give credit to peer */ @@ -821,7 +820,7 @@ { struct tsap_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct tsap_cb *) instance; @@ -933,7 +932,7 @@ { struct tsap_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct tsap_cb *) instance; @@ -947,7 +946,7 @@ self->notify.status_indication(self->notify.instance, link, lock); else - IRDA_DEBUG(2, __FUNCTION__ "(), no handler\n"); + IRDA_DEBUG(2, "%s(), no handler\n", __FUNCTION__); } /* @@ -965,7 +964,7 @@ ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); - IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self); + IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self); /* We are "polled" directly from LAP, and the LAP want to fill * its Tx window. We want to do our best to send it data, so that @@ -1003,18 +1002,18 @@ */ void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow) { - IRDA_DEBUG(1, __FUNCTION__ "()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return;); ASSERT(self->magic == TTP_TSAP_MAGIC, return;); switch (flow) { case FLOW_STOP: - IRDA_DEBUG(1, __FUNCTION__ "(), flow stop\n"); + IRDA_DEBUG(1, "%s(), flow stop\n", __FUNCTION__); self->rx_sdu_busy = TRUE; break; case FLOW_START: - IRDA_DEBUG(1, __FUNCTION__ "(), flow start\n"); + IRDA_DEBUG(1, "%s(), flow start\n", __FUNCTION__); self->rx_sdu_busy = FALSE; /* Client say he can accept more data, try to free our @@ -1023,7 +1022,7 @@ break; default: - IRDA_DEBUG(1, __FUNCTION__ "(), Unknown flow command!\n"); + IRDA_DEBUG(1, "%s(), Unknown flow command!\n", __FUNCTION__); } } @@ -1042,7 +1041,7 @@ __u8 *frame; __u8 n; - IRDA_DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size); + IRDA_DEBUG(4, "%s(), max_sdu_size=%d\n", __FUNCTION__, max_sdu_size); ASSERT(self != NULL, return -EBADR;); ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;); @@ -1134,7 +1133,7 @@ __u8 plen; __u8 n; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct tsap_cb *) instance; @@ -1158,7 +1157,7 @@ n = skb->data[0] & 0x7f; - IRDA_DEBUG(4, __FUNCTION__ "(), Initial send_credit=%d\n", n); + IRDA_DEBUG(4, "%s(), Initial send_credit=%d\n", __FUNCTION__, n); self->send_credit = n; self->tx_max_sdu_size = 0; @@ -1178,8 +1177,7 @@ /* Any errors in the parameter list? */ if (ret < 0) { - WARNING(__FUNCTION__ - "(), error extracting parameters\n"); + WARNING("%s(), error extracting parameters\n", __FUNCTION__); dev_kfree_skb(skb); /* Do not accept this connection attempt */ @@ -1189,10 +1187,10 @@ skb_pull(skb, IRDA_MIN(skb->len, plen+1)); } - IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", + IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__, self->send_credit, self->avail_credit, self->remote_credit); - IRDA_DEBUG(2, __FUNCTION__ "(), MaxSduSize=%d\n", self->tx_max_sdu_size); + IRDA_DEBUG(2, "%s(), MaxSduSize=%d\n", __FUNCTION__, self->tx_max_sdu_size); if (self->notify.connect_confirm) { self->notify.connect_confirm(self->notify.instance, self, qos, @@ -1229,7 +1227,7 @@ self->max_seg_size = max_seg_size - TTP_HEADER;; self->max_header_size = max_header_size+TTP_HEADER; - IRDA_DEBUG(4, __FUNCTION__ "(), TSAP sel=%02x\n", self->stsap_sel); + IRDA_DEBUG(4, "%s(), TSAP sel=%02x\n", __FUNCTION__, self->stsap_sel); /* Need to update dtsap_sel if its equal to LSAP_ANY */ self->dtsap_sel = lsap->dlsap_sel; @@ -1253,8 +1251,7 @@ /* Any errors in the parameter list? */ if (ret < 0) { - WARNING(__FUNCTION__ - "(), error extracting parameters\n"); + WARNING("%s(), error extracting parameters\n", __FUNCTION__); dev_kfree_skb(skb); /* Do not accept this connection attempt */ @@ -1291,7 +1288,7 @@ ASSERT(self != NULL, return -1;); ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;); - IRDA_DEBUG(4, __FUNCTION__ "(), Source TSAP selector=%02x\n", + IRDA_DEBUG(4, "%s(), Source TSAP selector=%02x\n", __FUNCTION__, self->stsap_sel); /* Any userdata supplied? */ @@ -1369,15 +1366,15 @@ { struct tsap_cb *new; - IRDA_DEBUG(1, __FUNCTION__ "()\n"); + IRDA_DEBUG(1, "%s()\n", __FUNCTION__); if (!hashbin_find(irttp->tsaps, (int) orig, NULL)) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to find TSAP\n"); + IRDA_DEBUG(0, "%s(), unable to find TSAP\n", __FUNCTION__); return NULL; } new = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC); if (!new) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc\n"); + IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__); return NULL; } /* Dup */ @@ -1415,7 +1412,7 @@ /* Already disconnected? */ if (!self->connected) { - IRDA_DEBUG(4, __FUNCTION__ "(), already disconnected!\n"); + IRDA_DEBUG(4, "%s(), already disconnected!\n", __FUNCTION__); if (userdata) dev_kfree_skb(userdata); return -1; @@ -1427,7 +1424,7 @@ * for following a disconnect_indication() (i.e. net_bh). * Jean II */ if(test_and_set_bit(0, &self->disconnect_pend)) { - IRDA_DEBUG(0, __FUNCTION__ "(), disconnect already pending\n"); + IRDA_DEBUG(0, "%s(), disconnect already pending\n", __FUNCTION__); if (userdata) dev_kfree_skb(userdata); @@ -1446,7 +1443,7 @@ * disconnecting right now since the data will * not have any usable connection to be sent on */ - IRDA_DEBUG(1, __FUNCTION__ "High priority!!()\n" ); + IRDA_DEBUG(1, "%s High priority!!()\n", __FUNCTION__); irttp_flush_queues(self); } else if (priority == P_NORMAL) { /* @@ -1467,7 +1464,7 @@ * be sent at the LMP level (so even if the peer has its Tx queue * full of data). - Jean II */ - IRDA_DEBUG(1, __FUNCTION__ "(), Disconnecting ...\n"); + IRDA_DEBUG(1, "%s(), Disconnecting ...\n", __FUNCTION__); self->connected = FALSE; if (!userdata) { @@ -1501,7 +1498,7 @@ { struct tsap_cb *self; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); self = (struct tsap_cb *) instance; @@ -1561,7 +1558,7 @@ * give an error back */ if (err == -ENOMEM) { - IRDA_DEBUG(0, __FUNCTION__ "() requeueing skb!\n"); + IRDA_DEBUG(0, "%s() requeueing skb!\n", __FUNCTION__); /* Make sure we take a break */ self->rx_sdu_busy = TRUE; @@ -1586,7 +1583,7 @@ struct sk_buff *skb; int more = 0; - IRDA_DEBUG(2, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n", + IRDA_DEBUG(2, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__, self->send_credit, self->avail_credit, self->remote_credit); /* Get exclusive access to the rx queue, otherwise don't touch it */ @@ -1626,7 +1623,7 @@ * limits of the maximum size of the rx_sdu */ if (self->rx_sdu_size <= self->rx_max_sdu_size) { - IRDA_DEBUG(4, __FUNCTION__ "(), queueing frag\n"); + IRDA_DEBUG(4, "%s(), queueing frag\n", __FUNCTION__); skb_queue_tail(&self->rx_fragments, skb); } else { /* Free the part of the SDU that is too big */ @@ -1656,7 +1653,7 @@ /* Now we can deliver the reassembled skb */ irttp_do_data_indication(self, skb); } else { - IRDA_DEBUG(1, __FUNCTION__ "(), Truncated frame\n"); + IRDA_DEBUG(1, "%s(), Truncated frame\n", __FUNCTION__); /* Free the part of the SDU that is too big */ dev_kfree_skb(skb); diff -urN linux-2.4.22-bk36/net/irda/parameters.c linux-2.4.22-bk37/net/irda/parameters.c --- linux-2.4.22-bk36/net/irda/parameters.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/parameters.c 2003-10-20 02:49:38.000000000 -0700 @@ -150,22 +150,22 @@ */ if (p.pl == 0) { if (p.pv.i < 0xff) { - IRDA_DEBUG(2, __FUNCTION__ "(), using 1 byte\n"); + IRDA_DEBUG(2, "%s(), using 1 byte\n", __FUNCTION__); p.pl = 1; } else if (p.pv.i < 0xffff) { - IRDA_DEBUG(2, __FUNCTION__ "(), using 2 bytes\n"); + IRDA_DEBUG(2, "%s(), using 2 bytes\n", __FUNCTION__); p.pl = 2; } else { - IRDA_DEBUG(2, __FUNCTION__ "(), using 4 bytes\n"); + IRDA_DEBUG(2, "%s(), using 4 bytes\n", __FUNCTION__); p.pl = 4; /* Default length */ } } /* Check if buffer is long enough for insertion */ if (len < (2+p.pl)) { - WARNING(__FUNCTION__ "(), buffer to short for insertion!\n"); + WARNING("%s(), buffer to short for insertion!\n", __FUNCTION__); return -1; } - IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i); + IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__, p.pi, p.pl, p.pv.i); switch (p.pl) { case 1: n += irda_param_pack(buf, "bbb", p.pi, p.pl, (__u8) p.pv.i); @@ -186,7 +186,7 @@ break; default: - WARNING(__FUNCTION__ "() length %d not supported\n", p.pl); + WARNING("%s() length %d not supported\n", __FUNCTION__, p.pl); /* Skip parameter */ return -1; } @@ -215,8 +215,8 @@ /* Check if buffer is long enough for parsing */ if (len < (2+p.pl)) { - WARNING(__FUNCTION__ "(), buffer to short for parsing! " - "Need %d bytes, but len is only %d\n", p.pl, len); + WARNING("%s(), buffer to short for parsing! " + "Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len); return -1; } @@ -226,9 +226,9 @@ * PV_INTEGER means that the handler is flexible. */ if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { - ERROR(__FUNCTION__ "(), invalid parameter length! " + ERROR("%s(), invalid parameter length! " "Expected %d bytes, but value had %d bytes!\n", - type & PV_MASK, p.pl); + __FUNCTION__, type & PV_MASK, p.pl); /* Most parameters are bit/byte fields or little endian, * so it's ok to only extract a subset of it (the subset @@ -265,13 +265,13 @@ le32_to_cpus(&p.pv.i); break; default: - WARNING(__FUNCTION__ "() length %d not supported\n", p.pl); + WARNING("%s() length %d not supported\n", __FUNCTION__, p.pl); /* Skip parameter */ return p.pl+2; } - IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d, pi=%d\n", p.pi, p.pl, p.pv.i); + IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __FUNCTION__, p.pi, p.pl, p.pv.i); /* Call handler for this parameter */ err = (*func)(self, &p, PV_PUT); if (err < 0) @@ -293,17 +293,17 @@ irda_param_t p; int err; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); p.pi = pi; /* In case handler needs to know */ p.pl = buf[1]; /* Extract lenght of value */ - IRDA_DEBUG(2, __FUNCTION__ "(), pi=%#x, pl=%d\n", p.pi, p.pl); + IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__, p.pi, p.pl); /* Check if buffer is long enough for parsing */ if (len < (2+p.pl)) { - WARNING(__FUNCTION__ "(), buffer to short for parsing! " - "Need %d bytes, but len is only %d\n", p.pl, len); + WARNING("%s(), buffer to short for parsing! " + "Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len); return -1; } @@ -311,7 +311,7 @@ * checked that the buffer is long enough */ strncpy(str, buf+2, p.pl); - IRDA_DEBUG(2, __FUNCTION__ "(), str=0x%02x 0x%02x\n", (__u8) str[0], + IRDA_DEBUG(2, "%s(), str=0x%02x 0x%02x\n", __FUNCTION__, (__u8) str[0], (__u8) str[1]); /* Null terminate string */ @@ -343,12 +343,12 @@ /* Check if buffer is long enough for parsing */ if (len < (2+p.pl)) { - WARNING(__FUNCTION__ "(), buffer to short for parsing! " - "Need %d bytes, but len is only %d\n", p.pl, len); + WARNING("%s(), buffer to short for parsing! " + "Need %d bytes, but len is only %d\n", __FUNCTION__, p.pl, len); return -1; } - IRDA_DEBUG(0, __FUNCTION__ "(), not impl\n"); + IRDA_DEBUG(0, "%s(), not impl\n", __FUNCTION__); return p.pl+2; /* Extracted pl+2 bytes */ } @@ -474,8 +474,7 @@ if ((pi_major > info->len-1) || (pi_minor > info->tables[pi_major].len-1)) { - IRDA_DEBUG(0, __FUNCTION__ - "(), no handler for parameter=0x%02x\n", pi); + IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n", __FUNCTION__, pi); /* Skip this parameter */ return -1; @@ -489,7 +488,7 @@ /* Check if handler has been implemented */ if (!pi_minor_info->func) { - MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", pi); + MESSAGE("%s(), no handler for pi=%#x\n", __FUNCTION__, pi); /* Skip this parameter */ return -1; } @@ -526,7 +525,7 @@ if ((pi_major > info->len-1) || (pi_minor > info->tables[pi_major].len-1)) { - IRDA_DEBUG(0, __FUNCTION__ "(), no handler for parameter=0x%02x\n", + IRDA_DEBUG(0, "%s(), no handler for parameter=0x%02x\n", __FUNCTION__, buf[0]); /* Skip this parameter */ @@ -539,12 +538,12 @@ /* Find expected data type for this parameter identifier (pi)*/ type = pi_minor_info->type; - IRDA_DEBUG(3, __FUNCTION__ "(), pi=[%d,%d], type=%d\n", + IRDA_DEBUG(3, "%s(), pi=[%d,%d], type=%d\n", __FUNCTION__, pi_major, pi_minor, type); /* Check if handler has been implemented */ if (!pi_minor_info->func) { - MESSAGE(__FUNCTION__"(), no handler for pi=%#x\n", buf[n]); + MESSAGE("%s(), no handler for pi=%#x\n", __FUNCTION__, buf[n]); /* Skip this parameter */ return 2 + buf[n + 1]; /* Continue */ } diff -urN linux-2.4.22-bk36/net/irda/qos.c linux-2.4.22-bk37/net/irda/qos.c --- linux-2.4.22-bk36/net/irda/qos.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/qos.c 2003-10-20 02:49:38.000000000 -0700 @@ -348,7 +348,7 @@ __u32 line_capacity; int index; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); /* * Make sure the mintt is sensible. @@ -374,8 +374,7 @@ if ((qos->baud_rate.value < 115200) && (qos->max_turn_time.value < 500)) { - IRDA_DEBUG(0, __FUNCTION__ - "(), adjusting max turn time from %d to 500 ms\n", + IRDA_DEBUG(0, "%s(), adjusting max turn time from %d to 500 ms\n", __FUNCTION__, qos->max_turn_time.value); qos->max_turn_time.value = 500; } @@ -391,8 +390,7 @@ #ifdef CONFIG_IRDA_DYNAMIC_WINDOW while ((qos->data_size.value > line_capacity) && (index > 0)) { qos->data_size.value = data_sizes[index--]; - IRDA_DEBUG(2, __FUNCTION__ - "(), reducing data size to %d\n", + IRDA_DEBUG(2, "%s(), reducing data size to %d\n", __FUNCTION__, qos->data_size.value); } #else /* Use method described in section 6.6.11 of IrLAP */ @@ -402,16 +400,14 @@ /* Must be able to send at least one frame */ if (qos->window_size.value > 1) { qos->window_size.value--; - IRDA_DEBUG(2, __FUNCTION__ - "(), reducing window size to %d\n", + IRDA_DEBUG(2, "%s(), reducing window size to %d\n", __FUNCTION__, qos->window_size.value); } else if (index > 1) { qos->data_size.value = data_sizes[index--]; - IRDA_DEBUG(2, __FUNCTION__ - "(), reducing data size to %d\n", + IRDA_DEBUG(2, "%s(), reducing data size to %d\n", __FUNCTION__, qos->data_size.value); } else { - WARNING(__FUNCTION__ "(), nothing more we can do!\n"); + WARNING("%s(), nothing more we can do!\n", __FUNCTION__); } } #endif /* CONFIG_IRDA_DYNAMIC_WINDOW */ @@ -545,7 +541,7 @@ if (get) { param->pv.i = self->qos_rx.baud_rate.bits; - IRDA_DEBUG(2, __FUNCTION__ "(), baud rate = 0x%02x\n", + IRDA_DEBUG(2, "%s(), baud rate = 0x%02x\n", __FUNCTION__, param->pv.i); } else { /* @@ -718,7 +714,7 @@ __u32 line_capacity; int i,j; - IRDA_DEBUG(2, __FUNCTION__ "(), speed=%d, max_turn_time=%d\n", + IRDA_DEBUG(2, "%s(), speed=%d, max_turn_time=%d\n", __FUNCTION__, speed, max_turn_time); i = value_index(speed, baud_rates, 10); @@ -729,7 +725,7 @@ line_capacity = max_line_capacities[i][j]; - IRDA_DEBUG(2, __FUNCTION__ "(), line capacity=%d bytes\n", + IRDA_DEBUG(2, "%s(), line capacity=%d bytes\n", __FUNCTION__, line_capacity); return line_capacity; @@ -743,7 +739,7 @@ irlap_min_turn_time_in_bytes(qos->baud_rate.value, qos->min_turn_time.value); - IRDA_DEBUG(2, __FUNCTION__ "(), requested line capacity=%d\n", + IRDA_DEBUG(2, "%s(), requested line capacity=%d\n", __FUNCTION__, line_capacity); return line_capacity; diff -urN linux-2.4.22-bk36/net/irda/wrapper.c linux-2.4.22-bk37/net/irda/wrapper.c --- linux-2.4.22-bk36/net/irda/wrapper.c 2001-04-30 16:26:09.000000000 -0700 +++ linux-2.4.22-bk37/net/irda/wrapper.c 2003-10-20 02:49:38.000000000 -0700 @@ -93,16 +93,16 @@ * Nothing to worry about, but we set the default number of * BOF's */ - IRDA_DEBUG(1, __FUNCTION__ "(), wrong magic in skb!\n"); + IRDA_DEBUG(1, "%s(), wrong magic in skb!\n", __FUNCTION__); xbofs = 10; } else xbofs = cb->xbofs + cb->xbofs_delay; - IRDA_DEBUG(4, __FUNCTION__ "(), xbofs=%d\n", xbofs); + IRDA_DEBUG(4, "%s(), xbofs=%d\n", __FUNCTION__, xbofs); /* Check that we never use more than 115 + 48 xbofs */ if (xbofs > 163) { - IRDA_DEBUG(0, __FUNCTION__ "(), too many xbofs (%d)\n", xbofs); + IRDA_DEBUG(0, "%s(), too many xbofs (%d)\n", __FUNCTION__, xbofs); xbofs = 163; } @@ -265,7 +265,7 @@ case EOF: /* Abort frame */ rx_buff->state = OUTSIDE_FRAME; - IRDA_DEBUG(1, __FUNCTION__ "(), abort frame\n"); + IRDA_DEBUG(1, "%s(), abort frame\n", __FUNCTION__); stats->rx_errors++; stats->rx_frame_errors++; break; @@ -289,13 +289,12 @@ { switch (byte) { case BOF: /* New frame? */ - IRDA_DEBUG(1, __FUNCTION__ - "(), Discarding incomplete frame\n"); + IRDA_DEBUG(1, "%s(), Discarding incomplete frame\n", __FUNCTION__); rx_buff->state = BEGIN_FRAME; irda_device_set_media_busy(dev, TRUE); break; case CE: - WARNING(__FUNCTION__ "(), state not defined\n"); + WARNING("%s(), state not defined\n", __FUNCTION__); break; case EOF: /* Abort frame */ rx_buff->state = OUTSIDE_FRAME; @@ -311,7 +310,7 @@ rx_buff->fcs = irda_fcs(rx_buff->fcs, byte); rx_buff->state = INSIDE_FRAME; } else { - IRDA_DEBUG(1, __FUNCTION__ "(), rx buffer overflow\n"); + IRDA_DEBUG(1, "%s(), rx buffer overflow\n", __FUNCTION__); rx_buff->state = OUTSIDE_FRAME; } break; @@ -332,8 +331,7 @@ switch (byte) { case BOF: /* New frame? */ - IRDA_DEBUG(1, __FUNCTION__ - "(), Discarding incomplete frame\n"); + IRDA_DEBUG(1, "%s(), Discarding incomplete frame\n", __FUNCTION__); rx_buff->state = BEGIN_FRAME; irda_device_set_media_busy(dev, TRUE); break; @@ -354,7 +352,7 @@ /* Wrong CRC, discard frame! */ irda_device_set_media_busy(dev, TRUE); - IRDA_DEBUG(1, __FUNCTION__ "(), crc error\n"); + IRDA_DEBUG(1, "%s(), crc error\n", __FUNCTION__); stats->rx_errors++; stats->rx_crc_errors++; } @@ -364,8 +362,7 @@ rx_buff->data[rx_buff->len++] = byte; rx_buff->fcs = irda_fcs(rx_buff->fcs, byte); } else { - IRDA_DEBUG(1, __FUNCTION__ - "(), Rx buffer overflow, aborting\n"); + IRDA_DEBUG(1, "%s(), Rx buffer overflow, aborting\n", __FUNCTION__); rx_buff->state = OUTSIDE_FRAME; } break;