diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 14:35:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-01 14:35:16 -0400 |
commit | 9a5467fd600669cda488771dac3e951034fe2b08 (patch) | |
tree | 20c3c73ff3571e525193aca20d3602161b4e90be | |
parent | 676056132425ac425d7215cdaa8bd25582e07966 (diff) | |
parent | 00b1304c4ca81dd893973cc620b87a5c3ff3f660 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (46 commits)
tcp: MD5: Fix IPv6 signatures
skbuff: add missing kernel-doc for do_not_encrypt
net/ipv4/route.c: fix build error
tcp: MD5: Fix MD5 signatures on certain ACK packets
ipv6: Fix ip6_xmit to send fragments if ipfragok is true
ipvs: Move userspace definitions to include/linux/ip_vs.h
netdev: Fix lockdep warnings in multiqueue configurations.
netfilter: xt_hashlimit: fix race between htable_destroy and htable_gc
netfilter: ipt_recent: fix race between recent_mt_destroy and proc manipulations
netfilter: nf_conntrack_tcp: decrease timeouts while data in unacknowledged
irda: replace __FUNCTION__ with __func__
nsc-ircc: default to dongle type 9 on IBM hardware
bluetooth: add quirks for a few hci_usb devices
hysdn: remove the packed attribute from PofTimStamp_tag
isdn: use the common ascii hex helpers
tg3: adapt tg3 to use reworked PCI PM code
atm: fix direct casts of pointers to u32 in the InterPhase driver
atm: fix const assignment/discard warnings in the ATM networking driver
net: use the common ascii hex helpers
random32: seeding improvement
...
73 files changed, 2006 insertions, 1290 deletions
diff --git a/arch/arm/mach-kirkwood/rd88f6281-setup.c b/arch/arm/mach-kirkwood/rd88f6281-setup.c index e1f8de2c74a2..b6437f47a77f 100644 --- a/arch/arm/mach-kirkwood/rd88f6281-setup.c +++ b/arch/arm/mach-kirkwood/rd88f6281-setup.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
19 | #include <linux/ata_platform.h> | 19 | #include <linux/ata_platform.h> |
20 | #include <linux/mv643xx_eth.h> | 20 | #include <linux/mv643xx_eth.h> |
21 | #include <linux/ethtool.h> | ||
21 | #include <asm/mach-types.h> | 22 | #include <asm/mach-types.h> |
22 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
23 | #include <asm/mach/pci.h> | 24 | #include <asm/mach/pci.h> |
@@ -69,6 +70,8 @@ static struct platform_device rd88f6281_nand_flash = { | |||
69 | 70 | ||
70 | static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { | 71 | static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { |
71 | .phy_addr = -1, | 72 | .phy_addr = -1, |
73 | .speed = SPEED_1000, | ||
74 | .duplex = DUPLEX_FULL, | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | static struct mv_sata_platform_data rd88f6281_sata_data = { | 77 | static struct mv_sata_platform_data rd88f6281_sata_data = { |
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c index d50e3650a09e..73e9242da7ad 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/mtd/physmap.h> | 16 | #include <linux/mtd/physmap.h> |
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/ethtool.h> | ||
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
19 | #include <asm/gpio.h> | 20 | #include <asm/gpio.h> |
20 | #include <asm/leds.h> | 21 | #include <asm/leds.h> |
@@ -88,6 +89,8 @@ static struct orion5x_mpp_mode rd88f5181l_fxo_mpp_modes[] __initdata = { | |||
88 | 89 | ||
89 | static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = { | 90 | static struct mv643xx_eth_platform_data rd88f5181l_fxo_eth_data = { |
90 | .phy_addr = -1, | 91 | .phy_addr = -1, |
92 | .speed = SPEED_1000, | ||
93 | .duplex = DUPLEX_FULL, | ||
91 | }; | 94 | }; |
92 | 95 | ||
93 | static void __init rd88f5181l_fxo_init(void) | 96 | static void __init rd88f5181l_fxo_init(void) |
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c index b56447d32e17..ac482019abbf 100644 --- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c +++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <linux/mtd/physmap.h> | 16 | #include <linux/mtd/physmap.h> |
17 | #include <linux/mv643xx_eth.h> | 17 | #include <linux/mv643xx_eth.h> |
18 | #include <linux/ethtool.h> | ||
18 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
20 | #include <asm/gpio.h> | 21 | #include <asm/gpio.h> |
@@ -89,6 +90,8 @@ static struct orion5x_mpp_mode rd88f5181l_ge_mpp_modes[] __initdata = { | |||
89 | 90 | ||
90 | static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = { | 91 | static struct mv643xx_eth_platform_data rd88f5181l_ge_eth_data = { |
91 | .phy_addr = -1, | 92 | .phy_addr = -1, |
93 | .speed = SPEED_1000, | ||
94 | .duplex = DUPLEX_FULL, | ||
92 | }; | 95 | }; |
93 | 96 | ||
94 | static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = { | 97 | static struct i2c_board_info __initdata rd88f5181l_ge_i2c_rtc = { |
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c index 1af093ff8cf3..25568c2a3d29 100644 --- a/arch/arm/mach-orion5x/wnr854t-setup.c +++ b/arch/arm/mach-orion5x/wnr854t-setup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/mtd/physmap.h> | 15 | #include <linux/mtd/physmap.h> |
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/ethtool.h> | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
18 | #include <asm/gpio.h> | 19 | #include <asm/gpio.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -92,6 +93,8 @@ static struct platform_device wnr854t_nor_flash = { | |||
92 | 93 | ||
93 | static struct mv643xx_eth_platform_data wnr854t_eth_data = { | 94 | static struct mv643xx_eth_platform_data wnr854t_eth_data = { |
94 | .phy_addr = -1, | 95 | .phy_addr = -1, |
96 | .speed = SPEED_1000, | ||
97 | .duplex = DUPLEX_FULL, | ||
95 | }; | 98 | }; |
96 | 99 | ||
97 | static void __init wnr854t_init(void) | 100 | static void __init wnr854t_init(void) |
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c index aeab55c6a82d..9b8ee8c48bf0 100644 --- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c +++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
15 | #include <linux/mtd/physmap.h> | 15 | #include <linux/mtd/physmap.h> |
16 | #include <linux/mv643xx_eth.h> | 16 | #include <linux/mv643xx_eth.h> |
17 | #include <linux/ethtool.h> | ||
17 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
18 | #include <asm/gpio.h> | 19 | #include <asm/gpio.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -100,6 +101,8 @@ static struct platform_device wrt350n_v2_nor_flash = { | |||
100 | 101 | ||
101 | static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = { | 102 | static struct mv643xx_eth_platform_data wrt350n_v2_eth_data = { |
102 | .phy_addr = -1, | 103 | .phy_addr = -1, |
104 | .speed = SPEED_1000, | ||
105 | .duplex = DUPLEX_FULL, | ||
103 | }; | 106 | }; |
104 | 107 | ||
105 | static void __init wrt350n_v2_init(void) | 108 | static void __init wrt350n_v2_init(void) |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 24df73ad326d..088885ed51b9 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -156,8 +156,8 @@ static void ia_hack_tcq(IADEV *dev) { | |||
156 | } | 156 | } |
157 | iavcc_r->vc_desc_cnt--; | 157 | iavcc_r->vc_desc_cnt--; |
158 | dev->desc_tbl[desc1 -1].timestamp = 0; | 158 | dev->desc_tbl[desc1 -1].timestamp = 0; |
159 | IF_EVENT(printk("ia_hack: return_q skb = 0x%x desc = %d\n", | 159 | IF_EVENT(printk("ia_hack: return_q skb = 0x%p desc = %d\n", |
160 | (u32)dev->desc_tbl[desc1 -1].txskb, desc1);) | 160 | dev->desc_tbl[desc1 -1].txskb, desc1);) |
161 | if (iavcc_r->pcr < dev->rate_limit) { | 161 | if (iavcc_r->pcr < dev->rate_limit) { |
162 | IA_SKB_STATE (dev->desc_tbl[desc1-1].txskb) |= IA_TX_DONE; | 162 | IA_SKB_STATE (dev->desc_tbl[desc1-1].txskb) |= IA_TX_DONE; |
163 | if (ia_enque_rtn_q(&dev->tx_return_q, dev->desc_tbl[desc1 -1]) < 0) | 163 | if (ia_enque_rtn_q(&dev->tx_return_q, dev->desc_tbl[desc1 -1]) < 0) |
@@ -527,8 +527,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) { | |||
527 | inc = 0; | 527 | inc = 0; |
528 | testSlot = idealSlot; | 528 | testSlot = idealSlot; |
529 | TstSchedTbl = (u16*)(SchedTbl+testSlot); //set index and read in value | 529 | TstSchedTbl = (u16*)(SchedTbl+testSlot); //set index and read in value |
530 | IF_CBR(printk("CBR Testslot 0x%x AT Location 0x%x, NumToAssign=%d\n", | 530 | IF_CBR(printk("CBR Testslot 0x%x AT Location 0x%p, NumToAssign=%d\n", |
531 | testSlot, (u32)TstSchedTbl,toBeAssigned);) | 531 | testSlot, TstSchedTbl,toBeAssigned);) |
532 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); | 532 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); |
533 | while (cbrVC) // If another VC at this location, we have to keep looking | 533 | while (cbrVC) // If another VC at this location, we have to keep looking |
534 | { | 534 | { |
@@ -536,8 +536,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) { | |||
536 | testSlot = idealSlot - inc; | 536 | testSlot = idealSlot - inc; |
537 | if (testSlot < 0) { // Wrap if necessary | 537 | if (testSlot < 0) { // Wrap if necessary |
538 | testSlot += dev->CbrTotEntries; | 538 | testSlot += dev->CbrTotEntries; |
539 | IF_CBR(printk("Testslot Wrap. STable Start=0x%x,Testslot=%d\n", | 539 | IF_CBR(printk("Testslot Wrap. STable Start=0x%p,Testslot=%d\n", |
540 | (u32)SchedTbl,testSlot);) | 540 | SchedTbl,testSlot);) |
541 | } | 541 | } |
542 | TstSchedTbl = (u16 *)(SchedTbl + testSlot); // set table index | 542 | TstSchedTbl = (u16 *)(SchedTbl + testSlot); // set table index |
543 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); | 543 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); |
@@ -552,8 +552,8 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) { | |||
552 | } | 552 | } |
553 | // set table index and read in value | 553 | // set table index and read in value |
554 | TstSchedTbl = (u16*)(SchedTbl + testSlot); | 554 | TstSchedTbl = (u16*)(SchedTbl + testSlot); |
555 | IF_CBR(printk("Reading CBR Tbl from 0x%x, CbrVal=0x%x Iteration %d\n", | 555 | IF_CBR(printk("Reading CBR Tbl from 0x%p, CbrVal=0x%x Iteration %d\n", |
556 | (u32)TstSchedTbl,cbrVC,inc);) | 556 | TstSchedTbl,cbrVC,inc);) |
557 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); | 557 | memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); |
558 | } /* while */ | 558 | } /* while */ |
559 | // Move this VCI number into this location of the CBR Sched table. | 559 | // Move this VCI number into this location of the CBR Sched table. |
@@ -1427,11 +1427,11 @@ static int rx_init(struct atm_dev *dev) | |||
1427 | /* We know this is 32bit bus addressed so the following is safe */ | 1427 | /* We know this is 32bit bus addressed so the following is safe */ |
1428 | writel(iadev->rx_dle_dma & 0xfffff000, | 1428 | writel(iadev->rx_dle_dma & 0xfffff000, |
1429 | iadev->dma + IPHASE5575_RX_LIST_ADDR); | 1429 | iadev->dma + IPHASE5575_RX_LIST_ADDR); |
1430 | IF_INIT(printk("Tx Dle list addr: 0x%08x value: 0x%0x\n", | 1430 | IF_INIT(printk("Tx Dle list addr: 0x%p value: 0x%0x\n", |
1431 | (u32)(iadev->dma+IPHASE5575_TX_LIST_ADDR), | 1431 | iadev->dma+IPHASE5575_TX_LIST_ADDR, |
1432 | *(u32*)(iadev->dma+IPHASE5575_TX_LIST_ADDR)); | 1432 | *(u32*)(iadev->dma+IPHASE5575_TX_LIST_ADDR)); |
1433 | printk("Rx Dle list addr: 0x%08x value: 0x%0x\n", | 1433 | printk("Rx Dle list addr: 0x%p value: 0x%0x\n", |
1434 | (u32)(iadev->dma+IPHASE5575_RX_LIST_ADDR), | 1434 | iadev->dma+IPHASE5575_RX_LIST_ADDR, |
1435 | *(u32*)(iadev->dma+IPHASE5575_RX_LIST_ADDR));) | 1435 | *(u32*)(iadev->dma+IPHASE5575_RX_LIST_ADDR));) |
1436 | 1436 | ||
1437 | writew(0xffff, iadev->reass_reg+REASS_MASK_REG); | 1437 | writew(0xffff, iadev->reass_reg+REASS_MASK_REG); |
@@ -1470,7 +1470,7 @@ static int rx_init(struct atm_dev *dev) | |||
1470 | buf_desc_ptr++; | 1470 | buf_desc_ptr++; |
1471 | rx_pkt_start += iadev->rx_buf_sz; | 1471 | rx_pkt_start += iadev->rx_buf_sz; |
1472 | } | 1472 | } |
1473 | IF_INIT(printk("Rx Buffer desc ptr: 0x%0x\n", (u32)(buf_desc_ptr));) | 1473 | IF_INIT(printk("Rx Buffer desc ptr: 0x%p\n", buf_desc_ptr);) |
1474 | i = FREE_BUF_DESC_Q*iadev->memSize; | 1474 | i = FREE_BUF_DESC_Q*iadev->memSize; |
1475 | writew(i >> 16, iadev->reass_reg+REASS_QUEUE_BASE); | 1475 | writew(i >> 16, iadev->reass_reg+REASS_QUEUE_BASE); |
1476 | writew(i, iadev->reass_reg+FREEQ_ST_ADR); | 1476 | writew(i, iadev->reass_reg+FREEQ_ST_ADR); |
@@ -1487,7 +1487,7 @@ static int rx_init(struct atm_dev *dev) | |||
1487 | *freeq_start = (u_short)i; | 1487 | *freeq_start = (u_short)i; |
1488 | freeq_start++; | 1488 | freeq_start++; |
1489 | } | 1489 | } |
1490 | IF_INIT(printk("freeq_start: 0x%0x\n", (u32)freeq_start);) | 1490 | IF_INIT(printk("freeq_start: 0x%p\n", freeq_start);) |
1491 | /* Packet Complete Queue */ | 1491 | /* Packet Complete Queue */ |
1492 | i = (PKT_COMP_Q * iadev->memSize) & 0xffff; | 1492 | i = (PKT_COMP_Q * iadev->memSize) & 0xffff; |
1493 | writew(i, iadev->reass_reg+PCQ_ST_ADR); | 1493 | writew(i, iadev->reass_reg+PCQ_ST_ADR); |
@@ -1713,7 +1713,7 @@ static void tx_dle_intr(struct atm_dev *dev) | |||
1713 | IA_SKB_STATE(skb) |= IA_DLED; | 1713 | IA_SKB_STATE(skb) |= IA_DLED; |
1714 | skb_queue_tail(&iavcc->txing_skb, skb); | 1714 | skb_queue_tail(&iavcc->txing_skb, skb); |
1715 | } | 1715 | } |
1716 | IF_EVENT(printk("tx_dle_intr: enque skb = 0x%x \n", (u32)skb);) | 1716 | IF_EVENT(printk("tx_dle_intr: enque skb = 0x%p \n", skb);) |
1717 | if (++dle == iadev->tx_dle_q.end) | 1717 | if (++dle == iadev->tx_dle_q.end) |
1718 | dle = iadev->tx_dle_q.start; | 1718 | dle = iadev->tx_dle_q.start; |
1719 | } | 1719 | } |
@@ -2044,8 +2044,8 @@ static int tx_init(struct atm_dev *dev) | |||
2044 | writew(tmp16, iadev->seg_reg+CBR_TAB_END+1); // CBR_PTR; | 2044 | writew(tmp16, iadev->seg_reg+CBR_TAB_END+1); // CBR_PTR; |
2045 | tmp16 = (CBR_SCHED_TABLE*iadev->memSize + iadev->num_vc*6 - 2) >> 1; | 2045 | tmp16 = (CBR_SCHED_TABLE*iadev->memSize + iadev->num_vc*6 - 2) >> 1; |
2046 | writew(tmp16, iadev->seg_reg+CBR_TAB_END); | 2046 | writew(tmp16, iadev->seg_reg+CBR_TAB_END); |
2047 | IF_INIT(printk("iadev->seg_reg = 0x%x CBR_PTR_BASE = 0x%x\n", | 2047 | IF_INIT(printk("iadev->seg_reg = 0x%p CBR_PTR_BASE = 0x%x\n", |
2048 | (u32)iadev->seg_reg, readw(iadev->seg_reg+CBR_PTR_BASE));) | 2048 | iadev->seg_reg, readw(iadev->seg_reg+CBR_PTR_BASE));) |
2049 | IF_INIT(printk("CBR_TAB_BEG = 0x%x, CBR_TAB_END = 0x%x, CBR_PTR = 0x%x\n", | 2049 | IF_INIT(printk("CBR_TAB_BEG = 0x%x, CBR_TAB_END = 0x%x, CBR_PTR = 0x%x\n", |
2050 | readw(iadev->seg_reg+CBR_TAB_BEG), readw(iadev->seg_reg+CBR_TAB_END), | 2050 | readw(iadev->seg_reg+CBR_TAB_BEG), readw(iadev->seg_reg+CBR_TAB_END), |
2051 | readw(iadev->seg_reg+CBR_TAB_END+1));) | 2051 | readw(iadev->seg_reg+CBR_TAB_END+1));) |
@@ -2963,8 +2963,8 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) { | |||
2963 | 2963 | ||
2964 | /* Put the packet in a tx buffer */ | 2964 | /* Put the packet in a tx buffer */ |
2965 | trailer = iadev->tx_buf[desc-1].cpcs; | 2965 | trailer = iadev->tx_buf[desc-1].cpcs; |
2966 | IF_TX(printk("Sent: skb = 0x%x skb->data: 0x%x len: %d, desc: %d\n", | 2966 | IF_TX(printk("Sent: skb = 0x%p skb->data: 0x%p len: %d, desc: %d\n", |
2967 | (u32)skb, (u32)skb->data, skb->len, desc);) | 2967 | skb, skb->data, skb->len, desc);) |
2968 | trailer->control = 0; | 2968 | trailer->control = 0; |
2969 | /*big endian*/ | 2969 | /*big endian*/ |
2970 | trailer->length = ((skb->len & 0xff) << 8) | ((skb->len & 0xff00) >> 8); | 2970 | trailer->length = ((skb->len & 0xff) << 8) | ((skb->len & 0xff00) >> 8); |
@@ -3181,7 +3181,7 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3181 | } | 3181 | } |
3182 | dev->dev_data = iadev; | 3182 | dev->dev_data = iadev; |
3183 | IF_INIT(printk(DEV_LABEL "registered at (itf :%d)\n", dev->number);) | 3183 | IF_INIT(printk(DEV_LABEL "registered at (itf :%d)\n", dev->number);) |
3184 | IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, | 3184 | IF_INIT(printk("dev_id = 0x%p iadev->LineRate = %d \n", dev, |
3185 | iadev->LineRate);) | 3185 | iadev->LineRate);) |
3186 | 3186 | ||
3187 | pci_set_drvdata(pdev, dev); | 3187 | pci_set_drvdata(pdev, dev); |
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index 192522ebb771..c33bb59ed1fa 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c | |||
@@ -134,6 +134,13 @@ static struct usb_device_id blacklist_ids[] = { | |||
134 | 134 | ||
135 | /* Dell laptop with Broadcom chip */ | 135 | /* Dell laptop with Broadcom chip */ |
136 | { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, | 136 | { USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, |
137 | /* Dell Wireless 370 */ | ||
138 | { USB_DEVICE(0x413c, 0x8156), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, | ||
139 | /* Dell Wireless 410 */ | ||
140 | { USB_DEVICE(0x413c, 0x8152), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU }, | ||
141 | |||
142 | /* Broadcom 2046 */ | ||
143 | { USB_DEVICE(0x0a5c, 0x2151), .driver_info = HCI_RESET }, | ||
137 | 144 | ||
138 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ | 145 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ |
139 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, | 146 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, |
diff --git a/drivers/isdn/gigaset/isocdata.c b/drivers/isdn/gigaset/isocdata.c index e30a7773f93c..fbce5222d83c 100644 --- a/drivers/isdn/gigaset/isocdata.c +++ b/drivers/isdn/gigaset/isocdata.c | |||
@@ -247,7 +247,6 @@ static inline void dump_bytes(enum debuglevel level, const char *tag, | |||
247 | #ifdef CONFIG_GIGASET_DEBUG | 247 | #ifdef CONFIG_GIGASET_DEBUG |
248 | unsigned char c; | 248 | unsigned char c; |
249 | static char dbgline[3 * 32 + 1]; | 249 | static char dbgline[3 * 32 + 1]; |
250 | static const char hexdigit[] = "0123456789abcdef"; | ||
251 | int i = 0; | 250 | int i = 0; |
252 | while (count-- > 0) { | 251 | while (count-- > 0) { |
253 | if (i > sizeof(dbgline) - 4) { | 252 | if (i > sizeof(dbgline) - 4) { |
@@ -258,8 +257,8 @@ static inline void dump_bytes(enum debuglevel level, const char *tag, | |||
258 | c = *bytes++; | 257 | c = *bytes++; |
259 | dbgline[i] = (i && !(i % 12)) ? '-' : ' '; | 258 | dbgline[i] = (i && !(i % 12)) ? '-' : ' '; |
260 | i++; | 259 | i++; |
261 | dbgline[i++] = hexdigit[(c >> 4) & 0x0f]; | 260 | dbgline[i++] = hex_asc_hi(c); |
262 | dbgline[i++] = hexdigit[c & 0x0f]; | 261 | dbgline[i++] = hex_asc_lo(c); |
263 | } | 262 | } |
264 | dbgline[i] = '\0'; | 263 | dbgline[i] = '\0'; |
265 | gig_dbg(level, "%s:%s", tag, dbgline); | 264 | gig_dbg(level, "%s:%s", tag, dbgline); |
diff --git a/drivers/isdn/hysdn/hysdn_pof.h b/drivers/isdn/hysdn/hysdn_pof.h index a368d6caca0e..3a72b908900f 100644 --- a/drivers/isdn/hysdn/hysdn_pof.h +++ b/drivers/isdn/hysdn/hysdn_pof.h | |||
@@ -60,7 +60,7 @@ typedef struct PofRecHdr_tag { /* Pof record header */ | |||
60 | 60 | ||
61 | typedef struct PofTimeStamp_tag { | 61 | typedef struct PofTimeStamp_tag { |
62 | /*00 */ unsigned long UnixTime __attribute__((packed)); | 62 | /*00 */ unsigned long UnixTime __attribute__((packed)); |
63 | /*04 */ unsigned char DateTimeText[0x28] __attribute__((packed)); | 63 | /*04 */ unsigned char DateTimeText[0x28]; |
64 | /* =40 */ | 64 | /* =40 */ |
65 | /*2C */ | 65 | /*2C */ |
66 | } tPofTimeStamp; | 66 | } tPofTimeStamp; |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index fa533c27052a..8a03875ec877 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -510,14 +510,14 @@ config STNIC | |||
510 | config SH_ETH | 510 | config SH_ETH |
511 | tristate "Renesas SuperH Ethernet support" | 511 | tristate "Renesas SuperH Ethernet support" |
512 | depends on SUPERH && \ | 512 | depends on SUPERH && \ |
513 | (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712) | 513 | (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7763) |
514 | select CRC32 | 514 | select CRC32 |
515 | select MII | 515 | select MII |
516 | select MDIO_BITBANG | 516 | select MDIO_BITBANG |
517 | select PHYLIB | 517 | select PHYLIB |
518 | help | 518 | help |
519 | Renesas SuperH Ethernet device driver. | 519 | Renesas SuperH Ethernet device driver. |
520 | This driver support SH7710 and SH7712. | 520 | This driver support SH7710, SH7712 and SH7763. |
521 | 521 | ||
522 | config SUNLANCE | 522 | config SUNLANCE |
523 | tristate "Sun LANCE support" | 523 | tristate "Sun LANCE support" |
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index a8ec60e1ed75..3db7db1828e7 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -605,36 +605,87 @@ adjust_head: | |||
605 | static int bfin_mac_hard_start_xmit(struct sk_buff *skb, | 605 | static int bfin_mac_hard_start_xmit(struct sk_buff *skb, |
606 | struct net_device *dev) | 606 | struct net_device *dev) |
607 | { | 607 | { |
608 | unsigned int data; | 608 | u16 *data; |
609 | 609 | ||
610 | current_tx_ptr->skb = skb; | 610 | current_tx_ptr->skb = skb; |
611 | 611 | ||
612 | /* | 612 | if (ANOMALY_05000285) { |
613 | * Is skb->data always 16-bit aligned? | 613 | /* |
614 | * Do we need to memcpy((char *)(tail->packet + 2), skb->data, len)? | 614 | * TXDWA feature is not avaible to older revision < 0.3 silicon |
615 | */ | 615 | * of BF537 |
616 | if ((((unsigned int)(skb->data)) & 0x02) == 2) { | 616 | * |
617 | /* move skb->data to current_tx_ptr payload */ | 617 | * Only if data buffer is ODD WORD alignment, we do not |
618 | data = (unsigned int)(skb->data) - 2; | 618 | * need to memcpy |
619 | *((unsigned short *)data) = (unsigned short)(skb->len); | 619 | */ |
620 | current_tx_ptr->desc_a.start_addr = (unsigned long)data; | 620 | u32 data_align = (u32)(skb->data) & 0x3; |
621 | /* this is important! */ | 621 | if (data_align == 0x2) { |
622 | blackfin_dcache_flush_range(data, (data + (skb->len)) + 2); | 622 | /* move skb->data to current_tx_ptr payload */ |
623 | 623 | data = (u16 *)(skb->data) - 1; | |
624 | *data = (u16)(skb->len); | ||
625 | current_tx_ptr->desc_a.start_addr = (u32)data; | ||
626 | /* this is important! */ | ||
627 | blackfin_dcache_flush_range((u32)data, | ||
628 | (u32)((u8 *)data + skb->len + 4)); | ||
629 | } else { | ||
630 | *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len); | ||
631 | memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data, | ||
632 | skb->len); | ||
633 | current_tx_ptr->desc_a.start_addr = | ||
634 | (u32)current_tx_ptr->packet; | ||
635 | if (current_tx_ptr->status.status_word != 0) | ||
636 | current_tx_ptr->status.status_word = 0; | ||
637 | blackfin_dcache_flush_range( | ||
638 | (u32)current_tx_ptr->packet, | ||
639 | (u32)(current_tx_ptr->packet + skb->len + 2)); | ||
640 | } | ||
624 | } else { | 641 | } else { |
625 | *((unsigned short *)(current_tx_ptr->packet)) = | 642 | /* |
626 | (unsigned short)(skb->len); | 643 | * TXDWA feature is avaible to revision < 0.3 silicon of |
627 | memcpy((char *)(current_tx_ptr->packet + 2), skb->data, | 644 | * BF537 and always avaible to BF52x |
628 | (skb->len)); | 645 | */ |
629 | current_tx_ptr->desc_a.start_addr = | 646 | u32 data_align = (u32)(skb->data) & 0x3; |
630 | (unsigned long)current_tx_ptr->packet; | 647 | if (data_align == 0x0) { |
631 | if (current_tx_ptr->status.status_word != 0) | 648 | u16 sysctl = bfin_read_EMAC_SYSCTL(); |
632 | current_tx_ptr->status.status_word = 0; | 649 | sysctl |= TXDWA; |
633 | blackfin_dcache_flush_range((unsigned int)current_tx_ptr-> | 650 | bfin_write_EMAC_SYSCTL(sysctl); |
634 | packet, | 651 | |
635 | (unsigned int)(current_tx_ptr-> | 652 | /* move skb->data to current_tx_ptr payload */ |
636 | packet + skb->len) + | 653 | data = (u16 *)(skb->data) - 2; |
637 | 2); | 654 | *data = (u16)(skb->len); |
655 | current_tx_ptr->desc_a.start_addr = (u32)data; | ||
656 | /* this is important! */ | ||
657 | blackfin_dcache_flush_range( | ||
658 | (u32)data, | ||
659 | (u32)((u8 *)data + skb->len + 4)); | ||
660 | } else if (data_align == 0x2) { | ||
661 | u16 sysctl = bfin_read_EMAC_SYSCTL(); | ||
662 | sysctl &= ~TXDWA; | ||
663 | bfin_write_EMAC_SYSCTL(sysctl); | ||
664 | |||
665 | /* move skb->data to current_tx_ptr payload */ | ||
666 | data = (u16 *)(skb->data) - 1; | ||
667 | *data = (u16)(skb->len); | ||
668 | current_tx_ptr->desc_a.start_addr = (u32)data; | ||
669 | /* this is important! */ | ||
670 | blackfin_dcache_flush_range( | ||
671 | (u32)data, | ||
672 | (u32)((u8 *)data + skb->len + 4)); | ||
673 | } else { | ||
674 | u16 sysctl = bfin_read_EMAC_SYSCTL(); | ||
675 | sysctl &= ~TXDWA; | ||
676 | bfin_write_EMAC_SYSCTL(sysctl); | ||
677 | |||
678 | *((u16 *)(current_tx_ptr->packet)) = (u16)(skb->len); | ||
679 | memcpy((u8 *)(current_tx_ptr->packet + 2), skb->data, | ||
680 | skb->len); | ||
681 | current_tx_ptr->desc_a.start_addr = | ||
682 | (u32)current_tx_ptr->packet; | ||
683 | if (current_tx_ptr->status.status_word != 0) | ||
684 | current_tx_ptr->status.status_word = 0; | ||
685 | blackfin_dcache_flush_range( | ||
686 | (u32)current_tx_ptr->packet, | ||
687 | (u32)(current_tx_ptr->packet + skb->len + 2)); | ||
688 | } | ||
638 | } | 689 | } |
639 | 690 | ||
640 | /* enable this packet's dma */ | 691 | /* enable this packet's dma */ |
@@ -691,7 +742,6 @@ static void bfin_mac_rx(struct net_device *dev) | |||
691 | (unsigned long)skb->tail); | 742 | (unsigned long)skb->tail); |
692 | 743 | ||
693 | dev->last_rx = jiffies; | 744 | dev->last_rx = jiffies; |
694 | skb->dev = dev; | ||
695 | skb->protocol = eth_type_trans(skb, dev); | 745 | skb->protocol = eth_type_trans(skb, dev); |
696 | #if defined(BFIN_MAC_CSUM_OFFLOAD) | 746 | #if defined(BFIN_MAC_CSUM_OFFLOAD) |
697 | skb->csum = current_rx_ptr->status.ip_payload_csum; | 747 | skb->csum = current_rx_ptr->status.ip_payload_csum; |
@@ -920,6 +970,7 @@ static int bfin_mac_open(struct net_device *dev) | |||
920 | phy_start(lp->phydev); | 970 | phy_start(lp->phydev); |
921 | phy_write(lp->phydev, MII_BMCR, BMCR_RESET); | 971 | phy_write(lp->phydev, MII_BMCR, BMCR_RESET); |
922 | setup_system_regs(dev); | 972 | setup_system_regs(dev); |
973 | setup_mac_addr(dev->dev_addr); | ||
923 | bfin_mac_disable(); | 974 | bfin_mac_disable(); |
924 | bfin_mac_enable(); | 975 | bfin_mac_enable(); |
925 | pr_debug("hardware init finished\n"); | 976 | pr_debug("hardware init finished\n"); |
@@ -955,7 +1006,7 @@ static int bfin_mac_close(struct net_device *dev) | |||
955 | return 0; | 1006 | return 0; |
956 | } | 1007 | } |
957 | 1008 | ||
958 | static int __init bfin_mac_probe(struct platform_device *pdev) | 1009 | static int __devinit bfin_mac_probe(struct platform_device *pdev) |
959 | { | 1010 | { |
960 | struct net_device *ndev; | 1011 | struct net_device *ndev; |
961 | struct bfin_mac_local *lp; | 1012 | struct bfin_mac_local *lp; |
@@ -1081,7 +1132,7 @@ out_err_probe_mac: | |||
1081 | return rc; | 1132 | return rc; |
1082 | } | 1133 | } |
1083 | 1134 | ||
1084 | static int bfin_mac_remove(struct platform_device *pdev) | 1135 | static int __devexit bfin_mac_remove(struct platform_device *pdev) |
1085 | { | 1136 | { |
1086 | struct net_device *ndev = platform_get_drvdata(pdev); | 1137 | struct net_device *ndev = platform_get_drvdata(pdev); |
1087 | struct bfin_mac_local *lp = netdev_priv(ndev); | 1138 | struct bfin_mac_local *lp = netdev_priv(ndev); |
@@ -1128,7 +1179,7 @@ static int bfin_mac_resume(struct platform_device *pdev) | |||
1128 | 1179 | ||
1129 | static struct platform_driver bfin_mac_driver = { | 1180 | static struct platform_driver bfin_mac_driver = { |
1130 | .probe = bfin_mac_probe, | 1181 | .probe = bfin_mac_probe, |
1131 | .remove = bfin_mac_remove, | 1182 | .remove = __devexit_p(bfin_mac_remove), |
1132 | .resume = bfin_mac_resume, | 1183 | .resume = bfin_mac_resume, |
1133 | .suspend = bfin_mac_suspend, | 1184 | .suspend = bfin_mac_suspend, |
1134 | .driver = { | 1185 | .driver = { |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 47d51788a462..04c0e90119af 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -683,7 +683,7 @@ enum { | |||
683 | SF_ERASE_SECTOR = 0xd8, /* erase sector */ | 683 | SF_ERASE_SECTOR = 0xd8, /* erase sector */ |
684 | 684 | ||
685 | FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */ | 685 | FW_FLASH_BOOT_ADDR = 0x70000, /* start address of FW in flash */ |
686 | FW_VERS_ADDR = 0x77ffc, /* flash address holding FW version */ | 686 | FW_VERS_ADDR = 0x7fffc, /* flash address holding FW version */ |
687 | FW_MIN_SIZE = 8 /* at least version and csum */ | 687 | FW_MIN_SIZE = 8 /* at least version and csum */ |
688 | }; | 688 | }; |
689 | 689 | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 0920b796bd78..b70c5314f537 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2937,9 +2937,9 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2937 | } | 2937 | } |
2938 | } | 2938 | } |
2939 | } | 2939 | } |
2940 | mutex_unlock(&dlpar_mem_lock); | 2940 | ehea_info("re-initializing driver complete"); |
2941 | ehea_info("re-initializing driver complete"); | ||
2942 | out: | 2941 | out: |
2942 | mutex_unlock(&dlpar_mem_lock); | ||
2943 | return; | 2943 | return; |
2944 | } | 2944 | } |
2945 | 2945 | ||
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index c05cb159c772..aa0bf6e1c694 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c | |||
@@ -1547,8 +1547,10 @@ static int __devinit enc28j60_probe(struct spi_device *spi) | |||
1547 | random_ether_addr(dev->dev_addr); | 1547 | random_ether_addr(dev->dev_addr); |
1548 | enc28j60_set_hw_macaddr(dev); | 1548 | enc28j60_set_hw_macaddr(dev); |
1549 | 1549 | ||
1550 | ret = request_irq(spi->irq, enc28j60_irq, IRQF_TRIGGER_FALLING, | 1550 | /* Board setup must set the relevant edge trigger type; |
1551 | DRV_NAME, priv); | 1551 | * level triggers won't currently work. |
1552 | */ | ||
1553 | ret = request_irq(spi->irq, enc28j60_irq, 0, DRV_NAME, priv); | ||
1552 | if (ret < 0) { | 1554 | if (ret < 0) { |
1553 | if (netif_msg_probe(priv)) | 1555 | if (netif_msg_probe(priv)) |
1554 | dev_err(&spi->dev, DRV_NAME ": request irq %d failed " | 1556 | dev_err(&spi->dev, DRV_NAME ": request irq %d failed " |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 4ed89fa9ae46..01b38b092c76 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -333,6 +333,7 @@ enum { | |||
333 | NvRegPowerState2 = 0x600, | 333 | NvRegPowerState2 = 0x600, |
334 | #define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11 | 334 | #define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11 |
335 | #define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001 | 335 | #define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001 |
336 | #define NVREG_POWERSTATE2_PHY_RESET 0x0004 | ||
336 | }; | 337 | }; |
337 | 338 | ||
338 | /* Big endian: should work, but is untested */ | 339 | /* Big endian: should work, but is untested */ |
@@ -529,6 +530,7 @@ union ring_type { | |||
529 | #define PHY_REALTEK_INIT_REG4 0x14 | 530 | #define PHY_REALTEK_INIT_REG4 0x14 |
530 | #define PHY_REALTEK_INIT_REG5 0x18 | 531 | #define PHY_REALTEK_INIT_REG5 0x18 |
531 | #define PHY_REALTEK_INIT_REG6 0x11 | 532 | #define PHY_REALTEK_INIT_REG6 0x11 |
533 | #define PHY_REALTEK_INIT_REG7 0x01 | ||
532 | #define PHY_REALTEK_INIT1 0x0000 | 534 | #define PHY_REALTEK_INIT1 0x0000 |
533 | #define PHY_REALTEK_INIT2 0x8e00 | 535 | #define PHY_REALTEK_INIT2 0x8e00 |
534 | #define PHY_REALTEK_INIT3 0x0001 | 536 | #define PHY_REALTEK_INIT3 0x0001 |
@@ -537,6 +539,9 @@ union ring_type { | |||
537 | #define PHY_REALTEK_INIT6 0xf5c7 | 539 | #define PHY_REALTEK_INIT6 0xf5c7 |
538 | #define PHY_REALTEK_INIT7 0x1000 | 540 | #define PHY_REALTEK_INIT7 0x1000 |
539 | #define PHY_REALTEK_INIT8 0x0003 | 541 | #define PHY_REALTEK_INIT8 0x0003 |
542 | #define PHY_REALTEK_INIT9 0x0008 | ||
543 | #define PHY_REALTEK_INIT10 0x0005 | ||
544 | #define PHY_REALTEK_INIT11 0x0200 | ||
540 | #define PHY_REALTEK_INIT_MSK1 0x0003 | 545 | #define PHY_REALTEK_INIT_MSK1 0x0003 |
541 | 546 | ||
542 | #define PHY_GIGABIT 0x0100 | 547 | #define PHY_GIGABIT 0x0100 |
@@ -1149,6 +1154,42 @@ static int phy_init(struct net_device *dev) | |||
1149 | return PHY_ERROR; | 1154 | return PHY_ERROR; |
1150 | } | 1155 | } |
1151 | } | 1156 | } |
1157 | if (np->phy_model == PHY_MODEL_REALTEK_8211 && | ||
1158 | np->phy_rev == PHY_REV_REALTEK_8211C) { | ||
1159 | u32 powerstate = readl(base + NvRegPowerState2); | ||
1160 | |||
1161 | /* need to perform hw phy reset */ | ||
1162 | powerstate |= NVREG_POWERSTATE2_PHY_RESET; | ||
1163 | writel(powerstate, base + NvRegPowerState2); | ||
1164 | msleep(25); | ||
1165 | |||
1166 | powerstate &= ~NVREG_POWERSTATE2_PHY_RESET; | ||
1167 | writel(powerstate, base + NvRegPowerState2); | ||
1168 | msleep(25); | ||
1169 | |||
1170 | reg = mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG6, MII_READ); | ||
1171 | reg |= PHY_REALTEK_INIT9; | ||
1172 | if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG6, reg)) { | ||
1173 | printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev)); | ||
1174 | return PHY_ERROR; | ||
1175 | } | ||
1176 | if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT10)) { | ||
1177 | printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev)); | ||
1178 | return PHY_ERROR; | ||
1179 | } | ||
1180 | reg = mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG7, MII_READ); | ||
1181 | if (!(reg & PHY_REALTEK_INIT11)) { | ||
1182 | reg |= PHY_REALTEK_INIT11; | ||
1183 | if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG7, reg)) { | ||
1184 | printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev)); | ||
1185 | return PHY_ERROR; | ||
1186 | } | ||
1187 | } | ||
1188 | if (mii_rw(dev, np->phyaddr, PHY_REALTEK_INIT_REG1, PHY_REALTEK_INIT1)) { | ||
1189 | printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev)); | ||
1190 | return PHY_ERROR; | ||
1191 | } | ||
1192 | } | ||
1152 | if (np->phy_model == PHY_MODEL_REALTEK_8201) { | 1193 | if (np->phy_model == PHY_MODEL_REALTEK_8201) { |
1153 | if (np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_32 || | 1194 | if (np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_32 || |
1154 | np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_33 || | 1195 | np->device_id == PCI_DEVICE_ID_NVIDIA_NVENET_33 || |
@@ -1201,12 +1242,23 @@ static int phy_init(struct net_device *dev) | |||
1201 | mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); | 1242 | mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); |
1202 | mii_control |= BMCR_ANENABLE; | 1243 | mii_control |= BMCR_ANENABLE; |
1203 | 1244 | ||
1204 | /* reset the phy | 1245 | if (np->phy_oui == PHY_OUI_REALTEK && |
1205 | * (certain phys need bmcr to be setup with reset) | 1246 | np->phy_model == PHY_MODEL_REALTEK_8211 && |
1206 | */ | 1247 | np->phy_rev == PHY_REV_REALTEK_8211C) { |
1207 | if (phy_reset(dev, mii_control)) { | 1248 | /* start autoneg since we already performed hw reset above */ |
1208 | printk(KERN_INFO "%s: phy reset failed\n", pci_name(np->pci_dev)); | 1249 | mii_control |= BMCR_ANRESTART; |
1209 | return PHY_ERROR; | 1250 | if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { |
1251 | printk(KERN_INFO "%s: phy init failed\n", pci_name(np->pci_dev)); | ||
1252 | return PHY_ERROR; | ||
1253 | } | ||
1254 | } else { | ||
1255 | /* reset the phy | ||
1256 | * (certain phys need bmcr to be setup with reset) | ||
1257 | */ | ||
1258 | if (phy_reset(dev, mii_control)) { | ||
1259 | printk(KERN_INFO "%s: phy reset failed\n", pci_name(np->pci_dev)); | ||
1260 | return PHY_ERROR; | ||
1261 | } | ||
1210 | } | 1262 | } |
1211 | 1263 | ||
1212 | /* phy vendor specific configuration */ | 1264 | /* phy vendor specific configuration */ |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index 0960e69b2da4..e4fbefc8c82f 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -69,18 +69,20 @@ static void ri_tasklet(unsigned long dev) | |||
69 | struct net_device *_dev = (struct net_device *)dev; | 69 | struct net_device *_dev = (struct net_device *)dev; |
70 | struct ifb_private *dp = netdev_priv(_dev); | 70 | struct ifb_private *dp = netdev_priv(_dev); |
71 | struct net_device_stats *stats = &_dev->stats; | 71 | struct net_device_stats *stats = &_dev->stats; |
72 | struct netdev_queue *txq; | ||
72 | struct sk_buff *skb; | 73 | struct sk_buff *skb; |
73 | 74 | ||
75 | txq = netdev_get_tx_queue(_dev, 0); | ||
74 | dp->st_task_enter++; | 76 | dp->st_task_enter++; |
75 | if ((skb = skb_peek(&dp->tq)) == NULL) { | 77 | if ((skb = skb_peek(&dp->tq)) == NULL) { |
76 | dp->st_txq_refl_try++; | 78 | dp->st_txq_refl_try++; |
77 | if (netif_tx_trylock(_dev)) { | 79 | if (__netif_tx_trylock(txq)) { |
78 | dp->st_rxq_enter++; | 80 | dp->st_rxq_enter++; |
79 | while ((skb = skb_dequeue(&dp->rq)) != NULL) { | 81 | while ((skb = skb_dequeue(&dp->rq)) != NULL) { |
80 | skb_queue_tail(&dp->tq, skb); | 82 | skb_queue_tail(&dp->tq, skb); |
81 | dp->st_rx2tx_tran++; | 83 | dp->st_rx2tx_tran++; |
82 | } | 84 | } |
83 | netif_tx_unlock(_dev); | 85 | __netif_tx_unlock(txq); |
84 | } else { | 86 | } else { |
85 | /* reschedule */ | 87 | /* reschedule */ |
86 | dp->st_rxq_notenter++; | 88 | dp->st_rxq_notenter++; |
@@ -115,7 +117,7 @@ static void ri_tasklet(unsigned long dev) | |||
115 | BUG(); | 117 | BUG(); |
116 | } | 118 | } |
117 | 119 | ||
118 | if (netif_tx_trylock(_dev)) { | 120 | if (__netif_tx_trylock(txq)) { |
119 | dp->st_rxq_check++; | 121 | dp->st_rxq_check++; |
120 | if ((skb = skb_peek(&dp->rq)) == NULL) { | 122 | if ((skb = skb_peek(&dp->rq)) == NULL) { |
121 | dp->tasklet_pending = 0; | 123 | dp->tasklet_pending = 0; |
@@ -123,10 +125,10 @@ static void ri_tasklet(unsigned long dev) | |||
123 | netif_wake_queue(_dev); | 125 | netif_wake_queue(_dev); |
124 | } else { | 126 | } else { |
125 | dp->st_rxq_rsch++; | 127 | dp->st_rxq_rsch++; |
126 | netif_tx_unlock(_dev); | 128 | __netif_tx_unlock(txq); |
127 | goto resched; | 129 | goto resched; |
128 | } | 130 | } |
129 | netif_tx_unlock(_dev); | 131 | __netif_tx_unlock(txq); |
130 | } else { | 132 | } else { |
131 | resched: | 133 | resched: |
132 | dp->tasklet_pending = 1; | 134 | dp->tasklet_pending = 1; |
diff --git a/drivers/net/irda/act200l-sir.c b/drivers/net/irda/act200l-sir.c index d8b89c74aabd..37ab8c855719 100644 --- a/drivers/net/irda/act200l-sir.c +++ b/drivers/net/irda/act200l-sir.c | |||
@@ -107,7 +107,7 @@ static int act200l_open(struct sir_dev *dev) | |||
107 | { | 107 | { |
108 | struct qos_info *qos = &dev->qos; | 108 | struct qos_info *qos = &dev->qos; |
109 | 109 | ||
110 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 110 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
111 | 111 | ||
112 | /* Power on the dongle */ | 112 | /* Power on the dongle */ |
113 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 113 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
@@ -124,7 +124,7 @@ static int act200l_open(struct sir_dev *dev) | |||
124 | 124 | ||
125 | static int act200l_close(struct sir_dev *dev) | 125 | static int act200l_close(struct sir_dev *dev) |
126 | { | 126 | { |
127 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 127 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
128 | 128 | ||
129 | /* Power off the dongle */ | 129 | /* Power off the dongle */ |
130 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 130 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -143,7 +143,7 @@ static int act200l_change_speed(struct sir_dev *dev, unsigned speed) | |||
143 | u8 control[3]; | 143 | u8 control[3]; |
144 | int ret = 0; | 144 | int ret = 0; |
145 | 145 | ||
146 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 146 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
147 | 147 | ||
148 | /* Clear DTR and set RTS to enter command mode */ | 148 | /* Clear DTR and set RTS to enter command mode */ |
149 | sirdev_set_dtr_rts(dev, FALSE, TRUE); | 149 | sirdev_set_dtr_rts(dev, FALSE, TRUE); |
@@ -212,7 +212,7 @@ static int act200l_reset(struct sir_dev *dev) | |||
212 | }; | 212 | }; |
213 | int ret = 0; | 213 | int ret = 0; |
214 | 214 | ||
215 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); | 215 | IRDA_DEBUG(2, "%s()\n", __func__ ); |
216 | 216 | ||
217 | switch (state) { | 217 | switch (state) { |
218 | case SIRDEV_STATE_DONGLE_RESET: | 218 | case SIRDEV_STATE_DONGLE_RESET: |
@@ -240,7 +240,7 @@ static int act200l_reset(struct sir_dev *dev) | |||
240 | dev->speed = 9600; | 240 | dev->speed = 9600; |
241 | break; | 241 | break; |
242 | default: | 242 | default: |
243 | IRDA_ERROR("%s(), unknown state %d\n", __FUNCTION__, state); | 243 | IRDA_ERROR("%s(), unknown state %d\n", __func__, state); |
244 | ret = -1; | 244 | ret = -1; |
245 | break; | 245 | break; |
246 | } | 246 | } |
diff --git a/drivers/net/irda/actisys-sir.c b/drivers/net/irda/actisys-sir.c index 736d2473b7e1..50b2141a6103 100644 --- a/drivers/net/irda/actisys-sir.c +++ b/drivers/net/irda/actisys-sir.c | |||
@@ -165,7 +165,7 @@ static int actisys_change_speed(struct sir_dev *dev, unsigned speed) | |||
165 | int ret = 0; | 165 | int ret = 0; |
166 | int i = 0; | 166 | int i = 0; |
167 | 167 | ||
168 | IRDA_DEBUG(4, "%s(), speed=%d (was %d)\n", __FUNCTION__, | 168 | IRDA_DEBUG(4, "%s(), speed=%d (was %d)\n", __func__, |
169 | speed, dev->speed); | 169 | speed, dev->speed); |
170 | 170 | ||
171 | /* dongle was already resetted from irda_request state machine, | 171 | /* dongle was already resetted from irda_request state machine, |
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c index 083b0dd70fef..2ff181861d2d 100644 --- a/drivers/net/irda/ali-ircc.c +++ b/drivers/net/irda/ali-ircc.c | |||
@@ -152,7 +152,7 @@ static int __init ali_ircc_init(void) | |||
152 | int reg, revision; | 152 | int reg, revision; |
153 | int i = 0; | 153 | int i = 0; |
154 | 154 | ||
155 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 155 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
156 | 156 | ||
157 | ret = platform_driver_register(&ali_ircc_driver); | 157 | ret = platform_driver_register(&ali_ircc_driver); |
158 | if (ret) { | 158 | if (ret) { |
@@ -166,7 +166,7 @@ static int __init ali_ircc_init(void) | |||
166 | /* Probe for all the ALi chipsets we know about */ | 166 | /* Probe for all the ALi chipsets we know about */ |
167 | for (chip= chips; chip->name; chip++, i++) | 167 | for (chip= chips; chip->name; chip++, i++) |
168 | { | 168 | { |
169 | IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __FUNCTION__, chip->name); | 169 | IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __func__, chip->name); |
170 | 170 | ||
171 | /* Try all config registers for this chip */ | 171 | /* Try all config registers for this chip */ |
172 | for (cfg=0; cfg<2; cfg++) | 172 | for (cfg=0; cfg<2; cfg++) |
@@ -196,11 +196,11 @@ static int __init ali_ircc_init(void) | |||
196 | 196 | ||
197 | if (reg == chip->cid_value) | 197 | if (reg == chip->cid_value) |
198 | { | 198 | { |
199 | IRDA_DEBUG(2, "%s(), Chip found at 0x%03x\n", __FUNCTION__, cfg_base); | 199 | IRDA_DEBUG(2, "%s(), Chip found at 0x%03x\n", __func__, cfg_base); |
200 | 200 | ||
201 | outb(0x1F, cfg_base); | 201 | outb(0x1F, cfg_base); |
202 | revision = inb(cfg_base+1); | 202 | revision = inb(cfg_base+1); |
203 | IRDA_DEBUG(2, "%s(), Found %s chip, revision=%d\n", __FUNCTION__, | 203 | IRDA_DEBUG(2, "%s(), Found %s chip, revision=%d\n", __func__, |
204 | chip->name, revision); | 204 | chip->name, revision); |
205 | 205 | ||
206 | /* | 206 | /* |
@@ -223,14 +223,14 @@ static int __init ali_ircc_init(void) | |||
223 | } | 223 | } |
224 | else | 224 | else |
225 | { | 225 | { |
226 | IRDA_DEBUG(2, "%s(), No %s chip at 0x%03x\n", __FUNCTION__, chip->name, cfg_base); | 226 | IRDA_DEBUG(2, "%s(), No %s chip at 0x%03x\n", __func__, chip->name, cfg_base); |
227 | } | 227 | } |
228 | /* Exit configuration */ | 228 | /* Exit configuration */ |
229 | outb(0xbb, cfg_base); | 229 | outb(0xbb, cfg_base); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); | 233 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); |
234 | 234 | ||
235 | if (ret) | 235 | if (ret) |
236 | platform_driver_unregister(&ali_ircc_driver); | 236 | platform_driver_unregister(&ali_ircc_driver); |
@@ -248,7 +248,7 @@ static void __exit ali_ircc_cleanup(void) | |||
248 | { | 248 | { |
249 | int i; | 249 | int i; |
250 | 250 | ||
251 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 251 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
252 | 252 | ||
253 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { | 253 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { |
254 | if (dev_self[i]) | 254 | if (dev_self[i]) |
@@ -257,7 +257,7 @@ static void __exit ali_ircc_cleanup(void) | |||
257 | 257 | ||
258 | platform_driver_unregister(&ali_ircc_driver); | 258 | platform_driver_unregister(&ali_ircc_driver); |
259 | 259 | ||
260 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); | 260 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); |
261 | } | 261 | } |
262 | 262 | ||
263 | /* | 263 | /* |
@@ -273,11 +273,11 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
273 | int dongle_id; | 273 | int dongle_id; |
274 | int err; | 274 | int err; |
275 | 275 | ||
276 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 276 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
277 | 277 | ||
278 | if (i >= ARRAY_SIZE(dev_self)) { | 278 | if (i >= ARRAY_SIZE(dev_self)) { |
279 | IRDA_ERROR("%s(), maximum number of supported chips reached!\n", | 279 | IRDA_ERROR("%s(), maximum number of supported chips reached!\n", |
280 | __FUNCTION__); | 280 | __func__); |
281 | return -ENOMEM; | 281 | return -ENOMEM; |
282 | } | 282 | } |
283 | 283 | ||
@@ -288,7 +288,7 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
288 | dev = alloc_irdadev(sizeof(*self)); | 288 | dev = alloc_irdadev(sizeof(*self)); |
289 | if (dev == NULL) { | 289 | if (dev == NULL) { |
290 | IRDA_ERROR("%s(), can't allocate memory for control block!\n", | 290 | IRDA_ERROR("%s(), can't allocate memory for control block!\n", |
291 | __FUNCTION__); | 291 | __func__); |
292 | return -ENOMEM; | 292 | return -ENOMEM; |
293 | } | 293 | } |
294 | 294 | ||
@@ -312,7 +312,7 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
312 | /* Reserve the ioports that we need */ | 312 | /* Reserve the ioports that we need */ |
313 | if (!request_region(self->io.fir_base, self->io.fir_ext, | 313 | if (!request_region(self->io.fir_base, self->io.fir_ext, |
314 | ALI_IRCC_DRIVER_NAME)) { | 314 | ALI_IRCC_DRIVER_NAME)) { |
315 | IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __FUNCTION__, | 315 | IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", __func__, |
316 | self->io.fir_base); | 316 | self->io.fir_base); |
317 | err = -ENODEV; | 317 | err = -ENODEV; |
318 | goto err_out1; | 318 | goto err_out1; |
@@ -370,19 +370,19 @@ static int ali_ircc_open(int i, chipio_t *info) | |||
370 | 370 | ||
371 | err = register_netdev(dev); | 371 | err = register_netdev(dev); |
372 | if (err) { | 372 | if (err) { |
373 | IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); | 373 | IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); |
374 | goto err_out4; | 374 | goto err_out4; |
375 | } | 375 | } |
376 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 376 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); |
377 | 377 | ||
378 | /* Check dongle id */ | 378 | /* Check dongle id */ |
379 | dongle_id = ali_ircc_read_dongle_id(i, info); | 379 | dongle_id = ali_ircc_read_dongle_id(i, info); |
380 | IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __FUNCTION__, | 380 | IRDA_MESSAGE("%s(), %s, Found dongle: %s\n", __func__, |
381 | ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]); | 381 | ALI_IRCC_DRIVER_NAME, dongle_types[dongle_id]); |
382 | 382 | ||
383 | self->io.dongle_id = dongle_id; | 383 | self->io.dongle_id = dongle_id; |
384 | 384 | ||
385 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); | 385 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); |
386 | 386 | ||
387 | return 0; | 387 | return 0; |
388 | 388 | ||
@@ -411,7 +411,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self) | |||
411 | { | 411 | { |
412 | int iobase; | 412 | int iobase; |
413 | 413 | ||
414 | IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 414 | IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __func__); |
415 | 415 | ||
416 | IRDA_ASSERT(self != NULL, return -1;); | 416 | IRDA_ASSERT(self != NULL, return -1;); |
417 | 417 | ||
@@ -421,7 +421,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self) | |||
421 | unregister_netdev(self->netdev); | 421 | unregister_netdev(self->netdev); |
422 | 422 | ||
423 | /* Release the PORT that this driver is using */ | 423 | /* Release the PORT that this driver is using */ |
424 | IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __FUNCTION__, self->io.fir_base); | 424 | IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __func__, self->io.fir_base); |
425 | release_region(self->io.fir_base, self->io.fir_ext); | 425 | release_region(self->io.fir_base, self->io.fir_ext); |
426 | 426 | ||
427 | if (self->tx_buff.head) | 427 | if (self->tx_buff.head) |
@@ -435,7 +435,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self) | |||
435 | dev_self[self->index] = NULL; | 435 | dev_self[self->index] = NULL; |
436 | free_netdev(self->netdev); | 436 | free_netdev(self->netdev); |
437 | 437 | ||
438 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); | 438 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); |
439 | 439 | ||
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
@@ -478,7 +478,7 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info) | |||
478 | int cfg_base = info->cfg_base; | 478 | int cfg_base = info->cfg_base; |
479 | int hi, low, reg; | 479 | int hi, low, reg; |
480 | 480 | ||
481 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 481 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
482 | 482 | ||
483 | /* Enter Configuration */ | 483 | /* Enter Configuration */ |
484 | outb(chip->entr1, cfg_base); | 484 | outb(chip->entr1, cfg_base); |
@@ -497,13 +497,13 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info) | |||
497 | 497 | ||
498 | info->sir_base = info->fir_base; | 498 | info->sir_base = info->fir_base; |
499 | 499 | ||
500 | IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __FUNCTION__, info->fir_base); | 500 | IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __func__, info->fir_base); |
501 | 501 | ||
502 | /* Read IRQ control register */ | 502 | /* Read IRQ control register */ |
503 | outb(0x70, cfg_base); | 503 | outb(0x70, cfg_base); |
504 | reg = inb(cfg_base+1); | 504 | reg = inb(cfg_base+1); |
505 | info->irq = reg & 0x0f; | 505 | info->irq = reg & 0x0f; |
506 | IRDA_DEBUG(2, "%s(), probing irq=%d\n", __FUNCTION__, info->irq); | 506 | IRDA_DEBUG(2, "%s(), probing irq=%d\n", __func__, info->irq); |
507 | 507 | ||
508 | /* Read DMA channel */ | 508 | /* Read DMA channel */ |
509 | outb(0x74, cfg_base); | 509 | outb(0x74, cfg_base); |
@@ -511,26 +511,26 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info) | |||
511 | info->dma = reg & 0x07; | 511 | info->dma = reg & 0x07; |
512 | 512 | ||
513 | if(info->dma == 0x04) | 513 | if(info->dma == 0x04) |
514 | IRDA_WARNING("%s(), No DMA channel assigned !\n", __FUNCTION__); | 514 | IRDA_WARNING("%s(), No DMA channel assigned !\n", __func__); |
515 | else | 515 | else |
516 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __FUNCTION__, info->dma); | 516 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma); |
517 | 517 | ||
518 | /* Read Enabled Status */ | 518 | /* Read Enabled Status */ |
519 | outb(0x30, cfg_base); | 519 | outb(0x30, cfg_base); |
520 | reg = inb(cfg_base+1); | 520 | reg = inb(cfg_base+1); |
521 | info->enabled = (reg & 0x80) && (reg & 0x01); | 521 | info->enabled = (reg & 0x80) && (reg & 0x01); |
522 | IRDA_DEBUG(2, "%s(), probing enabled=%d\n", __FUNCTION__, info->enabled); | 522 | IRDA_DEBUG(2, "%s(), probing enabled=%d\n", __func__, info->enabled); |
523 | 523 | ||
524 | /* Read Power Status */ | 524 | /* Read Power Status */ |
525 | outb(0x22, cfg_base); | 525 | outb(0x22, cfg_base); |
526 | reg = inb(cfg_base+1); | 526 | reg = inb(cfg_base+1); |
527 | info->suspended = (reg & 0x20); | 527 | info->suspended = (reg & 0x20); |
528 | IRDA_DEBUG(2, "%s(), probing suspended=%d\n", __FUNCTION__, info->suspended); | 528 | IRDA_DEBUG(2, "%s(), probing suspended=%d\n", __func__, info->suspended); |
529 | 529 | ||
530 | /* Exit configuration */ | 530 | /* Exit configuration */ |
531 | outb(0xbb, cfg_base); | 531 | outb(0xbb, cfg_base); |
532 | 532 | ||
533 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__); | 533 | IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __func__); |
534 | 534 | ||
535 | return 0; | 535 | return 0; |
536 | } | 536 | } |
@@ -548,7 +548,7 @@ static int ali_ircc_setup(chipio_t *info) | |||
548 | int version; | 548 | int version; |
549 | int iobase = info->fir_base; | 549 | int iobase = info->fir_base; |
550 | 550 | ||
551 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 551 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
552 | 552 | ||
553 | /* Locking comments : | 553 | /* Locking comments : |
554 | * Most operations here need to be protected. We are called before | 554 | * Most operations here need to be protected. We are called before |
@@ -609,7 +609,7 @@ static int ali_ircc_setup(chipio_t *info) | |||
609 | // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM | 609 | // outb(UART_IER_RDI, iobase+UART_IER); //benjamin 2000/11/23 01:25PM |
610 | // Turn on the interrupts in ali_ircc_net_open | 610 | // Turn on the interrupts in ali_ircc_net_open |
611 | 611 | ||
612 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__); | 612 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__); |
613 | 613 | ||
614 | return 0; | 614 | return 0; |
615 | } | 615 | } |
@@ -626,7 +626,7 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info) | |||
626 | int dongle_id, reg; | 626 | int dongle_id, reg; |
627 | int cfg_base = info->cfg_base; | 627 | int cfg_base = info->cfg_base; |
628 | 628 | ||
629 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 629 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
630 | 630 | ||
631 | /* Enter Configuration */ | 631 | /* Enter Configuration */ |
632 | outb(chips[i].entr1, cfg_base); | 632 | outb(chips[i].entr1, cfg_base); |
@@ -640,13 +640,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info) | |||
640 | outb(0xf0, cfg_base); | 640 | outb(0xf0, cfg_base); |
641 | reg = inb(cfg_base+1); | 641 | reg = inb(cfg_base+1); |
642 | dongle_id = ((reg>>6)&0x02) | ((reg>>5)&0x01); | 642 | dongle_id = ((reg>>6)&0x02) | ((reg>>5)&0x01); |
643 | IRDA_DEBUG(2, "%s(), probing dongle_id=%d, dongle_types=%s\n", __FUNCTION__, | 643 | IRDA_DEBUG(2, "%s(), probing dongle_id=%d, dongle_types=%s\n", __func__, |
644 | dongle_id, dongle_types[dongle_id]); | 644 | dongle_id, dongle_types[dongle_id]); |
645 | 645 | ||
646 | /* Exit configuration */ | 646 | /* Exit configuration */ |
647 | outb(0xbb, cfg_base); | 647 | outb(0xbb, cfg_base); |
648 | 648 | ||
649 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__); | 649 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__); |
650 | 650 | ||
651 | return dongle_id; | 651 | return dongle_id; |
652 | } | 652 | } |
@@ -663,7 +663,7 @@ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) | |||
663 | struct ali_ircc_cb *self; | 663 | struct ali_ircc_cb *self; |
664 | int ret; | 664 | int ret; |
665 | 665 | ||
666 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 666 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
667 | 667 | ||
668 | self = dev->priv; | 668 | self = dev->priv; |
669 | 669 | ||
@@ -677,7 +677,7 @@ static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) | |||
677 | 677 | ||
678 | spin_unlock(&self->lock); | 678 | spin_unlock(&self->lock); |
679 | 679 | ||
680 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__); | 680 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__); |
681 | return ret; | 681 | return ret; |
682 | } | 682 | } |
683 | /* | 683 | /* |
@@ -691,7 +691,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
691 | __u8 eir, OldMessageCount; | 691 | __u8 eir, OldMessageCount; |
692 | int iobase, tmp; | 692 | int iobase, tmp; |
693 | 693 | ||
694 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 694 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__); |
695 | 695 | ||
696 | iobase = self->io.fir_base; | 696 | iobase = self->io.fir_base; |
697 | 697 | ||
@@ -704,10 +704,10 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
704 | //self->ier = inb(iobase+FIR_IER); 2000/12/1 04:32PM | 704 | //self->ier = inb(iobase+FIR_IER); 2000/12/1 04:32PM |
705 | eir = self->InterruptID & self->ier; /* Mask out the interesting ones */ | 705 | eir = self->InterruptID & self->ier; /* Mask out the interesting ones */ |
706 | 706 | ||
707 | IRDA_DEBUG(1, "%s(), self->InterruptID = %x\n", __FUNCTION__,self->InterruptID); | 707 | IRDA_DEBUG(1, "%s(), self->InterruptID = %x\n", __func__,self->InterruptID); |
708 | IRDA_DEBUG(1, "%s(), self->LineStatus = %x\n", __FUNCTION__,self->LineStatus); | 708 | IRDA_DEBUG(1, "%s(), self->LineStatus = %x\n", __func__,self->LineStatus); |
709 | IRDA_DEBUG(1, "%s(), self->ier = %x\n", __FUNCTION__,self->ier); | 709 | IRDA_DEBUG(1, "%s(), self->ier = %x\n", __func__,self->ier); |
710 | IRDA_DEBUG(1, "%s(), eir = %x\n", __FUNCTION__,eir); | 710 | IRDA_DEBUG(1, "%s(), eir = %x\n", __func__,eir); |
711 | 711 | ||
712 | /* Disable interrupts */ | 712 | /* Disable interrupts */ |
713 | SetCOMInterrupts(self, FALSE); | 713 | SetCOMInterrupts(self, FALSE); |
@@ -718,7 +718,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
718 | { | 718 | { |
719 | if (self->io.direction == IO_XMIT) /* TX */ | 719 | if (self->io.direction == IO_XMIT) /* TX */ |
720 | { | 720 | { |
721 | IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Tx) *******\n", __FUNCTION__); | 721 | IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Tx) *******\n", __func__); |
722 | 722 | ||
723 | if(ali_ircc_dma_xmit_complete(self)) | 723 | if(ali_ircc_dma_xmit_complete(self)) |
724 | { | 724 | { |
@@ -737,23 +737,23 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
737 | } | 737 | } |
738 | else /* RX */ | 738 | else /* RX */ |
739 | { | 739 | { |
740 | IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Rx) *******\n", __FUNCTION__); | 740 | IRDA_DEBUG(1, "%s(), ******* IIR_EOM (Rx) *******\n", __func__); |
741 | 741 | ||
742 | if(OldMessageCount > ((self->LineStatus+1) & 0x07)) | 742 | if(OldMessageCount > ((self->LineStatus+1) & 0x07)) |
743 | { | 743 | { |
744 | self->rcvFramesOverflow = TRUE; | 744 | self->rcvFramesOverflow = TRUE; |
745 | IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******** \n", __FUNCTION__); | 745 | IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******** \n", __func__); |
746 | } | 746 | } |
747 | 747 | ||
748 | if (ali_ircc_dma_receive_complete(self)) | 748 | if (ali_ircc_dma_receive_complete(self)) |
749 | { | 749 | { |
750 | IRDA_DEBUG(1, "%s(), ******* receive complete ******** \n", __FUNCTION__); | 750 | IRDA_DEBUG(1, "%s(), ******* receive complete ******** \n", __func__); |
751 | 751 | ||
752 | self->ier = IER_EOM; | 752 | self->ier = IER_EOM; |
753 | } | 753 | } |
754 | else | 754 | else |
755 | { | 755 | { |
756 | IRDA_DEBUG(1, "%s(), ******* Not receive complete ******** \n", __FUNCTION__); | 756 | IRDA_DEBUG(1, "%s(), ******* Not receive complete ******** \n", __func__); |
757 | 757 | ||
758 | self->ier = IER_EOM | IER_TIMER; | 758 | self->ier = IER_EOM | IER_TIMER; |
759 | } | 759 | } |
@@ -766,7 +766,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
766 | if(OldMessageCount > ((self->LineStatus+1) & 0x07)) | 766 | if(OldMessageCount > ((self->LineStatus+1) & 0x07)) |
767 | { | 767 | { |
768 | self->rcvFramesOverflow = TRUE; | 768 | self->rcvFramesOverflow = TRUE; |
769 | IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******* \n", __FUNCTION__); | 769 | IRDA_DEBUG(1, "%s(), ******* self->rcvFramesOverflow = TRUE ******* \n", __func__); |
770 | } | 770 | } |
771 | /* Disable Timer */ | 771 | /* Disable Timer */ |
772 | switch_bank(iobase, BANK1); | 772 | switch_bank(iobase, BANK1); |
@@ -798,7 +798,7 @@ static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) | |||
798 | /* Restore Interrupt */ | 798 | /* Restore Interrupt */ |
799 | SetCOMInterrupts(self, TRUE); | 799 | SetCOMInterrupts(self, TRUE); |
800 | 800 | ||
801 | IRDA_DEBUG(1, "%s(), ----------------- End ---------------\n", __FUNCTION__); | 801 | IRDA_DEBUG(1, "%s(), ----------------- End ---------------\n", __func__); |
802 | return IRQ_RETVAL(eir); | 802 | return IRQ_RETVAL(eir); |
803 | } | 803 | } |
804 | 804 | ||
@@ -813,7 +813,7 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self) | |||
813 | int iobase; | 813 | int iobase; |
814 | int iir, lsr; | 814 | int iir, lsr; |
815 | 815 | ||
816 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 816 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
817 | 817 | ||
818 | iobase = self->io.sir_base; | 818 | iobase = self->io.sir_base; |
819 | 819 | ||
@@ -822,13 +822,13 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self) | |||
822 | /* Clear interrupt */ | 822 | /* Clear interrupt */ |
823 | lsr = inb(iobase+UART_LSR); | 823 | lsr = inb(iobase+UART_LSR); |
824 | 824 | ||
825 | IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", __FUNCTION__, | 825 | IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", __func__, |
826 | iir, lsr, iobase); | 826 | iir, lsr, iobase); |
827 | 827 | ||
828 | switch (iir) | 828 | switch (iir) |
829 | { | 829 | { |
830 | case UART_IIR_RLSI: | 830 | case UART_IIR_RLSI: |
831 | IRDA_DEBUG(2, "%s(), RLSI\n", __FUNCTION__); | 831 | IRDA_DEBUG(2, "%s(), RLSI\n", __func__); |
832 | break; | 832 | break; |
833 | case UART_IIR_RDI: | 833 | case UART_IIR_RDI: |
834 | /* Receive interrupt */ | 834 | /* Receive interrupt */ |
@@ -842,14 +842,14 @@ static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self) | |||
842 | } | 842 | } |
843 | break; | 843 | break; |
844 | default: | 844 | default: |
845 | IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", __FUNCTION__, iir); | 845 | IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", __func__, iir); |
846 | break; | 846 | break; |
847 | } | 847 | } |
848 | 848 | ||
849 | } | 849 | } |
850 | 850 | ||
851 | 851 | ||
852 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__); | 852 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__); |
853 | 853 | ||
854 | return IRQ_RETVAL(iir); | 854 | return IRQ_RETVAL(iir); |
855 | } | 855 | } |
@@ -866,7 +866,7 @@ static void ali_ircc_sir_receive(struct ali_ircc_cb *self) | |||
866 | int boguscount = 0; | 866 | int boguscount = 0; |
867 | int iobase; | 867 | int iobase; |
868 | 868 | ||
869 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); | 869 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__); |
870 | IRDA_ASSERT(self != NULL, return;); | 870 | IRDA_ASSERT(self != NULL, return;); |
871 | 871 | ||
872 | iobase = self->io.sir_base; | 872 | iobase = self->io.sir_base; |
@@ -881,12 +881,12 @@ static void ali_ircc_sir_receive(struct ali_ircc_cb *self) | |||
881 | 881 | ||
882 | /* Make sure we don't stay here too long */ | 882 | /* Make sure we don't stay here too long */ |
883 | if (boguscount++ > 32) { | 883 | if (boguscount++ > 32) { |
884 | IRDA_DEBUG(2,"%s(), breaking!\n", __FUNCTION__); | 884 | IRDA_DEBUG(2,"%s(), breaking!\n", __func__); |
885 | break; | 885 | break; |
886 | } | 886 | } |
887 | } while (inb(iobase+UART_LSR) & UART_LSR_DR); | 887 | } while (inb(iobase+UART_LSR) & UART_LSR_DR); |
888 | 888 | ||
889 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 889 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
890 | } | 890 | } |
891 | 891 | ||
892 | /* | 892 | /* |
@@ -903,7 +903,7 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self) | |||
903 | 903 | ||
904 | IRDA_ASSERT(self != NULL, return;); | 904 | IRDA_ASSERT(self != NULL, return;); |
905 | 905 | ||
906 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 906 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
907 | 907 | ||
908 | iobase = self->io.sir_base; | 908 | iobase = self->io.sir_base; |
909 | 909 | ||
@@ -922,16 +922,16 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self) | |||
922 | { | 922 | { |
923 | /* We must wait until all data are gone */ | 923 | /* We must wait until all data are gone */ |
924 | while(!(inb(iobase+UART_LSR) & UART_LSR_TEMT)) | 924 | while(!(inb(iobase+UART_LSR) & UART_LSR_TEMT)) |
925 | IRDA_DEBUG(1, "%s(), UART_LSR_THRE\n", __FUNCTION__ ); | 925 | IRDA_DEBUG(1, "%s(), UART_LSR_THRE\n", __func__ ); |
926 | 926 | ||
927 | IRDA_DEBUG(1, "%s(), Changing speed! self->new_speed = %d\n", __FUNCTION__ , self->new_speed); | 927 | IRDA_DEBUG(1, "%s(), Changing speed! self->new_speed = %d\n", __func__ , self->new_speed); |
928 | ali_ircc_change_speed(self, self->new_speed); | 928 | ali_ircc_change_speed(self, self->new_speed); |
929 | self->new_speed = 0; | 929 | self->new_speed = 0; |
930 | 930 | ||
931 | // benjamin 2000/11/10 06:32PM | 931 | // benjamin 2000/11/10 06:32PM |
932 | if (self->io.speed > 115200) | 932 | if (self->io.speed > 115200) |
933 | { | 933 | { |
934 | IRDA_DEBUG(2, "%s(), ali_ircc_change_speed from UART_LSR_TEMT \n", __FUNCTION__ ); | 934 | IRDA_DEBUG(2, "%s(), ali_ircc_change_speed from UART_LSR_TEMT \n", __func__ ); |
935 | 935 | ||
936 | self->ier = IER_EOM; | 936 | self->ier = IER_EOM; |
937 | // SetCOMInterrupts(self, TRUE); | 937 | // SetCOMInterrupts(self, TRUE); |
@@ -949,7 +949,7 @@ static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self) | |||
949 | outb(UART_IER_RDI, iobase+UART_IER); | 949 | outb(UART_IER_RDI, iobase+UART_IER); |
950 | } | 950 | } |
951 | 951 | ||
952 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 952 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
953 | } | 953 | } |
954 | 954 | ||
955 | static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud) | 955 | static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud) |
@@ -957,9 +957,9 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud) | |||
957 | struct net_device *dev = self->netdev; | 957 | struct net_device *dev = self->netdev; |
958 | int iobase; | 958 | int iobase; |
959 | 959 | ||
960 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 960 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
961 | 961 | ||
962 | IRDA_DEBUG(2, "%s(), setting speed = %d \n", __FUNCTION__ , baud); | 962 | IRDA_DEBUG(2, "%s(), setting speed = %d \n", __func__ , baud); |
963 | 963 | ||
964 | /* This function *must* be called with irq off and spin-lock. | 964 | /* This function *must* be called with irq off and spin-lock. |
965 | * - Jean II */ | 965 | * - Jean II */ |
@@ -998,7 +998,7 @@ static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud) | |||
998 | 998 | ||
999 | netif_wake_queue(self->netdev); | 999 | netif_wake_queue(self->netdev); |
1000 | 1000 | ||
1001 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1001 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud) | 1004 | static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud) |
@@ -1008,14 +1008,14 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud) | |||
1008 | struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; | 1008 | struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; |
1009 | struct net_device *dev; | 1009 | struct net_device *dev; |
1010 | 1010 | ||
1011 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1011 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
1012 | 1012 | ||
1013 | IRDA_ASSERT(self != NULL, return;); | 1013 | IRDA_ASSERT(self != NULL, return;); |
1014 | 1014 | ||
1015 | dev = self->netdev; | 1015 | dev = self->netdev; |
1016 | iobase = self->io.fir_base; | 1016 | iobase = self->io.fir_base; |
1017 | 1017 | ||
1018 | IRDA_DEBUG(1, "%s(), self->io.speed = %d, change to speed = %d\n", __FUNCTION__ ,self->io.speed,baud); | 1018 | IRDA_DEBUG(1, "%s(), self->io.speed = %d, change to speed = %d\n", __func__ ,self->io.speed,baud); |
1019 | 1019 | ||
1020 | /* Come from SIR speed */ | 1020 | /* Come from SIR speed */ |
1021 | if(self->io.speed <=115200) | 1021 | if(self->io.speed <=115200) |
@@ -1029,7 +1029,7 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud) | |||
1029 | // Set Dongle Speed mode | 1029 | // Set Dongle Speed mode |
1030 | ali_ircc_change_dongle_speed(self, baud); | 1030 | ali_ircc_change_dongle_speed(self, baud); |
1031 | 1031 | ||
1032 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1032 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | /* | 1035 | /* |
@@ -1047,9 +1047,9 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed) | |||
1047 | int lcr; /* Line control reg */ | 1047 | int lcr; /* Line control reg */ |
1048 | int divisor; | 1048 | int divisor; |
1049 | 1049 | ||
1050 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1050 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
1051 | 1051 | ||
1052 | IRDA_DEBUG(1, "%s(), Setting speed to: %d\n", __FUNCTION__ , speed); | 1052 | IRDA_DEBUG(1, "%s(), Setting speed to: %d\n", __func__ , speed); |
1053 | 1053 | ||
1054 | IRDA_ASSERT(self != NULL, return;); | 1054 | IRDA_ASSERT(self != NULL, return;); |
1055 | 1055 | ||
@@ -1103,7 +1103,7 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed) | |||
1103 | 1103 | ||
1104 | spin_unlock_irqrestore(&self->lock, flags); | 1104 | spin_unlock_irqrestore(&self->lock, flags); |
1105 | 1105 | ||
1106 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1106 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed) | 1109 | static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed) |
@@ -1113,14 +1113,14 @@ static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed) | |||
1113 | int iobase,dongle_id; | 1113 | int iobase,dongle_id; |
1114 | int tmp = 0; | 1114 | int tmp = 0; |
1115 | 1115 | ||
1116 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1116 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
1117 | 1117 | ||
1118 | iobase = self->io.fir_base; /* or iobase = self->io.sir_base; */ | 1118 | iobase = self->io.fir_base; /* or iobase = self->io.sir_base; */ |
1119 | dongle_id = self->io.dongle_id; | 1119 | dongle_id = self->io.dongle_id; |
1120 | 1120 | ||
1121 | /* We are already locked, no need to do it again */ | 1121 | /* We are already locked, no need to do it again */ |
1122 | 1122 | ||
1123 | IRDA_DEBUG(1, "%s(), Set Speed for %s , Speed = %d\n", __FUNCTION__ , dongle_types[dongle_id], speed); | 1123 | IRDA_DEBUG(1, "%s(), Set Speed for %s , Speed = %d\n", __func__ , dongle_types[dongle_id], speed); |
1124 | 1124 | ||
1125 | switch_bank(iobase, BANK2); | 1125 | switch_bank(iobase, BANK2); |
1126 | tmp = inb(iobase+FIR_IRDA_CR); | 1126 | tmp = inb(iobase+FIR_IRDA_CR); |
@@ -1284,7 +1284,7 @@ static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed) | |||
1284 | 1284 | ||
1285 | switch_bank(iobase, BANK0); | 1285 | switch_bank(iobase, BANK0); |
1286 | 1286 | ||
1287 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1287 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | /* | 1290 | /* |
@@ -1297,11 +1297,11 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len) | |||
1297 | { | 1297 | { |
1298 | int actual = 0; | 1298 | int actual = 0; |
1299 | 1299 | ||
1300 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1300 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
1301 | 1301 | ||
1302 | /* Tx FIFO should be empty! */ | 1302 | /* Tx FIFO should be empty! */ |
1303 | if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { | 1303 | if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { |
1304 | IRDA_DEBUG(0, "%s(), failed, fifo not empty!\n", __FUNCTION__ ); | 1304 | IRDA_DEBUG(0, "%s(), failed, fifo not empty!\n", __func__ ); |
1305 | return 0; | 1305 | return 0; |
1306 | } | 1306 | } |
1307 | 1307 | ||
@@ -1313,7 +1313,7 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len) | |||
1313 | actual++; | 1313 | actual++; |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1316 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
1317 | return actual; | 1317 | return actual; |
1318 | } | 1318 | } |
1319 | 1319 | ||
@@ -1329,7 +1329,7 @@ static int ali_ircc_net_open(struct net_device *dev) | |||
1329 | int iobase; | 1329 | int iobase; |
1330 | char hwname[32]; | 1330 | char hwname[32]; |
1331 | 1331 | ||
1332 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1332 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
1333 | 1333 | ||
1334 | IRDA_ASSERT(dev != NULL, return -1;); | 1334 | IRDA_ASSERT(dev != NULL, return -1;); |
1335 | 1335 | ||
@@ -1375,7 +1375,7 @@ static int ali_ircc_net_open(struct net_device *dev) | |||
1375 | */ | 1375 | */ |
1376 | self->irlap = irlap_open(dev, &self->qos, hwname); | 1376 | self->irlap = irlap_open(dev, &self->qos, hwname); |
1377 | 1377 | ||
1378 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1378 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
1379 | 1379 | ||
1380 | return 0; | 1380 | return 0; |
1381 | } | 1381 | } |
@@ -1392,7 +1392,7 @@ static int ali_ircc_net_close(struct net_device *dev) | |||
1392 | struct ali_ircc_cb *self; | 1392 | struct ali_ircc_cb *self; |
1393 | //int iobase; | 1393 | //int iobase; |
1394 | 1394 | ||
1395 | IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1395 | IRDA_DEBUG(4, "%s(), ---------------- Start ----------------\n", __func__ ); |
1396 | 1396 | ||
1397 | IRDA_ASSERT(dev != NULL, return -1;); | 1397 | IRDA_ASSERT(dev != NULL, return -1;); |
1398 | 1398 | ||
@@ -1415,7 +1415,7 @@ static int ali_ircc_net_close(struct net_device *dev) | |||
1415 | free_irq(self->io.irq, dev); | 1415 | free_irq(self->io.irq, dev); |
1416 | free_dma(self->io.dma); | 1416 | free_dma(self->io.dma); |
1417 | 1417 | ||
1418 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1418 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
1419 | 1419 | ||
1420 | return 0; | 1420 | return 0; |
1421 | } | 1421 | } |
@@ -1434,7 +1434,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1434 | __u32 speed; | 1434 | __u32 speed; |
1435 | int mtt, diff; | 1435 | int mtt, diff; |
1436 | 1436 | ||
1437 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 1437 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); |
1438 | 1438 | ||
1439 | self = (struct ali_ircc_cb *) dev->priv; | 1439 | self = (struct ali_ircc_cb *) dev->priv; |
1440 | iobase = self->io.fir_base; | 1440 | iobase = self->io.fir_base; |
@@ -1488,7 +1488,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1488 | diff = self->now.tv_usec - self->stamp.tv_usec; | 1488 | diff = self->now.tv_usec - self->stamp.tv_usec; |
1489 | /* self->stamp is set from ali_ircc_dma_receive_complete() */ | 1489 | /* self->stamp is set from ali_ircc_dma_receive_complete() */ |
1490 | 1490 | ||
1491 | IRDA_DEBUG(1, "%s(), ******* diff = %d ******* \n", __FUNCTION__ , diff); | 1491 | IRDA_DEBUG(1, "%s(), ******* diff = %d ******* \n", __func__ , diff); |
1492 | 1492 | ||
1493 | if (diff < 0) | 1493 | if (diff < 0) |
1494 | diff += 1000000; | 1494 | diff += 1000000; |
@@ -1510,7 +1510,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1510 | /* Adjust for timer resolution */ | 1510 | /* Adjust for timer resolution */ |
1511 | mtt = (mtt+250) / 500; /* 4 discard, 5 get advanced, Let's round off */ | 1511 | mtt = (mtt+250) / 500; /* 4 discard, 5 get advanced, Let's round off */ |
1512 | 1512 | ||
1513 | IRDA_DEBUG(1, "%s(), ************** mtt = %d ***********\n", __FUNCTION__ , mtt); | 1513 | IRDA_DEBUG(1, "%s(), ************** mtt = %d ***********\n", __func__ , mtt); |
1514 | 1514 | ||
1515 | /* Setup timer */ | 1515 | /* Setup timer */ |
1516 | if (mtt == 1) /* 500 us */ | 1516 | if (mtt == 1) /* 500 us */ |
@@ -1567,7 +1567,7 @@ static int ali_ircc_fir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1567 | spin_unlock_irqrestore(&self->lock, flags); | 1567 | spin_unlock_irqrestore(&self->lock, flags); |
1568 | dev_kfree_skb(skb); | 1568 | dev_kfree_skb(skb); |
1569 | 1569 | ||
1570 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1570 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1571 | return 0; | 1571 | return 0; |
1572 | } | 1572 | } |
1573 | 1573 | ||
@@ -1578,7 +1578,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self) | |||
1578 | unsigned char FIFO_OPTI, Hi, Lo; | 1578 | unsigned char FIFO_OPTI, Hi, Lo; |
1579 | 1579 | ||
1580 | 1580 | ||
1581 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 1581 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); |
1582 | 1582 | ||
1583 | iobase = self->io.fir_base; | 1583 | iobase = self->io.fir_base; |
1584 | 1584 | ||
@@ -1629,7 +1629,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self) | |||
1629 | tmp = inb(iobase+FIR_LCR_B); | 1629 | tmp = inb(iobase+FIR_LCR_B); |
1630 | tmp &= ~0x20; // Disable SIP | 1630 | tmp &= ~0x20; // Disable SIP |
1631 | outb(((unsigned char)(tmp & 0x3f) | LCR_B_TX_MODE) & ~LCR_B_BW, iobase+FIR_LCR_B); | 1631 | outb(((unsigned char)(tmp & 0x3f) | LCR_B_TX_MODE) & ~LCR_B_BW, iobase+FIR_LCR_B); |
1632 | IRDA_DEBUG(1, "%s(), ******* Change to TX mode: FIR_LCR_B = 0x%x ******* \n", __FUNCTION__ , inb(iobase+FIR_LCR_B)); | 1632 | IRDA_DEBUG(1, "%s(), ******* Change to TX mode: FIR_LCR_B = 0x%x ******* \n", __func__ , inb(iobase+FIR_LCR_B)); |
1633 | 1633 | ||
1634 | outb(0, iobase+FIR_LSR); | 1634 | outb(0, iobase+FIR_LSR); |
1635 | 1635 | ||
@@ -1639,7 +1639,7 @@ static void ali_ircc_dma_xmit(struct ali_ircc_cb *self) | |||
1639 | 1639 | ||
1640 | switch_bank(iobase, BANK0); | 1640 | switch_bank(iobase, BANK0); |
1641 | 1641 | ||
1642 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1642 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) | 1645 | static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) |
@@ -1647,7 +1647,7 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) | |||
1647 | int iobase; | 1647 | int iobase; |
1648 | int ret = TRUE; | 1648 | int ret = TRUE; |
1649 | 1649 | ||
1650 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 1650 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); |
1651 | 1651 | ||
1652 | iobase = self->io.fir_base; | 1652 | iobase = self->io.fir_base; |
1653 | 1653 | ||
@@ -1660,7 +1660,7 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) | |||
1660 | if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT) | 1660 | if((inb(iobase+FIR_LSR) & LSR_FRAME_ABORT) == LSR_FRAME_ABORT) |
1661 | 1661 | ||
1662 | { | 1662 | { |
1663 | IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __FUNCTION__); | 1663 | IRDA_ERROR("%s(), ********* LSR_FRAME_ABORT *********\n", __func__); |
1664 | self->stats.tx_errors++; | 1664 | self->stats.tx_errors++; |
1665 | self->stats.tx_fifo_errors++; | 1665 | self->stats.tx_fifo_errors++; |
1666 | } | 1666 | } |
@@ -1703,7 +1703,7 @@ static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) | |||
1703 | 1703 | ||
1704 | switch_bank(iobase, BANK0); | 1704 | switch_bank(iobase, BANK0); |
1705 | 1705 | ||
1706 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1706 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1707 | return ret; | 1707 | return ret; |
1708 | } | 1708 | } |
1709 | 1709 | ||
@@ -1718,7 +1718,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self) | |||
1718 | { | 1718 | { |
1719 | int iobase, tmp; | 1719 | int iobase, tmp; |
1720 | 1720 | ||
1721 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 1721 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); |
1722 | 1722 | ||
1723 | iobase = self->io.fir_base; | 1723 | iobase = self->io.fir_base; |
1724 | 1724 | ||
@@ -1756,7 +1756,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self) | |||
1756 | //switch_bank(iobase, BANK0); | 1756 | //switch_bank(iobase, BANK0); |
1757 | tmp = inb(iobase+FIR_LCR_B); | 1757 | tmp = inb(iobase+FIR_LCR_B); |
1758 | outb((unsigned char)(tmp &0x3f) | LCR_B_RX_MODE | LCR_B_BW , iobase + FIR_LCR_B); // 2000/12/1 05:16PM | 1758 | outb((unsigned char)(tmp &0x3f) | LCR_B_RX_MODE | LCR_B_BW , iobase + FIR_LCR_B); // 2000/12/1 05:16PM |
1759 | IRDA_DEBUG(1, "%s(), *** Change To RX mode: FIR_LCR_B = 0x%x *** \n", __FUNCTION__ , inb(iobase+FIR_LCR_B)); | 1759 | IRDA_DEBUG(1, "%s(), *** Change To RX mode: FIR_LCR_B = 0x%x *** \n", __func__ , inb(iobase+FIR_LCR_B)); |
1760 | 1760 | ||
1761 | /* Set Rx Threshold */ | 1761 | /* Set Rx Threshold */ |
1762 | switch_bank(iobase, BANK1); | 1762 | switch_bank(iobase, BANK1); |
@@ -1768,7 +1768,7 @@ static int ali_ircc_dma_receive(struct ali_ircc_cb *self) | |||
1768 | outb(CR_DMA_EN | CR_DMA_BURST, iobase+FIR_CR); | 1768 | outb(CR_DMA_EN | CR_DMA_BURST, iobase+FIR_CR); |
1769 | 1769 | ||
1770 | switch_bank(iobase, BANK0); | 1770 | switch_bank(iobase, BANK0); |
1771 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1771 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1772 | return 0; | 1772 | return 0; |
1773 | } | 1773 | } |
1774 | 1774 | ||
@@ -1779,7 +1779,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1779 | __u8 status, MessageCount; | 1779 | __u8 status, MessageCount; |
1780 | int len, i, iobase, val; | 1780 | int len, i, iobase, val; |
1781 | 1781 | ||
1782 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 1782 | IRDA_DEBUG(1, "%s(), ---------------- Start -----------------\n", __func__ ); |
1783 | 1783 | ||
1784 | st_fifo = &self->st_fifo; | 1784 | st_fifo = &self->st_fifo; |
1785 | iobase = self->io.fir_base; | 1785 | iobase = self->io.fir_base; |
@@ -1788,7 +1788,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1788 | MessageCount = inb(iobase+ FIR_LSR)&0x07; | 1788 | MessageCount = inb(iobase+ FIR_LSR)&0x07; |
1789 | 1789 | ||
1790 | if (MessageCount > 0) | 1790 | if (MessageCount > 0) |
1791 | IRDA_DEBUG(0, "%s(), Messsage count = %d,\n", __FUNCTION__ , MessageCount); | 1791 | IRDA_DEBUG(0, "%s(), Messsage count = %d,\n", __func__ , MessageCount); |
1792 | 1792 | ||
1793 | for (i=0; i<=MessageCount; i++) | 1793 | for (i=0; i<=MessageCount; i++) |
1794 | { | 1794 | { |
@@ -1801,11 +1801,11 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1801 | len = len << 8; | 1801 | len = len << 8; |
1802 | len |= inb(iobase+FIR_RX_DSR_LO); | 1802 | len |= inb(iobase+FIR_RX_DSR_LO); |
1803 | 1803 | ||
1804 | IRDA_DEBUG(1, "%s(), RX Length = 0x%.2x,\n", __FUNCTION__ , len); | 1804 | IRDA_DEBUG(1, "%s(), RX Length = 0x%.2x,\n", __func__ , len); |
1805 | IRDA_DEBUG(1, "%s(), RX Status = 0x%.2x,\n", __FUNCTION__ , status); | 1805 | IRDA_DEBUG(1, "%s(), RX Status = 0x%.2x,\n", __func__ , status); |
1806 | 1806 | ||
1807 | if (st_fifo->tail >= MAX_RX_WINDOW) { | 1807 | if (st_fifo->tail >= MAX_RX_WINDOW) { |
1808 | IRDA_DEBUG(0, "%s(), window is full!\n", __FUNCTION__ ); | 1808 | IRDA_DEBUG(0, "%s(), window is full!\n", __func__ ); |
1809 | continue; | 1809 | continue; |
1810 | } | 1810 | } |
1811 | 1811 | ||
@@ -1828,7 +1828,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1828 | /* Check for errors */ | 1828 | /* Check for errors */ |
1829 | if ((status & 0xd8) || self->rcvFramesOverflow || (len==0)) | 1829 | if ((status & 0xd8) || self->rcvFramesOverflow || (len==0)) |
1830 | { | 1830 | { |
1831 | IRDA_DEBUG(0,"%s(), ************* RX Errors ************ \n", __FUNCTION__ ); | 1831 | IRDA_DEBUG(0,"%s(), ************* RX Errors ************ \n", __func__ ); |
1832 | 1832 | ||
1833 | /* Skip frame */ | 1833 | /* Skip frame */ |
1834 | self->stats.rx_errors++; | 1834 | self->stats.rx_errors++; |
@@ -1838,29 +1838,29 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1838 | if (status & LSR_FIFO_UR) | 1838 | if (status & LSR_FIFO_UR) |
1839 | { | 1839 | { |
1840 | self->stats.rx_frame_errors++; | 1840 | self->stats.rx_frame_errors++; |
1841 | IRDA_DEBUG(0,"%s(), ************* FIFO Errors ************ \n", __FUNCTION__ ); | 1841 | IRDA_DEBUG(0,"%s(), ************* FIFO Errors ************ \n", __func__ ); |
1842 | } | 1842 | } |
1843 | if (status & LSR_FRAME_ERROR) | 1843 | if (status & LSR_FRAME_ERROR) |
1844 | { | 1844 | { |
1845 | self->stats.rx_frame_errors++; | 1845 | self->stats.rx_frame_errors++; |
1846 | IRDA_DEBUG(0,"%s(), ************* FRAME Errors ************ \n", __FUNCTION__ ); | 1846 | IRDA_DEBUG(0,"%s(), ************* FRAME Errors ************ \n", __func__ ); |
1847 | } | 1847 | } |
1848 | 1848 | ||
1849 | if (status & LSR_CRC_ERROR) | 1849 | if (status & LSR_CRC_ERROR) |
1850 | { | 1850 | { |
1851 | self->stats.rx_crc_errors++; | 1851 | self->stats.rx_crc_errors++; |
1852 | IRDA_DEBUG(0,"%s(), ************* CRC Errors ************ \n", __FUNCTION__ ); | 1852 | IRDA_DEBUG(0,"%s(), ************* CRC Errors ************ \n", __func__ ); |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | if(self->rcvFramesOverflow) | 1855 | if(self->rcvFramesOverflow) |
1856 | { | 1856 | { |
1857 | self->stats.rx_frame_errors++; | 1857 | self->stats.rx_frame_errors++; |
1858 | IRDA_DEBUG(0,"%s(), ************* Overran DMA buffer ************ \n", __FUNCTION__ ); | 1858 | IRDA_DEBUG(0,"%s(), ************* Overran DMA buffer ************ \n", __func__ ); |
1859 | } | 1859 | } |
1860 | if(len == 0) | 1860 | if(len == 0) |
1861 | { | 1861 | { |
1862 | self->stats.rx_frame_errors++; | 1862 | self->stats.rx_frame_errors++; |
1863 | IRDA_DEBUG(0,"%s(), ********** Receive Frame Size = 0 ********* \n", __FUNCTION__ ); | 1863 | IRDA_DEBUG(0,"%s(), ********** Receive Frame Size = 0 ********* \n", __func__ ); |
1864 | } | 1864 | } |
1865 | } | 1865 | } |
1866 | else | 1866 | else |
@@ -1872,7 +1872,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1872 | val = inb(iobase+FIR_BSR); | 1872 | val = inb(iobase+FIR_BSR); |
1873 | if ((val& BSR_FIFO_NOT_EMPTY)== 0x80) | 1873 | if ((val& BSR_FIFO_NOT_EMPTY)== 0x80) |
1874 | { | 1874 | { |
1875 | IRDA_DEBUG(0, "%s(), ************* BSR_FIFO_NOT_EMPTY ************ \n", __FUNCTION__ ); | 1875 | IRDA_DEBUG(0, "%s(), ************* BSR_FIFO_NOT_EMPTY ************ \n", __func__ ); |
1876 | 1876 | ||
1877 | /* Put this entry back in fifo */ | 1877 | /* Put this entry back in fifo */ |
1878 | st_fifo->head--; | 1878 | st_fifo->head--; |
@@ -1909,7 +1909,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1909 | { | 1909 | { |
1910 | IRDA_WARNING("%s(), memory squeeze, " | 1910 | IRDA_WARNING("%s(), memory squeeze, " |
1911 | "dropping frame.\n", | 1911 | "dropping frame.\n", |
1912 | __FUNCTION__); | 1912 | __func__); |
1913 | self->stats.rx_dropped++; | 1913 | self->stats.rx_dropped++; |
1914 | 1914 | ||
1915 | return FALSE; | 1915 | return FALSE; |
@@ -1937,7 +1937,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) | |||
1937 | 1937 | ||
1938 | switch_bank(iobase, BANK0); | 1938 | switch_bank(iobase, BANK0); |
1939 | 1939 | ||
1940 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 1940 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
1941 | return TRUE; | 1941 | return TRUE; |
1942 | } | 1942 | } |
1943 | 1943 | ||
@@ -1956,7 +1956,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1956 | int iobase; | 1956 | int iobase; |
1957 | __u32 speed; | 1957 | __u32 speed; |
1958 | 1958 | ||
1959 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 1959 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
1960 | 1960 | ||
1961 | IRDA_ASSERT(dev != NULL, return 0;); | 1961 | IRDA_ASSERT(dev != NULL, return 0;); |
1962 | 1962 | ||
@@ -2005,7 +2005,7 @@ static int ali_ircc_sir_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2005 | 2005 | ||
2006 | dev_kfree_skb(skb); | 2006 | dev_kfree_skb(skb); |
2007 | 2007 | ||
2008 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2008 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
2009 | 2009 | ||
2010 | return 0; | 2010 | return 0; |
2011 | } | 2011 | } |
@@ -2024,7 +2024,7 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2024 | unsigned long flags; | 2024 | unsigned long flags; |
2025 | int ret = 0; | 2025 | int ret = 0; |
2026 | 2026 | ||
2027 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 2027 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
2028 | 2028 | ||
2029 | IRDA_ASSERT(dev != NULL, return -1;); | 2029 | IRDA_ASSERT(dev != NULL, return -1;); |
2030 | 2030 | ||
@@ -2032,11 +2032,11 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2032 | 2032 | ||
2033 | IRDA_ASSERT(self != NULL, return -1;); | 2033 | IRDA_ASSERT(self != NULL, return -1;); |
2034 | 2034 | ||
2035 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__ , dev->name, cmd); | 2035 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__ , dev->name, cmd); |
2036 | 2036 | ||
2037 | switch (cmd) { | 2037 | switch (cmd) { |
2038 | case SIOCSBANDWIDTH: /* Set bandwidth */ | 2038 | case SIOCSBANDWIDTH: /* Set bandwidth */ |
2039 | IRDA_DEBUG(1, "%s(), SIOCSBANDWIDTH\n", __FUNCTION__ ); | 2039 | IRDA_DEBUG(1, "%s(), SIOCSBANDWIDTH\n", __func__ ); |
2040 | /* | 2040 | /* |
2041 | * This function will also be used by IrLAP to change the | 2041 | * This function will also be used by IrLAP to change the |
2042 | * speed, so we still must allow for speed change within | 2042 | * speed, so we still must allow for speed change within |
@@ -2050,13 +2050,13 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2050 | spin_unlock_irqrestore(&self->lock, flags); | 2050 | spin_unlock_irqrestore(&self->lock, flags); |
2051 | break; | 2051 | break; |
2052 | case SIOCSMEDIABUSY: /* Set media busy */ | 2052 | case SIOCSMEDIABUSY: /* Set media busy */ |
2053 | IRDA_DEBUG(1, "%s(), SIOCSMEDIABUSY\n", __FUNCTION__ ); | 2053 | IRDA_DEBUG(1, "%s(), SIOCSMEDIABUSY\n", __func__ ); |
2054 | if (!capable(CAP_NET_ADMIN)) | 2054 | if (!capable(CAP_NET_ADMIN)) |
2055 | return -EPERM; | 2055 | return -EPERM; |
2056 | irda_device_set_media_busy(self->netdev, TRUE); | 2056 | irda_device_set_media_busy(self->netdev, TRUE); |
2057 | break; | 2057 | break; |
2058 | case SIOCGRECEIVING: /* Check if we are receiving right now */ | 2058 | case SIOCGRECEIVING: /* Check if we are receiving right now */ |
2059 | IRDA_DEBUG(2, "%s(), SIOCGRECEIVING\n", __FUNCTION__ ); | 2059 | IRDA_DEBUG(2, "%s(), SIOCGRECEIVING\n", __func__ ); |
2060 | /* This is protected */ | 2060 | /* This is protected */ |
2061 | irq->ifr_receiving = ali_ircc_is_receiving(self); | 2061 | irq->ifr_receiving = ali_ircc_is_receiving(self); |
2062 | break; | 2062 | break; |
@@ -2064,7 +2064,7 @@ static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2064 | ret = -EOPNOTSUPP; | 2064 | ret = -EOPNOTSUPP; |
2065 | } | 2065 | } |
2066 | 2066 | ||
2067 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2067 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
2068 | 2068 | ||
2069 | return ret; | 2069 | return ret; |
2070 | } | 2070 | } |
@@ -2081,7 +2081,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self) | |||
2081 | int status = FALSE; | 2081 | int status = FALSE; |
2082 | int iobase; | 2082 | int iobase; |
2083 | 2083 | ||
2084 | IRDA_DEBUG(2, "%s(), ---------------- Start -----------------\n", __FUNCTION__ ); | 2084 | IRDA_DEBUG(2, "%s(), ---------------- Start -----------------\n", __func__ ); |
2085 | 2085 | ||
2086 | IRDA_ASSERT(self != NULL, return FALSE;); | 2086 | IRDA_ASSERT(self != NULL, return FALSE;); |
2087 | 2087 | ||
@@ -2095,7 +2095,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self) | |||
2095 | if((inb(iobase+FIR_FIFO_FR) & 0x3f) != 0) | 2095 | if((inb(iobase+FIR_FIFO_FR) & 0x3f) != 0) |
2096 | { | 2096 | { |
2097 | /* We are receiving something */ | 2097 | /* We are receiving something */ |
2098 | IRDA_DEBUG(1, "%s(), We are receiving something\n", __FUNCTION__ ); | 2098 | IRDA_DEBUG(1, "%s(), We are receiving something\n", __func__ ); |
2099 | status = TRUE; | 2099 | status = TRUE; |
2100 | } | 2100 | } |
2101 | switch_bank(iobase, BANK0); | 2101 | switch_bank(iobase, BANK0); |
@@ -2107,7 +2107,7 @@ static int ali_ircc_is_receiving(struct ali_ircc_cb *self) | |||
2107 | 2107 | ||
2108 | spin_unlock_irqrestore(&self->lock, flags); | 2108 | spin_unlock_irqrestore(&self->lock, flags); |
2109 | 2109 | ||
2110 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2110 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
2111 | 2111 | ||
2112 | return status; | 2112 | return status; |
2113 | } | 2113 | } |
@@ -2116,9 +2116,9 @@ static struct net_device_stats *ali_ircc_net_get_stats(struct net_device *dev) | |||
2116 | { | 2116 | { |
2117 | struct ali_ircc_cb *self = (struct ali_ircc_cb *) dev->priv; | 2117 | struct ali_ircc_cb *self = (struct ali_ircc_cb *) dev->priv; |
2118 | 2118 | ||
2119 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 2119 | IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __func__ ); |
2120 | 2120 | ||
2121 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2121 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
2122 | 2122 | ||
2123 | return &self->stats; | 2123 | return &self->stats; |
2124 | } | 2124 | } |
@@ -2164,7 +2164,7 @@ static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable) | |||
2164 | 2164 | ||
2165 | int iobase = self->io.fir_base; /* or sir_base */ | 2165 | int iobase = self->io.fir_base; /* or sir_base */ |
2166 | 2166 | ||
2167 | IRDA_DEBUG(2, "%s(), -------- Start -------- ( Enable = %d )\n", __FUNCTION__ , enable); | 2167 | IRDA_DEBUG(2, "%s(), -------- Start -------- ( Enable = %d )\n", __func__ , enable); |
2168 | 2168 | ||
2169 | /* Enable the interrupt which we wish to */ | 2169 | /* Enable the interrupt which we wish to */ |
2170 | if (enable){ | 2170 | if (enable){ |
@@ -2205,14 +2205,14 @@ static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable) | |||
2205 | else | 2205 | else |
2206 | outb(newMask, iobase+UART_IER); | 2206 | outb(newMask, iobase+UART_IER); |
2207 | 2207 | ||
2208 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2208 | IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __func__ ); |
2209 | } | 2209 | } |
2210 | 2210 | ||
2211 | static void SIR2FIR(int iobase) | 2211 | static void SIR2FIR(int iobase) |
2212 | { | 2212 | { |
2213 | //unsigned char tmp; | 2213 | //unsigned char tmp; |
2214 | 2214 | ||
2215 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 2215 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
2216 | 2216 | ||
2217 | /* Already protected (change_speed() or setup()), no need to lock. | 2217 | /* Already protected (change_speed() or setup()), no need to lock. |
2218 | * Jean II */ | 2218 | * Jean II */ |
@@ -2228,14 +2228,14 @@ static void SIR2FIR(int iobase) | |||
2228 | //tmp |= 0x20; | 2228 | //tmp |= 0x20; |
2229 | //outb(tmp, iobase+FIR_LCR_B); | 2229 | //outb(tmp, iobase+FIR_LCR_B); |
2230 | 2230 | ||
2231 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2231 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
2232 | } | 2232 | } |
2233 | 2233 | ||
2234 | static void FIR2SIR(int iobase) | 2234 | static void FIR2SIR(int iobase) |
2235 | { | 2235 | { |
2236 | unsigned char val; | 2236 | unsigned char val; |
2237 | 2237 | ||
2238 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __FUNCTION__ ); | 2238 | IRDA_DEBUG(1, "%s(), ---------------- Start ----------------\n", __func__ ); |
2239 | 2239 | ||
2240 | /* Already protected (change_speed() or setup()), no need to lock. | 2240 | /* Already protected (change_speed() or setup()), no need to lock. |
2241 | * Jean II */ | 2241 | * Jean II */ |
@@ -2251,7 +2251,7 @@ static void FIR2SIR(int iobase) | |||
2251 | val = inb(iobase+UART_LSR); | 2251 | val = inb(iobase+UART_LSR); |
2252 | val = inb(iobase+UART_MSR); | 2252 | val = inb(iobase+UART_MSR); |
2253 | 2253 | ||
2254 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __FUNCTION__ ); | 2254 | IRDA_DEBUG(1, "%s(), ----------------- End ------------------\n", __func__ ); |
2255 | } | 2255 | } |
2256 | 2256 | ||
2257 | MODULE_AUTHOR("Benjamin Kong <benjamin_kong@ali.com.tw>"); | 2257 | MODULE_AUTHOR("Benjamin Kong <benjamin_kong@ali.com.tw>"); |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 34ad189fff67..69d16b30323b 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -245,7 +245,7 @@ toshoboe_dumpregs (struct toshoboe_cb *self) | |||
245 | { | 245 | { |
246 | __u32 ringbase; | 246 | __u32 ringbase; |
247 | 247 | ||
248 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 248 | IRDA_DEBUG (4, "%s()\n", __func__); |
249 | 249 | ||
250 | ringbase = INB (OBOE_RING_BASE0) << 10; | 250 | ringbase = INB (OBOE_RING_BASE0) << 10; |
251 | ringbase |= INB (OBOE_RING_BASE1) << 18; | 251 | ringbase |= INB (OBOE_RING_BASE1) << 18; |
@@ -293,7 +293,7 @@ static void | |||
293 | toshoboe_disablebm (struct toshoboe_cb *self) | 293 | toshoboe_disablebm (struct toshoboe_cb *self) |
294 | { | 294 | { |
295 | __u8 command; | 295 | __u8 command; |
296 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 296 | IRDA_DEBUG (4, "%s()\n", __func__); |
297 | 297 | ||
298 | pci_read_config_byte (self->pdev, PCI_COMMAND, &command); | 298 | pci_read_config_byte (self->pdev, PCI_COMMAND, &command); |
299 | command &= ~PCI_COMMAND_MASTER; | 299 | command &= ~PCI_COMMAND_MASTER; |
@@ -305,7 +305,7 @@ toshoboe_disablebm (struct toshoboe_cb *self) | |||
305 | static void | 305 | static void |
306 | toshoboe_stopchip (struct toshoboe_cb *self) | 306 | toshoboe_stopchip (struct toshoboe_cb *self) |
307 | { | 307 | { |
308 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 308 | IRDA_DEBUG (4, "%s()\n", __func__); |
309 | 309 | ||
310 | /*Disable interrupts */ | 310 | /*Disable interrupts */ |
311 | OUTB (0x0, OBOE_IER); | 311 | OUTB (0x0, OBOE_IER); |
@@ -350,7 +350,7 @@ toshoboe_setbaud (struct toshoboe_cb *self) | |||
350 | __u16 pconfig = 0; | 350 | __u16 pconfig = 0; |
351 | __u8 config0l = 0; | 351 | __u8 config0l = 0; |
352 | 352 | ||
353 | IRDA_DEBUG (2, "%s(%d/%d)\n", __FUNCTION__, self->speed, self->io.speed); | 353 | IRDA_DEBUG (2, "%s(%d/%d)\n", __func__, self->speed, self->io.speed); |
354 | 354 | ||
355 | switch (self->speed) | 355 | switch (self->speed) |
356 | { | 356 | { |
@@ -482,7 +482,7 @@ toshoboe_setbaud (struct toshoboe_cb *self) | |||
482 | static void | 482 | static void |
483 | toshoboe_enablebm (struct toshoboe_cb *self) | 483 | toshoboe_enablebm (struct toshoboe_cb *self) |
484 | { | 484 | { |
485 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 485 | IRDA_DEBUG (4, "%s()\n", __func__); |
486 | pci_set_master (self->pdev); | 486 | pci_set_master (self->pdev); |
487 | } | 487 | } |
488 | 488 | ||
@@ -492,7 +492,7 @@ toshoboe_initring (struct toshoboe_cb *self) | |||
492 | { | 492 | { |
493 | int i; | 493 | int i; |
494 | 494 | ||
495 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 495 | IRDA_DEBUG (4, "%s()\n", __func__); |
496 | 496 | ||
497 | for (i = 0; i < TX_SLOTS; ++i) | 497 | for (i = 0; i < TX_SLOTS; ++i) |
498 | { | 498 | { |
@@ -550,7 +550,7 @@ toshoboe_startchip (struct toshoboe_cb *self) | |||
550 | { | 550 | { |
551 | __u32 physaddr; | 551 | __u32 physaddr; |
552 | 552 | ||
553 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 553 | IRDA_DEBUG (4, "%s()\n", __func__); |
554 | 554 | ||
555 | toshoboe_initring (self); | 555 | toshoboe_initring (self); |
556 | toshoboe_enablebm (self); | 556 | toshoboe_enablebm (self); |
@@ -824,7 +824,7 @@ toshoboe_probe (struct toshoboe_cb *self) | |||
824 | #endif | 824 | #endif |
825 | unsigned long flags; | 825 | unsigned long flags; |
826 | 826 | ||
827 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 827 | IRDA_DEBUG (4, "%s()\n", __func__); |
828 | 828 | ||
829 | if (request_irq (self->io.irq, toshoboe_probeinterrupt, | 829 | if (request_irq (self->io.irq, toshoboe_probeinterrupt, |
830 | self->io.irqflags, "toshoboe", (void *) self)) | 830 | self->io.irqflags, "toshoboe", (void *) self)) |
@@ -983,10 +983,10 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | |||
983 | 983 | ||
984 | IRDA_ASSERT (self != NULL, return 0; ); | 984 | IRDA_ASSERT (self != NULL, return 0; ); |
985 | 985 | ||
986 | IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __FUNCTION__ | 986 | IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __func__ |
987 | ,skb->len,self->txpending,INB (OBOE_ENABLEH)); | 987 | ,skb->len,self->txpending,INB (OBOE_ENABLEH)); |
988 | if (!cb->magic) { | 988 | if (!cb->magic) { |
989 | IRDA_DEBUG (2, "%s.Not IrLAP:%x\n", __FUNCTION__, cb->magic); | 989 | IRDA_DEBUG (2, "%s.Not IrLAP:%x\n", __func__, cb->magic); |
990 | #ifdef DUMP_PACKETS | 990 | #ifdef DUMP_PACKETS |
991 | _dumpbufs(skb->data,skb->len,'>'); | 991 | _dumpbufs(skb->data,skb->len,'>'); |
992 | #endif | 992 | #endif |
@@ -1015,7 +1015,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1015 | { | 1015 | { |
1016 | self->new_speed = speed; | 1016 | self->new_speed = speed; |
1017 | IRDA_DEBUG (1, "%s: Queued TxDone scheduled speed change %d\n" , | 1017 | IRDA_DEBUG (1, "%s: Queued TxDone scheduled speed change %d\n" , |
1018 | __FUNCTION__, speed); | 1018 | __func__, speed); |
1019 | /* if no data, that's all! */ | 1019 | /* if no data, that's all! */ |
1020 | if (!skb->len) | 1020 | if (!skb->len) |
1021 | { | 1021 | { |
@@ -1057,7 +1057,7 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1057 | /* which we will add a wrong checksum to */ | 1057 | /* which we will add a wrong checksum to */ |
1058 | 1058 | ||
1059 | mtt = toshoboe_makemttpacket (self, self->tx_bufs[self->txs], mtt); | 1059 | mtt = toshoboe_makemttpacket (self, self->tx_bufs[self->txs], mtt); |
1060 | IRDA_DEBUG (1, "%s.mtt:%x(%x)%d\n", __FUNCTION__ | 1060 | IRDA_DEBUG (1, "%s.mtt:%x(%x)%d\n", __func__ |
1061 | ,skb->len,mtt,self->txpending); | 1061 | ,skb->len,mtt,self->txpending); |
1062 | if (mtt) | 1062 | if (mtt) |
1063 | { | 1063 | { |
@@ -1101,7 +1101,7 @@ dumpbufs(skb->data,skb->len,'>'); | |||
1101 | 1101 | ||
1102 | if (self->ring->tx[self->txs].control & OBOE_CTL_TX_HW_OWNS) | 1102 | if (self->ring->tx[self->txs].control & OBOE_CTL_TX_HW_OWNS) |
1103 | { | 1103 | { |
1104 | IRDA_DEBUG (0, "%s.ful:%x(%x)%x\n", __FUNCTION__ | 1104 | IRDA_DEBUG (0, "%s.ful:%x(%x)%x\n", __func__ |
1105 | ,skb->len, self->ring->tx[self->txs].control, self->txpending); | 1105 | ,skb->len, self->ring->tx[self->txs].control, self->txpending); |
1106 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); | 1106 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); |
1107 | spin_unlock_irqrestore(&self->spinlock, flags); | 1107 | spin_unlock_irqrestore(&self->spinlock, flags); |
@@ -1179,7 +1179,7 @@ toshoboe_interrupt (int irq, void *dev_id) | |||
1179 | if (self->ring->tx[i].control & OBOE_CTL_TX_HW_OWNS) | 1179 | if (self->ring->tx[i].control & OBOE_CTL_TX_HW_OWNS) |
1180 | self->txpending++; | 1180 | self->txpending++; |
1181 | } | 1181 | } |
1182 | IRDA_DEBUG (1, "%s.txd(%x)%x/%x\n", __FUNCTION__ | 1182 | IRDA_DEBUG (1, "%s.txd(%x)%x/%x\n", __func__ |
1183 | ,irqstat,txp,self->txpending); | 1183 | ,irqstat,txp,self->txpending); |
1184 | 1184 | ||
1185 | txp = INB (OBOE_TXSLOT) & OBOE_SLOT_MASK; | 1185 | txp = INB (OBOE_TXSLOT) & OBOE_SLOT_MASK; |
@@ -1209,7 +1209,7 @@ toshoboe_interrupt (int irq, void *dev_id) | |||
1209 | { | 1209 | { |
1210 | self->speed = self->new_speed; | 1210 | self->speed = self->new_speed; |
1211 | IRDA_DEBUG (1, "%s: Executed TxDone scheduled speed change %d\n", | 1211 | IRDA_DEBUG (1, "%s: Executed TxDone scheduled speed change %d\n", |
1212 | __FUNCTION__, self->speed); | 1212 | __func__, self->speed); |
1213 | toshoboe_setbaud (self); | 1213 | toshoboe_setbaud (self); |
1214 | } | 1214 | } |
1215 | 1215 | ||
@@ -1224,7 +1224,7 @@ toshoboe_interrupt (int irq, void *dev_id) | |||
1224 | { | 1224 | { |
1225 | int len = self->ring->rx[self->rxs].len; | 1225 | int len = self->ring->rx[self->rxs].len; |
1226 | skb = NULL; | 1226 | skb = NULL; |
1227 | IRDA_DEBUG (3, "%s.rcv:%x(%x)\n", __FUNCTION__ | 1227 | IRDA_DEBUG (3, "%s.rcv:%x(%x)\n", __func__ |
1228 | ,len,self->ring->rx[self->rxs].control); | 1228 | ,len,self->ring->rx[self->rxs].control); |
1229 | 1229 | ||
1230 | #ifdef DUMP_PACKETS | 1230 | #ifdef DUMP_PACKETS |
@@ -1246,7 +1246,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1246 | len -= 2; | 1246 | len -= 2; |
1247 | else | 1247 | else |
1248 | len = 0; | 1248 | len = 0; |
1249 | IRDA_DEBUG (1, "%s.SIR:%x(%x)\n", __FUNCTION__, len,enable); | 1249 | IRDA_DEBUG (1, "%s.SIR:%x(%x)\n", __func__, len,enable); |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | #ifdef USE_MIR | 1252 | #ifdef USE_MIR |
@@ -1256,7 +1256,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1256 | len -= 2; | 1256 | len -= 2; |
1257 | else | 1257 | else |
1258 | len = 0; | 1258 | len = 0; |
1259 | IRDA_DEBUG (2, "%s.MIR:%x(%x)\n", __FUNCTION__, len,enable); | 1259 | IRDA_DEBUG (2, "%s.MIR:%x(%x)\n", __func__, len,enable); |
1260 | } | 1260 | } |
1261 | #endif | 1261 | #endif |
1262 | else if (enable & OBOE_ENABLEH_FIRON) | 1262 | else if (enable & OBOE_ENABLEH_FIRON) |
@@ -1265,10 +1265,10 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1265 | len -= 4; /*FIXME: check this */ | 1265 | len -= 4; /*FIXME: check this */ |
1266 | else | 1266 | else |
1267 | len = 0; | 1267 | len = 0; |
1268 | IRDA_DEBUG (1, "%s.FIR:%x(%x)\n", __FUNCTION__, len,enable); | 1268 | IRDA_DEBUG (1, "%s.FIR:%x(%x)\n", __func__, len,enable); |
1269 | } | 1269 | } |
1270 | else | 1270 | else |
1271 | IRDA_DEBUG (0, "%s.?IR:%x(%x)\n", __FUNCTION__, len,enable); | 1271 | IRDA_DEBUG (0, "%s.?IR:%x(%x)\n", __func__, len,enable); |
1272 | 1272 | ||
1273 | if (len) | 1273 | if (len) |
1274 | { | 1274 | { |
@@ -1289,7 +1289,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1289 | { | 1289 | { |
1290 | printk (KERN_INFO | 1290 | printk (KERN_INFO |
1291 | "%s(), memory squeeze, dropping frame.\n", | 1291 | "%s(), memory squeeze, dropping frame.\n", |
1292 | __FUNCTION__); | 1292 | __func__); |
1293 | } | 1293 | } |
1294 | } | 1294 | } |
1295 | } | 1295 | } |
@@ -1301,7 +1301,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1301 | /* (SIR) data is splitted in several slots. */ | 1301 | /* (SIR) data is splitted in several slots. */ |
1302 | /* we have to join all the received buffers received */ | 1302 | /* we have to join all the received buffers received */ |
1303 | /*in a large buffer before checking CRC. */ | 1303 | /*in a large buffer before checking CRC. */ |
1304 | IRDA_DEBUG (0, "%s.err:%x(%x)\n", __FUNCTION__ | 1304 | IRDA_DEBUG (0, "%s.err:%x(%x)\n", __func__ |
1305 | ,len,self->ring->rx[self->rxs].control); | 1305 | ,len,self->ring->rx[self->rxs].control); |
1306 | } | 1306 | } |
1307 | 1307 | ||
@@ -1329,7 +1329,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1329 | if (irqstat & OBOE_INT_SIP) | 1329 | if (irqstat & OBOE_INT_SIP) |
1330 | { | 1330 | { |
1331 | self->int_sip++; | 1331 | self->int_sip++; |
1332 | IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __FUNCTION__ | 1332 | IRDA_DEBUG (1, "%s.sip:%x(%x)%x\n", __func__ |
1333 | ,self->int_sip,irqstat,self->txpending); | 1333 | ,self->int_sip,irqstat,self->txpending); |
1334 | } | 1334 | } |
1335 | return IRQ_HANDLED; | 1335 | return IRQ_HANDLED; |
@@ -1343,7 +1343,7 @@ toshoboe_net_open (struct net_device *dev) | |||
1343 | unsigned long flags; | 1343 | unsigned long flags; |
1344 | int rc; | 1344 | int rc; |
1345 | 1345 | ||
1346 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1346 | IRDA_DEBUG (4, "%s()\n", __func__); |
1347 | 1347 | ||
1348 | self = netdev_priv(dev); | 1348 | self = netdev_priv(dev); |
1349 | 1349 | ||
@@ -1381,7 +1381,7 @@ toshoboe_net_close (struct net_device *dev) | |||
1381 | { | 1381 | { |
1382 | struct toshoboe_cb *self; | 1382 | struct toshoboe_cb *self; |
1383 | 1383 | ||
1384 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1384 | IRDA_DEBUG (4, "%s()\n", __func__); |
1385 | 1385 | ||
1386 | IRDA_ASSERT (dev != NULL, return -1; ); | 1386 | IRDA_ASSERT (dev != NULL, return -1; ); |
1387 | self = (struct toshoboe_cb *) dev->priv; | 1387 | self = (struct toshoboe_cb *) dev->priv; |
@@ -1426,7 +1426,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1426 | 1426 | ||
1427 | IRDA_ASSERT (self != NULL, return -1; ); | 1427 | IRDA_ASSERT (self != NULL, return -1; ); |
1428 | 1428 | ||
1429 | IRDA_DEBUG (5, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); | 1429 | IRDA_DEBUG (5, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); |
1430 | 1430 | ||
1431 | /* Disable interrupts & save flags */ | 1431 | /* Disable interrupts & save flags */ |
1432 | spin_lock_irqsave(&self->spinlock, flags); | 1432 | spin_lock_irqsave(&self->spinlock, flags); |
@@ -1438,7 +1438,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1438 | * speed, so we still must allow for speed change within | 1438 | * speed, so we still must allow for speed change within |
1439 | * interrupt context. | 1439 | * interrupt context. |
1440 | */ | 1440 | */ |
1441 | IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __FUNCTION__ | 1441 | IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __func__ |
1442 | ,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate ); | 1442 | ,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate ); |
1443 | if (!in_interrupt () && !capable (CAP_NET_ADMIN)) { | 1443 | if (!in_interrupt () && !capable (CAP_NET_ADMIN)) { |
1444 | ret = -EPERM; | 1444 | ret = -EPERM; |
@@ -1451,7 +1451,7 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1451 | self->new_speed = irq->ifr_baudrate; | 1451 | self->new_speed = irq->ifr_baudrate; |
1452 | break; | 1452 | break; |
1453 | case SIOCSMEDIABUSY: /* Set media busy */ | 1453 | case SIOCSMEDIABUSY: /* Set media busy */ |
1454 | IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __FUNCTION__ | 1454 | IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __func__ |
1455 | ,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) ); | 1455 | ,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) ); |
1456 | if (!capable (CAP_NET_ADMIN)) { | 1456 | if (!capable (CAP_NET_ADMIN)) { |
1457 | ret = -EPERM; | 1457 | ret = -EPERM; |
@@ -1461,11 +1461,11 @@ toshoboe_net_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
1461 | break; | 1461 | break; |
1462 | case SIOCGRECEIVING: /* Check if we are receiving right now */ | 1462 | case SIOCGRECEIVING: /* Check if we are receiving right now */ |
1463 | irq->ifr_receiving = (INB (OBOE_STATUS) & OBOE_STATUS_RXBUSY) ? 1 : 0; | 1463 | irq->ifr_receiving = (INB (OBOE_STATUS) & OBOE_STATUS_RXBUSY) ? 1 : 0; |
1464 | IRDA_DEBUG (3, "%s(RECEIVING), %s, (%X/%x)\n", __FUNCTION__ | 1464 | IRDA_DEBUG (3, "%s(RECEIVING), %s, (%X/%x)\n", __func__ |
1465 | ,dev->name, INB (OBOE_STATUS), irq->ifr_receiving ); | 1465 | ,dev->name, INB (OBOE_STATUS), irq->ifr_receiving ); |
1466 | break; | 1466 | break; |
1467 | default: | 1467 | default: |
1468 | IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); | 1468 | IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); |
1469 | ret = -EOPNOTSUPP; | 1469 | ret = -EOPNOTSUPP; |
1470 | } | 1470 | } |
1471 | out: | 1471 | out: |
@@ -1492,7 +1492,7 @@ toshoboe_close (struct pci_dev *pci_dev) | |||
1492 | int i; | 1492 | int i; |
1493 | struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); | 1493 | struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); |
1494 | 1494 | ||
1495 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1495 | IRDA_DEBUG (4, "%s()\n", __func__); |
1496 | 1496 | ||
1497 | IRDA_ASSERT (self != NULL, return; ); | 1497 | IRDA_ASSERT (self != NULL, return; ); |
1498 | 1498 | ||
@@ -1533,7 +1533,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid) | |||
1533 | int ok = 0; | 1533 | int ok = 0; |
1534 | int err; | 1534 | int err; |
1535 | 1535 | ||
1536 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1536 | IRDA_DEBUG (4, "%s()\n", __func__); |
1537 | 1537 | ||
1538 | if ((err=pci_enable_device(pci_dev))) | 1538 | if ((err=pci_enable_device(pci_dev))) |
1539 | return err; | 1539 | return err; |
@@ -1700,7 +1700,7 @@ toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap) | |||
1700 | unsigned long flags; | 1700 | unsigned long flags; |
1701 | int i = 10; | 1701 | int i = 10; |
1702 | 1702 | ||
1703 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1703 | IRDA_DEBUG (4, "%s()\n", __func__); |
1704 | 1704 | ||
1705 | if (!self || self->stopped) | 1705 | if (!self || self->stopped) |
1706 | return 0; | 1706 | return 0; |
@@ -1728,7 +1728,7 @@ toshoboe_wakeup (struct pci_dev *pci_dev) | |||
1728 | struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); | 1728 | struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev); |
1729 | unsigned long flags; | 1729 | unsigned long flags; |
1730 | 1730 | ||
1731 | IRDA_DEBUG (4, "%s()\n", __FUNCTION__); | 1731 | IRDA_DEBUG (4, "%s()\n", __func__); |
1732 | 1732 | ||
1733 | if (!self || !self->stopped) | 1733 | if (!self || !self->stopped) |
1734 | return 0; | 1734 | return 0; |
diff --git a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c index 738531b16bd3..a31b8fa8aaa9 100644 --- a/drivers/net/irda/girbil-sir.c +++ b/drivers/net/irda/girbil-sir.c | |||
@@ -86,7 +86,7 @@ static int girbil_open(struct sir_dev *dev) | |||
86 | { | 86 | { |
87 | struct qos_info *qos = &dev->qos; | 87 | struct qos_info *qos = &dev->qos; |
88 | 88 | ||
89 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 89 | IRDA_DEBUG(2, "%s()\n", __func__); |
90 | 90 | ||
91 | /* Power on dongle */ | 91 | /* Power on dongle */ |
92 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 92 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
@@ -102,7 +102,7 @@ static int girbil_open(struct sir_dev *dev) | |||
102 | 102 | ||
103 | static int girbil_close(struct sir_dev *dev) | 103 | static int girbil_close(struct sir_dev *dev) |
104 | { | 104 | { |
105 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 105 | IRDA_DEBUG(2, "%s()\n", __func__); |
106 | 106 | ||
107 | /* Power off dongle */ | 107 | /* Power off dongle */ |
108 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 108 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -126,7 +126,7 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed) | |||
126 | u8 control[2]; | 126 | u8 control[2]; |
127 | static int ret = 0; | 127 | static int ret = 0; |
128 | 128 | ||
129 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 129 | IRDA_DEBUG(2, "%s()\n", __func__); |
130 | 130 | ||
131 | /* dongle alread reset - port and dongle at default speed */ | 131 | /* dongle alread reset - port and dongle at default speed */ |
132 | 132 | ||
@@ -179,7 +179,7 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed) | |||
179 | break; | 179 | break; |
180 | 180 | ||
181 | default: | 181 | default: |
182 | IRDA_ERROR("%s - undefined state %d\n", __FUNCTION__, state); | 182 | IRDA_ERROR("%s - undefined state %d\n", __func__, state); |
183 | ret = -EINVAL; | 183 | ret = -EINVAL; |
184 | break; | 184 | break; |
185 | } | 185 | } |
@@ -209,7 +209,7 @@ static int girbil_reset(struct sir_dev *dev) | |||
209 | u8 control = GIRBIL_TXEN | GIRBIL_RXEN; | 209 | u8 control = GIRBIL_TXEN | GIRBIL_RXEN; |
210 | int ret = 0; | 210 | int ret = 0; |
211 | 211 | ||
212 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 212 | IRDA_DEBUG(2, "%s()\n", __func__); |
213 | 213 | ||
214 | switch (state) { | 214 | switch (state) { |
215 | case SIRDEV_STATE_DONGLE_RESET: | 215 | case SIRDEV_STATE_DONGLE_RESET: |
@@ -241,7 +241,7 @@ static int girbil_reset(struct sir_dev *dev) | |||
241 | break; | 241 | break; |
242 | 242 | ||
243 | default: | 243 | default: |
244 | IRDA_ERROR("%s(), undefined state %d\n", __FUNCTION__, state); | 244 | IRDA_ERROR("%s(), undefined state %d\n", __func__, state); |
245 | ret = -1; | 245 | ret = -1; |
246 | break; | 246 | break; |
247 | } | 247 | } |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 18b471cd1447..b5d6b9ac162a 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -177,12 +177,12 @@ static void irda_usb_build_header(struct irda_usb_cb *self, | |||
177 | (!force) && (self->speed != -1)) { | 177 | (!force) && (self->speed != -1)) { |
178 | /* No speed and xbofs change here | 178 | /* No speed and xbofs change here |
179 | * (we'll do it later in the write callback) */ | 179 | * (we'll do it later in the write callback) */ |
180 | IRDA_DEBUG(2, "%s(), not changing speed yet\n", __FUNCTION__); | 180 | IRDA_DEBUG(2, "%s(), not changing speed yet\n", __func__); |
181 | *header = 0; | 181 | *header = 0; |
182 | return; | 182 | return; |
183 | } | 183 | } |
184 | 184 | ||
185 | IRDA_DEBUG(2, "%s(), changing speed to %d\n", __FUNCTION__, self->new_speed); | 185 | IRDA_DEBUG(2, "%s(), changing speed to %d\n", __func__, self->new_speed); |
186 | self->speed = self->new_speed; | 186 | self->speed = self->new_speed; |
187 | /* We will do ` self->new_speed = -1; ' in the completion | 187 | /* We will do ` self->new_speed = -1; ' in the completion |
188 | * handler just in case the current URB fail - Jean II */ | 188 | * handler just in case the current URB fail - Jean II */ |
@@ -228,7 +228,7 @@ static void irda_usb_build_header(struct irda_usb_cb *self, | |||
228 | 228 | ||
229 | /* Set the negotiated additional XBOFS */ | 229 | /* Set the negotiated additional XBOFS */ |
230 | if (self->new_xbofs != -1) { | 230 | if (self->new_xbofs != -1) { |
231 | IRDA_DEBUG(2, "%s(), changing xbofs to %d\n", __FUNCTION__, self->new_xbofs); | 231 | IRDA_DEBUG(2, "%s(), changing xbofs to %d\n", __func__, self->new_xbofs); |
232 | self->xbofs = self->new_xbofs; | 232 | self->xbofs = self->new_xbofs; |
233 | /* We will do ` self->new_xbofs = -1; ' in the completion | 233 | /* We will do ` self->new_xbofs = -1; ' in the completion |
234 | * handler just in case the current URB fail - Jean II */ | 234 | * handler just in case the current URB fail - Jean II */ |
@@ -302,13 +302,13 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) | |||
302 | struct urb *urb; | 302 | struct urb *urb; |
303 | int ret; | 303 | int ret; |
304 | 304 | ||
305 | IRDA_DEBUG(2, "%s(), speed=%d, xbofs=%d\n", __FUNCTION__, | 305 | IRDA_DEBUG(2, "%s(), speed=%d, xbofs=%d\n", __func__, |
306 | self->new_speed, self->new_xbofs); | 306 | self->new_speed, self->new_xbofs); |
307 | 307 | ||
308 | /* Grab the speed URB */ | 308 | /* Grab the speed URB */ |
309 | urb = self->speed_urb; | 309 | urb = self->speed_urb; |
310 | if (urb->status != 0) { | 310 | if (urb->status != 0) { |
311 | IRDA_WARNING("%s(), URB still in use!\n", __FUNCTION__); | 311 | IRDA_WARNING("%s(), URB still in use!\n", __func__); |
312 | return; | 312 | return; |
313 | } | 313 | } |
314 | 314 | ||
@@ -334,7 +334,7 @@ static void irda_usb_change_speed_xbofs(struct irda_usb_cb *self) | |||
334 | 334 | ||
335 | /* Irq disabled -> GFP_ATOMIC */ | 335 | /* Irq disabled -> GFP_ATOMIC */ |
336 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { | 336 | if ((ret = usb_submit_urb(urb, GFP_ATOMIC))) { |
337 | IRDA_WARNING("%s(), failed Speed URB\n", __FUNCTION__); | 337 | IRDA_WARNING("%s(), failed Speed URB\n", __func__); |
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
@@ -347,7 +347,7 @@ static void speed_bulk_callback(struct urb *urb) | |||
347 | { | 347 | { |
348 | struct irda_usb_cb *self = urb->context; | 348 | struct irda_usb_cb *self = urb->context; |
349 | 349 | ||
350 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 350 | IRDA_DEBUG(2, "%s()\n", __func__); |
351 | 351 | ||
352 | /* We should always have a context */ | 352 | /* We should always have a context */ |
353 | IRDA_ASSERT(self != NULL, return;); | 353 | IRDA_ASSERT(self != NULL, return;); |
@@ -357,7 +357,7 @@ static void speed_bulk_callback(struct urb *urb) | |||
357 | /* Check for timeout and other USB nasties */ | 357 | /* Check for timeout and other USB nasties */ |
358 | if (urb->status != 0) { | 358 | if (urb->status != 0) { |
359 | /* I get a lot of -ECONNABORTED = -103 here - Jean II */ | 359 | /* I get a lot of -ECONNABORTED = -103 here - Jean II */ |
360 | IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __FUNCTION__, urb->status, urb->transfer_flags); | 360 | IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags); |
361 | 361 | ||
362 | /* Don't do anything here, that might confuse the USB layer. | 362 | /* Don't do anything here, that might confuse the USB layer. |
363 | * Instead, we will wait for irda_usb_net_timeout(), the | 363 | * Instead, we will wait for irda_usb_net_timeout(), the |
@@ -392,7 +392,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
392 | int res, mtt; | 392 | int res, mtt; |
393 | int err = 1; /* Failed */ | 393 | int err = 1; /* Failed */ |
394 | 394 | ||
395 | IRDA_DEBUG(4, "%s() on %s\n", __FUNCTION__, netdev->name); | 395 | IRDA_DEBUG(4, "%s() on %s\n", __func__, netdev->name); |
396 | 396 | ||
397 | netif_stop_queue(netdev); | 397 | netif_stop_queue(netdev); |
398 | 398 | ||
@@ -403,7 +403,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
403 | * We need to check self->present under the spinlock because | 403 | * We need to check self->present under the spinlock because |
404 | * of irda_usb_disconnect() is synchronous - Jean II */ | 404 | * of irda_usb_disconnect() is synchronous - Jean II */ |
405 | if (!self->present) { | 405 | if (!self->present) { |
406 | IRDA_DEBUG(0, "%s(), Device is gone...\n", __FUNCTION__); | 406 | IRDA_DEBUG(0, "%s(), Device is gone...\n", __func__); |
407 | goto drop; | 407 | goto drop; |
408 | } | 408 | } |
409 | 409 | ||
@@ -437,7 +437,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
437 | } | 437 | } |
438 | 438 | ||
439 | if (urb->status != 0) { | 439 | if (urb->status != 0) { |
440 | IRDA_WARNING("%s(), URB still in use!\n", __FUNCTION__); | 440 | IRDA_WARNING("%s(), URB still in use!\n", __func__); |
441 | goto drop; | 441 | goto drop; |
442 | } | 442 | } |
443 | 443 | ||
@@ -524,7 +524,7 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
524 | 524 | ||
525 | /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */ | 525 | /* Ask USB to send the packet - Irq disabled -> GFP_ATOMIC */ |
526 | if ((res = usb_submit_urb(urb, GFP_ATOMIC))) { | 526 | if ((res = usb_submit_urb(urb, GFP_ATOMIC))) { |
527 | IRDA_WARNING("%s(), failed Tx URB\n", __FUNCTION__); | 527 | IRDA_WARNING("%s(), failed Tx URB\n", __func__); |
528 | self->stats.tx_errors++; | 528 | self->stats.tx_errors++; |
529 | /* Let USB recover : We will catch that in the watchdog */ | 529 | /* Let USB recover : We will catch that in the watchdog */ |
530 | /*netif_start_queue(netdev);*/ | 530 | /*netif_start_queue(netdev);*/ |
@@ -556,7 +556,7 @@ static void write_bulk_callback(struct urb *urb) | |||
556 | struct sk_buff *skb = urb->context; | 556 | struct sk_buff *skb = urb->context; |
557 | struct irda_usb_cb *self = ((struct irda_skb_cb *) skb->cb)->context; | 557 | struct irda_usb_cb *self = ((struct irda_skb_cb *) skb->cb)->context; |
558 | 558 | ||
559 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 559 | IRDA_DEBUG(2, "%s()\n", __func__); |
560 | 560 | ||
561 | /* We should always have a context */ | 561 | /* We should always have a context */ |
562 | IRDA_ASSERT(self != NULL, return;); | 562 | IRDA_ASSERT(self != NULL, return;); |
@@ -570,7 +570,7 @@ static void write_bulk_callback(struct urb *urb) | |||
570 | /* Check for timeout and other USB nasties */ | 570 | /* Check for timeout and other USB nasties */ |
571 | if (urb->status != 0) { | 571 | if (urb->status != 0) { |
572 | /* I get a lot of -ECONNABORTED = -103 here - Jean II */ | 572 | /* I get a lot of -ECONNABORTED = -103 here - Jean II */ |
573 | IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __FUNCTION__, urb->status, urb->transfer_flags); | 573 | IRDA_DEBUG(0, "%s(), URB complete status %d, transfer_flags 0x%04X\n", __func__, urb->status, urb->transfer_flags); |
574 | 574 | ||
575 | /* Don't do anything here, that might confuse the USB layer, | 575 | /* Don't do anything here, that might confuse the USB layer, |
576 | * and we could go in recursion and blow the kernel stack... | 576 | * and we could go in recursion and blow the kernel stack... |
@@ -589,7 +589,7 @@ static void write_bulk_callback(struct urb *urb) | |||
589 | 589 | ||
590 | /* If the network is closed, stop everything */ | 590 | /* If the network is closed, stop everything */ |
591 | if ((!self->netopen) || (!self->present)) { | 591 | if ((!self->netopen) || (!self->present)) { |
592 | IRDA_DEBUG(0, "%s(), Network is gone...\n", __FUNCTION__); | 592 | IRDA_DEBUG(0, "%s(), Network is gone...\n", __func__); |
593 | spin_unlock_irqrestore(&self->lock, flags); | 593 | spin_unlock_irqrestore(&self->lock, flags); |
594 | return; | 594 | return; |
595 | } | 595 | } |
@@ -600,7 +600,7 @@ static void write_bulk_callback(struct urb *urb) | |||
600 | (self->new_xbofs != self->xbofs)) { | 600 | (self->new_xbofs != self->xbofs)) { |
601 | /* We haven't changed speed yet (because of | 601 | /* We haven't changed speed yet (because of |
602 | * IUC_SPEED_BUG), so do it now - Jean II */ | 602 | * IUC_SPEED_BUG), so do it now - Jean II */ |
603 | IRDA_DEBUG(1, "%s(), Changing speed now...\n", __FUNCTION__); | 603 | IRDA_DEBUG(1, "%s(), Changing speed now...\n", __func__); |
604 | irda_usb_change_speed_xbofs(self); | 604 | irda_usb_change_speed_xbofs(self); |
605 | } else { | 605 | } else { |
606 | /* New speed and xbof is now commited in hardware */ | 606 | /* New speed and xbof is now commited in hardware */ |
@@ -632,7 +632,7 @@ static void irda_usb_net_timeout(struct net_device *netdev) | |||
632 | struct urb *urb; | 632 | struct urb *urb; |
633 | int done = 0; /* If we have made any progress */ | 633 | int done = 0; /* If we have made any progress */ |
634 | 634 | ||
635 | IRDA_DEBUG(0, "%s(), Network layer thinks we timed out!\n", __FUNCTION__); | 635 | IRDA_DEBUG(0, "%s(), Network layer thinks we timed out!\n", __func__); |
636 | IRDA_ASSERT(self != NULL, return;); | 636 | IRDA_ASSERT(self != NULL, return;); |
637 | 637 | ||
638 | /* Protect us from USB callbacks, net Tx and else. */ | 638 | /* Protect us from USB callbacks, net Tx and else. */ |
@@ -640,7 +640,7 @@ static void irda_usb_net_timeout(struct net_device *netdev) | |||
640 | 640 | ||
641 | /* self->present *MUST* be read under spinlock */ | 641 | /* self->present *MUST* be read under spinlock */ |
642 | if (!self->present) { | 642 | if (!self->present) { |
643 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); | 643 | IRDA_WARNING("%s(), device not present!\n", __func__); |
644 | netif_stop_queue(netdev); | 644 | netif_stop_queue(netdev); |
645 | spin_unlock_irqrestore(&self->lock, flags); | 645 | spin_unlock_irqrestore(&self->lock, flags); |
646 | return; | 646 | return; |
@@ -763,7 +763,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc | |||
763 | struct irda_skb_cb *cb; | 763 | struct irda_skb_cb *cb; |
764 | int ret; | 764 | int ret; |
765 | 765 | ||
766 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 766 | IRDA_DEBUG(2, "%s()\n", __func__); |
767 | 767 | ||
768 | /* This should never happen */ | 768 | /* This should never happen */ |
769 | IRDA_ASSERT(skb != NULL, return;); | 769 | IRDA_ASSERT(skb != NULL, return;); |
@@ -786,7 +786,7 @@ static void irda_usb_submit(struct irda_usb_cb *self, struct sk_buff *skb, struc | |||
786 | /* If this ever happen, we are in deep s***. | 786 | /* If this ever happen, we are in deep s***. |
787 | * Basically, the Rx path will stop... */ | 787 | * Basically, the Rx path will stop... */ |
788 | IRDA_WARNING("%s(), Failed to submit Rx URB %d\n", | 788 | IRDA_WARNING("%s(), Failed to submit Rx URB %d\n", |
789 | __FUNCTION__, ret); | 789 | __func__, ret); |
790 | } | 790 | } |
791 | } | 791 | } |
792 | 792 | ||
@@ -807,7 +807,7 @@ static void irda_usb_receive(struct urb *urb) | |||
807 | struct urb *next_urb; | 807 | struct urb *next_urb; |
808 | unsigned int len, docopy; | 808 | unsigned int len, docopy; |
809 | 809 | ||
810 | IRDA_DEBUG(2, "%s(), len=%d\n", __FUNCTION__, urb->actual_length); | 810 | IRDA_DEBUG(2, "%s(), len=%d\n", __func__, urb->actual_length); |
811 | 811 | ||
812 | /* Find ourselves */ | 812 | /* Find ourselves */ |
813 | cb = (struct irda_skb_cb *) skb->cb; | 813 | cb = (struct irda_skb_cb *) skb->cb; |
@@ -817,7 +817,7 @@ static void irda_usb_receive(struct urb *urb) | |||
817 | 817 | ||
818 | /* If the network is closed or the device gone, stop everything */ | 818 | /* If the network is closed or the device gone, stop everything */ |
819 | if ((!self->netopen) || (!self->present)) { | 819 | if ((!self->netopen) || (!self->present)) { |
820 | IRDA_DEBUG(0, "%s(), Network is gone!\n", __FUNCTION__); | 820 | IRDA_DEBUG(0, "%s(), Network is gone!\n", __func__); |
821 | /* Don't re-submit the URB : will stall the Rx path */ | 821 | /* Don't re-submit the URB : will stall the Rx path */ |
822 | return; | 822 | return; |
823 | } | 823 | } |
@@ -840,7 +840,7 @@ static void irda_usb_receive(struct urb *urb) | |||
840 | /* Usually precursor to a hot-unplug on OHCI. */ | 840 | /* Usually precursor to a hot-unplug on OHCI. */ |
841 | default: | 841 | default: |
842 | self->stats.rx_errors++; | 842 | self->stats.rx_errors++; |
843 | IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __FUNCTION__, urb->status, urb->transfer_flags); | 843 | IRDA_DEBUG(0, "%s(), RX status %d, transfer_flags 0x%04X \n", __func__, urb->status, urb->transfer_flags); |
844 | break; | 844 | break; |
845 | } | 845 | } |
846 | /* If we received an error, we don't want to resubmit the | 846 | /* If we received an error, we don't want to resubmit the |
@@ -861,7 +861,7 @@ static void irda_usb_receive(struct urb *urb) | |||
861 | 861 | ||
862 | /* Check for empty frames */ | 862 | /* Check for empty frames */ |
863 | if (urb->actual_length <= self->header_length) { | 863 | if (urb->actual_length <= self->header_length) { |
864 | IRDA_WARNING("%s(), empty frame!\n", __FUNCTION__); | 864 | IRDA_WARNING("%s(), empty frame!\n", __func__); |
865 | goto done; | 865 | goto done; |
866 | } | 866 | } |
867 | 867 | ||
@@ -967,7 +967,7 @@ static void irda_usb_rx_defer_expired(unsigned long data) | |||
967 | struct irda_skb_cb *cb; | 967 | struct irda_skb_cb *cb; |
968 | struct urb *next_urb; | 968 | struct urb *next_urb; |
969 | 969 | ||
970 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 970 | IRDA_DEBUG(2, "%s()\n", __func__); |
971 | 971 | ||
972 | /* Find ourselves */ | 972 | /* Find ourselves */ |
973 | cb = (struct irda_skb_cb *) skb->cb; | 973 | cb = (struct irda_skb_cb *) skb->cb; |
@@ -1053,7 +1053,7 @@ static int stir421x_fw_upload(struct irda_usb_cb *self, | |||
1053 | patch_block, block_size, | 1053 | patch_block, block_size, |
1054 | &actual_len, msecs_to_jiffies(500)); | 1054 | &actual_len, msecs_to_jiffies(500)); |
1055 | IRDA_DEBUG(3,"%s(): Bulk send %u bytes, ret=%d\n", | 1055 | IRDA_DEBUG(3,"%s(): Bulk send %u bytes, ret=%d\n", |
1056 | __FUNCTION__, actual_len, ret); | 1056 | __func__, actual_len, ret); |
1057 | 1057 | ||
1058 | if (ret < 0) | 1058 | if (ret < 0) |
1059 | break; | 1059 | break; |
@@ -1092,7 +1092,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1092 | 1092 | ||
1093 | /* We get a patch from userspace */ | 1093 | /* We get a patch from userspace */ |
1094 | IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n", | 1094 | IRDA_MESSAGE("%s(): Received firmware %s (%zu bytes)\n", |
1095 | __FUNCTION__, stir421x_fw_name, fw->size); | 1095 | __func__, stir421x_fw_name, fw->size); |
1096 | 1096 | ||
1097 | ret = -EINVAL; | 1097 | ret = -EINVAL; |
1098 | 1098 | ||
@@ -1116,7 +1116,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1116 | + (build % 10); | 1116 | + (build % 10); |
1117 | 1117 | ||
1118 | IRDA_DEBUG(3, "%s(): Firmware Product version %ld\n", | 1118 | IRDA_DEBUG(3, "%s(): Firmware Product version %ld\n", |
1119 | __FUNCTION__, fw_version); | 1119 | __func__, fw_version); |
1120 | } | 1120 | } |
1121 | } | 1121 | } |
1122 | 1122 | ||
@@ -1172,7 +1172,7 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1172 | char hwname[16]; | 1172 | char hwname[16]; |
1173 | int i; | 1173 | int i; |
1174 | 1174 | ||
1175 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 1175 | IRDA_DEBUG(1, "%s()\n", __func__); |
1176 | 1176 | ||
1177 | IRDA_ASSERT(netdev != NULL, return -1;); | 1177 | IRDA_ASSERT(netdev != NULL, return -1;); |
1178 | self = (struct irda_usb_cb *) netdev->priv; | 1178 | self = (struct irda_usb_cb *) netdev->priv; |
@@ -1182,13 +1182,13 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1182 | /* Can only open the device if it's there */ | 1182 | /* Can only open the device if it's there */ |
1183 | if(!self->present) { | 1183 | if(!self->present) { |
1184 | spin_unlock_irqrestore(&self->lock, flags); | 1184 | spin_unlock_irqrestore(&self->lock, flags); |
1185 | IRDA_WARNING("%s(), device not present!\n", __FUNCTION__); | 1185 | IRDA_WARNING("%s(), device not present!\n", __func__); |
1186 | return -1; | 1186 | return -1; |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | if(self->needspatch) { | 1189 | if(self->needspatch) { |
1190 | spin_unlock_irqrestore(&self->lock, flags); | 1190 | spin_unlock_irqrestore(&self->lock, flags); |
1191 | IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ; | 1191 | IRDA_WARNING("%s(), device needs patch\n", __func__) ; |
1192 | return -EIO ; | 1192 | return -EIO ; |
1193 | } | 1193 | } |
1194 | 1194 | ||
@@ -1231,7 +1231,7 @@ static int irda_usb_net_open(struct net_device *netdev) | |||
1231 | /* If this ever happen, we are in deep s***. | 1231 | /* If this ever happen, we are in deep s***. |
1232 | * Basically, we can't start the Rx path... */ | 1232 | * Basically, we can't start the Rx path... */ |
1233 | IRDA_WARNING("%s(), Failed to allocate Rx skb\n", | 1233 | IRDA_WARNING("%s(), Failed to allocate Rx skb\n", |
1234 | __FUNCTION__); | 1234 | __func__); |
1235 | return -1; | 1235 | return -1; |
1236 | } | 1236 | } |
1237 | //skb_reserve(newskb, USB_IRDA_HEADER - 1); | 1237 | //skb_reserve(newskb, USB_IRDA_HEADER - 1); |
@@ -1254,7 +1254,7 @@ static int irda_usb_net_close(struct net_device *netdev) | |||
1254 | struct irda_usb_cb *self; | 1254 | struct irda_usb_cb *self; |
1255 | int i; | 1255 | int i; |
1256 | 1256 | ||
1257 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 1257 | IRDA_DEBUG(1, "%s()\n", __func__); |
1258 | 1258 | ||
1259 | IRDA_ASSERT(netdev != NULL, return -1;); | 1259 | IRDA_ASSERT(netdev != NULL, return -1;); |
1260 | self = (struct irda_usb_cb *) netdev->priv; | 1260 | self = (struct irda_usb_cb *) netdev->priv; |
@@ -1309,7 +1309,7 @@ static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1309 | self = dev->priv; | 1309 | self = dev->priv; |
1310 | IRDA_ASSERT(self != NULL, return -1;); | 1310 | IRDA_ASSERT(self != NULL, return -1;); |
1311 | 1311 | ||
1312 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); | 1312 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); |
1313 | 1313 | ||
1314 | switch (cmd) { | 1314 | switch (cmd) { |
1315 | case SIOCSBANDWIDTH: /* Set bandwidth */ | 1315 | case SIOCSBANDWIDTH: /* Set bandwidth */ |
@@ -1367,7 +1367,7 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self) | |||
1367 | { | 1367 | { |
1368 | struct irda_class_desc *desc; | 1368 | struct irda_class_desc *desc; |
1369 | 1369 | ||
1370 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 1370 | IRDA_DEBUG(3, "%s()\n", __func__); |
1371 | 1371 | ||
1372 | desc = self->irda_desc; | 1372 | desc = self->irda_desc; |
1373 | 1373 | ||
@@ -1384,7 +1384,7 @@ static inline void irda_usb_init_qos(struct irda_usb_cb *self) | |||
1384 | self->qos.data_size.bits = desc->bmDataSize; | 1384 | self->qos.data_size.bits = desc->bmDataSize; |
1385 | 1385 | ||
1386 | IRDA_DEBUG(0, "%s(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n", | 1386 | IRDA_DEBUG(0, "%s(), dongle says speed=0x%X, size=0x%X, window=0x%X, bofs=0x%X, turn=0x%X\n", |
1387 | __FUNCTION__, self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits); | 1387 | __func__, self->qos.baud_rate.bits, self->qos.data_size.bits, self->qos.window_size.bits, self->qos.additional_bofs.bits, self->qos.min_turn_time.bits); |
1388 | 1388 | ||
1389 | /* Don't always trust what the dongle tell us */ | 1389 | /* Don't always trust what the dongle tell us */ |
1390 | if(self->capability & IUC_SIR_ONLY) | 1390 | if(self->capability & IUC_SIR_ONLY) |
@@ -1419,7 +1419,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self) | |||
1419 | { | 1419 | { |
1420 | struct net_device *netdev = self->netdev; | 1420 | struct net_device *netdev = self->netdev; |
1421 | 1421 | ||
1422 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 1422 | IRDA_DEBUG(1, "%s()\n", __func__); |
1423 | 1423 | ||
1424 | irda_usb_init_qos(self); | 1424 | irda_usb_init_qos(self); |
1425 | 1425 | ||
@@ -1442,7 +1442,7 @@ static inline int irda_usb_open(struct irda_usb_cb *self) | |||
1442 | */ | 1442 | */ |
1443 | static inline void irda_usb_close(struct irda_usb_cb *self) | 1443 | static inline void irda_usb_close(struct irda_usb_cb *self) |
1444 | { | 1444 | { |
1445 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 1445 | IRDA_DEBUG(1, "%s()\n", __func__); |
1446 | 1446 | ||
1447 | /* Remove netdevice */ | 1447 | /* Remove netdevice */ |
1448 | unregister_netdev(self->netdev); | 1448 | unregister_netdev(self->netdev); |
@@ -1515,13 +1515,13 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_ | |||
1515 | /* This is our interrupt endpoint */ | 1515 | /* This is our interrupt endpoint */ |
1516 | self->bulk_int_ep = ep; | 1516 | self->bulk_int_ep = ep; |
1517 | } else { | 1517 | } else { |
1518 | IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __FUNCTION__, ep); | 1518 | IRDA_ERROR("%s(), Unrecognised endpoint %02X.\n", __func__, ep); |
1519 | } | 1519 | } |
1520 | } | 1520 | } |
1521 | } | 1521 | } |
1522 | 1522 | ||
1523 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", | 1523 | IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", |
1524 | __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); | 1524 | __func__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); |
1525 | 1525 | ||
1526 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); | 1526 | return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); |
1527 | } | 1527 | } |
@@ -1583,7 +1583,7 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf | |||
1583 | 0, intf->altsetting->desc.bInterfaceNumber, desc, | 1583 | 0, intf->altsetting->desc.bInterfaceNumber, desc, |
1584 | sizeof(*desc), 500); | 1584 | sizeof(*desc), 500); |
1585 | 1585 | ||
1586 | IRDA_DEBUG(1, "%s(), ret=%d\n", __FUNCTION__, ret); | 1586 | IRDA_DEBUG(1, "%s(), ret=%d\n", __func__, ret); |
1587 | if (ret < sizeof(*desc)) { | 1587 | if (ret < sizeof(*desc)) { |
1588 | IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n", | 1588 | IRDA_WARNING("usb-irda: class_descriptor read %s (%d)\n", |
1589 | (ret<0) ? "failed" : "too short", ret); | 1589 | (ret<0) ? "failed" : "too short", ret); |
@@ -1696,10 +1696,10 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1696 | /* Martin Diehl says if we get a -EPIPE we should | 1696 | /* Martin Diehl says if we get a -EPIPE we should |
1697 | * be fine and we don't need to do a usb_clear_halt(). | 1697 | * be fine and we don't need to do a usb_clear_halt(). |
1698 | * - Jean II */ | 1698 | * - Jean II */ |
1699 | IRDA_DEBUG(0, "%s(), Received -EPIPE, ignoring...\n", __FUNCTION__); | 1699 | IRDA_DEBUG(0, "%s(), Received -EPIPE, ignoring...\n", __func__); |
1700 | break; | 1700 | break; |
1701 | default: | 1701 | default: |
1702 | IRDA_DEBUG(0, "%s(), Unknown error %d\n", __FUNCTION__, ret); | 1702 | IRDA_DEBUG(0, "%s(), Unknown error %d\n", __func__, ret); |
1703 | ret = -EIO; | 1703 | ret = -EIO; |
1704 | goto err_out_3; | 1704 | goto err_out_3; |
1705 | } | 1705 | } |
@@ -1708,7 +1708,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1708 | interface = intf->cur_altsetting; | 1708 | interface = intf->cur_altsetting; |
1709 | if(!irda_usb_parse_endpoints(self, interface->endpoint, | 1709 | if(!irda_usb_parse_endpoints(self, interface->endpoint, |
1710 | interface->desc.bNumEndpoints)) { | 1710 | interface->desc.bNumEndpoints)) { |
1711 | IRDA_ERROR("%s(), Bogus endpoints...\n", __FUNCTION__); | 1711 | IRDA_ERROR("%s(), Bogus endpoints...\n", __func__); |
1712 | ret = -EIO; | 1712 | ret = -EIO; |
1713 | goto err_out_3; | 1713 | goto err_out_3; |
1714 | } | 1714 | } |
@@ -1815,7 +1815,7 @@ static void irda_usb_disconnect(struct usb_interface *intf) | |||
1815 | struct irda_usb_cb *self = usb_get_intfdata(intf); | 1815 | struct irda_usb_cb *self = usb_get_intfdata(intf); |
1816 | int i; | 1816 | int i; |
1817 | 1817 | ||
1818 | IRDA_DEBUG(1, "%s()\n", __FUNCTION__); | 1818 | IRDA_DEBUG(1, "%s()\n", __func__); |
1819 | 1819 | ||
1820 | usb_set_intfdata(intf, NULL); | 1820 | usb_set_intfdata(intf, NULL); |
1821 | if (!self) | 1821 | if (!self) |
@@ -1865,7 +1865,7 @@ static void irda_usb_disconnect(struct usb_interface *intf) | |||
1865 | 1865 | ||
1866 | /* Free self and network device */ | 1866 | /* Free self and network device */ |
1867 | free_netdev(self->netdev); | 1867 | free_netdev(self->netdev); |
1868 | IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __FUNCTION__); | 1868 | IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __func__); |
1869 | } | 1869 | } |
1870 | 1870 | ||
1871 | /*------------------------------------------------------------------*/ | 1871 | /*------------------------------------------------------------------*/ |
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 9e33196f9459..6bcee01c684c 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
@@ -231,7 +231,7 @@ static void irtty_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
231 | 231 | ||
232 | dev = priv->dev; | 232 | dev = priv->dev; |
233 | if (!dev) { | 233 | if (!dev) { |
234 | IRDA_WARNING("%s(), not ready yet!\n", __FUNCTION__); | 234 | IRDA_WARNING("%s(), not ready yet!\n", __func__); |
235 | return; | 235 | return; |
236 | } | 236 | } |
237 | 237 | ||
@@ -388,7 +388,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c | |||
388 | IRDA_ASSERT(priv != NULL, return -ENODEV;); | 388 | IRDA_ASSERT(priv != NULL, return -ENODEV;); |
389 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EBADR;); | 389 | IRDA_ASSERT(priv->magic == IRTTY_MAGIC, return -EBADR;); |
390 | 390 | ||
391 | IRDA_DEBUG(3, "%s(cmd=0x%X)\n", __FUNCTION__, cmd); | 391 | IRDA_DEBUG(3, "%s(cmd=0x%X)\n", __func__, cmd); |
392 | 392 | ||
393 | dev = priv->dev; | 393 | dev = priv->dev; |
394 | IRDA_ASSERT(dev != NULL, return -1;); | 394 | IRDA_ASSERT(dev != NULL, return -1;); |
@@ -476,7 +476,7 @@ static int irtty_open(struct tty_struct *tty) | |||
476 | 476 | ||
477 | mutex_unlock(&irtty_mutex); | 477 | mutex_unlock(&irtty_mutex); |
478 | 478 | ||
479 | IRDA_DEBUG(0, "%s - %s: irda line discipline opened\n", __FUNCTION__, tty->name); | 479 | IRDA_DEBUG(0, "%s - %s: irda line discipline opened\n", __func__, tty->name); |
480 | 480 | ||
481 | return 0; | 481 | return 0; |
482 | 482 | ||
@@ -528,7 +528,7 @@ static void irtty_close(struct tty_struct *tty) | |||
528 | 528 | ||
529 | kfree(priv); | 529 | kfree(priv); |
530 | 530 | ||
531 | IRDA_DEBUG(0, "%s - %s: irda line discipline closed\n", __FUNCTION__, tty->name); | 531 | IRDA_DEBUG(0, "%s - %s: irda line discipline closed\n", __func__, tty->name); |
532 | } | 532 | } |
533 | 533 | ||
534 | /* ------------------------------------------------------- */ | 534 | /* ------------------------------------------------------- */ |
@@ -566,7 +566,7 @@ static void __exit irtty_sir_cleanup(void) | |||
566 | 566 | ||
567 | if ((err = tty_unregister_ldisc(N_IRDA))) { | 567 | if ((err = tty_unregister_ldisc(N_IRDA))) { |
568 | IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n", | 568 | IRDA_ERROR("%s(), can't unregister line discipline (err = %d)\n", |
569 | __FUNCTION__, err); | 569 | __func__, err); |
570 | } | 570 | } |
571 | } | 571 | } |
572 | 572 | ||
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index 648e54b3f00e..73fe83be34fe 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -243,7 +243,7 @@ static void kingsun_rcv_irq(struct urb *urb) | |||
243 | } | 243 | } |
244 | } else if (urb->actual_length > 0) { | 244 | } else if (urb->actual_length > 0) { |
245 | err("%s(): Unexpected response length, expected %d got %d", | 245 | err("%s(): Unexpected response length, expected %d got %d", |
246 | __FUNCTION__, kingsun->max_rx, urb->actual_length); | 246 | __func__, kingsun->max_rx, urb->actual_length); |
247 | } | 247 | } |
248 | /* This urb has already been filled in kingsun_net_open */ | 248 | /* This urb has already been filled in kingsun_net_open */ |
249 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 249 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
diff --git a/drivers/net/irda/litelink-sir.c b/drivers/net/irda/litelink-sir.c index 73261c54bbfd..d6d9d2e5ad49 100644 --- a/drivers/net/irda/litelink-sir.c +++ b/drivers/net/irda/litelink-sir.c | |||
@@ -78,7 +78,7 @@ static int litelink_open(struct sir_dev *dev) | |||
78 | { | 78 | { |
79 | struct qos_info *qos = &dev->qos; | 79 | struct qos_info *qos = &dev->qos; |
80 | 80 | ||
81 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 81 | IRDA_DEBUG(2, "%s()\n", __func__); |
82 | 82 | ||
83 | /* Power up dongle */ | 83 | /* Power up dongle */ |
84 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 84 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
@@ -95,7 +95,7 @@ static int litelink_open(struct sir_dev *dev) | |||
95 | 95 | ||
96 | static int litelink_close(struct sir_dev *dev) | 96 | static int litelink_close(struct sir_dev *dev) |
97 | { | 97 | { |
98 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 98 | IRDA_DEBUG(2, "%s()\n", __func__); |
99 | 99 | ||
100 | /* Power off dongle */ | 100 | /* Power off dongle */ |
101 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 101 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -113,7 +113,7 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed) | |||
113 | { | 113 | { |
114 | int i; | 114 | int i; |
115 | 115 | ||
116 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 116 | IRDA_DEBUG(2, "%s()\n", __func__); |
117 | 117 | ||
118 | /* dongle already reset by irda-thread - current speed (dongle and | 118 | /* dongle already reset by irda-thread - current speed (dongle and |
119 | * port) is the default speed (115200 for litelink!) | 119 | * port) is the default speed (115200 for litelink!) |
@@ -156,7 +156,7 @@ static int litelink_change_speed(struct sir_dev *dev, unsigned speed) | |||
156 | */ | 156 | */ |
157 | static int litelink_reset(struct sir_dev *dev) | 157 | static int litelink_reset(struct sir_dev *dev) |
158 | { | 158 | { |
159 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 159 | IRDA_DEBUG(2, "%s()\n", __func__); |
160 | 160 | ||
161 | /* probably the power-up can be dropped here, but with only | 161 | /* probably the power-up can be dropped here, but with only |
162 | * 15 usec delay it's not worth the risk unless somebody with | 162 | * 15 usec delay it's not worth the risk unless somebody with |
diff --git a/drivers/net/irda/ma600-sir.c b/drivers/net/irda/ma600-sir.c index 809906d94762..1ceed9cfb7c4 100644 --- a/drivers/net/irda/ma600-sir.c +++ b/drivers/net/irda/ma600-sir.c | |||
@@ -67,13 +67,13 @@ static struct dongle_driver ma600 = { | |||
67 | 67 | ||
68 | static int __init ma600_sir_init(void) | 68 | static int __init ma600_sir_init(void) |
69 | { | 69 | { |
70 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 70 | IRDA_DEBUG(2, "%s()\n", __func__); |
71 | return irda_register_dongle(&ma600); | 71 | return irda_register_dongle(&ma600); |
72 | } | 72 | } |
73 | 73 | ||
74 | static void __exit ma600_sir_cleanup(void) | 74 | static void __exit ma600_sir_cleanup(void) |
75 | { | 75 | { |
76 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 76 | IRDA_DEBUG(2, "%s()\n", __func__); |
77 | irda_unregister_dongle(&ma600); | 77 | irda_unregister_dongle(&ma600); |
78 | } | 78 | } |
79 | 79 | ||
@@ -88,7 +88,7 @@ static int ma600_open(struct sir_dev *dev) | |||
88 | { | 88 | { |
89 | struct qos_info *qos = &dev->qos; | 89 | struct qos_info *qos = &dev->qos; |
90 | 90 | ||
91 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 91 | IRDA_DEBUG(2, "%s()\n", __func__); |
92 | 92 | ||
93 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 93 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
94 | 94 | ||
@@ -106,7 +106,7 @@ static int ma600_open(struct sir_dev *dev) | |||
106 | 106 | ||
107 | static int ma600_close(struct sir_dev *dev) | 107 | static int ma600_close(struct sir_dev *dev) |
108 | { | 108 | { |
109 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 109 | IRDA_DEBUG(2, "%s()\n", __func__); |
110 | 110 | ||
111 | /* Power off dongle */ | 111 | /* Power off dongle */ |
112 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 112 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -176,7 +176,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) | |||
176 | { | 176 | { |
177 | u8 byte; | 177 | u8 byte; |
178 | 178 | ||
179 | IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __FUNCTION__, | 179 | IRDA_DEBUG(2, "%s(), speed=%d (was %d)\n", __func__, |
180 | speed, dev->speed); | 180 | speed, dev->speed); |
181 | 181 | ||
182 | /* dongle already reset, dongle and port at default speed (9600) */ | 182 | /* dongle already reset, dongle and port at default speed (9600) */ |
@@ -201,12 +201,12 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) | |||
201 | sirdev_raw_read(dev, &byte, sizeof(byte)); | 201 | sirdev_raw_read(dev, &byte, sizeof(byte)); |
202 | if (byte != get_control_byte(speed)) { | 202 | if (byte != get_control_byte(speed)) { |
203 | IRDA_WARNING("%s(): bad control byte read-back %02x != %02x\n", | 203 | IRDA_WARNING("%s(): bad control byte read-back %02x != %02x\n", |
204 | __FUNCTION__, (unsigned) byte, | 204 | __func__, (unsigned) byte, |
205 | (unsigned) get_control_byte(speed)); | 205 | (unsigned) get_control_byte(speed)); |
206 | return -1; | 206 | return -1; |
207 | } | 207 | } |
208 | else | 208 | else |
209 | IRDA_DEBUG(2, "%s() control byte write read OK\n", __FUNCTION__); | 209 | IRDA_DEBUG(2, "%s() control byte write read OK\n", __func__); |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | /* Set DTR, Set RTS */ | 212 | /* Set DTR, Set RTS */ |
@@ -238,7 +238,7 @@ static int ma600_change_speed(struct sir_dev *dev, unsigned speed) | |||
238 | 238 | ||
239 | int ma600_reset(struct sir_dev *dev) | 239 | int ma600_reset(struct sir_dev *dev) |
240 | { | 240 | { |
241 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 241 | IRDA_DEBUG(2, "%s()\n", __func__); |
242 | 242 | ||
243 | /* Reset the dongle : set DTR low for 10 ms */ | 243 | /* Reset the dongle : set DTR low for 10 ms */ |
244 | sirdev_set_dtr_rts(dev, FALSE, TRUE); | 244 | sirdev_set_dtr_rts(dev, FALSE, TRUE); |
diff --git a/drivers/net/irda/mcp2120-sir.c b/drivers/net/irda/mcp2120-sir.c index 67bd016e4df8..5e2f4859cee7 100644 --- a/drivers/net/irda/mcp2120-sir.c +++ b/drivers/net/irda/mcp2120-sir.c | |||
@@ -63,7 +63,7 @@ static int mcp2120_open(struct sir_dev *dev) | |||
63 | { | 63 | { |
64 | struct qos_info *qos = &dev->qos; | 64 | struct qos_info *qos = &dev->qos; |
65 | 65 | ||
66 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 66 | IRDA_DEBUG(2, "%s()\n", __func__); |
67 | 67 | ||
68 | /* seems no explicit power-on required here and reset switching it on anyway */ | 68 | /* seems no explicit power-on required here and reset switching it on anyway */ |
69 | 69 | ||
@@ -76,7 +76,7 @@ static int mcp2120_open(struct sir_dev *dev) | |||
76 | 76 | ||
77 | static int mcp2120_close(struct sir_dev *dev) | 77 | static int mcp2120_close(struct sir_dev *dev) |
78 | { | 78 | { |
79 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 79 | IRDA_DEBUG(2, "%s()\n", __func__); |
80 | 80 | ||
81 | /* Power off dongle */ | 81 | /* Power off dongle */ |
82 | /* reset and inhibit mcp2120 */ | 82 | /* reset and inhibit mcp2120 */ |
@@ -102,7 +102,7 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed) | |||
102 | u8 control[2]; | 102 | u8 control[2]; |
103 | static int ret = 0; | 103 | static int ret = 0; |
104 | 104 | ||
105 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 105 | IRDA_DEBUG(2, "%s()\n", __func__); |
106 | 106 | ||
107 | switch (state) { | 107 | switch (state) { |
108 | case SIRDEV_STATE_DONGLE_SPEED: | 108 | case SIRDEV_STATE_DONGLE_SPEED: |
@@ -155,7 +155,7 @@ static int mcp2120_change_speed(struct sir_dev *dev, unsigned speed) | |||
155 | break; | 155 | break; |
156 | 156 | ||
157 | default: | 157 | default: |
158 | IRDA_ERROR("%s(), undefine state %d\n", __FUNCTION__, state); | 158 | IRDA_ERROR("%s(), undefine state %d\n", __func__, state); |
159 | ret = -EINVAL; | 159 | ret = -EINVAL; |
160 | break; | 160 | break; |
161 | } | 161 | } |
@@ -187,7 +187,7 @@ static int mcp2120_reset(struct sir_dev *dev) | |||
187 | unsigned delay = 0; | 187 | unsigned delay = 0; |
188 | int ret = 0; | 188 | int ret = 0; |
189 | 189 | ||
190 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 190 | IRDA_DEBUG(2, "%s()\n", __func__); |
191 | 191 | ||
192 | switch (state) { | 192 | switch (state) { |
193 | case SIRDEV_STATE_DONGLE_RESET: | 193 | case SIRDEV_STATE_DONGLE_RESET: |
@@ -213,7 +213,7 @@ static int mcp2120_reset(struct sir_dev *dev) | |||
213 | break; | 213 | break; |
214 | 214 | ||
215 | default: | 215 | default: |
216 | IRDA_ERROR("%s(), undefined state %d\n", __FUNCTION__, state); | 216 | IRDA_ERROR("%s(), undefined state %d\n", __func__, state); |
217 | ret = -EINVAL; | 217 | ret = -EINVAL; |
218 | break; | 218 | break; |
219 | } | 219 | } |
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index effc1ce8179a..8583d951a6ad 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -151,8 +151,8 @@ static char *dongle_types[] = { | |||
151 | static chipio_t pnp_info; | 151 | static chipio_t pnp_info; |
152 | static const struct pnp_device_id nsc_ircc_pnp_table[] = { | 152 | static const struct pnp_device_id nsc_ircc_pnp_table[] = { |
153 | { .id = "NSC6001", .driver_data = 0 }, | 153 | { .id = "NSC6001", .driver_data = 0 }, |
154 | { .id = "IBM0071", .driver_data = 0 }, | ||
155 | { .id = "HWPC224", .driver_data = 0 }, | 154 | { .id = "HWPC224", .driver_data = 0 }, |
155 | { .id = "IBM0071", .driver_data = NSC_FORCE_DONGLE_TYPE9 }, | ||
156 | { } | 156 | { } |
157 | }; | 157 | }; |
158 | 158 | ||
@@ -223,7 +223,7 @@ static int __init nsc_ircc_init(void) | |||
223 | 223 | ||
224 | /* Probe for all the NSC chipsets we know about */ | 224 | /* Probe for all the NSC chipsets we know about */ |
225 | for (chip = chips; chip->name ; chip++) { | 225 | for (chip = chips; chip->name ; chip++) { |
226 | IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __FUNCTION__, | 226 | IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __func__, |
227 | chip->name); | 227 | chip->name); |
228 | 228 | ||
229 | /* Try all config registers for this chip */ | 229 | /* Try all config registers for this chip */ |
@@ -235,7 +235,7 @@ static int __init nsc_ircc_init(void) | |||
235 | /* Read index register */ | 235 | /* Read index register */ |
236 | reg = inb(cfg_base); | 236 | reg = inb(cfg_base); |
237 | if (reg == 0xff) { | 237 | if (reg == 0xff) { |
238 | IRDA_DEBUG(2, "%s() no chip at 0x%03x\n", __FUNCTION__, cfg_base); | 238 | IRDA_DEBUG(2, "%s() no chip at 0x%03x\n", __func__, cfg_base); |
239 | continue; | 239 | continue; |
240 | } | 240 | } |
241 | 241 | ||
@@ -244,7 +244,7 @@ static int __init nsc_ircc_init(void) | |||
244 | id = inb(cfg_base+1); | 244 | id = inb(cfg_base+1); |
245 | if ((id & chip->cid_mask) == chip->cid_value) { | 245 | if ((id & chip->cid_mask) == chip->cid_value) { |
246 | IRDA_DEBUG(2, "%s() Found %s chip, revision=%d\n", | 246 | IRDA_DEBUG(2, "%s() Found %s chip, revision=%d\n", |
247 | __FUNCTION__, chip->name, id & ~chip->cid_mask); | 247 | __func__, chip->name, id & ~chip->cid_mask); |
248 | 248 | ||
249 | /* | 249 | /* |
250 | * If we found a correct PnP setting, | 250 | * If we found a correct PnP setting, |
@@ -295,7 +295,7 @@ static int __init nsc_ircc_init(void) | |||
295 | } | 295 | } |
296 | i++; | 296 | i++; |
297 | } else { | 297 | } else { |
298 | IRDA_DEBUG(2, "%s(), Wrong chip id=0x%02x\n", __FUNCTION__, id); | 298 | IRDA_DEBUG(2, "%s(), Wrong chip id=0x%02x\n", __func__, id); |
299 | } | 299 | } |
300 | } | 300 | } |
301 | } | 301 | } |
@@ -345,7 +345,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
345 | void *ret; | 345 | void *ret; |
346 | int err, chip_index; | 346 | int err, chip_index; |
347 | 347 | ||
348 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 348 | IRDA_DEBUG(2, "%s()\n", __func__); |
349 | 349 | ||
350 | 350 | ||
351 | for (chip_index = 0; chip_index < ARRAY_SIZE(dev_self); chip_index++) { | 351 | for (chip_index = 0; chip_index < ARRAY_SIZE(dev_self); chip_index++) { |
@@ -354,7 +354,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
354 | } | 354 | } |
355 | 355 | ||
356 | if (chip_index == ARRAY_SIZE(dev_self)) { | 356 | if (chip_index == ARRAY_SIZE(dev_self)) { |
357 | IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __FUNCTION__); | 357 | IRDA_ERROR("%s(), maximum number of supported chips reached!\n", __func__); |
358 | return -ENOMEM; | 358 | return -ENOMEM; |
359 | } | 359 | } |
360 | 360 | ||
@@ -369,7 +369,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
369 | dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); | 369 | dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); |
370 | if (dev == NULL) { | 370 | if (dev == NULL) { |
371 | IRDA_ERROR("%s(), can't allocate memory for " | 371 | IRDA_ERROR("%s(), can't allocate memory for " |
372 | "control block!\n", __FUNCTION__); | 372 | "control block!\n", __func__); |
373 | return -ENOMEM; | 373 | return -ENOMEM; |
374 | } | 374 | } |
375 | 375 | ||
@@ -393,7 +393,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
393 | ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); | 393 | ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); |
394 | if (!ret) { | 394 | if (!ret) { |
395 | IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", | 395 | IRDA_WARNING("%s(), can't get iobase of 0x%03x\n", |
396 | __FUNCTION__, self->io.fir_base); | 396 | __func__, self->io.fir_base); |
397 | err = -ENODEV; | 397 | err = -ENODEV; |
398 | goto out1; | 398 | goto out1; |
399 | } | 399 | } |
@@ -450,7 +450,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
450 | 450 | ||
451 | err = register_netdev(dev); | 451 | err = register_netdev(dev); |
452 | if (err) { | 452 | if (err) { |
453 | IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); | 453 | IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); |
454 | goto out4; | 454 | goto out4; |
455 | } | 455 | } |
456 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 456 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); |
@@ -506,7 +506,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self) | |||
506 | { | 506 | { |
507 | int iobase; | 507 | int iobase; |
508 | 508 | ||
509 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 509 | IRDA_DEBUG(4, "%s()\n", __func__); |
510 | 510 | ||
511 | IRDA_ASSERT(self != NULL, return -1;); | 511 | IRDA_ASSERT(self != NULL, return -1;); |
512 | 512 | ||
@@ -519,7 +519,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self) | |||
519 | 519 | ||
520 | /* Release the PORT that this driver is using */ | 520 | /* Release the PORT that this driver is using */ |
521 | IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", | 521 | IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", |
522 | __FUNCTION__, self->io.fir_base); | 522 | __func__, self->io.fir_base); |
523 | release_region(self->io.fir_base, self->io.fir_ext); | 523 | release_region(self->io.fir_base, self->io.fir_ext); |
524 | 524 | ||
525 | if (self->tx_buff.head) | 525 | if (self->tx_buff.head) |
@@ -557,7 +557,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) | |||
557 | case 0x2e8: outb(0x15, cfg_base+1); break; | 557 | case 0x2e8: outb(0x15, cfg_base+1); break; |
558 | case 0x3f8: outb(0x16, cfg_base+1); break; | 558 | case 0x3f8: outb(0x16, cfg_base+1); break; |
559 | case 0x2f8: outb(0x17, cfg_base+1); break; | 559 | case 0x2f8: outb(0x17, cfg_base+1); break; |
560 | default: IRDA_ERROR("%s(), invalid base_address", __FUNCTION__); | 560 | default: IRDA_ERROR("%s(), invalid base_address", __func__); |
561 | } | 561 | } |
562 | 562 | ||
563 | /* Control Signal Routing Register (CSRT) */ | 563 | /* Control Signal Routing Register (CSRT) */ |
@@ -569,7 +569,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) | |||
569 | case 9: temp = 0x05; break; | 569 | case 9: temp = 0x05; break; |
570 | case 11: temp = 0x06; break; | 570 | case 11: temp = 0x06; break; |
571 | case 15: temp = 0x07; break; | 571 | case 15: temp = 0x07; break; |
572 | default: IRDA_ERROR("%s(), invalid irq", __FUNCTION__); | 572 | default: IRDA_ERROR("%s(), invalid irq", __func__); |
573 | } | 573 | } |
574 | outb(CFG_108_CSRT, cfg_base); | 574 | outb(CFG_108_CSRT, cfg_base); |
575 | 575 | ||
@@ -577,7 +577,7 @@ static int nsc_ircc_init_108(nsc_chip_t *chip, chipio_t *info) | |||
577 | case 0: outb(0x08+temp, cfg_base+1); break; | 577 | case 0: outb(0x08+temp, cfg_base+1); break; |
578 | case 1: outb(0x10+temp, cfg_base+1); break; | 578 | case 1: outb(0x10+temp, cfg_base+1); break; |
579 | case 3: outb(0x18+temp, cfg_base+1); break; | 579 | case 3: outb(0x18+temp, cfg_base+1); break; |
580 | default: IRDA_ERROR("%s(), invalid dma", __FUNCTION__); | 580 | default: IRDA_ERROR("%s(), invalid dma", __func__); |
581 | } | 581 | } |
582 | 582 | ||
583 | outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */ | 583 | outb(CFG_108_MCTL, cfg_base); /* Mode Control Register (MCTL) */ |
@@ -616,7 +616,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info) | |||
616 | break; | 616 | break; |
617 | } | 617 | } |
618 | info->sir_base = info->fir_base; | 618 | info->sir_base = info->fir_base; |
619 | IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __FUNCTION__, | 619 | IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", __func__, |
620 | info->fir_base); | 620 | info->fir_base); |
621 | 621 | ||
622 | /* Read control signals routing register (CSRT) */ | 622 | /* Read control signals routing register (CSRT) */ |
@@ -649,7 +649,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info) | |||
649 | info->irq = 15; | 649 | info->irq = 15; |
650 | break; | 650 | break; |
651 | } | 651 | } |
652 | IRDA_DEBUG(2, "%s(), probing irq=%d\n", __FUNCTION__, info->irq); | 652 | IRDA_DEBUG(2, "%s(), probing irq=%d\n", __func__, info->irq); |
653 | 653 | ||
654 | /* Currently we only read Rx DMA but it will also be used for Tx */ | 654 | /* Currently we only read Rx DMA but it will also be used for Tx */ |
655 | switch ((reg >> 3) & 0x03) { | 655 | switch ((reg >> 3) & 0x03) { |
@@ -666,7 +666,7 @@ static int nsc_ircc_probe_108(nsc_chip_t *chip, chipio_t *info) | |||
666 | info->dma = 3; | 666 | info->dma = 3; |
667 | break; | 667 | break; |
668 | } | 668 | } |
669 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __FUNCTION__, info->dma); | 669 | IRDA_DEBUG(2, "%s(), probing dma=%d\n", __func__, info->dma); |
670 | 670 | ||
671 | /* Read mode control register (MCTL) */ | 671 | /* Read mode control register (MCTL) */ |
672 | outb(CFG_108_MCTL, cfg_base); | 672 | outb(CFG_108_MCTL, cfg_base); |
@@ -823,7 +823,7 @@ static int nsc_ircc_init_39x(nsc_chip_t *chip, chipio_t *info) | |||
823 | /* User is sure about his config... accept it. */ | 823 | /* User is sure about his config... accept it. */ |
824 | IRDA_DEBUG(2, "%s(): nsc_ircc_init_39x (user settings): " | 824 | IRDA_DEBUG(2, "%s(): nsc_ircc_init_39x (user settings): " |
825 | "io=0x%04x, irq=%d, dma=%d\n", | 825 | "io=0x%04x, irq=%d, dma=%d\n", |
826 | __FUNCTION__, info->fir_base, info->irq, info->dma); | 826 | __func__, info->fir_base, info->irq, info->dma); |
827 | 827 | ||
828 | /* Access bank for SP2 */ | 828 | /* Access bank for SP2 */ |
829 | outb(CFG_39X_LDN, cfg_base); | 829 | outb(CFG_39X_LDN, cfg_base); |
@@ -864,7 +864,7 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info) | |||
864 | int enabled, susp; | 864 | int enabled, susp; |
865 | 865 | ||
866 | IRDA_DEBUG(2, "%s(), nsc_ircc_probe_39x, base=%d\n", | 866 | IRDA_DEBUG(2, "%s(), nsc_ircc_probe_39x, base=%d\n", |
867 | __FUNCTION__, cfg_base); | 867 | __func__, cfg_base); |
868 | 868 | ||
869 | /* This function should be executed with irq off to avoid | 869 | /* This function should be executed with irq off to avoid |
870 | * another driver messing with the Super I/O bank - Jean II */ | 870 | * another driver messing with the Super I/O bank - Jean II */ |
@@ -898,7 +898,7 @@ static int nsc_ircc_probe_39x(nsc_chip_t *chip, chipio_t *info) | |||
898 | outb(CFG_39X_SPC, cfg_base); | 898 | outb(CFG_39X_SPC, cfg_base); |
899 | susp = 1 - ((inb(cfg_base+1) & 0x02) >> 1); | 899 | susp = 1 - ((inb(cfg_base+1) & 0x02) >> 1); |
900 | 900 | ||
901 | IRDA_DEBUG(2, "%s(): io=0x%02x%02x, irq=%d (type %d), rxdma=%d, txdma=%d, enabled=%d (suspended=%d)\n", __FUNCTION__, reg1,reg2,irq,irqt,dma1,dma2,enabled,susp); | 901 | IRDA_DEBUG(2, "%s(): io=0x%02x%02x, irq=%d (type %d), rxdma=%d, txdma=%d, enabled=%d (suspended=%d)\n", __func__, reg1,reg2,irq,irqt,dma1,dma2,enabled,susp); |
902 | 902 | ||
903 | /* Configure SP2 */ | 903 | /* Configure SP2 */ |
904 | 904 | ||
@@ -930,7 +930,10 @@ static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *i | |||
930 | pnp_info.dma = -1; | 930 | pnp_info.dma = -1; |
931 | pnp_succeeded = 1; | 931 | pnp_succeeded = 1; |
932 | 932 | ||
933 | /* There don't seem to be any way to get the cfg_base. | 933 | if (id->driver_data & NSC_FORCE_DONGLE_TYPE9) |
934 | dongle_id = 0x9; | ||
935 | |||
936 | /* There doesn't seem to be any way of getting the cfg_base. | ||
934 | * On my box, cfg_base is in the PnP descriptor of the | 937 | * On my box, cfg_base is in the PnP descriptor of the |
935 | * motherboard. Oh well... Jean II */ | 938 | * motherboard. Oh well... Jean II */ |
936 | 939 | ||
@@ -947,7 +950,7 @@ static int nsc_ircc_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *i | |||
947 | pnp_info.dma = pnp_dma(dev, 0); | 950 | pnp_info.dma = pnp_dma(dev, 0); |
948 | 951 | ||
949 | IRDA_DEBUG(0, "%s() : From PnP, found firbase 0x%03X ; irq %d ; dma %d.\n", | 952 | IRDA_DEBUG(0, "%s() : From PnP, found firbase 0x%03X ; irq %d ; dma %d.\n", |
950 | __FUNCTION__, pnp_info.fir_base, pnp_info.irq, pnp_info.dma); | 953 | __func__, pnp_info.fir_base, pnp_info.irq, pnp_info.dma); |
951 | 954 | ||
952 | if((pnp_info.fir_base == 0) || | 955 | if((pnp_info.fir_base == 0) || |
953 | (pnp_info.irq == -1) || (pnp_info.dma == -1)) { | 956 | (pnp_info.irq == -1) || (pnp_info.dma == -1)) { |
@@ -976,7 +979,7 @@ static int nsc_ircc_setup(chipio_t *info) | |||
976 | version = inb(iobase+MID); | 979 | version = inb(iobase+MID); |
977 | 980 | ||
978 | IRDA_DEBUG(2, "%s() Driver %s Found chip version %02x\n", | 981 | IRDA_DEBUG(2, "%s() Driver %s Found chip version %02x\n", |
979 | __FUNCTION__, driver_name, version); | 982 | __func__, driver_name, version); |
980 | 983 | ||
981 | /* Should be 0x2? */ | 984 | /* Should be 0x2? */ |
982 | if (0x20 != (version & 0xf0)) { | 985 | if (0x20 != (version & 0xf0)) { |
@@ -1080,30 +1083,30 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id) | |||
1080 | case 0x00: /* same as */ | 1083 | case 0x00: /* same as */ |
1081 | case 0x01: /* Differential serial interface */ | 1084 | case 0x01: /* Differential serial interface */ |
1082 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1085 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1083 | __FUNCTION__, dongle_types[dongle_id]); | 1086 | __func__, dongle_types[dongle_id]); |
1084 | break; | 1087 | break; |
1085 | case 0x02: /* same as */ | 1088 | case 0x02: /* same as */ |
1086 | case 0x03: /* Reserved */ | 1089 | case 0x03: /* Reserved */ |
1087 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1090 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1088 | __FUNCTION__, dongle_types[dongle_id]); | 1091 | __func__, dongle_types[dongle_id]); |
1089 | break; | 1092 | break; |
1090 | case 0x04: /* Sharp RY5HD01 */ | 1093 | case 0x04: /* Sharp RY5HD01 */ |
1091 | break; | 1094 | break; |
1092 | case 0x05: /* Reserved, but this is what the Thinkpad reports */ | 1095 | case 0x05: /* Reserved, but this is what the Thinkpad reports */ |
1093 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1096 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1094 | __FUNCTION__, dongle_types[dongle_id]); | 1097 | __func__, dongle_types[dongle_id]); |
1095 | break; | 1098 | break; |
1096 | case 0x06: /* Single-ended serial interface */ | 1099 | case 0x06: /* Single-ended serial interface */ |
1097 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1100 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1098 | __FUNCTION__, dongle_types[dongle_id]); | 1101 | __func__, dongle_types[dongle_id]); |
1099 | break; | 1102 | break; |
1100 | case 0x07: /* Consumer-IR only */ | 1103 | case 0x07: /* Consumer-IR only */ |
1101 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", | 1104 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", |
1102 | __FUNCTION__, dongle_types[dongle_id]); | 1105 | __func__, dongle_types[dongle_id]); |
1103 | break; | 1106 | break; |
1104 | case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ | 1107 | case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ |
1105 | IRDA_DEBUG(0, "%s(), %s\n", | 1108 | IRDA_DEBUG(0, "%s(), %s\n", |
1106 | __FUNCTION__, dongle_types[dongle_id]); | 1109 | __func__, dongle_types[dongle_id]); |
1107 | break; | 1110 | break; |
1108 | case 0x09: /* IBM31T1100 or Temic TFDS6000/TFDS6500 */ | 1111 | case 0x09: /* IBM31T1100 or Temic TFDS6000/TFDS6500 */ |
1109 | outb(0x28, iobase+7); /* Set irsl[0-2] as output */ | 1112 | outb(0x28, iobase+7); /* Set irsl[0-2] as output */ |
@@ -1111,7 +1114,7 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id) | |||
1111 | case 0x0A: /* same as */ | 1114 | case 0x0A: /* same as */ |
1112 | case 0x0B: /* Reserved */ | 1115 | case 0x0B: /* Reserved */ |
1113 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1116 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1114 | __FUNCTION__, dongle_types[dongle_id]); | 1117 | __func__, dongle_types[dongle_id]); |
1115 | break; | 1118 | break; |
1116 | case 0x0C: /* same as */ | 1119 | case 0x0C: /* same as */ |
1117 | case 0x0D: /* HP HSDL-1100/HSDL-2100 */ | 1120 | case 0x0D: /* HP HSDL-1100/HSDL-2100 */ |
@@ -1126,14 +1129,14 @@ static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id) | |||
1126 | break; | 1129 | break; |
1127 | case 0x0F: /* No dongle connected */ | 1130 | case 0x0F: /* No dongle connected */ |
1128 | IRDA_DEBUG(0, "%s(), %s\n", | 1131 | IRDA_DEBUG(0, "%s(), %s\n", |
1129 | __FUNCTION__, dongle_types[dongle_id]); | 1132 | __func__, dongle_types[dongle_id]); |
1130 | 1133 | ||
1131 | switch_bank(iobase, BANK0); | 1134 | switch_bank(iobase, BANK0); |
1132 | outb(0x62, iobase+MCR); | 1135 | outb(0x62, iobase+MCR); |
1133 | break; | 1136 | break; |
1134 | default: | 1137 | default: |
1135 | IRDA_DEBUG(0, "%s(), invalid dongle_id %#x", | 1138 | IRDA_DEBUG(0, "%s(), invalid dongle_id %#x", |
1136 | __FUNCTION__, dongle_id); | 1139 | __func__, dongle_id); |
1137 | } | 1140 | } |
1138 | 1141 | ||
1139 | /* IRCFG1: IRSL1 and 2 are set to IrDA mode */ | 1142 | /* IRCFG1: IRSL1 and 2 are set to IrDA mode */ |
@@ -1165,30 +1168,30 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id) | |||
1165 | case 0x00: /* same as */ | 1168 | case 0x00: /* same as */ |
1166 | case 0x01: /* Differential serial interface */ | 1169 | case 0x01: /* Differential serial interface */ |
1167 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1170 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1168 | __FUNCTION__, dongle_types[dongle_id]); | 1171 | __func__, dongle_types[dongle_id]); |
1169 | break; | 1172 | break; |
1170 | case 0x02: /* same as */ | 1173 | case 0x02: /* same as */ |
1171 | case 0x03: /* Reserved */ | 1174 | case 0x03: /* Reserved */ |
1172 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1175 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1173 | __FUNCTION__, dongle_types[dongle_id]); | 1176 | __func__, dongle_types[dongle_id]); |
1174 | break; | 1177 | break; |
1175 | case 0x04: /* Sharp RY5HD01 */ | 1178 | case 0x04: /* Sharp RY5HD01 */ |
1176 | break; | 1179 | break; |
1177 | case 0x05: /* Reserved */ | 1180 | case 0x05: /* Reserved */ |
1178 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1181 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1179 | __FUNCTION__, dongle_types[dongle_id]); | 1182 | __func__, dongle_types[dongle_id]); |
1180 | break; | 1183 | break; |
1181 | case 0x06: /* Single-ended serial interface */ | 1184 | case 0x06: /* Single-ended serial interface */ |
1182 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1185 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1183 | __FUNCTION__, dongle_types[dongle_id]); | 1186 | __func__, dongle_types[dongle_id]); |
1184 | break; | 1187 | break; |
1185 | case 0x07: /* Consumer-IR only */ | 1188 | case 0x07: /* Consumer-IR only */ |
1186 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", | 1189 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", |
1187 | __FUNCTION__, dongle_types[dongle_id]); | 1190 | __func__, dongle_types[dongle_id]); |
1188 | break; | 1191 | break; |
1189 | case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ | 1192 | case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ |
1190 | IRDA_DEBUG(0, "%s(), %s\n", | 1193 | IRDA_DEBUG(0, "%s(), %s\n", |
1191 | __FUNCTION__, dongle_types[dongle_id]); | 1194 | __func__, dongle_types[dongle_id]); |
1192 | outb(0x00, iobase+4); | 1195 | outb(0x00, iobase+4); |
1193 | if (speed > 115200) | 1196 | if (speed > 115200) |
1194 | outb(0x01, iobase+4); | 1197 | outb(0x01, iobase+4); |
@@ -1207,7 +1210,7 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id) | |||
1207 | case 0x0A: /* same as */ | 1210 | case 0x0A: /* same as */ |
1208 | case 0x0B: /* Reserved */ | 1211 | case 0x0B: /* Reserved */ |
1209 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", | 1212 | IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", |
1210 | __FUNCTION__, dongle_types[dongle_id]); | 1213 | __func__, dongle_types[dongle_id]); |
1211 | break; | 1214 | break; |
1212 | case 0x0C: /* same as */ | 1215 | case 0x0C: /* same as */ |
1213 | case 0x0D: /* HP HSDL-1100/HSDL-2100 */ | 1216 | case 0x0D: /* HP HSDL-1100/HSDL-2100 */ |
@@ -1216,13 +1219,13 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id) | |||
1216 | break; | 1219 | break; |
1217 | case 0x0F: /* No dongle connected */ | 1220 | case 0x0F: /* No dongle connected */ |
1218 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", | 1221 | IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", |
1219 | __FUNCTION__, dongle_types[dongle_id]); | 1222 | __func__, dongle_types[dongle_id]); |
1220 | 1223 | ||
1221 | switch_bank(iobase, BANK0); | 1224 | switch_bank(iobase, BANK0); |
1222 | outb(0x62, iobase+MCR); | 1225 | outb(0x62, iobase+MCR); |
1223 | break; | 1226 | break; |
1224 | default: | 1227 | default: |
1225 | IRDA_DEBUG(0, "%s(), invalid data_rate\n", __FUNCTION__); | 1228 | IRDA_DEBUG(0, "%s(), invalid data_rate\n", __func__); |
1226 | } | 1229 | } |
1227 | /* Restore bank register */ | 1230 | /* Restore bank register */ |
1228 | outb(bank, iobase+BSR); | 1231 | outb(bank, iobase+BSR); |
@@ -1243,7 +1246,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) | |||
1243 | __u8 bank; | 1246 | __u8 bank; |
1244 | __u8 ier; /* Interrupt enable register */ | 1247 | __u8 ier; /* Interrupt enable register */ |
1245 | 1248 | ||
1246 | IRDA_DEBUG(2, "%s(), speed=%d\n", __FUNCTION__, speed); | 1249 | IRDA_DEBUG(2, "%s(), speed=%d\n", __func__, speed); |
1247 | 1250 | ||
1248 | IRDA_ASSERT(self != NULL, return 0;); | 1251 | IRDA_ASSERT(self != NULL, return 0;); |
1249 | 1252 | ||
@@ -1276,20 +1279,20 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) | |||
1276 | outb(inb(iobase+4) | 0x04, iobase+4); | 1279 | outb(inb(iobase+4) | 0x04, iobase+4); |
1277 | 1280 | ||
1278 | mcr = MCR_MIR; | 1281 | mcr = MCR_MIR; |
1279 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__); | 1282 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__); |
1280 | break; | 1283 | break; |
1281 | case 1152000: | 1284 | case 1152000: |
1282 | mcr = MCR_MIR; | 1285 | mcr = MCR_MIR; |
1283 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__); | 1286 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __func__); |
1284 | break; | 1287 | break; |
1285 | case 4000000: | 1288 | case 4000000: |
1286 | mcr = MCR_FIR; | 1289 | mcr = MCR_FIR; |
1287 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__); | 1290 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __func__); |
1288 | break; | 1291 | break; |
1289 | default: | 1292 | default: |
1290 | mcr = MCR_FIR; | 1293 | mcr = MCR_FIR; |
1291 | IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", | 1294 | IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", |
1292 | __FUNCTION__, speed); | 1295 | __func__, speed); |
1293 | break; | 1296 | break; |
1294 | } | 1297 | } |
1295 | 1298 | ||
@@ -1594,7 +1597,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
1594 | int actual = 0; | 1597 | int actual = 0; |
1595 | __u8 bank; | 1598 | __u8 bank; |
1596 | 1599 | ||
1597 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 1600 | IRDA_DEBUG(4, "%s()\n", __func__); |
1598 | 1601 | ||
1599 | /* Save current bank */ | 1602 | /* Save current bank */ |
1600 | bank = inb(iobase+BSR); | 1603 | bank = inb(iobase+BSR); |
@@ -1602,7 +1605,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
1602 | switch_bank(iobase, BANK0); | 1605 | switch_bank(iobase, BANK0); |
1603 | if (!(inb_p(iobase+LSR) & LSR_TXEMP)) { | 1606 | if (!(inb_p(iobase+LSR) & LSR_TXEMP)) { |
1604 | IRDA_DEBUG(4, "%s(), warning, FIFO not empty yet!\n", | 1607 | IRDA_DEBUG(4, "%s(), warning, FIFO not empty yet!\n", |
1605 | __FUNCTION__); | 1608 | __func__); |
1606 | 1609 | ||
1607 | /* FIFO may still be filled to the Tx interrupt threshold */ | 1610 | /* FIFO may still be filled to the Tx interrupt threshold */ |
1608 | fifo_size -= 17; | 1611 | fifo_size -= 17; |
@@ -1615,7 +1618,7 @@ static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
1615 | } | 1618 | } |
1616 | 1619 | ||
1617 | IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", | 1620 | IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", |
1618 | __FUNCTION__, fifo_size, actual, len); | 1621 | __func__, fifo_size, actual, len); |
1619 | 1622 | ||
1620 | /* Restore bank */ | 1623 | /* Restore bank */ |
1621 | outb(bank, iobase+BSR); | 1624 | outb(bank, iobase+BSR); |
@@ -1636,7 +1639,7 @@ static int nsc_ircc_dma_xmit_complete(struct nsc_ircc_cb *self) | |||
1636 | __u8 bank; | 1639 | __u8 bank; |
1637 | int ret = TRUE; | 1640 | int ret = TRUE; |
1638 | 1641 | ||
1639 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 1642 | IRDA_DEBUG(2, "%s()\n", __func__); |
1640 | 1643 | ||
1641 | iobase = self->io.fir_base; | 1644 | iobase = self->io.fir_base; |
1642 | 1645 | ||
@@ -1767,7 +1770,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase) | |||
1767 | len = inb(iobase+RFLFL) | ((inb(iobase+RFLFH) & 0x1f) << 8); | 1770 | len = inb(iobase+RFLFL) | ((inb(iobase+RFLFH) & 0x1f) << 8); |
1768 | 1771 | ||
1769 | if (st_fifo->tail >= MAX_RX_WINDOW) { | 1772 | if (st_fifo->tail >= MAX_RX_WINDOW) { |
1770 | IRDA_DEBUG(0, "%s(), window is full!\n", __FUNCTION__); | 1773 | IRDA_DEBUG(0, "%s(), window is full!\n", __func__); |
1771 | continue; | 1774 | continue; |
1772 | } | 1775 | } |
1773 | 1776 | ||
@@ -1859,7 +1862,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase) | |||
1859 | if (skb == NULL) { | 1862 | if (skb == NULL) { |
1860 | IRDA_WARNING("%s(), memory squeeze, " | 1863 | IRDA_WARNING("%s(), memory squeeze, " |
1861 | "dropping frame.\n", | 1864 | "dropping frame.\n", |
1862 | __FUNCTION__); | 1865 | __func__); |
1863 | self->stats.rx_dropped++; | 1866 | self->stats.rx_dropped++; |
1864 | 1867 | ||
1865 | /* Restore bank register */ | 1868 | /* Restore bank register */ |
@@ -1965,7 +1968,7 @@ static void nsc_ircc_sir_interrupt(struct nsc_ircc_cb *self, int eir) | |||
1965 | * Need to be after self->io.direction to avoid race with | 1968 | * Need to be after self->io.direction to avoid race with |
1966 | * nsc_ircc_hard_xmit_sir() - Jean II */ | 1969 | * nsc_ircc_hard_xmit_sir() - Jean II */ |
1967 | if (self->new_speed) { | 1970 | if (self->new_speed) { |
1968 | IRDA_DEBUG(2, "%s(), Changing speed!\n", __FUNCTION__); | 1971 | IRDA_DEBUG(2, "%s(), Changing speed!\n", __func__); |
1969 | self->ier = nsc_ircc_change_speed(self, | 1972 | self->ier = nsc_ircc_change_speed(self, |
1970 | self->new_speed); | 1973 | self->new_speed); |
1971 | self->new_speed = 0; | 1974 | self->new_speed = 0; |
@@ -2051,7 +2054,7 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase, | |||
2051 | } else | 2054 | } else |
2052 | IRDA_WARNING("%s(), potential " | 2055 | IRDA_WARNING("%s(), potential " |
2053 | "Tx queue lockup !\n", | 2056 | "Tx queue lockup !\n", |
2054 | __FUNCTION__); | 2057 | __func__); |
2055 | } | 2058 | } |
2056 | } else { | 2059 | } else { |
2057 | /* Not finished yet, so interrupt on DMA again */ | 2060 | /* Not finished yet, so interrupt on DMA again */ |
@@ -2160,7 +2163,7 @@ static int nsc_ircc_net_open(struct net_device *dev) | |||
2160 | char hwname[32]; | 2163 | char hwname[32]; |
2161 | __u8 bank; | 2164 | __u8 bank; |
2162 | 2165 | ||
2163 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 2166 | IRDA_DEBUG(4, "%s()\n", __func__); |
2164 | 2167 | ||
2165 | IRDA_ASSERT(dev != NULL, return -1;); | 2168 | IRDA_ASSERT(dev != NULL, return -1;); |
2166 | self = (struct nsc_ircc_cb *) dev->priv; | 2169 | self = (struct nsc_ircc_cb *) dev->priv; |
@@ -2222,7 +2225,7 @@ static int nsc_ircc_net_close(struct net_device *dev) | |||
2222 | int iobase; | 2225 | int iobase; |
2223 | __u8 bank; | 2226 | __u8 bank; |
2224 | 2227 | ||
2225 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 2228 | IRDA_DEBUG(4, "%s()\n", __func__); |
2226 | 2229 | ||
2227 | IRDA_ASSERT(dev != NULL, return -1;); | 2230 | IRDA_ASSERT(dev != NULL, return -1;); |
2228 | 2231 | ||
@@ -2276,7 +2279,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2276 | 2279 | ||
2277 | IRDA_ASSERT(self != NULL, return -1;); | 2280 | IRDA_ASSERT(self != NULL, return -1;); |
2278 | 2281 | ||
2279 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); | 2282 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); |
2280 | 2283 | ||
2281 | switch (cmd) { | 2284 | switch (cmd) { |
2282 | case SIOCSBANDWIDTH: /* Set bandwidth */ | 2285 | case SIOCSBANDWIDTH: /* Set bandwidth */ |
diff --git a/drivers/net/irda/nsc-ircc.h b/drivers/net/irda/nsc-ircc.h index 29398a4f73fd..71cd3c5a0762 100644 --- a/drivers/net/irda/nsc-ircc.h +++ b/drivers/net/irda/nsc-ircc.h | |||
@@ -35,6 +35,9 @@ | |||
35 | #include <linux/types.h> | 35 | #include <linux/types.h> |
36 | #include <asm/io.h> | 36 | #include <asm/io.h> |
37 | 37 | ||
38 | /* Features for chips (set in driver_data) */ | ||
39 | #define NSC_FORCE_DONGLE_TYPE9 0x00000001 | ||
40 | |||
38 | /* DMA modes needed */ | 41 | /* DMA modes needed */ |
39 | #define DMA_TX_MODE 0x08 /* Mem to I/O, ++, demand. */ | 42 | #define DMA_TX_MODE 0x08 /* Mem to I/O, ++, demand. */ |
40 | #define DMA_RX_MODE 0x04 /* I/O to mem, ++, demand. */ | 43 | #define DMA_RX_MODE 0x04 /* I/O to mem, ++, demand. */ |
diff --git a/drivers/net/irda/old_belkin-sir.c b/drivers/net/irda/old_belkin-sir.c index 8c22c7374a23..75714bc71030 100644 --- a/drivers/net/irda/old_belkin-sir.c +++ b/drivers/net/irda/old_belkin-sir.c | |||
@@ -92,7 +92,7 @@ static int old_belkin_open(struct sir_dev *dev) | |||
92 | { | 92 | { |
93 | struct qos_info *qos = &dev->qos; | 93 | struct qos_info *qos = &dev->qos; |
94 | 94 | ||
95 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 95 | IRDA_DEBUG(2, "%s()\n", __func__); |
96 | 96 | ||
97 | /* Power on dongle */ | 97 | /* Power on dongle */ |
98 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 98 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
@@ -110,7 +110,7 @@ static int old_belkin_open(struct sir_dev *dev) | |||
110 | 110 | ||
111 | static int old_belkin_close(struct sir_dev *dev) | 111 | static int old_belkin_close(struct sir_dev *dev) |
112 | { | 112 | { |
113 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 113 | IRDA_DEBUG(2, "%s()\n", __func__); |
114 | 114 | ||
115 | /* Power off dongle */ | 115 | /* Power off dongle */ |
116 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 116 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -125,7 +125,7 @@ static int old_belkin_close(struct sir_dev *dev) | |||
125 | */ | 125 | */ |
126 | static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed) | 126 | static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed) |
127 | { | 127 | { |
128 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 128 | IRDA_DEBUG(2, "%s()\n", __func__); |
129 | 129 | ||
130 | dev->speed = 9600; | 130 | dev->speed = 9600; |
131 | return (speed==dev->speed) ? 0 : -EINVAL; | 131 | return (speed==dev->speed) ? 0 : -EINVAL; |
@@ -139,7 +139,7 @@ static int old_belkin_change_speed(struct sir_dev *dev, unsigned speed) | |||
139 | */ | 139 | */ |
140 | static int old_belkin_reset(struct sir_dev *dev) | 140 | static int old_belkin_reset(struct sir_dev *dev) |
141 | { | 141 | { |
142 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 142 | IRDA_DEBUG(2, "%s()\n", __func__); |
143 | 143 | ||
144 | /* This dongles speed "defaults" to 9600 bps ;-) */ | 144 | /* This dongles speed "defaults" to 9600 bps ;-) */ |
145 | dev->speed = 9600; | 145 | dev->speed = 9600; |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index 6078e03de9a8..3f32909c24c8 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -80,7 +80,7 @@ static int sirdev_tx_complete_fsm(struct sir_dev *dev) | |||
80 | return 0; | 80 | return 0; |
81 | 81 | ||
82 | default: | 82 | default: |
83 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | 83 | IRDA_ERROR("%s - undefined state\n", __func__); |
84 | return -EINVAL; | 84 | return -EINVAL; |
85 | } | 85 | } |
86 | fsm->substate = next_state; | 86 | fsm->substate = next_state; |
@@ -107,11 +107,11 @@ static void sirdev_config_fsm(struct work_struct *work) | |||
107 | int ret = -1; | 107 | int ret = -1; |
108 | unsigned delay; | 108 | unsigned delay; |
109 | 109 | ||
110 | IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies); | 110 | IRDA_DEBUG(2, "%s(), <%ld>\n", __func__, jiffies); |
111 | 111 | ||
112 | do { | 112 | do { |
113 | IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n", | 113 | IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n", |
114 | __FUNCTION__, fsm->state, fsm->substate); | 114 | __func__, fsm->state, fsm->substate); |
115 | 115 | ||
116 | next_state = fsm->state; | 116 | next_state = fsm->state; |
117 | delay = 0; | 117 | delay = 0; |
@@ -249,12 +249,12 @@ static void sirdev_config_fsm(struct work_struct *work) | |||
249 | break; | 249 | break; |
250 | 250 | ||
251 | default: | 251 | default: |
252 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | 252 | IRDA_ERROR("%s - undefined state\n", __func__); |
253 | fsm->result = -EINVAL; | 253 | fsm->result = -EINVAL; |
254 | /* fall thru */ | 254 | /* fall thru */ |
255 | 255 | ||
256 | case SIRDEV_STATE_ERROR: | 256 | case SIRDEV_STATE_ERROR: |
257 | IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result); | 257 | IRDA_ERROR("%s - error: %d\n", __func__, fsm->result); |
258 | 258 | ||
259 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ | 259 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ |
260 | netif_stop_queue(dev->netdev); | 260 | netif_stop_queue(dev->netdev); |
@@ -284,11 +284,12 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par | |||
284 | { | 284 | { |
285 | struct sir_fsm *fsm = &dev->fsm; | 285 | struct sir_fsm *fsm = &dev->fsm; |
286 | 286 | ||
287 | IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param); | 287 | IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __func__, |
288 | initial_state, param); | ||
288 | 289 | ||
289 | if (down_trylock(&fsm->sem)) { | 290 | if (down_trylock(&fsm->sem)) { |
290 | if (in_interrupt() || in_atomic() || irqs_disabled()) { | 291 | if (in_interrupt() || in_atomic() || irqs_disabled()) { |
291 | IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__); | 292 | IRDA_DEBUG(1, "%s(), state machine busy!\n", __func__); |
292 | return -EWOULDBLOCK; | 293 | return -EWOULDBLOCK; |
293 | } else | 294 | } else |
294 | down(&fsm->sem); | 295 | down(&fsm->sem); |
@@ -296,7 +297,7 @@ int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned par | |||
296 | 297 | ||
297 | if (fsm->state == SIRDEV_STATE_DEAD) { | 298 | if (fsm->state == SIRDEV_STATE_DEAD) { |
298 | /* race with sirdev_close should never happen */ | 299 | /* race with sirdev_close should never happen */ |
299 | IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__); | 300 | IRDA_ERROR("%s(), instance staled!\n", __func__); |
300 | up(&fsm->sem); | 301 | up(&fsm->sem); |
301 | return -ESTALE; /* or better EPIPE? */ | 302 | return -ESTALE; /* or better EPIPE? */ |
302 | } | 303 | } |
@@ -341,7 +342,7 @@ int sirdev_set_dongle(struct sir_dev *dev, IRDA_DONGLE type) | |||
341 | { | 342 | { |
342 | int err; | 343 | int err; |
343 | 344 | ||
344 | IRDA_DEBUG(3, "%s : requesting dongle %d.\n", __FUNCTION__, type); | 345 | IRDA_DEBUG(3, "%s : requesting dongle %d.\n", __func__, type); |
345 | 346 | ||
346 | err = sirdev_schedule_dongle_open(dev, type); | 347 | err = sirdev_schedule_dongle_open(dev, type); |
347 | if (unlikely(err)) | 348 | if (unlikely(err)) |
@@ -376,7 +377,7 @@ int sirdev_raw_write(struct sir_dev *dev, const char *buf, int len) | |||
376 | 377 | ||
377 | ret = dev->drv->do_write(dev, dev->tx_buff.data, dev->tx_buff.len); | 378 | ret = dev->drv->do_write(dev, dev->tx_buff.data, dev->tx_buff.len); |
378 | if (ret > 0) { | 379 | if (ret > 0) { |
379 | IRDA_DEBUG(3, "%s(), raw-tx started\n", __FUNCTION__); | 380 | IRDA_DEBUG(3, "%s(), raw-tx started\n", __func__); |
380 | 381 | ||
381 | dev->tx_buff.data += ret; | 382 | dev->tx_buff.data += ret; |
382 | dev->tx_buff.len -= ret; | 383 | dev->tx_buff.len -= ret; |
@@ -437,7 +438,7 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
437 | spin_lock_irqsave(&dev->tx_lock, flags); | 438 | spin_lock_irqsave(&dev->tx_lock, flags); |
438 | 439 | ||
439 | IRDA_DEBUG(3, "%s() - dev->tx_buff.len = %d\n", | 440 | IRDA_DEBUG(3, "%s() - dev->tx_buff.len = %d\n", |
440 | __FUNCTION__, dev->tx_buff.len); | 441 | __func__, dev->tx_buff.len); |
441 | 442 | ||
442 | if (likely(dev->tx_buff.len > 0)) { | 443 | if (likely(dev->tx_buff.len > 0)) { |
443 | /* Write data left in transmit buffer */ | 444 | /* Write data left in transmit buffer */ |
@@ -450,7 +451,7 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
450 | else if (unlikely(actual<0)) { | 451 | else if (unlikely(actual<0)) { |
451 | /* could be dropped later when we have tx_timeout to recover */ | 452 | /* could be dropped later when we have tx_timeout to recover */ |
452 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", | 453 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", |
453 | __FUNCTION__, actual); | 454 | __func__, actual); |
454 | if ((skb=dev->tx_skb) != NULL) { | 455 | if ((skb=dev->tx_skb) != NULL) { |
455 | dev->tx_skb = NULL; | 456 | dev->tx_skb = NULL; |
456 | dev_kfree_skb_any(skb); | 457 | dev_kfree_skb_any(skb); |
@@ -471,7 +472,7 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
471 | * restarted when the irda-thread has completed the request. | 472 | * restarted when the irda-thread has completed the request. |
472 | */ | 473 | */ |
473 | 474 | ||
474 | IRDA_DEBUG(3, "%s(), raw-tx done\n", __FUNCTION__); | 475 | IRDA_DEBUG(3, "%s(), raw-tx done\n", __func__); |
475 | dev->raw_tx = 0; | 476 | dev->raw_tx = 0; |
476 | goto done; /* no post-frame handling in raw mode */ | 477 | goto done; /* no post-frame handling in raw mode */ |
477 | } | 478 | } |
@@ -488,7 +489,7 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
488 | * re-activated. | 489 | * re-activated. |
489 | */ | 490 | */ |
490 | 491 | ||
491 | IRDA_DEBUG(5, "%s(), finished with frame!\n", __FUNCTION__); | 492 | IRDA_DEBUG(5, "%s(), finished with frame!\n", __func__); |
492 | 493 | ||
493 | if ((skb=dev->tx_skb) != NULL) { | 494 | if ((skb=dev->tx_skb) != NULL) { |
494 | dev->tx_skb = NULL; | 495 | dev->tx_skb = NULL; |
@@ -498,14 +499,14 @@ void sirdev_write_complete(struct sir_dev *dev) | |||
498 | } | 499 | } |
499 | 500 | ||
500 | if (unlikely(dev->new_speed > 0)) { | 501 | if (unlikely(dev->new_speed > 0)) { |
501 | IRDA_DEBUG(5, "%s(), Changing speed!\n", __FUNCTION__); | 502 | IRDA_DEBUG(5, "%s(), Changing speed!\n", __func__); |
502 | err = sirdev_schedule_speed(dev, dev->new_speed); | 503 | err = sirdev_schedule_speed(dev, dev->new_speed); |
503 | if (unlikely(err)) { | 504 | if (unlikely(err)) { |
504 | /* should never happen | 505 | /* should never happen |
505 | * forget the speed change and hope the stack recovers | 506 | * forget the speed change and hope the stack recovers |
506 | */ | 507 | */ |
507 | IRDA_ERROR("%s - schedule speed change failed: %d\n", | 508 | IRDA_ERROR("%s - schedule speed change failed: %d\n", |
508 | __FUNCTION__, err); | 509 | __func__, err); |
509 | netif_wake_queue(dev->netdev); | 510 | netif_wake_queue(dev->netdev); |
510 | } | 511 | } |
511 | /* else: success | 512 | /* else: success |
@@ -532,13 +533,13 @@ EXPORT_SYMBOL(sirdev_write_complete); | |||
532 | int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) | 533 | int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) |
533 | { | 534 | { |
534 | if (!dev || !dev->netdev) { | 535 | if (!dev || !dev->netdev) { |
535 | IRDA_WARNING("%s(), not ready yet!\n", __FUNCTION__); | 536 | IRDA_WARNING("%s(), not ready yet!\n", __func__); |
536 | return -1; | 537 | return -1; |
537 | } | 538 | } |
538 | 539 | ||
539 | if (!dev->irlap) { | 540 | if (!dev->irlap) { |
540 | IRDA_WARNING("%s - too early: %p / %zd!\n", | 541 | IRDA_WARNING("%s - too early: %p / %zd!\n", |
541 | __FUNCTION__, cp, count); | 542 | __func__, cp, count); |
542 | return -1; | 543 | return -1; |
543 | } | 544 | } |
544 | 545 | ||
@@ -548,7 +549,7 @@ int sirdev_receive(struct sir_dev *dev, const unsigned char *cp, size_t count) | |||
548 | */ | 549 | */ |
549 | irda_device_set_media_busy(dev->netdev, TRUE); | 550 | irda_device_set_media_busy(dev->netdev, TRUE); |
550 | dev->stats.rx_dropped++; | 551 | dev->stats.rx_dropped++; |
551 | IRDA_DEBUG(0, "%s; rx-drop: %zd\n", __FUNCTION__, count); | 552 | IRDA_DEBUG(0, "%s; rx-drop: %zd\n", __func__, count); |
552 | return 0; | 553 | return 0; |
553 | } | 554 | } |
554 | 555 | ||
@@ -600,7 +601,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
600 | 601 | ||
601 | netif_stop_queue(ndev); | 602 | netif_stop_queue(ndev); |
602 | 603 | ||
603 | IRDA_DEBUG(3, "%s(), skb->len = %d\n", __FUNCTION__, skb->len); | 604 | IRDA_DEBUG(3, "%s(), skb->len = %d\n", __func__, skb->len); |
604 | 605 | ||
605 | speed = irda_get_next_speed(skb); | 606 | speed = irda_get_next_speed(skb); |
606 | if ((speed != dev->speed) && (speed != -1)) { | 607 | if ((speed != dev->speed) && (speed != -1)) { |
@@ -637,7 +638,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
637 | 638 | ||
638 | /* Check problems */ | 639 | /* Check problems */ |
639 | if(spin_is_locked(&dev->tx_lock)) { | 640 | if(spin_is_locked(&dev->tx_lock)) { |
640 | IRDA_DEBUG(3, "%s(), write not completed\n", __FUNCTION__); | 641 | IRDA_DEBUG(3, "%s(), write not completed\n", __func__); |
641 | } | 642 | } |
642 | 643 | ||
643 | /* serialize with write completion */ | 644 | /* serialize with write completion */ |
@@ -666,7 +667,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
666 | else if (unlikely(actual < 0)) { | 667 | else if (unlikely(actual < 0)) { |
667 | /* could be dropped later when we have tx_timeout to recover */ | 668 | /* could be dropped later when we have tx_timeout to recover */ |
668 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", | 669 | IRDA_ERROR("%s: drv->do_write failed (%d)\n", |
669 | __FUNCTION__, actual); | 670 | __func__, actual); |
670 | dev_kfree_skb_any(skb); | 671 | dev_kfree_skb_any(skb); |
671 | dev->stats.tx_errors++; | 672 | dev->stats.tx_errors++; |
672 | dev->stats.tx_dropped++; | 673 | dev->stats.tx_dropped++; |
@@ -687,7 +688,7 @@ static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
687 | 688 | ||
688 | IRDA_ASSERT(dev != NULL, return -1;); | 689 | IRDA_ASSERT(dev != NULL, return -1;); |
689 | 690 | ||
690 | IRDA_DEBUG(3, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, ndev->name, cmd); | 691 | IRDA_DEBUG(3, "%s(), %s, (cmd=0x%X)\n", __func__, ndev->name, cmd); |
691 | 692 | ||
692 | switch (cmd) { | 693 | switch (cmd) { |
693 | case SIOCSBANDWIDTH: /* Set bandwidth */ | 694 | case SIOCSBANDWIDTH: /* Set bandwidth */ |
@@ -804,7 +805,7 @@ static int sirdev_open(struct net_device *ndev) | |||
804 | if (!try_module_get(drv->owner)) | 805 | if (!try_module_get(drv->owner)) |
805 | return -ESTALE; | 806 | return -ESTALE; |
806 | 807 | ||
807 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 808 | IRDA_DEBUG(2, "%s()\n", __func__); |
808 | 809 | ||
809 | if (sirdev_alloc_buffers(dev)) | 810 | if (sirdev_alloc_buffers(dev)) |
810 | goto errout_dec; | 811 | goto errout_dec; |
@@ -822,7 +823,7 @@ static int sirdev_open(struct net_device *ndev) | |||
822 | 823 | ||
823 | netif_wake_queue(ndev); | 824 | netif_wake_queue(ndev); |
824 | 825 | ||
825 | IRDA_DEBUG(2, "%s - done, speed = %d\n", __FUNCTION__, dev->speed); | 826 | IRDA_DEBUG(2, "%s - done, speed = %d\n", __func__, dev->speed); |
826 | 827 | ||
827 | return 0; | 828 | return 0; |
828 | 829 | ||
@@ -842,7 +843,7 @@ static int sirdev_close(struct net_device *ndev) | |||
842 | struct sir_dev *dev = ndev->priv; | 843 | struct sir_dev *dev = ndev->priv; |
843 | const struct sir_driver *drv; | 844 | const struct sir_driver *drv; |
844 | 845 | ||
845 | // IRDA_DEBUG(0, "%s\n", __FUNCTION__); | 846 | // IRDA_DEBUG(0, "%s\n", __func__); |
846 | 847 | ||
847 | netif_stop_queue(ndev); | 848 | netif_stop_queue(ndev); |
848 | 849 | ||
@@ -878,7 +879,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
878 | struct net_device *ndev; | 879 | struct net_device *ndev; |
879 | struct sir_dev *dev; | 880 | struct sir_dev *dev; |
880 | 881 | ||
881 | IRDA_DEBUG(0, "%s - %s\n", __FUNCTION__, name); | 882 | IRDA_DEBUG(0, "%s - %s\n", __func__, name); |
882 | 883 | ||
883 | /* instead of adding tests to protect against drv->do_write==NULL | 884 | /* instead of adding tests to protect against drv->do_write==NULL |
884 | * at several places we refuse to create a sir_dev instance for | 885 | * at several places we refuse to create a sir_dev instance for |
@@ -892,7 +893,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
892 | */ | 893 | */ |
893 | ndev = alloc_irdadev(sizeof(*dev)); | 894 | ndev = alloc_irdadev(sizeof(*dev)); |
894 | if (ndev == NULL) { | 895 | if (ndev == NULL) { |
895 | IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __FUNCTION__); | 896 | IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__); |
896 | goto out; | 897 | goto out; |
897 | } | 898 | } |
898 | dev = ndev->priv; | 899 | dev = ndev->priv; |
@@ -921,7 +922,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
921 | ndev->do_ioctl = sirdev_ioctl; | 922 | ndev->do_ioctl = sirdev_ioctl; |
922 | 923 | ||
923 | if (register_netdev(ndev)) { | 924 | if (register_netdev(ndev)) { |
924 | IRDA_ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); | 925 | IRDA_ERROR("%s(), register_netdev() failed!\n", __func__); |
925 | goto out_freenetdev; | 926 | goto out_freenetdev; |
926 | } | 927 | } |
927 | 928 | ||
@@ -938,7 +939,7 @@ int sirdev_put_instance(struct sir_dev *dev) | |||
938 | { | 939 | { |
939 | int err = 0; | 940 | int err = 0; |
940 | 941 | ||
941 | IRDA_DEBUG(0, "%s\n", __FUNCTION__); | 942 | IRDA_DEBUG(0, "%s\n", __func__); |
942 | 943 | ||
943 | atomic_set(&dev->enable_rx, 0); | 944 | atomic_set(&dev->enable_rx, 0); |
944 | 945 | ||
@@ -948,7 +949,7 @@ int sirdev_put_instance(struct sir_dev *dev) | |||
948 | if (dev->dongle_drv) | 949 | if (dev->dongle_drv) |
949 | err = sirdev_schedule_dongle_close(dev); | 950 | err = sirdev_schedule_dongle_close(dev); |
950 | if (err) | 951 | if (err) |
951 | IRDA_ERROR("%s - error %d\n", __FUNCTION__, err); | 952 | IRDA_ERROR("%s - error %d\n", __func__, err); |
952 | 953 | ||
953 | sirdev_close(dev->netdev); | 954 | sirdev_close(dev->netdev); |
954 | 955 | ||
diff --git a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c index 25d5b8a96bdc..36030241f7a9 100644 --- a/drivers/net/irda/sir_dongle.c +++ b/drivers/net/irda/sir_dongle.c | |||
@@ -36,7 +36,7 @@ int irda_register_dongle(struct dongle_driver *new) | |||
36 | struct dongle_driver *drv; | 36 | struct dongle_driver *drv; |
37 | 37 | ||
38 | IRDA_DEBUG(0, "%s : registering dongle \"%s\" (%d).\n", | 38 | IRDA_DEBUG(0, "%s : registering dongle \"%s\" (%d).\n", |
39 | __FUNCTION__, new->driver_name, new->type); | 39 | __func__, new->driver_name, new->type); |
40 | 40 | ||
41 | mutex_lock(&dongle_list_lock); | 41 | mutex_lock(&dongle_list_lock); |
42 | list_for_each(entry, &dongle_list) { | 42 | list_for_each(entry, &dongle_list) { |
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 78dc8e7837f0..b5360fe99d3a 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -460,7 +460,7 @@ static int __init smsc_ircc_init(void) | |||
460 | { | 460 | { |
461 | int ret; | 461 | int ret; |
462 | 462 | ||
463 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 463 | IRDA_DEBUG(1, "%s\n", __func__); |
464 | 464 | ||
465 | ret = platform_driver_register(&smsc_ircc_driver); | 465 | ret = platform_driver_register(&smsc_ircc_driver); |
466 | if (ret) { | 466 | if (ret) { |
@@ -500,7 +500,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u | |||
500 | struct net_device *dev; | 500 | struct net_device *dev; |
501 | int err; | 501 | int err; |
502 | 502 | ||
503 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 503 | IRDA_DEBUG(1, "%s\n", __func__); |
504 | 504 | ||
505 | err = smsc_ircc_present(fir_base, sir_base); | 505 | err = smsc_ircc_present(fir_base, sir_base); |
506 | if (err) | 506 | if (err) |
@@ -508,7 +508,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u | |||
508 | 508 | ||
509 | err = -ENOMEM; | 509 | err = -ENOMEM; |
510 | if (dev_count >= ARRAY_SIZE(dev_self)) { | 510 | if (dev_count >= ARRAY_SIZE(dev_self)) { |
511 | IRDA_WARNING("%s(), too many devices!\n", __FUNCTION__); | 511 | IRDA_WARNING("%s(), too many devices!\n", __func__); |
512 | goto err_out1; | 512 | goto err_out1; |
513 | } | 513 | } |
514 | 514 | ||
@@ -517,7 +517,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u | |||
517 | */ | 517 | */ |
518 | dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); | 518 | dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); |
519 | if (!dev) { | 519 | if (!dev) { |
520 | IRDA_WARNING("%s() can't allocate net device\n", __FUNCTION__); | 520 | IRDA_WARNING("%s() can't allocate net device\n", __func__); |
521 | goto err_out1; | 521 | goto err_out1; |
522 | } | 522 | } |
523 | 523 | ||
@@ -633,14 +633,14 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base) | |||
633 | if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, | 633 | if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, |
634 | driver_name)) { | 634 | driver_name)) { |
635 | IRDA_WARNING("%s: can't get fir_base of 0x%03x\n", | 635 | IRDA_WARNING("%s: can't get fir_base of 0x%03x\n", |
636 | __FUNCTION__, fir_base); | 636 | __func__, fir_base); |
637 | goto out1; | 637 | goto out1; |
638 | } | 638 | } |
639 | 639 | ||
640 | if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, | 640 | if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, |
641 | driver_name)) { | 641 | driver_name)) { |
642 | IRDA_WARNING("%s: can't get sir_base of 0x%03x\n", | 642 | IRDA_WARNING("%s: can't get sir_base of 0x%03x\n", |
643 | __FUNCTION__, sir_base); | 643 | __func__, sir_base); |
644 | goto out2; | 644 | goto out2; |
645 | } | 645 | } |
646 | 646 | ||
@@ -656,7 +656,7 @@ static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base) | |||
656 | 656 | ||
657 | if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { | 657 | if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { |
658 | IRDA_WARNING("%s(), addr 0x%04x - no device found!\n", | 658 | IRDA_WARNING("%s(), addr 0x%04x - no device found!\n", |
659 | __FUNCTION__, fir_base); | 659 | __func__, fir_base); |
660 | goto out3; | 660 | goto out3; |
661 | } | 661 | } |
662 | IRDA_MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " | 662 | IRDA_MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " |
@@ -793,7 +793,7 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd | |||
793 | 793 | ||
794 | IRDA_ASSERT(self != NULL, return -1;); | 794 | IRDA_ASSERT(self != NULL, return -1;); |
795 | 795 | ||
796 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); | 796 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, cmd); |
797 | 797 | ||
798 | switch (cmd) { | 798 | switch (cmd) { |
799 | case SIOCSBANDWIDTH: /* Set bandwidth */ | 799 | case SIOCSBANDWIDTH: /* Set bandwidth */ |
@@ -878,7 +878,7 @@ int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | |||
878 | unsigned long flags; | 878 | unsigned long flags; |
879 | s32 speed; | 879 | s32 speed; |
880 | 880 | ||
881 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 881 | IRDA_DEBUG(1, "%s\n", __func__); |
882 | 882 | ||
883 | IRDA_ASSERT(dev != NULL, return 0;); | 883 | IRDA_ASSERT(dev != NULL, return 0;); |
884 | 884 | ||
@@ -953,21 +953,21 @@ static void smsc_ircc_set_fir_speed(struct smsc_ircc_cb *self, u32 speed) | |||
953 | ir_mode = IRCC_CFGA_IRDA_HDLC; | 953 | ir_mode = IRCC_CFGA_IRDA_HDLC; |
954 | ctrl = IRCC_CRC; | 954 | ctrl = IRCC_CRC; |
955 | fast = 0; | 955 | fast = 0; |
956 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__); | 956 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__); |
957 | break; | 957 | break; |
958 | case 1152000: | 958 | case 1152000: |
959 | ir_mode = IRCC_CFGA_IRDA_HDLC; | 959 | ir_mode = IRCC_CFGA_IRDA_HDLC; |
960 | ctrl = IRCC_1152 | IRCC_CRC; | 960 | ctrl = IRCC_1152 | IRCC_CRC; |
961 | fast = IRCC_LCR_A_FAST | IRCC_LCR_A_GP_DATA; | 961 | fast = IRCC_LCR_A_FAST | IRCC_LCR_A_GP_DATA; |
962 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", | 962 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", |
963 | __FUNCTION__); | 963 | __func__); |
964 | break; | 964 | break; |
965 | case 4000000: | 965 | case 4000000: |
966 | ir_mode = IRCC_CFGA_IRDA_4PPM; | 966 | ir_mode = IRCC_CFGA_IRDA_4PPM; |
967 | ctrl = IRCC_CRC; | 967 | ctrl = IRCC_CRC; |
968 | fast = IRCC_LCR_A_FAST; | 968 | fast = IRCC_LCR_A_FAST; |
969 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", | 969 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", |
970 | __FUNCTION__); | 970 | __func__); |
971 | break; | 971 | break; |
972 | } | 972 | } |
973 | #if 0 | 973 | #if 0 |
@@ -995,7 +995,7 @@ static void smsc_ircc_fir_start(struct smsc_ircc_cb *self) | |||
995 | struct net_device *dev; | 995 | struct net_device *dev; |
996 | int fir_base; | 996 | int fir_base; |
997 | 997 | ||
998 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 998 | IRDA_DEBUG(1, "%s\n", __func__); |
999 | 999 | ||
1000 | IRDA_ASSERT(self != NULL, return;); | 1000 | IRDA_ASSERT(self != NULL, return;); |
1001 | dev = self->netdev; | 1001 | dev = self->netdev; |
@@ -1043,7 +1043,7 @@ static void smsc_ircc_fir_stop(struct smsc_ircc_cb *self) | |||
1043 | { | 1043 | { |
1044 | int fir_base; | 1044 | int fir_base; |
1045 | 1045 | ||
1046 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1046 | IRDA_DEBUG(1, "%s\n", __func__); |
1047 | 1047 | ||
1048 | IRDA_ASSERT(self != NULL, return;); | 1048 | IRDA_ASSERT(self != NULL, return;); |
1049 | 1049 | ||
@@ -1067,7 +1067,7 @@ static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed) | |||
1067 | struct net_device *dev; | 1067 | struct net_device *dev; |
1068 | int last_speed_was_sir; | 1068 | int last_speed_was_sir; |
1069 | 1069 | ||
1070 | IRDA_DEBUG(0, "%s() changing speed to: %d\n", __FUNCTION__, speed); | 1070 | IRDA_DEBUG(0, "%s() changing speed to: %d\n", __func__, speed); |
1071 | 1071 | ||
1072 | IRDA_ASSERT(self != NULL, return;); | 1072 | IRDA_ASSERT(self != NULL, return;); |
1073 | dev = self->netdev; | 1073 | dev = self->netdev; |
@@ -1135,7 +1135,7 @@ void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed) | |||
1135 | int lcr; /* Line control reg */ | 1135 | int lcr; /* Line control reg */ |
1136 | int divisor; | 1136 | int divisor; |
1137 | 1137 | ||
1138 | IRDA_DEBUG(0, "%s(), Setting speed to: %d\n", __FUNCTION__, speed); | 1138 | IRDA_DEBUG(0, "%s(), Setting speed to: %d\n", __func__, speed); |
1139 | 1139 | ||
1140 | IRDA_ASSERT(self != NULL, return;); | 1140 | IRDA_ASSERT(self != NULL, return;); |
1141 | iobase = self->io.sir_base; | 1141 | iobase = self->io.sir_base; |
@@ -1170,7 +1170,7 @@ void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed) | |||
1170 | /* Turn on interrups */ | 1170 | /* Turn on interrups */ |
1171 | outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); | 1171 | outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER); |
1172 | 1172 | ||
1173 | IRDA_DEBUG(2, "%s() speed changed to: %d\n", __FUNCTION__, speed); | 1173 | IRDA_DEBUG(2, "%s() speed changed to: %d\n", __func__, speed); |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | 1176 | ||
@@ -1253,7 +1253,7 @@ static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs) | |||
1253 | int iobase = self->io.fir_base; | 1253 | int iobase = self->io.fir_base; |
1254 | u8 ctrl; | 1254 | u8 ctrl; |
1255 | 1255 | ||
1256 | IRDA_DEBUG(3, "%s\n", __FUNCTION__); | 1256 | IRDA_DEBUG(3, "%s\n", __func__); |
1257 | #if 1 | 1257 | #if 1 |
1258 | /* Disable Rx */ | 1258 | /* Disable Rx */ |
1259 | register_bank(iobase, 0); | 1259 | register_bank(iobase, 0); |
@@ -1307,7 +1307,7 @@ static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self) | |||
1307 | { | 1307 | { |
1308 | int iobase = self->io.fir_base; | 1308 | int iobase = self->io.fir_base; |
1309 | 1309 | ||
1310 | IRDA_DEBUG(3, "%s\n", __FUNCTION__); | 1310 | IRDA_DEBUG(3, "%s\n", __func__); |
1311 | #if 0 | 1311 | #if 0 |
1312 | /* Disable Tx */ | 1312 | /* Disable Tx */ |
1313 | register_bank(iobase, 0); | 1313 | register_bank(iobase, 0); |
@@ -1411,7 +1411,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self) | |||
1411 | 1411 | ||
1412 | register_bank(iobase, 0); | 1412 | register_bank(iobase, 0); |
1413 | 1413 | ||
1414 | IRDA_DEBUG(3, "%s\n", __FUNCTION__); | 1414 | IRDA_DEBUG(3, "%s\n", __func__); |
1415 | #if 0 | 1415 | #if 0 |
1416 | /* Disable Rx */ | 1416 | /* Disable Rx */ |
1417 | register_bank(iobase, 0); | 1417 | register_bank(iobase, 0); |
@@ -1422,7 +1422,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self) | |||
1422 | lsr= inb(iobase + IRCC_LSR); | 1422 | lsr= inb(iobase + IRCC_LSR); |
1423 | msgcnt = inb(iobase + IRCC_LCR_B) & 0x08; | 1423 | msgcnt = inb(iobase + IRCC_LCR_B) & 0x08; |
1424 | 1424 | ||
1425 | IRDA_DEBUG(2, "%s: dma count = %d\n", __FUNCTION__, | 1425 | IRDA_DEBUG(2, "%s: dma count = %d\n", __func__, |
1426 | get_dma_residue(self->io.dma)); | 1426 | get_dma_residue(self->io.dma)); |
1427 | 1427 | ||
1428 | len = self->rx_buff.truesize - get_dma_residue(self->io.dma); | 1428 | len = self->rx_buff.truesize - get_dma_residue(self->io.dma); |
@@ -1445,15 +1445,15 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self) | |||
1445 | len -= self->io.speed < 4000000 ? 2 : 4; | 1445 | len -= self->io.speed < 4000000 ? 2 : 4; |
1446 | 1446 | ||
1447 | if (len < 2 || len > 2050) { | 1447 | if (len < 2 || len > 2050) { |
1448 | IRDA_WARNING("%s(), bogus len=%d\n", __FUNCTION__, len); | 1448 | IRDA_WARNING("%s(), bogus len=%d\n", __func__, len); |
1449 | return; | 1449 | return; |
1450 | } | 1450 | } |
1451 | IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __FUNCTION__, msgcnt, len); | 1451 | IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __func__, msgcnt, len); |
1452 | 1452 | ||
1453 | skb = dev_alloc_skb(len + 1); | 1453 | skb = dev_alloc_skb(len + 1); |
1454 | if (!skb) { | 1454 | if (!skb) { |
1455 | IRDA_WARNING("%s(), memory squeeze, dropping frame.\n", | 1455 | IRDA_WARNING("%s(), memory squeeze, dropping frame.\n", |
1456 | __FUNCTION__); | 1456 | __func__); |
1457 | return; | 1457 | return; |
1458 | } | 1458 | } |
1459 | /* Make sure IP header gets aligned */ | 1459 | /* Make sure IP header gets aligned */ |
@@ -1494,7 +1494,7 @@ static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self) | |||
1494 | 1494 | ||
1495 | /* Make sure we don't stay here to long */ | 1495 | /* Make sure we don't stay here to long */ |
1496 | if (boguscount++ > 32) { | 1496 | if (boguscount++ > 32) { |
1497 | IRDA_DEBUG(2, "%s(), breaking!\n", __FUNCTION__); | 1497 | IRDA_DEBUG(2, "%s(), breaking!\n", __func__); |
1498 | break; | 1498 | break; |
1499 | } | 1499 | } |
1500 | } while (inb(iobase + UART_LSR) & UART_LSR_DR); | 1500 | } while (inb(iobase + UART_LSR) & UART_LSR_DR); |
@@ -1536,7 +1536,7 @@ static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id) | |||
1536 | lcra = inb(iobase + IRCC_LCR_A); | 1536 | lcra = inb(iobase + IRCC_LCR_A); |
1537 | lsr = inb(iobase + IRCC_LSR); | 1537 | lsr = inb(iobase + IRCC_LSR); |
1538 | 1538 | ||
1539 | IRDA_DEBUG(2, "%s(), iir = 0x%02x\n", __FUNCTION__, iir); | 1539 | IRDA_DEBUG(2, "%s(), iir = 0x%02x\n", __func__, iir); |
1540 | 1540 | ||
1541 | if (iir & IRCC_IIR_EOM) { | 1541 | if (iir & IRCC_IIR_EOM) { |
1542 | if (self->io.direction == IO_RECV) | 1542 | if (self->io.direction == IO_RECV) |
@@ -1548,7 +1548,7 @@ static irqreturn_t smsc_ircc_interrupt(int dummy, void *dev_id) | |||
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | if (iir & IRCC_IIR_ACTIVE_FRAME) { | 1550 | if (iir & IRCC_IIR_ACTIVE_FRAME) { |
1551 | /*printk(KERN_WARNING "%s(): Active Frame\n", __FUNCTION__);*/ | 1551 | /*printk(KERN_WARNING "%s(): Active Frame\n", __func__);*/ |
1552 | } | 1552 | } |
1553 | 1553 | ||
1554 | /* Enable interrupts again */ | 1554 | /* Enable interrupts again */ |
@@ -1587,11 +1587,11 @@ static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev) | |||
1587 | lsr = inb(iobase + UART_LSR); | 1587 | lsr = inb(iobase + UART_LSR); |
1588 | 1588 | ||
1589 | IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", | 1589 | IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", |
1590 | __FUNCTION__, iir, lsr, iobase); | 1590 | __func__, iir, lsr, iobase); |
1591 | 1591 | ||
1592 | switch (iir) { | 1592 | switch (iir) { |
1593 | case UART_IIR_RLSI: | 1593 | case UART_IIR_RLSI: |
1594 | IRDA_DEBUG(2, "%s(), RLSI\n", __FUNCTION__); | 1594 | IRDA_DEBUG(2, "%s(), RLSI\n", __func__); |
1595 | break; | 1595 | break; |
1596 | case UART_IIR_RDI: | 1596 | case UART_IIR_RDI: |
1597 | /* Receive interrupt */ | 1597 | /* Receive interrupt */ |
@@ -1604,7 +1604,7 @@ static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev) | |||
1604 | break; | 1604 | break; |
1605 | default: | 1605 | default: |
1606 | IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", | 1606 | IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", |
1607 | __FUNCTION__, iir); | 1607 | __func__, iir); |
1608 | break; | 1608 | break; |
1609 | } | 1609 | } |
1610 | 1610 | ||
@@ -1631,11 +1631,11 @@ static int ircc_is_receiving(struct smsc_ircc_cb *self) | |||
1631 | int status = FALSE; | 1631 | int status = FALSE; |
1632 | /* int iobase; */ | 1632 | /* int iobase; */ |
1633 | 1633 | ||
1634 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1634 | IRDA_DEBUG(1, "%s\n", __func__); |
1635 | 1635 | ||
1636 | IRDA_ASSERT(self != NULL, return FALSE;); | 1636 | IRDA_ASSERT(self != NULL, return FALSE;); |
1637 | 1637 | ||
1638 | IRDA_DEBUG(0, "%s: dma count = %d\n", __FUNCTION__, | 1638 | IRDA_DEBUG(0, "%s: dma count = %d\n", __func__, |
1639 | get_dma_residue(self->io.dma)); | 1639 | get_dma_residue(self->io.dma)); |
1640 | 1640 | ||
1641 | status = (self->rx_buff.state != OUTSIDE_FRAME); | 1641 | status = (self->rx_buff.state != OUTSIDE_FRAME); |
@@ -1652,7 +1652,7 @@ static int smsc_ircc_request_irq(struct smsc_ircc_cb *self) | |||
1652 | self->netdev->name, self->netdev); | 1652 | self->netdev->name, self->netdev); |
1653 | if (error) | 1653 | if (error) |
1654 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d, err=%d\n", | 1654 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d, err=%d\n", |
1655 | __FUNCTION__, self->io.irq, error); | 1655 | __func__, self->io.irq, error); |
1656 | 1656 | ||
1657 | return error; | 1657 | return error; |
1658 | } | 1658 | } |
@@ -1696,21 +1696,21 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1696 | struct smsc_ircc_cb *self; | 1696 | struct smsc_ircc_cb *self; |
1697 | char hwname[16]; | 1697 | char hwname[16]; |
1698 | 1698 | ||
1699 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1699 | IRDA_DEBUG(1, "%s\n", __func__); |
1700 | 1700 | ||
1701 | IRDA_ASSERT(dev != NULL, return -1;); | 1701 | IRDA_ASSERT(dev != NULL, return -1;); |
1702 | self = netdev_priv(dev); | 1702 | self = netdev_priv(dev); |
1703 | IRDA_ASSERT(self != NULL, return 0;); | 1703 | IRDA_ASSERT(self != NULL, return 0;); |
1704 | 1704 | ||
1705 | if (self->io.suspended) { | 1705 | if (self->io.suspended) { |
1706 | IRDA_DEBUG(0, "%s(), device is suspended\n", __FUNCTION__); | 1706 | IRDA_DEBUG(0, "%s(), device is suspended\n", __func__); |
1707 | return -EAGAIN; | 1707 | return -EAGAIN; |
1708 | } | 1708 | } |
1709 | 1709 | ||
1710 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, | 1710 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, |
1711 | (void *) dev)) { | 1711 | (void *) dev)) { |
1712 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n", | 1712 | IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n", |
1713 | __FUNCTION__, self->io.irq); | 1713 | __func__, self->io.irq); |
1714 | return -EAGAIN; | 1714 | return -EAGAIN; |
1715 | } | 1715 | } |
1716 | 1716 | ||
@@ -1734,7 +1734,7 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1734 | smsc_ircc_net_close(dev); | 1734 | smsc_ircc_net_close(dev); |
1735 | 1735 | ||
1736 | IRDA_WARNING("%s(), unable to allocate DMA=%d\n", | 1736 | IRDA_WARNING("%s(), unable to allocate DMA=%d\n", |
1737 | __FUNCTION__, self->io.dma); | 1737 | __func__, self->io.dma); |
1738 | return -EAGAIN; | 1738 | return -EAGAIN; |
1739 | } | 1739 | } |
1740 | 1740 | ||
@@ -1753,7 +1753,7 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
1753 | { | 1753 | { |
1754 | struct smsc_ircc_cb *self; | 1754 | struct smsc_ircc_cb *self; |
1755 | 1755 | ||
1756 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1756 | IRDA_DEBUG(1, "%s\n", __func__); |
1757 | 1757 | ||
1758 | IRDA_ASSERT(dev != NULL, return -1;); | 1758 | IRDA_ASSERT(dev != NULL, return -1;); |
1759 | self = netdev_priv(dev); | 1759 | self = netdev_priv(dev); |
@@ -1836,7 +1836,7 @@ static int smsc_ircc_resume(struct platform_device *dev) | |||
1836 | */ | 1836 | */ |
1837 | static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) | 1837 | static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) |
1838 | { | 1838 | { |
1839 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1839 | IRDA_DEBUG(1, "%s\n", __func__); |
1840 | 1840 | ||
1841 | IRDA_ASSERT(self != NULL, return -1;); | 1841 | IRDA_ASSERT(self != NULL, return -1;); |
1842 | 1842 | ||
@@ -1848,12 +1848,12 @@ static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) | |||
1848 | smsc_ircc_stop_interrupts(self); | 1848 | smsc_ircc_stop_interrupts(self); |
1849 | 1849 | ||
1850 | /* Release the PORTS that this driver is using */ | 1850 | /* Release the PORTS that this driver is using */ |
1851 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__, | 1851 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __func__, |
1852 | self->io.fir_base); | 1852 | self->io.fir_base); |
1853 | 1853 | ||
1854 | release_region(self->io.fir_base, self->io.fir_ext); | 1854 | release_region(self->io.fir_base, self->io.fir_ext); |
1855 | 1855 | ||
1856 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__, | 1856 | IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __func__, |
1857 | self->io.sir_base); | 1857 | self->io.sir_base); |
1858 | 1858 | ||
1859 | release_region(self->io.sir_base, self->io.sir_ext); | 1859 | release_region(self->io.sir_base, self->io.sir_ext); |
@@ -1875,7 +1875,7 @@ static void __exit smsc_ircc_cleanup(void) | |||
1875 | { | 1875 | { |
1876 | int i; | 1876 | int i; |
1877 | 1877 | ||
1878 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1878 | IRDA_DEBUG(1, "%s\n", __func__); |
1879 | 1879 | ||
1880 | for (i = 0; i < 2; i++) { | 1880 | for (i = 0; i < 2; i++) { |
1881 | if (dev_self[i]) | 1881 | if (dev_self[i]) |
@@ -1899,7 +1899,7 @@ void smsc_ircc_sir_start(struct smsc_ircc_cb *self) | |||
1899 | struct net_device *dev; | 1899 | struct net_device *dev; |
1900 | int fir_base, sir_base; | 1900 | int fir_base, sir_base; |
1901 | 1901 | ||
1902 | IRDA_DEBUG(3, "%s\n", __FUNCTION__); | 1902 | IRDA_DEBUG(3, "%s\n", __func__); |
1903 | 1903 | ||
1904 | IRDA_ASSERT(self != NULL, return;); | 1904 | IRDA_ASSERT(self != NULL, return;); |
1905 | dev = self->netdev; | 1905 | dev = self->netdev; |
@@ -1926,7 +1926,7 @@ void smsc_ircc_sir_start(struct smsc_ircc_cb *self) | |||
1926 | /* Turn on interrups */ | 1926 | /* Turn on interrups */ |
1927 | outb(UART_IER_RLSI | UART_IER_RDI |UART_IER_THRI, sir_base + UART_IER); | 1927 | outb(UART_IER_RLSI | UART_IER_RDI |UART_IER_THRI, sir_base + UART_IER); |
1928 | 1928 | ||
1929 | IRDA_DEBUG(3, "%s() - exit\n", __FUNCTION__); | 1929 | IRDA_DEBUG(3, "%s() - exit\n", __func__); |
1930 | 1930 | ||
1931 | outb(0x00, fir_base + IRCC_MASTER); | 1931 | outb(0x00, fir_base + IRCC_MASTER); |
1932 | } | 1932 | } |
@@ -1936,7 +1936,7 @@ void smsc_ircc_sir_stop(struct smsc_ircc_cb *self) | |||
1936 | { | 1936 | { |
1937 | int iobase; | 1937 | int iobase; |
1938 | 1938 | ||
1939 | IRDA_DEBUG(3, "%s\n", __FUNCTION__); | 1939 | IRDA_DEBUG(3, "%s\n", __func__); |
1940 | iobase = self->io.sir_base; | 1940 | iobase = self->io.sir_base; |
1941 | 1941 | ||
1942 | /* Reset UART */ | 1942 | /* Reset UART */ |
@@ -1962,7 +1962,7 @@ static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self) | |||
1962 | 1962 | ||
1963 | IRDA_ASSERT(self != NULL, return;); | 1963 | IRDA_ASSERT(self != NULL, return;); |
1964 | 1964 | ||
1965 | IRDA_DEBUG(4, "%s\n", __FUNCTION__); | 1965 | IRDA_DEBUG(4, "%s\n", __func__); |
1966 | 1966 | ||
1967 | iobase = self->io.sir_base; | 1967 | iobase = self->io.sir_base; |
1968 | 1968 | ||
@@ -1984,7 +1984,7 @@ static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self) | |||
1984 | */ | 1984 | */ |
1985 | if (self->new_speed) { | 1985 | if (self->new_speed) { |
1986 | IRDA_DEBUG(5, "%s(), Changing speed to %d.\n", | 1986 | IRDA_DEBUG(5, "%s(), Changing speed to %d.\n", |
1987 | __FUNCTION__, self->new_speed); | 1987 | __func__, self->new_speed); |
1988 | smsc_ircc_sir_wait_hw_transmitter_finish(self); | 1988 | smsc_ircc_sir_wait_hw_transmitter_finish(self); |
1989 | smsc_ircc_change_speed(self, self->new_speed); | 1989 | smsc_ircc_change_speed(self, self->new_speed); |
1990 | self->new_speed = 0; | 1990 | self->new_speed = 0; |
@@ -2023,7 +2023,7 @@ static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len) | |||
2023 | 2023 | ||
2024 | /* Tx FIFO should be empty! */ | 2024 | /* Tx FIFO should be empty! */ |
2025 | if (!(inb(iobase + UART_LSR) & UART_LSR_THRE)) { | 2025 | if (!(inb(iobase + UART_LSR) & UART_LSR_THRE)) { |
2026 | IRDA_WARNING("%s(), failed, fifo not empty!\n", __FUNCTION__); | 2026 | IRDA_WARNING("%s(), failed, fifo not empty!\n", __func__); |
2027 | return 0; | 2027 | return 0; |
2028 | } | 2028 | } |
2029 | 2029 | ||
@@ -2123,7 +2123,7 @@ static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self) | |||
2123 | udelay(1); | 2123 | udelay(1); |
2124 | 2124 | ||
2125 | if (count == 0) | 2125 | if (count == 0) |
2126 | IRDA_DEBUG(0, "%s(): stuck transmitter\n", __FUNCTION__); | 2126 | IRDA_DEBUG(0, "%s(): stuck transmitter\n", __func__); |
2127 | } | 2127 | } |
2128 | 2128 | ||
2129 | 2129 | ||
@@ -2145,7 +2145,7 @@ static int __init smsc_ircc_look_for_chips(void) | |||
2145 | while (address->cfg_base) { | 2145 | while (address->cfg_base) { |
2146 | cfg_base = address->cfg_base; | 2146 | cfg_base = address->cfg_base; |
2147 | 2147 | ||
2148 | /*printk(KERN_WARNING "%s(): probing: 0x%02x for: 0x%02x\n", __FUNCTION__, cfg_base, address->type);*/ | 2148 | /*printk(KERN_WARNING "%s(): probing: 0x%02x for: 0x%02x\n", __func__, cfg_base, address->type);*/ |
2149 | 2149 | ||
2150 | if (address->type & SMSCSIO_TYPE_FDC) { | 2150 | if (address->type & SMSCSIO_TYPE_FDC) { |
2151 | type = "FDC"; | 2151 | type = "FDC"; |
@@ -2184,7 +2184,7 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor | |||
2184 | u8 mode, dma, irq; | 2184 | u8 mode, dma, irq; |
2185 | int ret = -ENODEV; | 2185 | int ret = -ENODEV; |
2186 | 2186 | ||
2187 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 2187 | IRDA_DEBUG(1, "%s\n", __func__); |
2188 | 2188 | ||
2189 | if (smsc_ircc_probe(cfgbase, SMSCSIOFLAT_DEVICEID_REG, chips, type) == NULL) | 2189 | if (smsc_ircc_probe(cfgbase, SMSCSIOFLAT_DEVICEID_REG, chips, type) == NULL) |
2190 | return ret; | 2190 | return ret; |
@@ -2192,10 +2192,10 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor | |||
2192 | outb(SMSCSIOFLAT_UARTMODE0C_REG, cfgbase); | 2192 | outb(SMSCSIOFLAT_UARTMODE0C_REG, cfgbase); |
2193 | mode = inb(cfgbase + 1); | 2193 | mode = inb(cfgbase + 1); |
2194 | 2194 | ||
2195 | /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __FUNCTION__, mode);*/ | 2195 | /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __func__, mode);*/ |
2196 | 2196 | ||
2197 | if (!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA)) | 2197 | if (!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA)) |
2198 | IRDA_WARNING("%s(): IrDA not enabled\n", __FUNCTION__); | 2198 | IRDA_WARNING("%s(): IrDA not enabled\n", __func__); |
2199 | 2199 | ||
2200 | outb(SMSCSIOFLAT_UART2BASEADDR_REG, cfgbase); | 2200 | outb(SMSCSIOFLAT_UART2BASEADDR_REG, cfgbase); |
2201 | sirbase = inb(cfgbase + 1) << 2; | 2201 | sirbase = inb(cfgbase + 1) << 2; |
@@ -2212,7 +2212,7 @@ static int __init smsc_superio_flat(const struct smsc_chip *chips, unsigned shor | |||
2212 | outb(SMSCSIOFLAT_UARTIRQSELECT_REG, cfgbase); | 2212 | outb(SMSCSIOFLAT_UARTIRQSELECT_REG, cfgbase); |
2213 | irq = inb(cfgbase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; | 2213 | irq = inb(cfgbase + 1) & SMSCSIOFLAT_UART2IRQSELECT_MASK; |
2214 | 2214 | ||
2215 | IRDA_MESSAGE("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", __FUNCTION__, firbase, sirbase, dma, irq, mode); | 2215 | IRDA_MESSAGE("%s(): fir: 0x%02x, sir: 0x%02x, dma: %02d, irq: %d, mode: 0x%02x\n", __func__, firbase, sirbase, dma, irq, mode); |
2216 | 2216 | ||
2217 | if (firbase && smsc_ircc_open(firbase, sirbase, dma, irq) == 0) | 2217 | if (firbase && smsc_ircc_open(firbase, sirbase, dma, irq) == 0) |
2218 | ret = 0; | 2218 | ret = 0; |
@@ -2234,7 +2234,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho | |||
2234 | unsigned short fir_io, sir_io; | 2234 | unsigned short fir_io, sir_io; |
2235 | int ret = -ENODEV; | 2235 | int ret = -ENODEV; |
2236 | 2236 | ||
2237 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 2237 | IRDA_DEBUG(1, "%s\n", __func__); |
2238 | 2238 | ||
2239 | if (smsc_ircc_probe(cfg_base, 0x20, chips, type) == NULL) | 2239 | if (smsc_ircc_probe(cfg_base, 0x20, chips, type) == NULL) |
2240 | return ret; | 2240 | return ret; |
@@ -2268,7 +2268,7 @@ static int __init smsc_superio_paged(const struct smsc_chip *chips, unsigned sho | |||
2268 | 2268 | ||
2269 | static int __init smsc_access(unsigned short cfg_base, unsigned char reg) | 2269 | static int __init smsc_access(unsigned short cfg_base, unsigned char reg) |
2270 | { | 2270 | { |
2271 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 2271 | IRDA_DEBUG(1, "%s\n", __func__); |
2272 | 2272 | ||
2273 | outb(reg, cfg_base); | 2273 | outb(reg, cfg_base); |
2274 | return inb(cfg_base) != reg ? -1 : 0; | 2274 | return inb(cfg_base) != reg ? -1 : 0; |
@@ -2278,7 +2278,7 @@ static const struct smsc_chip * __init smsc_ircc_probe(unsigned short cfg_base, | |||
2278 | { | 2278 | { |
2279 | u8 devid, xdevid, rev; | 2279 | u8 devid, xdevid, rev; |
2280 | 2280 | ||
2281 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 2281 | IRDA_DEBUG(1, "%s\n", __func__); |
2282 | 2282 | ||
2283 | /* Leave configuration */ | 2283 | /* Leave configuration */ |
2284 | 2284 | ||
@@ -2353,7 +2353,7 @@ static int __init smsc_superio_fdc(unsigned short cfg_base) | |||
2353 | 2353 | ||
2354 | if (!request_region(cfg_base, 2, driver_name)) { | 2354 | if (!request_region(cfg_base, 2, driver_name)) { |
2355 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", | 2355 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", |
2356 | __FUNCTION__, cfg_base); | 2356 | __func__, cfg_base); |
2357 | } else { | 2357 | } else { |
2358 | if (!smsc_superio_flat(fdc_chips_flat, cfg_base, "FDC") || | 2358 | if (!smsc_superio_flat(fdc_chips_flat, cfg_base, "FDC") || |
2359 | !smsc_superio_paged(fdc_chips_paged, cfg_base, "FDC")) | 2359 | !smsc_superio_paged(fdc_chips_paged, cfg_base, "FDC")) |
@@ -2371,7 +2371,7 @@ static int __init smsc_superio_lpc(unsigned short cfg_base) | |||
2371 | 2371 | ||
2372 | if (!request_region(cfg_base, 2, driver_name)) { | 2372 | if (!request_region(cfg_base, 2, driver_name)) { |
2373 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", | 2373 | IRDA_WARNING("%s: can't get cfg_base of 0x%03x\n", |
2374 | __FUNCTION__, cfg_base); | 2374 | __func__, cfg_base); |
2375 | } else { | 2375 | } else { |
2376 | if (!smsc_superio_flat(lpc_chips_flat, cfg_base, "LPC") || | 2376 | if (!smsc_superio_flat(lpc_chips_flat, cfg_base, "LPC") || |
2377 | !smsc_superio_paged(lpc_chips_paged, cfg_base, "LPC")) | 2377 | !smsc_superio_paged(lpc_chips_paged, cfg_base, "LPC")) |
@@ -2932,7 +2932,7 @@ static void smsc_ircc_set_transceiver_smsc_ircc_atc(int fir_base, u32 speed) | |||
2932 | /* empty */; | 2932 | /* empty */; |
2933 | 2933 | ||
2934 | if (val) | 2934 | if (val) |
2935 | IRDA_WARNING("%s(): ATC: 0x%02x\n", __FUNCTION__, | 2935 | IRDA_WARNING("%s(): ATC: 0x%02x\n", __func__, |
2936 | inb(fir_base + IRCC_ATC)); | 2936 | inb(fir_base + IRCC_ATC)); |
2937 | } | 2937 | } |
2938 | 2938 | ||
diff --git a/drivers/net/irda/tekram-sir.c b/drivers/net/irda/tekram-sir.c index d1ce5ae6a172..048a15422844 100644 --- a/drivers/net/irda/tekram-sir.c +++ b/drivers/net/irda/tekram-sir.c | |||
@@ -77,7 +77,7 @@ static int tekram_open(struct sir_dev *dev) | |||
77 | { | 77 | { |
78 | struct qos_info *qos = &dev->qos; | 78 | struct qos_info *qos = &dev->qos; |
79 | 79 | ||
80 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 80 | IRDA_DEBUG(2, "%s()\n", __func__); |
81 | 81 | ||
82 | sirdev_set_dtr_rts(dev, TRUE, TRUE); | 82 | sirdev_set_dtr_rts(dev, TRUE, TRUE); |
83 | 83 | ||
@@ -92,7 +92,7 @@ static int tekram_open(struct sir_dev *dev) | |||
92 | 92 | ||
93 | static int tekram_close(struct sir_dev *dev) | 93 | static int tekram_close(struct sir_dev *dev) |
94 | { | 94 | { |
95 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 95 | IRDA_DEBUG(2, "%s()\n", __func__); |
96 | 96 | ||
97 | /* Power off dongle */ | 97 | /* Power off dongle */ |
98 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 98 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -130,7 +130,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed) | |||
130 | u8 byte; | 130 | u8 byte; |
131 | static int ret = 0; | 131 | static int ret = 0; |
132 | 132 | ||
133 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 133 | IRDA_DEBUG(2, "%s()\n", __func__); |
134 | 134 | ||
135 | switch(state) { | 135 | switch(state) { |
136 | case SIRDEV_STATE_DONGLE_SPEED: | 136 | case SIRDEV_STATE_DONGLE_SPEED: |
@@ -179,7 +179,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed) | |||
179 | break; | 179 | break; |
180 | 180 | ||
181 | default: | 181 | default: |
182 | IRDA_ERROR("%s - undefined state %d\n", __FUNCTION__, state); | 182 | IRDA_ERROR("%s - undefined state %d\n", __func__, state); |
183 | ret = -EINVAL; | 183 | ret = -EINVAL; |
184 | break; | 184 | break; |
185 | } | 185 | } |
@@ -204,7 +204,7 @@ static int tekram_change_speed(struct sir_dev *dev, unsigned speed) | |||
204 | 204 | ||
205 | static int tekram_reset(struct sir_dev *dev) | 205 | static int tekram_reset(struct sir_dev *dev) |
206 | { | 206 | { |
207 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 207 | IRDA_DEBUG(2, "%s()\n", __func__); |
208 | 208 | ||
209 | /* Clear DTR, Set RTS */ | 209 | /* Clear DTR, Set RTS */ |
210 | sirdev_set_dtr_rts(dev, FALSE, TRUE); | 210 | sirdev_set_dtr_rts(dev, FALSE, TRUE); |
diff --git a/drivers/net/irda/toim3232-sir.c b/drivers/net/irda/toim3232-sir.c index aa1a9b0ed83e..fcf287b749db 100644 --- a/drivers/net/irda/toim3232-sir.c +++ b/drivers/net/irda/toim3232-sir.c | |||
@@ -181,7 +181,7 @@ static int toim3232_open(struct sir_dev *dev) | |||
181 | { | 181 | { |
182 | struct qos_info *qos = &dev->qos; | 182 | struct qos_info *qos = &dev->qos; |
183 | 183 | ||
184 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 184 | IRDA_DEBUG(2, "%s()\n", __func__); |
185 | 185 | ||
186 | /* Pull the lines high to start with. | 186 | /* Pull the lines high to start with. |
187 | * | 187 | * |
@@ -209,7 +209,7 @@ static int toim3232_open(struct sir_dev *dev) | |||
209 | 209 | ||
210 | static int toim3232_close(struct sir_dev *dev) | 210 | static int toim3232_close(struct sir_dev *dev) |
211 | { | 211 | { |
212 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 212 | IRDA_DEBUG(2, "%s()\n", __func__); |
213 | 213 | ||
214 | /* Power off dongle */ | 214 | /* Power off dongle */ |
215 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 215 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
@@ -241,7 +241,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed) | |||
241 | u8 byte; | 241 | u8 byte; |
242 | static int ret = 0; | 242 | static int ret = 0; |
243 | 243 | ||
244 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 244 | IRDA_DEBUG(2, "%s()\n", __func__); |
245 | 245 | ||
246 | switch(state) { | 246 | switch(state) { |
247 | case SIRDEV_STATE_DONGLE_SPEED: | 247 | case SIRDEV_STATE_DONGLE_SPEED: |
@@ -299,7 +299,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed) | |||
299 | break; | 299 | break; |
300 | 300 | ||
301 | default: | 301 | default: |
302 | printk(KERN_ERR "%s - undefined state %d\n", __FUNCTION__, state); | 302 | printk(KERN_ERR "%s - undefined state %d\n", __func__, state); |
303 | ret = -EINVAL; | 303 | ret = -EINVAL; |
304 | break; | 304 | break; |
305 | } | 305 | } |
@@ -344,7 +344,7 @@ static int toim3232_change_speed(struct sir_dev *dev, unsigned speed) | |||
344 | 344 | ||
345 | static int toim3232_reset(struct sir_dev *dev) | 345 | static int toim3232_reset(struct sir_dev *dev) |
346 | { | 346 | { |
347 | IRDA_DEBUG(2, "%s()\n", __FUNCTION__); | 347 | IRDA_DEBUG(2, "%s()\n", __func__); |
348 | 348 | ||
349 | /* Switch off both DTR and RTS to switch off dongle */ | 349 | /* Switch off both DTR and RTS to switch off dongle */ |
350 | sirdev_set_dtr_rts(dev, FALSE, FALSE); | 350 | sirdev_set_dtr_rts(dev, FALSE, FALSE); |
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c index 04ad3573b159..84e609ea5fbb 100644 --- a/drivers/net/irda/via-ircc.c +++ b/drivers/net/irda/via-ircc.c | |||
@@ -152,12 +152,12 @@ static int __init via_ircc_init(void) | |||
152 | { | 152 | { |
153 | int rc; | 153 | int rc; |
154 | 154 | ||
155 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 155 | IRDA_DEBUG(3, "%s()\n", __func__); |
156 | 156 | ||
157 | rc = pci_register_driver(&via_driver); | 157 | rc = pci_register_driver(&via_driver); |
158 | if (rc < 0) { | 158 | if (rc < 0) { |
159 | IRDA_DEBUG(0, "%s(): error rc = %d, returning -ENODEV...\n", | 159 | IRDA_DEBUG(0, "%s(): error rc = %d, returning -ENODEV...\n", |
160 | __FUNCTION__, rc); | 160 | __func__, rc); |
161 | return -ENODEV; | 161 | return -ENODEV; |
162 | } | 162 | } |
163 | return 0; | 163 | return 0; |
@@ -170,11 +170,11 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi | |||
170 | u16 Chipset,FirDRQ1,FirDRQ0,FirIRQ,FirIOBase; | 170 | u16 Chipset,FirDRQ1,FirDRQ0,FirIRQ,FirIOBase; |
171 | chipio_t info; | 171 | chipio_t info; |
172 | 172 | ||
173 | IRDA_DEBUG(2, "%s(): Device ID=(0X%X)\n", __FUNCTION__, id->device); | 173 | IRDA_DEBUG(2, "%s(): Device ID=(0X%X)\n", __func__, id->device); |
174 | 174 | ||
175 | rc = pci_enable_device (pcidev); | 175 | rc = pci_enable_device (pcidev); |
176 | if (rc) { | 176 | if (rc) { |
177 | IRDA_DEBUG(0, "%s(): error rc = %d\n", __FUNCTION__, rc); | 177 | IRDA_DEBUG(0, "%s(): error rc = %d\n", __func__, rc); |
178 | return -ENODEV; | 178 | return -ENODEV; |
179 | } | 179 | } |
180 | 180 | ||
@@ -185,7 +185,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi | |||
185 | Chipset=0x3076; | 185 | Chipset=0x3076; |
186 | 186 | ||
187 | if (Chipset==0x3076) { | 187 | if (Chipset==0x3076) { |
188 | IRDA_DEBUG(2, "%s(): Chipset = 3076\n", __FUNCTION__); | 188 | IRDA_DEBUG(2, "%s(): Chipset = 3076\n", __func__); |
189 | 189 | ||
190 | WriteLPCReg(7,0x0c ); | 190 | WriteLPCReg(7,0x0c ); |
191 | temp=ReadLPCReg(0x30);//check if BIOS Enable Fir | 191 | temp=ReadLPCReg(0x30);//check if BIOS Enable Fir |
@@ -222,7 +222,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi | |||
222 | } else | 222 | } else |
223 | rc = -ENODEV; //IR not turn on | 223 | rc = -ENODEV; //IR not turn on |
224 | } else { //Not VT1211 | 224 | } else { //Not VT1211 |
225 | IRDA_DEBUG(2, "%s(): Chipset = 3096\n", __FUNCTION__); | 225 | IRDA_DEBUG(2, "%s(): Chipset = 3096\n", __func__); |
226 | 226 | ||
227 | pci_read_config_byte(pcidev,0x67,&bTmp);//check if BIOS Enable Fir | 227 | pci_read_config_byte(pcidev,0x67,&bTmp);//check if BIOS Enable Fir |
228 | if((bTmp&0x01)==1) { // BIOS enable FIR | 228 | if((bTmp&0x01)==1) { // BIOS enable FIR |
@@ -262,7 +262,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi | |||
262 | rc = -ENODEV; //IR not turn on !!!!! | 262 | rc = -ENODEV; //IR not turn on !!!!! |
263 | }//Not VT1211 | 263 | }//Not VT1211 |
264 | 264 | ||
265 | IRDA_DEBUG(2, "%s(): End - rc = %d\n", __FUNCTION__, rc); | 265 | IRDA_DEBUG(2, "%s(): End - rc = %d\n", __func__, rc); |
266 | return rc; | 266 | return rc; |
267 | } | 267 | } |
268 | 268 | ||
@@ -276,7 +276,7 @@ static void via_ircc_clean(void) | |||
276 | { | 276 | { |
277 | int i; | 277 | int i; |
278 | 278 | ||
279 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 279 | IRDA_DEBUG(3, "%s()\n", __func__); |
280 | 280 | ||
281 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { | 281 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { |
282 | if (dev_self[i]) | 282 | if (dev_self[i]) |
@@ -286,7 +286,7 @@ static void via_ircc_clean(void) | |||
286 | 286 | ||
287 | static void __devexit via_remove_one (struct pci_dev *pdev) | 287 | static void __devexit via_remove_one (struct pci_dev *pdev) |
288 | { | 288 | { |
289 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 289 | IRDA_DEBUG(3, "%s()\n", __func__); |
290 | 290 | ||
291 | /* FIXME : This is ugly. We should use pci_get_drvdata(pdev); | 291 | /* FIXME : This is ugly. We should use pci_get_drvdata(pdev); |
292 | * to get our driver instance and call directly via_ircc_close(). | 292 | * to get our driver instance and call directly via_ircc_close(). |
@@ -301,7 +301,7 @@ static void __devexit via_remove_one (struct pci_dev *pdev) | |||
301 | 301 | ||
302 | static void __exit via_ircc_cleanup(void) | 302 | static void __exit via_ircc_cleanup(void) |
303 | { | 303 | { |
304 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 304 | IRDA_DEBUG(3, "%s()\n", __func__); |
305 | 305 | ||
306 | /* FIXME : This should be redundant, as pci_unregister_driver() | 306 | /* FIXME : This should be redundant, as pci_unregister_driver() |
307 | * should call via_remove_one() on each device. | 307 | * should call via_remove_one() on each device. |
@@ -324,7 +324,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id) | |||
324 | struct via_ircc_cb *self; | 324 | struct via_ircc_cb *self; |
325 | int err; | 325 | int err; |
326 | 326 | ||
327 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 327 | IRDA_DEBUG(3, "%s()\n", __func__); |
328 | 328 | ||
329 | if (i >= ARRAY_SIZE(dev_self)) | 329 | if (i >= ARRAY_SIZE(dev_self)) |
330 | return -ENOMEM; | 330 | return -ENOMEM; |
@@ -360,7 +360,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id) | |||
360 | /* Reserve the ioports that we need */ | 360 | /* Reserve the ioports that we need */ |
361 | if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) { | 361 | if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) { |
362 | IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", | 362 | IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", |
363 | __FUNCTION__, self->io.fir_base); | 363 | __func__, self->io.fir_base); |
364 | err = -ENODEV; | 364 | err = -ENODEV; |
365 | goto err_out1; | 365 | goto err_out1; |
366 | } | 366 | } |
@@ -471,7 +471,7 @@ static int via_ircc_close(struct via_ircc_cb *self) | |||
471 | { | 471 | { |
472 | int iobase; | 472 | int iobase; |
473 | 473 | ||
474 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 474 | IRDA_DEBUG(3, "%s()\n", __func__); |
475 | 475 | ||
476 | IRDA_ASSERT(self != NULL, return -1;); | 476 | IRDA_ASSERT(self != NULL, return -1;); |
477 | 477 | ||
@@ -483,7 +483,7 @@ static int via_ircc_close(struct via_ircc_cb *self) | |||
483 | 483 | ||
484 | /* Release the PORT that this driver is using */ | 484 | /* Release the PORT that this driver is using */ |
485 | IRDA_DEBUG(2, "%s(), Releasing Region %03x\n", | 485 | IRDA_DEBUG(2, "%s(), Releasing Region %03x\n", |
486 | __FUNCTION__, self->io.fir_base); | 486 | __func__, self->io.fir_base); |
487 | release_region(self->io.fir_base, self->io.fir_ext); | 487 | release_region(self->io.fir_base, self->io.fir_ext); |
488 | if (self->tx_buff.head) | 488 | if (self->tx_buff.head) |
489 | dma_free_coherent(NULL, self->tx_buff.truesize, | 489 | dma_free_coherent(NULL, self->tx_buff.truesize, |
@@ -509,7 +509,7 @@ static void via_hw_init(struct via_ircc_cb *self) | |||
509 | { | 509 | { |
510 | int iobase = self->io.fir_base; | 510 | int iobase = self->io.fir_base; |
511 | 511 | ||
512 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 512 | IRDA_DEBUG(3, "%s()\n", __func__); |
513 | 513 | ||
514 | SetMaxRxPacketSize(iobase, 0x0fff); //set to max:4095 | 514 | SetMaxRxPacketSize(iobase, 0x0fff); //set to max:4095 |
515 | // FIFO Init | 515 | // FIFO Init |
@@ -582,7 +582,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, | |||
582 | speed = speed; | 582 | speed = speed; |
583 | 583 | ||
584 | IRDA_DEBUG(1, "%s(): change_dongle_speed to %d for 0x%x, %d\n", | 584 | IRDA_DEBUG(1, "%s(): change_dongle_speed to %d for 0x%x, %d\n", |
585 | __FUNCTION__, speed, iobase, dongle_id); | 585 | __func__, speed, iobase, dongle_id); |
586 | 586 | ||
587 | switch (dongle_id) { | 587 | switch (dongle_id) { |
588 | 588 | ||
@@ -671,7 +671,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, | |||
671 | 671 | ||
672 | case 0x11: /* Temic TFDS4500 */ | 672 | case 0x11: /* Temic TFDS4500 */ |
673 | 673 | ||
674 | IRDA_DEBUG(2, "%s: Temic TFDS4500: One RX pin, TX normal, RX inverted.\n", __FUNCTION__); | 674 | IRDA_DEBUG(2, "%s: Temic TFDS4500: One RX pin, TX normal, RX inverted.\n", __func__); |
675 | 675 | ||
676 | UseOneRX(iobase, ON); //use ONE RX....RX1 | 676 | UseOneRX(iobase, ON); //use ONE RX....RX1 |
677 | InvertTX(iobase, OFF); | 677 | InvertTX(iobase, OFF); |
@@ -689,7 +689,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, | |||
689 | SlowIRRXLowActive(iobase, OFF); | 689 | SlowIRRXLowActive(iobase, OFF); |
690 | 690 | ||
691 | } else{ | 691 | } else{ |
692 | IRDA_DEBUG(0, "%s: Warning: TFDS4500 not running in SIR mode !\n", __FUNCTION__); | 692 | IRDA_DEBUG(0, "%s: Warning: TFDS4500 not running in SIR mode !\n", __func__); |
693 | } | 693 | } |
694 | break; | 694 | break; |
695 | 695 | ||
@@ -707,7 +707,7 @@ static void via_ircc_change_dongle_speed(int iobase, int speed, | |||
707 | 707 | ||
708 | default: | 708 | default: |
709 | IRDA_ERROR("%s: Error: dongle_id %d unsupported !\n", | 709 | IRDA_ERROR("%s: Error: dongle_id %d unsupported !\n", |
710 | __FUNCTION__, dongle_id); | 710 | __func__, dongle_id); |
711 | } | 711 | } |
712 | } | 712 | } |
713 | 713 | ||
@@ -726,7 +726,7 @@ static void via_ircc_change_speed(struct via_ircc_cb *self, __u32 speed) | |||
726 | iobase = self->io.fir_base; | 726 | iobase = self->io.fir_base; |
727 | /* Update accounting for new speed */ | 727 | /* Update accounting for new speed */ |
728 | self->io.speed = speed; | 728 | self->io.speed = speed; |
729 | IRDA_DEBUG(1, "%s: change_speed to %d bps.\n", __FUNCTION__, speed); | 729 | IRDA_DEBUG(1, "%s: change_speed to %d bps.\n", __func__, speed); |
730 | 730 | ||
731 | WriteReg(iobase, I_ST_CT_0, 0x0); | 731 | WriteReg(iobase, I_ST_CT_0, 0x0); |
732 | 732 | ||
@@ -957,7 +957,7 @@ static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase) | |||
957 | self->tx_buff.head) + self->tx_buff_dma, | 957 | self->tx_buff.head) + self->tx_buff_dma, |
958 | self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE); | 958 | self->tx_fifo.queue[self->tx_fifo.ptr].len, DMA_TX_MODE); |
959 | IRDA_DEBUG(1, "%s: tx_fifo.ptr=%x,len=%x,tx_fifo.len=%x..\n", | 959 | IRDA_DEBUG(1, "%s: tx_fifo.ptr=%x,len=%x,tx_fifo.len=%x..\n", |
960 | __FUNCTION__, self->tx_fifo.ptr, | 960 | __func__, self->tx_fifo.ptr, |
961 | self->tx_fifo.queue[self->tx_fifo.ptr].len, | 961 | self->tx_fifo.queue[self->tx_fifo.ptr].len, |
962 | self->tx_fifo.len); | 962 | self->tx_fifo.len); |
963 | 963 | ||
@@ -981,7 +981,7 @@ static int via_ircc_dma_xmit_complete(struct via_ircc_cb *self) | |||
981 | int ret = TRUE; | 981 | int ret = TRUE; |
982 | u8 Tx_status; | 982 | u8 Tx_status; |
983 | 983 | ||
984 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 984 | IRDA_DEBUG(3, "%s()\n", __func__); |
985 | 985 | ||
986 | iobase = self->io.fir_base; | 986 | iobase = self->io.fir_base; |
987 | /* Disable DMA */ | 987 | /* Disable DMA */ |
@@ -1014,7 +1014,7 @@ static int via_ircc_dma_xmit_complete(struct via_ircc_cb *self) | |||
1014 | } | 1014 | } |
1015 | IRDA_DEBUG(1, | 1015 | IRDA_DEBUG(1, |
1016 | "%s: tx_fifo.len=%x ,tx_fifo.ptr=%x,tx_fifo.free=%x...\n", | 1016 | "%s: tx_fifo.len=%x ,tx_fifo.ptr=%x,tx_fifo.free=%x...\n", |
1017 | __FUNCTION__, | 1017 | __func__, |
1018 | self->tx_fifo.len, self->tx_fifo.ptr, self->tx_fifo.free); | 1018 | self->tx_fifo.len, self->tx_fifo.ptr, self->tx_fifo.free); |
1019 | /* F01_S | 1019 | /* F01_S |
1020 | // Any frames to be sent back-to-back? | 1020 | // Any frames to be sent back-to-back? |
@@ -1050,7 +1050,7 @@ static int via_ircc_dma_receive(struct via_ircc_cb *self) | |||
1050 | 1050 | ||
1051 | iobase = self->io.fir_base; | 1051 | iobase = self->io.fir_base; |
1052 | 1052 | ||
1053 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 1053 | IRDA_DEBUG(3, "%s()\n", __func__); |
1054 | 1054 | ||
1055 | self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0; | 1055 | self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0; |
1056 | self->tx_fifo.tail = self->tx_buff.head; | 1056 | self->tx_fifo.tail = self->tx_buff.head; |
@@ -1134,13 +1134,13 @@ static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, | |||
1134 | return TRUE; //interrupt only, data maybe move by RxT | 1134 | return TRUE; //interrupt only, data maybe move by RxT |
1135 | if (((len - 4) < 2) || ((len - 4) > 2048)) { | 1135 | if (((len - 4) < 2) || ((len - 4) > 2048)) { |
1136 | IRDA_DEBUG(1, "%s(): Trouble:len=%x,CurCount=%x,LastCount=%x..\n", | 1136 | IRDA_DEBUG(1, "%s(): Trouble:len=%x,CurCount=%x,LastCount=%x..\n", |
1137 | __FUNCTION__, len, RxCurCount(iobase, self), | 1137 | __func__, len, RxCurCount(iobase, self), |
1138 | self->RxLastCount); | 1138 | self->RxLastCount); |
1139 | hwreset(self); | 1139 | hwreset(self); |
1140 | return FALSE; | 1140 | return FALSE; |
1141 | } | 1141 | } |
1142 | IRDA_DEBUG(2, "%s(): fifo.len=%x,len=%x,CurCount=%x..\n", | 1142 | IRDA_DEBUG(2, "%s(): fifo.len=%x,len=%x,CurCount=%x..\n", |
1143 | __FUNCTION__, | 1143 | __func__, |
1144 | st_fifo->len, len - 4, RxCurCount(iobase, self)); | 1144 | st_fifo->len, len - 4, RxCurCount(iobase, self)); |
1145 | 1145 | ||
1146 | st_fifo->entries[st_fifo->tail].status = status; | 1146 | st_fifo->entries[st_fifo->tail].status = status; |
@@ -1187,7 +1187,7 @@ F01_E */ | |||
1187 | skb_put(skb, len - 4); | 1187 | skb_put(skb, len - 4); |
1188 | 1188 | ||
1189 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); | 1189 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); |
1190 | IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __FUNCTION__, | 1190 | IRDA_DEBUG(2, "%s(): len=%x.rx_buff=%p\n", __func__, |
1191 | len - 4, self->rx_buff.data); | 1191 | len - 4, self->rx_buff.data); |
1192 | 1192 | ||
1193 | // Move to next frame | 1193 | // Move to next frame |
@@ -1217,7 +1217,7 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase) | |||
1217 | 1217 | ||
1218 | len = GetRecvByte(iobase, self); | 1218 | len = GetRecvByte(iobase, self); |
1219 | 1219 | ||
1220 | IRDA_DEBUG(2, "%s(): len=%x\n", __FUNCTION__, len); | 1220 | IRDA_DEBUG(2, "%s(): len=%x\n", __func__, len); |
1221 | 1221 | ||
1222 | if ((len - 4) < 2) { | 1222 | if ((len - 4) < 2) { |
1223 | self->stats.rx_dropped++; | 1223 | self->stats.rx_dropped++; |
@@ -1302,7 +1302,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1302 | skb_put(skb, len - 4); | 1302 | skb_put(skb, len - 4); |
1303 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); | 1303 | skb_copy_to_linear_data(skb, self->rx_buff.data, len - 4); |
1304 | 1304 | ||
1305 | IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __FUNCTION__, | 1305 | IRDA_DEBUG(2, "%s(): len=%x.head=%x\n", __func__, |
1306 | len - 4, st_fifo->head); | 1306 | len - 4, st_fifo->head); |
1307 | 1307 | ||
1308 | // Move to next frame | 1308 | // Move to next frame |
@@ -1318,7 +1318,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase) | |||
1318 | 1318 | ||
1319 | IRDA_DEBUG(2, | 1319 | IRDA_DEBUG(2, |
1320 | "%s(): End of upload HostStatus=%x,RxStatus=%x\n", | 1320 | "%s(): End of upload HostStatus=%x,RxStatus=%x\n", |
1321 | __FUNCTION__, | 1321 | __func__, |
1322 | GetHostStatus(iobase), GetRXStatus(iobase)); | 1322 | GetHostStatus(iobase), GetRXStatus(iobase)); |
1323 | 1323 | ||
1324 | /* | 1324 | /* |
@@ -1358,7 +1358,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) | |||
1358 | iHostIntType = GetHostStatus(iobase); | 1358 | iHostIntType = GetHostStatus(iobase); |
1359 | 1359 | ||
1360 | IRDA_DEBUG(4, "%s(): iHostIntType %02x: %s %s %s %02x\n", | 1360 | IRDA_DEBUG(4, "%s(): iHostIntType %02x: %s %s %s %02x\n", |
1361 | __FUNCTION__, iHostIntType, | 1361 | __func__, iHostIntType, |
1362 | (iHostIntType & 0x40) ? "Timer" : "", | 1362 | (iHostIntType & 0x40) ? "Timer" : "", |
1363 | (iHostIntType & 0x20) ? "Tx" : "", | 1363 | (iHostIntType & 0x20) ? "Tx" : "", |
1364 | (iHostIntType & 0x10) ? "Rx" : "", | 1364 | (iHostIntType & 0x10) ? "Rx" : "", |
@@ -1388,7 +1388,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) | |||
1388 | iTxIntType = GetTXStatus(iobase); | 1388 | iTxIntType = GetTXStatus(iobase); |
1389 | 1389 | ||
1390 | IRDA_DEBUG(4, "%s(): iTxIntType %02x: %s %s %s %s\n", | 1390 | IRDA_DEBUG(4, "%s(): iTxIntType %02x: %s %s %s %s\n", |
1391 | __FUNCTION__, iTxIntType, | 1391 | __func__, iTxIntType, |
1392 | (iTxIntType & 0x08) ? "FIFO underr." : "", | 1392 | (iTxIntType & 0x08) ? "FIFO underr." : "", |
1393 | (iTxIntType & 0x04) ? "EOM" : "", | 1393 | (iTxIntType & 0x04) ? "EOM" : "", |
1394 | (iTxIntType & 0x02) ? "FIFO ready" : "", | 1394 | (iTxIntType & 0x02) ? "FIFO ready" : "", |
@@ -1412,7 +1412,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) | |||
1412 | iRxIntType = GetRXStatus(iobase); | 1412 | iRxIntType = GetRXStatus(iobase); |
1413 | 1413 | ||
1414 | IRDA_DEBUG(4, "%s(): iRxIntType %02x: %s %s %s %s %s %s %s\n", | 1414 | IRDA_DEBUG(4, "%s(): iRxIntType %02x: %s %s %s %s %s %s %s\n", |
1415 | __FUNCTION__, iRxIntType, | 1415 | __func__, iRxIntType, |
1416 | (iRxIntType & 0x80) ? "PHY err." : "", | 1416 | (iRxIntType & 0x80) ? "PHY err." : "", |
1417 | (iRxIntType & 0x40) ? "CRC err" : "", | 1417 | (iRxIntType & 0x40) ? "CRC err" : "", |
1418 | (iRxIntType & 0x20) ? "FIFO overr." : "", | 1418 | (iRxIntType & 0x20) ? "FIFO overr." : "", |
@@ -1421,7 +1421,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) | |||
1421 | (iRxIntType & 0x02) ? "RxMaxLen" : "", | 1421 | (iRxIntType & 0x02) ? "RxMaxLen" : "", |
1422 | (iRxIntType & 0x01) ? "SIR bad" : ""); | 1422 | (iRxIntType & 0x01) ? "SIR bad" : ""); |
1423 | if (!iRxIntType) | 1423 | if (!iRxIntType) |
1424 | IRDA_DEBUG(3, "%s(): RxIRQ =0\n", __FUNCTION__); | 1424 | IRDA_DEBUG(3, "%s(): RxIRQ =0\n", __func__); |
1425 | 1425 | ||
1426 | if (iRxIntType & 0x10) { | 1426 | if (iRxIntType & 0x10) { |
1427 | if (via_ircc_dma_receive_complete(self, iobase)) { | 1427 | if (via_ircc_dma_receive_complete(self, iobase)) { |
@@ -1431,7 +1431,7 @@ static irqreturn_t via_ircc_interrupt(int dummy, void *dev_id) | |||
1431 | } // No ERR | 1431 | } // No ERR |
1432 | else { //ERR | 1432 | else { //ERR |
1433 | IRDA_DEBUG(4, "%s(): RxIRQ ERR:iRxIntType=%x,HostIntType=%x,CurCount=%x,RxLastCount=%x_____\n", | 1433 | IRDA_DEBUG(4, "%s(): RxIRQ ERR:iRxIntType=%x,HostIntType=%x,CurCount=%x,RxLastCount=%x_____\n", |
1434 | __FUNCTION__, iRxIntType, iHostIntType, | 1434 | __func__, iRxIntType, iHostIntType, |
1435 | RxCurCount(iobase, self), | 1435 | RxCurCount(iobase, self), |
1436 | self->RxLastCount); | 1436 | self->RxLastCount); |
1437 | 1437 | ||
@@ -1456,7 +1456,7 @@ static void hwreset(struct via_ircc_cb *self) | |||
1456 | int iobase; | 1456 | int iobase; |
1457 | iobase = self->io.fir_base; | 1457 | iobase = self->io.fir_base; |
1458 | 1458 | ||
1459 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 1459 | IRDA_DEBUG(3, "%s()\n", __func__); |
1460 | 1460 | ||
1461 | ResetChip(iobase, 5); | 1461 | ResetChip(iobase, 5); |
1462 | EnableDMA(iobase, OFF); | 1462 | EnableDMA(iobase, OFF); |
@@ -1501,7 +1501,7 @@ static int via_ircc_is_receiving(struct via_ircc_cb *self) | |||
1501 | if (CkRxRecv(iobase, self)) | 1501 | if (CkRxRecv(iobase, self)) |
1502 | status = TRUE; | 1502 | status = TRUE; |
1503 | 1503 | ||
1504 | IRDA_DEBUG(2, "%s(): status=%x....\n", __FUNCTION__, status); | 1504 | IRDA_DEBUG(2, "%s(): status=%x....\n", __func__, status); |
1505 | 1505 | ||
1506 | return status; | 1506 | return status; |
1507 | } | 1507 | } |
@@ -1519,7 +1519,7 @@ static int via_ircc_net_open(struct net_device *dev) | |||
1519 | int iobase; | 1519 | int iobase; |
1520 | char hwname[32]; | 1520 | char hwname[32]; |
1521 | 1521 | ||
1522 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 1522 | IRDA_DEBUG(3, "%s()\n", __func__); |
1523 | 1523 | ||
1524 | IRDA_ASSERT(dev != NULL, return -1;); | 1524 | IRDA_ASSERT(dev != NULL, return -1;); |
1525 | self = (struct via_ircc_cb *) dev->priv; | 1525 | self = (struct via_ircc_cb *) dev->priv; |
@@ -1586,7 +1586,7 @@ static int via_ircc_net_close(struct net_device *dev) | |||
1586 | struct via_ircc_cb *self; | 1586 | struct via_ircc_cb *self; |
1587 | int iobase; | 1587 | int iobase; |
1588 | 1588 | ||
1589 | IRDA_DEBUG(3, "%s()\n", __FUNCTION__); | 1589 | IRDA_DEBUG(3, "%s()\n", __func__); |
1590 | 1590 | ||
1591 | IRDA_ASSERT(dev != NULL, return -1;); | 1591 | IRDA_ASSERT(dev != NULL, return -1;); |
1592 | self = (struct via_ircc_cb *) dev->priv; | 1592 | self = (struct via_ircc_cb *) dev->priv; |
@@ -1630,7 +1630,7 @@ static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, | |||
1630 | IRDA_ASSERT(dev != NULL, return -1;); | 1630 | IRDA_ASSERT(dev != NULL, return -1;); |
1631 | self = dev->priv; | 1631 | self = dev->priv; |
1632 | IRDA_ASSERT(self != NULL, return -1;); | 1632 | IRDA_ASSERT(self != NULL, return -1;); |
1633 | IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, | 1633 | IRDA_DEBUG(1, "%s(), %s, (cmd=0x%X)\n", __func__, dev->name, |
1634 | cmd); | 1634 | cmd); |
1635 | /* Disable interrupts & save flags */ | 1635 | /* Disable interrupts & save flags */ |
1636 | spin_lock_irqsave(&self->lock, flags); | 1636 | spin_lock_irqsave(&self->lock, flags); |
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c index d15e00b8591e..18f4b3a96aed 100644 --- a/drivers/net/irda/vlsi_ir.c +++ b/drivers/net/irda/vlsi_ir.c | |||
@@ -140,15 +140,15 @@ static void vlsi_ring_debug(struct vlsi_ring *r) | |||
140 | unsigned i; | 140 | unsigned i; |
141 | 141 | ||
142 | printk(KERN_DEBUG "%s - ring %p / size %u / mask 0x%04x / len %u / dir %d / hw %p\n", | 142 | printk(KERN_DEBUG "%s - ring %p / size %u / mask 0x%04x / len %u / dir %d / hw %p\n", |
143 | __FUNCTION__, r, r->size, r->mask, r->len, r->dir, r->rd[0].hw); | 143 | __func__, r, r->size, r->mask, r->len, r->dir, r->rd[0].hw); |
144 | printk(KERN_DEBUG "%s - head = %d / tail = %d\n", __FUNCTION__, | 144 | printk(KERN_DEBUG "%s - head = %d / tail = %d\n", __func__, |
145 | atomic_read(&r->head) & r->mask, atomic_read(&r->tail) & r->mask); | 145 | atomic_read(&r->head) & r->mask, atomic_read(&r->tail) & r->mask); |
146 | for (i = 0; i < r->size; i++) { | 146 | for (i = 0; i < r->size; i++) { |
147 | rd = &r->rd[i]; | 147 | rd = &r->rd[i]; |
148 | printk(KERN_DEBUG "%s - ring descr %u: ", __FUNCTION__, i); | 148 | printk(KERN_DEBUG "%s - ring descr %u: ", __func__, i); |
149 | printk("skb=%p data=%p hw=%p\n", rd->skb, rd->buf, rd->hw); | 149 | printk("skb=%p data=%p hw=%p\n", rd->skb, rd->buf, rd->hw); |
150 | printk(KERN_DEBUG "%s - hw: status=%02x count=%u addr=0x%08x\n", | 150 | printk(KERN_DEBUG "%s - hw: status=%02x count=%u addr=0x%08x\n", |
151 | __FUNCTION__, (unsigned) rd_get_status(rd), | 151 | __func__, (unsigned) rd_get_status(rd), |
152 | (unsigned) rd_get_count(rd), (unsigned) rd_get_addr(rd)); | 152 | (unsigned) rd_get_count(rd), (unsigned) rd_get_addr(rd)); |
153 | } | 153 | } |
154 | } | 154 | } |
@@ -435,7 +435,7 @@ static struct vlsi_ring *vlsi_alloc_ring(struct pci_dev *pdev, struct ring_descr | |||
435 | || !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { | 435 | || !(busaddr = pci_map_single(pdev, rd->buf, len, dir))) { |
436 | if (rd->buf) { | 436 | if (rd->buf) { |
437 | IRDA_ERROR("%s: failed to create PCI-MAP for %p", | 437 | IRDA_ERROR("%s: failed to create PCI-MAP for %p", |
438 | __FUNCTION__, rd->buf); | 438 | __func__, rd->buf); |
439 | kfree(rd->buf); | 439 | kfree(rd->buf); |
440 | rd->buf = NULL; | 440 | rd->buf = NULL; |
441 | } | 441 | } |
@@ -489,7 +489,7 @@ static int vlsi_create_hwif(vlsi_irda_dev_t *idev) | |||
489 | ringarea = pci_alloc_consistent(idev->pdev, HW_RING_AREA_SIZE, &idev->busaddr); | 489 | ringarea = pci_alloc_consistent(idev->pdev, HW_RING_AREA_SIZE, &idev->busaddr); |
490 | if (!ringarea) { | 490 | if (!ringarea) { |
491 | IRDA_ERROR("%s: insufficient memory for descriptor rings\n", | 491 | IRDA_ERROR("%s: insufficient memory for descriptor rings\n", |
492 | __FUNCTION__); | 492 | __func__); |
493 | goto out; | 493 | goto out; |
494 | } | 494 | } |
495 | memset(ringarea, 0, HW_RING_AREA_SIZE); | 495 | memset(ringarea, 0, HW_RING_AREA_SIZE); |
@@ -564,7 +564,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd) | |||
564 | crclen = (idev->mode==IFF_FIR) ? sizeof(u32) : sizeof(u16); | 564 | crclen = (idev->mode==IFF_FIR) ? sizeof(u32) : sizeof(u16); |
565 | len -= crclen; /* remove trailing CRC */ | 565 | len -= crclen; /* remove trailing CRC */ |
566 | if (len <= 0) { | 566 | if (len <= 0) { |
567 | IRDA_DEBUG(0, "%s: strange frame (len=%d)\n", __FUNCTION__, len); | 567 | IRDA_DEBUG(0, "%s: strange frame (len=%d)\n", __func__, len); |
568 | ret |= VLSI_RX_DROP; | 568 | ret |= VLSI_RX_DROP; |
569 | goto done; | 569 | goto done; |
570 | } | 570 | } |
@@ -579,14 +579,14 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd) | |||
579 | */ | 579 | */ |
580 | le16_to_cpus(rd->buf+len); | 580 | le16_to_cpus(rd->buf+len); |
581 | if (irda_calc_crc16(INIT_FCS,rd->buf,len+crclen) != GOOD_FCS) { | 581 | if (irda_calc_crc16(INIT_FCS,rd->buf,len+crclen) != GOOD_FCS) { |
582 | IRDA_DEBUG(0, "%s: crc error\n", __FUNCTION__); | 582 | IRDA_DEBUG(0, "%s: crc error\n", __func__); |
583 | ret |= VLSI_RX_CRC; | 583 | ret |= VLSI_RX_CRC; |
584 | goto done; | 584 | goto done; |
585 | } | 585 | } |
586 | } | 586 | } |
587 | 587 | ||
588 | if (!rd->skb) { | 588 | if (!rd->skb) { |
589 | IRDA_WARNING("%s: rx packet lost\n", __FUNCTION__); | 589 | IRDA_WARNING("%s: rx packet lost\n", __func__); |
590 | ret |= VLSI_RX_DROP; | 590 | ret |= VLSI_RX_DROP; |
591 | goto done; | 591 | goto done; |
592 | } | 592 | } |
@@ -617,7 +617,7 @@ static void vlsi_fill_rx(struct vlsi_ring *r) | |||
617 | for (rd = ring_last(r); rd != NULL; rd = ring_put(r)) { | 617 | for (rd = ring_last(r); rd != NULL; rd = ring_put(r)) { |
618 | if (rd_is_active(rd)) { | 618 | if (rd_is_active(rd)) { |
619 | IRDA_WARNING("%s: driver bug: rx descr race with hw\n", | 619 | IRDA_WARNING("%s: driver bug: rx descr race with hw\n", |
620 | __FUNCTION__); | 620 | __func__); |
621 | vlsi_ring_debug(r); | 621 | vlsi_ring_debug(r); |
622 | break; | 622 | break; |
623 | } | 623 | } |
@@ -676,7 +676,7 @@ static void vlsi_rx_interrupt(struct net_device *ndev) | |||
676 | 676 | ||
677 | if (ring_first(r) == NULL) { | 677 | if (ring_first(r) == NULL) { |
678 | /* we are in big trouble, if this should ever happen */ | 678 | /* we are in big trouble, if this should ever happen */ |
679 | IRDA_ERROR("%s: rx ring exhausted!\n", __FUNCTION__); | 679 | IRDA_ERROR("%s: rx ring exhausted!\n", __func__); |
680 | vlsi_ring_debug(r); | 680 | vlsi_ring_debug(r); |
681 | } | 681 | } |
682 | else | 682 | else |
@@ -697,7 +697,7 @@ static void vlsi_unarm_rx(vlsi_irda_dev_t *idev) | |||
697 | if (rd_is_active(rd)) { | 697 | if (rd_is_active(rd)) { |
698 | rd_set_status(rd, 0); | 698 | rd_set_status(rd, 0); |
699 | if (rd_get_count(rd)) { | 699 | if (rd_get_count(rd)) { |
700 | IRDA_DEBUG(0, "%s - dropping rx packet\n", __FUNCTION__); | 700 | IRDA_DEBUG(0, "%s - dropping rx packet\n", __func__); |
701 | ret = -VLSI_RX_DROP; | 701 | ret = -VLSI_RX_DROP; |
702 | } | 702 | } |
703 | rd_set_count(rd, 0); | 703 | rd_set_count(rd, 0); |
@@ -772,7 +772,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
772 | int fifocnt; | 772 | int fifocnt; |
773 | 773 | ||
774 | baudrate = idev->new_baud; | 774 | baudrate = idev->new_baud; |
775 | IRDA_DEBUG(2, "%s: %d -> %d\n", __FUNCTION__, idev->baud, idev->new_baud); | 775 | IRDA_DEBUG(2, "%s: %d -> %d\n", __func__, idev->baud, idev->new_baud); |
776 | if (baudrate == 4000000) { | 776 | if (baudrate == 4000000) { |
777 | mode = IFF_FIR; | 777 | mode = IFF_FIR; |
778 | config = IRCFG_FIR; | 778 | config = IRCFG_FIR; |
@@ -789,7 +789,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
789 | switch(baudrate) { | 789 | switch(baudrate) { |
790 | default: | 790 | default: |
791 | IRDA_WARNING("%s: undefined baudrate %d - fallback to 9600!\n", | 791 | IRDA_WARNING("%s: undefined baudrate %d - fallback to 9600!\n", |
792 | __FUNCTION__, baudrate); | 792 | __func__, baudrate); |
793 | baudrate = 9600; | 793 | baudrate = 9600; |
794 | /* fallthru */ | 794 | /* fallthru */ |
795 | case 2400: | 795 | case 2400: |
@@ -806,7 +806,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
806 | 806 | ||
807 | fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; | 807 | fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; |
808 | if (fifocnt != 0) { | 808 | if (fifocnt != 0) { |
809 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __FUNCTION__, fifocnt); | 809 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __func__, fifocnt); |
810 | } | 810 | } |
811 | 811 | ||
812 | outw(0, iobase+VLSI_PIO_IRENABLE); | 812 | outw(0, iobase+VLSI_PIO_IRENABLE); |
@@ -830,14 +830,14 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
830 | config ^= IRENABLE_SIR_ON; | 830 | config ^= IRENABLE_SIR_ON; |
831 | 831 | ||
832 | if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) { | 832 | if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) { |
833 | IRDA_WARNING("%s: failed to set %s mode!\n", __FUNCTION__, | 833 | IRDA_WARNING("%s: failed to set %s mode!\n", __func__, |
834 | (mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR")); | 834 | (mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR")); |
835 | ret = -1; | 835 | ret = -1; |
836 | } | 836 | } |
837 | else { | 837 | else { |
838 | if (inw(iobase+VLSI_PIO_PHYCTL) != nphyctl) { | 838 | if (inw(iobase+VLSI_PIO_PHYCTL) != nphyctl) { |
839 | IRDA_WARNING("%s: failed to apply baudrate %d\n", | 839 | IRDA_WARNING("%s: failed to apply baudrate %d\n", |
840 | __FUNCTION__, baudrate); | 840 | __func__, baudrate); |
841 | ret = -1; | 841 | ret = -1; |
842 | } | 842 | } |
843 | else { | 843 | else { |
@@ -849,7 +849,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) | |||
849 | } | 849 | } |
850 | 850 | ||
851 | if (ret) | 851 | if (ret) |
852 | vlsi_reg_debug(iobase,__FUNCTION__); | 852 | vlsi_reg_debug(iobase,__func__); |
853 | 853 | ||
854 | return ret; | 854 | return ret; |
855 | } | 855 | } |
@@ -982,7 +982,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
982 | 982 | ||
983 | if (len >= r->len-5) | 983 | if (len >= r->len-5) |
984 | IRDA_WARNING("%s: possible buffer overflow with SIR wrapping!\n", | 984 | IRDA_WARNING("%s: possible buffer overflow with SIR wrapping!\n", |
985 | __FUNCTION__); | 985 | __func__); |
986 | } | 986 | } |
987 | else { | 987 | else { |
988 | /* hw deals with MIR/FIR mode wrapping */ | 988 | /* hw deals with MIR/FIR mode wrapping */ |
@@ -1027,7 +1027,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
1027 | 1027 | ||
1028 | fifocnt = inw(ndev->base_addr+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; | 1028 | fifocnt = inw(ndev->base_addr+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; |
1029 | if (fifocnt != 0) { | 1029 | if (fifocnt != 0) { |
1030 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __FUNCTION__, fifocnt); | 1030 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", __func__, fifocnt); |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | config = inw(iobase+VLSI_PIO_IRCFG); | 1033 | config = inw(iobase+VLSI_PIO_IRCFG); |
@@ -1040,7 +1040,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
1040 | 1040 | ||
1041 | if (ring_put(r) == NULL) { | 1041 | if (ring_put(r) == NULL) { |
1042 | netif_stop_queue(ndev); | 1042 | netif_stop_queue(ndev); |
1043 | IRDA_DEBUG(3, "%s: tx ring full - queue stopped\n", __FUNCTION__); | 1043 | IRDA_DEBUG(3, "%s: tx ring full - queue stopped\n", __func__); |
1044 | } | 1044 | } |
1045 | spin_unlock_irqrestore(&idev->lock, flags); | 1045 | spin_unlock_irqrestore(&idev->lock, flags); |
1046 | 1046 | ||
@@ -1049,7 +1049,7 @@ static int vlsi_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
1049 | drop_unlock: | 1049 | drop_unlock: |
1050 | spin_unlock_irqrestore(&idev->lock, flags); | 1050 | spin_unlock_irqrestore(&idev->lock, flags); |
1051 | drop: | 1051 | drop: |
1052 | IRDA_WARNING("%s: dropping packet - %s\n", __FUNCTION__, msg); | 1052 | IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg); |
1053 | dev_kfree_skb_any(skb); | 1053 | dev_kfree_skb_any(skb); |
1054 | idev->stats.tx_errors++; | 1054 | idev->stats.tx_errors++; |
1055 | idev->stats.tx_dropped++; | 1055 | idev->stats.tx_dropped++; |
@@ -1106,7 +1106,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev) | |||
1106 | fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; | 1106 | fifocnt = inw(iobase+VLSI_PIO_RCVBCNT) & RCVBCNT_MASK; |
1107 | if (fifocnt != 0) { | 1107 | if (fifocnt != 0) { |
1108 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", | 1108 | IRDA_DEBUG(0, "%s: rx fifo not empty(%d)\n", |
1109 | __FUNCTION__, fifocnt); | 1109 | __func__, fifocnt); |
1110 | } | 1110 | } |
1111 | outw(config | IRCFG_ENTX, iobase+VLSI_PIO_IRCFG); | 1111 | outw(config | IRCFG_ENTX, iobase+VLSI_PIO_IRCFG); |
1112 | } | 1112 | } |
@@ -1115,7 +1115,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev) | |||
1115 | 1115 | ||
1116 | if (netif_queue_stopped(ndev) && !idev->new_baud) { | 1116 | if (netif_queue_stopped(ndev) && !idev->new_baud) { |
1117 | netif_wake_queue(ndev); | 1117 | netif_wake_queue(ndev); |
1118 | IRDA_DEBUG(3, "%s: queue awoken\n", __FUNCTION__); | 1118 | IRDA_DEBUG(3, "%s: queue awoken\n", __func__); |
1119 | } | 1119 | } |
1120 | } | 1120 | } |
1121 | 1121 | ||
@@ -1138,7 +1138,7 @@ static void vlsi_unarm_tx(vlsi_irda_dev_t *idev) | |||
1138 | dev_kfree_skb_any(rd->skb); | 1138 | dev_kfree_skb_any(rd->skb); |
1139 | rd->skb = NULL; | 1139 | rd->skb = NULL; |
1140 | } | 1140 | } |
1141 | IRDA_DEBUG(0, "%s - dropping tx packet\n", __FUNCTION__); | 1141 | IRDA_DEBUG(0, "%s - dropping tx packet\n", __func__); |
1142 | ret = -VLSI_TX_DROP; | 1142 | ret = -VLSI_TX_DROP; |
1143 | } | 1143 | } |
1144 | else | 1144 | else |
@@ -1188,7 +1188,7 @@ static int vlsi_start_clock(struct pci_dev *pdev) | |||
1188 | if (count < 3) { | 1188 | if (count < 3) { |
1189 | if (clksrc == 1) { /* explicitly asked for PLL hence bail out */ | 1189 | if (clksrc == 1) { /* explicitly asked for PLL hence bail out */ |
1190 | IRDA_ERROR("%s: no PLL or failed to lock!\n", | 1190 | IRDA_ERROR("%s: no PLL or failed to lock!\n", |
1191 | __FUNCTION__); | 1191 | __func__); |
1192 | clkctl = CLKCTL_CLKSTP; | 1192 | clkctl = CLKCTL_CLKSTP; |
1193 | pci_write_config_byte(pdev, VLSI_PCI_CLKCTL, clkctl); | 1193 | pci_write_config_byte(pdev, VLSI_PCI_CLKCTL, clkctl); |
1194 | return -1; | 1194 | return -1; |
@@ -1197,7 +1197,7 @@ static int vlsi_start_clock(struct pci_dev *pdev) | |||
1197 | clksrc = 3; /* fallback to 40MHz XCLK (OB800) */ | 1197 | clksrc = 3; /* fallback to 40MHz XCLK (OB800) */ |
1198 | 1198 | ||
1199 | IRDA_DEBUG(0, "%s: PLL not locked, fallback to clksrc=%d\n", | 1199 | IRDA_DEBUG(0, "%s: PLL not locked, fallback to clksrc=%d\n", |
1200 | __FUNCTION__, clksrc); | 1200 | __func__, clksrc); |
1201 | } | 1201 | } |
1202 | else | 1202 | else |
1203 | clksrc = 1; /* got successful PLL lock */ | 1203 | clksrc = 1; /* got successful PLL lock */ |
@@ -1269,7 +1269,7 @@ static int vlsi_init_chip(struct pci_dev *pdev) | |||
1269 | /* start the clock and clean the registers */ | 1269 | /* start the clock and clean the registers */ |
1270 | 1270 | ||
1271 | if (vlsi_start_clock(pdev)) { | 1271 | if (vlsi_start_clock(pdev)) { |
1272 | IRDA_ERROR("%s: no valid clock source\n", __FUNCTION__); | 1272 | IRDA_ERROR("%s: no valid clock source\n", __func__); |
1273 | return -1; | 1273 | return -1; |
1274 | } | 1274 | } |
1275 | iobase = ndev->base_addr; | 1275 | iobase = ndev->base_addr; |
@@ -1386,7 +1386,7 @@ static void vlsi_tx_timeout(struct net_device *ndev) | |||
1386 | vlsi_irda_dev_t *idev = ndev->priv; | 1386 | vlsi_irda_dev_t *idev = ndev->priv; |
1387 | 1387 | ||
1388 | 1388 | ||
1389 | vlsi_reg_debug(ndev->base_addr, __FUNCTION__); | 1389 | vlsi_reg_debug(ndev->base_addr, __func__); |
1390 | vlsi_ring_debug(idev->tx_ring); | 1390 | vlsi_ring_debug(idev->tx_ring); |
1391 | 1391 | ||
1392 | if (netif_running(ndev)) | 1392 | if (netif_running(ndev)) |
@@ -1401,7 +1401,7 @@ static void vlsi_tx_timeout(struct net_device *ndev) | |||
1401 | 1401 | ||
1402 | if (vlsi_start_hw(idev)) | 1402 | if (vlsi_start_hw(idev)) |
1403 | IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", | 1403 | IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", |
1404 | __FUNCTION__, pci_name(idev->pdev), ndev->name); | 1404 | __func__, pci_name(idev->pdev), ndev->name); |
1405 | else | 1405 | else |
1406 | netif_start_queue(ndev); | 1406 | netif_start_queue(ndev); |
1407 | } | 1407 | } |
@@ -1446,7 +1446,7 @@ static int vlsi_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
1446 | break; | 1446 | break; |
1447 | default: | 1447 | default: |
1448 | IRDA_WARNING("%s: notsupp - cmd=%04x\n", | 1448 | IRDA_WARNING("%s: notsupp - cmd=%04x\n", |
1449 | __FUNCTION__, cmd); | 1449 | __func__, cmd); |
1450 | ret = -EOPNOTSUPP; | 1450 | ret = -EOPNOTSUPP; |
1451 | } | 1451 | } |
1452 | 1452 | ||
@@ -1491,7 +1491,7 @@ static irqreturn_t vlsi_interrupt(int irq, void *dev_instance) | |||
1491 | 1491 | ||
1492 | if (boguscount <= 0) | 1492 | if (boguscount <= 0) |
1493 | IRDA_MESSAGE("%s: too much work in interrupt!\n", | 1493 | IRDA_MESSAGE("%s: too much work in interrupt!\n", |
1494 | __FUNCTION__); | 1494 | __func__); |
1495 | return IRQ_RETVAL(handled); | 1495 | return IRQ_RETVAL(handled); |
1496 | } | 1496 | } |
1497 | 1497 | ||
@@ -1504,7 +1504,7 @@ static int vlsi_open(struct net_device *ndev) | |||
1504 | char hwname[32]; | 1504 | char hwname[32]; |
1505 | 1505 | ||
1506 | if (pci_request_regions(idev->pdev, drivername)) { | 1506 | if (pci_request_regions(idev->pdev, drivername)) { |
1507 | IRDA_WARNING("%s: io resource busy\n", __FUNCTION__); | 1507 | IRDA_WARNING("%s: io resource busy\n", __func__); |
1508 | goto errout; | 1508 | goto errout; |
1509 | } | 1509 | } |
1510 | ndev->base_addr = pci_resource_start(idev->pdev,0); | 1510 | ndev->base_addr = pci_resource_start(idev->pdev,0); |
@@ -1519,7 +1519,7 @@ static int vlsi_open(struct net_device *ndev) | |||
1519 | if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED, | 1519 | if (request_irq(ndev->irq, vlsi_interrupt, IRQF_SHARED, |
1520 | drivername, ndev)) { | 1520 | drivername, ndev)) { |
1521 | IRDA_WARNING("%s: couldn't get IRQ: %d\n", | 1521 | IRDA_WARNING("%s: couldn't get IRQ: %d\n", |
1522 | __FUNCTION__, ndev->irq); | 1522 | __func__, ndev->irq); |
1523 | goto errout_io; | 1523 | goto errout_io; |
1524 | } | 1524 | } |
1525 | 1525 | ||
@@ -1540,7 +1540,7 @@ static int vlsi_open(struct net_device *ndev) | |||
1540 | 1540 | ||
1541 | netif_start_queue(ndev); | 1541 | netif_start_queue(ndev); |
1542 | 1542 | ||
1543 | IRDA_MESSAGE("%s: device %s operational\n", __FUNCTION__, ndev->name); | 1543 | IRDA_MESSAGE("%s: device %s operational\n", __func__, ndev->name); |
1544 | 1544 | ||
1545 | return 0; | 1545 | return 0; |
1546 | 1546 | ||
@@ -1574,7 +1574,7 @@ static int vlsi_close(struct net_device *ndev) | |||
1574 | 1574 | ||
1575 | pci_release_regions(idev->pdev); | 1575 | pci_release_regions(idev->pdev); |
1576 | 1576 | ||
1577 | IRDA_MESSAGE("%s: device %s stopped\n", __FUNCTION__, ndev->name); | 1577 | IRDA_MESSAGE("%s: device %s stopped\n", __func__, ndev->name); |
1578 | 1578 | ||
1579 | return 0; | 1579 | return 0; |
1580 | } | 1580 | } |
@@ -1593,7 +1593,7 @@ static int vlsi_irda_init(struct net_device *ndev) | |||
1593 | 1593 | ||
1594 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) | 1594 | if (pci_set_dma_mask(pdev,DMA_MASK_USED_BY_HW) |
1595 | || pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { | 1595 | || pci_set_dma_mask(pdev,DMA_MASK_MSTRPAGE)) { |
1596 | IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __FUNCTION__); | 1596 | IRDA_ERROR("%s: aborting due to PCI BM-DMA address limitations\n", __func__); |
1597 | return -1; | 1597 | return -1; |
1598 | } | 1598 | } |
1599 | 1599 | ||
@@ -1645,14 +1645,14 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1645 | 1645 | ||
1646 | if ( !pci_resource_start(pdev,0) | 1646 | if ( !pci_resource_start(pdev,0) |
1647 | || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { | 1647 | || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { |
1648 | IRDA_ERROR("%s: bar 0 invalid", __FUNCTION__); | 1648 | IRDA_ERROR("%s: bar 0 invalid", __func__); |
1649 | goto out_disable; | 1649 | goto out_disable; |
1650 | } | 1650 | } |
1651 | 1651 | ||
1652 | ndev = alloc_irdadev(sizeof(*idev)); | 1652 | ndev = alloc_irdadev(sizeof(*idev)); |
1653 | if (ndev==NULL) { | 1653 | if (ndev==NULL) { |
1654 | IRDA_ERROR("%s: Unable to allocate device memory.\n", | 1654 | IRDA_ERROR("%s: Unable to allocate device memory.\n", |
1655 | __FUNCTION__); | 1655 | __func__); |
1656 | goto out_disable; | 1656 | goto out_disable; |
1657 | } | 1657 | } |
1658 | 1658 | ||
@@ -1667,7 +1667,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1667 | goto out_freedev; | 1667 | goto out_freedev; |
1668 | 1668 | ||
1669 | if (register_netdev(ndev) < 0) { | 1669 | if (register_netdev(ndev) < 0) { |
1670 | IRDA_ERROR("%s: register_netdev failed\n", __FUNCTION__); | 1670 | IRDA_ERROR("%s: register_netdev failed\n", __func__); |
1671 | goto out_freedev; | 1671 | goto out_freedev; |
1672 | } | 1672 | } |
1673 | 1673 | ||
@@ -1678,7 +1678,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1678 | vlsi_proc_root, VLSI_PROC_FOPS, ndev); | 1678 | vlsi_proc_root, VLSI_PROC_FOPS, ndev); |
1679 | if (!ent) { | 1679 | if (!ent) { |
1680 | IRDA_WARNING("%s: failed to create proc entry\n", | 1680 | IRDA_WARNING("%s: failed to create proc entry\n", |
1681 | __FUNCTION__); | 1681 | __func__); |
1682 | } else { | 1682 | } else { |
1683 | ent->size = 0; | 1683 | ent->size = 0; |
1684 | } | 1684 | } |
@@ -1745,7 +1745,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1745 | 1745 | ||
1746 | if (!ndev) { | 1746 | if (!ndev) { |
1747 | IRDA_ERROR("%s - %s: no netdevice \n", | 1747 | IRDA_ERROR("%s - %s: no netdevice \n", |
1748 | __FUNCTION__, pci_name(pdev)); | 1748 | __func__, pci_name(pdev)); |
1749 | return 0; | 1749 | return 0; |
1750 | } | 1750 | } |
1751 | idev = ndev->priv; | 1751 | idev = ndev->priv; |
@@ -1756,7 +1756,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state) | |||
1756 | pdev->current_state = state.event; | 1756 | pdev->current_state = state.event; |
1757 | } | 1757 | } |
1758 | else | 1758 | else |
1759 | IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, pci_name(pdev), pdev->current_state, state.event); | 1759 | IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __func__, pci_name(pdev), pdev->current_state, state.event); |
1760 | mutex_unlock(&idev->mtx); | 1760 | mutex_unlock(&idev->mtx); |
1761 | return 0; | 1761 | return 0; |
1762 | } | 1762 | } |
@@ -1784,7 +1784,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1784 | 1784 | ||
1785 | if (!ndev) { | 1785 | if (!ndev) { |
1786 | IRDA_ERROR("%s - %s: no netdevice \n", | 1786 | IRDA_ERROR("%s - %s: no netdevice \n", |
1787 | __FUNCTION__, pci_name(pdev)); | 1787 | __func__, pci_name(pdev)); |
1788 | return 0; | 1788 | return 0; |
1789 | } | 1789 | } |
1790 | idev = ndev->priv; | 1790 | idev = ndev->priv; |
@@ -1792,7 +1792,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1792 | if (pdev->current_state == 0) { | 1792 | if (pdev->current_state == 0) { |
1793 | mutex_unlock(&idev->mtx); | 1793 | mutex_unlock(&idev->mtx); |
1794 | IRDA_WARNING("%s - %s: already resumed\n", | 1794 | IRDA_WARNING("%s - %s: already resumed\n", |
1795 | __FUNCTION__, pci_name(pdev)); | 1795 | __func__, pci_name(pdev)); |
1796 | return 0; | 1796 | return 0; |
1797 | } | 1797 | } |
1798 | 1798 | ||
@@ -1811,7 +1811,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev) | |||
1811 | * now we explicitly set pdev->current_state = 0 after enabling the | 1811 | * now we explicitly set pdev->current_state = 0 after enabling the |
1812 | * device and independently resume_ok should catch any garbage config. | 1812 | * device and independently resume_ok should catch any garbage config. |
1813 | */ | 1813 | */ |
1814 | IRDA_WARNING("%s - hm, nothing to resume?\n", __FUNCTION__); | 1814 | IRDA_WARNING("%s - hm, nothing to resume?\n", __func__); |
1815 | mutex_unlock(&idev->mtx); | 1815 | mutex_unlock(&idev->mtx); |
1816 | return 0; | 1816 | return 0; |
1817 | } | 1817 | } |
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h index c8b9c74eea52..9b1884329fba 100644 --- a/drivers/net/irda/vlsi_ir.h +++ b/drivers/net/irda/vlsi_ir.h | |||
@@ -617,7 +617,7 @@ static inline void rd_set_addr_status(struct ring_descr *rd, dma_addr_t a, u8 s) | |||
617 | */ | 617 | */ |
618 | 618 | ||
619 | if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) { | 619 | if ((a & ~DMA_MASK_MSTRPAGE)>>24 != MSTRPAGE_VALUE) { |
620 | IRDA_ERROR("%s: pci busaddr inconsistency!\n", __FUNCTION__); | 620 | IRDA_ERROR("%s: pci busaddr inconsistency!\n", __func__); |
621 | dump_stack(); | 621 | dump_stack(); |
622 | return; | 622 | return; |
623 | } | 623 | } |
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 9fd2451b0fb2..002a6d769f21 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c | |||
@@ -114,7 +114,7 @@ static int __init w83977af_init(void) | |||
114 | { | 114 | { |
115 | int i; | 115 | int i; |
116 | 116 | ||
117 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 117 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
118 | 118 | ||
119 | for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) { | 119 | for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) { |
120 | if (w83977af_open(i, io[i], irq[i], dma[i]) == 0) | 120 | if (w83977af_open(i, io[i], irq[i], dma[i]) == 0) |
@@ -133,7 +133,7 @@ static void __exit w83977af_cleanup(void) | |||
133 | { | 133 | { |
134 | int i; | 134 | int i; |
135 | 135 | ||
136 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 136 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
137 | 137 | ||
138 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { | 138 | for (i=0; i < ARRAY_SIZE(dev_self); i++) { |
139 | if (dev_self[i]) | 139 | if (dev_self[i]) |
@@ -154,12 +154,12 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, | |||
154 | struct w83977af_ir *self; | 154 | struct w83977af_ir *self; |
155 | int err; | 155 | int err; |
156 | 156 | ||
157 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 157 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
158 | 158 | ||
159 | /* Lock the port that we need */ | 159 | /* Lock the port that we need */ |
160 | if (!request_region(iobase, CHIP_IO_EXTENT, driver_name)) { | 160 | if (!request_region(iobase, CHIP_IO_EXTENT, driver_name)) { |
161 | IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", | 161 | IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", |
162 | __FUNCTION__ , iobase); | 162 | __func__ , iobase); |
163 | return -ENODEV; | 163 | return -ENODEV; |
164 | } | 164 | } |
165 | 165 | ||
@@ -241,7 +241,7 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq, | |||
241 | 241 | ||
242 | err = register_netdev(dev); | 242 | err = register_netdev(dev); |
243 | if (err) { | 243 | if (err) { |
244 | IRDA_ERROR("%s(), register_netdevice() failed!\n", __FUNCTION__); | 244 | IRDA_ERROR("%s(), register_netdevice() failed!\n", __func__); |
245 | goto err_out3; | 245 | goto err_out3; |
246 | } | 246 | } |
247 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); | 247 | IRDA_MESSAGE("IrDA: Registered device %s\n", dev->name); |
@@ -273,7 +273,7 @@ static int w83977af_close(struct w83977af_ir *self) | |||
273 | { | 273 | { |
274 | int iobase; | 274 | int iobase; |
275 | 275 | ||
276 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 276 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
277 | 277 | ||
278 | iobase = self->io.fir_base; | 278 | iobase = self->io.fir_base; |
279 | 279 | ||
@@ -294,7 +294,7 @@ static int w83977af_close(struct w83977af_ir *self) | |||
294 | 294 | ||
295 | /* Release the PORT that this driver is using */ | 295 | /* Release the PORT that this driver is using */ |
296 | IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", | 296 | IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", |
297 | __FUNCTION__ , self->io.fir_base); | 297 | __func__ , self->io.fir_base); |
298 | release_region(self->io.fir_base, self->io.fir_ext); | 298 | release_region(self->io.fir_base, self->io.fir_ext); |
299 | 299 | ||
300 | if (self->tx_buff.head) | 300 | if (self->tx_buff.head) |
@@ -316,7 +316,7 @@ int w83977af_probe( int iobase, int irq, int dma) | |||
316 | int i; | 316 | int i; |
317 | 317 | ||
318 | for (i=0; i < 2; i++) { | 318 | for (i=0; i < 2; i++) { |
319 | IRDA_DEBUG( 0, "%s()\n", __FUNCTION__ ); | 319 | IRDA_DEBUG( 0, "%s()\n", __func__ ); |
320 | #ifdef CONFIG_USE_W977_PNP | 320 | #ifdef CONFIG_USE_W977_PNP |
321 | /* Enter PnP configuration mode */ | 321 | /* Enter PnP configuration mode */ |
322 | w977_efm_enter(efbase[i]); | 322 | w977_efm_enter(efbase[i]); |
@@ -403,7 +403,7 @@ int w83977af_probe( int iobase, int irq, int dma) | |||
403 | return 0; | 403 | return 0; |
404 | } else { | 404 | } else { |
405 | /* Try next extented function register address */ | 405 | /* Try next extented function register address */ |
406 | IRDA_DEBUG( 0, "%s(), Wrong chip version", __FUNCTION__ ); | 406 | IRDA_DEBUG( 0, "%s(), Wrong chip version", __func__ ); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | return -1; | 409 | return -1; |
@@ -439,19 +439,19 @@ void w83977af_change_speed(struct w83977af_ir *self, __u32 speed) | |||
439 | case 115200: outb(0x01, iobase+ABLL); break; | 439 | case 115200: outb(0x01, iobase+ABLL); break; |
440 | case 576000: | 440 | case 576000: |
441 | ir_mode = HCR_MIR_576; | 441 | ir_mode = HCR_MIR_576; |
442 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__ ); | 442 | IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __func__ ); |
443 | break; | 443 | break; |
444 | case 1152000: | 444 | case 1152000: |
445 | ir_mode = HCR_MIR_1152; | 445 | ir_mode = HCR_MIR_1152; |
446 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__ ); | 446 | IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __func__ ); |
447 | break; | 447 | break; |
448 | case 4000000: | 448 | case 4000000: |
449 | ir_mode = HCR_FIR; | 449 | ir_mode = HCR_FIR; |
450 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__ ); | 450 | IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __func__ ); |
451 | break; | 451 | break; |
452 | default: | 452 | default: |
453 | ir_mode = HCR_FIR; | 453 | ir_mode = HCR_FIR; |
454 | IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", __FUNCTION__ , speed); | 454 | IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", __func__ , speed); |
455 | break; | 455 | break; |
456 | } | 456 | } |
457 | 457 | ||
@@ -501,7 +501,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
501 | 501 | ||
502 | iobase = self->io.fir_base; | 502 | iobase = self->io.fir_base; |
503 | 503 | ||
504 | IRDA_DEBUG(4, "%s(%ld), skb->len=%d\n", __FUNCTION__ , jiffies, | 504 | IRDA_DEBUG(4, "%s(%ld), skb->len=%d\n", __func__ , jiffies, |
505 | (int) skb->len); | 505 | (int) skb->len); |
506 | 506 | ||
507 | /* Lock transmit buffer */ | 507 | /* Lock transmit buffer */ |
@@ -549,7 +549,7 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev) | |||
549 | outb(ICR_ETMRI, iobase+ICR); | 549 | outb(ICR_ETMRI, iobase+ICR); |
550 | } else { | 550 | } else { |
551 | #endif | 551 | #endif |
552 | IRDA_DEBUG(4, "%s(%ld), mtt=%d\n", __FUNCTION__ , jiffies, mtt); | 552 | IRDA_DEBUG(4, "%s(%ld), mtt=%d\n", __func__ , jiffies, mtt); |
553 | if (mtt) | 553 | if (mtt) |
554 | udelay(mtt); | 554 | udelay(mtt); |
555 | 555 | ||
@@ -591,7 +591,7 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase) | |||
591 | unsigned long flags; | 591 | unsigned long flags; |
592 | __u8 hcr; | 592 | __u8 hcr; |
593 | #endif | 593 | #endif |
594 | IRDA_DEBUG(4, "%s(), len=%d\n", __FUNCTION__ , self->tx_buff.len); | 594 | IRDA_DEBUG(4, "%s(), len=%d\n", __func__ , self->tx_buff.len); |
595 | 595 | ||
596 | /* Save current set */ | 596 | /* Save current set */ |
597 | set = inb(iobase+SSR); | 597 | set = inb(iobase+SSR); |
@@ -643,7 +643,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
643 | int actual = 0; | 643 | int actual = 0; |
644 | __u8 set; | 644 | __u8 set; |
645 | 645 | ||
646 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 646 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
647 | 647 | ||
648 | /* Save current bank */ | 648 | /* Save current bank */ |
649 | set = inb(iobase+SSR); | 649 | set = inb(iobase+SSR); |
@@ -651,11 +651,11 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
651 | switch_bank(iobase, SET0); | 651 | switch_bank(iobase, SET0); |
652 | if (!(inb_p(iobase+USR) & USR_TSRE)) { | 652 | if (!(inb_p(iobase+USR) & USR_TSRE)) { |
653 | IRDA_DEBUG(4, | 653 | IRDA_DEBUG(4, |
654 | "%s(), warning, FIFO not empty yet!\n", __FUNCTION__ ); | 654 | "%s(), warning, FIFO not empty yet!\n", __func__ ); |
655 | 655 | ||
656 | fifo_size -= 17; | 656 | fifo_size -= 17; |
657 | IRDA_DEBUG(4, "%s(), %d bytes left in tx fifo\n", | 657 | IRDA_DEBUG(4, "%s(), %d bytes left in tx fifo\n", |
658 | __FUNCTION__ , fifo_size); | 658 | __func__ , fifo_size); |
659 | } | 659 | } |
660 | 660 | ||
661 | /* Fill FIFO with current frame */ | 661 | /* Fill FIFO with current frame */ |
@@ -665,7 +665,7 @@ static int w83977af_pio_write(int iobase, __u8 *buf, int len, int fifo_size) | |||
665 | } | 665 | } |
666 | 666 | ||
667 | IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", | 667 | IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", |
668 | __FUNCTION__ , fifo_size, actual, len); | 668 | __func__ , fifo_size, actual, len); |
669 | 669 | ||
670 | /* Restore bank */ | 670 | /* Restore bank */ |
671 | outb(set, iobase+SSR); | 671 | outb(set, iobase+SSR); |
@@ -685,7 +685,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self) | |||
685 | int iobase; | 685 | int iobase; |
686 | __u8 set; | 686 | __u8 set; |
687 | 687 | ||
688 | IRDA_DEBUG(4, "%s(%ld)\n", __FUNCTION__ , jiffies); | 688 | IRDA_DEBUG(4, "%s(%ld)\n", __func__ , jiffies); |
689 | 689 | ||
690 | IRDA_ASSERT(self != NULL, return;); | 690 | IRDA_ASSERT(self != NULL, return;); |
691 | 691 | ||
@@ -700,7 +700,7 @@ static void w83977af_dma_xmit_complete(struct w83977af_ir *self) | |||
700 | 700 | ||
701 | /* Check for underrrun! */ | 701 | /* Check for underrrun! */ |
702 | if (inb(iobase+AUDR) & AUDR_UNDR) { | 702 | if (inb(iobase+AUDR) & AUDR_UNDR) { |
703 | IRDA_DEBUG(0, "%s(), Transmit underrun!\n", __FUNCTION__ ); | 703 | IRDA_DEBUG(0, "%s(), Transmit underrun!\n", __func__ ); |
704 | 704 | ||
705 | self->stats.tx_errors++; | 705 | self->stats.tx_errors++; |
706 | self->stats.tx_fifo_errors++; | 706 | self->stats.tx_fifo_errors++; |
@@ -741,7 +741,7 @@ int w83977af_dma_receive(struct w83977af_ir *self) | |||
741 | #endif | 741 | #endif |
742 | IRDA_ASSERT(self != NULL, return -1;); | 742 | IRDA_ASSERT(self != NULL, return -1;); |
743 | 743 | ||
744 | IRDA_DEBUG(4, "%s\n", __FUNCTION__ ); | 744 | IRDA_DEBUG(4, "%s\n", __func__ ); |
745 | 745 | ||
746 | iobase= self->io.fir_base; | 746 | iobase= self->io.fir_base; |
747 | 747 | ||
@@ -812,7 +812,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self) | |||
812 | __u8 set; | 812 | __u8 set; |
813 | __u8 status; | 813 | __u8 status; |
814 | 814 | ||
815 | IRDA_DEBUG(4, "%s\n", __FUNCTION__ ); | 815 | IRDA_DEBUG(4, "%s\n", __func__ ); |
816 | 816 | ||
817 | st_fifo = &self->st_fifo; | 817 | st_fifo = &self->st_fifo; |
818 | 818 | ||
@@ -892,7 +892,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self) | |||
892 | skb = dev_alloc_skb(len+1); | 892 | skb = dev_alloc_skb(len+1); |
893 | if (skb == NULL) { | 893 | if (skb == NULL) { |
894 | printk(KERN_INFO | 894 | printk(KERN_INFO |
895 | "%s(), memory squeeze, dropping frame.\n", __FUNCTION__); | 895 | "%s(), memory squeeze, dropping frame.\n", __func__); |
896 | /* Restore set register */ | 896 | /* Restore set register */ |
897 | outb(set, iobase+SSR); | 897 | outb(set, iobase+SSR); |
898 | 898 | ||
@@ -943,7 +943,7 @@ static void w83977af_pio_receive(struct w83977af_ir *self) | |||
943 | __u8 byte = 0x00; | 943 | __u8 byte = 0x00; |
944 | int iobase; | 944 | int iobase; |
945 | 945 | ||
946 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); | 946 | IRDA_DEBUG(4, "%s()\n", __func__ ); |
947 | 947 | ||
948 | IRDA_ASSERT(self != NULL, return;); | 948 | IRDA_ASSERT(self != NULL, return;); |
949 | 949 | ||
@@ -970,7 +970,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr) | |||
970 | __u8 set; | 970 | __u8 set; |
971 | int iobase; | 971 | int iobase; |
972 | 972 | ||
973 | IRDA_DEBUG(4, "%s(), isr=%#x\n", __FUNCTION__ , isr); | 973 | IRDA_DEBUG(4, "%s(), isr=%#x\n", __func__ , isr); |
974 | 974 | ||
975 | iobase = self->io.fir_base; | 975 | iobase = self->io.fir_base; |
976 | /* Transmit FIFO low on data */ | 976 | /* Transmit FIFO low on data */ |
@@ -1007,7 +1007,7 @@ static __u8 w83977af_sir_interrupt(struct w83977af_ir *self, int isr) | |||
1007 | /* Check if we need to change the speed? */ | 1007 | /* Check if we need to change the speed? */ |
1008 | if (self->new_speed) { | 1008 | if (self->new_speed) { |
1009 | IRDA_DEBUG(2, | 1009 | IRDA_DEBUG(2, |
1010 | "%s(), Changing speed!\n", __FUNCTION__ ); | 1010 | "%s(), Changing speed!\n", __func__ ); |
1011 | w83977af_change_speed(self, self->new_speed); | 1011 | w83977af_change_speed(self, self->new_speed); |
1012 | self->new_speed = 0; | 1012 | self->new_speed = 0; |
1013 | } | 1013 | } |
@@ -1189,7 +1189,7 @@ static int w83977af_net_open(struct net_device *dev) | |||
1189 | char hwname[32]; | 1189 | char hwname[32]; |
1190 | __u8 set; | 1190 | __u8 set; |
1191 | 1191 | ||
1192 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 1192 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
1193 | 1193 | ||
1194 | IRDA_ASSERT(dev != NULL, return -1;); | 1194 | IRDA_ASSERT(dev != NULL, return -1;); |
1195 | self = (struct w83977af_ir *) dev->priv; | 1195 | self = (struct w83977af_ir *) dev->priv; |
@@ -1252,7 +1252,7 @@ static int w83977af_net_close(struct net_device *dev) | |||
1252 | int iobase; | 1252 | int iobase; |
1253 | __u8 set; | 1253 | __u8 set; |
1254 | 1254 | ||
1255 | IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); | 1255 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
1256 | 1256 | ||
1257 | IRDA_ASSERT(dev != NULL, return -1;); | 1257 | IRDA_ASSERT(dev != NULL, return -1;); |
1258 | 1258 | ||
@@ -1307,7 +1307,7 @@ static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1307 | 1307 | ||
1308 | IRDA_ASSERT(self != NULL, return -1;); | 1308 | IRDA_ASSERT(self != NULL, return -1;); |
1309 | 1309 | ||
1310 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__ , dev->name, cmd); | 1310 | IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __func__ , dev->name, cmd); |
1311 | 1311 | ||
1312 | spin_lock_irqsave(&self->lock, flags); | 1312 | spin_lock_irqsave(&self->lock, flags); |
1313 | 1313 | ||
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 8a97a0066a88..46819af3b062 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -55,7 +55,7 @@ | |||
55 | #include <asm/system.h> | 55 | #include <asm/system.h> |
56 | 56 | ||
57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; | 57 | static char mv643xx_eth_driver_name[] = "mv643xx_eth"; |
58 | static char mv643xx_eth_driver_version[] = "1.1"; | 58 | static char mv643xx_eth_driver_version[] = "1.2"; |
59 | 59 | ||
60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX | 60 | #define MV643XX_ETH_CHECKSUM_OFFLOAD_TX |
61 | #define MV643XX_ETH_NAPI | 61 | #define MV643XX_ETH_NAPI |
@@ -90,12 +90,21 @@ static char mv643xx_eth_driver_version[] = "1.1"; | |||
90 | #define PORT_SERIAL_CONTROL(p) (0x043c + ((p) << 10)) | 90 | #define PORT_SERIAL_CONTROL(p) (0x043c + ((p) << 10)) |
91 | #define PORT_STATUS(p) (0x0444 + ((p) << 10)) | 91 | #define PORT_STATUS(p) (0x0444 + ((p) << 10)) |
92 | #define TX_FIFO_EMPTY 0x00000400 | 92 | #define TX_FIFO_EMPTY 0x00000400 |
93 | #define TX_IN_PROGRESS 0x00000080 | ||
94 | #define PORT_SPEED_MASK 0x00000030 | ||
95 | #define PORT_SPEED_1000 0x00000010 | ||
96 | #define PORT_SPEED_100 0x00000020 | ||
97 | #define PORT_SPEED_10 0x00000000 | ||
98 | #define FLOW_CONTROL_ENABLED 0x00000008 | ||
99 | #define FULL_DUPLEX 0x00000004 | ||
100 | #define LINK_UP 0x00000002 | ||
93 | #define TXQ_COMMAND(p) (0x0448 + ((p) << 10)) | 101 | #define TXQ_COMMAND(p) (0x0448 + ((p) << 10)) |
94 | #define TXQ_FIX_PRIO_CONF(p) (0x044c + ((p) << 10)) | 102 | #define TXQ_FIX_PRIO_CONF(p) (0x044c + ((p) << 10)) |
95 | #define TX_BW_RATE(p) (0x0450 + ((p) << 10)) | 103 | #define TX_BW_RATE(p) (0x0450 + ((p) << 10)) |
96 | #define TX_BW_MTU(p) (0x0458 + ((p) << 10)) | 104 | #define TX_BW_MTU(p) (0x0458 + ((p) << 10)) |
97 | #define TX_BW_BURST(p) (0x045c + ((p) << 10)) | 105 | #define TX_BW_BURST(p) (0x045c + ((p) << 10)) |
98 | #define INT_CAUSE(p) (0x0460 + ((p) << 10)) | 106 | #define INT_CAUSE(p) (0x0460 + ((p) << 10)) |
107 | #define INT_TX_END_0 0x00080000 | ||
99 | #define INT_TX_END 0x07f80000 | 108 | #define INT_TX_END 0x07f80000 |
100 | #define INT_RX 0x0007fbfc | 109 | #define INT_RX 0x0007fbfc |
101 | #define INT_EXT 0x00000002 | 110 | #define INT_EXT 0x00000002 |
@@ -127,21 +136,21 @@ static char mv643xx_eth_driver_version[] = "1.1"; | |||
127 | /* | 136 | /* |
128 | * SDMA configuration register. | 137 | * SDMA configuration register. |
129 | */ | 138 | */ |
130 | #define RX_BURST_SIZE_4_64BIT (2 << 1) | 139 | #define RX_BURST_SIZE_16_64BIT (4 << 1) |
131 | #define BLM_RX_NO_SWAP (1 << 4) | 140 | #define BLM_RX_NO_SWAP (1 << 4) |
132 | #define BLM_TX_NO_SWAP (1 << 5) | 141 | #define BLM_TX_NO_SWAP (1 << 5) |
133 | #define TX_BURST_SIZE_4_64BIT (2 << 22) | 142 | #define TX_BURST_SIZE_16_64BIT (4 << 22) |
134 | 143 | ||
135 | #if defined(__BIG_ENDIAN) | 144 | #if defined(__BIG_ENDIAN) |
136 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 145 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
137 | RX_BURST_SIZE_4_64BIT | \ | 146 | RX_BURST_SIZE_16_64BIT | \ |
138 | TX_BURST_SIZE_4_64BIT | 147 | TX_BURST_SIZE_16_64BIT |
139 | #elif defined(__LITTLE_ENDIAN) | 148 | #elif defined(__LITTLE_ENDIAN) |
140 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 149 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
141 | RX_BURST_SIZE_4_64BIT | \ | 150 | RX_BURST_SIZE_16_64BIT | \ |
142 | BLM_RX_NO_SWAP | \ | 151 | BLM_RX_NO_SWAP | \ |
143 | BLM_TX_NO_SWAP | \ | 152 | BLM_TX_NO_SWAP | \ |
144 | TX_BURST_SIZE_4_64BIT | 153 | TX_BURST_SIZE_16_64BIT |
145 | #else | 154 | #else |
146 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined | 155 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined |
147 | #endif | 156 | #endif |
@@ -153,9 +162,7 @@ static char mv643xx_eth_driver_version[] = "1.1"; | |||
153 | #define SET_MII_SPEED_TO_100 (1 << 24) | 162 | #define SET_MII_SPEED_TO_100 (1 << 24) |
154 | #define SET_GMII_SPEED_TO_1000 (1 << 23) | 163 | #define SET_GMII_SPEED_TO_1000 (1 << 23) |
155 | #define SET_FULL_DUPLEX_MODE (1 << 21) | 164 | #define SET_FULL_DUPLEX_MODE (1 << 21) |
156 | #define MAX_RX_PACKET_1522BYTE (1 << 17) | ||
157 | #define MAX_RX_PACKET_9700BYTE (5 << 17) | 165 | #define MAX_RX_PACKET_9700BYTE (5 << 17) |
158 | #define MAX_RX_PACKET_MASK (7 << 17) | ||
159 | #define DISABLE_AUTO_NEG_SPEED_GMII (1 << 13) | 166 | #define DISABLE_AUTO_NEG_SPEED_GMII (1 << 13) |
160 | #define DO_NOT_FORCE_LINK_FAIL (1 << 10) | 167 | #define DO_NOT_FORCE_LINK_FAIL (1 << 10) |
161 | #define SERIAL_PORT_CONTROL_RESERVED (1 << 9) | 168 | #define SERIAL_PORT_CONTROL_RESERVED (1 << 9) |
@@ -228,6 +235,8 @@ struct tx_desc { | |||
228 | #define GEN_IP_V4_CHECKSUM 0x00040000 | 235 | #define GEN_IP_V4_CHECKSUM 0x00040000 |
229 | #define GEN_TCP_UDP_CHECKSUM 0x00020000 | 236 | #define GEN_TCP_UDP_CHECKSUM 0x00020000 |
230 | #define UDP_FRAME 0x00010000 | 237 | #define UDP_FRAME 0x00010000 |
238 | #define MAC_HDR_EXTRA_4_BYTES 0x00008000 | ||
239 | #define MAC_HDR_EXTRA_8_BYTES 0x00000200 | ||
231 | 240 | ||
232 | #define TX_IHL_SHIFT 11 | 241 | #define TX_IHL_SHIFT 11 |
233 | 242 | ||
@@ -404,6 +413,17 @@ static void rxq_disable(struct rx_queue *rxq) | |||
404 | udelay(10); | 413 | udelay(10); |
405 | } | 414 | } |
406 | 415 | ||
416 | static void txq_reset_hw_ptr(struct tx_queue *txq) | ||
417 | { | ||
418 | struct mv643xx_eth_private *mp = txq_to_mp(txq); | ||
419 | int off = TXQ_CURRENT_DESC_PTR(mp->port_num, txq->index); | ||
420 | u32 addr; | ||
421 | |||
422 | addr = (u32)txq->tx_desc_dma; | ||
423 | addr += txq->tx_curr_desc * sizeof(struct tx_desc); | ||
424 | wrl(mp, off, addr); | ||
425 | } | ||
426 | |||
407 | static void txq_enable(struct tx_queue *txq) | 427 | static void txq_enable(struct tx_queue *txq) |
408 | { | 428 | { |
409 | struct mv643xx_eth_private *mp = txq_to_mp(txq); | 429 | struct mv643xx_eth_private *mp = txq_to_mp(txq); |
@@ -614,6 +634,12 @@ static int mv643xx_eth_poll(struct napi_struct *napi, int budget) | |||
614 | for (i = 0; i < 8; i++) | 634 | for (i = 0; i < 8; i++) |
615 | if (mp->txq_mask & (1 << i)) | 635 | if (mp->txq_mask & (1 << i)) |
616 | txq_reclaim(mp->txq + i, 0); | 636 | txq_reclaim(mp->txq + i, 0); |
637 | |||
638 | if (netif_carrier_ok(mp->dev)) { | ||
639 | spin_lock(&mp->lock); | ||
640 | __txq_maybe_wake(mp->txq + mp->txq_primary); | ||
641 | spin_unlock(&mp->lock); | ||
642 | } | ||
617 | } | 643 | } |
618 | #endif | 644 | #endif |
619 | 645 | ||
@@ -706,6 +732,7 @@ static inline __be16 sum16_as_be(__sum16 sum) | |||
706 | 732 | ||
707 | static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) | 733 | static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) |
708 | { | 734 | { |
735 | struct mv643xx_eth_private *mp = txq_to_mp(txq); | ||
709 | int nr_frags = skb_shinfo(skb)->nr_frags; | 736 | int nr_frags = skb_shinfo(skb)->nr_frags; |
710 | int tx_index; | 737 | int tx_index; |
711 | struct tx_desc *desc; | 738 | struct tx_desc *desc; |
@@ -732,12 +759,36 @@ static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
732 | desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE); | 759 | desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE); |
733 | 760 | ||
734 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 761 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
735 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | 762 | int mac_hdr_len; |
763 | |||
764 | BUG_ON(skb->protocol != htons(ETH_P_IP) && | ||
765 | skb->protocol != htons(ETH_P_8021Q)); | ||
736 | 766 | ||
737 | cmd_sts |= GEN_TCP_UDP_CHECKSUM | | 767 | cmd_sts |= GEN_TCP_UDP_CHECKSUM | |
738 | GEN_IP_V4_CHECKSUM | | 768 | GEN_IP_V4_CHECKSUM | |
739 | ip_hdr(skb)->ihl << TX_IHL_SHIFT; | 769 | ip_hdr(skb)->ihl << TX_IHL_SHIFT; |
740 | 770 | ||
771 | mac_hdr_len = (void *)ip_hdr(skb) - (void *)skb->data; | ||
772 | switch (mac_hdr_len - ETH_HLEN) { | ||
773 | case 0: | ||
774 | break; | ||
775 | case 4: | ||
776 | cmd_sts |= MAC_HDR_EXTRA_4_BYTES; | ||
777 | break; | ||
778 | case 8: | ||
779 | cmd_sts |= MAC_HDR_EXTRA_8_BYTES; | ||
780 | break; | ||
781 | case 12: | ||
782 | cmd_sts |= MAC_HDR_EXTRA_4_BYTES; | ||
783 | cmd_sts |= MAC_HDR_EXTRA_8_BYTES; | ||
784 | break; | ||
785 | default: | ||
786 | if (net_ratelimit()) | ||
787 | dev_printk(KERN_ERR, &txq_to_mp(txq)->dev->dev, | ||
788 | "mac header length is %d?!\n", mac_hdr_len); | ||
789 | break; | ||
790 | } | ||
791 | |||
741 | switch (ip_hdr(skb)->protocol) { | 792 | switch (ip_hdr(skb)->protocol) { |
742 | case IPPROTO_UDP: | 793 | case IPPROTO_UDP: |
743 | cmd_sts |= UDP_FRAME; | 794 | cmd_sts |= UDP_FRAME; |
@@ -759,6 +810,10 @@ static void txq_submit_skb(struct tx_queue *txq, struct sk_buff *skb) | |||
759 | wmb(); | 810 | wmb(); |
760 | desc->cmd_sts = cmd_sts; | 811 | desc->cmd_sts = cmd_sts; |
761 | 812 | ||
813 | /* clear TX_END interrupt status */ | ||
814 | wrl(mp, INT_CAUSE(mp->port_num), ~(INT_TX_END_0 << txq->index)); | ||
815 | rdl(mp, INT_CAUSE(mp->port_num)); | ||
816 | |||
762 | /* ensure all descriptors are written before poking hardware */ | 817 | /* ensure all descriptors are written before poking hardware */ |
763 | wmb(); | 818 | wmb(); |
764 | txq_enable(txq); | 819 | txq_enable(txq); |
@@ -1112,10 +1167,28 @@ static int mv643xx_eth_get_settings(struct net_device *dev, struct ethtool_cmd * | |||
1112 | 1167 | ||
1113 | static int mv643xx_eth_get_settings_phyless(struct net_device *dev, struct ethtool_cmd *cmd) | 1168 | static int mv643xx_eth_get_settings_phyless(struct net_device *dev, struct ethtool_cmd *cmd) |
1114 | { | 1169 | { |
1170 | struct mv643xx_eth_private *mp = netdev_priv(dev); | ||
1171 | u32 port_status; | ||
1172 | |||
1173 | port_status = rdl(mp, PORT_STATUS(mp->port_num)); | ||
1174 | |||
1115 | cmd->supported = SUPPORTED_MII; | 1175 | cmd->supported = SUPPORTED_MII; |
1116 | cmd->advertising = ADVERTISED_MII; | 1176 | cmd->advertising = ADVERTISED_MII; |
1117 | cmd->speed = SPEED_1000; | 1177 | switch (port_status & PORT_SPEED_MASK) { |
1118 | cmd->duplex = DUPLEX_FULL; | 1178 | case PORT_SPEED_10: |
1179 | cmd->speed = SPEED_10; | ||
1180 | break; | ||
1181 | case PORT_SPEED_100: | ||
1182 | cmd->speed = SPEED_100; | ||
1183 | break; | ||
1184 | case PORT_SPEED_1000: | ||
1185 | cmd->speed = SPEED_1000; | ||
1186 | break; | ||
1187 | default: | ||
1188 | cmd->speed = -1; | ||
1189 | break; | ||
1190 | } | ||
1191 | cmd->duplex = (port_status & FULL_DUPLEX) ? DUPLEX_FULL : DUPLEX_HALF; | ||
1119 | cmd->port = PORT_MII; | 1192 | cmd->port = PORT_MII; |
1120 | cmd->phy_address = 0; | 1193 | cmd->phy_address = 0; |
1121 | cmd->transceiver = XCVR_INTERNAL; | 1194 | cmd->transceiver = XCVR_INTERNAL; |
@@ -1539,8 +1612,11 @@ static int txq_init(struct mv643xx_eth_private *mp, int index) | |||
1539 | 1612 | ||
1540 | tx_desc = (struct tx_desc *)txq->tx_desc_area; | 1613 | tx_desc = (struct tx_desc *)txq->tx_desc_area; |
1541 | for (i = 0; i < txq->tx_ring_size; i++) { | 1614 | for (i = 0; i < txq->tx_ring_size; i++) { |
1615 | struct tx_desc *txd = tx_desc + i; | ||
1542 | int nexti = (i + 1) % txq->tx_ring_size; | 1616 | int nexti = (i + 1) % txq->tx_ring_size; |
1543 | tx_desc[i].next_desc_ptr = txq->tx_desc_dma + | 1617 | |
1618 | txd->cmd_sts = 0; | ||
1619 | txd->next_desc_ptr = txq->tx_desc_dma + | ||
1544 | nexti * sizeof(struct tx_desc); | 1620 | nexti * sizeof(struct tx_desc); |
1545 | } | 1621 | } |
1546 | 1622 | ||
@@ -1577,8 +1653,11 @@ static void txq_reclaim(struct tx_queue *txq, int force) | |||
1577 | desc = &txq->tx_desc_area[tx_index]; | 1653 | desc = &txq->tx_desc_area[tx_index]; |
1578 | cmd_sts = desc->cmd_sts; | 1654 | cmd_sts = desc->cmd_sts; |
1579 | 1655 | ||
1580 | if (!force && (cmd_sts & BUFFER_OWNED_BY_DMA)) | 1656 | if (cmd_sts & BUFFER_OWNED_BY_DMA) { |
1581 | break; | 1657 | if (!force) |
1658 | break; | ||
1659 | desc->cmd_sts = cmd_sts & ~BUFFER_OWNED_BY_DMA; | ||
1660 | } | ||
1582 | 1661 | ||
1583 | txq->tx_used_desc = (tx_index + 1) % txq->tx_ring_size; | 1662 | txq->tx_used_desc = (tx_index + 1) % txq->tx_ring_size; |
1584 | txq->tx_desc_count--; | 1663 | txq->tx_desc_count--; |
@@ -1632,49 +1711,61 @@ static void txq_deinit(struct tx_queue *txq) | |||
1632 | 1711 | ||
1633 | 1712 | ||
1634 | /* netdev ops and related ***************************************************/ | 1713 | /* netdev ops and related ***************************************************/ |
1635 | static void update_pscr(struct mv643xx_eth_private *mp, int speed, int duplex) | 1714 | static void handle_link_event(struct mv643xx_eth_private *mp) |
1636 | { | 1715 | { |
1637 | u32 pscr_o; | 1716 | struct net_device *dev = mp->dev; |
1638 | u32 pscr_n; | 1717 | u32 port_status; |
1639 | 1718 | int speed; | |
1640 | pscr_o = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); | 1719 | int duplex; |
1720 | int fc; | ||
1721 | |||
1722 | port_status = rdl(mp, PORT_STATUS(mp->port_num)); | ||
1723 | if (!(port_status & LINK_UP)) { | ||
1724 | if (netif_carrier_ok(dev)) { | ||
1725 | int i; | ||
1641 | 1726 | ||
1642 | /* clear speed, duplex and rx buffer size fields */ | 1727 | printk(KERN_INFO "%s: link down\n", dev->name); |
1643 | pscr_n = pscr_o & ~(SET_MII_SPEED_TO_100 | | ||
1644 | SET_GMII_SPEED_TO_1000 | | ||
1645 | SET_FULL_DUPLEX_MODE | | ||
1646 | MAX_RX_PACKET_MASK); | ||
1647 | 1728 | ||
1648 | if (speed == SPEED_1000) { | 1729 | netif_carrier_off(dev); |
1649 | pscr_n |= SET_GMII_SPEED_TO_1000 | MAX_RX_PACKET_9700BYTE; | 1730 | netif_stop_queue(dev); |
1650 | } else { | ||
1651 | if (speed == SPEED_100) | ||
1652 | pscr_n |= SET_MII_SPEED_TO_100; | ||
1653 | pscr_n |= MAX_RX_PACKET_1522BYTE; | ||
1654 | } | ||
1655 | 1731 | ||
1656 | if (duplex == DUPLEX_FULL) | 1732 | for (i = 0; i < 8; i++) { |
1657 | pscr_n |= SET_FULL_DUPLEX_MODE; | 1733 | struct tx_queue *txq = mp->txq + i; |
1658 | 1734 | ||
1659 | if (pscr_n != pscr_o) { | 1735 | if (mp->txq_mask & (1 << i)) { |
1660 | if ((pscr_o & SERIAL_PORT_ENABLE) == 0) | 1736 | txq_reclaim(txq, 1); |
1661 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n); | 1737 | txq_reset_hw_ptr(txq); |
1662 | else { | 1738 | } |
1663 | int i; | 1739 | } |
1740 | } | ||
1741 | return; | ||
1742 | } | ||
1664 | 1743 | ||
1665 | for (i = 0; i < 8; i++) | 1744 | switch (port_status & PORT_SPEED_MASK) { |
1666 | if (mp->txq_mask & (1 << i)) | 1745 | case PORT_SPEED_10: |
1667 | txq_disable(mp->txq + i); | 1746 | speed = 10; |
1747 | break; | ||
1748 | case PORT_SPEED_100: | ||
1749 | speed = 100; | ||
1750 | break; | ||
1751 | case PORT_SPEED_1000: | ||
1752 | speed = 1000; | ||
1753 | break; | ||
1754 | default: | ||
1755 | speed = -1; | ||
1756 | break; | ||
1757 | } | ||
1758 | duplex = (port_status & FULL_DUPLEX) ? 1 : 0; | ||
1759 | fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0; | ||
1668 | 1760 | ||
1669 | pscr_o &= ~SERIAL_PORT_ENABLE; | 1761 | printk(KERN_INFO "%s: link up, %d Mb/s, %s duplex, " |
1670 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_o); | 1762 | "flow control %sabled\n", dev->name, |
1671 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n); | 1763 | speed, duplex ? "full" : "half", |
1672 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr_n); | 1764 | fc ? "en" : "dis"); |
1673 | 1765 | ||
1674 | for (i = 0; i < 8; i++) | 1766 | if (!netif_carrier_ok(dev)) { |
1675 | if (mp->txq_mask & (1 << i)) | 1767 | netif_carrier_on(dev); |
1676 | txq_enable(mp->txq + i); | 1768 | netif_wake_queue(dev); |
1677 | } | ||
1678 | } | 1769 | } |
1679 | } | 1770 | } |
1680 | 1771 | ||
@@ -1684,7 +1775,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1684 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 1775 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
1685 | u32 int_cause; | 1776 | u32 int_cause; |
1686 | u32 int_cause_ext; | 1777 | u32 int_cause_ext; |
1687 | u32 txq_active; | ||
1688 | 1778 | ||
1689 | int_cause = rdl(mp, INT_CAUSE(mp->port_num)) & | 1779 | int_cause = rdl(mp, INT_CAUSE(mp->port_num)) & |
1690 | (INT_TX_END | INT_RX | INT_EXT); | 1780 | (INT_TX_END | INT_RX | INT_EXT); |
@@ -1698,30 +1788,8 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1698 | wrl(mp, INT_CAUSE_EXT(mp->port_num), ~int_cause_ext); | 1788 | wrl(mp, INT_CAUSE_EXT(mp->port_num), ~int_cause_ext); |
1699 | } | 1789 | } |
1700 | 1790 | ||
1701 | if (int_cause_ext & (INT_EXT_PHY | INT_EXT_LINK)) { | 1791 | if (int_cause_ext & (INT_EXT_PHY | INT_EXT_LINK)) |
1702 | if (mp->phy_addr == -1 || mii_link_ok(&mp->mii)) { | 1792 | handle_link_event(mp); |
1703 | int i; | ||
1704 | |||
1705 | if (mp->phy_addr != -1) { | ||
1706 | struct ethtool_cmd cmd; | ||
1707 | |||
1708 | mii_ethtool_gset(&mp->mii, &cmd); | ||
1709 | update_pscr(mp, cmd.speed, cmd.duplex); | ||
1710 | } | ||
1711 | |||
1712 | for (i = 0; i < 8; i++) | ||
1713 | if (mp->txq_mask & (1 << i)) | ||
1714 | txq_enable(mp->txq + i); | ||
1715 | |||
1716 | if (!netif_carrier_ok(dev)) { | ||
1717 | netif_carrier_on(dev); | ||
1718 | __txq_maybe_wake(mp->txq + mp->txq_primary); | ||
1719 | } | ||
1720 | } else if (netif_carrier_ok(dev)) { | ||
1721 | netif_stop_queue(dev); | ||
1722 | netif_carrier_off(dev); | ||
1723 | } | ||
1724 | } | ||
1725 | 1793 | ||
1726 | /* | 1794 | /* |
1727 | * RxBuffer or RxError set for any of the 8 queues? | 1795 | * RxBuffer or RxError set for any of the 8 queues? |
@@ -1743,8 +1811,6 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1743 | } | 1811 | } |
1744 | #endif | 1812 | #endif |
1745 | 1813 | ||
1746 | txq_active = rdl(mp, TXQ_COMMAND(mp->port_num)); | ||
1747 | |||
1748 | /* | 1814 | /* |
1749 | * TxBuffer or TxError set for any of the 8 queues? | 1815 | * TxBuffer or TxError set for any of the 8 queues? |
1750 | */ | 1816 | */ |
@@ -1754,6 +1820,16 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1754 | for (i = 0; i < 8; i++) | 1820 | for (i = 0; i < 8; i++) |
1755 | if (mp->txq_mask & (1 << i)) | 1821 | if (mp->txq_mask & (1 << i)) |
1756 | txq_reclaim(mp->txq + i, 0); | 1822 | txq_reclaim(mp->txq + i, 0); |
1823 | |||
1824 | /* | ||
1825 | * Enough space again in the primary TX queue for a | ||
1826 | * full packet? | ||
1827 | */ | ||
1828 | if (netif_carrier_ok(dev)) { | ||
1829 | spin_lock(&mp->lock); | ||
1830 | __txq_maybe_wake(mp->txq + mp->txq_primary); | ||
1831 | spin_unlock(&mp->lock); | ||
1832 | } | ||
1757 | } | 1833 | } |
1758 | 1834 | ||
1759 | /* | 1835 | /* |
@@ -1763,19 +1839,25 @@ static irqreturn_t mv643xx_eth_irq(int irq, void *dev_id) | |||
1763 | int i; | 1839 | int i; |
1764 | 1840 | ||
1765 | wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_TX_END)); | 1841 | wrl(mp, INT_CAUSE(mp->port_num), ~(int_cause & INT_TX_END)); |
1842 | |||
1843 | spin_lock(&mp->lock); | ||
1766 | for (i = 0; i < 8; i++) { | 1844 | for (i = 0; i < 8; i++) { |
1767 | struct tx_queue *txq = mp->txq + i; | 1845 | struct tx_queue *txq = mp->txq + i; |
1768 | if (txq->tx_desc_count && !((txq_active >> i) & 1)) | 1846 | u32 hw_desc_ptr; |
1847 | u32 expected_ptr; | ||
1848 | |||
1849 | if ((int_cause & (INT_TX_END_0 << i)) == 0) | ||
1850 | continue; | ||
1851 | |||
1852 | hw_desc_ptr = | ||
1853 | rdl(mp, TXQ_CURRENT_DESC_PTR(mp->port_num, i)); | ||
1854 | expected_ptr = (u32)txq->tx_desc_dma + | ||
1855 | txq->tx_curr_desc * sizeof(struct tx_desc); | ||
1856 | |||
1857 | if (hw_desc_ptr != expected_ptr) | ||
1769 | txq_enable(txq); | 1858 | txq_enable(txq); |
1770 | } | 1859 | } |
1771 | } | 1860 | spin_unlock(&mp->lock); |
1772 | |||
1773 | /* | ||
1774 | * Enough space again in the primary TX queue for a full packet? | ||
1775 | */ | ||
1776 | if (int_cause_ext & INT_EXT_TX) { | ||
1777 | struct tx_queue *txq = mp->txq + mp->txq_primary; | ||
1778 | __txq_maybe_wake(txq); | ||
1779 | } | 1861 | } |
1780 | 1862 | ||
1781 | return IRQ_HANDLED; | 1863 | return IRQ_HANDLED; |
@@ -1785,14 +1867,14 @@ static void phy_reset(struct mv643xx_eth_private *mp) | |||
1785 | { | 1867 | { |
1786 | unsigned int data; | 1868 | unsigned int data; |
1787 | 1869 | ||
1788 | smi_reg_read(mp, mp->phy_addr, 0, &data); | 1870 | smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data); |
1789 | data |= 0x8000; | 1871 | data |= BMCR_RESET; |
1790 | smi_reg_write(mp, mp->phy_addr, 0, data); | 1872 | smi_reg_write(mp, mp->phy_addr, MII_BMCR, data); |
1791 | 1873 | ||
1792 | do { | 1874 | do { |
1793 | udelay(1); | 1875 | udelay(1); |
1794 | smi_reg_read(mp, mp->phy_addr, 0, &data); | 1876 | smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data); |
1795 | } while (data & 0x8000); | 1877 | } while (data & BMCR_RESET); |
1796 | } | 1878 | } |
1797 | 1879 | ||
1798 | static void port_start(struct mv643xx_eth_private *mp) | 1880 | static void port_start(struct mv643xx_eth_private *mp) |
@@ -1801,23 +1883,6 @@ static void port_start(struct mv643xx_eth_private *mp) | |||
1801 | int i; | 1883 | int i; |
1802 | 1884 | ||
1803 | /* | 1885 | /* |
1804 | * Configure basic link parameters. | ||
1805 | */ | ||
1806 | pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); | ||
1807 | pscr &= ~(SERIAL_PORT_ENABLE | FORCE_LINK_PASS); | ||
1808 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
1809 | pscr |= DISABLE_AUTO_NEG_FOR_FLOW_CTRL | | ||
1810 | DISABLE_AUTO_NEG_SPEED_GMII | | ||
1811 | DISABLE_AUTO_NEG_FOR_DUPLEX | | ||
1812 | DO_NOT_FORCE_LINK_FAIL | | ||
1813 | SERIAL_PORT_CONTROL_RESERVED; | ||
1814 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
1815 | pscr |= SERIAL_PORT_ENABLE; | ||
1816 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
1817 | |||
1818 | wrl(mp, SDMA_CONFIG(mp->port_num), PORT_SDMA_CONFIG_DEFAULT_VALUE); | ||
1819 | |||
1820 | /* | ||
1821 | * Perform PHY reset, if there is a PHY. | 1886 | * Perform PHY reset, if there is a PHY. |
1822 | */ | 1887 | */ |
1823 | if (mp->phy_addr != -1) { | 1888 | if (mp->phy_addr != -1) { |
@@ -1829,21 +1894,31 @@ static void port_start(struct mv643xx_eth_private *mp) | |||
1829 | } | 1894 | } |
1830 | 1895 | ||
1831 | /* | 1896 | /* |
1897 | * Configure basic link parameters. | ||
1898 | */ | ||
1899 | pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); | ||
1900 | |||
1901 | pscr |= SERIAL_PORT_ENABLE; | ||
1902 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
1903 | |||
1904 | pscr |= DO_NOT_FORCE_LINK_FAIL; | ||
1905 | if (mp->phy_addr == -1) | ||
1906 | pscr |= FORCE_LINK_PASS; | ||
1907 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
1908 | |||
1909 | wrl(mp, SDMA_CONFIG(mp->port_num), PORT_SDMA_CONFIG_DEFAULT_VALUE); | ||
1910 | |||
1911 | /* | ||
1832 | * Configure TX path and queues. | 1912 | * Configure TX path and queues. |
1833 | */ | 1913 | */ |
1834 | tx_set_rate(mp, 1000000000, 16777216); | 1914 | tx_set_rate(mp, 1000000000, 16777216); |
1835 | for (i = 0; i < 8; i++) { | 1915 | for (i = 0; i < 8; i++) { |
1836 | struct tx_queue *txq = mp->txq + i; | 1916 | struct tx_queue *txq = mp->txq + i; |
1837 | int off = TXQ_CURRENT_DESC_PTR(mp->port_num, i); | ||
1838 | u32 addr; | ||
1839 | 1917 | ||
1840 | if ((mp->txq_mask & (1 << i)) == 0) | 1918 | if ((mp->txq_mask & (1 << i)) == 0) |
1841 | continue; | 1919 | continue; |
1842 | 1920 | ||
1843 | addr = (u32)txq->tx_desc_dma; | 1921 | txq_reset_hw_ptr(txq); |
1844 | addr += txq->tx_curr_desc * sizeof(struct tx_desc); | ||
1845 | wrl(mp, off, addr); | ||
1846 | |||
1847 | txq_set_rate(txq, 1000000000, 16777216); | 1922 | txq_set_rate(txq, 1000000000, 16777216); |
1848 | txq_set_fixed_prio_mode(txq); | 1923 | txq_set_fixed_prio_mode(txq); |
1849 | } | 1924 | } |
@@ -1965,6 +2040,9 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
1965 | napi_enable(&mp->napi); | 2040 | napi_enable(&mp->napi); |
1966 | #endif | 2041 | #endif |
1967 | 2042 | ||
2043 | netif_carrier_off(dev); | ||
2044 | netif_stop_queue(dev); | ||
2045 | |||
1968 | port_start(mp); | 2046 | port_start(mp); |
1969 | 2047 | ||
1970 | set_rx_coal(mp, 0); | 2048 | set_rx_coal(mp, 0); |
@@ -1999,8 +2077,14 @@ static void port_reset(struct mv643xx_eth_private *mp) | |||
1999 | if (mp->txq_mask & (1 << i)) | 2077 | if (mp->txq_mask & (1 << i)) |
2000 | txq_disable(mp->txq + i); | 2078 | txq_disable(mp->txq + i); |
2001 | } | 2079 | } |
2002 | while (!(rdl(mp, PORT_STATUS(mp->port_num)) & TX_FIFO_EMPTY)) | 2080 | |
2081 | while (1) { | ||
2082 | u32 ps = rdl(mp, PORT_STATUS(mp->port_num)); | ||
2083 | |||
2084 | if ((ps & (TX_IN_PROGRESS | TX_FIFO_EMPTY)) == TX_FIFO_EMPTY) | ||
2085 | break; | ||
2003 | udelay(10); | 2086 | udelay(10); |
2087 | } | ||
2004 | 2088 | ||
2005 | /* Reset the Enable bit in the Configuration Register */ | 2089 | /* Reset the Enable bit in the Configuration Register */ |
2006 | data = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); | 2090 | data = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); |
@@ -2202,7 +2286,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) | |||
2202 | int ret; | 2286 | int ret; |
2203 | 2287 | ||
2204 | if (!mv643xx_eth_version_printed++) | 2288 | if (!mv643xx_eth_version_printed++) |
2205 | printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); | 2289 | printk(KERN_NOTICE "MV-643xx 10/100/1000 ethernet " |
2290 | "driver version %s\n", mv643xx_eth_driver_version); | ||
2206 | 2291 | ||
2207 | ret = -EINVAL; | 2292 | ret = -EINVAL; |
2208 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2293 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -2338,14 +2423,14 @@ static int phy_detect(struct mv643xx_eth_private *mp) | |||
2338 | unsigned int data; | 2423 | unsigned int data; |
2339 | unsigned int data2; | 2424 | unsigned int data2; |
2340 | 2425 | ||
2341 | smi_reg_read(mp, mp->phy_addr, 0, &data); | 2426 | smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data); |
2342 | smi_reg_write(mp, mp->phy_addr, 0, data ^ 0x1000); | 2427 | smi_reg_write(mp, mp->phy_addr, MII_BMCR, data ^ BMCR_ANENABLE); |
2343 | 2428 | ||
2344 | smi_reg_read(mp, mp->phy_addr, 0, &data2); | 2429 | smi_reg_read(mp, mp->phy_addr, MII_BMCR, &data2); |
2345 | if (((data ^ data2) & 0x1000) == 0) | 2430 | if (((data ^ data2) & BMCR_ANENABLE) == 0) |
2346 | return -ENODEV; | 2431 | return -ENODEV; |
2347 | 2432 | ||
2348 | smi_reg_write(mp, mp->phy_addr, 0, data); | 2433 | smi_reg_write(mp, mp->phy_addr, MII_BMCR, data); |
2349 | 2434 | ||
2350 | return 0; | 2435 | return 0; |
2351 | } | 2436 | } |
@@ -2393,12 +2478,39 @@ static int phy_init(struct mv643xx_eth_private *mp, | |||
2393 | cmd.duplex = pd->duplex; | 2478 | cmd.duplex = pd->duplex; |
2394 | } | 2479 | } |
2395 | 2480 | ||
2396 | update_pscr(mp, cmd.speed, cmd.duplex); | ||
2397 | mv643xx_eth_set_settings(mp->dev, &cmd); | 2481 | mv643xx_eth_set_settings(mp->dev, &cmd); |
2398 | 2482 | ||
2399 | return 0; | 2483 | return 0; |
2400 | } | 2484 | } |
2401 | 2485 | ||
2486 | static void init_pscr(struct mv643xx_eth_private *mp, int speed, int duplex) | ||
2487 | { | ||
2488 | u32 pscr; | ||
2489 | |||
2490 | pscr = rdl(mp, PORT_SERIAL_CONTROL(mp->port_num)); | ||
2491 | if (pscr & SERIAL_PORT_ENABLE) { | ||
2492 | pscr &= ~SERIAL_PORT_ENABLE; | ||
2493 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
2494 | } | ||
2495 | |||
2496 | pscr = MAX_RX_PACKET_9700BYTE | SERIAL_PORT_CONTROL_RESERVED; | ||
2497 | if (mp->phy_addr == -1) { | ||
2498 | pscr |= DISABLE_AUTO_NEG_SPEED_GMII; | ||
2499 | if (speed == SPEED_1000) | ||
2500 | pscr |= SET_GMII_SPEED_TO_1000; | ||
2501 | else if (speed == SPEED_100) | ||
2502 | pscr |= SET_MII_SPEED_TO_100; | ||
2503 | |||
2504 | pscr |= DISABLE_AUTO_NEG_FOR_FLOW_CTRL; | ||
2505 | |||
2506 | pscr |= DISABLE_AUTO_NEG_FOR_DUPLEX; | ||
2507 | if (duplex == DUPLEX_FULL) | ||
2508 | pscr |= SET_FULL_DUPLEX_MODE; | ||
2509 | } | ||
2510 | |||
2511 | wrl(mp, PORT_SERIAL_CONTROL(mp->port_num), pscr); | ||
2512 | } | ||
2513 | |||
2402 | static int mv643xx_eth_probe(struct platform_device *pdev) | 2514 | static int mv643xx_eth_probe(struct platform_device *pdev) |
2403 | { | 2515 | { |
2404 | struct mv643xx_eth_platform_data *pd; | 2516 | struct mv643xx_eth_platform_data *pd; |
@@ -2452,6 +2564,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2452 | } else { | 2564 | } else { |
2453 | SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops_phyless); | 2565 | SET_ETHTOOL_OPS(dev, &mv643xx_eth_ethtool_ops_phyless); |
2454 | } | 2566 | } |
2567 | init_pscr(mp, pd->speed, pd->duplex); | ||
2455 | 2568 | ||
2456 | 2569 | ||
2457 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 2570 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
@@ -2478,6 +2591,7 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2478 | * have to map the buffers to ISA memory which is only 16 MB | 2591 | * have to map the buffers to ISA memory which is only 16 MB |
2479 | */ | 2592 | */ |
2480 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; | 2593 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; |
2594 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; | ||
2481 | #endif | 2595 | #endif |
2482 | 2596 | ||
2483 | SET_NETDEV_DEV(dev, &pdev->dev); | 2597 | SET_NETDEV_DEV(dev, &pdev->dev); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 2fec6122c7fa..42443d697423 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -536,7 +536,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr) | |||
536 | #ifdef CONFIG_NET_POLL_CONTROLLER | 536 | #ifdef CONFIG_NET_POLL_CONTROLLER |
537 | dev->poll_controller = eip_poll; | 537 | dev->poll_controller = eip_poll; |
538 | #endif | 538 | #endif |
539 | NS8390_init(dev, 0); | 539 | NS8390p_init(dev, 0); |
540 | 540 | ||
541 | ret = register_netdev(dev); | 541 | ret = register_netdev(dev); |
542 | if (ret) | 542 | if (ret) |
@@ -794,7 +794,7 @@ retry: | |||
794 | if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ | 794 | if (time_after(jiffies, dma_start + 2*HZ/100)) { /* 20ms */ |
795 | printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); | 795 | printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name); |
796 | ne_reset_8390(dev); | 796 | ne_reset_8390(dev); |
797 | NS8390_init(dev,1); | 797 | NS8390p_init(dev, 1); |
798 | break; | 798 | break; |
799 | } | 799 | } |
800 | 800 | ||
@@ -855,7 +855,7 @@ static int ne_drv_resume(struct platform_device *pdev) | |||
855 | 855 | ||
856 | if (netif_running(dev)) { | 856 | if (netif_running(dev)) { |
857 | ne_reset_8390(dev); | 857 | ne_reset_8390(dev); |
858 | NS8390_init(dev, 1); | 858 | NS8390p_init(dev, 1); |
859 | netif_device_attach(dev); | 859 | netif_device_attach(dev); |
860 | } | 860 | } |
861 | return 0; | 861 | return 0; |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 86d77d05190a..a2b073097e5c 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3143,7 +3143,7 @@ static void tx_intr_handler(struct fifo_info *fifo_data) | |||
3143 | pkt_cnt++; | 3143 | pkt_cnt++; |
3144 | 3144 | ||
3145 | /* Updating the statistics block */ | 3145 | /* Updating the statistics block */ |
3146 | nic->stats.tx_bytes += skb->len; | 3146 | nic->dev->stats.tx_bytes += skb->len; |
3147 | nic->mac_control.stats_info->sw_stat.mem_freed += skb->truesize; | 3147 | nic->mac_control.stats_info->sw_stat.mem_freed += skb->truesize; |
3148 | dev_kfree_skb_irq(skb); | 3148 | dev_kfree_skb_irq(skb); |
3149 | 3149 | ||
@@ -4896,25 +4896,42 @@ static struct net_device_stats *s2io_get_stats(struct net_device *dev) | |||
4896 | /* Configure Stats for immediate updt */ | 4896 | /* Configure Stats for immediate updt */ |
4897 | s2io_updt_stats(sp); | 4897 | s2io_updt_stats(sp); |
4898 | 4898 | ||
4899 | /* Using sp->stats as a staging area, because reset (due to mtu | ||
4900 | change, for example) will clear some hardware counters */ | ||
4901 | dev->stats.tx_packets += | ||
4902 | le32_to_cpu(mac_control->stats_info->tmac_frms) - | ||
4903 | sp->stats.tx_packets; | ||
4899 | sp->stats.tx_packets = | 4904 | sp->stats.tx_packets = |
4900 | le32_to_cpu(mac_control->stats_info->tmac_frms); | 4905 | le32_to_cpu(mac_control->stats_info->tmac_frms); |
4906 | dev->stats.tx_errors += | ||
4907 | le32_to_cpu(mac_control->stats_info->tmac_any_err_frms) - | ||
4908 | sp->stats.tx_errors; | ||
4901 | sp->stats.tx_errors = | 4909 | sp->stats.tx_errors = |
4902 | le32_to_cpu(mac_control->stats_info->tmac_any_err_frms); | 4910 | le32_to_cpu(mac_control->stats_info->tmac_any_err_frms); |
4911 | dev->stats.rx_errors += | ||
4912 | le64_to_cpu(mac_control->stats_info->rmac_drop_frms) - | ||
4913 | sp->stats.rx_errors; | ||
4903 | sp->stats.rx_errors = | 4914 | sp->stats.rx_errors = |
4904 | le64_to_cpu(mac_control->stats_info->rmac_drop_frms); | 4915 | le64_to_cpu(mac_control->stats_info->rmac_drop_frms); |
4916 | dev->stats.multicast = | ||
4917 | le32_to_cpu(mac_control->stats_info->rmac_vld_mcst_frms) - | ||
4918 | sp->stats.multicast; | ||
4905 | sp->stats.multicast = | 4919 | sp->stats.multicast = |
4906 | le32_to_cpu(mac_control->stats_info->rmac_vld_mcst_frms); | 4920 | le32_to_cpu(mac_control->stats_info->rmac_vld_mcst_frms); |
4921 | dev->stats.rx_length_errors = | ||
4922 | le64_to_cpu(mac_control->stats_info->rmac_long_frms) - | ||
4923 | sp->stats.rx_length_errors; | ||
4907 | sp->stats.rx_length_errors = | 4924 | sp->stats.rx_length_errors = |
4908 | le64_to_cpu(mac_control->stats_info->rmac_long_frms); | 4925 | le64_to_cpu(mac_control->stats_info->rmac_long_frms); |
4909 | 4926 | ||
4910 | /* collect per-ring rx_packets and rx_bytes */ | 4927 | /* collect per-ring rx_packets and rx_bytes */ |
4911 | sp->stats.rx_packets = sp->stats.rx_bytes = 0; | 4928 | dev->stats.rx_packets = dev->stats.rx_bytes = 0; |
4912 | for (i = 0; i < config->rx_ring_num; i++) { | 4929 | for (i = 0; i < config->rx_ring_num; i++) { |
4913 | sp->stats.rx_packets += mac_control->rings[i].rx_packets; | 4930 | dev->stats.rx_packets += mac_control->rings[i].rx_packets; |
4914 | sp->stats.rx_bytes += mac_control->rings[i].rx_bytes; | 4931 | dev->stats.rx_bytes += mac_control->rings[i].rx_bytes; |
4915 | } | 4932 | } |
4916 | 4933 | ||
4917 | return (&sp->stats); | 4934 | return (&dev->stats); |
4918 | } | 4935 | } |
4919 | 4936 | ||
4920 | /** | 4937 | /** |
@@ -7419,7 +7436,7 @@ static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp) | |||
7419 | if (err_mask != 0x5) { | 7436 | if (err_mask != 0x5) { |
7420 | DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%x\n", | 7437 | DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%x\n", |
7421 | dev->name, err_mask); | 7438 | dev->name, err_mask); |
7422 | sp->stats.rx_crc_errors++; | 7439 | dev->stats.rx_crc_errors++; |
7423 | sp->mac_control.stats_info->sw_stat.mem_freed | 7440 | sp->mac_control.stats_info->sw_stat.mem_freed |
7424 | += skb->truesize; | 7441 | += skb->truesize; |
7425 | dev_kfree_skb(skb); | 7442 | dev_kfree_skb(skb); |
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index c69ba1395fa9..6a06b9503e4f 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SuperH Ethernet device driver | 2 | * SuperH Ethernet device driver |
3 | * | 3 | * |
4 | * Copyright (C) 2006,2007 Nobuhiro Iwamatsu | 4 | * Copyright (C) 2006-2008 Nobuhiro Iwamatsu |
5 | * Copyright (C) 2008 Renesas Solutions Corp. | 5 | * Copyright (C) 2008 Renesas Solutions Corp. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
@@ -143,13 +143,39 @@ static struct mdiobb_ops bb_ops = { | |||
143 | .get_mdio_data = sh_get_mdio, | 143 | .get_mdio_data = sh_get_mdio, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | /* Chip Reset */ | ||
146 | static void sh_eth_reset(struct net_device *ndev) | 147 | static void sh_eth_reset(struct net_device *ndev) |
147 | { | 148 | { |
148 | u32 ioaddr = ndev->base_addr; | 149 | u32 ioaddr = ndev->base_addr; |
149 | 150 | ||
151 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
152 | int cnt = 100; | ||
153 | |||
154 | ctrl_outl(EDSR_ENALL, ioaddr + EDSR); | ||
155 | ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR); | ||
156 | while (cnt > 0) { | ||
157 | if (!(ctrl_inl(ioaddr + EDMR) & 0x3)) | ||
158 | break; | ||
159 | mdelay(1); | ||
160 | cnt--; | ||
161 | } | ||
162 | if (cnt < 0) | ||
163 | printk(KERN_ERR "Device reset fail\n"); | ||
164 | |||
165 | /* Table Init */ | ||
166 | ctrl_outl(0x0, ioaddr + TDLAR); | ||
167 | ctrl_outl(0x0, ioaddr + TDFAR); | ||
168 | ctrl_outl(0x0, ioaddr + TDFXR); | ||
169 | ctrl_outl(0x0, ioaddr + TDFFR); | ||
170 | ctrl_outl(0x0, ioaddr + RDLAR); | ||
171 | ctrl_outl(0x0, ioaddr + RDFAR); | ||
172 | ctrl_outl(0x0, ioaddr + RDFXR); | ||
173 | ctrl_outl(0x0, ioaddr + RDFFR); | ||
174 | #else | ||
150 | ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR); | 175 | ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR); |
151 | mdelay(3); | 176 | mdelay(3); |
152 | ctrl_outl(ctrl_inl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR); | 177 | ctrl_outl(ctrl_inl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR); |
178 | #endif | ||
153 | } | 179 | } |
154 | 180 | ||
155 | /* free skb and descriptor buffer */ | 181 | /* free skb and descriptor buffer */ |
@@ -180,6 +206,7 @@ static void sh_eth_ring_free(struct net_device *ndev) | |||
180 | /* format skb and descriptor buffer */ | 206 | /* format skb and descriptor buffer */ |
181 | static void sh_eth_ring_format(struct net_device *ndev) | 207 | static void sh_eth_ring_format(struct net_device *ndev) |
182 | { | 208 | { |
209 | u32 ioaddr = ndev->base_addr, reserve = 0; | ||
183 | struct sh_eth_private *mdp = netdev_priv(ndev); | 210 | struct sh_eth_private *mdp = netdev_priv(ndev); |
184 | int i; | 211 | int i; |
185 | struct sk_buff *skb; | 212 | struct sk_buff *skb; |
@@ -201,9 +228,15 @@ static void sh_eth_ring_format(struct net_device *ndev) | |||
201 | mdp->rx_skbuff[i] = skb; | 228 | mdp->rx_skbuff[i] = skb; |
202 | if (skb == NULL) | 229 | if (skb == NULL) |
203 | break; | 230 | break; |
204 | skb->dev = ndev; /* Mark as being used by this device. */ | 231 | skb->dev = ndev; /* Mark as being used by this device. */ |
232 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
233 | reserve = SH7763_SKB_ALIGN | ||
234 | - ((uint32_t)skb->data & (SH7763_SKB_ALIGN-1)); | ||
235 | if (reserve) | ||
236 | skb_reserve(skb, reserve); | ||
237 | #else | ||
205 | skb_reserve(skb, RX_OFFSET); | 238 | skb_reserve(skb, RX_OFFSET); |
206 | 239 | #endif | |
207 | /* RX descriptor */ | 240 | /* RX descriptor */ |
208 | rxdesc = &mdp->rx_ring[i]; | 241 | rxdesc = &mdp->rx_ring[i]; |
209 | rxdesc->addr = (u32)skb->data & ~0x3UL; | 242 | rxdesc->addr = (u32)skb->data & ~0x3UL; |
@@ -211,12 +244,25 @@ static void sh_eth_ring_format(struct net_device *ndev) | |||
211 | 244 | ||
212 | /* The size of the buffer is 16 byte boundary. */ | 245 | /* The size of the buffer is 16 byte boundary. */ |
213 | rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F; | 246 | rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F; |
247 | /* Rx descriptor address set */ | ||
248 | if (i == 0) { | ||
249 | ctrl_outl((u32)rxdesc, ioaddr + RDLAR); | ||
250 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
251 | ctrl_outl((u32)rxdesc, ioaddr + RDFAR); | ||
252 | #endif | ||
253 | } | ||
214 | } | 254 | } |
215 | 255 | ||
256 | /* Rx descriptor address set */ | ||
257 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
258 | ctrl_outl((u32)rxdesc, ioaddr + RDFXR); | ||
259 | ctrl_outl(0x1, ioaddr + RDFFR); | ||
260 | #endif | ||
261 | |||
216 | mdp->dirty_rx = (u32) (i - RX_RING_SIZE); | 262 | mdp->dirty_rx = (u32) (i - RX_RING_SIZE); |
217 | 263 | ||
218 | /* Mark the last entry as wrapping the ring. */ | 264 | /* Mark the last entry as wrapping the ring. */ |
219 | rxdesc->status |= cpu_to_le32(RC_RDEL); | 265 | rxdesc->status |= cpu_to_le32(RD_RDEL); |
220 | 266 | ||
221 | memset(mdp->tx_ring, 0, tx_ringsize); | 267 | memset(mdp->tx_ring, 0, tx_ringsize); |
222 | 268 | ||
@@ -226,8 +272,21 @@ static void sh_eth_ring_format(struct net_device *ndev) | |||
226 | txdesc = &mdp->tx_ring[i]; | 272 | txdesc = &mdp->tx_ring[i]; |
227 | txdesc->status = cpu_to_le32(TD_TFP); | 273 | txdesc->status = cpu_to_le32(TD_TFP); |
228 | txdesc->buffer_length = 0; | 274 | txdesc->buffer_length = 0; |
275 | if (i == 0) { | ||
276 | /* Rx descriptor address set */ | ||
277 | ctrl_outl((u32)txdesc, ioaddr + TDLAR); | ||
278 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
279 | ctrl_outl((u32)txdesc, ioaddr + TDFAR); | ||
280 | #endif | ||
281 | } | ||
229 | } | 282 | } |
230 | 283 | ||
284 | /* Rx descriptor address set */ | ||
285 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
286 | ctrl_outl((u32)txdesc, ioaddr + TDFXR); | ||
287 | ctrl_outl(0x1, ioaddr + TDFFR); | ||
288 | #endif | ||
289 | |||
231 | txdesc->status |= cpu_to_le32(TD_TDLE); | 290 | txdesc->status |= cpu_to_le32(TD_TDLE); |
232 | } | 291 | } |
233 | 292 | ||
@@ -311,31 +370,43 @@ static int sh_eth_dev_init(struct net_device *ndev) | |||
311 | /* Soft Reset */ | 370 | /* Soft Reset */ |
312 | sh_eth_reset(ndev); | 371 | sh_eth_reset(ndev); |
313 | 372 | ||
314 | ctrl_outl(RPADIR_PADS1, ioaddr + RPADIR); /* SH7712-DMA-RX-PAD2 */ | 373 | /* Descriptor format */ |
374 | sh_eth_ring_format(ndev); | ||
375 | ctrl_outl(RPADIR_INIT, ioaddr + RPADIR); | ||
315 | 376 | ||
316 | /* all sh_eth int mask */ | 377 | /* all sh_eth int mask */ |
317 | ctrl_outl(0, ioaddr + EESIPR); | 378 | ctrl_outl(0, ioaddr + EESIPR); |
318 | 379 | ||
319 | /* FIFO size set */ | 380 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) |
381 | ctrl_outl(EDMR_EL, ioaddr + EDMR); | ||
382 | #else | ||
320 | ctrl_outl(0, ioaddr + EDMR); /* Endian change */ | 383 | ctrl_outl(0, ioaddr + EDMR); /* Endian change */ |
384 | #endif | ||
321 | 385 | ||
386 | /* FIFO size set */ | ||
322 | ctrl_outl((FIFO_SIZE_T | FIFO_SIZE_R), ioaddr + FDR); | 387 | ctrl_outl((FIFO_SIZE_T | FIFO_SIZE_R), ioaddr + FDR); |
323 | ctrl_outl(0, ioaddr + TFTR); | 388 | ctrl_outl(0, ioaddr + TFTR); |
324 | 389 | ||
390 | /* Frame recv control */ | ||
325 | ctrl_outl(0, ioaddr + RMCR); | 391 | ctrl_outl(0, ioaddr + RMCR); |
326 | 392 | ||
327 | rx_int_var = mdp->rx_int_var = DESC_I_RINT8 | DESC_I_RINT5; | 393 | rx_int_var = mdp->rx_int_var = DESC_I_RINT8 | DESC_I_RINT5; |
328 | tx_int_var = mdp->tx_int_var = DESC_I_TINT2; | 394 | tx_int_var = mdp->tx_int_var = DESC_I_TINT2; |
329 | ctrl_outl(rx_int_var | tx_int_var, ioaddr + TRSCER); | 395 | ctrl_outl(rx_int_var | tx_int_var, ioaddr + TRSCER); |
330 | 396 | ||
397 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
398 | /* Burst sycle set */ | ||
399 | ctrl_outl(0x800, ioaddr + BCULR); | ||
400 | #endif | ||
401 | |||
331 | ctrl_outl((FIFO_F_D_RFF | FIFO_F_D_RFD), ioaddr + FCFTR); | 402 | ctrl_outl((FIFO_F_D_RFF | FIFO_F_D_RFD), ioaddr + FCFTR); |
332 | ctrl_outl(0, ioaddr + TRIMD); | ||
333 | 403 | ||
334 | /* Descriptor format */ | 404 | #if !defined(CONFIG_CPU_SUBTYPE_SH7763) |
335 | sh_eth_ring_format(ndev); | 405 | ctrl_outl(0, ioaddr + TRIMD); |
406 | #endif | ||
336 | 407 | ||
337 | ctrl_outl((u32)mdp->rx_ring, ioaddr + RDLAR); | 408 | /* Recv frame limit set register */ |
338 | ctrl_outl((u32)mdp->tx_ring, ioaddr + TDLAR); | 409 | ctrl_outl(RFLR_VALUE, ioaddr + RFLR); |
339 | 410 | ||
340 | ctrl_outl(ctrl_inl(ioaddr + EESR), ioaddr + EESR); | 411 | ctrl_outl(ctrl_inl(ioaddr + EESR), ioaddr + EESR); |
341 | ctrl_outl((DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff), ioaddr + EESIPR); | 412 | ctrl_outl((DMAC_M_RFRMER | DMAC_M_ECI | 0x003fffff), ioaddr + EESIPR); |
@@ -345,21 +416,26 @@ static int sh_eth_dev_init(struct net_device *ndev) | |||
345 | ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE; | 416 | ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE; |
346 | 417 | ||
347 | ctrl_outl(val, ioaddr + ECMR); | 418 | ctrl_outl(val, ioaddr + ECMR); |
348 | ctrl_outl(ECSR_BRCRX | ECSR_PSRTO | ECSR_LCHNG | ECSR_ICD | | 419 | |
349 | ECSIPR_MPDIP, ioaddr + ECSR); | 420 | /* E-MAC Status Register clear */ |
350 | ctrl_outl(ECSIPR_BRCRXIP | ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | | 421 | ctrl_outl(ECSR_INIT, ioaddr + ECSR); |
351 | ECSIPR_ICDIP | ECSIPR_MPDIP, ioaddr + ECSIPR); | 422 | |
423 | /* E-MAC Interrupt Enable register */ | ||
424 | ctrl_outl(ECSIPR_INIT, ioaddr + ECSIPR); | ||
352 | 425 | ||
353 | /* Set MAC address */ | 426 | /* Set MAC address */ |
354 | update_mac_address(ndev); | 427 | update_mac_address(ndev); |
355 | 428 | ||
356 | /* mask reset */ | 429 | /* mask reset */ |
357 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) | 430 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7763) |
358 | ctrl_outl(APR_AP, ioaddr + APR); | 431 | ctrl_outl(APR_AP, ioaddr + APR); |
359 | ctrl_outl(MPR_MP, ioaddr + MPR); | 432 | ctrl_outl(MPR_MP, ioaddr + MPR); |
360 | ctrl_outl(TPAUSER_UNLIMITED, ioaddr + TPAUSER); | 433 | ctrl_outl(TPAUSER_UNLIMITED, ioaddr + TPAUSER); |
434 | #endif | ||
435 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) | ||
361 | ctrl_outl(BCFR_UNLIMITED, ioaddr + BCFR); | 436 | ctrl_outl(BCFR_UNLIMITED, ioaddr + BCFR); |
362 | #endif | 437 | #endif |
438 | |||
363 | /* Setting the Rx mode will start the Rx process. */ | 439 | /* Setting the Rx mode will start the Rx process. */ |
364 | ctrl_outl(EDRRR_R, ioaddr + EDRRR); | 440 | ctrl_outl(EDRRR_R, ioaddr + EDRRR); |
365 | 441 | ||
@@ -407,7 +483,7 @@ static int sh_eth_rx(struct net_device *ndev) | |||
407 | int boguscnt = (mdp->dirty_rx + RX_RING_SIZE) - mdp->cur_rx; | 483 | int boguscnt = (mdp->dirty_rx + RX_RING_SIZE) - mdp->cur_rx; |
408 | struct sk_buff *skb; | 484 | struct sk_buff *skb; |
409 | u16 pkt_len = 0; | 485 | u16 pkt_len = 0; |
410 | u32 desc_status; | 486 | u32 desc_status, reserve = 0; |
411 | 487 | ||
412 | rxdesc = &mdp->rx_ring[entry]; | 488 | rxdesc = &mdp->rx_ring[entry]; |
413 | while (!(rxdesc->status & cpu_to_le32(RD_RACT))) { | 489 | while (!(rxdesc->status & cpu_to_le32(RD_RACT))) { |
@@ -454,28 +530,38 @@ static int sh_eth_rx(struct net_device *ndev) | |||
454 | for (; mdp->cur_rx - mdp->dirty_rx > 0; mdp->dirty_rx++) { | 530 | for (; mdp->cur_rx - mdp->dirty_rx > 0; mdp->dirty_rx++) { |
455 | entry = mdp->dirty_rx % RX_RING_SIZE; | 531 | entry = mdp->dirty_rx % RX_RING_SIZE; |
456 | rxdesc = &mdp->rx_ring[entry]; | 532 | rxdesc = &mdp->rx_ring[entry]; |
533 | /* The size of the buffer is 16 byte boundary. */ | ||
534 | rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F; | ||
535 | |||
457 | if (mdp->rx_skbuff[entry] == NULL) { | 536 | if (mdp->rx_skbuff[entry] == NULL) { |
458 | skb = dev_alloc_skb(mdp->rx_buf_sz); | 537 | skb = dev_alloc_skb(mdp->rx_buf_sz); |
459 | mdp->rx_skbuff[entry] = skb; | 538 | mdp->rx_skbuff[entry] = skb; |
460 | if (skb == NULL) | 539 | if (skb == NULL) |
461 | break; /* Better luck next round. */ | 540 | break; /* Better luck next round. */ |
462 | skb->dev = ndev; | 541 | skb->dev = ndev; |
542 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
543 | reserve = SH7763_SKB_ALIGN | ||
544 | - ((uint32_t)skb->data & (SH7763_SKB_ALIGN-1)); | ||
545 | if (reserve) | ||
546 | skb_reserve(skb, reserve); | ||
547 | #else | ||
463 | skb_reserve(skb, RX_OFFSET); | 548 | skb_reserve(skb, RX_OFFSET); |
549 | #endif | ||
550 | skb->ip_summed = CHECKSUM_NONE; | ||
464 | rxdesc->addr = (u32)skb->data & ~0x3UL; | 551 | rxdesc->addr = (u32)skb->data & ~0x3UL; |
465 | } | 552 | } |
466 | /* The size of the buffer is 16 byte boundary. */ | ||
467 | rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F; | ||
468 | if (entry >= RX_RING_SIZE - 1) | 553 | if (entry >= RX_RING_SIZE - 1) |
469 | rxdesc->status |= | 554 | rxdesc->status |= |
470 | cpu_to_le32(RD_RACT | RD_RFP | RC_RDEL); | 555 | cpu_to_le32(RD_RACT | RD_RFP | RD_RDEL); |
471 | else | 556 | else |
472 | rxdesc->status |= | 557 | rxdesc->status |= |
473 | cpu_to_le32(RD_RACT | RD_RFP); | 558 | cpu_to_le32(RD_RACT | RD_RFP); |
474 | } | 559 | } |
475 | 560 | ||
476 | /* Restart Rx engine if stopped. */ | 561 | /* Restart Rx engine if stopped. */ |
477 | /* If we don't need to check status, don't. -KDU */ | 562 | /* If we don't need to check status, don't. -KDU */ |
478 | ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR); | 563 | if (!(ctrl_inl(ndev->base_addr + EDRRR) & EDRRR_R)) |
564 | ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR); | ||
479 | 565 | ||
480 | return 0; | 566 | return 0; |
481 | } | 567 | } |
@@ -529,13 +615,14 @@ static void sh_eth_error(struct net_device *ndev, int intr_status) | |||
529 | printk(KERN_ERR "Receive Frame Overflow\n"); | 615 | printk(KERN_ERR "Receive Frame Overflow\n"); |
530 | } | 616 | } |
531 | } | 617 | } |
532 | 618 | #if !defined(CONFIG_CPU_SUBTYPE_SH7763) | |
533 | if (intr_status & EESR_ADE) { | 619 | if (intr_status & EESR_ADE) { |
534 | if (intr_status & EESR_TDE) { | 620 | if (intr_status & EESR_TDE) { |
535 | if (intr_status & EESR_TFE) | 621 | if (intr_status & EESR_TFE) |
536 | mdp->stats.tx_fifo_errors++; | 622 | mdp->stats.tx_fifo_errors++; |
537 | } | 623 | } |
538 | } | 624 | } |
625 | #endif | ||
539 | 626 | ||
540 | if (intr_status & EESR_RDE) { | 627 | if (intr_status & EESR_RDE) { |
541 | /* Receive Descriptor Empty int */ | 628 | /* Receive Descriptor Empty int */ |
@@ -550,8 +637,11 @@ static void sh_eth_error(struct net_device *ndev, int intr_status) | |||
550 | mdp->stats.rx_fifo_errors++; | 637 | mdp->stats.rx_fifo_errors++; |
551 | printk(KERN_ERR "Receive FIFO Overflow\n"); | 638 | printk(KERN_ERR "Receive FIFO Overflow\n"); |
552 | } | 639 | } |
553 | if (intr_status & | 640 | if (intr_status & (EESR_TWB | EESR_TABT | |
554 | (EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE)) { | 641 | #if !defined(CONFIG_CPU_SUBTYPE_SH7763) |
642 | EESR_ADE | | ||
643 | #endif | ||
644 | EESR_TDE | EESR_TFE)) { | ||
555 | /* Tx error */ | 645 | /* Tx error */ |
556 | u32 edtrr = ctrl_inl(ndev->base_addr + EDTRR); | 646 | u32 edtrr = ctrl_inl(ndev->base_addr + EDTRR); |
557 | /* dmesg */ | 647 | /* dmesg */ |
@@ -582,17 +672,23 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev) | |||
582 | ioaddr = ndev->base_addr; | 672 | ioaddr = ndev->base_addr; |
583 | spin_lock(&mdp->lock); | 673 | spin_lock(&mdp->lock); |
584 | 674 | ||
675 | /* Get interrpt stat */ | ||
585 | intr_status = ctrl_inl(ioaddr + EESR); | 676 | intr_status = ctrl_inl(ioaddr + EESR); |
586 | /* Clear interrupt */ | 677 | /* Clear interrupt */ |
587 | ctrl_outl(intr_status, ioaddr + EESR); | 678 | ctrl_outl(intr_status, ioaddr + EESR); |
588 | 679 | ||
589 | if (intr_status & (EESR_FRC | EESR_RINT8 | | 680 | if (intr_status & (EESR_FRC | /* Frame recv*/ |
590 | EESR_RINT5 | EESR_RINT4 | EESR_RINT3 | EESR_RINT2 | | 681 | EESR_RMAF | /* Multi cast address recv*/ |
591 | EESR_RINT1)) | 682 | EESR_RRF | /* Bit frame recv */ |
683 | EESR_RTLF | /* Long frame recv*/ | ||
684 | EESR_RTSF | /* short frame recv */ | ||
685 | EESR_PRE | /* PHY-LSI recv error */ | ||
686 | EESR_CERF)){ /* recv frame CRC error */ | ||
592 | sh_eth_rx(ndev); | 687 | sh_eth_rx(ndev); |
593 | if (intr_status & (EESR_FTC | | 688 | } |
594 | EESR_TINT4 | EESR_TINT3 | EESR_TINT2 | EESR_TINT1)) { | ||
595 | 689 | ||
690 | /* Tx Check */ | ||
691 | if (intr_status & TX_CHECK) { | ||
596 | sh_eth_txfree(ndev); | 692 | sh_eth_txfree(ndev); |
597 | netif_wake_queue(ndev); | 693 | netif_wake_queue(ndev); |
598 | } | 694 | } |
@@ -631,11 +727,32 @@ static void sh_eth_adjust_link(struct net_device *ndev) | |||
631 | if (phydev->duplex != mdp->duplex) { | 727 | if (phydev->duplex != mdp->duplex) { |
632 | new_state = 1; | 728 | new_state = 1; |
633 | mdp->duplex = phydev->duplex; | 729 | mdp->duplex = phydev->duplex; |
730 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
731 | if (mdp->duplex) { /* FULL */ | ||
732 | ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, | ||
733 | ioaddr + ECMR); | ||
734 | } else { /* Half */ | ||
735 | ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, | ||
736 | ioaddr + ECMR); | ||
737 | } | ||
738 | #endif | ||
634 | } | 739 | } |
635 | 740 | ||
636 | if (phydev->speed != mdp->speed) { | 741 | if (phydev->speed != mdp->speed) { |
637 | new_state = 1; | 742 | new_state = 1; |
638 | mdp->speed = phydev->speed; | 743 | mdp->speed = phydev->speed; |
744 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
745 | switch (mdp->speed) { | ||
746 | case 10: /* 10BASE */ | ||
747 | ctrl_outl(GECMR_10, ioaddr + GECMR); break; | ||
748 | case 100:/* 100BASE */ | ||
749 | ctrl_outl(GECMR_100, ioaddr + GECMR); break; | ||
750 | case 1000: /* 1000BASE */ | ||
751 | ctrl_outl(GECMR_1000, ioaddr + GECMR); break; | ||
752 | default: | ||
753 | break; | ||
754 | } | ||
755 | #endif | ||
639 | } | 756 | } |
640 | if (mdp->link == PHY_DOWN) { | 757 | if (mdp->link == PHY_DOWN) { |
641 | ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_TXF) | 758 | ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_TXF) |
@@ -730,7 +847,7 @@ static int sh_eth_open(struct net_device *ndev) | |||
730 | /* Set the timer to check for link beat. */ | 847 | /* Set the timer to check for link beat. */ |
731 | init_timer(&mdp->timer); | 848 | init_timer(&mdp->timer); |
732 | mdp->timer.expires = (jiffies + (24 * HZ)) / 10;/* 2.4 sec. */ | 849 | mdp->timer.expires = (jiffies + (24 * HZ)) / 10;/* 2.4 sec. */ |
733 | setup_timer(&mdp->timer, sh_eth_timer, ndev); | 850 | setup_timer(&mdp->timer, sh_eth_timer, (unsigned long)ndev); |
734 | 851 | ||
735 | return ret; | 852 | return ret; |
736 | 853 | ||
@@ -820,7 +937,9 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
820 | 937 | ||
821 | mdp->cur_tx++; | 938 | mdp->cur_tx++; |
822 | 939 | ||
823 | ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR); | 940 | if (!(ctrl_inl(ndev->base_addr + EDTRR) & EDTRR_TRNS)) |
941 | ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR); | ||
942 | |||
824 | ndev->trans_start = jiffies; | 943 | ndev->trans_start = jiffies; |
825 | 944 | ||
826 | return 0; | 945 | return 0; |
@@ -877,9 +996,15 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev) | |||
877 | ctrl_outl(0, ioaddr + CDCR); /* (write clear) */ | 996 | ctrl_outl(0, ioaddr + CDCR); /* (write clear) */ |
878 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + LCCR); | 997 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + LCCR); |
879 | ctrl_outl(0, ioaddr + LCCR); /* (write clear) */ | 998 | ctrl_outl(0, ioaddr + LCCR); /* (write clear) */ |
999 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
1000 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CERCR);/* CERCR */ | ||
1001 | ctrl_outl(0, ioaddr + CERCR); /* (write clear) */ | ||
1002 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CEECR);/* CEECR */ | ||
1003 | ctrl_outl(0, ioaddr + CEECR); /* (write clear) */ | ||
1004 | #else | ||
880 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CNDCR); | 1005 | mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CNDCR); |
881 | ctrl_outl(0, ioaddr + CNDCR); /* (write clear) */ | 1006 | ctrl_outl(0, ioaddr + CNDCR); /* (write clear) */ |
882 | 1007 | #endif | |
883 | return &mdp->stats; | 1008 | return &mdp->stats; |
884 | } | 1009 | } |
885 | 1010 | ||
@@ -929,8 +1054,13 @@ static void sh_eth_tsu_init(u32 ioaddr) | |||
929 | ctrl_outl(0, ioaddr + TSU_FWSL0); | 1054 | ctrl_outl(0, ioaddr + TSU_FWSL0); |
930 | ctrl_outl(0, ioaddr + TSU_FWSL1); | 1055 | ctrl_outl(0, ioaddr + TSU_FWSL1); |
931 | ctrl_outl(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC); | 1056 | ctrl_outl(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC); |
1057 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
1058 | ctrl_outl(0, ioaddr + TSU_QTAG0); /* Disable QTAG(0->1) */ | ||
1059 | ctrl_outl(0, ioaddr + TSU_QTAG1); /* Disable QTAG(1->0) */ | ||
1060 | #else | ||
932 | ctrl_outl(0, ioaddr + TSU_QTAGM0); /* Disable QTAG(0->1) */ | 1061 | ctrl_outl(0, ioaddr + TSU_QTAGM0); /* Disable QTAG(0->1) */ |
933 | ctrl_outl(0, ioaddr + TSU_QTAGM1); /* Disable QTAG(1->0) */ | 1062 | ctrl_outl(0, ioaddr + TSU_QTAGM1); /* Disable QTAG(1->0) */ |
1063 | #endif | ||
934 | ctrl_outl(0, ioaddr + TSU_FWSR); /* all interrupt status clear */ | 1064 | ctrl_outl(0, ioaddr + TSU_FWSR); /* all interrupt status clear */ |
935 | ctrl_outl(0, ioaddr + TSU_FWINMK); /* Disable all interrupt */ | 1065 | ctrl_outl(0, ioaddr + TSU_FWINMK); /* Disable all interrupt */ |
936 | ctrl_outl(0, ioaddr + TSU_TEN); /* Disable all CAM entry */ | 1066 | ctrl_outl(0, ioaddr + TSU_TEN); /* Disable all CAM entry */ |
@@ -1088,7 +1218,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
1088 | /* First device only init */ | 1218 | /* First device only init */ |
1089 | if (!devno) { | 1219 | if (!devno) { |
1090 | /* reset device */ | 1220 | /* reset device */ |
1091 | ctrl_outl(ARSTR_ARSTR, ndev->base_addr + ARSTR); | 1221 | ctrl_outl(ARSTR_ARSTR, ARSTR); |
1092 | mdelay(1); | 1222 | mdelay(1); |
1093 | 1223 | ||
1094 | /* TSU init (Init only)*/ | 1224 | /* TSU init (Init only)*/ |
@@ -1110,8 +1240,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev) | |||
1110 | ndev->name, CARDNAME, (u32) ndev->base_addr); | 1240 | ndev->name, CARDNAME, (u32) ndev->base_addr); |
1111 | 1241 | ||
1112 | for (i = 0; i < 5; i++) | 1242 | for (i = 0; i < 5; i++) |
1113 | printk(KERN_INFO "%2.2x:", ndev->dev_addr[i]); | 1243 | printk(KERN_INFO "%02X:", ndev->dev_addr[i]); |
1114 | printk(KERN_INFO "%2.2x, IRQ %d.\n", ndev->dev_addr[i], ndev->irq); | 1244 | printk(KERN_INFO "%02X, IRQ %d.\n", ndev->dev_addr[i], ndev->irq); |
1115 | 1245 | ||
1116 | platform_set_drvdata(pdev, ndev); | 1246 | platform_set_drvdata(pdev, ndev); |
1117 | 1247 | ||
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h index e01e1c347715..45ad1b09ca5a 100644 --- a/drivers/net/sh_eth.h +++ b/drivers/net/sh_eth.h | |||
@@ -32,118 +32,249 @@ | |||
32 | 32 | ||
33 | #define CARDNAME "sh-eth" | 33 | #define CARDNAME "sh-eth" |
34 | #define TX_TIMEOUT (5*HZ) | 34 | #define TX_TIMEOUT (5*HZ) |
35 | 35 | #define TX_RING_SIZE 64 /* Tx ring size */ | |
36 | #define TX_RING_SIZE 128 /* Tx ring size */ | 36 | #define RX_RING_SIZE 64 /* Rx ring size */ |
37 | #define RX_RING_SIZE 128 /* Rx ring size */ | ||
38 | #define RX_OFFSET 2 /* skb offset */ | ||
39 | #define ETHERSMALL 60 | 37 | #define ETHERSMALL 60 |
40 | #define PKT_BUF_SZ 1538 | 38 | #define PKT_BUF_SZ 1538 |
41 | 39 | ||
40 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
41 | |||
42 | #define SH7763_SKB_ALIGN 32 | ||
42 | /* Chip Base Address */ | 43 | /* Chip Base Address */ |
43 | #define SH_TSU_ADDR 0xA7000804 | 44 | # define SH_TSU_ADDR 0xFFE01800 |
45 | # define ARSTR 0xFFE01800 | ||
46 | |||
47 | /* Chip Registers */ | ||
48 | /* E-DMAC */ | ||
49 | # define EDSR 0x000 | ||
50 | # define EDMR 0x400 | ||
51 | # define EDTRR 0x408 | ||
52 | # define EDRRR 0x410 | ||
53 | # define EESR 0x428 | ||
54 | # define EESIPR 0x430 | ||
55 | # define TDLAR 0x010 | ||
56 | # define TDFAR 0x014 | ||
57 | # define TDFXR 0x018 | ||
58 | # define TDFFR 0x01C | ||
59 | # define RDLAR 0x030 | ||
60 | # define RDFAR 0x034 | ||
61 | # define RDFXR 0x038 | ||
62 | # define RDFFR 0x03C | ||
63 | # define TRSCER 0x438 | ||
64 | # define RMFCR 0x440 | ||
65 | # define TFTR 0x448 | ||
66 | # define FDR 0x450 | ||
67 | # define RMCR 0x458 | ||
68 | # define RPADIR 0x460 | ||
69 | # define FCFTR 0x468 | ||
70 | |||
71 | /* Ether Register */ | ||
72 | # define ECMR 0x500 | ||
73 | # define ECSR 0x510 | ||
74 | # define ECSIPR 0x518 | ||
75 | # define PIR 0x520 | ||
76 | # define PSR 0x528 | ||
77 | # define PIPR 0x52C | ||
78 | # define RFLR 0x508 | ||
79 | # define APR 0x554 | ||
80 | # define MPR 0x558 | ||
81 | # define PFTCR 0x55C | ||
82 | # define PFRCR 0x560 | ||
83 | # define TPAUSER 0x564 | ||
84 | # define GECMR 0x5B0 | ||
85 | # define BCULR 0x5B4 | ||
86 | # define MAHR 0x5C0 | ||
87 | # define MALR 0x5C8 | ||
88 | # define TROCR 0x700 | ||
89 | # define CDCR 0x708 | ||
90 | # define LCCR 0x710 | ||
91 | # define CEFCR 0x740 | ||
92 | # define FRECR 0x748 | ||
93 | # define TSFRCR 0x750 | ||
94 | # define TLFRCR 0x758 | ||
95 | # define RFCR 0x760 | ||
96 | # define CERCR 0x768 | ||
97 | # define CEECR 0x770 | ||
98 | # define MAFCR 0x778 | ||
99 | |||
100 | /* TSU Absolute Address */ | ||
101 | # define TSU_CTRST 0x004 | ||
102 | # define TSU_FWEN0 0x010 | ||
103 | # define TSU_FWEN1 0x014 | ||
104 | # define TSU_FCM 0x18 | ||
105 | # define TSU_BSYSL0 0x20 | ||
106 | # define TSU_BSYSL1 0x24 | ||
107 | # define TSU_PRISL0 0x28 | ||
108 | # define TSU_PRISL1 0x2C | ||
109 | # define TSU_FWSL0 0x30 | ||
110 | # define TSU_FWSL1 0x34 | ||
111 | # define TSU_FWSLC 0x38 | ||
112 | # define TSU_QTAG0 0x40 | ||
113 | # define TSU_QTAG1 0x44 | ||
114 | # define TSU_FWSR 0x50 | ||
115 | # define TSU_FWINMK 0x54 | ||
116 | # define TSU_ADQT0 0x48 | ||
117 | # define TSU_ADQT1 0x4C | ||
118 | # define TSU_VTAG0 0x58 | ||
119 | # define TSU_VTAG1 0x5C | ||
120 | # define TSU_ADSBSY 0x60 | ||
121 | # define TSU_TEN 0x64 | ||
122 | # define TSU_POST1 0x70 | ||
123 | # define TSU_POST2 0x74 | ||
124 | # define TSU_POST3 0x78 | ||
125 | # define TSU_POST4 0x7C | ||
126 | # define TSU_ADRH0 0x100 | ||
127 | # define TSU_ADRL0 0x104 | ||
128 | # define TSU_ADRH31 0x1F8 | ||
129 | # define TSU_ADRL31 0x1FC | ||
130 | |||
131 | # define TXNLCR0 0x80 | ||
132 | # define TXALCR0 0x84 | ||
133 | # define RXNLCR0 0x88 | ||
134 | # define RXALCR0 0x8C | ||
135 | # define FWNLCR0 0x90 | ||
136 | # define FWALCR0 0x94 | ||
137 | # define TXNLCR1 0xA0 | ||
138 | # define TXALCR1 0xA4 | ||
139 | # define RXNLCR1 0xA8 | ||
140 | # define RXALCR1 0xAC | ||
141 | # define FWNLCR1 0xB0 | ||
142 | # define FWALCR1 0x40 | ||
143 | |||
144 | #else /* CONFIG_CPU_SUBTYPE_SH7763 */ | ||
145 | # define RX_OFFSET 2 /* skb offset */ | ||
146 | /* Chip base address */ | ||
147 | # define SH_TSU_ADDR 0xA7000804 | ||
148 | # define ARSTR 0xA7000800 | ||
44 | 149 | ||
45 | /* Chip Registers */ | 150 | /* Chip Registers */ |
46 | /* E-DMAC */ | 151 | /* E-DMAC */ |
47 | #define EDMR 0x0000 | 152 | # define EDMR 0x0000 |
48 | #define EDTRR 0x0004 | 153 | # define EDTRR 0x0004 |
49 | #define EDRRR 0x0008 | 154 | # define EDRRR 0x0008 |
50 | #define TDLAR 0x000C | 155 | # define TDLAR 0x000C |
51 | #define RDLAR 0x0010 | 156 | # define RDLAR 0x0010 |
52 | #define EESR 0x0014 | 157 | # define EESR 0x0014 |
53 | #define EESIPR 0x0018 | 158 | # define EESIPR 0x0018 |
54 | #define TRSCER 0x001C | 159 | # define TRSCER 0x001C |
55 | #define RMFCR 0x0020 | 160 | # define RMFCR 0x0020 |
56 | #define TFTR 0x0024 | 161 | # define TFTR 0x0024 |
57 | #define FDR 0x0028 | 162 | # define FDR 0x0028 |
58 | #define RMCR 0x002C | 163 | # define RMCR 0x002C |
59 | #define EDOCR 0x0030 | 164 | # define EDOCR 0x0030 |
60 | #define FCFTR 0x0034 | 165 | # define FCFTR 0x0034 |
61 | #define RPADIR 0x0038 | 166 | # define RPADIR 0x0038 |
62 | #define TRIMD 0x003C | 167 | # define TRIMD 0x003C |
63 | #define RBWAR 0x0040 | 168 | # define RBWAR 0x0040 |
64 | #define RDFAR 0x0044 | 169 | # define RDFAR 0x0044 |
65 | #define TBRAR 0x004C | 170 | # define TBRAR 0x004C |
66 | #define TDFAR 0x0050 | 171 | # define TDFAR 0x0050 |
172 | |||
67 | /* Ether Register */ | 173 | /* Ether Register */ |
68 | #define ECMR 0x0160 | 174 | # define ECMR 0x0160 |
69 | #define ECSR 0x0164 | 175 | # define ECSR 0x0164 |
70 | #define ECSIPR 0x0168 | 176 | # define ECSIPR 0x0168 |
71 | #define PIR 0x016C | 177 | # define PIR 0x016C |
72 | #define MAHR 0x0170 | 178 | # define MAHR 0x0170 |
73 | #define MALR 0x0174 | 179 | # define MALR 0x0174 |
74 | #define RFLR 0x0178 | 180 | # define RFLR 0x0178 |
75 | #define PSR 0x017C | 181 | # define PSR 0x017C |
76 | #define TROCR 0x0180 | 182 | # define TROCR 0x0180 |
77 | #define CDCR 0x0184 | 183 | # define CDCR 0x0184 |
78 | #define LCCR 0x0188 | 184 | # define LCCR 0x0188 |
79 | #define CNDCR 0x018C | 185 | # define CNDCR 0x018C |
80 | #define CEFCR 0x0194 | 186 | # define CEFCR 0x0194 |
81 | #define FRECR 0x0198 | 187 | # define FRECR 0x0198 |
82 | #define TSFRCR 0x019C | 188 | # define TSFRCR 0x019C |
83 | #define TLFRCR 0x01A0 | 189 | # define TLFRCR 0x01A0 |
84 | #define RFCR 0x01A4 | 190 | # define RFCR 0x01A4 |
85 | #define MAFCR 0x01A8 | 191 | # define MAFCR 0x01A8 |
86 | #define IPGR 0x01B4 | 192 | # define IPGR 0x01B4 |
87 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) | 193 | # if defined(CONFIG_CPU_SUBTYPE_SH7710) |
88 | #define APR 0x01B8 | 194 | # define APR 0x01B8 |
89 | #define MPR 0x01BC | 195 | # define MPR 0x01BC |
90 | #define TPAUSER 0x1C4 | 196 | # define TPAUSER 0x1C4 |
91 | #define BCFR 0x1CC | 197 | # define BCFR 0x1CC |
92 | #endif /* CONFIG_CPU_SH7710 */ | 198 | # endif /* CONFIG_CPU_SH7710 */ |
93 | |||
94 | #define ARSTR 0x0800 | ||
95 | 199 | ||
96 | /* TSU */ | 200 | /* TSU */ |
97 | #define TSU_CTRST 0x004 | 201 | # define TSU_CTRST 0x004 |
98 | #define TSU_FWEN0 0x010 | 202 | # define TSU_FWEN0 0x010 |
99 | #define TSU_FWEN1 0x014 | 203 | # define TSU_FWEN1 0x014 |
100 | #define TSU_FCM 0x018 | 204 | # define TSU_FCM 0x018 |
101 | #define TSU_BSYSL0 0x020 | 205 | # define TSU_BSYSL0 0x020 |
102 | #define TSU_BSYSL1 0x024 | 206 | # define TSU_BSYSL1 0x024 |
103 | #define TSU_PRISL0 0x028 | 207 | # define TSU_PRISL0 0x028 |
104 | #define TSU_PRISL1 0x02C | 208 | # define TSU_PRISL1 0x02C |
105 | #define TSU_FWSL0 0x030 | 209 | # define TSU_FWSL0 0x030 |
106 | #define TSU_FWSL1 0x034 | 210 | # define TSU_FWSL1 0x034 |
107 | #define TSU_FWSLC 0x038 | 211 | # define TSU_FWSLC 0x038 |
108 | #define TSU_QTAGM0 0x040 | 212 | # define TSU_QTAGM0 0x040 |
109 | #define TSU_QTAGM1 0x044 | 213 | # define TSU_QTAGM1 0x044 |
110 | #define TSU_ADQT0 0x048 | 214 | # define TSU_ADQT0 0x048 |
111 | #define TSU_ADQT1 0x04C | 215 | # define TSU_ADQT1 0x04C |
112 | #define TSU_FWSR 0x050 | 216 | # define TSU_FWSR 0x050 |
113 | #define TSU_FWINMK 0x054 | 217 | # define TSU_FWINMK 0x054 |
114 | #define TSU_ADSBSY 0x060 | 218 | # define TSU_ADSBSY 0x060 |
115 | #define TSU_TEN 0x064 | 219 | # define TSU_TEN 0x064 |
116 | #define TSU_POST1 0x070 | 220 | # define TSU_POST1 0x070 |
117 | #define TSU_POST2 0x074 | 221 | # define TSU_POST2 0x074 |
118 | #define TSU_POST3 0x078 | 222 | # define TSU_POST3 0x078 |
119 | #define TSU_POST4 0x07C | 223 | # define TSU_POST4 0x07C |
120 | #define TXNLCR0 0x080 | 224 | # define TXNLCR0 0x080 |
121 | #define TXALCR0 0x084 | 225 | # define TXALCR0 0x084 |
122 | #define RXNLCR0 0x088 | 226 | # define RXNLCR0 0x088 |
123 | #define RXALCR0 0x08C | 227 | # define RXALCR0 0x08C |
124 | #define FWNLCR0 0x090 | 228 | # define FWNLCR0 0x090 |
125 | #define FWALCR0 0x094 | 229 | # define FWALCR0 0x094 |
126 | #define TXNLCR1 0x0A0 | 230 | # define TXNLCR1 0x0A0 |
127 | #define TXALCR1 0x0A4 | 231 | # define TXALCR1 0x0A4 |
128 | #define RXNLCR1 0x0A8 | 232 | # define RXNLCR1 0x0A8 |
129 | #define RXALCR1 0x0AC | 233 | # define RXALCR1 0x0AC |
130 | #define FWNLCR1 0x0B0 | 234 | # define FWNLCR1 0x0B0 |
131 | #define FWALCR1 0x0B4 | 235 | # define FWALCR1 0x0B4 |
132 | 236 | ||
133 | #define TSU_ADRH0 0x0100 | 237 | #define TSU_ADRH0 0x0100 |
134 | #define TSU_ADRL0 0x0104 | 238 | #define TSU_ADRL0 0x0104 |
135 | #define TSU_ADRL31 0x01FC | 239 | #define TSU_ADRL31 0x01FC |
136 | 240 | ||
137 | /* Register's bits */ | 241 | #endif /* CONFIG_CPU_SUBTYPE_SH7763 */ |
242 | |||
243 | /* | ||
244 | * Register's bits | ||
245 | */ | ||
246 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
247 | /* EDSR */ | ||
248 | enum EDSR_BIT { | ||
249 | EDSR_ENT = 0x01, EDSR_ENR = 0x02, | ||
250 | }; | ||
251 | #define EDSR_ENALL (EDSR_ENT|EDSR_ENR) | ||
252 | |||
253 | /* GECMR */ | ||
254 | enum GECMR_BIT { | ||
255 | GECMR_10 = 0x0, GECMR_100 = 0x04, GECMR_1000 = 0x01, | ||
256 | }; | ||
257 | #endif | ||
138 | 258 | ||
139 | /* EDMR */ | 259 | /* EDMR */ |
140 | enum DMAC_M_BIT { | 260 | enum DMAC_M_BIT { |
141 | EDMR_DL1 = 0x20, EDMR_DL0 = 0x10, EDMR_SRST = 0x01, | 261 | EDMR_DL1 = 0x20, EDMR_DL0 = 0x10, |
262 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
263 | EDMR_SRST = 0x03, | ||
264 | EMDR_DESC_R = 0x30, /* Descriptor reserve size */ | ||
265 | EDMR_EL = 0x40, /* Litte endian */ | ||
266 | #else /* CONFIG_CPU_SUBTYPE_SH7763 */ | ||
267 | EDMR_SRST = 0x01, | ||
268 | #endif | ||
142 | }; | 269 | }; |
143 | 270 | ||
144 | /* EDTRR */ | 271 | /* EDTRR */ |
145 | enum DMAC_T_BIT { | 272 | enum DMAC_T_BIT { |
273 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
274 | EDTRR_TRNS = 0x03, | ||
275 | #else | ||
146 | EDTRR_TRNS = 0x01, | 276 | EDTRR_TRNS = 0x01, |
277 | #endif | ||
147 | }; | 278 | }; |
148 | 279 | ||
149 | /* EDRRR*/ | 280 | /* EDRRR*/ |
@@ -173,21 +304,47 @@ enum PHY_STATUS_BIT { PHY_ST_LINK = 0x01, }; | |||
173 | 304 | ||
174 | /* EESR */ | 305 | /* EESR */ |
175 | enum EESR_BIT { | 306 | enum EESR_BIT { |
176 | EESR_TWB = 0x40000000, EESR_TABT = 0x04000000, | 307 | #ifndef CONFIG_CPU_SUBTYPE_SH7763 |
308 | EESR_TWB = 0x40000000, | ||
309 | #else | ||
310 | EESR_TWB = 0xC0000000, | ||
311 | EESR_TC1 = 0x20000000, | ||
312 | EESR_TUC = 0x10000000, | ||
313 | EESR_ROC = 0x80000000, | ||
314 | #endif | ||
315 | EESR_TABT = 0x04000000, | ||
177 | EESR_RABT = 0x02000000, EESR_RFRMER = 0x01000000, | 316 | EESR_RABT = 0x02000000, EESR_RFRMER = 0x01000000, |
178 | EESR_ADE = 0x00800000, EESR_ECI = 0x00400000, | 317 | #ifndef CONFIG_CPU_SUBTYPE_SH7763 |
179 | EESR_FTC = 0x00200000, EESR_TDE = 0x00100000, | 318 | EESR_ADE = 0x00800000, |
180 | EESR_TFE = 0x00080000, EESR_FRC = 0x00040000, | 319 | #endif |
181 | EESR_RDE = 0x00020000, EESR_RFE = 0x00010000, | 320 | EESR_ECI = 0x00400000, |
182 | EESR_TINT4 = 0x00000800, EESR_TINT3 = 0x00000400, | 321 | EESR_FTC = 0x00200000, EESR_TDE = 0x00100000, |
183 | EESR_TINT2 = 0x00000200, EESR_TINT1 = 0x00000100, | 322 | EESR_TFE = 0x00080000, EESR_FRC = 0x00040000, |
184 | EESR_RINT8 = 0x00000080, EESR_RINT5 = 0x00000010, | 323 | EESR_RDE = 0x00020000, EESR_RFE = 0x00010000, |
185 | EESR_RINT4 = 0x00000008, EESR_RINT3 = 0x00000004, | 324 | #ifndef CONFIG_CPU_SUBTYPE_SH7763 |
186 | EESR_RINT2 = 0x00000002, EESR_RINT1 = 0x00000001, | 325 | EESR_CND = 0x00000800, |
187 | }; | 326 | #endif |
188 | 327 | EESR_DLC = 0x00000400, | |
189 | #define EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \ | 328 | EESR_CD = 0x00000200, EESR_RTO = 0x00000100, |
329 | EESR_RMAF = 0x00000080, EESR_CEEF = 0x00000040, | ||
330 | EESR_CELF = 0x00000020, EESR_RRF = 0x00000010, | ||
331 | EESR_RTLF = 0x00000008, EESR_RTSF = 0x00000004, | ||
332 | EESR_PRE = 0x00000002, EESR_CERF = 0x00000001, | ||
333 | }; | ||
334 | |||
335 | |||
336 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
337 | # define TX_CHECK (EESR_TC1 | EESR_FTC) | ||
338 | # define EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \ | ||
339 | | EESR_RFRMER | EESR_TFE | EESR_TDE | EESR_ECI) | ||
340 | # define TX_ERROR_CEHCK (EESR_TWB | EESR_TABT | EESR_TDE | EESR_TFE) | ||
341 | |||
342 | #else | ||
343 | # define TX_CHECK (EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | EESR_RTO) | ||
344 | # define EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | EESR_RDE \ | ||
190 | | EESR_RFRMER | EESR_ADE | EESR_TFE | EESR_TDE | EESR_ECI) | 345 | | EESR_RFRMER | EESR_ADE | EESR_TFE | EESR_TDE | EESR_ECI) |
346 | # define TX_ERROR_CEHCK (EESR_TWB | EESR_TABT | EESR_ADE | EESR_TDE | EESR_TFE) | ||
347 | #endif | ||
191 | 348 | ||
192 | /* EESIPR */ | 349 | /* EESIPR */ |
193 | enum DMAC_IM_BIT { | 350 | enum DMAC_IM_BIT { |
@@ -207,8 +364,8 @@ enum DMAC_IM_BIT { | |||
207 | 364 | ||
208 | /* Receive descriptor bit */ | 365 | /* Receive descriptor bit */ |
209 | enum RD_STS_BIT { | 366 | enum RD_STS_BIT { |
210 | RD_RACT = 0x80000000, RC_RDEL = 0x40000000, | 367 | RD_RACT = 0x80000000, RD_RDEL = 0x40000000, |
211 | RC_RFP1 = 0x20000000, RC_RFP0 = 0x10000000, | 368 | RD_RFP1 = 0x20000000, RD_RFP0 = 0x10000000, |
212 | RD_RFE = 0x08000000, RD_RFS10 = 0x00000200, | 369 | RD_RFE = 0x08000000, RD_RFS10 = 0x00000200, |
213 | RD_RFS9 = 0x00000100, RD_RFS8 = 0x00000080, | 370 | RD_RFS9 = 0x00000100, RD_RFS8 = 0x00000080, |
214 | RD_RFS7 = 0x00000040, RD_RFS6 = 0x00000020, | 371 | RD_RFS7 = 0x00000040, RD_RFS6 = 0x00000020, |
@@ -216,9 +373,9 @@ enum RD_STS_BIT { | |||
216 | RD_RFS3 = 0x00000004, RD_RFS2 = 0x00000002, | 373 | RD_RFS3 = 0x00000004, RD_RFS2 = 0x00000002, |
217 | RD_RFS1 = 0x00000001, | 374 | RD_RFS1 = 0x00000001, |
218 | }; | 375 | }; |
219 | #define RDF1ST RC_RFP1 | 376 | #define RDF1ST RD_RFP1 |
220 | #define RDFEND RC_RFP0 | 377 | #define RDFEND RD_RFP0 |
221 | #define RD_RFP (RC_RFP1|RC_RFP0) | 378 | #define RD_RFP (RD_RFP1|RD_RFP0) |
222 | 379 | ||
223 | /* FCFTR */ | 380 | /* FCFTR */ |
224 | enum FCFTR_BIT { | 381 | enum FCFTR_BIT { |
@@ -231,7 +388,8 @@ enum FCFTR_BIT { | |||
231 | 388 | ||
232 | /* Transfer descriptor bit */ | 389 | /* Transfer descriptor bit */ |
233 | enum TD_STS_BIT { | 390 | enum TD_STS_BIT { |
234 | TD_TACT = 0x80000000, TD_TDLE = 0x40000000, TD_TFP1 = 0x20000000, | 391 | TD_TACT = 0x80000000, |
392 | TD_TDLE = 0x40000000, TD_TFP1 = 0x20000000, | ||
235 | TD_TFP0 = 0x10000000, | 393 | TD_TFP0 = 0x10000000, |
236 | }; | 394 | }; |
237 | #define TDF1ST TD_TFP1 | 395 | #define TDF1ST TD_TFP1 |
@@ -242,6 +400,10 @@ enum TD_STS_BIT { | |||
242 | enum RECV_RST_BIT { RMCR_RST = 0x01, }; | 400 | enum RECV_RST_BIT { RMCR_RST = 0x01, }; |
243 | /* ECMR */ | 401 | /* ECMR */ |
244 | enum FELIC_MODE_BIT { | 402 | enum FELIC_MODE_BIT { |
403 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
404 | ECMR_TRCCM = 0x04000000, ECMR_RCSC = 0x00800000, | ||
405 | ECMR_DPAD = 0x00200000, ECMR_RZPF = 0x00100000, | ||
406 | #endif | ||
245 | ECMR_ZPF = 0x00080000, ECMR_PFR = 0x00040000, ECMR_RXF = 0x00020000, | 407 | ECMR_ZPF = 0x00080000, ECMR_PFR = 0x00040000, ECMR_RXF = 0x00020000, |
246 | ECMR_TXF = 0x00010000, ECMR_MCT = 0x00002000, ECMR_PRCEF = 0x00001000, | 408 | ECMR_TXF = 0x00010000, ECMR_MCT = 0x00002000, ECMR_PRCEF = 0x00001000, |
247 | ECMR_PMDE = 0x00000200, ECMR_RE = 0x00000040, ECMR_TE = 0x00000020, | 409 | ECMR_PMDE = 0x00000200, ECMR_RE = 0x00000040, ECMR_TE = 0x00000020, |
@@ -249,18 +411,45 @@ enum FELIC_MODE_BIT { | |||
249 | ECMR_PRM = 0x00000001, | 411 | ECMR_PRM = 0x00000001, |
250 | }; | 412 | }; |
251 | 413 | ||
414 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
415 | #define ECMR_CHG_DM (ECMR_TRCCM | ECMR_RZPF | ECMR_ZPF |\ | ||
416 | ECMR_PFR | ECMR_RXF | ECMR_TXF | ECMR_MCT) | ||
417 | #else | ||
418 | #define ECMR_CHG_DM (ECMR_ZPF | ECMR_PFR ECMR_RXF | ECMR_TXF | ECMR_MCT) | ||
419 | #endif | ||
420 | |||
252 | /* ECSR */ | 421 | /* ECSR */ |
253 | enum ECSR_STATUS_BIT { | 422 | enum ECSR_STATUS_BIT { |
254 | ECSR_BRCRX = 0x20, ECSR_PSRTO = 0x10, ECSR_LCHNG = 0x04, | 423 | #ifndef CONFIG_CPU_SUBTYPE_SH7763 |
424 | ECSR_BRCRX = 0x20, ECSR_PSRTO = 0x10, | ||
425 | #endif | ||
426 | ECSR_LCHNG = 0x04, | ||
255 | ECSR_MPD = 0x02, ECSR_ICD = 0x01, | 427 | ECSR_MPD = 0x02, ECSR_ICD = 0x01, |
256 | }; | 428 | }; |
257 | 429 | ||
430 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
431 | # define ECSR_INIT (ECSR_ICD | ECSIPR_MPDIP) | ||
432 | #else | ||
433 | # define ECSR_INIT (ECSR_BRCRX | ECSR_PSRTO | \ | ||
434 | ECSR_LCHNG | ECSR_ICD | ECSIPR_MPDIP) | ||
435 | #endif | ||
436 | |||
258 | /* ECSIPR */ | 437 | /* ECSIPR */ |
259 | enum ECSIPR_STATUS_MASK_BIT { | 438 | enum ECSIPR_STATUS_MASK_BIT { |
260 | ECSIPR_BRCRXIP = 0x20, ECSIPR_PSRTOIP = 0x10, ECSIPR_LCHNGIP = 0x04, | 439 | #ifndef CONFIG_CPU_SUBTYPE_SH7763 |
440 | ECSIPR_BRCRXIP = 0x20, ECSIPR_PSRTOIP = 0x10, | ||
441 | #endif | ||
442 | ECSIPR_LCHNGIP = 0x04, | ||
261 | ECSIPR_MPDIP = 0x02, ECSIPR_ICDIP = 0x01, | 443 | ECSIPR_MPDIP = 0x02, ECSIPR_ICDIP = 0x01, |
262 | }; | 444 | }; |
263 | 445 | ||
446 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
447 | # define ECSIPR_INIT (ECSIPR_LCHNGIP | ECSIPR_ICDIP | ECSIPR_MPDIP) | ||
448 | #else | ||
449 | # define ECSIPR_INIT (ECSIPR_BRCRXIP | ECSIPR_PSRTOIP | ECSIPR_LCHNGIP | \ | ||
450 | ECSIPR_ICDIP | ECSIPR_MPDIP) | ||
451 | #endif | ||
452 | |||
264 | /* APR */ | 453 | /* APR */ |
265 | enum APR_BIT { | 454 | enum APR_BIT { |
266 | APR_AP = 0x00000001, | 455 | APR_AP = 0x00000001, |
@@ -285,6 +474,15 @@ enum RPADIR_BIT { | |||
285 | RPADIR_PADR = 0x0003f, | 474 | RPADIR_PADR = 0x0003f, |
286 | }; | 475 | }; |
287 | 476 | ||
477 | #if defined(CONFIG_CPU_SUBTYPE_SH7763) | ||
478 | # define RPADIR_INIT (0x00) | ||
479 | #else | ||
480 | # define RPADIR_INIT (RPADIR_PADS1) | ||
481 | #endif | ||
482 | |||
483 | /* RFLR */ | ||
484 | #define RFLR_VALUE 0x1000 | ||
485 | |||
288 | /* FDR */ | 486 | /* FDR */ |
289 | enum FIFO_SIZE_BIT { | 487 | enum FIFO_SIZE_BIT { |
290 | FIFO_SIZE_T = 0x00000700, FIFO_SIZE_R = 0x00000007, | 488 | FIFO_SIZE_T = 0x00000700, FIFO_SIZE_R = 0x00000007, |
@@ -316,7 +514,7 @@ enum PHY_ANA_BIT { | |||
316 | PHY_A_NP = 0x8000, PHY_A_ACK = 0x4000, PHY_A_RF = 0x2000, | 514 | PHY_A_NP = 0x8000, PHY_A_ACK = 0x4000, PHY_A_RF = 0x2000, |
317 | PHY_A_FCS = 0x0400, PHY_A_T4 = 0x0200, PHY_A_FDX = 0x0100, | 515 | PHY_A_FCS = 0x0400, PHY_A_T4 = 0x0200, PHY_A_FDX = 0x0100, |
318 | PHY_A_HDX = 0x0080, PHY_A_10FDX = 0x0040, PHY_A_10HDX = 0x0020, | 516 | PHY_A_HDX = 0x0080, PHY_A_10FDX = 0x0040, PHY_A_10HDX = 0x0020, |
319 | PHY_A_SEL = 0x001f, | 517 | PHY_A_SEL = 0x001e, |
320 | }; | 518 | }; |
321 | /* PHY_ANL */ | 519 | /* PHY_ANL */ |
322 | enum PHY_ANL_BIT { | 520 | enum PHY_ANL_BIT { |
@@ -449,6 +647,10 @@ struct sh_eth_private { | |||
449 | struct net_device_stats tsu_stats; /* TSU forward status */ | 647 | struct net_device_stats tsu_stats; /* TSU forward status */ |
450 | }; | 648 | }; |
451 | 649 | ||
650 | #ifdef CONFIG_CPU_SUBTYPE_SH7763 | ||
651 | /* SH7763 has endian control register */ | ||
652 | #define swaps(x, y) | ||
653 | #else | ||
452 | static void swaps(char *src, int len) | 654 | static void swaps(char *src, int len) |
453 | { | 655 | { |
454 | #ifdef __LITTLE_ENDIAN__ | 656 | #ifdef __LITTLE_ENDIAN__ |
@@ -460,5 +662,5 @@ static void swaps(char *src, int len) | |||
460 | *p = swab32(*p); | 662 | *p = swab32(*p); |
461 | #endif | 663 | #endif |
462 | } | 664 | } |
463 | 665 | #endif /* CONFIG_CPU_SUBTYPE_SH7763 */ | |
464 | #endif | 666 | #endif |
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c index ffbfb1b79f97..805383b33d3c 100644 --- a/drivers/net/skfp/smt.c +++ b/drivers/net/skfp/smt.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "h/smc.h" | 19 | #include "h/smc.h" |
20 | #include "h/smt_p.h" | 20 | #include "h/smt_p.h" |
21 | #include <linux/bitrev.h> | 21 | #include <linux/bitrev.h> |
22 | #include <linux/kernel.h> | ||
22 | 23 | ||
23 | #define KERNEL | 24 | #define KERNEL |
24 | #include "h/smtstate.h" | 25 | #include "h/smtstate.h" |
@@ -1730,20 +1731,18 @@ void fddi_send_antc(struct s_smc *smc, struct fddi_addr *dest) | |||
1730 | #endif | 1731 | #endif |
1731 | 1732 | ||
1732 | #ifdef DEBUG | 1733 | #ifdef DEBUG |
1733 | #define hextoasc(x) "0123456789abcdef"[x] | ||
1734 | |||
1735 | char *addr_to_string(struct fddi_addr *addr) | 1734 | char *addr_to_string(struct fddi_addr *addr) |
1736 | { | 1735 | { |
1737 | int i ; | 1736 | int i ; |
1738 | static char string[6*3] = "****" ; | 1737 | static char string[6*3] = "****" ; |
1739 | 1738 | ||
1740 | for (i = 0 ; i < 6 ; i++) { | 1739 | for (i = 0 ; i < 6 ; i++) { |
1741 | string[i*3] = hextoasc((addr->a[i]>>4)&0xf) ; | 1740 | string[i * 3] = hex_asc_hi(addr->a[i]); |
1742 | string[i*3+1] = hextoasc((addr->a[i])&0xf) ; | 1741 | string[i * 3 + 1] = hex_asc_lo(addr->a[i]); |
1743 | string[i*3+2] = ':' ; | 1742 | string[i * 3 + 2] = ':'; |
1744 | } | 1743 | } |
1745 | string[5*3+2] = 0 ; | 1744 | string[5 * 3 + 2] = 0; |
1746 | return(string) ; | 1745 | return(string); |
1747 | } | 1746 | } |
1748 | #endif | 1747 | #endif |
1749 | 1748 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 633c128a6228..26aa37aa531f 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -1982,8 +1982,6 @@ static void tg3_power_down_phy(struct tg3 *tp) | |||
1982 | static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | 1982 | static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) |
1983 | { | 1983 | { |
1984 | u32 misc_host_ctrl; | 1984 | u32 misc_host_ctrl; |
1985 | u16 power_control, power_caps; | ||
1986 | int pm = tp->pm_cap; | ||
1987 | 1985 | ||
1988 | /* Make sure register accesses (indirect or otherwise) | 1986 | /* Make sure register accesses (indirect or otherwise) |
1989 | * will function correctly. | 1987 | * will function correctly. |
@@ -1992,18 +1990,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
1992 | TG3PCI_MISC_HOST_CTRL, | 1990 | TG3PCI_MISC_HOST_CTRL, |
1993 | tp->misc_host_ctrl); | 1991 | tp->misc_host_ctrl); |
1994 | 1992 | ||
1995 | pci_read_config_word(tp->pdev, | ||
1996 | pm + PCI_PM_CTRL, | ||
1997 | &power_control); | ||
1998 | power_control |= PCI_PM_CTRL_PME_STATUS; | ||
1999 | power_control &= ~(PCI_PM_CTRL_STATE_MASK); | ||
2000 | switch (state) { | 1993 | switch (state) { |
2001 | case PCI_D0: | 1994 | case PCI_D0: |
2002 | power_control |= 0; | 1995 | pci_enable_wake(tp->pdev, state, false); |
2003 | pci_write_config_word(tp->pdev, | 1996 | pci_set_power_state(tp->pdev, PCI_D0); |
2004 | pm + PCI_PM_CTRL, | ||
2005 | power_control); | ||
2006 | udelay(100); /* Delay after power state change */ | ||
2007 | 1997 | ||
2008 | /* Switch out of Vaux if it is a NIC */ | 1998 | /* Switch out of Vaux if it is a NIC */ |
2009 | if (tp->tg3_flags2 & TG3_FLG2_IS_NIC) | 1999 | if (tp->tg3_flags2 & TG3_FLG2_IS_NIC) |
@@ -2012,26 +2002,15 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
2012 | return 0; | 2002 | return 0; |
2013 | 2003 | ||
2014 | case PCI_D1: | 2004 | case PCI_D1: |
2015 | power_control |= 1; | ||
2016 | break; | ||
2017 | |||
2018 | case PCI_D2: | 2005 | case PCI_D2: |
2019 | power_control |= 2; | ||
2020 | break; | ||
2021 | |||
2022 | case PCI_D3hot: | 2006 | case PCI_D3hot: |
2023 | power_control |= 3; | ||
2024 | break; | 2007 | break; |
2025 | 2008 | ||
2026 | default: | 2009 | default: |
2027 | printk(KERN_WARNING PFX "%s: Invalid power state (%d) " | 2010 | printk(KERN_ERR PFX "%s: Invalid power state (D%d) requested\n", |
2028 | "requested.\n", | 2011 | tp->dev->name, state); |
2029 | tp->dev->name, state); | ||
2030 | return -EINVAL; | 2012 | return -EINVAL; |
2031 | } | 2013 | } |
2032 | |||
2033 | power_control |= PCI_PM_CTRL_PME_ENABLE; | ||
2034 | |||
2035 | misc_host_ctrl = tr32(TG3PCI_MISC_HOST_CTRL); | 2014 | misc_host_ctrl = tr32(TG3PCI_MISC_HOST_CTRL); |
2036 | tw32(TG3PCI_MISC_HOST_CTRL, | 2015 | tw32(TG3PCI_MISC_HOST_CTRL, |
2037 | misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT); | 2016 | misc_host_ctrl | MISC_HOST_CTRL_MASK_PCI_INT); |
@@ -2109,8 +2088,6 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
2109 | WOL_DRV_WOL | | 2088 | WOL_DRV_WOL | |
2110 | WOL_SET_MAGIC_PKT); | 2089 | WOL_SET_MAGIC_PKT); |
2111 | 2090 | ||
2112 | pci_read_config_word(tp->pdev, pm + PCI_PM_PMC, &power_caps); | ||
2113 | |||
2114 | if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { | 2091 | if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) { |
2115 | u32 mac_mode; | 2092 | u32 mac_mode; |
2116 | 2093 | ||
@@ -2143,8 +2120,8 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
2143 | if (!(tp->tg3_flags2 & TG3_FLG2_5750_PLUS)) | 2120 | if (!(tp->tg3_flags2 & TG3_FLG2_5750_PLUS)) |
2144 | tw32(MAC_LED_CTRL, tp->led_ctrl); | 2121 | tw32(MAC_LED_CTRL, tp->led_ctrl); |
2145 | 2122 | ||
2146 | if (((power_caps & PCI_PM_CAP_PME_D3cold) && | 2123 | if (pci_pme_capable(tp->pdev, state) && |
2147 | (tp->tg3_flags & TG3_FLAG_WOL_ENABLE))) | 2124 | (tp->tg3_flags & TG3_FLAG_WOL_ENABLE)) |
2148 | mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE; | 2125 | mac_mode |= MAC_MODE_MAGIC_PKT_ENABLE; |
2149 | 2126 | ||
2150 | tw32_f(MAC_MODE, mac_mode); | 2127 | tw32_f(MAC_MODE, mac_mode); |
@@ -2236,9 +2213,11 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) | |||
2236 | 2213 | ||
2237 | tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN); | 2214 | tg3_write_sig_post_reset(tp, RESET_KIND_SHUTDOWN); |
2238 | 2215 | ||
2216 | if (tp->tg3_flags & TG3_FLAG_WOL_ENABLE) | ||
2217 | pci_enable_wake(tp->pdev, state, true); | ||
2218 | |||
2239 | /* Finally, set the new power state. */ | 2219 | /* Finally, set the new power state. */ |
2240 | pci_write_config_word(tp->pdev, pm + PCI_PM_CTRL, power_control); | 2220 | pci_set_power_state(tp->pdev, state); |
2241 | udelay(100); /* Delay after power state change */ | ||
2242 | 2221 | ||
2243 | return 0; | 2222 | return 0; |
2244 | } | 2223 | } |
@@ -9065,7 +9044,8 @@ static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
9065 | { | 9044 | { |
9066 | struct tg3 *tp = netdev_priv(dev); | 9045 | struct tg3 *tp = netdev_priv(dev); |
9067 | 9046 | ||
9068 | if (tp->tg3_flags & TG3_FLAG_WOL_CAP) | 9047 | if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) && |
9048 | device_can_wakeup(&tp->pdev->dev)) | ||
9069 | wol->supported = WAKE_MAGIC; | 9049 | wol->supported = WAKE_MAGIC; |
9070 | else | 9050 | else |
9071 | wol->supported = 0; | 9051 | wol->supported = 0; |
@@ -9078,18 +9058,22 @@ static void tg3_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | |||
9078 | static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 9058 | static int tg3_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
9079 | { | 9059 | { |
9080 | struct tg3 *tp = netdev_priv(dev); | 9060 | struct tg3 *tp = netdev_priv(dev); |
9061 | struct device *dp = &tp->pdev->dev; | ||
9081 | 9062 | ||
9082 | if (wol->wolopts & ~WAKE_MAGIC) | 9063 | if (wol->wolopts & ~WAKE_MAGIC) |
9083 | return -EINVAL; | 9064 | return -EINVAL; |
9084 | if ((wol->wolopts & WAKE_MAGIC) && | 9065 | if ((wol->wolopts & WAKE_MAGIC) && |
9085 | !(tp->tg3_flags & TG3_FLAG_WOL_CAP)) | 9066 | !((tp->tg3_flags & TG3_FLAG_WOL_CAP) && device_can_wakeup(dp))) |
9086 | return -EINVAL; | 9067 | return -EINVAL; |
9087 | 9068 | ||
9088 | spin_lock_bh(&tp->lock); | 9069 | spin_lock_bh(&tp->lock); |
9089 | if (wol->wolopts & WAKE_MAGIC) | 9070 | if (wol->wolopts & WAKE_MAGIC) { |
9090 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; | 9071 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; |
9091 | else | 9072 | device_set_wakeup_enable(dp, true); |
9073 | } else { | ||
9092 | tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE; | 9074 | tp->tg3_flags &= ~TG3_FLAG_WOL_ENABLE; |
9075 | device_set_wakeup_enable(dp, false); | ||
9076 | } | ||
9093 | spin_unlock_bh(&tp->lock); | 9077 | spin_unlock_bh(&tp->lock); |
9094 | 9078 | ||
9095 | return 0; | 9079 | return 0; |
@@ -11296,7 +11280,8 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
11296 | if (val & VCPU_CFGSHDW_ASPM_DBNC) | 11280 | if (val & VCPU_CFGSHDW_ASPM_DBNC) |
11297 | tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND; | 11281 | tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND; |
11298 | if ((val & VCPU_CFGSHDW_WOL_ENABLE) && | 11282 | if ((val & VCPU_CFGSHDW_WOL_ENABLE) && |
11299 | (val & VCPU_CFGSHDW_WOL_MAGPKT)) | 11283 | (val & VCPU_CFGSHDW_WOL_MAGPKT) && |
11284 | device_may_wakeup(&tp->pdev->dev)) | ||
11300 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; | 11285 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; |
11301 | return; | 11286 | return; |
11302 | } | 11287 | } |
@@ -11426,8 +11411,9 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp) | |||
11426 | !(nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)) | 11411 | !(nic_cfg & NIC_SRAM_DATA_CFG_FIBER_WOL)) |
11427 | tp->tg3_flags &= ~TG3_FLAG_WOL_CAP; | 11412 | tp->tg3_flags &= ~TG3_FLAG_WOL_CAP; |
11428 | 11413 | ||
11429 | if (tp->tg3_flags & TG3_FLAG_WOL_CAP && | 11414 | if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) && |
11430 | nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE) | 11415 | (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE) && |
11416 | device_may_wakeup(&tp->pdev->dev)) | ||
11431 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; | 11417 | tp->tg3_flags |= TG3_FLAG_WOL_ENABLE; |
11432 | 11418 | ||
11433 | if (cfg2 & (1 << 17)) | 11419 | if (cfg2 & (1 << 17)) |
@@ -13613,6 +13599,7 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) | |||
13613 | { | 13599 | { |
13614 | struct net_device *dev = pci_get_drvdata(pdev); | 13600 | struct net_device *dev = pci_get_drvdata(pdev); |
13615 | struct tg3 *tp = netdev_priv(dev); | 13601 | struct tg3 *tp = netdev_priv(dev); |
13602 | pci_power_t target_state; | ||
13616 | int err; | 13603 | int err; |
13617 | 13604 | ||
13618 | /* PCI register 4 needs to be saved whether netif_running() or not. | 13605 | /* PCI register 4 needs to be saved whether netif_running() or not. |
@@ -13641,7 +13628,9 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state) | |||
13641 | tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; | 13628 | tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; |
13642 | tg3_full_unlock(tp); | 13629 | tg3_full_unlock(tp); |
13643 | 13630 | ||
13644 | err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); | 13631 | target_state = pdev->pm_cap ? pci_target_state(pdev) : PCI_D3hot; |
13632 | |||
13633 | err = tg3_set_power_state(tp, target_state); | ||
13645 | if (err) { | 13634 | if (err) { |
13646 | int err2; | 13635 | int err2; |
13647 | 13636 | ||
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index f7319d326912..78df2be8a728 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -55,12 +55,28 @@ | |||
55 | 55 | ||
56 | static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data) | 56 | static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data) |
57 | { | 57 | { |
58 | void *buf; | ||
59 | int err = -ENOMEM; | ||
60 | |||
58 | devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); | 61 | devdbg(dev, "dm_read() reg=0x%02x length=%d", reg, length); |
59 | return usb_control_msg(dev->udev, | 62 | |
60 | usb_rcvctrlpipe(dev->udev, 0), | 63 | buf = kmalloc(length, GFP_KERNEL); |
61 | DM_READ_REGS, | 64 | if (!buf) |
62 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 65 | goto out; |
63 | 0, reg, data, length, USB_CTRL_SET_TIMEOUT); | 66 | |
67 | err = usb_control_msg(dev->udev, | ||
68 | usb_rcvctrlpipe(dev->udev, 0), | ||
69 | DM_READ_REGS, | ||
70 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
71 | 0, reg, buf, length, USB_CTRL_SET_TIMEOUT); | ||
72 | if (err == length) | ||
73 | memcpy(data, buf, length); | ||
74 | else if (err >= 0) | ||
75 | err = -EINVAL; | ||
76 | kfree(buf); | ||
77 | |||
78 | out: | ||
79 | return err; | ||
64 | } | 80 | } |
65 | 81 | ||
66 | static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value) | 82 | static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value) |
@@ -70,12 +86,28 @@ static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value) | |||
70 | 86 | ||
71 | static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) | 87 | static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) |
72 | { | 88 | { |
89 | void *buf = NULL; | ||
90 | int err = -ENOMEM; | ||
91 | |||
73 | devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); | 92 | devdbg(dev, "dm_write() reg=0x%02x, length=%d", reg, length); |
74 | return usb_control_msg(dev->udev, | 93 | |
75 | usb_sndctrlpipe(dev->udev, 0), | 94 | if (data) { |
76 | DM_WRITE_REGS, | 95 | buf = kmalloc(length, GFP_KERNEL); |
77 | USB_DIR_OUT | USB_TYPE_VENDOR |USB_RECIP_DEVICE, | 96 | if (!buf) |
78 | 0, reg, data, length, USB_CTRL_SET_TIMEOUT); | 97 | goto out; |
98 | memcpy(buf, data, length); | ||
99 | } | ||
100 | |||
101 | err = usb_control_msg(dev->udev, | ||
102 | usb_sndctrlpipe(dev->udev, 0), | ||
103 | DM_WRITE_REGS, | ||
104 | USB_DIR_OUT | USB_TYPE_VENDOR |USB_RECIP_DEVICE, | ||
105 | 0, reg, buf, length, USB_CTRL_SET_TIMEOUT); | ||
106 | kfree(buf); | ||
107 | if (err >= 0 && err < length) | ||
108 | err = -EINVAL; | ||
109 | out: | ||
110 | return err; | ||
79 | } | 111 | } |
80 | 112 | ||
81 | static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) | 113 | static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value) |
diff --git a/drivers/net/wd.c b/drivers/net/wd.c index fa14255282af..6f9aa1643743 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c | |||
@@ -337,7 +337,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr) | |||
337 | #ifdef CONFIG_NET_POLL_CONTROLLER | 337 | #ifdef CONFIG_NET_POLL_CONTROLLER |
338 | dev->poll_controller = ei_poll; | 338 | dev->poll_controller = ei_poll; |
339 | #endif | 339 | #endif |
340 | NS8390_init(dev, 0); | 340 | NS8390p_init(dev, 0); |
341 | 341 | ||
342 | #if 1 | 342 | #if 1 |
343 | /* Enable interrupt generation on softconfig cards -- M.U */ | 343 | /* Enable interrupt generation on softconfig cards -- M.U */ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 4c4142c5aa6e..a26f565e8189 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -97,6 +97,7 @@ header-y += ioctl.h | |||
97 | header-y += ip6_tunnel.h | 97 | header-y += ip6_tunnel.h |
98 | header-y += ipmi_msgdefs.h | 98 | header-y += ipmi_msgdefs.h |
99 | header-y += ipsec.h | 99 | header-y += ipsec.h |
100 | header-y += ip_vs.h | ||
100 | header-y += ipx.h | 101 | header-y += ipx.h |
101 | header-y += irda.h | 102 | header-y += irda.h |
102 | header-y += iso_fs.h | 103 | header-y += iso_fs.h |
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h new file mode 100644 index 000000000000..ec6eb49af2d8 --- /dev/null +++ b/include/linux/ip_vs.h | |||
@@ -0,0 +1,245 @@ | |||
1 | /* | ||
2 | * IP Virtual Server | ||
3 | * data structure and functionality definitions | ||
4 | */ | ||
5 | |||
6 | #ifndef _IP_VS_H | ||
7 | #define _IP_VS_H | ||
8 | |||
9 | #include <linux/types.h> /* For __beXX types in userland */ | ||
10 | |||
11 | #define IP_VS_VERSION_CODE 0x010201 | ||
12 | #define NVERSION(version) \ | ||
13 | (version >> 16) & 0xFF, \ | ||
14 | (version >> 8) & 0xFF, \ | ||
15 | version & 0xFF | ||
16 | |||
17 | /* | ||
18 | * Virtual Service Flags | ||
19 | */ | ||
20 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ | ||
21 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ | ||
22 | |||
23 | /* | ||
24 | * Destination Server Flags | ||
25 | */ | ||
26 | #define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */ | ||
27 | #define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */ | ||
28 | |||
29 | /* | ||
30 | * IPVS sync daemon states | ||
31 | */ | ||
32 | #define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */ | ||
33 | #define IP_VS_STATE_MASTER 0x0001 /* started as master */ | ||
34 | #define IP_VS_STATE_BACKUP 0x0002 /* started as backup */ | ||
35 | |||
36 | /* | ||
37 | * IPVS socket options | ||
38 | */ | ||
39 | #define IP_VS_BASE_CTL (64+1024+64) /* base */ | ||
40 | |||
41 | #define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */ | ||
42 | #define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1) | ||
43 | #define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2) | ||
44 | #define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3) | ||
45 | #define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4) | ||
46 | #define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5) | ||
47 | #define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6) | ||
48 | #define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7) | ||
49 | #define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8) | ||
50 | #define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9) | ||
51 | #define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10) | ||
52 | #define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11) | ||
53 | #define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12) | ||
54 | #define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13) | ||
55 | #define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14) | ||
56 | #define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15) | ||
57 | #define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO | ||
58 | |||
59 | #define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL | ||
60 | #define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1) | ||
61 | #define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2) | ||
62 | #define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3) | ||
63 | #define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4) | ||
64 | #define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */ | ||
65 | #define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6) | ||
66 | #define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7) | ||
67 | #define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON | ||
68 | |||
69 | |||
70 | /* | ||
71 | * IPVS Connection Flags | ||
72 | */ | ||
73 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ | ||
74 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ | ||
75 | #define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */ | ||
76 | #define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */ | ||
77 | #define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */ | ||
78 | #define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */ | ||
79 | #define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */ | ||
80 | #define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */ | ||
81 | #define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */ | ||
82 | #define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */ | ||
83 | #define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */ | ||
84 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ | ||
85 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ | ||
86 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ | ||
87 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | ||
88 | |||
89 | #define IP_VS_SCHEDNAME_MAXLEN 16 | ||
90 | #define IP_VS_IFNAME_MAXLEN 16 | ||
91 | |||
92 | |||
93 | /* | ||
94 | * The struct ip_vs_service_user and struct ip_vs_dest_user are | ||
95 | * used to set IPVS rules through setsockopt. | ||
96 | */ | ||
97 | struct ip_vs_service_user { | ||
98 | /* virtual service addresses */ | ||
99 | u_int16_t protocol; | ||
100 | __be32 addr; /* virtual ip address */ | ||
101 | __be16 port; | ||
102 | u_int32_t fwmark; /* firwall mark of service */ | ||
103 | |||
104 | /* virtual service options */ | ||
105 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
106 | unsigned flags; /* virtual service flags */ | ||
107 | unsigned timeout; /* persistent timeout in sec */ | ||
108 | __be32 netmask; /* persistent netmask */ | ||
109 | }; | ||
110 | |||
111 | |||
112 | struct ip_vs_dest_user { | ||
113 | /* destination server address */ | ||
114 | __be32 addr; | ||
115 | __be16 port; | ||
116 | |||
117 | /* real server options */ | ||
118 | unsigned conn_flags; /* connection flags */ | ||
119 | int weight; /* destination weight */ | ||
120 | |||
121 | /* thresholds for active connections */ | ||
122 | u_int32_t u_threshold; /* upper threshold */ | ||
123 | u_int32_t l_threshold; /* lower threshold */ | ||
124 | }; | ||
125 | |||
126 | |||
127 | /* | ||
128 | * IPVS statistics object (for user space) | ||
129 | */ | ||
130 | struct ip_vs_stats_user | ||
131 | { | ||
132 | __u32 conns; /* connections scheduled */ | ||
133 | __u32 inpkts; /* incoming packets */ | ||
134 | __u32 outpkts; /* outgoing packets */ | ||
135 | __u64 inbytes; /* incoming bytes */ | ||
136 | __u64 outbytes; /* outgoing bytes */ | ||
137 | |||
138 | __u32 cps; /* current connection rate */ | ||
139 | __u32 inpps; /* current in packet rate */ | ||
140 | __u32 outpps; /* current out packet rate */ | ||
141 | __u32 inbps; /* current in byte rate */ | ||
142 | __u32 outbps; /* current out byte rate */ | ||
143 | }; | ||
144 | |||
145 | |||
146 | /* The argument to IP_VS_SO_GET_INFO */ | ||
147 | struct ip_vs_getinfo { | ||
148 | /* version number */ | ||
149 | unsigned int version; | ||
150 | |||
151 | /* size of connection hash table */ | ||
152 | unsigned int size; | ||
153 | |||
154 | /* number of virtual services */ | ||
155 | unsigned int num_services; | ||
156 | }; | ||
157 | |||
158 | |||
159 | /* The argument to IP_VS_SO_GET_SERVICE */ | ||
160 | struct ip_vs_service_entry { | ||
161 | /* which service: user fills in these */ | ||
162 | u_int16_t protocol; | ||
163 | __be32 addr; /* virtual address */ | ||
164 | __be16 port; | ||
165 | u_int32_t fwmark; /* firwall mark of service */ | ||
166 | |||
167 | /* service options */ | ||
168 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
169 | unsigned flags; /* virtual service flags */ | ||
170 | unsigned timeout; /* persistent timeout */ | ||
171 | __be32 netmask; /* persistent netmask */ | ||
172 | |||
173 | /* number of real servers */ | ||
174 | unsigned int num_dests; | ||
175 | |||
176 | /* statistics */ | ||
177 | struct ip_vs_stats_user stats; | ||
178 | }; | ||
179 | |||
180 | |||
181 | struct ip_vs_dest_entry { | ||
182 | __be32 addr; /* destination address */ | ||
183 | __be16 port; | ||
184 | unsigned conn_flags; /* connection flags */ | ||
185 | int weight; /* destination weight */ | ||
186 | |||
187 | u_int32_t u_threshold; /* upper threshold */ | ||
188 | u_int32_t l_threshold; /* lower threshold */ | ||
189 | |||
190 | u_int32_t activeconns; /* active connections */ | ||
191 | u_int32_t inactconns; /* inactive connections */ | ||
192 | u_int32_t persistconns; /* persistent connections */ | ||
193 | |||
194 | /* statistics */ | ||
195 | struct ip_vs_stats_user stats; | ||
196 | }; | ||
197 | |||
198 | |||
199 | /* The argument to IP_VS_SO_GET_DESTS */ | ||
200 | struct ip_vs_get_dests { | ||
201 | /* which service: user fills in these */ | ||
202 | u_int16_t protocol; | ||
203 | __be32 addr; /* virtual address */ | ||
204 | __be16 port; | ||
205 | u_int32_t fwmark; /* firwall mark of service */ | ||
206 | |||
207 | /* number of real servers */ | ||
208 | unsigned int num_dests; | ||
209 | |||
210 | /* the real servers */ | ||
211 | struct ip_vs_dest_entry entrytable[0]; | ||
212 | }; | ||
213 | |||
214 | |||
215 | /* The argument to IP_VS_SO_GET_SERVICES */ | ||
216 | struct ip_vs_get_services { | ||
217 | /* number of virtual services */ | ||
218 | unsigned int num_services; | ||
219 | |||
220 | /* service table */ | ||
221 | struct ip_vs_service_entry entrytable[0]; | ||
222 | }; | ||
223 | |||
224 | |||
225 | /* The argument to IP_VS_SO_GET_TIMEOUT */ | ||
226 | struct ip_vs_timeout_user { | ||
227 | int tcp_timeout; | ||
228 | int tcp_fin_timeout; | ||
229 | int udp_timeout; | ||
230 | }; | ||
231 | |||
232 | |||
233 | /* The argument to IP_VS_SO_GET_DAEMON */ | ||
234 | struct ip_vs_daemon_user { | ||
235 | /* sync daemon state (master/backup) */ | ||
236 | int state; | ||
237 | |||
238 | /* multicast interface name */ | ||
239 | char mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
240 | |||
241 | /* SyncID we belong to */ | ||
242 | int syncid; | ||
243 | }; | ||
244 | |||
245 | #endif /* _IP_VS_H */ | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index b4d056ceab96..ee583f642a9f 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -440,6 +440,7 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
440 | enum netdev_queue_state_t | 440 | enum netdev_queue_state_t |
441 | { | 441 | { |
442 | __QUEUE_STATE_XOFF, | 442 | __QUEUE_STATE_XOFF, |
443 | __QUEUE_STATE_FROZEN, | ||
443 | }; | 444 | }; |
444 | 445 | ||
445 | struct netdev_queue { | 446 | struct netdev_queue { |
@@ -636,7 +637,7 @@ struct net_device | |||
636 | unsigned int real_num_tx_queues; | 637 | unsigned int real_num_tx_queues; |
637 | 638 | ||
638 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 639 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
639 | 640 | spinlock_t tx_global_lock; | |
640 | /* | 641 | /* |
641 | * One part is mostly used on xmit path (device) | 642 | * One part is mostly used on xmit path (device) |
642 | */ | 643 | */ |
@@ -1099,6 +1100,11 @@ static inline int netif_queue_stopped(const struct net_device *dev) | |||
1099 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); | 1100 | return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); |
1100 | } | 1101 | } |
1101 | 1102 | ||
1103 | static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) | ||
1104 | { | ||
1105 | return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); | ||
1106 | } | ||
1107 | |||
1102 | /** | 1108 | /** |
1103 | * netif_running - test if up | 1109 | * netif_running - test if up |
1104 | * @dev: network device | 1110 | * @dev: network device |
@@ -1475,6 +1481,26 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq) | |||
1475 | txq->xmit_lock_owner = smp_processor_id(); | 1481 | txq->xmit_lock_owner = smp_processor_id(); |
1476 | } | 1482 | } |
1477 | 1483 | ||
1484 | static inline int __netif_tx_trylock(struct netdev_queue *txq) | ||
1485 | { | ||
1486 | int ok = spin_trylock(&txq->_xmit_lock); | ||
1487 | if (likely(ok)) | ||
1488 | txq->xmit_lock_owner = smp_processor_id(); | ||
1489 | return ok; | ||
1490 | } | ||
1491 | |||
1492 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1493 | { | ||
1494 | txq->xmit_lock_owner = -1; | ||
1495 | spin_unlock(&txq->_xmit_lock); | ||
1496 | } | ||
1497 | |||
1498 | static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | ||
1499 | { | ||
1500 | txq->xmit_lock_owner = -1; | ||
1501 | spin_unlock_bh(&txq->_xmit_lock); | ||
1502 | } | ||
1503 | |||
1478 | /** | 1504 | /** |
1479 | * netif_tx_lock - grab network device transmit lock | 1505 | * netif_tx_lock - grab network device transmit lock |
1480 | * @dev: network device | 1506 | * @dev: network device |
@@ -1484,12 +1510,23 @@ static inline void __netif_tx_lock_bh(struct netdev_queue *txq) | |||
1484 | */ | 1510 | */ |
1485 | static inline void netif_tx_lock(struct net_device *dev) | 1511 | static inline void netif_tx_lock(struct net_device *dev) |
1486 | { | 1512 | { |
1487 | int cpu = smp_processor_id(); | ||
1488 | unsigned int i; | 1513 | unsigned int i; |
1514 | int cpu; | ||
1489 | 1515 | ||
1516 | spin_lock(&dev->tx_global_lock); | ||
1517 | cpu = smp_processor_id(); | ||
1490 | for (i = 0; i < dev->num_tx_queues; i++) { | 1518 | for (i = 0; i < dev->num_tx_queues; i++) { |
1491 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1519 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1520 | |||
1521 | /* We are the only thread of execution doing a | ||
1522 | * freeze, but we have to grab the _xmit_lock in | ||
1523 | * order to synchronize with threads which are in | ||
1524 | * the ->hard_start_xmit() handler and already | ||
1525 | * checked the frozen bit. | ||
1526 | */ | ||
1492 | __netif_tx_lock(txq, cpu); | 1527 | __netif_tx_lock(txq, cpu); |
1528 | set_bit(__QUEUE_STATE_FROZEN, &txq->state); | ||
1529 | __netif_tx_unlock(txq); | ||
1493 | } | 1530 | } |
1494 | } | 1531 | } |
1495 | 1532 | ||
@@ -1499,40 +1536,22 @@ static inline void netif_tx_lock_bh(struct net_device *dev) | |||
1499 | netif_tx_lock(dev); | 1536 | netif_tx_lock(dev); |
1500 | } | 1537 | } |
1501 | 1538 | ||
1502 | static inline int __netif_tx_trylock(struct netdev_queue *txq) | ||
1503 | { | ||
1504 | int ok = spin_trylock(&txq->_xmit_lock); | ||
1505 | if (likely(ok)) | ||
1506 | txq->xmit_lock_owner = smp_processor_id(); | ||
1507 | return ok; | ||
1508 | } | ||
1509 | |||
1510 | static inline int netif_tx_trylock(struct net_device *dev) | ||
1511 | { | ||
1512 | return __netif_tx_trylock(netdev_get_tx_queue(dev, 0)); | ||
1513 | } | ||
1514 | |||
1515 | static inline void __netif_tx_unlock(struct netdev_queue *txq) | ||
1516 | { | ||
1517 | txq->xmit_lock_owner = -1; | ||
1518 | spin_unlock(&txq->_xmit_lock); | ||
1519 | } | ||
1520 | |||
1521 | static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | ||
1522 | { | ||
1523 | txq->xmit_lock_owner = -1; | ||
1524 | spin_unlock_bh(&txq->_xmit_lock); | ||
1525 | } | ||
1526 | |||
1527 | static inline void netif_tx_unlock(struct net_device *dev) | 1539 | static inline void netif_tx_unlock(struct net_device *dev) |
1528 | { | 1540 | { |
1529 | unsigned int i; | 1541 | unsigned int i; |
1530 | 1542 | ||
1531 | for (i = 0; i < dev->num_tx_queues; i++) { | 1543 | for (i = 0; i < dev->num_tx_queues; i++) { |
1532 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1544 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1533 | __netif_tx_unlock(txq); | ||
1534 | } | ||
1535 | 1545 | ||
1546 | /* No need to grab the _xmit_lock here. If the | ||
1547 | * queue is not stopped for another reason, we | ||
1548 | * force a schedule. | ||
1549 | */ | ||
1550 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); | ||
1551 | if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) | ||
1552 | __netif_schedule(txq->qdisc); | ||
1553 | } | ||
1554 | spin_unlock(&dev->tx_global_lock); | ||
1536 | } | 1555 | } |
1537 | 1556 | ||
1538 | static inline void netif_tx_unlock_bh(struct net_device *dev) | 1557 | static inline void netif_tx_unlock_bh(struct net_device *dev) |
@@ -1556,13 +1575,18 @@ static inline void netif_tx_unlock_bh(struct net_device *dev) | |||
1556 | static inline void netif_tx_disable(struct net_device *dev) | 1575 | static inline void netif_tx_disable(struct net_device *dev) |
1557 | { | 1576 | { |
1558 | unsigned int i; | 1577 | unsigned int i; |
1578 | int cpu; | ||
1559 | 1579 | ||
1560 | netif_tx_lock_bh(dev); | 1580 | local_bh_disable(); |
1581 | cpu = smp_processor_id(); | ||
1561 | for (i = 0; i < dev->num_tx_queues; i++) { | 1582 | for (i = 0; i < dev->num_tx_queues; i++) { |
1562 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); | 1583 | struct netdev_queue *txq = netdev_get_tx_queue(dev, i); |
1584 | |||
1585 | __netif_tx_lock(txq, cpu); | ||
1563 | netif_tx_stop_queue(txq); | 1586 | netif_tx_stop_queue(txq); |
1587 | __netif_tx_unlock(txq); | ||
1564 | } | 1588 | } |
1565 | netif_tx_unlock_bh(dev); | 1589 | local_bh_enable(); |
1566 | } | 1590 | } |
1567 | 1591 | ||
1568 | static inline void netif_addr_lock(struct net_device *dev) | 1592 | static inline void netif_addr_lock(struct net_device *dev) |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index 22ce29995f13..a049df4f2236 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -30,6 +30,9 @@ enum tcp_conntrack { | |||
30 | /* Be liberal in window checking */ | 30 | /* Be liberal in window checking */ |
31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 | 31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 |
32 | 32 | ||
33 | /* Has unacknowledged data */ | ||
34 | #define IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED 0x10 | ||
35 | |||
33 | struct nf_ct_tcp_flags { | 36 | struct nf_ct_tcp_flags { |
34 | u_int8_t flags; | 37 | u_int8_t flags; |
35 | u_int8_t mask; | 38 | u_int8_t mask; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index a640385e0598..cfcc45b3bef0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -243,6 +243,7 @@ typedef unsigned char *sk_buff_data_t; | |||
243 | * @tc_index: Traffic control index | 243 | * @tc_index: Traffic control index |
244 | * @tc_verd: traffic control verdict | 244 | * @tc_verd: traffic control verdict |
245 | * @ndisc_nodetype: router type (from link layer) | 245 | * @ndisc_nodetype: router type (from link layer) |
246 | * @do_not_encrypt: set to prevent encryption of this frame | ||
246 | * @dma_cookie: a cookie to one of several possible DMA operations | 247 | * @dma_cookie: a cookie to one of several possible DMA operations |
247 | * done by skb DMA functions | 248 | * done by skb DMA functions |
248 | * @secmark: security marking | 249 | * @secmark: security marking |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 9a51ebad3f1f..cbb59ebed4ae 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -3,254 +3,17 @@ | |||
3 | * data structure and functionality definitions | 3 | * data structure and functionality definitions |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef _IP_VS_H | 6 | #ifndef _NET_IP_VS_H |
7 | #define _IP_VS_H | 7 | #define _NET_IP_VS_H |
8 | |||
9 | #include <asm/types.h> /* For __uXX types */ | ||
10 | #include <linux/types.h> /* For __beXX types in userland */ | ||
11 | |||
12 | #include <linux/sysctl.h> /* For ctl_path */ | ||
13 | |||
14 | #define IP_VS_VERSION_CODE 0x010201 | ||
15 | #define NVERSION(version) \ | ||
16 | (version >> 16) & 0xFF, \ | ||
17 | (version >> 8) & 0xFF, \ | ||
18 | version & 0xFF | ||
19 | |||
20 | /* | ||
21 | * Virtual Service Flags | ||
22 | */ | ||
23 | #define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ | ||
24 | #define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ | ||
25 | |||
26 | /* | ||
27 | * Destination Server Flags | ||
28 | */ | ||
29 | #define IP_VS_DEST_F_AVAILABLE 0x0001 /* server is available */ | ||
30 | #define IP_VS_DEST_F_OVERLOAD 0x0002 /* server is overloaded */ | ||
31 | |||
32 | /* | ||
33 | * IPVS sync daemon states | ||
34 | */ | ||
35 | #define IP_VS_STATE_NONE 0x0000 /* daemon is stopped */ | ||
36 | #define IP_VS_STATE_MASTER 0x0001 /* started as master */ | ||
37 | #define IP_VS_STATE_BACKUP 0x0002 /* started as backup */ | ||
38 | |||
39 | /* | ||
40 | * IPVS socket options | ||
41 | */ | ||
42 | #define IP_VS_BASE_CTL (64+1024+64) /* base */ | ||
43 | |||
44 | #define IP_VS_SO_SET_NONE IP_VS_BASE_CTL /* just peek */ | ||
45 | #define IP_VS_SO_SET_INSERT (IP_VS_BASE_CTL+1) | ||
46 | #define IP_VS_SO_SET_ADD (IP_VS_BASE_CTL+2) | ||
47 | #define IP_VS_SO_SET_EDIT (IP_VS_BASE_CTL+3) | ||
48 | #define IP_VS_SO_SET_DEL (IP_VS_BASE_CTL+4) | ||
49 | #define IP_VS_SO_SET_FLUSH (IP_VS_BASE_CTL+5) | ||
50 | #define IP_VS_SO_SET_LIST (IP_VS_BASE_CTL+6) | ||
51 | #define IP_VS_SO_SET_ADDDEST (IP_VS_BASE_CTL+7) | ||
52 | #define IP_VS_SO_SET_DELDEST (IP_VS_BASE_CTL+8) | ||
53 | #define IP_VS_SO_SET_EDITDEST (IP_VS_BASE_CTL+9) | ||
54 | #define IP_VS_SO_SET_TIMEOUT (IP_VS_BASE_CTL+10) | ||
55 | #define IP_VS_SO_SET_STARTDAEMON (IP_VS_BASE_CTL+11) | ||
56 | #define IP_VS_SO_SET_STOPDAEMON (IP_VS_BASE_CTL+12) | ||
57 | #define IP_VS_SO_SET_RESTORE (IP_VS_BASE_CTL+13) | ||
58 | #define IP_VS_SO_SET_SAVE (IP_VS_BASE_CTL+14) | ||
59 | #define IP_VS_SO_SET_ZERO (IP_VS_BASE_CTL+15) | ||
60 | #define IP_VS_SO_SET_MAX IP_VS_SO_SET_ZERO | ||
61 | |||
62 | #define IP_VS_SO_GET_VERSION IP_VS_BASE_CTL | ||
63 | #define IP_VS_SO_GET_INFO (IP_VS_BASE_CTL+1) | ||
64 | #define IP_VS_SO_GET_SERVICES (IP_VS_BASE_CTL+2) | ||
65 | #define IP_VS_SO_GET_SERVICE (IP_VS_BASE_CTL+3) | ||
66 | #define IP_VS_SO_GET_DESTS (IP_VS_BASE_CTL+4) | ||
67 | #define IP_VS_SO_GET_DEST (IP_VS_BASE_CTL+5) /* not used now */ | ||
68 | #define IP_VS_SO_GET_TIMEOUT (IP_VS_BASE_CTL+6) | ||
69 | #define IP_VS_SO_GET_DAEMON (IP_VS_BASE_CTL+7) | ||
70 | #define IP_VS_SO_GET_MAX IP_VS_SO_GET_DAEMON | ||
71 | |||
72 | |||
73 | /* | ||
74 | * IPVS Connection Flags | ||
75 | */ | ||
76 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ | ||
77 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ | ||
78 | #define IP_VS_CONN_F_LOCALNODE 0x0001 /* local node */ | ||
79 | #define IP_VS_CONN_F_TUNNEL 0x0002 /* tunneling */ | ||
80 | #define IP_VS_CONN_F_DROUTE 0x0003 /* direct routing */ | ||
81 | #define IP_VS_CONN_F_BYPASS 0x0004 /* cache bypass */ | ||
82 | #define IP_VS_CONN_F_SYNC 0x0020 /* entry created by sync */ | ||
83 | #define IP_VS_CONN_F_HASHED 0x0040 /* hashed entry */ | ||
84 | #define IP_VS_CONN_F_NOOUTPUT 0x0080 /* no output packets */ | ||
85 | #define IP_VS_CONN_F_INACTIVE 0x0100 /* not established */ | ||
86 | #define IP_VS_CONN_F_OUT_SEQ 0x0200 /* must do output seq adjust */ | ||
87 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ | ||
88 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ | ||
89 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ | ||
90 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | ||
91 | |||
92 | /* Move it to better place one day, for now keep it unique */ | ||
93 | #define NFC_IPVS_PROPERTY 0x10000 | ||
94 | |||
95 | #define IP_VS_SCHEDNAME_MAXLEN 16 | ||
96 | #define IP_VS_IFNAME_MAXLEN 16 | ||
97 | |||
98 | |||
99 | /* | ||
100 | * The struct ip_vs_service_user and struct ip_vs_dest_user are | ||
101 | * used to set IPVS rules through setsockopt. | ||
102 | */ | ||
103 | struct ip_vs_service_user { | ||
104 | /* virtual service addresses */ | ||
105 | u_int16_t protocol; | ||
106 | __be32 addr; /* virtual ip address */ | ||
107 | __be16 port; | ||
108 | u_int32_t fwmark; /* firwall mark of service */ | ||
109 | |||
110 | /* virtual service options */ | ||
111 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
112 | unsigned flags; /* virtual service flags */ | ||
113 | unsigned timeout; /* persistent timeout in sec */ | ||
114 | __be32 netmask; /* persistent netmask */ | ||
115 | }; | ||
116 | |||
117 | |||
118 | struct ip_vs_dest_user { | ||
119 | /* destination server address */ | ||
120 | __be32 addr; | ||
121 | __be16 port; | ||
122 | |||
123 | /* real server options */ | ||
124 | unsigned conn_flags; /* connection flags */ | ||
125 | int weight; /* destination weight */ | ||
126 | |||
127 | /* thresholds for active connections */ | ||
128 | u_int32_t u_threshold; /* upper threshold */ | ||
129 | u_int32_t l_threshold; /* lower threshold */ | ||
130 | }; | ||
131 | |||
132 | |||
133 | /* | ||
134 | * IPVS statistics object (for user space) | ||
135 | */ | ||
136 | struct ip_vs_stats_user | ||
137 | { | ||
138 | __u32 conns; /* connections scheduled */ | ||
139 | __u32 inpkts; /* incoming packets */ | ||
140 | __u32 outpkts; /* outgoing packets */ | ||
141 | __u64 inbytes; /* incoming bytes */ | ||
142 | __u64 outbytes; /* outgoing bytes */ | ||
143 | |||
144 | __u32 cps; /* current connection rate */ | ||
145 | __u32 inpps; /* current in packet rate */ | ||
146 | __u32 outpps; /* current out packet rate */ | ||
147 | __u32 inbps; /* current in byte rate */ | ||
148 | __u32 outbps; /* current out byte rate */ | ||
149 | }; | ||
150 | |||
151 | |||
152 | /* The argument to IP_VS_SO_GET_INFO */ | ||
153 | struct ip_vs_getinfo { | ||
154 | /* version number */ | ||
155 | unsigned int version; | ||
156 | |||
157 | /* size of connection hash table */ | ||
158 | unsigned int size; | ||
159 | |||
160 | /* number of virtual services */ | ||
161 | unsigned int num_services; | ||
162 | }; | ||
163 | |||
164 | |||
165 | /* The argument to IP_VS_SO_GET_SERVICE */ | ||
166 | struct ip_vs_service_entry { | ||
167 | /* which service: user fills in these */ | ||
168 | u_int16_t protocol; | ||
169 | __be32 addr; /* virtual address */ | ||
170 | __be16 port; | ||
171 | u_int32_t fwmark; /* firwall mark of service */ | ||
172 | |||
173 | /* service options */ | ||
174 | char sched_name[IP_VS_SCHEDNAME_MAXLEN]; | ||
175 | unsigned flags; /* virtual service flags */ | ||
176 | unsigned timeout; /* persistent timeout */ | ||
177 | __be32 netmask; /* persistent netmask */ | ||
178 | |||
179 | /* number of real servers */ | ||
180 | unsigned int num_dests; | ||
181 | |||
182 | /* statistics */ | ||
183 | struct ip_vs_stats_user stats; | ||
184 | }; | ||
185 | |||
186 | |||
187 | struct ip_vs_dest_entry { | ||
188 | __be32 addr; /* destination address */ | ||
189 | __be16 port; | ||
190 | unsigned conn_flags; /* connection flags */ | ||
191 | int weight; /* destination weight */ | ||
192 | |||
193 | u_int32_t u_threshold; /* upper threshold */ | ||
194 | u_int32_t l_threshold; /* lower threshold */ | ||
195 | |||
196 | u_int32_t activeconns; /* active connections */ | ||
197 | u_int32_t inactconns; /* inactive connections */ | ||
198 | u_int32_t persistconns; /* persistent connections */ | ||
199 | |||
200 | /* statistics */ | ||
201 | struct ip_vs_stats_user stats; | ||
202 | }; | ||
203 | |||
204 | |||
205 | /* The argument to IP_VS_SO_GET_DESTS */ | ||
206 | struct ip_vs_get_dests { | ||
207 | /* which service: user fills in these */ | ||
208 | u_int16_t protocol; | ||
209 | __be32 addr; /* virtual address */ | ||
210 | __be16 port; | ||
211 | u_int32_t fwmark; /* firwall mark of service */ | ||
212 | |||
213 | /* number of real servers */ | ||
214 | unsigned int num_dests; | ||
215 | |||
216 | /* the real servers */ | ||
217 | struct ip_vs_dest_entry entrytable[0]; | ||
218 | }; | ||
219 | |||
220 | |||
221 | /* The argument to IP_VS_SO_GET_SERVICES */ | ||
222 | struct ip_vs_get_services { | ||
223 | /* number of virtual services */ | ||
224 | unsigned int num_services; | ||
225 | |||
226 | /* service table */ | ||
227 | struct ip_vs_service_entry entrytable[0]; | ||
228 | }; | ||
229 | |||
230 | |||
231 | /* The argument to IP_VS_SO_GET_TIMEOUT */ | ||
232 | struct ip_vs_timeout_user { | ||
233 | int tcp_timeout; | ||
234 | int tcp_fin_timeout; | ||
235 | int udp_timeout; | ||
236 | }; | ||
237 | |||
238 | |||
239 | /* The argument to IP_VS_SO_GET_DAEMON */ | ||
240 | struct ip_vs_daemon_user { | ||
241 | /* sync daemon state (master/backup) */ | ||
242 | int state; | ||
243 | |||
244 | /* multicast interface name */ | ||
245 | char mcast_ifn[IP_VS_IFNAME_MAXLEN]; | ||
246 | |||
247 | /* SyncID we belong to */ | ||
248 | int syncid; | ||
249 | }; | ||
250 | 8 | ||
9 | #include <linux/ip_vs.h> /* definitions shared with userland */ | ||
251 | 10 | ||
11 | /* old ipvsadm versions still include this file directly */ | ||
252 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
253 | 13 | ||
14 | #include <asm/types.h> /* for __uXX types */ | ||
15 | |||
16 | #include <linux/sysctl.h> /* for ctl_path */ | ||
254 | #include <linux/list.h> /* for struct list_head */ | 17 | #include <linux/list.h> /* for struct list_head */ |
255 | #include <linux/spinlock.h> /* for struct rwlock_t */ | 18 | #include <linux/spinlock.h> /* for struct rwlock_t */ |
256 | #include <asm/atomic.h> /* for struct atomic_t */ | 19 | #include <asm/atomic.h> /* for struct atomic_t */ |
@@ -981,4 +744,4 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) | |||
981 | 744 | ||
982 | #endif /* __KERNEL__ */ | 745 | #endif /* __KERNEL__ */ |
983 | 746 | ||
984 | #endif /* _IP_VS_H */ | 747 | #endif /* _NET_IP_VS_H */ |
diff --git a/lib/random32.c b/lib/random32.c index ca87d86992bd..217d5c4b666d 100644 --- a/lib/random32.c +++ b/lib/random32.c | |||
@@ -56,23 +56,12 @@ static u32 __random32(struct rnd_state *state) | |||
56 | return (state->s1 ^ state->s2 ^ state->s3); | 56 | return (state->s1 ^ state->s2 ^ state->s3); |
57 | } | 57 | } |
58 | 58 | ||
59 | static void __set_random32(struct rnd_state *state, unsigned long s) | 59 | /* |
60 | * Handle minimum values for seeds | ||
61 | */ | ||
62 | static inline u32 __seed(u32 x, u32 m) | ||
60 | { | 63 | { |
61 | if (s == 0) | 64 | return (x < m) ? x + m : x; |
62 | s = 1; /* default seed is 1 */ | ||
63 | |||
64 | #define LCG(n) (69069 * n) | ||
65 | state->s1 = LCG(s); | ||
66 | state->s2 = LCG(state->s1); | ||
67 | state->s3 = LCG(state->s2); | ||
68 | |||
69 | /* "warm it up" */ | ||
70 | __random32(state); | ||
71 | __random32(state); | ||
72 | __random32(state); | ||
73 | __random32(state); | ||
74 | __random32(state); | ||
75 | __random32(state); | ||
76 | } | 65 | } |
77 | 66 | ||
78 | /** | 67 | /** |
@@ -107,7 +96,7 @@ void srandom32(u32 entropy) | |||
107 | */ | 96 | */ |
108 | for_each_possible_cpu (i) { | 97 | for_each_possible_cpu (i) { |
109 | struct rnd_state *state = &per_cpu(net_rand_state, i); | 98 | struct rnd_state *state = &per_cpu(net_rand_state, i); |
110 | __set_random32(state, state->s1 ^ entropy); | 99 | state->s1 = __seed(state->s1 ^ entropy, 1); |
111 | } | 100 | } |
112 | } | 101 | } |
113 | EXPORT_SYMBOL(srandom32); | 102 | EXPORT_SYMBOL(srandom32); |
@@ -122,7 +111,19 @@ static int __init random32_init(void) | |||
122 | 111 | ||
123 | for_each_possible_cpu(i) { | 112 | for_each_possible_cpu(i) { |
124 | struct rnd_state *state = &per_cpu(net_rand_state,i); | 113 | struct rnd_state *state = &per_cpu(net_rand_state,i); |
125 | __set_random32(state, i + jiffies); | 114 | |
115 | #define LCG(x) ((x) * 69069) /* super-duper LCG */ | ||
116 | state->s1 = __seed(LCG(i + jiffies), 1); | ||
117 | state->s2 = __seed(LCG(state->s1), 7); | ||
118 | state->s3 = __seed(LCG(state->s2), 15); | ||
119 | |||
120 | /* "warm it up" */ | ||
121 | __random32(state); | ||
122 | __random32(state); | ||
123 | __random32(state); | ||
124 | __random32(state); | ||
125 | __random32(state); | ||
126 | __random32(state); | ||
126 | } | 127 | } |
127 | return 0; | 128 | return 0; |
128 | } | 129 | } |
@@ -135,13 +136,18 @@ core_initcall(random32_init); | |||
135 | static int __init random32_reseed(void) | 136 | static int __init random32_reseed(void) |
136 | { | 137 | { |
137 | int i; | 138 | int i; |
138 | unsigned long seed; | ||
139 | 139 | ||
140 | for_each_possible_cpu(i) { | 140 | for_each_possible_cpu(i) { |
141 | struct rnd_state *state = &per_cpu(net_rand_state,i); | 141 | struct rnd_state *state = &per_cpu(net_rand_state,i); |
142 | u32 seeds[3]; | ||
143 | |||
144 | get_random_bytes(&seeds, sizeof(seeds)); | ||
145 | state->s1 = __seed(seeds[0], 1); | ||
146 | state->s2 = __seed(seeds[1], 7); | ||
147 | state->s3 = __seed(seeds[2], 15); | ||
142 | 148 | ||
143 | get_random_bytes(&seed, sizeof(seed)); | 149 | /* mix it in */ |
144 | __set_random32(state, seed); | 150 | __random32(state); |
145 | } | 151 | } |
146 | return 0; | 152 | return 0; |
147 | } | 153 | } |
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index 4fccaa1e07be..11b16d16661c 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c | |||
@@ -62,11 +62,13 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg, struct mpoa_client *mpc | |||
62 | static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); | 62 | static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); |
63 | static void set_mps_mac_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); | 63 | static void set_mps_mac_addr_rcvd(struct k_message *mesg, struct mpoa_client *mpc); |
64 | 64 | ||
65 | static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac, | 65 | static const uint8_t *copy_macs(struct mpoa_client *mpc, |
66 | uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type); | 66 | const uint8_t *router_mac, |
67 | const uint8_t *tlvs, uint8_t mps_macs, | ||
68 | uint8_t device_type); | ||
67 | static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry); | 69 | static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry); |
68 | 70 | ||
69 | static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc); | 71 | static void send_set_mps_ctrl_addr(const char *addr, struct mpoa_client *mpc); |
70 | static void mpoad_close(struct atm_vcc *vcc); | 72 | static void mpoad_close(struct atm_vcc *vcc); |
71 | static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb); | 73 | static int msg_from_mpoad(struct atm_vcc *vcc, struct sk_buff *skb); |
72 | 74 | ||
@@ -351,12 +353,12 @@ static const char *mpoa_device_type_string(char type) | |||
351 | * lec sees a TLV it uses the pointer to call this function. | 353 | * lec sees a TLV it uses the pointer to call this function. |
352 | * | 354 | * |
353 | */ | 355 | */ |
354 | static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr, | 356 | static void lane2_assoc_ind(struct net_device *dev, const u8 *mac_addr, |
355 | uint8_t *tlvs, uint32_t sizeoftlvs) | 357 | const u8 *tlvs, u32 sizeoftlvs) |
356 | { | 358 | { |
357 | uint32_t type; | 359 | uint32_t type; |
358 | uint8_t length, mpoa_device_type, number_of_mps_macs; | 360 | uint8_t length, mpoa_device_type, number_of_mps_macs; |
359 | uint8_t *end_of_tlvs; | 361 | const uint8_t *end_of_tlvs; |
360 | struct mpoa_client *mpc; | 362 | struct mpoa_client *mpc; |
361 | 363 | ||
362 | mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */ | 364 | mpoa_device_type = number_of_mps_macs = 0; /* silence gcc */ |
@@ -430,8 +432,10 @@ static void lane2_assoc_ind(struct net_device *dev, uint8_t *mac_addr, | |||
430 | * plus the possible MAC address(es) to mpc->mps_macs. | 432 | * plus the possible MAC address(es) to mpc->mps_macs. |
431 | * For a freshly allocated MPOA client mpc->mps_macs == 0. | 433 | * For a freshly allocated MPOA client mpc->mps_macs == 0. |
432 | */ | 434 | */ |
433 | static uint8_t *copy_macs(struct mpoa_client *mpc, uint8_t *router_mac, | 435 | static const uint8_t *copy_macs(struct mpoa_client *mpc, |
434 | uint8_t *tlvs, uint8_t mps_macs, uint8_t device_type) | 436 | const uint8_t *router_mac, |
437 | const uint8_t *tlvs, uint8_t mps_macs, | ||
438 | uint8_t device_type) | ||
435 | { | 439 | { |
436 | int num_macs; | 440 | int num_macs; |
437 | num_macs = (mps_macs > 1) ? mps_macs : 1; | 441 | num_macs = (mps_macs > 1) ? mps_macs : 1; |
@@ -811,7 +815,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg) | |||
811 | return arg; | 815 | return arg; |
812 | } | 816 | } |
813 | 817 | ||
814 | static void send_set_mps_ctrl_addr(char *addr, struct mpoa_client *mpc) | 818 | static void send_set_mps_ctrl_addr(const char *addr, struct mpoa_client *mpc) |
815 | { | 819 | { |
816 | struct k_message mesg; | 820 | struct k_message mesg; |
817 | 821 | ||
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index d9449df7cad5..9b58d70b0e7d 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -68,10 +68,17 @@ static int br_dev_stop(struct net_device *dev) | |||
68 | 68 | ||
69 | static int br_change_mtu(struct net_device *dev, int new_mtu) | 69 | static int br_change_mtu(struct net_device *dev, int new_mtu) |
70 | { | 70 | { |
71 | if (new_mtu < 68 || new_mtu > br_min_mtu(netdev_priv(dev))) | 71 | struct net_bridge *br = netdev_priv(dev); |
72 | if (new_mtu < 68 || new_mtu > br_min_mtu(br)) | ||
72 | return -EINVAL; | 73 | return -EINVAL; |
73 | 74 | ||
74 | dev->mtu = new_mtu; | 75 | dev->mtu = new_mtu; |
76 | |||
77 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
78 | /* remember the MTU in the rtable for PMTU */ | ||
79 | br->fake_rtable.u.dst.metrics[RTAX_MTU - 1] = new_mtu; | ||
80 | #endif | ||
81 | |||
75 | return 0; | 82 | return 0; |
76 | } | 83 | } |
77 | 84 | ||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index a072ea5ca6f5..63c18aacde8c 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -202,6 +202,9 @@ static struct net_device *new_bridge_dev(const char *name) | |||
202 | br->topology_change = 0; | 202 | br->topology_change = 0; |
203 | br->topology_change_detected = 0; | 203 | br->topology_change_detected = 0; |
204 | br->ageing_time = 300 * HZ; | 204 | br->ageing_time = 300 * HZ; |
205 | |||
206 | br_netfilter_rtable_init(br); | ||
207 | |||
205 | INIT_LIST_HEAD(&br->age_list); | 208 | INIT_LIST_HEAD(&br->age_list); |
206 | 209 | ||
207 | br_stp_timer_init(br); | 210 | br_stp_timer_init(br); |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index bb90cd7bace3..6e280a8a31ee 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -101,33 +101,30 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb) | |||
101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ | 101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ |
102 | brnf_filter_pppoe_tagged) | 102 | brnf_filter_pppoe_tagged) |
103 | 103 | ||
104 | /* We need these fake structures to make netfilter happy -- | 104 | /* |
105 | * lots of places assume that skb->dst != NULL, which isn't | 105 | * Initialize bogus route table used to keep netfilter happy. |
106 | * all that unreasonable. | ||
107 | * | ||
108 | * Currently, we fill in the PMTU entry because netfilter | 106 | * Currently, we fill in the PMTU entry because netfilter |
109 | * refragmentation needs it, and the rt_flags entry because | 107 | * refragmentation needs it, and the rt_flags entry because |
110 | * ipt_REJECT needs it. Future netfilter modules might | 108 | * ipt_REJECT needs it. Future netfilter modules might |
111 | * require us to fill additional fields. */ | 109 | * require us to fill additional fields. |
112 | static struct net_device __fake_net_device = { | 110 | */ |
113 | .hard_header_len = ETH_HLEN, | 111 | void br_netfilter_rtable_init(struct net_bridge *br) |
114 | #ifdef CONFIG_NET_NS | 112 | { |
115 | .nd_net = &init_net, | 113 | struct rtable *rt = &br->fake_rtable; |
116 | #endif | ||
117 | }; | ||
118 | 114 | ||
119 | static struct rtable __fake_rtable = { | 115 | atomic_set(&rt->u.dst.__refcnt, 1); |
120 | .u = { | 116 | rt->u.dst.dev = &br->dev; |
121 | .dst = { | 117 | rt->u.dst.path = &rt->u.dst; |
122 | .__refcnt = ATOMIC_INIT(1), | 118 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; |
123 | .dev = &__fake_net_device, | 119 | rt->u.dst.flags = DST_NOXFRM; |
124 | .path = &__fake_rtable.u.dst, | 120 | } |
125 | .metrics = {[RTAX_MTU - 1] = 1500}, | 121 | |
126 | .flags = DST_NOXFRM, | 122 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) |
127 | } | 123 | { |
128 | }, | 124 | struct net_bridge_port *port = rcu_dereference(dev->br_port); |
129 | .rt_flags = 0, | 125 | |
130 | }; | 126 | return port ? &port->br->fake_rtable : NULL; |
127 | } | ||
131 | 128 | ||
132 | static inline struct net_device *bridge_parent(const struct net_device *dev) | 129 | static inline struct net_device *bridge_parent(const struct net_device *dev) |
133 | { | 130 | { |
@@ -226,8 +223,12 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb) | |||
226 | } | 223 | } |
227 | nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; | 224 | nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING; |
228 | 225 | ||
229 | skb->rtable = &__fake_rtable; | 226 | skb->rtable = bridge_parent_rtable(nf_bridge->physindev); |
230 | dst_hold(&__fake_rtable.u.dst); | 227 | if (!skb->rtable) { |
228 | kfree_skb(skb); | ||
229 | return 0; | ||
230 | } | ||
231 | dst_hold(&skb->rtable->u.dst); | ||
231 | 232 | ||
232 | skb->dev = nf_bridge->physindev; | 233 | skb->dev = nf_bridge->physindev; |
233 | nf_bridge_push_encap_header(skb); | 234 | nf_bridge_push_encap_header(skb); |
@@ -391,8 +392,12 @@ bridged_dnat: | |||
391 | skb->pkt_type = PACKET_HOST; | 392 | skb->pkt_type = PACKET_HOST; |
392 | } | 393 | } |
393 | } else { | 394 | } else { |
394 | skb->rtable = &__fake_rtable; | 395 | skb->rtable = bridge_parent_rtable(nf_bridge->physindev); |
395 | dst_hold(&__fake_rtable.u.dst); | 396 | if (!skb->rtable) { |
397 | kfree_skb(skb); | ||
398 | return 0; | ||
399 | } | ||
400 | dst_hold(&skb->rtable->u.dst); | ||
396 | } | 401 | } |
397 | 402 | ||
398 | skb->dev = nf_bridge->physindev; | 403 | skb->dev = nf_bridge->physindev; |
@@ -611,8 +616,8 @@ static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff *skb, | |||
611 | const struct net_device *out, | 616 | const struct net_device *out, |
612 | int (*okfn)(struct sk_buff *)) | 617 | int (*okfn)(struct sk_buff *)) |
613 | { | 618 | { |
614 | if (skb->rtable == &__fake_rtable) { | 619 | if (skb->rtable && skb->rtable == bridge_parent_rtable(in)) { |
615 | dst_release(&__fake_rtable.u.dst); | 620 | dst_release(&skb->rtable->u.dst); |
616 | skb->rtable = NULL; | 621 | skb->rtable = NULL; |
617 | } | 622 | } |
618 | 623 | ||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 815ed38925b2..c3dc18ddc043 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
17 | #include <linux/if_bridge.h> | 17 | #include <linux/if_bridge.h> |
18 | #include <net/route.h> | ||
18 | 19 | ||
19 | #define BR_HASH_BITS 8 | 20 | #define BR_HASH_BITS 8 |
20 | #define BR_HASH_SIZE (1 << BR_HASH_BITS) | 21 | #define BR_HASH_SIZE (1 << BR_HASH_BITS) |
@@ -92,6 +93,9 @@ struct net_bridge | |||
92 | struct hlist_head hash[BR_HASH_SIZE]; | 93 | struct hlist_head hash[BR_HASH_SIZE]; |
93 | struct list_head age_list; | 94 | struct list_head age_list; |
94 | unsigned long feature_mask; | 95 | unsigned long feature_mask; |
96 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
97 | struct rtable fake_rtable; | ||
98 | #endif | ||
95 | unsigned long flags; | 99 | unsigned long flags; |
96 | #define BR_SET_MAC_ADDR 0x00000001 | 100 | #define BR_SET_MAC_ADDR 0x00000001 |
97 | 101 | ||
@@ -197,9 +201,11 @@ extern int br_ioctl_deviceless_stub(struct net *net, unsigned int cmd, void __us | |||
197 | #ifdef CONFIG_BRIDGE_NETFILTER | 201 | #ifdef CONFIG_BRIDGE_NETFILTER |
198 | extern int br_netfilter_init(void); | 202 | extern int br_netfilter_init(void); |
199 | extern void br_netfilter_fini(void); | 203 | extern void br_netfilter_fini(void); |
204 | extern void br_netfilter_rtable_init(struct net_bridge *); | ||
200 | #else | 205 | #else |
201 | #define br_netfilter_init() (0) | 206 | #define br_netfilter_init() (0) |
202 | #define br_netfilter_fini() do { } while(0) | 207 | #define br_netfilter_fini() do { } while(0) |
208 | #define br_netfilter_rtable_init(x) | ||
203 | #endif | 209 | #endif |
204 | 210 | ||
205 | /* br_stp.c */ | 211 | /* br_stp.c */ |
diff --git a/net/core/dev.c b/net/core/dev.c index 63d6bcddbf46..69320a56a084 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4200,6 +4200,7 @@ static void netdev_init_queues(struct net_device *dev) | |||
4200 | { | 4200 | { |
4201 | netdev_init_one_queue(dev, &dev->rx_queue, NULL); | 4201 | netdev_init_one_queue(dev, &dev->rx_queue, NULL); |
4202 | netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL); | 4202 | netdev_for_each_tx_queue(dev, netdev_init_one_queue, NULL); |
4203 | spin_lock_init(&dev->tx_global_lock); | ||
4203 | } | 4204 | } |
4204 | 4205 | ||
4205 | /** | 4206 | /** |
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index c12720895ecf..6c7af390be0a 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -70,6 +70,7 @@ static void queue_process(struct work_struct *work) | |||
70 | local_irq_save(flags); | 70 | local_irq_save(flags); |
71 | __netif_tx_lock(txq, smp_processor_id()); | 71 | __netif_tx_lock(txq, smp_processor_id()); |
72 | if (netif_tx_queue_stopped(txq) || | 72 | if (netif_tx_queue_stopped(txq) || |
73 | netif_tx_queue_frozen(txq) || | ||
73 | dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) { | 74 | dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) { |
74 | skb_queue_head(&npinfo->txq, skb); | 75 | skb_queue_head(&npinfo->txq, skb); |
75 | __netif_tx_unlock(txq); | 76 | __netif_tx_unlock(txq); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index c7d484f7e1c4..3284605f2ec7 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3305,6 +3305,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3305 | 3305 | ||
3306 | txq = netdev_get_tx_queue(odev, queue_map); | 3306 | txq = netdev_get_tx_queue(odev, queue_map); |
3307 | if (netif_tx_queue_stopped(txq) || | 3307 | if (netif_tx_queue_stopped(txq) || |
3308 | netif_tx_queue_frozen(txq) || | ||
3308 | need_resched()) { | 3309 | need_resched()) { |
3309 | idle_start = getCurUs(); | 3310 | idle_start = getCurUs(); |
3310 | 3311 | ||
@@ -3320,7 +3321,8 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3320 | 3321 | ||
3321 | pkt_dev->idle_acc += getCurUs() - idle_start; | 3322 | pkt_dev->idle_acc += getCurUs() - idle_start; |
3322 | 3323 | ||
3323 | if (netif_tx_queue_stopped(txq)) { | 3324 | if (netif_tx_queue_stopped(txq) || |
3325 | netif_tx_queue_frozen(txq)) { | ||
3324 | pkt_dev->next_tx_us = getCurUs(); /* TODO */ | 3326 | pkt_dev->next_tx_us = getCurUs(); /* TODO */ |
3325 | pkt_dev->next_tx_ns = 0; | 3327 | pkt_dev->next_tx_ns = 0; |
3326 | goto out; /* Try the next interface */ | 3328 | goto out; /* Try the next interface */ |
@@ -3352,7 +3354,8 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3352 | txq = netdev_get_tx_queue(odev, queue_map); | 3354 | txq = netdev_get_tx_queue(odev, queue_map); |
3353 | 3355 | ||
3354 | __netif_tx_lock_bh(txq); | 3356 | __netif_tx_lock_bh(txq); |
3355 | if (!netif_tx_queue_stopped(txq)) { | 3357 | if (!netif_tx_queue_stopped(txq) && |
3358 | !netif_tx_queue_frozen(txq)) { | ||
3356 | 3359 | ||
3357 | atomic_inc(&(pkt_dev->skb->users)); | 3360 | atomic_inc(&(pkt_dev->skb->users)); |
3358 | retry_now: | 3361 | retry_now: |
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index 1819ad7ab910..fafe8ebb4c55 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -475,11 +475,10 @@ static void arp_print(struct arp_payload *payload) | |||
475 | #define HBUFFERLEN 30 | 475 | #define HBUFFERLEN 30 |
476 | char hbuffer[HBUFFERLEN]; | 476 | char hbuffer[HBUFFERLEN]; |
477 | int j,k; | 477 | int j,k; |
478 | const char hexbuf[]= "0123456789abcdef"; | ||
479 | 478 | ||
480 | for (k=0, j=0; k < HBUFFERLEN-3 && j < ETH_ALEN; j++) { | 479 | for (k=0, j=0; k < HBUFFERLEN-3 && j < ETH_ALEN; j++) { |
481 | hbuffer[k++]=hexbuf[(payload->src_hw[j]>>4)&15]; | 480 | hbuffer[k++] = hex_asc_hi(payload->src_hw[j]); |
482 | hbuffer[k++]=hexbuf[payload->src_hw[j]&15]; | 481 | hbuffer[k++] = hex_asc_lo(payload->src_hw[j]); |
483 | hbuffer[k++]=':'; | 482 | hbuffer[k++]=':'; |
484 | } | 483 | } |
485 | hbuffer[--k]='\0'; | 484 | hbuffer[--k]='\0'; |
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 21cb053f5d7d..3974d7cae5c0 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -305,10 +305,10 @@ static void recent_mt_destroy(const struct xt_match *match, void *matchinfo) | |||
305 | spin_lock_bh(&recent_lock); | 305 | spin_lock_bh(&recent_lock); |
306 | list_del(&t->list); | 306 | list_del(&t->list); |
307 | spin_unlock_bh(&recent_lock); | 307 | spin_unlock_bh(&recent_lock); |
308 | recent_table_flush(t); | ||
309 | #ifdef CONFIG_PROC_FS | 308 | #ifdef CONFIG_PROC_FS |
310 | remove_proc_entry(t->name, proc_dir); | 309 | remove_proc_entry(t->name, proc_dir); |
311 | #endif | 310 | #endif |
311 | recent_table_flush(t); | ||
312 | kfree(t); | 312 | kfree(t); |
313 | } | 313 | } |
314 | mutex_unlock(&recent_mutex); | 314 | mutex_unlock(&recent_mutex); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a72a5ad46ec5..1bfa078ddbd0 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -3223,7 +3223,9 @@ int __init ip_rt_init(void) | |||
3223 | */ | 3223 | */ |
3224 | void __init ip_static_sysctl_init(void) | 3224 | void __init ip_static_sysctl_init(void) |
3225 | { | 3225 | { |
3226 | #ifdef CONFIG_SYSCTL | ||
3226 | register_sysctl_paths(ipv4_route_path, ipv4_route_table); | 3227 | register_sysctl_paths(ipv4_route_path, ipv4_route_table); |
3228 | #endif | ||
3227 | } | 3229 | } |
3228 | #endif | 3230 | #endif |
3229 | 3231 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index b3875c0d83c7..91a8cfddf1c4 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -655,8 +655,8 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack, | |||
655 | rep.th.doff = arg.iov[0].iov_len/4; | 655 | rep.th.doff = arg.iov[0].iov_len/4; |
656 | 656 | ||
657 | tcp_v4_md5_hash_hdr((__u8 *) &rep.opt[offset], | 657 | tcp_v4_md5_hash_hdr((__u8 *) &rep.opt[offset], |
658 | key, ip_hdr(skb)->daddr, | 658 | key, ip_hdr(skb)->saddr, |
659 | ip_hdr(skb)->saddr, &rep.th); | 659 | ip_hdr(skb)->daddr, &rep.th); |
660 | } | 660 | } |
661 | #endif | 661 | #endif |
662 | arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, | 662 | arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 6811901e6b1e..a027003d69a4 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -236,6 +236,10 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | |||
236 | skb_reset_network_header(skb); | 236 | skb_reset_network_header(skb); |
237 | hdr = ipv6_hdr(skb); | 237 | hdr = ipv6_hdr(skb); |
238 | 238 | ||
239 | /* Allow local fragmentation. */ | ||
240 | if (ipfragok) | ||
241 | skb->local_df = 1; | ||
242 | |||
239 | /* | 243 | /* |
240 | * Fill in the IPv6 header | 244 | * Fill in the IPv6 header |
241 | */ | 245 | */ |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 1db45216b232..78185a409212 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -748,7 +748,7 @@ static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp, | |||
748 | ipv6_addr_copy(&bp->saddr, saddr); | 748 | ipv6_addr_copy(&bp->saddr, saddr); |
749 | ipv6_addr_copy(&bp->daddr, daddr); | 749 | ipv6_addr_copy(&bp->daddr, daddr); |
750 | bp->protocol = cpu_to_be32(IPPROTO_TCP); | 750 | bp->protocol = cpu_to_be32(IPPROTO_TCP); |
751 | bp->len = cpu_to_be16(nbytes); | 751 | bp->len = cpu_to_be32(nbytes); |
752 | 752 | ||
753 | sg_init_one(&sg, bp, sizeof(*bp)); | 753 | sg_init_one(&sg, bp, sizeof(*bp)); |
754 | return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); | 754 | return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); |
@@ -1094,8 +1094,8 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 | |||
1094 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | | 1094 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | |
1095 | (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG); | 1095 | (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG); |
1096 | tcp_v6_md5_hash_hdr((__u8 *)topt, key, | 1096 | tcp_v6_md5_hash_hdr((__u8 *)topt, key, |
1097 | &ipv6_hdr(skb)->daddr, | 1097 | &ipv6_hdr(skb)->saddr, |
1098 | &ipv6_hdr(skb)->saddr, t1); | 1098 | &ipv6_hdr(skb)->daddr, t1); |
1099 | } | 1099 | } |
1100 | #endif | 1100 | #endif |
1101 | 1101 | ||
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 420a10d8eb1e..6f61261888ef 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -67,7 +67,8 @@ static const char *const tcp_conntrack_names[] = { | |||
67 | /* RFC1122 says the R2 limit should be at least 100 seconds. | 67 | /* RFC1122 says the R2 limit should be at least 100 seconds. |
68 | Linux uses 15 packets as limit, which corresponds | 68 | Linux uses 15 packets as limit, which corresponds |
69 | to ~13-30min depending on RTO. */ | 69 | to ~13-30min depending on RTO. */ |
70 | static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly = 5 MINS; | 70 | static unsigned int nf_ct_tcp_timeout_max_retrans __read_mostly = 5 MINS; |
71 | static unsigned int nf_ct_tcp_timeout_unacknowledged __read_mostly = 5 MINS; | ||
71 | 72 | ||
72 | static unsigned int tcp_timeouts[TCP_CONNTRACK_MAX] __read_mostly = { | 73 | static unsigned int tcp_timeouts[TCP_CONNTRACK_MAX] __read_mostly = { |
73 | [TCP_CONNTRACK_SYN_SENT] = 2 MINS, | 74 | [TCP_CONNTRACK_SYN_SENT] = 2 MINS, |
@@ -625,8 +626,10 @@ static bool tcp_in_window(const struct nf_conn *ct, | |||
625 | swin = win + (sack - ack); | 626 | swin = win + (sack - ack); |
626 | if (sender->td_maxwin < swin) | 627 | if (sender->td_maxwin < swin) |
627 | sender->td_maxwin = swin; | 628 | sender->td_maxwin = swin; |
628 | if (after(end, sender->td_end)) | 629 | if (after(end, sender->td_end)) { |
629 | sender->td_end = end; | 630 | sender->td_end = end; |
631 | sender->flags |= IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED; | ||
632 | } | ||
630 | /* | 633 | /* |
631 | * Update receiver data. | 634 | * Update receiver data. |
632 | */ | 635 | */ |
@@ -637,6 +640,8 @@ static bool tcp_in_window(const struct nf_conn *ct, | |||
637 | if (win == 0) | 640 | if (win == 0) |
638 | receiver->td_maxend++; | 641 | receiver->td_maxend++; |
639 | } | 642 | } |
643 | if (ack == receiver->td_end) | ||
644 | receiver->flags &= ~IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED; | ||
640 | 645 | ||
641 | /* | 646 | /* |
642 | * Check retransmissions. | 647 | * Check retransmissions. |
@@ -951,9 +956,16 @@ static int tcp_packet(struct nf_conn *ct, | |||
951 | if (old_state != new_state | 956 | if (old_state != new_state |
952 | && new_state == TCP_CONNTRACK_FIN_WAIT) | 957 | && new_state == TCP_CONNTRACK_FIN_WAIT) |
953 | ct->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; | 958 | ct->proto.tcp.seen[dir].flags |= IP_CT_TCP_FLAG_CLOSE_INIT; |
954 | timeout = ct->proto.tcp.retrans >= nf_ct_tcp_max_retrans | 959 | |
955 | && tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans | 960 | if (ct->proto.tcp.retrans >= nf_ct_tcp_max_retrans && |
956 | ? nf_ct_tcp_timeout_max_retrans : tcp_timeouts[new_state]; | 961 | tcp_timeouts[new_state] > nf_ct_tcp_timeout_max_retrans) |
962 | timeout = nf_ct_tcp_timeout_max_retrans; | ||
963 | else if ((ct->proto.tcp.seen[0].flags | ct->proto.tcp.seen[1].flags) & | ||
964 | IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED && | ||
965 | tcp_timeouts[new_state] > nf_ct_tcp_timeout_unacknowledged) | ||
966 | timeout = nf_ct_tcp_timeout_unacknowledged; | ||
967 | else | ||
968 | timeout = tcp_timeouts[new_state]; | ||
957 | write_unlock_bh(&tcp_lock); | 969 | write_unlock_bh(&tcp_lock); |
958 | 970 | ||
959 | nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb); | 971 | nf_conntrack_event_cache(IPCT_PROTOINFO_VOLATILE, skb); |
@@ -1236,6 +1248,13 @@ static struct ctl_table tcp_sysctl_table[] = { | |||
1236 | .proc_handler = &proc_dointvec_jiffies, | 1248 | .proc_handler = &proc_dointvec_jiffies, |
1237 | }, | 1249 | }, |
1238 | { | 1250 | { |
1251 | .procname = "nf_conntrack_tcp_timeout_unacknowledged", | ||
1252 | .data = &nf_ct_tcp_timeout_unacknowledged, | ||
1253 | .maxlen = sizeof(unsigned int), | ||
1254 | .mode = 0644, | ||
1255 | .proc_handler = &proc_dointvec_jiffies, | ||
1256 | }, | ||
1257 | { | ||
1239 | .ctl_name = NET_NF_CONNTRACK_TCP_LOOSE, | 1258 | .ctl_name = NET_NF_CONNTRACK_TCP_LOOSE, |
1240 | .procname = "nf_conntrack_tcp_loose", | 1259 | .procname = "nf_conntrack_tcp_loose", |
1241 | .data = &nf_ct_tcp_loose, | 1260 | .data = &nf_ct_tcp_loose, |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 6809af542a2c..d9418a267812 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -367,9 +367,7 @@ static void htable_gc(unsigned long htlong) | |||
367 | 367 | ||
368 | static void htable_destroy(struct xt_hashlimit_htable *hinfo) | 368 | static void htable_destroy(struct xt_hashlimit_htable *hinfo) |
369 | { | 369 | { |
370 | /* remove timer, if it is pending */ | 370 | del_timer_sync(&hinfo->timer); |
371 | if (timer_pending(&hinfo->timer)) | ||
372 | del_timer(&hinfo->timer); | ||
373 | 371 | ||
374 | /* remove proc entry */ | 372 | /* remove proc entry */ |
375 | remove_proc_entry(hinfo->pde->name, | 373 | remove_proc_entry(hinfo->pde->name, |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 345838a2e369..9c9cd4d94890 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -135,7 +135,8 @@ static inline int qdisc_restart(struct Qdisc *q) | |||
135 | txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); | 135 | txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); |
136 | 136 | ||
137 | HARD_TX_LOCK(dev, txq, smp_processor_id()); | 137 | HARD_TX_LOCK(dev, txq, smp_processor_id()); |
138 | if (!netif_subqueue_stopped(dev, skb)) | 138 | if (!netif_tx_queue_stopped(txq) && |
139 | !netif_tx_queue_frozen(txq)) | ||
139 | ret = dev_hard_start_xmit(skb, dev, txq); | 140 | ret = dev_hard_start_xmit(skb, dev, txq); |
140 | HARD_TX_UNLOCK(dev, txq); | 141 | HARD_TX_UNLOCK(dev, txq); |
141 | 142 | ||
@@ -162,7 +163,8 @@ static inline int qdisc_restart(struct Qdisc *q) | |||
162 | break; | 163 | break; |
163 | } | 164 | } |
164 | 165 | ||
165 | if (ret && netif_tx_queue_stopped(txq)) | 166 | if (ret && (netif_tx_queue_stopped(txq) || |
167 | netif_tx_queue_frozen(txq))) | ||
166 | ret = 0; | 168 | ret = 0; |
167 | 169 | ||
168 | return ret; | 170 | return ret; |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 537223642b6e..2c35c678563b 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -305,10 +305,11 @@ restart: | |||
305 | 305 | ||
306 | switch (teql_resolve(skb, skb_res, slave)) { | 306 | switch (teql_resolve(skb, skb_res, slave)) { |
307 | case 0: | 307 | case 0: |
308 | if (netif_tx_trylock(slave)) { | 308 | if (__netif_tx_trylock(slave_txq)) { |
309 | if (!__netif_subqueue_stopped(slave, subq) && | 309 | if (!netif_tx_queue_stopped(slave_txq) && |
310 | !netif_tx_queue_frozen(slave_txq) && | ||
310 | slave->hard_start_xmit(skb, slave) == 0) { | 311 | slave->hard_start_xmit(skb, slave) == 0) { |
311 | netif_tx_unlock(slave); | 312 | __netif_tx_unlock(slave_txq); |
312 | master->slaves = NEXT_SLAVE(q); | 313 | master->slaves = NEXT_SLAVE(q); |
313 | netif_wake_queue(dev); | 314 | netif_wake_queue(dev); |
314 | master->stats.tx_packets++; | 315 | master->stats.tx_packets++; |
@@ -316,7 +317,7 @@ restart: | |||
316 | qdisc_pkt_len(skb); | 317 | qdisc_pkt_len(skb); |
317 | return 0; | 318 | return 0; |
318 | } | 319 | } |
319 | netif_tx_unlock(slave); | 320 | __netif_tx_unlock(slave_txq); |
320 | } | 321 | } |
321 | if (netif_queue_stopped(dev)) | 322 | if (netif_queue_stopped(dev)) |
322 | busy = 1; | 323 | busy = 1; |