diff options
129 files changed, 2510 insertions, 1434 deletions
@@ -2380,8 +2380,8 @@ E: tmolina@cablespeed.com | |||
2380 | D: bug fixes, documentation, minor hackery | 2380 | D: bug fixes, documentation, minor hackery |
2381 | 2381 | ||
2382 | N: James Morris | 2382 | N: James Morris |
2383 | E: jmorris@redhat.com | 2383 | E: jmorris@namei.org |
2384 | W: http://www.intercode.com.au/jmorris/ | 2384 | W: http://namei.org/ |
2385 | D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec, | 2385 | D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec, |
2386 | D: Crypto API, general networking, miscellaneous. | 2386 | D: Crypto API, general networking, miscellaneous. |
2387 | S: PO Box 707 | 2387 | S: PO Box 707 |
diff --git a/Documentation/usb/usbmon.txt b/Documentation/usb/usbmon.txt index f1896ee3bb2a..63cb7edd177e 100644 --- a/Documentation/usb/usbmon.txt +++ b/Documentation/usb/usbmon.txt | |||
@@ -102,7 +102,7 @@ Here is the list of words, from left to right: | |||
102 | - URB Status. This field makes no sense for submissions, but is present | 102 | - URB Status. This field makes no sense for submissions, but is present |
103 | to help scripts with parsing. In error case, it contains the error code. | 103 | to help scripts with parsing. In error case, it contains the error code. |
104 | In case of a setup packet, it contains a Setup Tag. If scripts read a number | 104 | In case of a setup packet, it contains a Setup Tag. If scripts read a number |
105 | in this field, the proceed to read Data Length. Otherwise, they read | 105 | in this field, they proceed to read Data Length. Otherwise, they read |
106 | the setup packet before reading the Data Length. | 106 | the setup packet before reading the Data Length. |
107 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, | 107 | - Setup packet, if present, consists of 5 words: one of each for bmRequestType, |
108 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. | 108 | bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. |
diff --git a/Documentation/x86_64/boot-options.txt b/Documentation/x86_64/boot-options.txt index 476c0c22fbb7..678e8f192db2 100644 --- a/Documentation/x86_64/boot-options.txt +++ b/Documentation/x86_64/boot-options.txt | |||
@@ -6,6 +6,11 @@ only the AMD64 specific ones are listed here. | |||
6 | Machine check | 6 | Machine check |
7 | 7 | ||
8 | mce=off disable machine check | 8 | mce=off disable machine check |
9 | mce=bootlog Enable logging of machine checks left over from booting. | ||
10 | Disabled by default because some BIOS leave bogus ones. | ||
11 | If your BIOS doesn't do that it's a good idea to enable though | ||
12 | to make sure you log even machine check events that result | ||
13 | in a reboot. | ||
9 | 14 | ||
10 | nomce (for compatibility with i386): same as mce=off | 15 | nomce (for compatibility with i386): same as mce=off |
11 | 16 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index c31ddc4bcdd6..5fd00c075053 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1658,7 +1658,7 @@ M: kuznet@ms2.inr.ac.ru | |||
1658 | P: Pekka Savola (ipv6) | 1658 | P: Pekka Savola (ipv6) |
1659 | M: pekkas@netcore.fi | 1659 | M: pekkas@netcore.fi |
1660 | P: James Morris | 1660 | P: James Morris |
1661 | M: jmorris@redhat.com | 1661 | M: jmorris@namei.org |
1662 | P: Hideaki YOSHIFUJI | 1662 | P: Hideaki YOSHIFUJI |
1663 | M: yoshfuji@linux-ipv6.org | 1663 | M: yoshfuji@linux-ipv6.org |
1664 | P: Patrick McHardy | 1664 | P: Patrick McHardy |
@@ -2047,7 +2047,7 @@ SELINUX SECURITY MODULE | |||
2047 | P: Stephen Smalley | 2047 | P: Stephen Smalley |
2048 | M: sds@epoch.ncsc.mil | 2048 | M: sds@epoch.ncsc.mil |
2049 | P: James Morris | 2049 | P: James Morris |
2050 | M: jmorris@redhat.com | 2050 | M: jmorris@namei.org |
2051 | L: linux-kernel@vger.kernel.org (kernel issues) | 2051 | L: linux-kernel@vger.kernel.org (kernel issues) |
2052 | L: selinux@tycho.nsa.gov (general discussion) | 2052 | L: selinux@tycho.nsa.gov (general discussion) |
2053 | W: http://www.nsa.gov/selinux | 2053 | W: http://www.nsa.gov/selinux |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 13 | 3 | SUBLEVEL = 13 |
4 | EXTRAVERSION =-rc5 | 4 | EXTRAVERSION =-rc6 |
5 | NAME=Woozy Numbat | 5 | NAME=Woozy Numbat |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/REPORTING-BUGS b/REPORTING-BUGS index 2045eaea2d9e..224c34741d32 100644 --- a/REPORTING-BUGS +++ b/REPORTING-BUGS | |||
@@ -41,18 +41,19 @@ summary from [1.]>" for easy identification by the developers | |||
41 | [2.] Full description of the problem/report: | 41 | [2.] Full description of the problem/report: |
42 | [3.] Keywords (i.e., modules, networking, kernel): | 42 | [3.] Keywords (i.e., modules, networking, kernel): |
43 | [4.] Kernel version (from /proc/version): | 43 | [4.] Kernel version (from /proc/version): |
44 | [5.] Output of Oops.. message (if applicable) with symbolic information | 44 | [5.] Most recent kernel version which did not have the bug: |
45 | [6.] Output of Oops.. message (if applicable) with symbolic information | ||
45 | resolved (see Documentation/oops-tracing.txt) | 46 | resolved (see Documentation/oops-tracing.txt) |
46 | [6.] A small shell script or example program which triggers the | 47 | [7.] A small shell script or example program which triggers the |
47 | problem (if possible) | 48 | problem (if possible) |
48 | [7.] Environment | 49 | [8.] Environment |
49 | [7.1.] Software (add the output of the ver_linux script here) | 50 | [8.1.] Software (add the output of the ver_linux script here) |
50 | [7.2.] Processor information (from /proc/cpuinfo): | 51 | [8.2.] Processor information (from /proc/cpuinfo): |
51 | [7.3.] Module information (from /proc/modules): | 52 | [8.3.] Module information (from /proc/modules): |
52 | [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) | 53 | [8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) |
53 | [7.5.] PCI information ('lspci -vvv' as root) | 54 | [8.5.] PCI information ('lspci -vvv' as root) |
54 | [7.6.] SCSI information (from /proc/scsi/scsi) | 55 | [8.6.] SCSI information (from /proc/scsi/scsi) |
55 | [7.7.] Other information that might be relevant to the problem | 56 | [8.7.] Other information that might be relevant to the problem |
56 | (please look in /proc and include all information that you | 57 | (please look in /proc and include all information that you |
57 | think to be relevant): | 58 | think to be relevant): |
58 | [X.] Other notes, patches, fixes, workarounds: | 59 | [X.] Other notes, patches, fixes, workarounds: |
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 1f36bbd0ed5d..2a8b364c822e 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
350 | region->end = res->end - offset; | 350 | region->end = res->end - offset; |
351 | } | 351 | } |
352 | 352 | ||
353 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
354 | struct pci_bus_region *region) | ||
355 | { | ||
356 | struct pci_controller *hose = (struct pci_controller *)dev->sysdata; | ||
357 | unsigned long offset = 0; | ||
358 | |||
359 | if (res->flags & IORESOURCE_IO) | ||
360 | offset = hose->io_space->start; | ||
361 | else if (res->flags & IORESOURCE_MEM) | ||
362 | offset = hose->mem_space->start; | ||
363 | |||
364 | res->start = region->start + offset; | ||
365 | res->end = region->end + offset; | ||
366 | } | ||
367 | |||
353 | #ifdef CONFIG_HOTPLUG | 368 | #ifdef CONFIG_HOTPLUG |
354 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 369 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
370 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
355 | #endif | 371 | #endif |
356 | 372 | ||
357 | int | 373 | int |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index ad26e98f1e62..c4923fac8dff 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
447 | region->end = res->end - offset; | 447 | region->end = res->end - offset; |
448 | } | 448 | } |
449 | 449 | ||
450 | void __devinit | ||
451 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
452 | struct pci_bus_region *region) | ||
453 | { | ||
454 | struct pci_sys_data *root = dev->sysdata; | ||
455 | unsigned long offset = 0; | ||
456 | |||
457 | if (res->flags & IORESOURCE_IO) | ||
458 | offset = root->io_offset; | ||
459 | if (res->flags & IORESOURCE_MEM) | ||
460 | offset = root->mem_offset; | ||
461 | |||
462 | res->start = region->start + offset; | ||
463 | res->end = region->end + offset; | ||
464 | } | ||
465 | |||
450 | #ifdef CONFIG_HOTPLUG | 466 | #ifdef CONFIG_HOTPLUG |
451 | EXPORT_SYMBOL(pcibios_fixup_bus); | 467 | EXPORT_SYMBOL(pcibios_fixup_bus); |
452 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 468 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
469 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
453 | #endif | 470 | #endif |
454 | 471 | ||
455 | /* | 472 | /* |
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index a801d9d48606..619d843ba231 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -454,8 +454,9 @@ config HPET_TIMER | |||
454 | Choose N to continue using the legacy 8254 timer. | 454 | Choose N to continue using the legacy 8254 timer. |
455 | 455 | ||
456 | config HPET_EMULATE_RTC | 456 | config HPET_EMULATE_RTC |
457 | bool "Provide RTC interrupt" | 457 | bool |
458 | depends on HPET_TIMER && RTC=y | 458 | depends on HPET_TIMER && RTC=y |
459 | default y | ||
459 | 460 | ||
460 | config SMP | 461 | config SMP |
461 | bool "Symmetric multi-processing support" | 462 | bool "Symmetric multi-processing support" |
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c index 9e9296676f93..5d73e042ed0a 100644 --- a/arch/i386/mach-visws/reboot.c +++ b/arch/i386/mach-visws/reboot.c | |||
@@ -9,12 +9,15 @@ | |||
9 | void (*pm_power_off)(void); | 9 | void (*pm_power_off)(void); |
10 | EXPORT_SYMBOL(pm_power_off); | 10 | EXPORT_SYMBOL(pm_power_off); |
11 | 11 | ||
12 | void machine_restart(char * __unused) | 12 | void machine_shutdown(void) |
13 | { | 13 | { |
14 | #ifdef CONFIG_SMP | 14 | #ifdef CONFIG_SMP |
15 | smp_send_stop(); | 15 | smp_send_stop(); |
16 | #endif | 16 | #endif |
17 | } | ||
17 | 18 | ||
19 | void machine_emergency_restart(void) | ||
20 | { | ||
18 | /* | 21 | /* |
19 | * Visual Workstations restart after this | 22 | * Visual Workstations restart after this |
20 | * register is poked on the PIIX4 | 23 | * register is poked on the PIIX4 |
@@ -22,6 +25,12 @@ void machine_restart(char * __unused) | |||
22 | outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); | 25 | outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); |
23 | } | 26 | } |
24 | 27 | ||
28 | void machine_restart(char * __unused) | ||
29 | { | ||
30 | machine_shutdown(); | ||
31 | machine_emergency_restart(); | ||
32 | } | ||
33 | |||
25 | void machine_power_off(void) | 34 | void machine_power_off(void) |
26 | { | 35 | { |
27 | unsigned short pm_status; | 36 | unsigned short pm_status; |
diff --git a/arch/i386/mach-visws/setup.c b/arch/i386/mach-visws/setup.c index 9f6d2d9b1be7..26ada6fc0d77 100644 --- a/arch/i386/mach-visws/setup.c +++ b/arch/i386/mach-visws/setup.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include "cobalt.h" | 14 | #include "cobalt.h" |
15 | #include "piix4.h" | 15 | #include "piix4.h" |
16 | 16 | ||
17 | int no_broadcast; | ||
18 | |||
17 | char visws_board_type = -1; | 19 | char visws_board_type = -1; |
18 | char visws_board_rev = -1; | 20 | char visws_board_rev = -1; |
19 | 21 | ||
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c index b3eda46e0fe9..c6384061328a 100644 --- a/arch/i386/mach-voyager/voyager_basic.c +++ b/arch/i386/mach-voyager/voyager_basic.c | |||
@@ -252,6 +252,12 @@ kb_wait(void) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | void | 254 | void |
255 | machine_shutdown(void) | ||
256 | { | ||
257 | /* Architecture specific shutdown needed before a kexec */ | ||
258 | } | ||
259 | |||
260 | void | ||
255 | machine_restart(char *cmd) | 261 | machine_restart(char *cmd) |
256 | { | 262 | { |
257 | printk("Voyager Warm Restart\n"); | 263 | printk("Voyager Warm Restart\n"); |
@@ -279,6 +285,13 @@ machine_restart(char *cmd) | |||
279 | } | 285 | } |
280 | 286 | ||
281 | void | 287 | void |
288 | machine_emergency_restart(void) | ||
289 | { | ||
290 | /*for now, just hook this to a warm restart */ | ||
291 | machine_restart(NULL); | ||
292 | } | ||
293 | |||
294 | void | ||
282 | mca_nmi_hook(void) | 295 | mca_nmi_hook(void) |
283 | { | 296 | { |
284 | __u8 dumpval __attribute__((unused)) = inb(0xf823); | 297 | __u8 dumpval __attribute__((unused)) = inb(0xf823); |
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index c369a8bf7cbe..6711ce3f6916 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void) | |||
243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ | 243 | /* now the roundup is correct, convert to PAGE_SIZE pages */ |
244 | size = size * PTRS_PER_PTE; | 244 | size = size * PTRS_PER_PTE; |
245 | 245 | ||
246 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
247 | /* | ||
248 | * Adjust size if node_end_pfn is not on a proper | ||
249 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
250 | */ | ||
251 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
252 | } | ||
253 | |||
254 | /* | 246 | /* |
255 | * Validate the region we are allocating only contains valid | 247 | * Validate the region we are allocating only contains valid |
256 | * pages. | 248 | * pages. |
@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void) | |||
270 | reserve_pages += size; | 262 | reserve_pages += size; |
271 | printk("Shrinking node %d from %ld pages to %ld pages\n", | 263 | printk("Shrinking node %d from %ld pages to %ld pages\n", |
272 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); | 264 | nid, node_end_pfn[nid], node_end_pfn[nid] - size); |
265 | |||
266 | if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) { | ||
267 | /* | ||
268 | * Align node_end_pfn[] and node_remap_start_pfn[] to | ||
269 | * pmd boundary. remap_numa_kva will barf otherwise. | ||
270 | */ | ||
271 | printk("Shrinking node %d further by %ld pages for proper alignment\n", | ||
272 | nid, node_end_pfn[nid] & (PTRS_PER_PTE-1)); | ||
273 | size += node_end_pfn[nid] & (PTRS_PER_PTE-1); | ||
274 | } | ||
275 | |||
273 | node_end_pfn[nid] -= size; | 276 | node_end_pfn[nid] -= size; |
274 | node_remap_start_pfn[nid] = node_end_pfn[nid]; | 277 | node_remap_start_pfn[nid] = node_end_pfn[nid]; |
275 | } | 278 | } |
diff --git a/arch/i386/pci/visws.c b/arch/i386/pci/visws.c index 314c933b6b8e..6c17433fdf7d 100644 --- a/arch/i386/pci/visws.c +++ b/arch/i386/pci/visws.c | |||
@@ -18,8 +18,10 @@ | |||
18 | extern struct pci_raw_ops pci_direct_conf1; | 18 | extern struct pci_raw_ops pci_direct_conf1; |
19 | 19 | ||
20 | static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } | 20 | static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } |
21 | static void pci_visws_disable_irq(struct pci_dev *dev) { } | ||
21 | 22 | ||
22 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; | 23 | int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; |
24 | void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq; | ||
23 | 25 | ||
24 | void __init pcibios_penalize_isa_irq(int irq, int active) {} | 26 | void __init pcibios_penalize_isa_irq(int irq, int active) {} |
25 | 27 | ||
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 66e840609808..051e050359e4 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1; | |||
179 | 179 | ||
180 | static int __init nohalt_setup(char * str) | 180 | static int __init nohalt_setup(char * str) |
181 | { | 181 | { |
182 | pal_halt = 0; | 182 | pal_halt = can_do_pal_halt = 0; |
183 | return 1; | 183 | return 1; |
184 | } | 184 | } |
185 | __setup("nohalt", nohalt_setup); | 185 | __setup("nohalt", nohalt_setup); |
diff --git a/arch/ppc/8xx_io/Kconfig b/arch/ppc/8xx_io/Kconfig index 9e2227ec3b34..57dacf978532 100644 --- a/arch/ppc/8xx_io/Kconfig +++ b/arch/ppc/8xx_io/Kconfig | |||
@@ -69,9 +69,9 @@ config FEC_QS6612 | |||
69 | 69 | ||
70 | config ENET_BIG_BUFFERS | 70 | config ENET_BIG_BUFFERS |
71 | bool "Use Big CPM Ethernet Buffers" | 71 | bool "Use Big CPM Ethernet Buffers" |
72 | depends on NET_ETHERNET | 72 | depends on SCC_ENET || FEC_ENET |
73 | help | 73 | help |
74 | Allocate large buffers for MPC8xx Etherenet. Increases throughput | 74 | Allocate large buffers for MPC8xx Ethernet. Increases throughput |
75 | and decreases the likelihood of dropped packets, but costs memory. | 75 | and decreases the likelihood of dropped packets, but costs memory. |
76 | 76 | ||
77 | config HTDMSOUND | 77 | config HTDMSOUND |
diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 0cc2e7a9cb11..11726e2a4ec8 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c | |||
@@ -39,8 +39,6 @@ | |||
39 | #include <asm/tlbflush.h> | 39 | #include <asm/tlbflush.h> |
40 | #include <asm/rheap.h> | 40 | #include <asm/rheap.h> |
41 | 41 | ||
42 | extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep); | ||
43 | |||
44 | static void m8xx_cpm_dpinit(void); | 42 | static void m8xx_cpm_dpinit(void); |
45 | static uint host_buffer; /* One page of host buffer */ | 43 | static uint host_buffer; /* One page of host buffer */ |
46 | static uint host_end; /* end + 1 */ | 44 | static uint host_end; /* end + 1 */ |
@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = { | |||
108 | .end = cpm_eoi, | 106 | .end = cpm_eoi, |
109 | }; | 107 | }; |
110 | 108 | ||
111 | extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr); | ||
112 | |||
113 | void | 109 | void |
114 | m8xx_cpm_reset(uint bootpage) | 110 | m8xx_cpm_reset(void) |
115 | { | 111 | { |
116 | volatile immap_t *imp; | 112 | volatile immap_t *imp; |
117 | volatile cpm8xx_t *commproc; | 113 | volatile cpm8xx_t *commproc; |
118 | pte_t *pte; | ||
119 | 114 | ||
120 | imp = (immap_t *)IMAP_ADDR; | 115 | imp = (immap_t *)IMAP_ADDR; |
121 | commproc = (cpm8xx_t *)&imp->im_cpm; | 116 | commproc = (cpm8xx_t *)&imp->im_cpm; |
@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage) | |||
143 | /* Reclaim the DP memory for our use. */ | 138 | /* Reclaim the DP memory for our use. */ |
144 | m8xx_cpm_dpinit(); | 139 | m8xx_cpm_dpinit(); |
145 | 140 | ||
146 | /* get the PTE for the bootpage */ | ||
147 | if (!get_pteptr(&init_mm, bootpage, &pte)) | ||
148 | panic("get_pteptr failed\n"); | ||
149 | |||
150 | /* and make it uncachable */ | ||
151 | pte_val(*pte) |= _PAGE_NO_CACHE; | ||
152 | _tlbie(bootpage); | ||
153 | |||
154 | host_buffer = bootpage; | ||
155 | host_end = host_buffer + PAGE_SIZE; | ||
156 | |||
157 | /* Tell everyone where the comm processor resides. | 141 | /* Tell everyone where the comm processor resides. |
158 | */ | 142 | */ |
159 | cpmp = (cpm8xx_t *)commproc; | 143 | cpmp = (cpm8xx_t *)commproc; |
@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info; | |||
384 | 368 | ||
385 | void m8xx_cpm_dpinit(void) | 369 | void m8xx_cpm_dpinit(void) |
386 | { | 370 | { |
387 | cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm; | ||
388 | |||
389 | spin_lock_init(&cpm_dpmem_lock); | 371 | spin_lock_init(&cpm_dpmem_lock); |
390 | 372 | ||
391 | /* Initialize the info header */ | 373 | /* Initialize the info header */ |
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c index 0730392dcc20..62f68d6181c6 100644 --- a/arch/ppc/8xx_io/fec.c +++ b/arch/ppc/8xx_io/fec.c | |||
@@ -173,7 +173,7 @@ struct fec_enet_private { | |||
173 | uint phy_status; | 173 | uint phy_status; |
174 | uint phy_speed; | 174 | uint phy_speed; |
175 | phy_info_t *phy; | 175 | phy_info_t *phy; |
176 | struct tq_struct phy_task; | 176 | struct work_struct phy_task; |
177 | 177 | ||
178 | uint sequence_done; | 178 | uint sequence_done; |
179 | 179 | ||
@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); | |||
199 | #ifdef CONFIG_USE_MDIO | 199 | #ifdef CONFIG_USE_MDIO |
200 | static void fec_enet_mii(struct net_device *dev); | 200 | static void fec_enet_mii(struct net_device *dev); |
201 | #endif /* CONFIG_USE_MDIO */ | 201 | #endif /* CONFIG_USE_MDIO */ |
202 | static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); | 202 | static irqreturn_t fec_enet_interrupt(int irq, void * dev_id, |
203 | struct pt_regs * regs); | ||
203 | #ifdef CONFIG_FEC_PACKETHOOK | 204 | #ifdef CONFIG_FEC_PACKETHOOK |
204 | static void fec_enet_tx(struct net_device *dev, __u32 regval); | 205 | static void fec_enet_tx(struct net_device *dev, __u32 regval); |
205 | static void fec_enet_rx(struct net_device *dev, __u32 regval); | 206 | static void fec_enet_rx(struct net_device *dev, __u32 regval); |
@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev) | |||
471 | /* The interrupt handler. | 472 | /* The interrupt handler. |
472 | * This is called from the MPC core interrupt. | 473 | * This is called from the MPC core interrupt. |
473 | */ | 474 | */ |
474 | static void | 475 | static irqreturn_t |
475 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 476 | fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
476 | { | 477 | { |
477 | struct net_device *dev = dev_id; | 478 | struct net_device *dev = dev_id; |
@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO | |||
525 | } | 526 | } |
526 | 527 | ||
527 | } | 528 | } |
529 | return IRQ_RETVAL(IRQ_HANDLED); | ||
528 | } | 530 | } |
529 | 531 | ||
530 | 532 | ||
@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev) | |||
1263 | printk(".\n"); | 1265 | printk(".\n"); |
1264 | } | 1266 | } |
1265 | 1267 | ||
1266 | static void mii_display_config(struct net_device *dev) | 1268 | static void mii_display_config(void *priv) |
1267 | { | 1269 | { |
1270 | struct net_device *dev = (struct net_device *)priv; | ||
1268 | struct fec_enet_private *fep = dev->priv; | 1271 | struct fec_enet_private *fep = dev->priv; |
1269 | volatile uint *s = &(fep->phy_status); | 1272 | volatile uint *s = &(fep->phy_status); |
1270 | 1273 | ||
@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev) | |||
1294 | fep->sequence_done = 1; | 1297 | fep->sequence_done = 1; |
1295 | } | 1298 | } |
1296 | 1299 | ||
1297 | static void mii_relink(struct net_device *dev) | 1300 | static void mii_relink(void *priv) |
1298 | { | 1301 | { |
1302 | struct net_device *dev = (struct net_device *)priv; | ||
1299 | struct fec_enet_private *fep = dev->priv; | 1303 | struct fec_enet_private *fep = dev->priv; |
1300 | int duplex; | 1304 | int duplex; |
1301 | 1305 | ||
@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) | |||
1323 | { | 1327 | { |
1324 | struct fec_enet_private *fep = dev->priv; | 1328 | struct fec_enet_private *fep = dev->priv; |
1325 | 1329 | ||
1326 | fep->phy_task.routine = (void *)mii_relink; | 1330 | INIT_WORK(&fep->phy_task, mii_relink, (void *)dev); |
1327 | fep->phy_task.data = dev; | 1331 | schedule_work(&fep->phy_task); |
1328 | schedule_task(&fep->phy_task); | ||
1329 | } | 1332 | } |
1330 | 1333 | ||
1331 | static void mii_queue_config(uint mii_reg, struct net_device *dev) | 1334 | static void mii_queue_config(uint mii_reg, struct net_device *dev) |
1332 | { | 1335 | { |
1333 | struct fec_enet_private *fep = dev->priv; | 1336 | struct fec_enet_private *fep = dev->priv; |
1334 | 1337 | ||
1335 | fep->phy_task.routine = (void *)mii_display_config; | 1338 | INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev); |
1336 | fep->phy_task.data = dev; | 1339 | schedule_work(&fep->phy_task); |
1337 | schedule_task(&fep->phy_task); | ||
1338 | } | 1340 | } |
1339 | 1341 | ||
1340 | 1342 | ||
@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
1403 | 1405 | ||
1404 | /* This interrupt occurs when the PHY detects a link change. | 1406 | /* This interrupt occurs when the PHY detects a link change. |
1405 | */ | 1407 | */ |
1406 | static void | 1408 | static |
1407 | #ifdef CONFIG_RPXCLASSIC | 1409 | #ifdef CONFIG_RPXCLASSIC |
1408 | mii_link_interrupt(void *dev_id) | 1410 | void mii_link_interrupt(void *dev_id) |
1409 | #else | 1411 | #else |
1410 | mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | 1412 | irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) |
1411 | #endif | 1413 | #endif |
1412 | { | 1414 | { |
1413 | #ifdef CONFIG_USE_MDIO | 1415 | #ifdef CONFIG_USE_MDIO |
@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) | |||
1440 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); | 1442 | printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); |
1441 | #endif /* CONFIG_USE_MDIO */ | 1443 | #endif /* CONFIG_USE_MDIO */ |
1442 | 1444 | ||
1445 | #ifndef CONFIG_RPXCLASSIC | ||
1446 | return IRQ_RETVAL(IRQ_HANDLED); | ||
1447 | #endif /* CONFIG_RPXCLASSIC */ | ||
1443 | } | 1448 | } |
1444 | 1449 | ||
1445 | static int | 1450 | static int |
@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void) | |||
1575 | struct fec_enet_private *fep; | 1580 | struct fec_enet_private *fep; |
1576 | int i, j, k, err; | 1581 | int i, j, k, err; |
1577 | unsigned char *eap, *iap, *ba; | 1582 | unsigned char *eap, *iap, *ba; |
1578 | unsigned long mem_addr; | 1583 | dma_addr_t mem_addr; |
1579 | volatile cbd_t *bdp; | 1584 | volatile cbd_t *bdp; |
1580 | cbd_t *cbd_base; | 1585 | cbd_t *cbd_base; |
1581 | volatile immap_t *immap; | 1586 | volatile immap_t *immap; |
@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void) | |||
1640 | printk("FEC initialization failed.\n"); | 1645 | printk("FEC initialization failed.\n"); |
1641 | return 1; | 1646 | return 1; |
1642 | } | 1647 | } |
1643 | cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1648 | cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE, |
1649 | &mem_addr, GFP_KERNEL); | ||
1644 | 1650 | ||
1645 | /* Set receive and transmit descriptor base. | 1651 | /* Set receive and transmit descriptor base. |
1646 | */ | 1652 | */ |
@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void) | |||
1657 | 1663 | ||
1658 | /* Allocate a page. | 1664 | /* Allocate a page. |
1659 | */ | 1665 | */ |
1660 | ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); | 1666 | ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev, |
1667 | PAGE_SIZE, | ||
1668 | &mem_addr, | ||
1669 | GFP_KERNEL); | ||
1661 | /* BUG: no check for failure */ | 1670 | /* BUG: no check for failure */ |
1662 | 1671 | ||
1663 | /* Initialize the BD for every fragment in the page. | 1672 | /* Initialize the BD for every fragment in the page. |
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 70cfb6ffd877..7b3586a3bf30 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
160 | } | 160 | } |
161 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 161 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
162 | 162 | ||
163 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
164 | struct pci_bus_region *region) | ||
165 | { | ||
166 | unsigned long offset = 0; | ||
167 | struct pci_controller *hose = dev->sysdata; | ||
168 | |||
169 | if (hose && res->flags & IORESOURCE_IO) | ||
170 | offset = (unsigned long)hose->io_base_virt - isa_io_base; | ||
171 | else if (hose && res->flags & IORESOURCE_MEM) | ||
172 | offset = hose->pci_mem_offset; | ||
173 | res->start = region->start + offset; | ||
174 | res->end = region->end + offset; | ||
175 | } | ||
176 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
177 | |||
163 | /* | 178 | /* |
164 | * We need to avoid collisions with `mirrored' VGA ports | 179 | * We need to avoid collisions with `mirrored' VGA ports |
165 | * and other strange ISA hardware, so we always want the | 180 | * and other strange ISA hardware, so we always want the |
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index d59ad07de8e7..e7d40cc6c1b6 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c | |||
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res); | |||
324 | 324 | ||
325 | EXPORT_SYMBOL(next_mmu_context); | 325 | EXPORT_SYMBOL(next_mmu_context); |
326 | EXPORT_SYMBOL(set_context); | 326 | EXPORT_SYMBOL(set_context); |
327 | EXPORT_SYMBOL(handle_mm_fault); /* For MOL */ | 327 | EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */ |
328 | EXPORT_SYMBOL(disarm_decr); | 328 | EXPORT_SYMBOL(disarm_decr); |
329 | #ifdef CONFIG_PPC_STD_MMU | 329 | #ifdef CONFIG_PPC_STD_MMU |
330 | extern long mol_trampoline; | 330 | extern long mol_trampoline; |
diff --git a/arch/ppc/syslib/m8xx_setup.c b/arch/ppc/syslib/m8xx_setup.c index c1db2ab1d154..55a381af4e37 100644 --- a/arch/ppc/syslib/m8xx_setup.c +++ b/arch/ppc/syslib/m8xx_setup.c | |||
@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)]; | |||
57 | extern void m8xx_ide_init(void); | 57 | extern void m8xx_ide_init(void); |
58 | 58 | ||
59 | extern unsigned long find_available_memory(void); | 59 | extern unsigned long find_available_memory(void); |
60 | extern void m8xx_cpm_reset(uint cpm_page); | 60 | extern void m8xx_cpm_reset(); |
61 | extern void m8xx_wdt_handler_install(bd_t *bp); | 61 | extern void m8xx_wdt_handler_install(bd_t *bp); |
62 | extern void rpxfb_alloc_pages(void); | 62 | extern void rpxfb_alloc_pages(void); |
63 | extern void cpm_interrupt_init(void); | 63 | extern void cpm_interrupt_init(void); |
@@ -70,13 +70,9 @@ board_init(void) | |||
70 | void __init | 70 | void __init |
71 | m8xx_setup_arch(void) | 71 | m8xx_setup_arch(void) |
72 | { | 72 | { |
73 | int cpm_page; | ||
74 | |||
75 | cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE); | ||
76 | |||
77 | /* Reset the Communication Processor Module. | 73 | /* Reset the Communication Processor Module. |
78 | */ | 74 | */ |
79 | m8xx_cpm_reset(cpm_page); | 75 | m8xx_cpm_reset(); |
80 | 76 | ||
81 | #ifdef CONFIG_FB_RPX | 77 | #ifdef CONFIG_FB_RPX |
82 | rpxfb_alloc_pages(); | 78 | rpxfb_alloc_pages(); |
diff --git a/arch/ppc/syslib/mpc83xx_devices.c b/arch/ppc/syslib/mpc83xx_devices.c index 75c8e9834ae7..5aaf0e58e1f9 100644 --- a/arch/ppc/syslib/mpc83xx_devices.c +++ b/arch/ppc/syslib/mpc83xx_devices.c | |||
@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
191 | .num_resources = 2, | 191 | .num_resources = 2, |
192 | .resource = (struct resource[]) { | 192 | .resource = (struct resource[]) { |
193 | { | 193 | { |
194 | .start = 0x22000, | 194 | .start = 0x23000, |
195 | .end = 0x22fff, | 195 | .end = 0x23fff, |
196 | .flags = IORESOURCE_MEM, | 196 | .flags = IORESOURCE_MEM, |
197 | }, | 197 | }, |
198 | { | 198 | { |
@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = { | |||
208 | .num_resources = 2, | 208 | .num_resources = 2, |
209 | .resource = (struct resource[]) { | 209 | .resource = (struct resource[]) { |
210 | { | 210 | { |
211 | .start = 0x23000, | 211 | .start = 0x22000, |
212 | .end = 0x23fff, | 212 | .end = 0x22fff, |
213 | .flags = IORESOURCE_MEM, | 213 | .flags = IORESOURCE_MEM, |
214 | }, | 214 | }, |
215 | { | 215 | { |
diff --git a/arch/ppc64/boot/zlib.c b/arch/ppc64/boot/zlib.c index 9d5e4e9832d2..78837e884b8b 100644 --- a/arch/ppc64/boot/zlib.c +++ b/arch/ppc64/boot/zlib.c | |||
@@ -1307,7 +1307,7 @@ local int huft_build( | |||
1307 | { | 1307 | { |
1308 | *t = (inflate_huft *)Z_NULL; | 1308 | *t = (inflate_huft *)Z_NULL; |
1309 | *m = 0; | 1309 | *m = 0; |
1310 | return Z_OK; | 1310 | return Z_DATA_ERROR; |
1311 | } | 1311 | } |
1312 | 1312 | ||
1313 | 1313 | ||
@@ -1351,6 +1351,7 @@ local int huft_build( | |||
1351 | if ((j = *p++) != 0) | 1351 | if ((j = *p++) != 0) |
1352 | v[x[j]++] = i; | 1352 | v[x[j]++] = i; |
1353 | } while (++i < n); | 1353 | } while (++i < n); |
1354 | n = x[g]; /* set n to length of v */ | ||
1354 | 1355 | ||
1355 | 1356 | ||
1356 | /* Generate the Huffman codes and for each, make the table entries */ | 1357 | /* Generate the Huffman codes and for each, make the table entries */ |
diff --git a/arch/ppc64/configs/bpa_defconfig b/arch/ppc64/configs/bpa_defconfig new file mode 100644 index 000000000000..46c5da41c3ae --- /dev/null +++ b/arch/ppc64/configs/bpa_defconfig | |||
@@ -0,0 +1,987 @@ | |||
1 | # | ||
2 | # Automatically generated make config: don't edit | ||
3 | # Linux kernel version: 2.6.13-rc6 | ||
4 | # Mon Aug 8 14:12:19 2005 | ||
5 | # | ||
6 | CONFIG_64BIT=y | ||
7 | CONFIG_MMU=y | ||
8 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
9 | CONFIG_GENERIC_CALIBRATE_DELAY=y | ||
10 | CONFIG_GENERIC_ISA_DMA=y | ||
11 | CONFIG_HAVE_DEC_LOCK=y | ||
12 | CONFIG_EARLY_PRINTK=y | ||
13 | CONFIG_COMPAT=y | ||
14 | CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | ||
15 | CONFIG_FORCE_MAX_ZONEORDER=13 | ||
16 | |||
17 | # | ||
18 | # Code maturity level options | ||
19 | # | ||
20 | CONFIG_EXPERIMENTAL=y | ||
21 | CONFIG_CLEAN_COMPILE=y | ||
22 | CONFIG_LOCK_KERNEL=y | ||
23 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
24 | |||
25 | # | ||
26 | # General setup | ||
27 | # | ||
28 | CONFIG_LOCALVERSION="" | ||
29 | CONFIG_SWAP=y | ||
30 | CONFIG_SYSVIPC=y | ||
31 | # CONFIG_POSIX_MQUEUE is not set | ||
32 | # CONFIG_BSD_PROCESS_ACCT is not set | ||
33 | CONFIG_SYSCTL=y | ||
34 | # CONFIG_AUDIT is not set | ||
35 | CONFIG_HOTPLUG=y | ||
36 | CONFIG_KOBJECT_UEVENT=y | ||
37 | # CONFIG_IKCONFIG is not set | ||
38 | # CONFIG_CPUSETS is not set | ||
39 | # CONFIG_EMBEDDED is not set | ||
40 | CONFIG_KALLSYMS=y | ||
41 | # CONFIG_KALLSYMS_ALL is not set | ||
42 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | ||
43 | CONFIG_PRINTK=y | ||
44 | CONFIG_BUG=y | ||
45 | CONFIG_BASE_FULL=y | ||
46 | CONFIG_FUTEX=y | ||
47 | CONFIG_EPOLL=y | ||
48 | CONFIG_SHMEM=y | ||
49 | CONFIG_CC_ALIGN_FUNCTIONS=0 | ||
50 | CONFIG_CC_ALIGN_LABELS=0 | ||
51 | CONFIG_CC_ALIGN_LOOPS=0 | ||
52 | CONFIG_CC_ALIGN_JUMPS=0 | ||
53 | # CONFIG_TINY_SHMEM is not set | ||
54 | CONFIG_BASE_SMALL=0 | ||
55 | |||
56 | # | ||
57 | # Loadable module support | ||
58 | # | ||
59 | CONFIG_MODULES=y | ||
60 | CONFIG_MODULE_UNLOAD=y | ||
61 | # CONFIG_MODULE_FORCE_UNLOAD is not set | ||
62 | CONFIG_OBSOLETE_MODPARM=y | ||
63 | # CONFIG_MODVERSIONS is not set | ||
64 | # CONFIG_MODULE_SRCVERSION_ALL is not set | ||
65 | # CONFIG_KMOD is not set | ||
66 | CONFIG_STOP_MACHINE=y | ||
67 | CONFIG_SYSVIPC_COMPAT=y | ||
68 | |||
69 | # | ||
70 | # Platform support | ||
71 | # | ||
72 | # CONFIG_PPC_ISERIES is not set | ||
73 | CONFIG_PPC_MULTIPLATFORM=y | ||
74 | # CONFIG_PPC_PSERIES is not set | ||
75 | CONFIG_PPC_BPA=y | ||
76 | # CONFIG_PPC_PMAC is not set | ||
77 | # CONFIG_PPC_MAPLE is not set | ||
78 | CONFIG_PPC=y | ||
79 | CONFIG_PPC64=y | ||
80 | CONFIG_PPC_OF=y | ||
81 | CONFIG_BPA_IIC=y | ||
82 | CONFIG_ALTIVEC=y | ||
83 | CONFIG_KEXEC=y | ||
84 | # CONFIG_U3_DART is not set | ||
85 | # CONFIG_BOOTX_TEXT is not set | ||
86 | # CONFIG_POWER4_ONLY is not set | ||
87 | # CONFIG_IOMMU_VMERGE is not set | ||
88 | CONFIG_SMP=y | ||
89 | CONFIG_NR_CPUS=4 | ||
90 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
91 | CONFIG_ARCH_FLATMEM_ENABLE=y | ||
92 | CONFIG_SELECT_MEMORY_MODEL=y | ||
93 | CONFIG_FLATMEM_MANUAL=y | ||
94 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
95 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
96 | CONFIG_FLATMEM=y | ||
97 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
98 | # CONFIG_NUMA is not set | ||
99 | CONFIG_SCHED_SMT=y | ||
100 | CONFIG_PREEMPT_NONE=y | ||
101 | # CONFIG_PREEMPT_VOLUNTARY is not set | ||
102 | # CONFIG_PREEMPT is not set | ||
103 | CONFIG_PREEMPT_BKL=y | ||
104 | # CONFIG_HZ_100 is not set | ||
105 | CONFIG_HZ_250=y | ||
106 | # CONFIG_HZ_1000 is not set | ||
107 | CONFIG_HZ=250 | ||
108 | CONFIG_GENERIC_HARDIRQS=y | ||
109 | CONFIG_PPC_RTAS=y | ||
110 | CONFIG_RTAS_PROC=y | ||
111 | CONFIG_RTAS_FLASH=y | ||
112 | CONFIG_SECCOMP=y | ||
113 | CONFIG_ISA_DMA_API=y | ||
114 | |||
115 | # | ||
116 | # General setup | ||
117 | # | ||
118 | CONFIG_PCI=y | ||
119 | CONFIG_PCI_DOMAINS=y | ||
120 | CONFIG_BINFMT_ELF=y | ||
121 | # CONFIG_BINFMT_MISC is not set | ||
122 | CONFIG_PCI_LEGACY_PROC=y | ||
123 | CONFIG_PCI_NAMES=y | ||
124 | # CONFIG_PCI_DEBUG is not set | ||
125 | |||
126 | # | ||
127 | # PCCARD (PCMCIA/CardBus) support | ||
128 | # | ||
129 | # CONFIG_PCCARD is not set | ||
130 | |||
131 | # | ||
132 | # PCI Hotplug Support | ||
133 | # | ||
134 | # CONFIG_HOTPLUG_PCI is not set | ||
135 | CONFIG_PROC_DEVICETREE=y | ||
136 | # CONFIG_CMDLINE_BOOL is not set | ||
137 | |||
138 | # | ||
139 | # Networking | ||
140 | # | ||
141 | CONFIG_NET=y | ||
142 | |||
143 | # | ||
144 | # Networking options | ||
145 | # | ||
146 | CONFIG_PACKET=y | ||
147 | # CONFIG_PACKET_MMAP is not set | ||
148 | CONFIG_UNIX=y | ||
149 | CONFIG_XFRM=y | ||
150 | # CONFIG_XFRM_USER is not set | ||
151 | # CONFIG_NET_KEY is not set | ||
152 | CONFIG_INET=y | ||
153 | CONFIG_IP_MULTICAST=y | ||
154 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
155 | CONFIG_IP_FIB_HASH=y | ||
156 | # CONFIG_IP_PNP is not set | ||
157 | CONFIG_NET_IPIP=y | ||
158 | # CONFIG_NET_IPGRE is not set | ||
159 | # CONFIG_IP_MROUTE is not set | ||
160 | # CONFIG_ARPD is not set | ||
161 | CONFIG_SYN_COOKIES=y | ||
162 | # CONFIG_INET_AH is not set | ||
163 | # CONFIG_INET_ESP is not set | ||
164 | # CONFIG_INET_IPCOMP is not set | ||
165 | CONFIG_INET_TUNNEL=y | ||
166 | CONFIG_IP_TCPDIAG=y | ||
167 | CONFIG_IP_TCPDIAG_IPV6=y | ||
168 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
169 | CONFIG_TCP_CONG_BIC=y | ||
170 | |||
171 | # | ||
172 | # IP: Virtual Server Configuration | ||
173 | # | ||
174 | # CONFIG_IP_VS is not set | ||
175 | CONFIG_IPV6=y | ||
176 | # CONFIG_IPV6_PRIVACY is not set | ||
177 | CONFIG_INET6_AH=m | ||
178 | CONFIG_INET6_ESP=m | ||
179 | CONFIG_INET6_IPCOMP=m | ||
180 | CONFIG_INET6_TUNNEL=m | ||
181 | CONFIG_IPV6_TUNNEL=m | ||
182 | CONFIG_NETFILTER=y | ||
183 | # CONFIG_NETFILTER_DEBUG is not set | ||
184 | |||
185 | # | ||
186 | # IP: Netfilter Configuration | ||
187 | # | ||
188 | CONFIG_IP_NF_CONNTRACK=y | ||
189 | # CONFIG_IP_NF_CT_ACCT is not set | ||
190 | # CONFIG_IP_NF_CONNTRACK_MARK is not set | ||
191 | CONFIG_IP_NF_CT_PROTO_SCTP=y | ||
192 | CONFIG_IP_NF_FTP=m | ||
193 | CONFIG_IP_NF_IRC=m | ||
194 | CONFIG_IP_NF_TFTP=m | ||
195 | CONFIG_IP_NF_AMANDA=m | ||
196 | CONFIG_IP_NF_QUEUE=m | ||
197 | CONFIG_IP_NF_IPTABLES=m | ||
198 | CONFIG_IP_NF_MATCH_LIMIT=m | ||
199 | CONFIG_IP_NF_MATCH_IPRANGE=m | ||
200 | CONFIG_IP_NF_MATCH_MAC=m | ||
201 | CONFIG_IP_NF_MATCH_PKTTYPE=m | ||
202 | CONFIG_IP_NF_MATCH_MARK=m | ||
203 | CONFIG_IP_NF_MATCH_MULTIPORT=m | ||
204 | CONFIG_IP_NF_MATCH_TOS=m | ||
205 | CONFIG_IP_NF_MATCH_RECENT=m | ||
206 | CONFIG_IP_NF_MATCH_ECN=m | ||
207 | CONFIG_IP_NF_MATCH_DSCP=m | ||
208 | CONFIG_IP_NF_MATCH_AH_ESP=m | ||
209 | CONFIG_IP_NF_MATCH_LENGTH=m | ||
210 | CONFIG_IP_NF_MATCH_TTL=m | ||
211 | CONFIG_IP_NF_MATCH_TCPMSS=m | ||
212 | CONFIG_IP_NF_MATCH_HELPER=m | ||
213 | CONFIG_IP_NF_MATCH_STATE=m | ||
214 | CONFIG_IP_NF_MATCH_CONNTRACK=m | ||
215 | CONFIG_IP_NF_MATCH_OWNER=m | ||
216 | CONFIG_IP_NF_MATCH_ADDRTYPE=m | ||
217 | CONFIG_IP_NF_MATCH_REALM=m | ||
218 | CONFIG_IP_NF_MATCH_SCTP=m | ||
219 | CONFIG_IP_NF_MATCH_COMMENT=m | ||
220 | CONFIG_IP_NF_MATCH_HASHLIMIT=m | ||
221 | CONFIG_IP_NF_FILTER=m | ||
222 | CONFIG_IP_NF_TARGET_REJECT=m | ||
223 | CONFIG_IP_NF_TARGET_LOG=m | ||
224 | CONFIG_IP_NF_TARGET_ULOG=m | ||
225 | CONFIG_IP_NF_TARGET_TCPMSS=m | ||
226 | CONFIG_IP_NF_NAT=m | ||
227 | CONFIG_IP_NF_NAT_NEEDED=y | ||
228 | CONFIG_IP_NF_TARGET_MASQUERADE=m | ||
229 | CONFIG_IP_NF_TARGET_REDIRECT=m | ||
230 | CONFIG_IP_NF_TARGET_NETMAP=m | ||
231 | CONFIG_IP_NF_TARGET_SAME=m | ||
232 | CONFIG_IP_NF_NAT_SNMP_BASIC=m | ||
233 | CONFIG_IP_NF_NAT_IRC=m | ||
234 | CONFIG_IP_NF_NAT_FTP=m | ||
235 | CONFIG_IP_NF_NAT_TFTP=m | ||
236 | CONFIG_IP_NF_NAT_AMANDA=m | ||
237 | CONFIG_IP_NF_MANGLE=m | ||
238 | CONFIG_IP_NF_TARGET_TOS=m | ||
239 | CONFIG_IP_NF_TARGET_ECN=m | ||
240 | CONFIG_IP_NF_TARGET_DSCP=m | ||
241 | CONFIG_IP_NF_TARGET_MARK=m | ||
242 | CONFIG_IP_NF_TARGET_CLASSIFY=m | ||
243 | CONFIG_IP_NF_RAW=m | ||
244 | CONFIG_IP_NF_TARGET_NOTRACK=m | ||
245 | CONFIG_IP_NF_ARPTABLES=m | ||
246 | CONFIG_IP_NF_ARPFILTER=m | ||
247 | CONFIG_IP_NF_ARP_MANGLE=m | ||
248 | |||
249 | # | ||
250 | # IPv6: Netfilter Configuration (EXPERIMENTAL) | ||
251 | # | ||
252 | # CONFIG_IP6_NF_QUEUE is not set | ||
253 | # CONFIG_IP6_NF_IPTABLES is not set | ||
254 | |||
255 | # | ||
256 | # SCTP Configuration (EXPERIMENTAL) | ||
257 | # | ||
258 | # CONFIG_IP_SCTP is not set | ||
259 | # CONFIG_ATM is not set | ||
260 | # CONFIG_BRIDGE is not set | ||
261 | # CONFIG_VLAN_8021Q is not set | ||
262 | # CONFIG_DECNET is not set | ||
263 | # CONFIG_LLC2 is not set | ||
264 | # CONFIG_IPX is not set | ||
265 | # CONFIG_ATALK is not set | ||
266 | # CONFIG_X25 is not set | ||
267 | # CONFIG_LAPB is not set | ||
268 | # CONFIG_NET_DIVERT is not set | ||
269 | # CONFIG_ECONET is not set | ||
270 | # CONFIG_WAN_ROUTER is not set | ||
271 | # CONFIG_NET_SCHED is not set | ||
272 | CONFIG_NET_CLS_ROUTE=y | ||
273 | |||
274 | # | ||
275 | # Network testing | ||
276 | # | ||
277 | # CONFIG_NET_PKTGEN is not set | ||
278 | # CONFIG_HAMRADIO is not set | ||
279 | # CONFIG_IRDA is not set | ||
280 | # CONFIG_BT is not set | ||
281 | |||
282 | # | ||
283 | # Device Drivers | ||
284 | # | ||
285 | |||
286 | # | ||
287 | # Generic Driver Options | ||
288 | # | ||
289 | CONFIG_STANDALONE=y | ||
290 | CONFIG_PREVENT_FIRMWARE_BUILD=y | ||
291 | CONFIG_FW_LOADER=y | ||
292 | # CONFIG_DEBUG_DRIVER is not set | ||
293 | |||
294 | # | ||
295 | # Memory Technology Devices (MTD) | ||
296 | # | ||
297 | # CONFIG_MTD is not set | ||
298 | |||
299 | # | ||
300 | # Parallel port support | ||
301 | # | ||
302 | # CONFIG_PARPORT is not set | ||
303 | |||
304 | # | ||
305 | # Plug and Play support | ||
306 | # | ||
307 | |||
308 | # | ||
309 | # Block devices | ||
310 | # | ||
311 | # CONFIG_BLK_DEV_FD is not set | ||
312 | # CONFIG_BLK_CPQ_DA is not set | ||
313 | # CONFIG_BLK_CPQ_CISS_DA is not set | ||
314 | # CONFIG_BLK_DEV_DAC960 is not set | ||
315 | # CONFIG_BLK_DEV_UMEM is not set | ||
316 | # CONFIG_BLK_DEV_COW_COMMON is not set | ||
317 | CONFIG_BLK_DEV_LOOP=y | ||
318 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
319 | CONFIG_BLK_DEV_NBD=y | ||
320 | # CONFIG_BLK_DEV_SX8 is not set | ||
321 | CONFIG_BLK_DEV_RAM=y | ||
322 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
323 | CONFIG_BLK_DEV_RAM_SIZE=131072 | ||
324 | CONFIG_BLK_DEV_INITRD=y | ||
325 | CONFIG_INITRAMFS_SOURCE="" | ||
326 | # CONFIG_CDROM_PKTCDVD is not set | ||
327 | |||
328 | # | ||
329 | # IO Schedulers | ||
330 | # | ||
331 | CONFIG_IOSCHED_NOOP=y | ||
332 | CONFIG_IOSCHED_AS=y | ||
333 | CONFIG_IOSCHED_DEADLINE=y | ||
334 | CONFIG_IOSCHED_CFQ=y | ||
335 | # CONFIG_ATA_OVER_ETH is not set | ||
336 | |||
337 | # | ||
338 | # ATA/ATAPI/MFM/RLL support | ||
339 | # | ||
340 | CONFIG_IDE=y | ||
341 | CONFIG_BLK_DEV_IDE=y | ||
342 | |||
343 | # | ||
344 | # Please see Documentation/ide.txt for help/info on IDE drives | ||
345 | # | ||
346 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
347 | CONFIG_BLK_DEV_IDEDISK=y | ||
348 | CONFIG_IDEDISK_MULTI_MODE=y | ||
349 | # CONFIG_BLK_DEV_IDECD is not set | ||
350 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
351 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
352 | # CONFIG_IDE_TASK_IOCTL is not set | ||
353 | |||
354 | # | ||
355 | # IDE chipset support/bugfixes | ||
356 | # | ||
357 | CONFIG_IDE_GENERIC=y | ||
358 | CONFIG_BLK_DEV_IDEPCI=y | ||
359 | CONFIG_IDEPCI_SHARE_IRQ=y | ||
360 | # CONFIG_BLK_DEV_OFFBOARD is not set | ||
361 | CONFIG_BLK_DEV_GENERIC=y | ||
362 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
363 | # CONFIG_BLK_DEV_SL82C105 is not set | ||
364 | CONFIG_BLK_DEV_IDEDMA_PCI=y | ||
365 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | ||
366 | CONFIG_IDEDMA_PCI_AUTO=y | ||
367 | # CONFIG_IDEDMA_ONLYDISK is not set | ||
368 | CONFIG_BLK_DEV_AEC62XX=y | ||
369 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
370 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
371 | # CONFIG_BLK_DEV_CMD64X is not set | ||
372 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
373 | # CONFIG_BLK_DEV_CY82C693 is not set | ||
374 | # CONFIG_BLK_DEV_CS5520 is not set | ||
375 | # CONFIG_BLK_DEV_CS5530 is not set | ||
376 | # CONFIG_BLK_DEV_HPT34X is not set | ||
377 | # CONFIG_BLK_DEV_HPT366 is not set | ||
378 | # CONFIG_BLK_DEV_SC1200 is not set | ||
379 | # CONFIG_BLK_DEV_PIIX is not set | ||
380 | # CONFIG_BLK_DEV_IT821X is not set | ||
381 | # CONFIG_BLK_DEV_NS87415 is not set | ||
382 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
383 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
384 | # CONFIG_BLK_DEV_SVWKS is not set | ||
385 | CONFIG_BLK_DEV_SIIMAGE=y | ||
386 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
387 | # CONFIG_BLK_DEV_TRM290 is not set | ||
388 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
389 | # CONFIG_IDE_ARM is not set | ||
390 | CONFIG_BLK_DEV_IDEDMA=y | ||
391 | # CONFIG_IDEDMA_IVB is not set | ||
392 | CONFIG_IDEDMA_AUTO=y | ||
393 | # CONFIG_BLK_DEV_HD is not set | ||
394 | |||
395 | # | ||
396 | # SCSI device support | ||
397 | # | ||
398 | # CONFIG_SCSI is not set | ||
399 | |||
400 | # | ||
401 | # Multi-device support (RAID and LVM) | ||
402 | # | ||
403 | # CONFIG_MD is not set | ||
404 | |||
405 | # | ||
406 | # Fusion MPT device support | ||
407 | # | ||
408 | # CONFIG_FUSION is not set | ||
409 | |||
410 | # | ||
411 | # IEEE 1394 (FireWire) support | ||
412 | # | ||
413 | # CONFIG_IEEE1394 is not set | ||
414 | |||
415 | # | ||
416 | # I2O device support | ||
417 | # | ||
418 | # CONFIG_I2O is not set | ||
419 | |||
420 | # | ||
421 | # Macintosh device drivers | ||
422 | # | ||
423 | |||
424 | # | ||
425 | # Network device support | ||
426 | # | ||
427 | CONFIG_NETDEVICES=y | ||
428 | # CONFIG_DUMMY is not set | ||
429 | # CONFIG_BONDING is not set | ||
430 | # CONFIG_EQUALIZER is not set | ||
431 | # CONFIG_TUN is not set | ||
432 | |||
433 | # | ||
434 | # ARCnet devices | ||
435 | # | ||
436 | # CONFIG_ARCNET is not set | ||
437 | |||
438 | # | ||
439 | # Ethernet (10 or 100Mbit) | ||
440 | # | ||
441 | CONFIG_NET_ETHERNET=y | ||
442 | CONFIG_MII=y | ||
443 | # CONFIG_HAPPYMEAL is not set | ||
444 | # CONFIG_SUNGEM is not set | ||
445 | # CONFIG_NET_VENDOR_3COM is not set | ||
446 | |||
447 | # | ||
448 | # Tulip family network device support | ||
449 | # | ||
450 | # CONFIG_NET_TULIP is not set | ||
451 | # CONFIG_HP100 is not set | ||
452 | # CONFIG_NET_PCI is not set | ||
453 | |||
454 | # | ||
455 | # Ethernet (1000 Mbit) | ||
456 | # | ||
457 | # CONFIG_ACENIC is not set | ||
458 | # CONFIG_DL2K is not set | ||
459 | CONFIG_E1000=m | ||
460 | # CONFIG_E1000_NAPI is not set | ||
461 | # CONFIG_NS83820 is not set | ||
462 | # CONFIG_HAMACHI is not set | ||
463 | # CONFIG_YELLOWFIN is not set | ||
464 | # CONFIG_R8169 is not set | ||
465 | CONFIG_SKGE=m | ||
466 | # CONFIG_SK98LIN is not set | ||
467 | # CONFIG_TIGON3 is not set | ||
468 | # CONFIG_BNX2 is not set | ||
469 | # CONFIG_MV643XX_ETH is not set | ||
470 | |||
471 | # | ||
472 | # Ethernet (10000 Mbit) | ||
473 | # | ||
474 | # CONFIG_IXGB is not set | ||
475 | # CONFIG_S2IO is not set | ||
476 | |||
477 | # | ||
478 | # Token Ring devices | ||
479 | # | ||
480 | # CONFIG_TR is not set | ||
481 | |||
482 | # | ||
483 | # Wireless LAN (non-hamradio) | ||
484 | # | ||
485 | # CONFIG_NET_RADIO is not set | ||
486 | |||
487 | # | ||
488 | # Wan interfaces | ||
489 | # | ||
490 | # CONFIG_WAN is not set | ||
491 | # CONFIG_FDDI is not set | ||
492 | # CONFIG_HIPPI is not set | ||
493 | # CONFIG_PPP is not set | ||
494 | # CONFIG_SLIP is not set | ||
495 | # CONFIG_SHAPER is not set | ||
496 | # CONFIG_NETCONSOLE is not set | ||
497 | # CONFIG_NETPOLL is not set | ||
498 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
499 | |||
500 | # | ||
501 | # ISDN subsystem | ||
502 | # | ||
503 | # CONFIG_ISDN is not set | ||
504 | |||
505 | # | ||
506 | # Telephony Support | ||
507 | # | ||
508 | # CONFIG_PHONE is not set | ||
509 | |||
510 | # | ||
511 | # Input device support | ||
512 | # | ||
513 | CONFIG_INPUT=y | ||
514 | |||
515 | # | ||
516 | # Userland interfaces | ||
517 | # | ||
518 | CONFIG_INPUT_MOUSEDEV=y | ||
519 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
520 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | ||
521 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | ||
522 | # CONFIG_INPUT_JOYDEV is not set | ||
523 | # CONFIG_INPUT_TSDEV is not set | ||
524 | # CONFIG_INPUT_EVDEV is not set | ||
525 | # CONFIG_INPUT_EVBUG is not set | ||
526 | |||
527 | # | ||
528 | # Input Device Drivers | ||
529 | # | ||
530 | # CONFIG_INPUT_KEYBOARD is not set | ||
531 | # CONFIG_INPUT_MOUSE is not set | ||
532 | # CONFIG_INPUT_JOYSTICK is not set | ||
533 | # CONFIG_INPUT_TOUCHSCREEN is not set | ||
534 | # CONFIG_INPUT_MISC is not set | ||
535 | |||
536 | # | ||
537 | # Hardware I/O ports | ||
538 | # | ||
539 | CONFIG_SERIO=y | ||
540 | # CONFIG_SERIO_I8042 is not set | ||
541 | CONFIG_SERIO_SERPORT=y | ||
542 | # CONFIG_SERIO_PCIPS2 is not set | ||
543 | # CONFIG_SERIO_RAW is not set | ||
544 | # CONFIG_GAMEPORT is not set | ||
545 | |||
546 | # | ||
547 | # Character devices | ||
548 | # | ||
549 | CONFIG_VT=y | ||
550 | CONFIG_VT_CONSOLE=y | ||
551 | CONFIG_HW_CONSOLE=y | ||
552 | CONFIG_SERIAL_NONSTANDARD=y | ||
553 | # CONFIG_ROCKETPORT is not set | ||
554 | # CONFIG_CYCLADES is not set | ||
555 | # CONFIG_MOXA_SMARTIO is not set | ||
556 | # CONFIG_ISI is not set | ||
557 | # CONFIG_SYNCLINK is not set | ||
558 | # CONFIG_SYNCLINKMP is not set | ||
559 | # CONFIG_N_HDLC is not set | ||
560 | # CONFIG_SPECIALIX is not set | ||
561 | # CONFIG_SX is not set | ||
562 | # CONFIG_STALDRV is not set | ||
563 | |||
564 | # | ||
565 | # Serial drivers | ||
566 | # | ||
567 | CONFIG_SERIAL_8250=y | ||
568 | CONFIG_SERIAL_8250_CONSOLE=y | ||
569 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
570 | # CONFIG_SERIAL_8250_EXTENDED is not set | ||
571 | |||
572 | # | ||
573 | # Non-8250 serial port support | ||
574 | # | ||
575 | CONFIG_SERIAL_CORE=y | ||
576 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
577 | # CONFIG_SERIAL_JSM is not set | ||
578 | CONFIG_UNIX98_PTYS=y | ||
579 | # CONFIG_LEGACY_PTYS is not set | ||
580 | |||
581 | # | ||
582 | # IPMI | ||
583 | # | ||
584 | # CONFIG_IPMI_HANDLER is not set | ||
585 | |||
586 | # | ||
587 | # Watchdog Cards | ||
588 | # | ||
589 | CONFIG_WATCHDOG=y | ||
590 | # CONFIG_WATCHDOG_NOWAYOUT is not set | ||
591 | |||
592 | # | ||
593 | # Watchdog Device Drivers | ||
594 | # | ||
595 | # CONFIG_SOFT_WATCHDOG is not set | ||
596 | CONFIG_WATCHDOG_RTAS=y | ||
597 | |||
598 | # | ||
599 | # PCI-based Watchdog Cards | ||
600 | # | ||
601 | # CONFIG_PCIPCWATCHDOG is not set | ||
602 | # CONFIG_WDTPCI is not set | ||
603 | # CONFIG_RTC is not set | ||
604 | # CONFIG_DTLK is not set | ||
605 | # CONFIG_R3964 is not set | ||
606 | # CONFIG_APPLICOM is not set | ||
607 | |||
608 | # | ||
609 | # Ftape, the floppy tape device driver | ||
610 | # | ||
611 | # CONFIG_AGP is not set | ||
612 | # CONFIG_DRM is not set | ||
613 | # CONFIG_RAW_DRIVER is not set | ||
614 | # CONFIG_HANGCHECK_TIMER is not set | ||
615 | |||
616 | # | ||
617 | # TPM devices | ||
618 | # | ||
619 | # CONFIG_TCG_TPM is not set | ||
620 | |||
621 | # | ||
622 | # I2C support | ||
623 | # | ||
624 | CONFIG_I2C=y | ||
625 | # CONFIG_I2C_CHARDEV is not set | ||
626 | |||
627 | # | ||
628 | # I2C Algorithms | ||
629 | # | ||
630 | CONFIG_I2C_ALGOBIT=y | ||
631 | # CONFIG_I2C_ALGOPCF is not set | ||
632 | # CONFIG_I2C_ALGOPCA is not set | ||
633 | |||
634 | # | ||
635 | # I2C Hardware Bus support | ||
636 | # | ||
637 | # CONFIG_I2C_ALI1535 is not set | ||
638 | # CONFIG_I2C_ALI1563 is not set | ||
639 | # CONFIG_I2C_ALI15X3 is not set | ||
640 | # CONFIG_I2C_AMD756 is not set | ||
641 | # CONFIG_I2C_AMD8111 is not set | ||
642 | # CONFIG_I2C_I801 is not set | ||
643 | # CONFIG_I2C_I810 is not set | ||
644 | # CONFIG_I2C_PIIX4 is not set | ||
645 | # CONFIG_I2C_ISA is not set | ||
646 | # CONFIG_I2C_NFORCE2 is not set | ||
647 | # CONFIG_I2C_PARPORT_LIGHT is not set | ||
648 | # CONFIG_I2C_PROSAVAGE is not set | ||
649 | # CONFIG_I2C_SAVAGE4 is not set | ||
650 | # CONFIG_SCx200_ACB is not set | ||
651 | # CONFIG_I2C_SIS5595 is not set | ||
652 | # CONFIG_I2C_SIS630 is not set | ||
653 | # CONFIG_I2C_SIS96X is not set | ||
654 | # CONFIG_I2C_STUB is not set | ||
655 | # CONFIG_I2C_VIA is not set | ||
656 | # CONFIG_I2C_VIAPRO is not set | ||
657 | # CONFIG_I2C_VOODOO3 is not set | ||
658 | # CONFIG_I2C_PCA_ISA is not set | ||
659 | # CONFIG_I2C_SENSOR is not set | ||
660 | |||
661 | # | ||
662 | # Miscellaneous I2C Chip support | ||
663 | # | ||
664 | # CONFIG_SENSORS_DS1337 is not set | ||
665 | # CONFIG_SENSORS_DS1374 is not set | ||
666 | # CONFIG_SENSORS_EEPROM is not set | ||
667 | # CONFIG_SENSORS_PCF8574 is not set | ||
668 | # CONFIG_SENSORS_PCA9539 is not set | ||
669 | # CONFIG_SENSORS_PCF8591 is not set | ||
670 | # CONFIG_SENSORS_RTC8564 is not set | ||
671 | # CONFIG_SENSORS_MAX6875 is not set | ||
672 | # CONFIG_I2C_DEBUG_CORE is not set | ||
673 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
674 | # CONFIG_I2C_DEBUG_BUS is not set | ||
675 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
676 | |||
677 | # | ||
678 | # Dallas's 1-wire bus | ||
679 | # | ||
680 | # CONFIG_W1 is not set | ||
681 | |||
682 | # | ||
683 | # Hardware Monitoring support | ||
684 | # | ||
685 | # CONFIG_HWMON is not set | ||
686 | |||
687 | # | ||
688 | # Misc devices | ||
689 | # | ||
690 | |||
691 | # | ||
692 | # Multimedia devices | ||
693 | # | ||
694 | # CONFIG_VIDEO_DEV is not set | ||
695 | |||
696 | # | ||
697 | # Digital Video Broadcasting Devices | ||
698 | # | ||
699 | # CONFIG_DVB is not set | ||
700 | |||
701 | # | ||
702 | # Graphics support | ||
703 | # | ||
704 | # CONFIG_FB is not set | ||
705 | |||
706 | # | ||
707 | # Console display driver support | ||
708 | # | ||
709 | # CONFIG_VGA_CONSOLE is not set | ||
710 | CONFIG_DUMMY_CONSOLE=y | ||
711 | |||
712 | # | ||
713 | # Sound | ||
714 | # | ||
715 | # CONFIG_SOUND is not set | ||
716 | |||
717 | # | ||
718 | # USB support | ||
719 | # | ||
720 | CONFIG_USB_ARCH_HAS_HCD=y | ||
721 | CONFIG_USB_ARCH_HAS_OHCI=y | ||
722 | # CONFIG_USB is not set | ||
723 | |||
724 | # | ||
725 | # USB Gadget Support | ||
726 | # | ||
727 | # CONFIG_USB_GADGET is not set | ||
728 | |||
729 | # | ||
730 | # MMC/SD Card support | ||
731 | # | ||
732 | # CONFIG_MMC is not set | ||
733 | |||
734 | # | ||
735 | # InfiniBand support | ||
736 | # | ||
737 | # CONFIG_INFINIBAND is not set | ||
738 | |||
739 | # | ||
740 | # SN Devices | ||
741 | # | ||
742 | |||
743 | # | ||
744 | # File systems | ||
745 | # | ||
746 | CONFIG_EXT2_FS=y | ||
747 | # CONFIG_EXT2_FS_XATTR is not set | ||
748 | # CONFIG_EXT2_FS_XIP is not set | ||
749 | CONFIG_EXT3_FS=y | ||
750 | CONFIG_EXT3_FS_XATTR=y | ||
751 | # CONFIG_EXT3_FS_POSIX_ACL is not set | ||
752 | # CONFIG_EXT3_FS_SECURITY is not set | ||
753 | CONFIG_JBD=y | ||
754 | # CONFIG_JBD_DEBUG is not set | ||
755 | CONFIG_FS_MBCACHE=y | ||
756 | # CONFIG_REISERFS_FS is not set | ||
757 | # CONFIG_JFS_FS is not set | ||
758 | CONFIG_FS_POSIX_ACL=y | ||
759 | |||
760 | # | ||
761 | # XFS support | ||
762 | # | ||
763 | # CONFIG_XFS_FS is not set | ||
764 | # CONFIG_MINIX_FS is not set | ||
765 | # CONFIG_ROMFS_FS is not set | ||
766 | CONFIG_INOTIFY=y | ||
767 | # CONFIG_QUOTA is not set | ||
768 | CONFIG_DNOTIFY=y | ||
769 | # CONFIG_AUTOFS_FS is not set | ||
770 | # CONFIG_AUTOFS4_FS is not set | ||
771 | |||
772 | # | ||
773 | # CD-ROM/DVD Filesystems | ||
774 | # | ||
775 | CONFIG_ISO9660_FS=m | ||
776 | CONFIG_JOLIET=y | ||
777 | # CONFIG_ZISOFS is not set | ||
778 | CONFIG_UDF_FS=m | ||
779 | CONFIG_UDF_NLS=y | ||
780 | |||
781 | # | ||
782 | # DOS/FAT/NT Filesystems | ||
783 | # | ||
784 | CONFIG_FAT_FS=m | ||
785 | CONFIG_MSDOS_FS=m | ||
786 | CONFIG_VFAT_FS=m | ||
787 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | ||
788 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | ||
789 | # CONFIG_NTFS_FS is not set | ||
790 | |||
791 | # | ||
792 | # Pseudo filesystems | ||
793 | # | ||
794 | CONFIG_PROC_FS=y | ||
795 | CONFIG_PROC_KCORE=y | ||
796 | CONFIG_SYSFS=y | ||
797 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
798 | CONFIG_TMPFS=y | ||
799 | CONFIG_TMPFS_XATTR=y | ||
800 | # CONFIG_TMPFS_SECURITY is not set | ||
801 | CONFIG_HUGETLBFS=y | ||
802 | CONFIG_HUGETLB_PAGE=y | ||
803 | CONFIG_RAMFS=y | ||
804 | |||
805 | # | ||
806 | # Miscellaneous filesystems | ||
807 | # | ||
808 | # CONFIG_ADFS_FS is not set | ||
809 | # CONFIG_AFFS_FS is not set | ||
810 | # CONFIG_HFS_FS is not set | ||
811 | # CONFIG_HFSPLUS_FS is not set | ||
812 | # CONFIG_BEFS_FS is not set | ||
813 | # CONFIG_BFS_FS is not set | ||
814 | # CONFIG_EFS_FS is not set | ||
815 | # CONFIG_CRAMFS is not set | ||
816 | # CONFIG_VXFS_FS is not set | ||
817 | # CONFIG_HPFS_FS is not set | ||
818 | # CONFIG_QNX4FS_FS is not set | ||
819 | # CONFIG_SYSV_FS is not set | ||
820 | # CONFIG_UFS_FS is not set | ||
821 | |||
822 | # | ||
823 | # Network File Systems | ||
824 | # | ||
825 | CONFIG_NFS_FS=m | ||
826 | CONFIG_NFS_V3=y | ||
827 | CONFIG_NFS_V3_ACL=y | ||
828 | # CONFIG_NFS_V4 is not set | ||
829 | # CONFIG_NFS_DIRECTIO is not set | ||
830 | CONFIG_NFSD=m | ||
831 | CONFIG_NFSD_V2_ACL=y | ||
832 | CONFIG_NFSD_V3=y | ||
833 | CONFIG_NFSD_V3_ACL=y | ||
834 | # CONFIG_NFSD_V4 is not set | ||
835 | CONFIG_NFSD_TCP=y | ||
836 | CONFIG_LOCKD=m | ||
837 | CONFIG_LOCKD_V4=y | ||
838 | CONFIG_EXPORTFS=m | ||
839 | CONFIG_NFS_ACL_SUPPORT=m | ||
840 | CONFIG_NFS_COMMON=y | ||
841 | CONFIG_SUNRPC=m | ||
842 | # CONFIG_RPCSEC_GSS_KRB5 is not set | ||
843 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | ||
844 | # CONFIG_SMB_FS is not set | ||
845 | # CONFIG_CIFS is not set | ||
846 | # CONFIG_NCP_FS is not set | ||
847 | # CONFIG_CODA_FS is not set | ||
848 | # CONFIG_AFS_FS is not set | ||
849 | |||
850 | # | ||
851 | # Partition Types | ||
852 | # | ||
853 | CONFIG_PARTITION_ADVANCED=y | ||
854 | # CONFIG_ACORN_PARTITION is not set | ||
855 | # CONFIG_OSF_PARTITION is not set | ||
856 | # CONFIG_AMIGA_PARTITION is not set | ||
857 | # CONFIG_ATARI_PARTITION is not set | ||
858 | # CONFIG_MAC_PARTITION is not set | ||
859 | CONFIG_MSDOS_PARTITION=y | ||
860 | # CONFIG_BSD_DISKLABEL is not set | ||
861 | # CONFIG_MINIX_SUBPARTITION is not set | ||
862 | # CONFIG_SOLARIS_X86_PARTITION is not set | ||
863 | # CONFIG_UNIXWARE_DISKLABEL is not set | ||
864 | # CONFIG_LDM_PARTITION is not set | ||
865 | # CONFIG_SGI_PARTITION is not set | ||
866 | # CONFIG_ULTRIX_PARTITION is not set | ||
867 | # CONFIG_SUN_PARTITION is not set | ||
868 | CONFIG_EFI_PARTITION=y | ||
869 | |||
870 | # | ||
871 | # Native Language Support | ||
872 | # | ||
873 | CONFIG_NLS=m | ||
874 | CONFIG_NLS_DEFAULT="iso8859-1" | ||
875 | # CONFIG_NLS_CODEPAGE_437 is not set | ||
876 | # CONFIG_NLS_CODEPAGE_737 is not set | ||
877 | # CONFIG_NLS_CODEPAGE_775 is not set | ||
878 | # CONFIG_NLS_CODEPAGE_850 is not set | ||
879 | # CONFIG_NLS_CODEPAGE_852 is not set | ||
880 | # CONFIG_NLS_CODEPAGE_855 is not set | ||
881 | # CONFIG_NLS_CODEPAGE_857 is not set | ||
882 | # CONFIG_NLS_CODEPAGE_860 is not set | ||
883 | # CONFIG_NLS_CODEPAGE_861 is not set | ||
884 | # CONFIG_NLS_CODEPAGE_862 is not set | ||
885 | # CONFIG_NLS_CODEPAGE_863 is not set | ||
886 | # CONFIG_NLS_CODEPAGE_864 is not set | ||
887 | # CONFIG_NLS_CODEPAGE_865 is not set | ||
888 | # CONFIG_NLS_CODEPAGE_866 is not set | ||
889 | # CONFIG_NLS_CODEPAGE_869 is not set | ||
890 | # CONFIG_NLS_CODEPAGE_936 is not set | ||
891 | # CONFIG_NLS_CODEPAGE_950 is not set | ||
892 | # CONFIG_NLS_CODEPAGE_932 is not set | ||
893 | # CONFIG_NLS_CODEPAGE_949 is not set | ||
894 | # CONFIG_NLS_CODEPAGE_874 is not set | ||
895 | # CONFIG_NLS_ISO8859_8 is not set | ||
896 | # CONFIG_NLS_CODEPAGE_1250 is not set | ||
897 | # CONFIG_NLS_CODEPAGE_1251 is not set | ||
898 | # CONFIG_NLS_ASCII is not set | ||
899 | CONFIG_NLS_ISO8859_1=m | ||
900 | CONFIG_NLS_ISO8859_2=m | ||
901 | CONFIG_NLS_ISO8859_3=m | ||
902 | CONFIG_NLS_ISO8859_4=m | ||
903 | CONFIG_NLS_ISO8859_5=m | ||
904 | CONFIG_NLS_ISO8859_6=m | ||
905 | CONFIG_NLS_ISO8859_7=m | ||
906 | CONFIG_NLS_ISO8859_9=m | ||
907 | CONFIG_NLS_ISO8859_13=m | ||
908 | CONFIG_NLS_ISO8859_14=m | ||
909 | CONFIG_NLS_ISO8859_15=m | ||
910 | # CONFIG_NLS_KOI8_R is not set | ||
911 | # CONFIG_NLS_KOI8_U is not set | ||
912 | # CONFIG_NLS_UTF8 is not set | ||
913 | |||
914 | # | ||
915 | # Profiling support | ||
916 | # | ||
917 | # CONFIG_PROFILING is not set | ||
918 | |||
919 | # | ||
920 | # Kernel hacking | ||
921 | # | ||
922 | # CONFIG_PRINTK_TIME is not set | ||
923 | CONFIG_DEBUG_KERNEL=y | ||
924 | CONFIG_MAGIC_SYSRQ=y | ||
925 | CONFIG_LOG_BUF_SHIFT=15 | ||
926 | # CONFIG_SCHEDSTATS is not set | ||
927 | # CONFIG_DEBUG_SLAB is not set | ||
928 | # CONFIG_DEBUG_SPINLOCK is not set | ||
929 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | ||
930 | # CONFIG_DEBUG_KOBJECT is not set | ||
931 | # CONFIG_DEBUG_INFO is not set | ||
932 | CONFIG_DEBUG_FS=y | ||
933 | # CONFIG_DEBUG_STACKOVERFLOW is not set | ||
934 | # CONFIG_KPROBES is not set | ||
935 | # CONFIG_DEBUG_STACK_USAGE is not set | ||
936 | CONFIG_DEBUGGER=y | ||
937 | # CONFIG_XMON is not set | ||
938 | # CONFIG_PPCDBG is not set | ||
939 | CONFIG_IRQSTACKS=y | ||
940 | |||
941 | # | ||
942 | # Security options | ||
943 | # | ||
944 | # CONFIG_KEYS is not set | ||
945 | # CONFIG_SECURITY is not set | ||
946 | |||
947 | # | ||
948 | # Cryptographic options | ||
949 | # | ||
950 | CONFIG_CRYPTO=y | ||
951 | CONFIG_CRYPTO_HMAC=y | ||
952 | # CONFIG_CRYPTO_NULL is not set | ||
953 | # CONFIG_CRYPTO_MD4 is not set | ||
954 | CONFIG_CRYPTO_MD5=m | ||
955 | CONFIG_CRYPTO_SHA1=m | ||
956 | # CONFIG_CRYPTO_SHA256 is not set | ||
957 | # CONFIG_CRYPTO_SHA512 is not set | ||
958 | # CONFIG_CRYPTO_WP512 is not set | ||
959 | # CONFIG_CRYPTO_TGR192 is not set | ||
960 | CONFIG_CRYPTO_DES=m | ||
961 | # CONFIG_CRYPTO_BLOWFISH is not set | ||
962 | # CONFIG_CRYPTO_TWOFISH is not set | ||
963 | # CONFIG_CRYPTO_SERPENT is not set | ||
964 | # CONFIG_CRYPTO_AES is not set | ||
965 | # CONFIG_CRYPTO_CAST5 is not set | ||
966 | # CONFIG_CRYPTO_CAST6 is not set | ||
967 | # CONFIG_CRYPTO_TEA is not set | ||
968 | # CONFIG_CRYPTO_ARC4 is not set | ||
969 | # CONFIG_CRYPTO_KHAZAD is not set | ||
970 | # CONFIG_CRYPTO_ANUBIS is not set | ||
971 | CONFIG_CRYPTO_DEFLATE=m | ||
972 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | ||
973 | # CONFIG_CRYPTO_CRC32C is not set | ||
974 | # CONFIG_CRYPTO_TEST is not set | ||
975 | |||
976 | # | ||
977 | # Hardware crypto devices | ||
978 | # | ||
979 | |||
980 | # | ||
981 | # Library routines | ||
982 | # | ||
983 | # CONFIG_CRC_CCITT is not set | ||
984 | CONFIG_CRC32=y | ||
985 | # CONFIG_LIBCRC32C is not set | ||
986 | CONFIG_ZLIB_INFLATE=m | ||
987 | CONFIG_ZLIB_DEFLATE=m | ||
diff --git a/arch/ppc64/configs/g5_defconfig b/arch/ppc64/configs/g5_defconfig index 9e0abe8392fc..ab567741e80e 100644 --- a/arch/ppc64/configs/g5_defconfig +++ b/arch/ppc64/configs/g5_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:40:34 2005 | 4 | # Mon Aug 8 14:16:59 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -267,8 +267,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
267 | # Network testing | 267 | # Network testing |
268 | # | 268 | # |
269 | # CONFIG_NET_PKTGEN is not set | 269 | # CONFIG_NET_PKTGEN is not set |
270 | # CONFIG_NETPOLL is not set | ||
271 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
272 | # CONFIG_HAMRADIO is not set | 270 | # CONFIG_HAMRADIO is not set |
273 | # CONFIG_IRDA is not set | 271 | # CONFIG_IRDA is not set |
274 | # CONFIG_BT is not set | 272 | # CONFIG_BT is not set |
@@ -468,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
468 | # CONFIG_SCSI_QLA2300 is not set | 466 | # CONFIG_SCSI_QLA2300 is not set |
469 | # CONFIG_SCSI_QLA2322 is not set | 467 | # CONFIG_SCSI_QLA2322 is not set |
470 | # CONFIG_SCSI_QLA6312 is not set | 468 | # CONFIG_SCSI_QLA6312 is not set |
469 | # CONFIG_SCSI_QLA24XX is not set | ||
471 | # CONFIG_SCSI_LPFC is not set | 470 | # CONFIG_SCSI_LPFC is not set |
472 | # CONFIG_SCSI_DC395x is not set | 471 | # CONFIG_SCSI_DC395x is not set |
473 | # CONFIG_SCSI_DC390T is not set | 472 | # CONFIG_SCSI_DC390T is not set |
@@ -539,11 +538,9 @@ CONFIG_IEEE1394_RAWIO=y | |||
539 | # | 538 | # |
540 | # Macintosh device drivers | 539 | # Macintosh device drivers |
541 | # | 540 | # |
542 | CONFIG_ADB=y | ||
543 | CONFIG_ADB_PMU=y | 541 | CONFIG_ADB_PMU=y |
544 | CONFIG_PMAC_SMU=y | 542 | CONFIG_PMAC_SMU=y |
545 | # CONFIG_PMAC_BACKLIGHT is not set | 543 | # CONFIG_PMAC_BACKLIGHT is not set |
546 | # CONFIG_INPUT_ADBHID is not set | ||
547 | CONFIG_THERM_PM72=y | 544 | CONFIG_THERM_PM72=y |
548 | 545 | ||
549 | # | 546 | # |
@@ -631,6 +628,8 @@ CONFIG_PPPOE=m | |||
631 | # CONFIG_NET_FC is not set | 628 | # CONFIG_NET_FC is not set |
632 | # CONFIG_SHAPER is not set | 629 | # CONFIG_SHAPER is not set |
633 | # CONFIG_NETCONSOLE is not set | 630 | # CONFIG_NETCONSOLE is not set |
631 | # CONFIG_NETPOLL is not set | ||
632 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
634 | 633 | ||
635 | # | 634 | # |
636 | # ISDN subsystem | 635 | # ISDN subsystem |
@@ -718,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
718 | # | 717 | # |
719 | # CONFIG_WATCHDOG is not set | 718 | # CONFIG_WATCHDOG is not set |
720 | # CONFIG_RTC is not set | 719 | # CONFIG_RTC is not set |
721 | # CONFIG_GEN_RTC is not set | ||
722 | # CONFIG_DTLK is not set | 720 | # CONFIG_DTLK is not set |
723 | # CONFIG_R3964 is not set | 721 | # CONFIG_R3964 is not set |
724 | # CONFIG_APPLICOM is not set | 722 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/iSeries_defconfig b/arch/ppc64/configs/iSeries_defconfig index dbd54d188c2b..394ba18b58c7 100644 --- a/arch/ppc64/configs/iSeries_defconfig +++ b/arch/ppc64/configs/iSeries_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:43:39 2005 | 4 | # Mon Aug 8 14:17:02 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -257,10 +257,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
257 | # Network testing | 257 | # Network testing |
258 | # | 258 | # |
259 | # CONFIG_NET_PKTGEN is not set | 259 | # CONFIG_NET_PKTGEN is not set |
260 | CONFIG_NETPOLL=y | ||
261 | CONFIG_NETPOLL_RX=y | ||
262 | CONFIG_NETPOLL_TRAP=y | ||
263 | CONFIG_NET_POLL_CONTROLLER=y | ||
264 | # CONFIG_HAMRADIO is not set | 260 | # CONFIG_HAMRADIO is not set |
265 | # CONFIG_IRDA is not set | 261 | # CONFIG_IRDA is not set |
266 | # CONFIG_BT is not set | 262 | # CONFIG_BT is not set |
@@ -388,6 +384,7 @@ CONFIG_SCSI_QLA2XXX=y | |||
388 | # CONFIG_SCSI_QLA2300 is not set | 384 | # CONFIG_SCSI_QLA2300 is not set |
389 | # CONFIG_SCSI_QLA2322 is not set | 385 | # CONFIG_SCSI_QLA2322 is not set |
390 | # CONFIG_SCSI_QLA6312 is not set | 386 | # CONFIG_SCSI_QLA6312 is not set |
387 | # CONFIG_SCSI_QLA24XX is not set | ||
391 | # CONFIG_SCSI_LPFC is not set | 388 | # CONFIG_SCSI_LPFC is not set |
392 | # CONFIG_SCSI_DC395x is not set | 389 | # CONFIG_SCSI_DC395x is not set |
393 | # CONFIG_SCSI_DC390T is not set | 390 | # CONFIG_SCSI_DC390T is not set |
@@ -537,6 +534,10 @@ CONFIG_PPPOE=m | |||
537 | # CONFIG_NET_FC is not set | 534 | # CONFIG_NET_FC is not set |
538 | # CONFIG_SHAPER is not set | 535 | # CONFIG_SHAPER is not set |
539 | CONFIG_NETCONSOLE=y | 536 | CONFIG_NETCONSOLE=y |
537 | CONFIG_NETPOLL=y | ||
538 | CONFIG_NETPOLL_RX=y | ||
539 | CONFIG_NETPOLL_TRAP=y | ||
540 | CONFIG_NET_POLL_CONTROLLER=y | ||
540 | 541 | ||
541 | # | 542 | # |
542 | # ISDN subsystem | 543 | # ISDN subsystem |
@@ -610,7 +611,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
610 | # | 611 | # |
611 | # CONFIG_WATCHDOG is not set | 612 | # CONFIG_WATCHDOG is not set |
612 | # CONFIG_RTC is not set | 613 | # CONFIG_RTC is not set |
613 | # CONFIG_GEN_RTC is not set | ||
614 | # CONFIG_DTLK is not set | 614 | # CONFIG_DTLK is not set |
615 | # CONFIG_R3964 is not set | 615 | # CONFIG_R3964 is not set |
616 | # CONFIG_APPLICOM is not set | 616 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/maple_defconfig b/arch/ppc64/configs/maple_defconfig index cda8e8cb6d1d..2033fe663dbe 100644 --- a/arch/ppc64/configs/maple_defconfig +++ b/arch/ppc64/configs/maple_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:46:18 2005 | 4 | # Mon Aug 8 14:17:04 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -193,8 +193,6 @@ CONFIG_TCP_CONG_BIC=y | |||
193 | # Network testing | 193 | # Network testing |
194 | # | 194 | # |
195 | # CONFIG_NET_PKTGEN is not set | 195 | # CONFIG_NET_PKTGEN is not set |
196 | # CONFIG_NETPOLL is not set | ||
197 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
198 | # CONFIG_HAMRADIO is not set | 196 | # CONFIG_HAMRADIO is not set |
199 | # CONFIG_IRDA is not set | 197 | # CONFIG_IRDA is not set |
200 | # CONFIG_BT is not set | 198 | # CONFIG_BT is not set |
@@ -433,6 +431,8 @@ CONFIG_E1000=y | |||
433 | # CONFIG_SLIP is not set | 431 | # CONFIG_SLIP is not set |
434 | # CONFIG_SHAPER is not set | 432 | # CONFIG_SHAPER is not set |
435 | # CONFIG_NETCONSOLE is not set | 433 | # CONFIG_NETCONSOLE is not set |
434 | # CONFIG_NETPOLL is not set | ||
435 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
436 | 436 | ||
437 | # | 437 | # |
438 | # ISDN subsystem | 438 | # ISDN subsystem |
@@ -512,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256 | |||
512 | # | 512 | # |
513 | # CONFIG_WATCHDOG is not set | 513 | # CONFIG_WATCHDOG is not set |
514 | # CONFIG_RTC is not set | 514 | # CONFIG_RTC is not set |
515 | # CONFIG_GEN_RTC is not set | ||
516 | # CONFIG_DTLK is not set | 515 | # CONFIG_DTLK is not set |
517 | # CONFIG_R3964 is not set | 516 | # CONFIG_R3964 is not set |
518 | # CONFIG_APPLICOM is not set | 517 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig index 5112edf18181..297fd5229487 100644 --- a/arch/ppc64/configs/pSeries_defconfig +++ b/arch/ppc64/configs/pSeries_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:47:54 2005 | 4 | # Mon Aug 8 14:17:07 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -287,10 +287,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
287 | # Network testing | 287 | # Network testing |
288 | # | 288 | # |
289 | # CONFIG_NET_PKTGEN is not set | 289 | # CONFIG_NET_PKTGEN is not set |
290 | CONFIG_NETPOLL=y | ||
291 | CONFIG_NETPOLL_RX=y | ||
292 | CONFIG_NETPOLL_TRAP=y | ||
293 | CONFIG_NET_POLL_CONTROLLER=y | ||
294 | # CONFIG_HAMRADIO is not set | 290 | # CONFIG_HAMRADIO is not set |
295 | # CONFIG_IRDA is not set | 291 | # CONFIG_IRDA is not set |
296 | # CONFIG_BT is not set | 292 | # CONFIG_BT is not set |
@@ -488,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m | |||
488 | CONFIG_SCSI_QLA2300=m | 484 | CONFIG_SCSI_QLA2300=m |
489 | CONFIG_SCSI_QLA2322=m | 485 | CONFIG_SCSI_QLA2322=m |
490 | CONFIG_SCSI_QLA6312=m | 486 | CONFIG_SCSI_QLA6312=m |
487 | CONFIG_SCSI_QLA24XX=m | ||
491 | CONFIG_SCSI_LPFC=m | 488 | CONFIG_SCSI_LPFC=m |
492 | # CONFIG_SCSI_DC395x is not set | 489 | # CONFIG_SCSI_DC395x is not set |
493 | # CONFIG_SCSI_DC390T is not set | 490 | # CONFIG_SCSI_DC390T is not set |
@@ -645,6 +642,10 @@ CONFIG_PPPOE=m | |||
645 | # CONFIG_NET_FC is not set | 642 | # CONFIG_NET_FC is not set |
646 | # CONFIG_SHAPER is not set | 643 | # CONFIG_SHAPER is not set |
647 | CONFIG_NETCONSOLE=y | 644 | CONFIG_NETCONSOLE=y |
645 | CONFIG_NETPOLL=y | ||
646 | CONFIG_NETPOLL_RX=y | ||
647 | CONFIG_NETPOLL_TRAP=y | ||
648 | CONFIG_NET_POLL_CONTROLLER=y | ||
648 | 649 | ||
649 | # | 650 | # |
650 | # ISDN subsystem | 651 | # ISDN subsystem |
@@ -746,7 +747,6 @@ CONFIG_HVCS=m | |||
746 | # | 747 | # |
747 | # CONFIG_WATCHDOG is not set | 748 | # CONFIG_WATCHDOG is not set |
748 | # CONFIG_RTC is not set | 749 | # CONFIG_RTC is not set |
749 | # CONFIG_GEN_RTC is not set | ||
750 | # CONFIG_DTLK is not set | 750 | # CONFIG_DTLK is not set |
751 | # CONFIG_R3964 is not set | 751 | # CONFIG_R3964 is not set |
752 | # CONFIG_APPLICOM is not set | 752 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/defconfig b/arch/ppc64/defconfig index fbf1f427ad35..c361e7727b7a 100644 --- a/arch/ppc64/defconfig +++ b/arch/ppc64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.13-rc3 | 3 | # Linux kernel version: 2.6.13-rc6 |
4 | # Wed Jul 13 14:37:07 2005 | 4 | # Mon Aug 8 14:16:54 2005 |
5 | # | 5 | # |
6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -289,10 +289,6 @@ CONFIG_NET_CLS_ROUTE=y | |||
289 | # Network testing | 289 | # Network testing |
290 | # | 290 | # |
291 | # CONFIG_NET_PKTGEN is not set | 291 | # CONFIG_NET_PKTGEN is not set |
292 | CONFIG_NETPOLL=y | ||
293 | CONFIG_NETPOLL_RX=y | ||
294 | CONFIG_NETPOLL_TRAP=y | ||
295 | CONFIG_NET_POLL_CONTROLLER=y | ||
296 | # CONFIG_HAMRADIO is not set | 292 | # CONFIG_HAMRADIO is not set |
297 | # CONFIG_IRDA is not set | 293 | # CONFIG_IRDA is not set |
298 | # CONFIG_BT is not set | 294 | # CONFIG_BT is not set |
@@ -506,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m | |||
506 | CONFIG_SCSI_QLA2300=m | 502 | CONFIG_SCSI_QLA2300=m |
507 | CONFIG_SCSI_QLA2322=m | 503 | CONFIG_SCSI_QLA2322=m |
508 | CONFIG_SCSI_QLA6312=m | 504 | CONFIG_SCSI_QLA6312=m |
505 | CONFIG_SCSI_QLA24XX=m | ||
509 | CONFIG_SCSI_LPFC=m | 506 | CONFIG_SCSI_LPFC=m |
510 | # CONFIG_SCSI_DC395x is not set | 507 | # CONFIG_SCSI_DC395x is not set |
511 | # CONFIG_SCSI_DC390T is not set | 508 | # CONFIG_SCSI_DC390T is not set |
@@ -579,11 +576,9 @@ CONFIG_IEEE1394_AMDTP=m | |||
579 | # | 576 | # |
580 | # Macintosh device drivers | 577 | # Macintosh device drivers |
581 | # | 578 | # |
582 | CONFIG_ADB=y | ||
583 | CONFIG_ADB_PMU=y | 579 | CONFIG_ADB_PMU=y |
584 | CONFIG_PMAC_SMU=y | 580 | CONFIG_PMAC_SMU=y |
585 | # CONFIG_PMAC_BACKLIGHT is not set | 581 | # CONFIG_PMAC_BACKLIGHT is not set |
586 | # CONFIG_INPUT_ADBHID is not set | ||
587 | CONFIG_THERM_PM72=y | 582 | CONFIG_THERM_PM72=y |
588 | 583 | ||
589 | # | 584 | # |
@@ -694,6 +689,10 @@ CONFIG_PPPOE=m | |||
694 | # CONFIG_NET_FC is not set | 689 | # CONFIG_NET_FC is not set |
695 | # CONFIG_SHAPER is not set | 690 | # CONFIG_SHAPER is not set |
696 | CONFIG_NETCONSOLE=y | 691 | CONFIG_NETCONSOLE=y |
692 | CONFIG_NETPOLL=y | ||
693 | CONFIG_NETPOLL_RX=y | ||
694 | CONFIG_NETPOLL_TRAP=y | ||
695 | CONFIG_NET_POLL_CONTROLLER=y | ||
697 | 696 | ||
698 | # | 697 | # |
699 | # ISDN subsystem | 698 | # ISDN subsystem |
@@ -797,7 +796,6 @@ CONFIG_HVCS=m | |||
797 | # | 796 | # |
798 | # CONFIG_WATCHDOG is not set | 797 | # CONFIG_WATCHDOG is not set |
799 | # CONFIG_RTC is not set | 798 | # CONFIG_RTC is not set |
800 | # CONFIG_GEN_RTC is not set | ||
801 | # CONFIG_DTLK is not set | 799 | # CONFIG_DTLK is not set |
802 | # CONFIG_R3964 is not set | 800 | # CONFIG_R3964 is not set |
803 | # CONFIG_APPLICOM is not set | 801 | # CONFIG_APPLICOM is not set |
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index ae6f579d3fa0..d0d55c7908ef 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c | |||
@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region | |||
108 | region->end = res->end - offset; | 108 | region->end = res->end - offset; |
109 | } | 109 | } |
110 | 110 | ||
111 | void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
112 | struct pci_bus_region *region) | ||
113 | { | ||
114 | unsigned long offset = 0; | ||
115 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | ||
116 | |||
117 | if (!hose) | ||
118 | return; | ||
119 | |||
120 | if (res->flags & IORESOURCE_IO) | ||
121 | offset = (unsigned long)hose->io_base_virt - pci_io_base; | ||
122 | |||
123 | if (res->flags & IORESOURCE_MEM) | ||
124 | offset = hose->pci_mem_offset; | ||
125 | |||
126 | res->start = region->start + offset; | ||
127 | res->end = region->end + offset; | ||
128 | } | ||
129 | |||
111 | #ifdef CONFIG_HOTPLUG | 130 | #ifdef CONFIG_HOTPLUG |
112 | EXPORT_SYMBOL(pcibios_resource_to_bus); | 131 | EXPORT_SYMBOL(pcibios_resource_to_bus); |
132 | EXPORT_SYMBOL(pcibios_bus_to_resource); | ||
113 | #endif | 133 | #endif |
114 | 134 | ||
115 | /* | 135 | /* |
diff --git a/arch/sparc64/solaris/socket.c b/arch/sparc64/solaris/socket.c index 06740582717e..d3a66ea74a7f 100644 --- a/arch/sparc64/solaris/socket.c +++ b/arch/sparc64/solaris/socket.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/net.h> | 16 | #include <linux/net.h> |
17 | #include <linux/compat.h> | 17 | #include <linux/compat.h> |
18 | #include <net/compat.h> | 18 | #include <net/compat.h> |
19 | #include <net/sock.h> | ||
19 | 20 | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/string.h> | 22 | #include <asm/string.h> |
@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi | |||
297 | { | 298 | { |
298 | struct socket *sock; | 299 | struct socket *sock; |
299 | char address[MAX_SOCK_ADDR]; | 300 | char address[MAX_SOCK_ADDR]; |
300 | struct iovec iov[UIO_FASTIOV]; | 301 | struct iovec iovstack[UIO_FASTIOV], *iov = iovstack; |
301 | unsigned char ctl[sizeof(struct cmsghdr) + 20]; | 302 | unsigned char ctl[sizeof(struct cmsghdr) + 20]; |
302 | unsigned char *ctl_buf = ctl; | 303 | unsigned char *ctl_buf = ctl; |
303 | struct msghdr kern_msg; | 304 | struct msghdr msg_sys; |
304 | int err, total_len; | 305 | int err, ctl_len, iov_size, total_len; |
305 | 306 | ||
306 | if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) | 307 | err = -EFAULT; |
307 | return -EFAULT; | 308 | if (msghdr_from_user32_to_kern(&msg_sys, user_msg)) |
308 | if(kern_msg.msg_iovlen > UIO_MAXIOV) | 309 | goto out; |
309 | return -EINVAL; | 310 | |
310 | err = verify_compat_iovec(&kern_msg, iov, address, VERIFY_READ); | 311 | sock = sockfd_lookup(fd, &err); |
311 | if (err < 0) | 312 | if (!sock) |
312 | goto out; | 313 | goto out; |
314 | |||
315 | /* do not move before msg_sys is valid */ | ||
316 | err = -EMSGSIZE; | ||
317 | if (msg_sys.msg_iovlen > UIO_MAXIOV) | ||
318 | goto out_put; | ||
319 | |||
320 | /* Check whether to allocate the iovec area*/ | ||
321 | err = -ENOMEM; | ||
322 | iov_size = msg_sys.msg_iovlen * sizeof(struct iovec); | ||
323 | if (msg_sys.msg_iovlen > UIO_FASTIOV) { | ||
324 | iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL); | ||
325 | if (!iov) | ||
326 | goto out_put; | ||
327 | } | ||
328 | |||
329 | err = verify_compat_iovec(&msg_sys, iov, address, VERIFY_READ); | ||
330 | if (err < 0) | ||
331 | goto out_freeiov; | ||
313 | total_len = err; | 332 | total_len = err; |
314 | 333 | ||
315 | if(kern_msg.msg_controllen) { | 334 | err = -ENOBUFS; |
316 | struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control; | 335 | if (msg_sys.msg_controllen > INT_MAX) |
336 | goto out_freeiov; | ||
337 | |||
338 | ctl_len = msg_sys.msg_controllen; | ||
339 | if (ctl_len) { | ||
340 | struct sol_cmsghdr __user *ucmsg = msg_sys.msg_control; | ||
317 | unsigned long *kcmsg; | 341 | unsigned long *kcmsg; |
318 | compat_size_t cmlen; | 342 | compat_size_t cmlen; |
319 | 343 | ||
320 | if (kern_msg.msg_controllen <= sizeof(compat_size_t)) | 344 | err = -EINVAL; |
321 | return -EINVAL; | 345 | if (ctl_len <= sizeof(compat_size_t)) |
346 | goto out_freeiov; | ||
322 | 347 | ||
323 | if(kern_msg.msg_controllen > sizeof(ctl)) { | 348 | if (ctl_len > sizeof(ctl)) { |
324 | err = -ENOBUFS; | 349 | err = -ENOBUFS; |
325 | ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); | 350 | ctl_buf = kmalloc(ctl_len, GFP_KERNEL); |
326 | if(!ctl_buf) | 351 | if (!ctl_buf) |
327 | goto out_freeiov; | 352 | goto out_freeiov; |
328 | } | 353 | } |
329 | __get_user(cmlen, &ucmsg->cmsg_len); | 354 | __get_user(cmlen, &ucmsg->cmsg_len); |
330 | kcmsg = (unsigned long *) ctl_buf; | 355 | kcmsg = (unsigned long *) ctl_buf; |
331 | *kcmsg++ = (unsigned long)cmlen; | 356 | *kcmsg++ = (unsigned long)cmlen; |
332 | err = -EFAULT; | 357 | err = -EFAULT; |
333 | if(copy_from_user(kcmsg, &ucmsg->cmsg_level, | 358 | if (copy_from_user(kcmsg, &ucmsg->cmsg_level, |
334 | kern_msg.msg_controllen - sizeof(compat_size_t))) | 359 | ctl_len - sizeof(compat_size_t))) |
335 | goto out_freectl; | 360 | goto out_freectl; |
336 | kern_msg.msg_control = ctl_buf; | 361 | msg_sys.msg_control = ctl_buf; |
337 | } | 362 | } |
338 | kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags); | 363 | msg_sys.msg_flags = solaris_to_linux_msgflags(user_flags); |
339 | 364 | ||
340 | lock_kernel(); | 365 | if (sock->file->f_flags & O_NONBLOCK) |
341 | sock = sockfd_lookup(fd, &err); | 366 | msg_sys.msg_flags |= MSG_DONTWAIT; |
342 | if (sock != NULL) { | 367 | err = sock_sendmsg(sock, &msg_sys, total_len); |
343 | if (sock->file->f_flags & O_NONBLOCK) | ||
344 | kern_msg.msg_flags |= MSG_DONTWAIT; | ||
345 | err = sock_sendmsg(sock, &kern_msg, total_len); | ||
346 | sockfd_put(sock); | ||
347 | } | ||
348 | unlock_kernel(); | ||
349 | 368 | ||
350 | out_freectl: | 369 | out_freectl: |
351 | /* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ | 370 | if (ctl_buf != ctl) |
352 | if(ctl_buf != ctl) | 371 | sock_kfree_s(sock->sk, ctl_buf, ctl_len); |
353 | kfree(ctl_buf); | ||
354 | out_freeiov: | 372 | out_freeiov: |
355 | if(kern_msg.msg_iov != iov) | 373 | if (iov != iovstack) |
356 | kfree(kern_msg.msg_iov); | 374 | sock_kfree_s(sock->sk, iov, iov_size); |
357 | out: | 375 | out_put: |
376 | sockfd_put(sock); | ||
377 | out: | ||
358 | return err; | 378 | return err; |
359 | } | 379 | } |
360 | 380 | ||
361 | asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) | 381 | asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) |
362 | { | 382 | { |
363 | struct iovec iovstack[UIO_FASTIOV]; | ||
364 | struct msghdr kern_msg; | ||
365 | char addr[MAX_SOCK_ADDR]; | ||
366 | struct socket *sock; | 383 | struct socket *sock; |
384 | struct iovec iovstack[UIO_FASTIOV]; | ||
367 | struct iovec *iov = iovstack; | 385 | struct iovec *iov = iovstack; |
386 | struct msghdr msg_sys; | ||
387 | unsigned long cmsg_ptr; | ||
388 | int err, iov_size, total_len, len; | ||
389 | |||
390 | /* kernel mode address */ | ||
391 | char addr[MAX_SOCK_ADDR]; | ||
392 | |||
393 | /* user mode address pointers */ | ||
368 | struct sockaddr __user *uaddr; | 394 | struct sockaddr __user *uaddr; |
369 | int __user *uaddr_len; | 395 | int __user *uaddr_len; |
370 | unsigned long cmsg_ptr; | ||
371 | int err, total_len, len = 0; | ||
372 | 396 | ||
373 | if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) | 397 | if (msghdr_from_user32_to_kern(&msg_sys, user_msg)) |
374 | return -EFAULT; | 398 | return -EFAULT; |
375 | if(kern_msg.msg_iovlen > UIO_MAXIOV) | ||
376 | return -EINVAL; | ||
377 | 399 | ||
378 | uaddr = kern_msg.msg_name; | 400 | sock = sockfd_lookup(fd, &err); |
401 | if (!sock) | ||
402 | goto out; | ||
403 | |||
404 | err = -EMSGSIZE; | ||
405 | if (msg_sys.msg_iovlen > UIO_MAXIOV) | ||
406 | goto out_put; | ||
407 | |||
408 | /* Check whether to allocate the iovec area*/ | ||
409 | err = -ENOMEM; | ||
410 | iov_size = msg_sys.msg_iovlen * sizeof(struct iovec); | ||
411 | if (msg_sys.msg_iovlen > UIO_FASTIOV) { | ||
412 | iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL); | ||
413 | if (!iov) | ||
414 | goto out_put; | ||
415 | } | ||
416 | |||
417 | /* | ||
418 | * Save the user-mode address (verify_iovec will change the | ||
419 | * kernel msghdr to use the kernel address space) | ||
420 | */ | ||
421 | |||
422 | uaddr = (void __user *) msg_sys.msg_name; | ||
379 | uaddr_len = &user_msg->msg_namelen; | 423 | uaddr_len = &user_msg->msg_namelen; |
380 | err = verify_compat_iovec(&kern_msg, iov, addr, VERIFY_WRITE); | 424 | err = verify_compat_iovec(&msg_sys, iov, addr, VERIFY_WRITE); |
381 | if (err < 0) | 425 | if (err < 0) |
382 | goto out; | 426 | goto out_freeiov; |
383 | total_len = err; | 427 | total_len = err; |
384 | 428 | ||
385 | cmsg_ptr = (unsigned long) kern_msg.msg_control; | 429 | cmsg_ptr = (unsigned long) msg_sys.msg_control; |
386 | kern_msg.msg_flags = 0; | 430 | msg_sys.msg_flags = MSG_CMSG_COMPAT; |
387 | 431 | ||
388 | lock_kernel(); | 432 | if (sock->file->f_flags & O_NONBLOCK) |
389 | sock = sockfd_lookup(fd, &err); | 433 | user_flags |= MSG_DONTWAIT; |
390 | if (sock != NULL) { | 434 | |
391 | if (sock->file->f_flags & O_NONBLOCK) | 435 | err = sock_recvmsg(sock, &msg_sys, total_len, user_flags); |
392 | user_flags |= MSG_DONTWAIT; | 436 | if(err < 0) |
393 | err = sock_recvmsg(sock, &kern_msg, total_len, user_flags); | 437 | goto out_freeiov; |
394 | if(err >= 0) | 438 | |
395 | len = err; | 439 | len = err; |
396 | sockfd_put(sock); | 440 | |
397 | } | 441 | if (uaddr != NULL) { |
398 | unlock_kernel(); | 442 | err = move_addr_to_user(addr, msg_sys.msg_namelen, uaddr, uaddr_len); |
399 | 443 | if (err < 0) | |
400 | if(uaddr != NULL && err >= 0) | 444 | goto out_freeiov; |
401 | err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len); | ||
402 | if(err >= 0) { | ||
403 | err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags); | ||
404 | if(!err) { | ||
405 | /* XXX Convert cmsg back into userspace 32-bit format... */ | ||
406 | err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr, | ||
407 | &user_msg->msg_controllen); | ||
408 | } | ||
409 | } | 445 | } |
446 | err = __put_user(linux_to_solaris_msgflags(msg_sys.msg_flags), &user_msg->msg_flags); | ||
447 | if (err) | ||
448 | goto out_freeiov; | ||
449 | err = __put_user((unsigned long)msg_sys.msg_control - cmsg_ptr, | ||
450 | &user_msg->msg_controllen); | ||
451 | if (err) | ||
452 | goto out_freeiov; | ||
453 | err = len; | ||
410 | 454 | ||
411 | if(kern_msg.msg_iov != iov) | 455 | out_freeiov: |
412 | kfree(kern_msg.msg_iov); | 456 | if (iov != iovstack) |
457 | sock_kfree_s(sock->sk, iov, iov_size); | ||
458 | out_put: | ||
459 | sockfd_put(sock); | ||
413 | out: | 460 | out: |
414 | if(err < 0) | 461 | return err; |
415 | return err; | ||
416 | return len; | ||
417 | } | 462 | } |
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86_64/crypto/aes.c index 2b5c4010ce38..acfdaa28791e 100644 --- a/arch/x86_64/crypto/aes.c +++ b/arch/x86_64/crypto/aes.c | |||
@@ -322,3 +322,4 @@ module_exit(aes_fini); | |||
322 | 322 | ||
323 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 323 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
324 | MODULE_LICENSE("GPL"); | 324 | MODULE_LICENSE("GPL"); |
325 | MODULE_ALIAS("aes"); | ||
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index b98b6d2462f6..2a925e2af390 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c | |||
@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) | |||
43 | switch (regno) { | 43 | switch (regno) { |
44 | case offsetof(struct user32, regs.fs): | 44 | case offsetof(struct user32, regs.fs): |
45 | if (val && (val & 3) != 3) return -EIO; | 45 | if (val && (val & 3) != 3) return -EIO; |
46 | child->thread.fs = val & 0xffff; | 46 | child->thread.fsindex = val & 0xffff; |
47 | break; | 47 | break; |
48 | case offsetof(struct user32, regs.gs): | 48 | case offsetof(struct user32, regs.gs): |
49 | if (val && (val & 3) != 3) return -EIO; | 49 | if (val && (val & 3) != 3) return -EIO; |
50 | child->thread.gs = val & 0xffff; | 50 | child->thread.gsindex = val & 0xffff; |
51 | break; | 51 | break; |
52 | case offsetof(struct user32, regs.ds): | 52 | case offsetof(struct user32, regs.ds): |
53 | if (val && (val & 3) != 3) return -EIO; | 53 | if (val && (val & 3) != 3) return -EIO; |
@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) | |||
138 | 138 | ||
139 | switch (regno) { | 139 | switch (regno) { |
140 | case offsetof(struct user32, regs.fs): | 140 | case offsetof(struct user32, regs.fs): |
141 | *val = child->thread.fs; | 141 | *val = child->thread.fsindex; |
142 | break; | 142 | break; |
143 | case offsetof(struct user32, regs.gs): | 143 | case offsetof(struct user32, regs.gs): |
144 | *val = child->thread.gs; | 144 | *val = child->thread.gsindex; |
145 | break; | 145 | break; |
146 | case offsetof(struct user32, regs.ds): | 146 | case offsetof(struct user32, regs.ds): |
147 | *val = child->thread.ds; | 147 | *val = child->thread.ds; |
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index 3b267c91bb0c..8aa56736cde3 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -36,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL }; | |||
36 | static unsigned long console_logged; | 36 | static unsigned long console_logged; |
37 | static int notify_user; | 37 | static int notify_user; |
38 | static int rip_msr; | 38 | static int rip_msr; |
39 | static int mce_bootlog; | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * Lockless MCE logging infrastructure. | 42 | * Lockless MCE logging infrastructure. |
@@ -197,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code) | |||
197 | rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); | 198 | rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); |
198 | 199 | ||
199 | mce_get_rip(&m, regs); | 200 | mce_get_rip(&m, regs); |
200 | if (error_code != -1) | 201 | if (error_code >= 0) |
201 | rdtscll(m.tsc); | 202 | rdtscll(m.tsc); |
202 | wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); | 203 | wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); |
203 | mce_log(&m); | 204 | if (error_code != -2) |
205 | mce_log(&m); | ||
204 | 206 | ||
205 | /* Did this bank cause the exception? */ | 207 | /* Did this bank cause the exception? */ |
206 | /* Assume that the bank with uncorrectable errors did it, | 208 | /* Assume that the bank with uncorrectable errors did it, |
@@ -315,7 +317,7 @@ static void mce_init(void *dummy) | |||
315 | 317 | ||
316 | /* Log the machine checks left over from the previous reset. | 318 | /* Log the machine checks left over from the previous reset. |
317 | This also clears all registers */ | 319 | This also clears all registers */ |
318 | do_machine_check(NULL, -1); | 320 | do_machine_check(NULL, mce_bootlog ? -1 : -2); |
319 | 321 | ||
320 | set_in_cr4(X86_CR4_MCE); | 322 | set_in_cr4(X86_CR4_MCE); |
321 | 323 | ||
@@ -476,11 +478,17 @@ static int __init mcheck_disable(char *str) | |||
476 | } | 478 | } |
477 | 479 | ||
478 | /* mce=off disables machine check. Note you can reenable it later | 480 | /* mce=off disables machine check. Note you can reenable it later |
479 | using sysfs */ | 481 | using sysfs. |
482 | mce=bootlog Log MCEs from before booting. Disabled by default to work | ||
483 | around buggy BIOS that leave bogus MCEs. */ | ||
480 | static int __init mcheck_enable(char *str) | 484 | static int __init mcheck_enable(char *str) |
481 | { | 485 | { |
486 | if (*str == '=') | ||
487 | str++; | ||
482 | if (!strcmp(str, "off")) | 488 | if (!strcmp(str, "off")) |
483 | mce_dont_init = 1; | 489 | mce_dont_init = 1; |
490 | else if (!strcmp(str, "bootlog")) | ||
491 | mce_bootlog = 1; | ||
484 | else | 492 | else |
485 | printk("mce= argument %s ignored. Please use /sys", str); | 493 | printk("mce= argument %s ignored. Please use /sys", str); |
486 | return 0; | 494 | return 0; |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 0aa526298e92..116a491e2961 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p) | |||
645 | } | 645 | } |
646 | } | 646 | } |
647 | #endif | 647 | #endif |
648 | |||
649 | sparse_init(); | ||
650 | |||
651 | #ifdef CONFIG_KEXEC | 648 | #ifdef CONFIG_KEXEC |
652 | if (crashk_res.start != crashk_res.end) { | 649 | if (crashk_res.start != crashk_res.end) { |
653 | reserve_bootmem(crashk_res.start, | 650 | reserve_bootmem(crashk_res.start, |
654 | crashk_res.end - crashk_res.start + 1); | 651 | crashk_res.end - crashk_res.start + 1); |
655 | } | 652 | } |
656 | #endif | 653 | #endif |
654 | |||
655 | sparse_init(); | ||
656 | |||
657 | paging_init(); | 657 | paging_init(); |
658 | 658 | ||
659 | check_ioapic(); | 659 | check_ioapic(); |
diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index 3cd2e968e96c..c0a37d98b4f3 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c | |||
@@ -1283,8 +1283,7 @@ static void do_fd_request(request_queue_t* q) | |||
1283 | if (fdc_busy) return; | 1283 | if (fdc_busy) return; |
1284 | save_flags(flags); | 1284 | save_flags(flags); |
1285 | cli(); | 1285 | cli(); |
1286 | while (fdc_busy) | 1286 | wait_event(fdc_wait, !fdc_busy); |
1287 | sleep_on(&fdc_wait); | ||
1288 | fdc_busy = 1; | 1287 | fdc_busy = 1; |
1289 | ENABLE_IRQ(); | 1288 | ENABLE_IRQ(); |
1290 | restore_flags(flags); | 1289 | restore_flags(flags); |
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 692a5fced76e..3c818544475e 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c | |||
@@ -719,7 +719,7 @@ struct request *blk_queue_find_tag(request_queue_t *q, int tag) | |||
719 | { | 719 | { |
720 | struct blk_queue_tag *bqt = q->queue_tags; | 720 | struct blk_queue_tag *bqt = q->queue_tags; |
721 | 721 | ||
722 | if (unlikely(bqt == NULL || tag >= bqt->max_depth)) | 722 | if (unlikely(bqt == NULL || tag >= bqt->real_max_depth)) |
723 | return NULL; | 723 | return NULL; |
724 | 724 | ||
725 | return bqt->tag_index[tag]; | 725 | return bqt->tag_index[tag]; |
@@ -798,6 +798,7 @@ init_tag_map(request_queue_t *q, struct blk_queue_tag *tags, int depth) | |||
798 | 798 | ||
799 | memset(tag_index, 0, depth * sizeof(struct request *)); | 799 | memset(tag_index, 0, depth * sizeof(struct request *)); |
800 | memset(tag_map, 0, nr_ulongs * sizeof(unsigned long)); | 800 | memset(tag_map, 0, nr_ulongs * sizeof(unsigned long)); |
801 | tags->real_max_depth = depth; | ||
801 | tags->max_depth = depth; | 802 | tags->max_depth = depth; |
802 | tags->tag_index = tag_index; | 803 | tags->tag_index = tag_index; |
803 | tags->tag_map = tag_map; | 804 | tags->tag_map = tag_map; |
@@ -872,11 +873,22 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth) | |||
872 | return -ENXIO; | 873 | return -ENXIO; |
873 | 874 | ||
874 | /* | 875 | /* |
876 | * if we already have large enough real_max_depth. just | ||
877 | * adjust max_depth. *NOTE* as requests with tag value | ||
878 | * between new_depth and real_max_depth can be in-flight, tag | ||
879 | * map can not be shrunk blindly here. | ||
880 | */ | ||
881 | if (new_depth <= bqt->real_max_depth) { | ||
882 | bqt->max_depth = new_depth; | ||
883 | return 0; | ||
884 | } | ||
885 | |||
886 | /* | ||
875 | * save the old state info, so we can copy it back | 887 | * save the old state info, so we can copy it back |
876 | */ | 888 | */ |
877 | tag_index = bqt->tag_index; | 889 | tag_index = bqt->tag_index; |
878 | tag_map = bqt->tag_map; | 890 | tag_map = bqt->tag_map; |
879 | max_depth = bqt->max_depth; | 891 | max_depth = bqt->real_max_depth; |
880 | 892 | ||
881 | if (init_tag_map(q, bqt, new_depth)) | 893 | if (init_tag_map(q, bqt, new_depth)) |
882 | return -ENOMEM; | 894 | return -ENOMEM; |
@@ -913,7 +925,7 @@ void blk_queue_end_tag(request_queue_t *q, struct request *rq) | |||
913 | 925 | ||
914 | BUG_ON(tag == -1); | 926 | BUG_ON(tag == -1); |
915 | 927 | ||
916 | if (unlikely(tag >= bqt->max_depth)) | 928 | if (unlikely(tag >= bqt->real_max_depth)) |
917 | /* | 929 | /* |
918 | * This can happen after tag depth has been reduced. | 930 | * This can happen after tag depth has been reduced. |
919 | * FIXME: how about a warning or info message here? | 931 | * FIXME: how about a warning or info message here? |
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 2771c861f185..f696da6f417b 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struct urb *urb) | |||
367 | if (!urb) | 367 | if (!urb) |
368 | return; | 368 | return; |
369 | 369 | ||
370 | if (urb->setup_packet) | 370 | kfree(urb->setup_packet); |
371 | kfree(urb->setup_packet); | 371 | kfree(urb->transfer_buffer); |
372 | |||
373 | if (urb->transfer_buffer) | ||
374 | kfree(urb->transfer_buffer); | ||
375 | 372 | ||
376 | usb_free_urb(urb); | 373 | usb_free_urb(urb); |
377 | } | 374 | } |
diff --git a/drivers/bluetooth/hci_bcsp.c b/drivers/bluetooth/hci_bcsp.c index c0ed213fc857..858fddb046de 100644 --- a/drivers/bluetooth/hci_bcsp.c +++ b/drivers/bluetooth/hci_bcsp.c | |||
@@ -58,8 +58,6 @@ | |||
58 | #ifndef CONFIG_BT_HCIUART_DEBUG | 58 | #ifndef CONFIG_BT_HCIUART_DEBUG |
59 | #undef BT_DBG | 59 | #undef BT_DBG |
60 | #define BT_DBG( A... ) | 60 | #define BT_DBG( A... ) |
61 | #undef BT_DMP | ||
62 | #define BT_DMP( A... ) | ||
63 | #endif | 61 | #endif |
64 | 62 | ||
65 | static int hciextn = 1; | 63 | static int hciextn = 1; |
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c index ade94a57bb11..533323b60e63 100644 --- a/drivers/bluetooth/hci_h4.c +++ b/drivers/bluetooth/hci_h4.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUART_DEBUG | 57 | #ifndef CONFIG_BT_HCIUART_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG( A... ) | 59 | #define BT_DBG( A... ) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP( A... ) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | /* Initialize protocol */ | 62 | /* Initialize protocol */ |
@@ -125,7 +123,6 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len) | |||
125 | 123 | ||
126 | BT_DBG("len %d room %d", len, room); | 124 | BT_DBG("len %d room %d", len, room); |
127 | if (!len) { | 125 | if (!len) { |
128 | BT_DMP(h4->rx_skb->data, h4->rx_skb->len); | ||
129 | hci_recv_frame(h4->rx_skb); | 126 | hci_recv_frame(h4->rx_skb); |
130 | } else if (len > room) { | 127 | } else if (len > room) { |
131 | BT_ERR("Data length is too large"); | 128 | BT_ERR("Data length is too large"); |
@@ -169,8 +166,6 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) | |||
169 | case H4_W4_DATA: | 166 | case H4_W4_DATA: |
170 | BT_DBG("Complete data"); | 167 | BT_DBG("Complete data"); |
171 | 168 | ||
172 | BT_DMP(h4->rx_skb->data, h4->rx_skb->len); | ||
173 | |||
174 | hci_recv_frame(h4->rx_skb); | 169 | hci_recv_frame(h4->rx_skb); |
175 | 170 | ||
176 | h4->rx_state = H4_W4_PACKET_TYPE; | 171 | h4->rx_state = H4_W4_PACKET_TYPE; |
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index f766bc22c6bb..90be2eae52e0 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUART_DEBUG | 57 | #ifndef CONFIG_BT_HCIUART_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG( A... ) | 59 | #define BT_DBG( A... ) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP( A... ) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | static int reset = 0; | 62 | static int reset = 0; |
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c index b120ecf7b8c9..657719b8254f 100644 --- a/drivers/bluetooth/hci_usb.c +++ b/drivers/bluetooth/hci_usb.c | |||
@@ -57,8 +57,6 @@ | |||
57 | #ifndef CONFIG_BT_HCIUSB_DEBUG | 57 | #ifndef CONFIG_BT_HCIUSB_DEBUG |
58 | #undef BT_DBG | 58 | #undef BT_DBG |
59 | #define BT_DBG(D...) | 59 | #define BT_DBG(D...) |
60 | #undef BT_DMP | ||
61 | #define BT_DMP(D...) | ||
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET | 62 | #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET |
@@ -110,6 +108,9 @@ static struct usb_device_id blacklist_ids[] = { | |||
110 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ | 108 | /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ |
111 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, | 109 | { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, |
112 | 110 | ||
111 | /* Kensington Bluetooth USB adapter */ | ||
112 | { USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET }, | ||
113 | |||
113 | /* ISSC Bluetooth Adapter v3.1 */ | 114 | /* ISSC Bluetooth Adapter v3.1 */ |
114 | { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, | 115 | { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, |
115 | 116 | ||
@@ -387,10 +388,8 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb) | |||
387 | urb = &_urb->urb; | 388 | urb = &_urb->urb; |
388 | BT_DBG("%s freeing _urb %p type %d urb %p", | 389 | BT_DBG("%s freeing _urb %p type %d urb %p", |
389 | husb->hdev->name, _urb, _urb->type, urb); | 390 | husb->hdev->name, _urb, _urb->type, urb); |
390 | if (urb->setup_packet) | 391 | kfree(urb->setup_packet); |
391 | kfree(urb->setup_packet); | 392 | kfree(urb->transfer_buffer); |
392 | if (urb->transfer_buffer) | ||
393 | kfree(urb->transfer_buffer); | ||
394 | _urb_free(_urb); | 393 | _urb_free(_urb); |
395 | } | 394 | } |
396 | 395 | ||
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index d8f9e94ae475..cd4fe8b1709f 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) | |||
1209 | 1209 | ||
1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) | 1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) |
1211 | { | 1211 | { |
1212 | unsigned long uip_watchdog = jiffies; | ||
1212 | unsigned char ctrl; | 1213 | unsigned char ctrl; |
1213 | #ifdef CONFIG_MACH_DECSTATION | 1214 | #ifdef CONFIG_MACH_DECSTATION |
1214 | unsigned int real_year; | 1215 | unsigned int real_year; |
@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |||
1224 | * Once the read clears, read the RTC time (again via ioctl). Easy. | 1225 | * Once the read clears, read the RTC time (again via ioctl). Easy. |
1225 | */ | 1226 | */ |
1226 | 1227 | ||
1227 | if (rtc_is_updating() != 0) | 1228 | while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) { |
1228 | msleep(20); | 1229 | barrier(); |
1230 | cpu_relax(); | ||
1231 | } | ||
1229 | 1232 | ||
1230 | /* | 1233 | /* |
1231 | * Only the values that we read from the RTC are set. We leave | 1234 | * Only the values that we read from the RTC are set. We leave |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 94a3b3e20bf9..79e9832ef1f3 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -17,6 +17,8 @@ config TCG_TPM | |||
17 | obtained at: <http://sourceforge.net/projects/trousers>. To | 17 | obtained at: <http://sourceforge.net/projects/trousers>. To |
18 | compile this driver as a module, choose M here; the module | 18 | compile this driver as a module, choose M here; the module |
19 | will be called tpm. If unsure, say N. | 19 | will be called tpm. If unsure, say N. |
20 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI_BUS | ||
21 | and CONFIG_PNPACPI. | ||
20 | 22 | ||
21 | config TCG_NSC | 23 | config TCG_NSC |
22 | tristate "National Semiconductor TPM Interface" | 24 | tristate "National Semiconductor TPM Interface" |
@@ -36,12 +38,13 @@ config TCG_ATMEL | |||
36 | as a module, choose M here; the module will be called tpm_atmel. | 38 | as a module, choose M here; the module will be called tpm_atmel. |
37 | 39 | ||
38 | config TCG_INFINEON | 40 | config TCG_INFINEON |
39 | tristate "Infineon Technologies SLD 9630 TPM Interface" | 41 | tristate "Infineon Technologies TPM Interface" |
40 | depends on TCG_TPM | 42 | depends on TCG_TPM && PNPACPI |
41 | ---help--- | 43 | ---help--- |
42 | If you have a TPM security chip from Infineon Technologies | 44 | If you have a TPM security chip from Infineon Technologies |
43 | say Yes and it will be accessible from within Linux. To | 45 | (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it |
44 | compile this driver as a module, choose M here; the module | 46 | will be accessible from within Linux. |
47 | To compile this driver as a module, choose M here; the module | ||
45 | will be called tpm_infineon. | 48 | will be called tpm_infineon. |
46 | Further information on this driver and the supported hardware | 49 | Further information on this driver and the supported hardware |
47 | can be found at http://www.prosec.rub.de/tpm | 50 | can be found at http://www.prosec.rub.de/tpm |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c index 0e3241645c19..dc8c540391fd 100644 --- a/drivers/char/tpm/tpm_infineon.c +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Description: | 2 | * Description: |
3 | * Device Driver for the Infineon Technologies | 3 | * Device Driver for the Infineon Technologies |
4 | * SLD 9630 TT Trusted Platform Module | 4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module |
5 | * Specifications at www.trustedcomputinggroup.org | 5 | * Specifications at www.trustedcomputinggroup.org |
6 | * | 6 | * |
7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> | 7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> |
@@ -12,9 +12,10 @@ | |||
12 | * modify it under the terms of the GNU General Public License as | 12 | * modify it under the terms of the GNU General Public License as |
13 | * published by the Free Software Foundation, version 2 of the | 13 | * published by the Free Software Foundation, version 2 of the |
14 | * License. | 14 | * License. |
15 | * | ||
16 | */ | 15 | */ |
17 | 16 | ||
17 | #include <acpi/acpi_bus.h> | ||
18 | #include <linux/pnp.h> | ||
18 | #include "tpm.h" | 19 | #include "tpm.h" |
19 | 20 | ||
20 | /* Infineon specific definitions */ | 21 | /* Infineon specific definitions */ |
@@ -26,8 +27,11 @@ | |||
26 | #define TPM_MSLEEP_TIME 3 | 27 | #define TPM_MSLEEP_TIME 3 |
27 | /* gives number of max. msleep()-calls before throwing timeout */ | 28 | /* gives number of max. msleep()-calls before throwing timeout */ |
28 | #define TPM_MAX_TRIES 5000 | 29 | #define TPM_MAX_TRIES 5000 |
29 | #define TCPA_INFINEON_DEV_VEN_VALUE 0x15D1 | 30 | #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1 |
30 | #define TPM_DATA (TPM_ADDR + 1) & 0xff | 31 | |
32 | /* These values will be filled after ACPI-call */ | ||
33 | static int TPM_INF_DATA = 0; | ||
34 | static int TPM_INF_ADDR = 0; | ||
31 | 35 | ||
32 | /* TPM header definitions */ | 36 | /* TPM header definitions */ |
33 | enum infineon_tpm_header { | 37 | enum infineon_tpm_header { |
@@ -305,9 +309,10 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count) | |||
305 | 309 | ||
306 | static void tpm_inf_cancel(struct tpm_chip *chip) | 310 | static void tpm_inf_cancel(struct tpm_chip *chip) |
307 | { | 311 | { |
308 | /* Nothing yet! | 312 | /* |
309 | This has something to do with the internal functions | 313 | Since we are using the legacy mode to communicate |
310 | of the TPM. Abort isn't really necessary... | 314 | with the TPM, we have no cancel functions, but have |
315 | a workaround for interrupting the TPM through WTX. | ||
311 | */ | 316 | */ |
312 | } | 317 | } |
313 | 318 | ||
@@ -345,6 +350,32 @@ static struct tpm_vendor_specific tpm_inf = { | |||
345 | .miscdev = {.fops = &inf_ops,}, | 350 | .miscdev = {.fops = &inf_ops,}, |
346 | }; | 351 | }; |
347 | 352 | ||
353 | static const struct pnp_device_id tpm_pnp_tbl[] = { | ||
354 | /* Infineon TPMs */ | ||
355 | {"IFX0101", 0}, | ||
356 | {"IFX0102", 0}, | ||
357 | {"", 0} | ||
358 | }; | ||
359 | |||
360 | static int __devinit tpm_inf_acpi_probe(struct pnp_dev *dev, | ||
361 | const struct pnp_device_id *dev_id) | ||
362 | { | ||
363 | TPM_INF_ADDR = (pnp_port_start(dev, 0) & 0xff); | ||
364 | TPM_INF_DATA = ((TPM_INF_ADDR + 1) & 0xff); | ||
365 | tpm_inf.base = pnp_port_start(dev, 1); | ||
366 | dev_info(&dev->dev, "Found %s with ID %s\n", | ||
367 | dev->name, dev_id->id); | ||
368 | if (!((tpm_inf.base >> 8) & 0xff)) | ||
369 | tpm_inf.base = 0; | ||
370 | return 0; | ||
371 | } | ||
372 | |||
373 | static struct pnp_driver tpm_inf_pnp = { | ||
374 | .name = "tpm_inf_pnp", | ||
375 | .id_table = tpm_pnp_tbl, | ||
376 | .probe = tpm_inf_acpi_probe, | ||
377 | }; | ||
378 | |||
348 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | 379 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, |
349 | const struct pci_device_id *pci_id) | 380 | const struct pci_device_id *pci_id) |
350 | { | 381 | { |
@@ -353,64 +384,99 @@ static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | |||
353 | int vendorid[2]; | 384 | int vendorid[2]; |
354 | int version[2]; | 385 | int version[2]; |
355 | int productid[2]; | 386 | int productid[2]; |
387 | char chipname[20]; | ||
356 | 388 | ||
357 | if (pci_enable_device(pci_dev)) | 389 | if (pci_enable_device(pci_dev)) |
358 | return -EIO; | 390 | return -EIO; |
359 | 391 | ||
360 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); | 392 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); |
361 | 393 | ||
394 | /* read IO-ports from ACPI */ | ||
395 | pnp_register_driver(&tpm_inf_pnp); | ||
396 | pnp_unregister_driver(&tpm_inf_pnp); | ||
397 | |||
398 | /* Make sure, we have received valid config ports */ | ||
399 | if (!TPM_INF_ADDR) { | ||
400 | pci_disable_device(pci_dev); | ||
401 | return -EIO; | ||
402 | } | ||
403 | |||
362 | /* query chip for its vendor, its version number a.s.o. */ | 404 | /* query chip for its vendor, its version number a.s.o. */ |
363 | outb(ENABLE_REGISTER_PAIR, TPM_ADDR); | 405 | outb(ENABLE_REGISTER_PAIR, TPM_INF_ADDR); |
364 | outb(IDVENL, TPM_ADDR); | 406 | outb(IDVENL, TPM_INF_ADDR); |
365 | vendorid[1] = inb(TPM_DATA); | 407 | vendorid[1] = inb(TPM_INF_DATA); |
366 | outb(IDVENH, TPM_ADDR); | 408 | outb(IDVENH, TPM_INF_ADDR); |
367 | vendorid[0] = inb(TPM_DATA); | 409 | vendorid[0] = inb(TPM_INF_DATA); |
368 | outb(IDPDL, TPM_ADDR); | 410 | outb(IDPDL, TPM_INF_ADDR); |
369 | productid[1] = inb(TPM_DATA); | 411 | productid[1] = inb(TPM_INF_DATA); |
370 | outb(IDPDH, TPM_ADDR); | 412 | outb(IDPDH, TPM_INF_ADDR); |
371 | productid[0] = inb(TPM_DATA); | 413 | productid[0] = inb(TPM_INF_DATA); |
372 | outb(CHIP_ID1, TPM_ADDR); | 414 | outb(CHIP_ID1, TPM_INF_ADDR); |
373 | version[1] = inb(TPM_DATA); | 415 | version[1] = inb(TPM_INF_DATA); |
374 | outb(CHIP_ID2, TPM_ADDR); | 416 | outb(CHIP_ID2, TPM_INF_ADDR); |
375 | version[0] = inb(TPM_DATA); | 417 | version[0] = inb(TPM_INF_DATA); |
376 | 418 | ||
377 | if ((vendorid[0] << 8 | vendorid[1]) == (TCPA_INFINEON_DEV_VEN_VALUE)) { | 419 | switch ((productid[0] << 8) | productid[1]) { |
378 | 420 | case 6: | |
379 | /* read IO-ports from TPM */ | 421 | sprintf(chipname, " (SLD 9630 TT 1.1)"); |
380 | outb(IOLIMH, TPM_ADDR); | 422 | break; |
381 | ioh = inb(TPM_DATA); | 423 | case 11: |
382 | outb(IOLIML, TPM_ADDR); | 424 | sprintf(chipname, " (SLB 9635 TT 1.2)"); |
383 | iol = inb(TPM_DATA); | 425 | break; |
384 | tpm_inf.base = (ioh << 8) | iol; | 426 | default: |
427 | sprintf(chipname, " (unknown chip)"); | ||
428 | break; | ||
429 | } | ||
430 | chipname[19] = 0; | ||
431 | |||
432 | if ((vendorid[0] << 8 | vendorid[1]) == (TPM_INFINEON_DEV_VEN_VALUE)) { | ||
385 | 433 | ||
386 | if (tpm_inf.base == 0) { | 434 | if (tpm_inf.base == 0) { |
387 | dev_err(&pci_dev->dev, "No IO-ports set!\n"); | 435 | dev_err(&pci_dev->dev, "No IO-ports found!\n"); |
388 | pci_disable_device(pci_dev); | 436 | pci_disable_device(pci_dev); |
389 | return -ENODEV; | 437 | return -EIO; |
438 | } | ||
439 | /* configure TPM with IO-ports */ | ||
440 | outb(IOLIMH, TPM_INF_ADDR); | ||
441 | outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); | ||
442 | outb(IOLIML, TPM_INF_ADDR); | ||
443 | outb((tpm_inf.base & 0xff), TPM_INF_DATA); | ||
444 | |||
445 | /* control if IO-ports are set correctly */ | ||
446 | outb(IOLIMH, TPM_INF_ADDR); | ||
447 | ioh = inb(TPM_INF_DATA); | ||
448 | outb(IOLIML, TPM_INF_ADDR); | ||
449 | iol = inb(TPM_INF_DATA); | ||
450 | |||
451 | if ((ioh << 8 | iol) != tpm_inf.base) { | ||
452 | dev_err(&pci_dev->dev, | ||
453 | "Could not set IO-ports to %04x\n", | ||
454 | tpm_inf.base); | ||
455 | pci_disable_device(pci_dev); | ||
456 | return -EIO; | ||
390 | } | 457 | } |
391 | 458 | ||
392 | /* activate register */ | 459 | /* activate register */ |
393 | outb(TPM_DAR, TPM_ADDR); | 460 | outb(TPM_DAR, TPM_INF_ADDR); |
394 | outb(0x01, TPM_DATA); | 461 | outb(0x01, TPM_INF_DATA); |
395 | outb(DISABLE_REGISTER_PAIR, TPM_ADDR); | 462 | outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); |
396 | 463 | ||
397 | /* disable RESET, LP and IRQC */ | 464 | /* disable RESET, LP and IRQC */ |
398 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); | 465 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); |
399 | 466 | ||
400 | /* Finally, we're done, print some infos */ | 467 | /* Finally, we're done, print some infos */ |
401 | dev_info(&pci_dev->dev, "TPM found: " | 468 | dev_info(&pci_dev->dev, "TPM found: " |
469 | "config base 0x%x, " | ||
402 | "io base 0x%x, " | 470 | "io base 0x%x, " |
403 | "chip version %02x%02x, " | 471 | "chip version %02x%02x, " |
404 | "vendor id %x%x (Infineon), " | 472 | "vendor id %x%x (Infineon), " |
405 | "product id %02x%02x" | 473 | "product id %02x%02x" |
406 | "%s\n", | 474 | "%s\n", |
475 | TPM_INF_ADDR, | ||
407 | tpm_inf.base, | 476 | tpm_inf.base, |
408 | version[0], version[1], | 477 | version[0], version[1], |
409 | vendorid[0], vendorid[1], | 478 | vendorid[0], vendorid[1], |
410 | productid[0], productid[1], ((productid[0] == 0) | 479 | productid[0], productid[1], chipname); |
411 | && (productid[1] == | ||
412 | 6)) ? | ||
413 | " (SLD 9630 TT 1.1)" : ""); | ||
414 | 480 | ||
415 | rc = tpm_register_hardware(pci_dev, &tpm_inf); | 481 | rc = tpm_register_hardware(pci_dev, &tpm_inf); |
416 | if (rc < 0) { | 482 | if (rc < 0) { |
@@ -462,6 +528,6 @@ module_init(init_inf); | |||
462 | module_exit(cleanup_inf); | 528 | module_exit(cleanup_inf); |
463 | 529 | ||
464 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); | 530 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); |
465 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT"); | 531 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); |
466 | MODULE_VERSION("1.4"); | 532 | MODULE_VERSION("1.5"); |
467 | MODULE_LICENSE("GPL"); | 533 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index f975dab1ddf9..a13395e2c372 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * i8xx_tco 0.07: TCO timer driver for i8xx chipsets | 2 | * i8xx_tco: TCO timer driver for i8xx chipsets |
3 | * | 3 | * |
4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. | 4 | * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. |
5 | * http://www.kernelconcepts.de | 5 | * http://www.kernelconcepts.de |
@@ -63,6 +63,9 @@ | |||
63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> | 63 | * 20050128 Wim Van Sebroeck <wim@iguana.be> |
64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW | 64 | * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW |
65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. | 65 | * chipsets. Also added support for the "undocumented" ICH7 chipset. |
66 | * 20050807 Wim Van Sebroeck <wim@iguana.be> | ||
67 | * 0.08 Make sure that the watchdog is only "armed" when started. | ||
68 | * (Kernel Bug 4251) | ||
66 | */ | 69 | */ |
67 | 70 | ||
68 | /* | 71 | /* |
@@ -87,7 +90,7 @@ | |||
87 | #include "i8xx_tco.h" | 90 | #include "i8xx_tco.h" |
88 | 91 | ||
89 | /* Module and version information */ | 92 | /* Module and version information */ |
90 | #define TCO_VERSION "0.07" | 93 | #define TCO_VERSION "0.08" |
91 | #define TCO_MODULE_NAME "i8xx TCO timer" | 94 | #define TCO_MODULE_NAME "i8xx TCO timer" |
92 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 95 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
93 | #define PFX TCO_MODULE_NAME ": " | 96 | #define PFX TCO_MODULE_NAME ": " |
@@ -125,10 +128,18 @@ static int tco_timer_start (void) | |||
125 | unsigned char val; | 128 | unsigned char val; |
126 | 129 | ||
127 | spin_lock(&tco_lock); | 130 | spin_lock(&tco_lock); |
131 | |||
132 | /* disable chipset's NO_REBOOT bit */ | ||
133 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
134 | val &= 0xfd; | ||
135 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
136 | |||
137 | /* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */ | ||
128 | val = inb (TCO1_CNT + 1); | 138 | val = inb (TCO1_CNT + 1); |
129 | val &= 0xf7; | 139 | val &= 0xf7; |
130 | outb (val, TCO1_CNT + 1); | 140 | outb (val, TCO1_CNT + 1); |
131 | val = inb (TCO1_CNT + 1); | 141 | val = inb (TCO1_CNT + 1); |
142 | |||
132 | spin_unlock(&tco_lock); | 143 | spin_unlock(&tco_lock); |
133 | 144 | ||
134 | if (val & 0x08) | 145 | if (val & 0x08) |
@@ -138,13 +149,20 @@ static int tco_timer_start (void) | |||
138 | 149 | ||
139 | static int tco_timer_stop (void) | 150 | static int tco_timer_stop (void) |
140 | { | 151 | { |
141 | unsigned char val; | 152 | unsigned char val, val1; |
142 | 153 | ||
143 | spin_lock(&tco_lock); | 154 | spin_lock(&tco_lock); |
155 | /* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */ | ||
144 | val = inb (TCO1_CNT + 1); | 156 | val = inb (TCO1_CNT + 1); |
145 | val |= 0x08; | 157 | val |= 0x08; |
146 | outb (val, TCO1_CNT + 1); | 158 | outb (val, TCO1_CNT + 1); |
147 | val = inb (TCO1_CNT + 1); | 159 | val = inb (TCO1_CNT + 1); |
160 | |||
161 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
162 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | ||
163 | val1 |= 0x02; | ||
164 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
165 | |||
148 | spin_unlock(&tco_lock); | 166 | spin_unlock(&tco_lock); |
149 | 167 | ||
150 | if ((val & 0x08) == 0) | 168 | if ((val & 0x08) == 0) |
@@ -155,6 +173,7 @@ static int tco_timer_stop (void) | |||
155 | static int tco_timer_keepalive (void) | 173 | static int tco_timer_keepalive (void) |
156 | { | 174 | { |
157 | spin_lock(&tco_lock); | 175 | spin_lock(&tco_lock); |
176 | /* Reload the timer by writing to the TCO Timer Reload register */ | ||
158 | outb (0x01, TCO1_RLD); | 177 | outb (0x01, TCO1_RLD); |
159 | spin_unlock(&tco_lock); | 178 | spin_unlock(&tco_lock); |
160 | return 0; | 179 | return 0; |
@@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
417 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); | 436 | printk (KERN_ERR PFX "failed to get TCOBASE address\n"); |
418 | return 0; | 437 | return 0; |
419 | } | 438 | } |
420 | /* | 439 | |
421 | * Check chipset's NO_REBOOT bit | 440 | /* Check chipset's NO_REBOOT bit */ |
422 | */ | ||
423 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); | 441 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); |
424 | if (val1 & 0x02) { | 442 | if (val1 & 0x02) { |
425 | val1 &= 0xfd; | 443 | val1 &= 0xfd; |
@@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void) | |||
430 | return 0; /* Cannot reset NO_REBOOT bit */ | 448 | return 0; /* Cannot reset NO_REBOOT bit */ |
431 | } | 449 | } |
432 | } | 450 | } |
451 | /* Disable reboots untill the watchdog starts */ | ||
452 | val1 |= 0x02; | ||
453 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val1); | ||
454 | |||
433 | /* Set the TCO_EN bit in SMI_EN register */ | 455 | /* Set the TCO_EN bit in SMI_EN register */ |
434 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { | 456 | if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { |
435 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", | 457 | printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", |
@@ -505,17 +527,10 @@ out: | |||
505 | 527 | ||
506 | static void __exit watchdog_cleanup (void) | 528 | static void __exit watchdog_cleanup (void) |
507 | { | 529 | { |
508 | u8 val; | ||
509 | |||
510 | /* Stop the timer before we leave */ | 530 | /* Stop the timer before we leave */ |
511 | if (!nowayout) | 531 | if (!nowayout) |
512 | tco_timer_stop (); | 532 | tco_timer_stop (); |
513 | 533 | ||
514 | /* Set the NO_REBOOT bit to prevent later reboots, just for sure */ | ||
515 | pci_read_config_byte (i8xx_tco_pci, 0xd4, &val); | ||
516 | val |= 0x02; | ||
517 | pci_write_config_byte (i8xx_tco_pci, 0xd4, val); | ||
518 | |||
519 | /* Deregister */ | 534 | /* Deregister */ |
520 | misc_deregister (&i8xx_tco_miscdev); | 535 | misc_deregister (&i8xx_tco_miscdev); |
521 | unregister_reboot_notifier(&i8xx_tco_notifier); | 536 | unregister_reboot_notifier(&i8xx_tco_notifier); |
diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 1c99536b673b..fa503ed9f86d 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c | |||
@@ -23,8 +23,8 @@ | |||
23 | #include <asm/sibyte/sb1250_smbus.h> | 23 | #include <asm/sibyte/sb1250_smbus.h> |
24 | 24 | ||
25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { | 25 | static struct i2c_algo_sibyte_data sibyte_board_data[2] = { |
26 | { NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) }, | 26 | { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) }, |
27 | { NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) } | 27 | { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) } |
28 | }; | 28 | }; |
29 | 29 | ||
30 | static struct i2c_adapter sibyte_board_adapter[2] = { | 30 | static struct i2c_adapter sibyte_board_adapter[2] = { |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index f9c1acb4ed6a..c9d3a00a3c0c 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device *dev) | |||
1220 | goto failed; | 1220 | goto failed; |
1221 | 1221 | ||
1222 | g = alloc_disk_node(1 << PARTN_BITS, | 1222 | g = alloc_disk_node(1 << PARTN_BITS, |
1223 | pcibus_to_node(drive->hwif->pci_dev->bus)); | 1223 | hwif_to_node(drive->hwif)); |
1224 | if (!g) | 1224 | if (!g) |
1225 | goto out_free_idkp; | 1225 | goto out_free_idkp; |
1226 | 1226 | ||
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 94daf40ae323..c1128ae5cd2f 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -960,15 +960,6 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) | |||
960 | } | 960 | } |
961 | #endif /* MAX_HWIFS > 1 */ | 961 | #endif /* MAX_HWIFS > 1 */ |
962 | 962 | ||
963 | static inline int hwif_to_node(ide_hwif_t *hwif) | ||
964 | { | ||
965 | if (hwif->pci_dev) | ||
966 | return pcibus_to_node(hwif->pci_dev->bus); | ||
967 | else | ||
968 | /* Add ways to determine the node of other busses here */ | ||
969 | return -1; | ||
970 | } | ||
971 | |||
972 | /* | 963 | /* |
973 | * init request queue | 964 | * init request queue |
974 | */ | 965 | */ |
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c index e0d1b01cc74c..386df71eee74 100644 --- a/drivers/isdn/icn/icn.c +++ b/drivers/isdn/icn/icn.c | |||
@@ -1650,7 +1650,7 @@ static void __exit icn_exit(void) | |||
1650 | { | 1650 | { |
1651 | isdn_ctrl cmd; | 1651 | isdn_ctrl cmd; |
1652 | icn_card *card = cards; | 1652 | icn_card *card = cards; |
1653 | icn_card *last; | 1653 | icn_card *last, *tmpcard; |
1654 | int i; | 1654 | int i; |
1655 | unsigned long flags; | 1655 | unsigned long flags; |
1656 | 1656 | ||
@@ -1670,8 +1670,9 @@ static void __exit icn_exit(void) | |||
1670 | for (i = 0; i < ICN_BCH; i++) | 1670 | for (i = 0; i < ICN_BCH; i++) |
1671 | icn_free_queue(card, i); | 1671 | icn_free_queue(card, i); |
1672 | } | 1672 | } |
1673 | card = card->next; | 1673 | tmpcard = card->next; |
1674 | spin_unlock_irqrestore(&card->lock, flags); | 1674 | spin_unlock_irqrestore(&card->lock, flags); |
1675 | card = tmpcard; | ||
1675 | } | 1676 | } |
1676 | card = cards; | 1677 | card = cards; |
1677 | cards = NULL; | 1678 | cards = NULL; |
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index e83256d0fd14..a50a41f6f79d 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
@@ -188,7 +188,7 @@ config DVB_BCM3510 | |||
188 | support this frontend. | 188 | support this frontend. |
189 | 189 | ||
190 | config DVB_LGDT330X | 190 | config DVB_LGDT330X |
191 | tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)" | 191 | tristate "LG Electronics LGDT3302/LGDT3303 based" |
192 | depends on DVB_CORE | 192 | depends on DVB_CORE |
193 | help | 193 | help |
194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want | 194 | An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 5264310c070e..536c35d969b7 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -225,6 +225,22 @@ struct dvb_pll_desc dvb_pll_tua6034 = { | |||
225 | }; | 225 | }; |
226 | EXPORT_SYMBOL(dvb_pll_tua6034); | 226 | EXPORT_SYMBOL(dvb_pll_tua6034); |
227 | 227 | ||
228 | /* Infineon TUA6034 | ||
229 | * used in LG Innotek TDVS-H062F | ||
230 | */ | ||
231 | struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { | ||
232 | .name = "LG/Infineon TUA6034", | ||
233 | .min = 54000000, | ||
234 | .max = 863000000, | ||
235 | .count = 3, | ||
236 | .entries = { | ||
237 | { 160000000, 44000000, 62500, 0xce, 0x01 }, | ||
238 | { 455000000, 44000000, 62500, 0xce, 0x02 }, | ||
239 | { 999999999, 44000000, 62500, 0xce, 0x04 }, | ||
240 | }, | ||
241 | }; | ||
242 | EXPORT_SYMBOL(dvb_pll_tdvs_tua6034); | ||
243 | |||
228 | /* Philips FMD1216ME | 244 | /* Philips FMD1216ME |
229 | * used in Medion Hybrid PCMCIA card and USB Box | 245 | * used in Medion Hybrid PCMCIA card and USB Box |
230 | */ | 246 | */ |
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h index cb794759d89e..205b2d1a8852 100644 --- a/drivers/media/dvb/frontends/dvb-pll.h +++ b/drivers/media/dvb/frontends/dvb-pll.h | |||
@@ -31,6 +31,7 @@ extern struct dvb_pll_desc dvb_pll_unknown_1; | |||
31 | extern struct dvb_pll_desc dvb_pll_tua6010xs; | 31 | extern struct dvb_pll_desc dvb_pll_tua6010xs; |
32 | extern struct dvb_pll_desc dvb_pll_env57h1xd5; | 32 | extern struct dvb_pll_desc dvb_pll_env57h1xd5; |
33 | extern struct dvb_pll_desc dvb_pll_tua6034; | 33 | extern struct dvb_pll_desc dvb_pll_tua6034; |
34 | extern struct dvb_pll_desc dvb_pll_tdvs_tua6034; | ||
34 | extern struct dvb_pll_desc dvb_pll_tda665x; | 35 | extern struct dvb_pll_desc dvb_pll_tda665x; |
35 | extern struct dvb_pll_desc dvb_pll_fmd1216me; | 36 | extern struct dvb_pll_desc dvb_pll_fmd1216me; |
36 | extern struct dvb_pll_desc dvb_pll_tded4; | 37 | extern struct dvb_pll_desc dvb_pll_tded4; |
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c index e94dee50eecd..1f1cd7a8d500 100644 --- a/drivers/media/dvb/frontends/lgdt330x.c +++ b/drivers/media/dvb/frontends/lgdt330x.c | |||
@@ -1,11 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FusionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
6 | * Based on code from Kirk Lapray <kirk_lapray@bigfoot.com> | ||
7 | * Copyright (C) 2005 | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
@@ -25,11 +22,13 @@ | |||
25 | /* | 22 | /* |
26 | * NOTES ABOUT THIS DRIVER | 23 | * NOTES ABOUT THIS DRIVER |
27 | * | 24 | * |
28 | * This driver supports DViCO FusionHDTV Gold under Linux. | 25 | * This Linux driver supports: |
26 | * DViCO FusionHDTV 3 Gold-Q | ||
27 | * DViCO FusionHDTV 3 Gold-T | ||
28 | * DViCO FusionHDTV 5 Gold | ||
29 | * | 29 | * |
30 | * TODO: | 30 | * TODO: |
31 | * BER and signal strength always return 0. | 31 | * signal strength always returns 0. |
32 | * Include support for LGDT3303 | ||
33 | * | 32 | * |
34 | */ | 33 | */ |
35 | 34 | ||
@@ -41,7 +40,6 @@ | |||
41 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
42 | 41 | ||
43 | #include "dvb_frontend.h" | 42 | #include "dvb_frontend.h" |
44 | #include "dvb-pll.h" | ||
45 | #include "lgdt330x_priv.h" | 43 | #include "lgdt330x_priv.h" |
46 | #include "lgdt330x.h" | 44 | #include "lgdt330x.h" |
47 | 45 | ||
@@ -70,55 +68,37 @@ struct lgdt330x_state | |||
70 | u32 current_frequency; | 68 | u32 current_frequency; |
71 | }; | 69 | }; |
72 | 70 | ||
73 | static int i2c_writebytes (struct lgdt330x_state* state, | 71 | static int i2c_write_demod_bytes (struct lgdt330x_state* state, |
74 | u8 addr, /* demod_address or pll_address */ | ||
75 | u8 *buf, /* data bytes to send */ | 72 | u8 *buf, /* data bytes to send */ |
76 | int len /* number of bytes to send */ ) | 73 | int len /* number of bytes to send */ ) |
77 | { | 74 | { |
78 | u8 tmp[] = { buf[0], buf[1] }; | ||
79 | struct i2c_msg msg = | 75 | struct i2c_msg msg = |
80 | { .addr = addr, .flags = 0, .buf = tmp, .len = 2 }; | 76 | { .addr = state->config->demod_address, |
81 | int err; | 77 | .flags = 0, |
78 | .buf = buf, | ||
79 | .len = 2 }; | ||
82 | int i; | 80 | int i; |
81 | int err; | ||
83 | 82 | ||
84 | for (i=1; i<len; i++) { | 83 | for (i=0; i<len-1; i+=2){ |
85 | tmp[1] = buf[i]; | ||
86 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 84 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
87 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err == %i)\n", __FUNCTION__, addr, buf[0], err); | 85 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, msg.buf[0], msg.buf[1], err); |
88 | if (err < 0) | 86 | if (err < 0) |
89 | return err; | 87 | return err; |
90 | else | 88 | else |
91 | return -EREMOTEIO; | 89 | return -EREMOTEIO; |
92 | } | 90 | } |
93 | tmp[0]++; | 91 | msg.buf += 2; |
94 | } | 92 | } |
95 | return 0; | 93 | return 0; |
96 | } | 94 | } |
97 | 95 | ||
98 | #if 0 | ||
99 | static int i2c_readbytes (struct lgdt330x_state* state, | ||
100 | u8 addr, /* demod_address or pll_address */ | ||
101 | u8 *buf, /* holds data bytes read */ | ||
102 | int len /* number of bytes to read */ ) | ||
103 | { | ||
104 | struct i2c_msg msg = | ||
105 | { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len }; | ||
106 | int err; | ||
107 | |||
108 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | ||
109 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x, err == %i)\n", __FUNCTION__, addr, err); | ||
110 | return -EREMOTEIO; | ||
111 | } | ||
112 | return 0; | ||
113 | } | ||
114 | #endif | ||
115 | |||
116 | /* | 96 | /* |
117 | * This routine writes the register (reg) to the demod bus | 97 | * This routine writes the register (reg) to the demod bus |
118 | * then reads the data returned for (len) bytes. | 98 | * then reads the data returned for (len) bytes. |
119 | */ | 99 | */ |
120 | 100 | ||
121 | static u8 i2c_selectreadbytes (struct lgdt330x_state* state, | 101 | static u8 i2c_read_demod_bytes (struct lgdt330x_state* state, |
122 | enum I2C_REG reg, u8* buf, int len) | 102 | enum I2C_REG reg, u8* buf, int len) |
123 | { | 103 | { |
124 | u8 wr [] = { reg }; | 104 | u8 wr [] = { reg }; |
@@ -139,7 +119,7 @@ static u8 i2c_selectreadbytes (struct lgdt330x_state* state, | |||
139 | } | 119 | } |
140 | 120 | ||
141 | /* Software reset */ | 121 | /* Software reset */ |
142 | int lgdt330x_SwReset(struct lgdt330x_state* state) | 122 | static int lgdt3302_SwReset(struct lgdt330x_state* state) |
143 | { | 123 | { |
144 | u8 ret; | 124 | u8 ret; |
145 | u8 reset[] = { | 125 | u8 reset[] = { |
@@ -148,23 +128,51 @@ int lgdt330x_SwReset(struct lgdt330x_state* state) | |||
148 | * bits 5-0 are 1 to mask interrupts */ | 128 | * bits 5-0 are 1 to mask interrupts */ |
149 | }; | 129 | }; |
150 | 130 | ||
151 | ret = i2c_writebytes(state, | 131 | ret = i2c_write_demod_bytes(state, |
152 | state->config->demod_address, | 132 | reset, sizeof(reset)); |
133 | if (ret == 0) { | ||
134 | |||
135 | /* force reset high (inactive) and unmask interrupts */ | ||
136 | reset[1] = 0x7f; | ||
137 | ret = i2c_write_demod_bytes(state, | ||
138 | reset, sizeof(reset)); | ||
139 | } | ||
140 | return ret; | ||
141 | } | ||
142 | |||
143 | static int lgdt3303_SwReset(struct lgdt330x_state* state) | ||
144 | { | ||
145 | u8 ret; | ||
146 | u8 reset[] = { | ||
147 | 0x02, | ||
148 | 0x00 /* bit 0 is active low software reset */ | ||
149 | }; | ||
150 | |||
151 | ret = i2c_write_demod_bytes(state, | ||
153 | reset, sizeof(reset)); | 152 | reset, sizeof(reset)); |
154 | if (ret == 0) { | 153 | if (ret == 0) { |
155 | /* spec says reset takes 100 ns why wait */ | 154 | |
156 | /* mdelay(100); */ /* keep low for 100mS */ | 155 | /* force reset high (inactive) */ |
157 | reset[1] = 0x7f; /* force reset high (inactive) | 156 | reset[1] = 0x01; |
158 | * and unmask interrupts */ | 157 | ret = i2c_write_demod_bytes(state, |
159 | ret = i2c_writebytes(state, | ||
160 | state->config->demod_address, | ||
161 | reset, sizeof(reset)); | 158 | reset, sizeof(reset)); |
162 | } | 159 | } |
163 | /* Spec does not indicate a need for this either */ | ||
164 | /*mdelay(5); */ /* wait 5 msec before doing more */ | ||
165 | return ret; | 160 | return ret; |
166 | } | 161 | } |
167 | 162 | ||
163 | static int lgdt330x_SwReset(struct lgdt330x_state* state) | ||
164 | { | ||
165 | switch (state->config->demod_chip) { | ||
166 | case LGDT3302: | ||
167 | return lgdt3302_SwReset(state); | ||
168 | case LGDT3303: | ||
169 | return lgdt3303_SwReset(state); | ||
170 | default: | ||
171 | return -ENODEV; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | |||
168 | static int lgdt330x_init(struct dvb_frontend* fe) | 176 | static int lgdt330x_init(struct dvb_frontend* fe) |
169 | { | 177 | { |
170 | /* Hardware reset is done using gpio[0] of cx23880x chip. | 178 | /* Hardware reset is done using gpio[0] of cx23880x chip. |
@@ -173,22 +181,98 @@ static int lgdt330x_init(struct dvb_frontend* fe) | |||
173 | * Maybe there needs to be a callable function in cx88-core or | 181 | * Maybe there needs to be a callable function in cx88-core or |
174 | * the caller of this function needs to do it. */ | 182 | * the caller of this function needs to do it. */ |
175 | 183 | ||
176 | dprintk("%s entered\n", __FUNCTION__); | 184 | /* |
177 | return lgdt330x_SwReset((struct lgdt330x_state*) fe->demodulator_priv); | 185 | * Array of byte pairs <address, value> |
186 | * to initialize each different chip | ||
187 | */ | ||
188 | static u8 lgdt3302_init_data[] = { | ||
189 | /* Use 50MHz parameter values from spec sheet since xtal is 50 */ | ||
190 | /* Change the value of NCOCTFV[25:0] of carrier | ||
191 | recovery center frequency register */ | ||
192 | VSB_CARRIER_FREQ0, 0x00, | ||
193 | VSB_CARRIER_FREQ1, 0x87, | ||
194 | VSB_CARRIER_FREQ2, 0x8e, | ||
195 | VSB_CARRIER_FREQ3, 0x01, | ||
196 | /* Change the TPCLK pin polarity | ||
197 | data is valid on falling clock */ | ||
198 | DEMUX_CONTROL, 0xfb, | ||
199 | /* Change the value of IFBW[11:0] of | ||
200 | AGC IF/RF loop filter bandwidth register */ | ||
201 | AGC_RF_BANDWIDTH0, 0x40, | ||
202 | AGC_RF_BANDWIDTH1, 0x93, | ||
203 | AGC_RF_BANDWIDTH2, 0x00, | ||
204 | /* Change the value of bit 6, 'nINAGCBY' and | ||
205 | 'NSSEL[1:0] of ACG function control register 2 */ | ||
206 | AGC_FUNC_CTRL2, 0xc6, | ||
207 | /* Change the value of bit 6 'RFFIX' | ||
208 | of AGC function control register 3 */ | ||
209 | AGC_FUNC_CTRL3, 0x40, | ||
210 | /* Set the value of 'INLVTHD' register 0x2a/0x2c | ||
211 | to 0x7fe */ | ||
212 | AGC_DELAY0, 0x07, | ||
213 | AGC_DELAY2, 0xfe, | ||
214 | /* Change the value of IAGCBW[15:8] | ||
215 | of inner AGC loop filter bandwith */ | ||
216 | AGC_LOOP_BANDWIDTH0, 0x08, | ||
217 | AGC_LOOP_BANDWIDTH1, 0x9a | ||
218 | }; | ||
219 | |||
220 | static u8 lgdt3303_init_data[] = { | ||
221 | 0x4c, 0x14 | ||
222 | }; | ||
223 | |||
224 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
225 | char *chip_name; | ||
226 | int err; | ||
227 | |||
228 | switch (state->config->demod_chip) { | ||
229 | case LGDT3302: | ||
230 | chip_name = "LGDT3302"; | ||
231 | err = i2c_write_demod_bytes(state, lgdt3302_init_data, | ||
232 | sizeof(lgdt3302_init_data)); | ||
233 | break; | ||
234 | case LGDT3303: | ||
235 | chip_name = "LGDT3303"; | ||
236 | err = i2c_write_demod_bytes(state, lgdt3303_init_data, | ||
237 | sizeof(lgdt3303_init_data)); | ||
238 | break; | ||
239 | default: | ||
240 | chip_name = "undefined"; | ||
241 | printk (KERN_WARNING "Only LGDT3302 and LGDT3303 are supported chips.\n"); | ||
242 | err = -ENODEV; | ||
243 | } | ||
244 | dprintk("%s entered as %s\n", __FUNCTION__, chip_name); | ||
245 | if (err < 0) | ||
246 | return err; | ||
247 | return lgdt330x_SwReset(state); | ||
178 | } | 248 | } |
179 | 249 | ||
180 | static int lgdt330x_read_ber(struct dvb_frontend* fe, u32* ber) | 250 | static int lgdt330x_read_ber(struct dvb_frontend* fe, u32* ber) |
181 | { | 251 | { |
182 | *ber = 0; /* Dummy out for now */ | 252 | *ber = 0; /* Not supplied by the demod chips */ |
183 | return 0; | 253 | return 0; |
184 | } | 254 | } |
185 | 255 | ||
186 | static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 256 | static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
187 | { | 257 | { |
188 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 258 | struct lgdt330x_state* state = fe->demodulator_priv; |
259 | int err; | ||
189 | u8 buf[2]; | 260 | u8 buf[2]; |
190 | 261 | ||
191 | i2c_selectreadbytes(state, PACKET_ERR_COUNTER1, buf, sizeof(buf)); | 262 | switch (state->config->demod_chip) { |
263 | case LGDT3302: | ||
264 | err = i2c_read_demod_bytes(state, LGDT3302_PACKET_ERR_COUNTER1, | ||
265 | buf, sizeof(buf)); | ||
266 | break; | ||
267 | case LGDT3303: | ||
268 | err = i2c_read_demod_bytes(state, LGDT3303_PACKET_ERR_COUNTER1, | ||
269 | buf, sizeof(buf)); | ||
270 | break; | ||
271 | default: | ||
272 | printk(KERN_WARNING | ||
273 | "Only LGDT3302 and LGDT3303 are supported chips.\n"); | ||
274 | err = -ENODEV; | ||
275 | } | ||
192 | 276 | ||
193 | *ucblocks = (buf[0] << 8) | buf[1]; | 277 | *ucblocks = (buf[0] << 8) | buf[1]; |
194 | return 0; | 278 | return 0; |
@@ -197,123 +281,113 @@ static int lgdt330x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
197 | static int lgdt330x_set_parameters(struct dvb_frontend* fe, | 281 | static int lgdt330x_set_parameters(struct dvb_frontend* fe, |
198 | struct dvb_frontend_parameters *param) | 282 | struct dvb_frontend_parameters *param) |
199 | { | 283 | { |
200 | struct lgdt330x_state* state = | 284 | /* |
201 | (struct lgdt330x_state*) fe->demodulator_priv; | 285 | * Array of byte pairs <address, value> |
286 | * to initialize 8VSB for lgdt3303 chip 50 MHz IF | ||
287 | */ | ||
288 | static u8 lgdt3303_8vsb_44_data[] = { | ||
289 | 0x04, 0x00, | ||
290 | 0x0d, 0x40, | ||
291 | 0x0e, 0x87, | ||
292 | 0x0f, 0x8e, | ||
293 | 0x10, 0x01, | ||
294 | 0x47, 0x8b }; | ||
295 | |||
296 | /* | ||
297 | * Array of byte pairs <address, value> | ||
298 | * to initialize QAM for lgdt3303 chip | ||
299 | */ | ||
300 | static u8 lgdt3303_qam_data[] = { | ||
301 | 0x04, 0x00, | ||
302 | 0x0d, 0x00, | ||
303 | 0x0e, 0x00, | ||
304 | 0x0f, 0x00, | ||
305 | 0x10, 0x00, | ||
306 | 0x51, 0x63, | ||
307 | 0x47, 0x66, | ||
308 | 0x48, 0x66, | ||
309 | 0x4d, 0x1a, | ||
310 | 0x49, 0x08, | ||
311 | 0x4a, 0x9b }; | ||
312 | |||
313 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
202 | 314 | ||
203 | /* Use 50MHz parameter values from spec sheet since xtal is 50 */ | ||
204 | static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 }; | 315 | static u8 top_ctrl_cfg[] = { TOP_CONTROL, 0x03 }; |
205 | static u8 vsb_freq_cfg[] = { VSB_CARRIER_FREQ0, 0x00, 0x87, 0x8e, 0x01 }; | ||
206 | static u8 demux_ctrl_cfg[] = { DEMUX_CONTROL, 0xfb }; | ||
207 | static u8 agc_rf_cfg[] = { AGC_RF_BANDWIDTH0, 0x40, 0x93, 0x00 }; | ||
208 | static u8 agc_ctrl_cfg[] = { AGC_FUNC_CTRL2, 0xc6, 0x40 }; | ||
209 | static u8 agc_delay_cfg[] = { AGC_DELAY0, 0x07, 0x00, 0xfe }; | ||
210 | static u8 agc_loop_cfg[] = { AGC_LOOP_BANDWIDTH0, 0x08, 0x9a }; | ||
211 | 316 | ||
317 | int err; | ||
212 | /* Change only if we are actually changing the modulation */ | 318 | /* Change only if we are actually changing the modulation */ |
213 | if (state->current_modulation != param->u.vsb.modulation) { | 319 | if (state->current_modulation != param->u.vsb.modulation) { |
214 | switch(param->u.vsb.modulation) { | 320 | switch(param->u.vsb.modulation) { |
215 | case VSB_8: | 321 | case VSB_8: |
216 | dprintk("%s: VSB_8 MODE\n", __FUNCTION__); | 322 | dprintk("%s: VSB_8 MODE\n", __FUNCTION__); |
217 | 323 | ||
218 | /* Select VSB mode and serial MPEG interface */ | 324 | /* Select VSB mode */ |
219 | top_ctrl_cfg[1] = 0x07; | 325 | top_ctrl_cfg[1] = 0x03; |
220 | 326 | ||
221 | /* Select ANT connector if supported by card */ | 327 | /* Select ANT connector if supported by card */ |
222 | if (state->config->pll_rf_set) | 328 | if (state->config->pll_rf_set) |
223 | state->config->pll_rf_set(fe, 1); | 329 | state->config->pll_rf_set(fe, 1); |
330 | |||
331 | if (state->config->demod_chip == LGDT3303) { | ||
332 | err = i2c_write_demod_bytes(state, lgdt3303_8vsb_44_data, | ||
333 | sizeof(lgdt3303_8vsb_44_data)); | ||
334 | } | ||
224 | break; | 335 | break; |
225 | 336 | ||
226 | case QAM_64: | 337 | case QAM_64: |
227 | dprintk("%s: QAM_64 MODE\n", __FUNCTION__); | 338 | dprintk("%s: QAM_64 MODE\n", __FUNCTION__); |
228 | 339 | ||
229 | /* Select QAM_64 mode and serial MPEG interface */ | 340 | /* Select QAM_64 mode */ |
230 | top_ctrl_cfg[1] = 0x04; | 341 | top_ctrl_cfg[1] = 0x00; |
231 | 342 | ||
232 | /* Select CABLE connector if supported by card */ | 343 | /* Select CABLE connector if supported by card */ |
233 | if (state->config->pll_rf_set) | 344 | if (state->config->pll_rf_set) |
234 | state->config->pll_rf_set(fe, 0); | 345 | state->config->pll_rf_set(fe, 0); |
346 | |||
347 | if (state->config->demod_chip == LGDT3303) { | ||
348 | err = i2c_write_demod_bytes(state, lgdt3303_qam_data, | ||
349 | sizeof(lgdt3303_qam_data)); | ||
350 | } | ||
235 | break; | 351 | break; |
236 | 352 | ||
237 | case QAM_256: | 353 | case QAM_256: |
238 | dprintk("%s: QAM_256 MODE\n", __FUNCTION__); | 354 | dprintk("%s: QAM_256 MODE\n", __FUNCTION__); |
239 | 355 | ||
240 | /* Select QAM_256 mode and serial MPEG interface */ | 356 | /* Select QAM_256 mode */ |
241 | top_ctrl_cfg[1] = 0x05; | 357 | top_ctrl_cfg[1] = 0x01; |
242 | 358 | ||
243 | /* Select CABLE connector if supported by card */ | 359 | /* Select CABLE connector if supported by card */ |
244 | if (state->config->pll_rf_set) | 360 | if (state->config->pll_rf_set) |
245 | state->config->pll_rf_set(fe, 0); | 361 | state->config->pll_rf_set(fe, 0); |
362 | |||
363 | if (state->config->demod_chip == LGDT3303) { | ||
364 | err = i2c_write_demod_bytes(state, lgdt3303_qam_data, | ||
365 | sizeof(lgdt3303_qam_data)); | ||
366 | } | ||
246 | break; | 367 | break; |
247 | default: | 368 | default: |
248 | printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation); | 369 | printk(KERN_WARNING "lgdt330x: %s: Modulation type(%d) UNSUPPORTED\n", __FUNCTION__, param->u.vsb.modulation); |
249 | return -1; | 370 | return -1; |
250 | } | 371 | } |
251 | /* Initializations common to all modes */ | 372 | /* |
373 | * select serial or parallel MPEG harware interface | ||
374 | * Serial: 0x04 for LGDT3302 or 0x40 for LGDT3303 | ||
375 | * Parallel: 0x00 | ||
376 | */ | ||
377 | top_ctrl_cfg[1] |= state->config->serial_mpeg; | ||
252 | 378 | ||
253 | /* Select the requested mode */ | 379 | /* Select the requested mode */ |
254 | i2c_writebytes(state, state->config->demod_address, | 380 | i2c_write_demod_bytes(state, top_ctrl_cfg, |
255 | top_ctrl_cfg, sizeof(top_ctrl_cfg)); | 381 | sizeof(top_ctrl_cfg)); |
256 | |||
257 | /* Change the value of IFBW[11:0] | ||
258 | of AGC IF/RF loop filter bandwidth register */ | ||
259 | i2c_writebytes(state, state->config->demod_address, | ||
260 | agc_rf_cfg, sizeof(agc_rf_cfg)); | ||
261 | |||
262 | /* Change the value of bit 6, 'nINAGCBY' and | ||
263 | 'NSSEL[1:0] of ACG function control register 2 */ | ||
264 | /* Change the value of bit 6 'RFFIX' | ||
265 | of AGC function control register 3 */ | ||
266 | i2c_writebytes(state, state->config->demod_address, | ||
267 | agc_ctrl_cfg, sizeof(agc_ctrl_cfg)); | ||
268 | |||
269 | /* Change the TPCLK pin polarity | ||
270 | data is valid on falling clock */ | ||
271 | i2c_writebytes(state, state->config->demod_address, | ||
272 | demux_ctrl_cfg, sizeof(demux_ctrl_cfg)); | ||
273 | |||
274 | /* Change the value of NCOCTFV[25:0] of carrier | ||
275 | recovery center frequency register */ | ||
276 | i2c_writebytes(state, state->config->demod_address, | ||
277 | vsb_freq_cfg, sizeof(vsb_freq_cfg)); | ||
278 | |||
279 | /* Set the value of 'INLVTHD' register 0x2a/0x2c to 0x7fe */ | ||
280 | i2c_writebytes(state, state->config->demod_address, | ||
281 | agc_delay_cfg, sizeof(agc_delay_cfg)); | ||
282 | |||
283 | /* Change the value of IAGCBW[15:8] | ||
284 | of inner AGC loop filter bandwith */ | ||
285 | i2c_writebytes(state, state->config->demod_address, | ||
286 | agc_loop_cfg, sizeof(agc_loop_cfg)); | ||
287 | |||
288 | state->config->set_ts_params(fe, 0); | 382 | state->config->set_ts_params(fe, 0); |
289 | state->current_modulation = param->u.vsb.modulation; | 383 | state->current_modulation = param->u.vsb.modulation; |
290 | } | 384 | } |
291 | 385 | ||
292 | /* Change only if we are actually changing the channel */ | 386 | /* Change only if we are actually changing the channel */ |
293 | if (state->current_frequency != param->frequency) { | 387 | if (state->current_frequency != param->frequency) { |
294 | u8 buf[5]; | 388 | /* Tune to the new frequency */ |
295 | struct i2c_msg msg = { .flags = 0, .buf = &buf[1], .len = 4 }; | 389 | state->config->pll_set(fe, param); |
296 | int err; | 390 | /* Keep track of the new frequency */ |
297 | |||
298 | state->config->pll_set(fe, param, buf); | ||
299 | msg.addr = buf[0]; | ||
300 | |||
301 | dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x " | ||
302 | "0x%02x 0x%02x\n", __FUNCTION__, | ||
303 | buf[0],buf[1],buf[2],buf[3],buf[4]); | ||
304 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | ||
305 | printk(KERN_WARNING "lgdt330x: %s error (addr %02x <- %02x, err = %i)\n", __FUNCTION__, buf[0], buf[1], err); | ||
306 | if (err < 0) | ||
307 | return err; | ||
308 | else | ||
309 | return -EREMOTEIO; | ||
310 | } | ||
311 | #if 0 | ||
312 | /* Check the status of the tuner pll */ | ||
313 | i2c_readbytes(state, buf[0], &buf[1], 1); | ||
314 | dprintk("%s: tuner status byte = 0x%02x\n", __FUNCTION__, buf[1]); | ||
315 | #endif | ||
316 | /* Update current frequency */ | ||
317 | state->current_frequency = param->frequency; | 391 | state->current_frequency = param->frequency; |
318 | } | 392 | } |
319 | lgdt330x_SwReset(state); | 393 | lgdt330x_SwReset(state); |
@@ -328,21 +402,15 @@ static int lgdt330x_get_frontend(struct dvb_frontend* fe, | |||
328 | return 0; | 402 | return 0; |
329 | } | 403 | } |
330 | 404 | ||
331 | static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | 405 | static int lgdt3302_read_status(struct dvb_frontend* fe, fe_status_t* status) |
332 | { | 406 | { |
333 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 407 | struct lgdt330x_state* state = fe->demodulator_priv; |
334 | u8 buf[3]; | 408 | u8 buf[3]; |
335 | 409 | ||
336 | *status = 0; /* Reset status result */ | 410 | *status = 0; /* Reset status result */ |
337 | 411 | ||
338 | /* | ||
339 | * You must set the Mask bits to 1 in the IRQ_MASK in order | ||
340 | * to see that status bit in the IRQ_STATUS register. | ||
341 | * This is done in SwReset(); | ||
342 | */ | ||
343 | |||
344 | /* AGC status register */ | 412 | /* AGC status register */ |
345 | i2c_selectreadbytes(state, AGC_STATUS, buf, 1); | 413 | i2c_read_demod_bytes(state, AGC_STATUS, buf, 1); |
346 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); | 414 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); |
347 | if ((buf[0] & 0x0c) == 0x8){ | 415 | if ((buf[0] & 0x0c) == 0x8){ |
348 | /* Test signal does not exist flag */ | 416 | /* Test signal does not exist flag */ |
@@ -353,16 +421,15 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
353 | return 0; | 421 | return 0; |
354 | } | 422 | } |
355 | 423 | ||
424 | /* | ||
425 | * You must set the Mask bits to 1 in the IRQ_MASK in order | ||
426 | * to see that status bit in the IRQ_STATUS register. | ||
427 | * This is done in SwReset(); | ||
428 | */ | ||
356 | /* signal status */ | 429 | /* signal status */ |
357 | i2c_selectreadbytes(state, TOP_CONTROL, buf, sizeof(buf)); | 430 | i2c_read_demod_bytes(state, TOP_CONTROL, buf, sizeof(buf)); |
358 | dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]); | 431 | dprintk("%s: TOP_CONTROL = 0x%02x, IRO_MASK = 0x%02x, IRQ_STATUS = 0x%02x\n", __FUNCTION__, buf[0], buf[1], buf[2]); |
359 | 432 | ||
360 | #if 0 | ||
361 | /* Alternative method to check for a signal */ | ||
362 | /* using the SNR good/bad interrupts. */ | ||
363 | if ((buf[2] & 0x30) == 0x10) | ||
364 | *status |= FE_HAS_SIGNAL; | ||
365 | #endif | ||
366 | 433 | ||
367 | /* sync status */ | 434 | /* sync status */ |
368 | if ((buf[2] & 0x03) == 0x01) { | 435 | if ((buf[2] & 0x03) == 0x01) { |
@@ -376,7 +443,7 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
376 | } | 443 | } |
377 | 444 | ||
378 | /* Carrier Recovery Lock Status Register */ | 445 | /* Carrier Recovery Lock Status Register */ |
379 | i2c_selectreadbytes(state, CARRIER_LOCK, buf, 1); | 446 | i2c_read_demod_bytes(state, CARRIER_LOCK, buf, 1); |
380 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); | 447 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); |
381 | switch (state->current_modulation) { | 448 | switch (state->current_modulation) { |
382 | case QAM_256: | 449 | case QAM_256: |
@@ -396,13 +463,75 @@ static int lgdt330x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
396 | return 0; | 463 | return 0; |
397 | } | 464 | } |
398 | 465 | ||
466 | static int lgdt3303_read_status(struct dvb_frontend* fe, fe_status_t* status) | ||
467 | { | ||
468 | struct lgdt330x_state* state = fe->demodulator_priv; | ||
469 | int err; | ||
470 | u8 buf[3]; | ||
471 | |||
472 | *status = 0; /* Reset status result */ | ||
473 | |||
474 | /* lgdt3303 AGC status register */ | ||
475 | err = i2c_read_demod_bytes(state, 0x58, buf, 1); | ||
476 | if (err < 0) | ||
477 | return err; | ||
478 | |||
479 | dprintk("%s: AGC_STATUS = 0x%02x\n", __FUNCTION__, buf[0]); | ||
480 | if ((buf[0] & 0x21) == 0x01){ | ||
481 | /* Test input signal does not exist flag */ | ||
482 | /* as well as the AGC lock flag. */ | ||
483 | *status |= FE_HAS_SIGNAL; | ||
484 | } else { | ||
485 | /* Without a signal all other status bits are meaningless */ | ||
486 | return 0; | ||
487 | } | ||
488 | |||
489 | /* Carrier Recovery Lock Status Register */ | ||
490 | i2c_read_demod_bytes(state, CARRIER_LOCK, buf, 1); | ||
491 | dprintk("%s: CARRIER_LOCK = 0x%02x\n", __FUNCTION__, buf[0]); | ||
492 | switch (state->current_modulation) { | ||
493 | case QAM_256: | ||
494 | case QAM_64: | ||
495 | /* Need to undestand why there are 3 lock levels here */ | ||
496 | if ((buf[0] & 0x07) == 0x07) | ||
497 | *status |= FE_HAS_CARRIER; | ||
498 | else | ||
499 | break; | ||
500 | i2c_read_demod_bytes(state, 0x8a, buf, 1); | ||
501 | if ((buf[0] & 0x04) == 0x04) | ||
502 | *status |= FE_HAS_SYNC; | ||
503 | if ((buf[0] & 0x01) == 0x01) | ||
504 | *status |= FE_HAS_LOCK; | ||
505 | if ((buf[0] & 0x08) == 0x08) | ||
506 | *status |= FE_HAS_VITERBI; | ||
507 | break; | ||
508 | case VSB_8: | ||
509 | if ((buf[0] & 0x80) == 0x80) | ||
510 | *status |= FE_HAS_CARRIER; | ||
511 | else | ||
512 | break; | ||
513 | i2c_read_demod_bytes(state, 0x38, buf, 1); | ||
514 | if ((buf[0] & 0x02) == 0x00) | ||
515 | *status |= FE_HAS_SYNC; | ||
516 | if ((buf[0] & 0x01) == 0x01) { | ||
517 | *status |= FE_HAS_LOCK; | ||
518 | *status |= FE_HAS_VITERBI; | ||
519 | } | ||
520 | break; | ||
521 | default: | ||
522 | printk("KERN_WARNING lgdt330x: %s: Modulation set to unsupported value\n", __FUNCTION__); | ||
523 | } | ||
524 | return 0; | ||
525 | } | ||
526 | |||
399 | static int lgdt330x_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 527 | static int lgdt330x_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
400 | { | 528 | { |
401 | /* not directly available. */ | 529 | /* not directly available. */ |
530 | *strength = 0; | ||
402 | return 0; | 531 | return 0; |
403 | } | 532 | } |
404 | 533 | ||
405 | static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | 534 | static int lgdt3302_read_snr(struct dvb_frontend* fe, u16* snr) |
406 | { | 535 | { |
407 | #ifdef SNR_IN_DB | 536 | #ifdef SNR_IN_DB |
408 | /* | 537 | /* |
@@ -451,7 +580,7 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
451 | 91, 115, 144, 182, 229, 288, 362, 456, 574, 722, | 580 | 91, 115, 144, 182, 229, 288, 362, 456, 574, 722, |
452 | 909, 1144, 1440, 1813, 2282, 2873, 3617, 4553, 5732, 7216, | 581 | 909, 1144, 1440, 1813, 2282, 2873, 3617, 4553, 5732, 7216, |
453 | 9084, 11436, 14396, 18124, 22817, 28724, 36161, 45524, 57312, 72151, | 582 | 9084, 11436, 14396, 18124, 22817, 28724, 36161, 45524, 57312, 72151, |
454 | 90833, 114351, 143960, 181235, 228161, 0x040000 | 583 | 90833, 114351, 143960, 181235, 228161, 0x080000 |
455 | }; | 584 | }; |
456 | 585 | ||
457 | static u8 buf[5];/* read data buffer */ | 586 | static u8 buf[5];/* read data buffer */ |
@@ -459,8 +588,8 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
459 | static u32 snr_db; /* index into SNR_EQ[] */ | 588 | static u32 snr_db; /* index into SNR_EQ[] */ |
460 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 589 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; |
461 | 590 | ||
462 | /* read both equalizer and pase tracker noise data */ | 591 | /* read both equalizer and phase tracker noise data */ |
463 | i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); | 592 | i2c_read_demod_bytes(state, EQPH_ERR0, buf, sizeof(buf)); |
464 | 593 | ||
465 | if (state->current_modulation == VSB_8) { | 594 | if (state->current_modulation == VSB_8) { |
466 | /* Equalizer Mean-Square Error Register for VSB */ | 595 | /* Equalizer Mean-Square Error Register for VSB */ |
@@ -496,19 +625,20 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
496 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | 625 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; |
497 | 626 | ||
498 | /* read both equalizer and pase tracker noise data */ | 627 | /* read both equalizer and pase tracker noise data */ |
499 | i2c_selectreadbytes(state, EQPH_ERR0, buf, sizeof(buf)); | 628 | i2c_read_demod_bytes(state, EQPH_ERR0, buf, sizeof(buf)); |
500 | 629 | ||
501 | if (state->current_modulation == VSB_8) { | 630 | if (state->current_modulation == VSB_8) { |
502 | /* Equalizer Mean-Square Error Register for VSB */ | 631 | /* Phase Tracker Mean-Square Error Register for VSB */ |
503 | noise = ((buf[0] & 7) << 16) | (buf[1] << 8) | buf[2]; | ||
504 | } else { | ||
505 | /* Phase Tracker Mean-Square Error Register for QAM */ | ||
506 | noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4]; | 632 | noise = ((buf[0] & 7<<3) << 13) | (buf[3] << 8) | buf[4]; |
633 | } else { | ||
634 | |||
635 | /* Carrier Recovery Mean-Square Error for QAM */ | ||
636 | i2c_read_demod_bytes(state, 0x1a, buf, 2); | ||
637 | noise = ((buf[0] & 3) << 8) | buf[1]; | ||
507 | } | 638 | } |
508 | 639 | ||
509 | /* Small values for noise mean signal is better so invert noise */ | 640 | /* Small values for noise mean signal is better so invert noise */ |
510 | /* Noise is 19 bit value so discard 3 LSB*/ | 641 | *snr = ~noise; |
511 | *snr = ~noise>>3; | ||
512 | #endif | 642 | #endif |
513 | 643 | ||
514 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); | 644 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); |
@@ -516,6 +646,32 @@ static int lgdt330x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
516 | return 0; | 646 | return 0; |
517 | } | 647 | } |
518 | 648 | ||
649 | static int lgdt3303_read_snr(struct dvb_frontend* fe, u16* snr) | ||
650 | { | ||
651 | /* Return the raw noise value */ | ||
652 | static u8 buf[5];/* read data buffer */ | ||
653 | static u32 noise; /* noise value */ | ||
654 | struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv; | ||
655 | |||
656 | if (state->current_modulation == VSB_8) { | ||
657 | |||
658 | /* Phase Tracker Mean-Square Error Register for VSB */ | ||
659 | noise = ((buf[0] & 7) << 16) | (buf[3] << 8) | buf[4]; | ||
660 | } else { | ||
661 | |||
662 | /* Carrier Recovery Mean-Square Error for QAM */ | ||
663 | i2c_read_demod_bytes(state, 0x1a, buf, 2); | ||
664 | noise = (buf[0] << 8) | buf[1]; | ||
665 | } | ||
666 | |||
667 | /* Small values for noise mean signal is better so invert noise */ | ||
668 | *snr = ~noise; | ||
669 | |||
670 | dprintk("%s: noise = 0x%05x, snr = %idb\n",__FUNCTION__, noise, *snr); | ||
671 | |||
672 | return 0; | ||
673 | } | ||
674 | |||
519 | static int lgdt330x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings) | 675 | static int lgdt330x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fe_tune_settings) |
520 | { | 676 | { |
521 | /* I have no idea about this - it may not be needed */ | 677 | /* I have no idea about this - it may not be needed */ |
@@ -531,7 +687,8 @@ static void lgdt330x_release(struct dvb_frontend* fe) | |||
531 | kfree(state); | 687 | kfree(state); |
532 | } | 688 | } |
533 | 689 | ||
534 | static struct dvb_frontend_ops lgdt330x_ops; | 690 | static struct dvb_frontend_ops lgdt3302_ops; |
691 | static struct dvb_frontend_ops lgdt3303_ops; | ||
535 | 692 | ||
536 | struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | 693 | struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, |
537 | struct i2c_adapter* i2c) | 694 | struct i2c_adapter* i2c) |
@@ -548,9 +705,19 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config, | |||
548 | /* Setup the state */ | 705 | /* Setup the state */ |
549 | state->config = config; | 706 | state->config = config; |
550 | state->i2c = i2c; | 707 | state->i2c = i2c; |
551 | memcpy(&state->ops, &lgdt330x_ops, sizeof(struct dvb_frontend_ops)); | 708 | switch (config->demod_chip) { |
709 | case LGDT3302: | ||
710 | memcpy(&state->ops, &lgdt3302_ops, sizeof(struct dvb_frontend_ops)); | ||
711 | break; | ||
712 | case LGDT3303: | ||
713 | memcpy(&state->ops, &lgdt3303_ops, sizeof(struct dvb_frontend_ops)); | ||
714 | break; | ||
715 | default: | ||
716 | goto error; | ||
717 | } | ||
718 | |||
552 | /* Verify communication with demod chip */ | 719 | /* Verify communication with demod chip */ |
553 | if (i2c_selectreadbytes(state, 2, buf, 1)) | 720 | if (i2c_read_demod_bytes(state, 2, buf, 1)) |
554 | goto error; | 721 | goto error; |
555 | 722 | ||
556 | state->current_frequency = -1; | 723 | state->current_frequency = -1; |
@@ -568,9 +735,33 @@ error: | |||
568 | return NULL; | 735 | return NULL; |
569 | } | 736 | } |
570 | 737 | ||
571 | static struct dvb_frontend_ops lgdt330x_ops = { | 738 | static struct dvb_frontend_ops lgdt3302_ops = { |
739 | .info = { | ||
740 | .name= "LG Electronics LGDT3302 VSB/QAM Frontend", | ||
741 | .type = FE_ATSC, | ||
742 | .frequency_min= 54000000, | ||
743 | .frequency_max= 858000000, | ||
744 | .frequency_stepsize= 62500, | ||
745 | /* Symbol rate is for all VSB modes need to check QAM */ | ||
746 | .symbol_rate_min = 10762000, | ||
747 | .symbol_rate_max = 10762000, | ||
748 | .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB | ||
749 | }, | ||
750 | .init = lgdt330x_init, | ||
751 | .set_frontend = lgdt330x_set_parameters, | ||
752 | .get_frontend = lgdt330x_get_frontend, | ||
753 | .get_tune_settings = lgdt330x_get_tune_settings, | ||
754 | .read_status = lgdt3302_read_status, | ||
755 | .read_ber = lgdt330x_read_ber, | ||
756 | .read_signal_strength = lgdt330x_read_signal_strength, | ||
757 | .read_snr = lgdt3302_read_snr, | ||
758 | .read_ucblocks = lgdt330x_read_ucblocks, | ||
759 | .release = lgdt330x_release, | ||
760 | }; | ||
761 | |||
762 | static struct dvb_frontend_ops lgdt3303_ops = { | ||
572 | .info = { | 763 | .info = { |
573 | .name= "LG Electronics lgdt330x VSB/QAM Frontend", | 764 | .name= "LG Electronics LGDT3303 VSB/QAM Frontend", |
574 | .type = FE_ATSC, | 765 | .type = FE_ATSC, |
575 | .frequency_min= 54000000, | 766 | .frequency_min= 54000000, |
576 | .frequency_max= 858000000, | 767 | .frequency_max= 858000000, |
@@ -584,15 +775,15 @@ static struct dvb_frontend_ops lgdt330x_ops = { | |||
584 | .set_frontend = lgdt330x_set_parameters, | 775 | .set_frontend = lgdt330x_set_parameters, |
585 | .get_frontend = lgdt330x_get_frontend, | 776 | .get_frontend = lgdt330x_get_frontend, |
586 | .get_tune_settings = lgdt330x_get_tune_settings, | 777 | .get_tune_settings = lgdt330x_get_tune_settings, |
587 | .read_status = lgdt330x_read_status, | 778 | .read_status = lgdt3303_read_status, |
588 | .read_ber = lgdt330x_read_ber, | 779 | .read_ber = lgdt330x_read_ber, |
589 | .read_signal_strength = lgdt330x_read_signal_strength, | 780 | .read_signal_strength = lgdt330x_read_signal_strength, |
590 | .read_snr = lgdt330x_read_snr, | 781 | .read_snr = lgdt3303_read_snr, |
591 | .read_ucblocks = lgdt330x_read_ucblocks, | 782 | .read_ucblocks = lgdt330x_read_ucblocks, |
592 | .release = lgdt330x_release, | 783 | .release = lgdt330x_release, |
593 | }; | 784 | }; |
594 | 785 | ||
595 | MODULE_DESCRIPTION("lgdt330x [DViCO FusionHDTV 3 Gold] (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); | 786 | MODULE_DESCRIPTION("LGDT330X (ATSC 8VSB & ITU-T J.83 AnnexB 64/256 QAM) Demodulator Driver"); |
596 | MODULE_AUTHOR("Wilson Michaels"); | 787 | MODULE_AUTHOR("Wilson Michaels"); |
597 | MODULE_LICENSE("GPL"); | 788 | MODULE_LICENSE("GPL"); |
598 | 789 | ||
@@ -601,6 +792,5 @@ EXPORT_SYMBOL(lgdt330x_attach); | |||
601 | /* | 792 | /* |
602 | * Local variables: | 793 | * Local variables: |
603 | * c-basic-offset: 8 | 794 | * c-basic-offset: 8 |
604 | * compile-command: "make DVB=1" | ||
605 | * End: | 795 | * End: |
606 | */ | 796 | */ |
diff --git a/drivers/media/dvb/frontends/lgdt330x.h b/drivers/media/dvb/frontends/lgdt330x.h index 04986f8e7565..e209ba1e47c5 100644 --- a/drivers/media/dvb/frontends/lgdt330x.h +++ b/drivers/media/dvb/frontends/lgdt330x.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
@@ -24,14 +24,26 @@ | |||
24 | 24 | ||
25 | #include <linux/dvb/frontend.h> | 25 | #include <linux/dvb/frontend.h> |
26 | 26 | ||
27 | typedef enum lg_chip_t { | ||
28 | UNDEFINED, | ||
29 | LGDT3302, | ||
30 | LGDT3303 | ||
31 | }lg_chip_type; | ||
32 | |||
27 | struct lgdt330x_config | 33 | struct lgdt330x_config |
28 | { | 34 | { |
29 | /* The demodulator's i2c address */ | 35 | /* The demodulator's i2c address */ |
30 | u8 demod_address; | 36 | u8 demod_address; |
31 | 37 | ||
38 | /* LG demodulator chip LGDT3302 or LGDT3303 */ | ||
39 | lg_chip_type demod_chip; | ||
40 | |||
41 | /* MPEG hardware interface - 0:parallel 1:serial */ | ||
42 | int serial_mpeg; | ||
43 | |||
32 | /* PLL interface */ | 44 | /* PLL interface */ |
33 | int (*pll_rf_set) (struct dvb_frontend* fe, int index); | 45 | int (*pll_rf_set) (struct dvb_frontend* fe, int index); |
34 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pll_address); | 46 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); |
35 | 47 | ||
36 | /* Need to set device param for start_dma */ | 48 | /* Need to set device param for start_dma */ |
37 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); | 49 | int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); |
diff --git a/drivers/media/dvb/frontends/lgdt330x_priv.h b/drivers/media/dvb/frontends/lgdt330x_priv.h index 4143ce8f1a95..59b7c5b9012d 100644 --- a/drivers/media/dvb/frontends/lgdt330x_priv.h +++ b/drivers/media/dvb/frontends/lgdt330x_priv.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM | 2 | * Support for LGDT3302 and LGDT3303 - VSB/QAM |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> | 4 | * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> |
5 | * | 5 | * |
@@ -57,8 +57,10 @@ enum I2C_REG { | |||
57 | PH_ERR1= 0x4a, | 57 | PH_ERR1= 0x4a, |
58 | PH_ERR2= 0x4b, | 58 | PH_ERR2= 0x4b, |
59 | DEMUX_CONTROL= 0x66, | 59 | DEMUX_CONTROL= 0x66, |
60 | PACKET_ERR_COUNTER1= 0x6a, | 60 | LGDT3302_PACKET_ERR_COUNTER1= 0x6a, |
61 | PACKET_ERR_COUNTER2= 0x6b, | 61 | LGDT3302_PACKET_ERR_COUNTER2= 0x6b, |
62 | LGDT3303_PACKET_ERR_COUNTER1= 0x8b, | ||
63 | LGDT3303_PACKET_ERR_COUNTER2= 0x8c, | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | #endif /* _LGDT330X_PRIV_ */ | 66 | #endif /* _LGDT330X_PRIV_ */ |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index ef0e9a85c359..78d223257a68 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: cx88-dvb.c,v 1.54 2005/07/25 05:13:50 mkrufky Exp $ | 2 | * $Id: cx88-dvb.c,v 1.58 2005/08/07 09:24:08 mkrufky Exp $ |
3 | * | 3 | * |
4 | * device driver for Conexant 2388x based TV cards | 4 | * device driver for Conexant 2388x based TV cards |
5 | * MPEG Transport Stream (DVB) routines | 5 | * MPEG Transport Stream (DVB) routines |
@@ -208,14 +208,26 @@ static struct or51132_config pchdtv_hd3000 = { | |||
208 | 208 | ||
209 | #ifdef HAVE_LGDT330X | 209 | #ifdef HAVE_LGDT330X |
210 | static int lgdt330x_pll_set(struct dvb_frontend* fe, | 210 | static int lgdt330x_pll_set(struct dvb_frontend* fe, |
211 | struct dvb_frontend_parameters* params, | 211 | struct dvb_frontend_parameters* params) |
212 | u8* pllbuf) | ||
213 | { | 212 | { |
214 | struct cx8802_dev *dev= fe->dvb->priv; | 213 | struct cx8802_dev *dev= fe->dvb->priv; |
214 | u8 buf[4]; | ||
215 | struct i2c_msg msg = | ||
216 | { .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 }; | ||
217 | int err; | ||
215 | 218 | ||
216 | pllbuf[0] = dev->core->pll_addr; | 219 | dvb_pll_configure(dev->core->pll_desc, buf, params->frequency, 0); |
217 | dvb_pll_configure(dev->core->pll_desc, &pllbuf[1], | 220 | dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", |
218 | params->frequency, 0); | 221 | __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); |
222 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { | ||
223 | printk(KERN_WARNING "cx88-dvb: %s error " | ||
224 | "(addr %02x <- %02x, err = %i)\n", | ||
225 | __FUNCTION__, buf[0], buf[1], err); | ||
226 | if (err < 0) | ||
227 | return err; | ||
228 | else | ||
229 | return -EREMOTEIO; | ||
230 | } | ||
219 | return 0; | 231 | return 0; |
220 | } | 232 | } |
221 | 233 | ||
@@ -244,6 +256,8 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) | |||
244 | 256 | ||
245 | static struct lgdt330x_config fusionhdtv_3_gold = { | 257 | static struct lgdt330x_config fusionhdtv_3_gold = { |
246 | .demod_address = 0x0e, | 258 | .demod_address = 0x0e, |
259 | .demod_chip = LGDT3302, | ||
260 | .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ | ||
247 | .pll_set = lgdt330x_pll_set, | 261 | .pll_set = lgdt330x_pll_set, |
248 | .set_ts_params = lgdt330x_set_ts_param, | 262 | .set_ts_params = lgdt330x_set_ts_param, |
249 | }; | 263 | }; |
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index 06e8eb19a05c..43a942a29c2e 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
@@ -53,6 +53,9 @@ config I2O_CONFIG | |||
53 | To compile this support as a module, choose M here: the | 53 | To compile this support as a module, choose M here: the |
54 | module will be called i2o_config. | 54 | module will be called i2o_config. |
55 | 55 | ||
56 | Note: If you want to use the new API you have to download the | ||
57 | i2o_config patch from http://i2o.shadowconnect.com/ | ||
58 | |||
56 | config I2O_CONFIG_OLD_IOCTL | 59 | config I2O_CONFIG_OLD_IOCTL |
57 | bool "Enable ioctls (OBSOLETE)" | 60 | bool "Enable ioctls (OBSOLETE)" |
58 | depends on I2O_CONFIG | 61 | depends on I2O_CONFIG |
diff --git a/drivers/message/i2o/config-osm.c b/drivers/message/i2o/config-osm.c index fe2e7afc9eae..af32ab4e90cd 100644 --- a/drivers/message/i2o/config-osm.c +++ b/drivers/message/i2o/config-osm.c | |||
@@ -30,503 +30,9 @@ | |||
30 | 30 | ||
31 | static struct i2o_driver i2o_config_driver; | 31 | static struct i2o_driver i2o_config_driver; |
32 | 32 | ||
33 | /* Special file operations for sysfs */ | ||
34 | struct fops_attribute { | ||
35 | struct bin_attribute bin; | ||
36 | struct file_operations fops; | ||
37 | }; | ||
38 | |||
39 | /** | ||
40 | * sysfs_read_dummy | ||
41 | */ | ||
42 | static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
43 | size_t count) | ||
44 | { | ||
45 | return 0; | ||
46 | }; | ||
47 | |||
48 | /** | ||
49 | * sysfs_write_dummy | ||
50 | */ | ||
51 | static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset, | ||
52 | size_t count) | ||
53 | { | ||
54 | return 0; | ||
55 | }; | ||
56 | |||
57 | /** | ||
58 | * sysfs_create_fops_file - Creates attribute with special file operations | ||
59 | * @kobj: kobject which should contains the attribute | ||
60 | * @attr: attributes which should be used to create file | ||
61 | * | ||
62 | * First creates attribute @attr in kobject @kobj. If it is the first time | ||
63 | * this function is called, merge old fops from sysfs with new one and | ||
64 | * write it back. Afterwords the new fops will be set for the created | ||
65 | * attribute. | ||
66 | * | ||
67 | * Returns 0 on success or negative error code on failure. | ||
68 | */ | ||
69 | static int sysfs_create_fops_file(struct kobject *kobj, | ||
70 | struct fops_attribute *attr) | ||
71 | { | ||
72 | struct file_operations tmp, *fops; | ||
73 | struct dentry *d; | ||
74 | struct qstr qstr; | ||
75 | int rc; | ||
76 | |||
77 | fops = &attr->fops; | ||
78 | |||
79 | if (fops->read) | ||
80 | attr->bin.read = sysfs_read_dummy; | ||
81 | |||
82 | if (fops->write) | ||
83 | attr->bin.write = sysfs_write_dummy; | ||
84 | |||
85 | if ((rc = sysfs_create_bin_file(kobj, &attr->bin))) | ||
86 | return rc; | ||
87 | |||
88 | qstr.name = attr->bin.attr.name; | ||
89 | qstr.len = strlen(qstr.name); | ||
90 | qstr.hash = full_name_hash(qstr.name, qstr.len); | ||
91 | |||
92 | if ((d = lookup_hash(&qstr, kobj->dentry))) { | ||
93 | if (!fops->owner) { | ||
94 | memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp)); | ||
95 | if (fops->read) | ||
96 | tmp.read = fops->read; | ||
97 | if (fops->write) | ||
98 | tmp.write = fops->write; | ||
99 | memcpy(fops, &tmp, sizeof(tmp)); | ||
100 | } | ||
101 | |||
102 | d->d_inode->i_fop = fops; | ||
103 | } else | ||
104 | sysfs_remove_bin_file(kobj, &attr->bin); | ||
105 | |||
106 | return -ENOENT; | ||
107 | }; | ||
108 | |||
109 | /** | ||
110 | * sysfs_remove_fops_file - Remove attribute with special file operations | ||
111 | * @kobj: kobject which contains the attribute | ||
112 | * @attr: attributes which are used to create file | ||
113 | * | ||
114 | * Only wrapper arround sysfs_remove_bin_file() | ||
115 | * | ||
116 | * Returns 0 on success or negative error code on failure. | ||
117 | */ | ||
118 | static inline int sysfs_remove_fops_file(struct kobject *kobj, | ||
119 | struct fops_attribute *attr) | ||
120 | { | ||
121 | return sysfs_remove_bin_file(kobj, &attr->bin); | ||
122 | }; | ||
123 | |||
124 | /** | ||
125 | * i2o_config_read_hrt - Returns the HRT of the controller | ||
126 | * @kob: kernel object handle | ||
127 | * @buf: buffer into which the HRT should be copied | ||
128 | * @off: file offset | ||
129 | * @count: number of bytes to read | ||
130 | * | ||
131 | * Put @count bytes starting at @off into @buf from the HRT of the I2O | ||
132 | * controller corresponding to @kobj. | ||
133 | * | ||
134 | * Returns number of bytes copied into buffer. | ||
135 | */ | ||
136 | static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf, | ||
137 | loff_t offset, size_t count) | ||
138 | { | ||
139 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
140 | i2o_hrt *hrt = c->hrt.virt; | ||
141 | |||
142 | u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4; | ||
143 | |||
144 | if (offset > size) | ||
145 | return 0; | ||
146 | |||
147 | if (offset + count > size) | ||
148 | count = size - offset; | ||
149 | |||
150 | memcpy(buf, (u8 *) hrt + offset, count); | ||
151 | |||
152 | return count; | ||
153 | }; | ||
154 | |||
155 | /** | ||
156 | * i2o_config_read_lct - Returns the LCT of the controller | ||
157 | * @kob: kernel object handle | ||
158 | * @buf: buffer into which the LCT should be copied | ||
159 | * @off: file offset | ||
160 | * @count: number of bytes to read | ||
161 | * | ||
162 | * Put @count bytes starting at @off into @buf from the LCT of the I2O | ||
163 | * controller corresponding to @kobj. | ||
164 | * | ||
165 | * Returns number of bytes copied into buffer. | ||
166 | */ | ||
167 | static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf, | ||
168 | loff_t offset, size_t count) | ||
169 | { | ||
170 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
171 | u32 size = c->lct->table_size * 4; | ||
172 | |||
173 | if (offset > size) | ||
174 | return 0; | ||
175 | |||
176 | if (offset + count > size) | ||
177 | count = size - offset; | ||
178 | |||
179 | memcpy(buf, (u8 *) c->lct + offset, count); | ||
180 | |||
181 | return count; | ||
182 | }; | ||
183 | |||
184 | #define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \ | ||
185 | static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \ | ||
186 | return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \ | ||
187 | };\ | ||
188 | \ | ||
189 | static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \ | ||
190 | return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \ | ||
191 | }; \ | ||
192 | \ | ||
193 | static struct fops_attribute i2o_config_attr_##_name = { \ | ||
194 | .bin = { .attr = { .name = __stringify(_name), .mode = _mode, \ | ||
195 | .owner = THIS_MODULE }, \ | ||
196 | .size = 0, }, \ | ||
197 | .fops = { .write = i2o_config_##_name##_write, \ | ||
198 | .read = i2o_config_##_name##_read} \ | ||
199 | }; | ||
200 | |||
201 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
202 | |||
203 | /** | ||
204 | * i2o_config_dpt_reagion - Converts type and id to flash region | ||
205 | * @swtype: type of software module reading | ||
206 | * @swid: id of software which should be read | ||
207 | * | ||
208 | * Converts type and id from I2O spec to the matching region for DPT / | ||
209 | * Adaptec controllers. | ||
210 | * | ||
211 | * Returns region which match type and id or -1 on error. | ||
212 | */ | ||
213 | static u32 i2o_config_dpt_region(u8 swtype, u8 swid) | ||
214 | { | ||
215 | switch (swtype) { | ||
216 | case I2O_SOFTWARE_MODULE_IRTOS: | ||
217 | /* | ||
218 | * content: operation firmware | ||
219 | * region size: | ||
220 | * 0xbc000 for 2554, 3754, 2564, 3757 | ||
221 | * 0x170000 for 2865 | ||
222 | * 0x17c000 for 3966 | ||
223 | */ | ||
224 | if (!swid) | ||
225 | return 0; | ||
226 | |||
227 | break; | ||
228 | |||
229 | case I2O_SOFTWARE_MODULE_IOP_PRIVATE: | ||
230 | /* | ||
231 | * content: BIOS and SMOR | ||
232 | * BIOS size: first 0x8000 bytes | ||
233 | * region size: | ||
234 | * 0x40000 for 2554, 3754, 2564, 3757 | ||
235 | * 0x80000 for 2865, 3966 | ||
236 | */ | ||
237 | if (!swid) | ||
238 | return 1; | ||
239 | |||
240 | break; | ||
241 | |||
242 | case I2O_SOFTWARE_MODULE_IOP_CONFIG: | ||
243 | switch (swid) { | ||
244 | case 0: | ||
245 | /* | ||
246 | * content: NVRAM defaults | ||
247 | * region size: 0x2000 bytes | ||
248 | */ | ||
249 | return 2; | ||
250 | case 1: | ||
251 | /* | ||
252 | * content: serial number | ||
253 | * region size: 0x2000 bytes | ||
254 | */ | ||
255 | return 3; | ||
256 | } | ||
257 | break; | ||
258 | } | ||
259 | |||
260 | return -1; | ||
261 | }; | ||
262 | |||
263 | #endif | ||
264 | |||
265 | /** | ||
266 | * i2o_config_sw_read - Read a software module from controller | ||
267 | * @file: file pointer | ||
268 | * @buf: buffer into which the data should be copied | ||
269 | * @count: number of bytes to read | ||
270 | * @off: file offset | ||
271 | * @swtype: type of software module reading | ||
272 | * @swid: id of software which should be read | ||
273 | * | ||
274 | * Transfers @count bytes at offset @offset from IOP into buffer using | ||
275 | * type @swtype and id @swid as described in I2O spec. | ||
276 | * | ||
277 | * Returns number of bytes copied into buffer or error code on failure. | ||
278 | */ | ||
279 | static ssize_t i2o_config_sw_read(struct file *file, char __user * buf, | ||
280 | size_t count, loff_t * offset, u8 swtype, | ||
281 | u32 swid) | ||
282 | { | ||
283 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
284 | struct kobject *kobj = sd->s_element; | ||
285 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
286 | u32 m, function = I2O_CMD_SW_UPLOAD; | ||
287 | struct i2o_dma buffer; | ||
288 | struct i2o_message __iomem *msg; | ||
289 | u32 __iomem *mptr; | ||
290 | int rc, status; | ||
291 | |||
292 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
293 | if (m == I2O_QUEUE_EMPTY) | ||
294 | return -EBUSY; | ||
295 | |||
296 | mptr = &msg->body[3]; | ||
297 | |||
298 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) { | ||
299 | i2o_msg_nop(c, m); | ||
300 | return rc; | ||
301 | } | ||
302 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
303 | if (c->adaptec) { | ||
304 | mptr = &msg->body[4]; | ||
305 | function = I2O_CMD_PRIVATE; | ||
306 | |||
307 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
308 | |||
309 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ, | ||
310 | &msg->body[0]); | ||
311 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
312 | writel(*offset, &msg->body[2]); | ||
313 | writel(count, &msg->body[3]); | ||
314 | } else | ||
315 | #endif | ||
316 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
317 | |||
318 | writel(0xD0000000 | count, mptr++); | ||
319 | writel(buffer.phys, mptr); | ||
320 | |||
321 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
322 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
323 | writel(0, &msg->u.head[3]); | ||
324 | |||
325 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
326 | if (!c->adaptec) | ||
327 | #endif | ||
328 | { | ||
329 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
330 | writel(0, &msg->body[1]); | ||
331 | writel(swid, &msg->body[2]); | ||
332 | } | ||
333 | |||
334 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
335 | |||
336 | if (status == I2O_POST_WAIT_OK) { | ||
337 | if (!(rc = copy_to_user(buf, buffer.virt, count))) { | ||
338 | rc = count; | ||
339 | *offset += count; | ||
340 | } | ||
341 | } else | ||
342 | rc = -EIO; | ||
343 | |||
344 | if (status != -ETIMEDOUT) | ||
345 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
346 | |||
347 | return rc; | ||
348 | }; | ||
349 | |||
350 | /** | ||
351 | * i2o_config_sw_write - Write a software module to controller | ||
352 | * @file: file pointer | ||
353 | * @buf: buffer into which the data should be copied | ||
354 | * @count: number of bytes to read | ||
355 | * @off: file offset | ||
356 | * @swtype: type of software module writing | ||
357 | * @swid: id of software which should be written | ||
358 | * | ||
359 | * Transfers @count bytes at offset @offset from buffer to IOP using | ||
360 | * type @swtype and id @swid as described in I2O spec. | ||
361 | * | ||
362 | * Returns number of bytes copied from buffer or error code on failure. | ||
363 | */ | ||
364 | static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf, | ||
365 | size_t count, loff_t * offset, u8 swtype, | ||
366 | u32 swid) | ||
367 | { | ||
368 | struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata; | ||
369 | struct kobject *kobj = sd->s_element; | ||
370 | struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop; | ||
371 | u32 m, function = I2O_CMD_SW_DOWNLOAD; | ||
372 | struct i2o_dma buffer; | ||
373 | struct i2o_message __iomem *msg; | ||
374 | u32 __iomem *mptr; | ||
375 | int rc, status; | ||
376 | |||
377 | m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET); | ||
378 | if (m == I2O_QUEUE_EMPTY) | ||
379 | return -EBUSY; | ||
380 | |||
381 | mptr = &msg->body[3]; | ||
382 | |||
383 | if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) | ||
384 | goto nop_msg; | ||
385 | |||
386 | if ((rc = copy_from_user(buffer.virt, buf, count))) | ||
387 | goto free_buffer; | ||
388 | |||
389 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
390 | if (c->adaptec) { | ||
391 | mptr = &msg->body[4]; | ||
392 | function = I2O_CMD_PRIVATE; | ||
393 | |||
394 | writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]); | ||
395 | |||
396 | writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE, | ||
397 | &msg->body[0]); | ||
398 | writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]); | ||
399 | writel(*offset, &msg->body[2]); | ||
400 | writel(count, &msg->body[3]); | ||
401 | } else | ||
402 | #endif | ||
403 | writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]); | ||
404 | |||
405 | writel(0xD4000000 | count, mptr++); | ||
406 | writel(buffer.phys, mptr); | ||
407 | |||
408 | writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]); | ||
409 | writel(i2o_config_driver.context, &msg->u.head[2]); | ||
410 | writel(0, &msg->u.head[3]); | ||
411 | |||
412 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
413 | if (!c->adaptec) | ||
414 | #endif | ||
415 | { | ||
416 | writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]); | ||
417 | writel(0, &msg->body[1]); | ||
418 | writel(swid, &msg->body[2]); | ||
419 | } | ||
420 | |||
421 | status = i2o_msg_post_wait_mem(c, m, 60, &buffer); | ||
422 | |||
423 | if (status != -ETIMEDOUT) | ||
424 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
425 | |||
426 | if (status != I2O_POST_WAIT_OK) | ||
427 | return -EIO; | ||
428 | |||
429 | *offset += count; | ||
430 | |||
431 | return count; | ||
432 | |||
433 | free_buffer: | ||
434 | i2o_dma_free(&c->pdev->dev, &buffer); | ||
435 | |||
436 | nop_msg: | ||
437 | i2o_msg_nop(c, m); | ||
438 | |||
439 | return rc; | ||
440 | }; | ||
441 | |||
442 | /* attribute for HRT in sysfs */ | ||
443 | static struct bin_attribute i2o_config_hrt_attr = { | ||
444 | .attr = { | ||
445 | .name = "hrt", | ||
446 | .mode = S_IRUGO, | ||
447 | .owner = THIS_MODULE}, | ||
448 | .size = 0, | ||
449 | .read = i2o_config_read_hrt | ||
450 | }; | ||
451 | |||
452 | /* attribute for LCT in sysfs */ | ||
453 | static struct bin_attribute i2o_config_lct_attr = { | ||
454 | .attr = { | ||
455 | .name = "lct", | ||
456 | .mode = S_IRUGO, | ||
457 | .owner = THIS_MODULE}, | ||
458 | .size = 0, | ||
459 | .read = i2o_config_read_lct | ||
460 | }; | ||
461 | |||
462 | /* IRTOS firmware access */ | ||
463 | I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0); | ||
464 | |||
465 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
466 | |||
467 | /* | ||
468 | * attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec | ||
469 | * controllers | ||
470 | */ | ||
471 | I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0); | ||
472 | I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0); | ||
473 | I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1); | ||
474 | |||
475 | #endif | ||
476 | |||
477 | /** | ||
478 | * i2o_config_notify_controller_add - Notify of added controller | ||
479 | * @c: the controller which was added | ||
480 | * | ||
481 | * If a I2O controller is added, we catch the notification to add sysfs | ||
482 | * entries. | ||
483 | */ | ||
484 | static void i2o_config_notify_controller_add(struct i2o_controller *c) | ||
485 | { | ||
486 | struct kobject *kobj = &c->exec->device.kobj; | ||
487 | |||
488 | sysfs_create_bin_file(kobj, &i2o_config_hrt_attr); | ||
489 | sysfs_create_bin_file(kobj, &i2o_config_lct_attr); | ||
490 | |||
491 | sysfs_create_fops_file(kobj, &i2o_config_attr_irtos); | ||
492 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
493 | if (c->adaptec) { | ||
494 | sysfs_create_fops_file(kobj, &i2o_config_attr_bios); | ||
495 | sysfs_create_fops_file(kobj, &i2o_config_attr_nvram); | ||
496 | sysfs_create_fops_file(kobj, &i2o_config_attr_serial); | ||
497 | } | ||
498 | #endif | ||
499 | }; | ||
500 | |||
501 | /** | ||
502 | * i2o_config_notify_controller_remove - Notify of removed controller | ||
503 | * @c: the controller which was removed | ||
504 | * | ||
505 | * If a I2O controller is removed, we catch the notification to remove the | ||
506 | * sysfs entries. | ||
507 | */ | ||
508 | static void i2o_config_notify_controller_remove(struct i2o_controller *c) | ||
509 | { | ||
510 | struct kobject *kobj = &c->exec->device.kobj; | ||
511 | |||
512 | #ifdef CONFIG_I2O_EXT_ADAPTEC | ||
513 | if (c->adaptec) { | ||
514 | sysfs_remove_fops_file(kobj, &i2o_config_attr_serial); | ||
515 | sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram); | ||
516 | sysfs_remove_fops_file(kobj, &i2o_config_attr_bios); | ||
517 | } | ||
518 | #endif | ||
519 | sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos); | ||
520 | |||
521 | sysfs_remove_bin_file(kobj, &i2o_config_lct_attr); | ||
522 | sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr); | ||
523 | }; | ||
524 | |||
525 | /* Config OSM driver struct */ | 33 | /* Config OSM driver struct */ |
526 | static struct i2o_driver i2o_config_driver = { | 34 | static struct i2o_driver i2o_config_driver = { |
527 | .name = OSM_NAME, | 35 | .name = OSM_NAME, |
528 | .notify_controller_add = i2o_config_notify_controller_add, | ||
529 | .notify_controller_remove = i2o_config_notify_controller_remove | ||
530 | }; | 36 | }; |
531 | 37 | ||
532 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL | 38 | #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL |
diff --git a/drivers/message/i2o/pci.c b/drivers/message/i2o/pci.c index 7a60fd7be8ad..66c03e882570 100644 --- a/drivers/message/i2o/pci.c +++ b/drivers/message/i2o/pci.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/i2o.h> | 32 | #include <linux/i2o.h> |
33 | #include "core.h" | 33 | #include "core.h" |
34 | 34 | ||
35 | #define OSM_DESCRIPTION "I2O-subsystem" | ||
36 | |||
35 | /* PCI device id table for all I2O controllers */ | 37 | /* PCI device id table for all I2O controllers */ |
36 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { | 38 | static struct pci_device_id __devinitdata i2o_pci_ids[] = { |
37 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, | 39 | {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, |
@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c) | |||
66 | 68 | ||
67 | if (c->base.virt) | 69 | if (c->base.virt) |
68 | iounmap(c->base.virt); | 70 | iounmap(c->base.virt); |
71 | |||
72 | pci_release_regions(c->pdev); | ||
69 | } | 73 | } |
70 | 74 | ||
71 | /** | 75 | /** |
@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
84 | struct device *dev = &pdev->dev; | 88 | struct device *dev = &pdev->dev; |
85 | int i; | 89 | int i; |
86 | 90 | ||
91 | if (pci_request_regions(pdev, OSM_DESCRIPTION)) { | ||
92 | printk(KERN_ERR "%s: device already claimed\n", c->name); | ||
93 | return -ENODEV; | ||
94 | } | ||
95 | |||
87 | for (i = 0; i < 6; i++) { | 96 | for (i = 0; i < 6; i++) { |
88 | /* Skip I/O spaces */ | 97 | /* Skip I/O spaces */ |
89 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { | 98 | if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { |
@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) | |||
138 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); | 147 | c->base.virt = ioremap_nocache(c->base.phys, c->base.len); |
139 | if (!c->base.virt) { | 148 | if (!c->base.virt) { |
140 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); | 149 | printk(KERN_ERR "%s: Unable to map controller.\n", c->name); |
150 | i2o_pci_free(c); | ||
141 | return -ENOMEM; | 151 | return -ENOMEM; |
142 | } | 152 | } |
143 | 153 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 201a550f0bcc..368b8fb14023 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -66,8 +66,8 @@ | |||
66 | 66 | ||
67 | #define DRV_MODULE_NAME "tg3" | 67 | #define DRV_MODULE_NAME "tg3" |
68 | #define PFX DRV_MODULE_NAME ": " | 68 | #define PFX DRV_MODULE_NAME ": " |
69 | #define DRV_MODULE_VERSION "3.34" | 69 | #define DRV_MODULE_VERSION "3.35" |
70 | #define DRV_MODULE_RELDATE "July 25, 2005" | 70 | #define DRV_MODULE_RELDATE "August 6, 2005" |
71 | 71 | ||
72 | #define TG3_DEF_MAC_MODE 0 | 72 | #define TG3_DEF_MAC_MODE 0 |
73 | #define TG3_DEF_RX_MODE 0 | 73 | #define TG3_DEF_RX_MODE 0 |
@@ -10421,6 +10421,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10421 | 10421 | ||
10422 | tg3_init_coal(tp); | 10422 | tg3_init_coal(tp); |
10423 | 10423 | ||
10424 | /* Now that we have fully setup the chip, save away a snapshot | ||
10425 | * of the PCI config space. We need to restore this after | ||
10426 | * GRC_MISC_CFG core clock resets and some resume events. | ||
10427 | */ | ||
10428 | pci_save_state(tp->pdev); | ||
10429 | |||
10424 | err = register_netdev(dev); | 10430 | err = register_netdev(dev); |
10425 | if (err) { | 10431 | if (err) { |
10426 | printk(KERN_ERR PFX "Cannot register net device, " | 10432 | printk(KERN_ERR PFX "Cannot register net device, " |
@@ -10430,12 +10436,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10430 | 10436 | ||
10431 | pci_set_drvdata(pdev, dev); | 10437 | pci_set_drvdata(pdev, dev); |
10432 | 10438 | ||
10433 | /* Now that we have fully setup the chip, save away a snapshot | ||
10434 | * of the PCI config space. We need to restore this after | ||
10435 | * GRC_MISC_CFG core clock resets and some resume events. | ||
10436 | */ | ||
10437 | pci_save_state(tp->pdev); | ||
10438 | |||
10439 | printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", | 10439 | printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", |
10440 | dev->name, | 10440 | dev->name, |
10441 | tp->board_part_number, | 10441 | tp->board_part_number, |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 8d0968bd527e..a9160ad16581 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -373,6 +373,25 @@ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev) | |||
373 | } | 373 | } |
374 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi ); | 374 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi ); |
375 | 375 | ||
376 | /* | ||
377 | * VIA VT8235 ISA Bridge: Two IO regions pointed to by words at | ||
378 | * 0x88 (128 bytes of power management registers) | ||
379 | * 0xd0 (16 bytes of SMB registers) | ||
380 | */ | ||
381 | static void __devinit quirk_vt8235_acpi(struct pci_dev *dev) | ||
382 | { | ||
383 | u16 pm, smb; | ||
384 | |||
385 | pci_read_config_word(dev, 0x88, &pm); | ||
386 | pm &= PCI_BASE_ADDRESS_IO_MASK; | ||
387 | quirk_io_region(dev, pm, 128, PCI_BRIDGE_RESOURCES); | ||
388 | |||
389 | pci_read_config_word(dev, 0xd0, &smb); | ||
390 | smb &= PCI_BASE_ADDRESS_IO_MASK; | ||
391 | quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 1); | ||
392 | } | ||
393 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi); | ||
394 | |||
376 | 395 | ||
377 | #ifdef CONFIG_X86_IO_APIC | 396 | #ifdef CONFIG_X86_IO_APIC |
378 | 397 | ||
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1ca21d2ba11c..84eedc965688 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -33,6 +33,11 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
33 | u32 new, check, mask; | 33 | u32 new, check, mask; |
34 | int reg; | 34 | int reg; |
35 | 35 | ||
36 | /* Ignore resources for unimplemented BARs and unused resource slots | ||
37 | for 64 bit BARs. */ | ||
38 | if (!res->flags) | ||
39 | return; | ||
40 | |||
36 | pcibios_resource_to_bus(dev, ®ion, res); | 41 | pcibios_resource_to_bus(dev, ®ion, res); |
37 | 42 | ||
38 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " | 43 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " |
@@ -67,7 +72,7 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
67 | 72 | ||
68 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == | 73 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == |
69 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { | 74 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { |
70 | new = 0; /* currently everyone zeros the high address */ | 75 | new = region.start >> 16 >> 16; |
71 | pci_write_config_dword(dev, reg + 4, new); | 76 | pci_write_config_dword(dev, reg + 4, new); |
72 | pci_read_config_dword(dev, reg + 4, &check); | 77 | pci_read_config_dword(dev, reg + 4, &check); |
73 | if (check != new) { | 78 | if (check != new) { |
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 91e7457d5b04..62fd705203fb 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, | |||
605 | 605 | ||
606 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) | 606 | static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) |
607 | { | 607 | { |
608 | struct pci_bus *bus; | ||
609 | struct resource *root, *res; | 608 | struct resource *root, *res; |
610 | u32 start, end; | 609 | struct pci_bus_region region; |
611 | unsigned mask; | 610 | unsigned mask; |
612 | 611 | ||
613 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; | 612 | res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; |
@@ -620,15 +619,13 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ | |||
620 | if (type & IORESOURCE_IO) | 619 | if (type & IORESOURCE_IO) |
621 | mask = ~3; | 620 | mask = ~3; |
622 | 621 | ||
623 | bus = socket->dev->subordinate; | 622 | res->name = socket->dev->subordinate->name; |
624 | res->name = bus->name; | ||
625 | res->flags = type; | 623 | res->flags = type; |
626 | 624 | ||
627 | start = config_readl(socket, addr_start) & mask; | 625 | region.start = config_readl(socket, addr_start) & mask; |
628 | end = config_readl(socket, addr_end) | ~mask; | 626 | region.end = config_readl(socket, addr_end) | ~mask; |
629 | if (start && end > start && !override_bios) { | 627 | if (region.start && region.end > region.start && !override_bios) { |
630 | res->start = start; | 628 | pcibios_bus_to_resource(socket->dev, res, ®ion); |
631 | res->end = end; | ||
632 | root = pci_find_parent_resource(socket->dev, res); | 629 | root = pci_find_parent_resource(socket->dev, res); |
633 | if (root && (request_resource(root, res) == 0)) | 630 | if (root && (request_resource(root, res) == 0)) |
634 | return; | 631 | return; |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 8f4d2999af8e..79c74f3a11f5 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = { | |||
8120 | #endif | 8120 | #endif |
8121 | 8121 | ||
8122 | static int | 8122 | static int |
8123 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) | 8123 | __qeth_reboot_event_card(struct device *dev, void *data) |
8124 | { | 8124 | { |
8125 | |||
8126 | struct device *entry; | ||
8127 | struct qeth_card *card; | 8125 | struct qeth_card *card; |
8128 | 8126 | ||
8129 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8127 | card = (struct qeth_card *) dev->driver_data; |
8130 | list_for_each_entry(entry, &qeth_ccwgroup_driver.driver.devices, | 8128 | qeth_clear_ip_list(card, 0, 0); |
8131 | driver_list) { | 8129 | qeth_qdio_clear_card(card, 0); |
8132 | card = (struct qeth_card *) entry->driver_data; | 8130 | return 0; |
8133 | qeth_clear_ip_list(card, 0, 0); | 8131 | } |
8134 | qeth_qdio_clear_card(card, 0); | 8132 | |
8135 | } | 8133 | static int |
8136 | up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 8134 | qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) |
8135 | { | ||
8136 | |||
8137 | driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
8138 | __qeth_reboot_event_card); | ||
8137 | return NOTIFY_DONE; | 8139 | return NOTIFY_DONE; |
8138 | } | 8140 | } |
8139 | 8141 | ||
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 04719196fd20..f2ccfea8fdb8 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c | |||
@@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; | |||
27 | #define QETH_PROCFILE_NAME "qeth" | 27 | #define QETH_PROCFILE_NAME "qeth" |
28 | static struct proc_dir_entry *qeth_procfile; | 28 | static struct proc_dir_entry *qeth_procfile; |
29 | 29 | ||
30 | static int | ||
31 | qeth_procfile_seq_match(struct device *dev, void *data) | ||
32 | { | ||
33 | return 1; | ||
34 | } | ||
35 | |||
30 | static void * | 36 | static void * |
31 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) | 37 | qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) |
32 | { | 38 | { |
33 | struct list_head *next_card = NULL; | 39 | struct device *dev; |
34 | int i = 0; | 40 | loff_t nr; |
35 | 41 | ||
36 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 42 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
37 | 43 | ||
38 | if (*offset == 0) | 44 | nr = *offset; |
45 | if (nr == 0) | ||
39 | return SEQ_START_TOKEN; | 46 | return SEQ_START_TOKEN; |
40 | 47 | ||
41 | /* get card at pos *offset */ | 48 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, |
42 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices) | 49 | NULL, qeth_procfile_seq_match); |
43 | if (++i == *offset) | ||
44 | return next_card; | ||
45 | 50 | ||
46 | return NULL; | 51 | /* get card at pos *offset */ |
52 | nr = *offset; | ||
53 | while (nr-- > 1 && dev) | ||
54 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
55 | NULL, qeth_procfile_seq_match); | ||
56 | return (void *) dev; | ||
47 | } | 57 | } |
48 | 58 | ||
49 | static void | 59 | static void |
@@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it) | |||
55 | static void * | 65 | static void * |
56 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 66 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
57 | { | 67 | { |
58 | struct list_head *next_card = NULL; | 68 | struct device *prev, *next; |
59 | struct list_head *current_card; | ||
60 | 69 | ||
61 | if (it == SEQ_START_TOKEN) { | 70 | if (it == SEQ_START_TOKEN) { |
62 | next_card = qeth_ccwgroup_driver.driver.devices.next; | 71 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
63 | if (next_card->next == next_card) /* list empty */ | 72 | NULL, NULL, qeth_procfile_seq_match); |
64 | return NULL; | 73 | if (next) |
65 | (*offset)++; | 74 | (*offset)++; |
66 | } else { | 75 | return (void *) next; |
67 | current_card = (struct list_head *)it; | ||
68 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
69 | return NULL; /* end of list reached */ | ||
70 | next_card = current_card->next; | ||
71 | (*offset)++; | ||
72 | } | 76 | } |
73 | 77 | prev = (struct device *) it; | |
74 | return next_card; | 78 | next = driver_find_device(&qeth_ccwgroup_driver.driver, |
79 | prev, NULL, qeth_procfile_seq_match); | ||
80 | if (next) | ||
81 | (*offset)++; | ||
82 | return (void *) next; | ||
75 | } | 83 | } |
76 | 84 | ||
77 | static inline const char * | 85 | static inline const char * |
@@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) | |||
126 | "-------------- ---- ------ ---------- ---- " | 134 | "-------------- ---- ------ ---------- ---- " |
127 | "---- ----- -----\n"); | 135 | "---- ----- -----\n"); |
128 | } else { | 136 | } else { |
129 | device = list_entry(it, struct device, driver_list); | 137 | device = (struct device *) it; |
130 | card = device->driver_data; | 138 | card = device->driver_data; |
131 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", | 139 | seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", |
132 | CARD_RDEV_ID(card), | 140 | CARD_RDEV_ID(card), |
@@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile; | |||
180 | static void * | 188 | static void * |
181 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) | 189 | qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) |
182 | { | 190 | { |
183 | struct list_head *next_card = NULL; | 191 | struct device *dev = NULL; |
184 | int i = 0; | 192 | int nr; |
185 | 193 | ||
186 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 194 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
187 | /* get card at pos *offset */ | 195 | /* get card at pos *offset */ |
188 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 196 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, |
189 | if (i == *offset) | 197 | qeth_procfile_seq_match); |
190 | return next_card; | 198 | |
191 | i++; | 199 | /* get card at pos *offset */ |
192 | } | 200 | nr = *offset; |
193 | return NULL; | 201 | while (nr-- > 1 && dev) |
202 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, | ||
203 | NULL, qeth_procfile_seq_match); | ||
204 | return (void *) dev; | ||
194 | } | 205 | } |
195 | 206 | ||
196 | static void | 207 | static void |
@@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) | |||
202 | static void * | 213 | static void * |
203 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 214 | qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
204 | { | 215 | { |
205 | struct list_head *current_card = (struct list_head *)it; | 216 | struct device *prev, *next; |
206 | 217 | ||
207 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | 218 | prev = (struct device *) it; |
208 | return NULL; /* end of list reached */ | 219 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
209 | (*offset)++; | 220 | NULL, qeth_procfile_seq_match); |
210 | return current_card->next; | 221 | if (next) |
222 | (*offset)++; | ||
223 | return (void *) next; | ||
211 | } | 224 | } |
212 | 225 | ||
213 | static int | 226 | static int |
@@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | |||
216 | struct device *device; | 229 | struct device *device; |
217 | struct qeth_card *card; | 230 | struct qeth_card *card; |
218 | 231 | ||
219 | device = list_entry(it, struct device, driver_list); | 232 | device = (struct device *) it; |
220 | card = device->driver_data; | 233 | card = device->driver_data; |
221 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", | 234 | seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", |
222 | CARD_RDEV_ID(card), | 235 | CARD_RDEV_ID(card), |
@@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile; | |||
318 | static void * | 331 | static void * |
319 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | 332 | qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) |
320 | { | 333 | { |
321 | struct list_head *next_card = NULL; | 334 | struct device *dev; |
322 | int i = 0; | 335 | loff_t nr; |
323 | 336 | ||
324 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 337 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
325 | /* TODO: finish this */ | 338 | /* TODO: finish this */ |
@@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) | |||
328 | * output driver settings then; | 341 | * output driver settings then; |
329 | * else output setting for respective card | 342 | * else output setting for respective card |
330 | */ | 343 | */ |
344 | |||
345 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL, | ||
346 | qeth_procfile_seq_match); | ||
347 | |||
331 | /* get card at pos *offset */ | 348 | /* get card at pos *offset */ |
332 | list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ | 349 | nr = *offset; |
333 | if (i == *offset) | 350 | while (nr-- > 1 && dev) |
334 | return next_card; | 351 | dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev, |
335 | i++; | 352 | NULL, qeth_procfile_seq_match); |
336 | } | 353 | return (void *) dev; |
337 | return NULL; | ||
338 | } | 354 | } |
339 | 355 | ||
340 | static void | 356 | static void |
@@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) | |||
346 | static void * | 362 | static void * |
347 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 363 | qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
348 | { | 364 | { |
349 | struct list_head *current_card = (struct list_head *)it; | 365 | struct device *prev, *next; |
350 | 366 | ||
351 | /* TODO: finish this */ | 367 | prev = (struct device *) it; |
352 | /* | 368 | next = driver_find_device(&qeth_ccwgroup_driver.driver, prev, |
353 | * maybe SEQ_SATRT_TOKEN can be returned for offset 0 | 369 | NULL, qeth_procfile_seq_match); |
354 | * output driver settings then; | 370 | if (next) |
355 | * else output setting for respective card | 371 | (*offset)++; |
356 | */ | 372 | return (void *) next; |
357 | if (current_card->next == &qeth_ccwgroup_driver.driver.devices) | ||
358 | return NULL; /* end of list reached */ | ||
359 | (*offset)++; | ||
360 | return current_card->next; | ||
361 | } | 373 | } |
362 | 374 | ||
363 | static int | 375 | static int |
@@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) | |||
372 | * output driver settings then; | 384 | * output driver settings then; |
373 | * else output setting for respective card | 385 | * else output setting for respective card |
374 | */ | 386 | */ |
375 | device = list_entry(it, struct device, driver_list); | 387 | device = (struct device *) it; |
376 | card = device->driver_data; | 388 | card = device->driver_data; |
377 | 389 | ||
378 | return 0; | 390 | return 0; |
diff --git a/drivers/sbus/char/bbc_envctrl.c b/drivers/sbus/char/bbc_envctrl.c index b8a2c7353b0a..d44205d52bf3 100644 --- a/drivers/sbus/char/bbc_envctrl.c +++ b/drivers/sbus/char/bbc_envctrl.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #define __KERNEL_SYSCALLS__ | 7 | #define __KERNEL_SYSCALLS__ |
8 | 8 | ||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/kthread.h> | ||
10 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
11 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
12 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task; | |||
459 | 460 | ||
460 | static int kenvctrld(void *__unused) | 461 | static int kenvctrld(void *__unused) |
461 | { | 462 | { |
462 | daemonize("kenvctrld"); | ||
463 | allow_signal(SIGKILL); | ||
464 | kenvctrld_task = current; | ||
465 | |||
466 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); | 463 | printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); |
467 | last_warning_jiffies = jiffies - WARN_INTERVAL; | 464 | last_warning_jiffies = jiffies - WARN_INTERVAL; |
468 | for (;;) { | 465 | for (;;) { |
@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused) | |||
470 | struct bbc_fan_control *fp; | 467 | struct bbc_fan_control *fp; |
471 | 468 | ||
472 | msleep_interruptible(POLL_INTERVAL); | 469 | msleep_interruptible(POLL_INTERVAL); |
473 | if (signal_pending(current)) | 470 | if (kthread_should_stop()) |
474 | break; | 471 | break; |
475 | 472 | ||
476 | for (tp = all_bbc_temps; tp; tp = tp->next) { | 473 | for (tp = all_bbc_temps; tp; tp = tp->next) { |
@@ -577,7 +574,6 @@ int bbc_envctrl_init(void) | |||
577 | int temp_index = 0; | 574 | int temp_index = 0; |
578 | int fan_index = 0; | 575 | int fan_index = 0; |
579 | int devidx = 0; | 576 | int devidx = 0; |
580 | int err = 0; | ||
581 | 577 | ||
582 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { | 578 | while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { |
583 | if (!strcmp(echild->prom_name, "temperature")) | 579 | if (!strcmp(echild->prom_name, "temperature")) |
@@ -585,9 +581,13 @@ int bbc_envctrl_init(void) | |||
585 | if (!strcmp(echild->prom_name, "fan-control")) | 581 | if (!strcmp(echild->prom_name, "fan-control")) |
586 | attach_one_fan(echild, fan_index++); | 582 | attach_one_fan(echild, fan_index++); |
587 | } | 583 | } |
588 | if (temp_index != 0 && fan_index != 0) | 584 | if (temp_index != 0 && fan_index != 0) { |
589 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 585 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
590 | return err; | 586 | if (IS_ERR(kenvctrld_task)) |
587 | return PTR_ERR(kenvctrld_task); | ||
588 | } | ||
589 | |||
590 | return 0; | ||
591 | } | 591 | } |
592 | 592 | ||
593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) | 593 | static void destroy_one_temp(struct bbc_cpu_temperature *tp) |
@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void) | |||
607 | struct bbc_cpu_temperature *tp; | 607 | struct bbc_cpu_temperature *tp; |
608 | struct bbc_fan_control *fp; | 608 | struct bbc_fan_control *fp; |
609 | 609 | ||
610 | if (kenvctrld_task != NULL) { | 610 | kthread_stop(kenvctrld_task); |
611 | force_sig(SIGKILL, kenvctrld_task); | ||
612 | for (;;) { | ||
613 | struct task_struct *p; | ||
614 | int found = 0; | ||
615 | |||
616 | read_lock(&tasklist_lock); | ||
617 | for_each_process(p) { | ||
618 | if (p == kenvctrld_task) { | ||
619 | found = 1; | ||
620 | break; | ||
621 | } | ||
622 | } | ||
623 | read_unlock(&tasklist_lock); | ||
624 | if (!found) | ||
625 | break; | ||
626 | msleep(1000); | ||
627 | } | ||
628 | kenvctrld_task = NULL; | ||
629 | } | ||
630 | 611 | ||
631 | tp = all_bbc_temps; | 612 | tp = all_bbc_temps; |
632 | while (tp != NULL) { | 613 | while (tp != NULL) { |
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 9a8c572554f5..d765cc1bf060 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/config.h> | 24 | #include <linux/config.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | #include <linux/kthread.h> | ||
27 | #include <linux/errno.h> | 28 | #include <linux/errno.h> |
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
29 | #include <linux/ioport.h> | 30 | #include <linux/ioport.h> |
@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused) | |||
1010 | 1011 | ||
1011 | poll_interval = 5000; /* TODO env_mon_interval */ | 1012 | poll_interval = 5000; /* TODO env_mon_interval */ |
1012 | 1013 | ||
1013 | daemonize("kenvctrld"); | ||
1014 | allow_signal(SIGKILL); | ||
1015 | |||
1016 | kenvctrld_task = current; | ||
1017 | |||
1018 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); | 1014 | printk(KERN_INFO "envctrl: %s starting...\n", current->comm); |
1019 | for (;;) { | 1015 | for (;;) { |
1020 | if(msleep_interruptible(poll_interval)) | 1016 | msleep_interruptible(poll_interval); |
1021 | break; | ||
1022 | 1017 | ||
1018 | if (kthread_should_stop()) | ||
1019 | break; | ||
1020 | |||
1023 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { | 1021 | for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { |
1024 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, | 1022 | if (0 < envctrl_read_cpu_info(whichcpu, cputemp, |
1025 | ENVCTRL_CPUTEMP_MON, | 1023 | ENVCTRL_CPUTEMP_MON, |
@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused) | |||
1041 | 1039 | ||
1042 | static int __init envctrl_init(void) | 1040 | static int __init envctrl_init(void) |
1043 | { | 1041 | { |
1044 | #ifdef CONFIG_PCI | ||
1045 | struct linux_ebus *ebus = NULL; | 1042 | struct linux_ebus *ebus = NULL; |
1046 | struct linux_ebus_device *edev = NULL; | 1043 | struct linux_ebus_device *edev = NULL; |
1047 | struct linux_ebus_child *edev_child = NULL; | 1044 | struct linux_ebus_child *edev_child = NULL; |
@@ -1118,9 +1115,11 @@ done: | |||
1118 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); | 1115 | i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); |
1119 | } | 1116 | } |
1120 | 1117 | ||
1121 | err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); | 1118 | kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld"); |
1122 | if (err < 0) | 1119 | if (IS_ERR(kenvctrld_task)) { |
1120 | err = PTR_ERR(kenvctrld_task); | ||
1123 | goto out_deregister; | 1121 | goto out_deregister; |
1122 | } | ||
1124 | 1123 | ||
1125 | return 0; | 1124 | return 0; |
1126 | 1125 | ||
@@ -1133,37 +1132,13 @@ out_iounmap: | |||
1133 | kfree(i2c_childlist[i].tables); | 1132 | kfree(i2c_childlist[i].tables); |
1134 | } | 1133 | } |
1135 | return err; | 1134 | return err; |
1136 | #else | ||
1137 | return -ENODEV; | ||
1138 | #endif | ||
1139 | } | 1135 | } |
1140 | 1136 | ||
1141 | static void __exit envctrl_cleanup(void) | 1137 | static void __exit envctrl_cleanup(void) |
1142 | { | 1138 | { |
1143 | int i; | 1139 | int i; |
1144 | 1140 | ||
1145 | if (NULL != kenvctrld_task) { | 1141 | kthread_stop(kenvctrld_task); |
1146 | force_sig(SIGKILL, kenvctrld_task); | ||
1147 | for (;;) { | ||
1148 | struct task_struct *p; | ||
1149 | int found = 0; | ||
1150 | |||
1151 | read_lock(&tasklist_lock); | ||
1152 | for_each_process(p) { | ||
1153 | if (p == kenvctrld_task) { | ||
1154 | found = 1; | ||
1155 | break; | ||
1156 | } | ||
1157 | } | ||
1158 | read_unlock(&tasklist_lock); | ||
1159 | |||
1160 | if (!found) | ||
1161 | break; | ||
1162 | |||
1163 | msleep(1000); | ||
1164 | } | ||
1165 | kenvctrld_task = NULL; | ||
1166 | } | ||
1167 | 1142 | ||
1168 | iounmap(i2c); | 1143 | iounmap(i2c); |
1169 | misc_deregister(&envctrl_dev); | 1144 | misc_deregister(&envctrl_dev); |
diff --git a/drivers/sbus/char/vfc.h b/drivers/sbus/char/vfc.h index e56a43af0f62..a7782e7da42e 100644 --- a/drivers/sbus/char/vfc.h +++ b/drivers/sbus/char/vfc.h | |||
@@ -129,8 +129,6 @@ struct vfc_dev { | |||
129 | struct vfc_regs *phys_regs; | 129 | struct vfc_regs *phys_regs; |
130 | unsigned int control_reg; | 130 | unsigned int control_reg; |
131 | struct semaphore device_lock_sem; | 131 | struct semaphore device_lock_sem; |
132 | struct timer_list poll_timer; | ||
133 | wait_queue_head_t poll_wait; | ||
134 | int instance; | 132 | int instance; |
135 | int busy; | 133 | int busy; |
136 | unsigned long which_io; | 134 | unsigned long which_io; |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 86ce54130954..7a103698fa3c 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) | |||
137 | dev->instance=instance; | 137 | dev->instance=instance; |
138 | init_MUTEX(&dev->device_lock_sem); | 138 | init_MUTEX(&dev->device_lock_sem); |
139 | dev->control_reg=0; | 139 | dev->control_reg=0; |
140 | init_waitqueue_head(&dev->poll_wait); | ||
141 | dev->busy=0; | 140 | dev->busy=0; |
142 | return 0; | 141 | return 0; |
143 | } | 142 | } |
diff --git a/drivers/sbus/char/vfc_i2c.c b/drivers/sbus/char/vfc_i2c.c index 1faf1e75f71f..739cad9b19a1 100644 --- a/drivers/sbus/char/vfc_i2c.c +++ b/drivers/sbus/char/vfc_i2c.c | |||
@@ -79,25 +79,10 @@ int vfc_pcf8584_init(struct vfc_dev *dev) | |||
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
81 | 81 | ||
82 | void vfc_i2c_delay_wakeup(struct vfc_dev *dev) | ||
83 | { | ||
84 | /* Used to profile code and eliminate too many delays */ | ||
85 | VFC_I2C_DEBUG_PRINTK(("vfc%d: Delaying\n", dev->instance)); | ||
86 | wake_up(&dev->poll_wait); | ||
87 | } | ||
88 | |||
89 | void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) | 82 | void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) |
90 | { | 83 | { |
91 | DEFINE_WAIT(wait); | 84 | set_current_state(TASK_UNINTERRUPTIBLE); |
92 | init_timer(&dev->poll_timer); | 85 | schedule_timeout(usecs_to_jiffies(usecs)); |
93 | dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs); | ||
94 | dev->poll_timer.data=(unsigned long)dev; | ||
95 | dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup; | ||
96 | add_timer(&dev->poll_timer); | ||
97 | prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE); | ||
98 | schedule(); | ||
99 | del_timer(&dev->poll_timer); | ||
100 | finish_wait(&dev->poll_wait, &wait); | ||
101 | } | 86 | } |
102 | 87 | ||
103 | void inline vfc_i2c_delay(struct vfc_dev *dev) | 88 | void inline vfc_i2c_delay(struct vfc_dev *dev) |
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h index 5f6187baad86..73c8a088c160 100644 --- a/drivers/serial/cpm_uart/cpm_uart.h +++ b/drivers/serial/cpm_uart/cpm_uart.h | |||
@@ -40,13 +40,15 @@ | |||
40 | #define TX_NUM_FIFO 4 | 40 | #define TX_NUM_FIFO 4 |
41 | #define TX_BUF_SIZE 32 | 41 | #define TX_BUF_SIZE 32 |
42 | 42 | ||
43 | #define SCC_WAIT_CLOSING 100 | ||
44 | |||
43 | struct uart_cpm_port { | 45 | struct uart_cpm_port { |
44 | struct uart_port port; | 46 | struct uart_port port; |
45 | u16 rx_nrfifos; | 47 | u16 rx_nrfifos; |
46 | u16 rx_fifosize; | 48 | u16 rx_fifosize; |
47 | u16 tx_nrfifos; | 49 | u16 tx_nrfifos; |
48 | u16 tx_fifosize; | 50 | u16 tx_fifosize; |
49 | smc_t *smcp; | 51 | smc_t *smcp; |
50 | smc_uart_t *smcup; | 52 | smc_uart_t *smcup; |
51 | scc_t *sccp; | 53 | scc_t *sccp; |
52 | scc_uart_t *sccup; | 54 | scc_uart_t *sccup; |
@@ -67,6 +69,8 @@ struct uart_cpm_port { | |||
67 | int bits; | 69 | int bits; |
68 | /* Keep track of 'odd' SMC2 wirings */ | 70 | /* Keep track of 'odd' SMC2 wirings */ |
69 | int is_portb; | 71 | int is_portb; |
72 | /* wait on close if needed */ | ||
73 | int wait_closing; | ||
70 | }; | 74 | }; |
71 | 75 | ||
72 | extern int cpm_uart_port_map[UART_NR]; | 76 | extern int cpm_uart_port_map[UART_NR]; |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 29db677d4284..d639ac92a117 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -9,9 +9,10 @@ | |||
9 | * | 9 | * |
10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 10 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 11 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
12 | * | 12 | * |
13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 13 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
14 | * (C) 2004 Intracom, S.A. | 14 | * (C) 2004 Intracom, S.A. |
15 | * (C) 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@ru.mvista.com> | ||
15 | * | 16 | * |
16 | * This program is free software; you can redistribute it and/or modify | 17 | * This program is free software; you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License as published by | 18 | * it under the terms of the GNU General Public License as published by |
@@ -70,8 +71,22 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo); | |||
70 | 71 | ||
71 | /**************************************************************/ | 72 | /**************************************************************/ |
72 | 73 | ||
74 | static inline unsigned long cpu2cpm_addr(void *addr) | ||
75 | { | ||
76 | if ((unsigned long)addr >= CPM_ADDR) | ||
77 | return (unsigned long)addr; | ||
78 | return virt_to_bus(addr); | ||
79 | } | ||
80 | |||
81 | static inline void *cpm2cpu_addr(unsigned long addr) | ||
82 | { | ||
83 | if (addr >= CPM_ADDR) | ||
84 | return (void *)addr; | ||
85 | return bus_to_virt(addr); | ||
86 | } | ||
87 | |||
73 | /* | 88 | /* |
74 | * Check, if transmit buffers are processed | 89 | * Check, if transmit buffers are processed |
75 | */ | 90 | */ |
76 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) | 91 | static unsigned int cpm_uart_tx_empty(struct uart_port *port) |
77 | { | 92 | { |
@@ -143,15 +158,18 @@ static void cpm_uart_start_tx(struct uart_port *port, unsigned int tty_start) | |||
143 | } | 158 | } |
144 | 159 | ||
145 | if (cpm_uart_tx_pump(port) != 0) { | 160 | if (cpm_uart_tx_pump(port) != 0) { |
146 | if (IS_SMC(pinfo)) | 161 | if (IS_SMC(pinfo)) { |
147 | smcp->smc_smcm |= SMCM_TX; | 162 | smcp->smc_smcm |= SMCM_TX; |
148 | else | 163 | smcp->smc_smcmr |= SMCMR_TEN; |
164 | } else { | ||
149 | sccp->scc_sccm |= UART_SCCM_TX; | 165 | sccp->scc_sccm |= UART_SCCM_TX; |
166 | pinfo->sccp->scc_gsmrl |= SCC_GSMRL_ENT; | ||
167 | } | ||
150 | } | 168 | } |
151 | } | 169 | } |
152 | 170 | ||
153 | /* | 171 | /* |
154 | * Stop receiver | 172 | * Stop receiver |
155 | */ | 173 | */ |
156 | static void cpm_uart_stop_rx(struct uart_port *port) | 174 | static void cpm_uart_stop_rx(struct uart_port *port) |
157 | { | 175 | { |
@@ -176,7 +194,7 @@ static void cpm_uart_enable_ms(struct uart_port *port) | |||
176 | } | 194 | } |
177 | 195 | ||
178 | /* | 196 | /* |
179 | * Generate a break. | 197 | * Generate a break. |
180 | */ | 198 | */ |
181 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) | 199 | static void cpm_uart_break_ctl(struct uart_port *port, int break_state) |
182 | { | 200 | { |
@@ -231,7 +249,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
231 | /* get number of characters, and check spce in flip-buffer */ | 249 | /* get number of characters, and check spce in flip-buffer */ |
232 | i = bdp->cbd_datlen; | 250 | i = bdp->cbd_datlen; |
233 | 251 | ||
234 | /* If we have not enough room in tty flip buffer, then we try | 252 | /* If we have not enough room in tty flip buffer, then we try |
235 | * later, which will be the next rx-interrupt or a timeout | 253 | * later, which will be the next rx-interrupt or a timeout |
236 | */ | 254 | */ |
237 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { | 255 | if ((tty->flip.count + i) >= TTY_FLIPBUF_SIZE) { |
@@ -243,7 +261,7 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
243 | } | 261 | } |
244 | 262 | ||
245 | /* get pointer */ | 263 | /* get pointer */ |
246 | cp = (unsigned char *)bus_to_virt(bdp->cbd_bufaddr); | 264 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
247 | 265 | ||
248 | /* loop through the buffer */ | 266 | /* loop through the buffer */ |
249 | while (i-- > 0) { | 267 | while (i-- > 0) { |
@@ -265,13 +283,14 @@ static void cpm_uart_int_rx(struct uart_port *port, struct pt_regs *regs) | |||
265 | } /* End while (i--) */ | 283 | } /* End while (i--) */ |
266 | 284 | ||
267 | /* This BD is ready to be used again. Clear status. get next */ | 285 | /* This BD is ready to be used again. Clear status. get next */ |
268 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); | 286 | bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); |
269 | bdp->cbd_sc |= BD_SC_EMPTY; | 287 | bdp->cbd_sc |= BD_SC_EMPTY; |
270 | 288 | ||
271 | if (bdp->cbd_sc & BD_SC_WRAP) | 289 | if (bdp->cbd_sc & BD_SC_WRAP) |
272 | bdp = pinfo->rx_bd_base; | 290 | bdp = pinfo->rx_bd_base; |
273 | else | 291 | else |
274 | bdp++; | 292 | bdp++; |
293 | |||
275 | } /* End for (;;) */ | 294 | } /* End for (;;) */ |
276 | 295 | ||
277 | /* Write back buffer pointer */ | 296 | /* Write back buffer pointer */ |
@@ -336,22 +355,22 @@ static irqreturn_t cpm_uart_int(int irq, void *data, struct pt_regs *regs) | |||
336 | 355 | ||
337 | if (IS_SMC(pinfo)) { | 356 | if (IS_SMC(pinfo)) { |
338 | events = smcp->smc_smce; | 357 | events = smcp->smc_smce; |
358 | smcp->smc_smce = events; | ||
339 | if (events & SMCM_BRKE) | 359 | if (events & SMCM_BRKE) |
340 | uart_handle_break(port); | 360 | uart_handle_break(port); |
341 | if (events & SMCM_RX) | 361 | if (events & SMCM_RX) |
342 | cpm_uart_int_rx(port, regs); | 362 | cpm_uart_int_rx(port, regs); |
343 | if (events & SMCM_TX) | 363 | if (events & SMCM_TX) |
344 | cpm_uart_int_tx(port, regs); | 364 | cpm_uart_int_tx(port, regs); |
345 | smcp->smc_smce = events; | ||
346 | } else { | 365 | } else { |
347 | events = sccp->scc_scce; | 366 | events = sccp->scc_scce; |
367 | sccp->scc_scce = events; | ||
348 | if (events & UART_SCCM_BRKE) | 368 | if (events & UART_SCCM_BRKE) |
349 | uart_handle_break(port); | 369 | uart_handle_break(port); |
350 | if (events & UART_SCCM_RX) | 370 | if (events & UART_SCCM_RX) |
351 | cpm_uart_int_rx(port, regs); | 371 | cpm_uart_int_rx(port, regs); |
352 | if (events & UART_SCCM_TX) | 372 | if (events & UART_SCCM_TX) |
353 | cpm_uart_int_tx(port, regs); | 373 | cpm_uart_int_tx(port, regs); |
354 | sccp->scc_scce = events; | ||
355 | } | 374 | } |
356 | return (events) ? IRQ_HANDLED : IRQ_NONE; | 375 | return (events) ? IRQ_HANDLED : IRQ_NONE; |
357 | } | 376 | } |
@@ -360,6 +379,7 @@ static int cpm_uart_startup(struct uart_port *port) | |||
360 | { | 379 | { |
361 | int retval; | 380 | int retval; |
362 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; | 381 | struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; |
382 | int line = pinfo - cpm_uart_ports; | ||
363 | 383 | ||
364 | pr_debug("CPM uart[%d]:startup\n", port->line); | 384 | pr_debug("CPM uart[%d]:startup\n", port->line); |
365 | 385 | ||
@@ -376,9 +396,19 @@ static int cpm_uart_startup(struct uart_port *port) | |||
376 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; | 396 | pinfo->sccp->scc_sccm |= UART_SCCM_RX; |
377 | } | 397 | } |
378 | 398 | ||
399 | if (!(pinfo->flags & FLAG_CONSOLE)) | ||
400 | cpm_line_cr_cmd(line,CPM_CR_INIT_TRX); | ||
379 | return 0; | 401 | return 0; |
380 | } | 402 | } |
381 | 403 | ||
404 | inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) | ||
405 | { | ||
406 | unsigned long target_jiffies = jiffies + pinfo->wait_closing; | ||
407 | |||
408 | while (!time_after(jiffies, target_jiffies)) | ||
409 | schedule(); | ||
410 | } | ||
411 | |||
382 | /* | 412 | /* |
383 | * Shutdown the uart | 413 | * Shutdown the uart |
384 | */ | 414 | */ |
@@ -394,6 +424,12 @@ static void cpm_uart_shutdown(struct uart_port *port) | |||
394 | 424 | ||
395 | /* If the port is not the console, disable Rx and Tx. */ | 425 | /* If the port is not the console, disable Rx and Tx. */ |
396 | if (!(pinfo->flags & FLAG_CONSOLE)) { | 426 | if (!(pinfo->flags & FLAG_CONSOLE)) { |
427 | /* Wait for all the BDs marked sent */ | ||
428 | while(!cpm_uart_tx_empty(port)) | ||
429 | schedule_timeout(2); | ||
430 | if(pinfo->wait_closing) | ||
431 | cpm_uart_wait_until_send(pinfo); | ||
432 | |||
397 | /* Stop uarts */ | 433 | /* Stop uarts */ |
398 | if (IS_SMC(pinfo)) { | 434 | if (IS_SMC(pinfo)) { |
399 | volatile smc_t *smcp = pinfo->smcp; | 435 | volatile smc_t *smcp = pinfo->smcp; |
@@ -502,7 +538,7 @@ static void cpm_uart_set_termios(struct uart_port *port, | |||
502 | */ | 538 | */ |
503 | if ((termios->c_cflag & CREAD) == 0) | 539 | if ((termios->c_cflag & CREAD) == 0) |
504 | port->read_status_mask &= ~BD_SC_EMPTY; | 540 | port->read_status_mask &= ~BD_SC_EMPTY; |
505 | 541 | ||
506 | spin_lock_irqsave(&port->lock, flags); | 542 | spin_lock_irqsave(&port->lock, flags); |
507 | 543 | ||
508 | /* Start bit has not been added (so don't, because we would just | 544 | /* Start bit has not been added (so don't, because we would just |
@@ -569,7 +605,8 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
569 | /* Pick next descriptor and fill from buffer */ | 605 | /* Pick next descriptor and fill from buffer */ |
570 | bdp = pinfo->tx_cur; | 606 | bdp = pinfo->tx_cur; |
571 | 607 | ||
572 | p = bus_to_virt(bdp->cbd_bufaddr); | 608 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
609 | |||
573 | *p++ = xmit->buf[xmit->tail]; | 610 | *p++ = xmit->buf[xmit->tail]; |
574 | bdp->cbd_datlen = 1; | 611 | bdp->cbd_datlen = 1; |
575 | bdp->cbd_sc |= BD_SC_READY; | 612 | bdp->cbd_sc |= BD_SC_READY; |
@@ -595,7 +632,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
595 | 632 | ||
596 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { | 633 | while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { |
597 | count = 0; | 634 | count = 0; |
598 | p = bus_to_virt(bdp->cbd_bufaddr); | 635 | p = cpm2cpu_addr(bdp->cbd_bufaddr); |
599 | while (count < pinfo->tx_fifosize) { | 636 | while (count < pinfo->tx_fifosize) { |
600 | *p++ = xmit->buf[xmit->tail]; | 637 | *p++ = xmit->buf[xmit->tail]; |
601 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); | 638 | xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); |
@@ -606,6 +643,7 @@ static int cpm_uart_tx_pump(struct uart_port *port) | |||
606 | } | 643 | } |
607 | bdp->cbd_datlen = count; | 644 | bdp->cbd_datlen = count; |
608 | bdp->cbd_sc |= BD_SC_READY; | 645 | bdp->cbd_sc |= BD_SC_READY; |
646 | __asm__("eieio"); | ||
609 | /* Get next BD. */ | 647 | /* Get next BD. */ |
610 | if (bdp->cbd_sc & BD_SC_WRAP) | 648 | if (bdp->cbd_sc & BD_SC_WRAP) |
611 | bdp = pinfo->tx_bd_base; | 649 | bdp = pinfo->tx_bd_base; |
@@ -643,12 +681,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
643 | mem_addr = pinfo->mem_addr; | 681 | mem_addr = pinfo->mem_addr; |
644 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; | 682 | bdp = pinfo->rx_cur = pinfo->rx_bd_base; |
645 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { | 683 | for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { |
646 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 684 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
647 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; | 685 | bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; |
648 | mem_addr += pinfo->rx_fifosize; | 686 | mem_addr += pinfo->rx_fifosize; |
649 | } | 687 | } |
650 | 688 | ||
651 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 689 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
652 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; | 690 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; |
653 | 691 | ||
654 | /* Set the physical address of the host memory | 692 | /* Set the physical address of the host memory |
@@ -658,12 +696,12 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo) | |||
658 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); | 696 | mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); |
659 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; | 697 | bdp = pinfo->tx_cur = pinfo->tx_bd_base; |
660 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { | 698 | for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { |
661 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 699 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
662 | bdp->cbd_sc = BD_SC_INTRPT; | 700 | bdp->cbd_sc = BD_SC_INTRPT; |
663 | mem_addr += pinfo->tx_fifosize; | 701 | mem_addr += pinfo->tx_fifosize; |
664 | } | 702 | } |
665 | 703 | ||
666 | bdp->cbd_bufaddr = virt_to_bus(mem_addr); | 704 | bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr); |
667 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; | 705 | bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; |
668 | } | 706 | } |
669 | 707 | ||
@@ -763,6 +801,8 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) | |||
763 | /* Using idle charater time requires some additional tuning. */ | 801 | /* Using idle charater time requires some additional tuning. */ |
764 | up->smc_mrblr = pinfo->rx_fifosize; | 802 | up->smc_mrblr = pinfo->rx_fifosize; |
765 | up->smc_maxidl = pinfo->rx_fifosize; | 803 | up->smc_maxidl = pinfo->rx_fifosize; |
804 | up->smc_brklen = 0; | ||
805 | up->smc_brkec = 0; | ||
766 | up->smc_brkcr = 1; | 806 | up->smc_brkcr = 1; |
767 | 807 | ||
768 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); | 808 | cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); |
@@ -796,7 +836,7 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
796 | /* | 836 | /* |
797 | * Setup any port IO, connect any baud rate generators, | 837 | * Setup any port IO, connect any baud rate generators, |
798 | * etc. This is expected to be handled by board | 838 | * etc. This is expected to be handled by board |
799 | * dependant code | 839 | * dependant code |
800 | */ | 840 | */ |
801 | if (pinfo->set_lineif) | 841 | if (pinfo->set_lineif) |
802 | pinfo->set_lineif(pinfo); | 842 | pinfo->set_lineif(pinfo); |
@@ -815,6 +855,10 @@ static int cpm_uart_request_port(struct uart_port *port) | |||
815 | return ret; | 855 | return ret; |
816 | 856 | ||
817 | cpm_uart_initbd(pinfo); | 857 | cpm_uart_initbd(pinfo); |
858 | if (IS_SMC(pinfo)) | ||
859 | cpm_uart_init_smc(pinfo); | ||
860 | else | ||
861 | cpm_uart_init_scc(pinfo); | ||
818 | 862 | ||
819 | return 0; | 863 | return 0; |
820 | } | 864 | } |
@@ -869,7 +913,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
869 | .flags = FLAG_SMC, | 913 | .flags = FLAG_SMC, |
870 | .tx_nrfifos = TX_NUM_FIFO, | 914 | .tx_nrfifos = TX_NUM_FIFO, |
871 | .tx_fifosize = TX_BUF_SIZE, | 915 | .tx_fifosize = TX_BUF_SIZE, |
872 | .rx_nrfifos = RX_NUM_FIFO, | 916 | .rx_nrfifos = RX_NUM_FIFO, |
873 | .rx_fifosize = RX_BUF_SIZE, | 917 | .rx_fifosize = RX_BUF_SIZE, |
874 | .set_lineif = smc1_lineif, | 918 | .set_lineif = smc1_lineif, |
875 | }, | 919 | }, |
@@ -883,7 +927,7 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
883 | .flags = FLAG_SMC, | 927 | .flags = FLAG_SMC, |
884 | .tx_nrfifos = TX_NUM_FIFO, | 928 | .tx_nrfifos = TX_NUM_FIFO, |
885 | .tx_fifosize = TX_BUF_SIZE, | 929 | .tx_fifosize = TX_BUF_SIZE, |
886 | .rx_nrfifos = RX_NUM_FIFO, | 930 | .rx_nrfifos = RX_NUM_FIFO, |
887 | .rx_fifosize = RX_BUF_SIZE, | 931 | .rx_fifosize = RX_BUF_SIZE, |
888 | .set_lineif = smc2_lineif, | 932 | .set_lineif = smc2_lineif, |
889 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 | 933 | #ifdef CONFIG_SERIAL_CPM_ALT_SMC2 |
@@ -899,9 +943,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
899 | }, | 943 | }, |
900 | .tx_nrfifos = TX_NUM_FIFO, | 944 | .tx_nrfifos = TX_NUM_FIFO, |
901 | .tx_fifosize = TX_BUF_SIZE, | 945 | .tx_fifosize = TX_BUF_SIZE, |
902 | .rx_nrfifos = RX_NUM_FIFO, | 946 | .rx_nrfifos = RX_NUM_FIFO, |
903 | .rx_fifosize = RX_BUF_SIZE, | 947 | .rx_fifosize = RX_BUF_SIZE, |
904 | .set_lineif = scc1_lineif, | 948 | .set_lineif = scc1_lineif, |
949 | .wait_closing = SCC_WAIT_CLOSING, | ||
905 | }, | 950 | }, |
906 | [UART_SCC2] = { | 951 | [UART_SCC2] = { |
907 | .port = { | 952 | .port = { |
@@ -912,9 +957,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
912 | }, | 957 | }, |
913 | .tx_nrfifos = TX_NUM_FIFO, | 958 | .tx_nrfifos = TX_NUM_FIFO, |
914 | .tx_fifosize = TX_BUF_SIZE, | 959 | .tx_fifosize = TX_BUF_SIZE, |
915 | .rx_nrfifos = RX_NUM_FIFO, | 960 | .rx_nrfifos = RX_NUM_FIFO, |
916 | .rx_fifosize = RX_BUF_SIZE, | 961 | .rx_fifosize = RX_BUF_SIZE, |
917 | .set_lineif = scc2_lineif, | 962 | .set_lineif = scc2_lineif, |
963 | .wait_closing = SCC_WAIT_CLOSING, | ||
918 | }, | 964 | }, |
919 | [UART_SCC3] = { | 965 | [UART_SCC3] = { |
920 | .port = { | 966 | .port = { |
@@ -925,9 +971,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
925 | }, | 971 | }, |
926 | .tx_nrfifos = TX_NUM_FIFO, | 972 | .tx_nrfifos = TX_NUM_FIFO, |
927 | .tx_fifosize = TX_BUF_SIZE, | 973 | .tx_fifosize = TX_BUF_SIZE, |
928 | .rx_nrfifos = RX_NUM_FIFO, | 974 | .rx_nrfifos = RX_NUM_FIFO, |
929 | .rx_fifosize = RX_BUF_SIZE, | 975 | .rx_fifosize = RX_BUF_SIZE, |
930 | .set_lineif = scc3_lineif, | 976 | .set_lineif = scc3_lineif, |
977 | .wait_closing = SCC_WAIT_CLOSING, | ||
931 | }, | 978 | }, |
932 | [UART_SCC4] = { | 979 | [UART_SCC4] = { |
933 | .port = { | 980 | .port = { |
@@ -938,9 +985,10 @@ struct uart_cpm_port cpm_uart_ports[UART_NR] = { | |||
938 | }, | 985 | }, |
939 | .tx_nrfifos = TX_NUM_FIFO, | 986 | .tx_nrfifos = TX_NUM_FIFO, |
940 | .tx_fifosize = TX_BUF_SIZE, | 987 | .tx_fifosize = TX_BUF_SIZE, |
941 | .rx_nrfifos = RX_NUM_FIFO, | 988 | .rx_nrfifos = RX_NUM_FIFO, |
942 | .rx_fifosize = RX_BUF_SIZE, | 989 | .rx_fifosize = RX_BUF_SIZE, |
943 | .set_lineif = scc4_lineif, | 990 | .set_lineif = scc4_lineif, |
991 | .wait_closing = SCC_WAIT_CLOSING, | ||
944 | }, | 992 | }, |
945 | }; | 993 | }; |
946 | 994 | ||
@@ -983,11 +1031,8 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
983 | * If the buffer address is in the CPM DPRAM, don't | 1031 | * If the buffer address is in the CPM DPRAM, don't |
984 | * convert it. | 1032 | * convert it. |
985 | */ | 1033 | */ |
986 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1034 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
987 | cp = (unsigned char *) (bdp->cbd_bufaddr); | 1035 | |
988 | else | ||
989 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
990 | |||
991 | *cp = *s; | 1036 | *cp = *s; |
992 | 1037 | ||
993 | bdp->cbd_datlen = 1; | 1038 | bdp->cbd_datlen = 1; |
@@ -1003,10 +1048,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1003 | while ((bdp->cbd_sc & BD_SC_READY) != 0) | 1048 | while ((bdp->cbd_sc & BD_SC_READY) != 0) |
1004 | ; | 1049 | ; |
1005 | 1050 | ||
1006 | if ((uint) (bdp->cbd_bufaddr) > (uint) CPM_ADDR) | 1051 | cp = cpm2cpu_addr(bdp->cbd_bufaddr); |
1007 | cp = (unsigned char *) (bdp->cbd_bufaddr); | ||
1008 | else | ||
1009 | cp = bus_to_virt(bdp->cbd_bufaddr); | ||
1010 | 1052 | ||
1011 | *cp = 13; | 1053 | *cp = 13; |
1012 | bdp->cbd_datlen = 1; | 1054 | bdp->cbd_datlen = 1; |
@@ -1045,7 +1087,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1045 | port = | 1087 | port = |
1046 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | 1088 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; |
1047 | pinfo = (struct uart_cpm_port *)port; | 1089 | pinfo = (struct uart_cpm_port *)port; |
1048 | 1090 | ||
1049 | pinfo->flags |= FLAG_CONSOLE; | 1091 | pinfo->flags |= FLAG_CONSOLE; |
1050 | 1092 | ||
1051 | if (options) { | 1093 | if (options) { |
@@ -1062,7 +1104,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1062 | /* | 1104 | /* |
1063 | * Setup any port IO, connect any baud rate generators, | 1105 | * Setup any port IO, connect any baud rate generators, |
1064 | * etc. This is expected to be handled by board | 1106 | * etc. This is expected to be handled by board |
1065 | * dependant code | 1107 | * dependant code |
1066 | */ | 1108 | */ |
1067 | if (pinfo->set_lineif) | 1109 | if (pinfo->set_lineif) |
1068 | pinfo->set_lineif(pinfo); | 1110 | pinfo->set_lineif(pinfo); |
@@ -1092,14 +1134,14 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1092 | return 0; | 1134 | return 0; |
1093 | } | 1135 | } |
1094 | 1136 | ||
1095 | extern struct uart_driver cpm_reg; | 1137 | static struct uart_driver cpm_reg; |
1096 | static struct console cpm_scc_uart_console = { | 1138 | static struct console cpm_scc_uart_console = { |
1097 | .name "ttyCPM", | 1139 | .name = "ttyCPM", |
1098 | .write cpm_uart_console_write, | 1140 | .write = cpm_uart_console_write, |
1099 | .device uart_console_device, | 1141 | .device = uart_console_device, |
1100 | .setup cpm_uart_console_setup, | 1142 | .setup = cpm_uart_console_setup, |
1101 | .flags CON_PRINTBUFFER, | 1143 | .flags = CON_PRINTBUFFER, |
1102 | .index -1, | 1144 | .index = -1, |
1103 | .data = &cpm_reg, | 1145 | .data = &cpm_reg, |
1104 | }; | 1146 | }; |
1105 | 1147 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c index 8efbd6d1d6a4..4b0786e7eb7f 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) | 6 | * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) |
7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) | 7 | * Pantelis Antoniou (panto@intracom.gr) (CPM1) |
8 | * | 8 | * |
9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. | 9 | * Copyright (C) 2004 Freescale Semiconductor, Inc. |
10 | * (C) 2004 Intracom, S.A. | 10 | * (C) 2004 Intracom, S.A. |
11 | * | 11 | * |
@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) | |||
82 | void smc1_lineif(struct uart_cpm_port *pinfo) | 82 | void smc1_lineif(struct uart_cpm_port *pinfo) |
83 | { | 83 | { |
84 | volatile cpm8xx_t *cp = cpmp; | 84 | volatile cpm8xx_t *cp = cpmp; |
85 | |||
86 | (void)cp; /* fix warning */ | ||
87 | #if defined (CONFIG_MPC885ADS) | ||
88 | /* Enable SMC1 transceivers */ | ||
89 | { | ||
90 | cp->cp_pepar |= 0x000000c0; | ||
91 | cp->cp_pedir &= ~0x000000c0; | ||
92 | cp->cp_peso &= ~0x00000040; | ||
93 | cp->cp_peso |= 0x00000080; | ||
94 | } | ||
95 | #elif defined (CONFIG_MPC86XADS) | ||
85 | unsigned int iobits = 0x000000c0; | 96 | unsigned int iobits = 0x000000c0; |
86 | 97 | ||
87 | if (!pinfo->is_portb) { | 98 | if (!pinfo->is_portb) { |
@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) | |||
93 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | 104 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; |
94 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | 105 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; |
95 | } | 106 | } |
96 | |||
97 | #ifdef CONFIG_MPC885ADS | ||
98 | /* Enable SMC1 transceivers */ | ||
99 | { | ||
100 | volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4); | ||
101 | uint tmp; | ||
102 | |||
103 | tmp = in_be32(bcsr1); | ||
104 | tmp &= ~BCSR1_RS232EN_1; | ||
105 | out_be32(bcsr1, tmp); | ||
106 | iounmap(bcsr1); | ||
107 | } | ||
108 | #endif | 107 | #endif |
109 | |||
110 | pinfo->brg = 1; | 108 | pinfo->brg = 1; |
111 | } | 109 | } |
112 | 110 | ||
113 | void smc2_lineif(struct uart_cpm_port *pinfo) | 111 | void smc2_lineif(struct uart_cpm_port *pinfo) |
114 | { | 112 | { |
115 | #ifdef CONFIG_MPC885ADS | ||
116 | volatile cpm8xx_t *cp = cpmp; | 113 | volatile cpm8xx_t *cp = cpmp; |
117 | volatile uint __iomem *bcsr1; | ||
118 | uint tmp; | ||
119 | 114 | ||
115 | (void)cp; /* fix warning */ | ||
116 | #if defined (CONFIG_MPC885ADS) | ||
120 | cp->cp_pepar |= 0x00000c00; | 117 | cp->cp_pepar |= 0x00000c00; |
121 | cp->cp_pedir &= ~0x00000c00; | 118 | cp->cp_pedir &= ~0x00000c00; |
122 | cp->cp_peso &= ~0x00000400; | 119 | cp->cp_peso &= ~0x00000400; |
123 | cp->cp_peso |= 0x00000800; | 120 | cp->cp_peso |= 0x00000800; |
121 | #elif defined (CONFIG_MPC86XADS) | ||
122 | unsigned int iobits = 0x00000c00; | ||
123 | |||
124 | if (!pinfo->is_portb) { | ||
125 | cp->cp_pbpar |= iobits; | ||
126 | cp->cp_pbdir &= ~iobits; | ||
127 | cp->cp_pbodr &= ~iobits; | ||
128 | } else { | ||
129 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits; | ||
130 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; | ||
131 | ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; | ||
132 | } | ||
124 | 133 | ||
125 | /* Enable SMC2 transceivers */ | ||
126 | bcsr1 = ioremap(BCSR1, 4); | ||
127 | tmp = in_be32(bcsr1); | ||
128 | tmp &= ~BCSR1_RS232EN_2; | ||
129 | out_be32(bcsr1, tmp); | ||
130 | iounmap(bcsr1); | ||
131 | #endif | 134 | #endif |
132 | 135 | ||
133 | pinfo->brg = 2; | 136 | pinfo->brg = 2; |
@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) | |||
158 | } | 161 | } |
159 | 162 | ||
160 | /* | 163 | /* |
161 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and | 164 | * Allocate DP-Ram and memory buffers. We need to allocate a transmit and |
162 | * receive buffer descriptors from dual port ram, and a character | 165 | * receive buffer descriptors from dual port ram, and a character |
163 | * buffer area from host mem. If we are allocating for the console we need | 166 | * buffer area from host mem. If we are allocating for the console we need |
164 | * to do it from bootmem | 167 | * to do it from bootmem |
@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
185 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + | 188 | memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + |
186 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); | 189 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); |
187 | if (is_con) { | 190 | if (is_con) { |
191 | /* was hostalloc but changed cause it blows away the */ | ||
192 | /* large tlb mapping when pinning the kernel area */ | ||
188 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); | 193 | mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); |
189 | dma_addr = 0; | 194 | dma_addr = 0; |
190 | } else | 195 | } else |
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 50cb01831075..b01efb6b36f6 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -527,7 +527,7 @@ show_periodic (struct class_device *class_dev, char *buf) | |||
527 | p.qh->period, | 527 | p.qh->period, |
528 | le32_to_cpup (&p.qh->hw_info2) | 528 | le32_to_cpup (&p.qh->hw_info2) |
529 | /* uframe masks */ | 529 | /* uframe masks */ |
530 | & 0xffff, | 530 | & (QH_CMASK | QH_SMASK), |
531 | p.qh); | 531 | p.qh); |
532 | size -= temp; | 532 | size -= temp; |
533 | next += temp; | 533 | next += temp; |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 4f97a4ad1ed3..20df01a79b2e 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -222,7 +222,7 @@ __acquires(ehci->lock) | |||
222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; | 222 | struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; |
223 | 223 | ||
224 | /* S-mask in a QH means it's an interrupt urb */ | 224 | /* S-mask in a QH means it's an interrupt urb */ |
225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (0x00ff)) != 0) { | 225 | if ((qh->hw_info2 & __constant_cpu_to_le32 (QH_SMASK)) != 0) { |
226 | 226 | ||
227 | /* ... update hc-wide periodic stats (for usbfs) */ | 227 | /* ... update hc-wide periodic stats (for usbfs) */ |
228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; | 228 | ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; |
@@ -428,7 +428,8 @@ halt: | |||
428 | /* should be rare for periodic transfers, | 428 | /* should be rare for periodic transfers, |
429 | * except maybe high bandwidth ... | 429 | * except maybe high bandwidth ... |
430 | */ | 430 | */ |
431 | if (qh->period) { | 431 | if ((__constant_cpu_to_le32 (QH_SMASK) |
432 | & qh->hw_info2) != 0) { | ||
432 | intr_deschedule (ehci, qh); | 433 | intr_deschedule (ehci, qh); |
433 | (void) qh_schedule (ehci, qh); | 434 | (void) qh_schedule (ehci, qh); |
434 | } else | 435 | } else |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 9af4f64532a9..b56f25864ed6 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -301,7 +301,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
301 | 301 | ||
302 | dev_dbg (&qh->dev->dev, | 302 | dev_dbg (&qh->dev->dev, |
303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", | 303 | "link qh%d-%04x/%p start %d [%d/%d us]\n", |
304 | period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 304 | period, le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), |
305 | qh, qh->start, qh->usecs, qh->c_usecs); | 305 | qh, qh->start, qh->usecs, qh->c_usecs); |
306 | 306 | ||
307 | /* high bandwidth, or otherwise every microframe */ | 307 | /* high bandwidth, or otherwise every microframe */ |
@@ -385,7 +385,8 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
385 | 385 | ||
386 | dev_dbg (&qh->dev->dev, | 386 | dev_dbg (&qh->dev->dev, |
387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", | 387 | "unlink qh%d-%04x/%p start %d [%d/%d us]\n", |
388 | qh->period, le32_to_cpup (&qh->hw_info2) & 0xffff, | 388 | qh->period, |
389 | le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK), | ||
389 | qh, qh->start, qh->usecs, qh->c_usecs); | 390 | qh, qh->start, qh->usecs, qh->c_usecs); |
390 | 391 | ||
391 | /* qh->qh_next still "live" to HC */ | 392 | /* qh->qh_next still "live" to HC */ |
@@ -411,7 +412,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
411 | * active high speed queues may need bigger delays... | 412 | * active high speed queues may need bigger delays... |
412 | */ | 413 | */ |
413 | if (list_empty (&qh->qtd_list) | 414 | if (list_empty (&qh->qtd_list) |
414 | || (__constant_cpu_to_le32 (0x0ff << 8) | 415 | || (__constant_cpu_to_le32 (QH_CMASK) |
415 | & qh->hw_info2) != 0) | 416 | & qh->hw_info2) != 0) |
416 | wait = 2; | 417 | wait = 2; |
417 | else | 418 | else |
@@ -533,7 +534,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
533 | 534 | ||
534 | /* reuse the previous schedule slots, if we can */ | 535 | /* reuse the previous schedule slots, if we can */ |
535 | if (frame < qh->period) { | 536 | if (frame < qh->period) { |
536 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & 0x00ff); | 537 | uframe = ffs (le32_to_cpup (&qh->hw_info2) & QH_SMASK); |
537 | status = check_intr_schedule (ehci, frame, --uframe, | 538 | status = check_intr_schedule (ehci, frame, --uframe, |
538 | qh, &c_mask); | 539 | qh, &c_mask); |
539 | } else { | 540 | } else { |
@@ -569,10 +570,10 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
569 | qh->start = frame; | 570 | qh->start = frame; |
570 | 571 | ||
571 | /* reset S-frame and (maybe) C-frame masks */ | 572 | /* reset S-frame and (maybe) C-frame masks */ |
572 | qh->hw_info2 &= __constant_cpu_to_le32 (~0xffff); | 573 | qh->hw_info2 &= __constant_cpu_to_le32(~(QH_CMASK | QH_SMASK)); |
573 | qh->hw_info2 |= qh->period | 574 | qh->hw_info2 |= qh->period |
574 | ? cpu_to_le32 (1 << uframe) | 575 | ? cpu_to_le32 (1 << uframe) |
575 | : __constant_cpu_to_le32 (0xff); | 576 | : __constant_cpu_to_le32 (QH_SMASK); |
576 | qh->hw_info2 |= c_mask; | 577 | qh->hw_info2 |= c_mask; |
577 | } else | 578 | } else |
578 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); | 579 | ehci_dbg (ehci, "reused qh %p schedule\n", qh); |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 4df498231752..a7542157534c 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -385,6 +385,11 @@ struct ehci_qh { | |||
385 | __le32 hw_info1; /* see EHCI 3.6.2 */ | 385 | __le32 hw_info1; /* see EHCI 3.6.2 */ |
386 | #define QH_HEAD 0x00008000 | 386 | #define QH_HEAD 0x00008000 |
387 | __le32 hw_info2; /* see EHCI 3.6.2 */ | 387 | __le32 hw_info2; /* see EHCI 3.6.2 */ |
388 | #define QH_SMASK 0x000000ff | ||
389 | #define QH_CMASK 0x0000ff00 | ||
390 | #define QH_HUBADDR 0x007f0000 | ||
391 | #define QH_HUBPORT 0x3f800000 | ||
392 | #define QH_MULT 0xc0000000 | ||
388 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ | 393 | __le32 hw_current; /* qtd list - see EHCI 3.6.4 */ |
389 | 394 | ||
390 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ | 395 | /* qtd overlay (hardware parts of a struct ehci_qtd) */ |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 50b1970fe6b6..76cb496c5836 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -229,9 +229,11 @@ static void preproc_atl_queue(struct isp116x *isp116x) | |||
229 | struct isp116x_ep *ep; | 229 | struct isp116x_ep *ep; |
230 | struct urb *urb; | 230 | struct urb *urb; |
231 | struct ptd *ptd; | 231 | struct ptd *ptd; |
232 | u16 toggle = 0, dir = PTD_DIR_SETUP, len; | 232 | u16 len; |
233 | 233 | ||
234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { | 234 | for (ep = isp116x->atl_active; ep; ep = ep->active) { |
235 | u16 toggle = 0, dir = PTD_DIR_SETUP; | ||
236 | |||
235 | BUG_ON(list_empty(&ep->hep->urb_list)); | 237 | BUG_ON(list_empty(&ep->hep->urb_list)); |
236 | urb = container_of(ep->hep->urb_list.next, | 238 | urb = container_of(ep->hep->urb_list.next, |
237 | struct urb, urb_list); | 239 | struct urb, urb_list); |
diff --git a/drivers/usb/mon/Kconfig b/drivers/usb/mon/Kconfig index 777642e26b9a..deb9ddffa402 100644 --- a/drivers/usb/mon/Kconfig +++ b/drivers/usb/mon/Kconfig | |||
@@ -9,9 +9,8 @@ config USB_MON | |||
9 | help | 9 | help |
10 | If you say Y here, a component which captures the USB traffic | 10 | If you say Y here, a component which captures the USB traffic |
11 | between peripheral-specific drivers and HC drivers will be built. | 11 | between peripheral-specific drivers and HC drivers will be built. |
12 | The USB_MON is similar in spirit and may be compatible with Dave | 12 | For more information, see <file:Documentation/usb/usbmon.txt>. |
13 | Harding's USBMon. | ||
14 | 13 | ||
15 | This is somewhat experimental at this time, but it should be safe, | 14 | This is somewhat experimental at this time, but it should be safe. |
16 | as long as you aren't using modular USB and try to remove this | 15 | |
17 | module. | 16 | If unsure, say Y. |
diff --git a/drivers/usb/mon/Makefile b/drivers/usb/mon/Makefile index f18d10ce91f9..b0015b8a1d1f 100644 --- a/drivers/usb/mon/Makefile +++ b/drivers/usb/mon/Makefile | |||
@@ -4,4 +4,5 @@ | |||
4 | 4 | ||
5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o | 5 | usbmon-objs := mon_main.o mon_stat.o mon_text.o |
6 | 6 | ||
7 | # This does not use CONFIG_USB_MON because we want this to use a tristate. | ||
7 | obj-$(CONFIG_USB) += usbmon.o | 8 | obj-$(CONFIG_USB) += usbmon.o |
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index fbf659b6dab0..3edc9f49344b 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -246,6 +246,11 @@ static const struct fb_videomode modedb[] = { | |||
246 | /* 480x300 @ 72 Hz, 48.0 kHz hsync */ | 246 | /* 480x300 @ 72 Hz, 48.0 kHz hsync */ |
247 | NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, | 247 | NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, |
248 | 0, FB_VMODE_DOUBLE | 248 | 0, FB_VMODE_DOUBLE |
249 | }, { | ||
250 | /* 1920x1200 @ 60 Hz, 74.5 Khz hsync */ | ||
251 | NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3, | ||
252 | FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
253 | FB_VMODE_NONINTERLACED | ||
249 | }, | 254 | }, |
250 | }; | 255 | }; |
251 | 256 | ||
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index b2e6b2407869..52b16850a54e 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c | |||
@@ -1324,6 +1324,13 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info) | |||
1324 | 1324 | ||
1325 | fb_videomode_to_var(&nvidiafb_default_var, &modedb); | 1325 | fb_videomode_to_var(&nvidiafb_default_var, &modedb); |
1326 | nvidiafb_default_var.bits_per_pixel = 8; | 1326 | nvidiafb_default_var.bits_per_pixel = 8; |
1327 | } else if (par->fpWidth && par->fpHeight) { | ||
1328 | char buf[16]; | ||
1329 | |||
1330 | memset(buf, 0, 16); | ||
1331 | snprintf(buf, 15, "%dx%d", par->fpWidth, par->fpHeight); | ||
1332 | fb_find_mode(&nvidiafb_default_var, info, buf, specs->modedb, | ||
1333 | specs->modedb_len, &modedb, 8); | ||
1327 | } | 1334 | } |
1328 | 1335 | ||
1329 | if (mode_option) | 1336 | if (mode_option) |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 2d29db7ef800..beeec7b51425 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -598,7 +598,7 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, | |||
598 | * requests for the LCD controller. If we hit this, it means we're | 598 | * requests for the LCD controller. If we hit this, it means we're |
599 | * doing nothing but LCD DMA. | 599 | * doing nothing but LCD DMA. |
600 | */ | 600 | */ |
601 | static unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) | 601 | static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) |
602 | { | 602 | { |
603 | /* | 603 | /* |
604 | * Period = pixclock * bits_per_byte * bytes_per_transfer | 604 | * Period = pixclock * bits_per_byte * bytes_per_transfer |
@@ -248,17 +248,13 @@ inline void __bio_clone(struct bio *bio, struct bio *bio_src) | |||
248 | { | 248 | { |
249 | request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); | 249 | request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); |
250 | 250 | ||
251 | memcpy(bio->bi_io_vec, bio_src->bi_io_vec, bio_src->bi_max_vecs * sizeof(struct bio_vec)); | 251 | memcpy(bio->bi_io_vec, bio_src->bi_io_vec, |
252 | bio_src->bi_max_vecs * sizeof(struct bio_vec)); | ||
252 | 253 | ||
253 | bio->bi_sector = bio_src->bi_sector; | 254 | bio->bi_sector = bio_src->bi_sector; |
254 | bio->bi_bdev = bio_src->bi_bdev; | 255 | bio->bi_bdev = bio_src->bi_bdev; |
255 | bio->bi_flags |= 1 << BIO_CLONED; | 256 | bio->bi_flags |= 1 << BIO_CLONED; |
256 | bio->bi_rw = bio_src->bi_rw; | 257 | bio->bi_rw = bio_src->bi_rw; |
257 | |||
258 | /* | ||
259 | * notes -- maybe just leave bi_idx alone. assume identical mapping | ||
260 | * for the clone | ||
261 | */ | ||
262 | bio->bi_vcnt = bio_src->bi_vcnt; | 258 | bio->bi_vcnt = bio_src->bi_vcnt; |
263 | bio->bi_size = bio_src->bi_size; | 259 | bio->bi_size = bio_src->bi_size; |
264 | bio->bi_idx = bio_src->bi_idx; | 260 | bio->bi_idx = bio_src->bi_idx; |
diff --git a/fs/dcache.c b/fs/dcache.c index 3aa8a7e980d8..a15a2e1f5520 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/mm.h> | 20 | #include <linux/mm.h> |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/fsnotify.h> | ||
22 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
23 | #include <linux/init.h> | 24 | #include <linux/init.h> |
24 | #include <linux/smp_lock.h> | 25 | #include <linux/smp_lock.h> |
@@ -101,6 +102,7 @@ static inline void dentry_iput(struct dentry * dentry) | |||
101 | list_del_init(&dentry->d_alias); | 102 | list_del_init(&dentry->d_alias); |
102 | spin_unlock(&dentry->d_lock); | 103 | spin_unlock(&dentry->d_lock); |
103 | spin_unlock(&dcache_lock); | 104 | spin_unlock(&dcache_lock); |
105 | fsnotify_inoderemove(inode); | ||
104 | if (dentry->d_op && dentry->d_op->d_iput) | 106 | if (dentry->d_op && dentry->d_op->d_iput) |
105 | dentry->d_op->d_iput(dentry, inode); | 107 | dentry->d_op->d_iput(dentry, inode); |
106 | else | 108 | else |
@@ -1165,13 +1167,16 @@ out: | |||
1165 | 1167 | ||
1166 | void d_delete(struct dentry * dentry) | 1168 | void d_delete(struct dentry * dentry) |
1167 | { | 1169 | { |
1170 | int isdir = 0; | ||
1168 | /* | 1171 | /* |
1169 | * Are we the only user? | 1172 | * Are we the only user? |
1170 | */ | 1173 | */ |
1171 | spin_lock(&dcache_lock); | 1174 | spin_lock(&dcache_lock); |
1172 | spin_lock(&dentry->d_lock); | 1175 | spin_lock(&dentry->d_lock); |
1176 | isdir = S_ISDIR(dentry->d_inode->i_mode); | ||
1173 | if (atomic_read(&dentry->d_count) == 1) { | 1177 | if (atomic_read(&dentry->d_count) == 1) { |
1174 | dentry_iput(dentry); | 1178 | dentry_iput(dentry); |
1179 | fsnotify_nameremove(dentry, isdir); | ||
1175 | return; | 1180 | return; |
1176 | } | 1181 | } |
1177 | 1182 | ||
@@ -1180,6 +1185,8 @@ void d_delete(struct dentry * dentry) | |||
1180 | 1185 | ||
1181 | spin_unlock(&dentry->d_lock); | 1186 | spin_unlock(&dentry->d_lock); |
1182 | spin_unlock(&dcache_lock); | 1187 | spin_unlock(&dcache_lock); |
1188 | |||
1189 | fsnotify_nameremove(dentry, isdir); | ||
1183 | } | 1190 | } |
1184 | 1191 | ||
1185 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) | 1192 | static void __d_rehash(struct dentry * entry, struct hlist_head *list) |
diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c index 34a44e451689..4917315db732 100644 --- a/fs/isofs/compress.c +++ b/fs/isofs/compress.c | |||
@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *file, struct page *page) | |||
129 | cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); | 129 | cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); |
130 | brelse(bh); | 130 | brelse(bh); |
131 | 131 | ||
132 | if (cstart > cend) | ||
133 | goto eio; | ||
134 | |||
132 | csize = cend-cstart; | 135 | csize = cend-cstart; |
133 | 136 | ||
137 | if (csize > deflateBound(1UL << zisofs_block_shift)) | ||
138 | goto eio; | ||
139 | |||
134 | /* Now page[] contains an array of pages, any of which can be NULL, | 140 | /* Now page[] contains an array of pages, any of which can be NULL, |
135 | and the locks on which we hold. We should now read the data and | 141 | and the locks on which we hold. We should now read the data and |
136 | release the pages. If the pages are NULL the decompressed data | 142 | release the pages. If the pages are NULL the decompressed data |
diff --git a/fs/namei.c b/fs/namei.c index 83559dce4286..57046d98a746 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1802,7 +1802,6 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
1802 | up(&dentry->d_inode->i_sem); | 1802 | up(&dentry->d_inode->i_sem); |
1803 | if (!error) { | 1803 | if (!error) { |
1804 | d_delete(dentry); | 1804 | d_delete(dentry); |
1805 | fsnotify_rmdir(dentry, dentry->d_inode, dir); | ||
1806 | } | 1805 | } |
1807 | dput(dentry); | 1806 | dput(dentry); |
1808 | 1807 | ||
@@ -1874,14 +1873,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1874 | 1873 | ||
1875 | /* We don't d_delete() NFS sillyrenamed files--they still exist. */ | 1874 | /* We don't d_delete() NFS sillyrenamed files--they still exist. */ |
1876 | if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { | 1875 | if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { |
1877 | #if defined(CONFIG_INOTIFY) || defined(CONFIG_DNOTIFY) | ||
1878 | dget(dentry); | ||
1879 | d_delete(dentry); | 1876 | d_delete(dentry); |
1880 | fsnotify_unlink(dentry, dir); | ||
1881 | dput(dentry); | ||
1882 | #else | ||
1883 | d_delete(dentry); | ||
1884 | #endif | ||
1885 | } | 1877 | } |
1886 | 1878 | ||
1887 | return error; | 1879 | return error; |
diff --git a/fs/namespace.c b/fs/namespace.c index 587eb0d707ee..79bd8a46e1e7 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -160,7 +160,7 @@ clone_mnt(struct vfsmount *old, struct dentry *root) | |||
160 | mnt->mnt_root = dget(root); | 160 | mnt->mnt_root = dget(root); |
161 | mnt->mnt_mountpoint = mnt->mnt_root; | 161 | mnt->mnt_mountpoint = mnt->mnt_root; |
162 | mnt->mnt_parent = mnt; | 162 | mnt->mnt_parent = mnt; |
163 | mnt->mnt_namespace = old->mnt_namespace; | 163 | mnt->mnt_namespace = current->namespace; |
164 | 164 | ||
165 | /* stick the duplicate mount on the same expiry list | 165 | /* stick the duplicate mount on the same expiry list |
166 | * as the original if that was on one */ | 166 | * as the original if that was on one */ |
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 28957697e59c..f681e675b823 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h | |||
@@ -251,6 +251,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
251 | extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, | 251 | extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, |
252 | struct resource *); | 252 | struct resource *); |
253 | 253 | ||
254 | extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
255 | struct pci_bus_region *region); | ||
256 | |||
254 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | 257 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index |
255 | 258 | ||
256 | static inline int pci_proc_domain(struct pci_bus *bus) | 259 | static inline int pci_proc_domain(struct pci_bus *bus) |
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index b28f1c95dd62..38ea5899a580 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h | |||
@@ -60,6 +60,10 @@ extern void | |||
60 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 60 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
61 | struct resource *res); | 61 | struct resource *res); |
62 | 62 | ||
63 | extern void | ||
64 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
65 | struct pci_bus_region *region); | ||
66 | |||
63 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 67 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
64 | { | 68 | { |
65 | } | 69 | } |
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index 9d4cc47bde39..ee1d8b5d8168 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h | |||
@@ -22,6 +22,14 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | |||
22 | region->end = res->end; | 22 | region->end = res->end; |
23 | } | 23 | } |
24 | 24 | ||
25 | static inline void | ||
26 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
27 | struct pci_bus_region *region) | ||
28 | { | ||
29 | res->start = region->start; | ||
30 | res->end = region->end; | ||
31 | } | ||
32 | |||
25 | #define pcibios_scan_all_fns(a, b) 0 | 33 | #define pcibios_scan_all_fns(a, b) 0 |
26 | 34 | ||
27 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ | 35 | #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ |
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h index 33acd50fd9a8..92d638fc8b11 100644 --- a/include/asm-i386/mach-visws/do_timer.h +++ b/include/asm-i386/mach-visws/do_timer.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* defines for inline arch setup functions */ | 1 | /* defines for inline arch setup functions */ |
2 | 2 | ||
3 | #include <asm/fixmap.h> | 3 | #include <asm/fixmap.h> |
4 | #include <asm/i8259.h> | ||
4 | #include "cobalt.h" | 5 | #include "cobalt.h" |
5 | 6 | ||
6 | static inline void do_timer_interrupt_hook(struct pt_regs *regs) | 7 | static inline void do_timer_interrupt_hook(struct pt_regs *regs) |
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index ee741c150176..98d79a3d54fa 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h | |||
@@ -253,6 +253,10 @@ extern void | |||
253 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 253 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
254 | struct resource *res); | 254 | struct resource *res); |
255 | 255 | ||
256 | extern void | ||
257 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
258 | struct pci_bus_region *region); | ||
259 | |||
256 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) | 260 | static inline void pcibios_add_platform_entries(struct pci_dev *dev) |
257 | { | 261 | { |
258 | } | 262 | } |
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index a13d55870e62..a811e440c978 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h | |||
@@ -105,6 +105,10 @@ extern void | |||
105 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 105 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
106 | struct resource *res); | 106 | struct resource *res); |
107 | 107 | ||
108 | extern void | ||
109 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
110 | struct pci_bus_region *region); | ||
111 | |||
108 | extern void pcibios_add_platform_entries(struct pci_dev *dev); | 112 | extern void pcibios_add_platform_entries(struct pci_dev *dev); |
109 | 113 | ||
110 | struct file; | 114 | struct file; |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 4d4b20c9de78..92f30b28b252 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -202,18 +202,64 @@ extern unsigned long ioremap_bot, ioremap_base; | |||
202 | * | 202 | * |
203 | * Note that these bits preclude future use of a page size | 203 | * Note that these bits preclude future use of a page size |
204 | * less than 4KB. | 204 | * less than 4KB. |
205 | * | ||
206 | * | ||
207 | * PPC 440 core has following TLB attribute fields; | ||
208 | * | ||
209 | * TLB1: | ||
210 | * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ||
211 | * RPN................................. - - - - - - ERPN....... | ||
212 | * | ||
213 | * TLB2: | ||
214 | * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ||
215 | * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR | ||
216 | * | ||
217 | * There are some constrains and options, to decide mapping software bits | ||
218 | * into TLB entry. | ||
219 | * | ||
220 | * - PRESENT *must* be in the bottom three bits because swap cache | ||
221 | * entries use the top 29 bits for TLB2. | ||
222 | * | ||
223 | * - FILE *must* be in the bottom three bits because swap cache | ||
224 | * entries use the top 29 bits for TLB2. | ||
225 | * | ||
226 | * - CACHE COHERENT bit (M) has no effect on PPC440 core, because it | ||
227 | * doesn't support SMP. So we can use this as software bit, like | ||
228 | * DIRTY. | ||
229 | * | ||
230 | * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used | ||
231 | * for memory protection related functions (see PTE structure in | ||
232 | * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the | ||
233 | * above bits. Note that the bit values are CPU specific, not architecture | ||
234 | * specific. | ||
235 | * | ||
236 | * The kernel PTE entry holds an arch-dependent swp_entry structure under | ||
237 | * certain situations. In other words, in such situations some portion of | ||
238 | * the PTE bits are used as a swp_entry. In the PPC implementation, the | ||
239 | * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still | ||
240 | * hold protection values. That means the three protection bits are | ||
241 | * reserved for both PTE and SWAP entry at the most significant three | ||
242 | * LSBs. | ||
243 | * | ||
244 | * There are three protection bits available for SWAP entry: | ||
245 | * _PAGE_PRESENT | ||
246 | * _PAGE_FILE | ||
247 | * _PAGE_HASHPTE (if HW has) | ||
248 | * | ||
249 | * So those three bits have to be inside of 0-2nd LSB of PTE. | ||
250 | * | ||
205 | */ | 251 | */ |
252 | |||
206 | #define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ | 253 | #define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ |
207 | #define _PAGE_RW 0x00000002 /* S: Write permission */ | 254 | #define _PAGE_RW 0x00000002 /* S: Write permission */ |
208 | #define _PAGE_DIRTY 0x00000004 /* S: Page dirty */ | 255 | #define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */ |
209 | #define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ | 256 | #define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ |
210 | #define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */ | 257 | #define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */ |
211 | #define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */ | 258 | #define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */ |
212 | #define _PAGE_USER 0x00000040 /* S: User page */ | 259 | #define _PAGE_USER 0x00000040 /* S: User page */ |
213 | #define _PAGE_ENDIAN 0x00000080 /* H: E bit */ | 260 | #define _PAGE_ENDIAN 0x00000080 /* H: E bit */ |
214 | #define _PAGE_GUARDED 0x00000100 /* H: G bit */ | 261 | #define _PAGE_GUARDED 0x00000100 /* H: G bit */ |
215 | #define _PAGE_COHERENT 0x00000200 /* H: M bit */ | 262 | #define _PAGE_DIRTY 0x00000200 /* S: Page dirty */ |
216 | #define _PAGE_FILE 0x00000400 /* S: nonlinear file mapping */ | ||
217 | #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ | 263 | #define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ |
218 | #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ | 264 | #define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ |
219 | 265 | ||
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index faa772223075..4d057452f59b 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h | |||
@@ -134,6 +134,10 @@ extern void | |||
134 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 134 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, |
135 | struct resource *res); | 135 | struct resource *res); |
136 | 136 | ||
137 | extern void | ||
138 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | ||
139 | struct pci_bus_region *region); | ||
140 | |||
137 | extern int | 141 | extern int |
138 | unmap_bus_range(struct pci_bus *bus); | 142 | unmap_bus_range(struct pci_bus *bus); |
139 | 143 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0881b5cdee3d..19bd8e7e11bf 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -301,6 +301,7 @@ struct blk_queue_tag { | |||
301 | struct list_head busy_list; /* fifo list of busy tags */ | 301 | struct list_head busy_list; /* fifo list of busy tags */ |
302 | int busy; /* current depth */ | 302 | int busy; /* current depth */ |
303 | int max_depth; /* what we will send to device */ | 303 | int max_depth; /* what we will send to device */ |
304 | int real_max_depth; /* what the array can hold */ | ||
304 | atomic_t refcnt; /* map can be shared */ | 305 | atomic_t refcnt; /* map can be shared */ |
305 | }; | 306 | }; |
306 | 307 | ||
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index e96a4306ab3b..602c305c8585 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -44,28 +44,22 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
44 | } | 44 | } |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * fsnotify_unlink - file was unlinked | 47 | * fsnotify_nameremove - a filename was removed from a directory |
48 | */ | 48 | */ |
49 | static inline void fsnotify_unlink(struct dentry *dentry, struct inode *dir) | 49 | static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) |
50 | { | 50 | { |
51 | struct inode *inode = dentry->d_inode; | 51 | if (isdir) |
52 | 52 | isdir = IN_ISDIR; | |
53 | inode_dir_notify(dir, DN_DELETE); | 53 | dnotify_parent(dentry, DN_DELETE); |
54 | inotify_inode_queue_event(dir, IN_DELETE, 0, dentry->d_name.name); | 54 | inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name); |
55 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); | ||
56 | |||
57 | inotify_inode_is_dead(inode); | ||
58 | } | 55 | } |
59 | 56 | ||
60 | /* | 57 | /* |
61 | * fsnotify_rmdir - directory was removed | 58 | * fsnotify_inoderemove - an inode is going away |
62 | */ | 59 | */ |
63 | static inline void fsnotify_rmdir(struct dentry *dentry, struct inode *inode, | 60 | static inline void fsnotify_inoderemove(struct inode *inode) |
64 | struct inode *dir) | ||
65 | { | 61 | { |
66 | inode_dir_notify(dir, DN_DELETE); | 62 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL); |
67 | inotify_inode_queue_event(dir,IN_DELETE|IN_ISDIR,0,dentry->d_name.name); | ||
68 | inotify_inode_queue_event(inode, IN_DELETE_SELF | IN_ISDIR, 0, NULL); | ||
69 | inotify_inode_is_dead(inode); | 63 | inotify_inode_is_dead(inode); |
70 | } | 64 | } |
71 | 65 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 92129078d4f3..a6dbb51ecd7b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1501,4 +1501,10 @@ extern struct bus_type ide_bus_type; | |||
1501 | #define ide_id_has_flush_cache_ext(id) \ | 1501 | #define ide_id_has_flush_cache_ext(id) \ |
1502 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) | 1502 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) |
1503 | 1503 | ||
1504 | static inline int hwif_to_node(ide_hwif_t *hwif) | ||
1505 | { | ||
1506 | struct pci_dev *dev = hwif->pci_dev; | ||
1507 | return dev ? pcibus_to_node(dev->bus) : -1; | ||
1508 | } | ||
1509 | |||
1504 | #endif /* _IDE_H */ | 1510 | #endif /* _IDE_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 70c2a9dc4b2b..6552b71bfa73 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -12,15 +12,13 @@ | |||
12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ | 12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ |
13 | #define NETLINK_XFRM 6 /* ipsec */ | 13 | #define NETLINK_XFRM 6 /* ipsec */ |
14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ | 14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ |
15 | #define NETLINK_ARPD 8 | 15 | #define NETLINK_ISCSI 8 /* Open-iSCSI */ |
16 | #define NETLINK_AUDIT 9 /* auditing */ | 16 | #define NETLINK_AUDIT 9 /* auditing */ |
17 | #define NETLINK_FIB_LOOKUP 10 | 17 | #define NETLINK_FIB_LOOKUP 10 |
18 | #define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ | ||
19 | #define NETLINK_NETFILTER 12 /* netfilter subsystem */ | 18 | #define NETLINK_NETFILTER 12 /* netfilter subsystem */ |
20 | #define NETLINK_IP6_FW 13 | 19 | #define NETLINK_IP6_FW 13 |
21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 20 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 21 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
23 | #define NETLINK_TAPBASE 16 /* 16 to 31 are ethertap */ | ||
24 | 22 | ||
25 | #define MAX_LINKS 32 | 23 | #define MAX_LINKS 32 |
26 | 24 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 239f520cc49e..bfe3e763ccf2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/pagemap.h> | ||
11 | 10 | ||
12 | #include <asm/atomic.h> | 11 | #include <asm/atomic.h> |
13 | #include <asm/page.h> | 12 | #include <asm/page.h> |
@@ -255,6 +254,8 @@ static inline void put_swap_token(struct mm_struct *mm) | |||
255 | 254 | ||
256 | #define si_swapinfo(val) \ | 255 | #define si_swapinfo(val) \ |
257 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) | 256 | do { (val)->freeswap = (val)->totalswap = 0; } while (0) |
257 | /* only sparc can not include linux/pagemap.h in this file | ||
258 | * so leave page_cache_release and release_pages undeclared... */ | ||
258 | #define free_page_and_swap_cache(page) \ | 259 | #define free_page_and_swap_cache(page) \ |
259 | page_cache_release(page) | 260 | page_cache_release(page) |
260 | #define free_pages_and_swap_cache(pages, nr) \ | 261 | #define free_pages_and_swap_cache(pages, nr) \ |
diff --git a/include/linux/zlib.h b/include/linux/zlib.h index 850076ea14d3..74f7b78c22d2 100644 --- a/include/linux/zlib.h +++ b/include/linux/zlib.h | |||
@@ -506,6 +506,11 @@ extern int zlib_deflateReset (z_streamp strm); | |||
506 | stream state was inconsistent (such as zalloc or state being NULL). | 506 | stream state was inconsistent (such as zalloc or state being NULL). |
507 | */ | 507 | */ |
508 | 508 | ||
509 | static inline unsigned long deflateBound(unsigned long s) | ||
510 | { | ||
511 | return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11; | ||
512 | } | ||
513 | |||
509 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); | 514 | extern int zlib_deflateParams (z_streamp strm, int level, int strategy); |
510 | /* | 515 | /* |
511 | Dynamically update the compression level and compression strategy. The | 516 | Dynamically update the compression level and compression strategy. The |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 42a84c53678b..06b24f637026 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -57,12 +57,6 @@ | |||
57 | #define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) | 57 | #define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) |
58 | #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) | 58 | #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) |
59 | 59 | ||
60 | #ifdef HCI_DATA_DUMP | ||
61 | #define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len) | ||
62 | #else | ||
63 | #define BT_DMP(D...) | ||
64 | #endif | ||
65 | |||
66 | extern struct proc_dir_entry *proc_bt; | 60 | extern struct proc_dir_entry *proc_bt; |
67 | 61 | ||
68 | /* Connection and socket states */ | 62 | /* Connection and socket states */ |
@@ -174,8 +168,6 @@ static inline int skb_frags_no(struct sk_buff *skb) | |||
174 | return n; | 168 | return n; |
175 | } | 169 | } |
176 | 170 | ||
177 | void bt_dump(char *pref, __u8 *buf, int count); | ||
178 | |||
179 | int bt_err(__u16 code); | 171 | int bt_err(__u16 code); |
180 | 172 | ||
181 | #endif /* __BLUETOOTH_H */ | 173 | #endif /* __BLUETOOTH_H */ |
@@ -895,7 +895,7 @@ static inline void lock_semundo(void) | |||
895 | struct sem_undo_list *undo_list; | 895 | struct sem_undo_list *undo_list; |
896 | 896 | ||
897 | undo_list = current->sysvsem.undo_list; | 897 | undo_list = current->sysvsem.undo_list; |
898 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 898 | if (undo_list) |
899 | spin_lock(&undo_list->lock); | 899 | spin_lock(&undo_list->lock); |
900 | } | 900 | } |
901 | 901 | ||
@@ -915,7 +915,7 @@ static inline void unlock_semundo(void) | |||
915 | struct sem_undo_list *undo_list; | 915 | struct sem_undo_list *undo_list; |
916 | 916 | ||
917 | undo_list = current->sysvsem.undo_list; | 917 | undo_list = current->sysvsem.undo_list; |
918 | if ((undo_list != NULL) && (atomic_read(&undo_list->refcnt) != 1)) | 918 | if (undo_list) |
919 | spin_unlock(&undo_list->lock); | 919 | spin_unlock(&undo_list->lock); |
920 | } | 920 | } |
921 | 921 | ||
@@ -943,9 +943,7 @@ static inline int get_undo_list(struct sem_undo_list **undo_listp) | |||
943 | if (undo_list == NULL) | 943 | if (undo_list == NULL) |
944 | return -ENOMEM; | 944 | return -ENOMEM; |
945 | memset(undo_list, 0, size); | 945 | memset(undo_list, 0, size); |
946 | /* don't initialize unodhd->lock here. It's done | 946 | spin_lock_init(&undo_list->lock); |
947 | * in copy_semundo() instead. | ||
948 | */ | ||
949 | atomic_set(&undo_list->refcnt, 1); | 947 | atomic_set(&undo_list->refcnt, 1); |
950 | current->sysvsem.undo_list = undo_list; | 948 | current->sysvsem.undo_list = undo_list; |
951 | } | 949 | } |
@@ -1231,8 +1229,6 @@ int copy_semundo(unsigned long clone_flags, struct task_struct *tsk) | |||
1231 | error = get_undo_list(&undo_list); | 1229 | error = get_undo_list(&undo_list); |
1232 | if (error) | 1230 | if (error) |
1233 | return error; | 1231 | return error; |
1234 | if (atomic_read(&undo_list->refcnt) == 1) | ||
1235 | spin_lock_init(&undo_list->lock); | ||
1236 | atomic_inc(&undo_list->refcnt); | 1232 | atomic_inc(&undo_list->refcnt); |
1237 | tsk->sysvsem.undo_list = undo_list; | 1233 | tsk->sysvsem.undo_list = undo_list; |
1238 | } else | 1234 | } else |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 805fb9097318..21a4e3b2cbda 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -398,21 +398,31 @@ static int cpuset_path(const struct cpuset *cs, char *buf, int buflen) | |||
398 | * to continue to serve a useful existence. Next time it's released, | 398 | * to continue to serve a useful existence. Next time it's released, |
399 | * we will get notified again, if it still has 'notify_on_release' set. | 399 | * we will get notified again, if it still has 'notify_on_release' set. |
400 | * | 400 | * |
401 | * Note final arg to call_usermodehelper() is 0 - that means | 401 | * The final arg to call_usermodehelper() is 0, which means don't |
402 | * don't wait. Since we are holding the global cpuset_sem here, | 402 | * wait. The separate /sbin/cpuset_release_agent task is forked by |
403 | * and we are asking another thread (started from keventd) to rmdir a | 403 | * call_usermodehelper(), then control in this thread returns here, |
404 | * cpuset, we can't wait - or we'd deadlock with the removing thread | 404 | * without waiting for the release agent task. We don't bother to |
405 | * on cpuset_sem. | 405 | * wait because the caller of this routine has no use for the exit |
406 | * status of the /sbin/cpuset_release_agent task, so no sense holding | ||
407 | * our caller up for that. | ||
408 | * | ||
409 | * The simple act of forking that task might require more memory, | ||
410 | * which might need cpuset_sem. So this routine must be called while | ||
411 | * cpuset_sem is not held, to avoid a possible deadlock. See also | ||
412 | * comments for check_for_release(), below. | ||
406 | */ | 413 | */ |
407 | 414 | ||
408 | static int cpuset_release_agent(char *cpuset_str) | 415 | static void cpuset_release_agent(const char *pathbuf) |
409 | { | 416 | { |
410 | char *argv[3], *envp[3]; | 417 | char *argv[3], *envp[3]; |
411 | int i; | 418 | int i; |
412 | 419 | ||
420 | if (!pathbuf) | ||
421 | return; | ||
422 | |||
413 | i = 0; | 423 | i = 0; |
414 | argv[i++] = "/sbin/cpuset_release_agent"; | 424 | argv[i++] = "/sbin/cpuset_release_agent"; |
415 | argv[i++] = cpuset_str; | 425 | argv[i++] = (char *)pathbuf; |
416 | argv[i] = NULL; | 426 | argv[i] = NULL; |
417 | 427 | ||
418 | i = 0; | 428 | i = 0; |
@@ -421,17 +431,29 @@ static int cpuset_release_agent(char *cpuset_str) | |||
421 | envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; | 431 | envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; |
422 | envp[i] = NULL; | 432 | envp[i] = NULL; |
423 | 433 | ||
424 | return call_usermodehelper(argv[0], argv, envp, 0); | 434 | call_usermodehelper(argv[0], argv, envp, 0); |
435 | kfree(pathbuf); | ||
425 | } | 436 | } |
426 | 437 | ||
427 | /* | 438 | /* |
428 | * Either cs->count of using tasks transitioned to zero, or the | 439 | * Either cs->count of using tasks transitioned to zero, or the |
429 | * cs->children list of child cpusets just became empty. If this | 440 | * cs->children list of child cpusets just became empty. If this |
430 | * cs is notify_on_release() and now both the user count is zero and | 441 | * cs is notify_on_release() and now both the user count is zero and |
431 | * the list of children is empty, send notice to user land. | 442 | * the list of children is empty, prepare cpuset path in a kmalloc'd |
443 | * buffer, to be returned via ppathbuf, so that the caller can invoke | ||
444 | * cpuset_release_agent() with it later on, once cpuset_sem is dropped. | ||
445 | * Call here with cpuset_sem held. | ||
446 | * | ||
447 | * This check_for_release() routine is responsible for kmalloc'ing | ||
448 | * pathbuf. The above cpuset_release_agent() is responsible for | ||
449 | * kfree'ing pathbuf. The caller of these routines is responsible | ||
450 | * for providing a pathbuf pointer, initialized to NULL, then | ||
451 | * calling check_for_release() with cpuset_sem held and the address | ||
452 | * of the pathbuf pointer, then dropping cpuset_sem, then calling | ||
453 | * cpuset_release_agent() with pathbuf, as set by check_for_release(). | ||
432 | */ | 454 | */ |
433 | 455 | ||
434 | static void check_for_release(struct cpuset *cs) | 456 | static void check_for_release(struct cpuset *cs, char **ppathbuf) |
435 | { | 457 | { |
436 | if (notify_on_release(cs) && atomic_read(&cs->count) == 0 && | 458 | if (notify_on_release(cs) && atomic_read(&cs->count) == 0 && |
437 | list_empty(&cs->children)) { | 459 | list_empty(&cs->children)) { |
@@ -441,10 +463,9 @@ static void check_for_release(struct cpuset *cs) | |||
441 | if (!buf) | 463 | if (!buf) |
442 | return; | 464 | return; |
443 | if (cpuset_path(cs, buf, PAGE_SIZE) < 0) | 465 | if (cpuset_path(cs, buf, PAGE_SIZE) < 0) |
444 | goto out; | 466 | kfree(buf); |
445 | cpuset_release_agent(buf); | 467 | else |
446 | out: | 468 | *ppathbuf = buf; |
447 | kfree(buf); | ||
448 | } | 469 | } |
449 | } | 470 | } |
450 | 471 | ||
@@ -727,14 +748,14 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, char *buf) | |||
727 | return 0; | 748 | return 0; |
728 | } | 749 | } |
729 | 750 | ||
730 | static int attach_task(struct cpuset *cs, char *buf) | 751 | static int attach_task(struct cpuset *cs, char *pidbuf, char **ppathbuf) |
731 | { | 752 | { |
732 | pid_t pid; | 753 | pid_t pid; |
733 | struct task_struct *tsk; | 754 | struct task_struct *tsk; |
734 | struct cpuset *oldcs; | 755 | struct cpuset *oldcs; |
735 | cpumask_t cpus; | 756 | cpumask_t cpus; |
736 | 757 | ||
737 | if (sscanf(buf, "%d", &pid) != 1) | 758 | if (sscanf(pidbuf, "%d", &pid) != 1) |
738 | return -EIO; | 759 | return -EIO; |
739 | if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) | 760 | if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) |
740 | return -ENOSPC; | 761 | return -ENOSPC; |
@@ -777,7 +798,7 @@ static int attach_task(struct cpuset *cs, char *buf) | |||
777 | 798 | ||
778 | put_task_struct(tsk); | 799 | put_task_struct(tsk); |
779 | if (atomic_dec_and_test(&oldcs->count)) | 800 | if (atomic_dec_and_test(&oldcs->count)) |
780 | check_for_release(oldcs); | 801 | check_for_release(oldcs, ppathbuf); |
781 | return 0; | 802 | return 0; |
782 | } | 803 | } |
783 | 804 | ||
@@ -801,6 +822,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
801 | struct cftype *cft = __d_cft(file->f_dentry); | 822 | struct cftype *cft = __d_cft(file->f_dentry); |
802 | cpuset_filetype_t type = cft->private; | 823 | cpuset_filetype_t type = cft->private; |
803 | char *buffer; | 824 | char *buffer; |
825 | char *pathbuf = NULL; | ||
804 | int retval = 0; | 826 | int retval = 0; |
805 | 827 | ||
806 | /* Crude upper limit on largest legitimate cpulist user might write. */ | 828 | /* Crude upper limit on largest legitimate cpulist user might write. */ |
@@ -841,7 +863,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
841 | retval = update_flag(CS_NOTIFY_ON_RELEASE, cs, buffer); | 863 | retval = update_flag(CS_NOTIFY_ON_RELEASE, cs, buffer); |
842 | break; | 864 | break; |
843 | case FILE_TASKLIST: | 865 | case FILE_TASKLIST: |
844 | retval = attach_task(cs, buffer); | 866 | retval = attach_task(cs, buffer, &pathbuf); |
845 | break; | 867 | break; |
846 | default: | 868 | default: |
847 | retval = -EINVAL; | 869 | retval = -EINVAL; |
@@ -852,6 +874,7 @@ static ssize_t cpuset_common_file_write(struct file *file, const char __user *us | |||
852 | retval = nbytes; | 874 | retval = nbytes; |
853 | out2: | 875 | out2: |
854 | up(&cpuset_sem); | 876 | up(&cpuset_sem); |
877 | cpuset_release_agent(pathbuf); | ||
855 | out1: | 878 | out1: |
856 | kfree(buffer); | 879 | kfree(buffer); |
857 | return retval; | 880 | return retval; |
@@ -1357,6 +1380,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1357 | struct cpuset *cs = dentry->d_fsdata; | 1380 | struct cpuset *cs = dentry->d_fsdata; |
1358 | struct dentry *d; | 1381 | struct dentry *d; |
1359 | struct cpuset *parent; | 1382 | struct cpuset *parent; |
1383 | char *pathbuf = NULL; | ||
1360 | 1384 | ||
1361 | /* the vfs holds both inode->i_sem already */ | 1385 | /* the vfs holds both inode->i_sem already */ |
1362 | 1386 | ||
@@ -1376,7 +1400,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1376 | update_cpu_domains(cs); | 1400 | update_cpu_domains(cs); |
1377 | list_del(&cs->sibling); /* delete my sibling from parent->children */ | 1401 | list_del(&cs->sibling); /* delete my sibling from parent->children */ |
1378 | if (list_empty(&parent->children)) | 1402 | if (list_empty(&parent->children)) |
1379 | check_for_release(parent); | 1403 | check_for_release(parent, &pathbuf); |
1380 | spin_lock(&cs->dentry->d_lock); | 1404 | spin_lock(&cs->dentry->d_lock); |
1381 | d = dget(cs->dentry); | 1405 | d = dget(cs->dentry); |
1382 | cs->dentry = NULL; | 1406 | cs->dentry = NULL; |
@@ -1384,6 +1408,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
1384 | cpuset_d_remove_dir(d); | 1408 | cpuset_d_remove_dir(d); |
1385 | dput(d); | 1409 | dput(d); |
1386 | up(&cpuset_sem); | 1410 | up(&cpuset_sem); |
1411 | cpuset_release_agent(pathbuf); | ||
1387 | return 0; | 1412 | return 0; |
1388 | } | 1413 | } |
1389 | 1414 | ||
@@ -1483,10 +1508,13 @@ void cpuset_exit(struct task_struct *tsk) | |||
1483 | task_unlock(tsk); | 1508 | task_unlock(tsk); |
1484 | 1509 | ||
1485 | if (notify_on_release(cs)) { | 1510 | if (notify_on_release(cs)) { |
1511 | char *pathbuf = NULL; | ||
1512 | |||
1486 | down(&cpuset_sem); | 1513 | down(&cpuset_sem); |
1487 | if (atomic_dec_and_test(&cs->count)) | 1514 | if (atomic_dec_and_test(&cs->count)) |
1488 | check_for_release(cs); | 1515 | check_for_release(cs, &pathbuf); |
1489 | up(&cpuset_sem); | 1516 | up(&cpuset_sem); |
1517 | cpuset_release_agent(pathbuf); | ||
1490 | } else { | 1518 | } else { |
1491 | atomic_dec(&cs->count); | 1519 | atomic_dec(&cs->count); |
1492 | } | 1520 | } |
diff --git a/kernel/exit.c b/kernel/exit.c index 9d1b10ed0135..5b0fb9f09f21 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -829,8 +829,10 @@ fastcall NORET_TYPE void do_exit(long code) | |||
829 | acct_update_integrals(tsk); | 829 | acct_update_integrals(tsk); |
830 | update_mem_hiwater(tsk); | 830 | update_mem_hiwater(tsk); |
831 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 831 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
832 | if (group_dead) | 832 | if (group_dead) { |
833 | del_timer_sync(&tsk->signal->real_timer); | ||
833 | acct_process(code); | 834 | acct_process(code); |
835 | } | ||
834 | exit_mm(tsk); | 836 | exit_mm(tsk); |
835 | 837 | ||
836 | exit_sem(tsk); | 838 | exit_sem(tsk); |
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 10b2ad749d14..38798a2ff994 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -1166,7 +1166,6 @@ void exit_itimers(struct signal_struct *sig) | |||
1166 | tmr = list_entry(sig->posix_timers.next, struct k_itimer, list); | 1166 | tmr = list_entry(sig->posix_timers.next, struct k_itimer, list); |
1167 | itimer_delete(tmr); | 1167 | itimer_delete(tmr); |
1168 | } | 1168 | } |
1169 | del_timer_sync(&sig->real_timer); | ||
1170 | } | 1169 | } |
1171 | 1170 | ||
1172 | /* | 1171 | /* |
diff --git a/lib/crc32.c b/lib/crc32.c index 58b222783f9c..065198f98b3f 100644 --- a/lib/crc32.c +++ b/lib/crc32.c | |||
@@ -473,7 +473,7 @@ static u32 test_step(u32 init, unsigned char *buf, size_t len) | |||
473 | init = bitreverse(init); | 473 | init = bitreverse(init); |
474 | crc2 = bitreverse(crc1); | 474 | crc2 = bitreverse(crc1); |
475 | if (crc1 != bitreverse(crc2)) | 475 | if (crc1 != bitreverse(crc2)) |
476 | printf("\nBit reversal fail: 0x%08x -> %0x08x -> 0x%08x\n", | 476 | printf("\nBit reversal fail: 0x%08x -> 0x%08x -> 0x%08x\n", |
477 | crc1, crc2, bitreverse(crc2)); | 477 | crc1, crc2, bitreverse(crc2)); |
478 | crc1 = crc32_le(init, buf, len); | 478 | crc1 = crc32_le(init, buf, len); |
479 | if (crc1 != crc2) | 479 | if (crc1 != crc2) |
diff --git a/lib/inflate.c b/lib/inflate.c index 75e7d303c72e..6db6e98d1637 100644 --- a/lib/inflate.c +++ b/lib/inflate.c | |||
@@ -326,7 +326,7 @@ DEBG("huft1 "); | |||
326 | { | 326 | { |
327 | *t = (struct huft *)NULL; | 327 | *t = (struct huft *)NULL; |
328 | *m = 0; | 328 | *m = 0; |
329 | return 0; | 329 | return 2; |
330 | } | 330 | } |
331 | 331 | ||
332 | DEBG("huft2 "); | 332 | DEBG("huft2 "); |
@@ -374,6 +374,7 @@ DEBG("huft5 "); | |||
374 | if ((j = *p++) != 0) | 374 | if ((j = *p++) != 0) |
375 | v[x[j]++] = i; | 375 | v[x[j]++] = i; |
376 | } while (++i < n); | 376 | } while (++i < n); |
377 | n = x[g]; /* set n to length of v */ | ||
377 | 378 | ||
378 | DEBG("h6 "); | 379 | DEBG("h6 "); |
379 | 380 | ||
@@ -410,12 +411,13 @@ DEBG1("1 "); | |||
410 | DEBG1("2 "); | 411 | DEBG1("2 "); |
411 | f -= a + 1; /* deduct codes from patterns left */ | 412 | f -= a + 1; /* deduct codes from patterns left */ |
412 | xp = c + k; | 413 | xp = c + k; |
413 | while (++j < z) /* try smaller tables up to z bits */ | 414 | if (j < z) |
414 | { | 415 | while (++j < z) /* try smaller tables up to z bits */ |
415 | if ((f <<= 1) <= *++xp) | 416 | { |
416 | break; /* enough codes to use up j bits */ | 417 | if ((f <<= 1) <= *++xp) |
417 | f -= *xp; /* else deduct codes from patterns */ | 418 | break; /* enough codes to use up j bits */ |
418 | } | 419 | f -= *xp; /* else deduct codes from patterns */ |
420 | } | ||
419 | } | 421 | } |
420 | DEBG1("3 "); | 422 | DEBG1("3 "); |
421 | z = 1 << j; /* table entries for j-bit table */ | 423 | z = 1 << j; /* table entries for j-bit table */ |
diff --git a/lib/zlib_inflate/inftrees.c b/lib/zlib_inflate/inftrees.c index 874950ec4858..c5f66fbb0dd0 100644 --- a/lib/zlib_inflate/inftrees.c +++ b/lib/zlib_inflate/inftrees.c | |||
@@ -141,7 +141,7 @@ static int huft_build( | |||
141 | { | 141 | { |
142 | *t = NULL; | 142 | *t = NULL; |
143 | *m = 0; | 143 | *m = 0; |
144 | return Z_OK; | 144 | return Z_DATA_ERROR; |
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index fbd1111ea119..6bf720bc662c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -301,6 +301,7 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, | |||
301 | { | 301 | { |
302 | struct mm_struct *mm = vma->vm_mm; | 302 | struct mm_struct *mm = vma->vm_mm; |
303 | unsigned long address; | 303 | unsigned long address; |
304 | pte_t *ptep; | ||
304 | pte_t pte; | 305 | pte_t pte; |
305 | struct page *page; | 306 | struct page *page; |
306 | 307 | ||
@@ -309,9 +310,17 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, | |||
309 | BUG_ON(end & ~HPAGE_MASK); | 310 | BUG_ON(end & ~HPAGE_MASK); |
310 | 311 | ||
311 | for (address = start; address < end; address += HPAGE_SIZE) { | 312 | for (address = start; address < end; address += HPAGE_SIZE) { |
312 | pte = huge_ptep_get_and_clear(mm, address, huge_pte_offset(mm, address)); | 313 | ptep = huge_pte_offset(mm, address); |
314 | if (! ptep) | ||
315 | /* This can happen on truncate, or if an | ||
316 | * mmap() is aborted due to an error before | ||
317 | * the prefault */ | ||
318 | continue; | ||
319 | |||
320 | pte = huge_ptep_get_and_clear(mm, address, ptep); | ||
313 | if (pte_none(pte)) | 321 | if (pte_none(pte)) |
314 | continue; | 322 | continue; |
323 | |||
315 | page = pte_page(pte); | 324 | page = pte_page(pte); |
316 | put_page(page); | 325 | put_page(page); |
317 | } | 326 | } |
@@ -143,7 +143,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
143 | leave 3% of the size of this process for other processes */ | 143 | leave 3% of the size of this process for other processes */ |
144 | allowed -= current->mm->total_vm / 32; | 144 | allowed -= current->mm->total_vm / 32; |
145 | 145 | ||
146 | if (atomic_read(&vm_committed_space) < allowed) | 146 | /* |
147 | * cast `allowed' as a signed long because vm_committed_space | ||
148 | * sometimes has a negative value | ||
149 | */ | ||
150 | if (atomic_read(&vm_committed_space) < (long)allowed) | ||
147 | return 0; | 151 | return 0; |
148 | 152 | ||
149 | vm_unacct_memory(pages); | 153 | vm_unacct_memory(pages); |
diff --git a/mm/nommu.c b/mm/nommu.c index ce74452c02d9..fd4e8df0f02d 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1167,7 +1167,11 @@ int __vm_enough_memory(long pages, int cap_sys_admin) | |||
1167 | leave 3% of the size of this process for other processes */ | 1167 | leave 3% of the size of this process for other processes */ |
1168 | allowed -= current->mm->total_vm / 32; | 1168 | allowed -= current->mm->total_vm / 32; |
1169 | 1169 | ||
1170 | if (atomic_read(&vm_committed_space) < allowed) | 1170 | /* |
1171 | * cast `allowed' as a signed long because vm_committed_space | ||
1172 | * sometimes has a negative value | ||
1173 | */ | ||
1174 | if (atomic_read(&vm_committed_space) < (long)allowed) | ||
1171 | return 0; | 1175 | return 0; |
1172 | 1176 | ||
1173 | vm_unacct_memory(pages); | 1177 | vm_unacct_memory(pages); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index fb5524365bc2..ffa26c10bfe8 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -299,7 +299,6 @@ struct hci_dev *hci_dev_get(int index) | |||
299 | read_unlock(&hci_dev_list_lock); | 299 | read_unlock(&hci_dev_list_lock); |
300 | return hdev; | 300 | return hdev; |
301 | } | 301 | } |
302 | EXPORT_SYMBOL(hci_dev_get); | ||
303 | 302 | ||
304 | /* ---- Inquiry support ---- */ | 303 | /* ---- Inquiry support ---- */ |
305 | static void inquiry_cache_flush(struct hci_dev *hdev) | 304 | static void inquiry_cache_flush(struct hci_dev *hdev) |
@@ -1042,7 +1041,6 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p | |||
1042 | 1041 | ||
1043 | return 0; | 1042 | return 0; |
1044 | } | 1043 | } |
1045 | EXPORT_SYMBOL(hci_send_cmd); | ||
1046 | 1044 | ||
1047 | /* Get data from the previously sent command */ | 1045 | /* Get data from the previously sent command */ |
1048 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf) | 1046 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c4b592b4ef10..46367bd129c3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1035,9 +1035,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) | |||
1035 | ev->type = type; | 1035 | ev->type = type; |
1036 | memcpy(ev->data, data, dlen); | 1036 | memcpy(ev->data, data, dlen); |
1037 | 1037 | ||
1038 | bt_cb(skb)->incoming = 1; | ||
1039 | do_gettimeofday(&skb->stamp); | ||
1040 | |||
1038 | skb->pkt_type = HCI_EVENT_PKT; | 1041 | skb->pkt_type = HCI_EVENT_PKT; |
1039 | skb->dev = (void *) hdev; | 1042 | skb->dev = (void *) hdev; |
1040 | hci_send_to_sock(hdev, skb); | 1043 | hci_send_to_sock(hdev, skb); |
1041 | kfree_skb(skb); | 1044 | kfree_skb(skb); |
1042 | } | 1045 | } |
1043 | EXPORT_SYMBOL(hci_si_event); | ||
diff --git a/net/bluetooth/lib.c b/net/bluetooth/lib.c index 9efb0a093612..ee6a66979913 100644 --- a/net/bluetooth/lib.c +++ b/net/bluetooth/lib.c | |||
@@ -34,31 +34,6 @@ | |||
34 | 34 | ||
35 | #include <net/bluetooth/bluetooth.h> | 35 | #include <net/bluetooth/bluetooth.h> |
36 | 36 | ||
37 | void bt_dump(char *pref, __u8 *buf, int count) | ||
38 | { | ||
39 | char *ptr; | ||
40 | char line[100]; | ||
41 | unsigned int i; | ||
42 | |||
43 | printk(KERN_INFO "%s: dump, len %d\n", pref, count); | ||
44 | |||
45 | ptr = line; | ||
46 | *ptr = 0; | ||
47 | for (i = 0; i < count; i++) { | ||
48 | ptr += sprintf(ptr, " %2.2X", buf[i]); | ||
49 | |||
50 | if (i && !((i + 1) % 20)) { | ||
51 | printk(KERN_INFO "%s:%s\n", pref, line); | ||
52 | ptr = line; | ||
53 | *ptr = 0; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | if (line[0]) | ||
58 | printk(KERN_INFO "%s:%s\n", pref, line); | ||
59 | } | ||
60 | EXPORT_SYMBOL(bt_dump); | ||
61 | |||
62 | void baswap(bdaddr_t *dst, bdaddr_t *src) | 37 | void baswap(bdaddr_t *dst, bdaddr_t *src) |
63 | { | 38 | { |
64 | unsigned char *d = (unsigned char *) dst; | 39 | unsigned char *d = (unsigned char *) dst; |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index e9e6fda66f1a..27bf5047cd33 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -389,8 +389,6 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err) | |||
389 | rfcomm_dlc_unlock(d); | 389 | rfcomm_dlc_unlock(d); |
390 | 390 | ||
391 | skb_queue_purge(&d->tx_queue); | 391 | skb_queue_purge(&d->tx_queue); |
392 | rfcomm_session_put(s); | ||
393 | |||
394 | rfcomm_dlc_unlink(d); | 392 | rfcomm_dlc_unlink(d); |
395 | } | 393 | } |
396 | 394 | ||
@@ -600,8 +598,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst | |||
600 | goto failed; | 598 | goto failed; |
601 | } | 599 | } |
602 | 600 | ||
603 | rfcomm_session_hold(s); | ||
604 | |||
605 | s->initiator = 1; | 601 | s->initiator = 1; |
606 | 602 | ||
607 | bacpy(&addr.l2_bdaddr, dst); | 603 | bacpy(&addr.l2_bdaddr, dst); |
diff --git a/net/compat.c b/net/compat.c index be5d936dc423..d99ab9695893 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -91,20 +91,11 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, | |||
91 | } else | 91 | } else |
92 | kern_msg->msg_name = NULL; | 92 | kern_msg->msg_name = NULL; |
93 | 93 | ||
94 | if(kern_msg->msg_iovlen > UIO_FASTIOV) { | ||
95 | kern_iov = kmalloc(kern_msg->msg_iovlen * sizeof(struct iovec), | ||
96 | GFP_KERNEL); | ||
97 | if(!kern_iov) | ||
98 | return -ENOMEM; | ||
99 | } | ||
100 | |||
101 | tot_len = iov_from_user_compat_to_kern(kern_iov, | 94 | tot_len = iov_from_user_compat_to_kern(kern_iov, |
102 | (struct compat_iovec __user *)kern_msg->msg_iov, | 95 | (struct compat_iovec __user *)kern_msg->msg_iov, |
103 | kern_msg->msg_iovlen); | 96 | kern_msg->msg_iovlen); |
104 | if(tot_len >= 0) | 97 | if(tot_len >= 0) |
105 | kern_msg->msg_iov = kern_iov; | 98 | kern_msg->msg_iov = kern_iov; |
106 | else if(kern_msg->msg_iovlen > UIO_FASTIOV) | ||
107 | kfree(kern_iov); | ||
108 | 99 | ||
109 | return tot_len; | 100 | return tot_len; |
110 | } | 101 | } |
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index c886b28ba9f5..e278cb9d0075 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c | |||
@@ -593,10 +593,13 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
593 | struct hlist_head *new_laddrhash, | 593 | struct hlist_head *new_laddrhash, |
594 | unsigned int new_size) | 594 | unsigned int new_size) |
595 | { | 595 | { |
596 | struct hlist_head *old_info_hash, *old_laddrhash; | ||
596 | unsigned int old_size = fib_hash_size; | 597 | unsigned int old_size = fib_hash_size; |
597 | unsigned int i; | 598 | unsigned int i, bytes; |
598 | 599 | ||
599 | write_lock(&fib_info_lock); | 600 | write_lock(&fib_info_lock); |
601 | old_info_hash = fib_info_hash; | ||
602 | old_laddrhash = fib_info_laddrhash; | ||
600 | fib_hash_size = new_size; | 603 | fib_hash_size = new_size; |
601 | 604 | ||
602 | for (i = 0; i < old_size; i++) { | 605 | for (i = 0; i < old_size; i++) { |
@@ -636,6 +639,10 @@ static void fib_hash_move(struct hlist_head *new_info_hash, | |||
636 | fib_info_laddrhash = new_laddrhash; | 639 | fib_info_laddrhash = new_laddrhash; |
637 | 640 | ||
638 | write_unlock(&fib_info_lock); | 641 | write_unlock(&fib_info_lock); |
642 | |||
643 | bytes = old_size * sizeof(struct hlist_head *); | ||
644 | fib_hash_free(old_info_hash, bytes); | ||
645 | fib_hash_free(old_laddrhash, bytes); | ||
639 | } | 646 | } |
640 | 647 | ||
641 | struct fib_info * | 648 | struct fib_info * |
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 279f57abfecb..3d78464f64ea 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -936,8 +936,7 @@ int icmp_rcv(struct sk_buff *skb) | |||
936 | case CHECKSUM_HW: | 936 | case CHECKSUM_HW: |
937 | if (!(u16)csum_fold(skb->csum)) | 937 | if (!(u16)csum_fold(skb->csum)) |
938 | break; | 938 | break; |
939 | NETDEBUG(if (net_ratelimit()) | 939 | LIMIT_NETDEBUG(printk(KERN_DEBUG "icmp v4 hw csum failure\n")); |
940 | printk(KERN_DEBUG "icmp v4 hw csum failure\n")); | ||
941 | case CHECKSUM_NONE: | 940 | case CHECKSUM_NONE: |
942 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) | 941 | if ((u16)csum_fold(skb_checksum(skb, 0, skb->len, 0))) |
943 | goto error; | 942 | goto error; |
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 7f68e27eb4ea..eb377ae15305 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -377,7 +377,7 @@ static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) | |||
377 | return ip_frag_intern(hash, qp); | 377 | return ip_frag_intern(hash, qp); |
378 | 378 | ||
379 | out_nomem: | 379 | out_nomem: |
380 | NETDEBUG(if (net_ratelimit()) printk(KERN_ERR "ip_frag_create: no memory left !\n")); | 380 | LIMIT_NETDEBUG(printk(KERN_ERR "ip_frag_create: no memory left !\n")); |
381 | return NULL; | 381 | return NULL; |
382 | } | 382 | } |
383 | 383 | ||
@@ -625,10 +625,8 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev) | |||
625 | return head; | 625 | return head; |
626 | 626 | ||
627 | out_nomem: | 627 | out_nomem: |
628 | NETDEBUG(if (net_ratelimit()) | 628 | LIMIT_NETDEBUG(printk(KERN_ERR "IP: queue_glue: no memory for gluing " |
629 | printk(KERN_ERR | 629 | "queue %p\n", qp)); |
630 | "IP: queue_glue: no memory for gluing queue %p\n", | ||
631 | qp)); | ||
632 | goto out_fail; | 630 | goto out_fail; |
633 | out_oversize: | 631 | out_oversize: |
634 | if (net_ratelimit()) | 632 | if (net_ratelimit()) |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index fc7c481d0d79..ff4bd067b397 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -848,6 +848,9 @@ mc_msf_out: | |||
848 | 848 | ||
849 | case IP_IPSEC_POLICY: | 849 | case IP_IPSEC_POLICY: |
850 | case IP_XFRM_POLICY: | 850 | case IP_XFRM_POLICY: |
851 | err = -EPERM; | ||
852 | if (!capable(CAP_NET_ADMIN)) | ||
853 | break; | ||
851 | err = xfrm_user_policy(sk, optname, optval, optlen); | 854 | err = xfrm_user_policy(sk, optname, optval, optlen); |
852 | break; | 855 | break; |
853 | 856 | ||
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c index bc59d0d6e89e..91d5ea1dbbc9 100644 --- a/net/ipv4/netfilter/ip_nat_standalone.c +++ b/net/ipv4/netfilter/ip_nat_standalone.c | |||
@@ -102,6 +102,10 @@ ip_nat_fn(unsigned int hooknum, | |||
102 | return NF_ACCEPT; | 102 | return NF_ACCEPT; |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Don't try to NAT if this packet is not conntracked */ | ||
106 | if (ct == &ip_conntrack_untracked) | ||
107 | return NF_ACCEPT; | ||
108 | |||
105 | switch (ctinfo) { | 109 | switch (ctinfo) { |
106 | case IP_CT_RELATED: | 110 | case IP_CT_RELATED: |
107 | case IP_CT_RELATED+IP_CT_IS_REPLY: | 111 | case IP_CT_RELATED+IP_CT_IS_REPLY: |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 62f62bb05c2a..5d91213d34c0 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1494,12 +1494,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1494 | * to destinations, already remembered | 1494 | * to destinations, already remembered |
1495 | * to the moment of synflood. | 1495 | * to the moment of synflood. |
1496 | */ | 1496 | */ |
1497 | NETDEBUG(if (net_ratelimit()) \ | 1497 | LIMIT_NETDEBUG(printk(KERN_DEBUG "TCP: drop open " |
1498 | printk(KERN_DEBUG "TCP: drop open " | 1498 | "request from %u.%u." |
1499 | "request from %u.%u." | 1499 | "%u.%u/%u\n", |
1500 | "%u.%u/%u\n", \ | 1500 | NIPQUAD(saddr), |
1501 | NIPQUAD(saddr), | 1501 | ntohs(skb->h.th->source))); |
1502 | ntohs(skb->h.th->source))); | ||
1503 | dst_release(dst); | 1502 | dst_release(dst); |
1504 | goto drop_and_free; | 1503 | goto drop_and_free; |
1505 | } | 1504 | } |
@@ -1627,8 +1626,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb) | |||
1627 | skb->nh.iph->daddr, skb->csum)) | 1626 | skb->nh.iph->daddr, skb->csum)) |
1628 | return 0; | 1627 | return 0; |
1629 | 1628 | ||
1630 | NETDEBUG(if (net_ratelimit()) | 1629 | LIMIT_NETDEBUG(printk(KERN_DEBUG "hw tcp v4 csum failed\n")); |
1631 | printk(KERN_DEBUG "hw tcp v4 csum failed\n")); | ||
1632 | skb->ip_summed = CHECKSUM_NONE; | 1630 | skb->ip_summed = CHECKSUM_NONE; |
1633 | } | 1631 | } |
1634 | if (skb->len <= 76) { | 1632 | if (skb->len <= 76) { |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e3f8ea1bfa9c..7d076f0db100 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -403,11 +403,9 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
403 | sk->sk_send_head = skb; | 403 | sk->sk_send_head = skb; |
404 | } | 404 | } |
405 | 405 | ||
406 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | 406 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
407 | { | 407 | { |
408 | struct tcp_sock *tp = tcp_sk(sk); | 408 | if (skb->len <= mss_now || |
409 | |||
410 | if (skb->len <= tp->mss_cache || | ||
411 | !(sk->sk_route_caps & NETIF_F_TSO)) { | 409 | !(sk->sk_route_caps & NETIF_F_TSO)) { |
412 | /* Avoid the costly divide in the normal | 410 | /* Avoid the costly divide in the normal |
413 | * non-TSO case. | 411 | * non-TSO case. |
@@ -417,10 +415,10 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | |||
417 | } else { | 415 | } else { |
418 | unsigned int factor; | 416 | unsigned int factor; |
419 | 417 | ||
420 | factor = skb->len + (tp->mss_cache - 1); | 418 | factor = skb->len + (mss_now - 1); |
421 | factor /= tp->mss_cache; | 419 | factor /= mss_now; |
422 | skb_shinfo(skb)->tso_segs = factor; | 420 | skb_shinfo(skb)->tso_segs = factor; |
423 | skb_shinfo(skb)->tso_size = tp->mss_cache; | 421 | skb_shinfo(skb)->tso_size = mss_now; |
424 | } | 422 | } |
425 | } | 423 | } |
426 | 424 | ||
@@ -429,7 +427,7 @@ static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb) | |||
429 | * packet to the list. This won't be called frequently, I hope. | 427 | * packet to the list. This won't be called frequently, I hope. |
430 | * Remember, these are still headerless SKBs at this point. | 428 | * Remember, these are still headerless SKBs at this point. |
431 | */ | 429 | */ |
432 | static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) | 430 | static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss_now) |
433 | { | 431 | { |
434 | struct tcp_sock *tp = tcp_sk(sk); | 432 | struct tcp_sock *tp = tcp_sk(sk); |
435 | struct sk_buff *buff; | 433 | struct sk_buff *buff; |
@@ -492,8 +490,8 @@ static int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len) | |||
492 | } | 490 | } |
493 | 491 | ||
494 | /* Fix up tso_factor for both original and new SKB. */ | 492 | /* Fix up tso_factor for both original and new SKB. */ |
495 | tcp_set_skb_tso_segs(sk, skb); | 493 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
496 | tcp_set_skb_tso_segs(sk, buff); | 494 | tcp_set_skb_tso_segs(sk, buff, mss_now); |
497 | 495 | ||
498 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { | 496 | if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { |
499 | tp->lost_out += tcp_skb_pcount(skb); | 497 | tp->lost_out += tcp_skb_pcount(skb); |
@@ -569,7 +567,7 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | |||
569 | * factor and mss. | 567 | * factor and mss. |
570 | */ | 568 | */ |
571 | if (tcp_skb_pcount(skb) > 1) | 569 | if (tcp_skb_pcount(skb) > 1) |
572 | tcp_set_skb_tso_segs(sk, skb); | 570 | tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk, 1)); |
573 | 571 | ||
574 | return 0; | 572 | return 0; |
575 | } | 573 | } |
@@ -734,12 +732,14 @@ static inline unsigned int tcp_cwnd_test(struct tcp_sock *tp, struct sk_buff *sk | |||
734 | /* This must be invoked the first time we consider transmitting | 732 | /* This must be invoked the first time we consider transmitting |
735 | * SKB onto the wire. | 733 | * SKB onto the wire. |
736 | */ | 734 | */ |
737 | static inline int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb) | 735 | static inline int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now) |
738 | { | 736 | { |
739 | int tso_segs = tcp_skb_pcount(skb); | 737 | int tso_segs = tcp_skb_pcount(skb); |
740 | 738 | ||
741 | if (!tso_segs) { | 739 | if (!tso_segs || |
742 | tcp_set_skb_tso_segs(sk, skb); | 740 | (tso_segs > 1 && |
741 | skb_shinfo(skb)->tso_size != mss_now)) { | ||
742 | tcp_set_skb_tso_segs(sk, skb, mss_now); | ||
743 | tso_segs = tcp_skb_pcount(skb); | 743 | tso_segs = tcp_skb_pcount(skb); |
744 | } | 744 | } |
745 | return tso_segs; | 745 | return tso_segs; |
@@ -817,7 +817,7 @@ static unsigned int tcp_snd_test(struct sock *sk, struct sk_buff *skb, | |||
817 | struct tcp_sock *tp = tcp_sk(sk); | 817 | struct tcp_sock *tp = tcp_sk(sk); |
818 | unsigned int cwnd_quota; | 818 | unsigned int cwnd_quota; |
819 | 819 | ||
820 | tcp_init_tso_segs(sk, skb); | 820 | tcp_init_tso_segs(sk, skb, cur_mss); |
821 | 821 | ||
822 | if (!tcp_nagle_test(tp, skb, cur_mss, nonagle)) | 822 | if (!tcp_nagle_test(tp, skb, cur_mss, nonagle)) |
823 | return 0; | 823 | return 0; |
@@ -854,7 +854,7 @@ int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp) | |||
854 | * know that all the data is in scatter-gather pages, and that the | 854 | * know that all the data is in scatter-gather pages, and that the |
855 | * packet has never been sent out before (and thus is not cloned). | 855 | * packet has never been sent out before (and thus is not cloned). |
856 | */ | 856 | */ |
857 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len) | 857 | static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, unsigned int mss_now) |
858 | { | 858 | { |
859 | struct sk_buff *buff; | 859 | struct sk_buff *buff; |
860 | int nlen = skb->len - len; | 860 | int nlen = skb->len - len; |
@@ -887,8 +887,8 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len) | |||
887 | skb_split(skb, buff, len); | 887 | skb_split(skb, buff, len); |
888 | 888 | ||
889 | /* Fix up tso_factor for both original and new SKB. */ | 889 | /* Fix up tso_factor for both original and new SKB. */ |
890 | tcp_set_skb_tso_segs(sk, skb); | 890 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
891 | tcp_set_skb_tso_segs(sk, buff); | 891 | tcp_set_skb_tso_segs(sk, buff, mss_now); |
892 | 892 | ||
893 | /* Link BUFF into the send queue. */ | 893 | /* Link BUFF into the send queue. */ |
894 | skb_header_release(buff); | 894 | skb_header_release(buff); |
@@ -972,19 +972,18 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
972 | if (unlikely(sk->sk_state == TCP_CLOSE)) | 972 | if (unlikely(sk->sk_state == TCP_CLOSE)) |
973 | return 0; | 973 | return 0; |
974 | 974 | ||
975 | skb = sk->sk_send_head; | ||
976 | if (unlikely(!skb)) | ||
977 | return 0; | ||
978 | |||
979 | tso_segs = tcp_init_tso_segs(sk, skb); | ||
980 | cwnd_quota = tcp_cwnd_test(tp, skb); | ||
981 | if (unlikely(!cwnd_quota)) | ||
982 | goto out; | ||
983 | |||
984 | sent_pkts = 0; | 975 | sent_pkts = 0; |
985 | while (likely(tcp_snd_wnd_test(tp, skb, mss_now))) { | 976 | while ((skb = sk->sk_send_head)) { |
977 | tso_segs = tcp_init_tso_segs(sk, skb, mss_now); | ||
986 | BUG_ON(!tso_segs); | 978 | BUG_ON(!tso_segs); |
987 | 979 | ||
980 | cwnd_quota = tcp_cwnd_test(tp, skb); | ||
981 | if (!cwnd_quota) | ||
982 | break; | ||
983 | |||
984 | if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) | ||
985 | break; | ||
986 | |||
988 | if (tso_segs == 1) { | 987 | if (tso_segs == 1) { |
989 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, | 988 | if (unlikely(!tcp_nagle_test(tp, skb, mss_now, |
990 | (tcp_skb_is_last(sk, skb) ? | 989 | (tcp_skb_is_last(sk, skb) ? |
@@ -1006,11 +1005,11 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
1006 | limit = skb->len - trim; | 1005 | limit = skb->len - trim; |
1007 | } | 1006 | } |
1008 | if (skb->len > limit) { | 1007 | if (skb->len > limit) { |
1009 | if (tso_fragment(sk, skb, limit)) | 1008 | if (tso_fragment(sk, skb, limit, mss_now)) |
1010 | break; | 1009 | break; |
1011 | } | 1010 | } |
1012 | } else if (unlikely(skb->len > mss_now)) { | 1011 | } else if (unlikely(skb->len > mss_now)) { |
1013 | if (unlikely(tcp_fragment(sk, skb, mss_now))) | 1012 | if (unlikely(tcp_fragment(sk, skb, mss_now, mss_now))) |
1014 | break; | 1013 | break; |
1015 | } | 1014 | } |
1016 | 1015 | ||
@@ -1026,27 +1025,12 @@ static int tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle) | |||
1026 | 1025 | ||
1027 | tcp_minshall_update(tp, mss_now, skb); | 1026 | tcp_minshall_update(tp, mss_now, skb); |
1028 | sent_pkts++; | 1027 | sent_pkts++; |
1029 | |||
1030 | /* Do not optimize this to use tso_segs. If we chopped up | ||
1031 | * the packet above, tso_segs will no longer be valid. | ||
1032 | */ | ||
1033 | cwnd_quota -= tcp_skb_pcount(skb); | ||
1034 | |||
1035 | BUG_ON(cwnd_quota < 0); | ||
1036 | if (!cwnd_quota) | ||
1037 | break; | ||
1038 | |||
1039 | skb = sk->sk_send_head; | ||
1040 | if (!skb) | ||
1041 | break; | ||
1042 | tso_segs = tcp_init_tso_segs(sk, skb); | ||
1043 | } | 1028 | } |
1044 | 1029 | ||
1045 | if (likely(sent_pkts)) { | 1030 | if (likely(sent_pkts)) { |
1046 | tcp_cwnd_validate(sk, tp); | 1031 | tcp_cwnd_validate(sk, tp); |
1047 | return 0; | 1032 | return 0; |
1048 | } | 1033 | } |
1049 | out: | ||
1050 | return !tp->packets_out && sk->sk_send_head; | 1034 | return !tp->packets_out && sk->sk_send_head; |
1051 | } | 1035 | } |
1052 | 1036 | ||
@@ -1076,7 +1060,7 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) | |||
1076 | 1060 | ||
1077 | BUG_ON(!skb || skb->len < mss_now); | 1061 | BUG_ON(!skb || skb->len < mss_now); |
1078 | 1062 | ||
1079 | tso_segs = tcp_init_tso_segs(sk, skb); | 1063 | tso_segs = tcp_init_tso_segs(sk, skb, mss_now); |
1080 | cwnd_quota = tcp_snd_test(sk, skb, mss_now, TCP_NAGLE_PUSH); | 1064 | cwnd_quota = tcp_snd_test(sk, skb, mss_now, TCP_NAGLE_PUSH); |
1081 | 1065 | ||
1082 | if (likely(cwnd_quota)) { | 1066 | if (likely(cwnd_quota)) { |
@@ -1093,11 +1077,11 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) | |||
1093 | limit = skb->len - trim; | 1077 | limit = skb->len - trim; |
1094 | } | 1078 | } |
1095 | if (skb->len > limit) { | 1079 | if (skb->len > limit) { |
1096 | if (unlikely(tso_fragment(sk, skb, limit))) | 1080 | if (unlikely(tso_fragment(sk, skb, limit, mss_now))) |
1097 | return; | 1081 | return; |
1098 | } | 1082 | } |
1099 | } else if (unlikely(skb->len > mss_now)) { | 1083 | } else if (unlikely(skb->len > mss_now)) { |
1100 | if (unlikely(tcp_fragment(sk, skb, mss_now))) | 1084 | if (unlikely(tcp_fragment(sk, skb, mss_now, mss_now))) |
1101 | return; | 1085 | return; |
1102 | } | 1086 | } |
1103 | 1087 | ||
@@ -1388,7 +1372,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
1388 | int old_factor = tcp_skb_pcount(skb); | 1372 | int old_factor = tcp_skb_pcount(skb); |
1389 | int new_factor; | 1373 | int new_factor; |
1390 | 1374 | ||
1391 | if (tcp_fragment(sk, skb, cur_mss)) | 1375 | if (tcp_fragment(sk, skb, cur_mss, cur_mss)) |
1392 | return -ENOMEM; /* We'll try again later. */ | 1376 | return -ENOMEM; /* We'll try again later. */ |
1393 | 1377 | ||
1394 | /* New SKB created, account for it. */ | 1378 | /* New SKB created, account for it. */ |
@@ -1991,7 +1975,7 @@ int tcp_write_wakeup(struct sock *sk) | |||
1991 | skb->len > mss) { | 1975 | skb->len > mss) { |
1992 | seg_size = min(seg_size, mss); | 1976 | seg_size = min(seg_size, mss); |
1993 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 1977 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; |
1994 | if (tcp_fragment(sk, skb, seg_size)) | 1978 | if (tcp_fragment(sk, skb, seg_size, mss)) |
1995 | return -1; | 1979 | return -1; |
1996 | /* SWS override triggered forced fragmentation. | 1980 | /* SWS override triggered forced fragmentation. |
1997 | * Disable TSO, the connection is too sick. */ | 1981 | * Disable TSO, the connection is too sick. */ |
@@ -2000,7 +1984,7 @@ int tcp_write_wakeup(struct sock *sk) | |||
2000 | sk->sk_route_caps &= ~NETIF_F_TSO; | 1984 | sk->sk_route_caps &= ~NETIF_F_TSO; |
2001 | } | 1985 | } |
2002 | } else if (!tcp_skb_pcount(skb)) | 1986 | } else if (!tcp_skb_pcount(skb)) |
2003 | tcp_set_skb_tso_segs(sk, skb); | 1987 | tcp_set_skb_tso_segs(sk, skb, mss); |
2004 | 1988 | ||
2005 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; | 1989 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH; |
2006 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 1990 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 7c24e64b443f..dc4d07357e3a 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -628,7 +628,7 @@ back_from_confirm: | |||
628 | /* ... which is an evident application bug. --ANK */ | 628 | /* ... which is an evident application bug. --ANK */ |
629 | release_sock(sk); | 629 | release_sock(sk); |
630 | 630 | ||
631 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 2\n")); | 631 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 2\n")); |
632 | err = -EINVAL; | 632 | err = -EINVAL; |
633 | goto out; | 633 | goto out; |
634 | } | 634 | } |
@@ -693,7 +693,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset, | |||
693 | if (unlikely(!up->pending)) { | 693 | if (unlikely(!up->pending)) { |
694 | release_sock(sk); | 694 | release_sock(sk); |
695 | 695 | ||
696 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp cork app bug 3\n")); | 696 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp cork app bug 3\n")); |
697 | return -EINVAL; | 697 | return -EINVAL; |
698 | } | 698 | } |
699 | 699 | ||
@@ -1102,7 +1102,7 @@ static int udp_checksum_init(struct sk_buff *skb, struct udphdr *uh, | |||
1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1102 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) | 1103 | if (!udp_check(uh, ulen, saddr, daddr, skb->csum)) |
1104 | return 0; | 1104 | return 0; |
1105 | NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "udp v4 hw csum failure.\n")); | 1105 | LIMIT_NETDEBUG(printk(KERN_DEBUG "udp v4 hw csum failure.\n")); |
1106 | skb->ip_summed = CHECKSUM_NONE; | 1106 | skb->ip_summed = CHECKSUM_NONE; |
1107 | } | 1107 | } |
1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) | 1108 | if (skb->ip_summed != CHECKSUM_UNNECESSARY) |
@@ -1181,14 +1181,13 @@ int udp_rcv(struct sk_buff *skb) | |||
1181 | return(0); | 1181 | return(0); |
1182 | 1182 | ||
1183 | short_packet: | 1183 | short_packet: |
1184 | NETDEBUG(if (net_ratelimit()) | 1184 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", |
1185 | printk(KERN_DEBUG "UDP: short packet: From %u.%u.%u.%u:%u %d/%d to %u.%u.%u.%u:%u\n", | 1185 | NIPQUAD(saddr), |
1186 | NIPQUAD(saddr), | 1186 | ntohs(uh->source), |
1187 | ntohs(uh->source), | 1187 | ulen, |
1188 | ulen, | 1188 | len, |
1189 | len, | 1189 | NIPQUAD(daddr), |
1190 | NIPQUAD(daddr), | 1190 | ntohs(uh->dest))); |
1191 | ntohs(uh->dest))); | ||
1192 | no_header: | 1191 | no_header: |
1193 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1192 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1194 | kfree_skb(skb); | 1193 | kfree_skb(skb); |
@@ -1199,13 +1198,12 @@ csum_error: | |||
1199 | * RFC1122: OK. Discards the bad packet silently (as far as | 1198 | * RFC1122: OK. Discards the bad packet silently (as far as |
1200 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). | 1199 | * the network is concerned, anyway) as per 4.1.3.4 (MUST). |
1201 | */ | 1200 | */ |
1202 | NETDEBUG(if (net_ratelimit()) | 1201 | LIMIT_NETDEBUG(printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", |
1203 | printk(KERN_DEBUG "UDP: bad checksum. From %d.%d.%d.%d:%d to %d.%d.%d.%d:%d ulen %d\n", | 1202 | NIPQUAD(saddr), |
1204 | NIPQUAD(saddr), | 1203 | ntohs(uh->source), |
1205 | ntohs(uh->source), | 1204 | NIPQUAD(daddr), |
1206 | NIPQUAD(daddr), | 1205 | ntohs(uh->dest), |
1207 | ntohs(uh->dest), | 1206 | ulen)); |
1208 | ulen)); | ||
1209 | drop: | 1207 | drop: |
1210 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); | 1208 | UDP_INC_STATS_BH(UDP_MIB_INERRORS); |
1211 | kfree_skb(skb); | 1209 | kfree_skb(skb); |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index f3ef4c38d315..3bc144a79fa5 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -504,6 +504,9 @@ done: | |||
504 | break; | 504 | break; |
505 | case IPV6_IPSEC_POLICY: | 505 | case IPV6_IPSEC_POLICY: |
506 | case IPV6_XFRM_POLICY: | 506 | case IPV6_XFRM_POLICY: |
507 | retv = -EPERM; | ||
508 | if (!capable(CAP_NET_ADMIN)) | ||
509 | break; | ||
507 | retv = xfrm_user_policy(sk, optname, optval, optlen); | 510 | retv = xfrm_user_policy(sk, optname, optval, optlen); |
508 | break; | 511 | break; |
509 | 512 | ||
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 56db8f13e6cb..d0c3120d0233 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -586,7 +586,7 @@ svc_udp_recvfrom(struct svc_rqst *rqstp) | |||
586 | } | 586 | } |
587 | if (skb->stamp.tv_sec == 0) { | 587 | if (skb->stamp.tv_sec == 0) { |
588 | skb->stamp.tv_sec = xtime.tv_sec; | 588 | skb->stamp.tv_sec = xtime.tv_sec; |
589 | skb->stamp.tv_usec = xtime.tv_nsec * 1000; | 589 | skb->stamp.tv_usec = xtime.tv_nsec / NSEC_PER_USEC; |
590 | /* Don't enable netstamp, sunrpc doesn't | 590 | /* Don't enable netstamp, sunrpc doesn't |
591 | need that much accuracy */ | 591 | need that much accuracy */ |
592 | } | 592 | } |