diff options
77 files changed, 426 insertions, 327 deletions
diff --git a/arch/alpha/include/asm/socket.h b/arch/alpha/include/asm/socket.h index 3641ec1452f4..26773e3246e2 100644 --- a/arch/alpha/include/asm/socket.h +++ b/arch/alpha/include/asm/socket.h | |||
| @@ -32,6 +32,8 @@ | |||
| 32 | #define SO_RCVTIMEO 0x1012 | 32 | #define SO_RCVTIMEO 0x1012 |
| 33 | #define SO_SNDTIMEO 0x1013 | 33 | #define SO_SNDTIMEO 0x1013 |
| 34 | #define SO_ACCEPTCONN 0x1014 | 34 | #define SO_ACCEPTCONN 0x1014 |
| 35 | #define SO_PROTOCOL 0x1028 | ||
| 36 | #define SO_DOMAIN 0x1029 | ||
| 35 | 37 | ||
| 36 | /* linux-specific, might as well be the same as on i386 */ | 38 | /* linux-specific, might as well be the same as on i386 */ |
| 37 | #define SO_NO_CHECK 11 | 39 | #define SO_NO_CHECK 11 |
diff --git a/arch/arm/include/asm/socket.h b/arch/arm/include/asm/socket.h index 537de4e0ef50..92ac61d294fd 100644 --- a/arch/arm/include/asm/socket.h +++ b/arch/arm/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_SOCKET_H */ | 63 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/avr32/include/asm/socket.h b/arch/avr32/include/asm/socket.h index 04c860619700..fe863f9794d5 100644 --- a/arch/avr32/include/asm/socket.h +++ b/arch/avr32/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* __ASM_AVR32_SOCKET_H */ | 63 | #endif /* __ASM_AVR32_SOCKET_H */ |
diff --git a/arch/cris/include/asm/socket.h b/arch/cris/include/asm/socket.h index d5cf74005408..45ec49bdb7b1 100644 --- a/arch/cris/include/asm/socket.h +++ b/arch/cris/include/asm/socket.h | |||
| @@ -59,6 +59,9 @@ | |||
| 59 | #define SO_TIMESTAMPING 37 | 59 | #define SO_TIMESTAMPING 37 |
| 60 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 60 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 61 | 61 | ||
| 62 | #define SO_PROTOCOL 38 | ||
| 63 | #define SO_DOMAIN 39 | ||
| 64 | |||
| 62 | #endif /* _ASM_SOCKET_H */ | 65 | #endif /* _ASM_SOCKET_H */ |
| 63 | 66 | ||
| 64 | 67 | ||
diff --git a/arch/frv/include/asm/socket.h b/arch/frv/include/asm/socket.h index 57c3d4054e8b..2dea726095c2 100644 --- a/arch/frv/include/asm/socket.h +++ b/arch/frv/include/asm/socket.h | |||
| @@ -57,5 +57,8 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_SOCKET_H */ | 63 | #endif /* _ASM_SOCKET_H */ |
| 61 | 64 | ||
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h index 602518a70a1a..1547f01c8e22 100644 --- a/arch/h8300/include/asm/socket.h +++ b/arch/h8300/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_SOCKET_H */ | 63 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h index 745421225ec6..0b0d5ff062e5 100644 --- a/arch/ia64/include/asm/socket.h +++ b/arch/ia64/include/asm/socket.h | |||
| @@ -66,4 +66,7 @@ | |||
| 66 | #define SO_TIMESTAMPING 37 | 66 | #define SO_TIMESTAMPING 37 |
| 67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 68 | 68 | ||
| 69 | #define SO_PROTOCOL 38 | ||
| 70 | #define SO_DOMAIN 39 | ||
| 71 | |||
| 69 | #endif /* _ASM_IA64_SOCKET_H */ | 72 | #endif /* _ASM_IA64_SOCKET_H */ |
diff --git a/arch/m32r/include/asm/socket.h b/arch/m32r/include/asm/socket.h index be7ed589af5c..3390a864f224 100644 --- a/arch/m32r/include/asm/socket.h +++ b/arch/m32r/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_M32R_SOCKET_H */ | 63 | #endif /* _ASM_M32R_SOCKET_H */ |
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h index ca87f938b03f..eee01cce921b 100644 --- a/arch/m68k/include/asm/socket.h +++ b/arch/m68k/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_SOCKET_H */ | 63 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/microblaze/include/asm/socket.h b/arch/microblaze/include/asm/socket.h index 825936860314..7361ae7cfcde 100644 --- a/arch/microblaze/include/asm/socket.h +++ b/arch/microblaze/include/asm/socket.h | |||
| @@ -66,4 +66,7 @@ | |||
| 66 | #define SO_TIMESTAMPING 37 | 66 | #define SO_TIMESTAMPING 37 |
| 67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 68 | 68 | ||
| 69 | #define SO_PROTOCOL 38 | ||
| 70 | #define SO_DOMAIN 39 | ||
| 71 | |||
| 69 | #endif /* _ASM_MICROBLAZE_SOCKET_H */ | 72 | #endif /* _ASM_MICROBLAZE_SOCKET_H */ |
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c index 542244961780..c4737ce6d29c 100644 --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c | |||
| @@ -33,6 +33,8 @@ | |||
| 33 | #include <linux/leds.h> | 33 | #include <linux/leds.h> |
| 34 | #include <linux/string.h> | 34 | #include <linux/string.h> |
| 35 | #include <linux/etherdevice.h> | 35 | #include <linux/etherdevice.h> |
| 36 | #include <linux/phy.h> | ||
| 37 | #include <linux/phy_fixed.h> | ||
| 36 | 38 | ||
| 37 | #include <asm/addrspace.h> | 39 | #include <asm/addrspace.h> |
| 38 | #include <asm/mach-ar7/ar7.h> | 40 | #include <asm/mach-ar7/ar7.h> |
| @@ -209,6 +211,12 @@ static struct physmap_flash_data physmap_flash_data = { | |||
| 209 | .width = 2, | 211 | .width = 2, |
| 210 | }; | 212 | }; |
| 211 | 213 | ||
| 214 | static struct fixed_phy_status fixed_phy_status __initdata = { | ||
| 215 | .link = 1, | ||
| 216 | .speed = 100, | ||
| 217 | .duplex = 1, | ||
| 218 | }; | ||
| 219 | |||
| 212 | static struct plat_cpmac_data cpmac_low_data = { | 220 | static struct plat_cpmac_data cpmac_low_data = { |
| 213 | .reset_bit = 17, | 221 | .reset_bit = 17, |
| 214 | .power_bit = 20, | 222 | .power_bit = 20, |
| @@ -530,6 +538,9 @@ static int __init ar7_register_devices(void) | |||
| 530 | } | 538 | } |
| 531 | 539 | ||
| 532 | if (ar7_has_high_cpmac()) { | 540 | if (ar7_has_high_cpmac()) { |
| 541 | res = fixed_phy_add(PHY_POLL, cpmac_high.id, &fixed_phy_status); | ||
| 542 | if (res && res != -ENODEV) | ||
| 543 | return res; | ||
| 533 | cpmac_get_mac(1, cpmac_high_data.dev_addr); | 544 | cpmac_get_mac(1, cpmac_high_data.dev_addr); |
| 534 | res = platform_device_register(&cpmac_high); | 545 | res = platform_device_register(&cpmac_high); |
| 535 | if (res) | 546 | if (res) |
| @@ -538,6 +549,10 @@ static int __init ar7_register_devices(void) | |||
| 538 | cpmac_low_data.phy_mask = 0xffffffff; | 549 | cpmac_low_data.phy_mask = 0xffffffff; |
| 539 | } | 550 | } |
| 540 | 551 | ||
| 552 | res = fixed_phy_add(PHY_POLL, cpmac_low.id, &fixed_phy_status); | ||
| 553 | if (res && res != -ENODEV) | ||
| 554 | return res; | ||
| 555 | |||
| 541 | cpmac_get_mac(0, cpmac_low_data.dev_addr); | 556 | cpmac_get_mac(0, cpmac_low_data.dev_addr); |
| 542 | res = platform_device_register(&cpmac_low); | 557 | res = platform_device_register(&cpmac_low); |
| 543 | if (res) | 558 | if (res) |
diff --git a/arch/mips/include/asm/socket.h b/arch/mips/include/asm/socket.h index 2abca1780169..ae05accd9fe4 100644 --- a/arch/mips/include/asm/socket.h +++ b/arch/mips/include/asm/socket.h | |||
| @@ -42,6 +42,8 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ | |||
| 42 | #define SO_SNDTIMEO 0x1005 /* send timeout */ | 42 | #define SO_SNDTIMEO 0x1005 /* send timeout */ |
| 43 | #define SO_RCVTIMEO 0x1006 /* receive timeout */ | 43 | #define SO_RCVTIMEO 0x1006 /* receive timeout */ |
| 44 | #define SO_ACCEPTCONN 0x1009 | 44 | #define SO_ACCEPTCONN 0x1009 |
| 45 | #define SO_PROTOCOL 0x1028 /* protocol type */ | ||
| 46 | #define SO_DOMAIN 0x1029 /* domain/socket family */ | ||
| 45 | 47 | ||
| 46 | /* linux-specific, might as well be the same as on i386 */ | 48 | /* linux-specific, might as well be the same as on i386 */ |
| 47 | #define SO_NO_CHECK 11 | 49 | #define SO_NO_CHECK 11 |
diff --git a/arch/mn10300/include/asm/socket.h b/arch/mn10300/include/asm/socket.h index fb5daf438ec9..4df75af29d76 100644 --- a/arch/mn10300/include/asm/socket.h +++ b/arch/mn10300/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_SOCKET_H */ | 63 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h index 885472bf7b78..960b1e5d8e16 100644 --- a/arch/parisc/include/asm/socket.h +++ b/arch/parisc/include/asm/socket.h | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | #define SO_RCVTIMEO 0x1006 | 24 | #define SO_RCVTIMEO 0x1006 |
| 25 | #define SO_ERROR 0x1007 | 25 | #define SO_ERROR 0x1007 |
| 26 | #define SO_TYPE 0x1008 | 26 | #define SO_TYPE 0x1008 |
| 27 | #define SO_PROTOCOL 0x1028 | ||
| 28 | #define SO_DOMAIN 0x1029 | ||
| 27 | #define SO_PEERNAME 0x2000 | 29 | #define SO_PEERNAME 0x2000 |
| 28 | 30 | ||
| 29 | #define SO_NO_CHECK 0x400b | 31 | #define SO_NO_CHECK 0x400b |
diff --git a/arch/powerpc/include/asm/socket.h b/arch/powerpc/include/asm/socket.h index 1e5cfad0e3f7..3ab8b3e6feb0 100644 --- a/arch/powerpc/include/asm/socket.h +++ b/arch/powerpc/include/asm/socket.h | |||
| @@ -64,4 +64,7 @@ | |||
| 64 | #define SO_TIMESTAMPING 37 | 64 | #define SO_TIMESTAMPING 37 |
| 65 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 65 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 66 | 66 | ||
| 67 | #define SO_PROTOCOL 38 | ||
| 68 | #define SO_DOMAIN 39 | ||
| 69 | |||
| 67 | #endif /* _ASM_POWERPC_SOCKET_H */ | 70 | #endif /* _ASM_POWERPC_SOCKET_H */ |
diff --git a/arch/s390/include/asm/socket.h b/arch/s390/include/asm/socket.h index 02330c50241b..e42df89a0b85 100644 --- a/arch/s390/include/asm/socket.h +++ b/arch/s390/include/asm/socket.h | |||
| @@ -65,4 +65,7 @@ | |||
| 65 | #define SO_TIMESTAMPING 37 | 65 | #define SO_TIMESTAMPING 37 |
| 66 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 66 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 67 | 67 | ||
| 68 | #define SO_PROTOCOL 38 | ||
| 69 | #define SO_DOMAIN 39 | ||
| 70 | |||
| 68 | #endif /* _ASM_SOCKET_H */ | 71 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/sparc/include/asm/socket.h b/arch/sparc/include/asm/socket.h index 982a12f959f4..3a5ae3d12088 100644 --- a/arch/sparc/include/asm/socket.h +++ b/arch/sparc/include/asm/socket.h | |||
| @@ -29,6 +29,9 @@ | |||
| 29 | #define SO_RCVBUFFORCE 0x100b | 29 | #define SO_RCVBUFFORCE 0x100b |
| 30 | #define SO_ERROR 0x1007 | 30 | #define SO_ERROR 0x1007 |
| 31 | #define SO_TYPE 0x1008 | 31 | #define SO_TYPE 0x1008 |
| 32 | #define SO_PROTOCOL 0x1028 | ||
| 33 | #define SO_DOMAIN 0x1029 | ||
| 34 | |||
| 32 | 35 | ||
| 33 | /* Linux specific, keep the same. */ | 36 | /* Linux specific, keep the same. */ |
| 34 | #define SO_NO_CHECK 0x000b | 37 | #define SO_NO_CHECK 0x000b |
diff --git a/arch/x86/include/asm/socket.h b/arch/x86/include/asm/socket.h index ca8bf2cd0ba9..b2a8c74f2d06 100644 --- a/arch/x86/include/asm/socket.h +++ b/arch/x86/include/asm/socket.h | |||
| @@ -57,4 +57,7 @@ | |||
| 57 | #define SO_TIMESTAMPING 37 | 57 | #define SO_TIMESTAMPING 37 |
| 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 58 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 59 | 59 | ||
| 60 | #define SO_PROTOCOL 38 | ||
| 61 | #define SO_DOMAIN 39 | ||
| 62 | |||
| 60 | #endif /* _ASM_X86_SOCKET_H */ | 63 | #endif /* _ASM_X86_SOCKET_H */ |
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h index dd1a7a4a1cea..beb3a6bdb61d 100644 --- a/arch/xtensa/include/asm/socket.h +++ b/arch/xtensa/include/asm/socket.h | |||
| @@ -68,4 +68,7 @@ | |||
| 68 | #define SO_TIMESTAMPING 37 | 68 | #define SO_TIMESTAMPING 37 |
| 69 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 69 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 70 | 70 | ||
| 71 | #define SO_PROTOCOL 38 | ||
| 72 | #define SO_DOMAIN 39 | ||
| 73 | |||
| 71 | #endif /* _XTENSA_SOCKET_H */ | 74 | #endif /* _XTENSA_SOCKET_H */ |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 5f6509a5f640..9948fa232220 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -1774,7 +1774,7 @@ config SC92031 | |||
| 1774 | 1774 | ||
| 1775 | config CPMAC | 1775 | config CPMAC |
| 1776 | tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" | 1776 | tristate "TI AR7 CPMAC Ethernet support (EXPERIMENTAL)" |
| 1777 | depends on NET_ETHERNET && EXPERIMENTAL && AR7 && BROKEN | 1777 | depends on NET_ETHERNET && EXPERIMENTAL && AR7 |
| 1778 | select PHYLIB | 1778 | select PHYLIB |
| 1779 | help | 1779 | help |
| 1780 | TI AR7 CPMAC Ethernet support | 1780 | TI AR7 CPMAC Ethernet support |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index de107732dcdc..2547ee296a7d 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
| @@ -1019,3 +1019,24 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num) | |||
| 1019 | spin_unlock(&adapter->mbox_lock); | 1019 | spin_unlock(&adapter->mbox_lock); |
| 1020 | return status; | 1020 | return status; |
| 1021 | } | 1021 | } |
| 1022 | |||
| 1023 | int be_cmd_reset_function(struct be_adapter *adapter) | ||
| 1024 | { | ||
| 1025 | struct be_mcc_wrb *wrb = wrb_from_mbox(&adapter->mbox_mem); | ||
| 1026 | struct be_cmd_req_hdr *req = embedded_payload(wrb); | ||
| 1027 | int status; | ||
| 1028 | |||
| 1029 | spin_lock(&adapter->mbox_lock); | ||
| 1030 | |||
| 1031 | memset(wrb, 0, sizeof(*wrb)); | ||
| 1032 | |||
| 1033 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0); | ||
| 1034 | |||
| 1035 | be_cmd_hdr_prepare(req, CMD_SUBSYSTEM_COMMON, | ||
| 1036 | OPCODE_COMMON_FUNCTION_RESET, sizeof(*req)); | ||
| 1037 | |||
| 1038 | status = be_mbox_notify(adapter); | ||
| 1039 | |||
| 1040 | spin_unlock(&adapter->mbox_lock); | ||
| 1041 | return status; | ||
| 1042 | } | ||
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 5c5de3540d20..70618064ae15 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
| @@ -135,6 +135,7 @@ struct be_mcc_mailbox { | |||
| 135 | #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58 | 135 | #define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58 |
| 136 | #define OPCODE_COMMON_NTWK_PMAC_ADD 59 | 136 | #define OPCODE_COMMON_NTWK_PMAC_ADD 59 |
| 137 | #define OPCODE_COMMON_NTWK_PMAC_DEL 60 | 137 | #define OPCODE_COMMON_NTWK_PMAC_DEL 60 |
| 138 | #define OPCODE_COMMON_FUNCTION_RESET 61 | ||
| 138 | 139 | ||
| 139 | #define OPCODE_ETH_ACPI_CONFIG 2 | 140 | #define OPCODE_ETH_ACPI_CONFIG 2 |
| 140 | #define OPCODE_ETH_PROMISCUOUS 3 | 141 | #define OPCODE_ETH_PROMISCUOUS 3 |
| @@ -744,4 +745,5 @@ extern int be_cmd_set_flow_control(struct be_adapter *adapter, | |||
| 744 | extern int be_cmd_get_flow_control(struct be_adapter *adapter, | 745 | extern int be_cmd_get_flow_control(struct be_adapter *adapter, |
| 745 | u32 *tx_fc, u32 *rx_fc); | 746 | u32 *tx_fc, u32 *rx_fc); |
| 746 | extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num); | 747 | extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num); |
| 748 | extern int be_cmd_reset_function(struct be_adapter *adapter); | ||
| 747 | extern void be_process_mcc(struct be_adapter *adapter); | 749 | extern void be_process_mcc(struct be_adapter *adapter); |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index ef82a52f3934..d20235b16800 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
| @@ -1873,6 +1873,10 @@ static int __devinit be_probe(struct pci_dev *pdev, | |||
| 1873 | if (status) | 1873 | if (status) |
| 1874 | goto free_netdev; | 1874 | goto free_netdev; |
| 1875 | 1875 | ||
| 1876 | status = be_cmd_reset_function(adapter); | ||
| 1877 | if (status) | ||
| 1878 | goto ctrl_clean; | ||
| 1879 | |||
| 1876 | status = be_stats_init(adapter); | 1880 | status = be_stats_init(adapter); |
| 1877 | if (status) | 1881 | if (status) |
| 1878 | goto ctrl_clean; | 1882 | goto ctrl_clean; |
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index fd5e32cbcb87..3e3fab8afb1e 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
| @@ -54,7 +54,7 @@ module_param(dumb_switch, int, 0444); | |||
| 54 | MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable"); | 54 | MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable"); |
| 55 | MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); | 55 | MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); |
| 56 | 56 | ||
| 57 | #define CPMAC_VERSION "0.5.0" | 57 | #define CPMAC_VERSION "0.5.1" |
| 58 | /* frame size + 802.1q tag */ | 58 | /* frame size + 802.1q tag */ |
| 59 | #define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) | 59 | #define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) |
| 60 | #define CPMAC_QUEUES 8 | 60 | #define CPMAC_QUEUES 8 |
| @@ -1109,7 +1109,7 @@ static int external_switch; | |||
| 1109 | static int __devinit cpmac_probe(struct platform_device *pdev) | 1109 | static int __devinit cpmac_probe(struct platform_device *pdev) |
| 1110 | { | 1110 | { |
| 1111 | int rc, phy_id; | 1111 | int rc, phy_id; |
| 1112 | char *mdio_bus_id = "0"; | 1112 | char mdio_bus_id[BUS_ID_SIZE]; |
| 1113 | struct resource *mem; | 1113 | struct resource *mem; |
| 1114 | struct cpmac_priv *priv; | 1114 | struct cpmac_priv *priv; |
| 1115 | struct net_device *dev; | 1115 | struct net_device *dev; |
| @@ -1117,22 +1117,23 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
| 1117 | 1117 | ||
| 1118 | pdata = pdev->dev.platform_data; | 1118 | pdata = pdev->dev.platform_data; |
| 1119 | 1119 | ||
| 1120 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { | 1120 | if (external_switch || dumb_switch) { |
| 1121 | if (!(pdata->phy_mask & (1 << phy_id))) | 1121 | strncpy(mdio_bus_id, "0", BUS_ID_SIZE); /* fixed phys bus */ |
| 1122 | continue; | 1122 | phy_id = pdev->id; |
| 1123 | if (!cpmac_mii->phy_map[phy_id]) | 1123 | } else { |
| 1124 | continue; | 1124 | for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { |
| 1125 | break; | 1125 | if (!(pdata->phy_mask & (1 << phy_id))) |
| 1126 | continue; | ||
| 1127 | if (!cpmac_mii->phy_map[phy_id]) | ||
| 1128 | continue; | ||
| 1129 | strncpy(mdio_bus_id, cpmac_mii->id, BUS_ID_SIZE); | ||
| 1130 | break; | ||
| 1131 | } | ||
| 1126 | } | 1132 | } |
| 1127 | 1133 | ||
| 1128 | if (phy_id == PHY_MAX_ADDR) { | 1134 | if (phy_id == PHY_MAX_ADDR) { |
| 1129 | if (external_switch || dumb_switch) { | 1135 | dev_err(&pdev->dev, "no PHY present\n"); |
| 1130 | mdio_bus_id = 0; /* fixed phys bus */ | 1136 | return -ENODEV; |
| 1131 | phy_id = pdev->id; | ||
| 1132 | } else { | ||
| 1133 | dev_err(&pdev->dev, "no PHY present\n"); | ||
| 1134 | return -ENODEV; | ||
| 1135 | } | ||
| 1136 | } | 1137 | } |
| 1137 | 1138 | ||
| 1138 | dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); | 1139 | dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); |
| @@ -1166,8 +1167,11 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
| 1166 | priv->msg_enable = netif_msg_init(debug_level, 0xff); | 1167 | priv->msg_enable = netif_msg_init(debug_level, 0xff); |
| 1167 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); | 1168 | memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr)); |
| 1168 | 1169 | ||
| 1169 | priv->phy = phy_connect(dev, dev_name(&cpmac_mii->phy_map[phy_id]->dev), | 1170 | snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id); |
| 1170 | &cpmac_adjust_link, 0, PHY_INTERFACE_MODE_MII); | 1171 | |
| 1172 | priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0, | ||
| 1173 | PHY_INTERFACE_MODE_MII); | ||
| 1174 | |||
| 1171 | if (IS_ERR(priv->phy)) { | 1175 | if (IS_ERR(priv->phy)) { |
| 1172 | if (netif_msg_drv(priv)) | 1176 | if (netif_msg_drv(priv)) |
| 1173 | printk(KERN_ERR "%s: Could not attach to PHY\n", | 1177 | printk(KERN_ERR "%s: Could not attach to PHY\n", |
| @@ -1241,11 +1245,11 @@ int __devinit cpmac_init(void) | |||
| 1241 | 1245 | ||
| 1242 | cpmac_mii->reset(cpmac_mii); | 1246 | cpmac_mii->reset(cpmac_mii); |
| 1243 | 1247 | ||
| 1244 | for (i = 0; i < 300000; i++) | 1248 | for (i = 0; i < 300; i++) |
| 1245 | if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE))) | 1249 | if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE))) |
| 1246 | break; | 1250 | break; |
| 1247 | else | 1251 | else |
| 1248 | cpu_relax(); | 1252 | msleep(10); |
| 1249 | 1253 | ||
| 1250 | mask &= 0x7fffffff; | 1254 | mask &= 0x7fffffff; |
| 1251 | if (mask & (mask - 1)) { | 1255 | if (mask & (mask - 1)) { |
| @@ -1254,7 +1258,7 @@ int __devinit cpmac_init(void) | |||
| 1254 | } | 1258 | } |
| 1255 | 1259 | ||
| 1256 | cpmac_mii->phy_mask = ~(mask | 0x80000000); | 1260 | cpmac_mii->phy_mask = ~(mask | 0x80000000); |
| 1257 | snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "0"); | 1261 | snprintf(cpmac_mii->id, MII_BUS_ID_SIZE, "1"); |
| 1258 | 1262 | ||
| 1259 | res = mdiobus_register(cpmac_mii); | 1263 | res = mdiobus_register(cpmac_mii); |
| 1260 | if (res) | 1264 | if (res) |
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index 526e144b8b74..032cfe065570 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
| @@ -3692,8 +3692,12 @@ static void mc7_prep(struct adapter *adapter, struct mc7 *mc7, | |||
| 3692 | 3692 | ||
| 3693 | void mac_prep(struct cmac *mac, struct adapter *adapter, int index) | 3693 | void mac_prep(struct cmac *mac, struct adapter *adapter, int index) |
| 3694 | { | 3694 | { |
| 3695 | u16 devid; | ||
| 3696 | |||
| 3695 | mac->adapter = adapter; | 3697 | mac->adapter = adapter; |
| 3696 | if (!adapter->params.vpd.xauicfg[1]) | 3698 | pci_read_config_word(adapter->pdev, 0x2, &devid); |
| 3699 | |||
| 3700 | if (devid == 0x37 && !adapter->params.vpd.xauicfg[1]) | ||
| 3697 | index = 0; | 3701 | index = 0; |
| 3698 | mac->offset = (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR) * index; | 3702 | mac->offset = (XGMAC0_1_BASE_ADDR - XGMAC0_0_BASE_ADDR) * index; |
| 3699 | mac->nucast = 1; | 3703 | mac->nucast = 1; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 44adc9862826..52d7f19de435 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -5126,7 +5126,7 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
| 5126 | return smp_processor_id(); | 5126 | return smp_processor_id(); |
| 5127 | 5127 | ||
| 5128 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) | 5128 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) |
| 5129 | return 0; /* All traffic should default to class 0 */ | 5129 | return (skb->vlan_tci & IXGBE_TX_FLAGS_VLAN_PRIO_MASK) >> 13; |
| 5130 | 5130 | ||
| 5131 | return skb_tx_hash(dev, skb); | 5131 | return skb_tx_hash(dev, skb); |
| 5132 | } | 5132 | } |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index e22d08615893..ae81f7022d23 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
| @@ -365,6 +365,7 @@ struct rcv_desc { | |||
| 365 | #define NETXEN_NIC_RXPKT_DESC 0x04 | 365 | #define NETXEN_NIC_RXPKT_DESC 0x04 |
| 366 | #define NETXEN_OLD_RXPKT_DESC 0x3f | 366 | #define NETXEN_OLD_RXPKT_DESC 0x3f |
| 367 | #define NETXEN_NIC_RESPONSE_DESC 0x05 | 367 | #define NETXEN_NIC_RESPONSE_DESC 0x05 |
| 368 | #define NETXEN_NIC_LRO_DESC 0x12 | ||
| 368 | 369 | ||
| 369 | /* for status field in status_desc */ | 370 | /* for status field in status_desc */ |
| 370 | #define STATUS_NEED_CKSUM (1) | 371 | #define STATUS_NEED_CKSUM (1) |
| @@ -398,6 +399,24 @@ struct rcv_desc { | |||
| 398 | #define netxen_get_sts_opcode(sts_data) \ | 399 | #define netxen_get_sts_opcode(sts_data) \ |
| 399 | (((sts_data) >> 58) & 0x03F) | 400 | (((sts_data) >> 58) & 0x03F) |
| 400 | 401 | ||
| 402 | #define netxen_get_lro_sts_refhandle(sts_data) \ | ||
| 403 | ((sts_data) & 0x0FFFF) | ||
| 404 | #define netxen_get_lro_sts_length(sts_data) \ | ||
| 405 | (((sts_data) >> 16) & 0x0FFFF) | ||
| 406 | #define netxen_get_lro_sts_l2_hdr_offset(sts_data) \ | ||
| 407 | (((sts_data) >> 32) & 0x0FF) | ||
| 408 | #define netxen_get_lro_sts_l4_hdr_offset(sts_data) \ | ||
| 409 | (((sts_data) >> 40) & 0x0FF) | ||
| 410 | #define netxen_get_lro_sts_timestamp(sts_data) \ | ||
| 411 | (((sts_data) >> 48) & 0x1) | ||
| 412 | #define netxen_get_lro_sts_type(sts_data) \ | ||
| 413 | (((sts_data) >> 49) & 0x7) | ||
| 414 | #define netxen_get_lro_sts_push_flag(sts_data) \ | ||
| 415 | (((sts_data) >> 52) & 0x1) | ||
| 416 | #define netxen_get_lro_sts_seq_number(sts_data) \ | ||
| 417 | ((sts_data) & 0x0FFFFFFFF) | ||
| 418 | |||
| 419 | |||
| 401 | struct status_desc { | 420 | struct status_desc { |
| 402 | __le64 status_desc_data[2]; | 421 | __le64 status_desc_data[2]; |
| 403 | } __attribute__ ((aligned(16))); | 422 | } __attribute__ ((aligned(16))); |
| @@ -441,154 +460,6 @@ struct status_desc { | |||
| 441 | #define NETXEN_BRDTYPE_P3_10G_XFP 0x0032 | 460 | #define NETXEN_BRDTYPE_P3_10G_XFP 0x0032 |
| 442 | #define NETXEN_BRDTYPE_P3_10G_TP 0x0080 | 461 | #define NETXEN_BRDTYPE_P3_10G_TP 0x0080 |
| 443 | 462 | ||
| 444 | struct netxen_board_info { | ||
| 445 | u32 header_version; | ||
| 446 | |||
| 447 | u32 board_mfg; | ||
| 448 | u32 board_type; | ||
| 449 | u32 board_num; | ||
| 450 | u32 chip_id; | ||
| 451 | u32 chip_minor; | ||
| 452 | u32 chip_major; | ||
| 453 | u32 chip_pkg; | ||
| 454 | u32 chip_lot; | ||
| 455 | |||
| 456 | u32 port_mask; /* available niu ports */ | ||
| 457 | u32 peg_mask; /* available pegs */ | ||
| 458 | u32 icache_ok; /* can we run with icache? */ | ||
| 459 | u32 dcache_ok; /* can we run with dcache? */ | ||
| 460 | u32 casper_ok; | ||
| 461 | |||
| 462 | u32 mac_addr_lo_0; | ||
| 463 | u32 mac_addr_lo_1; | ||
| 464 | u32 mac_addr_lo_2; | ||
| 465 | u32 mac_addr_lo_3; | ||
| 466 | |||
| 467 | /* MN-related config */ | ||
| 468 | u32 mn_sync_mode; /* enable/ sync shift cclk/ sync shift mclk */ | ||
| 469 | u32 mn_sync_shift_cclk; | ||
| 470 | u32 mn_sync_shift_mclk; | ||
| 471 | u32 mn_wb_en; | ||
| 472 | u32 mn_crystal_freq; /* in MHz */ | ||
| 473 | u32 mn_speed; /* in MHz */ | ||
| 474 | u32 mn_org; | ||
| 475 | u32 mn_depth; | ||
| 476 | u32 mn_ranks_0; /* ranks per slot */ | ||
| 477 | u32 mn_ranks_1; /* ranks per slot */ | ||
| 478 | u32 mn_rd_latency_0; | ||
| 479 | u32 mn_rd_latency_1; | ||
| 480 | u32 mn_rd_latency_2; | ||
| 481 | u32 mn_rd_latency_3; | ||
| 482 | u32 mn_rd_latency_4; | ||
| 483 | u32 mn_rd_latency_5; | ||
| 484 | u32 mn_rd_latency_6; | ||
| 485 | u32 mn_rd_latency_7; | ||
| 486 | u32 mn_rd_latency_8; | ||
| 487 | u32 mn_dll_val[18]; | ||
| 488 | u32 mn_mode_reg; /* MIU DDR Mode Register */ | ||
| 489 | u32 mn_ext_mode_reg; /* MIU DDR Extended Mode Register */ | ||
| 490 | u32 mn_timing_0; /* MIU Memory Control Timing Rgister */ | ||
| 491 | u32 mn_timing_1; /* MIU Extended Memory Ctrl Timing Register */ | ||
| 492 | u32 mn_timing_2; /* MIU Extended Memory Ctrl Timing2 Register */ | ||
| 493 | |||
| 494 | /* SN-related config */ | ||
| 495 | u32 sn_sync_mode; /* enable/ sync shift cclk / sync shift mclk */ | ||
| 496 | u32 sn_pt_mode; /* pass through mode */ | ||
| 497 | u32 sn_ecc_en; | ||
| 498 | u32 sn_wb_en; | ||
| 499 | u32 sn_crystal_freq; | ||
| 500 | u32 sn_speed; | ||
| 501 | u32 sn_org; | ||
| 502 | u32 sn_depth; | ||
| 503 | u32 sn_dll_tap; | ||
| 504 | u32 sn_rd_latency; | ||
| 505 | |||
| 506 | u32 mac_addr_hi_0; | ||
| 507 | u32 mac_addr_hi_1; | ||
| 508 | u32 mac_addr_hi_2; | ||
| 509 | u32 mac_addr_hi_3; | ||
| 510 | |||
| 511 | u32 magic; /* indicates flash has been initialized */ | ||
| 512 | |||
| 513 | u32 mn_rdimm; | ||
| 514 | u32 mn_dll_override; | ||
| 515 | |||
| 516 | }; | ||
| 517 | |||
| 518 | #define FLASH_NUM_PORTS (4) | ||
| 519 | |||
| 520 | struct netxen_flash_mac_addr { | ||
| 521 | u32 flash_addr[32]; | ||
| 522 | }; | ||
| 523 | |||
| 524 | struct netxen_user_old_info { | ||
| 525 | u8 flash_md5[16]; | ||
| 526 | u8 crbinit_md5[16]; | ||
| 527 | u8 brdcfg_md5[16]; | ||
| 528 | /* bootloader */ | ||
| 529 | u32 bootld_version; | ||
| 530 | u32 bootld_size; | ||
| 531 | u8 bootld_md5[16]; | ||
| 532 | /* image */ | ||
| 533 | u32 image_version; | ||
| 534 | u32 image_size; | ||
| 535 | u8 image_md5[16]; | ||
| 536 | /* primary image status */ | ||
| 537 | u32 primary_status; | ||
| 538 | u32 secondary_present; | ||
| 539 | |||
| 540 | /* MAC address , 4 ports */ | ||
| 541 | struct netxen_flash_mac_addr mac_addr[FLASH_NUM_PORTS]; | ||
| 542 | }; | ||
| 543 | #define FLASH_NUM_MAC_PER_PORT 32 | ||
| 544 | struct netxen_user_info { | ||
| 545 | u8 flash_md5[16 * 64]; | ||
| 546 | /* bootloader */ | ||
| 547 | u32 bootld_version; | ||
| 548 | u32 bootld_size; | ||
| 549 | /* image */ | ||
| 550 | u32 image_version; | ||
| 551 | u32 image_size; | ||
| 552 | /* primary image status */ | ||
| 553 | u32 primary_status; | ||
| 554 | u32 secondary_present; | ||
| 555 | |||
| 556 | /* MAC address , 4 ports, 32 address per port */ | ||
| 557 | u64 mac_addr[FLASH_NUM_PORTS * FLASH_NUM_MAC_PER_PORT]; | ||
| 558 | u32 sub_sys_id; | ||
| 559 | u8 serial_num[32]; | ||
| 560 | |||
| 561 | /* Any user defined data */ | ||
| 562 | }; | ||
| 563 | |||
| 564 | /* | ||
| 565 | * Flash Layout - new format. | ||
| 566 | */ | ||
| 567 | struct netxen_new_user_info { | ||
| 568 | u8 flash_md5[16 * 64]; | ||
| 569 | /* bootloader */ | ||
| 570 | u32 bootld_version; | ||
| 571 | u32 bootld_size; | ||
| 572 | /* image */ | ||
| 573 | u32 image_version; | ||
| 574 | u32 image_size; | ||
| 575 | /* primary image status */ | ||
| 576 | u32 primary_status; | ||
| 577 | u32 secondary_present; | ||
| 578 | |||
| 579 | /* MAC address , 4 ports, 32 address per port */ | ||
| 580 | u64 mac_addr[FLASH_NUM_PORTS * FLASH_NUM_MAC_PER_PORT]; | ||
| 581 | u32 sub_sys_id; | ||
| 582 | u8 serial_num[32]; | ||
| 583 | |||
| 584 | /* Any user defined data */ | ||
| 585 | }; | ||
| 586 | |||
| 587 | #define SECONDARY_IMAGE_PRESENT 0xb3b4b5b6 | ||
| 588 | #define SECONDARY_IMAGE_ABSENT 0xffffffff | ||
| 589 | #define PRIMARY_IMAGE_GOOD 0x5a5a5a5a | ||
| 590 | #define PRIMARY_IMAGE_BAD 0xffffffff | ||
| 591 | |||
| 592 | /* Flash memory map */ | 463 | /* Flash memory map */ |
| 593 | #define NETXEN_CRBINIT_START 0 /* crbinit section */ | 464 | #define NETXEN_CRBINIT_START 0 /* crbinit section */ |
| 594 | #define NETXEN_BRDCFG_START 0x4000 /* board config */ | 465 | #define NETXEN_BRDCFG_START 0x4000 /* board config */ |
| @@ -599,28 +470,25 @@ struct netxen_new_user_info { | |||
| 599 | #define NETXEN_PXE_START 0x3E0000 /* PXE boot rom */ | 470 | #define NETXEN_PXE_START 0x3E0000 /* PXE boot rom */ |
| 600 | #define NETXEN_USER_START 0x3E8000 /* Firmare info */ | 471 | #define NETXEN_USER_START 0x3E8000 /* Firmare info */ |
| 601 | #define NETXEN_FIXED_START 0x3F0000 /* backup of crbinit */ | 472 | #define NETXEN_FIXED_START 0x3F0000 /* backup of crbinit */ |
| 473 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* very old flash */ | ||
| 602 | 474 | ||
| 475 | #define NX_OLD_MAC_ADDR_OFFSET (NETXEN_USER_START) | ||
| 603 | #define NX_FW_VERSION_OFFSET (NETXEN_USER_START+0x408) | 476 | #define NX_FW_VERSION_OFFSET (NETXEN_USER_START+0x408) |
| 604 | #define NX_FW_SIZE_OFFSET (NETXEN_USER_START+0x40c) | 477 | #define NX_FW_SIZE_OFFSET (NETXEN_USER_START+0x40c) |
| 478 | #define NX_FW_MAC_ADDR_OFFSET (NETXEN_USER_START+0x418) | ||
| 479 | #define NX_FW_SERIAL_NUM_OFFSET (NETXEN_USER_START+0x81c) | ||
| 605 | #define NX_BIOS_VERSION_OFFSET (NETXEN_USER_START+0x83c) | 480 | #define NX_BIOS_VERSION_OFFSET (NETXEN_USER_START+0x83c) |
| 481 | |||
| 482 | #define NX_HDR_VERSION_OFFSET (NETXEN_BRDCFG_START) | ||
| 483 | #define NX_BRDTYPE_OFFSET (NETXEN_BRDCFG_START+0x8) | ||
| 606 | #define NX_FW_MAGIC_OFFSET (NETXEN_BRDCFG_START+0x128) | 484 | #define NX_FW_MAGIC_OFFSET (NETXEN_BRDCFG_START+0x128) |
| 485 | |||
| 607 | #define NX_FW_MIN_SIZE (0x3fffff) | 486 | #define NX_FW_MIN_SIZE (0x3fffff) |
| 608 | #define NX_P2_MN_ROMIMAGE 0 | 487 | #define NX_P2_MN_ROMIMAGE 0 |
| 609 | #define NX_P3_CT_ROMIMAGE 1 | 488 | #define NX_P3_CT_ROMIMAGE 1 |
| 610 | #define NX_P3_MN_ROMIMAGE 2 | 489 | #define NX_P3_MN_ROMIMAGE 2 |
| 611 | #define NX_FLASH_ROMIMAGE 3 | 490 | #define NX_FLASH_ROMIMAGE 3 |
| 612 | 491 | ||
| 613 | #define NETXEN_USER_START_OLD NETXEN_PXE_START /* for backward compatibility */ | ||
| 614 | |||
| 615 | #define NETXEN_FLASH_START (NETXEN_CRBINIT_START) | ||
| 616 | #define NETXEN_INIT_SECTOR (0) | ||
| 617 | #define NETXEN_PRIMARY_START (NETXEN_BOOTLD_START) | ||
| 618 | #define NETXEN_FLASH_CRBINIT_SIZE (0x4000) | ||
| 619 | #define NETXEN_FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) | ||
| 620 | #define NETXEN_FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32)) | ||
| 621 | #define NETXEN_FLASH_SECONDARY_SIZE (NETXEN_USER_START-NETXEN_SECONDARY_START) | ||
| 622 | #define NETXEN_NUM_PRIMARY_SECTORS (0x20) | ||
| 623 | #define NETXEN_NUM_CONFIG_SECTORS (1) | ||
| 624 | extern char netxen_nic_driver_name[]; | 492 | extern char netxen_nic_driver_name[]; |
| 625 | 493 | ||
| 626 | /* Number of status descriptors to handle per interrupt */ | 494 | /* Number of status descriptors to handle per interrupt */ |
| @@ -863,6 +731,7 @@ struct netxen_recv_context { | |||
| 863 | #define NX_CAP0_LSO NX_CAP_BIT(0, 6) | 731 | #define NX_CAP0_LSO NX_CAP_BIT(0, 6) |
| 864 | #define NX_CAP0_JUMBO_CONTIGUOUS NX_CAP_BIT(0, 7) | 732 | #define NX_CAP0_JUMBO_CONTIGUOUS NX_CAP_BIT(0, 7) |
| 865 | #define NX_CAP0_LRO_CONTIGUOUS NX_CAP_BIT(0, 8) | 733 | #define NX_CAP0_LRO_CONTIGUOUS NX_CAP_BIT(0, 8) |
| 734 | #define NX_CAP0_HW_LRO NX_CAP_BIT(0, 10) | ||
| 866 | 735 | ||
| 867 | /* | 736 | /* |
| 868 | * Context state | 737 | * Context state |
| @@ -1120,6 +989,7 @@ typedef struct { | |||
| 1120 | #define NX_FW_CAPABILITY_PEXQ (1 << 7) | 989 | #define NX_FW_CAPABILITY_PEXQ (1 << 7) |
| 1121 | #define NX_FW_CAPABILITY_BDG (1 << 8) | 990 | #define NX_FW_CAPABILITY_BDG (1 << 8) |
| 1122 | #define NX_FW_CAPABILITY_FVLANTX (1 << 9) | 991 | #define NX_FW_CAPABILITY_FVLANTX (1 << 9) |
| 992 | #define NX_FW_CAPABILITY_HW_LRO (1 << 10) | ||
| 1123 | 993 | ||
| 1124 | /* module types */ | 994 | /* module types */ |
| 1125 | #define LINKEVENT_MODULE_NOT_PRESENT 1 | 995 | #define LINKEVENT_MODULE_NOT_PRESENT 1 |
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 9e0469643d34..412d65829d20 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
| @@ -203,6 +203,8 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
| 203 | 203 | ||
| 204 | cap = (NX_CAP0_LEGACY_CONTEXT | NX_CAP0_LEGACY_MN); | 204 | cap = (NX_CAP0_LEGACY_CONTEXT | NX_CAP0_LEGACY_MN); |
| 205 | cap |= (NX_CAP0_JUMBO_CONTIGUOUS | NX_CAP0_LRO_CONTIGUOUS); | 205 | cap |= (NX_CAP0_JUMBO_CONTIGUOUS | NX_CAP0_LRO_CONTIGUOUS); |
| 206 | if (adapter->capabilities & NX_FW_CAPABILITY_HW_LRO) | ||
| 207 | cap |= NX_CAP0_HW_LRO; | ||
| 206 | 208 | ||
| 207 | prq->capabilities[0] = cpu_to_le32(cap); | 209 | prq->capabilities[0] = cpu_to_le32(cap); |
| 208 | prq->host_int_crb_mode = | 210 | prq->host_int_crb_mode = |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index ddb9deb12b33..673dcf5ea53d 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
| @@ -816,18 +816,15 @@ int netxen_get_flash_mac_addr(struct netxen_adapter *adapter, __le64 *mac) | |||
| 816 | __le32 *pmac = (__le32 *) mac; | 816 | __le32 *pmac = (__le32 *) mac; |
| 817 | u32 offset; | 817 | u32 offset; |
| 818 | 818 | ||
| 819 | offset = NETXEN_USER_START + | 819 | offset = NX_FW_MAC_ADDR_OFFSET + (adapter->portnum * sizeof(u64)); |
| 820 | offsetof(struct netxen_new_user_info, mac_addr) + | ||
| 821 | adapter->portnum * sizeof(u64); | ||
| 822 | 820 | ||
| 823 | if (netxen_get_flash_block(adapter, offset, sizeof(u64), pmac) == -1) | 821 | if (netxen_get_flash_block(adapter, offset, sizeof(u64), pmac) == -1) |
| 824 | return -1; | 822 | return -1; |
| 825 | 823 | ||
| 826 | if (*mac == cpu_to_le64(~0ULL)) { | 824 | if (*mac == cpu_to_le64(~0ULL)) { |
| 827 | 825 | ||
| 828 | offset = NETXEN_USER_START_OLD + | 826 | offset = NX_OLD_MAC_ADDR_OFFSET + |
| 829 | offsetof(struct netxen_user_old_info, mac_addr) + | 827 | (adapter->portnum * sizeof(u64)); |
| 830 | adapter->portnum * sizeof(u64); | ||
| 831 | 828 | ||
| 832 | if (netxen_get_flash_block(adapter, | 829 | if (netxen_get_flash_block(adapter, |
| 833 | offset, sizeof(u64), pmac) == -1) | 830 | offset, sizeof(u64), pmac) == -1) |
| @@ -1857,13 +1854,11 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
| 1857 | int offset, board_type, magic, header_version; | 1854 | int offset, board_type, magic, header_version; |
| 1858 | struct pci_dev *pdev = adapter->pdev; | 1855 | struct pci_dev *pdev = adapter->pdev; |
| 1859 | 1856 | ||
| 1860 | offset = NETXEN_BRDCFG_START + | 1857 | offset = NX_FW_MAGIC_OFFSET; |
| 1861 | offsetof(struct netxen_board_info, magic); | ||
| 1862 | if (netxen_rom_fast_read(adapter, offset, &magic)) | 1858 | if (netxen_rom_fast_read(adapter, offset, &magic)) |
| 1863 | return -EIO; | 1859 | return -EIO; |
| 1864 | 1860 | ||
| 1865 | offset = NETXEN_BRDCFG_START + | 1861 | offset = NX_HDR_VERSION_OFFSET; |
| 1866 | offsetof(struct netxen_board_info, header_version); | ||
| 1867 | if (netxen_rom_fast_read(adapter, offset, &header_version)) | 1862 | if (netxen_rom_fast_read(adapter, offset, &header_version)) |
| 1868 | return -EIO; | 1863 | return -EIO; |
| 1869 | 1864 | ||
| @@ -1875,8 +1870,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
| 1875 | return -EIO; | 1870 | return -EIO; |
| 1876 | } | 1871 | } |
| 1877 | 1872 | ||
| 1878 | offset = NETXEN_BRDCFG_START + | 1873 | offset = NX_BRDTYPE_OFFSET; |
| 1879 | offsetof(struct netxen_board_info, board_type); | ||
| 1880 | if (netxen_rom_fast_read(adapter, offset, &board_type)) | 1874 | if (netxen_rom_fast_read(adapter, offset, &board_type)) |
| 1881 | return -EIO; | 1875 | return -EIO; |
| 1882 | 1876 | ||
| @@ -2022,23 +2016,22 @@ void netxen_nic_get_firmware_info(struct netxen_adapter *adapter) | |||
| 2022 | u32 fw_major, fw_minor, fw_build; | 2016 | u32 fw_major, fw_minor, fw_build; |
| 2023 | char brd_name[NETXEN_MAX_SHORT_NAME]; | 2017 | char brd_name[NETXEN_MAX_SHORT_NAME]; |
| 2024 | char serial_num[32]; | 2018 | char serial_num[32]; |
| 2025 | int i, addr, val; | 2019 | int i, offset, val; |
| 2026 | int *ptr32; | 2020 | int *ptr32; |
| 2027 | struct pci_dev *pdev = adapter->pdev; | 2021 | struct pci_dev *pdev = adapter->pdev; |
| 2028 | 2022 | ||
| 2029 | adapter->driver_mismatch = 0; | 2023 | adapter->driver_mismatch = 0; |
| 2030 | 2024 | ||
| 2031 | ptr32 = (int *)&serial_num; | 2025 | ptr32 = (int *)&serial_num; |
| 2032 | addr = NETXEN_USER_START + | 2026 | offset = NX_FW_SERIAL_NUM_OFFSET; |
| 2033 | offsetof(struct netxen_new_user_info, serial_num); | ||
| 2034 | for (i = 0; i < 8; i++) { | 2027 | for (i = 0; i < 8; i++) { |
| 2035 | if (netxen_rom_fast_read(adapter, addr, &val) == -1) { | 2028 | if (netxen_rom_fast_read(adapter, offset, &val) == -1) { |
| 2036 | dev_err(&pdev->dev, "error reading board info\n"); | 2029 | dev_err(&pdev->dev, "error reading board info\n"); |
| 2037 | adapter->driver_mismatch = 1; | 2030 | adapter->driver_mismatch = 1; |
| 2038 | return; | 2031 | return; |
| 2039 | } | 2032 | } |
| 2040 | ptr32[i] = cpu_to_le32(val); | 2033 | ptr32[i] = cpu_to_le32(val); |
| 2041 | addr += sizeof(u32); | 2034 | offset += sizeof(u32); |
| 2042 | } | 2035 | } |
| 2043 | 2036 | ||
| 2044 | fw_major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR); | 2037 | fw_major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR); |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 81253abbfa34..582828756ef4 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
| @@ -1242,20 +1242,31 @@ no_skb: | |||
| 1242 | 1242 | ||
| 1243 | static struct netxen_rx_buffer * | 1243 | static struct netxen_rx_buffer * |
| 1244 | netxen_process_rcv(struct netxen_adapter *adapter, | 1244 | netxen_process_rcv(struct netxen_adapter *adapter, |
| 1245 | int ring, int index, int length, int cksum, int pkt_offset, | 1245 | struct nx_host_sds_ring *sds_ring, |
| 1246 | struct nx_host_sds_ring *sds_ring) | 1246 | int ring, u64 sts_data0) |
| 1247 | { | 1247 | { |
| 1248 | struct net_device *netdev = adapter->netdev; | 1248 | struct net_device *netdev = adapter->netdev; |
| 1249 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; | 1249 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; |
| 1250 | struct netxen_rx_buffer *buffer; | 1250 | struct netxen_rx_buffer *buffer; |
| 1251 | struct sk_buff *skb; | 1251 | struct sk_buff *skb; |
| 1252 | struct nx_host_rds_ring *rds_ring = &recv_ctx->rds_rings[ring]; | 1252 | struct nx_host_rds_ring *rds_ring; |
| 1253 | int index, length, cksum, pkt_offset; | ||
| 1253 | 1254 | ||
| 1254 | if (unlikely(index > rds_ring->num_desc)) | 1255 | if (unlikely(ring >= adapter->max_rds_rings)) |
| 1256 | return NULL; | ||
| 1257 | |||
| 1258 | rds_ring = &recv_ctx->rds_rings[ring]; | ||
| 1259 | |||
| 1260 | index = netxen_get_sts_refhandle(sts_data0); | ||
| 1261 | if (unlikely(index >= rds_ring->num_desc)) | ||
| 1255 | return NULL; | 1262 | return NULL; |
| 1256 | 1263 | ||
| 1257 | buffer = &rds_ring->rx_buf_arr[index]; | 1264 | buffer = &rds_ring->rx_buf_arr[index]; |
| 1258 | 1265 | ||
| 1266 | length = netxen_get_sts_totallength(sts_data0); | ||
| 1267 | cksum = netxen_get_sts_status(sts_data0); | ||
| 1268 | pkt_offset = netxen_get_sts_pkt_offset(sts_data0); | ||
| 1269 | |||
| 1259 | skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); | 1270 | skb = netxen_process_rxbuf(adapter, rds_ring, index, cksum); |
| 1260 | if (!skb) | 1271 | if (!skb) |
| 1261 | return buffer; | 1272 | return buffer; |
| @@ -1279,6 +1290,78 @@ netxen_process_rcv(struct netxen_adapter *adapter, | |||
| 1279 | return buffer; | 1290 | return buffer; |
| 1280 | } | 1291 | } |
| 1281 | 1292 | ||
| 1293 | #define TCP_HDR_SIZE 20 | ||
| 1294 | #define TCP_TS_OPTION_SIZE 12 | ||
| 1295 | #define TCP_TS_HDR_SIZE (TCP_HDR_SIZE + TCP_TS_OPTION_SIZE) | ||
| 1296 | |||
| 1297 | static struct netxen_rx_buffer * | ||
| 1298 | netxen_process_lro(struct netxen_adapter *adapter, | ||
| 1299 | struct nx_host_sds_ring *sds_ring, | ||
| 1300 | int ring, u64 sts_data0, u64 sts_data1) | ||
| 1301 | { | ||
| 1302 | struct net_device *netdev = adapter->netdev; | ||
| 1303 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; | ||
| 1304 | struct netxen_rx_buffer *buffer; | ||
| 1305 | struct sk_buff *skb; | ||
| 1306 | struct nx_host_rds_ring *rds_ring; | ||
| 1307 | struct iphdr *iph; | ||
| 1308 | struct tcphdr *th; | ||
| 1309 | bool push, timestamp; | ||
| 1310 | int l2_hdr_offset, l4_hdr_offset; | ||
| 1311 | int index; | ||
| 1312 | u16 lro_length, length, data_offset; | ||
| 1313 | u32 seq_number; | ||
| 1314 | |||
| 1315 | if (unlikely(ring > adapter->max_rds_rings)) | ||
| 1316 | return NULL; | ||
| 1317 | |||
| 1318 | rds_ring = &recv_ctx->rds_rings[ring]; | ||
| 1319 | |||
| 1320 | index = netxen_get_lro_sts_refhandle(sts_data0); | ||
| 1321 | if (unlikely(index > rds_ring->num_desc)) | ||
| 1322 | return NULL; | ||
| 1323 | |||
| 1324 | buffer = &rds_ring->rx_buf_arr[index]; | ||
| 1325 | |||
| 1326 | timestamp = netxen_get_lro_sts_timestamp(sts_data0); | ||
| 1327 | lro_length = netxen_get_lro_sts_length(sts_data0); | ||
| 1328 | l2_hdr_offset = netxen_get_lro_sts_l2_hdr_offset(sts_data0); | ||
| 1329 | l4_hdr_offset = netxen_get_lro_sts_l4_hdr_offset(sts_data0); | ||
| 1330 | push = netxen_get_lro_sts_push_flag(sts_data0); | ||
| 1331 | seq_number = netxen_get_lro_sts_seq_number(sts_data1); | ||
| 1332 | |||
| 1333 | skb = netxen_process_rxbuf(adapter, rds_ring, index, STATUS_CKSUM_OK); | ||
| 1334 | if (!skb) | ||
| 1335 | return buffer; | ||
| 1336 | |||
| 1337 | if (timestamp) | ||
| 1338 | data_offset = l4_hdr_offset + TCP_TS_HDR_SIZE; | ||
| 1339 | else | ||
| 1340 | data_offset = l4_hdr_offset + TCP_HDR_SIZE; | ||
| 1341 | |||
| 1342 | skb_put(skb, lro_length + data_offset); | ||
| 1343 | |||
| 1344 | skb->truesize = (skb->len + sizeof(struct sk_buff) + | ||
| 1345 | ((unsigned long)skb->data - (unsigned long)skb->head)); | ||
| 1346 | |||
| 1347 | skb_pull(skb, l2_hdr_offset); | ||
| 1348 | skb->protocol = eth_type_trans(skb, netdev); | ||
| 1349 | |||
| 1350 | iph = (struct iphdr *)skb->data; | ||
| 1351 | th = (struct tcphdr *)(skb->data + (iph->ihl << 2)); | ||
| 1352 | |||
| 1353 | length = (iph->ihl << 2) + (th->doff << 2) + lro_length; | ||
| 1354 | iph->tot_len = htons(length); | ||
| 1355 | iph->check = 0; | ||
| 1356 | iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); | ||
| 1357 | th->psh = push; | ||
| 1358 | th->seq = htonl(seq_number); | ||
| 1359 | |||
| 1360 | netif_receive_skb(skb); | ||
| 1361 | |||
| 1362 | return buffer; | ||
| 1363 | } | ||
| 1364 | |||
| 1282 | #define netxen_merge_rx_buffers(list, head) \ | 1365 | #define netxen_merge_rx_buffers(list, head) \ |
| 1283 | do { list_splice_tail_init(list, head); } while (0); | 1366 | do { list_splice_tail_init(list, head); } while (0); |
| 1284 | 1367 | ||
| @@ -1295,28 +1378,33 @@ netxen_process_rcv_ring(struct nx_host_sds_ring *sds_ring, int max) | |||
| 1295 | u32 consumer = sds_ring->consumer; | 1378 | u32 consumer = sds_ring->consumer; |
| 1296 | 1379 | ||
| 1297 | int count = 0; | 1380 | int count = 0; |
| 1298 | u64 sts_data; | 1381 | u64 sts_data0, sts_data1; |
| 1299 | int opcode, ring, index, length, cksum, pkt_offset, desc_cnt; | 1382 | int opcode, ring = 0, desc_cnt; |
| 1300 | 1383 | ||
| 1301 | while (count < max) { | 1384 | while (count < max) { |
| 1302 | desc = &sds_ring->desc_head[consumer]; | 1385 | desc = &sds_ring->desc_head[consumer]; |
| 1303 | sts_data = le64_to_cpu(desc->status_desc_data[0]); | 1386 | sts_data0 = le64_to_cpu(desc->status_desc_data[0]); |
| 1304 | 1387 | ||
| 1305 | if (!(sts_data & STATUS_OWNER_HOST)) | 1388 | if (!(sts_data0 & STATUS_OWNER_HOST)) |
| 1306 | break; | 1389 | break; |
| 1307 | 1390 | ||
| 1308 | desc_cnt = netxen_get_sts_desc_cnt(sts_data); | 1391 | desc_cnt = netxen_get_sts_desc_cnt(sts_data0); |
| 1309 | ring = netxen_get_sts_type(sts_data); | ||
| 1310 | 1392 | ||
| 1311 | if (ring > RCV_RING_JUMBO) | 1393 | opcode = netxen_get_sts_opcode(sts_data0); |
| 1312 | goto skip; | ||
| 1313 | |||
| 1314 | opcode = netxen_get_sts_opcode(sts_data); | ||
| 1315 | 1394 | ||
| 1316 | switch (opcode) { | 1395 | switch (opcode) { |
| 1317 | case NETXEN_NIC_RXPKT_DESC: | 1396 | case NETXEN_NIC_RXPKT_DESC: |
| 1318 | case NETXEN_OLD_RXPKT_DESC: | 1397 | case NETXEN_OLD_RXPKT_DESC: |
| 1319 | case NETXEN_NIC_SYN_OFFLOAD: | 1398 | case NETXEN_NIC_SYN_OFFLOAD: |
| 1399 | ring = netxen_get_sts_type(sts_data0); | ||
| 1400 | rxbuf = netxen_process_rcv(adapter, sds_ring, | ||
| 1401 | ring, sts_data0); | ||
| 1402 | break; | ||
| 1403 | case NETXEN_NIC_LRO_DESC: | ||
| 1404 | ring = netxen_get_lro_sts_type(sts_data0); | ||
| 1405 | sts_data1 = le64_to_cpu(desc->status_desc_data[1]); | ||
| 1406 | rxbuf = netxen_process_lro(adapter, sds_ring, | ||
| 1407 | ring, sts_data0, sts_data1); | ||
| 1320 | break; | 1408 | break; |
| 1321 | case NETXEN_NIC_RESPONSE_DESC: | 1409 | case NETXEN_NIC_RESPONSE_DESC: |
| 1322 | netxen_handle_fw_message(desc_cnt, consumer, sds_ring); | 1410 | netxen_handle_fw_message(desc_cnt, consumer, sds_ring); |
| @@ -1326,14 +1414,6 @@ netxen_process_rcv_ring(struct nx_host_sds_ring *sds_ring, int max) | |||
| 1326 | 1414 | ||
| 1327 | WARN_ON(desc_cnt > 1); | 1415 | WARN_ON(desc_cnt > 1); |
| 1328 | 1416 | ||
| 1329 | index = netxen_get_sts_refhandle(sts_data); | ||
| 1330 | length = netxen_get_sts_totallength(sts_data); | ||
| 1331 | cksum = netxen_get_sts_status(sts_data); | ||
| 1332 | pkt_offset = netxen_get_sts_pkt_offset(sts_data); | ||
| 1333 | |||
| 1334 | rxbuf = netxen_process_rcv(adapter, ring, index, | ||
| 1335 | length, cksum, pkt_offset, sds_ring); | ||
| 1336 | |||
| 1337 | if (rxbuf) | 1417 | if (rxbuf) |
| 1338 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); | 1418 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); |
| 1339 | 1419 | ||
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 40549a0e9ff0..c91e02245815 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
| @@ -1450,7 +1450,7 @@ netxen_tso_check(struct net_device *netdev, | |||
| 1450 | skb_copy_from_linear_data_offset(skb, 12, | 1450 | skb_copy_from_linear_data_offset(skb, 12, |
| 1451 | (char *)vh + 16, copy_len - 16); | 1451 | (char *)vh + 16, copy_len - 16); |
| 1452 | 1452 | ||
| 1453 | copied = copy_len; | 1453 | copied = copy_len - VLAN_HLEN; |
| 1454 | offset = 0; | 1454 | offset = 0; |
| 1455 | 1455 | ||
| 1456 | producer = get_next_index(producer, tx_ring->num_desc); | 1456 | producer = get_next_index(producer, tx_ring->num_desc); |
diff --git a/drivers/net/vxge/vxge-config.h b/drivers/net/vxge/vxge-config.h index 224acea771ed..62779a520ca1 100644 --- a/drivers/net/vxge/vxge-config.h +++ b/drivers/net/vxge/vxge-config.h | |||
| @@ -978,7 +978,9 @@ struct __vxge_hw_fifo { | |||
| 978 | void *txdlh, | 978 | void *txdlh, |
| 979 | enum vxge_hw_fifo_tcode t_code, | 979 | enum vxge_hw_fifo_tcode t_code, |
| 980 | void *userdata, | 980 | void *userdata, |
| 981 | void **skb_ptr); | 981 | struct sk_buff ***skb_ptr, |
| 982 | int nr_skb, | ||
| 983 | int *more); | ||
| 982 | 984 | ||
| 983 | void (*txdl_term)( | 985 | void (*txdl_term)( |
| 984 | void *txdlh, | 986 | void *txdlh, |
| @@ -1779,7 +1781,8 @@ struct vxge_hw_fifo_attr { | |||
| 1779 | void *txdlh, | 1781 | void *txdlh, |
| 1780 | enum vxge_hw_fifo_tcode t_code, | 1782 | enum vxge_hw_fifo_tcode t_code, |
| 1781 | void *userdata, | 1783 | void *userdata, |
| 1782 | void **skb_ptr); | 1784 | struct sk_buff ***skb_ptr, |
| 1785 | int nr_skb, int *more); | ||
| 1783 | 1786 | ||
| 1784 | void (*txdl_term)( | 1787 | void (*txdl_term)( |
| 1785 | void *txdlh, | 1788 | void *txdlh, |
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c index 335140d2834a..094d15548a2b 100644 --- a/drivers/net/vxge/vxge-main.c +++ b/drivers/net/vxge/vxge-main.c | |||
| @@ -87,22 +87,25 @@ static inline int is_vxge_card_up(struct vxgedev *vdev) | |||
| 87 | static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo) | 87 | static inline void VXGE_COMPLETE_VPATH_TX(struct vxge_fifo *fifo) |
| 88 | { | 88 | { |
| 89 | unsigned long flags = 0; | 89 | unsigned long flags = 0; |
| 90 | struct sk_buff *skb_ptr = NULL; | 90 | struct sk_buff **skb_ptr = NULL; |
| 91 | struct sk_buff **temp, *head, *skb; | 91 | struct sk_buff **temp; |
| 92 | 92 | #define NR_SKB_COMPLETED 128 | |
| 93 | if (spin_trylock_irqsave(&fifo->tx_lock, flags)) { | 93 | struct sk_buff *completed[NR_SKB_COMPLETED]; |
| 94 | vxge_hw_vpath_poll_tx(fifo->handle, (void **)&skb_ptr); | 94 | int more; |
| 95 | spin_unlock_irqrestore(&fifo->tx_lock, flags); | 95 | |
| 96 | } | 96 | do { |
| 97 | /* free SKBs */ | 97 | more = 0; |
| 98 | head = skb_ptr; | 98 | skb_ptr = completed; |
| 99 | while (head) { | 99 | |
| 100 | skb = head; | 100 | if (spin_trylock_irqsave(&fifo->tx_lock, flags)) { |
| 101 | temp = (struct sk_buff **)&skb->cb; | 101 | vxge_hw_vpath_poll_tx(fifo->handle, &skb_ptr, |
| 102 | head = *temp; | 102 | NR_SKB_COMPLETED, &more); |
| 103 | *temp = NULL; | 103 | spin_unlock_irqrestore(&fifo->tx_lock, flags); |
| 104 | dev_kfree_skb_irq(skb); | 104 | } |
| 105 | } | 105 | /* free SKBs */ |
| 106 | for (temp = completed; temp != skb_ptr; temp++) | ||
| 107 | dev_kfree_skb_irq(*temp); | ||
| 108 | } while (more) ; | ||
| 106 | } | 109 | } |
| 107 | 110 | ||
| 108 | static inline void VXGE_COMPLETE_ALL_TX(struct vxgedev *vdev) | 111 | static inline void VXGE_COMPLETE_ALL_TX(struct vxgedev *vdev) |
| @@ -283,6 +286,7 @@ vxge_rx_alloc(void *dtrh, struct vxge_ring *ring, const int skb_size) | |||
| 283 | skb_reserve(skb, VXGE_HW_HEADER_ETHERNET_II_802_3_ALIGN); | 286 | skb_reserve(skb, VXGE_HW_HEADER_ETHERNET_II_802_3_ALIGN); |
| 284 | 287 | ||
| 285 | rx_priv->skb = skb; | 288 | rx_priv->skb = skb; |
| 289 | rx_priv->skb_data = NULL; | ||
| 286 | rx_priv->data_size = skb_size; | 290 | rx_priv->data_size = skb_size; |
| 287 | vxge_debug_entryexit(VXGE_TRACE, | 291 | vxge_debug_entryexit(VXGE_TRACE, |
| 288 | "%s: %s:%d Exiting...", ring->ndev->name, __func__, __LINE__); | 292 | "%s: %s:%d Exiting...", ring->ndev->name, __func__, __LINE__); |
| @@ -302,7 +306,8 @@ static int vxge_rx_map(void *dtrh, struct vxge_ring *ring) | |||
| 302 | ring->ndev->name, __func__, __LINE__); | 306 | ring->ndev->name, __func__, __LINE__); |
| 303 | rx_priv = vxge_hw_ring_rxd_private_get(dtrh); | 307 | rx_priv = vxge_hw_ring_rxd_private_get(dtrh); |
| 304 | 308 | ||
| 305 | dma_addr = pci_map_single(ring->pdev, rx_priv->skb->data, | 309 | rx_priv->skb_data = rx_priv->skb->data; |
| 310 | dma_addr = pci_map_single(ring->pdev, rx_priv->skb_data, | ||
| 306 | rx_priv->data_size, PCI_DMA_FROMDEVICE); | 311 | rx_priv->data_size, PCI_DMA_FROMDEVICE); |
| 307 | 312 | ||
| 308 | if (dma_addr == 0) { | 313 | if (dma_addr == 0) { |
| @@ -442,10 +447,12 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | |||
| 442 | vxge_hw_ring_replenish(ringh, 0); | 447 | vxge_hw_ring_replenish(ringh, 0); |
| 443 | 448 | ||
| 444 | do { | 449 | do { |
| 450 | prefetch((char *)dtr + L1_CACHE_BYTES); | ||
| 445 | rx_priv = vxge_hw_ring_rxd_private_get(dtr); | 451 | rx_priv = vxge_hw_ring_rxd_private_get(dtr); |
| 446 | skb = rx_priv->skb; | 452 | skb = rx_priv->skb; |
| 447 | data_size = rx_priv->data_size; | 453 | data_size = rx_priv->data_size; |
| 448 | data_dma = rx_priv->data_dma; | 454 | data_dma = rx_priv->data_dma; |
| 455 | prefetch(rx_priv->skb_data); | ||
| 449 | 456 | ||
| 450 | vxge_debug_rx(VXGE_TRACE, | 457 | vxge_debug_rx(VXGE_TRACE, |
| 451 | "%s: %s:%d skb = 0x%p", | 458 | "%s: %s:%d skb = 0x%p", |
| @@ -600,11 +607,10 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | |||
| 600 | enum vxge_hw_status | 607 | enum vxge_hw_status |
| 601 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | 608 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, |
| 602 | enum vxge_hw_fifo_tcode t_code, void *userdata, | 609 | enum vxge_hw_fifo_tcode t_code, void *userdata, |
| 603 | void **skb_ptr) | 610 | struct sk_buff ***skb_ptr, int nr_skb, int *more) |
| 604 | { | 611 | { |
| 605 | struct vxge_fifo *fifo = (struct vxge_fifo *)userdata; | 612 | struct vxge_fifo *fifo = (struct vxge_fifo *)userdata; |
| 606 | struct sk_buff *skb, *head = NULL; | 613 | struct sk_buff *skb, **done_skb = *skb_ptr; |
| 607 | struct sk_buff **temp; | ||
| 608 | int pkt_cnt = 0; | 614 | int pkt_cnt = 0; |
| 609 | 615 | ||
| 610 | vxge_debug_entryexit(VXGE_TRACE, | 616 | vxge_debug_entryexit(VXGE_TRACE, |
| @@ -657,9 +663,12 @@ vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | |||
| 657 | fifo->stats.tx_frms++; | 663 | fifo->stats.tx_frms++; |
| 658 | fifo->stats.tx_bytes += skb->len; | 664 | fifo->stats.tx_bytes += skb->len; |
| 659 | 665 | ||
| 660 | temp = (struct sk_buff **)&skb->cb; | 666 | *done_skb++ = skb; |
| 661 | *temp = head; | 667 | |
| 662 | head = skb; | 668 | if (--nr_skb <= 0) { |
| 669 | *more = 1; | ||
| 670 | break; | ||
| 671 | } | ||
| 663 | 672 | ||
| 664 | pkt_cnt++; | 673 | pkt_cnt++; |
| 665 | if (pkt_cnt > fifo->indicate_max_pkts) | 674 | if (pkt_cnt > fifo->indicate_max_pkts) |
| @@ -668,11 +677,9 @@ vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | |||
| 668 | } while (vxge_hw_fifo_txdl_next_completed(fifo_hw, | 677 | } while (vxge_hw_fifo_txdl_next_completed(fifo_hw, |
| 669 | &dtr, &t_code) == VXGE_HW_OK); | 678 | &dtr, &t_code) == VXGE_HW_OK); |
| 670 | 679 | ||
| 680 | *skb_ptr = done_skb; | ||
| 671 | vxge_wake_tx_queue(fifo, skb); | 681 | vxge_wake_tx_queue(fifo, skb); |
| 672 | 682 | ||
| 673 | if (skb_ptr) | ||
| 674 | *skb_ptr = (void *) head; | ||
| 675 | |||
| 676 | vxge_debug_entryexit(VXGE_TRACE, | 683 | vxge_debug_entryexit(VXGE_TRACE, |
| 677 | "%s: %s:%d Exiting...", | 684 | "%s: %s:%d Exiting...", |
| 678 | fifo->ndev->name, __func__, __LINE__); | 685 | fifo->ndev->name, __func__, __LINE__); |
| @@ -895,6 +902,12 @@ vxge_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 895 | goto _exit2; | 902 | goto _exit2; |
| 896 | } | 903 | } |
| 897 | 904 | ||
| 905 | /* Last TXD? Stop tx queue to avoid dropping packets. TX | ||
| 906 | * completion will resume the queue. | ||
| 907 | */ | ||
| 908 | if (avail == 1) | ||
| 909 | vxge_stop_tx_queue(fifo); | ||
| 910 | |||
| 898 | status = vxge_hw_fifo_txdl_reserve(fifo_hw, &dtr, &dtr_priv); | 911 | status = vxge_hw_fifo_txdl_reserve(fifo_hw, &dtr, &dtr_priv); |
| 899 | if (unlikely(status != VXGE_HW_OK)) { | 912 | if (unlikely(status != VXGE_HW_OK)) { |
| 900 | vxge_debug_tx(VXGE_ERR, | 913 | vxge_debug_tx(VXGE_ERR, |
| @@ -1046,6 +1059,7 @@ vxge_rx_term(void *dtrh, enum vxge_hw_rxd_state state, void *userdata) | |||
| 1046 | rx_priv->data_size, PCI_DMA_FROMDEVICE); | 1059 | rx_priv->data_size, PCI_DMA_FROMDEVICE); |
| 1047 | 1060 | ||
| 1048 | dev_kfree_skb(rx_priv->skb); | 1061 | dev_kfree_skb(rx_priv->skb); |
| 1062 | rx_priv->skb_data = NULL; | ||
| 1049 | 1063 | ||
| 1050 | vxge_debug_entryexit(VXGE_TRACE, | 1064 | vxge_debug_entryexit(VXGE_TRACE, |
| 1051 | "%s: %s:%d Exiting...", | 1065 | "%s: %s:%d Exiting...", |
diff --git a/drivers/net/vxge/vxge-main.h b/drivers/net/vxge/vxge-main.h index 18d824c3ab93..9c36b3a9a63d 100644 --- a/drivers/net/vxge/vxge-main.h +++ b/drivers/net/vxge/vxge-main.h | |||
| @@ -378,6 +378,7 @@ struct vxgedev { | |||
| 378 | 378 | ||
| 379 | struct vxge_rx_priv { | 379 | struct vxge_rx_priv { |
| 380 | struct sk_buff *skb; | 380 | struct sk_buff *skb; |
| 381 | unsigned char *skb_data; | ||
| 381 | dma_addr_t data_dma; | 382 | dma_addr_t data_dma; |
| 382 | dma_addr_t data_size; | 383 | dma_addr_t data_size; |
| 383 | }; | 384 | }; |
| @@ -428,7 +429,8 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr, | |||
| 428 | 429 | ||
| 429 | enum vxge_hw_status | 430 | enum vxge_hw_status |
| 430 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, | 431 | vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr, |
| 431 | enum vxge_hw_fifo_tcode t_code, void *userdata, void **skb_ptr); | 432 | enum vxge_hw_fifo_tcode t_code, void *userdata, |
| 433 | struct sk_buff ***skb_ptr, int nr_skbs, int *more); | ||
| 432 | 434 | ||
| 433 | int vxge_close(struct net_device *dev); | 435 | int vxge_close(struct net_device *dev); |
| 434 | 436 | ||
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index 370f55cbbad7..fe3ae518c69c 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
| @@ -731,6 +731,7 @@ vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel, void **dtrh) | |||
| 731 | vxge_assert(channel->compl_index < channel->length); | 731 | vxge_assert(channel->compl_index < channel->length); |
| 732 | 732 | ||
| 733 | *dtrh = channel->work_arr[channel->compl_index]; | 733 | *dtrh = channel->work_arr[channel->compl_index]; |
| 734 | prefetch(*dtrh); | ||
| 734 | } | 735 | } |
| 735 | 736 | ||
| 736 | /* | 737 | /* |
| @@ -1070,11 +1071,11 @@ static void __vxge_hw_non_offload_db_post(struct __vxge_hw_fifo *fifo, | |||
| 1070 | VXGE_HW_NODBW_GET_NO_SNOOP(no_snoop), | 1071 | VXGE_HW_NODBW_GET_NO_SNOOP(no_snoop), |
| 1071 | &fifo->nofl_db->control_0); | 1072 | &fifo->nofl_db->control_0); |
| 1072 | 1073 | ||
| 1073 | wmb(); | 1074 | mmiowb(); |
| 1074 | 1075 | ||
| 1075 | writeq(txdl_ptr, &fifo->nofl_db->txdl_ptr); | 1076 | writeq(txdl_ptr, &fifo->nofl_db->txdl_ptr); |
| 1076 | wmb(); | ||
| 1077 | 1077 | ||
| 1078 | mmiowb(); | ||
| 1078 | } | 1079 | } |
| 1079 | 1080 | ||
| 1080 | /** | 1081 | /** |
| @@ -2508,7 +2509,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_rx(struct __vxge_hw_ring *ring) | |||
| 2508 | * See also: vxge_hw_vpath_poll_tx(). | 2509 | * See also: vxge_hw_vpath_poll_tx(). |
| 2509 | */ | 2510 | */ |
| 2510 | enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo, | 2511 | enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo, |
| 2511 | void **skb_ptr) | 2512 | struct sk_buff ***skb_ptr, int nr_skb, |
| 2513 | int *more) | ||
| 2512 | { | 2514 | { |
| 2513 | enum vxge_hw_fifo_tcode t_code; | 2515 | enum vxge_hw_fifo_tcode t_code; |
| 2514 | void *first_txdlh; | 2516 | void *first_txdlh; |
| @@ -2520,8 +2522,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo, | |||
| 2520 | status = vxge_hw_fifo_txdl_next_completed(fifo, | 2522 | status = vxge_hw_fifo_txdl_next_completed(fifo, |
| 2521 | &first_txdlh, &t_code); | 2523 | &first_txdlh, &t_code); |
| 2522 | if (status == VXGE_HW_OK) | 2524 | if (status == VXGE_HW_OK) |
| 2523 | if (fifo->callback(fifo, first_txdlh, | 2525 | if (fifo->callback(fifo, first_txdlh, t_code, |
| 2524 | t_code, channel->userdata, skb_ptr) != VXGE_HW_OK) | 2526 | channel->userdata, skb_ptr, nr_skb, more) != VXGE_HW_OK) |
| 2525 | status = VXGE_HW_COMPLETIONS_REMAIN; | 2527 | status = VXGE_HW_COMPLETIONS_REMAIN; |
| 2526 | 2528 | ||
| 2527 | return status; | 2529 | return status; |
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h index 8260b91fd795..461742b4442b 100644 --- a/drivers/net/vxge/vxge-traffic.h +++ b/drivers/net/vxge/vxge-traffic.h | |||
| @@ -2326,7 +2326,7 @@ enum vxge_hw_status vxge_hw_vpath_poll_rx( | |||
| 2326 | 2326 | ||
| 2327 | enum vxge_hw_status vxge_hw_vpath_poll_tx( | 2327 | enum vxge_hw_status vxge_hw_vpath_poll_tx( |
| 2328 | struct __vxge_hw_fifo *fifoh, | 2328 | struct __vxge_hw_fifo *fifoh, |
| 2329 | void **skb_ptr); | 2329 | struct sk_buff ***skb_ptr, int nr_skb, int *more); |
| 2330 | 2330 | ||
| 2331 | enum vxge_hw_status vxge_hw_vpath_alarm_process( | 2331 | enum vxge_hw_status vxge_hw_vpath_alarm_process( |
| 2332 | struct __vxge_hw_vpath_handle *vpath_handle, | 2332 | struct __vxge_hw_vpath_handle *vpath_handle, |
diff --git a/drivers/net/vxge/vxge-version.h b/drivers/net/vxge/vxge-version.h index 580c6eb077b9..8fbce7552035 100644 --- a/drivers/net/vxge/vxge-version.h +++ b/drivers/net/vxge/vxge-version.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #define VXGE_VERSION_MAJOR "2" | 18 | #define VXGE_VERSION_MAJOR "2" |
| 19 | #define VXGE_VERSION_MINOR "0" | 19 | #define VXGE_VERSION_MINOR "0" |
| 20 | #define VXGE_VERSION_FIX "4" | 20 | #define VXGE_VERSION_FIX "5" |
| 21 | #define VXGE_VERSION_BUILD "17899" | 21 | #define VXGE_VERSION_BUILD "18053" |
| 22 | #define VXGE_VERSION_FOR "k" | 22 | #define VXGE_VERSION_FOR "k" |
| 23 | #endif | 23 | #endif |
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h index 5d79e409241c..538991cef6f0 100644 --- a/include/asm-generic/socket.h +++ b/include/asm-generic/socket.h | |||
| @@ -60,4 +60,7 @@ | |||
| 60 | #define SO_TIMESTAMPING 37 | 60 | #define SO_TIMESTAMPING 37 |
| 61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 62 | 62 | ||
| 63 | #define SO_PROTOCOL 38 | ||
| 64 | #define SO_DOMAIN 39 | ||
| 65 | |||
| 63 | #endif /* __ASM_GENERIC_SOCKET_H */ | 66 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 1c8ee1b13651..98978e73f666 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -738,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void); | |||
| 738 | extern void ip_vs_protocol_timeout_change(int flags); | 738 | extern void ip_vs_protocol_timeout_change(int flags); |
| 739 | extern int *ip_vs_create_timeout_table(int *table, int size); | 739 | extern int *ip_vs_create_timeout_table(int *table, int size); |
| 740 | extern int | 740 | extern int |
| 741 | ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to); | 741 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| 742 | const char *name, int to); | ||
| 742 | extern void | 743 | extern void |
| 743 | ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, | 744 | ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, |
| 744 | int offset, const char *msg); | 745 | int offset, const char *msg); |
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h index c290447872d1..bc0c6f31f1c6 100644 --- a/include/net/irda/ircomm_event.h +++ b/include/net/irda/ircomm_event.h | |||
| @@ -74,7 +74,7 @@ struct ircomm_info { | |||
| 74 | struct qos_info *qos; | 74 | struct qos_info *qos; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | extern char *ircomm_state[]; | 77 | extern const char *const ircomm_state[]; |
| 78 | 78 | ||
| 79 | struct ircomm_cb; /* Forward decl. */ | 79 | struct ircomm_cb; /* Forward decl. */ |
| 80 | 80 | ||
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h index f91a5695aa44..0a63bbb972d7 100644 --- a/include/net/irda/ircomm_tty_attach.h +++ b/include/net/irda/ircomm_tty_attach.h | |||
| @@ -66,8 +66,8 @@ struct ircomm_tty_info { | |||
| 66 | __u8 dlsap_sel; | 66 | __u8 dlsap_sel; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | extern char *ircomm_state[]; | 69 | extern const char *const ircomm_state[]; |
| 70 | extern char *ircomm_tty_state[]; | 70 | extern const char *const ircomm_tty_state[]; |
| 71 | 71 | ||
| 72 | int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, | 72 | int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, |
| 73 | struct sk_buff *skb, struct ircomm_tty_info *info); | 73 | struct sk_buff *skb, struct ircomm_tty_info *info); |
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h index 2ae2e119ef4b..4c90824c50fb 100644 --- a/include/net/irda/irlap_event.h +++ b/include/net/irda/irlap_event.h | |||
| @@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */ | |||
| 120 | LAP_PRIMARY_CONFLICT, | 120 | LAP_PRIMARY_CONFLICT, |
| 121 | } LAP_REASON; | 121 | } LAP_REASON; |
| 122 | 122 | ||
| 123 | extern const char *irlap_state[]; | 123 | extern const char *const irlap_state[]; |
| 124 | 124 | ||
| 125 | void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, | 125 | void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, |
| 126 | struct sk_buff *skb, struct irlap_info *info); | 126 | struct sk_buff *skb, struct irlap_info *info); |
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h index e03ae4ae3963..9e4ec17a7449 100644 --- a/include/net/irda/irlmp_event.h +++ b/include/net/irda/irlmp_event.h | |||
| @@ -79,8 +79,8 @@ typedef enum { | |||
| 79 | LM_LAP_IDLE_TIMEOUT, | 79 | LM_LAP_IDLE_TIMEOUT, |
| 80 | } IRLMP_EVENT; | 80 | } IRLMP_EVENT; |
| 81 | 81 | ||
| 82 | extern const char *irlmp_state[]; | 82 | extern const char *const irlmp_state[]; |
| 83 | extern const char *irlsap_state[]; | 83 | extern const char *const irlsap_state[]; |
| 84 | 84 | ||
| 85 | void irlmp_watchdog_timer_expired(void *data); | 85 | void irlmp_watchdog_timer_expired(void *data); |
| 86 | void irlmp_discovery_timer_expired(void *data); | 86 | void irlmp_discovery_timer_expired(void *data); |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index b05b0557211f..8bc25f7b04ce 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t); /* timeouts */ | |||
| 241 | const char *sctp_pname(const sctp_subtype_t); /* primitives */ | 241 | const char *sctp_pname(const sctp_subtype_t); /* primitives */ |
| 242 | 242 | ||
| 243 | /* This is a table of printable names of sctp_state_t's. */ | 243 | /* This is a table of printable names of sctp_state_t's. */ |
| 244 | extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[]; | 244 | extern const char *const sctp_state_tbl[]; |
| 245 | extern const char *const sctp_evttype_tbl[]; | ||
| 246 | extern const char *const sctp_status_tbl[]; | ||
| 245 | 247 | ||
| 246 | /* Maximum chunk length considering padding requirements. */ | 248 | /* Maximum chunk length considering padding requirements. */ |
| 247 | enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; | 249 | enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; |
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index b55a091a33df..6262c335f3c2 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
| @@ -107,7 +107,7 @@ static const struct file_operations vlandev_fops = { | |||
| 107 | */ | 107 | */ |
| 108 | 108 | ||
| 109 | /* Strings */ | 109 | /* Strings */ |
| 110 | static const char *vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = { | 110 | static const char *const vlan_name_type_str[VLAN_NAME_TYPE_HIGHEST] = { |
| 111 | [VLAN_NAME_TYPE_RAW_PLUS_VID] = "VLAN_NAME_TYPE_RAW_PLUS_VID", | 111 | [VLAN_NAME_TYPE_RAW_PLUS_VID] = "VLAN_NAME_TYPE_RAW_PLUS_VID", |
| 112 | [VLAN_NAME_TYPE_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_PLUS_VID_NO_PAD", | 112 | [VLAN_NAME_TYPE_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_PLUS_VID_NO_PAD", |
| 113 | [VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD", | 113 | [VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD] = "VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD", |
diff --git a/net/atm/lec.c b/net/atm/lec.c index c463868c993b..8e723c2654cb 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
| @@ -935,9 +935,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg) | |||
| 935 | } | 935 | } |
| 936 | 936 | ||
| 937 | #ifdef CONFIG_PROC_FS | 937 | #ifdef CONFIG_PROC_FS |
| 938 | static char *lec_arp_get_status_string(unsigned char status) | 938 | static const char *lec_arp_get_status_string(unsigned char status) |
| 939 | { | 939 | { |
| 940 | static char *lec_arp_status_string[] = { | 940 | static const char *const lec_arp_status_string[] = { |
| 941 | "ESI_UNKNOWN ", | 941 | "ESI_UNKNOWN ", |
| 942 | "ESI_ARP_PENDING ", | 942 | "ESI_ARP_PENDING ", |
| 943 | "ESI_VC_PENDING ", | 943 | "ESI_VC_PENDING ", |
| @@ -1121,7 +1121,8 @@ static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
| 1121 | 1121 | ||
| 1122 | static int lec_seq_show(struct seq_file *seq, void *v) | 1122 | static int lec_seq_show(struct seq_file *seq, void *v) |
| 1123 | { | 1123 | { |
| 1124 | static char lec_banner[] = "Itf MAC ATM destination" | 1124 | static const char lec_banner[] = |
| 1125 | "Itf MAC ATM destination" | ||
| 1125 | " Status Flags " | 1126 | " Status Flags " |
| 1126 | "VPI/VCI Recv VPI/VCI\n"; | 1127 | "VPI/VCI Recv VPI/VCI\n"; |
| 1127 | 1128 | ||
| @@ -1505,7 +1506,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) | |||
| 1505 | } | 1506 | } |
| 1506 | 1507 | ||
| 1507 | #if DEBUG_ARP_TABLE | 1508 | #if DEBUG_ARP_TABLE |
| 1508 | static char *get_status_string(unsigned char st) | 1509 | static const char *get_status_string(unsigned char st) |
| 1509 | { | 1510 | { |
| 1510 | switch (st) { | 1511 | switch (st) { |
| 1511 | case ESI_UNKNOWN: | 1512 | case ESI_UNKNOWN: |
diff --git a/net/atm/proc.c b/net/atm/proc.c index 38de5ff61ecd..ab8419a324b6 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c | |||
| @@ -151,8 +151,9 @@ static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
| 151 | 151 | ||
| 152 | static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) | 152 | static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) |
| 153 | { | 153 | { |
| 154 | static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" }; | 154 | static const char *const class_name[] = |
| 155 | static const char *aal_name[] = { | 155 | {"off","UBR","CBR","VBR","ABR"}; |
| 156 | static const char *const aal_name[] = { | ||
| 156 | "---", "1", "2", "3/4", /* 0- 3 */ | 157 | "---", "1", "2", "3/4", /* 0- 3 */ |
| 157 | "???", "5", "???", "???", /* 4- 7 */ | 158 | "???", "5", "???", "???", /* 4- 7 */ |
| 158 | "???", "???", "???", "???", /* 8-11 */ | 159 | "???", "???", "???", "???", /* 8-11 */ |
| @@ -178,7 +179,7 @@ static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) | |||
| 178 | 179 | ||
| 179 | static const char *vcc_state(struct atm_vcc *vcc) | 180 | static const char *vcc_state(struct atm_vcc *vcc) |
| 180 | { | 181 | { |
| 181 | static const char *map[] = { ATM_VS2TXT_MAP }; | 182 | static const char *const map[] = { ATM_VS2TXT_MAP }; |
| 182 | 183 | ||
| 183 | return map[ATM_VF2VS(vcc->flags)]; | 184 | return map[ATM_VF2VS(vcc->flags)]; |
| 184 | } | 185 | } |
| @@ -335,7 +336,7 @@ static const struct file_operations vcc_seq_fops = { | |||
| 335 | 336 | ||
| 336 | static int svc_seq_show(struct seq_file *seq, void *v) | 337 | static int svc_seq_show(struct seq_file *seq, void *v) |
| 337 | { | 338 | { |
| 338 | static char atm_svc_banner[] = | 339 | static const char atm_svc_banner[] = |
| 339 | "Itf VPI VCI State Remote\n"; | 340 | "Itf VPI VCI State Remote\n"; |
| 340 | 341 | ||
| 341 | if (v == SEQ_START_TOKEN) | 342 | if (v == SEQ_START_TOKEN) |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 0250e0600150..8cfb5a849841 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
| @@ -49,7 +49,7 @@ static struct net_proto_family *bt_proto[BT_MAX_PROTO]; | |||
| 49 | static DEFINE_RWLOCK(bt_proto_lock); | 49 | static DEFINE_RWLOCK(bt_proto_lock); |
| 50 | 50 | ||
| 51 | static struct lock_class_key bt_lock_key[BT_MAX_PROTO]; | 51 | static struct lock_class_key bt_lock_key[BT_MAX_PROTO]; |
| 52 | static const char *bt_key_strings[BT_MAX_PROTO] = { | 52 | static const char *const bt_key_strings[BT_MAX_PROTO] = { |
| 53 | "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP", | 53 | "sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP", |
| 54 | "sk_lock-AF_BLUETOOTH-BTPROTO_HCI", | 54 | "sk_lock-AF_BLUETOOTH-BTPROTO_HCI", |
| 55 | "sk_lock-AF_BLUETOOTH-BTPROTO_SCO", | 55 | "sk_lock-AF_BLUETOOTH-BTPROTO_SCO", |
| @@ -61,7 +61,7 @@ static const char *bt_key_strings[BT_MAX_PROTO] = { | |||
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static struct lock_class_key bt_slock_key[BT_MAX_PROTO]; | 63 | static struct lock_class_key bt_slock_key[BT_MAX_PROTO]; |
| 64 | static const char *bt_slock_key_strings[BT_MAX_PROTO] = { | 64 | static const char *const bt_slock_key_strings[BT_MAX_PROTO] = { |
| 65 | "slock-AF_BLUETOOTH-BTPROTO_L2CAP", | 65 | "slock-AF_BLUETOOTH-BTPROTO_L2CAP", |
| 66 | "slock-AF_BLUETOOTH-BTPROTO_HCI", | 66 | "slock-AF_BLUETOOTH-BTPROTO_HCI", |
| 67 | "slock-AF_BLUETOOTH-BTPROTO_SCO", | 67 | "slock-AF_BLUETOOTH-BTPROTO_SCO", |
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index 0660515f3992..fd3f8d6c0998 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | #define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256)) | 22 | #define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256)) |
| 23 | 23 | ||
| 24 | static const char *br_port_state_names[] = { | 24 | static const char *const br_port_state_names[] = { |
| 25 | [BR_STATE_DISABLED] = "disabled", | 25 | [BR_STATE_DISABLED] = "disabled", |
| 26 | [BR_STATE_LISTENING] = "listening", | 26 | [BR_STATE_LISTENING] = "listening", |
| 27 | [BR_STATE_LEARNING] = "learning", | 27 | [BR_STATE_LEARNING] = "learning", |
diff --git a/net/core/dev.c b/net/core/dev.c index 71347668c506..f01a9c41f112 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -272,7 +272,7 @@ static const unsigned short netdev_lock_type[] = | |||
| 272 | ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY, | 272 | ARPHRD_PHONET_PIPE, ARPHRD_IEEE802154, ARPHRD_IEEE802154_PHY, |
| 273 | ARPHRD_VOID, ARPHRD_NONE}; | 273 | ARPHRD_VOID, ARPHRD_NONE}; |
| 274 | 274 | ||
| 275 | static const char *netdev_lock_name[] = | 275 | static const char *const netdev_lock_name[] = |
| 276 | {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25", | 276 | {"_xmit_NETROM", "_xmit_ETHER", "_xmit_EETHER", "_xmit_AX25", |
| 277 | "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET", | 277 | "_xmit_PRONET", "_xmit_CHAOS", "_xmit_IEEE802", "_xmit_ARCNET", |
| 278 | "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM", | 278 | "_xmit_APPLETLK", "_xmit_DLCI", "_xmit_ATM", "_xmit_METRICOM", |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 3994680c08b9..ad91e9e5f475 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -141,7 +141,7 @@ static ssize_t show_dormant(struct device *dev, | |||
| 141 | return -EINVAL; | 141 | return -EINVAL; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | static const char *operstates[] = { | 144 | static const char *const operstates[] = { |
| 145 | "unknown", | 145 | "unknown", |
| 146 | "notpresent", /* currently unused */ | 146 | "notpresent", /* currently unused */ |
| 147 | "down", | 147 | "down", |
diff --git a/net/core/sock.c b/net/core/sock.c index bbb25be7ddfe..3ac34ea6ec05 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -142,7 +142,7 @@ static struct lock_class_key af_family_slock_keys[AF_MAX]; | |||
| 142 | * strings build-time, so that runtime initialization of socket | 142 | * strings build-time, so that runtime initialization of socket |
| 143 | * locks is fast): | 143 | * locks is fast): |
| 144 | */ | 144 | */ |
| 145 | static const char *af_family_key_strings[AF_MAX+1] = { | 145 | static const char *const af_family_key_strings[AF_MAX+1] = { |
| 146 | "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX" , "sk_lock-AF_INET" , | 146 | "sk_lock-AF_UNSPEC", "sk_lock-AF_UNIX" , "sk_lock-AF_INET" , |
| 147 | "sk_lock-AF_AX25" , "sk_lock-AF_IPX" , "sk_lock-AF_APPLETALK", | 147 | "sk_lock-AF_AX25" , "sk_lock-AF_IPX" , "sk_lock-AF_APPLETALK", |
| 148 | "sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE" , "sk_lock-AF_ATMPVC" , | 148 | "sk_lock-AF_NETROM", "sk_lock-AF_BRIDGE" , "sk_lock-AF_ATMPVC" , |
| @@ -158,7 +158,7 @@ static const char *af_family_key_strings[AF_MAX+1] = { | |||
| 158 | "sk_lock-AF_IEEE802154", | 158 | "sk_lock-AF_IEEE802154", |
| 159 | "sk_lock-AF_MAX" | 159 | "sk_lock-AF_MAX" |
| 160 | }; | 160 | }; |
| 161 | static const char *af_family_slock_key_strings[AF_MAX+1] = { | 161 | static const char *const af_family_slock_key_strings[AF_MAX+1] = { |
| 162 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , | 162 | "slock-AF_UNSPEC", "slock-AF_UNIX" , "slock-AF_INET" , |
| 163 | "slock-AF_AX25" , "slock-AF_IPX" , "slock-AF_APPLETALK", | 163 | "slock-AF_AX25" , "slock-AF_IPX" , "slock-AF_APPLETALK", |
| 164 | "slock-AF_NETROM", "slock-AF_BRIDGE" , "slock-AF_ATMPVC" , | 164 | "slock-AF_NETROM", "slock-AF_BRIDGE" , "slock-AF_ATMPVC" , |
| @@ -174,7 +174,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = { | |||
| 174 | "slock-AF_IEEE802154", | 174 | "slock-AF_IEEE802154", |
| 175 | "slock-AF_MAX" | 175 | "slock-AF_MAX" |
| 176 | }; | 176 | }; |
| 177 | static const char *af_family_clock_key_strings[AF_MAX+1] = { | 177 | static const char *const af_family_clock_key_strings[AF_MAX+1] = { |
| 178 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , | 178 | "clock-AF_UNSPEC", "clock-AF_UNIX" , "clock-AF_INET" , |
| 179 | "clock-AF_AX25" , "clock-AF_IPX" , "clock-AF_APPLETALK", | 179 | "clock-AF_AX25" , "clock-AF_IPX" , "clock-AF_APPLETALK", |
| 180 | "clock-AF_NETROM", "clock-AF_BRIDGE" , "clock-AF_ATMPVC" , | 180 | "clock-AF_NETROM", "clock-AF_BRIDGE" , "clock-AF_ATMPVC" , |
| @@ -482,6 +482,8 @@ int sock_setsockopt(struct socket *sock, int level, int optname, | |||
| 482 | sk->sk_reuse = valbool; | 482 | sk->sk_reuse = valbool; |
| 483 | break; | 483 | break; |
| 484 | case SO_TYPE: | 484 | case SO_TYPE: |
| 485 | case SO_PROTOCOL: | ||
| 486 | case SO_DOMAIN: | ||
| 485 | case SO_ERROR: | 487 | case SO_ERROR: |
| 486 | ret = -ENOPROTOOPT; | 488 | ret = -ENOPROTOOPT; |
| 487 | break; | 489 | break; |
| @@ -764,6 +766,14 @@ int sock_getsockopt(struct socket *sock, int level, int optname, | |||
| 764 | v.val = sk->sk_type; | 766 | v.val = sk->sk_type; |
| 765 | break; | 767 | break; |
| 766 | 768 | ||
| 769 | case SO_PROTOCOL: | ||
| 770 | v.val = sk->sk_protocol; | ||
| 771 | break; | ||
| 772 | |||
| 773 | case SO_DOMAIN: | ||
| 774 | v.val = sk->sk_family; | ||
| 775 | break; | ||
| 776 | |||
| 767 | case SO_ERROR: | 777 | case SO_ERROR: |
| 768 | v.val = -sock_error(sk); | 778 | v.val = -sock_error(sk); |
| 769 | if (v.val == 0) | 779 | if (v.val == 0) |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index a27b7f4c19c5..f596ce149c3c 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
| @@ -52,7 +52,7 @@ static int ccid3_debug; | |||
| 52 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 52 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
| 53 | static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state) | 53 | static const char *ccid3_tx_state_name(enum ccid3_hc_tx_states state) |
| 54 | { | 54 | { |
| 55 | static char *ccid3_state_names[] = { | 55 | static const char *const ccid3_state_names[] = { |
| 56 | [TFRC_SSTATE_NO_SENT] = "NO_SENT", | 56 | [TFRC_SSTATE_NO_SENT] = "NO_SENT", |
| 57 | [TFRC_SSTATE_NO_FBACK] = "NO_FBACK", | 57 | [TFRC_SSTATE_NO_FBACK] = "NO_FBACK", |
| 58 | [TFRC_SSTATE_FBACK] = "FBACK", | 58 | [TFRC_SSTATE_FBACK] = "FBACK", |
| @@ -646,7 +646,7 @@ enum ccid3_fback_type { | |||
| 646 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 646 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
| 647 | static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state) | 647 | static const char *ccid3_rx_state_name(enum ccid3_hc_rx_states state) |
| 648 | { | 648 | { |
| 649 | static char *ccid3_rx_state_names[] = { | 649 | static const char *const ccid3_rx_state_names[] = { |
| 650 | [TFRC_RSTATE_NO_DATA] = "NO_DATA", | 650 | [TFRC_RSTATE_NO_DATA] = "NO_DATA", |
| 651 | [TFRC_RSTATE_DATA] = "DATA", | 651 | [TFRC_RSTATE_DATA] = "DATA", |
| 652 | [TFRC_RSTATE_TERM] = "TERM", | 652 | [TFRC_RSTATE_TERM] = "TERM", |
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index b04160a2eea5..972b8dc918d6 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
| @@ -213,7 +213,7 @@ static int dccp_feat_default_value(u8 feat_num) | |||
| 213 | */ | 213 | */ |
| 214 | static const char *dccp_feat_fname(const u8 feat) | 214 | static const char *dccp_feat_fname(const u8 feat) |
| 215 | { | 215 | { |
| 216 | static const char *feature_names[] = { | 216 | static const char *const feature_names[] = { |
| 217 | [DCCPF_RESERVED] = "Reserved", | 217 | [DCCPF_RESERVED] = "Reserved", |
| 218 | [DCCPF_CCID] = "CCID", | 218 | [DCCPF_CCID] = "CCID", |
| 219 | [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos", | 219 | [DCCPF_SHORT_SEQNOS] = "Allow Short Seqnos", |
| @@ -236,8 +236,9 @@ static const char *dccp_feat_fname(const u8 feat) | |||
| 236 | return feature_names[feat]; | 236 | return feature_names[feat]; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| 239 | static const char *dccp_feat_sname[] = { "DEFAULT", "INITIALISING", "CHANGING", | 239 | static const char *const dccp_feat_sname[] = { |
| 240 | "UNSTABLE", "STABLE" }; | 240 | "DEFAULT", "INITIALISING", "CHANGING", "UNSTABLE", "STABLE", |
| 241 | }; | ||
| 241 | 242 | ||
| 242 | #ifdef CONFIG_IP_DCCP_DEBUG | 243 | #ifdef CONFIG_IP_DCCP_DEBUG |
| 243 | static const char *dccp_feat_oname(const u8 opt) | 244 | static const char *dccp_feat_oname(const u8 opt) |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 94ca8eaace7d..37b3b4293ef4 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(dccp_done); | |||
| 124 | 124 | ||
| 125 | const char *dccp_packet_name(const int type) | 125 | const char *dccp_packet_name(const int type) |
| 126 | { | 126 | { |
| 127 | static const char *dccp_packet_names[] = { | 127 | static const char *const dccp_packet_names[] = { |
| 128 | [DCCP_PKT_REQUEST] = "REQUEST", | 128 | [DCCP_PKT_REQUEST] = "REQUEST", |
| 129 | [DCCP_PKT_RESPONSE] = "RESPONSE", | 129 | [DCCP_PKT_RESPONSE] = "RESPONSE", |
| 130 | [DCCP_PKT_DATA] = "DATA", | 130 | [DCCP_PKT_DATA] = "DATA", |
| @@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(dccp_packet_name); | |||
| 147 | 147 | ||
| 148 | const char *dccp_state_name(const int state) | 148 | const char *dccp_state_name(const int state) |
| 149 | { | 149 | { |
| 150 | static char *dccp_state_names[] = { | 150 | static const char *const dccp_state_names[] = { |
| 151 | [DCCP_OPEN] = "OPEN", | 151 | [DCCP_OPEN] = "OPEN", |
| 152 | [DCCP_REQUESTING] = "REQUESTING", | 152 | [DCCP_REQUESTING] = "REQUESTING", |
| 153 | [DCCP_PARTOPEN] = "PARTOPEN", | 153 | [DCCP_PARTOPEN] = "PARTOPEN", |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index d58b49115386..fe3c846b99a6 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
| @@ -2421,7 +2421,7 @@ static inline const char *rtn_scope(char *buf, size_t len, enum rt_scope_t s) | |||
| 2421 | } | 2421 | } |
| 2422 | } | 2422 | } |
| 2423 | 2423 | ||
| 2424 | static const char *rtn_type_names[__RTN_MAX] = { | 2424 | static const char *const rtn_type_names[__RTN_MAX] = { |
| 2425 | [RTN_UNSPEC] = "UNSPEC", | 2425 | [RTN_UNSPEC] = "UNSPEC", |
| 2426 | [RTN_UNICAST] = "UNICAST", | 2426 | [RTN_UNICAST] = "UNICAST", |
| 2427 | [RTN_LOCAL] = "LOCAL", | 2427 | [RTN_LOCAL] = "LOCAL", |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 1ba44742ebbf..74fb2eb833ec 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
| @@ -264,6 +264,7 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { | |||
| 264 | .fill_dst = xfrm4_fill_dst, | 264 | .fill_dst = xfrm4_fill_dst, |
| 265 | }; | 265 | }; |
| 266 | 266 | ||
| 267 | #ifdef CONFIG_SYSCTL | ||
| 267 | static struct ctl_table xfrm4_policy_table[] = { | 268 | static struct ctl_table xfrm4_policy_table[] = { |
| 268 | { | 269 | { |
| 269 | .ctl_name = CTL_UNNUMBERED, | 270 | .ctl_name = CTL_UNNUMBERED, |
| @@ -277,6 +278,7 @@ static struct ctl_table xfrm4_policy_table[] = { | |||
| 277 | }; | 278 | }; |
| 278 | 279 | ||
| 279 | static struct ctl_table_header *sysctl_hdr; | 280 | static struct ctl_table_header *sysctl_hdr; |
| 281 | #endif | ||
| 280 | 282 | ||
| 281 | static void __init xfrm4_policy_init(void) | 283 | static void __init xfrm4_policy_init(void) |
| 282 | { | 284 | { |
| @@ -285,8 +287,10 @@ static void __init xfrm4_policy_init(void) | |||
| 285 | 287 | ||
| 286 | static void __exit xfrm4_policy_fini(void) | 288 | static void __exit xfrm4_policy_fini(void) |
| 287 | { | 289 | { |
| 290 | #ifdef CONFIG_SYSCTL | ||
| 288 | if (sysctl_hdr) | 291 | if (sysctl_hdr) |
| 289 | unregister_net_sysctl_table(sysctl_hdr); | 292 | unregister_net_sysctl_table(sysctl_hdr); |
| 293 | #endif | ||
| 290 | xfrm_policy_unregister_afinfo(&xfrm4_policy_afinfo); | 294 | xfrm_policy_unregister_afinfo(&xfrm4_policy_afinfo); |
| 291 | } | 295 | } |
| 292 | 296 | ||
| @@ -305,7 +309,9 @@ void __init xfrm4_init(int rt_max_size) | |||
| 305 | * and start cleaning when were 1/2 full | 309 | * and start cleaning when were 1/2 full |
| 306 | */ | 310 | */ |
| 307 | xfrm4_dst_ops.gc_thresh = rt_max_size/2; | 311 | xfrm4_dst_ops.gc_thresh = rt_max_size/2; |
| 312 | #ifdef CONFIG_SYSCTL | ||
| 308 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, | 313 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv4_ctl_path, |
| 309 | xfrm4_policy_table); | 314 | xfrm4_policy_table); |
| 315 | #endif | ||
| 310 | } | 316 | } |
| 311 | 317 | ||
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index 590ddefb7ffc..c9605c3ad91f 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
| @@ -101,7 +101,7 @@ static struct snmp_mib snmp6_icmp6_list[] = { | |||
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | /* RFC 4293 v6 ICMPMsgStatsTable; named items for RFC 2466 compatibility */ | 103 | /* RFC 4293 v6 ICMPMsgStatsTable; named items for RFC 2466 compatibility */ |
| 104 | static char *icmp6type2name[256] = { | 104 | static const char *const icmp6type2name[256] = { |
| 105 | [ICMPV6_DEST_UNREACH] = "DestUnreachs", | 105 | [ICMPV6_DEST_UNREACH] = "DestUnreachs", |
| 106 | [ICMPV6_PKT_TOOBIG] = "PktTooBigs", | 106 | [ICMPV6_PKT_TOOBIG] = "PktTooBigs", |
| 107 | [ICMPV6_TIME_EXCEED] = "TimeExcds", | 107 | [ICMPV6_TIME_EXCEED] = "TimeExcds", |
| @@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) | |||
| 144 | /* print by name -- deprecated items */ | 144 | /* print by name -- deprecated items */ |
| 145 | for (i = 0; i < ICMP6MSG_MIB_MAX; i++) { | 145 | for (i = 0; i < ICMP6MSG_MIB_MAX; i++) { |
| 146 | int icmptype; | 146 | int icmptype; |
| 147 | char *p; | 147 | const char *p; |
| 148 | 148 | ||
| 149 | icmptype = i & 0xff; | 149 | icmptype = i & 0xff; |
| 150 | p = icmp6type2name[icmptype]; | 150 | p = icmp6type2name[icmptype]; |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 611cffcf554f..8ec3d45cd1d9 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
| @@ -306,6 +306,7 @@ static void xfrm6_policy_fini(void) | |||
| 306 | xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); | 306 | xfrm_policy_unregister_afinfo(&xfrm6_policy_afinfo); |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | #ifdef CONFIG_SYSCTL | ||
| 309 | static struct ctl_table xfrm6_policy_table[] = { | 310 | static struct ctl_table xfrm6_policy_table[] = { |
| 310 | { | 311 | { |
| 311 | .ctl_name = CTL_UNNUMBERED, | 312 | .ctl_name = CTL_UNNUMBERED, |
| @@ -319,6 +320,7 @@ static struct ctl_table xfrm6_policy_table[] = { | |||
| 319 | }; | 320 | }; |
| 320 | 321 | ||
| 321 | static struct ctl_table_header *sysctl_hdr; | 322 | static struct ctl_table_header *sysctl_hdr; |
| 323 | #endif | ||
| 322 | 324 | ||
| 323 | int __init xfrm6_init(void) | 325 | int __init xfrm6_init(void) |
| 324 | { | 326 | { |
| @@ -345,9 +347,10 @@ int __init xfrm6_init(void) | |||
| 345 | */ | 347 | */ |
| 346 | gc_thresh = FIB6_TABLE_HASHSZ * 8; | 348 | gc_thresh = FIB6_TABLE_HASHSZ * 8; |
| 347 | xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; | 349 | xfrm6_dst_ops.gc_thresh = (gc_thresh < 1024) ? 1024 : gc_thresh; |
| 348 | 350 | #ifdef CONFIG_SYSCTL | |
| 349 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, | 351 | sysctl_hdr = register_net_sysctl_table(&init_net, net_ipv6_ctl_path, |
| 350 | xfrm6_policy_table); | 352 | xfrm6_policy_table); |
| 353 | #endif | ||
| 351 | out: | 354 | out: |
| 352 | return ret; | 355 | return ret; |
| 353 | out_policy: | 356 | out_policy: |
| @@ -357,8 +360,10 @@ out_policy: | |||
| 357 | 360 | ||
| 358 | void xfrm6_fini(void) | 361 | void xfrm6_fini(void) |
| 359 | { | 362 | { |
| 363 | #ifdef CONFIG_SYSCTL | ||
| 360 | if (sysctl_hdr) | 364 | if (sysctl_hdr) |
| 361 | unregister_net_sysctl_table(sysctl_hdr); | 365 | unregister_net_sysctl_table(sysctl_hdr); |
| 366 | #endif | ||
| 362 | //xfrm6_input_fini(); | 367 | //xfrm6_input_fini(); |
| 363 | xfrm6_policy_fini(); | 368 | xfrm6_policy_fini(); |
| 364 | xfrm6_state_fini(); | 369 | xfrm6_state_fini(); |
diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c index c35b3ef5c2f0..d78554fedbac 100644 --- a/net/irda/ircomm/ircomm_event.c +++ b/net/irda/ircomm/ircomm_event.c | |||
| @@ -49,7 +49,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, | |||
| 49 | static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, | 49 | static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, |
| 50 | struct sk_buff *skb, struct ircomm_info *info); | 50 | struct sk_buff *skb, struct ircomm_info *info); |
| 51 | 51 | ||
| 52 | char *ircomm_state[] = { | 52 | const char *const ircomm_state[] = { |
| 53 | "IRCOMM_IDLE", | 53 | "IRCOMM_IDLE", |
| 54 | "IRCOMM_WAITI", | 54 | "IRCOMM_WAITI", |
| 55 | "IRCOMM_WAITR", | 55 | "IRCOMM_WAITR", |
| @@ -57,7 +57,7 @@ char *ircomm_state[] = { | |||
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| 59 | #ifdef CONFIG_IRDA_DEBUG | 59 | #ifdef CONFIG_IRDA_DEBUG |
| 60 | static char *ircomm_event[] = { | 60 | static const char *const ircomm_event[] = { |
| 61 | "IRCOMM_CONNECT_REQUEST", | 61 | "IRCOMM_CONNECT_REQUEST", |
| 62 | "IRCOMM_CONNECT_RESPONSE", | 62 | "IRCOMM_CONNECT_RESPONSE", |
| 63 | "IRCOMM_TTP_CONNECT_INDICATION", | 63 | "IRCOMM_TTP_CONNECT_INDICATION", |
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index 9032a1d1190d..eafc010907c2 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c | |||
| @@ -80,7 +80,7 @@ static int ircomm_tty_state_ready(struct ircomm_tty_cb *self, | |||
| 80 | struct sk_buff *skb, | 80 | struct sk_buff *skb, |
| 81 | struct ircomm_tty_info *info); | 81 | struct ircomm_tty_info *info); |
| 82 | 82 | ||
| 83 | char *ircomm_tty_state[] = { | 83 | const char *const ircomm_tty_state[] = { |
| 84 | "IRCOMM_TTY_IDLE", | 84 | "IRCOMM_TTY_IDLE", |
| 85 | "IRCOMM_TTY_SEARCH", | 85 | "IRCOMM_TTY_SEARCH", |
| 86 | "IRCOMM_TTY_QUERY_PARAMETERS", | 86 | "IRCOMM_TTY_QUERY_PARAMETERS", |
| @@ -91,7 +91,7 @@ char *ircomm_tty_state[] = { | |||
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | #ifdef CONFIG_IRDA_DEBUG | 93 | #ifdef CONFIG_IRDA_DEBUG |
| 94 | static char *ircomm_tty_event[] = { | 94 | static const char *const ircomm_tty_event[] = { |
| 95 | "IRCOMM_TTY_ATTACH_CABLE", | 95 | "IRCOMM_TTY_ATTACH_CABLE", |
| 96 | "IRCOMM_TTY_DETACH_CABLE", | 96 | "IRCOMM_TTY_DETACH_CABLE", |
| 97 | "IRCOMM_TTY_DATA_REQUEST", | 97 | "IRCOMM_TTY_DATA_REQUEST", |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 4a105dc32dcd..294e34d3517c 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
| @@ -44,7 +44,7 @@ | |||
| 44 | 44 | ||
| 45 | #ifdef CONFIG_IRDA_DEBUG | 45 | #ifdef CONFIG_IRDA_DEBUG |
| 46 | /* FIXME: This one should go in irlmp.c */ | 46 | /* FIXME: This one should go in irlmp.c */ |
| 47 | static const char *ias_charset_types[] = { | 47 | static const char *const ias_charset_types[] = { |
| 48 | "CS_ASCII", | 48 | "CS_ASCII", |
| 49 | "CS_ISO_8859_1", | 49 | "CS_ISO_8859_1", |
| 50 | "CS_ISO_8859_2", | 50 | "CS_ISO_8859_2", |
| @@ -966,7 +966,7 @@ static void iriap_watchdog_timer_expired(void *data) | |||
| 966 | 966 | ||
| 967 | #ifdef CONFIG_PROC_FS | 967 | #ifdef CONFIG_PROC_FS |
| 968 | 968 | ||
| 969 | static const char *ias_value_types[] = { | 969 | static const char *const ias_value_types[] = { |
| 970 | "IAS_MISSING", | 970 | "IAS_MISSING", |
| 971 | "IAS_INTEGER", | 971 | "IAS_INTEGER", |
| 972 | "IAS_OCT_SEQ", | 972 | "IAS_OCT_SEQ", |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 774d73a76852..62116829b817 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
| @@ -69,14 +69,14 @@ static int eth; /* Use "eth" or "irlan" name for devices */ | |||
| 69 | static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */ | 69 | static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */ |
| 70 | 70 | ||
| 71 | #ifdef CONFIG_PROC_FS | 71 | #ifdef CONFIG_PROC_FS |
| 72 | static const char *irlan_access[] = { | 72 | static const char *const irlan_access[] = { |
| 73 | "UNKNOWN", | 73 | "UNKNOWN", |
| 74 | "DIRECT", | 74 | "DIRECT", |
| 75 | "PEER", | 75 | "PEER", |
| 76 | "HOSTED" | 76 | "HOSTED" |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | static const char *irlan_media[] = { | 79 | static const char *const irlan_media[] = { |
| 80 | "UNKNOWN", | 80 | "UNKNOWN", |
| 81 | "802.3", | 81 | "802.3", |
| 82 | "802.5" | 82 | "802.5" |
diff --git a/net/irda/irlap.c b/net/irda/irlap.c index e4965b764b9b..356e65b1dc42 100644 --- a/net/irda/irlap.c +++ b/net/irda/irlap.c | |||
| @@ -63,7 +63,7 @@ static void irlap_init_qos_capabilities(struct irlap_cb *self, | |||
| 63 | struct qos_info *qos_user); | 63 | struct qos_info *qos_user); |
| 64 | 64 | ||
| 65 | #ifdef CONFIG_IRDA_DEBUG | 65 | #ifdef CONFIG_IRDA_DEBUG |
| 66 | static char *lap_reasons[] = { | 66 | static const char *const lap_reasons[] = { |
| 67 | "ERROR, NOT USED", | 67 | "ERROR, NOT USED", |
| 68 | "LAP_DISC_INDICATION", | 68 | "LAP_DISC_INDICATION", |
| 69 | "LAP_NO_RESPONSE", | 69 | "LAP_NO_RESPONSE", |
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 16c4ef0f5c1a..c5c51959e3ce 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
| @@ -78,7 +78,7 @@ static int irlap_state_reset_check(struct irlap_cb *, IRLAP_EVENT event, | |||
| 78 | struct sk_buff *, struct irlap_info *); | 78 | struct sk_buff *, struct irlap_info *); |
| 79 | 79 | ||
| 80 | #ifdef CONFIG_IRDA_DEBUG | 80 | #ifdef CONFIG_IRDA_DEBUG |
| 81 | static const char *irlap_event[] = { | 81 | static const char *const irlap_event[] = { |
| 82 | "DISCOVERY_REQUEST", | 82 | "DISCOVERY_REQUEST", |
| 83 | "CONNECT_REQUEST", | 83 | "CONNECT_REQUEST", |
| 84 | "CONNECT_RESPONSE", | 84 | "CONNECT_RESPONSE", |
| @@ -120,7 +120,7 @@ static const char *irlap_event[] = { | |||
| 120 | }; | 120 | }; |
| 121 | #endif /* CONFIG_IRDA_DEBUG */ | 121 | #endif /* CONFIG_IRDA_DEBUG */ |
| 122 | 122 | ||
| 123 | const char *irlap_state[] = { | 123 | const char *const irlap_state[] = { |
| 124 | "LAP_NDM", | 124 | "LAP_NDM", |
| 125 | "LAP_QUERY", | 125 | "LAP_QUERY", |
| 126 | "LAP_REPLY", | 126 | "LAP_REPLY", |
diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c index 78cce0cb073f..c1fb5db81042 100644 --- a/net/irda/irlmp_event.c +++ b/net/irda/irlmp_event.c | |||
| @@ -33,13 +33,13 @@ | |||
| 33 | #include <net/irda/irlmp_frame.h> | 33 | #include <net/irda/irlmp_frame.h> |
| 34 | #include <net/irda/irlmp_event.h> | 34 | #include <net/irda/irlmp_event.h> |
| 35 | 35 | ||
| 36 | const char *irlmp_state[] = { | 36 | const char *const irlmp_state[] = { |
| 37 | "LAP_STANDBY", | 37 | "LAP_STANDBY", |
| 38 | "LAP_U_CONNECT", | 38 | "LAP_U_CONNECT", |
| 39 | "LAP_ACTIVE", | 39 | "LAP_ACTIVE", |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | const char *irlsap_state[] = { | 42 | const char *const irlsap_state[] = { |
| 43 | "LSAP_DISCONNECTED", | 43 | "LSAP_DISCONNECTED", |
| 44 | "LSAP_CONNECT", | 44 | "LSAP_CONNECT", |
| 45 | "LSAP_CONNECT_PEND", | 45 | "LSAP_CONNECT_PEND", |
| @@ -49,7 +49,7 @@ const char *irlsap_state[] = { | |||
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | #ifdef CONFIG_IRDA_DEBUG | 51 | #ifdef CONFIG_IRDA_DEBUG |
| 52 | static const char *irlmp_event[] = { | 52 | static const char *const irlmp_event[] = { |
| 53 | "LM_CONNECT_REQUEST", | 53 | "LM_CONNECT_REQUEST", |
| 54 | "LM_CONNECT_CONFIRM", | 54 | "LM_CONNECT_CONFIRM", |
| 55 | "LM_CONNECT_RESPONSE", | 55 | "LM_CONNECT_RESPONSE", |
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c index f97be471fe2e..be47ac427f6b 100644 --- a/net/llc/llc_proc.c +++ b/net/llc/llc_proc.c | |||
| @@ -143,7 +143,7 @@ out: | |||
| 143 | return 0; | 143 | return 0; |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static char *llc_conn_state_names[] = { | 146 | static const char *const llc_conn_state_names[] = { |
| 147 | [LLC_CONN_STATE_ADM] = "adm", | 147 | [LLC_CONN_STATE_ADM] = "adm", |
| 148 | [LLC_CONN_STATE_SETUP] = "setup", | 148 | [LLC_CONN_STATE_SETUP] = "setup", |
| 149 | [LLC_CONN_STATE_NORMAL] = "normal", | 149 | [LLC_CONN_STATE_NORMAL] = "normal", |
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index 85c8892e1e8b..3e7671674549 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c | |||
| @@ -127,7 +127,8 @@ ip_vs_create_timeout_table(int *table, int size) | |||
| 127 | * Set timeout value for state specified by name | 127 | * Set timeout value for state specified by name |
| 128 | */ | 128 | */ |
| 129 | int | 129 | int |
| 130 | ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to) | 130 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| 131 | const char *name, int to) | ||
| 131 | { | 132 | { |
| 132 | int i; | 133 | int i; |
| 133 | 134 | ||
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c index 2278e141489e..91d28e073742 100644 --- a/net/netfilter/ipvs/ip_vs_proto_tcp.c +++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c | |||
| @@ -377,7 +377,7 @@ static int tcp_timeouts[IP_VS_TCP_S_LAST+1] = { | |||
| 377 | [IP_VS_TCP_S_LAST] = 2*HZ, | 377 | [IP_VS_TCP_S_LAST] = 2*HZ, |
| 378 | }; | 378 | }; |
| 379 | 379 | ||
| 380 | static char * tcp_state_name_table[IP_VS_TCP_S_LAST+1] = { | 380 | static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] = { |
| 381 | [IP_VS_TCP_S_NONE] = "NONE", | 381 | [IP_VS_TCP_S_NONE] = "NONE", |
| 382 | [IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED", | 382 | [IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED", |
| 383 | [IP_VS_TCP_S_SYN_SENT] = "SYN_SENT", | 383 | [IP_VS_TCP_S_SYN_SENT] = "SYN_SENT", |
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c index 33a05d3684d9..e7a6885e0167 100644 --- a/net/netfilter/ipvs/ip_vs_proto_udp.c +++ b/net/netfilter/ipvs/ip_vs_proto_udp.c | |||
| @@ -472,7 +472,7 @@ static int udp_timeouts[IP_VS_UDP_S_LAST+1] = { | |||
| 472 | [IP_VS_UDP_S_LAST] = 2*HZ, | 472 | [IP_VS_UDP_S_LAST] = 2*HZ, |
| 473 | }; | 473 | }; |
| 474 | 474 | ||
| 475 | static char * udp_state_name_table[IP_VS_UDP_S_LAST+1] = { | 475 | static const char *const udp_state_name_table[IP_VS_UDP_S_LAST+1] = { |
| 476 | [IP_VS_UDP_S_NORMAL] = "UDP", | 476 | [IP_VS_UDP_S_NORMAL] = "UDP", |
| 477 | [IP_VS_UDP_S_LAST] = "BUG!", | 477 | [IP_VS_UDP_S_LAST] = "BUG!", |
| 478 | }; | 478 | }; |
diff --git a/net/rds/ib_stats.c b/net/rds/ib_stats.c index 02e3e3d50d4a..8d8488306fe4 100644 --- a/net/rds/ib_stats.c +++ b/net/rds/ib_stats.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | 39 | ||
| 40 | DEFINE_PER_CPU(struct rds_ib_statistics, rds_ib_stats) ____cacheline_aligned; | 40 | DEFINE_PER_CPU(struct rds_ib_statistics, rds_ib_stats) ____cacheline_aligned; |
| 41 | 41 | ||
| 42 | static char *rds_ib_stat_names[] = { | 42 | static const char *const rds_ib_stat_names[] = { |
| 43 | "ib_connect_raced", | 43 | "ib_connect_raced", |
| 44 | "ib_listen_closed_stale", | 44 | "ib_listen_closed_stale", |
| 45 | "ib_tx_cq_call", | 45 | "ib_tx_cq_call", |
diff --git a/net/rds/iw_stats.c b/net/rds/iw_stats.c index ccc7e8f0bf0e..d33ea790484e 100644 --- a/net/rds/iw_stats.c +++ b/net/rds/iw_stats.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | 39 | ||
| 40 | DEFINE_PER_CPU(struct rds_iw_statistics, rds_iw_stats) ____cacheline_aligned; | 40 | DEFINE_PER_CPU(struct rds_iw_statistics, rds_iw_stats) ____cacheline_aligned; |
| 41 | 41 | ||
| 42 | static char *rds_iw_stat_names[] = { | 42 | static const char *const rds_iw_stat_names[] = { |
| 43 | "iw_connect_raced", | 43 | "iw_connect_raced", |
| 44 | "iw_listen_closed_stale", | 44 | "iw_listen_closed_stale", |
| 45 | "iw_tx_cq_call", | 45 | "iw_tx_cq_call", |
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index 981a5e6ea5bc..7a6c748cb56c 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c | |||
| @@ -137,7 +137,7 @@ static int __init rds_rdma_listen_init(void) | |||
| 137 | goto out; | 137 | goto out; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | sin.sin_family = PF_INET, | 140 | sin.sin_family = AF_INET, |
| 141 | sin.sin_addr.s_addr = (__force u32)htonl(INADDR_ANY); | 141 | sin.sin_addr.s_addr = (__force u32)htonl(INADDR_ANY); |
| 142 | sin.sin_port = (__force u16)htons(RDS_PORT); | 142 | sin.sin_port = (__force u16)htons(RDS_PORT); |
| 143 | 143 | ||
diff --git a/net/rds/rds.h b/net/rds/rds.h index dbe111236783..290566c69d28 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h | |||
| @@ -652,7 +652,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats); | |||
| 652 | int __init rds_stats_init(void); | 652 | int __init rds_stats_init(void); |
| 653 | void rds_stats_exit(void); | 653 | void rds_stats_exit(void); |
| 654 | void rds_stats_info_copy(struct rds_info_iterator *iter, | 654 | void rds_stats_info_copy(struct rds_info_iterator *iter, |
| 655 | uint64_t *values, char **names, size_t nr); | 655 | uint64_t *values, const char *const *names, |
| 656 | size_t nr); | ||
| 656 | 657 | ||
| 657 | /* sysctl.c */ | 658 | /* sysctl.c */ |
| 658 | int __init rds_sysctl_init(void); | 659 | int __init rds_sysctl_init(void); |
diff --git a/net/rds/stats.c b/net/rds/stats.c index 637146893cf3..91d8c58b8335 100644 --- a/net/rds/stats.c +++ b/net/rds/stats.c | |||
| @@ -40,7 +40,7 @@ DEFINE_PER_CPU_SHARED_ALIGNED(struct rds_statistics, rds_stats); | |||
| 40 | 40 | ||
| 41 | /* :.,$s/unsigned long\>.*\<s_\(.*\);/"\1",/g */ | 41 | /* :.,$s/unsigned long\>.*\<s_\(.*\);/"\1",/g */ |
| 42 | 42 | ||
| 43 | static char *rds_stat_names[] = { | 43 | static const char *const rds_stat_names[] = { |
| 44 | "conn_reset", | 44 | "conn_reset", |
| 45 | "recv_drop_bad_checksum", | 45 | "recv_drop_bad_checksum", |
| 46 | "recv_drop_old_seq", | 46 | "recv_drop_old_seq", |
| @@ -77,7 +77,7 @@ static char *rds_stat_names[] = { | |||
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | void rds_stats_info_copy(struct rds_info_iterator *iter, | 79 | void rds_stats_info_copy(struct rds_info_iterator *iter, |
| 80 | uint64_t *values, char **names, size_t nr) | 80 | uint64_t *values, const char *const *names, size_t nr) |
| 81 | { | 81 | { |
| 82 | struct rds_info_counter ctr; | 82 | struct rds_info_counter ctr; |
| 83 | size_t i; | 83 | size_t i; |
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index 3ac1672e1070..c9f1f0a3a2ff 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | static unsigned rxrpc_ack_defer = 1; | 21 | static unsigned rxrpc_ack_defer = 1; |
| 22 | 22 | ||
| 23 | static const char *rxrpc_acks[] = { | 23 | static const char *const rxrpc_acks[] = { |
| 24 | "---", "REQ", "DUP", "OOS", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL", | 24 | "---", "REQ", "DUP", "OOS", "WIN", "MEM", "PNG", "PNR", "DLY", "IDL", |
| 25 | "-?-" | 25 | "-?-" |
| 26 | }; | 26 | }; |
diff --git a/net/sctp/debug.c b/net/sctp/debug.c index 7ff548a30cfb..bf24fa697de2 100644 --- a/net/sctp/debug.c +++ b/net/sctp/debug.c | |||
| @@ -52,7 +52,7 @@ int sctp_debug_flag = 1; /* Initially enable DEBUG */ | |||
| 52 | #endif /* SCTP_DEBUG */ | 52 | #endif /* SCTP_DEBUG */ |
| 53 | 53 | ||
| 54 | /* These are printable forms of Chunk ID's from section 3.1. */ | 54 | /* These are printable forms of Chunk ID's from section 3.1. */ |
| 55 | static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = { | 55 | static const char *const sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = { |
| 56 | "DATA", | 56 | "DATA", |
| 57 | "INIT", | 57 | "INIT", |
| 58 | "INIT_ACK", | 58 | "INIT_ACK", |
| @@ -97,7 +97,7 @@ const char *sctp_cname(const sctp_subtype_t cid) | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | /* These are printable forms of the states. */ | 99 | /* These are printable forms of the states. */ |
| 100 | const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = { | 100 | const char *const sctp_state_tbl[SCTP_STATE_NUM_STATES] = { |
| 101 | "STATE_EMPTY", | 101 | "STATE_EMPTY", |
| 102 | "STATE_CLOSED", | 102 | "STATE_CLOSED", |
| 103 | "STATE_COOKIE_WAIT", | 103 | "STATE_COOKIE_WAIT", |
| @@ -110,7 +110,7 @@ const char *sctp_state_tbl[SCTP_STATE_NUM_STATES] = { | |||
| 110 | }; | 110 | }; |
| 111 | 111 | ||
| 112 | /* Events that could change the state of an association. */ | 112 | /* Events that could change the state of an association. */ |
| 113 | const char *sctp_evttype_tbl[] = { | 113 | const char *const sctp_evttype_tbl[] = { |
| 114 | "EVENT_T_unknown", | 114 | "EVENT_T_unknown", |
| 115 | "EVENT_T_CHUNK", | 115 | "EVENT_T_CHUNK", |
| 116 | "EVENT_T_TIMEOUT", | 116 | "EVENT_T_TIMEOUT", |
| @@ -119,7 +119,7 @@ const char *sctp_evttype_tbl[] = { | |||
| 119 | }; | 119 | }; |
| 120 | 120 | ||
| 121 | /* Return value of a state function */ | 121 | /* Return value of a state function */ |
| 122 | const char *sctp_status_tbl[] = { | 122 | const char *const sctp_status_tbl[] = { |
| 123 | "DISPOSITION_DISCARD", | 123 | "DISPOSITION_DISCARD", |
| 124 | "DISPOSITION_CONSUME", | 124 | "DISPOSITION_CONSUME", |
| 125 | "DISPOSITION_NOMEM", | 125 | "DISPOSITION_NOMEM", |
| @@ -132,7 +132,7 @@ const char *sctp_status_tbl[] = { | |||
| 132 | }; | 132 | }; |
| 133 | 133 | ||
| 134 | /* Printable forms of primitives */ | 134 | /* Printable forms of primitives */ |
| 135 | static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = { | 135 | static const char *const sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = { |
| 136 | "PRIMITIVE_ASSOCIATE", | 136 | "PRIMITIVE_ASSOCIATE", |
| 137 | "PRIMITIVE_SHUTDOWN", | 137 | "PRIMITIVE_SHUTDOWN", |
| 138 | "PRIMITIVE_ABORT", | 138 | "PRIMITIVE_ABORT", |
| @@ -149,7 +149,7 @@ const char *sctp_pname(const sctp_subtype_t id) | |||
| 149 | return "unknown_primitive"; | 149 | return "unknown_primitive"; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | static const char *sctp_other_tbl[] = { | 152 | static const char *const sctp_other_tbl[] = { |
| 153 | "NO_PENDING_TSN", | 153 | "NO_PENDING_TSN", |
| 154 | "ICMP_PROTO_UNREACH", | 154 | "ICMP_PROTO_UNREACH", |
| 155 | }; | 155 | }; |
| @@ -162,7 +162,7 @@ const char *sctp_oname(const sctp_subtype_t id) | |||
| 162 | return "unknown 'other' event"; | 162 | return "unknown 'other' event"; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | static const char *sctp_timer_tbl[] = { | 165 | static const char *const sctp_timer_tbl[] = { |
| 166 | "TIMEOUT_NONE", | 166 | "TIMEOUT_NONE", |
| 167 | "TIMEOUT_T1_COOKIE", | 167 | "TIMEOUT_T1_COOKIE", |
| 168 | "TIMEOUT_T1_INIT", | 168 | "TIMEOUT_T1_INIT", |
