diff options
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/avm_pci.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/callc.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/config.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_2bds0.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_2bs0.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_pci.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hisax/hfc_sx.c | 6 | ||||
-rw-r--r-- | drivers/isdn/hisax/hisax.h | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/ipacx.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/isar.c | 15 | ||||
-rw-r--r-- | drivers/isdn/hisax/isdnl1.h | 1 | ||||
-rw-r--r-- | drivers/isdn/hisax/isdnl2.c | 28 | ||||
-rw-r--r-- | drivers/isdn/hisax/isdnl3.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hisax/netjet.c | 10 | ||||
-rw-r--r-- | drivers/isdn/hisax/st5481_d.c | 6 |
15 files changed, 47 insertions, 43 deletions
diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index fcf4ed1cb4b..0e66af1decd 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -314,7 +314,7 @@ hdlc_fill_fifo(struct BCState *bcs) bcs->hw.hdlc.ctrl.sr.cmd |= HDLC_CMD_XME; } if ((cs->debug & L1_DEB_HSCX) && !(cs->debug & L1_DEB_HSCX_FIFO)) - debugl1(cs, "hdlc_fill_fifo %d/%ld", count, bcs->tx_skb->len); + debugl1(cs, "hdlc_fill_fifo %d/%u", count, bcs->tx_skb->len); p = bcs->tx_skb->data; ptr = (u_int *)p; skb_pull(bcs->tx_skb, count); diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index f150330b5a2..37e685eafd2 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -65,7 +65,7 @@ hisax_findcard(int driverid) return (struct IsdnCardState *) 0; } -static void +static __attribute__((format(printf, 3, 4))) void link_debug(struct Channel *chanp, int direction, char *fmt, ...) { va_list args; @@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp) return 0; } -static void +static __attribute__((format(printf, 2, 3))) void callc_debug(struct FsmInst *fi, char *fmt, ...) { va_list args; diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index b133378d4dc..c110f8679ba 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -1917,7 +1917,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if) #ifdef CONFIG_PCI #include <linux/pci.h> -static struct pci_device_id hisax_pci_tbl[] __devinitdata = { +static struct pci_device_id hisax_pci_tbl[] __devinitdata __used = { #ifdef CONFIG_HISAX_FRITZPCI {PCI_VDEVICE(AVM, PCI_DEVICE_ID_AVM_A1) }, #endif diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c index 7250f56a524..a16459a1332 100644 --- a/drivers/isdn/hisax/hfc_2bds0.c +++ b/drivers/isdn/hisax/hfc_2bds0.c @@ -292,7 +292,7 @@ hfc_fill_fifo(struct BCState *bcs) } count = GetFreeFifoBytes_B(bcs); if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "hfc_fill_fifo %d count(%ld/%d),%lx", + debugl1(cs, "hfc_fill_fifo %d count(%u/%d),%lx", bcs->channel, bcs->tx_skb->len, count, current->state); if (count < bcs->tx_skb->len) { @@ -719,7 +719,7 @@ hfc_fill_dfifo(struct IsdnCardState *cs) } count = GetFreeFifoBytes_D(cs); if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "hfc_fill_Dfifo count(%ld/%d)", + debugl1(cs, "hfc_fill_Dfifo count(%u/%d)", cs->tx_skb->len, count); if (count < cs->tx_skb->len) { if (cs->debug & L1_DEB_ISAC) diff --git a/drivers/isdn/hisax/hfc_2bs0.c b/drivers/isdn/hisax/hfc_2bs0.c index b1f6481e119..626f85df302 100644 --- a/drivers/isdn/hisax/hfc_2bs0.c +++ b/drivers/isdn/hisax/hfc_2bs0.c @@ -282,7 +282,7 @@ hfc_fill_fifo(struct BCState *bcs) count += cs->hw.hfc.fifosize; } /* L1_MODE_TRANS */ if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "hfc_fill_fifo %d count(%ld/%d)", + debugl1(cs, "hfc_fill_fifo %d count(%u/%d)", bcs->channel, bcs->tx_skb->len, count); if (count < bcs->tx_skb->len) { diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 917cc84065b..3147020d188 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -550,7 +550,7 @@ hfcpci_fill_dfifo(struct IsdnCardState *cs) count += D_FIFO_SIZE; /* count now contains available bytes */ if (cs->debug & L1_DEB_ISAC) - debugl1(cs, "hfcpci_fill_Dfifo count(%ld/%d)", + debugl1(cs, "hfcpci_fill_Dfifo count(%u/%d)", cs->tx_skb->len, count); if (count < cs->tx_skb->len) { if (cs->debug & L1_DEB_ISAC) @@ -681,7 +681,7 @@ hfcpci_fill_fifo(struct BCState *bcs) count += B_FIFO_SIZE; /* count now contains available bytes */ if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "hfcpci_fill_fifo %d count(%ld/%d),%lx", + debugl1(cs, "hfcpci_fill_fifo %d count(%u/%d),%lx", bcs->channel, bcs->tx_skb->len, count, current->state); diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c index 5aa138eb0b3..1235b7131ae 100644 --- a/drivers/isdn/hisax/hfc_sx.c +++ b/drivers/isdn/hisax/hfc_sx.c @@ -179,7 +179,7 @@ write_fifo(struct IsdnCardState *cs, struct sk_buff *skb, u_char fifo, int trans count += fifo_size; /* count now contains available bytes */ if (cs->debug & L1_DEB_ISAC_FIFO) - debugl1(cs, "hfcsx_write_fifo %d count(%ld/%d)", + debugl1(cs, "hfcsx_write_fifo %d count(%u/%d)", fifo, skb->len, count); if (count < skb->len) { if (cs->debug & L1_DEB_ISAC_FIFO) @@ -265,7 +265,7 @@ read_fifo(struct IsdnCardState *cs, u_char fifo, int trans_max) count++; if (cs->debug & L1_DEB_ISAC_FIFO) - debugl1(cs, "hfcsx_read_fifo %d count %ld)", + debugl1(cs, "hfcsx_read_fifo %d count %u)", fifo, count); if ((count > fifo_size) || (count < 4)) { @@ -986,7 +986,7 @@ HFCSX_l1hw(struct PStack *st, int pr, void *arg) default: spin_unlock_irqrestore(&cs->lock, flags); if (cs->debug & L1_DEB_WARN) - debugl1(cs, "hfcsx_l1hw loop invalid %4lx", arg); + debugl1(cs, "hfcsx_l1hw loop invalid %4lx", (unsigned long)arg); return; } cs->hw.hfcsx.trm |= 0x80; /* enable IOM-loop */ diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index 32ab3924aa7..de1c669c7b1 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -1286,7 +1286,9 @@ int jiftime(char *s, long mark); int HiSax_command(isdn_ctrl * ic); int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); +__attribute__((format(printf, 3, 4))) void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); +__attribute__((format(printf, 3, 0))) void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); void HiSax_reportcard(int cardnr, int sel); int QuickHex(char *txt, u_char * p, int cnt); diff --git a/drivers/isdn/hisax/ipacx.c b/drivers/isdn/hisax/ipacx.c index 751b25f2ff5..332104103e1 100644 --- a/drivers/isdn/hisax/ipacx.c +++ b/drivers/isdn/hisax/ipacx.c @@ -717,7 +717,7 @@ bch_mode(struct BCState *bcs, int mode, int bc) bc = bc ? 1 : 0; // in case bc is greater than 1 if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "mode_bch() switch B-% mode %d chan %d", hscx, mode, bc); + debugl1(cs, "mode_bch() switch B-%d mode %d chan %d", hscx, mode, bc); bcs->mode = mode; bcs->channel = bc; diff --git a/drivers/isdn/hisax/isar.c b/drivers/isdn/hisax/isar.c index 2e72227bd07..d4cce337add 100644 --- a/drivers/isdn/hisax/isar.c +++ b/drivers/isdn/hisax/isar.c @@ -189,7 +189,7 @@ ISARVersion(struct IsdnCardState *cs, char *s) static int isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) { - int ret, size, cnt, debug; + int cfu_ret, ret, size, cnt, debug; u_char len, nom, noc; u_short sadr, left, *sp; u_char __user *p = buf; @@ -212,9 +212,10 @@ isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) cs->debug &= ~(L1_DEB_HSCX | L1_DEB_HSCX_FIFO); #endif - if ((ret = copy_from_user(&size, p, sizeof(int)))) { - printk(KERN_ERR"isar_load_firmware copy_from_user ret %d\n", ret); - return ret; + cfu_ret = copy_from_user(&size, p, sizeof(int)); + if (cfu_ret) { + printk(KERN_ERR"isar_load_firmware copy_from_user ret %d\n", cfu_ret); + return -EFAULT; } p += sizeof(int); printk(KERN_DEBUG"isar_load_firmware size: %d\n", size); @@ -953,7 +954,7 @@ isar_pump_statev_modem(struct BCState *bcs, u_char devt) { break; case PSEV_GSTN_CLR: if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "pump stev GSTN CLEAR", devt); + debugl1(cs, "pump stev GSTN CLEAR"); break; default: if (cs->debug & L1_DEB_HSCX) @@ -1268,7 +1269,7 @@ isar_int_main(struct IsdnCardState *cs) static void ftimer_handler(struct BCState *bcs) { if (bcs->cs->debug) - debugl1(bcs->cs, "ftimer flags %04x", + debugl1(bcs->cs, "ftimer flags %04lx", bcs->Flag); test_and_clear_bit(BC_FLG_FTI_RUN, &bcs->Flag); if (test_and_clear_bit(BC_FLG_LL_CONN, &bcs->Flag)) { @@ -1748,7 +1749,7 @@ isar_auxcmd(struct IsdnCardState *cs, isdn_ctrl *ic) { struct BCState *bcs; if (cs->debug & L1_DEB_HSCX) - debugl1(cs, "isar_auxcmd cmd/ch %x/%d", ic->command, ic->arg); + debugl1(cs, "isar_auxcmd cmd/ch %x/%ld", ic->command, ic->arg); switch (ic->command) { case (ISDN_CMD_FAXCMD): bcs = cs->channel[ic->arg].bcs; diff --git a/drivers/isdn/hisax/isdnl1.h b/drivers/isdn/hisax/isdnl1.h index 172ad4c8c96..425d86116f2 100644 --- a/drivers/isdn/hisax/isdnl1.h +++ b/drivers/isdn/hisax/isdnl1.h @@ -21,6 +21,7 @@ #define B_XMTBUFREADY 1 #define B_ACKPENDING 2 +__attribute__((format(printf, 2, 3))) void debugl1(struct IsdnCardState *cs, char *fmt, ...); void DChannel_proc_xmt(struct IsdnCardState *cs); void DChannel_proc_rcv(struct IsdnCardState *cs); diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 0858791978d..cfff0c41d29 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c @@ -1247,10 +1247,10 @@ static void l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; - struct sk_buff *skb, *oskb; + struct sk_buff *skb; struct Layer2 *l2 = &st->l2; u_char header[MAX_HEADER_LEN]; - int i; + int i, hdr_space_needed; int unsigned p1; u_long flags; @@ -1261,6 +1261,16 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) if (!skb) return; + hdr_space_needed = l2headersize(l2, 0); + if (hdr_space_needed > skb_headroom(skb)) { + struct sk_buff *orig_skb = skb; + + skb = skb_realloc_headroom(skb, hdr_space_needed); + if (!skb) { + dev_kfree_skb(orig_skb); + return; + } + } spin_lock_irqsave(&l2->lock, flags); if(test_bit(FLG_MOD128, &l2->flag)) p1 = (l2->vs - l2->va) % 128; @@ -1285,19 +1295,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg) l2->vs = (l2->vs + 1) % 8; } spin_unlock_irqrestore(&l2->lock, flags); - p1 = skb->data - skb->head; - if (p1 >= i) - memcpy(skb_push(skb, i), header, i); - else { - printk(KERN_WARNING - "isdl2 pull_iqueue skb header(%d/%d) too short\n", i, p1); - oskb = skb; - skb = alloc_skb(oskb->len + i, GFP_ATOMIC); - memcpy(skb_put(skb, i), header, i); - skb_copy_from_linear_data(oskb, - skb_put(skb, oskb->len), oskb->len); - dev_kfree_skb(oskb); - } + memcpy(skb_push(skb, i), header, i); st->l2.l2l1(st, PH_PULL | INDICATION, skb); test_and_clear_bit(FLG_ACK_PEND, &st->l2.flag); if (!test_and_set_bit(FLG_T200_RUN, &st->l2.flag)) { diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c index fd0b643ab74..ad291f21b20 100644 --- a/drivers/isdn/hisax/isdnl3.c +++ b/drivers/isdn/hisax/isdnl3.c @@ -66,7 +66,7 @@ static char *strL3Event[] = "EV_TIMEOUT", }; -static void +static __attribute__((format(printf, 2, 3))) void l3m_debug(struct FsmInst *fi, char *fmt, ...) { va_list args; diff --git a/drivers/isdn/hisax/netjet.c b/drivers/isdn/hisax/netjet.c index 5d7f0f2ff9b..644891efc26 100644 --- a/drivers/isdn/hisax/netjet.c +++ b/drivers/isdn/hisax/netjet.c @@ -254,7 +254,7 @@ static int make_raw_data(struct BCState *bcs) { val >>= 1; } if (bcs->cs->debug & L1_DEB_HSCX) - debugl1(bcs->cs,"tiger make_raw: in %ld out %d.%d", + debugl1(bcs->cs,"tiger make_raw: in %u out %d.%d", bcs->tx_skb->len, s_cnt, bitcnt); if (bitcnt) { while (8>bitcnt++) { @@ -361,7 +361,7 @@ static int make_raw_data_56k(struct BCState *bcs) { val >>= 1; } if (bcs->cs->debug & L1_DEB_HSCX) - debugl1(bcs->cs,"tiger make_raw_56k: in %ld out %d.%d", + debugl1(bcs->cs,"tiger make_raw_56k: in %u out %d.%d", bcs->tx_skb->len, s_cnt, bitcnt); if (bitcnt) { while (8>bitcnt++) { @@ -612,7 +612,7 @@ void netjet_fill_dma(struct BCState *bcs) if (!bcs->tx_skb) return; if (bcs->cs->debug & L1_DEB_HSCX) - debugl1(bcs->cs,"tiger fill_dma1: c%d %4x", bcs->channel, + debugl1(bcs->cs,"tiger fill_dma1: c%d %4lx", bcs->channel, bcs->Flag); if (test_and_set_bit(BC_FLG_BUSY, &bcs->Flag)) return; @@ -625,7 +625,7 @@ void netjet_fill_dma(struct BCState *bcs) return; }; if (bcs->cs->debug & L1_DEB_HSCX) - debugl1(bcs->cs,"tiger fill_dma2: c%d %4x", bcs->channel, + debugl1(bcs->cs,"tiger fill_dma2: c%d %4lx", bcs->channel, bcs->Flag); if (test_and_clear_bit(BC_FLG_NOFRAME, &bcs->Flag)) { write_raw(bcs, bcs->hw.tiger.sendp, bcs->hw.tiger.free); @@ -667,7 +667,7 @@ void netjet_fill_dma(struct BCState *bcs) write_raw(bcs, p, cnt); } if (bcs->cs->debug & L1_DEB_HSCX) - debugl1(bcs->cs,"tiger fill_dma3: c%d %4x", bcs->channel, + debugl1(bcs->cs,"tiger fill_dma3: c%d %4lx", bcs->channel, bcs->Flag); } diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c index b7876b19fe7..44082637a09 100644 --- a/drivers/isdn/hisax/st5481_d.c +++ b/drivers/isdn/hisax/st5481_d.c @@ -167,7 +167,8 @@ static struct FsmNode L1FnList[] __initdata = {ST_L1_F8, EV_IND_RSY, l1_ignore}, }; -static void l1m_debug(struct FsmInst *fi, char *fmt, ...) +static __attribute__((format(printf, 2, 3))) +void l1m_debug(struct FsmInst *fi, char *fmt, ...) { va_list args; char buf[256]; @@ -269,7 +270,8 @@ static char *strDoutEvent[] = "EV_DOUT_UNDERRUN", }; -static void dout_debug(struct FsmInst *fi, char *fmt, ...) +static __attribute__((format(printf, 2, 3))) +void dout_debug(struct FsmInst *fi, char *fmt, ...) { va_list args; char buf[256]; |