diff options
567 files changed, 8078 insertions, 5857 deletions
@@ -96,4 +96,6 @@ Tejun Heo <htejun@gmail.com> | |||
96 | Thomas Graf <tgraf@suug.ch> | 96 | Thomas Graf <tgraf@suug.ch> |
97 | Tony Luck <tony.luck@intel.com> | 97 | Tony Luck <tony.luck@intel.com> |
98 | Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com> | 98 | Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com> |
99 | Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com> | ||
100 | Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> | ||
99 | Valdis Kletnieks <Valdis.Kletnieks@vt.edu> | 101 | Valdis Kletnieks <Valdis.Kletnieks@vt.edu> |
diff --git a/Documentation/ABI/testing/sysfs-firmware-sgi_uv b/Documentation/ABI/testing/sysfs-firmware-sgi_uv new file mode 100644 index 000000000000..4573fd4b7876 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-firmware-sgi_uv | |||
@@ -0,0 +1,27 @@ | |||
1 | What: /sys/firmware/sgi_uv/ | ||
2 | Date: August 2008 | ||
3 | Contact: Russ Anderson <rja@sgi.com> | ||
4 | Description: | ||
5 | The /sys/firmware/sgi_uv directory contains information | ||
6 | about the SGI UV platform. | ||
7 | |||
8 | Under that directory are a number of files: | ||
9 | |||
10 | partition_id | ||
11 | coherence_id | ||
12 | |||
13 | The partition_id entry contains the partition id. | ||
14 | SGI UV systems can be partitioned into multiple physical | ||
15 | machines, which each partition running a unique copy | ||
16 | of the operating system. Each partition will have a unique | ||
17 | partition id. To display the partition id, use the command: | ||
18 | |||
19 | cat /sys/firmware/sgi_uv/partition_id | ||
20 | |||
21 | The coherence_id entry contains the coherence id. | ||
22 | A partitioned SGI UV system can have one or more coherence | ||
23 | domain. The coherence id indicates which coherence domain | ||
24 | this partition is in. To display the coherence id, use the | ||
25 | command: | ||
26 | |||
27 | cat /sys/firmware/sgi_uv/coherence_id | ||
diff --git a/Documentation/ABI/testing/sysfs-gpio b/Documentation/ABI/testing/sysfs-gpio new file mode 100644 index 000000000000..8aab8092ad35 --- /dev/null +++ b/Documentation/ABI/testing/sysfs-gpio | |||
@@ -0,0 +1,26 @@ | |||
1 | What: /sys/class/gpio/ | ||
2 | Date: July 2008 | ||
3 | KernelVersion: 2.6.27 | ||
4 | Contact: David Brownell <dbrownell@users.sourceforge.net> | ||
5 | Description: | ||
6 | |||
7 | As a Kconfig option, individual GPIO signals may be accessed from | ||
8 | userspace. GPIOs are only made available to userspace by an explicit | ||
9 | "export" operation. If a given GPIO is not claimed for use by | ||
10 | kernel code, it may be exported by userspace (and unexported later). | ||
11 | Kernel code may export it for complete or partial access. | ||
12 | |||
13 | GPIOs are identified as they are inside the kernel, using integers in | ||
14 | the range 0..INT_MAX. See Documentation/gpio.txt for more information. | ||
15 | |||
16 | /sys/class/gpio | ||
17 | /export ... asks the kernel to export a GPIO to userspace | ||
18 | /unexport ... to return a GPIO to the kernel | ||
19 | /gpioN ... for each exported GPIO #N | ||
20 | /value ... always readable, writes fail for input GPIOs | ||
21 | /direction ... r/w as: in, out (default low); write: high, low | ||
22 | /gpiochipN ... for each gpiochip; #N is its first GPIO | ||
23 | /base ... (r/o) same as N | ||
24 | /label ... (r/o) descriptive, not necessarily unique | ||
25 | /ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1) | ||
26 | |||
diff --git a/Documentation/cpusets.txt b/Documentation/cpusets.txt index 1f5a924d1e56..47e568a9370a 100644 --- a/Documentation/cpusets.txt +++ b/Documentation/cpusets.txt | |||
@@ -635,14 +635,16 @@ prior 'mems' setting, will not be moved. | |||
635 | 635 | ||
636 | There is an exception to the above. If hotplug functionality is used | 636 | There is an exception to the above. If hotplug functionality is used |
637 | to remove all the CPUs that are currently assigned to a cpuset, | 637 | to remove all the CPUs that are currently assigned to a cpuset, |
638 | then the kernel will automatically update the cpus_allowed of all | 638 | then all the tasks in that cpuset will be moved to the nearest ancestor |
639 | tasks attached to CPUs in that cpuset to allow all CPUs. When memory | 639 | with non-empty cpus. But the moving of some (or all) tasks might fail if |
640 | hotplug functionality for removing Memory Nodes is available, a | 640 | cpuset is bound with another cgroup subsystem which has some restrictions |
641 | similar exception is expected to apply there as well. In general, | 641 | on task attaching. In this failing case, those tasks will stay |
642 | the kernel prefers to violate cpuset placement, over starving a task | 642 | in the original cpuset, and the kernel will automatically update |
643 | that has had all its allowed CPUs or Memory Nodes taken offline. User | 643 | their cpus_allowed to allow all online CPUs. When memory hotplug |
644 | code should reconfigure cpusets to only refer to online CPUs and Memory | 644 | functionality for removing Memory Nodes is available, a similar exception |
645 | Nodes when using hotplug to add or remove such resources. | 645 | is expected to apply there as well. In general, the kernel prefers to |
646 | violate cpuset placement, over starving a task that has had all | ||
647 | its allowed CPUs or Memory Nodes taken offline. | ||
646 | 648 | ||
647 | There is a second exception to the above. GFP_ATOMIC requests are | 649 | There is a second exception to the above. GFP_ATOMIC requests are |
648 | kernel internal allocations that must be satisfied, immediately. | 650 | kernel internal allocations that must be satisfied, immediately. |
diff --git a/Documentation/dontdiff b/Documentation/dontdiff index 881e6dd03aea..27809357da58 100644 --- a/Documentation/dontdiff +++ b/Documentation/dontdiff | |||
@@ -5,6 +5,8 @@ | |||
5 | *.css | 5 | *.css |
6 | *.dvi | 6 | *.dvi |
7 | *.eps | 7 | *.eps |
8 | *.fw.gen.S | ||
9 | *.fw | ||
8 | *.gif | 10 | *.gif |
9 | *.grep | 11 | *.grep |
10 | *.grp | 12 | *.grp |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index eb1a47b97427..83c88cae1eda 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -322,3 +322,11 @@ Why: Accounting can now be enabled/disabled without kernel recompilation. | |||
322 | controlled by a kernel/module/sysfs/sysctl parameter. | 322 | controlled by a kernel/module/sysfs/sysctl parameter. |
323 | Who: Krzysztof Piotr Oledzki <ole@ans.pl> | 323 | Who: Krzysztof Piotr Oledzki <ole@ans.pl> |
324 | 324 | ||
325 | --------------------------- | ||
326 | |||
327 | What: ide-scsi (BLK_DEV_IDESCSI) | ||
328 | When: 2.6.29 | ||
329 | Why: The 2.6 kernel supports direct writing to ide CD drives, which | ||
330 | eliminates the need for ide-scsi. The new method is more | ||
331 | efficient in every way. | ||
332 | Who: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | ||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 680fb566b928..8362860e21a7 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -144,8 +144,8 @@ prototypes: | |||
144 | void (*kill_sb) (struct super_block *); | 144 | void (*kill_sb) (struct super_block *); |
145 | locking rules: | 145 | locking rules: |
146 | may block BKL | 146 | may block BKL |
147 | get_sb yes yes | 147 | get_sb yes no |
148 | kill_sb yes yes | 148 | kill_sb yes no |
149 | 149 | ||
150 | ->get_sb() returns error or 0 with locked superblock attached to the vfsmount | 150 | ->get_sb() returns error or 0 with locked superblock attached to the vfsmount |
151 | (exclusive on ->s_umount). | 151 | (exclusive on ->s_umount). |
@@ -409,12 +409,12 @@ ioctl: yes (see below) | |||
409 | unlocked_ioctl: no (see below) | 409 | unlocked_ioctl: no (see below) |
410 | compat_ioctl: no | 410 | compat_ioctl: no |
411 | mmap: no | 411 | mmap: no |
412 | open: maybe (see below) | 412 | open: no |
413 | flush: no | 413 | flush: no |
414 | release: no | 414 | release: no |
415 | fsync: no (see below) | 415 | fsync: no (see below) |
416 | aio_fsync: no | 416 | aio_fsync: no |
417 | fasync: yes (see below) | 417 | fasync: no |
418 | lock: yes | 418 | lock: yes |
419 | readv: no | 419 | readv: no |
420 | writev: no | 420 | writev: no |
@@ -431,13 +431,6 @@ For many filesystems, it is probably safe to acquire the inode | |||
431 | semaphore. Note some filesystems (i.e. remote ones) provide no | 431 | semaphore. Note some filesystems (i.e. remote ones) provide no |
432 | protection for i_size so you will need to use the BKL. | 432 | protection for i_size so you will need to use the BKL. |
433 | 433 | ||
434 | ->open() locking is in-transit: big lock partially moved into the methods. | ||
435 | The only exception is ->open() in the instances of file_operations that never | ||
436 | end up in ->i_fop/->proc_fops, i.e. ones that belong to character devices | ||
437 | (chrdev_open() takes lock before replacing ->f_op and calling the secondary | ||
438 | method. As soon as we fix the handling of module reference counters all | ||
439 | instances of ->open() will be called without the BKL. | ||
440 | |||
441 | Note: ext2_release() was *the* source of contention on fs-intensive | 434 | Note: ext2_release() was *the* source of contention on fs-intensive |
442 | loads and dropping BKL on ->release() helps to get rid of that (we still | 435 | loads and dropping BKL on ->release() helps to get rid of that (we still |
443 | grab BKL for cases when we close a file that had been opened r/w, but that | 436 | grab BKL for cases when we close a file that had been opened r/w, but that |
diff --git a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt index e79ee2db183a..ac2a261c5f7d 100644 --- a/Documentation/filesystems/ntfs.txt +++ b/Documentation/filesystems/ntfs.txt | |||
@@ -40,7 +40,7 @@ Web site | |||
40 | ======== | 40 | ======== |
41 | 41 | ||
42 | There is plenty of additional information on the linux-ntfs web site | 42 | There is plenty of additional information on the linux-ntfs web site |
43 | at http://linux-ntfs.sourceforge.net/ | 43 | at http://www.linux-ntfs.org/ |
44 | 44 | ||
45 | The web site has a lot of additional information, such as a comprehensive | 45 | The web site has a lot of additional information, such as a comprehensive |
46 | FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS | 46 | FAQ, documentation on the NTFS on-disk format, information on the Linux-NTFS |
@@ -272,7 +272,7 @@ And you would know that /dev/hda2 has a size of 37768814 - 4209030 + 1 = | |||
272 | For Win2k and later dynamic disks, you can for example use the ldminfo utility | 272 | For Win2k and later dynamic disks, you can for example use the ldminfo utility |
273 | which is part of the Linux LDM tools (the latest version at the time of | 273 | which is part of the Linux LDM tools (the latest version at the time of |
274 | writing is linux-ldm-0.0.8.tar.bz2). You can download it from: | 274 | writing is linux-ldm-0.0.8.tar.bz2). You can download it from: |
275 | http://linux-ntfs.sourceforge.net/downloads.html | 275 | http://www.linux-ntfs.org/ |
276 | Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go | 276 | Simply extract the downloaded archive (tar xvjf linux-ldm-0.0.8.tar.bz2), go |
277 | into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You | 277 | into it (cd linux-ldm-0.0.8) and change to the test directory (cd test). You |
278 | will find the precompiled (i386) ldminfo utility there. NOTE: You will not be | 278 | will find the precompiled (i386) ldminfo utility there. NOTE: You will not be |
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 64557821ee59..f566ad9bcb7b 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -1339,6 +1339,25 @@ Enables/Disables the protection of the per-process proc entries "maps" and | |||
1339 | "smaps". When enabled, the contents of these files are visible only to | 1339 | "smaps". When enabled, the contents of these files are visible only to |
1340 | readers that are allowed to ptrace() the given process. | 1340 | readers that are allowed to ptrace() the given process. |
1341 | 1341 | ||
1342 | msgmni | ||
1343 | ------ | ||
1344 | |||
1345 | Maximum number of message queue ids on the system. | ||
1346 | This value scales to the amount of lowmem. It is automatically recomputed | ||
1347 | upon memory add/remove or ipc namespace creation/removal. | ||
1348 | When a value is written into this file, msgmni's value becomes fixed, i.e. it | ||
1349 | is not recomputed anymore when one of the above events occurs. | ||
1350 | Use auto_msgmni to change this behavior. | ||
1351 | |||
1352 | auto_msgmni | ||
1353 | ----------- | ||
1354 | |||
1355 | Enables/Disables automatic recomputing of msgmni upon memory add/remove or | ||
1356 | upon ipc namespace creation/removal (see the msgmni description above). | ||
1357 | Echoing "1" into this file enables msgmni automatic recomputing. | ||
1358 | Echoing "0" turns it off. | ||
1359 | auto_msgmni default value is 1. | ||
1360 | |||
1342 | 1361 | ||
1343 | 2.4 /proc/sys/vm - The virtual memory subsystem | 1362 | 2.4 /proc/sys/vm - The virtual memory subsystem |
1344 | ----------------------------------------------- | 1363 | ----------------------------------------------- |
@@ -2394,6 +2413,8 @@ The following 4 memory types are supported: | |||
2394 | - (bit 1) anonymous shared memory | 2413 | - (bit 1) anonymous shared memory |
2395 | - (bit 2) file-backed private memory | 2414 | - (bit 2) file-backed private memory |
2396 | - (bit 3) file-backed shared memory | 2415 | - (bit 3) file-backed shared memory |
2416 | - (bit 4) ELF header pages in file-backed private memory areas (it is | ||
2417 | effective only if the bit 2 is cleared) | ||
2397 | 2418 | ||
2398 | Note that MMIO pages such as frame buffer are never dumped and vDSO pages | 2419 | Note that MMIO pages such as frame buffer are never dumped and vDSO pages |
2399 | are always dumped regardless of the bitmask status. | 2420 | are always dumped regardless of the bitmask status. |
diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index 02dc748b76c4..71f0fe1fc1b0 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt | |||
@@ -44,7 +44,7 @@ detailed description): | |||
44 | - LCD brightness control | 44 | - LCD brightness control |
45 | - Volume control | 45 | - Volume control |
46 | - Fan control and monitoring: fan speed, fan enable/disable | 46 | - Fan control and monitoring: fan speed, fan enable/disable |
47 | - Experimental: WAN enable and disable | 47 | - WAN enable and disable |
48 | 48 | ||
49 | A compatibility table by model and feature is maintained on the web | 49 | A compatibility table by model and feature is maintained on the web |
50 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure | 50 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure |
@@ -1375,18 +1375,13 @@ with EINVAL, try to set pwm1_enable to 1 and pwm1 to at least 128 (255 | |||
1375 | would be the safest choice, though). | 1375 | would be the safest choice, though). |
1376 | 1376 | ||
1377 | 1377 | ||
1378 | EXPERIMENTAL: WAN | 1378 | WAN |
1379 | ----------------- | 1379 | --- |
1380 | 1380 | ||
1381 | procfs: /proc/acpi/ibm/wan | 1381 | procfs: /proc/acpi/ibm/wan |
1382 | sysfs device attribute: wwan_enable (deprecated) | 1382 | sysfs device attribute: wwan_enable (deprecated) |
1383 | sysfs rfkill class: switch "tpacpi_wwan_sw" | 1383 | sysfs rfkill class: switch "tpacpi_wwan_sw" |
1384 | 1384 | ||
1385 | This feature is marked EXPERIMENTAL because the implementation | ||
1386 | directly accesses hardware registers and may not work as expected. USE | ||
1387 | WITH CAUTION! To use this feature, you need to supply the | ||
1388 | experimental=1 parameter when loading the module. | ||
1389 | |||
1390 | This feature shows the presence and current state of a W-WAN (Sierra | 1385 | This feature shows the presence and current state of a W-WAN (Sierra |
1391 | Wireless EV-DO) device. | 1386 | Wireless EV-DO) device. |
1392 | 1387 | ||
diff --git a/Documentation/video4linux/CARDLIST.au0828 b/Documentation/video4linux/CARDLIST.au0828 index eedc399e8deb..aa05e5bb22fb 100644 --- a/Documentation/video4linux/CARDLIST.au0828 +++ b/Documentation/video4linux/CARDLIST.au0828 | |||
@@ -3,3 +3,4 @@ | |||
3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] | 3 | 2 -> Hauppauge HVR850 (au0828) [2040:7240] |
4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] | 4 | 3 -> DViCO FusionHDTV USB (au0828) [0fe9:d620] |
5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] | 5 | 4 -> Hauppauge HVR950Q rev xxF8 (au0828) [2040:7201,2040:7211,2040:7281] |
6 | 5 -> Hauppauge Woodbury (au0828) [2040:8200] | ||
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 78a863ab8a5a..0f03900c48fb 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -88,14 +88,14 @@ zc3xx 0471:0325 Philips SPC 200 NC | |||
88 | zc3xx 0471:0326 Philips SPC 300 NC | 88 | zc3xx 0471:0326 Philips SPC 300 NC |
89 | sonixj 0471:0327 Philips SPC 600 NC | 89 | sonixj 0471:0327 Philips SPC 600 NC |
90 | sonixj 0471:0328 Philips SPC 700 NC | 90 | sonixj 0471:0328 Philips SPC 700 NC |
91 | zc3xx 0471:032d Philips spc210nc | 91 | zc3xx 0471:032d Philips SPC 210 NC |
92 | zc3xx 0471:032e Philips spc315nc | 92 | zc3xx 0471:032e Philips SPC 315 NC |
93 | sonixj 0471:0330 Philips SPC 710NC | 93 | sonixj 0471:0330 Philips SPC 710 NC |
94 | spca501 0497:c001 Smile International | 94 | spca501 0497:c001 Smile International |
95 | sunplus 04a5:3003 Benq DC 1300 | 95 | sunplus 04a5:3003 Benq DC 1300 |
96 | sunplus 04a5:3008 Benq DC 1500 | 96 | sunplus 04a5:3008 Benq DC 1500 |
97 | sunplus 04a5:300a Benq DC3410 | 97 | sunplus 04a5:300a Benq DC 3410 |
98 | spca500 04a5:300c Benq DC1016 | 98 | spca500 04a5:300c Benq DC 1016 |
99 | sunplus 04f1:1001 JVC GC A50 | 99 | sunplus 04f1:1001 JVC GC A50 |
100 | spca561 04fc:0561 Flexcam 100 | 100 | spca561 04fc:0561 Flexcam 100 |
101 | sunplus 04fc:500c Sunplus CA500C | 101 | sunplus 04fc:500c Sunplus CA500C |
@@ -175,19 +175,21 @@ sunplus 08ca:2060 Aiptek PocketDV5300 | |||
175 | tv8532 0923:010f ICM532 cams | 175 | tv8532 0923:010f ICM532 cams |
176 | mars 093a:050f Mars-Semi Pc-Camera | 176 | mars 093a:050f Mars-Semi Pc-Camera |
177 | pac207 093a:2460 PAC207 Qtec Webcam 100 | 177 | pac207 093a:2460 PAC207 Qtec Webcam 100 |
178 | pac207 093a:2463 Philips spc200nc pac207 | 178 | pac207 093a:2463 Philips SPC 220 NC |
179 | pac207 093a:2464 Labtec Webcam 1200 | 179 | pac207 093a:2464 Labtec Webcam 1200 |
180 | pac207 093a:2468 PAC207 | 180 | pac207 093a:2468 PAC207 |
181 | pac207 093a:2470 Genius GF112 | 181 | pac207 093a:2470 Genius GF112 |
182 | pac207 093a:2471 PAC207 Genius VideoCam ge111 | 182 | pac207 093a:2471 Genius VideoCam ge111 |
183 | pac207 093a:2472 PAC207 Genius VideoCam ge110 | 183 | pac207 093a:2472 Genius VideoCam ge110 |
184 | pac7311 093a:2600 PAC7311 Typhoon | 184 | pac7311 093a:2600 PAC7311 Typhoon |
185 | pac7311 093a:2601 PAC7311 Phillips SPC610NC | 185 | pac7311 093a:2601 Philips SPC 610 NC |
186 | pac7311 093a:2603 PAC7312 | 186 | pac7311 093a:2603 PAC7312 |
187 | pac7311 093a:2608 PAC7311 Trust WB-3300p | 187 | pac7311 093a:2608 Trust WB-3300p |
188 | pac7311 093a:260e PAC7311 Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 | 188 | pac7311 093a:260e Gigaware VGA PC Camera, Trust WB-3350p, SIGMA cam 2350 |
189 | pac7311 093a:260f PAC7311 SnakeCam | 189 | pac7311 093a:260f SnakeCam |
190 | pac7311 093a:2621 PAC731x | 190 | pac7311 093a:2621 PAC731x |
191 | pac7311 093a:2624 PAC7302 | ||
192 | pac7311 093a:2626 Labtec 2200 | ||
191 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 | 193 | zc3xx 0ac8:0302 Z-star Vimicro zc0302 |
192 | vc032x 0ac8:0321 Vimicro generic vc0321 | 194 | vc032x 0ac8:0321 Vimicro generic vc0321 |
193 | vc032x 0ac8:0323 Vimicro Vc0323 | 195 | vc032x 0ac8:0323 Vimicro Vc0323 |
@@ -220,6 +222,7 @@ sonixj 0c45:60c0 Sangha Sn535 | |||
220 | sonixj 0c45:60ec SN9C105+MO4000 | 222 | sonixj 0c45:60ec SN9C105+MO4000 |
221 | sonixj 0c45:60fb Surfer NoName | 223 | sonixj 0c45:60fb Surfer NoName |
222 | sonixj 0c45:60fc LG-LIC300 | 224 | sonixj 0c45:60fc LG-LIC300 |
225 | sonixj 0c45:6128 Microdia/Sonix SNP325 | ||
223 | sonixj 0c45:612a Avant Camera | 226 | sonixj 0c45:612a Avant Camera |
224 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix | 227 | sonixj 0c45:612c Typhoon Rasy Cam 1.3MPix |
225 | sonixj 0c45:6130 Sonix Pccam | 228 | sonixj 0c45:6130 Sonix Pccam |
@@ -234,7 +237,7 @@ zc3xx 10fd:0128 Typhoon Webshot II USB 300k 0x0128 | |||
234 | spca561 10fd:7e50 FlyCam Usb 100 | 237 | spca561 10fd:7e50 FlyCam Usb 100 |
235 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k | 238 | zc3xx 10fd:8050 Typhoon Webshot II USB 300k |
236 | spca501 1776:501c Arowana 300K CMOS Camera | 239 | spca501 1776:501c Arowana 300K CMOS Camera |
237 | t613 17a1:0128 T613/TAS5130A | 240 | t613 17a1:0128 TASCORP JPEG Webcam, NGS Cyclops |
238 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC | 241 | vc032x 17ef:4802 Lenovo Vc0323+MI1310_SOC |
239 | pac207 2001:f115 D-Link DSB-C120 | 242 | pac207 2001:f115 D-Link DSB-C120 |
240 | spca500 2899:012c Toptro Industrial | 243 | spca500 2899:012c Toptro Industrial |
diff --git a/MAINTAINERS b/MAINTAINERS index c4ca99cf80df..cad81a24e832 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -222,8 +222,7 @@ W: http://code.google.com/p/aceracpi | |||
222 | S: Maintained | 222 | S: Maintained |
223 | 223 | ||
224 | ACPI | 224 | ACPI |
225 | P: Andi Kleen | 225 | P: Len Brown |
226 | M: ak@linux.intel.com | ||
227 | M: lenb@kernel.org | 226 | M: lenb@kernel.org |
228 | L: linux-acpi@vger.kernel.org | 227 | L: linux-acpi@vger.kernel.org |
229 | W: http://www.lesswatts.org/projects/acpi/ | 228 | W: http://www.lesswatts.org/projects/acpi/ |
@@ -272,20 +271,20 @@ W: http://www.lesswatts.org/projects/acpi/ | |||
272 | S: Supported | 271 | S: Supported |
273 | 272 | ||
274 | ACPI WMI DRIVER | 273 | ACPI WMI DRIVER |
275 | P: Carlos Corbacho | 274 | P: Carlos Corbacho |
276 | M: carlos@strangeworlds.co.uk | 275 | M: carlos@strangeworlds.co.uk |
277 | L: linux-acpi@vger.kernel.org | 276 | L: linux-acpi@vger.kernel.org |
278 | W: http://www.lesswatts.org/projects/acpi/ | 277 | W: http://www.lesswatts.org/projects/acpi/ |
279 | S: Maintained | 278 | S: Maintained |
280 | 279 | ||
281 | AD1889 ALSA SOUND DRIVER | 280 | AD1889 ALSA SOUND DRIVER |
282 | P: Kyle McMartin | 281 | P: Kyle McMartin |
283 | M: kyle@mcmartin.ca | 282 | M: kyle@mcmartin.ca |
284 | P: Thibaut Varene | 283 | P: Thibaut Varene |
285 | M: T-Bone@parisc-linux.org | 284 | M: T-Bone@parisc-linux.org |
286 | W: http://wiki.parisc-linux.org/AD1889 | 285 | W: http://wiki.parisc-linux.org/AD1889 |
287 | L: linux-parisc@vger.kernel.org | 286 | L: linux-parisc@vger.kernel.org |
288 | S: Maintained | 287 | S: Maintained |
289 | 288 | ||
290 | ADM1025 HARDWARE MONITOR DRIVER | 289 | ADM1025 HARDWARE MONITOR DRIVER |
291 | P: Jean Delvare | 290 | P: Jean Delvare |
@@ -419,6 +418,12 @@ L: linux-laptop@vger.kernel.org | |||
419 | W: http://www.canb.auug.org.au/~sfr/ | 418 | W: http://www.canb.auug.org.au/~sfr/ |
420 | S: Supported | 419 | S: Supported |
421 | 420 | ||
421 | APPLE BCM5974 MULTITOUCH DRIVER | ||
422 | P: Henrik Rydberg | ||
423 | M: rydberg@euromail.se | ||
424 | L: linux-input@vger.kernel.org | ||
425 | S: Maintained | ||
426 | |||
422 | APPLE SMC DRIVER | 427 | APPLE SMC DRIVER |
423 | P: Nicolas Boichat | 428 | P: Nicolas Boichat |
424 | M: nicolas@boichat.ch | 429 | M: nicolas@boichat.ch |
@@ -468,11 +473,11 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) | |||
468 | S: Maintained | 473 | S: Maintained |
469 | 474 | ||
470 | ARM/ATMEL AT91RM9200 ARM ARCHITECTURE | 475 | ARM/ATMEL AT91RM9200 ARM ARCHITECTURE |
471 | P: Andrew Victor | 476 | P: Andrew Victor |
472 | M: linux@maxim.org.za | 477 | M: linux@maxim.org.za |
473 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) | 478 | L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) |
474 | W: http://maxim.org.za/at91_26.html | 479 | W: http://maxim.org.za/at91_26.html |
475 | S: Maintained | 480 | S: Maintained |
476 | 481 | ||
477 | ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE | 482 | ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE |
478 | P: Lennert Buytenhek | 483 | P: Lennert Buytenhek |
@@ -527,10 +532,10 @@ L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) | |||
527 | S: Maintained | 532 | S: Maintained |
528 | 533 | ||
529 | ARM/HP JORNADA 7XX MACHINE SUPPORT | 534 | ARM/HP JORNADA 7XX MACHINE SUPPORT |
530 | P: Kristoffer Ericson | 535 | P: Kristoffer Ericson |
531 | M: kristoffer.ericson@gmail.com | 536 | M: kristoffer.ericson@gmail.com |
532 | W: www.jlime.com | 537 | W: www.jlime.com |
533 | S: Maintained | 538 | S: Maintained |
534 | 539 | ||
535 | ARM/INTEL IOP32X ARM ARCHITECTURE | 540 | ARM/INTEL IOP32X ARM ARCHITECTURE |
536 | P: Lennert Buytenhek | 541 | P: Lennert Buytenhek |
@@ -745,11 +750,13 @@ P: Ville Syrjala | |||
745 | M: syrjala@sci.fi | 750 | M: syrjala@sci.fi |
746 | S: Maintained | 751 | S: Maintained |
747 | 752 | ||
748 | ATL1 ETHERNET DRIVER | 753 | ATLX ETHERNET DRIVERS |
749 | P: Jay Cliburn | 754 | P: Jay Cliburn |
750 | M: jcliburn@gmail.com | 755 | M: jcliburn@gmail.com |
751 | P: Chris Snook | 756 | P: Chris Snook |
752 | M: csnook@redhat.com | 757 | M: csnook@redhat.com |
758 | P: Jie Yang | ||
759 | M: jie.yang@atheros.com | ||
753 | L: atl1-devel@lists.sourceforge.net | 760 | L: atl1-devel@lists.sourceforge.net |
754 | W: http://sourceforge.net/projects/atl1 | 761 | W: http://sourceforge.net/projects/atl1 |
755 | W: http://atl1.sourceforge.net | 762 | W: http://atl1.sourceforge.net |
@@ -1010,7 +1017,7 @@ T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git | |||
1010 | S: Maintained | 1017 | S: Maintained |
1011 | 1018 | ||
1012 | CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER | 1019 | CAFE CMOS INTEGRATED CAMERA CONTROLLER DRIVER |
1013 | P: Jonathan Corbet | 1020 | P: Jonathan Corbet |
1014 | M: corbet@lwn.net | 1021 | M: corbet@lwn.net |
1015 | L: video4linux-list@redhat.com | 1022 | L: video4linux-list@redhat.com |
1016 | S: Maintained | 1023 | S: Maintained |
@@ -1352,7 +1359,7 @@ P: Digi International, Inc | |||
1352 | M: Eng.Linux@digi.com | 1359 | M: Eng.Linux@digi.com |
1353 | L: Eng.Linux@digi.com | 1360 | L: Eng.Linux@digi.com |
1354 | W: http://www.digi.com | 1361 | W: http://www.digi.com |
1355 | S: Orphaned | 1362 | S: Orphan |
1356 | 1363 | ||
1357 | DIRECTORY NOTIFICATION | 1364 | DIRECTORY NOTIFICATION |
1358 | P: Stephen Rothwell | 1365 | P: Stephen Rothwell |
@@ -1416,12 +1423,12 @@ L: linux-acpi@vger.kernel.org | |||
1416 | S: Supported | 1423 | S: Supported |
1417 | 1424 | ||
1418 | DOCUMENTATION (/Documentation directory) | 1425 | DOCUMENTATION (/Documentation directory) |
1419 | P: Michael Kerrisk | 1426 | P: Michael Kerrisk |
1420 | M: mtk.manpages@gmail.com | 1427 | M: mtk.manpages@gmail.com |
1421 | P: Randy Dunlap | 1428 | P: Randy Dunlap |
1422 | M: rdunlap@xenotime.net | 1429 | M: rdunlap@xenotime.net |
1423 | L: linux-doc@vger.kernel.org | 1430 | L: linux-doc@vger.kernel.org |
1424 | S: Maintained | 1431 | S: Maintained |
1425 | 1432 | ||
1426 | DOUBLETALK DRIVER | 1433 | DOUBLETALK DRIVER |
1427 | P: James R. Van Zandt | 1434 | P: James R. Van Zandt |
@@ -1452,7 +1459,7 @@ S: Maintained | |||
1452 | DVB SUBSYSTEM AND DRIVERS | 1459 | DVB SUBSYSTEM AND DRIVERS |
1453 | P: LinuxTV.org Project | 1460 | P: LinuxTV.org Project |
1454 | M: v4l-dvb-maintainer@linuxtv.org | 1461 | M: v4l-dvb-maintainer@linuxtv.org |
1455 | L: linux-dvb@linuxtv.org (subscription required) | 1462 | L: linux-dvb@linuxtv.org (subscription required) |
1456 | W: http://linuxtv.org/ | 1463 | W: http://linuxtv.org/ |
1457 | T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git | 1464 | T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git |
1458 | S: Maintained | 1465 | S: Maintained |
@@ -1588,7 +1595,7 @@ S: Supported | |||
1588 | EMBEDDED LINUX | 1595 | EMBEDDED LINUX |
1589 | P: Paul Gortmaker | 1596 | P: Paul Gortmaker |
1590 | M: paul.gortmaker@windriver.com | 1597 | M: paul.gortmaker@windriver.com |
1591 | P David Woodhouse | 1598 | P: David Woodhouse |
1592 | M: dwmw2@infradead.org | 1599 | M: dwmw2@infradead.org |
1593 | L: linux-embedded@vger.kernel.org | 1600 | L: linux-embedded@vger.kernel.org |
1594 | S: Maintained | 1601 | S: Maintained |
@@ -1790,7 +1797,7 @@ FUTURE DOMAIN TMC-16x0 SCSI DRIVER (16-bit) | |||
1790 | P: Rik Faith | 1797 | P: Rik Faith |
1791 | M: faith@cs.unc.edu | 1798 | M: faith@cs.unc.edu |
1792 | L: linux-scsi@vger.kernel.org | 1799 | L: linux-scsi@vger.kernel.org |
1793 | S: Odd fixes (e.g., new signatures) | 1800 | S: Odd Fixes (e.g., new signatures) |
1794 | 1801 | ||
1795 | GDT SCSI DISK ARRAY CONTROLLER DRIVER | 1802 | GDT SCSI DISK ARRAY CONTROLLER DRIVER |
1796 | P: Achim Leubner | 1803 | P: Achim Leubner |
@@ -1831,10 +1838,10 @@ S: Maintained | |||
1831 | HARDWARE MONITORING | 1838 | HARDWARE MONITORING |
1832 | L: lm-sensors@lm-sensors.org | 1839 | L: lm-sensors@lm-sensors.org |
1833 | W: http://www.lm-sensors.org/ | 1840 | W: http://www.lm-sensors.org/ |
1834 | S: Orphaned | 1841 | S: Orphan |
1835 | 1842 | ||
1836 | HARDWARE RANDOM NUMBER GENERATOR CORE | 1843 | HARDWARE RANDOM NUMBER GENERATOR CORE |
1837 | S: Orphaned | 1844 | S: Orphan |
1838 | 1845 | ||
1839 | HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER | 1846 | HARD DRIVE ACTIVE PROTECTION SYSTEM (HDAPS) DRIVER |
1840 | P: Robert Love | 1847 | P: Robert Love |
@@ -2101,7 +2108,7 @@ M: rolandd@cisco.com | |||
2101 | P: Sean Hefty | 2108 | P: Sean Hefty |
2102 | M: sean.hefty@intel.com | 2109 | M: sean.hefty@intel.com |
2103 | P: Hal Rosenstock | 2110 | P: Hal Rosenstock |
2104 | M: hal.rosenstock@gmail.com | 2111 | M: hal.rosenstock@gmail.com |
2105 | L: general@lists.openfabrics.org | 2112 | L: general@lists.openfabrics.org |
2106 | W: http://www.openib.org/ | 2113 | W: http://www.openib.org/ |
2107 | T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git | 2114 | T: git kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git |
@@ -2689,17 +2696,17 @@ S: Maintained | |||
2689 | 2696 | ||
2690 | MARVELL YUKON / SYSKONNECT DRIVER | 2697 | MARVELL YUKON / SYSKONNECT DRIVER |
2691 | P: Mirko Lindner | 2698 | P: Mirko Lindner |
2692 | M: mlindner@syskonnect.de | 2699 | M: mlindner@syskonnect.de |
2693 | P: Ralph Roesler | 2700 | P: Ralph Roesler |
2694 | M: rroesler@syskonnect.de | 2701 | M: rroesler@syskonnect.de |
2695 | W: http://www.syskonnect.com | 2702 | W: http://www.syskonnect.com |
2696 | S: Supported | 2703 | S: Supported |
2697 | 2704 | ||
2698 | MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 | 2705 | MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 |
2699 | P: Michael Kerrisk | 2706 | P: Michael Kerrisk |
2700 | M: mtk.manpages@gmail.com | 2707 | M: mtk.manpages@gmail.com |
2701 | W: http://www.kernel.org/doc/man-pages | 2708 | W: http://www.kernel.org/doc/man-pages |
2702 | S: Supported | 2709 | S: Supported |
2703 | 2710 | ||
2704 | MARVELL LIBERTAS WIRELESS DRIVER | 2711 | MARVELL LIBERTAS WIRELESS DRIVER |
2705 | P: Dan Williams | 2712 | P: Dan Williams |
@@ -2728,7 +2735,7 @@ S: Maintained | |||
2728 | MEGARAID SCSI DRIVERS | 2735 | MEGARAID SCSI DRIVERS |
2729 | P: Neela Syam Kolli | 2736 | P: Neela Syam Kolli |
2730 | M: megaraidlinux@lsi.com | 2737 | M: megaraidlinux@lsi.com |
2731 | S: linux-scsi@vger.kernel.org | 2738 | L: linux-scsi@vger.kernel.org |
2732 | W: http://megaraid.lsilogic.com | 2739 | W: http://megaraid.lsilogic.com |
2733 | S: Maintained | 2740 | S: Maintained |
2734 | 2741 | ||
@@ -2846,7 +2853,7 @@ MULTIMEDIA CARD (MMC) ETC. OVER SPI | |||
2846 | P: David Brownell | 2853 | P: David Brownell |
2847 | M: dbrownell@users.sourceforge.net | 2854 | M: dbrownell@users.sourceforge.net |
2848 | L: linux-kernel@vger.kernel.org | 2855 | L: linux-kernel@vger.kernel.org |
2849 | S: Odd fixes | 2856 | S: Odd Fixes |
2850 | 2857 | ||
2851 | MULTISOUND SOUND DRIVER | 2858 | MULTISOUND SOUND DRIVER |
2852 | P: Andrew Veliath | 2859 | P: Andrew Veliath |
@@ -2860,10 +2867,10 @@ L: linux-kernel@vger.kernel.org | |||
2860 | S: Maintained | 2867 | S: Maintained |
2861 | 2868 | ||
2862 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER | 2869 | MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER |
2863 | P: Felipe Balbi | 2870 | P: Felipe Balbi |
2864 | M: felipe.balbi@nokia.com | 2871 | M: felipe.balbi@nokia.com |
2865 | L: linux-usb@vger.kernel.org | 2872 | L: linux-usb@vger.kernel.org |
2866 | S: Maintained | 2873 | S: Maintained |
2867 | 2874 | ||
2868 | MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE) | 2875 | MYRICOM MYRI-10G 10GbE DRIVER (MYRI10GE) |
2869 | P: Andrew Gallatin | 2876 | P: Andrew Gallatin |
@@ -2875,7 +2882,7 @@ W: http://www.myri.com/scs/download-Myri10GE.html | |||
2875 | S: Supported | 2882 | S: Supported |
2876 | 2883 | ||
2877 | NATSEMI ETHERNET DRIVER (DP8381x) | 2884 | NATSEMI ETHERNET DRIVER (DP8381x) |
2878 | P: Tim Hockin | 2885 | P: Tim Hockin |
2879 | M: thockin@hockin.org | 2886 | M: thockin@hockin.org |
2880 | S: Maintained | 2887 | S: Maintained |
2881 | 2888 | ||
@@ -3051,7 +3058,7 @@ P: Anton Altaparmakov | |||
3051 | M: aia21@cantab.net | 3058 | M: aia21@cantab.net |
3052 | L: linux-ntfs-dev@lists.sourceforge.net | 3059 | L: linux-ntfs-dev@lists.sourceforge.net |
3053 | L: linux-kernel@vger.kernel.org | 3060 | L: linux-kernel@vger.kernel.org |
3054 | W: http://linux-ntfs.sf.net/ | 3061 | W: http://www.linux-ntfs.org/ |
3055 | T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git | 3062 | T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git |
3056 | S: Maintained | 3063 | S: Maintained |
3057 | 3064 | ||
@@ -3094,7 +3101,7 @@ M: laforge@gnumonks.org | |||
3094 | S: Maintained | 3101 | S: Maintained |
3095 | 3102 | ||
3096 | OMNIVISION OV7670 SENSOR DRIVER | 3103 | OMNIVISION OV7670 SENSOR DRIVER |
3097 | P: Jonathan Corbet | 3104 | P: Jonathan Corbet |
3098 | M: corbet@lwn.net | 3105 | M: corbet@lwn.net |
3099 | L: video4linux-list@redhat.com | 3106 | L: video4linux-list@redhat.com |
3100 | S: Maintained | 3107 | S: Maintained |
@@ -3204,7 +3211,7 @@ T: git kernel.org:/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git | |||
3204 | S: Supported | 3211 | S: Supported |
3205 | 3212 | ||
3206 | PCI HOTPLUG CORE | 3213 | PCI HOTPLUG CORE |
3207 | P: Kristen Carlson Accardi | 3214 | P: Kristen Carlson Accardi |
3208 | M: kristen.c.accardi@intel.com | 3215 | M: kristen.c.accardi@intel.com |
3209 | S: Supported | 3216 | S: Supported |
3210 | 3217 | ||
@@ -3643,7 +3650,7 @@ M: jmorris@namei.org | |||
3643 | P: Eric Paris | 3650 | P: Eric Paris |
3644 | M: eparis@parisplace.org | 3651 | M: eparis@parisplace.org |
3645 | L: linux-kernel@vger.kernel.org (kernel issues) | 3652 | L: linux-kernel@vger.kernel.org (kernel issues) |
3646 | L: selinux@tycho.nsa.gov (subscribers-only, general discussion) | 3653 | L: selinux@tycho.nsa.gov (subscribers-only, general discussion) |
3647 | W: http://www.nsa.gov/selinux | 3654 | W: http://www.nsa.gov/selinux |
3648 | S: Supported | 3655 | S: Supported |
3649 | 3656 | ||
@@ -3761,10 +3768,10 @@ M: bn@niasdigital.com | |||
3761 | S: Maintained | 3768 | S: Maintained |
3762 | 3769 | ||
3763 | SOC-CAMERA V4L2 SUBSYSTEM | 3770 | SOC-CAMERA V4L2 SUBSYSTEM |
3764 | P: Guennadi Liakhovetski | 3771 | P: Guennadi Liakhovetski |
3765 | M: g.liakhovetski@gmx.de | 3772 | M: g.liakhovetski@gmx.de |
3766 | L: video4linux-list@redhat.com | 3773 | L: video4linux-list@redhat.com |
3767 | S: Maintained | 3774 | S: Maintained |
3768 | 3775 | ||
3769 | SOFTWARE RAID (Multiple Disks) SUPPORT | 3776 | SOFTWARE RAID (Multiple Disks) SUPPORT |
3770 | P: Ingo Molnar | 3777 | P: Ingo Molnar |
@@ -3918,7 +3925,7 @@ S: Maintained | |||
3918 | 3925 | ||
3919 | STARMODE RADIO IP (STRIP) PROTOCOL DRIVER | 3926 | STARMODE RADIO IP (STRIP) PROTOCOL DRIVER |
3920 | W: http://mosquitonet.Stanford.EDU/strip.html | 3927 | W: http://mosquitonet.Stanford.EDU/strip.html |
3921 | S: Unsupported ? | 3928 | S: Orphan |
3922 | 3929 | ||
3923 | STRADIS MPEG-2 DECODER DRIVER | 3930 | STRADIS MPEG-2 DECODER DRIVER |
3924 | P: Nathan Laredo | 3931 | P: Nathan Laredo |
@@ -3999,9 +4006,9 @@ T: git repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git | |||
3999 | S: Maintained | 4006 | S: Maintained |
4000 | 4007 | ||
4001 | TI FLASH MEDIA INTERFACE DRIVER | 4008 | TI FLASH MEDIA INTERFACE DRIVER |
4002 | P: Alex Dubov | 4009 | P: Alex Dubov |
4003 | M: oakad@yahoo.com | 4010 | M: oakad@yahoo.com |
4004 | S: Maintained | 4011 | S: Maintained |
4005 | 4012 | ||
4006 | TI OMAP MMC INTERFACE DRIVER | 4013 | TI OMAP MMC INTERFACE DRIVER |
4007 | P: Carlos Aguiar, Anderson Briglia and Syed Khasim | 4014 | P: Carlos Aguiar, Anderson Briglia and Syed Khasim |
@@ -4147,13 +4154,13 @@ USB BLOCK DRIVER (UB ub) | |||
4147 | P: Pete Zaitcev | 4154 | P: Pete Zaitcev |
4148 | M: zaitcev@redhat.com | 4155 | M: zaitcev@redhat.com |
4149 | L: linux-kernel@vger.kernel.org | 4156 | L: linux-kernel@vger.kernel.org |
4150 | L: linux-usb@vger.kernel.org | 4157 | L: linux-usb@vger.kernel.org |
4151 | S: Supported | 4158 | S: Supported |
4152 | 4159 | ||
4153 | USB CDC ETHERNET DRIVER | 4160 | USB CDC ETHERNET DRIVER |
4154 | P: Greg Kroah-Hartman | 4161 | P: Greg Kroah-Hartman |
4155 | M: greg@kroah.com | 4162 | M: greg@kroah.com |
4156 | L: linux-usb@vger.kernel.org | 4163 | L: linux-usb@vger.kernel.org |
4157 | S: Maintained | 4164 | S: Maintained |
4158 | W: http://www.kroah.com/linux-usb/ | 4165 | W: http://www.kroah.com/linux-usb/ |
4159 | 4166 | ||
@@ -4180,13 +4187,13 @@ S: Maintained | |||
4180 | USB EHCI DRIVER | 4187 | USB EHCI DRIVER |
4181 | P: David Brownell | 4188 | P: David Brownell |
4182 | M: dbrownell@users.sourceforge.net | 4189 | M: dbrownell@users.sourceforge.net |
4183 | L: linux-usb@vger.kernel.org | 4190 | L: linux-usb@vger.kernel.org |
4184 | S: Odd Fixes | 4191 | S: Odd Fixes |
4185 | 4192 | ||
4186 | USB ET61X[12]51 DRIVER | 4193 | USB ET61X[12]51 DRIVER |
4187 | P: Luca Risolia | 4194 | P: Luca Risolia |
4188 | M: luca.risolia@studio.unibo.it | 4195 | M: luca.risolia@studio.unibo.it |
4189 | L: linux-usb@vger.kernel.org | 4196 | L: linux-usb@vger.kernel.org |
4190 | L: video4linux-list@redhat.com | 4197 | L: video4linux-list@redhat.com |
4191 | W: http://www.linux-projects.org | 4198 | W: http://www.linux-projects.org |
4192 | S: Maintained | 4199 | S: Maintained |
@@ -4194,33 +4201,33 @@ S: Maintained | |||
4194 | USB GADGET/PERIPHERAL SUBSYSTEM | 4201 | USB GADGET/PERIPHERAL SUBSYSTEM |
4195 | P: David Brownell | 4202 | P: David Brownell |
4196 | M: dbrownell@users.sourceforge.net | 4203 | M: dbrownell@users.sourceforge.net |
4197 | L: linux-usb@vger.kernel.org | 4204 | L: linux-usb@vger.kernel.org |
4198 | W: http://www.linux-usb.org/gadget | 4205 | W: http://www.linux-usb.org/gadget |
4199 | S: Maintained | 4206 | S: Maintained |
4200 | 4207 | ||
4201 | USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...) | 4208 | USB HID/HIDBP DRIVERS (USB KEYBOARDS, MICE, REMOTE CONTROLS, ...) |
4202 | P: Jiri Kosina | 4209 | P: Jiri Kosina |
4203 | M: jkosina@suse.cz | 4210 | M: jkosina@suse.cz |
4204 | L: linux-usb@vger.kernel.org | 4211 | L: linux-usb@vger.kernel.org |
4205 | T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git | 4212 | T: git kernel.org:/pub/scm/linux/kernel/git/jikos/hid.git |
4206 | S: Maintained | 4213 | S: Maintained |
4207 | 4214 | ||
4208 | USB ISP116X DRIVER | 4215 | USB ISP116X DRIVER |
4209 | P: Olav Kongas | 4216 | P: Olav Kongas |
4210 | M: ok@artecdesign.ee | 4217 | M: ok@artecdesign.ee |
4211 | L: linux-usb@vger.kernel.org | 4218 | L: linux-usb@vger.kernel.org |
4212 | S: Maintained | 4219 | S: Maintained |
4213 | 4220 | ||
4214 | USB KAWASAKI LSI DRIVER | 4221 | USB KAWASAKI LSI DRIVER |
4215 | P: Oliver Neukum | 4222 | P: Oliver Neukum |
4216 | M: oliver@neukum.name | 4223 | M: oliver@neukum.name |
4217 | L: linux-usb@vger.kernel.org | 4224 | L: linux-usb@vger.kernel.org |
4218 | S: Maintained | 4225 | S: Maintained |
4219 | 4226 | ||
4220 | USB MASS STORAGE DRIVER | 4227 | USB MASS STORAGE DRIVER |
4221 | P: Matthew Dharm | 4228 | P: Matthew Dharm |
4222 | M: mdharm-usb@one-eyed-alien.net | 4229 | M: mdharm-usb@one-eyed-alien.net |
4223 | L: linux-usb@vger.kernel.org | 4230 | L: linux-usb@vger.kernel.org |
4224 | L: usb-storage@lists.one-eyed-alien.net | 4231 | L: usb-storage@lists.one-eyed-alien.net |
4225 | S: Maintained | 4232 | S: Maintained |
4226 | W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ | 4233 | W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ |
@@ -4228,26 +4235,26 @@ W: http://www.one-eyed-alien.net/~mdharm/linux-usb/ | |||
4228 | USB OHCI DRIVER | 4235 | USB OHCI DRIVER |
4229 | P: David Brownell | 4236 | P: David Brownell |
4230 | M: dbrownell@users.sourceforge.net | 4237 | M: dbrownell@users.sourceforge.net |
4231 | L: linux-usb@vger.kernel.org | 4238 | L: linux-usb@vger.kernel.org |
4232 | S: Odd Fixes | 4239 | S: Odd Fixes |
4233 | 4240 | ||
4234 | USB OPTION-CARD DRIVER | 4241 | USB OPTION-CARD DRIVER |
4235 | P: Matthias Urlichs | 4242 | P: Matthias Urlichs |
4236 | M: smurf@smurf.noris.de | 4243 | M: smurf@smurf.noris.de |
4237 | L: linux-usb@vger.kernel.org | 4244 | L: linux-usb@vger.kernel.org |
4238 | S: Maintained | 4245 | S: Maintained |
4239 | 4246 | ||
4240 | USB OV511 DRIVER | 4247 | USB OV511 DRIVER |
4241 | P: Mark McClelland | 4248 | P: Mark McClelland |
4242 | M: mmcclell@bigfoot.com | 4249 | M: mmcclell@bigfoot.com |
4243 | L: linux-usb@vger.kernel.org | 4250 | L: linux-usb@vger.kernel.org |
4244 | W: http://alpha.dyndns.org/ov511/ | 4251 | W: http://alpha.dyndns.org/ov511/ |
4245 | S: Maintained | 4252 | S: Maintained |
4246 | 4253 | ||
4247 | USB PEGASUS DRIVER | 4254 | USB PEGASUS DRIVER |
4248 | P: Petko Manolov | 4255 | P: Petko Manolov |
4249 | M: petkan@users.sourceforge.net | 4256 | M: petkan@users.sourceforge.net |
4250 | L: linux-usb@vger.kernel.org | 4257 | L: linux-usb@vger.kernel.org |
4251 | L: netdev@vger.kernel.org | 4258 | L: netdev@vger.kernel.org |
4252 | W: http://pegasus2.sourceforge.net/ | 4259 | W: http://pegasus2.sourceforge.net/ |
4253 | S: Maintained | 4260 | S: Maintained |
@@ -4255,13 +4262,13 @@ S: Maintained | |||
4255 | USB PRINTER DRIVER (usblp) | 4262 | USB PRINTER DRIVER (usblp) |
4256 | P: Pete Zaitcev | 4263 | P: Pete Zaitcev |
4257 | M: zaitcev@redhat.com | 4264 | M: zaitcev@redhat.com |
4258 | L: linux-usb@vger.kernel.org | 4265 | L: linux-usb@vger.kernel.org |
4259 | S: Supported | 4266 | S: Supported |
4260 | 4267 | ||
4261 | USB RTL8150 DRIVER | 4268 | USB RTL8150 DRIVER |
4262 | P: Petko Manolov | 4269 | P: Petko Manolov |
4263 | M: petkan@users.sourceforge.net | 4270 | M: petkan@users.sourceforge.net |
4264 | L: linux-usb@vger.kernel.org | 4271 | L: linux-usb@vger.kernel.org |
4265 | L: netdev@vger.kernel.org | 4272 | L: netdev@vger.kernel.org |
4266 | W: http://pegasus2.sourceforge.net/ | 4273 | W: http://pegasus2.sourceforge.net/ |
4267 | S: Maintained | 4274 | S: Maintained |
@@ -4269,20 +4276,20 @@ S: Maintained | |||
4269 | USB SE401 DRIVER | 4276 | USB SE401 DRIVER |
4270 | P: Jeroen Vreeken | 4277 | P: Jeroen Vreeken |
4271 | M: pe1rxq@amsat.org | 4278 | M: pe1rxq@amsat.org |
4272 | L: linux-usb@vger.kernel.org | 4279 | L: linux-usb@vger.kernel.org |
4273 | W: http://www.chello.nl/~j.vreeken/se401/ | 4280 | W: http://www.chello.nl/~j.vreeken/se401/ |
4274 | S: Maintained | 4281 | S: Maintained |
4275 | 4282 | ||
4276 | USB SERIAL BELKIN F5U103 DRIVER | 4283 | USB SERIAL BELKIN F5U103 DRIVER |
4277 | P: William Greathouse | 4284 | P: William Greathouse |
4278 | M: wgreathouse@smva.com | 4285 | M: wgreathouse@smva.com |
4279 | L: linux-usb@vger.kernel.org | 4286 | L: linux-usb@vger.kernel.org |
4280 | S: Maintained | 4287 | S: Maintained |
4281 | 4288 | ||
4282 | USB SERIAL CYPRESS M8 DRIVER | 4289 | USB SERIAL CYPRESS M8 DRIVER |
4283 | P: Lonnie Mendez | 4290 | P: Lonnie Mendez |
4284 | M: dignome@gmail.com | 4291 | M: dignome@gmail.com |
4285 | L: linux-usb@vger.kernel.org | 4292 | L: linux-usb@vger.kernel.org |
4286 | S: Maintained | 4293 | S: Maintained |
4287 | W: http://geocities.com/i0xox0i | 4294 | W: http://geocities.com/i0xox0i |
4288 | W: http://firstlight.net/cvs | 4295 | W: http://firstlight.net/cvs |
@@ -4297,39 +4304,39 @@ USB SERIAL DIGI ACCELEPORT DRIVER | |||
4297 | P: Peter Berger and Al Borchers | 4304 | P: Peter Berger and Al Borchers |
4298 | M: pberger@brimson.com | 4305 | M: pberger@brimson.com |
4299 | M: alborchers@steinerpoint.com | 4306 | M: alborchers@steinerpoint.com |
4300 | L: linux-usb@vger.kernel.org | 4307 | L: linux-usb@vger.kernel.org |
4301 | S: Maintained | 4308 | S: Maintained |
4302 | 4309 | ||
4303 | USB SERIAL DRIVER | 4310 | USB SERIAL DRIVER |
4304 | P: Greg Kroah-Hartman | 4311 | P: Greg Kroah-Hartman |
4305 | M: gregkh@suse.de | 4312 | M: gregkh@suse.de |
4306 | L: linux-usb@vger.kernel.org | 4313 | L: linux-usb@vger.kernel.org |
4307 | S: Supported | 4314 | S: Supported |
4308 | 4315 | ||
4309 | USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER | 4316 | USB SERIAL EMPEG EMPEG-CAR MARK I/II DRIVER |
4310 | P: Gary Brubaker | 4317 | P: Gary Brubaker |
4311 | M: xavyer@ix.netcom.com | 4318 | M: xavyer@ix.netcom.com |
4312 | L: linux-usb@vger.kernel.org | 4319 | L: linux-usb@vger.kernel.org |
4313 | S: Maintained | 4320 | S: Maintained |
4314 | 4321 | ||
4315 | USB SERIAL KEYSPAN DRIVER | 4322 | USB SERIAL KEYSPAN DRIVER |
4316 | P: Greg Kroah-Hartman | 4323 | P: Greg Kroah-Hartman |
4317 | M: greg@kroah.com | 4324 | M: greg@kroah.com |
4318 | L: linux-usb@vger.kernel.org | 4325 | L: linux-usb@vger.kernel.org |
4319 | W: http://www.kroah.com/linux/ | 4326 | W: http://www.kroah.com/linux/ |
4320 | S: Maintained | 4327 | S: Maintained |
4321 | 4328 | ||
4322 | USB SERIAL WHITEHEAT DRIVER | 4329 | USB SERIAL WHITEHEAT DRIVER |
4323 | P: Support Department | 4330 | P: Support Department |
4324 | M: support@connecttech.com | 4331 | M: support@connecttech.com |
4325 | L: linux-usb@vger.kernel.org | 4332 | L: linux-usb@vger.kernel.org |
4326 | W: http://www.connecttech.com | 4333 | W: http://www.connecttech.com |
4327 | S: Supported | 4334 | S: Supported |
4328 | 4335 | ||
4329 | USB SN9C1xx DRIVER | 4336 | USB SN9C1xx DRIVER |
4330 | P: Luca Risolia | 4337 | P: Luca Risolia |
4331 | M: luca.risolia@studio.unibo.it | 4338 | M: luca.risolia@studio.unibo.it |
4332 | L: linux-usb@vger.kernel.org | 4339 | L: linux-usb@vger.kernel.org |
4333 | L: video4linux-list@redhat.com | 4340 | L: video4linux-list@redhat.com |
4334 | W: http://www.linux-projects.org | 4341 | W: http://www.linux-projects.org |
4335 | S: Maintained | 4342 | S: Maintained |
@@ -4337,7 +4344,7 @@ S: Maintained | |||
4337 | USB SUBSYSTEM | 4344 | USB SUBSYSTEM |
4338 | P: Greg Kroah-Hartman | 4345 | P: Greg Kroah-Hartman |
4339 | M: gregkh@suse.de | 4346 | M: gregkh@suse.de |
4340 | L: linux-usb@vger.kernel.org | 4347 | L: linux-usb@vger.kernel.org |
4341 | W: http://www.linux-usb.org | 4348 | W: http://www.linux-usb.org |
4342 | T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 4349 | T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ |
4343 | S: Supported | 4350 | S: Supported |
@@ -4345,7 +4352,7 @@ S: Supported | |||
4345 | USB UHCI DRIVER | 4352 | USB UHCI DRIVER |
4346 | P: Alan Stern | 4353 | P: Alan Stern |
4347 | M: stern@rowland.harvard.edu | 4354 | M: stern@rowland.harvard.edu |
4348 | L: linux-usb@vger.kernel.org | 4355 | L: linux-usb@vger.kernel.org |
4349 | S: Maintained | 4356 | S: Maintained |
4350 | 4357 | ||
4351 | USB "USBNET" DRIVER FRAMEWORK | 4358 | USB "USBNET" DRIVER FRAMEWORK |
@@ -4358,7 +4365,7 @@ S: Maintained | |||
4358 | USB VIDEO CLASS | 4365 | USB VIDEO CLASS |
4359 | P: Laurent Pinchart | 4366 | P: Laurent Pinchart |
4360 | M: laurent.pinchart@skynet.be | 4367 | M: laurent.pinchart@skynet.be |
4361 | L: linx-uvc-devel@berlios.de | 4368 | L: linux-uvc-devel@lists.berlios.de |
4362 | L: video4linux-list@redhat.com | 4369 | L: video4linux-list@redhat.com |
4363 | W: http://linux-uvc.berlios.de | 4370 | W: http://linux-uvc.berlios.de |
4364 | S: Maintained | 4371 | S: Maintained |
@@ -4366,7 +4373,7 @@ S: Maintained | |||
4366 | USB W996[87]CF DRIVER | 4373 | USB W996[87]CF DRIVER |
4367 | P: Luca Risolia | 4374 | P: Luca Risolia |
4368 | M: luca.risolia@studio.unibo.it | 4375 | M: luca.risolia@studio.unibo.it |
4369 | L: linux-usb@vger.kernel.org | 4376 | L: linux-usb@vger.kernel.org |
4370 | L: video4linux-list@redhat.com | 4377 | L: video4linux-list@redhat.com |
4371 | W: http://www.linux-projects.org | 4378 | W: http://www.linux-projects.org |
4372 | S: Maintained | 4379 | S: Maintained |
@@ -4380,7 +4387,7 @@ S: Maintained | |||
4380 | USB ZC0301 DRIVER | 4387 | USB ZC0301 DRIVER |
4381 | P: Luca Risolia | 4388 | P: Luca Risolia |
4382 | M: luca.risolia@studio.unibo.it | 4389 | M: luca.risolia@studio.unibo.it |
4383 | L: linux-usb@vger.kernel.org | 4390 | L: linux-usb@vger.kernel.org |
4384 | L: video4linux-list@redhat.com | 4391 | L: video4linux-list@redhat.com |
4385 | W: http://www.linux-projects.org | 4392 | W: http://www.linux-projects.org |
4386 | S: Maintained | 4393 | S: Maintained |
@@ -4388,14 +4395,14 @@ S: Maintained | |||
4388 | USB ZD1201 DRIVER | 4395 | USB ZD1201 DRIVER |
4389 | P: Jeroen Vreeken | 4396 | P: Jeroen Vreeken |
4390 | M: pe1rxq@amsat.org | 4397 | M: pe1rxq@amsat.org |
4391 | L: linux-usb@vger.kernel.org | 4398 | L: linux-usb@vger.kernel.org |
4392 | W: http://linux-lc100020.sourceforge.net | 4399 | W: http://linux-lc100020.sourceforge.net |
4393 | S: Maintained | 4400 | S: Maintained |
4394 | 4401 | ||
4395 | USB ZR364XX DRIVER | 4402 | USB ZR364XX DRIVER |
4396 | P: Antoine Jacquet | 4403 | P: Antoine Jacquet |
4397 | M: royale@zerezo.com | 4404 | M: royale@zerezo.com |
4398 | L: linux-usb@vger.kernel.org | 4405 | L: linux-usb@vger.kernel.org |
4399 | L: video4linux-list@redhat.com | 4406 | L: video4linux-list@redhat.com |
4400 | W: http://royale.zerezo.com/zr364xx/ | 4407 | W: http://royale.zerezo.com/zr364xx/ |
4401 | S: Maintained | 4408 | S: Maintained |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 27 | 3 | SUBLEVEL = 27 |
4 | EXTRAVERSION = -rc5 | 4 | EXTRAVERSION = -rc6 |
5 | NAME = Rotary Wombat | 5 | NAME = Rotary Wombat |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h index d04a7a2bc2e9..4fbfb22f65a0 100644 --- a/arch/arm/include/asm/byteorder.h +++ b/arch/arm/include/asm/byteorder.h | |||
@@ -18,15 +18,7 @@ | |||
18 | #include <linux/compiler.h> | 18 | #include <linux/compiler.h> |
19 | #include <asm/types.h> | 19 | #include <asm/types.h> |
20 | 20 | ||
21 | #ifdef __ARMEB__ | 21 | static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) |
22 | # define __BIG_ENDIAN | ||
23 | #else | ||
24 | # define __LITTLE_ENDIAN | ||
25 | #endif | ||
26 | |||
27 | #define __SWAB_64_THRU_32__ | ||
28 | |||
29 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | ||
30 | { | 22 | { |
31 | __u32 t; | 23 | __u32 t; |
32 | 24 | ||
@@ -48,8 +40,19 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | |||
48 | 40 | ||
49 | return x; | 41 | return x; |
50 | } | 42 | } |
51 | #define __arch_swab32 __arch_swab32 | ||
52 | 43 | ||
53 | #include <linux/byteorder.h> | 44 | #define __arch__swab32(x) ___arch__swab32(x) |
45 | |||
46 | #if !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
47 | # define __BYTEORDER_HAS_U64__ | ||
48 | # define __SWAB_64_THRU_32__ | ||
49 | #endif | ||
50 | |||
51 | #ifdef __ARMEB__ | ||
52 | #include <linux/byteorder/big_endian.h> | ||
53 | #else | ||
54 | #include <linux/byteorder/little_endian.h> | ||
55 | #endif | ||
54 | 56 | ||
55 | #endif | 57 | #endif |
58 | |||
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 94a95d7fafd6..71934856fc22 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -61,8 +61,9 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); | |||
61 | #define MT_DEVICE_NONSHARED 1 | 61 | #define MT_DEVICE_NONSHARED 1 |
62 | #define MT_DEVICE_CACHED 2 | 62 | #define MT_DEVICE_CACHED 2 |
63 | #define MT_DEVICE_IXP2000 3 | 63 | #define MT_DEVICE_IXP2000 3 |
64 | #define MT_DEVICE_WC 4 | ||
64 | /* | 65 | /* |
65 | * types 4 onwards can be found in asm/mach/map.h and are undefined | 66 | * types 5 onwards can be found in asm/mach/map.h and are undefined |
66 | * for ioremap | 67 | * for ioremap |
67 | */ | 68 | */ |
68 | 69 | ||
@@ -215,11 +216,13 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
215 | #define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) | 216 | #define ioremap(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) |
216 | #define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) | 217 | #define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE) |
217 | #define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED) | 218 | #define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED) |
219 | #define ioremap_wc(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_WC) | ||
218 | #define iounmap(cookie) __iounmap(cookie) | 220 | #define iounmap(cookie) __iounmap(cookie) |
219 | #else | 221 | #else |
220 | #define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) | 222 | #define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
221 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) | 223 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE) |
222 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) | 224 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED) |
225 | #define ioremap_wc(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_WC) | ||
223 | #define iounmap(cookie) __arch_iounmap(cookie) | 226 | #define iounmap(cookie) __arch_iounmap(cookie) |
224 | #endif | 227 | #endif |
225 | 228 | ||
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h index 06f583b13999..9eb936e49cc3 100644 --- a/arch/arm/include/asm/mach/map.h +++ b/arch/arm/include/asm/mach/map.h | |||
@@ -18,13 +18,13 @@ struct map_desc { | |||
18 | unsigned int type; | 18 | unsigned int type; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | /* types 0-3 are defined in asm/io.h */ | 21 | /* types 0-4 are defined in asm/io.h */ |
22 | #define MT_CACHECLEAN 4 | 22 | #define MT_CACHECLEAN 5 |
23 | #define MT_MINICLEAN 5 | 23 | #define MT_MINICLEAN 6 |
24 | #define MT_LOW_VECTORS 6 | 24 | #define MT_LOW_VECTORS 7 |
25 | #define MT_HIGH_VECTORS 7 | 25 | #define MT_HIGH_VECTORS 8 |
26 | #define MT_MEMORY 8 | 26 | #define MT_MEMORY 9 |
27 | #define MT_ROM 9 | 27 | #define MT_ROM 10 |
28 | 28 | ||
29 | #define MT_NONSHARED_DEVICE MT_DEVICE_NONSHARED | 29 | #define MT_NONSHARED_DEVICE MT_DEVICE_NONSHARED |
30 | #define MT_IXP2000_DEVICE MT_DEVICE_IXP2000 | 30 | #define MT_IXP2000_DEVICE MT_DEVICE_IXP2000 |
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h index 721c03d53f4b..918d0cbbf064 100644 --- a/arch/arm/include/asm/pci.h +++ b/arch/arm/include/asm/pci.h | |||
@@ -30,7 +30,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
30 | * The networking and block device layers use this boolean for bounce | 30 | * The networking and block device layers use this boolean for bounce |
31 | * buffer decisions. | 31 | * buffer decisions. |
32 | */ | 32 | */ |
33 | #define PCI_DMA_BUS_IS_PHYS (0) | 33 | #define PCI_DMA_BUS_IS_PHYS (1) |
34 | 34 | ||
35 | /* | 35 | /* |
36 | * Whether pci_unmap_{single,page} is a nop depends upon the | 36 | * Whether pci_unmap_{single,page} is a nop depends upon the |
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 720c48b9ee04..aa2fc375a325 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -70,9 +70,6 @@ void davinci_psc_config(unsigned int domain, unsigned int id, char enable) | |||
70 | { | 70 | { |
71 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl, mdstat_mask; | 71 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl, mdstat_mask; |
72 | 72 | ||
73 | if (id < 0) | ||
74 | return; | ||
75 | |||
76 | mdctl = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + MDCTL + 4 * id); | 73 | mdctl = davinci_readl(DAVINCI_PWR_SLEEP_CNTRL_BASE + MDCTL + 4 * id); |
77 | if (enable) | 74 | if (enable) |
78 | mdctl |= 0x00000003; /* Enable Module */ | 75 | mdctl |= 0x00000003; /* Enable Module */ |
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c index 0a152ed15a85..df8582a6231b 100644 --- a/arch/arm/mach-mx3/pcm037.c +++ b/arch/arm/mach-mx3/pcm037.c | |||
@@ -54,7 +54,7 @@ static struct platform_device pcm037_flash = { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | static struct imxuart_platform_data uart_pdata = { | 56 | static struct imxuart_platform_data uart_pdata = { |
57 | .flags = 0, | 57 | .flags = IMXUART_HAVE_RTSCTS, |
58 | }; | 58 | }; |
59 | 59 | ||
60 | static struct platform_device *devices[] __initdata = { | 60 | static struct platform_device *devices[] __initdata = { |
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c index 826010d5d014..2baeaeb0c900 100644 --- a/arch/arm/mach-omap1/mcbsp.c +++ b/arch/arm/mach-omap1/mcbsp.c | |||
@@ -159,6 +159,7 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = { | |||
159 | #ifdef CONFIG_ARCH_OMAP730 | 159 | #ifdef CONFIG_ARCH_OMAP730 |
160 | static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { | 160 | static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { |
161 | { | 161 | { |
162 | .phys_base = OMAP730_MCBSP1_BASE, | ||
162 | .virt_base = io_p2v(OMAP730_MCBSP1_BASE), | 163 | .virt_base = io_p2v(OMAP730_MCBSP1_BASE), |
163 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | 164 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, |
164 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | 165 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, |
@@ -167,6 +168,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { | |||
167 | .ops = &omap1_mcbsp_ops, | 168 | .ops = &omap1_mcbsp_ops, |
168 | }, | 169 | }, |
169 | { | 170 | { |
171 | .phys_base = OMAP730_MCBSP2_BASE, | ||
170 | .virt_base = io_p2v(OMAP730_MCBSP2_BASE), | 172 | .virt_base = io_p2v(OMAP730_MCBSP2_BASE), |
171 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | 173 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, |
172 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | 174 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, |
@@ -184,6 +186,7 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { | |||
184 | #ifdef CONFIG_ARCH_OMAP15XX | 186 | #ifdef CONFIG_ARCH_OMAP15XX |
185 | static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | 187 | static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { |
186 | { | 188 | { |
189 | .phys_base = OMAP1510_MCBSP1_BASE, | ||
187 | .virt_base = OMAP1510_MCBSP1_BASE, | 190 | .virt_base = OMAP1510_MCBSP1_BASE, |
188 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | 191 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, |
189 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | 192 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, |
@@ -193,6 +196,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
193 | .clk_name = "mcbsp_clk", | 196 | .clk_name = "mcbsp_clk", |
194 | }, | 197 | }, |
195 | { | 198 | { |
199 | .phys_base = OMAP1510_MCBSP2_BASE, | ||
196 | .virt_base = io_p2v(OMAP1510_MCBSP2_BASE), | 200 | .virt_base = io_p2v(OMAP1510_MCBSP2_BASE), |
197 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, | 201 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, |
198 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, | 202 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, |
@@ -201,6 +205,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
201 | .ops = &omap1_mcbsp_ops, | 205 | .ops = &omap1_mcbsp_ops, |
202 | }, | 206 | }, |
203 | { | 207 | { |
208 | .phys_base = OMAP1510_MCBSP3_BASE, | ||
204 | .virt_base = OMAP1510_MCBSP3_BASE, | 209 | .virt_base = OMAP1510_MCBSP3_BASE, |
205 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | 210 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, |
206 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | 211 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, |
@@ -219,6 +224,7 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { | |||
219 | #ifdef CONFIG_ARCH_OMAP16XX | 224 | #ifdef CONFIG_ARCH_OMAP16XX |
220 | static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | 225 | static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { |
221 | { | 226 | { |
227 | .phys_base = OMAP1610_MCBSP1_BASE, | ||
222 | .virt_base = OMAP1610_MCBSP1_BASE, | 228 | .virt_base = OMAP1610_MCBSP1_BASE, |
223 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, | 229 | .dma_rx_sync = OMAP_DMA_MCBSP1_RX, |
224 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, | 230 | .dma_tx_sync = OMAP_DMA_MCBSP1_TX, |
@@ -228,6 +234,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | |||
228 | .clk_name = "mcbsp_clk", | 234 | .clk_name = "mcbsp_clk", |
229 | }, | 235 | }, |
230 | { | 236 | { |
237 | .phys_base = OMAP1610_MCBSP2_BASE, | ||
231 | .virt_base = io_p2v(OMAP1610_MCBSP2_BASE), | 238 | .virt_base = io_p2v(OMAP1610_MCBSP2_BASE), |
232 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, | 239 | .dma_rx_sync = OMAP_DMA_MCBSP2_RX, |
233 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, | 240 | .dma_tx_sync = OMAP_DMA_MCBSP2_TX, |
@@ -236,6 +243,7 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { | |||
236 | .ops = &omap1_mcbsp_ops, | 243 | .ops = &omap1_mcbsp_ops, |
237 | }, | 244 | }, |
238 | { | 245 | { |
246 | .phys_base = OMAP1610_MCBSP3_BASE, | ||
239 | .virt_base = OMAP1610_MCBSP3_BASE, | 247 | .virt_base = OMAP1610_MCBSP3_BASE, |
240 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, | 248 | .dma_rx_sync = OMAP_DMA_MCBSP3_RX, |
241 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, | 249 | .dma_tx_sync = OMAP_DMA_MCBSP3_TX, |
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 27eb6e3ca926..b261f1f80b5e 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -134,6 +134,7 @@ static struct omap_mcbsp_ops omap2_mcbsp_ops = { | |||
134 | #ifdef CONFIG_ARCH_OMAP24XX | 134 | #ifdef CONFIG_ARCH_OMAP24XX |
135 | static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { | 135 | static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { |
136 | { | 136 | { |
137 | .phys_base = OMAP24XX_MCBSP1_BASE, | ||
137 | .virt_base = IO_ADDRESS(OMAP24XX_MCBSP1_BASE), | 138 | .virt_base = IO_ADDRESS(OMAP24XX_MCBSP1_BASE), |
138 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 139 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, |
139 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 140 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, |
@@ -143,6 +144,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { | |||
143 | .clk_name = "mcbsp_clk", | 144 | .clk_name = "mcbsp_clk", |
144 | }, | 145 | }, |
145 | { | 146 | { |
147 | .phys_base = OMAP24XX_MCBSP2_BASE, | ||
146 | .virt_base = IO_ADDRESS(OMAP24XX_MCBSP2_BASE), | 148 | .virt_base = IO_ADDRESS(OMAP24XX_MCBSP2_BASE), |
147 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | 149 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, |
148 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | 150 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, |
@@ -161,6 +163,7 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = { | |||
161 | #ifdef CONFIG_ARCH_OMAP34XX | 163 | #ifdef CONFIG_ARCH_OMAP34XX |
162 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | 164 | static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { |
163 | { | 165 | { |
166 | .phys_base = OMAP34XX_MCBSP1_BASE, | ||
164 | .virt_base = IO_ADDRESS(OMAP34XX_MCBSP1_BASE), | 167 | .virt_base = IO_ADDRESS(OMAP34XX_MCBSP1_BASE), |
165 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, | 168 | .dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX, |
166 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, | 169 | .dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX, |
@@ -170,6 +173,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
170 | .clk_name = "mcbsp_clk", | 173 | .clk_name = "mcbsp_clk", |
171 | }, | 174 | }, |
172 | { | 175 | { |
176 | .phys_base = OMAP34XX_MCBSP2_BASE, | ||
173 | .virt_base = IO_ADDRESS(OMAP34XX_MCBSP2_BASE), | 177 | .virt_base = IO_ADDRESS(OMAP34XX_MCBSP2_BASE), |
174 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, | 178 | .dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX, |
175 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, | 179 | .dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX, |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 5dab30eafddc..9f3ef9eb32e3 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <asm/mach/sharpsl_param.h> | 50 | #include <asm/mach/sharpsl_param.h> |
51 | 51 | ||
52 | #include "generic.h" | 52 | #include "generic.h" |
53 | #include "clock.h" | ||
53 | #include "devices.h" | 54 | #include "devices.h" |
54 | 55 | ||
55 | static unsigned long tosa_pin_config[] = { | 56 | static unsigned long tosa_pin_config[] = { |
@@ -521,6 +522,14 @@ static struct gpio_keys_button tosa_gpio_keys[] = { | |||
521 | .wakeup = 1, | 522 | .wakeup = 1, |
522 | .active_low = 1, | 523 | .active_low = 1, |
523 | }, | 524 | }, |
525 | { | ||
526 | .type = EV_SW, | ||
527 | .code = SW_HEADPHONE_INSERT, | ||
528 | .gpio = TOSA_GPIO_EAR_IN, | ||
529 | .desc = "HeadPhone insert", | ||
530 | .active_low = 1, | ||
531 | .debounce_interval = 300, | ||
532 | }, | ||
524 | }; | 533 | }; |
525 | 534 | ||
526 | static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = { | 535 | static struct gpio_keys_platform_data tosa_gpio_keys_platform_data = { |
@@ -792,6 +801,8 @@ static void __init tosa_init(void) | |||
792 | pxa_set_i2c_info(NULL); | 801 | pxa_set_i2c_info(NULL); |
793 | platform_scoop_config = &tosa_pcmcia_config; | 802 | platform_scoop_config = &tosa_pcmcia_config; |
794 | 803 | ||
804 | clk_add_alias("CLK_CK3P6MI", &tc6393xb_device.dev, "GPIO11_CLK", NULL); | ||
805 | |||
795 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 806 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
796 | } | 807 | } |
797 | 808 | ||
diff --git a/arch/arm/mach-sa1100/include/mach/jornada720.h b/arch/arm/mach-sa1100/include/mach/jornada720.h index bc120850d313..cc6b4bfcecf6 100644 --- a/arch/arm/mach-sa1100/include/mach/jornada720.h +++ b/arch/arm/mach-sa1100/include/mach/jornada720.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-sa1100/include/mach/jornada720.h | 2 | * arch/arm/mach-sa1100/include/mach/jornada720.h |
3 | * | 3 | * |
4 | * This file contains SSP/MCU communication definitions for HP Jornada 710/720/728 | 4 | * SSP/MCU communication definitions for HP Jornada 710/720/728 |
5 | * | 5 | * |
6 | * Copyright (C) 2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com> | 6 | * Copyright 2007,2008 Kristoffer Ericson <Kristoffer.Ericson@gmail.com> |
7 | * Copyright (C) 2000 John Ankcorn <jca@lcs.mit.edu> | 7 | * Copyright 2000 John Ankcorn <jca@lcs.mit.edu> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
@@ -25,3 +25,8 @@ | |||
25 | #define PWMOFF 0xDF | 25 | #define PWMOFF 0xDF |
26 | #define TXDUMMY 0x11 | 26 | #define TXDUMMY 0x11 |
27 | #define ERRORCODE 0x00 | 27 | #define ERRORCODE 0x00 |
28 | |||
29 | extern void jornada_ssp_start(void); | ||
30 | extern void jornada_ssp_end(void); | ||
31 | extern int jornada_ssp_inout(u8 byte); | ||
32 | extern int jornada_ssp_byte(u8 byte); | ||
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c index 06ea7abd9170..28cf36967977 100644 --- a/arch/arm/mach-sa1100/jornada720_ssp.c +++ b/arch/arm/mach-sa1100/jornada720_ssp.c | |||
@@ -21,8 +21,8 @@ | |||
21 | #include <linux/slab.h> | 21 | #include <linux/slab.h> |
22 | 22 | ||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <asm/hardware/ssp.h> | ||
25 | #include <mach/jornada720.h> | 24 | #include <mach/jornada720.h> |
25 | #include <asm/hardware/ssp.h> | ||
26 | 26 | ||
27 | static DEFINE_SPINLOCK(jornada_ssp_lock); | 27 | static DEFINE_SPINLOCK(jornada_ssp_lock); |
28 | static unsigned long jornada_ssp_flags; | 28 | static unsigned long jornada_ssp_flags; |
@@ -109,12 +109,12 @@ EXPORT_SYMBOL(jornada_ssp_inout); | |||
109 | * jornada_ssp_start - enable mcu | 109 | * jornada_ssp_start - enable mcu |
110 | * | 110 | * |
111 | */ | 111 | */ |
112 | int jornada_ssp_start() | 112 | void jornada_ssp_start(void) |
113 | { | 113 | { |
114 | spin_lock_irqsave(&jornada_ssp_lock, jornada_ssp_flags); | 114 | spin_lock_irqsave(&jornada_ssp_lock, jornada_ssp_flags); |
115 | GPCR = GPIO_GPIO25; | 115 | GPCR = GPIO_GPIO25; |
116 | udelay(50); | 116 | udelay(50); |
117 | return 0; | 117 | return; |
118 | }; | 118 | }; |
119 | EXPORT_SYMBOL(jornada_ssp_start); | 119 | EXPORT_SYMBOL(jornada_ssp_start); |
120 | 120 | ||
@@ -122,11 +122,11 @@ EXPORT_SYMBOL(jornada_ssp_start); | |||
122 | * jornada_ssp_end - disable mcu and turn off lock | 122 | * jornada_ssp_end - disable mcu and turn off lock |
123 | * | 123 | * |
124 | */ | 124 | */ |
125 | int jornada_ssp_end() | 125 | void jornada_ssp_end(void) |
126 | { | 126 | { |
127 | GPSR = GPIO_GPIO25; | 127 | GPSR = GPIO_GPIO25; |
128 | spin_unlock_irqrestore(&jornada_ssp_lock, jornada_ssp_flags); | 128 | spin_unlock_irqrestore(&jornada_ssp_lock, jornada_ssp_flags); |
129 | return 0; | 129 | return; |
130 | }; | 130 | }; |
131 | EXPORT_SYMBOL(jornada_ssp_end); | 131 | EXPORT_SYMBOL(jornada_ssp_end); |
132 | 132 | ||
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 25d9a11eb617..a713e40e1f1a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -211,6 +211,12 @@ static struct mem_type mem_types[] = { | |||
211 | PMD_SECT_TEX(1), | 211 | PMD_SECT_TEX(1), |
212 | .domain = DOMAIN_IO, | 212 | .domain = DOMAIN_IO, |
213 | }, | 213 | }, |
214 | [MT_DEVICE_WC] = { /* ioremap_wc */ | ||
215 | .prot_pte = PROT_PTE_DEVICE, | ||
216 | .prot_l1 = PMD_TYPE_TABLE, | ||
217 | .prot_sect = PROT_SECT_DEVICE, | ||
218 | .domain = DOMAIN_IO, | ||
219 | }, | ||
214 | [MT_CACHECLEAN] = { | 220 | [MT_CACHECLEAN] = { |
215 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, | 221 | .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN, |
216 | .domain = DOMAIN_KERNEL, | 222 | .domain = DOMAIN_KERNEL, |
@@ -273,6 +279,20 @@ static void __init build_mem_type_table(void) | |||
273 | } | 279 | } |
274 | 280 | ||
275 | /* | 281 | /* |
282 | * On non-Xscale3 ARMv5-and-older systems, use CB=01 | ||
283 | * (Uncached/Buffered) for ioremap_wc() mappings. On XScale3 | ||
284 | * and ARMv6+, use TEXCB=00100 mappings (Inner/Outer Uncacheable | ||
285 | * in xsc3 parlance, Uncached Normal in ARMv6 parlance). | ||
286 | */ | ||
287 | if (cpu_is_xsc3() || cpu_arch >= CPU_ARCH_ARMv6) { | ||
288 | mem_types[MT_DEVICE_WC].prot_pte_ext |= PTE_EXT_TEX(1); | ||
289 | mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_TEX(1); | ||
290 | } else { | ||
291 | mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_BUFFERABLE; | ||
292 | mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_BUFFERABLE; | ||
293 | } | ||
294 | |||
295 | /* | ||
276 | * ARMv5 and lower, bit 4 must be set for page tables. | 296 | * ARMv5 and lower, bit 4 must be set for page tables. |
277 | * (was: cache "update-able on write" bit on ARM610) | 297 | * (was: cache "update-able on write" bit on ARM610) |
278 | * However, Xscale cores require this bit to be cleared. | 298 | * However, Xscale cores require this bit to be cleared. |
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c index 2f8627218839..0a38f0b396eb 100644 --- a/arch/arm/plat-mxc/clock.c +++ b/arch/arm/plat-mxc/clock.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/proc_fs.h> | 37 | #include <linux/proc_fs.h> |
38 | #include <linux/semaphore.h> | 38 | #include <linux/semaphore.h> |
39 | #include <linux/string.h> | 39 | #include <linux/string.h> |
40 | #include <linux/version.h> | ||
41 | 40 | ||
42 | #include <mach/clock.h> | 41 | #include <mach/clock.h> |
43 | 42 | ||
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index 187e3d8bfdfe..01da719a7453 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include <mach/tc.h> | 22 | #include <mach/tc.h> |
23 | #include <mach/board.h> | 23 | #include <mach/board.h> |
24 | #include <mach/mmc.h> | ||
24 | #include <mach/mux.h> | 25 | #include <mach/mux.h> |
25 | #include <mach/gpio.h> | 26 | #include <mach/gpio.h> |
26 | #include <mach/menelaus.h> | 27 | #include <mach/menelaus.h> |
@@ -194,25 +195,38 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config, | |||
194 | 195 | ||
195 | /*-------------------------------------------------------------------------*/ | 196 | /*-------------------------------------------------------------------------*/ |
196 | 197 | ||
197 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) | 198 | #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \ |
199 | defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) | ||
198 | 200 | ||
199 | #ifdef CONFIG_ARCH_OMAP24XX | 201 | #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) |
200 | #define OMAP_MMC1_BASE 0x4809c000 | 202 | #define OMAP_MMC1_BASE 0x4809c000 |
201 | #define OMAP_MMC1_INT INT_24XX_MMC_IRQ | 203 | #define OMAP_MMC1_END (OMAP_MMC1_BASE + 0x1fc) |
204 | #define OMAP_MMC1_INT INT_24XX_MMC_IRQ | ||
205 | |||
206 | #define OMAP_MMC2_BASE 0x480b4000 | ||
207 | #define OMAP_MMC2_END (OMAP_MMC2_BASE + 0x1fc) | ||
208 | #define OMAP_MMC2_INT INT_24XX_MMC2_IRQ | ||
209 | |||
202 | #else | 210 | #else |
211 | |||
203 | #define OMAP_MMC1_BASE 0xfffb7800 | 212 | #define OMAP_MMC1_BASE 0xfffb7800 |
213 | #define OMAP_MMC1_END (OMAP_MMC1_BASE + 0x7f) | ||
204 | #define OMAP_MMC1_INT INT_MMC | 214 | #define OMAP_MMC1_INT INT_MMC |
205 | #endif | 215 | |
206 | #define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */ | 216 | #define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */ |
217 | #define OMAP_MMC2_END (OMAP_MMC2_BASE + 0x7f) | ||
218 | #define OMAP_MMC2_INT INT_1610_MMC2 | ||
219 | |||
220 | #endif | ||
207 | 221 | ||
208 | static struct omap_mmc_conf mmc1_conf; | 222 | static struct omap_mmc_platform_data mmc1_data; |
209 | 223 | ||
210 | static u64 mmc1_dmamask = 0xffffffff; | 224 | static u64 mmc1_dmamask = 0xffffffff; |
211 | 225 | ||
212 | static struct resource mmc1_resources[] = { | 226 | static struct resource mmc1_resources[] = { |
213 | { | 227 | { |
214 | .start = OMAP_MMC1_BASE, | 228 | .start = OMAP_MMC1_BASE, |
215 | .end = OMAP_MMC1_BASE + 0x7f, | 229 | .end = OMAP_MMC1_END, |
216 | .flags = IORESOURCE_MEM, | 230 | .flags = IORESOURCE_MEM, |
217 | }, | 231 | }, |
218 | { | 232 | { |
@@ -226,26 +240,27 @@ static struct platform_device mmc_omap_device1 = { | |||
226 | .id = 1, | 240 | .id = 1, |
227 | .dev = { | 241 | .dev = { |
228 | .dma_mask = &mmc1_dmamask, | 242 | .dma_mask = &mmc1_dmamask, |
229 | .platform_data = &mmc1_conf, | 243 | .platform_data = &mmc1_data, |
230 | }, | 244 | }, |
231 | .num_resources = ARRAY_SIZE(mmc1_resources), | 245 | .num_resources = ARRAY_SIZE(mmc1_resources), |
232 | .resource = mmc1_resources, | 246 | .resource = mmc1_resources, |
233 | }; | 247 | }; |
234 | 248 | ||
235 | #ifdef CONFIG_ARCH_OMAP16XX | 249 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2430) || \ |
250 | defined(CONFIG_ARCH_OMAP34XX) | ||
236 | 251 | ||
237 | static struct omap_mmc_conf mmc2_conf; | 252 | static struct omap_mmc_platform_data mmc2_data; |
238 | 253 | ||
239 | static u64 mmc2_dmamask = 0xffffffff; | 254 | static u64 mmc2_dmamask = 0xffffffff; |
240 | 255 | ||
241 | static struct resource mmc2_resources[] = { | 256 | static struct resource mmc2_resources[] = { |
242 | { | 257 | { |
243 | .start = OMAP_MMC2_BASE, | 258 | .start = OMAP_MMC2_BASE, |
244 | .end = OMAP_MMC2_BASE + 0x7f, | 259 | .end = OMAP_MMC2_END, |
245 | .flags = IORESOURCE_MEM, | 260 | .flags = IORESOURCE_MEM, |
246 | }, | 261 | }, |
247 | { | 262 | { |
248 | .start = INT_1610_MMC2, | 263 | .start = OMAP_MMC2_INT, |
249 | .flags = IORESOURCE_IRQ, | 264 | .flags = IORESOURCE_IRQ, |
250 | }, | 265 | }, |
251 | }; | 266 | }; |
@@ -255,26 +270,19 @@ static struct platform_device mmc_omap_device2 = { | |||
255 | .id = 2, | 270 | .id = 2, |
256 | .dev = { | 271 | .dev = { |
257 | .dma_mask = &mmc2_dmamask, | 272 | .dma_mask = &mmc2_dmamask, |
258 | .platform_data = &mmc2_conf, | 273 | .platform_data = &mmc2_data, |
259 | }, | 274 | }, |
260 | .num_resources = ARRAY_SIZE(mmc2_resources), | 275 | .num_resources = ARRAY_SIZE(mmc2_resources), |
261 | .resource = mmc2_resources, | 276 | .resource = mmc2_resources, |
262 | }; | 277 | }; |
263 | #endif | 278 | #endif |
264 | 279 | ||
265 | static void __init omap_init_mmc(void) | 280 | static inline void omap_init_mmc_conf(const struct omap_mmc_config *mmc_conf) |
266 | { | 281 | { |
267 | const struct omap_mmc_config *mmc_conf; | 282 | if (cpu_is_omap2430() || cpu_is_omap34xx()) |
268 | const struct omap_mmc_conf *mmc; | ||
269 | |||
270 | /* NOTE: assumes MMC was never (wrongly) enabled */ | ||
271 | mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config); | ||
272 | if (!mmc_conf) | ||
273 | return; | 283 | return; |
274 | 284 | ||
275 | /* block 1 is always available and has just one pinout option */ | 285 | if (mmc_conf->mmc[0].enabled) { |
276 | mmc = &mmc_conf->mmc[0]; | ||
277 | if (mmc->enabled) { | ||
278 | if (cpu_is_omap24xx()) { | 286 | if (cpu_is_omap24xx()) { |
279 | omap_cfg_reg(H18_24XX_MMC_CMD); | 287 | omap_cfg_reg(H18_24XX_MMC_CMD); |
280 | omap_cfg_reg(H15_24XX_MMC_CLKI); | 288 | omap_cfg_reg(H15_24XX_MMC_CLKI); |
@@ -292,7 +300,7 @@ static void __init omap_init_mmc(void) | |||
292 | omap_cfg_reg(P20_1710_MMC_DATDIR0); | 300 | omap_cfg_reg(P20_1710_MMC_DATDIR0); |
293 | } | 301 | } |
294 | } | 302 | } |
295 | if (mmc->wire4) { | 303 | if (mmc_conf->mmc[0].wire4) { |
296 | if (cpu_is_omap24xx()) { | 304 | if (cpu_is_omap24xx()) { |
297 | omap_cfg_reg(H14_24XX_MMC_DAT1); | 305 | omap_cfg_reg(H14_24XX_MMC_DAT1); |
298 | omap_cfg_reg(E19_24XX_MMC_DAT2); | 306 | omap_cfg_reg(E19_24XX_MMC_DAT2); |
@@ -303,25 +311,22 @@ static void __init omap_init_mmc(void) | |||
303 | } else { | 311 | } else { |
304 | omap_cfg_reg(MMC_DAT1); | 312 | omap_cfg_reg(MMC_DAT1); |
305 | /* NOTE: DAT2 can be on W10 (here) or M15 */ | 313 | /* NOTE: DAT2 can be on W10 (here) or M15 */ |
306 | if (!mmc->nomux) | 314 | if (!mmc_conf->mmc[0].nomux) |
307 | omap_cfg_reg(MMC_DAT2); | 315 | omap_cfg_reg(MMC_DAT2); |
308 | omap_cfg_reg(MMC_DAT3); | 316 | omap_cfg_reg(MMC_DAT3); |
309 | } | 317 | } |
310 | } | 318 | } |
311 | mmc1_conf = *mmc; | ||
312 | (void) platform_device_register(&mmc_omap_device1); | ||
313 | } | 319 | } |
314 | 320 | ||
315 | #ifdef CONFIG_ARCH_OMAP16XX | 321 | #ifdef CONFIG_ARCH_OMAP16XX |
316 | /* block 2 is on newer chips, and has many pinout options */ | 322 | /* block 2 is on newer chips, and has many pinout options */ |
317 | mmc = &mmc_conf->mmc[1]; | 323 | if (mmc_conf->mmc[1].enabled) { |
318 | if (mmc->enabled) { | 324 | if (!mmc_conf->mmc[1].nomux) { |
319 | if (!mmc->nomux) { | ||
320 | omap_cfg_reg(Y8_1610_MMC2_CMD); | 325 | omap_cfg_reg(Y8_1610_MMC2_CMD); |
321 | omap_cfg_reg(Y10_1610_MMC2_CLK); | 326 | omap_cfg_reg(Y10_1610_MMC2_CLK); |
322 | omap_cfg_reg(R18_1610_MMC2_CLKIN); | 327 | omap_cfg_reg(R18_1610_MMC2_CLKIN); |
323 | omap_cfg_reg(W8_1610_MMC2_DAT0); | 328 | omap_cfg_reg(W8_1610_MMC2_DAT0); |
324 | if (mmc->wire4) { | 329 | if (mmc_conf->mmc[1].wire4) { |
325 | omap_cfg_reg(V8_1610_MMC2_DAT1); | 330 | omap_cfg_reg(V8_1610_MMC2_DAT1); |
326 | omap_cfg_reg(W15_1610_MMC2_DAT2); | 331 | omap_cfg_reg(W15_1610_MMC2_DAT2); |
327 | omap_cfg_reg(R10_1610_MMC2_DAT3); | 332 | omap_cfg_reg(R10_1610_MMC2_DAT3); |
@@ -337,14 +342,55 @@ static void __init omap_init_mmc(void) | |||
337 | if (cpu_is_omap1710()) | 342 | if (cpu_is_omap1710()) |
338 | omap_writel(omap_readl(MOD_CONF_CTRL_1) | (1 << 24), | 343 | omap_writel(omap_readl(MOD_CONF_CTRL_1) | (1 << 24), |
339 | MOD_CONF_CTRL_1); | 344 | MOD_CONF_CTRL_1); |
340 | mmc2_conf = *mmc; | 345 | } |
346 | #endif | ||
347 | } | ||
348 | |||
349 | static void __init omap_init_mmc(void) | ||
350 | { | ||
351 | const struct omap_mmc_config *mmc_conf; | ||
352 | |||
353 | /* NOTE: assumes MMC was never (wrongly) enabled */ | ||
354 | mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config); | ||
355 | if (!mmc_conf) | ||
356 | return; | ||
357 | |||
358 | omap_init_mmc_conf(mmc_conf); | ||
359 | |||
360 | if (mmc_conf->mmc[0].enabled) { | ||
361 | mmc1_data.conf = mmc_conf->mmc[0]; | ||
362 | (void) platform_device_register(&mmc_omap_device1); | ||
363 | } | ||
364 | |||
365 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2430) || \ | ||
366 | defined(CONFIG_ARCH_OMAP34XX) | ||
367 | if (mmc_conf->mmc[1].enabled) { | ||
368 | mmc2_data.conf = mmc_conf->mmc[1]; | ||
341 | (void) platform_device_register(&mmc_omap_device2); | 369 | (void) platform_device_register(&mmc_omap_device2); |
342 | } | 370 | } |
343 | #endif | 371 | #endif |
344 | return; | ||
345 | } | 372 | } |
373 | |||
374 | void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info) | ||
375 | { | ||
376 | switch (host) { | ||
377 | case 1: | ||
378 | mmc1_data = *info; | ||
379 | break; | ||
380 | #if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2430) || \ | ||
381 | defined(CONFIG_ARCH_OMAP34XX) | ||
382 | case 2: | ||
383 | mmc2_data = *info; | ||
384 | break; | ||
385 | #endif | ||
386 | default: | ||
387 | BUG(); | ||
388 | } | ||
389 | } | ||
390 | |||
346 | #else | 391 | #else |
347 | static inline void omap_init_mmc(void) {} | 392 | static inline void omap_init_mmc(void) {} |
393 | void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info) {} | ||
348 | #endif | 394 | #endif |
349 | 395 | ||
350 | /*-------------------------------------------------------------------------*/ | 396 | /*-------------------------------------------------------------------------*/ |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 3e76ee2bc731..9e1341ebc14e 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -1488,7 +1488,7 @@ static int __init _omap_gpio_init(void) | |||
1488 | bank->chip.set = gpio_set; | 1488 | bank->chip.set = gpio_set; |
1489 | if (bank_is_mpuio(bank)) { | 1489 | if (bank_is_mpuio(bank)) { |
1490 | bank->chip.label = "mpuio"; | 1490 | bank->chip.label = "mpuio"; |
1491 | #ifdef CONFIG_ARCH_OMAP1 | 1491 | #ifdef CONFIG_ARCH_OMAP16XX |
1492 | bank->chip.dev = &omap_mpuio_device.dev; | 1492 | bank->chip.dev = &omap_mpuio_device.dev; |
1493 | #endif | 1493 | #endif |
1494 | bank->chip.base = OMAP_MPUIO(0); | 1494 | bank->chip.base = OMAP_MPUIO(0); |
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h index 6eb44a92871d..8fdb95e26fcd 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/mach/mcbsp.h | |||
@@ -315,6 +315,7 @@ struct omap_mcbsp_ops { | |||
315 | }; | 315 | }; |
316 | 316 | ||
317 | struct omap_mcbsp_platform_data { | 317 | struct omap_mcbsp_platform_data { |
318 | unsigned long phys_base; | ||
318 | u32 virt_base; | 319 | u32 virt_base; |
319 | u8 dma_rx_sync, dma_tx_sync; | 320 | u8 dma_rx_sync, dma_tx_sync; |
320 | u16 rx_irq, tx_irq; | 321 | u16 rx_irq, tx_irq; |
@@ -324,6 +325,7 @@ struct omap_mcbsp_platform_data { | |||
324 | 325 | ||
325 | struct omap_mcbsp { | 326 | struct omap_mcbsp { |
326 | struct device *dev; | 327 | struct device *dev; |
328 | unsigned long phys_base; | ||
327 | u32 io_base; | 329 | u32 io_base; |
328 | u8 id; | 330 | u8 id; |
329 | u8 free; | 331 | u8 free; |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index d0844050f2d2..014d26574bb6 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -651,7 +651,7 @@ int omap_mcbsp_xmit_buffer(unsigned int id, dma_addr_t buffer, | |||
651 | omap_set_dma_dest_params(mcbsp[id].dma_tx_lch, | 651 | omap_set_dma_dest_params(mcbsp[id].dma_tx_lch, |
652 | src_port, | 652 | src_port, |
653 | OMAP_DMA_AMODE_CONSTANT, | 653 | OMAP_DMA_AMODE_CONSTANT, |
654 | mcbsp[id].io_base + OMAP_MCBSP_REG_DXR1, | 654 | mcbsp[id].phys_base + OMAP_MCBSP_REG_DXR1, |
655 | 0, 0); | 655 | 0, 0); |
656 | 656 | ||
657 | omap_set_dma_src_params(mcbsp[id].dma_tx_lch, | 657 | omap_set_dma_src_params(mcbsp[id].dma_tx_lch, |
@@ -712,7 +712,7 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, | |||
712 | omap_set_dma_src_params(mcbsp[id].dma_rx_lch, | 712 | omap_set_dma_src_params(mcbsp[id].dma_rx_lch, |
713 | src_port, | 713 | src_port, |
714 | OMAP_DMA_AMODE_CONSTANT, | 714 | OMAP_DMA_AMODE_CONSTANT, |
715 | mcbsp[id].io_base + OMAP_MCBSP_REG_DRR1, | 715 | mcbsp[id].phys_base + OMAP_MCBSP_REG_DRR1, |
716 | 0, 0); | 716 | 0, 0); |
717 | 717 | ||
718 | omap_set_dma_dest_params(mcbsp[id].dma_rx_lch, | 718 | omap_set_dma_dest_params(mcbsp[id].dma_rx_lch, |
@@ -830,6 +830,7 @@ static int __init omap_mcbsp_probe(struct platform_device *pdev) | |||
830 | mcbsp[id].dma_tx_lch = -1; | 830 | mcbsp[id].dma_tx_lch = -1; |
831 | mcbsp[id].dma_rx_lch = -1; | 831 | mcbsp[id].dma_rx_lch = -1; |
832 | 832 | ||
833 | mcbsp[id].phys_base = pdata->phys_base; | ||
833 | mcbsp[id].io_base = pdata->virt_base; | 834 | mcbsp[id].io_base = pdata->virt_base; |
834 | /* Default I/O is IRQ based */ | 835 | /* Default I/O is IRQ based */ |
835 | mcbsp[id].io_type = OMAP_MCBSP_IRQ_IO; | 836 | mcbsp[id].io_type = OMAP_MCBSP_IRQ_IO; |
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index ee4c292683e1..dfc3443e23aa 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -325,7 +325,7 @@ static int __init atstk1002_init(void) | |||
325 | #ifdef CONFIG_BOARD_ATSTK100X_SPI1 | 325 | #ifdef CONFIG_BOARD_ATSTK100X_SPI1 |
326 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 326 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
327 | #endif | 327 | #endif |
328 | #ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM | 328 | #ifndef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
329 | at32_add_device_mci(0, MCI_PDATA); | 329 | at32_add_device_mci(0, MCI_PDATA); |
330 | #endif | 330 | #endif |
331 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM | 331 | #ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM |
diff --git a/arch/avr32/boot/images/.gitignore b/arch/avr32/boot/images/.gitignore new file mode 100644 index 000000000000..64ea9d0141d2 --- /dev/null +++ b/arch/avr32/boot/images/.gitignore | |||
@@ -0,0 +1,4 @@ | |||
1 | uImage | ||
2 | uImage.srec | ||
3 | vmlinux.cso | ||
4 | sfdwarf.log | ||
diff --git a/arch/avr32/kernel/.gitignore b/arch/avr32/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/avr32/kernel/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.lds | |||
diff --git a/arch/avr32/kernel/asm-offsets.c b/arch/avr32/kernel/asm-offsets.c index e4796c67a831..d6a8193a1d2f 100644 --- a/arch/avr32/kernel/asm-offsets.c +++ b/arch/avr32/kernel/asm-offsets.c | |||
@@ -4,6 +4,8 @@ | |||
4 | * to extract and format the required data. | 4 | * to extract and format the required data. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/mm.h> | ||
8 | #include <linux/sched.h> | ||
7 | #include <linux/thread_info.h> | 9 | #include <linux/thread_info.h> |
8 | #include <linux/kbuild.h> | 10 | #include <linux/kbuild.h> |
9 | 11 | ||
@@ -17,4 +19,8 @@ void foo(void) | |||
17 | OFFSET(TI_rar_saved, thread_info, rar_saved); | 19 | OFFSET(TI_rar_saved, thread_info, rar_saved); |
18 | OFFSET(TI_rsr_saved, thread_info, rsr_saved); | 20 | OFFSET(TI_rsr_saved, thread_info, rsr_saved); |
19 | OFFSET(TI_restart_block, thread_info, restart_block); | 21 | OFFSET(TI_restart_block, thread_info, restart_block); |
22 | BLANK(); | ||
23 | OFFSET(TSK_active_mm, task_struct, active_mm); | ||
24 | BLANK(); | ||
25 | OFFSET(MM_pgd, mm_struct, pgd); | ||
20 | } | 26 | } |
diff --git a/arch/avr32/kernel/avr32_ksyms.c b/arch/avr32/kernel/avr32_ksyms.c index 84a7d44edc67..11e310c567a9 100644 --- a/arch/avr32/kernel/avr32_ksyms.c +++ b/arch/avr32/kernel/avr32_ksyms.c | |||
@@ -58,6 +58,7 @@ EXPORT_SYMBOL(find_first_zero_bit); | |||
58 | EXPORT_SYMBOL(find_next_zero_bit); | 58 | EXPORT_SYMBOL(find_next_zero_bit); |
59 | EXPORT_SYMBOL(find_first_bit); | 59 | EXPORT_SYMBOL(find_first_bit); |
60 | EXPORT_SYMBOL(find_next_bit); | 60 | EXPORT_SYMBOL(find_next_bit); |
61 | EXPORT_SYMBOL(generic_find_next_le_bit); | ||
61 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); | 62 | EXPORT_SYMBOL(generic_find_next_zero_le_bit); |
62 | 63 | ||
63 | /* I/O primitives (lib/io-*.S) */ | 64 | /* I/O primitives (lib/io-*.S) */ |
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S index 2b398cae110c..33d49377b8be 100644 --- a/arch/avr32/kernel/entry-avr32b.S +++ b/arch/avr32/kernel/entry-avr32b.S | |||
@@ -334,9 +334,64 @@ save_full_context_ex: | |||
334 | 334 | ||
335 | /* Low-level exception handlers */ | 335 | /* Low-level exception handlers */ |
336 | handle_critical: | 336 | handle_critical: |
337 | /* | ||
338 | * AT32AP700x errata: | ||
339 | * | ||
340 | * After a Java stack overflow or underflow trap, any CPU | ||
341 | * memory access may cause erratic behavior. This will happen | ||
342 | * when the four least significant bits of the JOSP system | ||
343 | * register contains any value between 9 and 15 (inclusive). | ||
344 | * | ||
345 | * Possible workarounds: | ||
346 | * - Don't use the Java Extension Module | ||
347 | * - Ensure that the stack overflow and underflow trap | ||
348 | * handlers do not do any memory access or trigger any | ||
349 | * exceptions before the overflow/underflow condition is | ||
350 | * cleared (by incrementing or decrementing the JOSP) | ||
351 | * - Make sure that JOSP does not contain any problematic | ||
352 | * value before doing any exception or interrupt | ||
353 | * processing. | ||
354 | * - Set up a critical exception handler which writes a | ||
355 | * known-to-be-safe value, e.g. 4, to JOSP before doing | ||
356 | * any further processing. | ||
357 | * | ||
358 | * We'll use the last workaround for now since we cannot | ||
359 | * guarantee that user space processes don't use Java mode. | ||
360 | * Non-well-behaving userland will be terminated with extreme | ||
361 | * prejudice. | ||
362 | */ | ||
363 | #ifdef CONFIG_CPU_AT32AP700X | ||
364 | /* | ||
365 | * There's a chance we can't touch memory, so temporarily | ||
366 | * borrow PTBR to save the stack pointer while we fix things | ||
367 | * up... | ||
368 | */ | ||
369 | mtsr SYSREG_PTBR, sp | ||
370 | mov sp, 4 | ||
371 | mtsr SYSREG_JOSP, sp | ||
372 | mfsr sp, SYSREG_PTBR | ||
373 | sub pc, -2 | ||
374 | |||
375 | /* Push most of pt_regs on stack. We'll do the rest later */ | ||
337 | sub sp, 4 | 376 | sub sp, 4 |
338 | stmts --sp, r0-lr | 377 | pushm r0-r12 |
339 | rcall save_full_context_ex | 378 | |
379 | /* PTBR mirrors current_thread_info()->task->active_mm->pgd */ | ||
380 | get_thread_info r0 | ||
381 | ld.w r1, r0[TI_task] | ||
382 | ld.w r2, r1[TSK_active_mm] | ||
383 | ld.w r3, r2[MM_pgd] | ||
384 | mtsr SYSREG_PTBR, r3 | ||
385 | #else | ||
386 | sub sp, 4 | ||
387 | pushm r0-r12 | ||
388 | #endif | ||
389 | sub r0, sp, -(14 * 4) | ||
390 | mov r1, lr | ||
391 | mfsr r2, SYSREG_RAR_EX | ||
392 | mfsr r3, SYSREG_RSR_EX | ||
393 | pushm r0-r3 | ||
394 | |||
340 | mfsr r12, SYSREG_ECR | 395 | mfsr r12, SYSREG_ECR |
341 | mov r11, sp | 396 | mov r11, sp |
342 | rcall do_critical_exception | 397 | rcall do_critical_exception |
diff --git a/arch/avr32/kernel/syscall-stubs.S b/arch/avr32/kernel/syscall-stubs.S index 890286a1e62b..673178e235f3 100644 --- a/arch/avr32/kernel/syscall-stubs.S +++ b/arch/avr32/kernel/syscall-stubs.S | |||
@@ -109,3 +109,12 @@ __sys_epoll_pwait: | |||
109 | rcall sys_epoll_pwait | 109 | rcall sys_epoll_pwait |
110 | sub sp, -4 | 110 | sub sp, -4 |
111 | popm pc | 111 | popm pc |
112 | |||
113 | .global __sys_sync_file_range | ||
114 | .type __sys_sync_file_range,@function | ||
115 | __sys_sync_file_range: | ||
116 | pushm lr | ||
117 | st.w --sp, ARG6 | ||
118 | rcall sys_sync_file_range | ||
119 | sub sp, -4 | ||
120 | popm pc | ||
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index 478bda4c4a09..7ee0057613b3 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S | |||
@@ -275,7 +275,7 @@ sys_call_table: | |||
275 | .long sys_set_robust_list | 275 | .long sys_set_robust_list |
276 | .long sys_get_robust_list /* 260 */ | 276 | .long sys_get_robust_list /* 260 */ |
277 | .long __sys_splice | 277 | .long __sys_splice |
278 | .long sys_sync_file_range | 278 | .long __sys_sync_file_range |
279 | .long sys_tee | 279 | .long sys_tee |
280 | .long sys_vmsplice | 280 | .long sys_vmsplice |
281 | .long __sys_epoll_pwait /* 265 */ | 281 | .long __sys_epoll_pwait /* 265 */ |
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c index b835c4c01368..0d987373bc01 100644 --- a/arch/avr32/kernel/traps.c +++ b/arch/avr32/kernel/traps.c | |||
@@ -116,15 +116,15 @@ asmlinkage void do_nmi(unsigned long ecr, struct pt_regs *regs) | |||
116 | switch (ret) { | 116 | switch (ret) { |
117 | case NOTIFY_OK: | 117 | case NOTIFY_OK: |
118 | case NOTIFY_STOP: | 118 | case NOTIFY_STOP: |
119 | return; | 119 | break; |
120 | case NOTIFY_BAD: | 120 | case NOTIFY_BAD: |
121 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); | 121 | die("Fatal Non-Maskable Interrupt", regs, SIGINT); |
122 | default: | 122 | default: |
123 | printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n"); | ||
124 | nmi_disable(); | ||
123 | break; | 125 | break; |
124 | } | 126 | } |
125 | 127 | nmi_exit(); | |
126 | printk(KERN_ALERT "Got NMI, but nobody cared. Disabling...\n"); | ||
127 | nmi_disable(); | ||
128 | } | 128 | } |
129 | 129 | ||
130 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) | 130 | asmlinkage void do_critical_exception(unsigned long ecr, struct pt_regs *regs) |
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S index c6b91dee857c..997b33b2288a 100644 --- a/arch/avr32/lib/findbit.S +++ b/arch/avr32/lib/findbit.S | |||
@@ -123,6 +123,36 @@ ENTRY(find_next_bit) | |||
123 | brgt 1b | 123 | brgt 1b |
124 | retal r11 | 124 | retal r11 |
125 | 125 | ||
126 | ENTRY(generic_find_next_le_bit) | ||
127 | lsr r8, r10, 5 | ||
128 | sub r9, r11, r10 | ||
129 | retle r11 | ||
130 | |||
131 | lsl r8, 2 | ||
132 | add r12, r8 | ||
133 | andl r10, 31, COH | ||
134 | breq 1f | ||
135 | |||
136 | /* offset is not word-aligned. Handle the first (32 - r10) bits */ | ||
137 | ldswp.w r8, r12[0] | ||
138 | sub r12, -4 | ||
139 | lsr r8, r8, r10 | ||
140 | brne .L_found | ||
141 | |||
142 | /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */ | ||
143 | add r9, r10 | ||
144 | sub r9, 32 | ||
145 | retle r11 | ||
146 | |||
147 | /* Main loop. offset must be word-aligned */ | ||
148 | 1: ldswp.w r8, r12[0] | ||
149 | cp.w r8, 0 | ||
150 | brne .L_found | ||
151 | sub r12, -4 | ||
152 | sub r9, 32 | ||
153 | brgt 1b | ||
154 | retal r11 | ||
155 | |||
126 | ENTRY(generic_find_next_zero_le_bit) | 156 | ENTRY(generic_find_next_zero_le_bit) |
127 | lsr r8, r10, 5 | 157 | lsr r8, r10, 5 |
128 | sub r9, r11, r10 | 158 | sub r9, r11, r10 |
diff --git a/arch/avr32/mach-at32ap/pm-at32ap700x.S b/arch/avr32/mach-at32ap/pm-at32ap700x.S index 5be4de65b209..17503b0ed6c9 100644 --- a/arch/avr32/mach-at32ap/pm-at32ap700x.S +++ b/arch/avr32/mach-at32ap/pm-at32ap700x.S | |||
@@ -134,7 +134,7 @@ pm_standby: | |||
134 | mov r11, SDRAMC_LPR_LPCB_SELF_RFR | 134 | mov r11, SDRAMC_LPR_LPCB_SELF_RFR |
135 | bfins r10, r11, 0, 2 /* LPCB <- self Refresh */ | 135 | bfins r10, r11, 0, 2 /* LPCB <- self Refresh */ |
136 | sync 0 /* flush write buffer */ | 136 | sync 0 /* flush write buffer */ |
137 | st.w r12[SDRAMC_LPR], r11 /* put SDRAM in self-refresh mode */ | 137 | st.w r12[SDRAMC_LPR], r10 /* put SDRAM in self-refresh mode */ |
138 | ld.w r11, r12[SDRAMC_LPR] | 138 | ld.w r11, r12[SDRAMC_LPR] |
139 | unmask_interrupts | 139 | unmask_interrupts |
140 | sleep CPU_SLEEP_FROZEN | 140 | sleep CPU_SLEEP_FROZEN |
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h index 5e0c1a6bce8d..2acb6b6543c9 100644 --- a/arch/ia64/include/asm/elf.h +++ b/arch/ia64/include/asm/elf.h | |||
@@ -266,4 +266,19 @@ do { \ | |||
266 | } \ | 266 | } \ |
267 | } while (0) | 267 | } while (0) |
268 | 268 | ||
269 | /* | ||
270 | * format for entries in the Global Offset Table | ||
271 | */ | ||
272 | struct got_entry { | ||
273 | uint64_t val; | ||
274 | }; | ||
275 | |||
276 | /* | ||
277 | * Layout of the Function Descriptor | ||
278 | */ | ||
279 | struct fdesc { | ||
280 | uint64_t ip; | ||
281 | uint64_t gp; | ||
282 | }; | ||
283 | |||
269 | #endif /* _ASM_IA64_ELF_H */ | 284 | #endif /* _ASM_IA64_ELF_H */ |
diff --git a/arch/ia64/include/asm/sections.h b/arch/ia64/include/asm/sections.h index 7286e4a9fe84..f66799891036 100644 --- a/arch/ia64/include/asm/sections.h +++ b/arch/ia64/include/asm/sections.h | |||
@@ -6,6 +6,8 @@ | |||
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | 6 | * David Mosberger-Tang <davidm@hpl.hp.com> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/elf.h> | ||
10 | #include <linux/uaccess.h> | ||
9 | #include <asm-generic/sections.h> | 11 | #include <asm-generic/sections.h> |
10 | 12 | ||
11 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; | 13 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; |
@@ -21,5 +23,17 @@ extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_b | |||
21 | extern char __start_unwind[], __end_unwind[]; | 23 | extern char __start_unwind[], __end_unwind[]; |
22 | extern char __start_ivt_text[], __end_ivt_text[]; | 24 | extern char __start_ivt_text[], __end_ivt_text[]; |
23 | 25 | ||
26 | #undef dereference_function_descriptor | ||
27 | static inline void *dereference_function_descriptor(void *ptr) | ||
28 | { | ||
29 | struct fdesc *desc = ptr; | ||
30 | void *p; | ||
31 | |||
32 | if (!probe_kernel_address(&desc->ip, p)) | ||
33 | ptr = p; | ||
34 | return ptr; | ||
35 | } | ||
36 | |||
37 | |||
24 | #endif /* _ASM_IA64_SECTIONS_H */ | 38 | #endif /* _ASM_IA64_SECTIONS_H */ |
25 | 39 | ||
diff --git a/arch/ia64/include/asm/sn/bte.h b/arch/ia64/include/asm/sn/bte.h index a0d214f43115..5efecf06c9a4 100644 --- a/arch/ia64/include/asm/sn/bte.h +++ b/arch/ia64/include/asm/sn/bte.h | |||
@@ -223,10 +223,11 @@ extern void bte_error_handler(unsigned long); | |||
223 | * until the transfer is complete. In order to get the asynch | 223 | * until the transfer is complete. In order to get the asynch |
224 | * version of bte_copy, you must perform this check yourself. | 224 | * version of bte_copy, you must perform this check yourself. |
225 | */ | 225 | */ |
226 | #define BTE_UNALIGNED_COPY(src, dest, len, mode) \ | 226 | #define BTE_UNALIGNED_COPY(src, dest, len, mode) \ |
227 | (((len & L1_CACHE_MASK) || (src & L1_CACHE_MASK) || \ | 227 | (((len & (L1_CACHE_BYTES - 1)) || \ |
228 | (dest & L1_CACHE_MASK)) ? \ | 228 | (src & (L1_CACHE_BYTES - 1)) || \ |
229 | bte_unaligned_copy(src, dest, len, mode) : \ | 229 | (dest & (L1_CACHE_BYTES - 1))) ? \ |
230 | bte_unaligned_copy(src, dest, len, mode) : \ | ||
230 | bte_copy(src, dest, len, mode, NULL)) | 231 | bte_copy(src, dest, len, mode, NULL)) |
231 | 232 | ||
232 | 233 | ||
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 29aad349e0c4..aaa7d901521f 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -135,15 +135,6 @@ static const char *reloc_name[256] = { | |||
135 | 135 | ||
136 | #undef N | 136 | #undef N |
137 | 137 | ||
138 | struct got_entry { | ||
139 | uint64_t val; | ||
140 | }; | ||
141 | |||
142 | struct fdesc { | ||
143 | uint64_t ip; | ||
144 | uint64_t gp; | ||
145 | }; | ||
146 | |||
147 | /* Opaque struct for insns, to protect against derefs. */ | 138 | /* Opaque struct for insns, to protect against derefs. */ |
148 | struct insn; | 139 | struct insn; |
149 | 140 | ||
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index bcea81e432fd..d8f05e504fbf 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -741,16 +741,14 @@ int __cpu_disable(void) | |||
741 | return -EBUSY; | 741 | return -EBUSY; |
742 | } | 742 | } |
743 | 743 | ||
744 | cpu_clear(cpu, cpu_online_map); | ||
745 | |||
746 | if (migrate_platform_irqs(cpu)) { | 744 | if (migrate_platform_irqs(cpu)) { |
747 | cpu_set(cpu, cpu_online_map); | 745 | cpu_set(cpu, cpu_online_map); |
748 | return (-EBUSY); | 746 | return (-EBUSY); |
749 | } | 747 | } |
750 | 748 | ||
751 | remove_siblinginfo(cpu); | 749 | remove_siblinginfo(cpu); |
752 | cpu_clear(cpu, cpu_online_map); | ||
753 | fixup_irqs(); | 750 | fixup_irqs(); |
751 | cpu_clear(cpu, cpu_online_map); | ||
754 | local_flush_tlb_all(); | 752 | local_flush_tlb_all(); |
755 | cpu_clear(cpu, cpu_callin_map); | 753 | cpu_clear(cpu, cpu_callin_map); |
756 | return 0; | 754 | return 0; |
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c index 529462c01570..79165122501c 100644 --- a/arch/ia64/sn/pci/tioca_provider.c +++ b/arch/ia64/sn/pci/tioca_provider.c | |||
@@ -420,8 +420,10 @@ tioca_dma_mapped(struct pci_dev *pdev, u64 paddr, size_t req_size) | |||
420 | entry = find_next_zero_bit(map, mapsize, last_entry); | 420 | entry = find_next_zero_bit(map, mapsize, last_entry); |
421 | } | 421 | } |
422 | 422 | ||
423 | if (entry > mapsize) | 423 | if (entry > mapsize) { |
424 | kfree(ca_dmamap); | ||
424 | goto map_return; | 425 | goto map_return; |
426 | } | ||
425 | 427 | ||
426 | for (i = 0; i < entries; i++) | 428 | for (i = 0; i < entries; i++) |
427 | set_bit(entry + i, map); | 429 | set_bit(entry + i, map); |
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index 8a2a53b33616..bb959fbab2dc 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c | |||
@@ -580,13 +580,15 @@ int atari_keyb_init(void) | |||
580 | do { | 580 | do { |
581 | /* reset IKBD ACIA */ | 581 | /* reset IKBD ACIA */ |
582 | acia.key_ctrl = ACIA_RESET | | 582 | acia.key_ctrl = ACIA_RESET | |
583 | (atari_switches & ATARI_SWITCH_IKBD) ? ACIA_RHTID : 0; | 583 | ((atari_switches & ATARI_SWITCH_IKBD) ? |
584 | ACIA_RHTID : 0); | ||
584 | (void)acia.key_ctrl; | 585 | (void)acia.key_ctrl; |
585 | (void)acia.key_data; | 586 | (void)acia.key_data; |
586 | 587 | ||
587 | /* reset MIDI ACIA */ | 588 | /* reset MIDI ACIA */ |
588 | acia.mid_ctrl = ACIA_RESET | | 589 | acia.mid_ctrl = ACIA_RESET | |
589 | (atari_switches & ATARI_SWITCH_MIDI) ? ACIA_RHTID : 0; | 590 | ((atari_switches & ATARI_SWITCH_MIDI) ? |
591 | ACIA_RHTID : 0); | ||
590 | (void)acia.mid_ctrl; | 592 | (void)acia.mid_ctrl; |
591 | (void)acia.mid_data; | 593 | (void)acia.mid_data; |
592 | 594 | ||
@@ -599,7 +601,8 @@ int atari_keyb_init(void) | |||
599 | ACIA_RHTID : ACIA_RLTID); | 601 | ACIA_RHTID : ACIA_RLTID); |
600 | 602 | ||
601 | acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | | 603 | acia.mid_ctrl = ACIA_DIV16 | ACIA_D8N1S | |
602 | (atari_switches & ATARI_SWITCH_MIDI) ? ACIA_RHTID : 0; | 604 | ((atari_switches & ATARI_SWITCH_MIDI) ? |
605 | ACIA_RHTID : 0); | ||
603 | 606 | ||
604 | /* make sure the interrupt line is up */ | 607 | /* make sure the interrupt line is up */ |
605 | } while ((mfp.par_dt_reg & 0x10) == 0); | 608 | } while ((mfp.par_dt_reg & 0x10) == 0); |
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 8e2a0f5faf53..8bd61a640fc9 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:00 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -166,10 +172,6 @@ CONFIG_GENERIC_ISA_DMA=y | |||
166 | CONFIG_ZONE_DMA=y | 172 | CONFIG_ZONE_DMA=y |
167 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 173 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
168 | CONFIG_ZORRO_NAMES=y | 174 | CONFIG_ZORRO_NAMES=y |
169 | |||
170 | # | ||
171 | # Networking | ||
172 | # | ||
173 | CONFIG_NET=y | 175 | CONFIG_NET=y |
174 | 176 | ||
175 | # | 177 | # |
@@ -183,6 +185,7 @@ CONFIG_XFRM=y | |||
183 | # CONFIG_XFRM_SUB_POLICY is not set | 185 | # CONFIG_XFRM_SUB_POLICY is not set |
184 | CONFIG_XFRM_MIGRATE=y | 186 | CONFIG_XFRM_MIGRATE=y |
185 | # CONFIG_XFRM_STATISTICS is not set | 187 | # CONFIG_XFRM_STATISTICS is not set |
188 | CONFIG_XFRM_IPCOMP=m | ||
186 | CONFIG_NET_KEY=y | 189 | CONFIG_NET_KEY=y |
187 | CONFIG_NET_KEY_MIGRATE=y | 190 | CONFIG_NET_KEY_MIGRATE=y |
188 | CONFIG_INET=y | 191 | CONFIG_INET=y |
@@ -413,6 +416,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
413 | # | 416 | # |
414 | # CONFIG_CFG80211 is not set | 417 | # CONFIG_CFG80211 is not set |
415 | CONFIG_WIRELESS_EXT=y | 418 | CONFIG_WIRELESS_EXT=y |
419 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
416 | # CONFIG_MAC80211 is not set | 420 | # CONFIG_MAC80211 is not set |
417 | CONFIG_IEEE80211=m | 421 | CONFIG_IEEE80211=m |
418 | # CONFIG_IEEE80211_DEBUG is not set | 422 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -432,7 +436,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 436 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
433 | CONFIG_STANDALONE=y | 437 | CONFIG_STANDALONE=y |
434 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 438 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
435 | CONFIG_FW_LOADER=m | 439 | CONFIG_FW_LOADER=y |
440 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
441 | CONFIG_EXTRA_FIRMWARE="" | ||
436 | # CONFIG_SYS_HYPERVISOR is not set | 442 | # CONFIG_SYS_HYPERVISOR is not set |
437 | CONFIG_CONNECTOR=m | 443 | CONFIG_CONNECTOR=m |
438 | # CONFIG_MTD is not set | 444 | # CONFIG_MTD is not set |
@@ -460,6 +466,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
460 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 466 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
461 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 467 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
462 | CONFIG_ATA_OVER_ETH=m | 468 | CONFIG_ATA_OVER_ETH=m |
469 | # CONFIG_BLK_DEV_HD is not set | ||
463 | CONFIG_MISC_DEVICES=y | 470 | CONFIG_MISC_DEVICES=y |
464 | # CONFIG_EEPROM_93CX6 is not set | 471 | # CONFIG_EEPROM_93CX6 is not set |
465 | # CONFIG_ENCLOSURE_SERVICES is not set | 472 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -470,6 +477,7 @@ CONFIG_BLK_DEV_IDE=y | |||
470 | # | 477 | # |
471 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | 478 | # Please see Documentation/ide/ide.txt for help/info on IDE drives |
472 | # | 479 | # |
480 | CONFIG_IDE_ATAPI=y | ||
473 | # CONFIG_BLK_DEV_IDE_SATA is not set | 481 | # CONFIG_BLK_DEV_IDE_SATA is not set |
474 | CONFIG_BLK_DEV_IDEDISK=y | 482 | CONFIG_BLK_DEV_IDEDISK=y |
475 | # CONFIG_IDEDISK_MULTI_MODE is not set | 483 | # CONFIG_IDEDISK_MULTI_MODE is not set |
@@ -489,8 +497,6 @@ CONFIG_BLK_DEV_GAYLE=y | |||
489 | CONFIG_BLK_DEV_IDEDOUBLER=y | 497 | CONFIG_BLK_DEV_IDEDOUBLER=y |
490 | CONFIG_BLK_DEV_BUDDHA=y | 498 | CONFIG_BLK_DEV_BUDDHA=y |
491 | # CONFIG_BLK_DEV_IDEDMA is not set | 499 | # CONFIG_BLK_DEV_IDEDMA is not set |
492 | # CONFIG_BLK_DEV_HD_ONLY is not set | ||
493 | # CONFIG_BLK_DEV_HD is not set | ||
494 | 500 | ||
495 | # | 501 | # |
496 | # SCSI device support | 502 | # SCSI device support |
@@ -556,6 +562,7 @@ CONFIG_A2091_SCSI=y | |||
556 | CONFIG_GVP11_SCSI=y | 562 | CONFIG_GVP11_SCSI=y |
557 | CONFIG_SCSI_A4000T=y | 563 | CONFIG_SCSI_A4000T=y |
558 | CONFIG_SCSI_ZORRO7XX=y | 564 | CONFIG_SCSI_ZORRO7XX=y |
565 | # CONFIG_SCSI_DH is not set | ||
559 | CONFIG_MD=y | 566 | CONFIG_MD=y |
560 | CONFIG_BLK_DEV_MD=m | 567 | CONFIG_BLK_DEV_MD=m |
561 | CONFIG_MD_LINEAR=m | 568 | CONFIG_MD_LINEAR=m |
@@ -564,7 +571,7 @@ CONFIG_MD_RAID1=m | |||
564 | # CONFIG_MD_RAID10 is not set | 571 | # CONFIG_MD_RAID10 is not set |
565 | CONFIG_MD_RAID456=m | 572 | CONFIG_MD_RAID456=m |
566 | CONFIG_MD_RAID5_RESHAPE=y | 573 | CONFIG_MD_RAID5_RESHAPE=y |
567 | CONFIG_MD_MULTIPATH=m | 574 | # CONFIG_MD_MULTIPATH is not set |
568 | # CONFIG_MD_FAULTY is not set | 575 | # CONFIG_MD_FAULTY is not set |
569 | CONFIG_BLK_DEV_DM=m | 576 | CONFIG_BLK_DEV_DM=m |
570 | # CONFIG_DM_DEBUG is not set | 577 | # CONFIG_DM_DEBUG is not set |
@@ -573,13 +580,9 @@ CONFIG_DM_SNAPSHOT=m | |||
573 | CONFIG_DM_MIRROR=m | 580 | CONFIG_DM_MIRROR=m |
574 | CONFIG_DM_ZERO=m | 581 | CONFIG_DM_ZERO=m |
575 | CONFIG_DM_MULTIPATH=m | 582 | CONFIG_DM_MULTIPATH=m |
576 | CONFIG_DM_MULTIPATH_EMC=m | ||
577 | CONFIG_DM_MULTIPATH_RDAC=m | ||
578 | CONFIG_DM_MULTIPATH_HP=m | ||
579 | # CONFIG_DM_DELAY is not set | 583 | # CONFIG_DM_DELAY is not set |
580 | CONFIG_DM_UEVENT=y | 584 | CONFIG_DM_UEVENT=y |
581 | CONFIG_NETDEVICES=y | 585 | CONFIG_NETDEVICES=y |
582 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
583 | CONFIG_DUMMY=m | 586 | CONFIG_DUMMY=m |
584 | # CONFIG_BONDING is not set | 587 | # CONFIG_BONDING is not set |
585 | CONFIG_MACVLAN=m | 588 | CONFIG_MACVLAN=m |
@@ -722,6 +725,7 @@ CONFIG_INPUT_M68K_BEEP=m | |||
722 | # Character devices | 725 | # Character devices |
723 | # | 726 | # |
724 | CONFIG_VT=y | 727 | CONFIG_VT=y |
728 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
725 | CONFIG_VT_CONSOLE=y | 729 | CONFIG_VT_CONSOLE=y |
726 | CONFIG_HW_CONSOLE=y | 730 | CONFIG_HW_CONSOLE=y |
727 | CONFIG_VT_HW_CONSOLE_BINDING=y | 731 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -757,6 +761,7 @@ CONFIG_GEN_RTC_X=y | |||
757 | # CONFIG_POWER_SUPPLY is not set | 761 | # CONFIG_POWER_SUPPLY is not set |
758 | # CONFIG_HWMON is not set | 762 | # CONFIG_HWMON is not set |
759 | # CONFIG_THERMAL is not set | 763 | # CONFIG_THERMAL is not set |
764 | # CONFIG_THERMAL_HWMON is not set | ||
760 | # CONFIG_WATCHDOG is not set | 765 | # CONFIG_WATCHDOG is not set |
761 | 766 | ||
762 | # | 767 | # |
@@ -768,8 +773,10 @@ CONFIG_SSB_POSSIBLE=y | |||
768 | # | 773 | # |
769 | # Multifunction device drivers | 774 | # Multifunction device drivers |
770 | # | 775 | # |
776 | # CONFIG_MFD_CORE is not set | ||
771 | # CONFIG_MFD_SM501 is not set | 777 | # CONFIG_MFD_SM501 is not set |
772 | # CONFIG_HTC_PASIC3 is not set | 778 | # CONFIG_HTC_PASIC3 is not set |
779 | # CONFIG_MFD_TMIO is not set | ||
773 | 780 | ||
774 | # | 781 | # |
775 | # Multimedia devices | 782 | # Multimedia devices |
@@ -844,10 +851,6 @@ CONFIG_LOGO=y | |||
844 | CONFIG_LOGO_LINUX_MONO=y | 851 | CONFIG_LOGO_LINUX_MONO=y |
845 | CONFIG_LOGO_LINUX_VGA16=y | 852 | CONFIG_LOGO_LINUX_VGA16=y |
846 | CONFIG_LOGO_LINUX_CLUT224=y | 853 | CONFIG_LOGO_LINUX_CLUT224=y |
847 | |||
848 | # | ||
849 | # Sound | ||
850 | # | ||
851 | CONFIG_SOUND=m | 854 | CONFIG_SOUND=m |
852 | CONFIG_DMASOUND_PAULA=m | 855 | CONFIG_DMASOUND_PAULA=m |
853 | CONFIG_DMASOUND=m | 856 | CONFIG_DMASOUND=m |
@@ -861,6 +864,7 @@ CONFIG_HIDRAW=y | |||
861 | # CONFIG_NEW_LEDS is not set | 864 | # CONFIG_NEW_LEDS is not set |
862 | # CONFIG_ACCESSIBILITY is not set | 865 | # CONFIG_ACCESSIBILITY is not set |
863 | # CONFIG_RTC_CLASS is not set | 866 | # CONFIG_RTC_CLASS is not set |
867 | # CONFIG_DMADEVICES is not set | ||
864 | # CONFIG_AUXDISPLAY is not set | 868 | # CONFIG_AUXDISPLAY is not set |
865 | # CONFIG_UIO is not set | 869 | # CONFIG_UIO is not set |
866 | 870 | ||
@@ -899,6 +903,7 @@ CONFIG_XFS_FS=m | |||
899 | CONFIG_OCFS2_FS=m | 903 | CONFIG_OCFS2_FS=m |
900 | CONFIG_OCFS2_FS_O2CB=m | 904 | CONFIG_OCFS2_FS_O2CB=m |
901 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 905 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
906 | # CONFIG_OCFS2_FS_STATS is not set | ||
902 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 907 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
903 | # CONFIG_OCFS2_DEBUG_FS is not set | 908 | # CONFIG_OCFS2_DEBUG_FS is not set |
904 | CONFIG_DNOTIFY=y | 909 | CONFIG_DNOTIFY=y |
@@ -958,6 +963,7 @@ CONFIG_HFSPLUS_FS=m | |||
958 | CONFIG_CRAMFS=m | 963 | CONFIG_CRAMFS=m |
959 | # CONFIG_VXFS_FS is not set | 964 | # CONFIG_VXFS_FS is not set |
960 | CONFIG_MINIX_FS=y | 965 | CONFIG_MINIX_FS=y |
966 | # CONFIG_OMFS_FS is not set | ||
961 | CONFIG_HPFS_FS=m | 967 | CONFIG_HPFS_FS=m |
962 | # CONFIG_QNX4FS_FS is not set | 968 | # CONFIG_QNX4FS_FS is not set |
963 | # CONFIG_ROMFS_FS is not set | 969 | # CONFIG_ROMFS_FS is not set |
@@ -980,7 +986,6 @@ CONFIG_EXPORTFS=m | |||
980 | CONFIG_NFS_COMMON=y | 986 | CONFIG_NFS_COMMON=y |
981 | CONFIG_SUNRPC=m | 987 | CONFIG_SUNRPC=m |
982 | CONFIG_SUNRPC_GSS=m | 988 | CONFIG_SUNRPC_GSS=m |
983 | CONFIG_SUNRPC_BIND34=y | ||
984 | CONFIG_RPCSEC_GSS_KRB5=m | 989 | CONFIG_RPCSEC_GSS_KRB5=m |
985 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 990 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
986 | CONFIG_SMB_FS=m | 991 | CONFIG_SMB_FS=m |
@@ -989,7 +994,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
989 | # CONFIG_CIFS is not set | 994 | # CONFIG_CIFS is not set |
990 | # CONFIG_NCP_FS is not set | 995 | # CONFIG_NCP_FS is not set |
991 | CONFIG_CODA_FS=m | 996 | CONFIG_CODA_FS=m |
992 | # CONFIG_CODA_FS_OLD_API is not set | ||
993 | # CONFIG_AFS_FS is not set | 997 | # CONFIG_AFS_FS is not set |
994 | 998 | ||
995 | # | 999 | # |
@@ -1054,6 +1058,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
1054 | # CONFIG_HEADERS_CHECK is not set | 1058 | # CONFIG_HEADERS_CHECK is not set |
1055 | # CONFIG_DEBUG_KERNEL is not set | 1059 | # CONFIG_DEBUG_KERNEL is not set |
1056 | CONFIG_DEBUG_BUGVERBOSE=y | 1060 | CONFIG_DEBUG_BUGVERBOSE=y |
1061 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1062 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
1057 | # CONFIG_SAMPLES is not set | 1063 | # CONFIG_SAMPLES is not set |
1058 | 1064 | ||
1059 | # | 1065 | # |
@@ -1113,6 +1119,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1113 | CONFIG_CRYPTO_MD4=m | 1119 | CONFIG_CRYPTO_MD4=m |
1114 | CONFIG_CRYPTO_MD5=m | 1120 | CONFIG_CRYPTO_MD5=m |
1115 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1121 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1122 | CONFIG_CRYPTO_RMD128=m | ||
1123 | CONFIG_CRYPTO_RMD160=m | ||
1124 | CONFIG_CRYPTO_RMD256=m | ||
1125 | CONFIG_CRYPTO_RMD320=m | ||
1116 | CONFIG_CRYPTO_SHA1=m | 1126 | CONFIG_CRYPTO_SHA1=m |
1117 | CONFIG_CRYPTO_SHA256=m | 1127 | CONFIG_CRYPTO_SHA256=m |
1118 | CONFIG_CRYPTO_SHA512=m | 1128 | CONFIG_CRYPTO_SHA512=m |
@@ -1154,6 +1164,7 @@ CONFIG_BITREVERSE=y | |||
1154 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1164 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1155 | CONFIG_CRC_CCITT=m | 1165 | CONFIG_CRC_CCITT=m |
1156 | CONFIG_CRC16=m | 1166 | CONFIG_CRC16=m |
1167 | CONFIG_CRC_T10DIF=y | ||
1157 | CONFIG_CRC_ITU_T=m | 1168 | CONFIG_CRC_ITU_T=m |
1158 | CONFIG_CRC32=y | 1169 | CONFIG_CRC32=y |
1159 | # CONFIG_CRC7 is not set | 1170 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index e2d511e2a1d1..c41b854c0284 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:01 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -161,10 +167,6 @@ CONFIG_HEARTBEAT=y | |||
161 | CONFIG_PROC_HARDWARE=y | 167 | CONFIG_PROC_HARDWARE=y |
162 | CONFIG_ZONE_DMA=y | 168 | CONFIG_ZONE_DMA=y |
163 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 169 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
164 | |||
165 | # | ||
166 | # Networking | ||
167 | # | ||
168 | CONFIG_NET=y | 170 | CONFIG_NET=y |
169 | 171 | ||
170 | # | 172 | # |
@@ -178,6 +180,7 @@ CONFIG_XFRM=y | |||
178 | # CONFIG_XFRM_SUB_POLICY is not set | 180 | # CONFIG_XFRM_SUB_POLICY is not set |
179 | CONFIG_XFRM_MIGRATE=y | 181 | CONFIG_XFRM_MIGRATE=y |
180 | # CONFIG_XFRM_STATISTICS is not set | 182 | # CONFIG_XFRM_STATISTICS is not set |
183 | CONFIG_XFRM_IPCOMP=m | ||
181 | CONFIG_NET_KEY=y | 184 | CONFIG_NET_KEY=y |
182 | CONFIG_NET_KEY_MIGRATE=y | 185 | CONFIG_NET_KEY_MIGRATE=y |
183 | CONFIG_INET=y | 186 | CONFIG_INET=y |
@@ -411,6 +414,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
411 | # | 414 | # |
412 | # CONFIG_CFG80211 is not set | 415 | # CONFIG_CFG80211 is not set |
413 | CONFIG_WIRELESS_EXT=y | 416 | CONFIG_WIRELESS_EXT=y |
417 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
414 | # CONFIG_MAC80211 is not set | 418 | # CONFIG_MAC80211 is not set |
415 | CONFIG_IEEE80211=m | 419 | CONFIG_IEEE80211=m |
416 | # CONFIG_IEEE80211_DEBUG is not set | 420 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -430,7 +434,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
430 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 434 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
431 | CONFIG_STANDALONE=y | 435 | CONFIG_STANDALONE=y |
432 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 436 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
433 | CONFIG_FW_LOADER=m | 437 | CONFIG_FW_LOADER=y |
438 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
439 | CONFIG_EXTRA_FIRMWARE="" | ||
434 | # CONFIG_SYS_HYPERVISOR is not set | 440 | # CONFIG_SYS_HYPERVISOR is not set |
435 | CONFIG_CONNECTOR=m | 441 | CONFIG_CONNECTOR=m |
436 | # CONFIG_MTD is not set | 442 | # CONFIG_MTD is not set |
@@ -448,6 +454,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
448 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 454 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
449 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 455 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
450 | CONFIG_ATA_OVER_ETH=m | 456 | CONFIG_ATA_OVER_ETH=m |
457 | # CONFIG_BLK_DEV_HD is not set | ||
451 | CONFIG_MISC_DEVICES=y | 458 | CONFIG_MISC_DEVICES=y |
452 | # CONFIG_EEPROM_93CX6 is not set | 459 | # CONFIG_EEPROM_93CX6 is not set |
453 | # CONFIG_ENCLOSURE_SERVICES is not set | 460 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -499,6 +506,7 @@ CONFIG_SCSI_SRP_TGT_ATTRS=y | |||
499 | CONFIG_SCSI_LOWLEVEL=y | 506 | CONFIG_SCSI_LOWLEVEL=y |
500 | CONFIG_ISCSI_TCP=m | 507 | CONFIG_ISCSI_TCP=m |
501 | # CONFIG_SCSI_DEBUG is not set | 508 | # CONFIG_SCSI_DEBUG is not set |
509 | # CONFIG_SCSI_DH is not set | ||
502 | CONFIG_MD=y | 510 | CONFIG_MD=y |
503 | CONFIG_BLK_DEV_MD=m | 511 | CONFIG_BLK_DEV_MD=m |
504 | CONFIG_MD_LINEAR=m | 512 | CONFIG_MD_LINEAR=m |
@@ -507,7 +515,7 @@ CONFIG_MD_RAID1=m | |||
507 | # CONFIG_MD_RAID10 is not set | 515 | # CONFIG_MD_RAID10 is not set |
508 | CONFIG_MD_RAID456=m | 516 | CONFIG_MD_RAID456=m |
509 | CONFIG_MD_RAID5_RESHAPE=y | 517 | CONFIG_MD_RAID5_RESHAPE=y |
510 | CONFIG_MD_MULTIPATH=m | 518 | # CONFIG_MD_MULTIPATH is not set |
511 | # CONFIG_MD_FAULTY is not set | 519 | # CONFIG_MD_FAULTY is not set |
512 | CONFIG_BLK_DEV_DM=m | 520 | CONFIG_BLK_DEV_DM=m |
513 | # CONFIG_DM_DEBUG is not set | 521 | # CONFIG_DM_DEBUG is not set |
@@ -516,13 +524,9 @@ CONFIG_DM_SNAPSHOT=m | |||
516 | CONFIG_DM_MIRROR=m | 524 | CONFIG_DM_MIRROR=m |
517 | CONFIG_DM_ZERO=m | 525 | CONFIG_DM_ZERO=m |
518 | CONFIG_DM_MULTIPATH=m | 526 | CONFIG_DM_MULTIPATH=m |
519 | CONFIG_DM_MULTIPATH_EMC=m | ||
520 | CONFIG_DM_MULTIPATH_RDAC=m | ||
521 | CONFIG_DM_MULTIPATH_HP=m | ||
522 | # CONFIG_DM_DELAY is not set | 527 | # CONFIG_DM_DELAY is not set |
523 | CONFIG_DM_UEVENT=y | 528 | CONFIG_DM_UEVENT=y |
524 | CONFIG_NETDEVICES=y | 529 | CONFIG_NETDEVICES=y |
525 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
526 | CONFIG_DUMMY=m | 530 | CONFIG_DUMMY=m |
527 | # CONFIG_BONDING is not set | 531 | # CONFIG_BONDING is not set |
528 | CONFIG_MACVLAN=m | 532 | CONFIG_MACVLAN=m |
@@ -532,7 +536,6 @@ CONFIG_VETH=m | |||
532 | # CONFIG_PHYLIB is not set | 536 | # CONFIG_PHYLIB is not set |
533 | CONFIG_NET_ETHERNET=y | 537 | CONFIG_NET_ETHERNET=y |
534 | # CONFIG_MII is not set | 538 | # CONFIG_MII is not set |
535 | CONFIG_APOLLO_ELPLUS=y | ||
536 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | 539 | # CONFIG_IBM_NEW_EMAC_ZMII is not set |
537 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 540 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
538 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 541 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
@@ -627,6 +630,7 @@ CONFIG_SERIO_LIBPS2=m | |||
627 | # Character devices | 630 | # Character devices |
628 | # | 631 | # |
629 | CONFIG_VT=y | 632 | CONFIG_VT=y |
633 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
630 | CONFIG_VT_CONSOLE=y | 634 | CONFIG_VT_CONSOLE=y |
631 | CONFIG_HW_CONSOLE=y | 635 | CONFIG_HW_CONSOLE=y |
632 | CONFIG_VT_HW_CONSOLE_BINDING=y | 636 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -657,6 +661,7 @@ CONFIG_GEN_RTC_X=y | |||
657 | # CONFIG_POWER_SUPPLY is not set | 661 | # CONFIG_POWER_SUPPLY is not set |
658 | # CONFIG_HWMON is not set | 662 | # CONFIG_HWMON is not set |
659 | # CONFIG_THERMAL is not set | 663 | # CONFIG_THERMAL is not set |
664 | # CONFIG_THERMAL_HWMON is not set | ||
660 | # CONFIG_WATCHDOG is not set | 665 | # CONFIG_WATCHDOG is not set |
661 | 666 | ||
662 | # | 667 | # |
@@ -668,8 +673,10 @@ CONFIG_SSB_POSSIBLE=y | |||
668 | # | 673 | # |
669 | # Multifunction device drivers | 674 | # Multifunction device drivers |
670 | # | 675 | # |
676 | # CONFIG_MFD_CORE is not set | ||
671 | # CONFIG_MFD_SM501 is not set | 677 | # CONFIG_MFD_SM501 is not set |
672 | # CONFIG_HTC_PASIC3 is not set | 678 | # CONFIG_HTC_PASIC3 is not set |
679 | # CONFIG_MFD_TMIO is not set | ||
673 | 680 | ||
674 | # | 681 | # |
675 | # Multimedia devices | 682 | # Multimedia devices |
@@ -738,10 +745,6 @@ CONFIG_LOGO=y | |||
738 | CONFIG_LOGO_LINUX_MONO=y | 745 | CONFIG_LOGO_LINUX_MONO=y |
739 | # CONFIG_LOGO_LINUX_VGA16 is not set | 746 | # CONFIG_LOGO_LINUX_VGA16 is not set |
740 | # CONFIG_LOGO_LINUX_CLUT224 is not set | 747 | # CONFIG_LOGO_LINUX_CLUT224 is not set |
741 | |||
742 | # | ||
743 | # Sound | ||
744 | # | ||
745 | # CONFIG_SOUND is not set | 748 | # CONFIG_SOUND is not set |
746 | CONFIG_HID_SUPPORT=y | 749 | CONFIG_HID_SUPPORT=y |
747 | CONFIG_HID=m | 750 | CONFIG_HID=m |
@@ -753,6 +756,7 @@ CONFIG_HIDRAW=y | |||
753 | # CONFIG_NEW_LEDS is not set | 756 | # CONFIG_NEW_LEDS is not set |
754 | # CONFIG_ACCESSIBILITY is not set | 757 | # CONFIG_ACCESSIBILITY is not set |
755 | # CONFIG_RTC_CLASS is not set | 758 | # CONFIG_RTC_CLASS is not set |
759 | # CONFIG_DMADEVICES is not set | ||
756 | # CONFIG_UIO is not set | 760 | # CONFIG_UIO is not set |
757 | 761 | ||
758 | # | 762 | # |
@@ -789,6 +793,7 @@ CONFIG_XFS_FS=m | |||
789 | CONFIG_OCFS2_FS=m | 793 | CONFIG_OCFS2_FS=m |
790 | CONFIG_OCFS2_FS_O2CB=m | 794 | CONFIG_OCFS2_FS_O2CB=m |
791 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 795 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
796 | # CONFIG_OCFS2_FS_STATS is not set | ||
792 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 797 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
793 | # CONFIG_OCFS2_DEBUG_FS is not set | 798 | # CONFIG_OCFS2_DEBUG_FS is not set |
794 | CONFIG_DNOTIFY=y | 799 | CONFIG_DNOTIFY=y |
@@ -848,6 +853,7 @@ CONFIG_HFSPLUS_FS=m | |||
848 | CONFIG_CRAMFS=m | 853 | CONFIG_CRAMFS=m |
849 | # CONFIG_VXFS_FS is not set | 854 | # CONFIG_VXFS_FS is not set |
850 | CONFIG_MINIX_FS=y | 855 | CONFIG_MINIX_FS=y |
856 | # CONFIG_OMFS_FS is not set | ||
851 | CONFIG_HPFS_FS=m | 857 | CONFIG_HPFS_FS=m |
852 | # CONFIG_QNX4FS_FS is not set | 858 | # CONFIG_QNX4FS_FS is not set |
853 | # CONFIG_ROMFS_FS is not set | 859 | # CONFIG_ROMFS_FS is not set |
@@ -860,18 +866,17 @@ CONFIG_NFS_FS=y | |||
860 | CONFIG_NFS_V3=y | 866 | CONFIG_NFS_V3=y |
861 | # CONFIG_NFS_V3_ACL is not set | 867 | # CONFIG_NFS_V3_ACL is not set |
862 | CONFIG_NFS_V4=y | 868 | CONFIG_NFS_V4=y |
869 | CONFIG_ROOT_NFS=y | ||
863 | CONFIG_NFSD=m | 870 | CONFIG_NFSD=m |
864 | CONFIG_NFSD_V3=y | 871 | CONFIG_NFSD_V3=y |
865 | # CONFIG_NFSD_V3_ACL is not set | 872 | # CONFIG_NFSD_V3_ACL is not set |
866 | # CONFIG_NFSD_V4 is not set | 873 | # CONFIG_NFSD_V4 is not set |
867 | CONFIG_ROOT_NFS=y | ||
868 | CONFIG_LOCKD=y | 874 | CONFIG_LOCKD=y |
869 | CONFIG_LOCKD_V4=y | 875 | CONFIG_LOCKD_V4=y |
870 | CONFIG_EXPORTFS=m | 876 | CONFIG_EXPORTFS=m |
871 | CONFIG_NFS_COMMON=y | 877 | CONFIG_NFS_COMMON=y |
872 | CONFIG_SUNRPC=y | 878 | CONFIG_SUNRPC=y |
873 | CONFIG_SUNRPC_GSS=y | 879 | CONFIG_SUNRPC_GSS=y |
874 | CONFIG_SUNRPC_BIND34=y | ||
875 | CONFIG_RPCSEC_GSS_KRB5=y | 880 | CONFIG_RPCSEC_GSS_KRB5=y |
876 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 881 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
877 | CONFIG_SMB_FS=m | 882 | CONFIG_SMB_FS=m |
@@ -880,7 +885,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
880 | # CONFIG_CIFS is not set | 885 | # CONFIG_CIFS is not set |
881 | # CONFIG_NCP_FS is not set | 886 | # CONFIG_NCP_FS is not set |
882 | CONFIG_CODA_FS=m | 887 | CONFIG_CODA_FS=m |
883 | # CONFIG_CODA_FS_OLD_API is not set | ||
884 | # CONFIG_AFS_FS is not set | 888 | # CONFIG_AFS_FS is not set |
885 | 889 | ||
886 | # | 890 | # |
@@ -944,6 +948,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
944 | # CONFIG_HEADERS_CHECK is not set | 948 | # CONFIG_HEADERS_CHECK is not set |
945 | # CONFIG_DEBUG_KERNEL is not set | 949 | # CONFIG_DEBUG_KERNEL is not set |
946 | CONFIG_DEBUG_BUGVERBOSE=y | 950 | CONFIG_DEBUG_BUGVERBOSE=y |
951 | CONFIG_DEBUG_MEMORY_INIT=y | ||
952 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
947 | # CONFIG_SAMPLES is not set | 953 | # CONFIG_SAMPLES is not set |
948 | 954 | ||
949 | # | 955 | # |
@@ -1003,6 +1009,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1003 | CONFIG_CRYPTO_MD4=m | 1009 | CONFIG_CRYPTO_MD4=m |
1004 | CONFIG_CRYPTO_MD5=y | 1010 | CONFIG_CRYPTO_MD5=y |
1005 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1011 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1012 | CONFIG_CRYPTO_RMD128=m | ||
1013 | CONFIG_CRYPTO_RMD160=m | ||
1014 | CONFIG_CRYPTO_RMD256=m | ||
1015 | CONFIG_CRYPTO_RMD320=m | ||
1006 | CONFIG_CRYPTO_SHA1=m | 1016 | CONFIG_CRYPTO_SHA1=m |
1007 | CONFIG_CRYPTO_SHA256=m | 1017 | CONFIG_CRYPTO_SHA256=m |
1008 | CONFIG_CRYPTO_SHA512=m | 1018 | CONFIG_CRYPTO_SHA512=m |
@@ -1044,6 +1054,7 @@ CONFIG_BITREVERSE=y | |||
1044 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1054 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1045 | CONFIG_CRC_CCITT=m | 1055 | CONFIG_CRC_CCITT=m |
1046 | CONFIG_CRC16=m | 1056 | CONFIG_CRC16=m |
1057 | CONFIG_CRC_T10DIF=y | ||
1047 | CONFIG_CRC_ITU_T=m | 1058 | CONFIG_CRC_ITU_T=m |
1048 | CONFIG_CRC32=y | 1059 | CONFIG_CRC32=y |
1049 | # CONFIG_CRC7 is not set | 1060 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index 6e20d656adaf..654c5acb9e86 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:02 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -162,10 +168,6 @@ CONFIG_HEARTBEAT=y | |||
162 | CONFIG_PROC_HARDWARE=y | 168 | CONFIG_PROC_HARDWARE=y |
163 | CONFIG_ZONE_DMA=y | 169 | CONFIG_ZONE_DMA=y |
164 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 170 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
165 | |||
166 | # | ||
167 | # Networking | ||
168 | # | ||
169 | CONFIG_NET=y | 171 | CONFIG_NET=y |
170 | 172 | ||
171 | # | 173 | # |
@@ -179,6 +181,7 @@ CONFIG_XFRM=y | |||
179 | # CONFIG_XFRM_SUB_POLICY is not set | 181 | # CONFIG_XFRM_SUB_POLICY is not set |
180 | CONFIG_XFRM_MIGRATE=y | 182 | CONFIG_XFRM_MIGRATE=y |
181 | # CONFIG_XFRM_STATISTICS is not set | 183 | # CONFIG_XFRM_STATISTICS is not set |
184 | CONFIG_XFRM_IPCOMP=m | ||
182 | CONFIG_NET_KEY=y | 185 | CONFIG_NET_KEY=y |
183 | CONFIG_NET_KEY_MIGRATE=y | 186 | CONFIG_NET_KEY_MIGRATE=y |
184 | CONFIG_INET=y | 187 | CONFIG_INET=y |
@@ -409,6 +412,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
409 | # | 412 | # |
410 | # CONFIG_CFG80211 is not set | 413 | # CONFIG_CFG80211 is not set |
411 | CONFIG_WIRELESS_EXT=y | 414 | CONFIG_WIRELESS_EXT=y |
415 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
412 | # CONFIG_MAC80211 is not set | 416 | # CONFIG_MAC80211 is not set |
413 | CONFIG_IEEE80211=m | 417 | CONFIG_IEEE80211=m |
414 | # CONFIG_IEEE80211_DEBUG is not set | 418 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -428,7 +432,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
428 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
429 | CONFIG_STANDALONE=y | 433 | CONFIG_STANDALONE=y |
430 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 434 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
431 | CONFIG_FW_LOADER=m | 435 | CONFIG_FW_LOADER=y |
436 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
437 | CONFIG_EXTRA_FIRMWARE="" | ||
432 | # CONFIG_SYS_HYPERVISOR is not set | 438 | # CONFIG_SYS_HYPERVISOR is not set |
433 | CONFIG_CONNECTOR=m | 439 | CONFIG_CONNECTOR=m |
434 | # CONFIG_MTD is not set | 440 | # CONFIG_MTD is not set |
@@ -452,6 +458,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
452 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 458 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
453 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 459 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
454 | CONFIG_ATA_OVER_ETH=m | 460 | CONFIG_ATA_OVER_ETH=m |
461 | # CONFIG_BLK_DEV_HD is not set | ||
455 | CONFIG_MISC_DEVICES=y | 462 | CONFIG_MISC_DEVICES=y |
456 | # CONFIG_EEPROM_93CX6 is not set | 463 | # CONFIG_EEPROM_93CX6 is not set |
457 | # CONFIG_ENCLOSURE_SERVICES is not set | 464 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -462,6 +469,7 @@ CONFIG_BLK_DEV_IDE=y | |||
462 | # | 469 | # |
463 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | 470 | # Please see Documentation/ide/ide.txt for help/info on IDE drives |
464 | # | 471 | # |
472 | CONFIG_IDE_ATAPI=y | ||
465 | # CONFIG_BLK_DEV_IDE_SATA is not set | 473 | # CONFIG_BLK_DEV_IDE_SATA is not set |
466 | CONFIG_BLK_DEV_IDEDISK=y | 474 | CONFIG_BLK_DEV_IDEDISK=y |
467 | # CONFIG_IDEDISK_MULTI_MODE is not set | 475 | # CONFIG_IDEDISK_MULTI_MODE is not set |
@@ -479,8 +487,6 @@ CONFIG_IDE_PROC_FS=y | |||
479 | # CONFIG_BLK_DEV_PLATFORM is not set | 487 | # CONFIG_BLK_DEV_PLATFORM is not set |
480 | CONFIG_BLK_DEV_FALCON_IDE=y | 488 | CONFIG_BLK_DEV_FALCON_IDE=y |
481 | # CONFIG_BLK_DEV_IDEDMA is not set | 489 | # CONFIG_BLK_DEV_IDEDMA is not set |
482 | # CONFIG_BLK_DEV_HD_ONLY is not set | ||
483 | # CONFIG_BLK_DEV_HD is not set | ||
484 | 490 | ||
485 | # | 491 | # |
486 | # SCSI device support | 492 | # SCSI device support |
@@ -530,6 +536,7 @@ CONFIG_ISCSI_TCP=m | |||
530 | CONFIG_ATARI_SCSI=y | 536 | CONFIG_ATARI_SCSI=y |
531 | # CONFIG_ATARI_SCSI_TOSHIBA_DELAY is not set | 537 | # CONFIG_ATARI_SCSI_TOSHIBA_DELAY is not set |
532 | # CONFIG_ATARI_SCSI_RESET_BOOT is not set | 538 | # CONFIG_ATARI_SCSI_RESET_BOOT is not set |
539 | # CONFIG_SCSI_DH is not set | ||
533 | CONFIG_MD=y | 540 | CONFIG_MD=y |
534 | CONFIG_BLK_DEV_MD=m | 541 | CONFIG_BLK_DEV_MD=m |
535 | CONFIG_MD_LINEAR=m | 542 | CONFIG_MD_LINEAR=m |
@@ -538,7 +545,7 @@ CONFIG_MD_RAID1=m | |||
538 | # CONFIG_MD_RAID10 is not set | 545 | # CONFIG_MD_RAID10 is not set |
539 | CONFIG_MD_RAID456=m | 546 | CONFIG_MD_RAID456=m |
540 | CONFIG_MD_RAID5_RESHAPE=y | 547 | CONFIG_MD_RAID5_RESHAPE=y |
541 | CONFIG_MD_MULTIPATH=m | 548 | # CONFIG_MD_MULTIPATH is not set |
542 | # CONFIG_MD_FAULTY is not set | 549 | # CONFIG_MD_FAULTY is not set |
543 | CONFIG_BLK_DEV_DM=m | 550 | CONFIG_BLK_DEV_DM=m |
544 | # CONFIG_DM_DEBUG is not set | 551 | # CONFIG_DM_DEBUG is not set |
@@ -547,13 +554,9 @@ CONFIG_DM_SNAPSHOT=m | |||
547 | CONFIG_DM_MIRROR=m | 554 | CONFIG_DM_MIRROR=m |
548 | CONFIG_DM_ZERO=m | 555 | CONFIG_DM_ZERO=m |
549 | CONFIG_DM_MULTIPATH=m | 556 | CONFIG_DM_MULTIPATH=m |
550 | CONFIG_DM_MULTIPATH_EMC=m | ||
551 | CONFIG_DM_MULTIPATH_RDAC=m | ||
552 | CONFIG_DM_MULTIPATH_HP=m | ||
553 | # CONFIG_DM_DELAY is not set | 557 | # CONFIG_DM_DELAY is not set |
554 | CONFIG_DM_UEVENT=y | 558 | CONFIG_DM_UEVENT=y |
555 | CONFIG_NETDEVICES=y | 559 | CONFIG_NETDEVICES=y |
556 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
557 | CONFIG_DUMMY=m | 560 | CONFIG_DUMMY=m |
558 | # CONFIG_BONDING is not set | 561 | # CONFIG_BONDING is not set |
559 | CONFIG_MACVLAN=m | 562 | CONFIG_MACVLAN=m |
@@ -666,6 +669,7 @@ CONFIG_SERIO_LIBPS2=y | |||
666 | # Character devices | 669 | # Character devices |
667 | # | 670 | # |
668 | CONFIG_VT=y | 671 | CONFIG_VT=y |
672 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
669 | CONFIG_VT_CONSOLE=y | 673 | CONFIG_VT_CONSOLE=y |
670 | CONFIG_HW_CONSOLE=y | 674 | CONFIG_HW_CONSOLE=y |
671 | CONFIG_VT_HW_CONSOLE_BINDING=y | 675 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -700,6 +704,7 @@ CONFIG_GEN_RTC_X=y | |||
700 | # CONFIG_POWER_SUPPLY is not set | 704 | # CONFIG_POWER_SUPPLY is not set |
701 | # CONFIG_HWMON is not set | 705 | # CONFIG_HWMON is not set |
702 | # CONFIG_THERMAL is not set | 706 | # CONFIG_THERMAL is not set |
707 | # CONFIG_THERMAL_HWMON is not set | ||
703 | # CONFIG_WATCHDOG is not set | 708 | # CONFIG_WATCHDOG is not set |
704 | 709 | ||
705 | # | 710 | # |
@@ -711,8 +716,10 @@ CONFIG_SSB_POSSIBLE=y | |||
711 | # | 716 | # |
712 | # Multifunction device drivers | 717 | # Multifunction device drivers |
713 | # | 718 | # |
719 | # CONFIG_MFD_CORE is not set | ||
714 | # CONFIG_MFD_SM501 is not set | 720 | # CONFIG_MFD_SM501 is not set |
715 | # CONFIG_HTC_PASIC3 is not set | 721 | # CONFIG_HTC_PASIC3 is not set |
722 | # CONFIG_MFD_TMIO is not set | ||
716 | 723 | ||
717 | # | 724 | # |
718 | # Multimedia devices | 725 | # Multimedia devices |
@@ -782,10 +789,6 @@ CONFIG_LOGO=y | |||
782 | CONFIG_LOGO_LINUX_MONO=y | 789 | CONFIG_LOGO_LINUX_MONO=y |
783 | CONFIG_LOGO_LINUX_VGA16=y | 790 | CONFIG_LOGO_LINUX_VGA16=y |
784 | CONFIG_LOGO_LINUX_CLUT224=y | 791 | CONFIG_LOGO_LINUX_CLUT224=y |
785 | |||
786 | # | ||
787 | # Sound | ||
788 | # | ||
789 | CONFIG_SOUND=m | 792 | CONFIG_SOUND=m |
790 | CONFIG_DMASOUND_ATARI=m | 793 | CONFIG_DMASOUND_ATARI=m |
791 | CONFIG_DMASOUND=m | 794 | CONFIG_DMASOUND=m |
@@ -799,6 +802,7 @@ CONFIG_HIDRAW=y | |||
799 | # CONFIG_NEW_LEDS is not set | 802 | # CONFIG_NEW_LEDS is not set |
800 | # CONFIG_ACCESSIBILITY is not set | 803 | # CONFIG_ACCESSIBILITY is not set |
801 | # CONFIG_RTC_CLASS is not set | 804 | # CONFIG_RTC_CLASS is not set |
805 | # CONFIG_DMADEVICES is not set | ||
802 | # CONFIG_AUXDISPLAY is not set | 806 | # CONFIG_AUXDISPLAY is not set |
803 | # CONFIG_UIO is not set | 807 | # CONFIG_UIO is not set |
804 | 808 | ||
@@ -806,11 +810,8 @@ CONFIG_HIDRAW=y | |||
806 | # Character devices | 810 | # Character devices |
807 | # | 811 | # |
808 | CONFIG_ATARI_MFPSER=m | 812 | CONFIG_ATARI_MFPSER=m |
809 | CONFIG_ATARI_SCC=y | ||
810 | CONFIG_ATARI_SCC_DMA=y | ||
811 | CONFIG_ATARI_MIDI=m | 813 | CONFIG_ATARI_MIDI=m |
812 | CONFIG_ATARI_DSP56K=m | 814 | CONFIG_ATARI_DSP56K=m |
813 | # CONFIG_SERIAL_CONSOLE is not set | ||
814 | 815 | ||
815 | # | 816 | # |
816 | # File systems | 817 | # File systems |
@@ -820,8 +821,10 @@ CONFIG_EXT2_FS=y | |||
820 | # CONFIG_EXT2_FS_XIP is not set | 821 | # CONFIG_EXT2_FS_XIP is not set |
821 | CONFIG_EXT3_FS=y | 822 | CONFIG_EXT3_FS=y |
822 | # CONFIG_EXT3_FS_XATTR is not set | 823 | # CONFIG_EXT3_FS_XATTR is not set |
823 | # CONFIG_EXT4DEV_FS is not set | 824 | CONFIG_EXT4DEV_FS=y |
825 | # CONFIG_EXT4DEV_FS_XATTR is not set | ||
824 | CONFIG_JBD=y | 826 | CONFIG_JBD=y |
827 | CONFIG_JBD2=y | ||
825 | CONFIG_REISERFS_FS=m | 828 | CONFIG_REISERFS_FS=m |
826 | # CONFIG_REISERFS_CHECK is not set | 829 | # CONFIG_REISERFS_CHECK is not set |
827 | # CONFIG_REISERFS_PROC_INFO is not set | 830 | # CONFIG_REISERFS_PROC_INFO is not set |
@@ -840,6 +843,7 @@ CONFIG_XFS_FS=m | |||
840 | CONFIG_OCFS2_FS=m | 843 | CONFIG_OCFS2_FS=m |
841 | CONFIG_OCFS2_FS_O2CB=m | 844 | CONFIG_OCFS2_FS_O2CB=m |
842 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 845 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
846 | # CONFIG_OCFS2_FS_STATS is not set | ||
843 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 847 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
844 | # CONFIG_OCFS2_DEBUG_FS is not set | 848 | # CONFIG_OCFS2_DEBUG_FS is not set |
845 | CONFIG_DNOTIFY=y | 849 | CONFIG_DNOTIFY=y |
@@ -899,6 +903,7 @@ CONFIG_HFSPLUS_FS=m | |||
899 | CONFIG_CRAMFS=m | 903 | CONFIG_CRAMFS=m |
900 | # CONFIG_VXFS_FS is not set | 904 | # CONFIG_VXFS_FS is not set |
901 | CONFIG_MINIX_FS=y | 905 | CONFIG_MINIX_FS=y |
906 | # CONFIG_OMFS_FS is not set | ||
902 | CONFIG_HPFS_FS=m | 907 | CONFIG_HPFS_FS=m |
903 | # CONFIG_QNX4FS_FS is not set | 908 | # CONFIG_QNX4FS_FS is not set |
904 | # CONFIG_ROMFS_FS is not set | 909 | # CONFIG_ROMFS_FS is not set |
@@ -920,7 +925,6 @@ CONFIG_LOCKD_V4=y | |||
920 | CONFIG_EXPORTFS=m | 925 | CONFIG_EXPORTFS=m |
921 | CONFIG_NFS_COMMON=y | 926 | CONFIG_NFS_COMMON=y |
922 | CONFIG_SUNRPC=m | 927 | CONFIG_SUNRPC=m |
923 | CONFIG_SUNRPC_BIND34=y | ||
924 | # CONFIG_RPCSEC_GSS_KRB5 is not set | 928 | # CONFIG_RPCSEC_GSS_KRB5 is not set |
925 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 929 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
926 | CONFIG_SMB_FS=m | 930 | CONFIG_SMB_FS=m |
@@ -929,7 +933,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
929 | # CONFIG_CIFS is not set | 933 | # CONFIG_CIFS is not set |
930 | # CONFIG_NCP_FS is not set | 934 | # CONFIG_NCP_FS is not set |
931 | CONFIG_CODA_FS=m | 935 | CONFIG_CODA_FS=m |
932 | # CONFIG_CODA_FS_OLD_API is not set | ||
933 | # CONFIG_AFS_FS is not set | 936 | # CONFIG_AFS_FS is not set |
934 | 937 | ||
935 | # | 938 | # |
@@ -994,6 +997,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
994 | # CONFIG_HEADERS_CHECK is not set | 997 | # CONFIG_HEADERS_CHECK is not set |
995 | # CONFIG_DEBUG_KERNEL is not set | 998 | # CONFIG_DEBUG_KERNEL is not set |
996 | CONFIG_DEBUG_BUGVERBOSE=y | 999 | CONFIG_DEBUG_BUGVERBOSE=y |
1000 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1001 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
997 | # CONFIG_SAMPLES is not set | 1002 | # CONFIG_SAMPLES is not set |
998 | 1003 | ||
999 | # | 1004 | # |
@@ -1053,6 +1058,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1053 | CONFIG_CRYPTO_MD4=m | 1058 | CONFIG_CRYPTO_MD4=m |
1054 | CONFIG_CRYPTO_MD5=m | 1059 | CONFIG_CRYPTO_MD5=m |
1055 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1060 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1061 | CONFIG_CRYPTO_RMD128=m | ||
1062 | CONFIG_CRYPTO_RMD160=m | ||
1063 | CONFIG_CRYPTO_RMD256=m | ||
1064 | CONFIG_CRYPTO_RMD320=m | ||
1056 | CONFIG_CRYPTO_SHA1=m | 1065 | CONFIG_CRYPTO_SHA1=m |
1057 | CONFIG_CRYPTO_SHA256=m | 1066 | CONFIG_CRYPTO_SHA256=m |
1058 | CONFIG_CRYPTO_SHA512=m | 1067 | CONFIG_CRYPTO_SHA512=m |
@@ -1094,6 +1103,7 @@ CONFIG_BITREVERSE=y | |||
1094 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1103 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1095 | CONFIG_CRC_CCITT=m | 1104 | CONFIG_CRC_CCITT=m |
1096 | CONFIG_CRC16=y | 1105 | CONFIG_CRC16=y |
1106 | CONFIG_CRC_T10DIF=y | ||
1097 | CONFIG_CRC_ITU_T=m | 1107 | CONFIG_CRC_ITU_T=m |
1098 | CONFIG_CRC32=y | 1108 | CONFIG_CRC32=y |
1099 | # CONFIG_CRC7 is not set | 1109 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index a0a9b30bb502..2e44af0fe54a 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:03 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -163,10 +169,6 @@ CONFIG_BINFMT_MISC=m | |||
163 | CONFIG_PROC_HARDWARE=y | 169 | CONFIG_PROC_HARDWARE=y |
164 | CONFIG_ZONE_DMA=y | 170 | CONFIG_ZONE_DMA=y |
165 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 171 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
166 | |||
167 | # | ||
168 | # Networking | ||
169 | # | ||
170 | CONFIG_NET=y | 172 | CONFIG_NET=y |
171 | 173 | ||
172 | # | 174 | # |
@@ -180,6 +182,7 @@ CONFIG_XFRM=y | |||
180 | # CONFIG_XFRM_SUB_POLICY is not set | 182 | # CONFIG_XFRM_SUB_POLICY is not set |
181 | CONFIG_XFRM_MIGRATE=y | 183 | CONFIG_XFRM_MIGRATE=y |
182 | # CONFIG_XFRM_STATISTICS is not set | 184 | # CONFIG_XFRM_STATISTICS is not set |
185 | CONFIG_XFRM_IPCOMP=m | ||
183 | CONFIG_NET_KEY=y | 186 | CONFIG_NET_KEY=y |
184 | CONFIG_NET_KEY_MIGRATE=y | 187 | CONFIG_NET_KEY_MIGRATE=y |
185 | CONFIG_INET=y | 188 | CONFIG_INET=y |
@@ -413,6 +416,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
413 | # | 416 | # |
414 | # CONFIG_CFG80211 is not set | 417 | # CONFIG_CFG80211 is not set |
415 | CONFIG_WIRELESS_EXT=y | 418 | CONFIG_WIRELESS_EXT=y |
419 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
416 | # CONFIG_MAC80211 is not set | 420 | # CONFIG_MAC80211 is not set |
417 | CONFIG_IEEE80211=m | 421 | CONFIG_IEEE80211=m |
418 | # CONFIG_IEEE80211_DEBUG is not set | 422 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -432,7 +436,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 436 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
433 | CONFIG_STANDALONE=y | 437 | CONFIG_STANDALONE=y |
434 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 438 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
435 | CONFIG_FW_LOADER=m | 439 | CONFIG_FW_LOADER=y |
440 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
441 | CONFIG_EXTRA_FIRMWARE="" | ||
436 | # CONFIG_SYS_HYPERVISOR is not set | 442 | # CONFIG_SYS_HYPERVISOR is not set |
437 | CONFIG_CONNECTOR=m | 443 | CONFIG_CONNECTOR=m |
438 | # CONFIG_MTD is not set | 444 | # CONFIG_MTD is not set |
@@ -450,6 +456,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
450 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 456 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
451 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 457 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
452 | CONFIG_ATA_OVER_ETH=m | 458 | CONFIG_ATA_OVER_ETH=m |
459 | # CONFIG_BLK_DEV_HD is not set | ||
453 | CONFIG_MISC_DEVICES=y | 460 | CONFIG_MISC_DEVICES=y |
454 | # CONFIG_EEPROM_93CX6 is not set | 461 | # CONFIG_EEPROM_93CX6 is not set |
455 | # CONFIG_ENCLOSURE_SERVICES is not set | 462 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -503,6 +510,7 @@ CONFIG_ISCSI_TCP=m | |||
503 | CONFIG_53C700_BE_BUS=y | 510 | CONFIG_53C700_BE_BUS=y |
504 | # CONFIG_SCSI_DEBUG is not set | 511 | # CONFIG_SCSI_DEBUG is not set |
505 | CONFIG_BVME6000_SCSI=y | 512 | CONFIG_BVME6000_SCSI=y |
513 | # CONFIG_SCSI_DH is not set | ||
506 | CONFIG_MD=y | 514 | CONFIG_MD=y |
507 | CONFIG_BLK_DEV_MD=m | 515 | CONFIG_BLK_DEV_MD=m |
508 | CONFIG_MD_LINEAR=m | 516 | CONFIG_MD_LINEAR=m |
@@ -511,7 +519,7 @@ CONFIG_MD_RAID1=m | |||
511 | # CONFIG_MD_RAID10 is not set | 519 | # CONFIG_MD_RAID10 is not set |
512 | CONFIG_MD_RAID456=m | 520 | CONFIG_MD_RAID456=m |
513 | CONFIG_MD_RAID5_RESHAPE=y | 521 | CONFIG_MD_RAID5_RESHAPE=y |
514 | CONFIG_MD_MULTIPATH=m | 522 | # CONFIG_MD_MULTIPATH is not set |
515 | # CONFIG_MD_FAULTY is not set | 523 | # CONFIG_MD_FAULTY is not set |
516 | CONFIG_BLK_DEV_DM=m | 524 | CONFIG_BLK_DEV_DM=m |
517 | # CONFIG_DM_DEBUG is not set | 525 | # CONFIG_DM_DEBUG is not set |
@@ -520,13 +528,9 @@ CONFIG_DM_SNAPSHOT=m | |||
520 | CONFIG_DM_MIRROR=m | 528 | CONFIG_DM_MIRROR=m |
521 | CONFIG_DM_ZERO=m | 529 | CONFIG_DM_ZERO=m |
522 | CONFIG_DM_MULTIPATH=m | 530 | CONFIG_DM_MULTIPATH=m |
523 | CONFIG_DM_MULTIPATH_EMC=m | ||
524 | CONFIG_DM_MULTIPATH_RDAC=m | ||
525 | CONFIG_DM_MULTIPATH_HP=m | ||
526 | # CONFIG_DM_DELAY is not set | 531 | # CONFIG_DM_DELAY is not set |
527 | CONFIG_DM_UEVENT=y | 532 | CONFIG_DM_UEVENT=y |
528 | CONFIG_NETDEVICES=y | 533 | CONFIG_NETDEVICES=y |
529 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
530 | CONFIG_DUMMY=m | 534 | CONFIG_DUMMY=m |
531 | # CONFIG_BONDING is not set | 535 | # CONFIG_BONDING is not set |
532 | CONFIG_MACVLAN=m | 536 | CONFIG_MACVLAN=m |
@@ -631,6 +635,7 @@ CONFIG_SERIO_LIBPS2=m | |||
631 | # Character devices | 635 | # Character devices |
632 | # | 636 | # |
633 | CONFIG_VT=y | 637 | CONFIG_VT=y |
638 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
634 | CONFIG_VT_CONSOLE=y | 639 | CONFIG_VT_CONSOLE=y |
635 | CONFIG_HW_CONSOLE=y | 640 | CONFIG_HW_CONSOLE=y |
636 | CONFIG_VT_HW_CONSOLE_BINDING=y | 641 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -661,6 +666,7 @@ CONFIG_GEN_RTC_X=y | |||
661 | # CONFIG_POWER_SUPPLY is not set | 666 | # CONFIG_POWER_SUPPLY is not set |
662 | # CONFIG_HWMON is not set | 667 | # CONFIG_HWMON is not set |
663 | # CONFIG_THERMAL is not set | 668 | # CONFIG_THERMAL is not set |
669 | # CONFIG_THERMAL_HWMON is not set | ||
664 | # CONFIG_WATCHDOG is not set | 670 | # CONFIG_WATCHDOG is not set |
665 | 671 | ||
666 | # | 672 | # |
@@ -672,8 +678,10 @@ CONFIG_SSB_POSSIBLE=y | |||
672 | # | 678 | # |
673 | # Multifunction device drivers | 679 | # Multifunction device drivers |
674 | # | 680 | # |
681 | # CONFIG_MFD_CORE is not set | ||
675 | # CONFIG_MFD_SM501 is not set | 682 | # CONFIG_MFD_SM501 is not set |
676 | # CONFIG_HTC_PASIC3 is not set | 683 | # CONFIG_HTC_PASIC3 is not set |
684 | # CONFIG_MFD_TMIO is not set | ||
677 | 685 | ||
678 | # | 686 | # |
679 | # Multimedia devices | 687 | # Multimedia devices |
@@ -708,10 +716,6 @@ CONFIG_SSB_POSSIBLE=y | |||
708 | # Console display driver support | 716 | # Console display driver support |
709 | # | 717 | # |
710 | CONFIG_DUMMY_CONSOLE=y | 718 | CONFIG_DUMMY_CONSOLE=y |
711 | |||
712 | # | ||
713 | # Sound | ||
714 | # | ||
715 | # CONFIG_SOUND is not set | 719 | # CONFIG_SOUND is not set |
716 | CONFIG_HID_SUPPORT=y | 720 | CONFIG_HID_SUPPORT=y |
717 | CONFIG_HID=m | 721 | CONFIG_HID=m |
@@ -723,6 +727,7 @@ CONFIG_HIDRAW=y | |||
723 | # CONFIG_NEW_LEDS is not set | 727 | # CONFIG_NEW_LEDS is not set |
724 | # CONFIG_ACCESSIBILITY is not set | 728 | # CONFIG_ACCESSIBILITY is not set |
725 | # CONFIG_RTC_CLASS is not set | 729 | # CONFIG_RTC_CLASS is not set |
730 | # CONFIG_DMADEVICES is not set | ||
726 | # CONFIG_UIO is not set | 731 | # CONFIG_UIO is not set |
727 | 732 | ||
728 | # | 733 | # |
@@ -759,6 +764,7 @@ CONFIG_XFS_FS=m | |||
759 | CONFIG_OCFS2_FS=m | 764 | CONFIG_OCFS2_FS=m |
760 | CONFIG_OCFS2_FS_O2CB=m | 765 | CONFIG_OCFS2_FS_O2CB=m |
761 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 766 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
767 | # CONFIG_OCFS2_FS_STATS is not set | ||
762 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 768 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
763 | # CONFIG_OCFS2_DEBUG_FS is not set | 769 | # CONFIG_OCFS2_DEBUG_FS is not set |
764 | CONFIG_DNOTIFY=y | 770 | CONFIG_DNOTIFY=y |
@@ -818,6 +824,7 @@ CONFIG_HFSPLUS_FS=m | |||
818 | CONFIG_CRAMFS=m | 824 | CONFIG_CRAMFS=m |
819 | # CONFIG_VXFS_FS is not set | 825 | # CONFIG_VXFS_FS is not set |
820 | CONFIG_MINIX_FS=y | 826 | CONFIG_MINIX_FS=y |
827 | # CONFIG_OMFS_FS is not set | ||
821 | CONFIG_HPFS_FS=m | 828 | CONFIG_HPFS_FS=m |
822 | # CONFIG_QNX4FS_FS is not set | 829 | # CONFIG_QNX4FS_FS is not set |
823 | # CONFIG_ROMFS_FS is not set | 830 | # CONFIG_ROMFS_FS is not set |
@@ -830,18 +837,17 @@ CONFIG_NFS_FS=y | |||
830 | CONFIG_NFS_V3=y | 837 | CONFIG_NFS_V3=y |
831 | # CONFIG_NFS_V3_ACL is not set | 838 | # CONFIG_NFS_V3_ACL is not set |
832 | CONFIG_NFS_V4=y | 839 | CONFIG_NFS_V4=y |
840 | CONFIG_ROOT_NFS=y | ||
833 | CONFIG_NFSD=m | 841 | CONFIG_NFSD=m |
834 | CONFIG_NFSD_V3=y | 842 | CONFIG_NFSD_V3=y |
835 | # CONFIG_NFSD_V3_ACL is not set | 843 | # CONFIG_NFSD_V3_ACL is not set |
836 | # CONFIG_NFSD_V4 is not set | 844 | # CONFIG_NFSD_V4 is not set |
837 | CONFIG_ROOT_NFS=y | ||
838 | CONFIG_LOCKD=y | 845 | CONFIG_LOCKD=y |
839 | CONFIG_LOCKD_V4=y | 846 | CONFIG_LOCKD_V4=y |
840 | CONFIG_EXPORTFS=m | 847 | CONFIG_EXPORTFS=m |
841 | CONFIG_NFS_COMMON=y | 848 | CONFIG_NFS_COMMON=y |
842 | CONFIG_SUNRPC=y | 849 | CONFIG_SUNRPC=y |
843 | CONFIG_SUNRPC_GSS=y | 850 | CONFIG_SUNRPC_GSS=y |
844 | CONFIG_SUNRPC_BIND34=y | ||
845 | CONFIG_RPCSEC_GSS_KRB5=y | 851 | CONFIG_RPCSEC_GSS_KRB5=y |
846 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 852 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
847 | CONFIG_SMB_FS=m | 853 | CONFIG_SMB_FS=m |
@@ -850,7 +856,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
850 | # CONFIG_CIFS is not set | 856 | # CONFIG_CIFS is not set |
851 | # CONFIG_NCP_FS is not set | 857 | # CONFIG_NCP_FS is not set |
852 | CONFIG_CODA_FS=m | 858 | CONFIG_CODA_FS=m |
853 | # CONFIG_CODA_FS_OLD_API is not set | ||
854 | # CONFIG_AFS_FS is not set | 859 | # CONFIG_AFS_FS is not set |
855 | 860 | ||
856 | # | 861 | # |
@@ -915,6 +920,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
915 | # CONFIG_HEADERS_CHECK is not set | 920 | # CONFIG_HEADERS_CHECK is not set |
916 | # CONFIG_DEBUG_KERNEL is not set | 921 | # CONFIG_DEBUG_KERNEL is not set |
917 | CONFIG_DEBUG_BUGVERBOSE=y | 922 | CONFIG_DEBUG_BUGVERBOSE=y |
923 | CONFIG_DEBUG_MEMORY_INIT=y | ||
924 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
918 | # CONFIG_SAMPLES is not set | 925 | # CONFIG_SAMPLES is not set |
919 | 926 | ||
920 | # | 927 | # |
@@ -974,6 +981,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
974 | CONFIG_CRYPTO_MD4=m | 981 | CONFIG_CRYPTO_MD4=m |
975 | CONFIG_CRYPTO_MD5=y | 982 | CONFIG_CRYPTO_MD5=y |
976 | CONFIG_CRYPTO_MICHAEL_MIC=m | 983 | CONFIG_CRYPTO_MICHAEL_MIC=m |
984 | CONFIG_CRYPTO_RMD128=m | ||
985 | CONFIG_CRYPTO_RMD160=m | ||
986 | CONFIG_CRYPTO_RMD256=m | ||
987 | CONFIG_CRYPTO_RMD320=m | ||
977 | CONFIG_CRYPTO_SHA1=m | 988 | CONFIG_CRYPTO_SHA1=m |
978 | CONFIG_CRYPTO_SHA256=m | 989 | CONFIG_CRYPTO_SHA256=m |
979 | CONFIG_CRYPTO_SHA512=m | 990 | CONFIG_CRYPTO_SHA512=m |
@@ -1015,6 +1026,7 @@ CONFIG_BITREVERSE=m | |||
1015 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1026 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1016 | CONFIG_CRC_CCITT=m | 1027 | CONFIG_CRC_CCITT=m |
1017 | CONFIG_CRC16=m | 1028 | CONFIG_CRC16=m |
1029 | CONFIG_CRC_T10DIF=y | ||
1018 | CONFIG_CRC_ITU_T=m | 1030 | CONFIG_CRC_ITU_T=m |
1019 | CONFIG_CRC32=m | 1031 | CONFIG_CRC32=m |
1020 | # CONFIG_CRC7 is not set | 1032 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 6778041de262..3570fc89b089 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:04 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -162,10 +168,6 @@ CONFIG_HEARTBEAT=y | |||
162 | CONFIG_PROC_HARDWARE=y | 168 | CONFIG_PROC_HARDWARE=y |
163 | CONFIG_ZONE_DMA=y | 169 | CONFIG_ZONE_DMA=y |
164 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 170 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
165 | |||
166 | # | ||
167 | # Networking | ||
168 | # | ||
169 | CONFIG_NET=y | 171 | CONFIG_NET=y |
170 | 172 | ||
171 | # | 173 | # |
@@ -179,6 +181,7 @@ CONFIG_XFRM=y | |||
179 | # CONFIG_XFRM_SUB_POLICY is not set | 181 | # CONFIG_XFRM_SUB_POLICY is not set |
180 | CONFIG_XFRM_MIGRATE=y | 182 | CONFIG_XFRM_MIGRATE=y |
181 | # CONFIG_XFRM_STATISTICS is not set | 183 | # CONFIG_XFRM_STATISTICS is not set |
184 | CONFIG_XFRM_IPCOMP=m | ||
182 | CONFIG_NET_KEY=y | 185 | CONFIG_NET_KEY=y |
183 | CONFIG_NET_KEY_MIGRATE=y | 186 | CONFIG_NET_KEY_MIGRATE=y |
184 | CONFIG_INET=y | 187 | CONFIG_INET=y |
@@ -412,6 +415,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
412 | # | 415 | # |
413 | # CONFIG_CFG80211 is not set | 416 | # CONFIG_CFG80211 is not set |
414 | CONFIG_WIRELESS_EXT=y | 417 | CONFIG_WIRELESS_EXT=y |
418 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
415 | # CONFIG_MAC80211 is not set | 419 | # CONFIG_MAC80211 is not set |
416 | CONFIG_IEEE80211=m | 420 | CONFIG_IEEE80211=m |
417 | # CONFIG_IEEE80211_DEBUG is not set | 421 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -431,7 +435,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
431 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 435 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
432 | CONFIG_STANDALONE=y | 436 | CONFIG_STANDALONE=y |
433 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 437 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
434 | CONFIG_FW_LOADER=m | 438 | CONFIG_FW_LOADER=y |
439 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
440 | CONFIG_EXTRA_FIRMWARE="" | ||
435 | # CONFIG_SYS_HYPERVISOR is not set | 441 | # CONFIG_SYS_HYPERVISOR is not set |
436 | CONFIG_CONNECTOR=m | 442 | CONFIG_CONNECTOR=m |
437 | # CONFIG_MTD is not set | 443 | # CONFIG_MTD is not set |
@@ -449,6 +455,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
449 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 455 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
450 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 456 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
451 | CONFIG_ATA_OVER_ETH=m | 457 | CONFIG_ATA_OVER_ETH=m |
458 | # CONFIG_BLK_DEV_HD is not set | ||
452 | CONFIG_MISC_DEVICES=y | 459 | CONFIG_MISC_DEVICES=y |
453 | # CONFIG_EEPROM_93CX6 is not set | 460 | # CONFIG_EEPROM_93CX6 is not set |
454 | # CONFIG_ENCLOSURE_SERVICES is not set | 461 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -500,6 +507,7 @@ CONFIG_SCSI_SRP_TGT_ATTRS=y | |||
500 | CONFIG_SCSI_LOWLEVEL=y | 507 | CONFIG_SCSI_LOWLEVEL=y |
501 | CONFIG_ISCSI_TCP=m | 508 | CONFIG_ISCSI_TCP=m |
502 | # CONFIG_SCSI_DEBUG is not set | 509 | # CONFIG_SCSI_DEBUG is not set |
510 | # CONFIG_SCSI_DH is not set | ||
503 | CONFIG_MD=y | 511 | CONFIG_MD=y |
504 | CONFIG_BLK_DEV_MD=m | 512 | CONFIG_BLK_DEV_MD=m |
505 | CONFIG_MD_LINEAR=m | 513 | CONFIG_MD_LINEAR=m |
@@ -508,7 +516,7 @@ CONFIG_MD_RAID1=m | |||
508 | # CONFIG_MD_RAID10 is not set | 516 | # CONFIG_MD_RAID10 is not set |
509 | CONFIG_MD_RAID456=m | 517 | CONFIG_MD_RAID456=m |
510 | CONFIG_MD_RAID5_RESHAPE=y | 518 | CONFIG_MD_RAID5_RESHAPE=y |
511 | CONFIG_MD_MULTIPATH=m | 519 | # CONFIG_MD_MULTIPATH is not set |
512 | # CONFIG_MD_FAULTY is not set | 520 | # CONFIG_MD_FAULTY is not set |
513 | CONFIG_BLK_DEV_DM=m | 521 | CONFIG_BLK_DEV_DM=m |
514 | # CONFIG_DM_DEBUG is not set | 522 | # CONFIG_DM_DEBUG is not set |
@@ -517,13 +525,9 @@ CONFIG_DM_SNAPSHOT=m | |||
517 | CONFIG_DM_MIRROR=m | 525 | CONFIG_DM_MIRROR=m |
518 | CONFIG_DM_ZERO=m | 526 | CONFIG_DM_ZERO=m |
519 | CONFIG_DM_MULTIPATH=m | 527 | CONFIG_DM_MULTIPATH=m |
520 | CONFIG_DM_MULTIPATH_EMC=m | ||
521 | CONFIG_DM_MULTIPATH_RDAC=m | ||
522 | CONFIG_DM_MULTIPATH_HP=m | ||
523 | # CONFIG_DM_DELAY is not set | 528 | # CONFIG_DM_DELAY is not set |
524 | CONFIG_DM_UEVENT=y | 529 | CONFIG_DM_UEVENT=y |
525 | CONFIG_NETDEVICES=y | 530 | CONFIG_NETDEVICES=y |
526 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
527 | CONFIG_DUMMY=m | 531 | CONFIG_DUMMY=m |
528 | # CONFIG_BONDING is not set | 532 | # CONFIG_BONDING is not set |
529 | CONFIG_MACVLAN=m | 533 | CONFIG_MACVLAN=m |
@@ -636,6 +640,7 @@ CONFIG_SERIO_LIBPS2=m | |||
636 | # Character devices | 640 | # Character devices |
637 | # | 641 | # |
638 | CONFIG_VT=y | 642 | CONFIG_VT=y |
643 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
639 | CONFIG_VT_CONSOLE=y | 644 | CONFIG_VT_CONSOLE=y |
640 | CONFIG_HW_CONSOLE=y | 645 | CONFIG_HW_CONSOLE=y |
641 | CONFIG_VT_HW_CONSOLE_BINDING=y | 646 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -666,6 +671,7 @@ CONFIG_GEN_RTC_X=y | |||
666 | # CONFIG_POWER_SUPPLY is not set | 671 | # CONFIG_POWER_SUPPLY is not set |
667 | # CONFIG_HWMON is not set | 672 | # CONFIG_HWMON is not set |
668 | # CONFIG_THERMAL is not set | 673 | # CONFIG_THERMAL is not set |
674 | # CONFIG_THERMAL_HWMON is not set | ||
669 | # CONFIG_WATCHDOG is not set | 675 | # CONFIG_WATCHDOG is not set |
670 | 676 | ||
671 | # | 677 | # |
@@ -677,8 +683,10 @@ CONFIG_SSB_POSSIBLE=y | |||
677 | # | 683 | # |
678 | # Multifunction device drivers | 684 | # Multifunction device drivers |
679 | # | 685 | # |
686 | # CONFIG_MFD_CORE is not set | ||
680 | # CONFIG_MFD_SM501 is not set | 687 | # CONFIG_MFD_SM501 is not set |
681 | # CONFIG_HTC_PASIC3 is not set | 688 | # CONFIG_HTC_PASIC3 is not set |
689 | # CONFIG_MFD_TMIO is not set | ||
682 | 690 | ||
683 | # | 691 | # |
684 | # Multimedia devices | 692 | # Multimedia devices |
@@ -747,10 +755,6 @@ CONFIG_LOGO=y | |||
747 | # CONFIG_LOGO_LINUX_MONO is not set | 755 | # CONFIG_LOGO_LINUX_MONO is not set |
748 | # CONFIG_LOGO_LINUX_VGA16 is not set | 756 | # CONFIG_LOGO_LINUX_VGA16 is not set |
749 | CONFIG_LOGO_LINUX_CLUT224=y | 757 | CONFIG_LOGO_LINUX_CLUT224=y |
750 | |||
751 | # | ||
752 | # Sound | ||
753 | # | ||
754 | # CONFIG_SOUND is not set | 758 | # CONFIG_SOUND is not set |
755 | CONFIG_HID_SUPPORT=y | 759 | CONFIG_HID_SUPPORT=y |
756 | CONFIG_HID=m | 760 | CONFIG_HID=m |
@@ -762,6 +766,7 @@ CONFIG_HIDRAW=y | |||
762 | # CONFIG_NEW_LEDS is not set | 766 | # CONFIG_NEW_LEDS is not set |
763 | # CONFIG_ACCESSIBILITY is not set | 767 | # CONFIG_ACCESSIBILITY is not set |
764 | # CONFIG_RTC_CLASS is not set | 768 | # CONFIG_RTC_CLASS is not set |
769 | # CONFIG_DMADEVICES is not set | ||
765 | # CONFIG_UIO is not set | 770 | # CONFIG_UIO is not set |
766 | 771 | ||
767 | # | 772 | # |
@@ -796,6 +801,7 @@ CONFIG_XFS_FS=m | |||
796 | CONFIG_OCFS2_FS=m | 801 | CONFIG_OCFS2_FS=m |
797 | CONFIG_OCFS2_FS_O2CB=m | 802 | CONFIG_OCFS2_FS_O2CB=m |
798 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 803 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
804 | # CONFIG_OCFS2_FS_STATS is not set | ||
799 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 805 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
800 | # CONFIG_OCFS2_DEBUG_FS is not set | 806 | # CONFIG_OCFS2_DEBUG_FS is not set |
801 | CONFIG_DNOTIFY=y | 807 | CONFIG_DNOTIFY=y |
@@ -855,6 +861,7 @@ CONFIG_HFSPLUS_FS=m | |||
855 | CONFIG_CRAMFS=m | 861 | CONFIG_CRAMFS=m |
856 | # CONFIG_VXFS_FS is not set | 862 | # CONFIG_VXFS_FS is not set |
857 | CONFIG_MINIX_FS=y | 863 | CONFIG_MINIX_FS=y |
864 | # CONFIG_OMFS_FS is not set | ||
858 | CONFIG_HPFS_FS=m | 865 | CONFIG_HPFS_FS=m |
859 | # CONFIG_QNX4FS_FS is not set | 866 | # CONFIG_QNX4FS_FS is not set |
860 | # CONFIG_ROMFS_FS is not set | 867 | # CONFIG_ROMFS_FS is not set |
@@ -867,18 +874,17 @@ CONFIG_NFS_FS=y | |||
867 | CONFIG_NFS_V3=y | 874 | CONFIG_NFS_V3=y |
868 | # CONFIG_NFS_V3_ACL is not set | 875 | # CONFIG_NFS_V3_ACL is not set |
869 | CONFIG_NFS_V4=y | 876 | CONFIG_NFS_V4=y |
877 | CONFIG_ROOT_NFS=y | ||
870 | CONFIG_NFSD=m | 878 | CONFIG_NFSD=m |
871 | CONFIG_NFSD_V3=y | 879 | CONFIG_NFSD_V3=y |
872 | # CONFIG_NFSD_V3_ACL is not set | 880 | # CONFIG_NFSD_V3_ACL is not set |
873 | # CONFIG_NFSD_V4 is not set | 881 | # CONFIG_NFSD_V4 is not set |
874 | CONFIG_ROOT_NFS=y | ||
875 | CONFIG_LOCKD=y | 882 | CONFIG_LOCKD=y |
876 | CONFIG_LOCKD_V4=y | 883 | CONFIG_LOCKD_V4=y |
877 | CONFIG_EXPORTFS=m | 884 | CONFIG_EXPORTFS=m |
878 | CONFIG_NFS_COMMON=y | 885 | CONFIG_NFS_COMMON=y |
879 | CONFIG_SUNRPC=y | 886 | CONFIG_SUNRPC=y |
880 | CONFIG_SUNRPC_GSS=y | 887 | CONFIG_SUNRPC_GSS=y |
881 | CONFIG_SUNRPC_BIND34=y | ||
882 | CONFIG_RPCSEC_GSS_KRB5=y | 888 | CONFIG_RPCSEC_GSS_KRB5=y |
883 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 889 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
884 | CONFIG_SMB_FS=m | 890 | CONFIG_SMB_FS=m |
@@ -887,7 +893,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
887 | # CONFIG_CIFS is not set | 893 | # CONFIG_CIFS is not set |
888 | # CONFIG_NCP_FS is not set | 894 | # CONFIG_NCP_FS is not set |
889 | CONFIG_CODA_FS=m | 895 | CONFIG_CODA_FS=m |
890 | # CONFIG_CODA_FS_OLD_API is not set | ||
891 | # CONFIG_AFS_FS is not set | 896 | # CONFIG_AFS_FS is not set |
892 | 897 | ||
893 | # | 898 | # |
@@ -951,6 +956,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
951 | # CONFIG_HEADERS_CHECK is not set | 956 | # CONFIG_HEADERS_CHECK is not set |
952 | # CONFIG_DEBUG_KERNEL is not set | 957 | # CONFIG_DEBUG_KERNEL is not set |
953 | CONFIG_DEBUG_BUGVERBOSE=y | 958 | CONFIG_DEBUG_BUGVERBOSE=y |
959 | CONFIG_DEBUG_MEMORY_INIT=y | ||
960 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
954 | # CONFIG_SAMPLES is not set | 961 | # CONFIG_SAMPLES is not set |
955 | 962 | ||
956 | # | 963 | # |
@@ -1010,6 +1017,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1010 | CONFIG_CRYPTO_MD4=m | 1017 | CONFIG_CRYPTO_MD4=m |
1011 | CONFIG_CRYPTO_MD5=y | 1018 | CONFIG_CRYPTO_MD5=y |
1012 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1019 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1020 | CONFIG_CRYPTO_RMD128=m | ||
1021 | CONFIG_CRYPTO_RMD160=m | ||
1022 | CONFIG_CRYPTO_RMD256=m | ||
1023 | CONFIG_CRYPTO_RMD320=m | ||
1013 | CONFIG_CRYPTO_SHA1=m | 1024 | CONFIG_CRYPTO_SHA1=m |
1014 | CONFIG_CRYPTO_SHA256=m | 1025 | CONFIG_CRYPTO_SHA256=m |
1015 | CONFIG_CRYPTO_SHA512=m | 1026 | CONFIG_CRYPTO_SHA512=m |
@@ -1051,6 +1062,7 @@ CONFIG_BITREVERSE=y | |||
1051 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1062 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1052 | CONFIG_CRC_CCITT=m | 1063 | CONFIG_CRC_CCITT=m |
1053 | CONFIG_CRC16=m | 1064 | CONFIG_CRC16=m |
1065 | CONFIG_CRC_T10DIF=y | ||
1054 | CONFIG_CRC_ITU_T=m | 1066 | CONFIG_CRC_ITU_T=m |
1055 | CONFIG_CRC32=y | 1067 | CONFIG_CRC32=y |
1056 | # CONFIG_CRC7 is not set | 1068 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 7cd375740348..db6e8822594a 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:06 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -163,10 +169,6 @@ CONFIG_BINFMT_MISC=m | |||
163 | CONFIG_PROC_HARDWARE=y | 169 | CONFIG_PROC_HARDWARE=y |
164 | CONFIG_ZONE_DMA=y | 170 | CONFIG_ZONE_DMA=y |
165 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 171 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
166 | |||
167 | # | ||
168 | # Networking | ||
169 | # | ||
170 | CONFIG_NET=y | 172 | CONFIG_NET=y |
171 | 173 | ||
172 | # | 174 | # |
@@ -180,6 +182,7 @@ CONFIG_XFRM=y | |||
180 | # CONFIG_XFRM_SUB_POLICY is not set | 182 | # CONFIG_XFRM_SUB_POLICY is not set |
181 | CONFIG_XFRM_MIGRATE=y | 183 | CONFIG_XFRM_MIGRATE=y |
182 | # CONFIG_XFRM_STATISTICS is not set | 184 | # CONFIG_XFRM_STATISTICS is not set |
185 | CONFIG_XFRM_IPCOMP=m | ||
183 | CONFIG_NET_KEY=y | 186 | CONFIG_NET_KEY=y |
184 | CONFIG_NET_KEY_MIGRATE=y | 187 | CONFIG_NET_KEY_MIGRATE=y |
185 | CONFIG_INET=y | 188 | CONFIG_INET=y |
@@ -413,6 +416,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
413 | # | 416 | # |
414 | # CONFIG_CFG80211 is not set | 417 | # CONFIG_CFG80211 is not set |
415 | CONFIG_WIRELESS_EXT=y | 418 | CONFIG_WIRELESS_EXT=y |
419 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
416 | # CONFIG_MAC80211 is not set | 420 | # CONFIG_MAC80211 is not set |
417 | CONFIG_IEEE80211=m | 421 | CONFIG_IEEE80211=m |
418 | # CONFIG_IEEE80211_DEBUG is not set | 422 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -432,7 +436,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 436 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
433 | CONFIG_STANDALONE=y | 437 | CONFIG_STANDALONE=y |
434 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 438 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
435 | CONFIG_FW_LOADER=m | 439 | CONFIG_FW_LOADER=y |
440 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
441 | CONFIG_EXTRA_FIRMWARE="" | ||
436 | # CONFIG_SYS_HYPERVISOR is not set | 442 | # CONFIG_SYS_HYPERVISOR is not set |
437 | CONFIG_CONNECTOR=m | 443 | CONFIG_CONNECTOR=m |
438 | # CONFIG_MTD is not set | 444 | # CONFIG_MTD is not set |
@@ -450,6 +456,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
450 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 456 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
451 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 457 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
452 | CONFIG_ATA_OVER_ETH=m | 458 | CONFIG_ATA_OVER_ETH=m |
459 | # CONFIG_BLK_DEV_HD is not set | ||
453 | CONFIG_MISC_DEVICES=y | 460 | CONFIG_MISC_DEVICES=y |
454 | # CONFIG_EEPROM_93CX6 is not set | 461 | # CONFIG_EEPROM_93CX6 is not set |
455 | # CONFIG_ENCLOSURE_SERVICES is not set | 462 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -460,6 +467,7 @@ CONFIG_BLK_DEV_IDE=y | |||
460 | # | 467 | # |
461 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | 468 | # Please see Documentation/ide/ide.txt for help/info on IDE drives |
462 | # | 469 | # |
470 | CONFIG_IDE_ATAPI=y | ||
463 | # CONFIG_BLK_DEV_IDE_SATA is not set | 471 | # CONFIG_BLK_DEV_IDE_SATA is not set |
464 | CONFIG_BLK_DEV_IDEDISK=y | 472 | CONFIG_BLK_DEV_IDEDISK=y |
465 | # CONFIG_IDEDISK_MULTI_MODE is not set | 473 | # CONFIG_IDEDISK_MULTI_MODE is not set |
@@ -477,8 +485,6 @@ CONFIG_IDE_PROC_FS=y | |||
477 | # CONFIG_BLK_DEV_PLATFORM is not set | 485 | # CONFIG_BLK_DEV_PLATFORM is not set |
478 | CONFIG_BLK_DEV_MAC_IDE=y | 486 | CONFIG_BLK_DEV_MAC_IDE=y |
479 | # CONFIG_BLK_DEV_IDEDMA is not set | 487 | # CONFIG_BLK_DEV_IDEDMA is not set |
480 | # CONFIG_BLK_DEV_HD_ONLY is not set | ||
481 | # CONFIG_BLK_DEV_HD is not set | ||
482 | 488 | ||
483 | # | 489 | # |
484 | # SCSI device support | 490 | # SCSI device support |
@@ -527,6 +533,7 @@ CONFIG_ISCSI_TCP=m | |||
527 | # CONFIG_SCSI_DEBUG is not set | 533 | # CONFIG_SCSI_DEBUG is not set |
528 | CONFIG_MAC_SCSI=y | 534 | CONFIG_MAC_SCSI=y |
529 | CONFIG_SCSI_MAC_ESP=y | 535 | CONFIG_SCSI_MAC_ESP=y |
536 | # CONFIG_SCSI_DH is not set | ||
530 | CONFIG_MD=y | 537 | CONFIG_MD=y |
531 | CONFIG_BLK_DEV_MD=m | 538 | CONFIG_BLK_DEV_MD=m |
532 | CONFIG_MD_LINEAR=m | 539 | CONFIG_MD_LINEAR=m |
@@ -535,7 +542,7 @@ CONFIG_MD_RAID1=m | |||
535 | # CONFIG_MD_RAID10 is not set | 542 | # CONFIG_MD_RAID10 is not set |
536 | CONFIG_MD_RAID456=m | 543 | CONFIG_MD_RAID456=m |
537 | CONFIG_MD_RAID5_RESHAPE=y | 544 | CONFIG_MD_RAID5_RESHAPE=y |
538 | CONFIG_MD_MULTIPATH=m | 545 | # CONFIG_MD_MULTIPATH is not set |
539 | # CONFIG_MD_FAULTY is not set | 546 | # CONFIG_MD_FAULTY is not set |
540 | CONFIG_BLK_DEV_DM=m | 547 | CONFIG_BLK_DEV_DM=m |
541 | # CONFIG_DM_DEBUG is not set | 548 | # CONFIG_DM_DEBUG is not set |
@@ -544,9 +551,6 @@ CONFIG_DM_SNAPSHOT=m | |||
544 | CONFIG_DM_MIRROR=m | 551 | CONFIG_DM_MIRROR=m |
545 | CONFIG_DM_ZERO=m | 552 | CONFIG_DM_ZERO=m |
546 | CONFIG_DM_MULTIPATH=m | 553 | CONFIG_DM_MULTIPATH=m |
547 | CONFIG_DM_MULTIPATH_EMC=m | ||
548 | CONFIG_DM_MULTIPATH_RDAC=m | ||
549 | CONFIG_DM_MULTIPATH_HP=m | ||
550 | # CONFIG_DM_DELAY is not set | 554 | # CONFIG_DM_DELAY is not set |
551 | CONFIG_DM_UEVENT=y | 555 | CONFIG_DM_UEVENT=y |
552 | CONFIG_MACINTOSH_DRIVERS=y | 556 | CONFIG_MACINTOSH_DRIVERS=y |
@@ -559,7 +563,6 @@ CONFIG_ADB_CUDA=y | |||
559 | CONFIG_INPUT_ADBHID=y | 563 | CONFIG_INPUT_ADBHID=y |
560 | CONFIG_MAC_EMUMOUSEBTN=y | 564 | CONFIG_MAC_EMUMOUSEBTN=y |
561 | CONFIG_NETDEVICES=y | 565 | CONFIG_NETDEVICES=y |
562 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
563 | CONFIG_DUMMY=m | 566 | CONFIG_DUMMY=m |
564 | # CONFIG_BONDING is not set | 567 | # CONFIG_BONDING is not set |
565 | CONFIG_MACVLAN=m | 568 | CONFIG_MACVLAN=m |
@@ -670,6 +673,7 @@ CONFIG_SERIO_LIBPS2=m | |||
670 | # Character devices | 673 | # Character devices |
671 | # | 674 | # |
672 | CONFIG_VT=y | 675 | CONFIG_VT=y |
676 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
673 | CONFIG_VT_CONSOLE=y | 677 | CONFIG_VT_CONSOLE=y |
674 | CONFIG_HW_CONSOLE=y | 678 | CONFIG_HW_CONSOLE=y |
675 | CONFIG_VT_HW_CONSOLE_BINDING=y | 679 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -700,6 +704,7 @@ CONFIG_GEN_RTC_X=y | |||
700 | # CONFIG_POWER_SUPPLY is not set | 704 | # CONFIG_POWER_SUPPLY is not set |
701 | # CONFIG_HWMON is not set | 705 | # CONFIG_HWMON is not set |
702 | # CONFIG_THERMAL is not set | 706 | # CONFIG_THERMAL is not set |
707 | # CONFIG_THERMAL_HWMON is not set | ||
703 | # CONFIG_WATCHDOG is not set | 708 | # CONFIG_WATCHDOG is not set |
704 | 709 | ||
705 | # | 710 | # |
@@ -711,8 +716,10 @@ CONFIG_SSB_POSSIBLE=y | |||
711 | # | 716 | # |
712 | # Multifunction device drivers | 717 | # Multifunction device drivers |
713 | # | 718 | # |
719 | # CONFIG_MFD_CORE is not set | ||
714 | # CONFIG_MFD_SM501 is not set | 720 | # CONFIG_MFD_SM501 is not set |
715 | # CONFIG_HTC_PASIC3 is not set | 721 | # CONFIG_HTC_PASIC3 is not set |
722 | # CONFIG_MFD_TMIO is not set | ||
716 | 723 | ||
717 | # | 724 | # |
718 | # Multimedia devices | 725 | # Multimedia devices |
@@ -784,10 +791,6 @@ CONFIG_LOGO_LINUX_MONO=y | |||
784 | CONFIG_LOGO_LINUX_VGA16=y | 791 | CONFIG_LOGO_LINUX_VGA16=y |
785 | CONFIG_LOGO_LINUX_CLUT224=y | 792 | CONFIG_LOGO_LINUX_CLUT224=y |
786 | CONFIG_LOGO_MAC_CLUT224=y | 793 | CONFIG_LOGO_MAC_CLUT224=y |
787 | |||
788 | # | ||
789 | # Sound | ||
790 | # | ||
791 | # CONFIG_SOUND is not set | 794 | # CONFIG_SOUND is not set |
792 | CONFIG_HID_SUPPORT=y | 795 | CONFIG_HID_SUPPORT=y |
793 | CONFIG_HID=m | 796 | CONFIG_HID=m |
@@ -799,6 +802,7 @@ CONFIG_HIDRAW=y | |||
799 | # CONFIG_NEW_LEDS is not set | 802 | # CONFIG_NEW_LEDS is not set |
800 | # CONFIG_ACCESSIBILITY is not set | 803 | # CONFIG_ACCESSIBILITY is not set |
801 | # CONFIG_RTC_CLASS is not set | 804 | # CONFIG_RTC_CLASS is not set |
805 | # CONFIG_DMADEVICES is not set | ||
802 | # CONFIG_UIO is not set | 806 | # CONFIG_UIO is not set |
803 | 807 | ||
804 | # | 808 | # |
@@ -836,6 +840,7 @@ CONFIG_XFS_FS=m | |||
836 | CONFIG_OCFS2_FS=m | 840 | CONFIG_OCFS2_FS=m |
837 | CONFIG_OCFS2_FS_O2CB=m | 841 | CONFIG_OCFS2_FS_O2CB=m |
838 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 842 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
843 | # CONFIG_OCFS2_FS_STATS is not set | ||
839 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 844 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
840 | # CONFIG_OCFS2_DEBUG_FS is not set | 845 | # CONFIG_OCFS2_DEBUG_FS is not set |
841 | CONFIG_DNOTIFY=y | 846 | CONFIG_DNOTIFY=y |
@@ -895,6 +900,7 @@ CONFIG_HFSPLUS_FS=y | |||
895 | CONFIG_CRAMFS=m | 900 | CONFIG_CRAMFS=m |
896 | # CONFIG_VXFS_FS is not set | 901 | # CONFIG_VXFS_FS is not set |
897 | CONFIG_MINIX_FS=y | 902 | CONFIG_MINIX_FS=y |
903 | # CONFIG_OMFS_FS is not set | ||
898 | CONFIG_HPFS_FS=m | 904 | CONFIG_HPFS_FS=m |
899 | # CONFIG_QNX4FS_FS is not set | 905 | # CONFIG_QNX4FS_FS is not set |
900 | # CONFIG_ROMFS_FS is not set | 906 | # CONFIG_ROMFS_FS is not set |
@@ -917,7 +923,6 @@ CONFIG_EXPORTFS=m | |||
917 | CONFIG_NFS_COMMON=y | 923 | CONFIG_NFS_COMMON=y |
918 | CONFIG_SUNRPC=m | 924 | CONFIG_SUNRPC=m |
919 | CONFIG_SUNRPC_GSS=m | 925 | CONFIG_SUNRPC_GSS=m |
920 | CONFIG_SUNRPC_BIND34=y | ||
921 | CONFIG_RPCSEC_GSS_KRB5=m | 926 | CONFIG_RPCSEC_GSS_KRB5=m |
922 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 927 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
923 | CONFIG_SMB_FS=m | 928 | CONFIG_SMB_FS=m |
@@ -926,7 +931,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
926 | # CONFIG_CIFS is not set | 931 | # CONFIG_CIFS is not set |
927 | # CONFIG_NCP_FS is not set | 932 | # CONFIG_NCP_FS is not set |
928 | CONFIG_CODA_FS=m | 933 | CONFIG_CODA_FS=m |
929 | # CONFIG_CODA_FS_OLD_API is not set | ||
930 | # CONFIG_AFS_FS is not set | 934 | # CONFIG_AFS_FS is not set |
931 | 935 | ||
932 | # | 936 | # |
@@ -991,6 +995,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
991 | # CONFIG_HEADERS_CHECK is not set | 995 | # CONFIG_HEADERS_CHECK is not set |
992 | # CONFIG_DEBUG_KERNEL is not set | 996 | # CONFIG_DEBUG_KERNEL is not set |
993 | CONFIG_DEBUG_BUGVERBOSE=y | 997 | CONFIG_DEBUG_BUGVERBOSE=y |
998 | CONFIG_DEBUG_MEMORY_INIT=y | ||
999 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
994 | # CONFIG_SAMPLES is not set | 1000 | # CONFIG_SAMPLES is not set |
995 | 1001 | ||
996 | # | 1002 | # |
@@ -1050,6 +1056,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1050 | CONFIG_CRYPTO_MD4=m | 1056 | CONFIG_CRYPTO_MD4=m |
1051 | CONFIG_CRYPTO_MD5=m | 1057 | CONFIG_CRYPTO_MD5=m |
1052 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1058 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1059 | CONFIG_CRYPTO_RMD128=m | ||
1060 | CONFIG_CRYPTO_RMD160=m | ||
1061 | CONFIG_CRYPTO_RMD256=m | ||
1062 | CONFIG_CRYPTO_RMD320=m | ||
1053 | CONFIG_CRYPTO_SHA1=m | 1063 | CONFIG_CRYPTO_SHA1=m |
1054 | CONFIG_CRYPTO_SHA256=m | 1064 | CONFIG_CRYPTO_SHA256=m |
1055 | CONFIG_CRYPTO_SHA512=m | 1065 | CONFIG_CRYPTO_SHA512=m |
@@ -1091,6 +1101,7 @@ CONFIG_BITREVERSE=y | |||
1091 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1101 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1092 | CONFIG_CRC_CCITT=m | 1102 | CONFIG_CRC_CCITT=m |
1093 | CONFIG_CRC16=m | 1103 | CONFIG_CRC16=m |
1104 | CONFIG_CRC_T10DIF=y | ||
1094 | CONFIG_CRC_ITU_T=m | 1105 | CONFIG_CRC_ITU_T=m |
1095 | CONFIG_CRC32=y | 1106 | CONFIG_CRC32=y |
1096 | # CONFIG_CRC7 is not set | 1107 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 0747fa3984df..1a806102b999 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:07 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -173,10 +179,6 @@ CONFIG_GENERIC_ISA_DMA=y | |||
173 | CONFIG_ZONE_DMA=y | 179 | CONFIG_ZONE_DMA=y |
174 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 180 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
175 | CONFIG_ZORRO_NAMES=y | 181 | CONFIG_ZORRO_NAMES=y |
176 | |||
177 | # | ||
178 | # Networking | ||
179 | # | ||
180 | CONFIG_NET=y | 182 | CONFIG_NET=y |
181 | 183 | ||
182 | # | 184 | # |
@@ -190,6 +192,7 @@ CONFIG_XFRM=y | |||
190 | # CONFIG_XFRM_SUB_POLICY is not set | 192 | # CONFIG_XFRM_SUB_POLICY is not set |
191 | CONFIG_XFRM_MIGRATE=y | 193 | CONFIG_XFRM_MIGRATE=y |
192 | # CONFIG_XFRM_STATISTICS is not set | 194 | # CONFIG_XFRM_STATISTICS is not set |
195 | CONFIG_XFRM_IPCOMP=m | ||
193 | CONFIG_NET_KEY=y | 196 | CONFIG_NET_KEY=y |
194 | CONFIG_NET_KEY_MIGRATE=y | 197 | CONFIG_NET_KEY_MIGRATE=y |
195 | CONFIG_INET=y | 198 | CONFIG_INET=y |
@@ -427,6 +430,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
427 | # | 430 | # |
428 | # CONFIG_CFG80211 is not set | 431 | # CONFIG_CFG80211 is not set |
429 | CONFIG_WIRELESS_EXT=y | 432 | CONFIG_WIRELESS_EXT=y |
433 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
430 | # CONFIG_MAC80211 is not set | 434 | # CONFIG_MAC80211 is not set |
431 | CONFIG_IEEE80211=m | 435 | CONFIG_IEEE80211=m |
432 | # CONFIG_IEEE80211_DEBUG is not set | 436 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -446,7 +450,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
446 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 450 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
447 | CONFIG_STANDALONE=y | 451 | CONFIG_STANDALONE=y |
448 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 452 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
449 | CONFIG_FW_LOADER=m | 453 | CONFIG_FW_LOADER=y |
454 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
455 | CONFIG_EXTRA_FIRMWARE="" | ||
450 | # CONFIG_SYS_HYPERVISOR is not set | 456 | # CONFIG_SYS_HYPERVISOR is not set |
451 | CONFIG_CONNECTOR=m | 457 | CONFIG_CONNECTOR=m |
452 | # CONFIG_MTD is not set | 458 | # CONFIG_MTD is not set |
@@ -476,6 +482,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
476 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 482 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
477 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 483 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
478 | CONFIG_ATA_OVER_ETH=m | 484 | CONFIG_ATA_OVER_ETH=m |
485 | # CONFIG_BLK_DEV_HD is not set | ||
479 | CONFIG_MISC_DEVICES=y | 486 | CONFIG_MISC_DEVICES=y |
480 | # CONFIG_EEPROM_93CX6 is not set | 487 | # CONFIG_EEPROM_93CX6 is not set |
481 | # CONFIG_ENCLOSURE_SERVICES is not set | 488 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -486,6 +493,7 @@ CONFIG_BLK_DEV_IDE=y | |||
486 | # | 493 | # |
487 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | 494 | # Please see Documentation/ide/ide.txt for help/info on IDE drives |
488 | # | 495 | # |
496 | CONFIG_IDE_ATAPI=y | ||
489 | # CONFIG_BLK_DEV_IDE_SATA is not set | 497 | # CONFIG_BLK_DEV_IDE_SATA is not set |
490 | CONFIG_BLK_DEV_IDEDISK=y | 498 | CONFIG_BLK_DEV_IDEDISK=y |
491 | # CONFIG_IDEDISK_MULTI_MODE is not set | 499 | # CONFIG_IDEDISK_MULTI_MODE is not set |
@@ -508,8 +516,6 @@ CONFIG_BLK_DEV_FALCON_IDE=y | |||
508 | CONFIG_BLK_DEV_MAC_IDE=y | 516 | CONFIG_BLK_DEV_MAC_IDE=y |
509 | CONFIG_BLK_DEV_Q40IDE=y | 517 | CONFIG_BLK_DEV_Q40IDE=y |
510 | # CONFIG_BLK_DEV_IDEDMA is not set | 518 | # CONFIG_BLK_DEV_IDEDMA is not set |
511 | # CONFIG_BLK_DEV_HD_ONLY is not set | ||
512 | # CONFIG_BLK_DEV_HD is not set | ||
513 | 519 | ||
514 | # | 520 | # |
515 | # SCSI device support | 521 | # SCSI device support |
@@ -584,6 +590,7 @@ CONFIG_MVME147_SCSI=y | |||
584 | CONFIG_MVME16x_SCSI=y | 590 | CONFIG_MVME16x_SCSI=y |
585 | CONFIG_BVME6000_SCSI=y | 591 | CONFIG_BVME6000_SCSI=y |
586 | CONFIG_SUN3X_ESP=y | 592 | CONFIG_SUN3X_ESP=y |
593 | # CONFIG_SCSI_DH is not set | ||
587 | CONFIG_MD=y | 594 | CONFIG_MD=y |
588 | CONFIG_BLK_DEV_MD=m | 595 | CONFIG_BLK_DEV_MD=m |
589 | CONFIG_MD_LINEAR=m | 596 | CONFIG_MD_LINEAR=m |
@@ -592,7 +599,7 @@ CONFIG_MD_RAID1=m | |||
592 | # CONFIG_MD_RAID10 is not set | 599 | # CONFIG_MD_RAID10 is not set |
593 | CONFIG_MD_RAID456=m | 600 | CONFIG_MD_RAID456=m |
594 | CONFIG_MD_RAID5_RESHAPE=y | 601 | CONFIG_MD_RAID5_RESHAPE=y |
595 | CONFIG_MD_MULTIPATH=m | 602 | # CONFIG_MD_MULTIPATH is not set |
596 | # CONFIG_MD_FAULTY is not set | 603 | # CONFIG_MD_FAULTY is not set |
597 | CONFIG_BLK_DEV_DM=m | 604 | CONFIG_BLK_DEV_DM=m |
598 | # CONFIG_DM_DEBUG is not set | 605 | # CONFIG_DM_DEBUG is not set |
@@ -601,9 +608,6 @@ CONFIG_DM_SNAPSHOT=m | |||
601 | CONFIG_DM_MIRROR=m | 608 | CONFIG_DM_MIRROR=m |
602 | CONFIG_DM_ZERO=m | 609 | CONFIG_DM_ZERO=m |
603 | CONFIG_DM_MULTIPATH=m | 610 | CONFIG_DM_MULTIPATH=m |
604 | CONFIG_DM_MULTIPATH_EMC=m | ||
605 | CONFIG_DM_MULTIPATH_RDAC=m | ||
606 | CONFIG_DM_MULTIPATH_HP=m | ||
607 | # CONFIG_DM_DELAY is not set | 611 | # CONFIG_DM_DELAY is not set |
608 | CONFIG_DM_UEVENT=y | 612 | CONFIG_DM_UEVENT=y |
609 | CONFIG_MACINTOSH_DRIVERS=y | 613 | CONFIG_MACINTOSH_DRIVERS=y |
@@ -616,7 +620,6 @@ CONFIG_ADB_CUDA=y | |||
616 | CONFIG_INPUT_ADBHID=y | 620 | CONFIG_INPUT_ADBHID=y |
617 | CONFIG_MAC_EMUMOUSEBTN=y | 621 | CONFIG_MAC_EMUMOUSEBTN=y |
618 | CONFIG_NETDEVICES=y | 622 | CONFIG_NETDEVICES=y |
619 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
620 | CONFIG_DUMMY=m | 623 | CONFIG_DUMMY=m |
621 | # CONFIG_BONDING is not set | 624 | # CONFIG_BONDING is not set |
622 | CONFIG_MACVLAN=m | 625 | CONFIG_MACVLAN=m |
@@ -632,7 +635,6 @@ CONFIG_A2065=m | |||
632 | CONFIG_HYDRA=m | 635 | CONFIG_HYDRA=m |
633 | CONFIG_ZORRO8390=m | 636 | CONFIG_ZORRO8390=m |
634 | CONFIG_APNE=m | 637 | CONFIG_APNE=m |
635 | CONFIG_APOLLO_ELPLUS=y | ||
636 | CONFIG_MAC8390=y | 638 | CONFIG_MAC8390=y |
637 | CONFIG_MAC89x0=m | 639 | CONFIG_MAC89x0=m |
638 | CONFIG_MACSONIC=m | 640 | CONFIG_MACSONIC=m |
@@ -791,6 +793,7 @@ CONFIG_SERIO_LIBPS2=y | |||
791 | # Character devices | 793 | # Character devices |
792 | # | 794 | # |
793 | CONFIG_VT=y | 795 | CONFIG_VT=y |
796 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
794 | CONFIG_VT_CONSOLE=y | 797 | CONFIG_VT_CONSOLE=y |
795 | CONFIG_HW_CONSOLE=y | 798 | CONFIG_HW_CONSOLE=y |
796 | CONFIG_VT_HW_CONSOLE_BINDING=y | 799 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -827,6 +830,7 @@ CONFIG_GEN_RTC_X=y | |||
827 | # CONFIG_POWER_SUPPLY is not set | 830 | # CONFIG_POWER_SUPPLY is not set |
828 | # CONFIG_HWMON is not set | 831 | # CONFIG_HWMON is not set |
829 | # CONFIG_THERMAL is not set | 832 | # CONFIG_THERMAL is not set |
833 | # CONFIG_THERMAL_HWMON is not set | ||
830 | # CONFIG_WATCHDOG is not set | 834 | # CONFIG_WATCHDOG is not set |
831 | 835 | ||
832 | # | 836 | # |
@@ -838,8 +842,10 @@ CONFIG_SSB_POSSIBLE=y | |||
838 | # | 842 | # |
839 | # Multifunction device drivers | 843 | # Multifunction device drivers |
840 | # | 844 | # |
845 | # CONFIG_MFD_CORE is not set | ||
841 | # CONFIG_MFD_SM501 is not set | 846 | # CONFIG_MFD_SM501 is not set |
842 | # CONFIG_HTC_PASIC3 is not set | 847 | # CONFIG_HTC_PASIC3 is not set |
848 | # CONFIG_MFD_TMIO is not set | ||
843 | 849 | ||
844 | # | 850 | # |
845 | # Multimedia devices | 851 | # Multimedia devices |
@@ -923,10 +929,6 @@ CONFIG_LOGO_LINUX_MONO=y | |||
923 | CONFIG_LOGO_LINUX_VGA16=y | 929 | CONFIG_LOGO_LINUX_VGA16=y |
924 | CONFIG_LOGO_LINUX_CLUT224=y | 930 | CONFIG_LOGO_LINUX_CLUT224=y |
925 | CONFIG_LOGO_MAC_CLUT224=y | 931 | CONFIG_LOGO_MAC_CLUT224=y |
926 | |||
927 | # | ||
928 | # Sound | ||
929 | # | ||
930 | CONFIG_SOUND=m | 932 | CONFIG_SOUND=m |
931 | CONFIG_DMASOUND_ATARI=m | 933 | CONFIG_DMASOUND_ATARI=m |
932 | CONFIG_DMASOUND_PAULA=m | 934 | CONFIG_DMASOUND_PAULA=m |
@@ -942,6 +944,7 @@ CONFIG_HIDRAW=y | |||
942 | # CONFIG_NEW_LEDS is not set | 944 | # CONFIG_NEW_LEDS is not set |
943 | # CONFIG_ACCESSIBILITY is not set | 945 | # CONFIG_ACCESSIBILITY is not set |
944 | # CONFIG_RTC_CLASS is not set | 946 | # CONFIG_RTC_CLASS is not set |
947 | # CONFIG_DMADEVICES is not set | ||
945 | # CONFIG_AUXDISPLAY is not set | 948 | # CONFIG_AUXDISPLAY is not set |
946 | # CONFIG_UIO is not set | 949 | # CONFIG_UIO is not set |
947 | 950 | ||
@@ -949,8 +952,6 @@ CONFIG_HIDRAW=y | |||
949 | # Character devices | 952 | # Character devices |
950 | # | 953 | # |
951 | CONFIG_ATARI_MFPSER=m | 954 | CONFIG_ATARI_MFPSER=m |
952 | CONFIG_ATARI_SCC=y | ||
953 | CONFIG_ATARI_SCC_DMA=y | ||
954 | CONFIG_ATARI_MIDI=m | 955 | CONFIG_ATARI_MIDI=m |
955 | CONFIG_ATARI_DSP56K=m | 956 | CONFIG_ATARI_DSP56K=m |
956 | CONFIG_AMIGA_BUILTIN_SERIAL=y | 957 | CONFIG_AMIGA_BUILTIN_SERIAL=y |
@@ -972,8 +973,10 @@ CONFIG_EXT2_FS=y | |||
972 | # CONFIG_EXT2_FS_XIP is not set | 973 | # CONFIG_EXT2_FS_XIP is not set |
973 | CONFIG_EXT3_FS=y | 974 | CONFIG_EXT3_FS=y |
974 | # CONFIG_EXT3_FS_XATTR is not set | 975 | # CONFIG_EXT3_FS_XATTR is not set |
975 | # CONFIG_EXT4DEV_FS is not set | 976 | CONFIG_EXT4DEV_FS=y |
977 | # CONFIG_EXT4DEV_FS_XATTR is not set | ||
976 | CONFIG_JBD=y | 978 | CONFIG_JBD=y |
979 | CONFIG_JBD2=y | ||
977 | CONFIG_REISERFS_FS=m | 980 | CONFIG_REISERFS_FS=m |
978 | # CONFIG_REISERFS_CHECK is not set | 981 | # CONFIG_REISERFS_CHECK is not set |
979 | # CONFIG_REISERFS_PROC_INFO is not set | 982 | # CONFIG_REISERFS_PROC_INFO is not set |
@@ -992,6 +995,7 @@ CONFIG_XFS_FS=m | |||
992 | CONFIG_OCFS2_FS=m | 995 | CONFIG_OCFS2_FS=m |
993 | CONFIG_OCFS2_FS_O2CB=m | 996 | CONFIG_OCFS2_FS_O2CB=m |
994 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 997 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
998 | # CONFIG_OCFS2_FS_STATS is not set | ||
995 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 999 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
996 | # CONFIG_OCFS2_DEBUG_FS is not set | 1000 | # CONFIG_OCFS2_DEBUG_FS is not set |
997 | CONFIG_DNOTIFY=y | 1001 | CONFIG_DNOTIFY=y |
@@ -1051,6 +1055,7 @@ CONFIG_HFSPLUS_FS=y | |||
1051 | CONFIG_CRAMFS=m | 1055 | CONFIG_CRAMFS=m |
1052 | # CONFIG_VXFS_FS is not set | 1056 | # CONFIG_VXFS_FS is not set |
1053 | CONFIG_MINIX_FS=y | 1057 | CONFIG_MINIX_FS=y |
1058 | # CONFIG_OMFS_FS is not set | ||
1054 | CONFIG_HPFS_FS=m | 1059 | CONFIG_HPFS_FS=m |
1055 | # CONFIG_QNX4FS_FS is not set | 1060 | # CONFIG_QNX4FS_FS is not set |
1056 | # CONFIG_ROMFS_FS is not set | 1061 | # CONFIG_ROMFS_FS is not set |
@@ -1063,18 +1068,17 @@ CONFIG_NFS_FS=y | |||
1063 | CONFIG_NFS_V3=y | 1068 | CONFIG_NFS_V3=y |
1064 | # CONFIG_NFS_V3_ACL is not set | 1069 | # CONFIG_NFS_V3_ACL is not set |
1065 | CONFIG_NFS_V4=y | 1070 | CONFIG_NFS_V4=y |
1071 | CONFIG_ROOT_NFS=y | ||
1066 | CONFIG_NFSD=m | 1072 | CONFIG_NFSD=m |
1067 | CONFIG_NFSD_V3=y | 1073 | CONFIG_NFSD_V3=y |
1068 | # CONFIG_NFSD_V3_ACL is not set | 1074 | # CONFIG_NFSD_V3_ACL is not set |
1069 | # CONFIG_NFSD_V4 is not set | 1075 | # CONFIG_NFSD_V4 is not set |
1070 | CONFIG_ROOT_NFS=y | ||
1071 | CONFIG_LOCKD=y | 1076 | CONFIG_LOCKD=y |
1072 | CONFIG_LOCKD_V4=y | 1077 | CONFIG_LOCKD_V4=y |
1073 | CONFIG_EXPORTFS=m | 1078 | CONFIG_EXPORTFS=m |
1074 | CONFIG_NFS_COMMON=y | 1079 | CONFIG_NFS_COMMON=y |
1075 | CONFIG_SUNRPC=y | 1080 | CONFIG_SUNRPC=y |
1076 | CONFIG_SUNRPC_GSS=y | 1081 | CONFIG_SUNRPC_GSS=y |
1077 | CONFIG_SUNRPC_BIND34=y | ||
1078 | CONFIG_RPCSEC_GSS_KRB5=y | 1082 | CONFIG_RPCSEC_GSS_KRB5=y |
1079 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 1083 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
1080 | CONFIG_SMB_FS=m | 1084 | CONFIG_SMB_FS=m |
@@ -1083,7 +1087,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
1083 | # CONFIG_CIFS is not set | 1087 | # CONFIG_CIFS is not set |
1084 | # CONFIG_NCP_FS is not set | 1088 | # CONFIG_NCP_FS is not set |
1085 | CONFIG_CODA_FS=m | 1089 | CONFIG_CODA_FS=m |
1086 | # CONFIG_CODA_FS_OLD_API is not set | ||
1087 | # CONFIG_AFS_FS is not set | 1090 | # CONFIG_AFS_FS is not set |
1088 | 1091 | ||
1089 | # | 1092 | # |
@@ -1152,6 +1155,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
1152 | # CONFIG_HEADERS_CHECK is not set | 1155 | # CONFIG_HEADERS_CHECK is not set |
1153 | # CONFIG_DEBUG_KERNEL is not set | 1156 | # CONFIG_DEBUG_KERNEL is not set |
1154 | CONFIG_DEBUG_BUGVERBOSE=y | 1157 | CONFIG_DEBUG_BUGVERBOSE=y |
1158 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1159 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
1155 | # CONFIG_SAMPLES is not set | 1160 | # CONFIG_SAMPLES is not set |
1156 | 1161 | ||
1157 | # | 1162 | # |
@@ -1211,6 +1216,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1211 | CONFIG_CRYPTO_MD4=m | 1216 | CONFIG_CRYPTO_MD4=m |
1212 | CONFIG_CRYPTO_MD5=y | 1217 | CONFIG_CRYPTO_MD5=y |
1213 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1218 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1219 | CONFIG_CRYPTO_RMD128=m | ||
1220 | CONFIG_CRYPTO_RMD160=m | ||
1221 | CONFIG_CRYPTO_RMD256=m | ||
1222 | CONFIG_CRYPTO_RMD320=m | ||
1214 | CONFIG_CRYPTO_SHA1=m | 1223 | CONFIG_CRYPTO_SHA1=m |
1215 | CONFIG_CRYPTO_SHA256=m | 1224 | CONFIG_CRYPTO_SHA256=m |
1216 | CONFIG_CRYPTO_SHA512=m | 1225 | CONFIG_CRYPTO_SHA512=m |
@@ -1252,6 +1261,7 @@ CONFIG_BITREVERSE=y | |||
1252 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1261 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1253 | CONFIG_CRC_CCITT=m | 1262 | CONFIG_CRC_CCITT=m |
1254 | CONFIG_CRC16=y | 1263 | CONFIG_CRC16=y |
1264 | CONFIG_CRC_T10DIF=y | ||
1255 | CONFIG_CRC_ITU_T=m | 1265 | CONFIG_CRC_ITU_T=m |
1256 | CONFIG_CRC32=y | 1266 | CONFIG_CRC32=y |
1257 | # CONFIG_CRC7 is not set | 1267 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index e7a8246840b5..cacb5aef6a37 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:08 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -163,10 +169,6 @@ CONFIG_BINFMT_MISC=m | |||
163 | CONFIG_PROC_HARDWARE=y | 169 | CONFIG_PROC_HARDWARE=y |
164 | CONFIG_ZONE_DMA=y | 170 | CONFIG_ZONE_DMA=y |
165 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 171 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
166 | |||
167 | # | ||
168 | # Networking | ||
169 | # | ||
170 | CONFIG_NET=y | 172 | CONFIG_NET=y |
171 | 173 | ||
172 | # | 174 | # |
@@ -180,6 +182,7 @@ CONFIG_XFRM=y | |||
180 | # CONFIG_XFRM_SUB_POLICY is not set | 182 | # CONFIG_XFRM_SUB_POLICY is not set |
181 | CONFIG_XFRM_MIGRATE=y | 183 | CONFIG_XFRM_MIGRATE=y |
182 | # CONFIG_XFRM_STATISTICS is not set | 184 | # CONFIG_XFRM_STATISTICS is not set |
185 | CONFIG_XFRM_IPCOMP=m | ||
183 | CONFIG_NET_KEY=y | 186 | CONFIG_NET_KEY=y |
184 | CONFIG_NET_KEY_MIGRATE=y | 187 | CONFIG_NET_KEY_MIGRATE=y |
185 | CONFIG_INET=y | 188 | CONFIG_INET=y |
@@ -413,6 +416,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
413 | # | 416 | # |
414 | # CONFIG_CFG80211 is not set | 417 | # CONFIG_CFG80211 is not set |
415 | CONFIG_WIRELESS_EXT=y | 418 | CONFIG_WIRELESS_EXT=y |
419 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
416 | # CONFIG_MAC80211 is not set | 420 | # CONFIG_MAC80211 is not set |
417 | CONFIG_IEEE80211=m | 421 | CONFIG_IEEE80211=m |
418 | # CONFIG_IEEE80211_DEBUG is not set | 422 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -432,7 +436,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 436 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
433 | CONFIG_STANDALONE=y | 437 | CONFIG_STANDALONE=y |
434 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 438 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
435 | CONFIG_FW_LOADER=m | 439 | CONFIG_FW_LOADER=y |
440 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
441 | CONFIG_EXTRA_FIRMWARE="" | ||
436 | # CONFIG_SYS_HYPERVISOR is not set | 442 | # CONFIG_SYS_HYPERVISOR is not set |
437 | CONFIG_CONNECTOR=m | 443 | CONFIG_CONNECTOR=m |
438 | # CONFIG_MTD is not set | 444 | # CONFIG_MTD is not set |
@@ -450,6 +456,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
450 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 456 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
451 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 457 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
452 | CONFIG_ATA_OVER_ETH=m | 458 | CONFIG_ATA_OVER_ETH=m |
459 | # CONFIG_BLK_DEV_HD is not set | ||
453 | CONFIG_MISC_DEVICES=y | 460 | CONFIG_MISC_DEVICES=y |
454 | # CONFIG_EEPROM_93CX6 is not set | 461 | # CONFIG_EEPROM_93CX6 is not set |
455 | # CONFIG_ENCLOSURE_SERVICES is not set | 462 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -502,6 +509,7 @@ CONFIG_SCSI_LOWLEVEL=y | |||
502 | CONFIG_ISCSI_TCP=m | 509 | CONFIG_ISCSI_TCP=m |
503 | # CONFIG_SCSI_DEBUG is not set | 510 | # CONFIG_SCSI_DEBUG is not set |
504 | CONFIG_MVME147_SCSI=y | 511 | CONFIG_MVME147_SCSI=y |
512 | # CONFIG_SCSI_DH is not set | ||
505 | CONFIG_MD=y | 513 | CONFIG_MD=y |
506 | CONFIG_BLK_DEV_MD=m | 514 | CONFIG_BLK_DEV_MD=m |
507 | CONFIG_MD_LINEAR=m | 515 | CONFIG_MD_LINEAR=m |
@@ -510,7 +518,7 @@ CONFIG_MD_RAID1=m | |||
510 | # CONFIG_MD_RAID10 is not set | 518 | # CONFIG_MD_RAID10 is not set |
511 | CONFIG_MD_RAID456=m | 519 | CONFIG_MD_RAID456=m |
512 | CONFIG_MD_RAID5_RESHAPE=y | 520 | CONFIG_MD_RAID5_RESHAPE=y |
513 | CONFIG_MD_MULTIPATH=m | 521 | # CONFIG_MD_MULTIPATH is not set |
514 | # CONFIG_MD_FAULTY is not set | 522 | # CONFIG_MD_FAULTY is not set |
515 | CONFIG_BLK_DEV_DM=m | 523 | CONFIG_BLK_DEV_DM=m |
516 | # CONFIG_DM_DEBUG is not set | 524 | # CONFIG_DM_DEBUG is not set |
@@ -519,13 +527,9 @@ CONFIG_DM_SNAPSHOT=m | |||
519 | CONFIG_DM_MIRROR=m | 527 | CONFIG_DM_MIRROR=m |
520 | CONFIG_DM_ZERO=m | 528 | CONFIG_DM_ZERO=m |
521 | CONFIG_DM_MULTIPATH=m | 529 | CONFIG_DM_MULTIPATH=m |
522 | CONFIG_DM_MULTIPATH_EMC=m | ||
523 | CONFIG_DM_MULTIPATH_RDAC=m | ||
524 | CONFIG_DM_MULTIPATH_HP=m | ||
525 | # CONFIG_DM_DELAY is not set | 530 | # CONFIG_DM_DELAY is not set |
526 | CONFIG_DM_UEVENT=y | 531 | CONFIG_DM_UEVENT=y |
527 | CONFIG_NETDEVICES=y | 532 | CONFIG_NETDEVICES=y |
528 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
529 | CONFIG_DUMMY=m | 533 | CONFIG_DUMMY=m |
530 | # CONFIG_BONDING is not set | 534 | # CONFIG_BONDING is not set |
531 | CONFIG_MACVLAN=m | 535 | CONFIG_MACVLAN=m |
@@ -630,6 +634,7 @@ CONFIG_SERIO_LIBPS2=m | |||
630 | # Character devices | 634 | # Character devices |
631 | # | 635 | # |
632 | CONFIG_VT=y | 636 | CONFIG_VT=y |
637 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
633 | CONFIG_VT_CONSOLE=y | 638 | CONFIG_VT_CONSOLE=y |
634 | CONFIG_HW_CONSOLE=y | 639 | CONFIG_HW_CONSOLE=y |
635 | CONFIG_VT_HW_CONSOLE_BINDING=y | 640 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -660,6 +665,7 @@ CONFIG_GEN_RTC_X=y | |||
660 | # CONFIG_POWER_SUPPLY is not set | 665 | # CONFIG_POWER_SUPPLY is not set |
661 | # CONFIG_HWMON is not set | 666 | # CONFIG_HWMON is not set |
662 | # CONFIG_THERMAL is not set | 667 | # CONFIG_THERMAL is not set |
668 | # CONFIG_THERMAL_HWMON is not set | ||
663 | # CONFIG_WATCHDOG is not set | 669 | # CONFIG_WATCHDOG is not set |
664 | 670 | ||
665 | # | 671 | # |
@@ -671,8 +677,10 @@ CONFIG_SSB_POSSIBLE=y | |||
671 | # | 677 | # |
672 | # Multifunction device drivers | 678 | # Multifunction device drivers |
673 | # | 679 | # |
680 | # CONFIG_MFD_CORE is not set | ||
674 | # CONFIG_MFD_SM501 is not set | 681 | # CONFIG_MFD_SM501 is not set |
675 | # CONFIG_HTC_PASIC3 is not set | 682 | # CONFIG_HTC_PASIC3 is not set |
683 | # CONFIG_MFD_TMIO is not set | ||
676 | 684 | ||
677 | # | 685 | # |
678 | # Multimedia devices | 686 | # Multimedia devices |
@@ -707,10 +715,6 @@ CONFIG_SSB_POSSIBLE=y | |||
707 | # Console display driver support | 715 | # Console display driver support |
708 | # | 716 | # |
709 | CONFIG_DUMMY_CONSOLE=y | 717 | CONFIG_DUMMY_CONSOLE=y |
710 | |||
711 | # | ||
712 | # Sound | ||
713 | # | ||
714 | # CONFIG_SOUND is not set | 718 | # CONFIG_SOUND is not set |
715 | CONFIG_HID_SUPPORT=y | 719 | CONFIG_HID_SUPPORT=y |
716 | CONFIG_HID=m | 720 | CONFIG_HID=m |
@@ -722,6 +726,7 @@ CONFIG_HIDRAW=y | |||
722 | # CONFIG_NEW_LEDS is not set | 726 | # CONFIG_NEW_LEDS is not set |
723 | # CONFIG_ACCESSIBILITY is not set | 727 | # CONFIG_ACCESSIBILITY is not set |
724 | # CONFIG_RTC_CLASS is not set | 728 | # CONFIG_RTC_CLASS is not set |
729 | # CONFIG_DMADEVICES is not set | ||
725 | # CONFIG_UIO is not set | 730 | # CONFIG_UIO is not set |
726 | 731 | ||
727 | # | 732 | # |
@@ -758,6 +763,7 @@ CONFIG_XFS_FS=m | |||
758 | CONFIG_OCFS2_FS=m | 763 | CONFIG_OCFS2_FS=m |
759 | CONFIG_OCFS2_FS_O2CB=m | 764 | CONFIG_OCFS2_FS_O2CB=m |
760 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 765 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
766 | # CONFIG_OCFS2_FS_STATS is not set | ||
761 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 767 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
762 | # CONFIG_OCFS2_DEBUG_FS is not set | 768 | # CONFIG_OCFS2_DEBUG_FS is not set |
763 | CONFIG_DNOTIFY=y | 769 | CONFIG_DNOTIFY=y |
@@ -817,6 +823,7 @@ CONFIG_HFSPLUS_FS=m | |||
817 | CONFIG_CRAMFS=m | 823 | CONFIG_CRAMFS=m |
818 | # CONFIG_VXFS_FS is not set | 824 | # CONFIG_VXFS_FS is not set |
819 | CONFIG_MINIX_FS=y | 825 | CONFIG_MINIX_FS=y |
826 | # CONFIG_OMFS_FS is not set | ||
820 | CONFIG_HPFS_FS=m | 827 | CONFIG_HPFS_FS=m |
821 | # CONFIG_QNX4FS_FS is not set | 828 | # CONFIG_QNX4FS_FS is not set |
822 | # CONFIG_ROMFS_FS is not set | 829 | # CONFIG_ROMFS_FS is not set |
@@ -829,18 +836,17 @@ CONFIG_NFS_FS=y | |||
829 | CONFIG_NFS_V3=y | 836 | CONFIG_NFS_V3=y |
830 | # CONFIG_NFS_V3_ACL is not set | 837 | # CONFIG_NFS_V3_ACL is not set |
831 | CONFIG_NFS_V4=y | 838 | CONFIG_NFS_V4=y |
839 | CONFIG_ROOT_NFS=y | ||
832 | CONFIG_NFSD=m | 840 | CONFIG_NFSD=m |
833 | CONFIG_NFSD_V3=y | 841 | CONFIG_NFSD_V3=y |
834 | # CONFIG_NFSD_V3_ACL is not set | 842 | # CONFIG_NFSD_V3_ACL is not set |
835 | # CONFIG_NFSD_V4 is not set | 843 | # CONFIG_NFSD_V4 is not set |
836 | CONFIG_ROOT_NFS=y | ||
837 | CONFIG_LOCKD=y | 844 | CONFIG_LOCKD=y |
838 | CONFIG_LOCKD_V4=y | 845 | CONFIG_LOCKD_V4=y |
839 | CONFIG_EXPORTFS=m | 846 | CONFIG_EXPORTFS=m |
840 | CONFIG_NFS_COMMON=y | 847 | CONFIG_NFS_COMMON=y |
841 | CONFIG_SUNRPC=y | 848 | CONFIG_SUNRPC=y |
842 | CONFIG_SUNRPC_GSS=y | 849 | CONFIG_SUNRPC_GSS=y |
843 | CONFIG_SUNRPC_BIND34=y | ||
844 | CONFIG_RPCSEC_GSS_KRB5=y | 850 | CONFIG_RPCSEC_GSS_KRB5=y |
845 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 851 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
846 | CONFIG_SMB_FS=m | 852 | CONFIG_SMB_FS=m |
@@ -849,7 +855,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
849 | # CONFIG_CIFS is not set | 855 | # CONFIG_CIFS is not set |
850 | # CONFIG_NCP_FS is not set | 856 | # CONFIG_NCP_FS is not set |
851 | CONFIG_CODA_FS=m | 857 | CONFIG_CODA_FS=m |
852 | # CONFIG_CODA_FS_OLD_API is not set | ||
853 | # CONFIG_AFS_FS is not set | 858 | # CONFIG_AFS_FS is not set |
854 | 859 | ||
855 | # | 860 | # |
@@ -914,6 +919,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
914 | # CONFIG_HEADERS_CHECK is not set | 919 | # CONFIG_HEADERS_CHECK is not set |
915 | # CONFIG_DEBUG_KERNEL is not set | 920 | # CONFIG_DEBUG_KERNEL is not set |
916 | CONFIG_DEBUG_BUGVERBOSE=y | 921 | CONFIG_DEBUG_BUGVERBOSE=y |
922 | CONFIG_DEBUG_MEMORY_INIT=y | ||
923 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
917 | # CONFIG_SAMPLES is not set | 924 | # CONFIG_SAMPLES is not set |
918 | 925 | ||
919 | # | 926 | # |
@@ -973,6 +980,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
973 | CONFIG_CRYPTO_MD4=m | 980 | CONFIG_CRYPTO_MD4=m |
974 | CONFIG_CRYPTO_MD5=y | 981 | CONFIG_CRYPTO_MD5=y |
975 | CONFIG_CRYPTO_MICHAEL_MIC=m | 982 | CONFIG_CRYPTO_MICHAEL_MIC=m |
983 | CONFIG_CRYPTO_RMD128=m | ||
984 | CONFIG_CRYPTO_RMD160=m | ||
985 | CONFIG_CRYPTO_RMD256=m | ||
986 | CONFIG_CRYPTO_RMD320=m | ||
976 | CONFIG_CRYPTO_SHA1=m | 987 | CONFIG_CRYPTO_SHA1=m |
977 | CONFIG_CRYPTO_SHA256=m | 988 | CONFIG_CRYPTO_SHA256=m |
978 | CONFIG_CRYPTO_SHA512=m | 989 | CONFIG_CRYPTO_SHA512=m |
@@ -1014,6 +1025,7 @@ CONFIG_BITREVERSE=y | |||
1014 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1025 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1015 | CONFIG_CRC_CCITT=m | 1026 | CONFIG_CRC_CCITT=m |
1016 | CONFIG_CRC16=m | 1027 | CONFIG_CRC16=m |
1028 | CONFIG_CRC_T10DIF=y | ||
1017 | CONFIG_CRC_ITU_T=m | 1029 | CONFIG_CRC_ITU_T=m |
1018 | CONFIG_CRC32=y | 1030 | CONFIG_CRC32=y |
1019 | # CONFIG_CRC7 is not set | 1031 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index ab536eb172bb..a183e25e348d 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:09 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -163,10 +169,6 @@ CONFIG_BINFMT_MISC=m | |||
163 | CONFIG_PROC_HARDWARE=y | 169 | CONFIG_PROC_HARDWARE=y |
164 | CONFIG_ZONE_DMA=y | 170 | CONFIG_ZONE_DMA=y |
165 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 171 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
166 | |||
167 | # | ||
168 | # Networking | ||
169 | # | ||
170 | CONFIG_NET=y | 172 | CONFIG_NET=y |
171 | 173 | ||
172 | # | 174 | # |
@@ -180,6 +182,7 @@ CONFIG_XFRM=y | |||
180 | # CONFIG_XFRM_SUB_POLICY is not set | 182 | # CONFIG_XFRM_SUB_POLICY is not set |
181 | CONFIG_XFRM_MIGRATE=y | 183 | CONFIG_XFRM_MIGRATE=y |
182 | # CONFIG_XFRM_STATISTICS is not set | 184 | # CONFIG_XFRM_STATISTICS is not set |
185 | CONFIG_XFRM_IPCOMP=m | ||
183 | CONFIG_NET_KEY=y | 186 | CONFIG_NET_KEY=y |
184 | CONFIG_NET_KEY_MIGRATE=y | 187 | CONFIG_NET_KEY_MIGRATE=y |
185 | CONFIG_INET=y | 188 | CONFIG_INET=y |
@@ -413,6 +416,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
413 | # | 416 | # |
414 | # CONFIG_CFG80211 is not set | 417 | # CONFIG_CFG80211 is not set |
415 | CONFIG_WIRELESS_EXT=y | 418 | CONFIG_WIRELESS_EXT=y |
419 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
416 | # CONFIG_MAC80211 is not set | 420 | # CONFIG_MAC80211 is not set |
417 | CONFIG_IEEE80211=m | 421 | CONFIG_IEEE80211=m |
418 | # CONFIG_IEEE80211_DEBUG is not set | 422 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -432,7 +436,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
432 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 436 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
433 | CONFIG_STANDALONE=y | 437 | CONFIG_STANDALONE=y |
434 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 438 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
435 | CONFIG_FW_LOADER=m | 439 | CONFIG_FW_LOADER=y |
440 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
441 | CONFIG_EXTRA_FIRMWARE="" | ||
436 | # CONFIG_SYS_HYPERVISOR is not set | 442 | # CONFIG_SYS_HYPERVISOR is not set |
437 | CONFIG_CONNECTOR=m | 443 | CONFIG_CONNECTOR=m |
438 | # CONFIG_MTD is not set | 444 | # CONFIG_MTD is not set |
@@ -450,6 +456,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
450 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 456 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
451 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 457 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
452 | CONFIG_ATA_OVER_ETH=m | 458 | CONFIG_ATA_OVER_ETH=m |
459 | # CONFIG_BLK_DEV_HD is not set | ||
453 | CONFIG_MISC_DEVICES=y | 460 | CONFIG_MISC_DEVICES=y |
454 | # CONFIG_EEPROM_93CX6 is not set | 461 | # CONFIG_EEPROM_93CX6 is not set |
455 | # CONFIG_ENCLOSURE_SERVICES is not set | 462 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -503,6 +510,7 @@ CONFIG_ISCSI_TCP=m | |||
503 | CONFIG_53C700_BE_BUS=y | 510 | CONFIG_53C700_BE_BUS=y |
504 | # CONFIG_SCSI_DEBUG is not set | 511 | # CONFIG_SCSI_DEBUG is not set |
505 | CONFIG_MVME16x_SCSI=y | 512 | CONFIG_MVME16x_SCSI=y |
513 | # CONFIG_SCSI_DH is not set | ||
506 | CONFIG_MD=y | 514 | CONFIG_MD=y |
507 | CONFIG_BLK_DEV_MD=m | 515 | CONFIG_BLK_DEV_MD=m |
508 | CONFIG_MD_LINEAR=m | 516 | CONFIG_MD_LINEAR=m |
@@ -511,7 +519,7 @@ CONFIG_MD_RAID1=m | |||
511 | # CONFIG_MD_RAID10 is not set | 519 | # CONFIG_MD_RAID10 is not set |
512 | CONFIG_MD_RAID456=m | 520 | CONFIG_MD_RAID456=m |
513 | CONFIG_MD_RAID5_RESHAPE=y | 521 | CONFIG_MD_RAID5_RESHAPE=y |
514 | CONFIG_MD_MULTIPATH=m | 522 | # CONFIG_MD_MULTIPATH is not set |
515 | # CONFIG_MD_FAULTY is not set | 523 | # CONFIG_MD_FAULTY is not set |
516 | CONFIG_BLK_DEV_DM=m | 524 | CONFIG_BLK_DEV_DM=m |
517 | # CONFIG_DM_DEBUG is not set | 525 | # CONFIG_DM_DEBUG is not set |
@@ -520,13 +528,9 @@ CONFIG_DM_SNAPSHOT=m | |||
520 | CONFIG_DM_MIRROR=m | 528 | CONFIG_DM_MIRROR=m |
521 | CONFIG_DM_ZERO=m | 529 | CONFIG_DM_ZERO=m |
522 | CONFIG_DM_MULTIPATH=m | 530 | CONFIG_DM_MULTIPATH=m |
523 | CONFIG_DM_MULTIPATH_EMC=m | ||
524 | CONFIG_DM_MULTIPATH_RDAC=m | ||
525 | CONFIG_DM_MULTIPATH_HP=m | ||
526 | # CONFIG_DM_DELAY is not set | 531 | # CONFIG_DM_DELAY is not set |
527 | CONFIG_DM_UEVENT=y | 532 | CONFIG_DM_UEVENT=y |
528 | CONFIG_NETDEVICES=y | 533 | CONFIG_NETDEVICES=y |
529 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
530 | CONFIG_DUMMY=m | 534 | CONFIG_DUMMY=m |
531 | # CONFIG_BONDING is not set | 535 | # CONFIG_BONDING is not set |
532 | CONFIG_MACVLAN=m | 536 | CONFIG_MACVLAN=m |
@@ -631,6 +635,7 @@ CONFIG_SERIO_LIBPS2=m | |||
631 | # Character devices | 635 | # Character devices |
632 | # | 636 | # |
633 | CONFIG_VT=y | 637 | CONFIG_VT=y |
638 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
634 | CONFIG_VT_CONSOLE=y | 639 | CONFIG_VT_CONSOLE=y |
635 | CONFIG_HW_CONSOLE=y | 640 | CONFIG_HW_CONSOLE=y |
636 | CONFIG_VT_HW_CONSOLE_BINDING=y | 641 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -661,6 +666,7 @@ CONFIG_GEN_RTC_X=y | |||
661 | # CONFIG_POWER_SUPPLY is not set | 666 | # CONFIG_POWER_SUPPLY is not set |
662 | # CONFIG_HWMON is not set | 667 | # CONFIG_HWMON is not set |
663 | # CONFIG_THERMAL is not set | 668 | # CONFIG_THERMAL is not set |
669 | # CONFIG_THERMAL_HWMON is not set | ||
664 | # CONFIG_WATCHDOG is not set | 670 | # CONFIG_WATCHDOG is not set |
665 | 671 | ||
666 | # | 672 | # |
@@ -672,8 +678,10 @@ CONFIG_SSB_POSSIBLE=y | |||
672 | # | 678 | # |
673 | # Multifunction device drivers | 679 | # Multifunction device drivers |
674 | # | 680 | # |
681 | # CONFIG_MFD_CORE is not set | ||
675 | # CONFIG_MFD_SM501 is not set | 682 | # CONFIG_MFD_SM501 is not set |
676 | # CONFIG_HTC_PASIC3 is not set | 683 | # CONFIG_HTC_PASIC3 is not set |
684 | # CONFIG_MFD_TMIO is not set | ||
677 | 685 | ||
678 | # | 686 | # |
679 | # Multimedia devices | 687 | # Multimedia devices |
@@ -708,10 +716,6 @@ CONFIG_SSB_POSSIBLE=y | |||
708 | # Console display driver support | 716 | # Console display driver support |
709 | # | 717 | # |
710 | CONFIG_DUMMY_CONSOLE=y | 718 | CONFIG_DUMMY_CONSOLE=y |
711 | |||
712 | # | ||
713 | # Sound | ||
714 | # | ||
715 | # CONFIG_SOUND is not set | 719 | # CONFIG_SOUND is not set |
716 | CONFIG_HID_SUPPORT=y | 720 | CONFIG_HID_SUPPORT=y |
717 | CONFIG_HID=m | 721 | CONFIG_HID=m |
@@ -723,6 +727,7 @@ CONFIG_HIDRAW=y | |||
723 | # CONFIG_NEW_LEDS is not set | 727 | # CONFIG_NEW_LEDS is not set |
724 | # CONFIG_ACCESSIBILITY is not set | 728 | # CONFIG_ACCESSIBILITY is not set |
725 | # CONFIG_RTC_CLASS is not set | 729 | # CONFIG_RTC_CLASS is not set |
730 | # CONFIG_DMADEVICES is not set | ||
726 | # CONFIG_UIO is not set | 731 | # CONFIG_UIO is not set |
727 | 732 | ||
728 | # | 733 | # |
@@ -760,6 +765,7 @@ CONFIG_XFS_FS=m | |||
760 | CONFIG_OCFS2_FS=m | 765 | CONFIG_OCFS2_FS=m |
761 | CONFIG_OCFS2_FS_O2CB=m | 766 | CONFIG_OCFS2_FS_O2CB=m |
762 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 767 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
768 | # CONFIG_OCFS2_FS_STATS is not set | ||
763 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 769 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
764 | # CONFIG_OCFS2_DEBUG_FS is not set | 770 | # CONFIG_OCFS2_DEBUG_FS is not set |
765 | CONFIG_DNOTIFY=y | 771 | CONFIG_DNOTIFY=y |
@@ -819,6 +825,7 @@ CONFIG_HFSPLUS_FS=m | |||
819 | CONFIG_CRAMFS=m | 825 | CONFIG_CRAMFS=m |
820 | # CONFIG_VXFS_FS is not set | 826 | # CONFIG_VXFS_FS is not set |
821 | CONFIG_MINIX_FS=y | 827 | CONFIG_MINIX_FS=y |
828 | # CONFIG_OMFS_FS is not set | ||
822 | CONFIG_HPFS_FS=m | 829 | CONFIG_HPFS_FS=m |
823 | # CONFIG_QNX4FS_FS is not set | 830 | # CONFIG_QNX4FS_FS is not set |
824 | # CONFIG_ROMFS_FS is not set | 831 | # CONFIG_ROMFS_FS is not set |
@@ -831,18 +838,17 @@ CONFIG_NFS_FS=y | |||
831 | CONFIG_NFS_V3=y | 838 | CONFIG_NFS_V3=y |
832 | # CONFIG_NFS_V3_ACL is not set | 839 | # CONFIG_NFS_V3_ACL is not set |
833 | CONFIG_NFS_V4=y | 840 | CONFIG_NFS_V4=y |
841 | CONFIG_ROOT_NFS=y | ||
834 | CONFIG_NFSD=m | 842 | CONFIG_NFSD=m |
835 | CONFIG_NFSD_V3=y | 843 | CONFIG_NFSD_V3=y |
836 | # CONFIG_NFSD_V3_ACL is not set | 844 | # CONFIG_NFSD_V3_ACL is not set |
837 | # CONFIG_NFSD_V4 is not set | 845 | # CONFIG_NFSD_V4 is not set |
838 | CONFIG_ROOT_NFS=y | ||
839 | CONFIG_LOCKD=y | 846 | CONFIG_LOCKD=y |
840 | CONFIG_LOCKD_V4=y | 847 | CONFIG_LOCKD_V4=y |
841 | CONFIG_EXPORTFS=m | 848 | CONFIG_EXPORTFS=m |
842 | CONFIG_NFS_COMMON=y | 849 | CONFIG_NFS_COMMON=y |
843 | CONFIG_SUNRPC=y | 850 | CONFIG_SUNRPC=y |
844 | CONFIG_SUNRPC_GSS=y | 851 | CONFIG_SUNRPC_GSS=y |
845 | CONFIG_SUNRPC_BIND34=y | ||
846 | CONFIG_RPCSEC_GSS_KRB5=y | 852 | CONFIG_RPCSEC_GSS_KRB5=y |
847 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 853 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
848 | CONFIG_SMB_FS=m | 854 | CONFIG_SMB_FS=m |
@@ -851,7 +857,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
851 | # CONFIG_CIFS is not set | 857 | # CONFIG_CIFS is not set |
852 | # CONFIG_NCP_FS is not set | 858 | # CONFIG_NCP_FS is not set |
853 | CONFIG_CODA_FS=m | 859 | CONFIG_CODA_FS=m |
854 | # CONFIG_CODA_FS_OLD_API is not set | ||
855 | # CONFIG_AFS_FS is not set | 860 | # CONFIG_AFS_FS is not set |
856 | 861 | ||
857 | # | 862 | # |
@@ -916,6 +921,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
916 | # CONFIG_HEADERS_CHECK is not set | 921 | # CONFIG_HEADERS_CHECK is not set |
917 | # CONFIG_DEBUG_KERNEL is not set | 922 | # CONFIG_DEBUG_KERNEL is not set |
918 | CONFIG_DEBUG_BUGVERBOSE=y | 923 | CONFIG_DEBUG_BUGVERBOSE=y |
924 | CONFIG_DEBUG_MEMORY_INIT=y | ||
925 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
919 | # CONFIG_SAMPLES is not set | 926 | # CONFIG_SAMPLES is not set |
920 | 927 | ||
921 | # | 928 | # |
@@ -975,6 +982,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
975 | CONFIG_CRYPTO_MD4=m | 982 | CONFIG_CRYPTO_MD4=m |
976 | CONFIG_CRYPTO_MD5=y | 983 | CONFIG_CRYPTO_MD5=y |
977 | CONFIG_CRYPTO_MICHAEL_MIC=m | 984 | CONFIG_CRYPTO_MICHAEL_MIC=m |
985 | CONFIG_CRYPTO_RMD128=m | ||
986 | CONFIG_CRYPTO_RMD160=m | ||
987 | CONFIG_CRYPTO_RMD256=m | ||
988 | CONFIG_CRYPTO_RMD320=m | ||
978 | CONFIG_CRYPTO_SHA1=m | 989 | CONFIG_CRYPTO_SHA1=m |
979 | CONFIG_CRYPTO_SHA256=m | 990 | CONFIG_CRYPTO_SHA256=m |
980 | CONFIG_CRYPTO_SHA512=m | 991 | CONFIG_CRYPTO_SHA512=m |
@@ -1016,6 +1027,7 @@ CONFIG_BITREVERSE=y | |||
1016 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1027 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1017 | CONFIG_CRC_CCITT=m | 1028 | CONFIG_CRC_CCITT=m |
1018 | CONFIG_CRC16=m | 1029 | CONFIG_CRC16=m |
1030 | CONFIG_CRC_T10DIF=y | ||
1019 | CONFIG_CRC_ITU_T=m | 1031 | CONFIG_CRC_ITU_T=m |
1020 | CONFIG_CRC32=y | 1032 | CONFIG_CRC32=y |
1021 | # CONFIG_CRC7 is not set | 1033 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index e05be687b500..72eaff0776b8 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:10 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -163,10 +169,6 @@ CONFIG_ISA=y | |||
163 | CONFIG_GENERIC_ISA_DMA=y | 169 | CONFIG_GENERIC_ISA_DMA=y |
164 | CONFIG_ZONE_DMA=y | 170 | CONFIG_ZONE_DMA=y |
165 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 171 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
166 | |||
167 | # | ||
168 | # Networking | ||
169 | # | ||
170 | CONFIG_NET=y | 172 | CONFIG_NET=y |
171 | 173 | ||
172 | # | 174 | # |
@@ -180,6 +182,7 @@ CONFIG_XFRM=y | |||
180 | # CONFIG_XFRM_SUB_POLICY is not set | 182 | # CONFIG_XFRM_SUB_POLICY is not set |
181 | CONFIG_XFRM_MIGRATE=y | 183 | CONFIG_XFRM_MIGRATE=y |
182 | # CONFIG_XFRM_STATISTICS is not set | 184 | # CONFIG_XFRM_STATISTICS is not set |
185 | CONFIG_XFRM_IPCOMP=m | ||
183 | CONFIG_NET_KEY=y | 186 | CONFIG_NET_KEY=y |
184 | CONFIG_NET_KEY_MIGRATE=y | 187 | CONFIG_NET_KEY_MIGRATE=y |
185 | CONFIG_INET=y | 188 | CONFIG_INET=y |
@@ -410,6 +413,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
410 | # | 413 | # |
411 | # CONFIG_CFG80211 is not set | 414 | # CONFIG_CFG80211 is not set |
412 | CONFIG_WIRELESS_EXT=y | 415 | CONFIG_WIRELESS_EXT=y |
416 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
413 | # CONFIG_MAC80211 is not set | 417 | # CONFIG_MAC80211 is not set |
414 | CONFIG_IEEE80211=m | 418 | CONFIG_IEEE80211=m |
415 | # CONFIG_IEEE80211_DEBUG is not set | 419 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -429,7 +433,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
429 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 433 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
430 | CONFIG_STANDALONE=y | 434 | CONFIG_STANDALONE=y |
431 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 435 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
432 | CONFIG_FW_LOADER=m | 436 | CONFIG_FW_LOADER=y |
437 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
438 | CONFIG_EXTRA_FIRMWARE="" | ||
433 | # CONFIG_SYS_HYPERVISOR is not set | 439 | # CONFIG_SYS_HYPERVISOR is not set |
434 | CONFIG_CONNECTOR=m | 440 | CONFIG_CONNECTOR=m |
435 | # CONFIG_MTD is not set | 441 | # CONFIG_MTD is not set |
@@ -448,6 +454,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
448 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 454 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
449 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 455 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
450 | CONFIG_ATA_OVER_ETH=m | 456 | CONFIG_ATA_OVER_ETH=m |
457 | # CONFIG_BLK_DEV_HD is not set | ||
451 | CONFIG_MISC_DEVICES=y | 458 | CONFIG_MISC_DEVICES=y |
452 | # CONFIG_EEPROM_93CX6 is not set | 459 | # CONFIG_EEPROM_93CX6 is not set |
453 | # CONFIG_ENCLOSURE_SERVICES is not set | 460 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -458,6 +465,7 @@ CONFIG_BLK_DEV_IDE=y | |||
458 | # | 465 | # |
459 | # Please see Documentation/ide/ide.txt for help/info on IDE drives | 466 | # Please see Documentation/ide/ide.txt for help/info on IDE drives |
460 | # | 467 | # |
468 | CONFIG_IDE_ATAPI=y | ||
461 | # CONFIG_BLK_DEV_IDE_SATA is not set | 469 | # CONFIG_BLK_DEV_IDE_SATA is not set |
462 | CONFIG_BLK_DEV_IDEDISK=y | 470 | CONFIG_BLK_DEV_IDEDISK=y |
463 | # CONFIG_IDEDISK_MULTI_MODE is not set | 471 | # CONFIG_IDEDISK_MULTI_MODE is not set |
@@ -475,8 +483,6 @@ CONFIG_IDE_PROC_FS=y | |||
475 | # CONFIG_BLK_DEV_PLATFORM is not set | 483 | # CONFIG_BLK_DEV_PLATFORM is not set |
476 | CONFIG_BLK_DEV_Q40IDE=y | 484 | CONFIG_BLK_DEV_Q40IDE=y |
477 | # CONFIG_BLK_DEV_IDEDMA is not set | 485 | # CONFIG_BLK_DEV_IDEDMA is not set |
478 | # CONFIG_BLK_DEV_HD_ONLY is not set | ||
479 | # CONFIG_BLK_DEV_HD is not set | ||
480 | 486 | ||
481 | # | 487 | # |
482 | # SCSI device support | 488 | # SCSI device support |
@@ -536,6 +542,7 @@ CONFIG_ISCSI_TCP=m | |||
536 | # CONFIG_SCSI_SYM53C416 is not set | 542 | # CONFIG_SCSI_SYM53C416 is not set |
537 | # CONFIG_SCSI_T128 is not set | 543 | # CONFIG_SCSI_T128 is not set |
538 | # CONFIG_SCSI_DEBUG is not set | 544 | # CONFIG_SCSI_DEBUG is not set |
545 | # CONFIG_SCSI_DH is not set | ||
539 | CONFIG_MD=y | 546 | CONFIG_MD=y |
540 | CONFIG_BLK_DEV_MD=m | 547 | CONFIG_BLK_DEV_MD=m |
541 | CONFIG_MD_LINEAR=m | 548 | CONFIG_MD_LINEAR=m |
@@ -544,7 +551,7 @@ CONFIG_MD_RAID1=m | |||
544 | # CONFIG_MD_RAID10 is not set | 551 | # CONFIG_MD_RAID10 is not set |
545 | CONFIG_MD_RAID456=m | 552 | CONFIG_MD_RAID456=m |
546 | CONFIG_MD_RAID5_RESHAPE=y | 553 | CONFIG_MD_RAID5_RESHAPE=y |
547 | CONFIG_MD_MULTIPATH=m | 554 | # CONFIG_MD_MULTIPATH is not set |
548 | # CONFIG_MD_FAULTY is not set | 555 | # CONFIG_MD_FAULTY is not set |
549 | CONFIG_BLK_DEV_DM=m | 556 | CONFIG_BLK_DEV_DM=m |
550 | # CONFIG_DM_DEBUG is not set | 557 | # CONFIG_DM_DEBUG is not set |
@@ -553,13 +560,9 @@ CONFIG_DM_SNAPSHOT=m | |||
553 | CONFIG_DM_MIRROR=m | 560 | CONFIG_DM_MIRROR=m |
554 | CONFIG_DM_ZERO=m | 561 | CONFIG_DM_ZERO=m |
555 | CONFIG_DM_MULTIPATH=m | 562 | CONFIG_DM_MULTIPATH=m |
556 | CONFIG_DM_MULTIPATH_EMC=m | ||
557 | CONFIG_DM_MULTIPATH_RDAC=m | ||
558 | CONFIG_DM_MULTIPATH_HP=m | ||
559 | # CONFIG_DM_DELAY is not set | 563 | # CONFIG_DM_DELAY is not set |
560 | CONFIG_DM_UEVENT=y | 564 | CONFIG_DM_UEVENT=y |
561 | CONFIG_NETDEVICES=y | 565 | CONFIG_NETDEVICES=y |
562 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
563 | CONFIG_DUMMY=m | 566 | CONFIG_DUMMY=m |
564 | # CONFIG_BONDING is not set | 567 | # CONFIG_BONDING is not set |
565 | CONFIG_MACVLAN=m | 568 | CONFIG_MACVLAN=m |
@@ -680,6 +683,7 @@ CONFIG_SERIO_LIBPS2=m | |||
680 | # Character devices | 683 | # Character devices |
681 | # | 684 | # |
682 | CONFIG_VT=y | 685 | CONFIG_VT=y |
686 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
683 | CONFIG_VT_CONSOLE=y | 687 | CONFIG_VT_CONSOLE=y |
684 | CONFIG_HW_CONSOLE=y | 688 | CONFIG_HW_CONSOLE=y |
685 | CONFIG_VT_HW_CONSOLE_BINDING=y | 689 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -711,6 +715,7 @@ CONFIG_GEN_RTC_X=y | |||
711 | # CONFIG_POWER_SUPPLY is not set | 715 | # CONFIG_POWER_SUPPLY is not set |
712 | # CONFIG_HWMON is not set | 716 | # CONFIG_HWMON is not set |
713 | # CONFIG_THERMAL is not set | 717 | # CONFIG_THERMAL is not set |
718 | # CONFIG_THERMAL_HWMON is not set | ||
714 | # CONFIG_WATCHDOG is not set | 719 | # CONFIG_WATCHDOG is not set |
715 | 720 | ||
716 | # | 721 | # |
@@ -722,8 +727,10 @@ CONFIG_SSB_POSSIBLE=y | |||
722 | # | 727 | # |
723 | # Multifunction device drivers | 728 | # Multifunction device drivers |
724 | # | 729 | # |
730 | # CONFIG_MFD_CORE is not set | ||
725 | # CONFIG_MFD_SM501 is not set | 731 | # CONFIG_MFD_SM501 is not set |
726 | # CONFIG_HTC_PASIC3 is not set | 732 | # CONFIG_HTC_PASIC3 is not set |
733 | # CONFIG_MFD_TMIO is not set | ||
727 | 734 | ||
728 | # | 735 | # |
729 | # Multimedia devices | 736 | # Multimedia devices |
@@ -792,10 +799,6 @@ CONFIG_LOGO=y | |||
792 | CONFIG_LOGO_LINUX_MONO=y | 799 | CONFIG_LOGO_LINUX_MONO=y |
793 | CONFIG_LOGO_LINUX_VGA16=y | 800 | CONFIG_LOGO_LINUX_VGA16=y |
794 | CONFIG_LOGO_LINUX_CLUT224=y | 801 | CONFIG_LOGO_LINUX_CLUT224=y |
795 | |||
796 | # | ||
797 | # Sound | ||
798 | # | ||
799 | CONFIG_SOUND=m | 802 | CONFIG_SOUND=m |
800 | CONFIG_DMASOUND_Q40=m | 803 | CONFIG_DMASOUND_Q40=m |
801 | CONFIG_DMASOUND=m | 804 | CONFIG_DMASOUND=m |
@@ -809,6 +812,7 @@ CONFIG_HIDRAW=y | |||
809 | # CONFIG_NEW_LEDS is not set | 812 | # CONFIG_NEW_LEDS is not set |
810 | # CONFIG_ACCESSIBILITY is not set | 813 | # CONFIG_ACCESSIBILITY is not set |
811 | # CONFIG_RTC_CLASS is not set | 814 | # CONFIG_RTC_CLASS is not set |
815 | # CONFIG_DMADEVICES is not set | ||
812 | # CONFIG_UIO is not set | 816 | # CONFIG_UIO is not set |
813 | 817 | ||
814 | # | 818 | # |
@@ -843,6 +847,7 @@ CONFIG_XFS_FS=m | |||
843 | CONFIG_OCFS2_FS=m | 847 | CONFIG_OCFS2_FS=m |
844 | CONFIG_OCFS2_FS_O2CB=m | 848 | CONFIG_OCFS2_FS_O2CB=m |
845 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 849 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
850 | # CONFIG_OCFS2_FS_STATS is not set | ||
846 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 851 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
847 | # CONFIG_OCFS2_DEBUG_FS is not set | 852 | # CONFIG_OCFS2_DEBUG_FS is not set |
848 | CONFIG_DNOTIFY=y | 853 | CONFIG_DNOTIFY=y |
@@ -902,6 +907,7 @@ CONFIG_HFSPLUS_FS=m | |||
902 | CONFIG_CRAMFS=m | 907 | CONFIG_CRAMFS=m |
903 | # CONFIG_VXFS_FS is not set | 908 | # CONFIG_VXFS_FS is not set |
904 | CONFIG_MINIX_FS=y | 909 | CONFIG_MINIX_FS=y |
910 | # CONFIG_OMFS_FS is not set | ||
905 | CONFIG_HPFS_FS=m | 911 | CONFIG_HPFS_FS=m |
906 | # CONFIG_QNX4FS_FS is not set | 912 | # CONFIG_QNX4FS_FS is not set |
907 | # CONFIG_ROMFS_FS is not set | 913 | # CONFIG_ROMFS_FS is not set |
@@ -924,7 +930,6 @@ CONFIG_EXPORTFS=m | |||
924 | CONFIG_NFS_COMMON=y | 930 | CONFIG_NFS_COMMON=y |
925 | CONFIG_SUNRPC=y | 931 | CONFIG_SUNRPC=y |
926 | CONFIG_SUNRPC_GSS=y | 932 | CONFIG_SUNRPC_GSS=y |
927 | CONFIG_SUNRPC_BIND34=y | ||
928 | CONFIG_RPCSEC_GSS_KRB5=y | 933 | CONFIG_RPCSEC_GSS_KRB5=y |
929 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 934 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
930 | CONFIG_SMB_FS=m | 935 | CONFIG_SMB_FS=m |
@@ -933,7 +938,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
933 | # CONFIG_CIFS is not set | 938 | # CONFIG_CIFS is not set |
934 | # CONFIG_NCP_FS is not set | 939 | # CONFIG_NCP_FS is not set |
935 | CONFIG_CODA_FS=m | 940 | CONFIG_CODA_FS=m |
936 | # CONFIG_CODA_FS_OLD_API is not set | ||
937 | # CONFIG_AFS_FS is not set | 941 | # CONFIG_AFS_FS is not set |
938 | 942 | ||
939 | # | 943 | # |
@@ -997,6 +1001,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
997 | # CONFIG_HEADERS_CHECK is not set | 1001 | # CONFIG_HEADERS_CHECK is not set |
998 | # CONFIG_DEBUG_KERNEL is not set | 1002 | # CONFIG_DEBUG_KERNEL is not set |
999 | CONFIG_DEBUG_BUGVERBOSE=y | 1003 | CONFIG_DEBUG_BUGVERBOSE=y |
1004 | CONFIG_DEBUG_MEMORY_INIT=y | ||
1005 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
1000 | # CONFIG_SAMPLES is not set | 1006 | # CONFIG_SAMPLES is not set |
1001 | 1007 | ||
1002 | # | 1008 | # |
@@ -1056,6 +1062,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1056 | CONFIG_CRYPTO_MD4=m | 1062 | CONFIG_CRYPTO_MD4=m |
1057 | CONFIG_CRYPTO_MD5=y | 1063 | CONFIG_CRYPTO_MD5=y |
1058 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1064 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1065 | CONFIG_CRYPTO_RMD128=m | ||
1066 | CONFIG_CRYPTO_RMD160=m | ||
1067 | CONFIG_CRYPTO_RMD256=m | ||
1068 | CONFIG_CRYPTO_RMD320=m | ||
1059 | CONFIG_CRYPTO_SHA1=m | 1069 | CONFIG_CRYPTO_SHA1=m |
1060 | CONFIG_CRYPTO_SHA256=m | 1070 | CONFIG_CRYPTO_SHA256=m |
1061 | CONFIG_CRYPTO_SHA512=m | 1071 | CONFIG_CRYPTO_SHA512=m |
@@ -1097,6 +1107,7 @@ CONFIG_BITREVERSE=y | |||
1097 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1107 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1098 | CONFIG_CRC_CCITT=m | 1108 | CONFIG_CRC_CCITT=m |
1099 | CONFIG_CRC16=m | 1109 | CONFIG_CRC16=m |
1110 | CONFIG_CRC_T10DIF=y | ||
1100 | CONFIG_CRC_ITU_T=m | 1111 | CONFIG_CRC_ITU_T=m |
1101 | CONFIG_CRC32=y | 1112 | CONFIG_CRC32=y |
1102 | # CONFIG_CRC7 is not set | 1113 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 296340d2b315..cb62b96d766e 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:11 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -149,10 +155,6 @@ CONFIG_BINFMT_MISC=m | |||
149 | CONFIG_PROC_HARDWARE=y | 155 | CONFIG_PROC_HARDWARE=y |
150 | CONFIG_ZONE_DMA=y | 156 | CONFIG_ZONE_DMA=y |
151 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 157 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
152 | |||
153 | # | ||
154 | # Networking | ||
155 | # | ||
156 | CONFIG_NET=y | 158 | CONFIG_NET=y |
157 | 159 | ||
158 | # | 160 | # |
@@ -166,6 +168,7 @@ CONFIG_XFRM=y | |||
166 | # CONFIG_XFRM_SUB_POLICY is not set | 168 | # CONFIG_XFRM_SUB_POLICY is not set |
167 | CONFIG_XFRM_MIGRATE=y | 169 | CONFIG_XFRM_MIGRATE=y |
168 | # CONFIG_XFRM_STATISTICS is not set | 170 | # CONFIG_XFRM_STATISTICS is not set |
171 | CONFIG_XFRM_IPCOMP=m | ||
169 | CONFIG_NET_KEY=y | 172 | CONFIG_NET_KEY=y |
170 | CONFIG_NET_KEY_MIGRATE=y | 173 | CONFIG_NET_KEY_MIGRATE=y |
171 | CONFIG_INET=y | 174 | CONFIG_INET=y |
@@ -399,6 +402,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
399 | # | 402 | # |
400 | # CONFIG_CFG80211 is not set | 403 | # CONFIG_CFG80211 is not set |
401 | CONFIG_WIRELESS_EXT=y | 404 | CONFIG_WIRELESS_EXT=y |
405 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
402 | # CONFIG_MAC80211 is not set | 406 | # CONFIG_MAC80211 is not set |
403 | CONFIG_IEEE80211=m | 407 | CONFIG_IEEE80211=m |
404 | # CONFIG_IEEE80211_DEBUG is not set | 408 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -418,7 +422,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
418 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 422 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
419 | CONFIG_STANDALONE=y | 423 | CONFIG_STANDALONE=y |
420 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 424 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
421 | CONFIG_FW_LOADER=m | 425 | CONFIG_FW_LOADER=y |
426 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
427 | CONFIG_EXTRA_FIRMWARE="" | ||
422 | # CONFIG_SYS_HYPERVISOR is not set | 428 | # CONFIG_SYS_HYPERVISOR is not set |
423 | CONFIG_CONNECTOR=m | 429 | CONFIG_CONNECTOR=m |
424 | # CONFIG_MTD is not set | 430 | # CONFIG_MTD is not set |
@@ -436,6 +442,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
436 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 442 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
437 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 443 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
438 | CONFIG_ATA_OVER_ETH=m | 444 | CONFIG_ATA_OVER_ETH=m |
445 | # CONFIG_BLK_DEV_HD is not set | ||
439 | CONFIG_MISC_DEVICES=y | 446 | CONFIG_MISC_DEVICES=y |
440 | # CONFIG_EEPROM_93CX6 is not set | 447 | # CONFIG_EEPROM_93CX6 is not set |
441 | # CONFIG_ENCLOSURE_SERVICES is not set | 448 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -488,6 +495,7 @@ CONFIG_SCSI_LOWLEVEL=y | |||
488 | CONFIG_ISCSI_TCP=m | 495 | CONFIG_ISCSI_TCP=m |
489 | # CONFIG_SCSI_DEBUG is not set | 496 | # CONFIG_SCSI_DEBUG is not set |
490 | CONFIG_SUN3_SCSI=y | 497 | CONFIG_SUN3_SCSI=y |
498 | # CONFIG_SCSI_DH is not set | ||
491 | CONFIG_MD=y | 499 | CONFIG_MD=y |
492 | CONFIG_BLK_DEV_MD=m | 500 | CONFIG_BLK_DEV_MD=m |
493 | CONFIG_MD_LINEAR=m | 501 | CONFIG_MD_LINEAR=m |
@@ -496,7 +504,7 @@ CONFIG_MD_RAID1=m | |||
496 | # CONFIG_MD_RAID10 is not set | 504 | # CONFIG_MD_RAID10 is not set |
497 | CONFIG_MD_RAID456=m | 505 | CONFIG_MD_RAID456=m |
498 | CONFIG_MD_RAID5_RESHAPE=y | 506 | CONFIG_MD_RAID5_RESHAPE=y |
499 | CONFIG_MD_MULTIPATH=m | 507 | # CONFIG_MD_MULTIPATH is not set |
500 | # CONFIG_MD_FAULTY is not set | 508 | # CONFIG_MD_FAULTY is not set |
501 | CONFIG_BLK_DEV_DM=m | 509 | CONFIG_BLK_DEV_DM=m |
502 | # CONFIG_DM_DEBUG is not set | 510 | # CONFIG_DM_DEBUG is not set |
@@ -505,13 +513,9 @@ CONFIG_DM_SNAPSHOT=m | |||
505 | CONFIG_DM_MIRROR=m | 513 | CONFIG_DM_MIRROR=m |
506 | CONFIG_DM_ZERO=m | 514 | CONFIG_DM_ZERO=m |
507 | CONFIG_DM_MULTIPATH=m | 515 | CONFIG_DM_MULTIPATH=m |
508 | CONFIG_DM_MULTIPATH_EMC=m | ||
509 | CONFIG_DM_MULTIPATH_RDAC=m | ||
510 | CONFIG_DM_MULTIPATH_HP=m | ||
511 | # CONFIG_DM_DELAY is not set | 516 | # CONFIG_DM_DELAY is not set |
512 | CONFIG_DM_UEVENT=y | 517 | CONFIG_DM_UEVENT=y |
513 | CONFIG_NETDEVICES=y | 518 | CONFIG_NETDEVICES=y |
514 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
515 | CONFIG_DUMMY=m | 519 | CONFIG_DUMMY=m |
516 | # CONFIG_BONDING is not set | 520 | # CONFIG_BONDING is not set |
517 | CONFIG_MACVLAN=m | 521 | CONFIG_MACVLAN=m |
@@ -527,7 +531,6 @@ CONFIG_SUN3_82586=y | |||
527 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | 531 | # CONFIG_IBM_NEW_EMAC_RGMII is not set |
528 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 532 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
529 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | 533 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set |
530 | # CONFIG_B44 is not set | ||
531 | # CONFIG_NETDEV_1000 is not set | 534 | # CONFIG_NETDEV_1000 is not set |
532 | # CONFIG_NETDEV_10000 is not set | 535 | # CONFIG_NETDEV_10000 is not set |
533 | 536 | ||
@@ -617,6 +620,7 @@ CONFIG_SERIO_LIBPS2=m | |||
617 | # Character devices | 620 | # Character devices |
618 | # | 621 | # |
619 | CONFIG_VT=y | 622 | CONFIG_VT=y |
623 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
620 | CONFIG_VT_CONSOLE=y | 624 | CONFIG_VT_CONSOLE=y |
621 | CONFIG_HW_CONSOLE=y | 625 | CONFIG_HW_CONSOLE=y |
622 | CONFIG_VT_HW_CONSOLE_BINDING=y | 626 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -647,19 +651,20 @@ CONFIG_GEN_RTC_X=y | |||
647 | # CONFIG_POWER_SUPPLY is not set | 651 | # CONFIG_POWER_SUPPLY is not set |
648 | # CONFIG_HWMON is not set | 652 | # CONFIG_HWMON is not set |
649 | # CONFIG_THERMAL is not set | 653 | # CONFIG_THERMAL is not set |
654 | # CONFIG_THERMAL_HWMON is not set | ||
650 | # CONFIG_WATCHDOG is not set | 655 | # CONFIG_WATCHDOG is not set |
651 | 656 | ||
652 | # | 657 | # |
653 | # Sonics Silicon Backplane | 658 | # Sonics Silicon Backplane |
654 | # | 659 | # |
655 | CONFIG_SSB_POSSIBLE=y | ||
656 | # CONFIG_SSB is not set | ||
657 | 660 | ||
658 | # | 661 | # |
659 | # Multifunction device drivers | 662 | # Multifunction device drivers |
660 | # | 663 | # |
664 | # CONFIG_MFD_CORE is not set | ||
661 | # CONFIG_MFD_SM501 is not set | 665 | # CONFIG_MFD_SM501 is not set |
662 | # CONFIG_HTC_PASIC3 is not set | 666 | # CONFIG_HTC_PASIC3 is not set |
667 | # CONFIG_MFD_TMIO is not set | ||
663 | 668 | ||
664 | # | 669 | # |
665 | # Multimedia devices | 670 | # Multimedia devices |
@@ -727,10 +732,6 @@ CONFIG_LOGO=y | |||
727 | CONFIG_LOGO_LINUX_MONO=y | 732 | CONFIG_LOGO_LINUX_MONO=y |
728 | CONFIG_LOGO_LINUX_VGA16=y | 733 | CONFIG_LOGO_LINUX_VGA16=y |
729 | CONFIG_LOGO_LINUX_CLUT224=y | 734 | CONFIG_LOGO_LINUX_CLUT224=y |
730 | |||
731 | # | ||
732 | # Sound | ||
733 | # | ||
734 | # CONFIG_SOUND is not set | 735 | # CONFIG_SOUND is not set |
735 | CONFIG_HID_SUPPORT=y | 736 | CONFIG_HID_SUPPORT=y |
736 | CONFIG_HID=m | 737 | CONFIG_HID=m |
@@ -776,6 +777,7 @@ CONFIG_XFS_FS=m | |||
776 | CONFIG_OCFS2_FS=m | 777 | CONFIG_OCFS2_FS=m |
777 | CONFIG_OCFS2_FS_O2CB=m | 778 | CONFIG_OCFS2_FS_O2CB=m |
778 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 779 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
780 | # CONFIG_OCFS2_FS_STATS is not set | ||
779 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 781 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
780 | # CONFIG_OCFS2_DEBUG_FS is not set | 782 | # CONFIG_OCFS2_DEBUG_FS is not set |
781 | CONFIG_DNOTIFY=y | 783 | CONFIG_DNOTIFY=y |
@@ -835,6 +837,7 @@ CONFIG_HFSPLUS_FS=m | |||
835 | CONFIG_CRAMFS=m | 837 | CONFIG_CRAMFS=m |
836 | # CONFIG_VXFS_FS is not set | 838 | # CONFIG_VXFS_FS is not set |
837 | CONFIG_MINIX_FS=y | 839 | CONFIG_MINIX_FS=y |
840 | # CONFIG_OMFS_FS is not set | ||
838 | CONFIG_HPFS_FS=m | 841 | CONFIG_HPFS_FS=m |
839 | # CONFIG_QNX4FS_FS is not set | 842 | # CONFIG_QNX4FS_FS is not set |
840 | # CONFIG_ROMFS_FS is not set | 843 | # CONFIG_ROMFS_FS is not set |
@@ -847,18 +850,17 @@ CONFIG_NFS_FS=y | |||
847 | CONFIG_NFS_V3=y | 850 | CONFIG_NFS_V3=y |
848 | # CONFIG_NFS_V3_ACL is not set | 851 | # CONFIG_NFS_V3_ACL is not set |
849 | CONFIG_NFS_V4=y | 852 | CONFIG_NFS_V4=y |
853 | CONFIG_ROOT_NFS=y | ||
850 | CONFIG_NFSD=m | 854 | CONFIG_NFSD=m |
851 | CONFIG_NFSD_V3=y | 855 | CONFIG_NFSD_V3=y |
852 | # CONFIG_NFSD_V3_ACL is not set | 856 | # CONFIG_NFSD_V3_ACL is not set |
853 | # CONFIG_NFSD_V4 is not set | 857 | # CONFIG_NFSD_V4 is not set |
854 | CONFIG_ROOT_NFS=y | ||
855 | CONFIG_LOCKD=y | 858 | CONFIG_LOCKD=y |
856 | CONFIG_LOCKD_V4=y | 859 | CONFIG_LOCKD_V4=y |
857 | CONFIG_EXPORTFS=m | 860 | CONFIG_EXPORTFS=m |
858 | CONFIG_NFS_COMMON=y | 861 | CONFIG_NFS_COMMON=y |
859 | CONFIG_SUNRPC=y | 862 | CONFIG_SUNRPC=y |
860 | CONFIG_SUNRPC_GSS=y | 863 | CONFIG_SUNRPC_GSS=y |
861 | CONFIG_SUNRPC_BIND34=y | ||
862 | CONFIG_RPCSEC_GSS_KRB5=y | 864 | CONFIG_RPCSEC_GSS_KRB5=y |
863 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 865 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
864 | CONFIG_SMB_FS=m | 866 | CONFIG_SMB_FS=m |
@@ -867,7 +869,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
867 | # CONFIG_CIFS is not set | 869 | # CONFIG_CIFS is not set |
868 | # CONFIG_NCP_FS is not set | 870 | # CONFIG_NCP_FS is not set |
869 | CONFIG_CODA_FS=m | 871 | CONFIG_CODA_FS=m |
870 | # CONFIG_CODA_FS_OLD_API is not set | ||
871 | # CONFIG_AFS_FS is not set | 872 | # CONFIG_AFS_FS is not set |
872 | 873 | ||
873 | # | 874 | # |
@@ -932,6 +933,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
932 | # CONFIG_HEADERS_CHECK is not set | 933 | # CONFIG_HEADERS_CHECK is not set |
933 | # CONFIG_DEBUG_KERNEL is not set | 934 | # CONFIG_DEBUG_KERNEL is not set |
934 | CONFIG_DEBUG_BUGVERBOSE=y | 935 | CONFIG_DEBUG_BUGVERBOSE=y |
936 | CONFIG_DEBUG_MEMORY_INIT=y | ||
937 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
935 | # CONFIG_SAMPLES is not set | 938 | # CONFIG_SAMPLES is not set |
936 | 939 | ||
937 | # | 940 | # |
@@ -991,6 +994,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
991 | CONFIG_CRYPTO_MD4=m | 994 | CONFIG_CRYPTO_MD4=m |
992 | CONFIG_CRYPTO_MD5=y | 995 | CONFIG_CRYPTO_MD5=y |
993 | CONFIG_CRYPTO_MICHAEL_MIC=m | 996 | CONFIG_CRYPTO_MICHAEL_MIC=m |
997 | CONFIG_CRYPTO_RMD128=m | ||
998 | CONFIG_CRYPTO_RMD160=m | ||
999 | CONFIG_CRYPTO_RMD256=m | ||
1000 | CONFIG_CRYPTO_RMD320=m | ||
994 | CONFIG_CRYPTO_SHA1=m | 1001 | CONFIG_CRYPTO_SHA1=m |
995 | CONFIG_CRYPTO_SHA256=m | 1002 | CONFIG_CRYPTO_SHA256=m |
996 | CONFIG_CRYPTO_SHA512=m | 1003 | CONFIG_CRYPTO_SHA512=m |
@@ -1032,6 +1039,7 @@ CONFIG_BITREVERSE=y | |||
1032 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1039 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1033 | CONFIG_CRC_CCITT=m | 1040 | CONFIG_CRC_CCITT=m |
1034 | CONFIG_CRC16=m | 1041 | CONFIG_CRC16=m |
1042 | CONFIG_CRC_T10DIF=y | ||
1035 | CONFIG_CRC_ITU_T=m | 1043 | CONFIG_CRC_ITU_T=m |
1036 | CONFIG_CRC32=y | 1044 | CONFIG_CRC32=y |
1037 | # CONFIG_CRC7 is not set | 1045 | # CONFIG_CRC7 is not set |
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index 8d3a416c92bf..04b4363a7050 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_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.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc6 |
4 | # Wed May 28 22:47:35 2008 | 4 | # Wed Sep 10 09:02:12 2008 |
5 | # | 5 | # |
6 | CONFIG_M68K=y | 6 | CONFIG_M68K=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -52,7 +52,6 @@ CONFIG_SYSCTL=y | |||
52 | # CONFIG_EMBEDDED is not set | 52 | # CONFIG_EMBEDDED is not set |
53 | CONFIG_UID16=y | 53 | CONFIG_UID16=y |
54 | CONFIG_SYSCTL_SYSCALL=y | 54 | CONFIG_SYSCTL_SYSCALL=y |
55 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
56 | CONFIG_KALLSYMS=y | 55 | CONFIG_KALLSYMS=y |
57 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 56 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
58 | CONFIG_HOTPLUG=y | 57 | CONFIG_HOTPLUG=y |
@@ -75,10 +74,16 @@ CONFIG_SLAB=y | |||
75 | # CONFIG_PROFILING is not set | 74 | # CONFIG_PROFILING is not set |
76 | # CONFIG_MARKERS is not set | 75 | # CONFIG_MARKERS is not set |
77 | # CONFIG_HAVE_OPROFILE is not set | 76 | # CONFIG_HAVE_OPROFILE is not set |
77 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
78 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
78 | # CONFIG_HAVE_KPROBES is not set | 79 | # CONFIG_HAVE_KPROBES is not set |
79 | # CONFIG_HAVE_KRETPROBES is not set | 80 | # CONFIG_HAVE_KRETPROBES is not set |
81 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
80 | # CONFIG_HAVE_DMA_ATTRS is not set | 82 | # CONFIG_HAVE_DMA_ATTRS is not set |
83 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
84 | # CONFIG_HAVE_CLK is not set | ||
81 | CONFIG_PROC_PAGE_MONITOR=y | 85 | CONFIG_PROC_PAGE_MONITOR=y |
86 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
82 | CONFIG_SLABINFO=y | 87 | CONFIG_SLABINFO=y |
83 | CONFIG_RT_MUTEXES=y | 88 | CONFIG_RT_MUTEXES=y |
84 | # CONFIG_TINY_SHMEM is not set | 89 | # CONFIG_TINY_SHMEM is not set |
@@ -95,6 +100,7 @@ CONFIG_BLOCK=y | |||
95 | # CONFIG_BLK_DEV_IO_TRACE is not set | 100 | # CONFIG_BLK_DEV_IO_TRACE is not set |
96 | # CONFIG_LSF is not set | 101 | # CONFIG_LSF is not set |
97 | CONFIG_BLK_DEV_BSG=y | 102 | CONFIG_BLK_DEV_BSG=y |
103 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
98 | 104 | ||
99 | # | 105 | # |
100 | # IO Schedulers | 106 | # IO Schedulers |
@@ -160,10 +166,6 @@ CONFIG_BINFMT_MISC=m | |||
160 | CONFIG_PROC_HARDWARE=y | 166 | CONFIG_PROC_HARDWARE=y |
161 | CONFIG_ZONE_DMA=y | 167 | CONFIG_ZONE_DMA=y |
162 | # CONFIG_ARCH_SUPPORTS_MSI is not set | 168 | # CONFIG_ARCH_SUPPORTS_MSI is not set |
163 | |||
164 | # | ||
165 | # Networking | ||
166 | # | ||
167 | CONFIG_NET=y | 169 | CONFIG_NET=y |
168 | 170 | ||
169 | # | 171 | # |
@@ -177,6 +179,7 @@ CONFIG_XFRM=y | |||
177 | # CONFIG_XFRM_SUB_POLICY is not set | 179 | # CONFIG_XFRM_SUB_POLICY is not set |
178 | CONFIG_XFRM_MIGRATE=y | 180 | CONFIG_XFRM_MIGRATE=y |
179 | # CONFIG_XFRM_STATISTICS is not set | 181 | # CONFIG_XFRM_STATISTICS is not set |
182 | CONFIG_XFRM_IPCOMP=m | ||
180 | CONFIG_NET_KEY=y | 183 | CONFIG_NET_KEY=y |
181 | CONFIG_NET_KEY_MIGRATE=y | 184 | CONFIG_NET_KEY_MIGRATE=y |
182 | CONFIG_INET=y | 185 | CONFIG_INET=y |
@@ -410,6 +413,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
410 | # | 413 | # |
411 | # CONFIG_CFG80211 is not set | 414 | # CONFIG_CFG80211 is not set |
412 | CONFIG_WIRELESS_EXT=y | 415 | CONFIG_WIRELESS_EXT=y |
416 | # CONFIG_WIRELESS_EXT_SYSFS is not set | ||
413 | # CONFIG_MAC80211 is not set | 417 | # CONFIG_MAC80211 is not set |
414 | CONFIG_IEEE80211=m | 418 | CONFIG_IEEE80211=m |
415 | # CONFIG_IEEE80211_DEBUG is not set | 419 | # CONFIG_IEEE80211_DEBUG is not set |
@@ -429,7 +433,9 @@ CONFIG_IEEE80211_CRYPT_TKIP=m | |||
429 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 433 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
430 | CONFIG_STANDALONE=y | 434 | CONFIG_STANDALONE=y |
431 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 435 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
432 | CONFIG_FW_LOADER=m | 436 | CONFIG_FW_LOADER=y |
437 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
438 | CONFIG_EXTRA_FIRMWARE="" | ||
433 | # CONFIG_SYS_HYPERVISOR is not set | 439 | # CONFIG_SYS_HYPERVISOR is not set |
434 | CONFIG_CONNECTOR=m | 440 | CONFIG_CONNECTOR=m |
435 | # CONFIG_MTD is not set | 441 | # CONFIG_MTD is not set |
@@ -447,6 +453,7 @@ CONFIG_CDROM_PKTCDVD=m | |||
447 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 453 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
448 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set | 454 | # CONFIG_CDROM_PKTCDVD_WCACHE is not set |
449 | CONFIG_ATA_OVER_ETH=m | 455 | CONFIG_ATA_OVER_ETH=m |
456 | # CONFIG_BLK_DEV_HD is not set | ||
450 | CONFIG_MISC_DEVICES=y | 457 | CONFIG_MISC_DEVICES=y |
451 | # CONFIG_EEPROM_93CX6 is not set | 458 | # CONFIG_EEPROM_93CX6 is not set |
452 | # CONFIG_ENCLOSURE_SERVICES is not set | 459 | # CONFIG_ENCLOSURE_SERVICES is not set |
@@ -499,6 +506,7 @@ CONFIG_SCSI_LOWLEVEL=y | |||
499 | CONFIG_ISCSI_TCP=m | 506 | CONFIG_ISCSI_TCP=m |
500 | # CONFIG_SCSI_DEBUG is not set | 507 | # CONFIG_SCSI_DEBUG is not set |
501 | CONFIG_SUN3X_ESP=y | 508 | CONFIG_SUN3X_ESP=y |
509 | # CONFIG_SCSI_DH is not set | ||
502 | CONFIG_MD=y | 510 | CONFIG_MD=y |
503 | CONFIG_BLK_DEV_MD=m | 511 | CONFIG_BLK_DEV_MD=m |
504 | CONFIG_MD_LINEAR=m | 512 | CONFIG_MD_LINEAR=m |
@@ -507,7 +515,7 @@ CONFIG_MD_RAID1=m | |||
507 | # CONFIG_MD_RAID10 is not set | 515 | # CONFIG_MD_RAID10 is not set |
508 | CONFIG_MD_RAID456=m | 516 | CONFIG_MD_RAID456=m |
509 | CONFIG_MD_RAID5_RESHAPE=y | 517 | CONFIG_MD_RAID5_RESHAPE=y |
510 | CONFIG_MD_MULTIPATH=m | 518 | # CONFIG_MD_MULTIPATH is not set |
511 | # CONFIG_MD_FAULTY is not set | 519 | # CONFIG_MD_FAULTY is not set |
512 | CONFIG_BLK_DEV_DM=m | 520 | CONFIG_BLK_DEV_DM=m |
513 | # CONFIG_DM_DEBUG is not set | 521 | # CONFIG_DM_DEBUG is not set |
@@ -516,13 +524,9 @@ CONFIG_DM_SNAPSHOT=m | |||
516 | CONFIG_DM_MIRROR=m | 524 | CONFIG_DM_MIRROR=m |
517 | CONFIG_DM_ZERO=m | 525 | CONFIG_DM_ZERO=m |
518 | CONFIG_DM_MULTIPATH=m | 526 | CONFIG_DM_MULTIPATH=m |
519 | CONFIG_DM_MULTIPATH_EMC=m | ||
520 | CONFIG_DM_MULTIPATH_RDAC=m | ||
521 | CONFIG_DM_MULTIPATH_HP=m | ||
522 | # CONFIG_DM_DELAY is not set | 527 | # CONFIG_DM_DELAY is not set |
523 | CONFIG_DM_UEVENT=y | 528 | CONFIG_DM_UEVENT=y |
524 | CONFIG_NETDEVICES=y | 529 | CONFIG_NETDEVICES=y |
525 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
526 | CONFIG_DUMMY=m | 530 | CONFIG_DUMMY=m |
527 | # CONFIG_BONDING is not set | 531 | # CONFIG_BONDING is not set |
528 | CONFIG_MACVLAN=m | 532 | CONFIG_MACVLAN=m |
@@ -627,6 +631,7 @@ CONFIG_SERIO_LIBPS2=m | |||
627 | # Character devices | 631 | # Character devices |
628 | # | 632 | # |
629 | CONFIG_VT=y | 633 | CONFIG_VT=y |
634 | CONFIG_CONSOLE_TRANSLATIONS=y | ||
630 | CONFIG_VT_CONSOLE=y | 635 | CONFIG_VT_CONSOLE=y |
631 | CONFIG_HW_CONSOLE=y | 636 | CONFIG_HW_CONSOLE=y |
632 | CONFIG_VT_HW_CONSOLE_BINDING=y | 637 | CONFIG_VT_HW_CONSOLE_BINDING=y |
@@ -657,6 +662,7 @@ CONFIG_GEN_RTC_X=y | |||
657 | # CONFIG_POWER_SUPPLY is not set | 662 | # CONFIG_POWER_SUPPLY is not set |
658 | # CONFIG_HWMON is not set | 663 | # CONFIG_HWMON is not set |
659 | # CONFIG_THERMAL is not set | 664 | # CONFIG_THERMAL is not set |
665 | # CONFIG_THERMAL_HWMON is not set | ||
660 | # CONFIG_WATCHDOG is not set | 666 | # CONFIG_WATCHDOG is not set |
661 | 667 | ||
662 | # | 668 | # |
@@ -668,8 +674,10 @@ CONFIG_SSB_POSSIBLE=y | |||
668 | # | 674 | # |
669 | # Multifunction device drivers | 675 | # Multifunction device drivers |
670 | # | 676 | # |
677 | # CONFIG_MFD_CORE is not set | ||
671 | # CONFIG_MFD_SM501 is not set | 678 | # CONFIG_MFD_SM501 is not set |
672 | # CONFIG_HTC_PASIC3 is not set | 679 | # CONFIG_HTC_PASIC3 is not set |
680 | # CONFIG_MFD_TMIO is not set | ||
673 | 681 | ||
674 | # | 682 | # |
675 | # Multimedia devices | 683 | # Multimedia devices |
@@ -737,10 +745,6 @@ CONFIG_LOGO=y | |||
737 | CONFIG_LOGO_LINUX_MONO=y | 745 | CONFIG_LOGO_LINUX_MONO=y |
738 | CONFIG_LOGO_LINUX_VGA16=y | 746 | CONFIG_LOGO_LINUX_VGA16=y |
739 | CONFIG_LOGO_LINUX_CLUT224=y | 747 | CONFIG_LOGO_LINUX_CLUT224=y |
740 | |||
741 | # | ||
742 | # Sound | ||
743 | # | ||
744 | # CONFIG_SOUND is not set | 748 | # CONFIG_SOUND is not set |
745 | CONFIG_HID_SUPPORT=y | 749 | CONFIG_HID_SUPPORT=y |
746 | CONFIG_HID=m | 750 | CONFIG_HID=m |
@@ -752,6 +756,7 @@ CONFIG_HIDRAW=y | |||
752 | # CONFIG_NEW_LEDS is not set | 756 | # CONFIG_NEW_LEDS is not set |
753 | # CONFIG_ACCESSIBILITY is not set | 757 | # CONFIG_ACCESSIBILITY is not set |
754 | # CONFIG_RTC_CLASS is not set | 758 | # CONFIG_RTC_CLASS is not set |
759 | # CONFIG_DMADEVICES is not set | ||
755 | # CONFIG_UIO is not set | 760 | # CONFIG_UIO is not set |
756 | 761 | ||
757 | # | 762 | # |
@@ -786,6 +791,7 @@ CONFIG_XFS_FS=m | |||
786 | CONFIG_OCFS2_FS=m | 791 | CONFIG_OCFS2_FS=m |
787 | CONFIG_OCFS2_FS_O2CB=m | 792 | CONFIG_OCFS2_FS_O2CB=m |
788 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m | 793 | CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m |
794 | # CONFIG_OCFS2_FS_STATS is not set | ||
789 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set | 795 | # CONFIG_OCFS2_DEBUG_MASKLOG is not set |
790 | # CONFIG_OCFS2_DEBUG_FS is not set | 796 | # CONFIG_OCFS2_DEBUG_FS is not set |
791 | CONFIG_DNOTIFY=y | 797 | CONFIG_DNOTIFY=y |
@@ -845,6 +851,7 @@ CONFIG_HFSPLUS_FS=m | |||
845 | CONFIG_CRAMFS=m | 851 | CONFIG_CRAMFS=m |
846 | # CONFIG_VXFS_FS is not set | 852 | # CONFIG_VXFS_FS is not set |
847 | CONFIG_MINIX_FS=y | 853 | CONFIG_MINIX_FS=y |
854 | # CONFIG_OMFS_FS is not set | ||
848 | CONFIG_HPFS_FS=m | 855 | CONFIG_HPFS_FS=m |
849 | # CONFIG_QNX4FS_FS is not set | 856 | # CONFIG_QNX4FS_FS is not set |
850 | # CONFIG_ROMFS_FS is not set | 857 | # CONFIG_ROMFS_FS is not set |
@@ -857,18 +864,17 @@ CONFIG_NFS_FS=y | |||
857 | CONFIG_NFS_V3=y | 864 | CONFIG_NFS_V3=y |
858 | # CONFIG_NFS_V3_ACL is not set | 865 | # CONFIG_NFS_V3_ACL is not set |
859 | CONFIG_NFS_V4=y | 866 | CONFIG_NFS_V4=y |
867 | CONFIG_ROOT_NFS=y | ||
860 | CONFIG_NFSD=m | 868 | CONFIG_NFSD=m |
861 | CONFIG_NFSD_V3=y | 869 | CONFIG_NFSD_V3=y |
862 | # CONFIG_NFSD_V3_ACL is not set | 870 | # CONFIG_NFSD_V3_ACL is not set |
863 | # CONFIG_NFSD_V4 is not set | 871 | # CONFIG_NFSD_V4 is not set |
864 | CONFIG_ROOT_NFS=y | ||
865 | CONFIG_LOCKD=y | 872 | CONFIG_LOCKD=y |
866 | CONFIG_LOCKD_V4=y | 873 | CONFIG_LOCKD_V4=y |
867 | CONFIG_EXPORTFS=m | 874 | CONFIG_EXPORTFS=m |
868 | CONFIG_NFS_COMMON=y | 875 | CONFIG_NFS_COMMON=y |
869 | CONFIG_SUNRPC=y | 876 | CONFIG_SUNRPC=y |
870 | CONFIG_SUNRPC_GSS=y | 877 | CONFIG_SUNRPC_GSS=y |
871 | CONFIG_SUNRPC_BIND34=y | ||
872 | CONFIG_RPCSEC_GSS_KRB5=y | 878 | CONFIG_RPCSEC_GSS_KRB5=y |
873 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 879 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
874 | CONFIG_SMB_FS=m | 880 | CONFIG_SMB_FS=m |
@@ -877,7 +883,6 @@ CONFIG_SMB_NLS_REMOTE="cp437" | |||
877 | # CONFIG_CIFS is not set | 883 | # CONFIG_CIFS is not set |
878 | # CONFIG_NCP_FS is not set | 884 | # CONFIG_NCP_FS is not set |
879 | CONFIG_CODA_FS=m | 885 | CONFIG_CODA_FS=m |
880 | # CONFIG_CODA_FS_OLD_API is not set | ||
881 | # CONFIG_AFS_FS is not set | 886 | # CONFIG_AFS_FS is not set |
882 | 887 | ||
883 | # | 888 | # |
@@ -942,6 +947,8 @@ CONFIG_MAGIC_SYSRQ=y | |||
942 | # CONFIG_HEADERS_CHECK is not set | 947 | # CONFIG_HEADERS_CHECK is not set |
943 | # CONFIG_DEBUG_KERNEL is not set | 948 | # CONFIG_DEBUG_KERNEL is not set |
944 | CONFIG_DEBUG_BUGVERBOSE=y | 949 | CONFIG_DEBUG_BUGVERBOSE=y |
950 | CONFIG_DEBUG_MEMORY_INIT=y | ||
951 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
945 | # CONFIG_SAMPLES is not set | 952 | # CONFIG_SAMPLES is not set |
946 | 953 | ||
947 | # | 954 | # |
@@ -1001,6 +1008,10 @@ CONFIG_CRYPTO_CRC32C=m | |||
1001 | CONFIG_CRYPTO_MD4=m | 1008 | CONFIG_CRYPTO_MD4=m |
1002 | CONFIG_CRYPTO_MD5=y | 1009 | CONFIG_CRYPTO_MD5=y |
1003 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1010 | CONFIG_CRYPTO_MICHAEL_MIC=m |
1011 | CONFIG_CRYPTO_RMD128=m | ||
1012 | CONFIG_CRYPTO_RMD160=m | ||
1013 | CONFIG_CRYPTO_RMD256=m | ||
1014 | CONFIG_CRYPTO_RMD320=m | ||
1004 | CONFIG_CRYPTO_SHA1=m | 1015 | CONFIG_CRYPTO_SHA1=m |
1005 | CONFIG_CRYPTO_SHA256=m | 1016 | CONFIG_CRYPTO_SHA256=m |
1006 | CONFIG_CRYPTO_SHA512=m | 1017 | CONFIG_CRYPTO_SHA512=m |
@@ -1042,6 +1053,7 @@ CONFIG_BITREVERSE=y | |||
1042 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 1053 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
1043 | CONFIG_CRC_CCITT=m | 1054 | CONFIG_CRC_CCITT=m |
1044 | CONFIG_CRC16=m | 1055 | CONFIG_CRC16=m |
1056 | CONFIG_CRC_T10DIF=y | ||
1045 | CONFIG_CRC_ITU_T=m | 1057 | CONFIG_CRC_ITU_T=m |
1046 | CONFIG_CRC32=y | 1058 | CONFIG_CRC32=y |
1047 | # CONFIG_CRC7 is not set | 1059 | # CONFIG_CRC7 is not set |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4da736e25333..49896a2a1d72 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1886,6 +1886,15 @@ config STACKTRACE_SUPPORT | |||
1886 | 1886 | ||
1887 | source "init/Kconfig" | 1887 | source "init/Kconfig" |
1888 | 1888 | ||
1889 | config PROBE_INITRD_HEADER | ||
1890 | bool "Probe initrd header created by addinitrd" | ||
1891 | depends on BLK_DEV_INITRD | ||
1892 | help | ||
1893 | Probe initrd header at the last page of kernel image. | ||
1894 | Say Y here if you are using arch/mips/boot/addinitrd.c to | ||
1895 | add initrd or initramfs image to the kernel image. | ||
1896 | Otherwise, say N. | ||
1897 | |||
1889 | menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)" | 1898 | menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)" |
1890 | 1899 | ||
1891 | config HW_HAS_EISA | 1900 | config HW_HAS_EISA |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 2aae76bce293..16f8edfe5cdc 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -160,30 +160,33 @@ early_param("rd_size", rd_size_early); | |||
160 | static unsigned long __init init_initrd(void) | 160 | static unsigned long __init init_initrd(void) |
161 | { | 161 | { |
162 | unsigned long end; | 162 | unsigned long end; |
163 | u32 *initrd_header; | ||
164 | 163 | ||
165 | /* | 164 | /* |
166 | * Board specific code or command line parser should have | 165 | * Board specific code or command line parser should have |
167 | * already set up initrd_start and initrd_end. In these cases | 166 | * already set up initrd_start and initrd_end. In these cases |
168 | * perfom sanity checks and use them if all looks good. | 167 | * perfom sanity checks and use them if all looks good. |
169 | */ | 168 | */ |
170 | if (initrd_start && initrd_end > initrd_start) | 169 | if (!initrd_start || initrd_end <= initrd_start) { |
171 | goto sanitize; | 170 | #ifdef CONFIG_PROBE_INITRD_HEADER |
171 | u32 *initrd_header; | ||
172 | 172 | ||
173 | /* | 173 | /* |
174 | * See if initrd has been added to the kernel image by | 174 | * See if initrd has been added to the kernel image by |
175 | * arch/mips/boot/addinitrd.c. In that case a header is | 175 | * arch/mips/boot/addinitrd.c. In that case a header is |
176 | * prepended to initrd and is made up by 8 bytes. The fisrt | 176 | * prepended to initrd and is made up by 8 bytes. The first |
177 | * word is a magic number and the second one is the size of | 177 | * word is a magic number and the second one is the size of |
178 | * initrd. Initrd start must be page aligned in any cases. | 178 | * initrd. Initrd start must be page aligned in any cases. |
179 | */ | 179 | */ |
180 | initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; | 180 | initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; |
181 | if (initrd_header[0] != 0x494E5244) | 181 | if (initrd_header[0] != 0x494E5244) |
182 | goto disable; | ||
183 | initrd_start = (unsigned long)(initrd_header + 2); | ||
184 | initrd_end = initrd_start + initrd_header[1]; | ||
185 | #else | ||
182 | goto disable; | 186 | goto disable; |
183 | initrd_start = (unsigned long)(initrd_header + 2); | 187 | #endif |
184 | initrd_end = initrd_start + initrd_header[1]; | 188 | } |
185 | 189 | ||
186 | sanitize: | ||
187 | if (initrd_start & ~PAGE_MASK) { | 190 | if (initrd_start & ~PAGE_MASK) { |
188 | pr_err("initrd start must be page aligned\n"); | 191 | pr_err("initrd start must be page aligned\n"); |
189 | goto disable; | 192 | goto disable; |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 426cced1e9dc..6bee29097a56 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -373,8 +373,8 @@ void __noreturn die(const char * str, const struct pt_regs * regs) | |||
373 | do_exit(SIGSEGV); | 373 | do_exit(SIGSEGV); |
374 | } | 374 | } |
375 | 375 | ||
376 | extern const struct exception_table_entry __start___dbe_table[]; | 376 | extern struct exception_table_entry __start___dbe_table[]; |
377 | extern const struct exception_table_entry __stop___dbe_table[]; | 377 | extern struct exception_table_entry __stop___dbe_table[]; |
378 | 378 | ||
379 | __asm__( | 379 | __asm__( |
380 | " .section __dbe_table, \"a\"\n" | 380 | " .section __dbe_table, \"a\"\n" |
@@ -1200,7 +1200,7 @@ void *set_except_vector(int n, void *addr) | |||
1200 | if (n == 0 && cpu_has_divec) { | 1200 | if (n == 0 && cpu_has_divec) { |
1201 | *(u32 *)(ebase + 0x200) = 0x08000000 | | 1201 | *(u32 *)(ebase + 0x200) = 0x08000000 | |
1202 | (0x03ffffff & (handler >> 2)); | 1202 | (0x03ffffff & (handler >> 2)); |
1203 | flush_icache_range(ebase + 0x200, ebase + 0x204); | 1203 | local_flush_icache_range(ebase + 0x200, ebase + 0x204); |
1204 | } | 1204 | } |
1205 | return (void *)old_handler; | 1205 | return (void *)old_handler; |
1206 | } | 1206 | } |
@@ -1283,7 +1283,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
1283 | *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); | 1283 | *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); |
1284 | w = (u32 *)(b + ori_offset); | 1284 | w = (u32 *)(b + ori_offset); |
1285 | *w = (*w & 0xffff0000) | ((u32)handler & 0xffff); | 1285 | *w = (*w & 0xffff0000) | ((u32)handler & 0xffff); |
1286 | flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len)); | 1286 | local_flush_icache_range((unsigned long)b, |
1287 | (unsigned long)(b+handler_len)); | ||
1287 | } | 1288 | } |
1288 | else { | 1289 | else { |
1289 | /* | 1290 | /* |
@@ -1295,7 +1296,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
1295 | w = (u32 *)b; | 1296 | w = (u32 *)b; |
1296 | *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */ | 1297 | *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */ |
1297 | *w = 0; | 1298 | *w = 0; |
1298 | flush_icache_range((unsigned long)b, (unsigned long)(b+8)); | 1299 | local_flush_icache_range((unsigned long)b, |
1300 | (unsigned long)(b+8)); | ||
1299 | } | 1301 | } |
1300 | 1302 | ||
1301 | return (void *)old_handler; | 1303 | return (void *)old_handler; |
@@ -1515,7 +1517,7 @@ void __cpuinit per_cpu_trap_init(void) | |||
1515 | void __init set_handler(unsigned long offset, void *addr, unsigned long size) | 1517 | void __init set_handler(unsigned long offset, void *addr, unsigned long size) |
1516 | { | 1518 | { |
1517 | memcpy((void *)(ebase + offset), addr, size); | 1519 | memcpy((void *)(ebase + offset), addr, size); |
1518 | flush_icache_range(ebase + offset, ebase + offset + size); | 1520 | local_flush_icache_range(ebase + offset, ebase + offset + size); |
1519 | } | 1521 | } |
1520 | 1522 | ||
1521 | static char panic_null_cerr[] __cpuinitdata = | 1523 | static char panic_null_cerr[] __cpuinitdata = |
@@ -1680,6 +1682,8 @@ void __init trap_init(void) | |||
1680 | signal32_init(); | 1682 | signal32_init(); |
1681 | #endif | 1683 | #endif |
1682 | 1684 | ||
1683 | flush_icache_range(ebase, ebase + 0x400); | 1685 | local_flush_icache_range(ebase, ebase + 0x400); |
1684 | flush_tlb_handlers(); | 1686 | flush_tlb_handlers(); |
1687 | |||
1688 | sort_extable(__start___dbe_table, __stop___dbe_table); | ||
1685 | } | 1689 | } |
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c index 27a5b466c85c..5500c20c79ae 100644 --- a/arch/mips/mm/c-r3k.c +++ b/arch/mips/mm/c-r3k.c | |||
@@ -320,6 +320,7 @@ void __cpuinit r3k_cache_init(void) | |||
320 | flush_cache_range = r3k_flush_cache_range; | 320 | flush_cache_range = r3k_flush_cache_range; |
321 | flush_cache_page = r3k_flush_cache_page; | 321 | flush_cache_page = r3k_flush_cache_page; |
322 | flush_icache_range = r3k_flush_icache_range; | 322 | flush_icache_range = r3k_flush_icache_range; |
323 | local_flush_icache_range = r3k_flush_icache_range; | ||
323 | 324 | ||
324 | flush_cache_sigtramp = r3k_flush_cache_sigtramp; | 325 | flush_cache_sigtramp = r3k_flush_cache_sigtramp; |
325 | local_flush_data_cache_page = local_r3k_flush_data_cache_page; | 326 | local_flush_data_cache_page = local_r3k_flush_data_cache_page; |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 71df3390c07b..6e99665ae860 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -543,12 +543,8 @@ struct flush_icache_range_args { | |||
543 | unsigned long end; | 543 | unsigned long end; |
544 | }; | 544 | }; |
545 | 545 | ||
546 | static inline void local_r4k_flush_icache_range(void *args) | 546 | static inline void local_r4k_flush_icache_range(unsigned long start, unsigned long end) |
547 | { | 547 | { |
548 | struct flush_icache_range_args *fir_args = args; | ||
549 | unsigned long start = fir_args->start; | ||
550 | unsigned long end = fir_args->end; | ||
551 | |||
552 | if (!cpu_has_ic_fills_f_dc) { | 548 | if (!cpu_has_ic_fills_f_dc) { |
553 | if (end - start >= dcache_size) { | 549 | if (end - start >= dcache_size) { |
554 | r4k_blast_dcache(); | 550 | r4k_blast_dcache(); |
@@ -564,6 +560,15 @@ static inline void local_r4k_flush_icache_range(void *args) | |||
564 | protected_blast_icache_range(start, end); | 560 | protected_blast_icache_range(start, end); |
565 | } | 561 | } |
566 | 562 | ||
563 | static inline void local_r4k_flush_icache_range_ipi(void *args) | ||
564 | { | ||
565 | struct flush_icache_range_args *fir_args = args; | ||
566 | unsigned long start = fir_args->start; | ||
567 | unsigned long end = fir_args->end; | ||
568 | |||
569 | local_r4k_flush_icache_range(start, end); | ||
570 | } | ||
571 | |||
567 | static void r4k_flush_icache_range(unsigned long start, unsigned long end) | 572 | static void r4k_flush_icache_range(unsigned long start, unsigned long end) |
568 | { | 573 | { |
569 | struct flush_icache_range_args args; | 574 | struct flush_icache_range_args args; |
@@ -571,7 +576,7 @@ static void r4k_flush_icache_range(unsigned long start, unsigned long end) | |||
571 | args.start = start; | 576 | args.start = start; |
572 | args.end = end; | 577 | args.end = end; |
573 | 578 | ||
574 | r4k_on_each_cpu(local_r4k_flush_icache_range, &args, 1); | 579 | r4k_on_each_cpu(local_r4k_flush_icache_range_ipi, &args, 1); |
575 | instruction_hazard(); | 580 | instruction_hazard(); |
576 | } | 581 | } |
577 | 582 | ||
@@ -1375,6 +1380,7 @@ void __cpuinit r4k_cache_init(void) | |||
1375 | local_flush_data_cache_page = local_r4k_flush_data_cache_page; | 1380 | local_flush_data_cache_page = local_r4k_flush_data_cache_page; |
1376 | flush_data_cache_page = r4k_flush_data_cache_page; | 1381 | flush_data_cache_page = r4k_flush_data_cache_page; |
1377 | flush_icache_range = r4k_flush_icache_range; | 1382 | flush_icache_range = r4k_flush_icache_range; |
1383 | local_flush_icache_range = local_r4k_flush_icache_range; | ||
1378 | 1384 | ||
1379 | #if defined(CONFIG_DMA_NONCOHERENT) | 1385 | #if defined(CONFIG_DMA_NONCOHERENT) |
1380 | if (coherentio) { | 1386 | if (coherentio) { |
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c index a9f7f1f5e9b4..f7c8f9ce39c1 100644 --- a/arch/mips/mm/c-tx39.c +++ b/arch/mips/mm/c-tx39.c | |||
@@ -362,6 +362,7 @@ void __cpuinit tx39_cache_init(void) | |||
362 | flush_cache_range = (void *) tx39h_flush_icache_all; | 362 | flush_cache_range = (void *) tx39h_flush_icache_all; |
363 | flush_cache_page = (void *) tx39h_flush_icache_all; | 363 | flush_cache_page = (void *) tx39h_flush_icache_all; |
364 | flush_icache_range = (void *) tx39h_flush_icache_all; | 364 | flush_icache_range = (void *) tx39h_flush_icache_all; |
365 | local_flush_icache_range = (void *) tx39h_flush_icache_all; | ||
365 | 366 | ||
366 | flush_cache_sigtramp = (void *) tx39h_flush_icache_all; | 367 | flush_cache_sigtramp = (void *) tx39h_flush_icache_all; |
367 | local_flush_data_cache_page = (void *) tx39h_flush_icache_all; | 368 | local_flush_data_cache_page = (void *) tx39h_flush_icache_all; |
@@ -390,6 +391,7 @@ void __cpuinit tx39_cache_init(void) | |||
390 | flush_cache_range = tx39_flush_cache_range; | 391 | flush_cache_range = tx39_flush_cache_range; |
391 | flush_cache_page = tx39_flush_cache_page; | 392 | flush_cache_page = tx39_flush_cache_page; |
392 | flush_icache_range = tx39_flush_icache_range; | 393 | flush_icache_range = tx39_flush_icache_range; |
394 | local_flush_icache_range = tx39_flush_icache_range; | ||
393 | 395 | ||
394 | flush_cache_sigtramp = tx39_flush_cache_sigtramp; | 396 | flush_cache_sigtramp = tx39_flush_cache_sigtramp; |
395 | local_flush_data_cache_page = local_tx39_flush_data_cache_page; | 397 | local_flush_data_cache_page = local_tx39_flush_data_cache_page; |
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 034e8506f6ea..1eb7c71e3d6a 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -29,6 +29,7 @@ void (*flush_cache_range)(struct vm_area_struct *vma, unsigned long start, | |||
29 | void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, | 29 | void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, |
30 | unsigned long pfn); | 30 | unsigned long pfn); |
31 | void (*flush_icache_range)(unsigned long start, unsigned long end); | 31 | void (*flush_icache_range)(unsigned long start, unsigned long end); |
32 | void (*local_flush_icache_range)(unsigned long start, unsigned long end); | ||
32 | 33 | ||
33 | void (*__flush_cache_vmap)(void); | 34 | void (*__flush_cache_vmap)(void); |
34 | void (*__flush_cache_vunmap)(void); | 35 | void (*__flush_cache_vunmap)(void); |
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 76da73a5ab3c..979cf9197282 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -1273,10 +1273,10 @@ void __cpuinit build_tlb_refill_handler(void) | |||
1273 | 1273 | ||
1274 | void __cpuinit flush_tlb_handlers(void) | 1274 | void __cpuinit flush_tlb_handlers(void) |
1275 | { | 1275 | { |
1276 | flush_icache_range((unsigned long)handle_tlbl, | 1276 | local_flush_icache_range((unsigned long)handle_tlbl, |
1277 | (unsigned long)handle_tlbl + sizeof(handle_tlbl)); | 1277 | (unsigned long)handle_tlbl + sizeof(handle_tlbl)); |
1278 | flush_icache_range((unsigned long)handle_tlbs, | 1278 | local_flush_icache_range((unsigned long)handle_tlbs, |
1279 | (unsigned long)handle_tlbs + sizeof(handle_tlbs)); | 1279 | (unsigned long)handle_tlbs + sizeof(handle_tlbs)); |
1280 | flush_icache_range((unsigned long)handle_tlbm, | 1280 | local_flush_icache_range((unsigned long)handle_tlbm, |
1281 | (unsigned long)handle_tlbm + sizeof(handle_tlbm)); | 1281 | (unsigned long)handle_tlbm + sizeof(handle_tlbm)); |
1282 | } | 1282 | } |
diff --git a/arch/mips/sgi-ip22/ip22-platform.c b/arch/mips/sgi-ip22/ip22-platform.c index 60141235ec40..52486c4d2b01 100644 --- a/arch/mips/sgi-ip22/ip22-platform.c +++ b/arch/mips/sgi-ip22/ip22-platform.c | |||
@@ -150,7 +150,7 @@ static int __init sgiseeq_devinit(void) | |||
150 | return res; | 150 | return res; |
151 | 151 | ||
152 | /* Second HPC is missing? */ | 152 | /* Second HPC is missing? */ |
153 | if (!ip22_is_fullhouse() || | 153 | if (ip22_is_fullhouse() || |
154 | get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1])) | 154 | get_dbe(tmp, (unsigned int *)&hpc3c1->pbdma[1])) |
155 | return 0; | 155 | return 0; |
156 | 156 | ||
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index 0afe94c48fb6..fe6bee09cece 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c | |||
@@ -53,6 +53,7 @@ txx9_reg_res_init(unsigned int pcode, unsigned long base, unsigned long size) | |||
53 | txx9_ce_res[i].name = txx9_ce_res_name[i]; | 53 | txx9_ce_res[i].name = txx9_ce_res_name[i]; |
54 | } | 54 | } |
55 | 55 | ||
56 | txx9_pcode = pcode; | ||
56 | sprintf(txx9_pcode_str, "TX%x", pcode); | 57 | sprintf(txx9_pcode_str, "TX%x", pcode); |
57 | if (base) { | 58 | if (base) { |
58 | txx9_reg_res.start = base & 0xfffffffffULL; | 59 | txx9_reg_res.start = base & 0xfffffffffULL; |
diff --git a/arch/mips/vr41xx/common/irq.c b/arch/mips/vr41xx/common/irq.c index cba36a247e32..92dd1a0ca352 100644 --- a/arch/mips/vr41xx/common/irq.c +++ b/arch/mips/vr41xx/common/irq.c | |||
@@ -72,6 +72,7 @@ static void irq_dispatch(unsigned int irq) | |||
72 | cascade = irq_cascade + irq; | 72 | cascade = irq_cascade + irq; |
73 | if (cascade->get_irq != NULL) { | 73 | if (cascade->get_irq != NULL) { |
74 | unsigned int source_irq = irq; | 74 | unsigned int source_irq = irq; |
75 | int ret; | ||
75 | desc = irq_desc + source_irq; | 76 | desc = irq_desc + source_irq; |
76 | if (desc->chip->mask_ack) | 77 | if (desc->chip->mask_ack) |
77 | desc->chip->mask_ack(source_irq); | 78 | desc->chip->mask_ack(source_irq); |
@@ -79,8 +80,9 @@ static void irq_dispatch(unsigned int irq) | |||
79 | desc->chip->mask(source_irq); | 80 | desc->chip->mask(source_irq); |
80 | desc->chip->ack(source_irq); | 81 | desc->chip->ack(source_irq); |
81 | } | 82 | } |
82 | irq = cascade->get_irq(irq); | 83 | ret = cascade->get_irq(irq); |
83 | if (irq < 0) | 84 | irq = ret; |
85 | if (ret < 0) | ||
84 | atomic_inc(&irq_err_count); | 86 | atomic_inc(&irq_err_count); |
85 | else | 87 | else |
86 | irq_dispatch(irq); | 88 | irq_dispatch(irq); |
diff --git a/arch/mn10300/mm/fault.c b/arch/mn10300/mm/fault.c index 78f092ca0316..33cf25025dac 100644 --- a/arch/mn10300/mm/fault.c +++ b/arch/mn10300/mm/fault.c | |||
@@ -174,7 +174,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long fault_code, | |||
174 | * If we're in an interrupt or have no user | 174 | * If we're in an interrupt or have no user |
175 | * context, we must not take the fault.. | 175 | * context, we must not take the fault.. |
176 | */ | 176 | */ |
177 | if (in_interrupt() || !mm) | 177 | if (in_atomic() || !mm) |
178 | goto no_context; | 178 | goto no_context; |
179 | 179 | ||
180 | down_read(&mm->mmap_sem); | 180 | down_read(&mm->mmap_sem); |
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 69ff671498e5..12c04c5e558b 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -104,7 +104,7 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
104 | buf->count -= reclen; | 104 | buf->count -= reclen; |
105 | return 0; | 105 | return 0; |
106 | Efault: | 106 | Efault: |
107 | buffer->error = -EFAULT; | 107 | buf->error = -EFAULT; |
108 | return -EFAULT; | 108 | return -EFAULT; |
109 | } | 109 | } |
110 | 110 | ||
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index fdacdd4341c9..44138c3e6ea7 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -47,7 +47,9 @@ | |||
47 | #include <linux/string.h> | 47 | #include <linux/string.h> |
48 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
49 | #include <linux/bug.h> | 49 | #include <linux/bug.h> |
50 | #include <linux/uaccess.h> | ||
50 | 51 | ||
52 | #include <asm/sections.h> | ||
51 | #include <asm/unwind.h> | 53 | #include <asm/unwind.h> |
52 | 54 | ||
53 | #if 0 | 55 | #if 0 |
@@ -860,3 +862,15 @@ void module_arch_cleanup(struct module *mod) | |||
860 | deregister_unwind_table(mod); | 862 | deregister_unwind_table(mod); |
861 | module_bug_cleanup(mod); | 863 | module_bug_cleanup(mod); |
862 | } | 864 | } |
865 | |||
866 | #ifdef CONFIG_64BIT | ||
867 | void *dereference_function_descriptor(void *ptr) | ||
868 | { | ||
869 | Elf64_Fdesc *desc = ptr; | ||
870 | void *p; | ||
871 | |||
872 | if (!probe_kernel_address(&desc->addr, p)) | ||
873 | ptr = p; | ||
874 | return ptr; | ||
875 | } | ||
876 | #endif | ||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 9155c9312c1e..c6be19e9ceae 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -116,6 +116,11 @@ ifeq ($(CONFIG_6xx),y) | |||
116 | KBUILD_CFLAGS += -mcpu=powerpc | 116 | KBUILD_CFLAGS += -mcpu=powerpc |
117 | endif | 117 | endif |
118 | 118 | ||
119 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. | ||
120 | ifeq ($(CONFIG_FTRACE),y) | ||
121 | KBUILD_CFLAGS += -mno-sched-epilog | ||
122 | endif | ||
123 | |||
119 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 | 124 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 |
120 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec | 125 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec |
121 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec | 126 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 14174aa24074..65d1a8454d2c 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -49,7 +49,7 @@ zlib := inffast.c inflate.c inftrees.c | |||
49 | zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h | 49 | zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h |
50 | zliblinuxheader := zlib.h zconf.h zutil.h | 50 | zliblinuxheader := zlib.h zconf.h zutil.h |
51 | 51 | ||
52 | $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ | 52 | $(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \ |
53 | $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) | 53 | $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) |
54 | 54 | ||
55 | src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c | 55 | src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c |
@@ -195,7 +195,7 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries | |||
195 | image-$(CONFIG_PPC_CHRP) += zImage.chrp | 195 | image-$(CONFIG_PPC_CHRP) += zImage.chrp |
196 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp | 196 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp |
197 | image-$(CONFIG_PPC_PMAC) += zImage.pmac | 197 | image-$(CONFIG_PPC_PMAC) += zImage.pmac |
198 | image-$(CONFIG_PPC_HOLLY) += zImage.holly | 198 | image-$(CONFIG_PPC_HOLLY) += dtbImage.holly |
199 | image-$(CONFIG_PPC_PRPMC2800) += dtbImage.prpmc2800 | 199 | image-$(CONFIG_PPC_PRPMC2800) += dtbImage.prpmc2800 |
200 | image-$(CONFIG_PPC_ISERIES) += zImage.iseries | 200 | image-$(CONFIG_PPC_ISERIES) += zImage.iseries |
201 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage | 201 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage |
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts index 3b3a1062cb25..584a4f184eb2 100644 --- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts +++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts | |||
@@ -281,7 +281,7 @@ | |||
281 | cell-index = <0>; | 281 | cell-index = <0>; |
282 | reg = <0x0 0x80>; | 282 | reg = <0x0 0x80>; |
283 | interrupt-parent = <&mpic>; | 283 | interrupt-parent = <&mpic>; |
284 | interrupts = <60 2>; | 284 | interrupts = <76 2>; |
285 | }; | 285 | }; |
286 | dma-channel@1 { | 286 | dma-channel@1 { |
287 | compatible = "fsl,mpc8610-dma-channel", | 287 | compatible = "fsl,mpc8610-dma-channel", |
@@ -289,7 +289,7 @@ | |||
289 | cell-index = <1>; | 289 | cell-index = <1>; |
290 | reg = <0x80 0x80>; | 290 | reg = <0x80 0x80>; |
291 | interrupt-parent = <&mpic>; | 291 | interrupt-parent = <&mpic>; |
292 | interrupts = <61 2>; | 292 | interrupts = <77 2>; |
293 | }; | 293 | }; |
294 | dma-channel@2 { | 294 | dma-channel@2 { |
295 | compatible = "fsl,mpc8610-dma-channel", | 295 | compatible = "fsl,mpc8610-dma-channel", |
@@ -297,7 +297,7 @@ | |||
297 | cell-index = <2>; | 297 | cell-index = <2>; |
298 | reg = <0x100 0x80>; | 298 | reg = <0x100 0x80>; |
299 | interrupt-parent = <&mpic>; | 299 | interrupt-parent = <&mpic>; |
300 | interrupts = <62 2>; | 300 | interrupts = <78 2>; |
301 | }; | 301 | }; |
302 | dma-channel@3 { | 302 | dma-channel@3 { |
303 | compatible = "fsl,mpc8610-dma-channel", | 303 | compatible = "fsl,mpc8610-dma-channel", |
@@ -305,7 +305,7 @@ | |||
305 | cell-index = <3>; | 305 | cell-index = <3>; |
306 | reg = <0x180 0x80>; | 306 | reg = <0x180 0x80>; |
307 | interrupt-parent = <&mpic>; | 307 | interrupt-parent = <&mpic>; |
308 | interrupts = <63 2>; | 308 | interrupts = <79 2>; |
309 | }; | 309 | }; |
310 | }; | 310 | }; |
311 | 311 | ||
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index 80d1f399ee51..64c6ee22eefd 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h | |||
@@ -409,6 +409,13 @@ do { \ | |||
409 | /* Keep this the last entry. */ | 409 | /* Keep this the last entry. */ |
410 | #define R_PPC64_NUM 107 | 410 | #define R_PPC64_NUM 107 |
411 | 411 | ||
412 | /* There's actually a third entry here, but it's unused */ | ||
413 | struct ppc64_opd_entry | ||
414 | { | ||
415 | unsigned long funcaddr; | ||
416 | unsigned long r2; | ||
417 | }; | ||
418 | |||
412 | #ifdef __KERNEL__ | 419 | #ifdef __KERNEL__ |
413 | 420 | ||
414 | #ifdef CONFIG_SPU_BASE | 421 | #ifdef CONFIG_SPU_BASE |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index db0b8f3b8807..4597c491e9b5 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -153,12 +153,10 @@ | |||
153 | #define __S110 PAGE_SHARED_X | 153 | #define __S110 PAGE_SHARED_X |
154 | #define __S111 PAGE_SHARED_X | 154 | #define __S111 PAGE_SHARED_X |
155 | 155 | ||
156 | #ifdef CONFIG_HUGETLB_PAGE | 156 | #ifdef CONFIG_PPC_MM_SLICES |
157 | |||
158 | #define HAVE_ARCH_UNMAPPED_AREA | 157 | #define HAVE_ARCH_UNMAPPED_AREA |
159 | #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN | 158 | #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN |
160 | 159 | #endif /* CONFIG_PPC_MM_SLICES */ | |
161 | #endif | ||
162 | 160 | ||
163 | #ifndef __ASSEMBLY__ | 161 | #ifndef __ASSEMBLY__ |
164 | 162 | ||
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index 916018e425c4..07956f3e7844 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ASM_POWERPC_SECTIONS_H | 2 | #define _ASM_POWERPC_SECTIONS_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/elf.h> | ||
6 | #include <linux/uaccess.h> | ||
5 | #include <asm-generic/sections.h> | 7 | #include <asm-generic/sections.h> |
6 | 8 | ||
7 | #ifdef __powerpc64__ | 9 | #ifdef __powerpc64__ |
@@ -16,6 +18,17 @@ static inline int in_kernel_text(unsigned long addr) | |||
16 | return 0; | 18 | return 0; |
17 | } | 19 | } |
18 | 20 | ||
21 | #undef dereference_function_descriptor | ||
22 | static inline void *dereference_function_descriptor(void *ptr) | ||
23 | { | ||
24 | struct ppc64_opd_entry *desc = ptr; | ||
25 | void *p; | ||
26 | |||
27 | if (!probe_kernel_address(&desc->funcaddr, p)) | ||
28 | ptr = p; | ||
29 | return ptr; | ||
30 | } | ||
31 | |||
19 | #endif | 32 | #endif |
20 | 33 | ||
21 | #endif /* __KERNEL__ */ | 34 | #endif /* __KERNEL__ */ |
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 64f5948ebc9d..946daea780f1 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -14,12 +14,13 @@ endif | |||
14 | 14 | ||
15 | ifdef CONFIG_FTRACE | 15 | ifdef CONFIG_FTRACE |
16 | # Do not trace early boot code | 16 | # Do not trace early boot code |
17 | CFLAGS_REMOVE_cputable.o = -pg | 17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog |
18 | CFLAGS_REMOVE_prom_init.o = -pg | 18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog |
19 | CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog | ||
19 | 20 | ||
20 | ifdef CONFIG_DYNAMIC_FTRACE | 21 | ifdef CONFIG_DYNAMIC_FTRACE |
21 | # dynamic ftrace setup. | 22 | # dynamic ftrace setup. |
22 | CFLAGS_REMOVE_ftrace.o = -pg | 23 | CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog |
23 | endif | 24 | endif |
24 | 25 | ||
25 | endif | 26 | endif |
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 367129789cc0..5af4e9b2dbe2 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
@@ -647,7 +647,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, | |||
647 | unsigned int flags, unsigned int length) | 647 | unsigned int flags, unsigned int length) |
648 | { | 648 | { |
649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); |
650 | int ret; | 650 | int ret = 0; |
651 | 651 | ||
652 | flush_vsx_to_thread(current); | 652 | flush_vsx_to_thread(current); |
653 | 653 | ||
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S index 019b02d8844f..15c611de1ee2 100644 --- a/arch/powerpc/kernel/idle_6xx.S +++ b/arch/powerpc/kernel/idle_6xx.S | |||
@@ -158,7 +158,7 @@ _GLOBAL(power_save_ppc32_restore) | |||
158 | stw r9,_NIP(r11) /* make it do a blr */ | 158 | stw r9,_NIP(r11) /* make it do a blr */ |
159 | 159 | ||
160 | #ifdef CONFIG_SMP | 160 | #ifdef CONFIG_SMP |
161 | mfspr r12,SPRN_SPRG3 | 161 | rlwinm r12,r11,0,0,31-THREAD_SHIFT |
162 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ | 162 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ |
163 | slwi r11,r11,2 | 163 | slwi r11,r11,2 |
164 | #else | 164 | #else |
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S index 06304034b393..47a1a983ff88 100644 --- a/arch/powerpc/kernel/idle_e500.S +++ b/arch/powerpc/kernel/idle_e500.S | |||
@@ -84,10 +84,11 @@ _GLOBAL(power_save_ppc32_restore) | |||
84 | stw r9,_NIP(r11) /* make it do a blr */ | 84 | stw r9,_NIP(r11) /* make it do a blr */ |
85 | 85 | ||
86 | #ifdef CONFIG_SMP | 86 | #ifdef CONFIG_SMP |
87 | mfspr r12,SPRN_SPRG3 | 87 | rlwinm r12,r1,0,0,31-THREAD_SHIFT |
88 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ | 88 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ |
89 | slwi r11,r11,2 | 89 | slwi r11,r11,2 |
90 | #else | 90 | #else |
91 | li r11,0 | 91 | li r11,0 |
92 | #endif | 92 | #endif |
93 | |||
93 | b transfer_to_handler_cont | 94 | b transfer_to_handler_cont |
diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c index ee6a2982d567..1af2377e4992 100644 --- a/arch/powerpc/kernel/module_64.c +++ b/arch/powerpc/kernel/module_64.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/vmalloc.h> | 22 | #include <linux/vmalloc.h> |
23 | #include <linux/bug.h> | 23 | #include <linux/bug.h> |
24 | #include <asm/module.h> | 24 | #include <asm/module.h> |
25 | #include <asm/uaccess.h> | ||
26 | #include <asm/firmware.h> | 25 | #include <asm/firmware.h> |
27 | #include <asm/code-patching.h> | 26 | #include <asm/code-patching.h> |
28 | #include <linux/sort.h> | 27 | #include <linux/sort.h> |
@@ -42,13 +41,6 @@ | |||
42 | #define DEBUGP(fmt , ...) | 41 | #define DEBUGP(fmt , ...) |
43 | #endif | 42 | #endif |
44 | 43 | ||
45 | /* There's actually a third entry here, but it's unused */ | ||
46 | struct ppc64_opd_entry | ||
47 | { | ||
48 | unsigned long funcaddr; | ||
49 | unsigned long r2; | ||
50 | }; | ||
51 | |||
52 | /* Like PPC32, we need little trampolines to do > 24-bit jumps (into | 44 | /* Like PPC32, we need little trampolines to do > 24-bit jumps (into |
53 | the kernel itself). But on PPC64, these need to be used for every | 45 | the kernel itself). But on PPC64, these need to be used for every |
54 | jump, actually, to reset r2 (TOC+0x8000). */ | 46 | jump, actually, to reset r2 (TOC+0x8000). */ |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 4a8ce62fe112..9f6c1ca1739e 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -66,11 +66,12 @@ SECTIONS | |||
66 | __got2_end = .; | 66 | __got2_end = .; |
67 | #endif /* CONFIG_PPC32 */ | 67 | #endif /* CONFIG_PPC32 */ |
68 | 68 | ||
69 | . = ALIGN(PAGE_SIZE); | ||
70 | _etext = .; | ||
71 | PROVIDE32 (etext = .); | ||
72 | } :kernel | 69 | } :kernel |
73 | 70 | ||
71 | . = ALIGN(PAGE_SIZE); | ||
72 | _etext = .; | ||
73 | PROVIDE32 (etext = .); | ||
74 | |||
74 | /* Read-only data */ | 75 | /* Read-only data */ |
75 | RODATA | 76 | RODATA |
76 | 77 | ||
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 14be408dfc9b..8920eea34528 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -191,12 +191,17 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
191 | unsigned long hash, hpteg; | 191 | unsigned long hash, hpteg; |
192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); | 192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); |
193 | unsigned long va = hpt_va(vaddr, vsid, ssize); | 193 | unsigned long va = hpt_va(vaddr, vsid, ssize); |
194 | unsigned long tprot = prot; | ||
195 | |||
196 | /* Make kernel text executable */ | ||
197 | if (in_kernel_text(vaddr)) | ||
198 | tprot &= ~HPTE_R_N; | ||
194 | 199 | ||
195 | hash = hpt_hash(va, shift, ssize); | 200 | hash = hpt_hash(va, shift, ssize); |
196 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); | 201 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); |
197 | 202 | ||
198 | BUG_ON(!ppc_md.hpte_insert); | 203 | BUG_ON(!ppc_md.hpte_insert); |
199 | ret = ppc_md.hpte_insert(hpteg, va, paddr, prot, | 204 | ret = ppc_md.hpte_insert(hpteg, va, paddr, tprot, |
200 | HPTE_V_BOLTED, psize, ssize); | 205 | HPTE_V_BOLTED, psize, ssize); |
201 | 206 | ||
202 | if (ret < 0) | 207 | if (ret < 0) |
@@ -584,7 +589,7 @@ void __init htab_initialize(void) | |||
584 | { | 589 | { |
585 | unsigned long table; | 590 | unsigned long table; |
586 | unsigned long pteg_count; | 591 | unsigned long pteg_count; |
587 | unsigned long prot, tprot; | 592 | unsigned long prot; |
588 | unsigned long base = 0, size = 0, limit; | 593 | unsigned long base = 0, size = 0, limit; |
589 | int i; | 594 | int i; |
590 | 595 | ||
@@ -660,10 +665,9 @@ void __init htab_initialize(void) | |||
660 | for (i=0; i < lmb.memory.cnt; i++) { | 665 | for (i=0; i < lmb.memory.cnt; i++) { |
661 | base = (unsigned long)__va(lmb.memory.region[i].base); | 666 | base = (unsigned long)__va(lmb.memory.region[i].base); |
662 | size = lmb.memory.region[i].size; | 667 | size = lmb.memory.region[i].size; |
663 | tprot = prot | (in_kernel_text(base) ? _PAGE_EXEC : 0); | ||
664 | 668 | ||
665 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", | 669 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", |
666 | base, size, tprot); | 670 | base, size, prot); |
667 | 671 | ||
668 | #ifdef CONFIG_U3_DART | 672 | #ifdef CONFIG_U3_DART |
669 | /* Do not map the DART space. Fortunately, it will be aligned | 673 | /* Do not map the DART space. Fortunately, it will be aligned |
@@ -680,21 +684,21 @@ void __init htab_initialize(void) | |||
680 | unsigned long dart_table_end = dart_tablebase + 16 * MB; | 684 | unsigned long dart_table_end = dart_tablebase + 16 * MB; |
681 | if (base != dart_tablebase) | 685 | if (base != dart_tablebase) |
682 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, | 686 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, |
683 | __pa(base), tprot, | 687 | __pa(base), prot, |
684 | mmu_linear_psize, | 688 | mmu_linear_psize, |
685 | mmu_kernel_ssize)); | 689 | mmu_kernel_ssize)); |
686 | if ((base + size) > dart_table_end) | 690 | if ((base + size) > dart_table_end) |
687 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, | 691 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, |
688 | base + size, | 692 | base + size, |
689 | __pa(dart_table_end), | 693 | __pa(dart_table_end), |
690 | tprot, | 694 | prot, |
691 | mmu_linear_psize, | 695 | mmu_linear_psize, |
692 | mmu_kernel_ssize)); | 696 | mmu_kernel_ssize)); |
693 | continue; | 697 | continue; |
694 | } | 698 | } |
695 | #endif /* CONFIG_U3_DART */ | 699 | #endif /* CONFIG_U3_DART */ |
696 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), | 700 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), |
697 | tprot, mmu_linear_psize, mmu_kernel_ssize)); | 701 | prot, mmu_linear_psize, mmu_kernel_ssize)); |
698 | } | 702 | } |
699 | 703 | ||
700 | /* | 704 | /* |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 1c1b627ee843..67595bc380dc 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -643,9 +643,10 @@ static struct spu *find_victim(struct spu_context *ctx) | |||
643 | !(tmp->flags & SPU_CREATE_NOSCHED) && | 643 | !(tmp->flags & SPU_CREATE_NOSCHED) && |
644 | (!victim || tmp->prio > victim->prio)) { | 644 | (!victim || tmp->prio > victim->prio)) { |
645 | victim = spu->ctx; | 645 | victim = spu->ctx; |
646 | get_spu_context(victim); | ||
647 | } | 646 | } |
648 | } | 647 | } |
648 | if (victim) | ||
649 | get_spu_context(victim); | ||
649 | mutex_unlock(&cbe_spu_info[node].list_mutex); | 650 | mutex_unlock(&cbe_spu_info[node].list_mutex); |
650 | 651 | ||
651 | if (victim) { | 652 | if (victim) { |
@@ -727,17 +728,33 @@ static void spu_schedule(struct spu *spu, struct spu_context *ctx) | |||
727 | /* not a candidate for interruptible because it's called either | 728 | /* not a candidate for interruptible because it's called either |
728 | from the scheduler thread or from spu_deactivate */ | 729 | from the scheduler thread or from spu_deactivate */ |
729 | mutex_lock(&ctx->state_mutex); | 730 | mutex_lock(&ctx->state_mutex); |
730 | __spu_schedule(spu, ctx); | 731 | if (ctx->state == SPU_STATE_SAVED) |
732 | __spu_schedule(spu, ctx); | ||
731 | spu_release(ctx); | 733 | spu_release(ctx); |
732 | } | 734 | } |
733 | 735 | ||
734 | static void spu_unschedule(struct spu *spu, struct spu_context *ctx) | 736 | /** |
737 | * spu_unschedule - remove a context from a spu, and possibly release it. | ||
738 | * @spu: The SPU to unschedule from | ||
739 | * @ctx: The context currently scheduled on the SPU | ||
740 | * @free_spu Whether to free the SPU for other contexts | ||
741 | * | ||
742 | * Unbinds the context @ctx from the SPU @spu. If @free_spu is non-zero, the | ||
743 | * SPU is made available for other contexts (ie, may be returned by | ||
744 | * spu_get_idle). If this is zero, the caller is expected to schedule another | ||
745 | * context to this spu. | ||
746 | * | ||
747 | * Should be called with ctx->state_mutex held. | ||
748 | */ | ||
749 | static void spu_unschedule(struct spu *spu, struct spu_context *ctx, | ||
750 | int free_spu) | ||
735 | { | 751 | { |
736 | int node = spu->node; | 752 | int node = spu->node; |
737 | 753 | ||
738 | mutex_lock(&cbe_spu_info[node].list_mutex); | 754 | mutex_lock(&cbe_spu_info[node].list_mutex); |
739 | cbe_spu_info[node].nr_active--; | 755 | cbe_spu_info[node].nr_active--; |
740 | spu->alloc_state = SPU_FREE; | 756 | if (free_spu) |
757 | spu->alloc_state = SPU_FREE; | ||
741 | spu_unbind_context(spu, ctx); | 758 | spu_unbind_context(spu, ctx); |
742 | ctx->stats.invol_ctx_switch++; | 759 | ctx->stats.invol_ctx_switch++; |
743 | spu->stats.invol_ctx_switch++; | 760 | spu->stats.invol_ctx_switch++; |
@@ -837,7 +854,7 @@ static int __spu_deactivate(struct spu_context *ctx, int force, int max_prio) | |||
837 | if (spu) { | 854 | if (spu) { |
838 | new = grab_runnable_context(max_prio, spu->node); | 855 | new = grab_runnable_context(max_prio, spu->node); |
839 | if (new || force) { | 856 | if (new || force) { |
840 | spu_unschedule(spu, ctx); | 857 | spu_unschedule(spu, ctx, new == NULL); |
841 | if (new) { | 858 | if (new) { |
842 | if (new->flags & SPU_CREATE_NOSCHED) | 859 | if (new->flags & SPU_CREATE_NOSCHED) |
843 | wake_up(&new->stop_wq); | 860 | wake_up(&new->stop_wq); |
@@ -910,7 +927,7 @@ static noinline void spusched_tick(struct spu_context *ctx) | |||
910 | 927 | ||
911 | new = grab_runnable_context(ctx->prio + 1, spu->node); | 928 | new = grab_runnable_context(ctx->prio + 1, spu->node); |
912 | if (new) { | 929 | if (new) { |
913 | spu_unschedule(spu, ctx); | 930 | spu_unschedule(spu, ctx, 0); |
914 | if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) | 931 | if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) |
915 | spu_add_to_rq(ctx); | 932 | spu_add_to_rq(ctx); |
916 | } else { | 933 | } else { |
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile index 58ecdd72630f..be60d64be7ad 100644 --- a/arch/powerpc/platforms/powermac/Makefile +++ b/arch/powerpc/platforms/powermac/Makefile | |||
@@ -2,7 +2,7 @@ CFLAGS_bootx_init.o += -fPIC | |||
2 | 2 | ||
3 | ifdef CONFIG_FTRACE | 3 | ifdef CONFIG_FTRACE |
4 | # Do not trace early boot code | 4 | # Do not trace early boot code |
5 | CFLAGS_REMOVE_bootx_init.o = -pg | 5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog |
6 | endif | 6 | endif |
7 | 7 | ||
8 | obj-y += pic.o setup.o time.o feature.o pci.o \ | 8 | obj-y += pic.o setup.o time.o feature.o pci.o \ |
diff --git a/arch/s390/kernel/compat_ptrace.h b/arch/s390/kernel/compat_ptrace.h index cde81fa64f89..a2be3a978d5c 100644 --- a/arch/s390/kernel/compat_ptrace.h +++ b/arch/s390/kernel/compat_ptrace.h | |||
@@ -42,6 +42,7 @@ struct user_regs_struct32 | |||
42 | u32 gprs[NUM_GPRS]; | 42 | u32 gprs[NUM_GPRS]; |
43 | u32 acrs[NUM_ACRS]; | 43 | u32 acrs[NUM_ACRS]; |
44 | u32 orig_gpr2; | 44 | u32 orig_gpr2; |
45 | /* nb: there's a 4-byte hole here */ | ||
45 | s390_fp_regs fp_regs; | 46 | s390_fp_regs fp_regs; |
46 | /* | 47 | /* |
47 | * These per registers are in here so that gdb can modify them | 48 | * These per registers are in here so that gdb can modify them |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 2815bfe348a6..c8b08289eb87 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -170,6 +170,13 @@ static unsigned long __peek_user(struct task_struct *child, addr_t addr) | |||
170 | */ | 170 | */ |
171 | tmp = (addr_t) task_pt_regs(child)->orig_gpr2; | 171 | tmp = (addr_t) task_pt_regs(child)->orig_gpr2; |
172 | 172 | ||
173 | } else if (addr < (addr_t) &dummy->regs.fp_regs) { | ||
174 | /* | ||
175 | * prevent reads of padding hole between | ||
176 | * orig_gpr2 and fp_regs on s390. | ||
177 | */ | ||
178 | tmp = 0; | ||
179 | |||
173 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { | 180 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { |
174 | /* | 181 | /* |
175 | * floating point regs. are stored in the thread structure | 182 | * floating point regs. are stored in the thread structure |
@@ -270,6 +277,13 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) | |||
270 | */ | 277 | */ |
271 | task_pt_regs(child)->orig_gpr2 = data; | 278 | task_pt_regs(child)->orig_gpr2 = data; |
272 | 279 | ||
280 | } else if (addr < (addr_t) &dummy->regs.fp_regs) { | ||
281 | /* | ||
282 | * prevent writes of padding hole between | ||
283 | * orig_gpr2 and fp_regs on s390. | ||
284 | */ | ||
285 | return 0; | ||
286 | |||
273 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { | 287 | } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { |
274 | /* | 288 | /* |
275 | * floating point regs. are stored in the thread structure | 289 | * floating point regs. are stored in the thread structure |
@@ -428,6 +442,13 @@ static u32 __peek_user_compat(struct task_struct *child, addr_t addr) | |||
428 | */ | 442 | */ |
429 | tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4); | 443 | tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4); |
430 | 444 | ||
445 | } else if (addr < (addr_t) &dummy32->regs.fp_regs) { | ||
446 | /* | ||
447 | * prevent reads of padding hole between | ||
448 | * orig_gpr2 and fp_regs on s390. | ||
449 | */ | ||
450 | tmp = 0; | ||
451 | |||
431 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { | 452 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { |
432 | /* | 453 | /* |
433 | * floating point regs. are stored in the thread structure | 454 | * floating point regs. are stored in the thread structure |
@@ -514,6 +535,13 @@ static int __poke_user_compat(struct task_struct *child, | |||
514 | */ | 535 | */ |
515 | *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp; | 536 | *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp; |
516 | 537 | ||
538 | } else if (addr < (addr_t) &dummy32->regs.fp_regs) { | ||
539 | /* | ||
540 | * prevent writess of padding hole between | ||
541 | * orig_gpr2 and fp_regs on s390. | ||
542 | */ | ||
543 | return 0; | ||
544 | |||
517 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { | 545 | } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { |
518 | /* | 546 | /* |
519 | * floating point regs. are stored in the thread structure | 547 | * floating point regs. are stored in the thread structure |
diff --git a/arch/sh/configs/ap325rxa_defconfig b/arch/sh/configs/ap325rxa_defconfig index 29926a9b9ce2..851c870adf3b 100644 --- a/arch/sh/configs/ap325rxa_defconfig +++ b/arch/sh/configs/ap325rxa_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.26 | 3 | # Linux kernel version: 2.6.27-rc4 |
4 | # Wed Jul 30 01:18:59 2008 | 4 | # Tue Aug 26 14:21:17 2008 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_SUPERH32=y | 7 | CONFIG_SUPERH32=y |
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y | |||
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 11 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
12 | CONFIG_GENERIC_HWEIGHT=y | 12 | CONFIG_GENERIC_HWEIGHT=y |
13 | CONFIG_GENERIC_HARDIRQS=y | 13 | CONFIG_GENERIC_HARDIRQS=y |
14 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
14 | CONFIG_GENERIC_IRQ_PROBE=y | 15 | CONFIG_GENERIC_IRQ_PROBE=y |
15 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 16 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
16 | CONFIG_GENERIC_TIME=y | 17 | CONFIG_GENERIC_TIME=y |
@@ -20,7 +21,6 @@ CONFIG_LOCKDEP_SUPPORT=y | |||
20 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 21 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
21 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 22 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
22 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 23 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
23 | CONFIG_ARCH_SUPPORTS_AOUT=y | ||
24 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 24 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
25 | 25 | ||
26 | # | 26 | # |
@@ -58,7 +58,6 @@ CONFIG_SYSCTL=y | |||
58 | CONFIG_EMBEDDED=y | 58 | CONFIG_EMBEDDED=y |
59 | CONFIG_UID16=y | 59 | CONFIG_UID16=y |
60 | CONFIG_SYSCTL_SYSCALL=y | 60 | CONFIG_SYSCTL_SYSCALL=y |
61 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
62 | # CONFIG_KALLSYMS is not set | 61 | # CONFIG_KALLSYMS is not set |
63 | CONFIG_HOTPLUG=y | 62 | CONFIG_HOTPLUG=y |
64 | CONFIG_PRINTK=y | 63 | CONFIG_PRINTK=y |
@@ -89,6 +88,7 @@ CONFIG_HAVE_OPROFILE=y | |||
89 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | 88 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set |
90 | CONFIG_HAVE_CLK=y | 89 | CONFIG_HAVE_CLK=y |
91 | CONFIG_PROC_PAGE_MONITOR=y | 90 | CONFIG_PROC_PAGE_MONITOR=y |
91 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
92 | CONFIG_SLABINFO=y | 92 | CONFIG_SLABINFO=y |
93 | CONFIG_RT_MUTEXES=y | 93 | CONFIG_RT_MUTEXES=y |
94 | # CONFIG_TINY_SHMEM is not set | 94 | # CONFIG_TINY_SHMEM is not set |
@@ -261,9 +261,10 @@ CONFIG_HZ_250=y | |||
261 | # CONFIG_HZ_300 is not set | 261 | # CONFIG_HZ_300 is not set |
262 | # CONFIG_HZ_1000 is not set | 262 | # CONFIG_HZ_1000 is not set |
263 | CONFIG_HZ=250 | 263 | CONFIG_HZ=250 |
264 | # CONFIG_SCHED_HRTICK is not set | 264 | CONFIG_SCHED_HRTICK=y |
265 | # CONFIG_KEXEC is not set | 265 | # CONFIG_KEXEC is not set |
266 | # CONFIG_CRASH_DUMP is not set | 266 | # CONFIG_CRASH_DUMP is not set |
267 | CONFIG_SECCOMP=y | ||
267 | # CONFIG_PREEMPT_NONE is not set | 268 | # CONFIG_PREEMPT_NONE is not set |
268 | # CONFIG_PREEMPT_VOLUNTARY is not set | 269 | # CONFIG_PREEMPT_VOLUNTARY is not set |
269 | CONFIG_PREEMPT=y | 270 | CONFIG_PREEMPT=y |
@@ -289,10 +290,6 @@ CONFIG_CMDLINE="console=tty1 console=ttySC5,38400 root=/dev/nfs ip=dhcp" | |||
289 | # | 290 | # |
290 | CONFIG_BINFMT_ELF=y | 291 | CONFIG_BINFMT_ELF=y |
291 | # CONFIG_BINFMT_MISC is not set | 292 | # CONFIG_BINFMT_MISC is not set |
292 | |||
293 | # | ||
294 | # Networking | ||
295 | # | ||
296 | CONFIG_NET=y | 293 | CONFIG_NET=y |
297 | 294 | ||
298 | # | 295 | # |
@@ -647,6 +644,7 @@ CONFIG_SSB_POSSIBLE=y | |||
647 | # CONFIG_MFD_CORE is not set | 644 | # CONFIG_MFD_CORE is not set |
648 | # CONFIG_MFD_SM501 is not set | 645 | # CONFIG_MFD_SM501 is not set |
649 | # CONFIG_HTC_PASIC3 is not set | 646 | # CONFIG_HTC_PASIC3 is not set |
647 | # CONFIG_MFD_TMIO is not set | ||
650 | 648 | ||
651 | # | 649 | # |
652 | # Multimedia devices | 650 | # Multimedia devices |
@@ -690,7 +688,10 @@ CONFIG_DUMMY_CONSOLE=y | |||
690 | # CONFIG_ACCESSIBILITY is not set | 688 | # CONFIG_ACCESSIBILITY is not set |
691 | # CONFIG_RTC_CLASS is not set | 689 | # CONFIG_RTC_CLASS is not set |
692 | # CONFIG_DMADEVICES is not set | 690 | # CONFIG_DMADEVICES is not set |
693 | # CONFIG_UIO is not set | 691 | CONFIG_UIO=y |
692 | # CONFIG_UIO_PDRV is not set | ||
693 | CONFIG_UIO_PDRV_GENIRQ=y | ||
694 | # CONFIG_UIO_SMX is not set | ||
694 | 695 | ||
695 | # | 696 | # |
696 | # File systems | 697 | # File systems |
@@ -854,6 +855,7 @@ CONFIG_FRAME_WARN=1024 | |||
854 | # CONFIG_DEBUG_KERNEL is not set | 855 | # CONFIG_DEBUG_KERNEL is not set |
855 | # CONFIG_DEBUG_BUGVERBOSE is not set | 856 | # CONFIG_DEBUG_BUGVERBOSE is not set |
856 | # CONFIG_DEBUG_MEMORY_INIT is not set | 857 | # CONFIG_DEBUG_MEMORY_INIT is not set |
858 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
857 | # CONFIG_SAMPLES is not set | 859 | # CONFIG_SAMPLES is not set |
858 | # CONFIG_SH_STANDARD_BIOS is not set | 860 | # CONFIG_SH_STANDARD_BIOS is not set |
859 | # CONFIG_EARLY_SCIF_CONSOLE is not set | 861 | # CONFIG_EARLY_SCIF_CONSOLE is not set |
diff --git a/arch/sh/configs/migor_defconfig b/arch/sh/configs/migor_defconfig index c4b3e1d8950d..4f8b1974f2c7 100644 --- a/arch/sh/configs/migor_defconfig +++ b/arch/sh/configs/migor_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.26 | 3 | # Linux kernel version: 2.6.27-rc4 |
4 | # Wed Jul 30 01:44:41 2008 | 4 | # Tue Aug 26 14:18:17 2008 |
5 | # | 5 | # |
6 | CONFIG_SUPERH=y | 6 | CONFIG_SUPERH=y |
7 | CONFIG_SUPERH32=y | 7 | CONFIG_SUPERH32=y |
@@ -11,6 +11,7 @@ CONFIG_GENERIC_BUG=y | |||
11 | CONFIG_GENERIC_FIND_NEXT_BIT=y | 11 | CONFIG_GENERIC_FIND_NEXT_BIT=y |
12 | CONFIG_GENERIC_HWEIGHT=y | 12 | CONFIG_GENERIC_HWEIGHT=y |
13 | CONFIG_GENERIC_HARDIRQS=y | 13 | CONFIG_GENERIC_HARDIRQS=y |
14 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | ||
14 | CONFIG_GENERIC_IRQ_PROBE=y | 15 | CONFIG_GENERIC_IRQ_PROBE=y |
15 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 16 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
16 | CONFIG_GENERIC_TIME=y | 17 | CONFIG_GENERIC_TIME=y |
@@ -21,7 +22,6 @@ CONFIG_LOCKDEP_SUPPORT=y | |||
21 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set | 22 | # CONFIG_ARCH_HAS_ILOG2_U32 is not set |
22 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set | 23 | # CONFIG_ARCH_HAS_ILOG2_U64 is not set |
23 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 24 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
24 | CONFIG_ARCH_SUPPORTS_AOUT=y | ||
25 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | 25 | CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" |
26 | 26 | ||
27 | # | 27 | # |
@@ -87,6 +87,7 @@ CONFIG_HAVE_OPROFILE=y | |||
87 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | 87 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set |
88 | CONFIG_HAVE_CLK=y | 88 | CONFIG_HAVE_CLK=y |
89 | CONFIG_PROC_PAGE_MONITOR=y | 89 | CONFIG_PROC_PAGE_MONITOR=y |
90 | CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
90 | CONFIG_SLABINFO=y | 91 | CONFIG_SLABINFO=y |
91 | CONFIG_RT_MUTEXES=y | 92 | CONFIG_RT_MUTEXES=y |
92 | # CONFIG_TINY_SHMEM is not set | 93 | # CONFIG_TINY_SHMEM is not set |
@@ -270,6 +271,7 @@ CONFIG_HZ=250 | |||
270 | # CONFIG_SCHED_HRTICK is not set | 271 | # CONFIG_SCHED_HRTICK is not set |
271 | # CONFIG_KEXEC is not set | 272 | # CONFIG_KEXEC is not set |
272 | # CONFIG_CRASH_DUMP is not set | 273 | # CONFIG_CRASH_DUMP is not set |
274 | CONFIG_SECCOMP=y | ||
273 | CONFIG_PREEMPT_NONE=y | 275 | CONFIG_PREEMPT_NONE=y |
274 | # CONFIG_PREEMPT_VOLUNTARY is not set | 276 | # CONFIG_PREEMPT_VOLUNTARY is not set |
275 | # CONFIG_PREEMPT is not set | 277 | # CONFIG_PREEMPT is not set |
@@ -294,10 +296,6 @@ CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=serial ip=on" | |||
294 | # | 296 | # |
295 | CONFIG_BINFMT_ELF=y | 297 | CONFIG_BINFMT_ELF=y |
296 | # CONFIG_BINFMT_MISC is not set | 298 | # CONFIG_BINFMT_MISC is not set |
297 | |||
298 | # | ||
299 | # Networking | ||
300 | # | ||
301 | CONFIG_NET=y | 299 | CONFIG_NET=y |
302 | 300 | ||
303 | # | 301 | # |
@@ -649,6 +647,7 @@ CONFIG_HW_RANDOM=y | |||
649 | CONFIG_I2C=y | 647 | CONFIG_I2C=y |
650 | CONFIG_I2C_BOARDINFO=y | 648 | CONFIG_I2C_BOARDINFO=y |
651 | # CONFIG_I2C_CHARDEV is not set | 649 | # CONFIG_I2C_CHARDEV is not set |
650 | CONFIG_I2C_HELPER_AUTO=y | ||
652 | 651 | ||
653 | # | 652 | # |
654 | # I2C Hardware Bus support | 653 | # I2C Hardware Bus support |
@@ -709,6 +708,7 @@ CONFIG_SSB_POSSIBLE=y | |||
709 | # CONFIG_MFD_CORE is not set | 708 | # CONFIG_MFD_CORE is not set |
710 | # CONFIG_MFD_SM501 is not set | 709 | # CONFIG_MFD_SM501 is not set |
711 | # CONFIG_HTC_PASIC3 is not set | 710 | # CONFIG_HTC_PASIC3 is not set |
711 | # CONFIG_MFD_TMIO is not set | ||
712 | 712 | ||
713 | # | 713 | # |
714 | # Multimedia devices | 714 | # Multimedia devices |
@@ -755,6 +755,8 @@ CONFIG_USB_ARCH_HAS_HCD=y | |||
755 | # CONFIG_USB is not set | 755 | # CONFIG_USB is not set |
756 | # CONFIG_USB_OTG_WHITELIST is not set | 756 | # CONFIG_USB_OTG_WHITELIST is not set |
757 | # CONFIG_USB_OTG_BLACKLIST_HUB is not set | 757 | # CONFIG_USB_OTG_BLACKLIST_HUB is not set |
758 | # CONFIG_USB_MUSB_HDRC is not set | ||
759 | # CONFIG_USB_GADGET_MUSB_HDRC is not set | ||
758 | 760 | ||
759 | # | 761 | # |
760 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | 762 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' |
@@ -842,7 +844,10 @@ CONFIG_RTC_DRV_RS5C372=y | |||
842 | # | 844 | # |
843 | CONFIG_RTC_DRV_SH=y | 845 | CONFIG_RTC_DRV_SH=y |
844 | # CONFIG_DMADEVICES is not set | 846 | # CONFIG_DMADEVICES is not set |
845 | # CONFIG_UIO is not set | 847 | CONFIG_UIO=y |
848 | # CONFIG_UIO_PDRV is not set | ||
849 | CONFIG_UIO_PDRV_GENIRQ=y | ||
850 | # CONFIG_UIO_SMX is not set | ||
846 | 851 | ||
847 | # | 852 | # |
848 | # File systems | 853 | # File systems |
diff --git a/arch/sh/include/asm/uaccess_64.h b/arch/sh/include/asm/uaccess_64.h index 81b3d515fcb3..5580fd471003 100644 --- a/arch/sh/include/asm/uaccess_64.h +++ b/arch/sh/include/asm/uaccess_64.h | |||
@@ -76,4 +76,6 @@ extern long __put_user_asm_l(void *, long); | |||
76 | extern long __put_user_asm_q(void *, long); | 76 | extern long __put_user_asm_q(void *, long); |
77 | extern void __put_user_unknown(void); | 77 | extern void __put_user_unknown(void); |
78 | 78 | ||
79 | extern long __strnlen_user(const char *__s, long __n); | ||
80 | |||
79 | #endif /* __ASM_SH_UACCESS_64_H */ | 81 | #endif /* __ASM_SH_UACCESS_64_H */ |
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S index 04c7da968146..e640c63d5811 100644 --- a/arch/sh/kernel/cpu/sh5/entry.S +++ b/arch/sh/kernel/cpu/sh5/entry.S | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/sh/kernel/cpu/sh5/entry.S | 2 | * arch/sh/kernel/cpu/sh5/entry.S |
3 | * | 3 | * |
4 | * Copyright (C) 2000, 2001 Paolo Alberelli | 4 | * Copyright (C) 2000, 2001 Paolo Alberelli |
5 | * Copyright (C) 2004 - 2007 Paul Mundt | 5 | * Copyright (C) 2004 - 2008 Paul Mundt |
6 | * Copyright (C) 2003, 2004 Richard Curnow | 6 | * Copyright (C) 2003, 2004 Richard Curnow |
7 | * | 7 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 8 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -923,6 +923,8 @@ ret_from_exception: | |||
923 | blink tr0, ZERO | 923 | blink tr0, ZERO |
924 | 924 | ||
925 | resume_kernel: | 925 | resume_kernel: |
926 | CLI() | ||
927 | |||
926 | pta restore_all, tr0 | 928 | pta restore_all, tr0 |
927 | 929 | ||
928 | getcon KCR0, r6 | 930 | getcon KCR0, r6 |
@@ -939,19 +941,11 @@ need_resched: | |||
939 | andi r7, 0xf0, r7 | 941 | andi r7, 0xf0, r7 |
940 | bne r7, ZERO, tr0 | 942 | bne r7, ZERO, tr0 |
941 | 943 | ||
942 | movi ((PREEMPT_ACTIVE >> 16) & 65535), r8 | 944 | movi preempt_schedule_irq, r7 |
943 | shori (PREEMPT_ACTIVE & 65535), r8 | ||
944 | st.l r6, TI_PRE_COUNT, r8 | ||
945 | |||
946 | STI() | ||
947 | movi schedule, r7 | ||
948 | ori r7, 1, r7 | 945 | ori r7, 1, r7 |
949 | ptabs r7, tr1 | 946 | ptabs r7, tr1 |
950 | blink tr1, LINK | 947 | blink tr1, LINK |
951 | 948 | ||
952 | st.l r6, TI_PRE_COUNT, ZERO | ||
953 | CLI() | ||
954 | |||
955 | pta need_resched, tr1 | 949 | pta need_resched, tr1 |
956 | blink tr1, ZERO | 950 | blink tr1, ZERO |
957 | #endif | 951 | #endif |
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 0bc17def55a7..efbb4268875e 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -92,6 +92,7 @@ ENTRY(ret_from_irq) | |||
92 | bra resume_userspace | 92 | bra resume_userspace |
93 | nop | 93 | nop |
94 | ENTRY(resume_kernel) | 94 | ENTRY(resume_kernel) |
95 | cli | ||
95 | mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count | 96 | mov.l @(TI_PRE_COUNT,r8), r0 ! current_thread_info->preempt_count |
96 | tst r0, r0 | 97 | tst r0, r0 |
97 | bf noresched | 98 | bf noresched |
@@ -105,28 +106,9 @@ need_resched: | |||
105 | and #0xf0, r0 ! interrupts off (exception path)? | 106 | and #0xf0, r0 ! interrupts off (exception path)? |
106 | cmp/eq #0xf0, r0 | 107 | cmp/eq #0xf0, r0 |
107 | bt noresched | 108 | bt noresched |
108 | |||
109 | mov.l 1f, r0 | ||
110 | mov.l r0, @(TI_PRE_COUNT,r8) | ||
111 | |||
112 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
113 | mov.l 3f, r0 | 109 | mov.l 3f, r0 |
114 | jsr @r0 | 110 | jsr @r0 ! call preempt_schedule_irq |
115 | nop | ||
116 | #endif | ||
117 | sti | ||
118 | mov.l 2f, r0 | ||
119 | jsr @r0 | ||
120 | nop | ||
121 | mov #0, r0 | ||
122 | mov.l r0, @(TI_PRE_COUNT,r8) | ||
123 | cli | ||
124 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
125 | mov.l 4f, r0 | ||
126 | jsr @r0 | ||
127 | nop | 111 | nop |
128 | #endif | ||
129 | |||
130 | bra need_resched | 112 | bra need_resched |
131 | nop | 113 | nop |
132 | 114 | ||
@@ -137,10 +119,7 @@ noresched: | |||
137 | .align 2 | 119 | .align 2 |
138 | 1: .long PREEMPT_ACTIVE | 120 | 1: .long PREEMPT_ACTIVE |
139 | 2: .long schedule | 121 | 2: .long schedule |
140 | #ifdef CONFIG_TRACE_IRQFLAGS | 122 | 3: .long preempt_schedule_irq |
141 | 3: .long trace_hardirqs_on | ||
142 | 4: .long trace_hardirqs_off | ||
143 | #endif | ||
144 | #endif | 123 | #endif |
145 | 124 | ||
146 | ENTRY(resume_userspace) | 125 | ENTRY(resume_userspace) |
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 4703dff174d5..94df56b0d1f6 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -102,7 +102,7 @@ void machine_kexec(struct kimage *image) | |||
102 | 102 | ||
103 | /* now call it */ | 103 | /* now call it */ |
104 | rnk = (relocate_new_kernel_t) reboot_code_buffer; | 104 | rnk = (relocate_new_kernel_t) reboot_code_buffer; |
105 | (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); | 105 | (*rnk)(page_list, reboot_code_buffer, P2SEGADDR(image->start), vbr_reg); |
106 | } | 106 | } |
107 | 107 | ||
108 | void arch_crash_save_vmcoreinfo(void) | 108 | void arch_crash_save_vmcoreinfo(void) |
diff --git a/arch/sh/kernel/ptrace_64.c b/arch/sh/kernel/ptrace_64.c index 5922edd416db..9c6424892bd3 100644 --- a/arch/sh/kernel/ptrace_64.c +++ b/arch/sh/kernel/ptrace_64.c | |||
@@ -131,6 +131,8 @@ void user_enable_single_step(struct task_struct *child) | |||
131 | 131 | ||
132 | void user_disable_single_step(struct task_struct *child) | 132 | void user_disable_single_step(struct task_struct *child) |
133 | { | 133 | { |
134 | struct pt_regs *regs = child->thread.uregs; | ||
135 | |||
134 | regs->sr &= ~SR_SSTEP; | 136 | regs->sr &= ~SR_SSTEP; |
135 | } | 137 | } |
136 | 138 | ||
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index a35207655e7b..de832056bf1b 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -171,6 +171,7 @@ static void __init reserve_crashkernel(void) | |||
171 | (unsigned long)(free_mem >> 20)); | 171 | (unsigned long)(free_mem >> 20)); |
172 | crashk_res.start = crash_base; | 172 | crashk_res.start = crash_base; |
173 | crashk_res.end = crash_base + crash_size - 1; | 173 | crashk_res.end = crash_base + crash_size - 1; |
174 | insert_resource(&iomem_resource, &crashk_res); | ||
174 | } | 175 | } |
175 | } | 176 | } |
176 | #else | 177 | #else |
@@ -204,11 +205,6 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn, | |||
204 | request_resource(res, &data_resource); | 205 | request_resource(res, &data_resource); |
205 | request_resource(res, &bss_resource); | 206 | request_resource(res, &bss_resource); |
206 | 207 | ||
207 | #ifdef CONFIG_KEXEC | ||
208 | if (crashk_res.start != crashk_res.end) | ||
209 | request_resource(res, &crashk_res); | ||
210 | #endif | ||
211 | |||
212 | add_active_range(nid, start_pfn, end_pfn); | 208 | add_active_range(nid, start_pfn, end_pfn); |
213 | } | 209 | } |
214 | 210 | ||
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index 59cd2859ce9b..9061b86d73fa 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
@@ -170,7 +170,7 @@ asmlinkage int sys_ipc(uint call, int first, int second, | |||
170 | version = call >> 16; /* hack for backward compatibility */ | 170 | version = call >> 16; /* hack for backward compatibility */ |
171 | call &= 0xffff; | 171 | call &= 0xffff; |
172 | 172 | ||
173 | if (call <= SEMCTL) | 173 | if (call <= SEMTIMEDOP) |
174 | switch (call) { | 174 | switch (call) { |
175 | case SEMOP: | 175 | case SEMOP: |
176 | return sys_semtimedop(first, | 176 | return sys_semtimedop(first, |
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index 895bb3f335c7..64b8f7f96f9a 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -101,7 +101,7 @@ static int __init memchunk_setup(char *str) | |||
101 | } | 101 | } |
102 | __setup("memchunk.", memchunk_setup); | 102 | __setup("memchunk.", memchunk_setup); |
103 | 103 | ||
104 | static void memchunk_cmdline_override(char *name, unsigned long *sizep) | 104 | static void __init memchunk_cmdline_override(char *name, unsigned long *sizep) |
105 | { | 105 | { |
106 | char *p = boot_command_line; | 106 | char *p = boot_command_line; |
107 | int k = strlen(name); | 107 | int k = strlen(name); |
@@ -118,8 +118,8 @@ static void memchunk_cmdline_override(char *name, unsigned long *sizep) | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | int platform_resource_setup_memory(struct platform_device *pdev, | 121 | int __init platform_resource_setup_memory(struct platform_device *pdev, |
122 | char *name, unsigned long memsize) | 122 | char *name, unsigned long memsize) |
123 | { | 123 | { |
124 | struct resource *r; | 124 | struct resource *r; |
125 | dma_addr_t dma_handle; | 125 | dma_addr_t dma_handle; |
diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h index 7201752cf934..a8180e546a48 100644 --- a/arch/sparc/include/asm/smp_32.h +++ b/arch/sparc/include/asm/smp_32.h | |||
@@ -50,27 +50,24 @@ struct seq_file; | |||
50 | void smp_bogo(struct seq_file *); | 50 | void smp_bogo(struct seq_file *); |
51 | void smp_info(struct seq_file *); | 51 | void smp_info(struct seq_file *); |
52 | 52 | ||
53 | BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) | 53 | BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, cpumask_t, unsigned long, unsigned long, unsigned long, unsigned long) |
54 | BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) | 54 | BTFIXUPDEF_CALL(int, __hard_smp_processor_id, void) |
55 | BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) | 55 | BTFIXUPDEF_BLACKBOX(hard_smp_processor_id) |
56 | BTFIXUPDEF_BLACKBOX(load_current) | 56 | BTFIXUPDEF_BLACKBOX(load_current) |
57 | 57 | ||
58 | #define smp_cross_call(func,arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5) | 58 | #define smp_cross_call(func,mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4) |
59 | 59 | ||
60 | static inline void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); } | 60 | static inline void xc0(smpfunc_t func) { smp_cross_call(func, cpu_online_map, 0, 0, 0, 0); } |
61 | static inline void xc1(smpfunc_t func, unsigned long arg1) | 61 | static inline void xc1(smpfunc_t func, unsigned long arg1) |
62 | { smp_cross_call(func, arg1, 0, 0, 0, 0); } | 62 | { smp_cross_call(func, cpu_online_map, arg1, 0, 0, 0); } |
63 | static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) | 63 | static inline void xc2(smpfunc_t func, unsigned long arg1, unsigned long arg2) |
64 | { smp_cross_call(func, arg1, arg2, 0, 0, 0); } | 64 | { smp_cross_call(func, cpu_online_map, arg1, arg2, 0, 0); } |
65 | static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 65 | static inline void xc3(smpfunc_t func, unsigned long arg1, unsigned long arg2, |
66 | unsigned long arg3) | 66 | unsigned long arg3) |
67 | { smp_cross_call(func, arg1, arg2, arg3, 0, 0); } | 67 | { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, 0); } |
68 | static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 68 | static inline void xc4(smpfunc_t func, unsigned long arg1, unsigned long arg2, |
69 | unsigned long arg3, unsigned long arg4) | 69 | unsigned long arg3, unsigned long arg4) |
70 | { smp_cross_call(func, arg1, arg2, arg3, arg4, 0); } | 70 | { smp_cross_call(func, cpu_online_map, arg1, arg2, arg3, arg4); } |
71 | static inline void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg2, | ||
72 | unsigned long arg3, unsigned long arg4, unsigned long arg5) | ||
73 | { smp_cross_call(func, arg1, arg2, arg3, arg4, arg5); } | ||
74 | 71 | ||
75 | static inline int smp_call_function(void (*func)(void *info), void *info, int wait) | 72 | static inline int smp_call_function(void (*func)(void *info), void *info, int wait) |
76 | { | 73 | { |
@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa | |||
78 | return 0; | 75 | return 0; |
79 | } | 76 | } |
80 | 77 | ||
78 | static inline int smp_call_function_single(int cpuid, void (*func) (void *info), | ||
79 | void *info, int wait) | ||
80 | { | ||
81 | smp_cross_call((smpfunc_t)func, cpumask_of_cpu(cpuid), | ||
82 | (unsigned long) info, 0, 0, 0); | ||
83 | return 0; | ||
84 | } | ||
85 | |||
81 | static inline int cpu_logical_map(int cpu) | 86 | static inline int cpu_logical_map(int cpu) |
82 | { | 87 | { |
83 | return cpu; | 88 | return cpu; |
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c index cc4c235c4f59..f58c537446a8 100644 --- a/arch/sparc/kernel/of_device.c +++ b/arch/sparc/kernel/of_device.c | |||
@@ -70,7 +70,7 @@ struct of_bus { | |||
70 | int *addrc, int *sizec); | 70 | int *addrc, int *sizec); |
71 | int (*map)(u32 *addr, const u32 *range, | 71 | int (*map)(u32 *addr, const u32 *range, |
72 | int na, int ns, int pna); | 72 | int na, int ns, int pna); |
73 | unsigned int (*get_flags)(const u32 *addr); | 73 | unsigned long (*get_flags)(const u32 *addr, unsigned long); |
74 | }; | 74 | }; |
75 | 75 | ||
76 | /* | 76 | /* |
@@ -130,8 +130,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, | |||
130 | return 0; | 130 | return 0; |
131 | } | 131 | } |
132 | 132 | ||
133 | static unsigned int of_bus_default_get_flags(const u32 *addr) | 133 | static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) |
134 | { | 134 | { |
135 | if (flags) | ||
136 | return flags; | ||
135 | return IORESOURCE_MEM; | 137 | return IORESOURCE_MEM; |
136 | } | 138 | } |
137 | 139 | ||
@@ -194,17 +196,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, | |||
194 | return 0; | 196 | return 0; |
195 | } | 197 | } |
196 | 198 | ||
197 | static unsigned int of_bus_pci_get_flags(const u32 *addr) | 199 | static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) |
198 | { | 200 | { |
199 | unsigned int flags = 0; | ||
200 | u32 w = addr[0]; | 201 | u32 w = addr[0]; |
201 | 202 | ||
203 | /* For PCI, we override whatever child busses may have used. */ | ||
204 | flags = 0; | ||
202 | switch((w >> 24) & 0x03) { | 205 | switch((w >> 24) & 0x03) { |
203 | case 0x01: | 206 | case 0x01: |
204 | flags |= IORESOURCE_IO; | 207 | flags |= IORESOURCE_IO; |
208 | break; | ||
209 | |||
205 | case 0x02: /* 32 bits */ | 210 | case 0x02: /* 32 bits */ |
206 | case 0x03: /* 64 bits */ | 211 | case 0x03: /* 64 bits */ |
207 | flags |= IORESOURCE_MEM; | 212 | flags |= IORESOURCE_MEM; |
213 | break; | ||
208 | } | 214 | } |
209 | if (w & 0x40000000) | 215 | if (w & 0x40000000) |
210 | flags |= IORESOURCE_PREFETCH; | 216 | flags |= IORESOURCE_PREFETCH; |
@@ -235,7 +241,7 @@ static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna) | |||
235 | return of_bus_default_map(addr, range, na, ns, pna); | 241 | return of_bus_default_map(addr, range, na, ns, pna); |
236 | } | 242 | } |
237 | 243 | ||
238 | static unsigned int of_bus_sbus_get_flags(const u32 *addr) | 244 | static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags) |
239 | { | 245 | { |
240 | return IORESOURCE_MEM; | 246 | return IORESOURCE_MEM; |
241 | } | 247 | } |
@@ -362,10 +368,11 @@ static void __init build_device_resources(struct of_device *op, | |||
362 | int pna, pns; | 368 | int pna, pns; |
363 | 369 | ||
364 | size = of_read_addr(reg + na, ns); | 370 | size = of_read_addr(reg + na, ns); |
365 | flags = bus->get_flags(reg); | ||
366 | 371 | ||
367 | memcpy(addr, reg, na * 4); | 372 | memcpy(addr, reg, na * 4); |
368 | 373 | ||
374 | flags = bus->get_flags(reg, 0); | ||
375 | |||
369 | /* If the immediate parent has no ranges property to apply, | 376 | /* If the immediate parent has no ranges property to apply, |
370 | * just use a 1<->1 mapping. | 377 | * just use a 1<->1 mapping. |
371 | */ | 378 | */ |
@@ -393,6 +400,8 @@ static void __init build_device_resources(struct of_device *op, | |||
393 | dna, dns, pna)) | 400 | dna, dns, pna)) |
394 | break; | 401 | break; |
395 | 402 | ||
403 | flags = pbus->get_flags(addr, flags); | ||
404 | |||
396 | dna = pna; | 405 | dna = pna; |
397 | dns = pns; | 406 | dns = pns; |
398 | dbus = pbus; | 407 | dbus = pbus; |
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index 20699c701412..8ce6285a06d5 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c | |||
@@ -288,7 +288,7 @@ static const struct user_regset sparc32_regsets[] = { | |||
288 | */ | 288 | */ |
289 | [REGSET_GENERAL] = { | 289 | [REGSET_GENERAL] = { |
290 | .core_note_type = NT_PRSTATUS, | 290 | .core_note_type = NT_PRSTATUS, |
291 | .n = 38 * sizeof(u32), | 291 | .n = 38, |
292 | .size = sizeof(u32), .align = sizeof(u32), | 292 | .size = sizeof(u32), .align = sizeof(u32), |
293 | .get = genregs32_get, .set = genregs32_set | 293 | .get = genregs32_get, .set = genregs32_set |
294 | }, | 294 | }, |
@@ -304,7 +304,7 @@ static const struct user_regset sparc32_regsets[] = { | |||
304 | */ | 304 | */ |
305 | [REGSET_FP] = { | 305 | [REGSET_FP] = { |
306 | .core_note_type = NT_PRFPREG, | 306 | .core_note_type = NT_PRFPREG, |
307 | .n = 99 * sizeof(u32), | 307 | .n = 99, |
308 | .size = sizeof(u32), .align = sizeof(u32), | 308 | .size = sizeof(u32), .align = sizeof(u32), |
309 | .get = fpregs32_get, .set = fpregs32_set | 309 | .get = fpregs32_get, .set = fpregs32_set |
310 | }, | 310 | }, |
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c index dfde77ff0848..69596402a500 100644 --- a/arch/sparc/kernel/sun4d_smp.c +++ b/arch/sparc/kernel/sun4d_smp.c | |||
@@ -262,8 +262,9 @@ static struct smp_funcall { | |||
262 | static DEFINE_SPINLOCK(cross_call_lock); | 262 | static DEFINE_SPINLOCK(cross_call_lock); |
263 | 263 | ||
264 | /* Cross calls must be serialized, at least currently. */ | 264 | /* Cross calls must be serialized, at least currently. */ |
265 | void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | 265 | static void smp4d_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
266 | unsigned long arg3, unsigned long arg4, unsigned long arg5) | 266 | unsigned long arg2, unsigned long arg3, |
267 | unsigned long arg4) | ||
267 | { | 268 | { |
268 | if(smp_processors_ready) { | 269 | if(smp_processors_ready) { |
269 | register int high = smp_highest_cpu; | 270 | register int high = smp_highest_cpu; |
@@ -278,7 +279,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
278 | register unsigned long a2 asm("i2") = arg2; | 279 | register unsigned long a2 asm("i2") = arg2; |
279 | register unsigned long a3 asm("i3") = arg3; | 280 | register unsigned long a3 asm("i3") = arg3; |
280 | register unsigned long a4 asm("i4") = arg4; | 281 | register unsigned long a4 asm("i4") = arg4; |
281 | register unsigned long a5 asm("i5") = arg5; | 282 | register unsigned long a5 asm("i5") = 0; |
282 | 283 | ||
283 | __asm__ __volatile__( | 284 | __asm__ __volatile__( |
284 | "std %0, [%6]\n\t" | 285 | "std %0, [%6]\n\t" |
@@ -290,11 +291,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
290 | 291 | ||
291 | /* Init receive/complete mapping, plus fire the IPI's off. */ | 292 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
292 | { | 293 | { |
293 | cpumask_t mask; | ||
294 | register int i; | 294 | register int i; |
295 | 295 | ||
296 | mask = cpumask_of_cpu(hard_smp4d_processor_id()); | 296 | cpu_clear(smp_processor_id(), mask); |
297 | cpus_andnot(mask, cpu_online_map, mask); | 297 | cpus_and(mask, cpu_online_map, mask); |
298 | for(i = 0; i <= high; i++) { | 298 | for(i = 0; i <= high; i++) { |
299 | if (cpu_isset(i, mask)) { | 299 | if (cpu_isset(i, mask)) { |
300 | ccall_info.processors_in[i] = 0; | 300 | ccall_info.processors_in[i] = 0; |
@@ -309,12 +309,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2, | |||
309 | 309 | ||
310 | i = 0; | 310 | i = 0; |
311 | do { | 311 | do { |
312 | if (!cpu_isset(i, mask)) | ||
313 | continue; | ||
312 | while(!ccall_info.processors_in[i]) | 314 | while(!ccall_info.processors_in[i]) |
313 | barrier(); | 315 | barrier(); |
314 | } while(++i <= high); | 316 | } while(++i <= high); |
315 | 317 | ||
316 | i = 0; | 318 | i = 0; |
317 | do { | 319 | do { |
320 | if (!cpu_isset(i, mask)) | ||
321 | continue; | ||
318 | while(!ccall_info.processors_out[i]) | 322 | while(!ccall_info.processors_out[i]) |
319 | barrier(); | 323 | barrier(); |
320 | } while(++i <= high); | 324 | } while(++i <= high); |
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c index 406ac1abc83a..a14a76ac7f36 100644 --- a/arch/sparc/kernel/sun4m_smp.c +++ b/arch/sparc/kernel/sun4m_smp.c | |||
@@ -244,9 +244,9 @@ static struct smp_funcall { | |||
244 | static DEFINE_SPINLOCK(cross_call_lock); | 244 | static DEFINE_SPINLOCK(cross_call_lock); |
245 | 245 | ||
246 | /* Cross calls must be serialized, at least currently. */ | 246 | /* Cross calls must be serialized, at least currently. */ |
247 | static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | 247 | static void smp4m_cross_call(smpfunc_t func, cpumask_t mask, unsigned long arg1, |
248 | unsigned long arg2, unsigned long arg3, | 248 | unsigned long arg2, unsigned long arg3, |
249 | unsigned long arg4, unsigned long arg5) | 249 | unsigned long arg4) |
250 | { | 250 | { |
251 | register int ncpus = SUN4M_NCPUS; | 251 | register int ncpus = SUN4M_NCPUS; |
252 | unsigned long flags; | 252 | unsigned long flags; |
@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | |||
259 | ccall_info.arg2 = arg2; | 259 | ccall_info.arg2 = arg2; |
260 | ccall_info.arg3 = arg3; | 260 | ccall_info.arg3 = arg3; |
261 | ccall_info.arg4 = arg4; | 261 | ccall_info.arg4 = arg4; |
262 | ccall_info.arg5 = arg5; | 262 | ccall_info.arg5 = 0; |
263 | 263 | ||
264 | /* Init receive/complete mapping, plus fire the IPI's off. */ | 264 | /* Init receive/complete mapping, plus fire the IPI's off. */ |
265 | { | 265 | { |
266 | cpumask_t mask = cpu_online_map; | ||
267 | register int i; | 266 | register int i; |
268 | 267 | ||
269 | cpu_clear(smp_processor_id(), mask); | 268 | cpu_clear(smp_processor_id(), mask); |
269 | cpus_and(mask, cpu_online_map, mask); | ||
270 | for(i = 0; i < ncpus; i++) { | 270 | for(i = 0; i < ncpus; i++) { |
271 | if (cpu_isset(i, mask)) { | 271 | if (cpu_isset(i, mask)) { |
272 | ccall_info.processors_in[i] = 0; | 272 | ccall_info.processors_in[i] = 0; |
@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1, | |||
284 | 284 | ||
285 | i = 0; | 285 | i = 0; |
286 | do { | 286 | do { |
287 | if (!cpu_isset(i, mask)) | ||
288 | continue; | ||
287 | while(!ccall_info.processors_in[i]) | 289 | while(!ccall_info.processors_in[i]) |
288 | barrier(); | 290 | barrier(); |
289 | } while(++i < ncpus); | 291 | } while(++i < ncpus); |
290 | 292 | ||
291 | i = 0; | 293 | i = 0; |
292 | do { | 294 | do { |
295 | if (!cpu_isset(i, mask)) | ||
296 | continue; | ||
293 | while(!ccall_info.processors_out[i]) | 297 | while(!ccall_info.processors_out[i]) |
294 | barrier(); | 298 | barrier(); |
295 | } while(++i < ncpus); | 299 | } while(++i < ncpus); |
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 9b6689d9d570..7495bc774685 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/linkage.h> | ||
10 | #include <linux/ptrace.h> | 11 | #include <linux/ptrace.h> |
11 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
12 | #include <linux/kernel_stat.h> | 13 | #include <linux/kernel_stat.h> |
@@ -792,6 +793,8 @@ void fixup_irqs(void) | |||
792 | } | 793 | } |
793 | spin_unlock_irqrestore(&irq_desc[irq].lock, flags); | 794 | spin_unlock_irqrestore(&irq_desc[irq].lock, flags); |
794 | } | 795 | } |
796 | |||
797 | tick_ops->disable_irq(); | ||
795 | } | 798 | } |
796 | #endif | 799 | #endif |
797 | 800 | ||
@@ -864,7 +867,7 @@ static void kill_prom_timer(void) | |||
864 | : "g1", "g2"); | 867 | : "g1", "g2"); |
865 | } | 868 | } |
866 | 869 | ||
867 | void init_irqwork_curcpu(void) | 870 | void notrace init_irqwork_curcpu(void) |
868 | { | 871 | { |
869 | int cpu = hard_smp_processor_id(); | 872 | int cpu = hard_smp_processor_id(); |
870 | 873 | ||
@@ -895,7 +898,7 @@ static void __cpuinit register_one_mondo(unsigned long paddr, unsigned long type | |||
895 | } | 898 | } |
896 | } | 899 | } |
897 | 900 | ||
898 | void __cpuinit sun4v_register_mondo_queues(int this_cpu) | 901 | void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu) |
899 | { | 902 | { |
900 | struct trap_per_cpu *tb = &trap_block[this_cpu]; | 903 | struct trap_per_cpu *tb = &trap_block[this_cpu]; |
901 | 904 | ||
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c index f8b50cbf4bf7..f845f150f565 100644 --- a/arch/sparc64/kernel/of_device.c +++ b/arch/sparc64/kernel/of_device.c | |||
@@ -96,7 +96,7 @@ struct of_bus { | |||
96 | int *addrc, int *sizec); | 96 | int *addrc, int *sizec); |
97 | int (*map)(u32 *addr, const u32 *range, | 97 | int (*map)(u32 *addr, const u32 *range, |
98 | int na, int ns, int pna); | 98 | int na, int ns, int pna); |
99 | unsigned int (*get_flags)(const u32 *addr); | 99 | unsigned long (*get_flags)(const u32 *addr, unsigned long); |
100 | }; | 100 | }; |
101 | 101 | ||
102 | /* | 102 | /* |
@@ -156,8 +156,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range, | |||
156 | return 0; | 156 | return 0; |
157 | } | 157 | } |
158 | 158 | ||
159 | static unsigned int of_bus_default_get_flags(const u32 *addr) | 159 | static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags) |
160 | { | 160 | { |
161 | if (flags) | ||
162 | return flags; | ||
161 | return IORESOURCE_MEM; | 163 | return IORESOURCE_MEM; |
162 | } | 164 | } |
163 | 165 | ||
@@ -249,17 +251,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range, | |||
249 | return 0; | 251 | return 0; |
250 | } | 252 | } |
251 | 253 | ||
252 | static unsigned int of_bus_pci_get_flags(const u32 *addr) | 254 | static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags) |
253 | { | 255 | { |
254 | unsigned int flags = 0; | ||
255 | u32 w = addr[0]; | 256 | u32 w = addr[0]; |
256 | 257 | ||
258 | /* For PCI, we override whatever child busses may have used. */ | ||
259 | flags = 0; | ||
257 | switch((w >> 24) & 0x03) { | 260 | switch((w >> 24) & 0x03) { |
258 | case 0x01: | 261 | case 0x01: |
259 | flags |= IORESOURCE_IO; | 262 | flags |= IORESOURCE_IO; |
263 | break; | ||
264 | |||
260 | case 0x02: /* 32 bits */ | 265 | case 0x02: /* 32 bits */ |
261 | case 0x03: /* 64 bits */ | 266 | case 0x03: /* 64 bits */ |
262 | flags |= IORESOURCE_MEM; | 267 | flags |= IORESOURCE_MEM; |
268 | break; | ||
263 | } | 269 | } |
264 | if (w & 0x40000000) | 270 | if (w & 0x40000000) |
265 | flags |= IORESOURCE_PREFETCH; | 271 | flags |= IORESOURCE_PREFETCH; |
@@ -478,10 +484,10 @@ static void __init build_device_resources(struct of_device *op, | |||
478 | int pna, pns; | 484 | int pna, pns; |
479 | 485 | ||
480 | size = of_read_addr(reg + na, ns); | 486 | size = of_read_addr(reg + na, ns); |
481 | flags = bus->get_flags(reg); | ||
482 | |||
483 | memcpy(addr, reg, na * 4); | 487 | memcpy(addr, reg, na * 4); |
484 | 488 | ||
489 | flags = bus->get_flags(addr, 0); | ||
490 | |||
485 | if (use_1to1_mapping(pp)) { | 491 | if (use_1to1_mapping(pp)) { |
486 | result = of_read_addr(addr, na); | 492 | result = of_read_addr(addr, na); |
487 | goto build_res; | 493 | goto build_res; |
@@ -506,6 +512,8 @@ static void __init build_device_resources(struct of_device *op, | |||
506 | dna, dns, pna)) | 512 | dna, dns, pna)) |
507 | break; | 513 | break; |
508 | 514 | ||
515 | flags = pbus->get_flags(addr, flags); | ||
516 | |||
509 | dna = pna; | 517 | dna = pna; |
510 | dns = pns; | 518 | dns = pns; |
511 | dbus = pbus; | 519 | dbus = pbus; |
diff --git a/arch/sparc64/kernel/pci_psycho.c b/arch/sparc64/kernel/pci_psycho.c index ef5fe29202c2..f85b6bebb0be 100644 --- a/arch/sparc64/kernel/pci_psycho.c +++ b/arch/sparc64/kernel/pci_psycho.c | |||
@@ -575,7 +575,7 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm, int is_pbm | |||
575 | { | 575 | { |
576 | unsigned long csr_reg, csr, csr_error_bits; | 576 | unsigned long csr_reg, csr, csr_error_bits; |
577 | irqreturn_t ret = IRQ_NONE; | 577 | irqreturn_t ret = IRQ_NONE; |
578 | u16 stat; | 578 | u16 stat, *addr; |
579 | 579 | ||
580 | if (is_pbm_a) { | 580 | if (is_pbm_a) { |
581 | csr_reg = pbm->controller_regs + PSYCHO_PCIA_CTRL; | 581 | csr_reg = pbm->controller_regs + PSYCHO_PCIA_CTRL; |
@@ -597,7 +597,9 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm, int is_pbm | |||
597 | printk("%s: PCI SERR signal asserted.\n", pbm->name); | 597 | printk("%s: PCI SERR signal asserted.\n", pbm->name); |
598 | ret = IRQ_HANDLED; | 598 | ret = IRQ_HANDLED; |
599 | } | 599 | } |
600 | pci_read_config_word(pbm->pci_bus->self, PCI_STATUS, &stat); | 600 | addr = psycho_pci_config_mkaddr(pbm, pbm->pci_first_busno, |
601 | 0, PCI_STATUS); | ||
602 | pci_config_read16(addr, &stat); | ||
601 | if (stat & (PCI_STATUS_PARITY | | 603 | if (stat & (PCI_STATUS_PARITY | |
602 | PCI_STATUS_SIG_TARGET_ABORT | | 604 | PCI_STATUS_SIG_TARGET_ABORT | |
603 | PCI_STATUS_REC_TARGET_ABORT | | 605 | PCI_STATUS_REC_TARGET_ABORT | |
@@ -605,7 +607,7 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm, int is_pbm | |||
605 | PCI_STATUS_SIG_SYSTEM_ERROR)) { | 607 | PCI_STATUS_SIG_SYSTEM_ERROR)) { |
606 | printk("%s: PCI bus error, PCI_STATUS[%04x]\n", | 608 | printk("%s: PCI bus error, PCI_STATUS[%04x]\n", |
607 | pbm->name, stat); | 609 | pbm->name, stat); |
608 | pci_write_config_word(pbm->pci_bus->self, PCI_STATUS, 0xffff); | 610 | pci_config_write16(addr, 0xffff); |
609 | ret = IRQ_HANDLED; | 611 | ret = IRQ_HANDLED; |
610 | } | 612 | } |
611 | return ret; | 613 | return ret; |
@@ -744,16 +746,16 @@ static void psycho_register_error_handlers(struct pci_pbm_info *pbm) | |||
744 | * the second will just error out since we do not pass in | 746 | * the second will just error out since we do not pass in |
745 | * IRQF_SHARED. | 747 | * IRQF_SHARED. |
746 | */ | 748 | */ |
747 | err = request_irq(op->irqs[1], psycho_ue_intr, 0, | 749 | err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED, |
748 | "PSYCHO_UE", pbm); | 750 | "PSYCHO_UE", pbm); |
749 | err = request_irq(op->irqs[2], psycho_ce_intr, 0, | 751 | err = request_irq(op->irqs[2], psycho_ce_intr, IRQF_SHARED, |
750 | "PSYCHO_CE", pbm); | 752 | "PSYCHO_CE", pbm); |
751 | 753 | ||
752 | /* This one, however, ought not to fail. We can just warn | 754 | /* This one, however, ought not to fail. We can just warn |
753 | * about it since the system can still operate properly even | 755 | * about it since the system can still operate properly even |
754 | * if this fails. | 756 | * if this fails. |
755 | */ | 757 | */ |
756 | err = request_irq(op->irqs[0], psycho_pcierr_intr, 0, | 758 | err = request_irq(op->irqs[0], psycho_pcierr_intr, IRQF_SHARED, |
757 | "PSYCHO_PCIERR", pbm); | 759 | "PSYCHO_PCIERR", pbm); |
758 | if (err) | 760 | if (err) |
759 | printk(KERN_WARNING "%s: Could not register PCIERR, " | 761 | printk(KERN_WARNING "%s: Could not register PCIERR, " |
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 3c048ac4e638..7151513f156e 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c | |||
@@ -156,55 +156,11 @@ static unsigned long psycho_pcislot_imap_offset(unsigned long ino) | |||
156 | return PSYCHO_IMAP_B_SLOT0 + (slot * 8); | 156 | return PSYCHO_IMAP_B_SLOT0 + (slot * 8); |
157 | } | 157 | } |
158 | 158 | ||
159 | #define PSYCHO_IMAP_SCSI 0x1000UL | 159 | #define PSYCHO_OBIO_IMAP_BASE 0x1000UL |
160 | #define PSYCHO_IMAP_ETH 0x1008UL | 160 | |
161 | #define PSYCHO_IMAP_BPP 0x1010UL | ||
162 | #define PSYCHO_IMAP_AU_REC 0x1018UL | ||
163 | #define PSYCHO_IMAP_AU_PLAY 0x1020UL | ||
164 | #define PSYCHO_IMAP_PFAIL 0x1028UL | ||
165 | #define PSYCHO_IMAP_KMS 0x1030UL | ||
166 | #define PSYCHO_IMAP_FLPY 0x1038UL | ||
167 | #define PSYCHO_IMAP_SHW 0x1040UL | ||
168 | #define PSYCHO_IMAP_KBD 0x1048UL | ||
169 | #define PSYCHO_IMAP_MS 0x1050UL | ||
170 | #define PSYCHO_IMAP_SER 0x1058UL | ||
171 | #define PSYCHO_IMAP_TIM0 0x1060UL | ||
172 | #define PSYCHO_IMAP_TIM1 0x1068UL | ||
173 | #define PSYCHO_IMAP_UE 0x1070UL | ||
174 | #define PSYCHO_IMAP_CE 0x1078UL | ||
175 | #define PSYCHO_IMAP_A_ERR 0x1080UL | ||
176 | #define PSYCHO_IMAP_B_ERR 0x1088UL | ||
177 | #define PSYCHO_IMAP_PMGMT 0x1090UL | ||
178 | #define PSYCHO_IMAP_GFX 0x1098UL | ||
179 | #define PSYCHO_IMAP_EUPA 0x10a0UL | ||
180 | |||
181 | static unsigned long __psycho_onboard_imap_off[] = { | ||
182 | /*0x20*/ PSYCHO_IMAP_SCSI, | ||
183 | /*0x21*/ PSYCHO_IMAP_ETH, | ||
184 | /*0x22*/ PSYCHO_IMAP_BPP, | ||
185 | /*0x23*/ PSYCHO_IMAP_AU_REC, | ||
186 | /*0x24*/ PSYCHO_IMAP_AU_PLAY, | ||
187 | /*0x25*/ PSYCHO_IMAP_PFAIL, | ||
188 | /*0x26*/ PSYCHO_IMAP_KMS, | ||
189 | /*0x27*/ PSYCHO_IMAP_FLPY, | ||
190 | /*0x28*/ PSYCHO_IMAP_SHW, | ||
191 | /*0x29*/ PSYCHO_IMAP_KBD, | ||
192 | /*0x2a*/ PSYCHO_IMAP_MS, | ||
193 | /*0x2b*/ PSYCHO_IMAP_SER, | ||
194 | /*0x2c*/ PSYCHO_IMAP_TIM0, | ||
195 | /*0x2d*/ PSYCHO_IMAP_TIM1, | ||
196 | /*0x2e*/ PSYCHO_IMAP_UE, | ||
197 | /*0x2f*/ PSYCHO_IMAP_CE, | ||
198 | /*0x30*/ PSYCHO_IMAP_A_ERR, | ||
199 | /*0x31*/ PSYCHO_IMAP_B_ERR, | ||
200 | /*0x32*/ PSYCHO_IMAP_PMGMT, | ||
201 | /*0x33*/ PSYCHO_IMAP_GFX, | ||
202 | /*0x34*/ PSYCHO_IMAP_EUPA, | ||
203 | }; | ||
204 | #define PSYCHO_ONBOARD_IRQ_BASE 0x20 | 161 | #define PSYCHO_ONBOARD_IRQ_BASE 0x20 |
205 | #define PSYCHO_ONBOARD_IRQ_LAST 0x34 | ||
206 | #define psycho_onboard_imap_offset(__ino) \ | 162 | #define psycho_onboard_imap_offset(__ino) \ |
207 | __psycho_onboard_imap_off[(__ino) - PSYCHO_ONBOARD_IRQ_BASE] | 163 | (PSYCHO_OBIO_IMAP_BASE + (((__ino) & 0x1f) << 3)) |
208 | 164 | ||
209 | #define PSYCHO_ICLR_A_SLOT0 0x1400UL | 165 | #define PSYCHO_ICLR_A_SLOT0 0x1400UL |
210 | #define PSYCHO_ICLR_SCSI 0x1800UL | 166 | #define PSYCHO_ICLR_SCSI 0x1800UL |
@@ -228,10 +184,6 @@ static unsigned int psycho_irq_build(struct device_node *dp, | |||
228 | imap_off = psycho_pcislot_imap_offset(ino); | 184 | imap_off = psycho_pcislot_imap_offset(ino); |
229 | } else { | 185 | } else { |
230 | /* Onboard device */ | 186 | /* Onboard device */ |
231 | if (ino > PSYCHO_ONBOARD_IRQ_LAST) { | ||
232 | prom_printf("psycho_irq_build: Wacky INO [%x]\n", ino); | ||
233 | prom_halt(); | ||
234 | } | ||
235 | imap_off = psycho_onboard_imap_offset(ino); | 187 | imap_off = psycho_onboard_imap_offset(ino); |
236 | } | 188 | } |
237 | 189 | ||
@@ -318,23 +270,6 @@ static void sabre_wsync_handler(unsigned int ino, void *_arg1, void *_arg2) | |||
318 | 270 | ||
319 | #define SABRE_IMAP_A_SLOT0 0x0c00UL | 271 | #define SABRE_IMAP_A_SLOT0 0x0c00UL |
320 | #define SABRE_IMAP_B_SLOT0 0x0c20UL | 272 | #define SABRE_IMAP_B_SLOT0 0x0c20UL |
321 | #define SABRE_IMAP_SCSI 0x1000UL | ||
322 | #define SABRE_IMAP_ETH 0x1008UL | ||
323 | #define SABRE_IMAP_BPP 0x1010UL | ||
324 | #define SABRE_IMAP_AU_REC 0x1018UL | ||
325 | #define SABRE_IMAP_AU_PLAY 0x1020UL | ||
326 | #define SABRE_IMAP_PFAIL 0x1028UL | ||
327 | #define SABRE_IMAP_KMS 0x1030UL | ||
328 | #define SABRE_IMAP_FLPY 0x1038UL | ||
329 | #define SABRE_IMAP_SHW 0x1040UL | ||
330 | #define SABRE_IMAP_KBD 0x1048UL | ||
331 | #define SABRE_IMAP_MS 0x1050UL | ||
332 | #define SABRE_IMAP_SER 0x1058UL | ||
333 | #define SABRE_IMAP_UE 0x1070UL | ||
334 | #define SABRE_IMAP_CE 0x1078UL | ||
335 | #define SABRE_IMAP_PCIERR 0x1080UL | ||
336 | #define SABRE_IMAP_GFX 0x1098UL | ||
337 | #define SABRE_IMAP_EUPA 0x10a0UL | ||
338 | #define SABRE_ICLR_A_SLOT0 0x1400UL | 273 | #define SABRE_ICLR_A_SLOT0 0x1400UL |
339 | #define SABRE_ICLR_B_SLOT0 0x1480UL | 274 | #define SABRE_ICLR_B_SLOT0 0x1480UL |
340 | #define SABRE_ICLR_SCSI 0x1800UL | 275 | #define SABRE_ICLR_SCSI 0x1800UL |
@@ -364,33 +299,10 @@ static unsigned long sabre_pcislot_imap_offset(unsigned long ino) | |||
364 | return SABRE_IMAP_B_SLOT0 + (slot * 8); | 299 | return SABRE_IMAP_B_SLOT0 + (slot * 8); |
365 | } | 300 | } |
366 | 301 | ||
367 | static unsigned long __sabre_onboard_imap_off[] = { | 302 | #define SABRE_OBIO_IMAP_BASE 0x1000UL |
368 | /*0x20*/ SABRE_IMAP_SCSI, | 303 | #define SABRE_ONBOARD_IRQ_BASE 0x20 |
369 | /*0x21*/ SABRE_IMAP_ETH, | ||
370 | /*0x22*/ SABRE_IMAP_BPP, | ||
371 | /*0x23*/ SABRE_IMAP_AU_REC, | ||
372 | /*0x24*/ SABRE_IMAP_AU_PLAY, | ||
373 | /*0x25*/ SABRE_IMAP_PFAIL, | ||
374 | /*0x26*/ SABRE_IMAP_KMS, | ||
375 | /*0x27*/ SABRE_IMAP_FLPY, | ||
376 | /*0x28*/ SABRE_IMAP_SHW, | ||
377 | /*0x29*/ SABRE_IMAP_KBD, | ||
378 | /*0x2a*/ SABRE_IMAP_MS, | ||
379 | /*0x2b*/ SABRE_IMAP_SER, | ||
380 | /*0x2c*/ 0 /* reserved */, | ||
381 | /*0x2d*/ 0 /* reserved */, | ||
382 | /*0x2e*/ SABRE_IMAP_UE, | ||
383 | /*0x2f*/ SABRE_IMAP_CE, | ||
384 | /*0x30*/ SABRE_IMAP_PCIERR, | ||
385 | /*0x31*/ 0 /* reserved */, | ||
386 | /*0x32*/ 0 /* reserved */, | ||
387 | /*0x33*/ SABRE_IMAP_GFX, | ||
388 | /*0x34*/ SABRE_IMAP_EUPA, | ||
389 | }; | ||
390 | #define SABRE_ONBOARD_IRQ_BASE 0x20 | ||
391 | #define SABRE_ONBOARD_IRQ_LAST 0x30 | ||
392 | #define sabre_onboard_imap_offset(__ino) \ | 304 | #define sabre_onboard_imap_offset(__ino) \ |
393 | __sabre_onboard_imap_off[(__ino) - SABRE_ONBOARD_IRQ_BASE] | 305 | (SABRE_OBIO_IMAP_BASE + (((__ino) & 0x1f) << 3)) |
394 | 306 | ||
395 | #define sabre_iclr_offset(ino) \ | 307 | #define sabre_iclr_offset(ino) \ |
396 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ | 308 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ |
@@ -453,10 +365,6 @@ static unsigned int sabre_irq_build(struct device_node *dp, | |||
453 | imap_off = sabre_pcislot_imap_offset(ino); | 365 | imap_off = sabre_pcislot_imap_offset(ino); |
454 | } else { | 366 | } else { |
455 | /* onboard device */ | 367 | /* onboard device */ |
456 | if (ino > SABRE_ONBOARD_IRQ_LAST) { | ||
457 | prom_printf("sabre_irq_build: Wacky INO [%x]\n", ino); | ||
458 | prom_halt(); | ||
459 | } | ||
460 | imap_off = sabre_onboard_imap_offset(ino); | 368 | imap_off = sabre_onboard_imap_offset(ino); |
461 | } | 369 | } |
462 | 370 | ||
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index bd578cc4856d..10306e476e38 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -443,7 +443,7 @@ static const struct user_regset sparc64_regsets[] = { | |||
443 | */ | 443 | */ |
444 | [REGSET_GENERAL] = { | 444 | [REGSET_GENERAL] = { |
445 | .core_note_type = NT_PRSTATUS, | 445 | .core_note_type = NT_PRSTATUS, |
446 | .n = 36 * sizeof(u64), | 446 | .n = 36, |
447 | .size = sizeof(u64), .align = sizeof(u64), | 447 | .size = sizeof(u64), .align = sizeof(u64), |
448 | .get = genregs64_get, .set = genregs64_set | 448 | .get = genregs64_get, .set = genregs64_set |
449 | }, | 449 | }, |
@@ -455,7 +455,7 @@ static const struct user_regset sparc64_regsets[] = { | |||
455 | */ | 455 | */ |
456 | [REGSET_FP] = { | 456 | [REGSET_FP] = { |
457 | .core_note_type = NT_PRFPREG, | 457 | .core_note_type = NT_PRFPREG, |
458 | .n = 35 * sizeof(u64), | 458 | .n = 35, |
459 | .size = sizeof(u64), .align = sizeof(u64), | 459 | .size = sizeof(u64), .align = sizeof(u64), |
460 | .get = fpregs64_get, .set = fpregs64_set | 460 | .get = fpregs64_get, .set = fpregs64_set |
461 | }, | 461 | }, |
@@ -801,7 +801,7 @@ static const struct user_regset sparc32_regsets[] = { | |||
801 | */ | 801 | */ |
802 | [REGSET_GENERAL] = { | 802 | [REGSET_GENERAL] = { |
803 | .core_note_type = NT_PRSTATUS, | 803 | .core_note_type = NT_PRSTATUS, |
804 | .n = 38 * sizeof(u32), | 804 | .n = 38, |
805 | .size = sizeof(u32), .align = sizeof(u32), | 805 | .size = sizeof(u32), .align = sizeof(u32), |
806 | .get = genregs32_get, .set = genregs32_set | 806 | .get = genregs32_get, .set = genregs32_set |
807 | }, | 807 | }, |
@@ -817,7 +817,7 @@ static const struct user_regset sparc32_regsets[] = { | |||
817 | */ | 817 | */ |
818 | [REGSET_FP] = { | 818 | [REGSET_FP] = { |
819 | .core_note_type = NT_PRFPREG, | 819 | .core_note_type = NT_PRFPREG, |
820 | .n = 99 * sizeof(u32), | 820 | .n = 99, |
821 | .size = sizeof(u32), .align = sizeof(u32), | 821 | .size = sizeof(u32), .align = sizeof(u32), |
822 | .get = fpregs32_get, .set = fpregs32_set | 822 | .get = fpregs32_get, .set = fpregs32_set |
823 | }, | 823 | }, |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 743ccad61c60..2be166c544ca 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -80,8 +80,6 @@ void smp_bogo(struct seq_file *m) | |||
80 | i, cpu_data(i).clock_tick); | 80 | i, cpu_data(i).clock_tick); |
81 | } | 81 | } |
82 | 82 | ||
83 | static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock); | ||
84 | |||
85 | extern void setup_sparc64_timer(void); | 83 | extern void setup_sparc64_timer(void); |
86 | 84 | ||
87 | static volatile unsigned long callin_flag = 0; | 85 | static volatile unsigned long callin_flag = 0; |
@@ -120,9 +118,9 @@ void __cpuinit smp_callin(void) | |||
120 | while (!cpu_isset(cpuid, smp_commenced_mask)) | 118 | while (!cpu_isset(cpuid, smp_commenced_mask)) |
121 | rmb(); | 119 | rmb(); |
122 | 120 | ||
123 | spin_lock(&call_lock); | 121 | ipi_call_lock(); |
124 | cpu_set(cpuid, cpu_online_map); | 122 | cpu_set(cpuid, cpu_online_map); |
125 | spin_unlock(&call_lock); | 123 | ipi_call_unlock(); |
126 | 124 | ||
127 | /* idle thread is expected to have preempt disabled */ | 125 | /* idle thread is expected to have preempt disabled */ |
128 | preempt_disable(); | 126 | preempt_disable(); |
@@ -1305,10 +1303,6 @@ int __cpu_disable(void) | |||
1305 | c->core_id = 0; | 1303 | c->core_id = 0; |
1306 | c->proc_id = -1; | 1304 | c->proc_id = -1; |
1307 | 1305 | ||
1308 | spin_lock(&call_lock); | ||
1309 | cpu_clear(cpu, cpu_online_map); | ||
1310 | spin_unlock(&call_lock); | ||
1311 | |||
1312 | smp_wmb(); | 1306 | smp_wmb(); |
1313 | 1307 | ||
1314 | /* Make sure no interrupts point to this cpu. */ | 1308 | /* Make sure no interrupts point to this cpu. */ |
@@ -1318,6 +1312,10 @@ int __cpu_disable(void) | |||
1318 | mdelay(1); | 1312 | mdelay(1); |
1319 | local_irq_disable(); | 1313 | local_irq_disable(); |
1320 | 1314 | ||
1315 | ipi_call_lock(); | ||
1316 | cpu_clear(cpu, cpu_online_map); | ||
1317 | ipi_call_unlock(); | ||
1318 | |||
1321 | return 0; | 1319 | return 0; |
1322 | } | 1320 | } |
1323 | 1321 | ||
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 3d924121c796..c824df13f589 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
13 | #include <linux/linkage.h> | ||
13 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
14 | #include <linux/signal.h> | 15 | #include <linux/signal.h> |
15 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
@@ -2453,7 +2454,7 @@ struct trap_per_cpu trap_block[NR_CPUS]; | |||
2453 | /* This can get invoked before sched_init() so play it super safe | 2454 | /* This can get invoked before sched_init() so play it super safe |
2454 | * and use hard_smp_processor_id(). | 2455 | * and use hard_smp_processor_id(). |
2455 | */ | 2456 | */ |
2456 | void init_cur_cpu_trap(struct thread_info *t) | 2457 | void notrace init_cur_cpu_trap(struct thread_info *t) |
2457 | { | 2458 | { |
2458 | int cpu = hard_smp_processor_id(); | 2459 | int cpu = hard_smp_processor_id(); |
2459 | struct trap_per_cpu *p = &trap_block[cpu]; | 2460 | struct trap_per_cpu *p = &trap_block[cpu]; |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index b4aeb0f696dc..a41df7bef035 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -1843,7 +1843,7 @@ static int pavail_rescan_ents __initdata; | |||
1843 | * memory list again, and make sure it provides at least as much | 1843 | * memory list again, and make sure it provides at least as much |
1844 | * memory as 'pavail' does. | 1844 | * memory as 'pavail' does. |
1845 | */ | 1845 | */ |
1846 | static void setup_valid_addr_bitmap_from_pavail(void) | 1846 | static void __init setup_valid_addr_bitmap_from_pavail(void) |
1847 | { | 1847 | { |
1848 | int i; | 1848 | int i; |
1849 | 1849 | ||
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 2c518fbc52ec..b225219c448c 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
@@ -382,14 +382,17 @@ config X86_OOSTORE | |||
382 | # P6_NOPs are a relatively minor optimization that require a family >= | 382 | # P6_NOPs are a relatively minor optimization that require a family >= |
383 | # 6 processor, except that it is broken on certain VIA chips. | 383 | # 6 processor, except that it is broken on certain VIA chips. |
384 | # Furthermore, AMD chips prefer a totally different sequence of NOPs | 384 | # Furthermore, AMD chips prefer a totally different sequence of NOPs |
385 | # (which work on all CPUs). As a result, disallow these if we're | 385 | # (which work on all CPUs). In addition, it looks like Virtual PC |
386 | # compiling X86_GENERIC but not X86_64 (these NOPs do work on all | 386 | # does not understand them. |
387 | # x86-64 capable chips); the list of processors in the right-hand clause | 387 | # |
388 | # are the cores that benefit from this optimization. | 388 | # As a result, disallow these if we're not compiling for X86_64 (these |
389 | # NOPs do work on all x86-64 capable chips); the list of processors in | ||
390 | # the right-hand clause are the cores that benefit from this optimization. | ||
389 | # | 391 | # |
390 | config X86_P6_NOP | 392 | config X86_P6_NOP |
391 | def_bool y | 393 | def_bool y |
392 | depends on (X86_64 || !X86_GENERIC) && (M686 || MPENTIUMII || MPENTIUMIII || MPENTIUMM || MCORE2 || MPENTIUM4 || MPSC) | 394 | depends on X86_64 |
395 | depends on (MCORE2 || MPENTIUM4 || MPSC) | ||
393 | 396 | ||
394 | config X86_TSC | 397 | config X86_TSC |
395 | def_bool y | 398 | def_bool y |
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c index 4b9ae7c56748..4d3ff037201f 100644 --- a/arch/x86/boot/cpucheck.c +++ b/arch/x86/boot/cpucheck.c | |||
@@ -38,12 +38,12 @@ static const u32 req_flags[NCAPINTS] = | |||
38 | { | 38 | { |
39 | REQUIRED_MASK0, | 39 | REQUIRED_MASK0, |
40 | REQUIRED_MASK1, | 40 | REQUIRED_MASK1, |
41 | REQUIRED_MASK2, | 41 | 0, /* REQUIRED_MASK2 not implemented in this file */ |
42 | REQUIRED_MASK3, | 42 | 0, /* REQUIRED_MASK3 not implemented in this file */ |
43 | REQUIRED_MASK4, | 43 | REQUIRED_MASK4, |
44 | REQUIRED_MASK5, | 44 | 0, /* REQUIRED_MASK5 not implemented in this file */ |
45 | REQUIRED_MASK6, | 45 | REQUIRED_MASK6, |
46 | REQUIRED_MASK7, | 46 | 0, /* REQUIRED_MASK7 not implemented in this file */ |
47 | }; | 47 | }; |
48 | 48 | ||
49 | #define A32(a, b, c, d) (((d) << 24)+((c) << 16)+((b) << 8)+(a)) | 49 | #define A32(a, b, c, d) (((d) << 24)+((c) << 16)+((b) << 8)+(a)) |
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 2763cb37b553..65a0c1b48696 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -145,35 +145,25 @@ static const unsigned char *const p6_nops[ASM_NOP_MAX+1] = { | |||
145 | extern char __vsyscall_0; | 145 | extern char __vsyscall_0; |
146 | const unsigned char *const *find_nop_table(void) | 146 | const unsigned char *const *find_nop_table(void) |
147 | { | 147 | { |
148 | return boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || | 148 | if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && |
149 | boot_cpu_data.x86 < 6 ? k8_nops : p6_nops; | 149 | boot_cpu_has(X86_FEATURE_NOPL)) |
150 | return p6_nops; | ||
151 | else | ||
152 | return k8_nops; | ||
150 | } | 153 | } |
151 | 154 | ||
152 | #else /* CONFIG_X86_64 */ | 155 | #else /* CONFIG_X86_64 */ |
153 | 156 | ||
154 | static const struct nop { | ||
155 | int cpuid; | ||
156 | const unsigned char *const *noptable; | ||
157 | } noptypes[] = { | ||
158 | { X86_FEATURE_K8, k8_nops }, | ||
159 | { X86_FEATURE_K7, k7_nops }, | ||
160 | { X86_FEATURE_P4, p6_nops }, | ||
161 | { X86_FEATURE_P3, p6_nops }, | ||
162 | { -1, NULL } | ||
163 | }; | ||
164 | |||
165 | const unsigned char *const *find_nop_table(void) | 157 | const unsigned char *const *find_nop_table(void) |
166 | { | 158 | { |
167 | const unsigned char *const *noptable = intel_nops; | 159 | if (boot_cpu_has(X86_FEATURE_K8)) |
168 | int i; | 160 | return k8_nops; |
169 | 161 | else if (boot_cpu_has(X86_FEATURE_K7)) | |
170 | for (i = 0; noptypes[i].cpuid >= 0; i++) { | 162 | return k7_nops; |
171 | if (boot_cpu_has(noptypes[i].cpuid)) { | 163 | else if (boot_cpu_has(X86_FEATURE_NOPL)) |
172 | noptable = noptypes[i].noptable; | 164 | return p6_nops; |
173 | break; | 165 | else |
174 | } | 166 | return intel_nops; |
175 | } | ||
176 | return noptable; | ||
177 | } | 167 | } |
178 | 168 | ||
179 | #endif /* CONFIG_X86_64 */ | 169 | #endif /* CONFIG_X86_64 */ |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index cae9cabc3031..18514ed26104 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -31,6 +31,11 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
31 | if (c->x86_power & (1<<8)) | 31 | if (c->x86_power & (1<<8)) |
32 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | 32 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |
33 | } | 33 | } |
34 | |||
35 | /* Set MTRR capability flag if appropriate */ | ||
36 | if (c->x86_model == 13 || c->x86_model == 9 || | ||
37 | (c->x86_model == 8 && c->x86_mask >= 8)) | ||
38 | set_cpu_cap(c, X86_FEATURE_K6_MTRR); | ||
34 | } | 39 | } |
35 | 40 | ||
36 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) | 41 | static void __cpuinit init_amd(struct cpuinfo_x86 *c) |
@@ -166,10 +171,6 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
166 | mbytes); | 171 | mbytes); |
167 | } | 172 | } |
168 | 173 | ||
169 | /* Set MTRR capability flag if appropriate */ | ||
170 | if (c->x86_model == 13 || c->x86_model == 9 || | ||
171 | (c->x86_model == 8 && c->x86_mask >= 8)) | ||
172 | set_cpu_cap(c, X86_FEATURE_K6_MTRR); | ||
173 | break; | 174 | break; |
174 | } | 175 | } |
175 | 176 | ||
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index e0f45edd6a55..a0534c04d38a 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c | |||
@@ -314,6 +314,16 @@ enum { | |||
314 | EAMD3D = 1<<20, | 314 | EAMD3D = 1<<20, |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static void __cpuinit early_init_centaur(struct cpuinfo_x86 *c) | ||
318 | { | ||
319 | switch (c->x86) { | ||
320 | case 5: | ||
321 | /* Emulate MTRRs using Centaur's MCR. */ | ||
322 | set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); | ||
323 | break; | ||
324 | } | ||
325 | } | ||
326 | |||
317 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) | 327 | static void __cpuinit init_centaur(struct cpuinfo_x86 *c) |
318 | { | 328 | { |
319 | 329 | ||
@@ -462,6 +472,7 @@ centaur_size_cache(struct cpuinfo_x86 *c, unsigned int size) | |||
462 | static struct cpu_dev centaur_cpu_dev __cpuinitdata = { | 472 | static struct cpu_dev centaur_cpu_dev __cpuinitdata = { |
463 | .c_vendor = "Centaur", | 473 | .c_vendor = "Centaur", |
464 | .c_ident = { "CentaurHauls" }, | 474 | .c_ident = { "CentaurHauls" }, |
475 | .c_early_init = early_init_centaur, | ||
465 | .c_init = init_centaur, | 476 | .c_init = init_centaur, |
466 | .c_size_cache = centaur_size_cache, | 477 | .c_size_cache = centaur_size_cache, |
467 | }; | 478 | }; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 80ab20d4fa39..4e456bd955bb 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mtrr.h> | 13 | #include <asm/mtrr.h> |
14 | #include <asm/mce.h> | 14 | #include <asm/mce.h> |
15 | #include <asm/pat.h> | 15 | #include <asm/pat.h> |
16 | #include <asm/asm.h> | ||
16 | #ifdef CONFIG_X86_LOCAL_APIC | 17 | #ifdef CONFIG_X86_LOCAL_APIC |
17 | #include <asm/mpspec.h> | 18 | #include <asm/mpspec.h> |
18 | #include <asm/apic.h> | 19 | #include <asm/apic.h> |
@@ -334,11 +335,24 @@ static void __init early_cpu_detect(void) | |||
334 | 335 | ||
335 | get_cpu_vendor(c, 1); | 336 | get_cpu_vendor(c, 1); |
336 | 337 | ||
338 | early_get_cap(c); | ||
339 | |||
337 | if (c->x86_vendor != X86_VENDOR_UNKNOWN && | 340 | if (c->x86_vendor != X86_VENDOR_UNKNOWN && |
338 | cpu_devs[c->x86_vendor]->c_early_init) | 341 | cpu_devs[c->x86_vendor]->c_early_init) |
339 | cpu_devs[c->x86_vendor]->c_early_init(c); | 342 | cpu_devs[c->x86_vendor]->c_early_init(c); |
343 | } | ||
340 | 344 | ||
341 | early_get_cap(c); | 345 | /* |
346 | * The NOPL instruction is supposed to exist on all CPUs with | ||
347 | * family >= 6; unfortunately, that's not true in practice because | ||
348 | * of early VIA chips and (more importantly) broken virtualizers that | ||
349 | * are not easy to detect. In the latter case it doesn't even *fail* | ||
350 | * reliably, so probing for it doesn't even work. Disable it completely | ||
351 | * unless we can find a reliable way to detect all the broken cases. | ||
352 | */ | ||
353 | static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) | ||
354 | { | ||
355 | clear_cpu_cap(c, X86_FEATURE_NOPL); | ||
342 | } | 356 | } |
343 | 357 | ||
344 | static void __cpuinit generic_identify(struct cpuinfo_x86 *c) | 358 | static void __cpuinit generic_identify(struct cpuinfo_x86 *c) |
@@ -395,8 +409,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c) | |||
395 | } | 409 | } |
396 | 410 | ||
397 | init_scattered_cpuid_features(c); | 411 | init_scattered_cpuid_features(c); |
412 | detect_nopl(c); | ||
398 | } | 413 | } |
399 | |||
400 | } | 414 | } |
401 | 415 | ||
402 | static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) | 416 | static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c index dd6e3f15017e..a11f5d4477cd 100644 --- a/arch/x86/kernel/cpu/common_64.c +++ b/arch/x86/kernel/cpu/common_64.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <asm/mtrr.h> | 18 | #include <asm/mtrr.h> |
19 | #include <asm/mce.h> | 19 | #include <asm/mce.h> |
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <asm/asm.h> | ||
21 | #include <asm/numa.h> | 22 | #include <asm/numa.h> |
22 | #ifdef CONFIG_X86_LOCAL_APIC | 23 | #ifdef CONFIG_X86_LOCAL_APIC |
23 | #include <asm/mpspec.h> | 24 | #include <asm/mpspec.h> |
@@ -215,6 +216,39 @@ static void __init early_cpu_support_print(void) | |||
215 | } | 216 | } |
216 | } | 217 | } |
217 | 218 | ||
219 | /* | ||
220 | * The NOPL instruction is supposed to exist on all CPUs with | ||
221 | * family >= 6, unfortunately, that's not true in practice because | ||
222 | * of early VIA chips and (more importantly) broken virtualizers that | ||
223 | * are not easy to detect. Hence, probe for it based on first | ||
224 | * principles. | ||
225 | * | ||
226 | * Note: no 64-bit chip is known to lack these, but put the code here | ||
227 | * for consistency with 32 bits, and to make it utterly trivial to | ||
228 | * diagnose the problem should it ever surface. | ||
229 | */ | ||
230 | static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) | ||
231 | { | ||
232 | const u32 nopl_signature = 0x888c53b1; /* Random number */ | ||
233 | u32 has_nopl = nopl_signature; | ||
234 | |||
235 | clear_cpu_cap(c, X86_FEATURE_NOPL); | ||
236 | if (c->x86 >= 6) { | ||
237 | asm volatile("\n" | ||
238 | "1: .byte 0x0f,0x1f,0xc0\n" /* nopl %eax */ | ||
239 | "2:\n" | ||
240 | " .section .fixup,\"ax\"\n" | ||
241 | "3: xor %0,%0\n" | ||
242 | " jmp 2b\n" | ||
243 | " .previous\n" | ||
244 | _ASM_EXTABLE(1b,3b) | ||
245 | : "+a" (has_nopl)); | ||
246 | |||
247 | if (has_nopl == nopl_signature) | ||
248 | set_cpu_cap(c, X86_FEATURE_NOPL); | ||
249 | } | ||
250 | } | ||
251 | |||
218 | static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c); | 252 | static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c); |
219 | 253 | ||
220 | void __init early_cpu_init(void) | 254 | void __init early_cpu_init(void) |
@@ -313,6 +347,8 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) | |||
313 | c->x86_phys_bits = eax & 0xff; | 347 | c->x86_phys_bits = eax & 0xff; |
314 | } | 348 | } |
315 | 349 | ||
350 | detect_nopl(c); | ||
351 | |||
316 | if (c->x86_vendor != X86_VENDOR_UNKNOWN && | 352 | if (c->x86_vendor != X86_VENDOR_UNKNOWN && |
317 | cpu_devs[c->x86_vendor]->c_early_init) | 353 | cpu_devs[c->x86_vendor]->c_early_init) |
318 | cpu_devs[c->x86_vendor]->c_early_init(c); | 354 | cpu_devs[c->x86_vendor]->c_early_init(c); |
@@ -493,17 +529,20 @@ void pda_init(int cpu) | |||
493 | /* others are initialized in smpboot.c */ | 529 | /* others are initialized in smpboot.c */ |
494 | pda->pcurrent = &init_task; | 530 | pda->pcurrent = &init_task; |
495 | pda->irqstackptr = boot_cpu_stack; | 531 | pda->irqstackptr = boot_cpu_stack; |
532 | pda->irqstackptr += IRQSTACKSIZE - 64; | ||
496 | } else { | 533 | } else { |
497 | pda->irqstackptr = (char *) | 534 | if (!pda->irqstackptr) { |
498 | __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); | 535 | pda->irqstackptr = (char *) |
499 | if (!pda->irqstackptr) | 536 | __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); |
500 | panic("cannot allocate irqstack for cpu %d", cpu); | 537 | if (!pda->irqstackptr) |
538 | panic("cannot allocate irqstack for cpu %d", | ||
539 | cpu); | ||
540 | pda->irqstackptr += IRQSTACKSIZE - 64; | ||
541 | } | ||
501 | 542 | ||
502 | if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE) | 543 | if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE) |
503 | pda->nodenumber = cpu_to_node(cpu); | 544 | pda->nodenumber = cpu_to_node(cpu); |
504 | } | 545 | } |
505 | |||
506 | pda->irqstackptr += IRQSTACKSIZE-64; | ||
507 | } | 546 | } |
508 | 547 | ||
509 | char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + | 548 | char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + |
@@ -601,19 +640,22 @@ void __cpuinit cpu_init(void) | |||
601 | /* | 640 | /* |
602 | * set up and load the per-CPU TSS | 641 | * set up and load the per-CPU TSS |
603 | */ | 642 | */ |
604 | for (v = 0; v < N_EXCEPTION_STACKS; v++) { | 643 | if (!orig_ist->ist[0]) { |
605 | static const unsigned int order[N_EXCEPTION_STACKS] = { | 644 | static const unsigned int order[N_EXCEPTION_STACKS] = { |
606 | [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, | 645 | [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, |
607 | [DEBUG_STACK - 1] = DEBUG_STACK_ORDER | 646 | [DEBUG_STACK - 1] = DEBUG_STACK_ORDER |
608 | }; | 647 | }; |
609 | if (cpu) { | 648 | for (v = 0; v < N_EXCEPTION_STACKS; v++) { |
610 | estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); | 649 | if (cpu) { |
611 | if (!estacks) | 650 | estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); |
612 | panic("Cannot allocate exception stack %ld %d\n", | 651 | if (!estacks) |
613 | v, cpu); | 652 | panic("Cannot allocate exception " |
653 | "stack %ld %d\n", v, cpu); | ||
654 | } | ||
655 | estacks += PAGE_SIZE << order[v]; | ||
656 | orig_ist->ist[v] = t->x86_tss.ist[v] = | ||
657 | (unsigned long)estacks; | ||
614 | } | 658 | } |
615 | estacks += PAGE_SIZE << order[v]; | ||
616 | orig_ist->ist[v] = t->x86_tss.ist[v] = (unsigned long)estacks; | ||
617 | } | 659 | } |
618 | 660 | ||
619 | t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); | 661 | t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); |
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index e710a21bb6e8..898a5a2002ed 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c | |||
@@ -15,13 +15,11 @@ | |||
15 | /* | 15 | /* |
16 | * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU | 16 | * Read NSC/Cyrix DEVID registers (DIR) to get more detailed info. about the CPU |
17 | */ | 17 | */ |
18 | static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) | 18 | static void __cpuinit __do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) |
19 | { | 19 | { |
20 | unsigned char ccr2, ccr3; | 20 | unsigned char ccr2, ccr3; |
21 | unsigned long flags; | ||
22 | 21 | ||
23 | /* we test for DEVID by checking whether CCR3 is writable */ | 22 | /* we test for DEVID by checking whether CCR3 is writable */ |
24 | local_irq_save(flags); | ||
25 | ccr3 = getCx86(CX86_CCR3); | 23 | ccr3 = getCx86(CX86_CCR3); |
26 | setCx86(CX86_CCR3, ccr3 ^ 0x80); | 24 | setCx86(CX86_CCR3, ccr3 ^ 0x80); |
27 | getCx86(0xc0); /* dummy to change bus */ | 25 | getCx86(0xc0); /* dummy to change bus */ |
@@ -44,9 +42,16 @@ static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) | |||
44 | *dir0 = getCx86(CX86_DIR0); | 42 | *dir0 = getCx86(CX86_DIR0); |
45 | *dir1 = getCx86(CX86_DIR1); | 43 | *dir1 = getCx86(CX86_DIR1); |
46 | } | 44 | } |
47 | local_irq_restore(flags); | ||
48 | } | 45 | } |
49 | 46 | ||
47 | static void __cpuinit do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) | ||
48 | { | ||
49 | unsigned long flags; | ||
50 | |||
51 | local_irq_save(flags); | ||
52 | __do_cyrix_devid(dir0, dir1); | ||
53 | local_irq_restore(flags); | ||
54 | } | ||
50 | /* | 55 | /* |
51 | * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in | 56 | * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in |
52 | * order to identify the Cyrix CPU model after we're out of setup.c | 57 | * order to identify the Cyrix CPU model after we're out of setup.c |
@@ -161,6 +166,24 @@ static void __cpuinit geode_configure(void) | |||
161 | local_irq_restore(flags); | 166 | local_irq_restore(flags); |
162 | } | 167 | } |
163 | 168 | ||
169 | static void __cpuinit early_init_cyrix(struct cpuinfo_x86 *c) | ||
170 | { | ||
171 | unsigned char dir0, dir0_msn, dir1 = 0; | ||
172 | |||
173 | __do_cyrix_devid(&dir0, &dir1); | ||
174 | dir0_msn = dir0 >> 4; /* identifies CPU "family" */ | ||
175 | |||
176 | switch (dir0_msn) { | ||
177 | case 3: /* 6x86/6x86L */ | ||
178 | /* Emulate MTRRs using Cyrix's ARRs. */ | ||
179 | set_cpu_cap(c, X86_FEATURE_CYRIX_ARR); | ||
180 | break; | ||
181 | case 5: /* 6x86MX/M II */ | ||
182 | /* Emulate MTRRs using Cyrix's ARRs. */ | ||
183 | set_cpu_cap(c, X86_FEATURE_CYRIX_ARR); | ||
184 | break; | ||
185 | } | ||
186 | } | ||
164 | 187 | ||
165 | static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) | 188 | static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) |
166 | { | 189 | { |
@@ -416,6 +439,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c) | |||
416 | static struct cpu_dev cyrix_cpu_dev __cpuinitdata = { | 439 | static struct cpu_dev cyrix_cpu_dev __cpuinitdata = { |
417 | .c_vendor = "Cyrix", | 440 | .c_vendor = "Cyrix", |
418 | .c_ident = { "CyrixInstead" }, | 441 | .c_ident = { "CyrixInstead" }, |
442 | .c_early_init = early_init_cyrix, | ||
419 | .c_init = init_cyrix, | 443 | .c_init = init_cyrix, |
420 | .c_identify = cyrix_identify, | 444 | .c_identify = cyrix_identify, |
421 | }; | 445 | }; |
diff --git a/arch/x86/kernel/cpu/feature_names.c b/arch/x86/kernel/cpu/feature_names.c index e43ad4ad4cba..c9017799497c 100644 --- a/arch/x86/kernel/cpu/feature_names.c +++ b/arch/x86/kernel/cpu/feature_names.c | |||
@@ -39,7 +39,8 @@ const char * const x86_cap_flags[NCAPINTS*32] = { | |||
39 | NULL, NULL, NULL, NULL, | 39 | NULL, NULL, NULL, NULL, |
40 | "constant_tsc", "up", NULL, "arch_perfmon", | 40 | "constant_tsc", "up", NULL, "arch_perfmon", |
41 | "pebs", "bts", NULL, NULL, | 41 | "pebs", "bts", NULL, NULL, |
42 | "rep_good", NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 42 | "rep_good", NULL, NULL, NULL, |
43 | "nopl", NULL, NULL, NULL, | ||
43 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 44 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
44 | 45 | ||
45 | /* Intel-defined (#2) */ | 46 | /* Intel-defined (#2) */ |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 9af89078f7bb..66e48aa2dd1b 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1203,7 +1203,7 @@ static int __init parse_memmap_opt(char *p) | |||
1203 | if (!p) | 1203 | if (!p) |
1204 | return -EINVAL; | 1204 | return -EINVAL; |
1205 | 1205 | ||
1206 | if (!strcmp(p, "exactmap")) { | 1206 | if (!strncmp(p, "exactmap", 8)) { |
1207 | #ifdef CONFIG_CRASH_DUMP | 1207 | #ifdef CONFIG_CRASH_DUMP |
1208 | /* | 1208 | /* |
1209 | * If we are doing a crash dump, we still need to know | 1209 | * If we are doing a crash dump, we still need to know |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 59fd3b6b1303..73deaffadd03 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -210,8 +210,8 @@ static void hpet_legacy_clockevent_register(void) | |||
210 | /* Calculate the min / max delta */ | 210 | /* Calculate the min / max delta */ |
211 | hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF, | 211 | hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF, |
212 | &hpet_clockevent); | 212 | &hpet_clockevent); |
213 | hpet_clockevent.min_delta_ns = clockevent_delta2ns(0x30, | 213 | /* 5 usec minimum reprogramming delta. */ |
214 | &hpet_clockevent); | 214 | hpet_clockevent.min_delta_ns = 5000; |
215 | 215 | ||
216 | /* | 216 | /* |
217 | * Start hpet with the boot cpu mask and make it | 217 | * Start hpet with the boot cpu mask and make it |
@@ -270,15 +270,22 @@ static void hpet_legacy_set_mode(enum clock_event_mode mode, | |||
270 | } | 270 | } |
271 | 271 | ||
272 | static int hpet_legacy_next_event(unsigned long delta, | 272 | static int hpet_legacy_next_event(unsigned long delta, |
273 | struct clock_event_device *evt) | 273 | struct clock_event_device *evt) |
274 | { | 274 | { |
275 | unsigned long cnt; | 275 | u32 cnt; |
276 | 276 | ||
277 | cnt = hpet_readl(HPET_COUNTER); | 277 | cnt = hpet_readl(HPET_COUNTER); |
278 | cnt += delta; | 278 | cnt += (u32) delta; |
279 | hpet_writel(cnt, HPET_T0_CMP); | 279 | hpet_writel(cnt, HPET_T0_CMP); |
280 | 280 | ||
281 | return ((long)(hpet_readl(HPET_COUNTER) - cnt ) > 0) ? -ETIME : 0; | 281 | /* |
282 | * We need to read back the CMP register to make sure that | ||
283 | * what we wrote hit the chip before we compare it to the | ||
284 | * counter. | ||
285 | */ | ||
286 | WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt); | ||
287 | |||
288 | return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; | ||
282 | } | 289 | } |
283 | 290 | ||
284 | /* | 291 | /* |
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c index 1c3a66a67f83..720d2607aacb 100644 --- a/arch/x86/kernel/io_delay.c +++ b/arch/x86/kernel/io_delay.c | |||
@@ -92,6 +92,14 @@ static struct dmi_system_id __initdata io_delay_0xed_port_dmi_table[] = { | |||
92 | DMI_MATCH(DMI_BOARD_NAME, "30BF") | 92 | DMI_MATCH(DMI_BOARD_NAME, "30BF") |
93 | } | 93 | } |
94 | }, | 94 | }, |
95 | { | ||
96 | .callback = dmi_io_delay_0xed_port, | ||
97 | .ident = "Presario F700", | ||
98 | .matches = { | ||
99 | DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), | ||
100 | DMI_MATCH(DMI_BOARD_NAME, "30D3") | ||
101 | } | ||
102 | }, | ||
95 | { } | 103 | { } |
96 | }; | 104 | }; |
97 | 105 | ||
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index f2d43bc75514..ff7d3b0124f1 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
@@ -139,6 +139,7 @@ static int __init create_setup_data_nodes(struct dentry *parent) | |||
139 | if (PageHighMem(pg)) { | 139 | if (PageHighMem(pg)) { |
140 | data = ioremap_cache(pa_data, sizeof(*data)); | 140 | data = ioremap_cache(pa_data, sizeof(*data)); |
141 | if (!data) { | 141 | if (!data) { |
142 | kfree(node); | ||
142 | error = -ENXIO; | 143 | error = -ENXIO; |
143 | goto err_dir; | 144 | goto err_dir; |
144 | } | 145 | } |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 362d4e7f2d38..9838f2539dfc 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -670,6 +670,10 @@ void __init setup_arch(char **cmdline_p) | |||
670 | 670 | ||
671 | parse_early_param(); | 671 | parse_early_param(); |
672 | 672 | ||
673 | #ifdef CONFIG_X86_64 | ||
674 | check_efer(); | ||
675 | #endif | ||
676 | |||
673 | #if defined(CONFIG_VMI) && defined(CONFIG_X86_32) | 677 | #if defined(CONFIG_VMI) && defined(CONFIG_X86_32) |
674 | /* | 678 | /* |
675 | * Must be before kernel pagetables are setup | 679 | * Must be before kernel pagetables are setup |
@@ -738,7 +742,6 @@ void __init setup_arch(char **cmdline_p) | |||
738 | #else | 742 | #else |
739 | num_physpages = max_pfn; | 743 | num_physpages = max_pfn; |
740 | 744 | ||
741 | check_efer(); | ||
742 | 745 | ||
743 | /* How many end-of-memory variables you have, grandma! */ | 746 | /* How many end-of-memory variables you have, grandma! */ |
744 | /* need this before calling reserve_initrd */ | 747 | /* need this before calling reserve_initrd */ |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 8e786b0d665a..8f98e9de1b82 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -122,80 +122,216 @@ static u64 tsc_read_refs(u64 *pm, u64 *hpet) | |||
122 | return ULLONG_MAX; | 122 | return ULLONG_MAX; |
123 | } | 123 | } |
124 | 124 | ||
125 | /** | 125 | /* |
126 | * native_calibrate_tsc - calibrate the tsc on boot | 126 | * Try to calibrate the TSC against the Programmable |
127 | * Interrupt Timer and return the frequency of the TSC | ||
128 | * in kHz. | ||
129 | * | ||
130 | * Return ULONG_MAX on failure to calibrate. | ||
127 | */ | 131 | */ |
128 | unsigned long native_calibrate_tsc(void) | 132 | static unsigned long pit_calibrate_tsc(void) |
129 | { | 133 | { |
130 | unsigned long flags; | 134 | u64 tsc, t1, t2, delta; |
131 | u64 tsc1, tsc2, tr1, tr2, delta, pm1, pm2, hpet1, hpet2; | 135 | unsigned long tscmin, tscmax; |
132 | int hpet = is_hpet_enabled(); | 136 | int pitcnt; |
133 | unsigned int tsc_khz_val = 0; | ||
134 | |||
135 | local_irq_save(flags); | ||
136 | |||
137 | tsc1 = tsc_read_refs(&pm1, hpet ? &hpet1 : NULL); | ||
138 | 137 | ||
138 | /* Set the Gate high, disable speaker */ | ||
139 | outb((inb(0x61) & ~0x02) | 0x01, 0x61); | 139 | outb((inb(0x61) & ~0x02) | 0x01, 0x61); |
140 | 140 | ||
141 | /* | ||
142 | * Setup CTC channel 2* for mode 0, (interrupt on terminal | ||
143 | * count mode), binary count. Set the latch register to 50ms | ||
144 | * (LSB then MSB) to begin countdown. | ||
145 | */ | ||
141 | outb(0xb0, 0x43); | 146 | outb(0xb0, 0x43); |
142 | outb((CLOCK_TICK_RATE / (1000 / 50)) & 0xff, 0x42); | 147 | outb((CLOCK_TICK_RATE / (1000 / 50)) & 0xff, 0x42); |
143 | outb((CLOCK_TICK_RATE / (1000 / 50)) >> 8, 0x42); | 148 | outb((CLOCK_TICK_RATE / (1000 / 50)) >> 8, 0x42); |
144 | tr1 = get_cycles(); | ||
145 | while ((inb(0x61) & 0x20) == 0); | ||
146 | tr2 = get_cycles(); | ||
147 | 149 | ||
148 | tsc2 = tsc_read_refs(&pm2, hpet ? &hpet2 : NULL); | 150 | tsc = t1 = t2 = get_cycles(); |
149 | 151 | ||
150 | local_irq_restore(flags); | 152 | pitcnt = 0; |
153 | tscmax = 0; | ||
154 | tscmin = ULONG_MAX; | ||
155 | while ((inb(0x61) & 0x20) == 0) { | ||
156 | t2 = get_cycles(); | ||
157 | delta = t2 - tsc; | ||
158 | tsc = t2; | ||
159 | if ((unsigned long) delta < tscmin) | ||
160 | tscmin = (unsigned int) delta; | ||
161 | if ((unsigned long) delta > tscmax) | ||
162 | tscmax = (unsigned int) delta; | ||
163 | pitcnt++; | ||
164 | } | ||
151 | 165 | ||
152 | /* | 166 | /* |
153 | * Preset the result with the raw and inaccurate PIT | 167 | * Sanity checks: |
154 | * calibration value | 168 | * |
169 | * If we were not able to read the PIT more than 5000 | ||
170 | * times, then we have been hit by a massive SMI | ||
171 | * | ||
172 | * If the maximum is 10 times larger than the minimum, | ||
173 | * then we got hit by an SMI as well. | ||
155 | */ | 174 | */ |
156 | delta = (tr2 - tr1); | 175 | if (pitcnt < 5000 || tscmax > 10 * tscmin) |
176 | return ULONG_MAX; | ||
177 | |||
178 | /* Calculate the PIT value */ | ||
179 | delta = t2 - t1; | ||
157 | do_div(delta, 50); | 180 | do_div(delta, 50); |
158 | tsc_khz_val = delta; | 181 | return delta; |
182 | } | ||
183 | |||
184 | |||
185 | /** | ||
186 | * native_calibrate_tsc - calibrate the tsc on boot | ||
187 | */ | ||
188 | unsigned long native_calibrate_tsc(void) | ||
189 | { | ||
190 | u64 tsc1, tsc2, delta, pm1, pm2, hpet1, hpet2; | ||
191 | unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX; | ||
192 | unsigned long flags; | ||
193 | int hpet = is_hpet_enabled(), i; | ||
159 | 194 | ||
160 | /* hpet or pmtimer available ? */ | 195 | /* |
196 | * Run 5 calibration loops to get the lowest frequency value | ||
197 | * (the best estimate). We use two different calibration modes | ||
198 | * here: | ||
199 | * | ||
200 | * 1) PIT loop. We set the PIT Channel 2 to oneshot mode and | ||
201 | * load a timeout of 50ms. We read the time right after we | ||
202 | * started the timer and wait until the PIT count down reaches | ||
203 | * zero. In each wait loop iteration we read the TSC and check | ||
204 | * the delta to the previous read. We keep track of the min | ||
205 | * and max values of that delta. The delta is mostly defined | ||
206 | * by the IO time of the PIT access, so we can detect when a | ||
207 | * SMI/SMM disturbance happend between the two reads. If the | ||
208 | * maximum time is significantly larger than the minimum time, | ||
209 | * then we discard the result and have another try. | ||
210 | * | ||
211 | * 2) Reference counter. If available we use the HPET or the | ||
212 | * PMTIMER as a reference to check the sanity of that value. | ||
213 | * We use separate TSC readouts and check inside of the | ||
214 | * reference read for a SMI/SMM disturbance. We dicard | ||
215 | * disturbed values here as well. We do that around the PIT | ||
216 | * calibration delay loop as we have to wait for a certain | ||
217 | * amount of time anyway. | ||
218 | */ | ||
219 | for (i = 0; i < 5; i++) { | ||
220 | unsigned long tsc_pit_khz; | ||
221 | |||
222 | /* | ||
223 | * Read the start value and the reference count of | ||
224 | * hpet/pmtimer when available. Then do the PIT | ||
225 | * calibration, which will take at least 50ms, and | ||
226 | * read the end value. | ||
227 | */ | ||
228 | local_irq_save(flags); | ||
229 | tsc1 = tsc_read_refs(&pm1, hpet ? &hpet1 : NULL); | ||
230 | tsc_pit_khz = pit_calibrate_tsc(); | ||
231 | tsc2 = tsc_read_refs(&pm2, hpet ? &hpet2 : NULL); | ||
232 | local_irq_restore(flags); | ||
233 | |||
234 | /* Pick the lowest PIT TSC calibration so far */ | ||
235 | tsc_pit_min = min(tsc_pit_min, tsc_pit_khz); | ||
236 | |||
237 | /* hpet or pmtimer available ? */ | ||
238 | if (!hpet && !pm1 && !pm2) | ||
239 | continue; | ||
240 | |||
241 | /* Check, whether the sampling was disturbed by an SMI */ | ||
242 | if (tsc1 == ULLONG_MAX || tsc2 == ULLONG_MAX) | ||
243 | continue; | ||
244 | |||
245 | tsc2 = (tsc2 - tsc1) * 1000000LL; | ||
246 | |||
247 | if (hpet) { | ||
248 | if (hpet2 < hpet1) | ||
249 | hpet2 += 0x100000000ULL; | ||
250 | hpet2 -= hpet1; | ||
251 | tsc1 = ((u64)hpet2 * hpet_readl(HPET_PERIOD)); | ||
252 | do_div(tsc1, 1000000); | ||
253 | } else { | ||
254 | if (pm2 < pm1) | ||
255 | pm2 += (u64)ACPI_PM_OVRRUN; | ||
256 | pm2 -= pm1; | ||
257 | tsc1 = pm2 * 1000000000LL; | ||
258 | do_div(tsc1, PMTMR_TICKS_PER_SEC); | ||
259 | } | ||
260 | |||
261 | do_div(tsc2, tsc1); | ||
262 | tsc_ref_min = min(tsc_ref_min, (unsigned long) tsc2); | ||
263 | } | ||
264 | |||
265 | /* | ||
266 | * Now check the results. | ||
267 | */ | ||
268 | if (tsc_pit_min == ULONG_MAX) { | ||
269 | /* PIT gave no useful value */ | ||
270 | printk(KERN_WARNING "TSC: Unable to calibrate against PIT\n"); | ||
271 | |||
272 | /* We don't have an alternative source, disable TSC */ | ||
273 | if (!hpet && !pm1 && !pm2) { | ||
274 | printk("TSC: No reference (HPET/PMTIMER) available\n"); | ||
275 | return 0; | ||
276 | } | ||
277 | |||
278 | /* The alternative source failed as well, disable TSC */ | ||
279 | if (tsc_ref_min == ULONG_MAX) { | ||
280 | printk(KERN_WARNING "TSC: HPET/PMTIMER calibration " | ||
281 | "failed due to SMI disturbance.\n"); | ||
282 | return 0; | ||
283 | } | ||
284 | |||
285 | /* Use the alternative source */ | ||
286 | printk(KERN_INFO "TSC: using %s reference calibration\n", | ||
287 | hpet ? "HPET" : "PMTIMER"); | ||
288 | |||
289 | return tsc_ref_min; | ||
290 | } | ||
291 | |||
292 | /* We don't have an alternative source, use the PIT calibration value */ | ||
161 | if (!hpet && !pm1 && !pm2) { | 293 | if (!hpet && !pm1 && !pm2) { |
162 | printk(KERN_INFO "TSC calibrated against PIT\n"); | 294 | printk(KERN_INFO "TSC: Using PIT calibration value\n"); |
163 | goto out; | 295 | return tsc_pit_min; |
164 | } | 296 | } |
165 | 297 | ||
166 | /* Check, whether the sampling was disturbed by an SMI */ | 298 | /* The alternative source failed, use the PIT calibration value */ |
167 | if (tsc1 == ULLONG_MAX || tsc2 == ULLONG_MAX) { | 299 | if (tsc_ref_min == ULONG_MAX) { |
168 | printk(KERN_WARNING "TSC calibration disturbed by SMI, " | 300 | printk(KERN_WARNING "TSC: HPET/PMTIMER calibration failed due " |
169 | "using PIT calibration result\n"); | 301 | "to SMI disturbance. Using PIT calibration\n"); |
170 | goto out; | 302 | return tsc_pit_min; |
171 | } | 303 | } |
172 | 304 | ||
173 | tsc2 = (tsc2 - tsc1) * 1000000LL; | 305 | /* Check the reference deviation */ |
174 | 306 | delta = ((u64) tsc_pit_min) * 100; | |
175 | if (hpet) { | 307 | do_div(delta, tsc_ref_min); |
176 | printk(KERN_INFO "TSC calibrated against HPET\n"); | 308 | |
177 | if (hpet2 < hpet1) | 309 | /* |
178 | hpet2 += 0x100000000ULL; | 310 | * If both calibration results are inside a 5% window, the we |
179 | hpet2 -= hpet1; | 311 | * use the lower frequency of those as it is probably the |
180 | tsc1 = ((u64)hpet2 * hpet_readl(HPET_PERIOD)); | 312 | * closest estimate. |
181 | do_div(tsc1, 1000000); | 313 | */ |
182 | } else { | 314 | if (delta >= 95 && delta <= 105) { |
183 | printk(KERN_INFO "TSC calibrated against PM_TIMER\n"); | 315 | printk(KERN_INFO "TSC: PIT calibration confirmed by %s.\n", |
184 | if (pm2 < pm1) | 316 | hpet ? "HPET" : "PMTIMER"); |
185 | pm2 += (u64)ACPI_PM_OVRRUN; | 317 | printk(KERN_INFO "TSC: using %s calibration value\n", |
186 | pm2 -= pm1; | 318 | tsc_pit_min <= tsc_ref_min ? "PIT" : |
187 | tsc1 = pm2 * 1000000000LL; | 319 | hpet ? "HPET" : "PMTIMER"); |
188 | do_div(tsc1, PMTMR_TICKS_PER_SEC); | 320 | return tsc_pit_min <= tsc_ref_min ? tsc_pit_min : tsc_ref_min; |
189 | } | 321 | } |
190 | 322 | ||
191 | do_div(tsc2, tsc1); | 323 | printk(KERN_WARNING "TSC: PIT calibration deviates from %s: %lu %lu.\n", |
192 | tsc_khz_val = tsc2; | 324 | hpet ? "HPET" : "PMTIMER", tsc_pit_min, tsc_ref_min); |
193 | 325 | ||
194 | out: | 326 | /* |
195 | return tsc_khz_val; | 327 | * The calibration values differ too much. In doubt, we use |
328 | * the PIT value as we know that there are PMTIMERs around | ||
329 | * running at double speed. | ||
330 | */ | ||
331 | printk(KERN_INFO "TSC: Using PIT calibration value\n"); | ||
332 | return tsc_pit_min; | ||
196 | } | 333 | } |
197 | 334 | ||
198 | |||
199 | #ifdef CONFIG_X86_32 | 335 | #ifdef CONFIG_X86_32 |
200 | /* Only called from the Powernow K7 cpu freq driver */ | 336 | /* Only called from the Powernow K7 cpu freq driver */ |
201 | int recalibrate_cpu_khz(void) | 337 | int recalibrate_cpu_khz(void) |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0bfe2bd305eb..3da2508eb22a 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -711,6 +711,10 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp) | |||
711 | u64 *spte; | 711 | u64 *spte; |
712 | int young = 0; | 712 | int young = 0; |
713 | 713 | ||
714 | /* always return old for EPT */ | ||
715 | if (!shadow_accessed_mask) | ||
716 | return 0; | ||
717 | |||
714 | spte = rmap_next(kvm, rmapp, NULL); | 718 | spte = rmap_next(kvm, rmapp, NULL); |
715 | while (spte) { | 719 | while (spte) { |
716 | int _young; | 720 | int _young; |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e2ee264740c7..8233b86c778c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -62,6 +62,7 @@ static int npt = 1; | |||
62 | module_param(npt, int, S_IRUGO); | 62 | module_param(npt, int, S_IRUGO); |
63 | 63 | ||
64 | static void kvm_reput_irq(struct vcpu_svm *svm); | 64 | static void kvm_reput_irq(struct vcpu_svm *svm); |
65 | static void svm_flush_tlb(struct kvm_vcpu *vcpu); | ||
65 | 66 | ||
66 | static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu) | 67 | static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu) |
67 | { | 68 | { |
@@ -878,6 +879,10 @@ set: | |||
878 | static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | 879 | static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) |
879 | { | 880 | { |
880 | unsigned long host_cr4_mce = read_cr4() & X86_CR4_MCE; | 881 | unsigned long host_cr4_mce = read_cr4() & X86_CR4_MCE; |
882 | unsigned long old_cr4 = to_svm(vcpu)->vmcb->save.cr4; | ||
883 | |||
884 | if (npt_enabled && ((old_cr4 ^ cr4) & X86_CR4_PGE)) | ||
885 | force_new_asid(vcpu); | ||
881 | 886 | ||
882 | vcpu->arch.cr4 = cr4; | 887 | vcpu->arch.cr4 = cr4; |
883 | if (!npt_enabled) | 888 | if (!npt_enabled) |
@@ -1027,6 +1032,13 @@ static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) | |||
1027 | KVMTRACE_3D(TDP_FAULT, &svm->vcpu, error_code, | 1032 | KVMTRACE_3D(TDP_FAULT, &svm->vcpu, error_code, |
1028 | (u32)fault_address, (u32)(fault_address >> 32), | 1033 | (u32)fault_address, (u32)(fault_address >> 32), |
1029 | handler); | 1034 | handler); |
1035 | /* | ||
1036 | * FIXME: Tis shouldn't be necessary here, but there is a flush | ||
1037 | * missing in the MMU code. Until we find this bug, flush the | ||
1038 | * complete TLB here on an NPF | ||
1039 | */ | ||
1040 | if (npt_enabled) | ||
1041 | svm_flush_tlb(&svm->vcpu); | ||
1030 | 1042 | ||
1031 | if (event_injection) | 1043 | if (event_injection) |
1032 | kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); | 1044 | kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2a69773e3b26..7041cc52b562 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3301,8 +3301,7 @@ static int __init vmx_init(void) | |||
3301 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | | 3301 | kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | |
3302 | VMX_EPT_WRITABLE_MASK | | 3302 | VMX_EPT_WRITABLE_MASK | |
3303 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); | 3303 | VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT); |
3304 | kvm_mmu_set_mask_ptes(0ull, VMX_EPT_FAKE_ACCESSED_MASK, | 3304 | kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, |
3305 | VMX_EPT_FAKE_DIRTY_MASK, 0ull, | ||
3306 | VMX_EPT_EXECUTABLE_MASK); | 3305 | VMX_EPT_EXECUTABLE_MASK); |
3307 | kvm_enable_tdp(); | 3306 | kvm_enable_tdp(); |
3308 | } else | 3307 | } else |
diff --git a/arch/x86/kvm/vmx.h b/arch/x86/kvm/vmx.h index 425a13436b3f..23e8373507ad 100644 --- a/arch/x86/kvm/vmx.h +++ b/arch/x86/kvm/vmx.h | |||
@@ -370,8 +370,6 @@ enum vmcs_field { | |||
370 | #define VMX_EPT_READABLE_MASK 0x1ull | 370 | #define VMX_EPT_READABLE_MASK 0x1ull |
371 | #define VMX_EPT_WRITABLE_MASK 0x2ull | 371 | #define VMX_EPT_WRITABLE_MASK 0x2ull |
372 | #define VMX_EPT_EXECUTABLE_MASK 0x4ull | 372 | #define VMX_EPT_EXECUTABLE_MASK 0x4ull |
373 | #define VMX_EPT_FAKE_ACCESSED_MASK (1ull << 62) | ||
374 | #define VMX_EPT_FAKE_DIRTY_MASK (1ull << 63) | ||
375 | 373 | ||
376 | #define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul | 374 | #define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul |
377 | 375 | ||
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index d37f29376b0c..60ec1d08ff24 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -458,11 +458,7 @@ static void __init pagetable_init(void) | |||
458 | { | 458 | { |
459 | pgd_t *pgd_base = swapper_pg_dir; | 459 | pgd_t *pgd_base = swapper_pg_dir; |
460 | 460 | ||
461 | paravirt_pagetable_setup_start(pgd_base); | ||
462 | |||
463 | permanent_kmaps_init(pgd_base); | 461 | permanent_kmaps_init(pgd_base); |
464 | |||
465 | paravirt_pagetable_setup_done(pgd_base); | ||
466 | } | 462 | } |
467 | 463 | ||
468 | #ifdef CONFIG_ACPI_SLEEP | 464 | #ifdef CONFIG_ACPI_SLEEP |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 5807d1bc73f7..8791fc55e715 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -128,8 +128,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
128 | pr = pci_find_parent_resource(dev, r); | 128 | pr = pci_find_parent_resource(dev, r); |
129 | if (!r->start || !pr || | 129 | if (!r->start || !pr || |
130 | request_resource(pr, r) < 0) { | 130 | request_resource(pr, r) < 0) { |
131 | dev_err(&dev->dev, "BAR %d: can't " | 131 | dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx); |
132 | "allocate resource\n", idx); | ||
133 | /* | 132 | /* |
134 | * Something is wrong with the region. | 133 | * Something is wrong with the region. |
135 | * Invalidate the resource to prevent | 134 | * Invalidate the resource to prevent |
@@ -164,15 +163,13 @@ static void __init pcibios_allocate_resources(int pass) | |||
164 | else | 163 | else |
165 | disabled = !(command & PCI_COMMAND_MEMORY); | 164 | disabled = !(command & PCI_COMMAND_MEMORY); |
166 | if (pass == disabled) { | 165 | if (pass == disabled) { |
167 | dev_dbg(&dev->dev, "resource %#08llx-%#08llx " | 166 | dev_dbg(&dev->dev, "resource %#08llx-%#08llx (f=%lx, d=%d, p=%d)\n", |
168 | "(f=%lx, d=%d, p=%d)\n", | ||
169 | (unsigned long long) r->start, | 167 | (unsigned long long) r->start, |
170 | (unsigned long long) r->end, | 168 | (unsigned long long) r->end, |
171 | r->flags, disabled, pass); | 169 | r->flags, disabled, pass); |
172 | pr = pci_find_parent_resource(dev, r); | 170 | pr = pci_find_parent_resource(dev, r); |
173 | if (!pr || request_resource(pr, r) < 0) { | 171 | if (!pr || request_resource(pr, r) < 0) { |
174 | dev_err(&dev->dev, "BAR %d: can't " | 172 | dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx); |
175 | "allocate resource\n", idx); | ||
176 | /* We'll assign a new address later */ | 173 | /* We'll assign a new address later */ |
177 | r->end -= r->start; | 174 | r->end -= r->start; |
178 | r->start = 0; | 175 | r->start = 0; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 9ff6e3cbf08f..a4e201b47f64 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1324,7 +1324,7 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1324 | .ptep_modify_prot_commit = __ptep_modify_prot_commit, | 1324 | .ptep_modify_prot_commit = __ptep_modify_prot_commit, |
1325 | 1325 | ||
1326 | .pte_val = xen_pte_val, | 1326 | .pte_val = xen_pte_val, |
1327 | .pte_flags = native_pte_val, | 1327 | .pte_flags = native_pte_flags, |
1328 | .pgd_val = xen_pgd_val, | 1328 | .pgd_val = xen_pgd_val, |
1329 | 1329 | ||
1330 | .make_pte = xen_make_pte, | 1330 | .make_pte = xen_make_pte, |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index b6acc3a0af46..d67901083888 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -42,7 +42,7 @@ char * __init xen_memory_setup(void) | |||
42 | 42 | ||
43 | e820.nr_map = 0; | 43 | e820.nr_map = 0; |
44 | 44 | ||
45 | e820_add_region(0, PFN_PHYS(max_pfn), E820_RAM); | 45 | e820_add_region(0, PFN_PHYS((u64)max_pfn), E820_RAM); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Even though this is normal, usable memory under Xen, reserve | 48 | * Even though this is normal, usable memory under Xen, reserve |
diff --git a/block/cmd-filter.c b/block/cmd-filter.c index 1d4026206ac2..79c14996ac11 100644 --- a/block/cmd-filter.c +++ b/block/cmd-filter.c | |||
@@ -49,6 +49,7 @@ int blk_verify_command(struct blk_cmd_filter *filter, | |||
49 | } | 49 | } |
50 | EXPORT_SYMBOL(blk_verify_command); | 50 | EXPORT_SYMBOL(blk_verify_command); |
51 | 51 | ||
52 | #if 0 | ||
52 | /* and now, the sysfs stuff */ | 53 | /* and now, the sysfs stuff */ |
53 | static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page, | 54 | static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page, |
54 | int rw) | 55 | int rw) |
@@ -223,6 +224,7 @@ int blk_register_filter(struct gendisk *disk) | |||
223 | 224 | ||
224 | return 0; | 225 | return 0; |
225 | } | 226 | } |
227 | EXPORT_SYMBOL(blk_register_filter); | ||
226 | 228 | ||
227 | void blk_unregister_filter(struct gendisk *disk) | 229 | void blk_unregister_filter(struct gendisk *disk) |
228 | { | 230 | { |
@@ -231,4 +233,5 @@ void blk_unregister_filter(struct gendisk *disk) | |||
231 | kobject_put(&filter->kobj); | 233 | kobject_put(&filter->kobj); |
232 | kobject_put(disk->holder_dir->parent); | 234 | kobject_put(disk->holder_dir->parent); |
233 | } | 235 | } |
234 | 236 | EXPORT_SYMBOL(blk_unregister_filter); | |
237 | #endif | ||
diff --git a/block/genhd.c b/block/genhd.c index 656c2c7abf99..e0ce23ac2ece 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -190,7 +190,6 @@ void add_disk(struct gendisk *disk) | |||
190 | disk->minors, NULL, exact_match, exact_lock, disk); | 190 | disk->minors, NULL, exact_match, exact_lock, disk); |
191 | register_disk(disk); | 191 | register_disk(disk); |
192 | blk_register_queue(disk); | 192 | blk_register_queue(disk); |
193 | blk_register_filter(disk); | ||
194 | 193 | ||
195 | bdi = &disk->queue->backing_dev_info; | 194 | bdi = &disk->queue->backing_dev_info; |
196 | bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor)); | 195 | bdi_register_dev(bdi, MKDEV(disk->major, disk->first_minor)); |
@@ -203,7 +202,6 @@ EXPORT_SYMBOL(del_gendisk); /* in partitions/check.c */ | |||
203 | 202 | ||
204 | void unlink_gendisk(struct gendisk *disk) | 203 | void unlink_gendisk(struct gendisk *disk) |
205 | { | 204 | { |
206 | blk_unregister_filter(disk); | ||
207 | sysfs_remove_link(&disk->dev.kobj, "bdi"); | 205 | sysfs_remove_link(&disk->dev.kobj, "bdi"); |
208 | bdi_unregister(&disk->queue->backing_dev_info); | 206 | bdi_unregister(&disk->queue->backing_dev_info); |
209 | blk_unregister_queue(disk); | 207 | blk_unregister_queue(disk); |
@@ -309,7 +307,7 @@ static void *part_start(struct seq_file *part, loff_t *pos) | |||
309 | loff_t k = *pos; | 307 | loff_t k = *pos; |
310 | 308 | ||
311 | if (!k) | 309 | if (!k) |
312 | seq_puts(part, "major minor #blocks name\n\n"); | 310 | part->private = (void *)1LU; /* tell show to print header */ |
313 | 311 | ||
314 | mutex_lock(&block_class_lock); | 312 | mutex_lock(&block_class_lock); |
315 | dev = class_find_device(&block_class, NULL, &k, find_start); | 313 | dev = class_find_device(&block_class, NULL, &k, find_start); |
@@ -351,6 +349,17 @@ static int show_partition(struct seq_file *part, void *v) | |||
351 | int n; | 349 | int n; |
352 | char buf[BDEVNAME_SIZE]; | 350 | char buf[BDEVNAME_SIZE]; |
353 | 351 | ||
352 | /* | ||
353 | * Print header if start told us to do. This is to preserve | ||
354 | * the original behavior of not printing header if no | ||
355 | * partition exists. This hackery will be removed later with | ||
356 | * class iteration clean up. | ||
357 | */ | ||
358 | if (part->private) { | ||
359 | seq_puts(part, "major minor #blocks name\n\n"); | ||
360 | part->private = NULL; | ||
361 | } | ||
362 | |||
354 | /* Don't show non-partitionable removeable devices or empty devices */ | 363 | /* Don't show non-partitionable removeable devices or empty devices */ |
355 | if (!get_capacity(sgp) || | 364 | if (!get_capacity(sgp) || |
356 | (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))) | 365 | (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE))) |
diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c index 85eaf7b1c531..e8362c1efa30 100644 --- a/crypto/async_tx/async_tx.c +++ b/crypto/async_tx/async_tx.c | |||
@@ -137,7 +137,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx) | |||
137 | spin_lock_bh(&next->lock); | 137 | spin_lock_bh(&next->lock); |
138 | next->parent = NULL; | 138 | next->parent = NULL; |
139 | _next = next->next; | 139 | _next = next->next; |
140 | next->next = NULL; | 140 | if (_next && _next->chan == chan) |
141 | next->next = NULL; | ||
141 | spin_unlock_bh(&next->lock); | 142 | spin_unlock_bh(&next->lock); |
142 | 143 | ||
143 | next->tx_submit(next); | 144 | next->tx_submit(next); |
diff --git a/crypto/camellia.c b/crypto/camellia.c index b1cc4de6493c..493fee7e0a8b 100644 --- a/crypto/camellia.c +++ b/crypto/camellia.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
36 | #include <linux/kernel.h> | 36 | #include <linux/kernel.h> |
37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
38 | #include <linux/bitops.h> | ||
39 | #include <asm/unaligned.h> | ||
40 | 38 | ||
41 | static const u32 camellia_sp1110[256] = { | 39 | static const u32 camellia_sp1110[256] = { |
42 | 0x70707000,0x82828200,0x2c2c2c00,0xececec00, | 40 | 0x70707000,0x82828200,0x2c2c2c00,0xececec00, |
@@ -337,6 +335,20 @@ static const u32 camellia_sp4404[256] = { | |||
337 | /* | 335 | /* |
338 | * macros | 336 | * macros |
339 | */ | 337 | */ |
338 | #define GETU32(v, pt) \ | ||
339 | do { \ | ||
340 | /* latest breed of gcc is clever enough to use move */ \ | ||
341 | memcpy(&(v), (pt), 4); \ | ||
342 | (v) = be32_to_cpu(v); \ | ||
343 | } while(0) | ||
344 | |||
345 | /* rotation right shift 1byte */ | ||
346 | #define ROR8(x) (((x) >> 8) + ((x) << 24)) | ||
347 | /* rotation left shift 1bit */ | ||
348 | #define ROL1(x) (((x) << 1) + ((x) >> 31)) | ||
349 | /* rotation left shift 1byte */ | ||
350 | #define ROL8(x) (((x) << 8) + ((x) >> 24)) | ||
351 | |||
340 | #define ROLDQ(ll, lr, rl, rr, w0, w1, bits) \ | 352 | #define ROLDQ(ll, lr, rl, rr, w0, w1, bits) \ |
341 | do { \ | 353 | do { \ |
342 | w0 = ll; \ | 354 | w0 = ll; \ |
@@ -371,7 +383,7 @@ static const u32 camellia_sp4404[256] = { | |||
371 | ^ camellia_sp3033[(u8)(il >> 8)] \ | 383 | ^ camellia_sp3033[(u8)(il >> 8)] \ |
372 | ^ camellia_sp4404[(u8)(il )]; \ | 384 | ^ camellia_sp4404[(u8)(il )]; \ |
373 | yl ^= yr; \ | 385 | yl ^= yr; \ |
374 | yr = ror32(yr, 8); \ | 386 | yr = ROR8(yr); \ |
375 | yr ^= yl; \ | 387 | yr ^= yl; \ |
376 | } while(0) | 388 | } while(0) |
377 | 389 | ||
@@ -393,7 +405,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
393 | subL[7] ^= subL[1]; subR[7] ^= subR[1]; | 405 | subL[7] ^= subL[1]; subR[7] ^= subR[1]; |
394 | subL[1] ^= subR[1] & ~subR[9]; | 406 | subL[1] ^= subR[1] & ~subR[9]; |
395 | dw = subL[1] & subL[9], | 407 | dw = subL[1] & subL[9], |
396 | subR[1] ^= rol32(dw, 1); /* modified for FLinv(kl2) */ | 408 | subR[1] ^= ROL1(dw); /* modified for FLinv(kl2) */ |
397 | /* round 8 */ | 409 | /* round 8 */ |
398 | subL[11] ^= subL[1]; subR[11] ^= subR[1]; | 410 | subL[11] ^= subL[1]; subR[11] ^= subR[1]; |
399 | /* round 10 */ | 411 | /* round 10 */ |
@@ -402,7 +414,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
402 | subL[15] ^= subL[1]; subR[15] ^= subR[1]; | 414 | subL[15] ^= subL[1]; subR[15] ^= subR[1]; |
403 | subL[1] ^= subR[1] & ~subR[17]; | 415 | subL[1] ^= subR[1] & ~subR[17]; |
404 | dw = subL[1] & subL[17], | 416 | dw = subL[1] & subL[17], |
405 | subR[1] ^= rol32(dw, 1); /* modified for FLinv(kl4) */ | 417 | subR[1] ^= ROL1(dw); /* modified for FLinv(kl4) */ |
406 | /* round 14 */ | 418 | /* round 14 */ |
407 | subL[19] ^= subL[1]; subR[19] ^= subR[1]; | 419 | subL[19] ^= subL[1]; subR[19] ^= subR[1]; |
408 | /* round 16 */ | 420 | /* round 16 */ |
@@ -418,7 +430,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
418 | } else { | 430 | } else { |
419 | subL[1] ^= subR[1] & ~subR[25]; | 431 | subL[1] ^= subR[1] & ~subR[25]; |
420 | dw = subL[1] & subL[25], | 432 | dw = subL[1] & subL[25], |
421 | subR[1] ^= rol32(dw, 1); /* modified for FLinv(kl6) */ | 433 | subR[1] ^= ROL1(dw); /* modified for FLinv(kl6) */ |
422 | /* round 20 */ | 434 | /* round 20 */ |
423 | subL[27] ^= subL[1]; subR[27] ^= subR[1]; | 435 | subL[27] ^= subL[1]; subR[27] ^= subR[1]; |
424 | /* round 22 */ | 436 | /* round 22 */ |
@@ -438,7 +450,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
438 | subL[26] ^= kw4l; subR[26] ^= kw4r; | 450 | subL[26] ^= kw4l; subR[26] ^= kw4r; |
439 | kw4l ^= kw4r & ~subR[24]; | 451 | kw4l ^= kw4r & ~subR[24]; |
440 | dw = kw4l & subL[24], | 452 | dw = kw4l & subL[24], |
441 | kw4r ^= rol32(dw, 1); /* modified for FL(kl5) */ | 453 | kw4r ^= ROL1(dw); /* modified for FL(kl5) */ |
442 | } | 454 | } |
443 | /* round 17 */ | 455 | /* round 17 */ |
444 | subL[22] ^= kw4l; subR[22] ^= kw4r; | 456 | subL[22] ^= kw4l; subR[22] ^= kw4r; |
@@ -448,7 +460,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
448 | subL[18] ^= kw4l; subR[18] ^= kw4r; | 460 | subL[18] ^= kw4l; subR[18] ^= kw4r; |
449 | kw4l ^= kw4r & ~subR[16]; | 461 | kw4l ^= kw4r & ~subR[16]; |
450 | dw = kw4l & subL[16], | 462 | dw = kw4l & subL[16], |
451 | kw4r ^= rol32(dw, 1); /* modified for FL(kl3) */ | 463 | kw4r ^= ROL1(dw); /* modified for FL(kl3) */ |
452 | /* round 11 */ | 464 | /* round 11 */ |
453 | subL[14] ^= kw4l; subR[14] ^= kw4r; | 465 | subL[14] ^= kw4l; subR[14] ^= kw4r; |
454 | /* round 9 */ | 466 | /* round 9 */ |
@@ -457,7 +469,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
457 | subL[10] ^= kw4l; subR[10] ^= kw4r; | 469 | subL[10] ^= kw4l; subR[10] ^= kw4r; |
458 | kw4l ^= kw4r & ~subR[8]; | 470 | kw4l ^= kw4r & ~subR[8]; |
459 | dw = kw4l & subL[8], | 471 | dw = kw4l & subL[8], |
460 | kw4r ^= rol32(dw, 1); /* modified for FL(kl1) */ | 472 | kw4r ^= ROL1(dw); /* modified for FL(kl1) */ |
461 | /* round 5 */ | 473 | /* round 5 */ |
462 | subL[6] ^= kw4l; subR[6] ^= kw4r; | 474 | subL[6] ^= kw4l; subR[6] ^= kw4r; |
463 | /* round 3 */ | 475 | /* round 3 */ |
@@ -482,7 +494,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
482 | SUBKEY_R(6) = subR[5] ^ subR[7]; | 494 | SUBKEY_R(6) = subR[5] ^ subR[7]; |
483 | tl = subL[10] ^ (subR[10] & ~subR[8]); | 495 | tl = subL[10] ^ (subR[10] & ~subR[8]); |
484 | dw = tl & subL[8], /* FL(kl1) */ | 496 | dw = tl & subL[8], /* FL(kl1) */ |
485 | tr = subR[10] ^ rol32(dw, 1); | 497 | tr = subR[10] ^ ROL1(dw); |
486 | SUBKEY_L(7) = subL[6] ^ tl; /* round 6 */ | 498 | SUBKEY_L(7) = subL[6] ^ tl; /* round 6 */ |
487 | SUBKEY_R(7) = subR[6] ^ tr; | 499 | SUBKEY_R(7) = subR[6] ^ tr; |
488 | SUBKEY_L(8) = subL[8]; /* FL(kl1) */ | 500 | SUBKEY_L(8) = subL[8]; /* FL(kl1) */ |
@@ -491,7 +503,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
491 | SUBKEY_R(9) = subR[9]; | 503 | SUBKEY_R(9) = subR[9]; |
492 | tl = subL[7] ^ (subR[7] & ~subR[9]); | 504 | tl = subL[7] ^ (subR[7] & ~subR[9]); |
493 | dw = tl & subL[9], /* FLinv(kl2) */ | 505 | dw = tl & subL[9], /* FLinv(kl2) */ |
494 | tr = subR[7] ^ rol32(dw, 1); | 506 | tr = subR[7] ^ ROL1(dw); |
495 | SUBKEY_L(10) = tl ^ subL[11]; /* round 7 */ | 507 | SUBKEY_L(10) = tl ^ subL[11]; /* round 7 */ |
496 | SUBKEY_R(10) = tr ^ subR[11]; | 508 | SUBKEY_R(10) = tr ^ subR[11]; |
497 | SUBKEY_L(11) = subL[10] ^ subL[12]; /* round 8 */ | 509 | SUBKEY_L(11) = subL[10] ^ subL[12]; /* round 8 */ |
@@ -504,7 +516,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
504 | SUBKEY_R(14) = subR[13] ^ subR[15]; | 516 | SUBKEY_R(14) = subR[13] ^ subR[15]; |
505 | tl = subL[18] ^ (subR[18] & ~subR[16]); | 517 | tl = subL[18] ^ (subR[18] & ~subR[16]); |
506 | dw = tl & subL[16], /* FL(kl3) */ | 518 | dw = tl & subL[16], /* FL(kl3) */ |
507 | tr = subR[18] ^ rol32(dw, 1); | 519 | tr = subR[18] ^ ROL1(dw); |
508 | SUBKEY_L(15) = subL[14] ^ tl; /* round 12 */ | 520 | SUBKEY_L(15) = subL[14] ^ tl; /* round 12 */ |
509 | SUBKEY_R(15) = subR[14] ^ tr; | 521 | SUBKEY_R(15) = subR[14] ^ tr; |
510 | SUBKEY_L(16) = subL[16]; /* FL(kl3) */ | 522 | SUBKEY_L(16) = subL[16]; /* FL(kl3) */ |
@@ -513,7 +525,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
513 | SUBKEY_R(17) = subR[17]; | 525 | SUBKEY_R(17) = subR[17]; |
514 | tl = subL[15] ^ (subR[15] & ~subR[17]); | 526 | tl = subL[15] ^ (subR[15] & ~subR[17]); |
515 | dw = tl & subL[17], /* FLinv(kl4) */ | 527 | dw = tl & subL[17], /* FLinv(kl4) */ |
516 | tr = subR[15] ^ rol32(dw, 1); | 528 | tr = subR[15] ^ ROL1(dw); |
517 | SUBKEY_L(18) = tl ^ subL[19]; /* round 13 */ | 529 | SUBKEY_L(18) = tl ^ subL[19]; /* round 13 */ |
518 | SUBKEY_R(18) = tr ^ subR[19]; | 530 | SUBKEY_R(18) = tr ^ subR[19]; |
519 | SUBKEY_L(19) = subL[18] ^ subL[20]; /* round 14 */ | 531 | SUBKEY_L(19) = subL[18] ^ subL[20]; /* round 14 */ |
@@ -532,7 +544,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
532 | } else { | 544 | } else { |
533 | tl = subL[26] ^ (subR[26] & ~subR[24]); | 545 | tl = subL[26] ^ (subR[26] & ~subR[24]); |
534 | dw = tl & subL[24], /* FL(kl5) */ | 546 | dw = tl & subL[24], /* FL(kl5) */ |
535 | tr = subR[26] ^ rol32(dw, 1); | 547 | tr = subR[26] ^ ROL1(dw); |
536 | SUBKEY_L(23) = subL[22] ^ tl; /* round 18 */ | 548 | SUBKEY_L(23) = subL[22] ^ tl; /* round 18 */ |
537 | SUBKEY_R(23) = subR[22] ^ tr; | 549 | SUBKEY_R(23) = subR[22] ^ tr; |
538 | SUBKEY_L(24) = subL[24]; /* FL(kl5) */ | 550 | SUBKEY_L(24) = subL[24]; /* FL(kl5) */ |
@@ -541,7 +553,7 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
541 | SUBKEY_R(25) = subR[25]; | 553 | SUBKEY_R(25) = subR[25]; |
542 | tl = subL[23] ^ (subR[23] & ~subR[25]); | 554 | tl = subL[23] ^ (subR[23] & ~subR[25]); |
543 | dw = tl & subL[25], /* FLinv(kl6) */ | 555 | dw = tl & subL[25], /* FLinv(kl6) */ |
544 | tr = subR[23] ^ rol32(dw, 1); | 556 | tr = subR[23] ^ ROL1(dw); |
545 | SUBKEY_L(26) = tl ^ subL[27]; /* round 19 */ | 557 | SUBKEY_L(26) = tl ^ subL[27]; /* round 19 */ |
546 | SUBKEY_R(26) = tr ^ subR[27]; | 558 | SUBKEY_R(26) = tr ^ subR[27]; |
547 | SUBKEY_L(27) = subL[26] ^ subL[28]; /* round 20 */ | 559 | SUBKEY_L(27) = subL[26] ^ subL[28]; /* round 20 */ |
@@ -561,17 +573,17 @@ static void camellia_setup_tail(u32 *subkey, u32 *subL, u32 *subR, int max) | |||
561 | /* apply the inverse of the last half of P-function */ | 573 | /* apply the inverse of the last half of P-function */ |
562 | i = 2; | 574 | i = 2; |
563 | do { | 575 | do { |
564 | dw = SUBKEY_L(i + 0) ^ SUBKEY_R(i + 0); dw = rol32(dw, 8);/* round 1 */ | 576 | dw = SUBKEY_L(i + 0) ^ SUBKEY_R(i + 0); dw = ROL8(dw);/* round 1 */ |
565 | SUBKEY_R(i + 0) = SUBKEY_L(i + 0) ^ dw; SUBKEY_L(i + 0) = dw; | 577 | SUBKEY_R(i + 0) = SUBKEY_L(i + 0) ^ dw; SUBKEY_L(i + 0) = dw; |
566 | dw = SUBKEY_L(i + 1) ^ SUBKEY_R(i + 1); dw = rol32(dw, 8);/* round 2 */ | 578 | dw = SUBKEY_L(i + 1) ^ SUBKEY_R(i + 1); dw = ROL8(dw);/* round 2 */ |
567 | SUBKEY_R(i + 1) = SUBKEY_L(i + 1) ^ dw; SUBKEY_L(i + 1) = dw; | 579 | SUBKEY_R(i + 1) = SUBKEY_L(i + 1) ^ dw; SUBKEY_L(i + 1) = dw; |
568 | dw = SUBKEY_L(i + 2) ^ SUBKEY_R(i + 2); dw = rol32(dw, 8);/* round 3 */ | 580 | dw = SUBKEY_L(i + 2) ^ SUBKEY_R(i + 2); dw = ROL8(dw);/* round 3 */ |
569 | SUBKEY_R(i + 2) = SUBKEY_L(i + 2) ^ dw; SUBKEY_L(i + 2) = dw; | 581 | SUBKEY_R(i + 2) = SUBKEY_L(i + 2) ^ dw; SUBKEY_L(i + 2) = dw; |
570 | dw = SUBKEY_L(i + 3) ^ SUBKEY_R(i + 3); dw = rol32(dw, 8);/* round 4 */ | 582 | dw = SUBKEY_L(i + 3) ^ SUBKEY_R(i + 3); dw = ROL8(dw);/* round 4 */ |
571 | SUBKEY_R(i + 3) = SUBKEY_L(i + 3) ^ dw; SUBKEY_L(i + 3) = dw; | 583 | SUBKEY_R(i + 3) = SUBKEY_L(i + 3) ^ dw; SUBKEY_L(i + 3) = dw; |
572 | dw = SUBKEY_L(i + 4) ^ SUBKEY_R(i + 4); dw = rol32(dw, 9);/* round 5 */ | 584 | dw = SUBKEY_L(i + 4) ^ SUBKEY_R(i + 4); dw = ROL8(dw);/* round 5 */ |
573 | SUBKEY_R(i + 4) = SUBKEY_L(i + 4) ^ dw; SUBKEY_L(i + 4) = dw; | 585 | SUBKEY_R(i + 4) = SUBKEY_L(i + 4) ^ dw; SUBKEY_L(i + 4) = dw; |
574 | dw = SUBKEY_L(i + 5) ^ SUBKEY_R(i + 5); dw = rol32(dw, 8);/* round 6 */ | 586 | dw = SUBKEY_L(i + 5) ^ SUBKEY_R(i + 5); dw = ROL8(dw);/* round 6 */ |
575 | SUBKEY_R(i + 5) = SUBKEY_L(i + 5) ^ dw; SUBKEY_L(i + 5) = dw; | 587 | SUBKEY_R(i + 5) = SUBKEY_L(i + 5) ^ dw; SUBKEY_L(i + 5) = dw; |
576 | i += 8; | 588 | i += 8; |
577 | } while (i < max); | 589 | } while (i < max); |
@@ -587,10 +599,10 @@ static void camellia_setup128(const unsigned char *key, u32 *subkey) | |||
587 | /** | 599 | /** |
588 | * k == kll || klr || krl || krr (|| is concatenation) | 600 | * k == kll || klr || krl || krr (|| is concatenation) |
589 | */ | 601 | */ |
590 | kll = get_unaligned_be32(key); | 602 | GETU32(kll, key ); |
591 | klr = get_unaligned_be32(key + 4); | 603 | GETU32(klr, key + 4); |
592 | krl = get_unaligned_be32(key + 8); | 604 | GETU32(krl, key + 8); |
593 | krr = get_unaligned_be32(key + 12); | 605 | GETU32(krr, key + 12); |
594 | 606 | ||
595 | /* generate KL dependent subkeys */ | 607 | /* generate KL dependent subkeys */ |
596 | /* kw1 */ | 608 | /* kw1 */ |
@@ -695,14 +707,14 @@ static void camellia_setup256(const unsigned char *key, u32 *subkey) | |||
695 | * key = (kll || klr || krl || krr || krll || krlr || krrl || krrr) | 707 | * key = (kll || klr || krl || krr || krll || krlr || krrl || krrr) |
696 | * (|| is concatenation) | 708 | * (|| is concatenation) |
697 | */ | 709 | */ |
698 | kll = get_unaligned_be32(key); | 710 | GETU32(kll, key ); |
699 | klr = get_unaligned_be32(key + 4); | 711 | GETU32(klr, key + 4); |
700 | krl = get_unaligned_be32(key + 8); | 712 | GETU32(krl, key + 8); |
701 | krr = get_unaligned_be32(key + 12); | 713 | GETU32(krr, key + 12); |
702 | krll = get_unaligned_be32(key + 16); | 714 | GETU32(krll, key + 16); |
703 | krlr = get_unaligned_be32(key + 20); | 715 | GETU32(krlr, key + 20); |
704 | krrl = get_unaligned_be32(key + 24); | 716 | GETU32(krrl, key + 24); |
705 | krrr = get_unaligned_be32(key + 28); | 717 | GETU32(krrr, key + 28); |
706 | 718 | ||
707 | /* generate KL dependent subkeys */ | 719 | /* generate KL dependent subkeys */ |
708 | /* kw1 */ | 720 | /* kw1 */ |
@@ -858,13 +870,13 @@ static void camellia_setup192(const unsigned char *key, u32 *subkey) | |||
858 | t0 &= ll; \ | 870 | t0 &= ll; \ |
859 | t2 |= rr; \ | 871 | t2 |= rr; \ |
860 | rl ^= t2; \ | 872 | rl ^= t2; \ |
861 | lr ^= rol32(t0, 1); \ | 873 | lr ^= ROL1(t0); \ |
862 | t3 = krl; \ | 874 | t3 = krl; \ |
863 | t1 = klr; \ | 875 | t1 = klr; \ |
864 | t3 &= rl; \ | 876 | t3 &= rl; \ |
865 | t1 |= lr; \ | 877 | t1 |= lr; \ |
866 | ll ^= t1; \ | 878 | ll ^= t1; \ |
867 | rr ^= rol32(t3, 1); \ | 879 | rr ^= ROL1(t3); \ |
868 | } while(0) | 880 | } while(0) |
869 | 881 | ||
870 | #define CAMELLIA_ROUNDSM(xl, xr, kl, kr, yl, yr, il, ir) \ | 882 | #define CAMELLIA_ROUNDSM(xl, xr, kl, kr, yl, yr, il, ir) \ |
@@ -880,7 +892,7 @@ static void camellia_setup192(const unsigned char *key, u32 *subkey) | |||
880 | il ^= kl; \ | 892 | il ^= kl; \ |
881 | ir ^= il ^ kr; \ | 893 | ir ^= il ^ kr; \ |
882 | yl ^= ir; \ | 894 | yl ^= ir; \ |
883 | yr ^= ror32(il, 8) ^ ir; \ | 895 | yr ^= ROR8(il) ^ ir; \ |
884 | } while(0) | 896 | } while(0) |
885 | 897 | ||
886 | /* max = 24: 128bit encrypt, max = 32: 256bit encrypt */ | 898 | /* max = 24: 128bit encrypt, max = 32: 256bit encrypt */ |
diff --git a/drivers/acpi/dispatcher/dsobject.c b/drivers/acpi/dispatcher/dsobject.c index 1022e38994c2..0f2805899210 100644 --- a/drivers/acpi/dispatcher/dsobject.c +++ b/drivers/acpi/dispatcher/dsobject.c | |||
@@ -496,7 +496,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, | |||
496 | arg = arg->common.next; | 496 | arg = arg->common.next; |
497 | } | 497 | } |
498 | 498 | ||
499 | ACPI_ERROR((AE_INFO, | 499 | ACPI_WARNING((AE_INFO, |
500 | "Package List length (%X) larger than NumElements count (%X), truncated\n", | 500 | "Package List length (%X) larger than NumElements count (%X), truncated\n", |
501 | i, element_count)); | 501 | i, element_count)); |
502 | } else if (i < element_count) { | 502 | } else if (i < element_count) { |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index d3f0a62efcc1..ee68ac54c0d4 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -138,7 +138,7 @@ static struct dmi_system_id __cpuinitdata processor_idle_dmi_table[] = { | |||
138 | { | 138 | { |
139 | set_no_mwait, "Extensa 5220", { | 139 | set_no_mwait, "Extensa 5220", { |
140 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), | 140 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), |
141 | DMI_MATCH(DMI_SYS_VENDOR, "ACER"), | 141 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
142 | DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), | 142 | DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), |
143 | DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL}, | 143 | DMI_MATCH(DMI_BOARD_NAME, "Columbia") }, NULL}, |
144 | {}, | 144 | {}, |
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 80e32093e977..80c251ec6d2a 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -71,7 +71,7 @@ static DEFINE_MUTEX(performance_mutex); | |||
71 | * 1 -> ignore _PPC totally -> forced by user through boot param | 71 | * 1 -> ignore _PPC totally -> forced by user through boot param |
72 | */ | 72 | */ |
73 | static int ignore_ppc = -1; | 73 | static int ignore_ppc = -1; |
74 | module_param(ignore_ppc, uint, 0644); | 74 | module_param(ignore_ppc, int, 0644); |
75 | MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ | 75 | MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \ |
76 | "limited by BIOS, this should help"); | 76 | "limited by BIOS, this should help"); |
77 | 77 | ||
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c index bcf2c70fca87..a4e3767b8c64 100644 --- a/drivers/acpi/sbshc.c +++ b/drivers/acpi/sbshc.c | |||
@@ -107,6 +107,13 @@ static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout) | |||
107 | if (wait_event_timeout(hc->wait, smb_check_done(hc), | 107 | if (wait_event_timeout(hc->wait, smb_check_done(hc), |
108 | msecs_to_jiffies(timeout))) | 108 | msecs_to_jiffies(timeout))) |
109 | return 0; | 109 | return 0; |
110 | /* | ||
111 | * After the timeout happens, OS will try to check the status of SMbus. | ||
112 | * If the status is what OS expected, it will be regarded as the bogus | ||
113 | * timeout. | ||
114 | */ | ||
115 | if (smb_check_done(hc)) | ||
116 | return 0; | ||
110 | else | 117 | else |
111 | return -ETIME; | 118 | return -ETIME; |
112 | } | 119 | } |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index c3419182c9a7..775c97a282bd 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -300,6 +300,8 @@ int __init acpi_table_init(void) | |||
300 | 300 | ||
301 | static int __init acpi_parse_apic_instance(char *str) | 301 | static int __init acpi_parse_apic_instance(char *str) |
302 | { | 302 | { |
303 | if (!str) | ||
304 | return -EINVAL; | ||
303 | 305 | ||
304 | acpi_apic_instance = simple_strtoul(str, NULL, 0); | 306 | acpi_apic_instance = simple_strtoul(str, NULL, 0); |
305 | 307 | ||
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index ae8494944c45..11c8c19f0fb7 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -448,8 +448,10 @@ config PATA_MARVELL | |||
448 | tristate "Marvell PATA support via legacy mode" | 448 | tristate "Marvell PATA support via legacy mode" |
449 | depends on PCI | 449 | depends on PCI |
450 | help | 450 | help |
451 | This option enables limited support for the Marvell 88SE6145 ATA | 451 | This option enables limited support for the Marvell 88SE61xx ATA |
452 | controller. | 452 | controllers. If you wish to use only the SATA ports then select |
453 | the AHCI driver alone. If you wish to the use the PATA port or | ||
454 | both SATA and PATA include this driver. | ||
453 | 455 | ||
454 | If unsure, say N. | 456 | If unsure, say N. |
455 | 457 | ||
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index c729e6988bbb..2e1a7cb2ed5f 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -420,7 +420,7 @@ static const struct ata_port_info ahci_port_info[] = { | |||
420 | /* board_ahci_mv */ | 420 | /* board_ahci_mv */ |
421 | { | 421 | { |
422 | AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ | AHCI_HFLAG_NO_MSI | | 422 | AHCI_HFLAGS (AHCI_HFLAG_NO_NCQ | AHCI_HFLAG_NO_MSI | |
423 | AHCI_HFLAG_MV_PATA), | 423 | AHCI_HFLAG_MV_PATA | AHCI_HFLAG_NO_PMP), |
424 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 424 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
425 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA, | 425 | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA, |
426 | .pio_mask = 0x1f, /* pio0-4 */ | 426 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -487,7 +487,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
487 | { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ | 487 | { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ |
488 | { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ | 488 | { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ |
489 | { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */ | 489 | { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */ |
490 | { PCI_VDEVICE(INTEL, 0x3b25), board_ahci }, /* PCH RAID */ | ||
490 | { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ | 491 | { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ |
492 | { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */ | ||
491 | 493 | ||
492 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 494 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
493 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 495 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
@@ -610,6 +612,15 @@ module_param(ahci_em_messages, int, 0444); | |||
610 | MODULE_PARM_DESC(ahci_em_messages, | 612 | MODULE_PARM_DESC(ahci_em_messages, |
611 | "Set AHCI Enclosure Management Message type (0 = disabled, 1 = LED"); | 613 | "Set AHCI Enclosure Management Message type (0 = disabled, 1 = LED"); |
612 | 614 | ||
615 | #if defined(CONFIG_PATA_MARVELL) || defined(CONFIG_PATA_MARVELL_MODULE) | ||
616 | static int marvell_enable; | ||
617 | #else | ||
618 | static int marvell_enable = 1; | ||
619 | #endif | ||
620 | module_param(marvell_enable, int, 0644); | ||
621 | MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)"); | ||
622 | |||
623 | |||
613 | static inline int ahci_nr_ports(u32 cap) | 624 | static inline int ahci_nr_ports(u32 cap) |
614 | { | 625 | { |
615 | return (cap & 0x1f) + 1; | 626 | return (cap & 0x1f) + 1; |
@@ -732,6 +743,8 @@ static void ahci_save_initial_config(struct pci_dev *pdev, | |||
732 | "MV_AHCI HACK: port_map %x -> %x\n", | 743 | "MV_AHCI HACK: port_map %x -> %x\n", |
733 | port_map, | 744 | port_map, |
734 | port_map & mv); | 745 | port_map & mv); |
746 | dev_printk(KERN_ERR, &pdev->dev, | ||
747 | "Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n"); | ||
735 | 748 | ||
736 | port_map &= mv; | 749 | port_map &= mv; |
737 | } | 750 | } |
@@ -2533,6 +2546,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2533 | if (!printed_version++) | 2546 | if (!printed_version++) |
2534 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); | 2547 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
2535 | 2548 | ||
2549 | /* The AHCI driver can only drive the SATA ports, the PATA driver | ||
2550 | can drive them all so if both drivers are selected make sure | ||
2551 | AHCI stays out of the way */ | ||
2552 | if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable) | ||
2553 | return -ENODEV; | ||
2554 | |||
2536 | /* acquire resources */ | 2555 | /* acquire resources */ |
2537 | rc = pcim_enable_device(pdev); | 2556 | rc = pcim_enable_device(pdev); |
2538 | if (rc) | 2557 | if (rc) |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index b1d08a8f5003..e6b4606e36b6 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -1499,7 +1499,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev, | |||
1499 | * off. | 1499 | * off. |
1500 | */ | 1500 | */ |
1501 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2652) { | 1501 | if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2652) { |
1502 | int rc = piix_disable_ahci(pdev); | 1502 | rc = piix_disable_ahci(pdev); |
1503 | if (rc) | 1503 | if (rc) |
1504 | return rc; | 1504 | return rc; |
1505 | } | 1505 | } |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 304fdc6f1dc2..2a4c516894f0 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1315,11 +1315,6 @@ fsm_start: | |||
1315 | break; | 1315 | break; |
1316 | 1316 | ||
1317 | case HSM_ST_ERR: | 1317 | case HSM_ST_ERR: |
1318 | /* make sure qc->err_mask is available to | ||
1319 | * know what's wrong and recover | ||
1320 | */ | ||
1321 | WARN_ON(!(qc->err_mask & (AC_ERR_DEV | AC_ERR_HSM))); | ||
1322 | |||
1323 | ap->hsm_task_state = HSM_ST_IDLE; | 1318 | ap->hsm_task_state = HSM_ST_IDLE; |
1324 | 1319 | ||
1325 | /* complete taskfile transaction */ | 1320 | /* complete taskfile transaction */ |
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c index 24a011b25024..0d87eec84966 100644 --- a/drivers/ata/pata_marvell.c +++ b/drivers/ata/pata_marvell.c | |||
@@ -20,29 +20,30 @@ | |||
20 | #include <linux/ata.h> | 20 | #include <linux/ata.h> |
21 | 21 | ||
22 | #define DRV_NAME "pata_marvell" | 22 | #define DRV_NAME "pata_marvell" |
23 | #define DRV_VERSION "0.1.4" | 23 | #define DRV_VERSION "0.1.6" |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * marvell_pre_reset - check for 40/80 pin | 26 | * marvell_pata_active - check if PATA is active |
27 | * @link: link | 27 | * @pdev: PCI device |
28 | * @deadline: deadline jiffies for the operation | ||
29 | * | 28 | * |
30 | * Perform the PATA port setup we need. | 29 | * Returns 1 if the PATA port may be active. We know how to check this |
30 | * for the 6145 but not the other devices | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | static int marvell_pre_reset(struct ata_link *link, unsigned long deadline) | 33 | static int marvell_pata_active(struct pci_dev *pdev) |
34 | { | 34 | { |
35 | struct ata_port *ap = link->ap; | 35 | int i; |
36 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
37 | u32 devices; | 36 | u32 devices; |
38 | void __iomem *barp; | 37 | void __iomem *barp; |
39 | int i; | ||
40 | 38 | ||
41 | /* Check if our port is enabled */ | 39 | /* We don't yet know how to do this for other devices */ |
40 | if (pdev->device != 0x6145) | ||
41 | return 1; | ||
42 | 42 | ||
43 | barp = pci_iomap(pdev, 5, 0x10); | 43 | barp = pci_iomap(pdev, 5, 0x10); |
44 | if (barp == NULL) | 44 | if (barp == NULL) |
45 | return -ENOMEM; | 45 | return -ENOMEM; |
46 | |||
46 | printk("BAR5:"); | 47 | printk("BAR5:"); |
47 | for(i = 0; i <= 0x0F; i++) | 48 | for(i = 0; i <= 0x0F; i++) |
48 | printk("%02X:%02X ", i, ioread8(barp + i)); | 49 | printk("%02X:%02X ", i, ioread8(barp + i)); |
@@ -51,9 +52,27 @@ static int marvell_pre_reset(struct ata_link *link, unsigned long deadline) | |||
51 | devices = ioread32(barp + 0x0C); | 52 | devices = ioread32(barp + 0x0C); |
52 | pci_iounmap(pdev, barp); | 53 | pci_iounmap(pdev, barp); |
53 | 54 | ||
54 | if ((pdev->device == 0x6145) && (ap->port_no == 0) && | 55 | if (devices & 0x10) |
55 | (!(devices & 0x10))) /* PATA enable ? */ | 56 | return 1; |
56 | return -ENOENT; | 57 | return 0; |
58 | } | ||
59 | |||
60 | /** | ||
61 | * marvell_pre_reset - check for 40/80 pin | ||
62 | * @link: link | ||
63 | * @deadline: deadline jiffies for the operation | ||
64 | * | ||
65 | * Perform the PATA port setup we need. | ||
66 | */ | ||
67 | |||
68 | static int marvell_pre_reset(struct ata_link *link, unsigned long deadline) | ||
69 | { | ||
70 | struct ata_port *ap = link->ap; | ||
71 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | ||
72 | |||
73 | if (pdev->device == 0x6145 && ap->port_no == 0 && | ||
74 | !marvell_pata_active(pdev)) /* PATA enable ? */ | ||
75 | return -ENOENT; | ||
57 | 76 | ||
58 | return ata_sff_prereset(link, deadline); | 77 | return ata_sff_prereset(link, deadline); |
59 | } | 78 | } |
@@ -128,6 +147,12 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i | |||
128 | if (pdev->device == 0x6101) | 147 | if (pdev->device == 0x6101) |
129 | ppi[1] = &ata_dummy_port_info; | 148 | ppi[1] = &ata_dummy_port_info; |
130 | 149 | ||
150 | #if defined(CONFIG_AHCI) || defined(CONFIG_AHCI_MODULE) | ||
151 | if (!marvell_pata_active(pdev)) { | ||
152 | printk(KERN_INFO DRV_NAME ": PATA port not active, deferring to AHCI driver.\n"); | ||
153 | return -ENODEV; | ||
154 | } | ||
155 | #endif | ||
131 | return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL); | 156 | return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL); |
132 | } | 157 | } |
133 | 158 | ||
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c index 720b8645f58a..e970b227fbce 100644 --- a/drivers/ata/pata_sil680.c +++ b/drivers/ata/pata_sil680.c | |||
@@ -322,9 +322,6 @@ static int __devinit sil680_init_one(struct pci_dev *pdev, | |||
322 | /* Try to acquire MMIO resources and fallback to PIO if | 322 | /* Try to acquire MMIO resources and fallback to PIO if |
323 | * that fails | 323 | * that fails |
324 | */ | 324 | */ |
325 | rc = pcim_enable_device(pdev); | ||
326 | if (rc) | ||
327 | return rc; | ||
328 | rc = pcim_iomap_regions(pdev, 1 << SIL680_MMIO_BAR, DRV_NAME); | 325 | rc = pcim_iomap_regions(pdev, 1 << SIL680_MMIO_BAR, DRV_NAME); |
329 | if (rc) | 326 | if (rc) |
330 | goto use_ioports; | 327 | goto use_ioports; |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index 3ead02fe379e..5032c32fa505 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -96,6 +96,7 @@ enum { | |||
96 | PORT_SCR = 0x20, | 96 | PORT_SCR = 0x20, |
97 | 97 | ||
98 | /* HOST_CTL bits */ | 98 | /* HOST_CTL bits */ |
99 | HCTL_LEDEN = (1 << 3), /* enable LED operation */ | ||
99 | HCTL_IRQOFF = (1 << 8), /* global IRQ off */ | 100 | HCTL_IRQOFF = (1 << 8), /* global IRQ off */ |
100 | HCTL_FTHD0 = (1 << 10), /* fifo threshold 0 */ | 101 | HCTL_FTHD0 = (1 << 10), /* fifo threshold 0 */ |
101 | HCTL_FTHD1 = (1 << 11), /* fifo threshold 1*/ | 102 | HCTL_FTHD1 = (1 << 11), /* fifo threshold 1*/ |
@@ -540,7 +541,7 @@ static unsigned int inic_qc_issue(struct ata_queued_cmd *qc) | |||
540 | void __iomem *port_base = inic_port_base(ap); | 541 | void __iomem *port_base = inic_port_base(ap); |
541 | 542 | ||
542 | /* fire up the ADMA engine */ | 543 | /* fire up the ADMA engine */ |
543 | writew(HCTL_FTHD0, port_base + HOST_CTL); | 544 | writew(HCTL_FTHD0 | HCTL_LEDEN, port_base + HOST_CTL); |
544 | writew(IDMA_CTL_GO, port_base + PORT_IDMA_CTL); | 545 | writew(IDMA_CTL_GO, port_base + PORT_IDMA_CTL); |
545 | writeb(0, port_base + PORT_CPB_PTQFIFO); | 546 | writeb(0, port_base + PORT_CPB_PTQFIFO); |
546 | 547 | ||
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 13c1d2af18ac..c815f8ecf6e6 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -667,7 +667,8 @@ static const struct pci_device_id mv_pci_tbl[] = { | |||
667 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, | 667 | { PCI_VDEVICE(MARVELL, 0x5041), chip_504x }, |
668 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, | 668 | { PCI_VDEVICE(MARVELL, 0x5080), chip_5080 }, |
669 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, | 669 | { PCI_VDEVICE(MARVELL, 0x5081), chip_508x }, |
670 | /* RocketRAID 1740/174x have different identifiers */ | 670 | /* RocketRAID 1720/174x have different identifiers */ |
671 | { PCI_VDEVICE(TTI, 0x1720), chip_6042 }, | ||
671 | { PCI_VDEVICE(TTI, 0x1740), chip_508x }, | 672 | { PCI_VDEVICE(TTI, 0x1740), chip_508x }, |
672 | { PCI_VDEVICE(TTI, 0x1742), chip_508x }, | 673 | { PCI_VDEVICE(TTI, 0x1742), chip_508x }, |
673 | 674 | ||
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 858f70610eda..1e1f3f3757ae 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -309,8 +309,6 @@ static void nv_nf2_freeze(struct ata_port *ap); | |||
309 | static void nv_nf2_thaw(struct ata_port *ap); | 309 | static void nv_nf2_thaw(struct ata_port *ap); |
310 | static void nv_ck804_freeze(struct ata_port *ap); | 310 | static void nv_ck804_freeze(struct ata_port *ap); |
311 | static void nv_ck804_thaw(struct ata_port *ap); | 311 | static void nv_ck804_thaw(struct ata_port *ap); |
312 | static int nv_hardreset(struct ata_link *link, unsigned int *class, | ||
313 | unsigned long deadline); | ||
314 | static int nv_adma_slave_config(struct scsi_device *sdev); | 312 | static int nv_adma_slave_config(struct scsi_device *sdev); |
315 | static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); | 313 | static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); |
316 | static void nv_adma_qc_prep(struct ata_queued_cmd *qc); | 314 | static void nv_adma_qc_prep(struct ata_queued_cmd *qc); |
@@ -407,7 +405,7 @@ static struct scsi_host_template nv_swncq_sht = { | |||
407 | 405 | ||
408 | static struct ata_port_operations nv_generic_ops = { | 406 | static struct ata_port_operations nv_generic_ops = { |
409 | .inherits = &ata_bmdma_port_ops, | 407 | .inherits = &ata_bmdma_port_ops, |
410 | .hardreset = nv_hardreset, | 408 | .hardreset = ATA_OP_NULL, |
411 | .scr_read = nv_scr_read, | 409 | .scr_read = nv_scr_read, |
412 | .scr_write = nv_scr_write, | 410 | .scr_write = nv_scr_write, |
413 | }; | 411 | }; |
@@ -1588,21 +1586,6 @@ static void nv_mcp55_thaw(struct ata_port *ap) | |||
1588 | ata_sff_thaw(ap); | 1586 | ata_sff_thaw(ap); |
1589 | } | 1587 | } |
1590 | 1588 | ||
1591 | static int nv_hardreset(struct ata_link *link, unsigned int *class, | ||
1592 | unsigned long deadline) | ||
1593 | { | ||
1594 | int rc; | ||
1595 | |||
1596 | /* SATA hardreset fails to retrieve proper device signature on | ||
1597 | * some controllers. Request follow up SRST. For more info, | ||
1598 | * see http://bugzilla.kernel.org/show_bug.cgi?id=3352 | ||
1599 | */ | ||
1600 | rc = sata_sff_hardreset(link, class, deadline); | ||
1601 | if (rc) | ||
1602 | return rc; | ||
1603 | return -EAGAIN; | ||
1604 | } | ||
1605 | |||
1606 | static void nv_adma_error_handler(struct ata_port *ap) | 1589 | static void nv_adma_error_handler(struct ata_port *ap) |
1607 | { | 1590 | { |
1608 | struct nv_adma_port_priv *pp = ap->private_data; | 1591 | struct nv_adma_port_priv *pp = ap->private_data; |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 1838aa3d24fe..7ce1ac4baa6d 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -407,7 +407,7 @@ struct entropy_store { | |||
407 | /* read-write data: */ | 407 | /* read-write data: */ |
408 | spinlock_t lock; | 408 | spinlock_t lock; |
409 | unsigned add_ptr; | 409 | unsigned add_ptr; |
410 | int entropy_count; | 410 | int entropy_count; /* Must at no time exceed ->POOLBITS! */ |
411 | int input_rotate; | 411 | int input_rotate; |
412 | }; | 412 | }; |
413 | 413 | ||
@@ -520,6 +520,7 @@ static void mix_pool_bytes(struct entropy_store *r, const void *in, int bytes) | |||
520 | static void credit_entropy_bits(struct entropy_store *r, int nbits) | 520 | static void credit_entropy_bits(struct entropy_store *r, int nbits) |
521 | { | 521 | { |
522 | unsigned long flags; | 522 | unsigned long flags; |
523 | int entropy_count; | ||
523 | 524 | ||
524 | if (!nbits) | 525 | if (!nbits) |
525 | return; | 526 | return; |
@@ -527,20 +528,20 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits) | |||
527 | spin_lock_irqsave(&r->lock, flags); | 528 | spin_lock_irqsave(&r->lock, flags); |
528 | 529 | ||
529 | DEBUG_ENT("added %d entropy credits to %s\n", nbits, r->name); | 530 | DEBUG_ENT("added %d entropy credits to %s\n", nbits, r->name); |
530 | r->entropy_count += nbits; | 531 | entropy_count = r->entropy_count; |
531 | if (r->entropy_count < 0) { | 532 | entropy_count += nbits; |
533 | if (entropy_count < 0) { | ||
532 | DEBUG_ENT("negative entropy/overflow\n"); | 534 | DEBUG_ENT("negative entropy/overflow\n"); |
533 | r->entropy_count = 0; | 535 | entropy_count = 0; |
534 | } else if (r->entropy_count > r->poolinfo->POOLBITS) | 536 | } else if (entropy_count > r->poolinfo->POOLBITS) |
535 | r->entropy_count = r->poolinfo->POOLBITS; | 537 | entropy_count = r->poolinfo->POOLBITS; |
538 | r->entropy_count = entropy_count; | ||
536 | 539 | ||
537 | /* should we wake readers? */ | 540 | /* should we wake readers? */ |
538 | if (r == &input_pool && | 541 | if (r == &input_pool && entropy_count >= random_read_wakeup_thresh) { |
539 | r->entropy_count >= random_read_wakeup_thresh) { | ||
540 | wake_up_interruptible(&random_read_wait); | 542 | wake_up_interruptible(&random_read_wait); |
541 | kill_fasync(&fasync, SIGIO, POLL_IN); | 543 | kill_fasync(&fasync, SIGIO, POLL_IN); |
542 | } | 544 | } |
543 | |||
544 | spin_unlock_irqrestore(&r->lock, flags); | 545 | spin_unlock_irqrestore(&r->lock, flags); |
545 | } | 546 | } |
546 | 547 | ||
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 5ca1d80de182..71d2ac4e3f46 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/errno.h> | 21 | #include <linux/errno.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #include <linux/delay.h> | ||
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
25 | 26 | ||
26 | /* | 27 | /* |
@@ -151,13 +152,13 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_LE, | |||
151 | */ | 152 | */ |
152 | static int verify_pmtmr_rate(void) | 153 | static int verify_pmtmr_rate(void) |
153 | { | 154 | { |
154 | u32 value1, value2; | 155 | cycle_t value1, value2; |
155 | unsigned long count, delta; | 156 | unsigned long count, delta; |
156 | 157 | ||
157 | mach_prepare_counter(); | 158 | mach_prepare_counter(); |
158 | value1 = read_pmtmr(); | 159 | value1 = clocksource_acpi_pm.read(); |
159 | mach_countup(&count); | 160 | mach_countup(&count); |
160 | value2 = read_pmtmr(); | 161 | value2 = clocksource_acpi_pm.read(); |
161 | delta = (value2 - value1) & ACPI_PM_MASK; | 162 | delta = (value2 - value1) & ACPI_PM_MASK; |
162 | 163 | ||
163 | /* Check that the PMTMR delta is within 5% of what we expect */ | 164 | /* Check that the PMTMR delta is within 5% of what we expect */ |
@@ -175,10 +176,15 @@ static int verify_pmtmr_rate(void) | |||
175 | #define verify_pmtmr_rate() (0) | 176 | #define verify_pmtmr_rate() (0) |
176 | #endif | 177 | #endif |
177 | 178 | ||
179 | /* Number of monotonicity checks to perform during initialization */ | ||
180 | #define ACPI_PM_MONOTONICITY_CHECKS 10 | ||
181 | /* Number of reads we try to get two different values */ | ||
182 | #define ACPI_PM_READ_CHECKS 10000 | ||
183 | |||
178 | static int __init init_acpi_pm_clocksource(void) | 184 | static int __init init_acpi_pm_clocksource(void) |
179 | { | 185 | { |
180 | u32 value1, value2; | 186 | cycle_t value1, value2; |
181 | unsigned int i; | 187 | unsigned int i, j = 0; |
182 | 188 | ||
183 | if (!pmtmr_ioport) | 189 | if (!pmtmr_ioport) |
184 | return -ENODEV; | 190 | return -ENODEV; |
@@ -187,24 +193,29 @@ static int __init init_acpi_pm_clocksource(void) | |||
187 | clocksource_acpi_pm.shift); | 193 | clocksource_acpi_pm.shift); |
188 | 194 | ||
189 | /* "verify" this timing source: */ | 195 | /* "verify" this timing source: */ |
190 | value1 = read_pmtmr(); | 196 | for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) { |
191 | for (i = 0; i < 10000; i++) { | 197 | udelay(100 * j); |
192 | value2 = read_pmtmr(); | 198 | value1 = clocksource_acpi_pm.read(); |
193 | if (value2 == value1) | 199 | for (i = 0; i < ACPI_PM_READ_CHECKS; i++) { |
194 | continue; | 200 | value2 = clocksource_acpi_pm.read(); |
195 | if (value2 > value1) | 201 | if (value2 == value1) |
196 | goto pm_good; | 202 | continue; |
197 | if ((value2 < value1) && ((value2) < 0xFFF)) | 203 | if (value2 > value1) |
198 | goto pm_good; | 204 | break; |
199 | printk(KERN_INFO "PM-Timer had inconsistent results:" | 205 | if ((value2 < value1) && ((value2) < 0xFFF)) |
200 | " 0x%#x, 0x%#x - aborting.\n", value1, value2); | 206 | break; |
201 | return -EINVAL; | 207 | printk(KERN_INFO "PM-Timer had inconsistent results:" |
208 | " 0x%#llx, 0x%#llx - aborting.\n", | ||
209 | value1, value2); | ||
210 | return -EINVAL; | ||
211 | } | ||
212 | if (i == ACPI_PM_READ_CHECKS) { | ||
213 | printk(KERN_INFO "PM-Timer failed consistency check " | ||
214 | " (0x%#llx) - aborting.\n", value1); | ||
215 | return -ENODEV; | ||
216 | } | ||
202 | } | 217 | } |
203 | printk(KERN_INFO "PM-Timer had no reasonable result:" | ||
204 | " 0x%#x - aborting.\n", value1); | ||
205 | return -ENODEV; | ||
206 | 218 | ||
207 | pm_good: | ||
208 | if (verify_pmtmr_rate() != 0) | 219 | if (verify_pmtmr_rate() != 0) |
209 | return -ENODEV; | 220 | return -ENODEV; |
210 | 221 | ||
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index ee827a7f7c6a..b6ad3ac5916e 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -1157,6 +1157,8 @@ static int aead_authenc_givencrypt( | |||
1157 | edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT; | 1157 | edesc->desc.hdr = ctx->desc_hdr_template | DESC_HDR_MODE0_ENCRYPT; |
1158 | 1158 | ||
1159 | memcpy(req->giv, ctx->iv, crypto_aead_ivsize(authenc)); | 1159 | memcpy(req->giv, ctx->iv, crypto_aead_ivsize(authenc)); |
1160 | /* avoid consecutive packets going out with same IV */ | ||
1161 | *(__be64 *)req->giv ^= cpu_to_be64(req->seq); | ||
1160 | 1162 | ||
1161 | return ipsec_esp(edesc, areq, req->giv, req->seq, | 1163 | return ipsec_esp(edesc, areq, req->giv, req->seq, |
1162 | ipsec_esp_encrypt_done); | 1164 | ipsec_esp_encrypt_done); |
@@ -1449,6 +1451,8 @@ static int talitos_probe(struct of_device *ofdev, | |||
1449 | 1451 | ||
1450 | priv->ofdev = ofdev; | 1452 | priv->ofdev = ofdev; |
1451 | 1453 | ||
1454 | INIT_LIST_HEAD(&priv->alg_list); | ||
1455 | |||
1452 | tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); | 1456 | tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); |
1453 | tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev); | 1457 | tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev); |
1454 | 1458 | ||
@@ -1575,8 +1579,6 @@ static int talitos_probe(struct of_device *ofdev, | |||
1575 | } | 1579 | } |
1576 | 1580 | ||
1577 | /* register crypto algorithms the device supports */ | 1581 | /* register crypto algorithms the device supports */ |
1578 | INIT_LIST_HEAD(&priv->alg_list); | ||
1579 | |||
1580 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { | 1582 | for (i = 0; i < ARRAY_SIZE(driver_algs); i++) { |
1581 | if (hw_supports(dev, driver_algs[i].desc_hdr_template)) { | 1583 | if (hw_supports(dev, driver_algs[i].desc_hdr_template)) { |
1582 | struct talitos_crypto_alg *t_alg; | 1584 | struct talitos_crypto_alg *t_alg; |
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c index 8024e3bfd877..b91ef63126ed 100644 --- a/drivers/firmware/iscsi_ibft.c +++ b/drivers/firmware/iscsi_ibft.c | |||
@@ -669,8 +669,7 @@ static int __init ibft_register_kobjects(struct ibft_table_header *header, | |||
669 | 669 | ||
670 | control = (void *)header + sizeof(*header); | 670 | control = (void *)header + sizeof(*header); |
671 | end = (void *)control + control->hdr.length; | 671 | end = (void *)control + control->hdr.length; |
672 | eot_offset = (void *)header + header->length - | 672 | eot_offset = (void *)header + header->length - (void *)control; |
673 | (void *)control - sizeof(*header); | ||
674 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, | 673 | rc = ibft_verify_hdr("control", (struct ibft_hdr *)control, id_control, |
675 | sizeof(*control)); | 674 | sizeof(*control)); |
676 | 675 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 3331f88dcfb6..248ab4a7d39f 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -223,7 +223,7 @@ static int radeon_do_wait_for_fifo(drm_radeon_private_t * dev_priv, int entries) | |||
223 | return 0; | 223 | return 0; |
224 | DRM_UDELAY(1); | 224 | DRM_UDELAY(1); |
225 | } | 225 | } |
226 | DRM_INFO("wait for fifo failed status : 0x%08X 0x%08X\n", | 226 | DRM_DEBUG("wait for fifo failed status : 0x%08X 0x%08X\n", |
227 | RADEON_READ(RADEON_RBBM_STATUS), | 227 | RADEON_READ(RADEON_RBBM_STATUS), |
228 | RADEON_READ(R300_VAP_CNTL_STATUS)); | 228 | RADEON_READ(R300_VAP_CNTL_STATUS)); |
229 | 229 | ||
@@ -252,7 +252,7 @@ static int radeon_do_wait_for_idle(drm_radeon_private_t * dev_priv) | |||
252 | } | 252 | } |
253 | DRM_UDELAY(1); | 253 | DRM_UDELAY(1); |
254 | } | 254 | } |
255 | DRM_INFO("wait idle failed status : 0x%08X 0x%08X\n", | 255 | DRM_DEBUG("wait idle failed status : 0x%08X 0x%08X\n", |
256 | RADEON_READ(RADEON_RBBM_STATUS), | 256 | RADEON_READ(RADEON_RBBM_STATUS), |
257 | RADEON_READ(R300_VAP_CNTL_STATUS)); | 257 | RADEON_READ(R300_VAP_CNTL_STATUS)); |
258 | 258 | ||
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 840e634fa31f..640cbb237328 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -31,13 +31,84 @@ | |||
31 | #include <linux/clk.h> | 31 | #include <linux/clk.h> |
32 | #include <linux/io.h> | 32 | #include <linux/io.h> |
33 | 33 | ||
34 | /* Transmit operation: */ | ||
35 | /* */ | ||
36 | /* 0 byte transmit */ | ||
37 | /* BUS: S A8 ACK P */ | ||
38 | /* IRQ: DTE WAIT */ | ||
39 | /* ICIC: */ | ||
40 | /* ICCR: 0x94 0x90 */ | ||
41 | /* ICDR: A8 */ | ||
42 | /* */ | ||
43 | /* 1 byte transmit */ | ||
44 | /* BUS: S A8 ACK D8(1) ACK P */ | ||
45 | /* IRQ: DTE WAIT WAIT */ | ||
46 | /* ICIC: -DTE */ | ||
47 | /* ICCR: 0x94 0x90 */ | ||
48 | /* ICDR: A8 D8(1) */ | ||
49 | /* */ | ||
50 | /* 2 byte transmit */ | ||
51 | /* BUS: S A8 ACK D8(1) ACK D8(2) ACK P */ | ||
52 | /* IRQ: DTE WAIT WAIT WAIT */ | ||
53 | /* ICIC: -DTE */ | ||
54 | /* ICCR: 0x94 0x90 */ | ||
55 | /* ICDR: A8 D8(1) D8(2) */ | ||
56 | /* */ | ||
57 | /* 3 bytes or more, +---------+ gets repeated */ | ||
58 | /* */ | ||
59 | /* */ | ||
60 | /* Receive operation: */ | ||
61 | /* */ | ||
62 | /* 0 byte receive - not supported since slave may hold SDA low */ | ||
63 | /* */ | ||
64 | /* 1 byte receive [TX] | [RX] */ | ||
65 | /* BUS: S A8 ACK | D8(1) ACK P */ | ||
66 | /* IRQ: DTE WAIT | WAIT DTE */ | ||
67 | /* ICIC: -DTE | +DTE */ | ||
68 | /* ICCR: 0x94 0x81 | 0xc0 */ | ||
69 | /* ICDR: A8 | D8(1) */ | ||
70 | /* */ | ||
71 | /* 2 byte receive [TX]| [RX] */ | ||
72 | /* BUS: S A8 ACK | D8(1) ACK D8(2) ACK P */ | ||
73 | /* IRQ: DTE WAIT | WAIT WAIT DTE */ | ||
74 | /* ICIC: -DTE | +DTE */ | ||
75 | /* ICCR: 0x94 0x81 | 0xc0 */ | ||
76 | /* ICDR: A8 | D8(1) D8(2) */ | ||
77 | /* */ | ||
78 | /* 3 byte receive [TX] | [RX] */ | ||
79 | /* BUS: S A8 ACK | D8(1) ACK D8(2) ACK D8(3) ACK P */ | ||
80 | /* IRQ: DTE WAIT | WAIT WAIT WAIT DTE */ | ||
81 | /* ICIC: -DTE | +DTE */ | ||
82 | /* ICCR: 0x94 0x81 | 0xc0 */ | ||
83 | /* ICDR: A8 | D8(1) D8(2) D8(3) */ | ||
84 | /* */ | ||
85 | /* 4 bytes or more, this part is repeated +---------+ */ | ||
86 | /* */ | ||
87 | /* */ | ||
88 | /* Interrupt order and BUSY flag */ | ||
89 | /* ___ _ */ | ||
90 | /* SDA ___\___XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXAAAAAAAAA___/ */ | ||
91 | /* SCL \_/1\_/2\_/3\_/4\_/5\_/6\_/7\_/8\___/9\_____/ */ | ||
92 | /* */ | ||
93 | /* S D7 D6 D5 D4 D3 D2 D1 D0 P */ | ||
94 | /* ___ */ | ||
95 | /* WAIT IRQ ________________________________/ \___________ */ | ||
96 | /* TACK IRQ ____________________________________/ \_______ */ | ||
97 | /* DTE IRQ __________________________________________/ \_ */ | ||
98 | /* AL IRQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ | ||
99 | /* _______________________________________________ */ | ||
100 | /* BUSY __/ \_ */ | ||
101 | /* */ | ||
102 | |||
34 | enum sh_mobile_i2c_op { | 103 | enum sh_mobile_i2c_op { |
35 | OP_START = 0, | 104 | OP_START = 0, |
36 | OP_TX_ONLY, | 105 | OP_TX_FIRST, |
106 | OP_TX, | ||
37 | OP_TX_STOP, | 107 | OP_TX_STOP, |
38 | OP_TX_TO_RX, | 108 | OP_TX_TO_RX, |
39 | OP_RX_ONLY, | 109 | OP_RX, |
40 | OP_RX_STOP, | 110 | OP_RX_STOP, |
111 | OP_RX_STOP_DATA, | ||
41 | }; | 112 | }; |
42 | 113 | ||
43 | struct sh_mobile_i2c_data { | 114 | struct sh_mobile_i2c_data { |
@@ -127,25 +198,34 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, | |||
127 | spin_lock_irqsave(&pd->lock, flags); | 198 | spin_lock_irqsave(&pd->lock, flags); |
128 | 199 | ||
129 | switch (op) { | 200 | switch (op) { |
130 | case OP_START: | 201 | case OP_START: /* issue start and trigger DTE interrupt */ |
131 | iowrite8(0x94, ICCR(pd)); | 202 | iowrite8(0x94, ICCR(pd)); |
132 | break; | 203 | break; |
133 | case OP_TX_ONLY: | 204 | case OP_TX_FIRST: /* disable DTE interrupt and write data */ |
205 | iowrite8(ICIC_WAITE | ICIC_ALE | ICIC_TACKE, ICIC(pd)); | ||
134 | iowrite8(data, ICDR(pd)); | 206 | iowrite8(data, ICDR(pd)); |
135 | break; | 207 | break; |
136 | case OP_TX_STOP: | 208 | case OP_TX: /* write data */ |
137 | iowrite8(data, ICDR(pd)); | 209 | iowrite8(data, ICDR(pd)); |
138 | iowrite8(0x90, ICCR(pd)); | ||
139 | iowrite8(ICIC_ALE | ICIC_TACKE, ICIC(pd)); | ||
140 | break; | 210 | break; |
141 | case OP_TX_TO_RX: | 211 | case OP_TX_STOP: /* write data and issue a stop afterwards */ |
142 | iowrite8(data, ICDR(pd)); | 212 | iowrite8(data, ICDR(pd)); |
213 | iowrite8(0x90, ICCR(pd)); | ||
214 | break; | ||
215 | case OP_TX_TO_RX: /* select read mode */ | ||
143 | iowrite8(0x81, ICCR(pd)); | 216 | iowrite8(0x81, ICCR(pd)); |
144 | break; | 217 | break; |
145 | case OP_RX_ONLY: | 218 | case OP_RX: /* just read data */ |
146 | ret = ioread8(ICDR(pd)); | 219 | ret = ioread8(ICDR(pd)); |
147 | break; | 220 | break; |
148 | case OP_RX_STOP: | 221 | case OP_RX_STOP: /* enable DTE interrupt, issue stop */ |
222 | iowrite8(ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE, | ||
223 | ICIC(pd)); | ||
224 | iowrite8(0xc0, ICCR(pd)); | ||
225 | break; | ||
226 | case OP_RX_STOP_DATA: /* enable DTE interrupt, read data, issue stop */ | ||
227 | iowrite8(ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE, | ||
228 | ICIC(pd)); | ||
149 | ret = ioread8(ICDR(pd)); | 229 | ret = ioread8(ICDR(pd)); |
150 | iowrite8(0xc0, ICCR(pd)); | 230 | iowrite8(0xc0, ICCR(pd)); |
151 | break; | 231 | break; |
@@ -157,58 +237,120 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, | |||
157 | return ret; | 237 | return ret; |
158 | } | 238 | } |
159 | 239 | ||
240 | static int sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd) | ||
241 | { | ||
242 | if (pd->pos == -1) | ||
243 | return 1; | ||
244 | |||
245 | return 0; | ||
246 | } | ||
247 | |||
248 | static int sh_mobile_i2c_is_last_byte(struct sh_mobile_i2c_data *pd) | ||
249 | { | ||
250 | if (pd->pos == (pd->msg->len - 1)) | ||
251 | return 1; | ||
252 | |||
253 | return 0; | ||
254 | } | ||
255 | |||
256 | static void sh_mobile_i2c_get_data(struct sh_mobile_i2c_data *pd, | ||
257 | unsigned char *buf) | ||
258 | { | ||
259 | switch (pd->pos) { | ||
260 | case -1: | ||
261 | *buf = (pd->msg->addr & 0x7f) << 1; | ||
262 | *buf |= (pd->msg->flags & I2C_M_RD) ? 1 : 0; | ||
263 | break; | ||
264 | default: | ||
265 | *buf = pd->msg->buf[pd->pos]; | ||
266 | } | ||
267 | } | ||
268 | |||
269 | static int sh_mobile_i2c_isr_tx(struct sh_mobile_i2c_data *pd) | ||
270 | { | ||
271 | unsigned char data; | ||
272 | |||
273 | if (pd->pos == pd->msg->len) | ||
274 | return 1; | ||
275 | |||
276 | sh_mobile_i2c_get_data(pd, &data); | ||
277 | |||
278 | if (sh_mobile_i2c_is_last_byte(pd)) | ||
279 | i2c_op(pd, OP_TX_STOP, data); | ||
280 | else if (sh_mobile_i2c_is_first_byte(pd)) | ||
281 | i2c_op(pd, OP_TX_FIRST, data); | ||
282 | else | ||
283 | i2c_op(pd, OP_TX, data); | ||
284 | |||
285 | pd->pos++; | ||
286 | return 0; | ||
287 | } | ||
288 | |||
289 | static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd) | ||
290 | { | ||
291 | unsigned char data; | ||
292 | int real_pos; | ||
293 | |||
294 | do { | ||
295 | if (pd->pos <= -1) { | ||
296 | sh_mobile_i2c_get_data(pd, &data); | ||
297 | |||
298 | if (sh_mobile_i2c_is_first_byte(pd)) | ||
299 | i2c_op(pd, OP_TX_FIRST, data); | ||
300 | else | ||
301 | i2c_op(pd, OP_TX, data); | ||
302 | break; | ||
303 | } | ||
304 | |||
305 | if (pd->pos == 0) { | ||
306 | i2c_op(pd, OP_TX_TO_RX, 0); | ||
307 | break; | ||
308 | } | ||
309 | |||
310 | real_pos = pd->pos - 2; | ||
311 | |||
312 | if (pd->pos == pd->msg->len) { | ||
313 | if (real_pos < 0) { | ||
314 | i2c_op(pd, OP_RX_STOP, 0); | ||
315 | break; | ||
316 | } | ||
317 | data = i2c_op(pd, OP_RX_STOP_DATA, 0); | ||
318 | } else | ||
319 | data = i2c_op(pd, OP_RX, 0); | ||
320 | |||
321 | pd->msg->buf[real_pos] = data; | ||
322 | } while (0); | ||
323 | |||
324 | pd->pos++; | ||
325 | return pd->pos == (pd->msg->len + 2); | ||
326 | } | ||
327 | |||
160 | static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) | 328 | static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) |
161 | { | 329 | { |
162 | struct platform_device *dev = dev_id; | 330 | struct platform_device *dev = dev_id; |
163 | struct sh_mobile_i2c_data *pd = platform_get_drvdata(dev); | 331 | struct sh_mobile_i2c_data *pd = platform_get_drvdata(dev); |
164 | struct i2c_msg *msg = pd->msg; | 332 | unsigned char sr; |
165 | unsigned char data, sr; | 333 | int wakeup; |
166 | int wakeup = 0; | ||
167 | 334 | ||
168 | sr = ioread8(ICSR(pd)); | 335 | sr = ioread8(ICSR(pd)); |
169 | pd->sr |= sr; | 336 | pd->sr |= sr; /* remember state */ |
170 | 337 | ||
171 | dev_dbg(pd->dev, "i2c_isr 0x%02x 0x%02x %s %d %d!\n", sr, pd->sr, | 338 | dev_dbg(pd->dev, "i2c_isr 0x%02x 0x%02x %s %d %d!\n", sr, pd->sr, |
172 | (msg->flags & I2C_M_RD) ? "read" : "write", | 339 | (pd->msg->flags & I2C_M_RD) ? "read" : "write", |
173 | pd->pos, msg->len); | 340 | pd->pos, pd->msg->len); |
174 | 341 | ||
175 | if (sr & (ICSR_AL | ICSR_TACK)) { | 342 | if (sr & (ICSR_AL | ICSR_TACK)) { |
176 | iowrite8(0, ICIC(pd)); /* disable interrupts */ | 343 | /* don't interrupt transaction - continue to issue stop */ |
177 | wakeup = 1; | 344 | iowrite8(sr & ~(ICSR_AL | ICSR_TACK), ICSR(pd)); |
178 | goto do_wakeup; | 345 | wakeup = 0; |
179 | } | 346 | } else if (pd->msg->flags & I2C_M_RD) |
347 | wakeup = sh_mobile_i2c_isr_rx(pd); | ||
348 | else | ||
349 | wakeup = sh_mobile_i2c_isr_tx(pd); | ||
180 | 350 | ||
181 | if (pd->pos == msg->len) { | 351 | if (sr & ICSR_WAIT) /* TODO: add delay here to support slow acks */ |
182 | i2c_op(pd, OP_RX_ONLY, 0); | 352 | iowrite8(sr & ~ICSR_WAIT, ICSR(pd)); |
183 | wakeup = 1; | ||
184 | goto do_wakeup; | ||
185 | } | ||
186 | 353 | ||
187 | if (pd->pos == -1) { | ||
188 | data = (msg->addr & 0x7f) << 1; | ||
189 | data |= (msg->flags & I2C_M_RD) ? 1 : 0; | ||
190 | } else | ||
191 | data = msg->buf[pd->pos]; | ||
192 | |||
193 | if ((pd->pos == -1) || !(msg->flags & I2C_M_RD)) { | ||
194 | if (msg->flags & I2C_M_RD) | ||
195 | i2c_op(pd, OP_TX_TO_RX, data); | ||
196 | else if (pd->pos == (msg->len - 1)) { | ||
197 | i2c_op(pd, OP_TX_STOP, data); | ||
198 | wakeup = 1; | ||
199 | } else | ||
200 | i2c_op(pd, OP_TX_ONLY, data); | ||
201 | } else { | ||
202 | if (pd->pos == (msg->len - 1)) | ||
203 | data = i2c_op(pd, OP_RX_STOP, 0); | ||
204 | else | ||
205 | data = i2c_op(pd, OP_RX_ONLY, 0); | ||
206 | |||
207 | msg->buf[pd->pos] = data; | ||
208 | } | ||
209 | pd->pos++; | ||
210 | |||
211 | do_wakeup: | ||
212 | if (wakeup) { | 354 | if (wakeup) { |
213 | pd->sr |= SW_DONE; | 355 | pd->sr |= SW_DONE; |
214 | wake_up(&pd->wait); | 356 | wake_up(&pd->wait); |
@@ -219,6 +361,11 @@ static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) | |||
219 | 361 | ||
220 | static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg) | 362 | static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg) |
221 | { | 363 | { |
364 | if (usr_msg->len == 0 && (usr_msg->flags & I2C_M_RD)) { | ||
365 | dev_err(pd->dev, "Unsupported zero length i2c read\n"); | ||
366 | return -EIO; | ||
367 | } | ||
368 | |||
222 | /* Initialize channel registers */ | 369 | /* Initialize channel registers */ |
223 | iowrite8(ioread8(ICCR(pd)) & ~ICCR_ICE, ICCR(pd)); | 370 | iowrite8(ioread8(ICCR(pd)) & ~ICCR_ICE, ICCR(pd)); |
224 | 371 | ||
@@ -233,9 +380,8 @@ static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg) | |||
233 | pd->pos = -1; | 380 | pd->pos = -1; |
234 | pd->sr = 0; | 381 | pd->sr = 0; |
235 | 382 | ||
236 | /* Enable all interrupts except wait */ | 383 | /* Enable all interrupts to begin with */ |
237 | iowrite8(ioread8(ICIC(pd)) | ICIC_ALE | ICIC_TACKE | ICIC_DTEE, | 384 | iowrite8(ICIC_WAITE | ICIC_ALE | ICIC_TACKE | ICIC_DTEE, ICIC(pd)); |
238 | ICIC(pd)); | ||
239 | return 0; | 385 | return 0; |
240 | } | 386 | } |
241 | 387 | ||
@@ -268,25 +414,18 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter, | |||
268 | if (!k) | 414 | if (!k) |
269 | dev_err(pd->dev, "Transfer request timed out\n"); | 415 | dev_err(pd->dev, "Transfer request timed out\n"); |
270 | 416 | ||
271 | retry_count = 10; | 417 | retry_count = 1000; |
272 | again: | 418 | again: |
273 | val = ioread8(ICSR(pd)); | 419 | val = ioread8(ICSR(pd)); |
274 | 420 | ||
275 | dev_dbg(pd->dev, "val 0x%02x pd->sr 0x%02x\n", val, pd->sr); | 421 | dev_dbg(pd->dev, "val 0x%02x pd->sr 0x%02x\n", val, pd->sr); |
276 | 422 | ||
277 | if ((val | pd->sr) & (ICSR_TACK | ICSR_AL)) { | ||
278 | err = -EIO; | ||
279 | break; | ||
280 | } | ||
281 | |||
282 | /* the interrupt handler may wake us up before the | 423 | /* the interrupt handler may wake us up before the |
283 | * transfer is finished, so poll the hardware | 424 | * transfer is finished, so poll the hardware |
284 | * until we're done. | 425 | * until we're done. |
285 | */ | 426 | */ |
286 | 427 | if (val & ICSR_BUSY) { | |
287 | if (!(!(val & ICSR_BUSY) && (val & ICSR_SCLM) && | 428 | udelay(10); |
288 | (val & ICSR_SDAM))) { | ||
289 | msleep(1); | ||
290 | if (retry_count--) | 429 | if (retry_count--) |
291 | goto again; | 430 | goto again; |
292 | 431 | ||
@@ -294,6 +433,12 @@ again: | |||
294 | dev_err(pd->dev, "Polling timed out\n"); | 433 | dev_err(pd->dev, "Polling timed out\n"); |
295 | break; | 434 | break; |
296 | } | 435 | } |
436 | |||
437 | /* handle missing acknowledge and arbitration lost */ | ||
438 | if ((val | pd->sr) & (ICSR_TACK | ICSR_AL)) { | ||
439 | err = -EIO; | ||
440 | break; | ||
441 | } | ||
297 | } | 442 | } |
298 | 443 | ||
299 | deactivate_ch(pd); | 444 | deactivate_ch(pd); |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index a34758d29516..fc735ab08ff4 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -242,7 +242,7 @@ config BLK_DEV_IDEFLOPPY | |||
242 | module will be called ide-floppy. | 242 | module will be called ide-floppy. |
243 | 243 | ||
244 | config BLK_DEV_IDESCSI | 244 | config BLK_DEV_IDESCSI |
245 | tristate "SCSI emulation support" | 245 | tristate "SCSI emulation support (DEPRECATED)" |
246 | depends on SCSI | 246 | depends on SCSI |
247 | select IDE_ATAPI | 247 | select IDE_ATAPI |
248 | ---help--- | 248 | ---help--- |
@@ -255,20 +255,6 @@ config BLK_DEV_IDESCSI | |||
255 | and will allow you to use a SCSI device driver instead of a native | 255 | and will allow you to use a SCSI device driver instead of a native |
256 | ATAPI driver. | 256 | ATAPI driver. |
257 | 257 | ||
258 | This is useful if you have an ATAPI device for which no native | ||
259 | driver has been written (for example, an ATAPI PD-CD drive); | ||
260 | you can then use this emulation together with an appropriate SCSI | ||
261 | device driver. In order to do this, say Y here and to "SCSI support" | ||
262 | and "SCSI generic support", below. You must then provide the kernel | ||
263 | command line "hdx=ide-scsi" (try "man bootparam" or see the | ||
264 | documentation of your boot loader (lilo or loadlin) about how to | ||
265 | pass options to the kernel at boot time) for devices if you want the | ||
266 | native EIDE sub-drivers to skip over the native support, so that | ||
267 | this SCSI emulation can be used instead. | ||
268 | |||
269 | Note that this option does NOT allow you to attach SCSI devices to a | ||
270 | box that doesn't have a SCSI host adapter installed. | ||
271 | |||
272 | If both this SCSI emulation and native ATAPI support are compiled | 258 | If both this SCSI emulation and native ATAPI support are compiled |
273 | into the kernel, the native support will be used. | 259 | into the kernel, the native support will be used. |
274 | 260 | ||
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c index f788fa5a977b..4fd91dcf1dc2 100644 --- a/drivers/ide/arm/palm_bk3710.c +++ b/drivers/ide/arm/palm_bk3710.c | |||
@@ -343,11 +343,10 @@ static struct ide_port_info __devinitdata palm_bk3710_port_info = { | |||
343 | .mwdma_mask = ATA_MWDMA2, | 343 | .mwdma_mask = ATA_MWDMA2, |
344 | }; | 344 | }; |
345 | 345 | ||
346 | static int __devinit palm_bk3710_probe(struct platform_device *pdev) | 346 | static int __init palm_bk3710_probe(struct platform_device *pdev) |
347 | { | 347 | { |
348 | struct clk *clk; | 348 | struct clk *clk; |
349 | struct resource *mem, *irq; | 349 | struct resource *mem, *irq; |
350 | struct ide_host *host; | ||
351 | unsigned long base, rate; | 350 | unsigned long base, rate; |
352 | int i, rc; | 351 | int i, rc; |
353 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | 352 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
@@ -390,6 +389,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev) | |||
390 | hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; | 389 | hw.io_ports_array[i] = base + IDE_PALM_ATA_PRI_REG_OFFSET + i; |
391 | hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; | 390 | hw.io_ports.ctl_addr = base + IDE_PALM_ATA_PRI_CTL_OFFSET; |
392 | hw.irq = irq->start; | 391 | hw.irq = irq->start; |
392 | hw.dev = &pdev->dev; | ||
393 | hw.chipset = ide_palm3710; | 393 | hw.chipset = ide_palm3710; |
394 | 394 | ||
395 | palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 : | 395 | palm_bk3710_port_info.udma_mask = rate < 100000000 ? ATA_UDMA4 : |
@@ -413,13 +413,11 @@ static struct platform_driver platform_bk_driver = { | |||
413 | .name = "palm_bk3710", | 413 | .name = "palm_bk3710", |
414 | .owner = THIS_MODULE, | 414 | .owner = THIS_MODULE, |
415 | }, | 415 | }, |
416 | .probe = palm_bk3710_probe, | ||
417 | .remove = NULL, | ||
418 | }; | 416 | }; |
419 | 417 | ||
420 | static int __init palm_bk3710_init(void) | 418 | static int __init palm_bk3710_init(void) |
421 | { | 419 | { |
422 | return platform_driver_register(&platform_bk_driver); | 420 | return platform_driver_probe(&platform_bk_driver, palm_bk3710_probe); |
423 | } | 421 | } |
424 | 422 | ||
425 | module_init(palm_bk3710_init); | 423 | module_init(palm_bk3710_init); |
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 68b9cf0138b0..07ef88bd109b 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -445,20 +445,6 @@ static void idedisk_check_hpa(ide_drive_t *drive) | |||
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | /* | ||
449 | * Compute drive->capacity, the full capacity of the drive | ||
450 | * Called with drive->id != NULL. | ||
451 | * | ||
452 | * To compute capacity, this uses either of | ||
453 | * | ||
454 | * 1. CHS value set by user (whatever user sets will be trusted) | ||
455 | * 2. LBA value from target drive (require new ATA feature) | ||
456 | * 3. LBA value from system BIOS (new one is OK, old one may break) | ||
457 | * 4. CHS value from system BIOS (traditional style) | ||
458 | * | ||
459 | * in above order (i.e., if value of higher priority is available, | ||
460 | * reset will be ignored). | ||
461 | */ | ||
462 | static void init_idedisk_capacity(ide_drive_t *drive) | 448 | static void init_idedisk_capacity(ide_drive_t *drive) |
463 | { | 449 | { |
464 | struct hd_driveid *id = drive->id; | 450 | struct hd_driveid *id = drive->id; |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index eb107eef0dbc..c37ab1743819 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -613,6 +613,14 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list) | |||
613 | return 0; | 613 | return 0; |
614 | } | 614 | } |
615 | 615 | ||
616 | static struct hpt_info *hpt3xx_get_info(struct device *dev) | ||
617 | { | ||
618 | struct ide_host *host = dev_get_drvdata(dev); | ||
619 | struct hpt_info *info = (struct hpt_info *)host->host_priv; | ||
620 | |||
621 | return dev == host->dev[1] ? info + 1 : info; | ||
622 | } | ||
623 | |||
616 | /* | 624 | /* |
617 | * The Marvell bridge chips used on the HighPoint SATA cards do not seem | 625 | * The Marvell bridge chips used on the HighPoint SATA cards do not seem |
618 | * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... | 626 | * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... |
@@ -621,9 +629,7 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list) | |||
621 | static u8 hpt3xx_udma_filter(ide_drive_t *drive) | 629 | static u8 hpt3xx_udma_filter(ide_drive_t *drive) |
622 | { | 630 | { |
623 | ide_hwif_t *hwif = HWIF(drive); | 631 | ide_hwif_t *hwif = HWIF(drive); |
624 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 632 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
625 | struct ide_host *host = pci_get_drvdata(dev); | ||
626 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
627 | u8 mask = hwif->ultra_mask; | 633 | u8 mask = hwif->ultra_mask; |
628 | 634 | ||
629 | switch (info->chip_type) { | 635 | switch (info->chip_type) { |
@@ -662,9 +668,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive) | |||
662 | static u8 hpt3xx_mdma_filter(ide_drive_t *drive) | 668 | static u8 hpt3xx_mdma_filter(ide_drive_t *drive) |
663 | { | 669 | { |
664 | ide_hwif_t *hwif = HWIF(drive); | 670 | ide_hwif_t *hwif = HWIF(drive); |
665 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 671 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
666 | struct ide_host *host = pci_get_drvdata(dev); | ||
667 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
668 | 672 | ||
669 | switch (info->chip_type) { | 673 | switch (info->chip_type) { |
670 | case HPT372 : | 674 | case HPT372 : |
@@ -700,8 +704,7 @@ static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed) | |||
700 | { | 704 | { |
701 | ide_hwif_t *hwif = drive->hwif; | 705 | ide_hwif_t *hwif = drive->hwif; |
702 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 706 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
703 | struct ide_host *host = pci_get_drvdata(dev); | 707 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
704 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
705 | struct hpt_timings *t = info->timings; | 708 | struct hpt_timings *t = info->timings; |
706 | u8 itr_addr = 0x40 + (drive->dn * 4); | 709 | u8 itr_addr = 0x40 + (drive->dn * 4); |
707 | u32 old_itr = 0; | 710 | u32 old_itr = 0; |
@@ -744,8 +747,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask) | |||
744 | { | 747 | { |
745 | ide_hwif_t *hwif = HWIF(drive); | 748 | ide_hwif_t *hwif = HWIF(drive); |
746 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 749 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
747 | struct ide_host *host = pci_get_drvdata(dev); | 750 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
748 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
749 | 751 | ||
750 | if (drive->quirk_list) { | 752 | if (drive->quirk_list) { |
751 | if (info->chip_type >= HPT370) { | 753 | if (info->chip_type >= HPT370) { |
@@ -973,8 +975,7 @@ static int __devinit hpt37x_calibrate_dpll(struct pci_dev *dev, u16 f_low, u16 f | |||
973 | static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) | 975 | static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) |
974 | { | 976 | { |
975 | unsigned long io_base = pci_resource_start(dev, 4); | 977 | unsigned long io_base = pci_resource_start(dev, 4); |
976 | struct ide_host *host = pci_get_drvdata(dev); | 978 | struct hpt_info *info = hpt3xx_get_info(&dev->dev); |
977 | struct hpt_info *info = host->host_priv + (&dev->dev == host->dev[1]); | ||
978 | const char *name = DRV_NAME; | 979 | const char *name = DRV_NAME; |
979 | u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ | 980 | u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ |
980 | u8 chip_type; | 981 | u8 chip_type; |
@@ -1217,8 +1218,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) | |||
1217 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | 1218 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) |
1218 | { | 1219 | { |
1219 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1220 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1220 | struct ide_host *host = pci_get_drvdata(dev); | 1221 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
1221 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
1222 | u8 chip_type = info->chip_type; | 1222 | u8 chip_type = info->chip_type; |
1223 | u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; | 1223 | u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; |
1224 | 1224 | ||
@@ -1262,8 +1262,7 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | |||
1262 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) | 1262 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) |
1263 | { | 1263 | { |
1264 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1264 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1265 | struct ide_host *host = pci_get_drvdata(dev); | 1265 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
1266 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
1267 | int serialize = HPT_SERIALIZE_IO; | 1266 | int serialize = HPT_SERIALIZE_IO; |
1268 | u8 chip_type = info->chip_type; | 1267 | u8 chip_type = info->chip_type; |
1269 | u8 new_mcr, old_mcr = 0; | 1268 | u8 new_mcr, old_mcr = 0; |
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f29dbb767e87..9559248f265b 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -1342,6 +1342,12 @@ static __be32 convert_access(int acc) | |||
1342 | static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) | 1342 | static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) |
1343 | { | 1343 | { |
1344 | struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(wr->wr.fast_reg.page_list); | 1344 | struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(wr->wr.fast_reg.page_list); |
1345 | int i; | ||
1346 | |||
1347 | for (i = 0; i < wr->wr.fast_reg.page_list_len; ++i) | ||
1348 | wr->wr.fast_reg.page_list->page_list[i] = | ||
1349 | cpu_to_be64(wr->wr.fast_reg.page_list->page_list[i] | | ||
1350 | MLX4_MTT_FLAG_PRESENT); | ||
1345 | 1351 | ||
1346 | fseg->flags = convert_access(wr->wr.fast_reg.access_flags); | 1352 | fseg->flags = convert_access(wr->wr.fast_reg.access_flags); |
1347 | fseg->mem_key = cpu_to_be32(wr->wr.fast_reg.rkey); | 1353 | fseg->mem_key = cpu_to_be32(wr->wr.fast_reg.rkey); |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 9f0b964b2c99..499d3cf83e1f 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -1956,13 +1956,6 @@ static int mini_cm_reject(struct nes_cm_core *cm_core, | |||
1956 | return ret; | 1956 | return ret; |
1957 | cleanup_retrans_entry(cm_node); | 1957 | cleanup_retrans_entry(cm_node); |
1958 | cm_node->state = NES_CM_STATE_CLOSED; | 1958 | cm_node->state = NES_CM_STATE_CLOSED; |
1959 | ret = send_fin(cm_node, NULL); | ||
1960 | |||
1961 | if (cm_node->accept_pend) { | ||
1962 | BUG_ON(!cm_node->listener); | ||
1963 | atomic_dec(&cm_node->listener->pend_accepts_cnt); | ||
1964 | BUG_ON(atomic_read(&cm_node->listener->pend_accepts_cnt) < 0); | ||
1965 | } | ||
1966 | 1959 | ||
1967 | ret = send_reset(cm_node, NULL); | 1960 | ret = send_reset(cm_node, NULL); |
1968 | return ret; | 1961 | return ret; |
@@ -2383,6 +2376,7 @@ static int nes_cm_disconn_true(struct nes_qp *nesqp) | |||
2383 | atomic_inc(&cm_disconnects); | 2376 | atomic_inc(&cm_disconnects); |
2384 | cm_event.event = IW_CM_EVENT_DISCONNECT; | 2377 | cm_event.event = IW_CM_EVENT_DISCONNECT; |
2385 | if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) { | 2378 | if (last_ae == NES_AEQE_AEID_LLP_CONNECTION_RESET) { |
2379 | issued_disconnect_reset = 1; | ||
2386 | cm_event.status = IW_CM_EVENT_STATUS_RESET; | 2380 | cm_event.status = IW_CM_EVENT_STATUS_RESET; |
2387 | nes_debug(NES_DBG_CM, "Generating a CM " | 2381 | nes_debug(NES_DBG_CM, "Generating a CM " |
2388 | "Disconnect Event (status reset) for " | 2382 | "Disconnect Event (status reset) for " |
@@ -2508,7 +2502,6 @@ static int nes_disconnect(struct nes_qp *nesqp, int abrupt) | |||
2508 | nes_debug(NES_DBG_CM, "Call close API\n"); | 2502 | nes_debug(NES_DBG_CM, "Call close API\n"); |
2509 | 2503 | ||
2510 | g_cm_core->api->close(g_cm_core, nesqp->cm_node); | 2504 | g_cm_core->api->close(g_cm_core, nesqp->cm_node); |
2511 | nesqp->cm_node = NULL; | ||
2512 | } | 2505 | } |
2513 | 2506 | ||
2514 | return ret; | 2507 | return ret; |
@@ -2837,6 +2830,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
2837 | cm_node->apbvt_set = 1; | 2830 | cm_node->apbvt_set = 1; |
2838 | nesqp->cm_node = cm_node; | 2831 | nesqp->cm_node = cm_node; |
2839 | cm_node->nesqp = nesqp; | 2832 | cm_node->nesqp = nesqp; |
2833 | nes_add_ref(&nesqp->ibqp); | ||
2840 | 2834 | ||
2841 | return 0; | 2835 | return 0; |
2842 | } | 2836 | } |
@@ -3167,7 +3161,6 @@ static void cm_event_connect_error(struct nes_cm_event *event) | |||
3167 | if (ret) | 3161 | if (ret) |
3168 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " | 3162 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " |
3169 | "ret=%d\n", __func__, __LINE__, ret); | 3163 | "ret=%d\n", __func__, __LINE__, ret); |
3170 | nes_rem_ref(&nesqp->ibqp); | ||
3171 | cm_id->rem_ref(cm_id); | 3164 | cm_id->rem_ref(cm_id); |
3172 | 3165 | ||
3173 | rem_ref_cm_node(event->cm_node->cm_core, event->cm_node); | 3166 | rem_ref_cm_node(event->cm_node->cm_core, event->cm_node); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index b0ffc9abe8c0..05eb41b8ab63 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
@@ -293,6 +293,7 @@ struct ipoib_dev_priv { | |||
293 | 293 | ||
294 | struct delayed_work pkey_poll_task; | 294 | struct delayed_work pkey_poll_task; |
295 | struct delayed_work mcast_task; | 295 | struct delayed_work mcast_task; |
296 | struct work_struct carrier_on_task; | ||
296 | struct work_struct flush_light; | 297 | struct work_struct flush_light; |
297 | struct work_struct flush_normal; | 298 | struct work_struct flush_normal; |
298 | struct work_struct flush_heavy; | 299 | struct work_struct flush_heavy; |
@@ -464,6 +465,7 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | |||
464 | void ipoib_dev_cleanup(struct net_device *dev); | 465 | void ipoib_dev_cleanup(struct net_device *dev); |
465 | 466 | ||
466 | void ipoib_mcast_join_task(struct work_struct *work); | 467 | void ipoib_mcast_join_task(struct work_struct *work); |
468 | void ipoib_mcast_carrier_on_task(struct work_struct *work); | ||
467 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); | 469 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb); |
468 | 470 | ||
469 | void ipoib_mcast_restart_task(struct work_struct *work); | 471 | void ipoib_mcast_restart_task(struct work_struct *work); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 7e9e218738fa..1b1df5cc4113 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -1075,6 +1075,7 @@ static void ipoib_setup(struct net_device *dev) | |||
1075 | 1075 | ||
1076 | INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll); | 1076 | INIT_DELAYED_WORK(&priv->pkey_poll_task, ipoib_pkey_poll); |
1077 | INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); | 1077 | INIT_DELAYED_WORK(&priv->mcast_task, ipoib_mcast_join_task); |
1078 | INIT_WORK(&priv->carrier_on_task, ipoib_mcast_carrier_on_task); | ||
1078 | INIT_WORK(&priv->flush_light, ipoib_ib_dev_flush_light); | 1079 | INIT_WORK(&priv->flush_light, ipoib_ib_dev_flush_light); |
1079 | INIT_WORK(&priv->flush_normal, ipoib_ib_dev_flush_normal); | 1080 | INIT_WORK(&priv->flush_normal, ipoib_ib_dev_flush_normal); |
1080 | INIT_WORK(&priv->flush_heavy, ipoib_ib_dev_flush_heavy); | 1081 | INIT_WORK(&priv->flush_heavy, ipoib_ib_dev_flush_heavy); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index ac33c8f3ea85..aae28620a6e5 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -366,6 +366,21 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast) | |||
366 | return ret; | 366 | return ret; |
367 | } | 367 | } |
368 | 368 | ||
369 | void ipoib_mcast_carrier_on_task(struct work_struct *work) | ||
370 | { | ||
371 | struct ipoib_dev_priv *priv = container_of(work, struct ipoib_dev_priv, | ||
372 | carrier_on_task); | ||
373 | |||
374 | /* | ||
375 | * Take rtnl_lock to avoid racing with ipoib_stop() and | ||
376 | * turning the carrier back on while a device is being | ||
377 | * removed. | ||
378 | */ | ||
379 | rtnl_lock(); | ||
380 | netif_carrier_on(priv->dev); | ||
381 | rtnl_unlock(); | ||
382 | } | ||
383 | |||
369 | static int ipoib_mcast_join_complete(int status, | 384 | static int ipoib_mcast_join_complete(int status, |
370 | struct ib_sa_multicast *multicast) | 385 | struct ib_sa_multicast *multicast) |
371 | { | 386 | { |
@@ -392,16 +407,12 @@ static int ipoib_mcast_join_complete(int status, | |||
392 | &priv->mcast_task, 0); | 407 | &priv->mcast_task, 0); |
393 | mutex_unlock(&mcast_mutex); | 408 | mutex_unlock(&mcast_mutex); |
394 | 409 | ||
395 | if (mcast == priv->broadcast) { | 410 | /* |
396 | /* | 411 | * Defer carrier on work to ipoib_workqueue to avoid a |
397 | * Take RTNL lock here to avoid racing with | 412 | * deadlock on rtnl_lock here. |
398 | * ipoib_stop() and turning the carrier back | 413 | */ |
399 | * on while a device is being removed. | 414 | if (mcast == priv->broadcast) |
400 | */ | 415 | queue_work(ipoib_workqueue, &priv->carrier_on_task); |
401 | rtnl_lock(); | ||
402 | netif_carrier_on(dev); | ||
403 | rtnl_unlock(); | ||
404 | } | ||
405 | 416 | ||
406 | return 0; | 417 | return 0; |
407 | } | 418 | } |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 2ec921bf3c60..18f4d7f6ce6d 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -63,7 +63,7 @@ | |||
63 | } | 63 | } |
64 | 64 | ||
65 | /* table of devices that work with this driver */ | 65 | /* table of devices that work with this driver */ |
66 | static const struct usb_device_id bcm5974_table [] = { | 66 | static const struct usb_device_id bcm5974_table[] = { |
67 | /* MacbookAir1.1 */ | 67 | /* MacbookAir1.1 */ |
68 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), | 68 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), |
69 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ISO), | 69 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING_ISO), |
@@ -105,7 +105,7 @@ struct tp_header { | |||
105 | 105 | ||
106 | /* trackpad finger structure */ | 106 | /* trackpad finger structure */ |
107 | struct tp_finger { | 107 | struct tp_finger { |
108 | __le16 origin; /* left/right origin? */ | 108 | __le16 origin; /* zero when switching track finger */ |
109 | __le16 abs_x; /* absolute x coodinate */ | 109 | __le16 abs_x; /* absolute x coodinate */ |
110 | __le16 abs_y; /* absolute y coodinate */ | 110 | __le16 abs_y; /* absolute y coodinate */ |
111 | __le16 rel_x; /* relative x coodinate */ | 111 | __le16 rel_x; /* relative x coodinate */ |
@@ -159,6 +159,7 @@ struct bcm5974 { | |||
159 | struct bt_data *bt_data; /* button transferred data */ | 159 | struct bt_data *bt_data; /* button transferred data */ |
160 | struct urb *tp_urb; /* trackpad usb request block */ | 160 | struct urb *tp_urb; /* trackpad usb request block */ |
161 | struct tp_data *tp_data; /* trackpad transferred data */ | 161 | struct tp_data *tp_data; /* trackpad transferred data */ |
162 | int fingers; /* number of fingers on trackpad */ | ||
162 | }; | 163 | }; |
163 | 164 | ||
164 | /* logical dimensions */ | 165 | /* logical dimensions */ |
@@ -172,6 +173,10 @@ struct bcm5974 { | |||
172 | #define SN_WIDTH 100 /* width signal-to-noise ratio */ | 173 | #define SN_WIDTH 100 /* width signal-to-noise ratio */ |
173 | #define SN_COORD 250 /* coordinate signal-to-noise ratio */ | 174 | #define SN_COORD 250 /* coordinate signal-to-noise ratio */ |
174 | 175 | ||
176 | /* pressure thresholds */ | ||
177 | #define PRESSURE_LOW (2 * DIM_PRESSURE / SN_PRESSURE) | ||
178 | #define PRESSURE_HIGH (3 * PRESSURE_LOW) | ||
179 | |||
175 | /* device constants */ | 180 | /* device constants */ |
176 | static const struct bcm5974_config bcm5974_config_table[] = { | 181 | static const struct bcm5974_config bcm5974_config_table[] = { |
177 | { | 182 | { |
@@ -248,6 +253,7 @@ static void setup_events_to_report(struct input_dev *input_dev, | |||
248 | 0, cfg->y.dim, cfg->y.fuzz, 0); | 253 | 0, cfg->y.dim, cfg->y.fuzz, 0); |
249 | 254 | ||
250 | __set_bit(EV_KEY, input_dev->evbit); | 255 | __set_bit(EV_KEY, input_dev->evbit); |
256 | __set_bit(BTN_TOUCH, input_dev->keybit); | ||
251 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); | 257 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
252 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); | 258 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
253 | __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); | 259 | __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); |
@@ -273,32 +279,66 @@ static int report_tp_state(struct bcm5974 *dev, int size) | |||
273 | const struct tp_finger *f = dev->tp_data->finger; | 279 | const struct tp_finger *f = dev->tp_data->finger; |
274 | struct input_dev *input = dev->input; | 280 | struct input_dev *input = dev->input; |
275 | const int fingers = (size - 26) / 28; | 281 | const int fingers = (size - 26) / 28; |
276 | int p = 0, w, x, y, n = 0; | 282 | int raw_p, raw_w, raw_x, raw_y; |
283 | int ptest = 0, origin = 0, nmin = 0, nmax = 0; | ||
284 | int abs_p = 0, abs_w = 0, abs_x = 0, abs_y = 0; | ||
277 | 285 | ||
278 | if (size < 26 || (size - 26) % 28 != 0) | 286 | if (size < 26 || (size - 26) % 28 != 0) |
279 | return -EIO; | 287 | return -EIO; |
280 | 288 | ||
289 | /* always track the first finger; when detached, start over */ | ||
281 | if (fingers) { | 290 | if (fingers) { |
282 | p = raw2int(f->force_major); | 291 | raw_p = raw2int(f->force_major); |
283 | w = raw2int(f->size_major); | 292 | raw_w = raw2int(f->size_major); |
284 | x = raw2int(f->abs_x); | 293 | raw_x = raw2int(f->abs_x); |
285 | y = raw2int(f->abs_y); | 294 | raw_y = raw2int(f->abs_y); |
286 | n = p > 0 ? fingers : 0; | ||
287 | 295 | ||
288 | dprintk(9, | 296 | dprintk(9, |
289 | "bcm5974: p: %+05d w: %+05d x: %+05d y: %+05d n: %d\n", | 297 | "bcm5974: raw: p: %+05d w: %+05d x: %+05d y: %+05d\n", |
290 | p, w, x, y, n); | 298 | raw_p, raw_w, raw_x, raw_y); |
299 | |||
300 | ptest = int2bound(&c->p, raw_p); | ||
301 | origin = raw2int(f->origin); | ||
302 | } | ||
291 | 303 | ||
292 | input_report_abs(input, ABS_TOOL_WIDTH, int2bound(&c->w, w)); | 304 | /* while tracking finger still valid, count all fingers */ |
293 | input_report_abs(input, ABS_X, int2bound(&c->x, x - c->x.devmin)); | 305 | if (ptest > PRESSURE_LOW && origin) { |
294 | input_report_abs(input, ABS_Y, int2bound(&c->y, c->y.devmax - y)); | 306 | abs_p = ptest; |
307 | abs_w = int2bound(&c->w, raw_w); | ||
308 | abs_x = int2bound(&c->x, raw_x - c->x.devmin); | ||
309 | abs_y = int2bound(&c->y, c->y.devmax - raw_y); | ||
310 | for (; f != dev->tp_data->finger + fingers; f++) { | ||
311 | ptest = int2bound(&c->p, raw2int(f->force_major)); | ||
312 | if (ptest > PRESSURE_LOW) | ||
313 | nmax++; | ||
314 | if (ptest > PRESSURE_HIGH) | ||
315 | nmin++; | ||
316 | } | ||
295 | } | 317 | } |
296 | 318 | ||
297 | input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p)); | 319 | if (dev->fingers < nmin) |
320 | dev->fingers = nmin; | ||
321 | if (dev->fingers > nmax) | ||
322 | dev->fingers = nmax; | ||
323 | |||
324 | input_report_key(input, BTN_TOUCH, dev->fingers > 0); | ||
325 | input_report_key(input, BTN_TOOL_FINGER, dev->fingers == 1); | ||
326 | input_report_key(input, BTN_TOOL_DOUBLETAP, dev->fingers == 2); | ||
327 | input_report_key(input, BTN_TOOL_TRIPLETAP, dev->fingers > 2); | ||
298 | 328 | ||
299 | input_report_key(input, BTN_TOOL_FINGER, n == 1); | 329 | input_report_abs(input, ABS_PRESSURE, abs_p); |
300 | input_report_key(input, BTN_TOOL_DOUBLETAP, n == 2); | 330 | input_report_abs(input, ABS_TOOL_WIDTH, abs_w); |
301 | input_report_key(input, BTN_TOOL_TRIPLETAP, n > 2); | 331 | |
332 | if (abs_p) { | ||
333 | input_report_abs(input, ABS_X, abs_x); | ||
334 | input_report_abs(input, ABS_Y, abs_y); | ||
335 | |||
336 | dprintk(8, | ||
337 | "bcm5974: abs: p: %+05d w: %+05d x: %+05d y: %+05d " | ||
338 | "nmin: %d nmax: %d n: %d\n", | ||
339 | abs_p, abs_w, abs_x, abs_y, nmin, nmax, dev->fingers); | ||
340 | |||
341 | } | ||
302 | 342 | ||
303 | input_sync(input); | 343 | input_sync(input); |
304 | 344 | ||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 3282b741e246..5aafe24984c5 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -305,7 +305,7 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
305 | .ident = "Lenovo 3000 n100", | 305 | .ident = "Lenovo 3000 n100", |
306 | .matches = { | 306 | .matches = { |
307 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | 307 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), |
308 | DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"), | 308 | DMI_MATCH(DMI_PRODUCT_NAME, "076804U"), |
309 | }, | 309 | }, |
310 | }, | 310 | }, |
311 | { | 311 | { |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 7e65bad522cb..ac89a5deaca2 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -238,15 +238,47 @@ static struct page *read_sb_page(mddev_t *mddev, long offset, unsigned long inde | |||
238 | 238 | ||
239 | } | 239 | } |
240 | 240 | ||
241 | static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) | ||
242 | { | ||
243 | /* Iterate the disks of an mddev, using rcu to protect access to the | ||
244 | * linked list, and raising the refcount of devices we return to ensure | ||
245 | * they don't disappear while in use. | ||
246 | * As devices are only added or removed when raid_disk is < 0 and | ||
247 | * nr_pending is 0 and In_sync is clear, the entries we return will | ||
248 | * still be in the same position on the list when we re-enter | ||
249 | * list_for_each_continue_rcu. | ||
250 | */ | ||
251 | struct list_head *pos; | ||
252 | rcu_read_lock(); | ||
253 | if (rdev == NULL) | ||
254 | /* start at the beginning */ | ||
255 | pos = &mddev->disks; | ||
256 | else { | ||
257 | /* release the previous rdev and start from there. */ | ||
258 | rdev_dec_pending(rdev, mddev); | ||
259 | pos = &rdev->same_set; | ||
260 | } | ||
261 | list_for_each_continue_rcu(pos, &mddev->disks) { | ||
262 | rdev = list_entry(pos, mdk_rdev_t, same_set); | ||
263 | if (rdev->raid_disk >= 0 && | ||
264 | test_bit(In_sync, &rdev->flags) && | ||
265 | !test_bit(Faulty, &rdev->flags)) { | ||
266 | /* this is a usable devices */ | ||
267 | atomic_inc(&rdev->nr_pending); | ||
268 | rcu_read_unlock(); | ||
269 | return rdev; | ||
270 | } | ||
271 | } | ||
272 | rcu_read_unlock(); | ||
273 | return NULL; | ||
274 | } | ||
275 | |||
241 | static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) | 276 | static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) |
242 | { | 277 | { |
243 | mdk_rdev_t *rdev; | 278 | mdk_rdev_t *rdev = NULL; |
244 | mddev_t *mddev = bitmap->mddev; | 279 | mddev_t *mddev = bitmap->mddev; |
245 | 280 | ||
246 | rcu_read_lock(); | 281 | while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { |
247 | rdev_for_each_rcu(rdev, mddev) | ||
248 | if (test_bit(In_sync, &rdev->flags) | ||
249 | && !test_bit(Faulty, &rdev->flags)) { | ||
250 | int size = PAGE_SIZE; | 282 | int size = PAGE_SIZE; |
251 | if (page->index == bitmap->file_pages-1) | 283 | if (page->index == bitmap->file_pages-1) |
252 | size = roundup(bitmap->last_page_size, | 284 | size = roundup(bitmap->last_page_size, |
@@ -281,8 +313,7 @@ static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) | |||
281 | + page->index * (PAGE_SIZE/512), | 313 | + page->index * (PAGE_SIZE/512), |
282 | size, | 314 | size, |
283 | page); | 315 | page); |
284 | } | 316 | } |
285 | rcu_read_unlock(); | ||
286 | 317 | ||
287 | if (wait) | 318 | if (wait) |
288 | md_super_wait(mddev); | 319 | md_super_wait(mddev); |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8cfadc5bd2ba..deeac4b44173 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -3841,8 +3841,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) | |||
3841 | 3841 | ||
3842 | del_timer_sync(&mddev->safemode_timer); | 3842 | del_timer_sync(&mddev->safemode_timer); |
3843 | 3843 | ||
3844 | invalidate_partition(disk, 0); | ||
3845 | |||
3846 | switch(mode) { | 3844 | switch(mode) { |
3847 | case 1: /* readonly */ | 3845 | case 1: /* readonly */ |
3848 | err = -ENXIO; | 3846 | err = -ENXIO; |
@@ -5763,7 +5761,11 @@ void md_do_sync(mddev_t *mddev) | |||
5763 | * time 'round when curr_resync == 2 | 5761 | * time 'round when curr_resync == 2 |
5764 | */ | 5762 | */ |
5765 | continue; | 5763 | continue; |
5766 | prepare_to_wait(&resync_wait, &wq, TASK_UNINTERRUPTIBLE); | 5764 | /* We need to wait 'interruptible' so as not to |
5765 | * contribute to the load average, and not to | ||
5766 | * be caught by 'softlockup' | ||
5767 | */ | ||
5768 | prepare_to_wait(&resync_wait, &wq, TASK_INTERRUPTIBLE); | ||
5767 | if (!kthread_should_stop() && | 5769 | if (!kthread_should_stop() && |
5768 | mddev2->curr_resync >= mddev->curr_resync) { | 5770 | mddev2->curr_resync >= mddev->curr_resync) { |
5769 | printk(KERN_INFO "md: delaying %s of %s" | 5771 | printk(KERN_INFO "md: delaying %s of %s" |
@@ -5771,6 +5773,8 @@ void md_do_sync(mddev_t *mddev) | |||
5771 | " share one or more physical units)\n", | 5773 | " share one or more physical units)\n", |
5772 | desc, mdname(mddev), mdname(mddev2)); | 5774 | desc, mdname(mddev), mdname(mddev2)); |
5773 | mddev_put(mddev2); | 5775 | mddev_put(mddev2); |
5776 | if (signal_pending(current)) | ||
5777 | flush_signals(current); | ||
5774 | schedule(); | 5778 | schedule(); |
5775 | finish_wait(&resync_wait, &wq); | 5779 | finish_wait(&resync_wait, &wq); |
5776 | goto try_again; | 5780 | goto try_again; |
diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c index e8bc7abf2409..99be9e5c85f7 100644 --- a/drivers/media/common/saa7146_video.c +++ b/drivers/media/common/saa7146_video.c | |||
@@ -1068,7 +1068,7 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1068 | { | 1068 | { |
1069 | v4l2_std_id *id = arg; | 1069 | v4l2_std_id *id = arg; |
1070 | int found = 0; | 1070 | int found = 0; |
1071 | int i, err; | 1071 | int i; |
1072 | 1072 | ||
1073 | DEB_EE(("VIDIOC_S_STD\n")); | 1073 | DEB_EE(("VIDIOC_S_STD\n")); |
1074 | 1074 | ||
@@ -1116,7 +1116,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1116 | case VIDIOC_OVERLAY: | 1116 | case VIDIOC_OVERLAY: |
1117 | { | 1117 | { |
1118 | int on = *(int *)arg; | 1118 | int on = *(int *)arg; |
1119 | int err = 0; | ||
1120 | 1119 | ||
1121 | DEB_D(("VIDIOC_OVERLAY on:%d\n",on)); | 1120 | DEB_D(("VIDIOC_OVERLAY on:%d\n",on)); |
1122 | if (on != 0) { | 1121 | if (on != 0) { |
@@ -1192,7 +1191,6 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int | |||
1192 | case VIDIOCGMBUF: | 1191 | case VIDIOCGMBUF: |
1193 | { | 1192 | { |
1194 | struct video_mbuf *mbuf = arg; | 1193 | struct video_mbuf *mbuf = arg; |
1195 | struct videobuf_queue *q; | ||
1196 | int i; | 1194 | int i; |
1197 | 1195 | ||
1198 | /* fixme: number of capture buffers and sizes for v4l apps */ | 1196 | /* fixme: number of capture buffers and sizes for v4l apps */ |
diff --git a/drivers/media/common/tuners/mt2131.c b/drivers/media/common/tuners/mt2131.c index e254bcfc2efb..e8d3c48f8605 100644 --- a/drivers/media/common/tuners/mt2131.c +++ b/drivers/media/common/tuners/mt2131.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" | 2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/common/tuners/mt2131.h b/drivers/media/common/tuners/mt2131.h index cd8376f6f7b4..6632de640df0 100644 --- a/drivers/media/common/tuners/mt2131.h +++ b/drivers/media/common/tuners/mt2131.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" | 2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/common/tuners/mt2131_priv.h b/drivers/media/common/tuners/mt2131_priv.h index e930759c2c00..4e05a67e88c1 100644 --- a/drivers/media/common/tuners/mt2131_priv.h +++ b/drivers/media/common/tuners/mt2131_priv.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" | 2 | * Driver for Microtune MT2131 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/common/tuners/mxl5005s.c b/drivers/media/common/tuners/mxl5005s.c index 0dc2bef9f6a3..227642b044ae 100644 --- a/drivers/media/common/tuners/mxl5005s.c +++ b/drivers/media/common/tuners/mxl5005s.c | |||
@@ -2,7 +2,7 @@ | |||
2 | MaxLinear MXL5005S VSB/QAM/DVBT tuner driver | 2 | MaxLinear MXL5005S VSB/QAM/DVBT tuner driver |
3 | 3 | ||
4 | Copyright (C) 2008 MaxLinear | 4 | Copyright (C) 2008 MaxLinear |
5 | Copyright (C) 2006 Steven Toth <stoth@hauppauge.com> | 5 | Copyright (C) 2006 Steven Toth <stoth@linuxtv.org> |
6 | Functions: | 6 | Functions: |
7 | mxl5005s_reset() | 7 | mxl5005s_reset() |
8 | mxl5005s_writereg() | 8 | mxl5005s_writereg() |
@@ -3837,7 +3837,7 @@ static u16 MXL_Hystersis_Test(struct dvb_frontend *fe, int Hystersis) | |||
3837 | /* ---------------------------------------------------------------- | 3837 | /* ---------------------------------------------------------------- |
3838 | * Begin: Everything after here is new code to adapt the | 3838 | * Begin: Everything after here is new code to adapt the |
3839 | * proprietary Realtek driver into a Linux API tuner. | 3839 | * proprietary Realtek driver into a Linux API tuner. |
3840 | * Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 3840 | * Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
3841 | */ | 3841 | */ |
3842 | static int mxl5005s_reset(struct dvb_frontend *fe) | 3842 | static int mxl5005s_reset(struct dvb_frontend *fe) |
3843 | { | 3843 | { |
diff --git a/drivers/media/common/tuners/mxl5005s.h b/drivers/media/common/tuners/mxl5005s.h index 396db150bf0c..7ac6815b30aa 100644 --- a/drivers/media/common/tuners/mxl5005s.h +++ b/drivers/media/common/tuners/mxl5005s.h | |||
@@ -2,7 +2,7 @@ | |||
2 | MaxLinear MXL5005S VSB/QAM/DVBT tuner driver | 2 | MaxLinear MXL5005S VSB/QAM/DVBT tuner driver |
3 | 3 | ||
4 | Copyright (C) 2008 MaxLinear | 4 | Copyright (C) 2008 MaxLinear |
5 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 5 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index 597e47f5d69c..aa773a658a2a 100644 --- a/drivers/media/common/tuners/tuner-simple.c +++ b/drivers/media/common/tuners/tuner-simple.c | |||
@@ -253,7 +253,7 @@ static struct tuner_params *simple_tuner_params(struct dvb_frontend *fe, | |||
253 | 253 | ||
254 | static int simple_config_lookup(struct dvb_frontend *fe, | 254 | static int simple_config_lookup(struct dvb_frontend *fe, |
255 | struct tuner_params *t_params, | 255 | struct tuner_params *t_params, |
256 | int *frequency, u8 *config, u8 *cb) | 256 | unsigned *frequency, u8 *config, u8 *cb) |
257 | { | 257 | { |
258 | struct tuner_simple_priv *priv = fe->tuner_priv; | 258 | struct tuner_simple_priv *priv = fe->tuner_priv; |
259 | int i; | 259 | int i; |
@@ -587,45 +587,45 @@ static int simple_set_tv_freq(struct dvb_frontend *fe, | |||
587 | priv->last_div = div; | 587 | priv->last_div = div; |
588 | if (t_params->has_tda9887) { | 588 | if (t_params->has_tda9887) { |
589 | struct v4l2_priv_tun_config tda9887_cfg; | 589 | struct v4l2_priv_tun_config tda9887_cfg; |
590 | int config = 0; | 590 | int tda_config = 0; |
591 | int is_secam_l = (params->std & (V4L2_STD_SECAM_L | | 591 | int is_secam_l = (params->std & (V4L2_STD_SECAM_L | |
592 | V4L2_STD_SECAM_LC)) && | 592 | V4L2_STD_SECAM_LC)) && |
593 | !(params->std & ~(V4L2_STD_SECAM_L | | 593 | !(params->std & ~(V4L2_STD_SECAM_L | |
594 | V4L2_STD_SECAM_LC)); | 594 | V4L2_STD_SECAM_LC)); |
595 | 595 | ||
596 | tda9887_cfg.tuner = TUNER_TDA9887; | 596 | tda9887_cfg.tuner = TUNER_TDA9887; |
597 | tda9887_cfg.priv = &config; | 597 | tda9887_cfg.priv = &tda_config; |
598 | 598 | ||
599 | if (params->std == V4L2_STD_SECAM_LC) { | 599 | if (params->std == V4L2_STD_SECAM_LC) { |
600 | if (t_params->port1_active ^ t_params->port1_invert_for_secam_lc) | 600 | if (t_params->port1_active ^ t_params->port1_invert_for_secam_lc) |
601 | config |= TDA9887_PORT1_ACTIVE; | 601 | tda_config |= TDA9887_PORT1_ACTIVE; |
602 | if (t_params->port2_active ^ t_params->port2_invert_for_secam_lc) | 602 | if (t_params->port2_active ^ t_params->port2_invert_for_secam_lc) |
603 | config |= TDA9887_PORT2_ACTIVE; | 603 | tda_config |= TDA9887_PORT2_ACTIVE; |
604 | } else { | 604 | } else { |
605 | if (t_params->port1_active) | 605 | if (t_params->port1_active) |
606 | config |= TDA9887_PORT1_ACTIVE; | 606 | tda_config |= TDA9887_PORT1_ACTIVE; |
607 | if (t_params->port2_active) | 607 | if (t_params->port2_active) |
608 | config |= TDA9887_PORT2_ACTIVE; | 608 | tda_config |= TDA9887_PORT2_ACTIVE; |
609 | } | 609 | } |
610 | if (t_params->intercarrier_mode) | 610 | if (t_params->intercarrier_mode) |
611 | config |= TDA9887_INTERCARRIER; | 611 | tda_config |= TDA9887_INTERCARRIER; |
612 | if (is_secam_l) { | 612 | if (is_secam_l) { |
613 | if (i == 0 && t_params->default_top_secam_low) | 613 | if (i == 0 && t_params->default_top_secam_low) |
614 | config |= TDA9887_TOP(t_params->default_top_secam_low); | 614 | tda_config |= TDA9887_TOP(t_params->default_top_secam_low); |
615 | else if (i == 1 && t_params->default_top_secam_mid) | 615 | else if (i == 1 && t_params->default_top_secam_mid) |
616 | config |= TDA9887_TOP(t_params->default_top_secam_mid); | 616 | tda_config |= TDA9887_TOP(t_params->default_top_secam_mid); |
617 | else if (t_params->default_top_secam_high) | 617 | else if (t_params->default_top_secam_high) |
618 | config |= TDA9887_TOP(t_params->default_top_secam_high); | 618 | tda_config |= TDA9887_TOP(t_params->default_top_secam_high); |
619 | } else { | 619 | } else { |
620 | if (i == 0 && t_params->default_top_low) | 620 | if (i == 0 && t_params->default_top_low) |
621 | config |= TDA9887_TOP(t_params->default_top_low); | 621 | tda_config |= TDA9887_TOP(t_params->default_top_low); |
622 | else if (i == 1 && t_params->default_top_mid) | 622 | else if (i == 1 && t_params->default_top_mid) |
623 | config |= TDA9887_TOP(t_params->default_top_mid); | 623 | tda_config |= TDA9887_TOP(t_params->default_top_mid); |
624 | else if (t_params->default_top_high) | 624 | else if (t_params->default_top_high) |
625 | config |= TDA9887_TOP(t_params->default_top_high); | 625 | tda_config |= TDA9887_TOP(t_params->default_top_high); |
626 | } | 626 | } |
627 | if (t_params->default_pll_gating_18) | 627 | if (t_params->default_pll_gating_18) |
628 | config |= TDA9887_GATING_18; | 628 | tda_config |= TDA9887_GATING_18; |
629 | i2c_clients_command(priv->i2c_props.adap, TUNER_SET_CONFIG, | 629 | i2c_clients_command(priv->i2c_props.adap, TUNER_SET_CONFIG, |
630 | &tda9887_cfg); | 630 | &tda9887_cfg); |
631 | } | 631 | } |
@@ -813,7 +813,8 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, | |||
813 | static struct tuner_params *t_params; | 813 | static struct tuner_params *t_params; |
814 | u8 config, cb; | 814 | u8 config, cb; |
815 | u32 div; | 815 | u32 div; |
816 | int ret, frequency = params->frequency / 62500; | 816 | int ret; |
817 | unsigned frequency = params->frequency / 62500; | ||
817 | 818 | ||
818 | t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL); | 819 | t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL); |
819 | ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb); | 820 | ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb); |
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index 5f99de0ad612..dcddfa803a75 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" | 2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Xceive Corporation | 4 | * Copyright (c) 2007 Xceive Corporation |
5 | * Copyright (c) 2007 Steven Toth <stoth@hauppauge.com> | 5 | * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/common/tuners/xc5000.h b/drivers/media/common/tuners/xc5000.h index c910715addc9..5389f740945a 100644 --- a/drivers/media/common/tuners/xc5000.h +++ b/drivers/media/common/tuners/xc5000.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" | 2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/common/tuners/xc5000_priv.h b/drivers/media/common/tuners/xc5000_priv.h index a72a9887fe7f..b2a0074c99c9 100644 --- a/drivers/media/common/tuners/xc5000_priv.h +++ b/drivers/media/common/tuners/xc5000_priv.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" | 2 | * Driver for Xceive XC5000 "QAM/8VSB single chip tuner" |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index f9d087669d5d..4eed783f4bce 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c | |||
@@ -137,7 +137,8 @@ static int flexcop_send_diseqc_msg(struct dvb_frontend* fe, int len, u8 *msg, un | |||
137 | flexcop_diseqc_send_byte(fe, 0xff); | 137 | flexcop_diseqc_send_byte(fe, 0xff); |
138 | else { | 138 | else { |
139 | flexcop_set_tone(fe, SEC_TONE_ON); | 139 | flexcop_set_tone(fe, SEC_TONE_ON); |
140 | udelay(12500); | 140 | mdelay(12); |
141 | udelay(500); | ||
141 | flexcop_set_tone(fe, SEC_TONE_OFF); | 142 | flexcop_set_tone(fe, SEC_TONE_OFF); |
142 | } | 143 | } |
143 | msleep(20); | 144 | msleep(20); |
diff --git a/drivers/media/dvb/b2c2/flexcop-i2c.c b/drivers/media/dvb/b2c2/flexcop-i2c.c index 55973eaf3711..43a112ec6d44 100644 --- a/drivers/media/dvb/b2c2/flexcop-i2c.c +++ b/drivers/media/dvb/b2c2/flexcop-i2c.c | |||
@@ -221,12 +221,12 @@ int flexcop_i2c_init(struct flexcop_device *fc) | |||
221 | fc->fc_i2c_adap[1].port = FC_I2C_PORT_EEPROM; | 221 | fc->fc_i2c_adap[1].port = FC_I2C_PORT_EEPROM; |
222 | fc->fc_i2c_adap[2].port = FC_I2C_PORT_TUNER; | 222 | fc->fc_i2c_adap[2].port = FC_I2C_PORT_TUNER; |
223 | 223 | ||
224 | strncpy(fc->fc_i2c_adap[0].i2c_adap.name, | 224 | strlcpy(fc->fc_i2c_adap[0].i2c_adap.name, "B2C2 FlexCop I2C to demod", |
225 | "B2C2 FlexCop I2C to demod", I2C_NAME_SIZE); | 225 | sizeof(fc->fc_i2c_adap[0].i2c_adap.name)); |
226 | strncpy(fc->fc_i2c_adap[1].i2c_adap.name, | 226 | strlcpy(fc->fc_i2c_adap[1].i2c_adap.name, "B2C2 FlexCop I2C to eeprom", |
227 | "B2C2 FlexCop I2C to eeprom", I2C_NAME_SIZE); | 227 | sizeof(fc->fc_i2c_adap[1].i2c_adap.name)); |
228 | strncpy(fc->fc_i2c_adap[2].i2c_adap.name, | 228 | strlcpy(fc->fc_i2c_adap[2].i2c_adap.name, "B2C2 FlexCop I2C to tuner", |
229 | "B2C2 FlexCop I2C to tuner", I2C_NAME_SIZE); | 229 | sizeof(fc->fc_i2c_adap[2].i2c_adap.name)); |
230 | 230 | ||
231 | i2c_set_adapdata(&fc->fc_i2c_adap[0].i2c_adap, &fc->fc_i2c_adap[0]); | 231 | i2c_set_adapdata(&fc->fc_i2c_adap[0].i2c_adap, &fc->fc_i2c_adap[0]); |
232 | i2c_set_adapdata(&fc->fc_i2c_adap[1].i2c_adap, &fc->fc_i2c_adap[1]); | 232 | i2c_set_adapdata(&fc->fc_i2c_adap[1].i2c_adap, &fc->fc_i2c_adap[1]); |
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index a7637562e742..aa3db57d32d9 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -1244,7 +1244,7 @@ static int dst_command(struct dst_state *state, u8 *data, u8 len) | |||
1244 | goto error; | 1244 | goto error; |
1245 | } | 1245 | } |
1246 | if (state->type_flags & DST_TYPE_HAS_FW_1) | 1246 | if (state->type_flags & DST_TYPE_HAS_FW_1) |
1247 | udelay(3000); | 1247 | mdelay(3); |
1248 | if (read_dst(state, &reply, GET_ACK)) { | 1248 | if (read_dst(state, &reply, GET_ACK)) { |
1249 | dprintk(verbose, DST_DEBUG, 1, "Trying to recover.. "); | 1249 | dprintk(verbose, DST_DEBUG, 1, "Trying to recover.. "); |
1250 | if ((dst_error_recovery(state)) < 0) { | 1250 | if ((dst_error_recovery(state)) < 0) { |
@@ -1260,7 +1260,7 @@ static int dst_command(struct dst_state *state, u8 *data, u8 len) | |||
1260 | if (len >= 2 && data[0] == 0 && (data[1] == 1 || data[1] == 3)) | 1260 | if (len >= 2 && data[0] == 0 && (data[1] == 1 || data[1] == 3)) |
1261 | goto error; | 1261 | goto error; |
1262 | if (state->type_flags & DST_TYPE_HAS_FW_1) | 1262 | if (state->type_flags & DST_TYPE_HAS_FW_1) |
1263 | udelay(3000); | 1263 | mdelay(3); |
1264 | else | 1264 | else |
1265 | udelay(2000); | 1265 | udelay(2000); |
1266 | if (!dst_wait_dst_ready(state, NO_DELAY)) | 1266 | if (!dst_wait_dst_ready(state, NO_DELAY)) |
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c index 1cf9fcb6f514..069d847ba887 100644 --- a/drivers/media/dvb/dvb-core/dmxdev.c +++ b/drivers/media/dvb/dvb-core/dmxdev.c | |||
@@ -641,7 +641,6 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter) | |||
641 | struct timespec timeout = { 0 }; | 641 | struct timespec timeout = { 0 }; |
642 | struct dmx_pes_filter_params *para = &filter->params.pes; | 642 | struct dmx_pes_filter_params *para = &filter->params.pes; |
643 | dmx_output_t otype; | 643 | dmx_output_t otype; |
644 | int ret; | ||
645 | int ts_type; | 644 | int ts_type; |
646 | enum dmx_ts_pes ts_pes; | 645 | enum dmx_ts_pes ts_pes; |
647 | struct dmx_ts_feed **tsfeed = &filter->feed.ts; | 646 | struct dmx_ts_feed **tsfeed = &filter->feed.ts; |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 8e5dd7b1f034..98ee16773ff2 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -1032,7 +1032,7 @@ static int dvb_ca_en50221_thread(void *data) | |||
1032 | /* we need this extra check for annoying interfaces like the budget-av */ | 1032 | /* we need this extra check for annoying interfaces like the budget-av */ |
1033 | if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && | 1033 | if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && |
1034 | (ca->pub->poll_slot_status)) { | 1034 | (ca->pub->poll_slot_status)) { |
1035 | int status = ca->pub->poll_slot_status(ca->pub, slot, 0); | 1035 | status = ca->pub->poll_slot_status(ca->pub, slot, 0); |
1036 | if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { | 1036 | if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { |
1037 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; | 1037 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; |
1038 | dvb_ca_en50221_thread_update_delay(ca); | 1038 | dvb_ca_en50221_thread_update_delay(ca); |
@@ -1089,7 +1089,7 @@ static int dvb_ca_en50221_thread(void *data) | |||
1089 | /* we need this extra check for annoying interfaces like the budget-av */ | 1089 | /* we need this extra check for annoying interfaces like the budget-av */ |
1090 | if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && | 1090 | if ((!(ca->flags & DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE)) && |
1091 | (ca->pub->poll_slot_status)) { | 1091 | (ca->pub->poll_slot_status)) { |
1092 | int status = ca->pub->poll_slot_status(ca->pub, slot, 0); | 1092 | status = ca->pub->poll_slot_status(ca->pub, slot, 0); |
1093 | if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { | 1093 | if (!(status & DVB_CA_EN50221_POLL_CAM_PRESENT)) { |
1094 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; | 1094 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; |
1095 | dvb_ca_en50221_thread_update_delay(ca); | 1095 | dvb_ca_en50221_thread_update_delay(ca); |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 8cbdb218952f..3526e3ee9487 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -889,13 +889,13 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
889 | * initialization, so parg is 8 bits and does not | 889 | * initialization, so parg is 8 bits and does not |
890 | * include the initialization or start bit | 890 | * include the initialization or start bit |
891 | */ | 891 | */ |
892 | unsigned long cmd = ((unsigned long) parg) << 1; | 892 | unsigned long swcmd = ((unsigned long) parg) << 1; |
893 | struct timeval nexttime; | 893 | struct timeval nexttime; |
894 | struct timeval tv[10]; | 894 | struct timeval tv[10]; |
895 | int i; | 895 | int i; |
896 | u8 last = 1; | 896 | u8 last = 1; |
897 | if (dvb_frontend_debug) | 897 | if (dvb_frontend_debug) |
898 | printk("%s switch command: 0x%04lx\n", __func__, cmd); | 898 | printk("%s switch command: 0x%04lx\n", __func__, swcmd); |
899 | do_gettimeofday(&nexttime); | 899 | do_gettimeofday(&nexttime); |
900 | if (dvb_frontend_debug) | 900 | if (dvb_frontend_debug) |
901 | memcpy(&tv[0], &nexttime, sizeof(struct timeval)); | 901 | memcpy(&tv[0], &nexttime, sizeof(struct timeval)); |
@@ -908,12 +908,12 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
908 | for (i = 0; i < 9; i++) { | 908 | for (i = 0; i < 9; i++) { |
909 | if (dvb_frontend_debug) | 909 | if (dvb_frontend_debug) |
910 | do_gettimeofday(&tv[i + 1]); | 910 | do_gettimeofday(&tv[i + 1]); |
911 | if ((cmd & 0x01) != last) { | 911 | if ((swcmd & 0x01) != last) { |
912 | /* set voltage to (last ? 13V : 18V) */ | 912 | /* set voltage to (last ? 13V : 18V) */ |
913 | fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); | 913 | fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); |
914 | last = (last) ? 0 : 1; | 914 | last = (last) ? 0 : 1; |
915 | } | 915 | } |
916 | cmd = cmd >> 1; | 916 | swcmd = swcmd >> 1; |
917 | if (i != 8) | 917 | if (i != 8) |
918 | dvb_frontend_sleep_until(&nexttime, 8000); | 918 | dvb_frontend_sleep_until(&nexttime, 8000); |
919 | } | 919 | } |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index aaa0b6f0b521..563400277a42 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -210,7 +210,7 @@ static int cxusb_aver_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
210 | if (d->state == DVB_USB_STATE_INIT && | 210 | if (d->state == DVB_USB_STATE_INIT && |
211 | usb_set_interface(d->udev, 0, 0) < 0) | 211 | usb_set_interface(d->udev, 0, 0) < 0) |
212 | err("set interface failed"); | 212 | err("set interface failed"); |
213 | do; while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) && | 213 | do {} while (!(ret = cxusb_ctrl_msg(d, CMD_POWER_ON, NULL, 0, NULL, 0)) && |
214 | !(ret = cxusb_ctrl_msg(d, 0x15, NULL, 0, NULL, 0)) && | 214 | !(ret = cxusb_ctrl_msg(d, 0x15, NULL, 0, NULL, 0)) && |
215 | !(ret = cxusb_ctrl_msg(d, 0x17, NULL, 0, NULL, 0)) && 0); | 215 | !(ret = cxusb_ctrl_msg(d, 0x17, NULL, 0, NULL, 0)) && 0); |
216 | if (!ret) { | 216 | if (!ret) { |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index 3dd20bfbed32..6c0e5c5f4362 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -1117,7 +1117,8 @@ struct usb_device_id dib0700_usb_id_table[] = { | |||
1117 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, | 1117 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) }, |
1118 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) }, | 1118 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) }, |
1119 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) }, | 1119 | { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) }, |
1120 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) }, | 1120 | /* 35 */{ USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) }, |
1121 | { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_T_500_3) }, | ||
1121 | { 0 } /* Terminating entry */ | 1122 | { 0 } /* Terminating entry */ |
1122 | }; | 1123 | }; |
1123 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); | 1124 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
@@ -1373,7 +1374,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1373 | } | 1374 | } |
1374 | }, | 1375 | }, |
1375 | 1376 | ||
1376 | .num_device_descs = 3, | 1377 | .num_device_descs = 4, |
1377 | .devices = { | 1378 | .devices = { |
1378 | { "DiBcom STK7070PD reference design", | 1379 | { "DiBcom STK7070PD reference design", |
1379 | { &dib0700_usb_id_table[17], NULL }, | 1380 | { &dib0700_usb_id_table[17], NULL }, |
@@ -1386,6 +1387,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1386 | { "Hauppauge Nova-TD Stick (52009)", | 1387 | { "Hauppauge Nova-TD Stick (52009)", |
1387 | { &dib0700_usb_id_table[35], NULL }, | 1388 | { &dib0700_usb_id_table[35], NULL }, |
1388 | { NULL }, | 1389 | { NULL }, |
1390 | }, | ||
1391 | { "Hauppauge Nova-TD-500 (84xxx)", | ||
1392 | { &dib0700_usb_id_table[36], NULL }, | ||
1393 | { NULL }, | ||
1389 | } | 1394 | } |
1390 | } | 1395 | } |
1391 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 1396 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 029b437caf9a..03dfb9f2fe30 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 | 129 | #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 |
130 | #define USB_PID_HAUPPAUGE_NOVA_T_500 0x9941 | 130 | #define USB_PID_HAUPPAUGE_NOVA_T_500 0x9941 |
131 | #define USB_PID_HAUPPAUGE_NOVA_T_500_2 0x9950 | 131 | #define USB_PID_HAUPPAUGE_NOVA_T_500_2 0x9950 |
132 | #define USB_PID_HAUPPAUGE_NOVA_T_500_3 0x8400 | ||
132 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x7050 | 133 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK 0x7050 |
133 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_2 0x7060 | 134 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_2 0x7060 |
134 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070 | 135 | #define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070 |
diff --git a/drivers/media/dvb/frontends/au8522.c b/drivers/media/dvb/frontends/au8522.c index f7b71657f0f6..0b82cc2a1e16 100644 --- a/drivers/media/dvb/frontends/au8522.c +++ b/drivers/media/dvb/frontends/au8522.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Auvitek AU8522 QAM/8VSB demodulator driver | 2 | Auvitek AU8522 QAM/8VSB demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
@@ -304,6 +304,43 @@ static int au8522_mse2snr_lookup(struct mse2snr_tab *tab, int sz, int mse, | |||
304 | return ret; | 304 | return ret; |
305 | } | 305 | } |
306 | 306 | ||
307 | static int au8522_set_if(struct dvb_frontend *fe, enum au8522_if_freq if_freq) | ||
308 | { | ||
309 | struct au8522_state *state = fe->demodulator_priv; | ||
310 | u8 r0b5, r0b6, r0b7; | ||
311 | char *ifmhz; | ||
312 | |||
313 | switch (if_freq) { | ||
314 | case AU8522_IF_3_25MHZ: | ||
315 | ifmhz = "3.25"; | ||
316 | r0b5 = 0x00; | ||
317 | r0b6 = 0x3d; | ||
318 | r0b7 = 0xa0; | ||
319 | break; | ||
320 | case AU8522_IF_4MHZ: | ||
321 | ifmhz = "4.00"; | ||
322 | r0b5 = 0x00; | ||
323 | r0b6 = 0x4b; | ||
324 | r0b7 = 0xd9; | ||
325 | break; | ||
326 | case AU8522_IF_6MHZ: | ||
327 | ifmhz = "6.00"; | ||
328 | r0b5 = 0xfb; | ||
329 | r0b6 = 0x8e; | ||
330 | r0b7 = 0x39; | ||
331 | break; | ||
332 | default: | ||
333 | dprintk("%s() IF Frequency not supported\n", __func__); | ||
334 | return -EINVAL; | ||
335 | } | ||
336 | dprintk("%s() %s MHz\n", __func__, ifmhz); | ||
337 | au8522_writereg(state, 0x80b5, r0b5); | ||
338 | au8522_writereg(state, 0x80b6, r0b6); | ||
339 | au8522_writereg(state, 0x80b7, r0b7); | ||
340 | |||
341 | return 0; | ||
342 | } | ||
343 | |||
307 | /* VSB Modulation table */ | 344 | /* VSB Modulation table */ |
308 | static struct { | 345 | static struct { |
309 | u16 reg; | 346 | u16 reg; |
@@ -334,9 +371,6 @@ static struct { | |||
334 | { 0x80af, 0x66 }, | 371 | { 0x80af, 0x66 }, |
335 | { 0x821b, 0xcc }, | 372 | { 0x821b, 0xcc }, |
336 | { 0x821d, 0x80 }, | 373 | { 0x821d, 0x80 }, |
337 | { 0x80b5, 0xfb }, | ||
338 | { 0x80b6, 0x8e }, | ||
339 | { 0x80b7, 0x39 }, | ||
340 | { 0x80a4, 0xe8 }, | 374 | { 0x80a4, 0xe8 }, |
341 | { 0x8231, 0x13 }, | 375 | { 0x8231, 0x13 }, |
342 | }; | 376 | }; |
@@ -350,9 +384,6 @@ static struct { | |||
350 | { 0x80a4, 0x00 }, | 384 | { 0x80a4, 0x00 }, |
351 | { 0x8081, 0xc4 }, | 385 | { 0x8081, 0xc4 }, |
352 | { 0x80a5, 0x40 }, | 386 | { 0x80a5, 0x40 }, |
353 | { 0x80b5, 0xfb }, | ||
354 | { 0x80b6, 0x8e }, | ||
355 | { 0x80b7, 0x39 }, | ||
356 | { 0x80aa, 0x77 }, | 387 | { 0x80aa, 0x77 }, |
357 | { 0x80ad, 0x77 }, | 388 | { 0x80ad, 0x77 }, |
358 | { 0x80a6, 0x67 }, | 389 | { 0x80a6, 0x67 }, |
@@ -438,6 +469,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, | |||
438 | au8522_writereg(state, | 469 | au8522_writereg(state, |
439 | VSB_mod_tab[i].reg, | 470 | VSB_mod_tab[i].reg, |
440 | VSB_mod_tab[i].data); | 471 | VSB_mod_tab[i].data); |
472 | au8522_set_if(fe, state->config->vsb_if); | ||
441 | break; | 473 | break; |
442 | case QAM_64: | 474 | case QAM_64: |
443 | case QAM_256: | 475 | case QAM_256: |
@@ -446,6 +478,7 @@ static int au8522_enable_modulation(struct dvb_frontend *fe, | |||
446 | au8522_writereg(state, | 478 | au8522_writereg(state, |
447 | QAM_mod_tab[i].reg, | 479 | QAM_mod_tab[i].reg, |
448 | QAM_mod_tab[i].data); | 480 | QAM_mod_tab[i].data); |
481 | au8522_set_if(fe, state->config->qam_if); | ||
449 | break; | 482 | break; |
450 | default: | 483 | default: |
451 | dprintk("%s() Invalid modulation\n", __func__); | 484 | dprintk("%s() Invalid modulation\n", __func__); |
diff --git a/drivers/media/dvb/frontends/au8522.h b/drivers/media/dvb/frontends/au8522.h index d7affa3cdb27..595915ade8c3 100644 --- a/drivers/media/dvb/frontends/au8522.h +++ b/drivers/media/dvb/frontends/au8522.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Auvitek AU8522 QAM/8VSB demodulator driver | 2 | Auvitek AU8522 QAM/8VSB demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <linux/dvb/frontend.h> | 25 | #include <linux/dvb/frontend.h> |
26 | 26 | ||
27 | enum au8522_if_freq { | ||
28 | AU8522_IF_6MHZ = 0, | ||
29 | AU8522_IF_4MHZ, | ||
30 | AU8522_IF_3_25MHZ, | ||
31 | }; | ||
32 | |||
27 | struct au8522_config { | 33 | struct au8522_config { |
28 | /* the demodulator's i2c address */ | 34 | /* the demodulator's i2c address */ |
29 | u8 demod_address; | 35 | u8 demod_address; |
@@ -32,6 +38,9 @@ struct au8522_config { | |||
32 | #define AU8522_TUNERLOCKING 0 | 38 | #define AU8522_TUNERLOCKING 0 |
33 | #define AU8522_DEMODLOCKING 1 | 39 | #define AU8522_DEMODLOCKING 1 |
34 | u8 status_mode; | 40 | u8 status_mode; |
41 | |||
42 | enum au8522_if_freq vsb_if; | ||
43 | enum au8522_if_freq qam_if; | ||
35 | }; | 44 | }; |
36 | 45 | ||
37 | #if defined(CONFIG_DVB_AU8522) || \ | 46 | #if defined(CONFIG_DVB_AU8522) || \ |
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c index cc1db4e371c3..9430e03dba6c 100644 --- a/drivers/media/dvb/frontends/cx22702.c +++ b/drivers/media/dvb/frontends/cx22702.c | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> | 10 | Copyright (C) 2004 Steven Toth <stoth@linuxtv.org> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/cx22702.h b/drivers/media/dvb/frontends/cx22702.h index 8af766a31552..b1e465c6c2ce 100644 --- a/drivers/media/dvb/frontends/cx22702.h +++ b/drivers/media/dvb/frontends/cx22702.h | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> | 10 | Copyright (C) 2004 Steven Toth <stoth@linuxtv.org> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index 7f68d78c6558..7156157cb34b 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Conexant cx24123/cx24109 - DVB QPSK Satellite demod/tuner driver | 2 | * Conexant cx24123/cx24109 - DVB QPSK Satellite demod/tuner driver |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (C) 2005 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * Support for KWorld DVB-S 100 by Vadim Catana <skystar@moldova.cc> | 6 | * Support for KWorld DVB-S 100 by Vadim Catana <skystar@moldova.cc> |
7 | * | 7 | * |
@@ -1072,8 +1072,8 @@ struct dvb_frontend* cx24123_attach(const struct cx24123_config* config, | |||
1072 | if (config->dont_use_pll) | 1072 | if (config->dont_use_pll) |
1073 | cx24123_repeater_mode(state, 1, 0); | 1073 | cx24123_repeater_mode(state, 1, 0); |
1074 | 1074 | ||
1075 | strncpy(state->tuner_i2c_adapter.name, | 1075 | strlcpy(state->tuner_i2c_adapter.name, "CX24123 tuner I2C bus", |
1076 | "CX24123 tuner I2C bus", I2C_NAME_SIZE); | 1076 | sizeof(state->tuner_i2c_adapter.name)); |
1077 | state->tuner_i2c_adapter.class = I2C_CLASS_TV_DIGITAL, | 1077 | state->tuner_i2c_adapter.class = I2C_CLASS_TV_DIGITAL, |
1078 | state->tuner_i2c_adapter.algo = &cx24123_tuner_i2c_algo; | 1078 | state->tuner_i2c_adapter.algo = &cx24123_tuner_i2c_algo; |
1079 | state->tuner_i2c_adapter.algo_data = NULL; | 1079 | state->tuner_i2c_adapter.algo_data = NULL; |
diff --git a/drivers/media/dvb/frontends/cx24123.h b/drivers/media/dvb/frontends/cx24123.h index 81ebc3d2f19f..cc6b411d6d20 100644 --- a/drivers/media/dvb/frontends/cx24123.h +++ b/drivers/media/dvb/frontends/cx24123.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Conexant cx24123/cx24109 - DVB QPSK Satellite demod/tuner driver | 2 | Conexant cx24123/cx24109 - DVB QPSK Satellite demod/tuner driver |
3 | 3 | ||
4 | Copyright (C) 2005 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2005 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
diff --git a/drivers/media/dvb/frontends/s5h1409.c b/drivers/media/dvb/frontends/s5h1409.c index 5ddb2dca305c..7500a1c53e68 100644 --- a/drivers/media/dvb/frontends/s5h1409.c +++ b/drivers/media/dvb/frontends/s5h1409.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Samsung S5H1409 VSB/QAM demodulator driver | 2 | Samsung S5H1409 VSB/QAM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2006 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2006 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
@@ -404,6 +404,7 @@ static int s5h1409_enable_modulation(struct dvb_frontend* fe, | |||
404 | break; | 404 | break; |
405 | case QAM_64: | 405 | case QAM_64: |
406 | case QAM_256: | 406 | case QAM_256: |
407 | case QAM_AUTO: | ||
407 | dprintk("%s() QAM_AUTO (64/256)\n", __func__); | 408 | dprintk("%s() QAM_AUTO (64/256)\n", __func__); |
408 | if (state->if_freq != S5H1409_QAM_IF_FREQ) | 409 | if (state->if_freq != S5H1409_QAM_IF_FREQ) |
409 | s5h1409_set_if_freq(fe, S5H1409_QAM_IF_FREQ); | 410 | s5h1409_set_if_freq(fe, S5H1409_QAM_IF_FREQ); |
diff --git a/drivers/media/dvb/frontends/s5h1409.h b/drivers/media/dvb/frontends/s5h1409.h index 59f4335964c6..d1a1d2eb8e11 100644 --- a/drivers/media/dvb/frontends/s5h1409.h +++ b/drivers/media/dvb/frontends/s5h1409.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Samsung S5H1409 VSB/QAM demodulator driver | 2 | Samsung S5H1409 VSB/QAM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2006 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2006 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c index cff360ce1ba3..2da1a3763de9 100644 --- a/drivers/media/dvb/frontends/s5h1411.c +++ b/drivers/media/dvb/frontends/s5h1411.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Samsung S5H1411 VSB/QAM demodulator driver | 2 | Samsung S5H1411 VSB/QAM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
@@ -488,6 +488,7 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe, | |||
488 | break; | 488 | break; |
489 | case QAM_64: | 489 | case QAM_64: |
490 | case QAM_256: | 490 | case QAM_256: |
491 | case QAM_AUTO: | ||
491 | dprintk("%s() QAM_AUTO (64/256)\n", __func__); | 492 | dprintk("%s() QAM_AUTO (64/256)\n", __func__); |
492 | s5h1411_set_if_freq(fe, state->config->qam_if); | 493 | s5h1411_set_if_freq(fe, state->config->qam_if); |
493 | s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x00, 0x0171); | 494 | s5h1411_writereg(state, S5H1411_I2C_TOP_ADDR, 0x00, 0x0171); |
diff --git a/drivers/media/dvb/frontends/s5h1411.h b/drivers/media/dvb/frontends/s5h1411.h index 1855f64ed4d8..7d542bc00c48 100644 --- a/drivers/media/dvb/frontends/s5h1411.h +++ b/drivers/media/dvb/frontends/s5h1411.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | Samsung S5H1411 VSB/QAM demodulator driver | 2 | Samsung S5H1411 VSB/QAM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
diff --git a/drivers/media/dvb/frontends/s5h1420.c b/drivers/media/dvb/frontends/s5h1420.c index 720ed9ff7c5f..747d3fa2e5e5 100644 --- a/drivers/media/dvb/frontends/s5h1420.c +++ b/drivers/media/dvb/frontends/s5h1420.c | |||
@@ -915,7 +915,8 @@ struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config, | |||
915 | state->frontend.demodulator_priv = state; | 915 | state->frontend.demodulator_priv = state; |
916 | 916 | ||
917 | /* create tuner i2c adapter */ | 917 | /* create tuner i2c adapter */ |
918 | strncpy(state->tuner_i2c_adapter.name, "S5H1420-PN1010 tuner I2C bus", I2C_NAME_SIZE); | 918 | strlcpy(state->tuner_i2c_adapter.name, "S5H1420-PN1010 tuner I2C bus", |
919 | sizeof(state->tuner_i2c_adapter.name)); | ||
919 | state->tuner_i2c_adapter.class = I2C_CLASS_TV_DIGITAL, | 920 | state->tuner_i2c_adapter.class = I2C_CLASS_TV_DIGITAL, |
920 | state->tuner_i2c_adapter.algo = &s5h1420_tuner_i2c_algo; | 921 | state->tuner_i2c_adapter.algo = &s5h1420_tuner_i2c_algo; |
921 | state->tuner_i2c_adapter.algo_data = NULL; | 922 | state->tuner_i2c_adapter.algo_data = NULL; |
diff --git a/drivers/media/dvb/frontends/tda10048.c b/drivers/media/dvb/frontends/tda10048.c index 0ab8d86b3ae3..04e7f1cc1403 100644 --- a/drivers/media/dvb/frontends/tda10048.c +++ b/drivers/media/dvb/frontends/tda10048.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | NXP TDA10048HN DVB OFDM demodulator driver | 2 | NXP TDA10048HN DVB OFDM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
@@ -303,7 +303,7 @@ static int tda10048_firmware_upload(struct dvb_frontend *fe) | |||
303 | 303 | ||
304 | if (fw->size != TDA10048_DEFAULT_FIRMWARE_SIZE) { | 304 | if (fw->size != TDA10048_DEFAULT_FIRMWARE_SIZE) { |
305 | printk(KERN_ERR "%s: firmware incorrect size\n", __func__); | 305 | printk(KERN_ERR "%s: firmware incorrect size\n", __func__); |
306 | return -EIO; | 306 | ret = -EIO; |
307 | } else { | 307 | } else { |
308 | printk(KERN_INFO "%s: firmware uploading\n", __func__); | 308 | printk(KERN_INFO "%s: firmware uploading\n", __func__); |
309 | 309 | ||
diff --git a/drivers/media/dvb/frontends/tda10048.h b/drivers/media/dvb/frontends/tda10048.h index 2b5c78e62c86..0457b24601fa 100644 --- a/drivers/media/dvb/frontends/tda10048.h +++ b/drivers/media/dvb/frontends/tda10048.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | NXP TDA10048HN DVB OFDM demodulator driver | 2 | NXP TDA10048HN DVB OFDM demodulator driver |
3 | 3 | ||
4 | Copyright (C) 2008 Steven Toth <stoth@hauppauge.com> | 4 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
5 | 5 | ||
6 | 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 |
7 | 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 |
diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index e7a8ac0c4049..cc5efb643f33 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> | 4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * it under the terms of the GNU General Public License version 3 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation; | 8 | * published by the Free Software Foundation; |
9 | * | 9 | * |
10 | * Software distributed under the License is distributed on an "AS IS" | 10 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/siano/sms-cards.h b/drivers/media/dvb/siano/sms-cards.h index 83b39bc203fe..c8f3da6f9bc1 100644 --- a/drivers/media/dvb/siano/sms-cards.h +++ b/drivers/media/dvb/siano/sms-cards.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> | 4 | * Copyright (c) 2008 Michael Krufky <mkrufky@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * it under the terms of the GNU General Public License version 3 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation; | 8 | * published by the Free Software Foundation; |
9 | * | 9 | * |
10 | * Software distributed under the License is distributed on an "AS IS" | 10 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index c5f45fed69dc..6576fbb40fc6 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. | 8 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License version 3 as | 11 | * it under the terms of the GNU General Public License version 2 as |
12 | * published by the Free Software Foundation; | 12 | * published by the Free Software Foundation; |
13 | * | 13 | * |
14 | * Software distributed under the License is distributed on an "AS IS" | 14 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/siano/smscoreapi.h b/drivers/media/dvb/siano/smscoreapi.h index c1f8f1dccb11..8d973f726fb8 100644 --- a/drivers/media/dvb/siano/smscoreapi.h +++ b/drivers/media/dvb/siano/smscoreapi.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. | 6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 3 as | 9 | * it under the terms of the GNU General Public License version 2 as |
10 | * published by the Free Software Foundation; | 10 | * published by the Free Software Foundation; |
11 | * | 11 | * |
12 | * Software distributed under the License is distributed on an "AS IS" | 12 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c index 229274a14110..8d490e133f35 100644 --- a/drivers/media/dvb/siano/smsdvb.c +++ b/drivers/media/dvb/siano/smsdvb.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. | 6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 3 as | 9 | * it under the terms of the GNU General Public License version 2 as |
10 | * published by the Free Software Foundation; | 10 | * published by the Free Software Foundation; |
11 | * | 11 | * |
12 | * Software distributed under the License is distributed on an "AS IS" | 12 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index c10b1849c6a3..87a3c24454b9 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. | 6 | * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 3 as | 9 | * it under the terms of the GNU General Public License version 2 as |
10 | * published by the Free Software Foundation; | 10 | * published by the Free Software Foundation; |
11 | * | 11 | * |
12 | * Software distributed under the License is distributed on an "AS IS" | 12 | * Software distributed under the License is distributed on an "AS IS" |
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c index 39bd0a20f53a..aa5ed4ef19f2 100644 --- a/drivers/media/dvb/ttpci/budget-patch.c +++ b/drivers/media/dvb/ttpci/budget-patch.c | |||
@@ -116,7 +116,8 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long | |||
116 | DiseqcSendByte(budget, 0xff); | 116 | DiseqcSendByte(budget, 0xff); |
117 | else { | 117 | else { |
118 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); | 118 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); |
119 | udelay(12500); | 119 | mdelay(12); |
120 | udelay(500); | ||
120 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); | 121 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); |
121 | } | 122 | } |
122 | msleep(20); | 123 | msleep(20); |
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 2293d80c6e51..f0068996ac07 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c | |||
@@ -108,7 +108,8 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long | |||
108 | DiseqcSendByte(budget, 0xff); | 108 | DiseqcSendByte(budget, 0xff); |
109 | else { | 109 | else { |
110 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); | 110 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); |
111 | udelay(12500); | 111 | mdelay(12); |
112 | udelay(500); | ||
112 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); | 113 | saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); |
113 | } | 114 | } |
114 | msleep(20); | 115 | msleep(20); |
diff --git a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile index a30159f6fa42..7ca71ab96b43 100644 --- a/drivers/media/radio/Makefile +++ b/drivers/media/radio/Makefile | |||
@@ -2,8 +2,6 @@ | |||
2 | # Makefile for the kernel character device drivers. | 2 | # Makefile for the kernel character device drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | miropcm20-objs := miropcm20-rds-core.o miropcm20-radio.o | ||
6 | |||
7 | obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o | 5 | obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o |
8 | obj-$(CONFIG_RADIO_RTRACK2) += radio-rtrack2.o | 6 | obj-$(CONFIG_RADIO_RTRACK2) += radio-rtrack2.o |
9 | obj-$(CONFIG_RADIO_SF16FMI) += radio-sf16fmi.o | 7 | obj-$(CONFIG_RADIO_SF16FMI) += radio-sf16fmi.o |
@@ -14,8 +12,6 @@ obj-$(CONFIG_RADIO_TERRATEC) += radio-terratec.o | |||
14 | obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o | 12 | obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o |
15 | obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o | 13 | obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o |
16 | obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o | 14 | obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o |
17 | obj-$(CONFIG_RADIO_MIROPCM20) += miropcm20.o | ||
18 | obj-$(CONFIG_RADIO_MIROPCM20_RDS) += miropcm20-rds.o | ||
19 | obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o | 15 | obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o |
20 | obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o | 16 | obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o |
21 | obj-$(CONFIG_RADIO_TRUST) += radio-trust.o | 17 | obj-$(CONFIG_RADIO_TRUST) += radio-trust.o |
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 1ed88f3abe61..70c65a745923 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c | |||
@@ -493,7 +493,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, | |||
493 | radio->usbdev = interface_to_usbdev(intf); | 493 | radio->usbdev = interface_to_usbdev(intf); |
494 | radio->curfreq = FREQ_MIN*FREQ_MUL; | 494 | radio->curfreq = FREQ_MIN*FREQ_MUL; |
495 | video_set_drvdata(radio->videodev, radio); | 495 | video_set_drvdata(radio->videodev, radio); |
496 | if (video_register_device(radio->videodev, VFL_TYPE_RADIO,radio_nr)) { | 496 | if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) { |
497 | warn("Could not register video device"); | 497 | warn("Could not register video device"); |
498 | video_device_release(radio->videodev); | 498 | video_device_release(radio->videodev); |
499 | kfree(radio->transfer_buffer); | 499 | kfree(radio->transfer_buffer); |
diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c deleted file mode 100644 index 7fd7ee2d32c1..000000000000 --- a/drivers/media/radio/miropcm20-radio.c +++ /dev/null | |||
@@ -1,266 +0,0 @@ | |||
1 | /* Miro PCM20 radio driver for Linux radio support | ||
2 | * (c) 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> | ||
3 | * Thanks to Norberto Pellici for the ACI device interface specification | ||
4 | * The API part is based on the radiotrack driver by M. Kirkwood | ||
5 | * This driver relies on the aci mixer (drivers/sound/aci.c) | ||
6 | * Look there for further info... | ||
7 | */ | ||
8 | |||
9 | /* Revision history: | ||
10 | * | ||
11 | * 1998 Ruurd Reitsma <R.A.Reitsma@wbmt.tudelft.nl> | ||
12 | * 2000-09-05 Robert Siemer <Robert.Siemer@gmx.de> | ||
13 | * removed unfinished volume control (maybe adding it later again) | ||
14 | * use OSS-mixer; added stereo control | ||
15 | */ | ||
16 | |||
17 | /* What ever you think about the ACI, version 0x07 is not very well! | ||
18 | * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono | ||
19 | * conditions... Robert | ||
20 | */ | ||
21 | |||
22 | #include <linux/module.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/videodev.h> | ||
25 | #include <media/v4l2-common.h> | ||
26 | #include <media/v4l2-ioctl.h> | ||
27 | #include "oss/aci.h" | ||
28 | #include "miropcm20-rds-core.h" | ||
29 | |||
30 | static int radio_nr = -1; | ||
31 | module_param(radio_nr, int, 0); | ||
32 | |||
33 | struct pcm20_device { | ||
34 | unsigned long freq; | ||
35 | int muted; | ||
36 | int stereo; | ||
37 | }; | ||
38 | |||
39 | |||
40 | static int pcm20_mute(struct pcm20_device *dev, unsigned char mute) | ||
41 | { | ||
42 | dev->muted = mute; | ||
43 | return aci_write_cmd(ACI_SET_TUNERMUTE, mute); | ||
44 | } | ||
45 | |||
46 | static int pcm20_stereo(struct pcm20_device *dev, unsigned char stereo) | ||
47 | { | ||
48 | dev->stereo = stereo; | ||
49 | return aci_write_cmd(ACI_SET_TUNERMONO, !stereo); | ||
50 | } | ||
51 | |||
52 | static int pcm20_setfreq(struct pcm20_device *dev, unsigned long freq) | ||
53 | { | ||
54 | unsigned char freql; | ||
55 | unsigned char freqh; | ||
56 | |||
57 | dev->freq=freq; | ||
58 | |||
59 | freq /= 160; | ||
60 | if (!(aci_version==0x07 || aci_version>=0xb0)) | ||
61 | freq /= 10; /* I don't know exactly which version | ||
62 | * needs this hack */ | ||
63 | freql = freq & 0xff; | ||
64 | freqh = freq >> 8; | ||
65 | |||
66 | aci_rds_cmd(RDS_RESET, NULL, 0); | ||
67 | pcm20_stereo(dev, 1); | ||
68 | |||
69 | return aci_rw_cmd(ACI_WRITE_TUNE, freql, freqh); | ||
70 | } | ||
71 | |||
72 | static int pcm20_getflags(struct pcm20_device *dev, __u32 *flags, __u16 *signal) | ||
73 | { | ||
74 | /* okay, check for signal, stereo and rds here... */ | ||
75 | int i; | ||
76 | unsigned char buf; | ||
77 | |||
78 | if ((i=aci_rw_cmd(ACI_READ_TUNERSTATION, -1, -1))<0) | ||
79 | return i; | ||
80 | pr_debug("check_sig: 0x%x\n", i); | ||
81 | if (i & 0x80) { | ||
82 | /* no signal from tuner */ | ||
83 | *flags=0; | ||
84 | *signal=0; | ||
85 | return 0; | ||
86 | } else | ||
87 | *signal=0xffff; | ||
88 | |||
89 | if ((i=aci_rw_cmd(ACI_READ_TUNERSTEREO, -1, -1))<0) | ||
90 | return i; | ||
91 | if (i & 0x40) { | ||
92 | *flags=0; | ||
93 | } else { | ||
94 | /* stereo */ | ||
95 | *flags=VIDEO_TUNER_STEREO_ON; | ||
96 | /* I can't see stereo, when forced to mono */ | ||
97 | dev->stereo=1; | ||
98 | } | ||
99 | |||
100 | if ((i=aci_rds_cmd(RDS_STATUS, &buf, 1))<0) | ||
101 | return i; | ||
102 | if (buf & 1) | ||
103 | /* RDS available */ | ||
104 | *flags|=VIDEO_TUNER_RDS_ON; | ||
105 | else | ||
106 | return 0; | ||
107 | |||
108 | if ((i=aci_rds_cmd(RDS_RXVALUE, &buf, 1))<0) | ||
109 | return i; | ||
110 | pr_debug("rds-signal: %d\n", buf); | ||
111 | if (buf > 15) { | ||
112 | printk("miropcm20-radio: RX strengths unexpected high...\n"); | ||
113 | buf=15; | ||
114 | } | ||
115 | /* refine signal */ | ||
116 | if ((*signal=SCALE(15, 0xffff, buf))==0) | ||
117 | *signal = 1; | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | static int pcm20_do_ioctl(struct inode *inode, struct file *file, | ||
123 | unsigned int cmd, void *arg) | ||
124 | { | ||
125 | struct video_device *dev = video_devdata(file); | ||
126 | struct pcm20_device *pcm20 = dev->priv; | ||
127 | int i; | ||
128 | |||
129 | switch(cmd) | ||
130 | { | ||
131 | case VIDIOCGCAP: | ||
132 | { | ||
133 | struct video_capability *v = arg; | ||
134 | memset(v,0,sizeof(*v)); | ||
135 | v->type=VID_TYPE_TUNER; | ||
136 | strcpy(v->name, "Miro PCM20"); | ||
137 | v->channels=1; | ||
138 | v->audios=1; | ||
139 | return 0; | ||
140 | } | ||
141 | case VIDIOCGTUNER: | ||
142 | { | ||
143 | struct video_tuner *v = arg; | ||
144 | if(v->tuner) /* Only 1 tuner */ | ||
145 | return -EINVAL; | ||
146 | v->rangelow=87*16000; | ||
147 | v->rangehigh=108*16000; | ||
148 | pcm20_getflags(pcm20, &v->flags, &v->signal); | ||
149 | v->flags|=VIDEO_TUNER_LOW; | ||
150 | v->mode=VIDEO_MODE_AUTO; | ||
151 | strcpy(v->name, "FM"); | ||
152 | return 0; | ||
153 | } | ||
154 | case VIDIOCSTUNER: | ||
155 | { | ||
156 | struct video_tuner *v = arg; | ||
157 | if(v->tuner!=0) | ||
158 | return -EINVAL; | ||
159 | /* Only 1 tuner so no setting needed ! */ | ||
160 | return 0; | ||
161 | } | ||
162 | case VIDIOCGFREQ: | ||
163 | { | ||
164 | unsigned long *freq = arg; | ||
165 | *freq = pcm20->freq; | ||
166 | return 0; | ||
167 | } | ||
168 | case VIDIOCSFREQ: | ||
169 | { | ||
170 | unsigned long *freq = arg; | ||
171 | pcm20->freq = *freq; | ||
172 | i=pcm20_setfreq(pcm20, pcm20->freq); | ||
173 | pr_debug("First view (setfreq): 0x%x\n", i); | ||
174 | return i; | ||
175 | } | ||
176 | case VIDIOCGAUDIO: | ||
177 | { | ||
178 | struct video_audio *v = arg; | ||
179 | memset(v,0, sizeof(*v)); | ||
180 | v->flags=VIDEO_AUDIO_MUTABLE; | ||
181 | if (pcm20->muted) | ||
182 | v->flags|=VIDEO_AUDIO_MUTE; | ||
183 | v->mode=VIDEO_SOUND_STEREO; | ||
184 | if (pcm20->stereo) | ||
185 | v->mode|=VIDEO_SOUND_MONO; | ||
186 | /* v->step=2048; */ | ||
187 | strcpy(v->name, "Radio"); | ||
188 | return 0; | ||
189 | } | ||
190 | case VIDIOCSAUDIO: | ||
191 | { | ||
192 | struct video_audio *v = arg; | ||
193 | if(v->audio) | ||
194 | return -EINVAL; | ||
195 | |||
196 | pcm20_mute(pcm20, !!(v->flags&VIDEO_AUDIO_MUTE)); | ||
197 | if(v->flags&VIDEO_SOUND_MONO) | ||
198 | pcm20_stereo(pcm20, 0); | ||
199 | if(v->flags&VIDEO_SOUND_STEREO) | ||
200 | pcm20_stereo(pcm20, 1); | ||
201 | |||
202 | return 0; | ||
203 | } | ||
204 | default: | ||
205 | return -ENOIOCTLCMD; | ||
206 | } | ||
207 | } | ||
208 | |||
209 | static int pcm20_ioctl(struct inode *inode, struct file *file, | ||
210 | unsigned int cmd, unsigned long arg) | ||
211 | { | ||
212 | return video_usercopy(inode, file, cmd, arg, pcm20_do_ioctl); | ||
213 | } | ||
214 | |||
215 | static struct pcm20_device pcm20_unit = { | ||
216 | .freq = 87*16000, | ||
217 | .muted = 1, | ||
218 | }; | ||
219 | |||
220 | static const struct file_operations pcm20_fops = { | ||
221 | .owner = THIS_MODULE, | ||
222 | .open = video_exclusive_open, | ||
223 | .release = video_exclusive_release, | ||
224 | .ioctl = pcm20_ioctl, | ||
225 | #ifdef CONFIG_COMPAT | ||
226 | .compat_ioctl = v4l_compat_ioctl32, | ||
227 | #endif | ||
228 | .llseek = no_llseek, | ||
229 | }; | ||
230 | |||
231 | static struct video_device pcm20_radio = { | ||
232 | .name = "Miro PCM 20 radio", | ||
233 | .fops = &pcm20_fops, | ||
234 | .priv = &pcm20_unit | ||
235 | }; | ||
236 | |||
237 | static int __init pcm20_init(void) | ||
238 | { | ||
239 | if(video_register_device(&pcm20_radio, VFL_TYPE_RADIO, radio_nr)==-1) | ||
240 | goto video_register_device; | ||
241 | |||
242 | if(attach_aci_rds()<0) | ||
243 | goto attach_aci_rds; | ||
244 | |||
245 | printk(KERN_INFO "Miro PCM20 radio card driver.\n"); | ||
246 | |||
247 | return 0; | ||
248 | |||
249 | attach_aci_rds: | ||
250 | video_unregister_device(&pcm20_radio); | ||
251 | video_register_device: | ||
252 | return -EINVAL; | ||
253 | } | ||
254 | |||
255 | MODULE_AUTHOR("Ruurd Reitsma"); | ||
256 | MODULE_DESCRIPTION("A driver for the Miro PCM20 radio card."); | ||
257 | MODULE_LICENSE("GPL"); | ||
258 | |||
259 | static void __exit pcm20_cleanup(void) | ||
260 | { | ||
261 | unload_aci_rds(); | ||
262 | video_unregister_device(&pcm20_radio); | ||
263 | } | ||
264 | |||
265 | module_init(pcm20_init); | ||
266 | module_exit(pcm20_cleanup); | ||
diff --git a/drivers/media/radio/miropcm20-rds-core.c b/drivers/media/radio/miropcm20-rds-core.c deleted file mode 100644 index 9428d8b2642c..000000000000 --- a/drivers/media/radio/miropcm20-rds-core.c +++ /dev/null | |||
@@ -1,211 +0,0 @@ | |||
1 | /* | ||
2 | * Many thanks to Fred Seidel <seidel@metabox.de>, the | ||
3 | * designer of the RDS decoder hardware. With his help | ||
4 | * I was able to code this driver. | ||
5 | * Thanks also to Norberto Pellicci, Dominic Mounteney | ||
6 | * <DMounteney@pinnaclesys.com> and www.teleauskunft.de | ||
7 | * for good hints on finding Fred. It was somewhat hard | ||
8 | * to locate him here in Germany... [: | ||
9 | * | ||
10 | * Revision history: | ||
11 | * | ||
12 | * 2000-08-09 Robert Siemer <Robert.Siemer@gmx.de> | ||
13 | * RDS support for MiroSound PCM20 radio | ||
14 | */ | ||
15 | |||
16 | #include <linux/module.h> | ||
17 | #include <linux/errno.h> | ||
18 | #include <linux/string.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/slab.h> | ||
21 | #include <linux/mutex.h> | ||
22 | |||
23 | #include <asm/io.h> | ||
24 | #include "oss/aci.h" | ||
25 | #include "miropcm20-rds-core.h" | ||
26 | |||
27 | #define DEBUG 0 | ||
28 | |||
29 | static struct mutex aci_rds_mutex; | ||
30 | |||
31 | #define RDS_DATASHIFT 2 /* Bit 2 */ | ||
32 | #define RDS_DATAMASK (1 << RDS_DATASHIFT) | ||
33 | #define RDS_BUSYMASK 0x10 /* Bit 4 */ | ||
34 | #define RDS_CLOCKMASK 0x08 /* Bit 3 */ | ||
35 | |||
36 | #define RDS_DATA(x) (((x) >> RDS_DATASHIFT) & 1) | ||
37 | |||
38 | |||
39 | #if DEBUG | ||
40 | static void print_matrix(char array[], unsigned int length) | ||
41 | { | ||
42 | int i, j; | ||
43 | |||
44 | for (i=0; i<length; i++) { | ||
45 | printk(KERN_DEBUG "aci-rds: "); | ||
46 | for (j=7; j>=0; j--) { | ||
47 | printk("%d", (array[i] >> j) & 0x1); | ||
48 | } | ||
49 | if (i%8 == 0) | ||
50 | printk(" byte-border\n"); | ||
51 | else | ||
52 | printk("\n"); | ||
53 | } | ||
54 | } | ||
55 | #endif /* DEBUG */ | ||
56 | |||
57 | static int byte2trans(unsigned char byte, unsigned char sendbuffer[], int size) | ||
58 | { | ||
59 | int i; | ||
60 | |||
61 | if (size != 8) | ||
62 | return -1; | ||
63 | for (i = 7; i >= 0; i--) | ||
64 | sendbuffer[7-i] = (byte & (1 << i)) ? RDS_DATAMASK : 0; | ||
65 | sendbuffer[0] |= RDS_CLOCKMASK; | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static int rds_waitread(void) | ||
71 | { | ||
72 | unsigned char byte; | ||
73 | int i=2000; | ||
74 | |||
75 | do { | ||
76 | byte=inb(RDS_REGISTER); | ||
77 | i--; | ||
78 | } | ||
79 | while ((byte & RDS_BUSYMASK) && i); | ||
80 | |||
81 | if (i) { | ||
82 | #if DEBUG | ||
83 | printk(KERN_DEBUG "rds_waitread()"); | ||
84 | print_matrix(&byte, 1); | ||
85 | #endif | ||
86 | return (byte); | ||
87 | } else { | ||
88 | printk(KERN_WARNING "aci-rds: rds_waitread() timeout...\n"); | ||
89 | return -1; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | /* don't use any ..._nowait() function if you are not sure what you do... */ | ||
94 | |||
95 | static inline void rds_rawwrite_nowait(unsigned char byte) | ||
96 | { | ||
97 | #if DEBUG | ||
98 | printk(KERN_DEBUG "rds_rawwrite()"); | ||
99 | print_matrix(&byte, 1); | ||
100 | #endif | ||
101 | outb(byte, RDS_REGISTER); | ||
102 | } | ||
103 | |||
104 | static int rds_rawwrite(unsigned char byte) | ||
105 | { | ||
106 | if (rds_waitread() >= 0) { | ||
107 | rds_rawwrite_nowait(byte); | ||
108 | return 0; | ||
109 | } else | ||
110 | return -1; | ||
111 | } | ||
112 | |||
113 | static int rds_write(unsigned char cmd) | ||
114 | { | ||
115 | unsigned char sendbuffer[8]; | ||
116 | int i; | ||
117 | |||
118 | if (byte2trans(cmd, sendbuffer, 8) != 0){ | ||
119 | return -1; | ||
120 | } else { | ||
121 | for (i=0; i<8; i++) { | ||
122 | rds_rawwrite(sendbuffer[i]); | ||
123 | } | ||
124 | } | ||
125 | return 0; | ||
126 | } | ||
127 | |||
128 | static int rds_readcycle_nowait(void) | ||
129 | { | ||
130 | rds_rawwrite_nowait(0); | ||
131 | return rds_waitread(); | ||
132 | } | ||
133 | |||
134 | static int rds_readcycle(void) | ||
135 | { | ||
136 | if (rds_rawwrite(0) < 0) | ||
137 | return -1; | ||
138 | return rds_waitread(); | ||
139 | } | ||
140 | |||
141 | static int rds_read(unsigned char databuffer[], int datasize) | ||
142 | { | ||
143 | #define READSIZE (8*datasize) | ||
144 | |||
145 | int i,j; | ||
146 | |||
147 | if (datasize < 1) /* nothing to read */ | ||
148 | return 0; | ||
149 | |||
150 | /* to be able to use rds_readcycle_nowait() | ||
151 | I have to waitread() here */ | ||
152 | if (rds_waitread() < 0) | ||
153 | return -1; | ||
154 | |||
155 | memset(databuffer, 0, datasize); | ||
156 | |||
157 | for (i=0; i< READSIZE; i++) | ||
158 | if((j=rds_readcycle_nowait()) < 0) { | ||
159 | return -1; | ||
160 | } else { | ||
161 | databuffer[i/8]|=(RDS_DATA(j) << (7-(i%8))); | ||
162 | } | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static int rds_ack(void) | ||
168 | { | ||
169 | int i=rds_readcycle(); | ||
170 | |||
171 | if (i < 0) | ||
172 | return -1; | ||
173 | if (i & RDS_DATAMASK) { | ||
174 | return 0; /* ACK */ | ||
175 | } else { | ||
176 | printk(KERN_DEBUG "aci-rds: NACK\n"); | ||
177 | return 1; /* NACK */ | ||
178 | } | ||
179 | } | ||
180 | |||
181 | int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize) | ||
182 | { | ||
183 | int ret; | ||
184 | |||
185 | if (mutex_lock_interruptible(&aci_rds_mutex)) | ||
186 | return -EINTR; | ||
187 | |||
188 | rds_write(cmd); | ||
189 | |||
190 | /* RDS_RESET doesn't need further processing */ | ||
191 | if (cmd!=RDS_RESET && (rds_ack() || rds_read(databuffer, datasize))) | ||
192 | ret = -1; | ||
193 | else | ||
194 | ret = 0; | ||
195 | |||
196 | mutex_unlock(&aci_rds_mutex); | ||
197 | |||
198 | return ret; | ||
199 | } | ||
200 | EXPORT_SYMBOL(aci_rds_cmd); | ||
201 | |||
202 | int __init attach_aci_rds(void) | ||
203 | { | ||
204 | mutex_init(&aci_rds_mutex); | ||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | void __exit unload_aci_rds(void) | ||
209 | { | ||
210 | } | ||
211 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/radio/miropcm20-rds-core.h b/drivers/media/radio/miropcm20-rds-core.h deleted file mode 100644 index aeb5761f0469..000000000000 --- a/drivers/media/radio/miropcm20-rds-core.h +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | #ifndef _MIROPCM20_RDS_CORE_H_ | ||
2 | #define _MIROPCM20_RDS_CORE_H_ | ||
3 | |||
4 | extern int aci_rds_cmd(unsigned char cmd, unsigned char databuffer[], int datasize); | ||
5 | |||
6 | #define RDS_STATUS 0x01 | ||
7 | #define RDS_STATIONNAME 0x02 | ||
8 | #define RDS_TEXT 0x03 | ||
9 | #define RDS_ALTFREQ 0x04 | ||
10 | #define RDS_TIMEDATE 0x05 | ||
11 | #define RDS_PI_CODE 0x06 | ||
12 | #define RDS_PTYTATP 0x07 | ||
13 | #define RDS_RESET 0x08 | ||
14 | #define RDS_RXVALUE 0x09 | ||
15 | |||
16 | extern void __exit unload_aci_rds(void); | ||
17 | extern int __init attach_aci_rds(void); | ||
18 | |||
19 | #endif /* _MIROPCM20_RDS_CORE_H_ */ | ||
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c deleted file mode 100644 index 3e840f74d45c..000000000000 --- a/drivers/media/radio/miropcm20-rds.c +++ /dev/null | |||
@@ -1,136 +0,0 @@ | |||
1 | /* MiroSOUND PCM20 radio rds interface driver | ||
2 | * (c) 2001 Robert Siemer <Robert.Siemer@gmx.de> | ||
3 | * Thanks to Fred Seidel. See miropcm20-rds-core.c for further information. | ||
4 | */ | ||
5 | |||
6 | /* Revision history: | ||
7 | * | ||
8 | * 2001-04-18 Robert Siemer <Robert.Siemer@gmx.de> | ||
9 | * separate file for user interface driver | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/slab.h> | ||
15 | #include <linux/smp_lock.h> | ||
16 | #include <linux/fs.h> | ||
17 | #include <linux/miscdevice.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <asm/uaccess.h> | ||
20 | #include "miropcm20-rds-core.h" | ||
21 | |||
22 | static char * text_buffer; | ||
23 | static int rds_users; | ||
24 | |||
25 | |||
26 | static int rds_f_open(struct inode *in, struct file *fi) | ||
27 | { | ||
28 | if (rds_users) | ||
29 | return -EBUSY; | ||
30 | |||
31 | lock_kernel(); | ||
32 | rds_users++; | ||
33 | if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { | ||
34 | rds_users--; | ||
35 | printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); | ||
36 | unlock_kernel(); | ||
37 | return -ENOMEM; | ||
38 | } | ||
39 | |||
40 | unlock_kernel(); | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static int rds_f_release(struct inode *in, struct file *fi) | ||
45 | { | ||
46 | kfree(text_buffer); | ||
47 | |||
48 | rds_users--; | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static void print_matrix(char *ch, char out[]) | ||
53 | { | ||
54 | int j; | ||
55 | |||
56 | for (j=7; j>=0; j--) { | ||
57 | out[7-j] = ((*ch >> j) & 0x1) + '0'; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) | ||
62 | { | ||
63 | // i = sprintf(text_buffer, "length: %d, offset: %d\n", length, *offset); | ||
64 | |||
65 | char c; | ||
66 | char bits[8]; | ||
67 | |||
68 | msleep(2000); | ||
69 | aci_rds_cmd(RDS_STATUS, &c, 1); | ||
70 | print_matrix(&c, bits); | ||
71 | if (copy_to_user(buffer, bits, 8)) | ||
72 | return -EFAULT; | ||
73 | |||
74 | /* if ((c >> 3) & 1) { | ||
75 | aci_rds_cmd(RDS_STATIONNAME, text_buffer+1, 8); | ||
76 | text_buffer[0] = ' ' ; | ||
77 | text_buffer[9] = '\n'; | ||
78 | return copy_to_user(buffer+8, text_buffer, 10) ? -EFAULT: 18; | ||
79 | } | ||
80 | */ | ||
81 | /* if ((c >> 6) & 1) { | ||
82 | aci_rds_cmd(RDS_PTYTATP, &c, 1); | ||
83 | if ( c & 1) | ||
84 | sprintf(text_buffer, " M"); | ||
85 | else | ||
86 | sprintf(text_buffer, " S"); | ||
87 | if ((c >> 1) & 1) | ||
88 | sprintf(text_buffer+2, " TA"); | ||
89 | else | ||
90 | sprintf(text_buffer+2, " --"); | ||
91 | if ((c >> 7) & 1) | ||
92 | sprintf(text_buffer+5, " TP"); | ||
93 | else | ||
94 | sprintf(text_buffer+5, " --"); | ||
95 | sprintf(text_buffer+8, " %2d\n", (c >> 2) & 0x1f); | ||
96 | return copy_to_user(buffer+8, text_buffer, 12) ? -EFAULT: 20; | ||
97 | } | ||
98 | */ | ||
99 | |||
100 | if ((c >> 4) & 1) { | ||
101 | aci_rds_cmd(RDS_TEXT, text_buffer, 65); | ||
102 | text_buffer[0] = ' ' ; | ||
103 | text_buffer[65] = '\n'; | ||
104 | return copy_to_user(buffer+8, text_buffer,66) ? -EFAULT : 66+8; | ||
105 | } else { | ||
106 | put_user('\n', buffer+8); | ||
107 | return 9; | ||
108 | } | ||
109 | } | ||
110 | |||
111 | static const struct file_operations rds_fops = { | ||
112 | .owner = THIS_MODULE, | ||
113 | .read = rds_f_read, | ||
114 | .open = rds_f_open, | ||
115 | .release = rds_f_release | ||
116 | }; | ||
117 | |||
118 | static struct miscdevice rds_miscdev = { | ||
119 | .minor = MISC_DYNAMIC_MINOR, | ||
120 | .name = "radiotext", | ||
121 | .fops = &rds_fops, | ||
122 | }; | ||
123 | |||
124 | static int __init miropcm20_rds_init(void) | ||
125 | { | ||
126 | return misc_register(&rds_miscdev); | ||
127 | } | ||
128 | |||
129 | static void __exit miropcm20_rds_cleanup(void) | ||
130 | { | ||
131 | misc_deregister(&rds_miscdev); | ||
132 | } | ||
133 | |||
134 | module_init(miropcm20_rds_init); | ||
135 | module_exit(miropcm20_rds_cleanup); | ||
136 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index eba9209b3024..1f064f4b32df 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c | |||
@@ -426,8 +426,7 @@ static int __init rtrack_init(void) | |||
426 | 426 | ||
427 | rtrack_radio.priv=&rtrack_unit; | 427 | rtrack_radio.priv=&rtrack_unit; |
428 | 428 | ||
429 | if(video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr)==-1) | 429 | if (video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
430 | { | ||
431 | release_region(io, 2); | 430 | release_region(io, 2); |
432 | return -EINVAL; | 431 | return -EINVAL; |
433 | } | 432 | } |
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index 3fe5504428c5..628c689e3ffe 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c | |||
@@ -394,8 +394,7 @@ static int __init aztech_init(void) | |||
394 | mutex_init(&lock); | 394 | mutex_init(&lock); |
395 | aztech_radio.priv=&aztech_unit; | 395 | aztech_radio.priv=&aztech_unit; |
396 | 396 | ||
397 | if(video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr)==-1) | 397 | if (video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
398 | { | ||
399 | release_region(io,2); | 398 | release_region(io,2); |
400 | return -EINVAL; | 399 | return -EINVAL; |
401 | } | 400 | } |
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 6166e726ed72..04c3698d32e4 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c | |||
@@ -682,7 +682,7 @@ static int __init cadet_init(void) | |||
682 | } | 682 | } |
683 | if (!request_region(io,2,"cadet")) | 683 | if (!request_region(io,2,"cadet")) |
684 | goto fail; | 684 | goto fail; |
685 | if(video_register_device(&cadet_radio,VFL_TYPE_RADIO,radio_nr)==-1) { | 685 | if (video_register_device(&cadet_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
686 | release_region(io,2); | 686 | release_region(io,2); |
687 | goto fail; | 687 | goto fail; |
688 | } | 688 | } |
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index 36e754e3ffb2..5cd7f032298d 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c | |||
@@ -425,7 +425,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci | |||
425 | } | 425 | } |
426 | *devradio = vdev_template; | 426 | *devradio = vdev_template; |
427 | 427 | ||
428 | if ( video_register_device( devradio, VFL_TYPE_RADIO , nr_radio) == -1 ) { | 428 | if (video_register_device(devradio, VFL_TYPE_RADIO, nr_radio) < 0) { |
429 | kfree( devradio ); | 429 | kfree( devradio ); |
430 | goto err_video; | 430 | goto err_video; |
431 | } | 431 | } |
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index 2b1a6221de6d..0a0f956bb308 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c | |||
@@ -612,8 +612,7 @@ static int __init gemtek_init(void) | |||
612 | 612 | ||
613 | gemtek_radio.priv = &gemtek_unit; | 613 | gemtek_radio.priv = &gemtek_unit; |
614 | 614 | ||
615 | if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, | 615 | if (video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
616 | radio_nr) == -1) { | ||
617 | release_region(io, 1); | 616 | release_region(io, 1); |
618 | return -EBUSY; | 617 | return -EBUSY; |
619 | } | 618 | } |
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index 0ada1c697e8a..9ef0a763eeb7 100644 --- a/drivers/media/radio/radio-maestro.c +++ b/drivers/media/radio/radio-maestro.c | |||
@@ -409,8 +409,7 @@ static int __devinit maestro_probe(struct pci_dev *pdev, | |||
409 | video_set_drvdata(maestro_radio_inst, radio_unit); | 409 | video_set_drvdata(maestro_radio_inst, radio_unit); |
410 | pci_set_drvdata(pdev, maestro_radio_inst); | 410 | pci_set_drvdata(pdev, maestro_radio_inst); |
411 | 411 | ||
412 | retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO, | 412 | retval = video_register_device(maestro_radio_inst, VFL_TYPE_RADIO, radio_nr); |
413 | radio_nr); | ||
414 | if (retval) { | 413 | if (retval) { |
415 | printk(KERN_ERR "can't register video device!\n"); | 414 | printk(KERN_ERR "can't register video device!\n"); |
416 | goto errfr1; | 415 | goto errfr1; |
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 43c75497dc49..0cc6fcb041fd 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c | |||
@@ -156,28 +156,28 @@ static void set_freq(__u16 io, __u32 freq) | |||
156 | { | 156 | { |
157 | unsigned long int si; | 157 | unsigned long int si; |
158 | int bl; | 158 | int bl; |
159 | int data = FREQ2BITS(freq); | 159 | int val = FREQ2BITS(freq); |
160 | 160 | ||
161 | /* TEA5757 shift register bits (see pdf) */ | 161 | /* TEA5757 shift register bits (see pdf) */ |
162 | 162 | ||
163 | outbit(0,io); // 24 search | 163 | outbit(0, io); /* 24 search */ |
164 | outbit(1,io); // 23 search up/down | 164 | outbit(1, io); /* 23 search up/down */ |
165 | 165 | ||
166 | outbit(0,io); // 22 stereo/mono | 166 | outbit(0, io); /* 22 stereo/mono */ |
167 | 167 | ||
168 | outbit(0,io); // 21 band | 168 | outbit(0, io); /* 21 band */ |
169 | outbit(0,io); // 20 band (only 00=FM works I think) | 169 | outbit(0, io); /* 20 band (only 00=FM works I think) */ |
170 | 170 | ||
171 | outbit(0,io); // 19 port ? | 171 | outbit(0, io); /* 19 port ? */ |
172 | outbit(0,io); // 18 port ? | 172 | outbit(0, io); /* 18 port ? */ |
173 | 173 | ||
174 | outbit(0,io); // 17 search level | 174 | outbit(0, io); /* 17 search level */ |
175 | outbit(0,io); // 16 search level | 175 | outbit(0, io); /* 16 search level */ |
176 | 176 | ||
177 | si = 0x8000; | 177 | si = 0x8000; |
178 | for (bl = 1; bl <= 16 ; bl++) { | 178 | for (bl = 1; bl <= 16; bl++) { |
179 | outbit(data & si,io); | 179 | outbit(val & si, io); |
180 | si >>=1; | 180 | si >>= 1; |
181 | } | 181 | } |
182 | 182 | ||
183 | dprintk(1, "Radio freq set to %d.%02d MHz\n", | 183 | dprintk(1, "Radio freq set to %d.%02d MHz\n", |
@@ -410,7 +410,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d | |||
410 | mutex_init(&radio_unit.lock); | 410 | mutex_init(&radio_unit.lock); |
411 | maxiradio_radio.priv = &radio_unit; | 411 | maxiradio_radio.priv = &radio_unit; |
412 | 412 | ||
413 | if (video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) { | 413 | if (video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
414 | printk("radio-maxiradio: can't register device!"); | 414 | printk("radio-maxiradio: can't register device!"); |
415 | goto err_out_free_region; | 415 | goto err_out_free_region; |
416 | } | 416 | } |
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index e2dde0807268..6d820e2481e7 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c | |||
@@ -332,8 +332,7 @@ static int __init rtrack2_init(void) | |||
332 | rtrack2_radio.priv=&rtrack2_unit; | 332 | rtrack2_radio.priv=&rtrack2_unit; |
333 | 333 | ||
334 | spin_lock_init(&lock); | 334 | spin_lock_init(&lock); |
335 | if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr)==-1) | 335 | if (video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
336 | { | ||
337 | release_region(io, 4); | 336 | release_region(io, 4); |
338 | return -EINVAL; | 337 | return -EINVAL; |
339 | } | 338 | } |
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index bb5d92f104af..0d478f54a907 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c | |||
@@ -377,7 +377,7 @@ static int __init fmi_init(void) | |||
377 | 377 | ||
378 | mutex_init(&lock); | 378 | mutex_init(&lock); |
379 | 379 | ||
380 | if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) == -1) { | 380 | if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
381 | release_region(io, 2); | 381 | release_region(io, 2); |
382 | return -EINVAL; | 382 | return -EINVAL; |
383 | } | 383 | } |
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c index a4984ff87c9c..16c7ef20265c 100644 --- a/drivers/media/radio/radio-si470x.c +++ b/drivers/media/radio/radio-si470x.c | |||
@@ -1694,8 +1694,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, | |||
1694 | INIT_DELAYED_WORK(&radio->work, si470x_work); | 1694 | INIT_DELAYED_WORK(&radio->work, si470x_work); |
1695 | 1695 | ||
1696 | /* register video device */ | 1696 | /* register video device */ |
1697 | if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr)) { | 1697 | retval = video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr); |
1698 | retval = -EIO; | 1698 | if (retval) { |
1699 | printk(KERN_WARNING DRIVER_NAME | 1699 | printk(KERN_WARNING DRIVER_NAME |
1700 | ": Could not register video device\n"); | 1700 | ": Could not register video device\n"); |
1701 | goto err_all; | 1701 | goto err_all; |
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index cefa44fc5aed..0876fecc5f27 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c | |||
@@ -405,8 +405,7 @@ static int __init terratec_init(void) | |||
405 | 405 | ||
406 | spin_lock_init(&lock); | 406 | spin_lock_init(&lock); |
407 | 407 | ||
408 | if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1) | 408 | if (video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
409 | { | ||
410 | release_region(io,2); | 409 | release_region(io,2); |
411 | return -EINVAL; | 410 | return -EINVAL; |
412 | } | 411 | } |
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index d70172d23edb..193161956253 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c | |||
@@ -378,8 +378,7 @@ static int __init trust_init(void) | |||
378 | printk(KERN_ERR "trust: port 0x%x already in use\n", io); | 378 | printk(KERN_ERR "trust: port 0x%x already in use\n", io); |
379 | return -EBUSY; | 379 | return -EBUSY; |
380 | } | 380 | } |
381 | if(video_register_device(&trust_radio, VFL_TYPE_RADIO, radio_nr)==-1) | 381 | if (video_register_device(&trust_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
382 | { | ||
383 | release_region(io, 2); | 382 | release_region(io, 2); |
384 | return -EINVAL; | 383 | return -EINVAL; |
385 | } | 384 | } |
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 9f17a332fa11..51d57ed3b3e1 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c | |||
@@ -446,8 +446,7 @@ static int __init zoltrix_init(void) | |||
446 | return -EBUSY; | 446 | return -EBUSY; |
447 | } | 447 | } |
448 | 448 | ||
449 | if (video_register_device(&zoltrix_radio, VFL_TYPE_RADIO, radio_nr) == -1) | 449 | if (video_register_device(&zoltrix_radio, VFL_TYPE_RADIO, radio_nr) < 0) { |
450 | { | ||
451 | release_region(io, 2); | 450 | release_region(io, 2); |
452 | return -EINVAL; | 451 | return -EINVAL; |
453 | } | 452 | } |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ecbfa1b39b70..3e9e0dcd217e 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -968,7 +968,7 @@ config VIDEO_PXA27x | |||
968 | 968 | ||
969 | config VIDEO_SH_MOBILE_CEU | 969 | config VIDEO_SH_MOBILE_CEU |
970 | tristate "SuperH Mobile CEU Interface driver" | 970 | tristate "SuperH Mobile CEU Interface driver" |
971 | depends on VIDEO_DEV | 971 | depends on VIDEO_DEV && HAS_DMA |
972 | select SOC_CAMERA | 972 | select SOC_CAMERA |
973 | select VIDEOBUF_DMA_CONTIG | 973 | select VIDEOBUF_DMA_CONTIG |
974 | ---help--- | 974 | ---help--- |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index bbc6f8b82297..ef7c8d3ffb18 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
@@ -20,6 +20,8 @@ ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y) | |||
20 | obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o | 20 | obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o |
21 | endif | 21 | endif |
22 | 22 | ||
23 | obj-$(CONFIG_VIDEO_TUNER) += tuner.o | ||
24 | |||
23 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ | 25 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ |
24 | obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o | 26 | obj-$(CONFIG_VIDEO_IR_I2C) += ir-kbd-i2c.o |
25 | obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o | 27 | obj-$(CONFIG_VIDEO_TVAUDIO) += tvaudio.o |
@@ -85,8 +87,6 @@ obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o | |||
85 | obj-$(CONFIG_VIDEO_DPC) += dpc7146.o | 87 | obj-$(CONFIG_VIDEO_DPC) += dpc7146.o |
86 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o | 88 | obj-$(CONFIG_TUNER_3036) += tuner-3036.o |
87 | 89 | ||
88 | obj-$(CONFIG_VIDEO_TUNER) += tuner.o | ||
89 | |||
90 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o | 90 | obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o |
91 | obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o | 91 | obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o |
92 | obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o | 92 | obj-$(CONFIG_VIDEOBUF_DMA_CONTIG) += videobuf-dma-contig.o |
diff --git a/drivers/media/video/au0828/Kconfig b/drivers/media/video/au0828/Kconfig index ed9a50f189fc..018f72b8e3e2 100644 --- a/drivers/media/video/au0828/Kconfig +++ b/drivers/media/video/au0828/Kconfig | |||
@@ -7,6 +7,7 @@ config VIDEO_AU0828 | |||
7 | select DVB_AU8522 if !DVB_FE_CUSTOMIZE | 7 | select DVB_AU8522 if !DVB_FE_CUSTOMIZE |
8 | select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE | 8 | select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE |
9 | select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMIZE | 9 | select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMIZE |
10 | select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE | ||
10 | ---help--- | 11 | ---help--- |
11 | This is a video4linux driver for Auvitek's USB device. | 12 | This is a video4linux driver for Auvitek's USB device. |
12 | 13 | ||
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c index 443e59009762..ed48908a9034 100644 --- a/drivers/media/video/au0828/au0828-cards.c +++ b/drivers/media/video/au0828/au0828-cards.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek USB bridge | 2 | * Driver for the Auvitek USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -38,6 +38,9 @@ struct au0828_board au0828_boards[] = { | |||
38 | [AU0828_BOARD_DVICO_FUSIONHDTV7] = { | 38 | [AU0828_BOARD_DVICO_FUSIONHDTV7] = { |
39 | .name = "DViCO FusionHDTV USB", | 39 | .name = "DViCO FusionHDTV USB", |
40 | }, | 40 | }, |
41 | [AU0828_BOARD_HAUPPAUGE_WOODBURY] = { | ||
42 | .name = "Hauppauge Woodbury", | ||
43 | }, | ||
41 | }; | 44 | }; |
42 | 45 | ||
43 | /* Tuner callback function for au0828 boards. Currently only needed | 46 | /* Tuner callback function for au0828 boards. Currently only needed |
@@ -115,6 +118,7 @@ void au0828_card_setup(struct au0828_dev *dev) | |||
115 | case AU0828_BOARD_HAUPPAUGE_HVR850: | 118 | case AU0828_BOARD_HAUPPAUGE_HVR850: |
116 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: | 119 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: |
117 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: | 120 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: |
121 | case AU0828_BOARD_HAUPPAUGE_WOODBURY: | ||
118 | if (dev->i2c_rc == 0) | 122 | if (dev->i2c_rc == 0) |
119 | hauppauge_eeprom(dev, eeprom+0xa0); | 123 | hauppauge_eeprom(dev, eeprom+0xa0); |
120 | break; | 124 | break; |
@@ -134,6 +138,7 @@ void au0828_gpio_setup(struct au0828_dev *dev) | |||
134 | case AU0828_BOARD_HAUPPAUGE_HVR850: | 138 | case AU0828_BOARD_HAUPPAUGE_HVR850: |
135 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: | 139 | case AU0828_BOARD_HAUPPAUGE_HVR950Q: |
136 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: | 140 | case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL: |
141 | case AU0828_BOARD_HAUPPAUGE_WOODBURY: | ||
137 | /* GPIO's | 142 | /* GPIO's |
138 | * 4 - CS5340 | 143 | * 4 - CS5340 |
139 | * 5 - AU8522 Demodulator | 144 | * 5 - AU8522 Demodulator |
@@ -205,6 +210,8 @@ struct usb_device_id au0828_usb_id_table [] = { | |||
205 | .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, | 210 | .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, |
206 | { USB_DEVICE(0x2040, 0x7281), | 211 | { USB_DEVICE(0x2040, 0x7281), |
207 | .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, | 212 | .driver_info = AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL }, |
213 | { USB_DEVICE(0x2040, 0x8200), | ||
214 | .driver_info = AU0828_BOARD_HAUPPAUGE_WOODBURY }, | ||
208 | { }, | 215 | { }, |
209 | }; | 216 | }; |
210 | 217 | ||
diff --git a/drivers/media/video/au0828/au0828-cards.h b/drivers/media/video/au0828/au0828-cards.h index c37f5fd0fa80..48a1882c2b6b 100644 --- a/drivers/media/video/au0828/au0828-cards.h +++ b/drivers/media/video/au0828/au0828-cards.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek USB bridge | 2 | * Driver for the Auvitek USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -24,3 +24,4 @@ | |||
24 | #define AU0828_BOARD_HAUPPAUGE_HVR850 2 | 24 | #define AU0828_BOARD_HAUPPAUGE_HVR850 2 |
25 | #define AU0828_BOARD_DVICO_FUSIONHDTV7 3 | 25 | #define AU0828_BOARD_DVICO_FUSIONHDTV7 3 |
26 | #define AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL 4 | 26 | #define AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL 4 |
27 | #define AU0828_BOARD_HAUPPAUGE_WOODBURY 5 | ||
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c index 54bfc0f05295..d856de9f742f 100644 --- a/drivers/media/video/au0828/au0828-core.c +++ b/drivers/media/video/au0828/au0828-core.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek USB bridge | 2 | * Driver for the Auvitek USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -252,5 +252,5 @@ module_init(au0828_init); | |||
252 | module_exit(au0828_exit); | 252 | module_exit(au0828_exit); |
253 | 253 | ||
254 | MODULE_DESCRIPTION("Driver for Auvitek AU0828 based products"); | 254 | MODULE_DESCRIPTION("Driver for Auvitek AU0828 based products"); |
255 | MODULE_AUTHOR("Steven Toth <stoth@hauppauge.com>"); | 255 | MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); |
256 | MODULE_LICENSE("GPL"); | 256 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 584a83a94a2a..ba94be7e0ac1 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek USB bridge | 2 | * Driver for the Auvitek USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -29,6 +29,7 @@ | |||
29 | #include "au8522.h" | 29 | #include "au8522.h" |
30 | #include "xc5000.h" | 30 | #include "xc5000.h" |
31 | #include "mxl5007t.h" | 31 | #include "mxl5007t.h" |
32 | #include "tda18271.h" | ||
32 | 33 | ||
33 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 34 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
34 | 35 | ||
@@ -38,6 +39,15 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
38 | static struct au8522_config hauppauge_hvr950q_config = { | 39 | static struct au8522_config hauppauge_hvr950q_config = { |
39 | .demod_address = 0x8e >> 1, | 40 | .demod_address = 0x8e >> 1, |
40 | .status_mode = AU8522_DEMODLOCKING, | 41 | .status_mode = AU8522_DEMODLOCKING, |
42 | .qam_if = AU8522_IF_6MHZ, | ||
43 | .vsb_if = AU8522_IF_6MHZ, | ||
44 | }; | ||
45 | |||
46 | static struct au8522_config hauppauge_woodbury_config = { | ||
47 | .demod_address = 0x8e >> 1, | ||
48 | .status_mode = AU8522_DEMODLOCKING, | ||
49 | .qam_if = AU8522_IF_4MHZ, | ||
50 | .vsb_if = AU8522_IF_3_25MHZ, | ||
41 | }; | 51 | }; |
42 | 52 | ||
43 | static struct xc5000_config hauppauge_hvr950q_tunerconfig = { | 53 | static struct xc5000_config hauppauge_hvr950q_tunerconfig = { |
@@ -51,6 +61,10 @@ static struct mxl5007t_config mxl5007t_hvr950q_config = { | |||
51 | .if_freq_hz = MxL_IF_6_MHZ, | 61 | .if_freq_hz = MxL_IF_6_MHZ, |
52 | }; | 62 | }; |
53 | 63 | ||
64 | static struct tda18271_config hauppauge_woodbury_tunerconfig = { | ||
65 | .gate = TDA18271_GATE_DIGITAL, | ||
66 | }; | ||
67 | |||
54 | /*-------------------------------------------------------------------*/ | 68 | /*-------------------------------------------------------------------*/ |
55 | static void urb_completion(struct urb *purb) | 69 | static void urb_completion(struct urb *purb) |
56 | { | 70 | { |
@@ -357,6 +371,15 @@ int au0828_dvb_register(struct au0828_dev *dev) | |||
357 | &dev->i2c_adap, 0x60, | 371 | &dev->i2c_adap, 0x60, |
358 | &mxl5007t_hvr950q_config); | 372 | &mxl5007t_hvr950q_config); |
359 | break; | 373 | break; |
374 | case AU0828_BOARD_HAUPPAUGE_WOODBURY: | ||
375 | dvb->frontend = dvb_attach(au8522_attach, | ||
376 | &hauppauge_woodbury_config, | ||
377 | &dev->i2c_adap); | ||
378 | if (dvb->frontend != NULL) | ||
379 | dvb_attach(tda18271_attach, dvb->frontend, | ||
380 | 0x60, &dev->i2c_adap, | ||
381 | &hauppauge_woodbury_tunerconfig); | ||
382 | break; | ||
360 | default: | 383 | default: |
361 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " | 384 | printk(KERN_WARNING "The frontend of your DVB/ATSC card " |
362 | "isn't supported yet\n"); | 385 | "isn't supported yet\n"); |
diff --git a/drivers/media/video/au0828/au0828-i2c.c b/drivers/media/video/au0828/au0828-i2c.c index 741a4937b050..d618fbaade1b 100644 --- a/drivers/media/video/au0828/au0828-i2c.c +++ b/drivers/media/video/au0828/au0828-i2c.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek AU0828 USB bridge | 2 | * Driver for the Auvitek AU0828 USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/au0828/au0828-reg.h b/drivers/media/video/au0828/au0828-reg.h index 39827550891c..1e87fa0c6842 100644 --- a/drivers/media/video/au0828/au0828-reg.h +++ b/drivers/media/video/au0828/au0828-reg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek USB bridge | 2 | * Driver for the Auvitek USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/au0828/au0828.h b/drivers/media/video/au0828/au0828.h index 7beb571798e5..4f10ff300135 100644 --- a/drivers/media/video/au0828/au0828.h +++ b/drivers/media/video/au0828/au0828.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Auvitek AU0828 USB bridge | 2 | * Driver for the Auvitek AU0828 USB bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index 1c56ae92ce74..6081edc362df 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -3144,8 +3144,9 @@ static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]) | |||
3144 | 3144 | ||
3145 | static void flyvideo_gpio(struct bttv *btv) | 3145 | static void flyvideo_gpio(struct bttv *btv) |
3146 | { | 3146 | { |
3147 | int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821; | 3147 | int gpio, has_remote, has_radio, is_capture_only; |
3148 | int tuner=UNSET,ttype; | 3148 | int is_lr90, has_tda9820_tda9821; |
3149 | int tuner_type = UNSET, ttype; | ||
3149 | 3150 | ||
3150 | gpio_inout(0xffffff, 0); | 3151 | gpio_inout(0xffffff, 0); |
3151 | udelay(8); /* without this we would see the 0x1800 mask */ | 3152 | udelay(8); /* without this we would see the 0x1800 mask */ |
@@ -3163,20 +3164,26 @@ static void flyvideo_gpio(struct bttv *btv) | |||
3163 | * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered | 3164 | * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered |
3164 | * Note: Some bits are Audio_Mask ! | 3165 | * Note: Some bits are Audio_Mask ! |
3165 | */ | 3166 | */ |
3166 | ttype=(gpio&0x0f0000)>>16; | 3167 | ttype = (gpio & 0x0f0000) >> 16; |
3167 | switch(ttype) { | 3168 | switch (ttype) { |
3168 | case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */ | 3169 | case 0x0: |
3170 | tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */ | ||
3169 | break; | 3171 | break; |
3170 | case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */ | 3172 | case 0x2: |
3173 | tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */ | ||
3171 | break; | 3174 | break; |
3172 | case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ | 3175 | case 0x4: |
3176 | tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */ | ||
3173 | break; | 3177 | break; |
3174 | case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */ | 3178 | case 0x6: |
3179 | tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */ | ||
3175 | break; | 3180 | break; |
3176 | case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ | 3181 | case 0xC: |
3182 | tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */ | ||
3177 | break; | 3183 | break; |
3178 | default: | 3184 | default: |
3179 | printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); | 3185 | printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr); |
3186 | break; | ||
3180 | } | 3187 | } |
3181 | 3188 | ||
3182 | has_remote = gpio & 0x800000; | 3189 | has_remote = gpio & 0x800000; |
@@ -3189,23 +3196,26 @@ static void flyvideo_gpio(struct bttv *btv) | |||
3189 | /* | 3196 | /* |
3190 | * gpio & 0x001000 output bit for audio routing */ | 3197 | * gpio & 0x001000 output bit for audio routing */ |
3191 | 3198 | ||
3192 | if(is_capture_only) | 3199 | if (is_capture_only) |
3193 | tuner = TUNER_ABSENT; /* No tuner present */ | 3200 | tuner_type = TUNER_ABSENT; /* No tuner present */ |
3194 | 3201 | ||
3195 | printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", | 3202 | printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n", |
3196 | btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio); | 3203 | btv->c.nr, has_radio ? "yes" : "no ", |
3204 | has_remote ? "yes" : "no ", tuner_type, gpio); | ||
3197 | printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", | 3205 | printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n", |
3198 | btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ", | 3206 | btv->c.nr, is_lr90 ? "yes" : "no ", |
3199 | is_capture_only?"yes":"no "); | 3207 | has_tda9820_tda9821 ? "yes" : "no ", |
3208 | is_capture_only ? "yes" : "no "); | ||
3200 | 3209 | ||
3201 | if (tuner != UNSET) /* only set if known tuner autodetected, else let insmod option through */ | 3210 | if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */ |
3202 | btv->tuner_type = tuner; | 3211 | btv->tuner_type = tuner_type; |
3203 | btv->has_radio = has_radio; | 3212 | btv->has_radio = has_radio; |
3204 | 3213 | ||
3205 | /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 | 3214 | /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80 |
3206 | * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 | 3215 | * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00 |
3207 | * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ | 3216 | * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */ |
3208 | if(has_tda9820_tda9821) btv->audio_mode_gpio = lt9415_audio; | 3217 | if (has_tda9820_tda9821) |
3218 | btv->audio_mode_gpio = lt9415_audio; | ||
3209 | /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ | 3219 | /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */ |
3210 | } | 3220 | } |
3211 | 3221 | ||
@@ -3962,7 +3972,7 @@ static int tuner_1_table[] = { | |||
3962 | 3972 | ||
3963 | static void __devinit avermedia_eeprom(struct bttv *btv) | 3973 | static void __devinit avermedia_eeprom(struct bttv *btv) |
3964 | { | 3974 | { |
3965 | int tuner_make,tuner_tv_fm,tuner_format,tuner=0; | 3975 | int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0; |
3966 | 3976 | ||
3967 | tuner_make = (eeprom_data[0x41] & 0x7); | 3977 | tuner_make = (eeprom_data[0x41] & 0x7); |
3968 | tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; | 3978 | tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3; |
@@ -3970,24 +3980,24 @@ static void __devinit avermedia_eeprom(struct bttv *btv) | |||
3970 | btv->has_remote = (eeprom_data[0x42] & 0x01); | 3980 | btv->has_remote = (eeprom_data[0x42] & 0x01); |
3971 | 3981 | ||
3972 | if (tuner_make == 0 || tuner_make == 2) | 3982 | if (tuner_make == 0 || tuner_make == 2) |
3973 | if(tuner_format <=0x0a) | 3983 | if (tuner_format <= 0x0a) |
3974 | tuner = tuner_0_table[tuner_format]; | 3984 | tuner_type = tuner_0_table[tuner_format]; |
3975 | if (tuner_make == 1) | 3985 | if (tuner_make == 1) |
3976 | if(tuner_format <=9) | 3986 | if (tuner_format <= 9) |
3977 | tuner = tuner_1_table[tuner_format]; | 3987 | tuner_type = tuner_1_table[tuner_format]; |
3978 | 3988 | ||
3979 | if (tuner_make == 4) | 3989 | if (tuner_make == 4) |
3980 | if(tuner_format == 0x09) | 3990 | if (tuner_format == 0x09) |
3981 | tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ | 3991 | tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */ |
3982 | 3992 | ||
3983 | printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", | 3993 | printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", |
3984 | btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); | 3994 | btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]); |
3985 | if(tuner) { | 3995 | if (tuner_type) { |
3986 | btv->tuner_type=tuner; | 3996 | btv->tuner_type = tuner_type; |
3987 | printk("%d",tuner); | 3997 | printk(KERN_CONT "%d", tuner_type); |
3988 | } else | 3998 | } else |
3989 | printk("Unknown type"); | 3999 | printk(KERN_CONT "Unknown type"); |
3990 | printk(" radio:%s remote control:%s\n", | 4000 | printk(KERN_CONT " radio:%s remote control:%s\n", |
3991 | tuner_tv_fm ? "yes" : "no", | 4001 | tuner_tv_fm ? "yes" : "no", |
3992 | btv->has_remote ? "yes" : "no"); | 4002 | btv->has_remote ? "yes" : "no"); |
3993 | } | 4003 | } |
@@ -4029,7 +4039,8 @@ static void __devinit boot_msp34xx(struct bttv *btv, int pin) | |||
4029 | 4039 | ||
4030 | gpio_inout(mask,mask); | 4040 | gpio_inout(mask,mask); |
4031 | gpio_bits(mask,0); | 4041 | gpio_bits(mask,0); |
4032 | udelay(2500); | 4042 | mdelay(2); |
4043 | udelay(500); | ||
4033 | gpio_bits(mask,mask); | 4044 | gpio_bits(mask,mask); |
4034 | 4045 | ||
4035 | if (bttv_gpio) | 4046 | if (bttv_gpio) |
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 85bf31ab8789..6ae4cc860efe 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -96,7 +96,6 @@ static unsigned int irq_iswitch; | |||
96 | static unsigned int uv_ratio = 50; | 96 | static unsigned int uv_ratio = 50; |
97 | static unsigned int full_luma_range; | 97 | static unsigned int full_luma_range; |
98 | static unsigned int coring; | 98 | static unsigned int coring; |
99 | extern int no_overlay; | ||
100 | 99 | ||
101 | /* API features (turn on/off stuff for testing) */ | 100 | /* API features (turn on/off stuff for testing) */ |
102 | static unsigned int v4l2 = 1; | 101 | static unsigned int v4l2 = 1; |
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c index 649682aac1ac..5b1b8e4c78ba 100644 --- a/drivers/media/video/bt8xx/bttv-risc.c +++ b/drivers/media/video/bt8xx/bttv-risc.c | |||
@@ -244,7 +244,8 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
244 | const struct bttv_format *fmt, struct bttv_overlay *ov, | 244 | const struct bttv_format *fmt, struct bttv_overlay *ov, |
245 | int skip_even, int skip_odd) | 245 | int skip_even, int skip_odd) |
246 | { | 246 | { |
247 | int dwords,rc,line,maxy,start,end,skip,nskips; | 247 | int dwords, rc, line, maxy, start, end; |
248 | unsigned skip, nskips; | ||
248 | struct btcx_skiplist *skips; | 249 | struct btcx_skiplist *skips; |
249 | __le32 *rp; | 250 | __le32 *rp; |
250 | u32 ri,ra; | 251 | u32 ri,ra; |
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h index 08ef54a22c9e..b4d940b2e447 100644 --- a/drivers/media/video/bt8xx/bttvp.h +++ b/drivers/media/video/bt8xx/bttvp.h | |||
@@ -267,6 +267,11 @@ int bttv_sub_add_device(struct bttv_core *core, char *name); | |||
267 | int bttv_sub_del_devices(struct bttv_core *core); | 267 | int bttv_sub_del_devices(struct bttv_core *core); |
268 | 268 | ||
269 | /* ---------------------------------------------------------- */ | 269 | /* ---------------------------------------------------------- */ |
270 | /* bttv-cards.c */ | ||
271 | |||
272 | extern int no_overlay; | ||
273 | |||
274 | /* ---------------------------------------------------------- */ | ||
270 | /* bttv-driver.c */ | 275 | /* bttv-driver.c */ |
271 | 276 | ||
272 | /* insmod options */ | 277 | /* insmod options */ |
diff --git a/drivers/media/video/btcx-risc.c b/drivers/media/video/btcx-risc.c index f42701f82e7f..3324ab38f58c 100644 --- a/drivers/media/video/btcx-risc.c +++ b/drivers/media/video/btcx-risc.c | |||
@@ -184,12 +184,12 @@ btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | void | 186 | void |
187 | btcx_calc_skips(int line, int width, unsigned int *maxy, | 187 | btcx_calc_skips(int line, int width, int *maxy, |
188 | struct btcx_skiplist *skips, unsigned int *nskips, | 188 | struct btcx_skiplist *skips, unsigned int *nskips, |
189 | const struct v4l2_clip *clips, unsigned int nclips) | 189 | const struct v4l2_clip *clips, unsigned int nclips) |
190 | { | 190 | { |
191 | unsigned int clip,skip; | 191 | unsigned int clip,skip; |
192 | int end,maxline; | 192 | int end, maxline; |
193 | 193 | ||
194 | skip=0; | 194 | skip=0; |
195 | maxline = 9999; | 195 | maxline = 9999; |
diff --git a/drivers/media/video/btcx-risc.h b/drivers/media/video/btcx-risc.h index 861bc8112824..f8bc6e8e7b51 100644 --- a/drivers/media/video/btcx-risc.h +++ b/drivers/media/video/btcx-risc.h | |||
@@ -23,7 +23,7 @@ int btcx_screen_clips(int swidth, int sheight, struct v4l2_rect *win, | |||
23 | int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, | 23 | int btcx_align(struct v4l2_rect *win, struct v4l2_clip *clips, |
24 | unsigned int n, int mask); | 24 | unsigned int n, int mask); |
25 | void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); | 25 | void btcx_sort_clips(struct v4l2_clip *clips, unsigned int nclips); |
26 | void btcx_calc_skips(int line, int width, unsigned int *maxy, | 26 | void btcx_calc_skips(int line, int width, int *maxy, |
27 | struct btcx_skiplist *skips, unsigned int *nskips, | 27 | struct btcx_skiplist *skips, unsigned int *nskips, |
28 | const struct v4l2_clip *clips, unsigned int nclips); | 28 | const struct v4l2_clip *clips, unsigned int nclips); |
29 | 29 | ||
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index d3b3268bace8..6e39e253ce53 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c | |||
@@ -946,8 +946,7 @@ static int init_bwqcam(struct parport *port) | |||
946 | 946 | ||
947 | printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name); | 947 | printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name); |
948 | 948 | ||
949 | if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) | 949 | if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
950 | { | ||
951 | parport_unregister_device(qcam->pdev); | 950 | parport_unregister_device(qcam->pdev); |
952 | kfree(qcam); | 951 | kfree(qcam); |
953 | return -ENODEV; | 952 | return -ENODEV; |
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c index fe9379b282d3..7f6c6b4bec10 100644 --- a/drivers/media/video/c-qcam.c +++ b/drivers/media/video/c-qcam.c | |||
@@ -787,8 +787,7 @@ static int init_cqcam(struct parport *port) | |||
787 | 787 | ||
788 | parport_release(qcam->pdev); | 788 | parport_release(qcam->pdev); |
789 | 789 | ||
790 | if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1) | 790 | if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
791 | { | ||
792 | printk(KERN_ERR "Unable to register Colour QuickCam on %s\n", | 791 | printk(KERN_ERR "Unable to register Colour QuickCam on %s\n", |
793 | qcam->pport->name); | 792 | qcam->pport->name); |
794 | parport_unregister_device(qcam->pdev); | 793 | parport_unregister_device(qcam->pdev); |
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index dc8cc6115e2f..a661800b0e69 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c | |||
@@ -3955,7 +3955,7 @@ struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowleve | |||
3955 | camera->lowlevel_data = lowlevel; | 3955 | camera->lowlevel_data = lowlevel; |
3956 | 3956 | ||
3957 | /* register v4l device */ | 3957 | /* register v4l device */ |
3958 | if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { | 3958 | if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
3959 | kfree(camera); | 3959 | kfree(camera); |
3960 | printk(KERN_DEBUG "video_register_device failed\n"); | 3960 | printk(KERN_DEBUG "video_register_device failed\n"); |
3961 | return NULL; | 3961 | return NULL; |
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index 515c8b57a60d..eb9f15cd4c45 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c | |||
@@ -1024,7 +1024,6 @@ static int ioctl_queryctrl(void *arg,struct camera_data *cam) | |||
1024 | if(cam->params.pnp_id.device_type == DEVICE_STV_672 && | 1024 | if(cam->params.pnp_id.device_type == DEVICE_STV_672 && |
1025 | cam->params.version.sensor_flags==CPIA2_VP_SENSOR_FLAGS_500){ | 1025 | cam->params.version.sensor_flags==CPIA2_VP_SENSOR_FLAGS_500){ |
1026 | // Maximum 15fps | 1026 | // Maximum 15fps |
1027 | int i; | ||
1028 | for(i=0; i<c->maximum; ++i) { | 1027 | for(i=0; i<c->maximum; ++i) { |
1029 | if(framerate_controls[i].value == | 1028 | if(framerate_controls[i].value == |
1030 | CPIA2_VP_FRAMERATE_15) { | 1029 | CPIA2_VP_FRAMERATE_15) { |
@@ -1959,8 +1958,7 @@ int cpia2_register_camera(struct camera_data *cam) | |||
1959 | reset_camera_struct_v4l(cam); | 1958 | reset_camera_struct_v4l(cam); |
1960 | 1959 | ||
1961 | /* register v4l device */ | 1960 | /* register v4l device */ |
1962 | if (video_register_device | 1961 | if (video_register_device(cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
1963 | (cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { | ||
1964 | ERR("video_register_device failed\n"); | 1962 | ERR("video_register_device failed\n"); |
1965 | video_device_release(cam->vdev); | 1963 | video_device_release(cam->vdev); |
1966 | return -ENODEV; | 1964 | return -ENODEV; |
diff --git a/drivers/media/video/cx18/cx18-av-firmware.c b/drivers/media/video/cx18/cx18-av-firmware.c index 834b9248242e..e996a4e3123a 100644 --- a/drivers/media/video/cx18/cx18-av-firmware.c +++ b/drivers/media/video/cx18/cx18-av-firmware.c | |||
@@ -32,7 +32,7 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
32 | u32 v; | 32 | u32 v; |
33 | const u8 *ptr; | 33 | const u8 *ptr; |
34 | int i; | 34 | int i; |
35 | int retries = 0; | 35 | int retries1 = 0; |
36 | 36 | ||
37 | if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) { | 37 | if (request_firmware(&fw, FWFILE, &cx->dev->dev) != 0) { |
38 | CX18_ERR("unable to open firmware %s\n", FWFILE); | 38 | CX18_ERR("unable to open firmware %s\n", FWFILE); |
@@ -41,7 +41,7 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
41 | 41 | ||
42 | /* The firmware load often has byte errors, so allow for several | 42 | /* The firmware load often has byte errors, so allow for several |
43 | retries, both at byte level and at the firmware load level. */ | 43 | retries, both at byte level and at the firmware load level. */ |
44 | while (retries < 5) { | 44 | while (retries1 < 5) { |
45 | cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000); | 45 | cx18_av_write4(cx, CXADEC_CHIP_CTRL, 0x00010000); |
46 | cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6); | 46 | cx18_av_write(cx, CXADEC_STD_DET_CTL, 0xf6); |
47 | 47 | ||
@@ -57,9 +57,9 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
57 | for (i = 0; i < size; i++) { | 57 | for (i = 0; i < size; i++) { |
58 | u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); | 58 | u32 dl_control = 0x0F000000 | i | ((u32)ptr[i] << 16); |
59 | u32 value = 0; | 59 | u32 value = 0; |
60 | int retries; | 60 | int retries2; |
61 | 61 | ||
62 | for (retries = 0; retries < 5; retries++) { | 62 | for (retries2 = 0; retries2 < 5; retries2++) { |
63 | cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); | 63 | cx18_av_write4(cx, CXADEC_DL_CTL, dl_control); |
64 | udelay(10); | 64 | udelay(10); |
65 | value = cx18_av_read4(cx, CXADEC_DL_CTL); | 65 | value = cx18_av_read4(cx, CXADEC_DL_CTL); |
@@ -69,18 +69,18 @@ int cx18_av_loadfw(struct cx18 *cx) | |||
69 | the address. We can only write the lower | 69 | the address. We can only write the lower |
70 | address byte of the address. */ | 70 | address byte of the address. */ |
71 | if ((value & 0x3F00) != (dl_control & 0x3F00)) { | 71 | if ((value & 0x3F00) != (dl_control & 0x3F00)) { |
72 | retries = 5; | 72 | retries2 = 5; |
73 | break; | 73 | break; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | if (retries >= 5) | 76 | if (retries2 >= 5) |
77 | break; | 77 | break; |
78 | } | 78 | } |
79 | if (i == size) | 79 | if (i == size) |
80 | break; | 80 | break; |
81 | retries++; | 81 | retries1++; |
82 | } | 82 | } |
83 | if (retries >= 5) { | 83 | if (retries1 >= 5) { |
84 | CX18_ERR("unable to load firmware %s\n", FWFILE); | 84 | CX18_ERR("unable to load firmware %s\n", FWFILE); |
85 | release_firmware(fw); | 85 | release_firmware(fw); |
86 | return -EIO; | 86 | return -EIO; |
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 22434aadde31..bd18afebbf86 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -74,9 +74,9 @@ static int radio[CX18_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, | |||
74 | -1, -1, -1, -1, -1, -1, -1, -1, | 74 | -1, -1, -1, -1, -1, -1, -1, -1, |
75 | -1, -1, -1, -1, -1, -1, -1, -1 }; | 75 | -1, -1, -1, -1, -1, -1, -1, -1 }; |
76 | 76 | ||
77 | static int cardtype_c = 1; | 77 | static unsigned cardtype_c = 1; |
78 | static int tuner_c = 1; | 78 | static unsigned tuner_c = 1; |
79 | static int radio_c = 1; | 79 | static unsigned radio_c = 1; |
80 | static char pal[] = "--"; | 80 | static char pal[] = "--"; |
81 | static char secam[] = "--"; | 81 | static char secam[] = "--"; |
82 | static char ntsc[] = "-"; | 82 | static char ntsc[] = "-"; |
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index cae38985b131..1e420a804fc9 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * cx18 functions for DVB support | 2 | * cx18 functions for DVB support |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx18/cx18-dvb.h b/drivers/media/video/cx18/cx18-dvb.h index d6a6ccda79a9..bf8d8f6f5455 100644 --- a/drivers/media/video/cx18/cx18-dvb.h +++ b/drivers/media/video/cx18/cx18-dvb.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * cx18 functions for DVB support | 2 | * cx18 functions for DVB support |
3 | * | 3 | * |
4 | * Copyright (c) 2008 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx18/cx18-irq.c b/drivers/media/video/cx18/cx18-irq.c index 25114a5cbd57..ab218315c84b 100644 --- a/drivers/media/video/cx18/cx18-irq.c +++ b/drivers/media/video/cx18/cx18-irq.c | |||
@@ -61,7 +61,7 @@ static void epu_dma_done(struct cx18 *cx, struct cx18_mailbox *mb) | |||
61 | CX18_WARN("Ack struct = %d for %s\n", | 61 | CX18_WARN("Ack struct = %d for %s\n", |
62 | mb->args[2], s->name); | 62 | mb->args[2], s->name); |
63 | id = read_enc(off); | 63 | id = read_enc(off); |
64 | buf = cx18_queue_find_buf(s, id, read_enc(off + 4)); | 64 | buf = cx18_queue_get_buf_irq(s, id, read_enc(off + 4)); |
65 | CX18_DEBUG_HI_DMA("DMA DONE for %s (buffer %d)\n", s->name, id); | 65 | CX18_DEBUG_HI_DMA("DMA DONE for %s (buffer %d)\n", s->name, id); |
66 | if (buf) { | 66 | if (buf) { |
67 | cx18_buf_sync_for_cpu(s, buf); | 67 | cx18_buf_sync_for_cpu(s, buf); |
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index 6990b77c6200..dbe792ac3001 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -78,12 +78,13 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q) | |||
78 | return buf; | 78 | return buf; |
79 | } | 79 | } |
80 | 80 | ||
81 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, | 81 | struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id, |
82 | u32 bytesused) | 82 | u32 bytesused) |
83 | { | 83 | { |
84 | struct cx18 *cx = s->cx; | 84 | struct cx18 *cx = s->cx; |
85 | struct list_head *p; | 85 | struct list_head *p; |
86 | 86 | ||
87 | spin_lock(&s->qlock); | ||
87 | list_for_each(p, &s->q_free.list) { | 88 | list_for_each(p, &s->q_free.list) { |
88 | struct cx18_buffer *buf = | 89 | struct cx18_buffer *buf = |
89 | list_entry(p, struct cx18_buffer, list); | 90 | list_entry(p, struct cx18_buffer, list); |
@@ -92,114 +93,48 @@ struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, | |||
92 | continue; | 93 | continue; |
93 | buf->bytesused = bytesused; | 94 | buf->bytesused = bytesused; |
94 | /* the transport buffers are handled differently, | 95 | /* the transport buffers are handled differently, |
95 | so there is no need to move them to the full queue */ | 96 | they are not moved to the full queue */ |
96 | if (s->type == CX18_ENC_STREAM_TYPE_TS) | 97 | if (s->type != CX18_ENC_STREAM_TYPE_TS) { |
97 | return buf; | 98 | s->q_free.buffers--; |
98 | s->q_free.buffers--; | 99 | s->q_free.length -= s->buf_size; |
99 | s->q_free.length -= s->buf_size; | 100 | s->q_full.buffers++; |
100 | s->q_full.buffers++; | 101 | s->q_full.length += s->buf_size; |
101 | s->q_full.length += s->buf_size; | 102 | s->q_full.bytesused += buf->bytesused; |
102 | s->q_full.bytesused += buf->bytesused; | 103 | list_move_tail(&buf->list, &s->q_full.list); |
103 | list_move_tail(&buf->list, &s->q_full.list); | 104 | } |
105 | spin_unlock(&s->qlock); | ||
104 | return buf; | 106 | return buf; |
105 | } | 107 | } |
108 | spin_unlock(&s->qlock); | ||
106 | CX18_ERR("Cannot find buffer %d for stream %s\n", id, s->name); | 109 | CX18_ERR("Cannot find buffer %d for stream %s\n", id, s->name); |
107 | return NULL; | 110 | return NULL; |
108 | } | 111 | } |
109 | 112 | ||
110 | static void cx18_queue_move_buf(struct cx18_stream *s, struct cx18_queue *from, | 113 | /* Move all buffers of a queue to q_free, while flushing the buffers */ |
111 | struct cx18_queue *to, int clear, int full) | 114 | static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q) |
112 | { | ||
113 | struct cx18_buffer *buf = | ||
114 | list_entry(from->list.next, struct cx18_buffer, list); | ||
115 | |||
116 | list_move_tail(from->list.next, &to->list); | ||
117 | from->buffers--; | ||
118 | from->length -= s->buf_size; | ||
119 | from->bytesused -= buf->bytesused - buf->readpos; | ||
120 | /* special handling for q_free */ | ||
121 | if (clear) | ||
122 | buf->bytesused = buf->readpos = buf->b_flags = 0; | ||
123 | else if (full) { | ||
124 | /* special handling for stolen buffers, assume | ||
125 | all bytes are used. */ | ||
126 | buf->bytesused = s->buf_size; | ||
127 | buf->readpos = buf->b_flags = 0; | ||
128 | } | ||
129 | to->buffers++; | ||
130 | to->length += s->buf_size; | ||
131 | to->bytesused += buf->bytesused - buf->readpos; | ||
132 | } | ||
133 | |||
134 | /* Move 'needed_bytes' worth of buffers from queue 'from' into queue 'to'. | ||
135 | If 'needed_bytes' == 0, then move all buffers from 'from' into 'to'. | ||
136 | If 'steal' != NULL, then buffers may also taken from that queue if | ||
137 | needed. | ||
138 | |||
139 | The buffer is automatically cleared if it goes to the free queue. It is | ||
140 | also cleared if buffers need to be taken from the 'steal' queue and | ||
141 | the 'from' queue is the free queue. | ||
142 | |||
143 | When 'from' is q_free, then needed_bytes is compared to the total | ||
144 | available buffer length, otherwise needed_bytes is compared to the | ||
145 | bytesused value. For the 'steal' queue the total available buffer | ||
146 | length is always used. | ||
147 | |||
148 | -ENOMEM is returned if the buffers could not be obtained, 0 if all | ||
149 | buffers where obtained from the 'from' list and if non-zero then | ||
150 | the number of stolen buffers is returned. */ | ||
151 | static int cx18_queue_move(struct cx18_stream *s, struct cx18_queue *from, | ||
152 | struct cx18_queue *steal, struct cx18_queue *to, | ||
153 | int needed_bytes) | ||
154 | { | 115 | { |
155 | unsigned long flags; | 116 | unsigned long flags; |
156 | int rc = 0; | 117 | struct cx18_buffer *buf; |
157 | int from_free = from == &s->q_free; | ||
158 | int to_free = to == &s->q_free; | ||
159 | int bytes_available; | ||
160 | |||
161 | spin_lock_irqsave(&s->qlock, flags); | ||
162 | if (needed_bytes == 0) { | ||
163 | from_free = 1; | ||
164 | needed_bytes = from->length; | ||
165 | } | ||
166 | |||
167 | bytes_available = from_free ? from->length : from->bytesused; | ||
168 | bytes_available += steal ? steal->length : 0; | ||
169 | 118 | ||
170 | if (bytes_available < needed_bytes) { | 119 | if (q == &s->q_free) |
171 | spin_unlock_irqrestore(&s->qlock, flags); | 120 | return; |
172 | return -ENOMEM; | ||
173 | } | ||
174 | if (from_free) { | ||
175 | u32 old_length = to->length; | ||
176 | 121 | ||
177 | while (to->length - old_length < needed_bytes) { | 122 | spin_lock_irqsave(&s->qlock, flags); |
178 | if (list_empty(&from->list)) | 123 | while (!list_empty(&q->list)) { |
179 | from = steal; | 124 | buf = list_entry(q->list.next, struct cx18_buffer, list); |
180 | if (from == steal) | 125 | list_move_tail(q->list.next, &s->q_free.list); |
181 | rc++; /* keep track of 'stolen' buffers */ | 126 | buf->bytesused = buf->readpos = buf->b_flags = 0; |
182 | cx18_queue_move_buf(s, from, to, 1, 0); | 127 | s->q_free.buffers++; |
183 | } | 128 | s->q_free.length += s->buf_size; |
184 | } else { | ||
185 | u32 old_bytesused = to->bytesused; | ||
186 | |||
187 | while (to->bytesused - old_bytesused < needed_bytes) { | ||
188 | if (list_empty(&from->list)) | ||
189 | from = steal; | ||
190 | if (from == steal) | ||
191 | rc++; /* keep track of 'stolen' buffers */ | ||
192 | cx18_queue_move_buf(s, from, to, to_free, rc); | ||
193 | } | ||
194 | } | 129 | } |
130 | cx18_queue_init(q); | ||
195 | spin_unlock_irqrestore(&s->qlock, flags); | 131 | spin_unlock_irqrestore(&s->qlock, flags); |
196 | return rc; | ||
197 | } | 132 | } |
198 | 133 | ||
199 | void cx18_flush_queues(struct cx18_stream *s) | 134 | void cx18_flush_queues(struct cx18_stream *s) |
200 | { | 135 | { |
201 | cx18_queue_move(s, &s->q_io, NULL, &s->q_free, 0); | 136 | cx18_queue_flush(s, &s->q_io); |
202 | cx18_queue_move(s, &s->q_full, NULL, &s->q_free, 0); | 137 | cx18_queue_flush(s, &s->q_full); |
203 | } | 138 | } |
204 | 139 | ||
205 | int cx18_stream_alloc(struct cx18_stream *s) | 140 | int cx18_stream_alloc(struct cx18_stream *s) |
@@ -214,10 +149,10 @@ int cx18_stream_alloc(struct cx18_stream *s) | |||
214 | s->name, s->buffers, s->buf_size, | 149 | s->name, s->buffers, s->buf_size, |
215 | s->buffers * s->buf_size / 1024); | 150 | s->buffers * s->buf_size / 1024); |
216 | 151 | ||
217 | if (((char *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - | 152 | if (((char __iomem *)&cx->scb->cpu_mdl[cx->mdl_offset + s->buffers] - |
218 | (char *)cx->scb) > SCB_RESERVED_SIZE) { | 153 | (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) { |
219 | unsigned bufsz = (((char *)cx->scb) + SCB_RESERVED_SIZE - | 154 | unsigned bufsz = (((char __iomem *)cx->scb) + SCB_RESERVED_SIZE - |
220 | ((char *)cx->scb->cpu_mdl)); | 155 | ((char __iomem *)cx->scb->cpu_mdl)); |
221 | 156 | ||
222 | CX18_ERR("Too many buffers, cannot fit in SCB area\n"); | 157 | CX18_ERR("Too many buffers, cannot fit in SCB area\n"); |
223 | CX18_ERR("Max buffers = %zd\n", | 158 | CX18_ERR("Max buffers = %zd\n", |
diff --git a/drivers/media/video/cx18/cx18-queue.h b/drivers/media/video/cx18/cx18-queue.h index 91423b9863a4..7f93bb13c09f 100644 --- a/drivers/media/video/cx18/cx18-queue.h +++ b/drivers/media/video/cx18/cx18-queue.h | |||
@@ -46,7 +46,7 @@ void cx18_queue_init(struct cx18_queue *q); | |||
46 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, | 46 | void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, |
47 | struct cx18_queue *q); | 47 | struct cx18_queue *q); |
48 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); | 48 | struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); |
49 | struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id, | 49 | struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id, |
50 | u32 bytesused); | 50 | u32 bytesused); |
51 | void cx18_flush_queues(struct cx18_stream *s); | 51 | void cx18_flush_queues(struct cx18_stream *s); |
52 | 52 | ||
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index 8118091568fc..7b0e8c01692e 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * (c) 2004 Jelle Foks <jelle@foks.8m.com> | 5 | * (c) 2004 Jelle Foks <jelle@foks.8m.com> |
6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> | 6 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> |
7 | * (c) 2008 Steven Toth <stoth@hauppauge.com> | 7 | * (c) 2008 Steven Toth <stoth@linuxtv.org> |
8 | * - CX23885/7/8 support | 8 | * - CX23885/7/8 support |
9 | * | 9 | * |
10 | * Includes parts from the ivtv driver( http://ivtv.sourceforge.net/), | 10 | * Includes parts from the ivtv driver( http://ivtv.sourceforge.net/), |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index a19de850955d..c36d3f632104 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 6286a9cf957e..25fb09938744 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -33,7 +33,7 @@ | |||
33 | #include "cx23885.h" | 33 | #include "cx23885.h" |
34 | 34 | ||
35 | MODULE_DESCRIPTION("Driver for cx23885 based TV cards"); | 35 | MODULE_DESCRIPTION("Driver for cx23885 based TV cards"); |
36 | MODULE_AUTHOR("Steven Toth <stoth@hauppauge.com>"); | 36 | MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); |
37 | MODULE_LICENSE("GPL"); | 37 | MODULE_LICENSE("GPL"); |
38 | 38 | ||
39 | static unsigned int debug; | 39 | static unsigned int debug; |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 0a2e6558cd66..291b9d008da8 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx23885/cx23885-i2c.c b/drivers/media/video/cx23885/cx23885-i2c.c index c6bb0a05bc1c..f98e476e9617 100644 --- a/drivers/media/video/cx23885/cx23885-i2c.c +++ b/drivers/media/video/cx23885/cx23885-i2c.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx23885/cx23885-reg.h b/drivers/media/video/cx23885/cx23885-reg.h index bdd11bc513ad..20b68a236260 100644 --- a/drivers/media/video/cx23885/cx23885-reg.h +++ b/drivers/media/video/cx23885/cx23885-reg.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx23885/cx23885-vbi.c b/drivers/media/video/cx23885/cx23885-vbi.c index e36e3fcae2fb..35e61cd112fc 100644 --- a/drivers/media/video/cx23885/cx23885-vbi.c +++ b/drivers/media/video/cx23885/cx23885-vbi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index ad2235dab5b1..6047c78d84bf 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2007 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
@@ -41,7 +41,7 @@ | |||
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards"); | 43 | MODULE_DESCRIPTION("v4l2 driver module for cx23885 based TV cards"); |
44 | MODULE_AUTHOR("Steven Toth <stoth@hauppauge.com>"); | 44 | MODULE_AUTHOR("Steven Toth <stoth@linuxtv.org>"); |
45 | MODULE_LICENSE("GPL"); | 45 | MODULE_LICENSE("GPL"); |
46 | 46 | ||
47 | /* ------------------------------------------------------------------ */ | 47 | /* ------------------------------------------------------------------ */ |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index 00dfdc89d641..e23d97c071e0 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Driver for the Conexant CX23885 PCIe bridge | 2 | * Driver for the Conexant CX23885 PCIe bridge |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Steven Toth <stoth@hauppauge.com> | 4 | * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org> |
5 | * | 5 | * |
6 | * 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 |
7 | * 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 |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 209d3bcb5dbb..4da8cd74f00e 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * NTSC sliced VBI support by Christopher Neufeld <television@cneufeld.ca> | 13 | * NTSC sliced VBI support by Christopher Neufeld <television@cneufeld.ca> |
14 | * with additional fixes by Hans Verkuil <hverkuil@xs4all.nl>. | 14 | * with additional fixes by Hans Verkuil <hverkuil@xs4all.nl>. |
15 | * | 15 | * |
16 | * CX23885 support by Steven Toth <stoth@hauppauge.com>. | 16 | * CX23885 support by Steven Toth <stoth@linuxtv.org>. |
17 | * | 17 | * |
18 | * This program is free software; you can redistribute it and/or | 18 | * This program is free software; you can redistribute it and/or |
19 | * modify it under the terms of the GNU General Public License | 19 | * modify it under the terms of the GNU General Public License |
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index 48f4b92a8f8b..79faedf58521 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c | |||
@@ -403,6 +403,7 @@ static int dabusb_fpga_download (pdabusb_t s, const char *fname) | |||
403 | ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev); | 403 | ret = request_firmware(&fw, "dabusb/bitstream.bin", &s->usbdev->dev); |
404 | if (ret) { | 404 | if (ret) { |
405 | err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret); | 405 | err("Failed to load \"dabusb/bitstream.bin\": %d\n", ret); |
406 | kfree(b); | ||
406 | return ret; | 407 | return ret; |
407 | } | 408 | } |
408 | 409 | ||
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index 2d170d101c21..8db2a05bf9c5 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -2588,6 +2588,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
2588 | cam->v4ldev->fops = &et61x251_fops; | 2588 | cam->v4ldev->fops = &et61x251_fops; |
2589 | cam->v4ldev->minor = video_nr[dev_nr]; | 2589 | cam->v4ldev->minor = video_nr[dev_nr]; |
2590 | cam->v4ldev->release = video_device_release; | 2590 | cam->v4ldev->release = video_device_release; |
2591 | cam->v4ldev->parent = &udev->dev; | ||
2591 | video_set_drvdata(cam->v4ldev, cam); | 2592 | video_set_drvdata(cam->v4ldev, cam); |
2592 | 2593 | ||
2593 | init_completion(&cam->probe); | 2594 | init_completion(&cam->probe); |
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c index cd3a3f5829b2..4d9f4cc255a9 100644 --- a/drivers/media/video/gspca/conex.c +++ b/drivers/media/video/gspca/conex.c | |||
@@ -124,7 +124,7 @@ static void reg_r(struct gspca_dev *gspca_dev, | |||
124 | struct usb_device *dev = gspca_dev->dev; | 124 | struct usb_device *dev = gspca_dev->dev; |
125 | 125 | ||
126 | #ifdef GSPCA_DEBUG | 126 | #ifdef GSPCA_DEBUG |
127 | if (len > sizeof gspca_dev->usb_buf) { | 127 | if (len > USB_BUF_SZ) { |
128 | err("reg_r: buffer overflow"); | 128 | err("reg_r: buffer overflow"); |
129 | return; | 129 | return; |
130 | } | 130 | } |
@@ -164,7 +164,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
164 | struct usb_device *dev = gspca_dev->dev; | 164 | struct usb_device *dev = gspca_dev->dev; |
165 | 165 | ||
166 | #ifdef GSPCA_DEBUG | 166 | #ifdef GSPCA_DEBUG |
167 | if (len > sizeof gspca_dev->usb_buf) { | 167 | if (len > USB_BUF_SZ) { |
168 | err("reg_w: buffer overflow"); | 168 | err("reg_w: buffer overflow"); |
169 | return; | 169 | return; |
170 | } | 170 | } |
@@ -731,13 +731,13 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev) | |||
731 | reg_w_val(gspca_dev, 0x0000, 0x00); | 731 | reg_w_val(gspca_dev, 0x0000, 0x00); |
732 | /* wait for completion */ | 732 | /* wait for completion */ |
733 | retry = 50; | 733 | retry = 50; |
734 | while (retry--) { | 734 | do { |
735 | reg_r(gspca_dev, 0x0002, 1); | 735 | reg_r(gspca_dev, 0x0002, 1); |
736 | /* 0x07 until 0x00 */ | 736 | /* 0x07 until 0x00 */ |
737 | if (gspca_dev->usb_buf[0] == 0x00) | 737 | if (gspca_dev->usb_buf[0] == 0x00) |
738 | break; | 738 | break; |
739 | reg_w_val(gspca_dev, 0x0053, 0x00); | 739 | reg_w_val(gspca_dev, 0x0053, 0x00); |
740 | } | 740 | } while (--retry); |
741 | if (retry == 0) | 741 | if (retry == 0) |
742 | PDEBUG(D_ERR, "Damned Errors sending jpeg Table"); | 742 | PDEBUG(D_ERR, "Damned Errors sending jpeg Table"); |
743 | /* send the qtable now */ | 743 | /* send the qtable now */ |
@@ -826,8 +826,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
826 | return 0; | 826 | return 0; |
827 | } | 827 | } |
828 | 828 | ||
829 | /* this function is called at open time */ | 829 | /* this function is called at probe and resume time */ |
830 | static int sd_open(struct gspca_dev *gspca_dev) | 830 | static int sd_init(struct gspca_dev *gspca_dev) |
831 | { | 831 | { |
832 | cx11646_init1(gspca_dev); | 832 | cx11646_init1(gspca_dev); |
833 | cx11646_initsize(gspca_dev); | 833 | cx11646_initsize(gspca_dev); |
@@ -845,10 +845,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
845 | cx11646_jpeg(gspca_dev); | 845 | cx11646_jpeg(gspca_dev); |
846 | } | 846 | } |
847 | 847 | ||
848 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
849 | { | ||
850 | } | ||
851 | |||
852 | static void sd_stop0(struct gspca_dev *gspca_dev) | 848 | static void sd_stop0(struct gspca_dev *gspca_dev) |
853 | { | 849 | { |
854 | int retry = 50; | 850 | int retry = 50; |
@@ -871,10 +867,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
871 | reg_w_val(gspca_dev, 0x00fc, 0xe0); | 867 | reg_w_val(gspca_dev, 0x00fc, 0xe0); |
872 | } | 868 | } |
873 | 869 | ||
874 | static void sd_close(struct gspca_dev *gspca_dev) | ||
875 | { | ||
876 | } | ||
877 | |||
878 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 870 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
879 | struct gspca_frame *frame, /* target */ | 871 | struct gspca_frame *frame, /* target */ |
880 | __u8 *data, /* isoc packet */ | 872 | __u8 *data, /* isoc packet */ |
@@ -998,11 +990,9 @@ static struct sd_desc sd_desc = { | |||
998 | .ctrls = sd_ctrls, | 990 | .ctrls = sd_ctrls, |
999 | .nctrls = ARRAY_SIZE(sd_ctrls), | 991 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1000 | .config = sd_config, | 992 | .config = sd_config, |
1001 | .open = sd_open, | 993 | .init = sd_init, |
1002 | .start = sd_start, | 994 | .start = sd_start, |
1003 | .stopN = sd_stopN, | ||
1004 | .stop0 = sd_stop0, | 995 | .stop0 = sd_stop0, |
1005 | .close = sd_close, | ||
1006 | .pkt_scan = sd_pkt_scan, | 996 | .pkt_scan = sd_pkt_scan, |
1007 | }; | 997 | }; |
1008 | 998 | ||
@@ -1026,6 +1016,10 @@ static struct usb_driver sd_driver = { | |||
1026 | .id_table = device_table, | 1016 | .id_table = device_table, |
1027 | .probe = sd_probe, | 1017 | .probe = sd_probe, |
1028 | .disconnect = gspca_disconnect, | 1018 | .disconnect = gspca_disconnect, |
1019 | #ifdef CONFIG_PM | ||
1020 | .suspend = gspca_suspend, | ||
1021 | .resume = gspca_resume, | ||
1022 | #endif | ||
1029 | }; | 1023 | }; |
1030 | 1024 | ||
1031 | /* -- module insert / remove -- */ | 1025 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c index 1dbe92d01e6a..4ff0e386914b 100644 --- a/drivers/media/video/gspca/etoms.c +++ b/drivers/media/video/gspca/etoms.c | |||
@@ -81,6 +81,7 @@ static struct ctrl sd_ctrls[] = { | |||
81 | .set = sd_setcontrast, | 81 | .set = sd_setcontrast, |
82 | .get = sd_getcontrast, | 82 | .get = sd_getcontrast, |
83 | }, | 83 | }, |
84 | #define COLOR_IDX 2 | ||
84 | { | 85 | { |
85 | { | 86 | { |
86 | .id = V4L2_CID_SATURATION, | 87 | .id = V4L2_CID_SATURATION, |
@@ -234,7 +235,7 @@ static void reg_r(struct gspca_dev *gspca_dev, | |||
234 | struct usb_device *dev = gspca_dev->dev; | 235 | struct usb_device *dev = gspca_dev->dev; |
235 | 236 | ||
236 | #ifdef GSPCA_DEBUG | 237 | #ifdef GSPCA_DEBUG |
237 | if (len > sizeof gspca_dev->usb_buf) { | 238 | if (len > USB_BUF_SZ) { |
238 | err("reg_r: buffer overflow"); | 239 | err("reg_r: buffer overflow"); |
239 | return; | 240 | return; |
240 | } | 241 | } |
@@ -272,7 +273,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
272 | struct usb_device *dev = gspca_dev->dev; | 273 | struct usb_device *dev = gspca_dev->dev; |
273 | 274 | ||
274 | #ifdef GSPCA_DEBUG | 275 | #ifdef GSPCA_DEBUG |
275 | if (len > sizeof gspca_dev->usb_buf) { | 276 | if (len > USB_BUF_SZ) { |
276 | err("reg_w: buffer overflow"); | 277 | err("reg_w: buffer overflow"); |
277 | return; | 278 | return; |
278 | } | 279 | } |
@@ -665,6 +666,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
665 | } else { | 666 | } else { |
666 | cam->cam_mode = vga_mode; | 667 | cam->cam_mode = vga_mode; |
667 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; | 668 | cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; |
669 | gspca_dev->ctrl_dis = (1 << COLOR_IDX); | ||
668 | } | 670 | } |
669 | sd->brightness = BRIGHTNESS_DEF; | 671 | sd->brightness = BRIGHTNESS_DEF; |
670 | sd->contrast = CONTRAST_DEF; | 672 | sd->contrast = CONTRAST_DEF; |
@@ -674,8 +676,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
674 | return 0; | 676 | return 0; |
675 | } | 677 | } |
676 | 678 | ||
677 | /* this function is called at open time */ | 679 | /* this function is called at probe and resume time */ |
678 | static int sd_open(struct gspca_dev *gspca_dev) | 680 | static int sd_init(struct gspca_dev *gspca_dev) |
679 | { | 681 | { |
680 | struct sd *sd = (struct sd *) gspca_dev; | 682 | struct sd *sd = (struct sd *) gspca_dev; |
681 | 683 | ||
@@ -709,14 +711,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
709 | et_video(gspca_dev, 0); /* video off */ | 711 | et_video(gspca_dev, 0); /* video off */ |
710 | } | 712 | } |
711 | 713 | ||
712 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
713 | { | ||
714 | } | ||
715 | |||
716 | static void sd_close(struct gspca_dev *gspca_dev) | ||
717 | { | ||
718 | } | ||
719 | |||
720 | static __u8 Et_getgainG(struct gspca_dev *gspca_dev) | 714 | static __u8 Et_getgainG(struct gspca_dev *gspca_dev) |
721 | { | 715 | { |
722 | struct sd *sd = (struct sd *) gspca_dev; | 716 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -893,21 +887,19 @@ static struct sd_desc sd_desc = { | |||
893 | .ctrls = sd_ctrls, | 887 | .ctrls = sd_ctrls, |
894 | .nctrls = ARRAY_SIZE(sd_ctrls), | 888 | .nctrls = ARRAY_SIZE(sd_ctrls), |
895 | .config = sd_config, | 889 | .config = sd_config, |
896 | .open = sd_open, | 890 | .init = sd_init, |
897 | .start = sd_start, | 891 | .start = sd_start, |
898 | .stopN = sd_stopN, | 892 | .stopN = sd_stopN, |
899 | .stop0 = sd_stop0, | ||
900 | .close = sd_close, | ||
901 | .pkt_scan = sd_pkt_scan, | 893 | .pkt_scan = sd_pkt_scan, |
902 | .dq_callback = do_autogain, | 894 | .dq_callback = do_autogain, |
903 | }; | 895 | }; |
904 | 896 | ||
905 | /* -- module initialisation -- */ | 897 | /* -- module initialisation -- */ |
906 | static __devinitdata struct usb_device_id device_table[] = { | 898 | static __devinitdata struct usb_device_id device_table[] = { |
907 | #ifndef CONFIG_USB_ET61X251 | ||
908 | {USB_DEVICE(0x102c, 0x6151), .driver_info = SENSOR_PAS106}, | 899 | {USB_DEVICE(0x102c, 0x6151), .driver_info = SENSOR_PAS106}, |
909 | #endif | 900 | #if !defined CONFIG_USB_ET61X251 && !defined CONFIG_USB_ET61X251_MODULE |
910 | {USB_DEVICE(0x102c, 0x6251), .driver_info = SENSOR_TAS5130CXX}, | 901 | {USB_DEVICE(0x102c, 0x6251), .driver_info = SENSOR_TAS5130CXX}, |
902 | #endif | ||
911 | {} | 903 | {} |
912 | }; | 904 | }; |
913 | 905 | ||
@@ -926,6 +918,10 @@ static struct usb_driver sd_driver = { | |||
926 | .id_table = device_table, | 918 | .id_table = device_table, |
927 | .probe = sd_probe, | 919 | .probe = sd_probe, |
928 | .disconnect = gspca_disconnect, | 920 | .disconnect = gspca_disconnect, |
921 | #ifdef CONFIG_PM | ||
922 | .suspend = gspca_suspend, | ||
923 | .resume = gspca_resume, | ||
924 | #endif | ||
929 | }; | 925 | }; |
930 | 926 | ||
931 | /* -- module insert / remove -- */ | 927 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 15d302b28b79..7be69284da03 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -114,7 +114,10 @@ static void fill_frame(struct gspca_dev *gspca_dev, | |||
114 | cam_pkt_op pkt_scan; | 114 | cam_pkt_op pkt_scan; |
115 | 115 | ||
116 | if (urb->status != 0) { | 116 | if (urb->status != 0) { |
117 | PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status); | 117 | #ifdef CONFIG_PM |
118 | if (!gspca_dev->frozen) | ||
119 | #endif | ||
120 | PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status); | ||
118 | return; /* disconnection ? */ | 121 | return; /* disconnection ? */ |
119 | } | 122 | } |
120 | pkt_scan = gspca_dev->sd_desc->pkt_scan; | 123 | pkt_scan = gspca_dev->sd_desc->pkt_scan; |
@@ -555,10 +558,12 @@ static void gspca_stream_off(struct gspca_dev *gspca_dev) | |||
555 | gspca_dev->streaming = 0; | 558 | gspca_dev->streaming = 0; |
556 | atomic_set(&gspca_dev->nevent, 0); | 559 | atomic_set(&gspca_dev->nevent, 0); |
557 | if (gspca_dev->present) { | 560 | if (gspca_dev->present) { |
558 | gspca_dev->sd_desc->stopN(gspca_dev); | 561 | if (gspca_dev->sd_desc->stopN) |
562 | gspca_dev->sd_desc->stopN(gspca_dev); | ||
559 | destroy_urbs(gspca_dev); | 563 | destroy_urbs(gspca_dev); |
560 | gspca_set_alt0(gspca_dev); | 564 | gspca_set_alt0(gspca_dev); |
561 | gspca_dev->sd_desc->stop0(gspca_dev); | 565 | if (gspca_dev->sd_desc->stop0) |
566 | gspca_dev->sd_desc->stop0(gspca_dev); | ||
562 | PDEBUG(D_STREAM, "stream off OK"); | 567 | PDEBUG(D_STREAM, "stream off OK"); |
563 | } | 568 | } |
564 | } | 569 | } |
@@ -767,19 +772,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
767 | goto out; | 772 | goto out; |
768 | } | 773 | } |
769 | 774 | ||
770 | /* if not done yet, initialize the sensor */ | 775 | if (gspca_dev->users > 4) { /* (arbitrary value) */ |
771 | if (gspca_dev->users == 0) { | ||
772 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) { | ||
773 | ret = -ERESTARTSYS; | ||
774 | goto out; | ||
775 | } | ||
776 | ret = gspca_dev->sd_desc->open(gspca_dev); | ||
777 | mutex_unlock(&gspca_dev->usb_lock); | ||
778 | if (ret != 0) { | ||
779 | PDEBUG(D_ERR|D_CONF, "init device failed %d", ret); | ||
780 | goto out; | ||
781 | } | ||
782 | } else if (gspca_dev->users > 4) { /* (arbitrary value) */ | ||
783 | ret = -EBUSY; | 776 | ret = -EBUSY; |
784 | goto out; | 777 | goto out; |
785 | } | 778 | } |
@@ -792,6 +785,7 @@ static int dev_open(struct inode *inode, struct file *file) | |||
792 | else | 785 | else |
793 | gspca_dev->vdev.debug &= ~3; | 786 | gspca_dev->vdev.debug &= ~3; |
794 | #endif | 787 | #endif |
788 | ret = 0; | ||
795 | out: | 789 | out: |
796 | mutex_unlock(&gspca_dev->queue_lock); | 790 | mutex_unlock(&gspca_dev->queue_lock); |
797 | if (ret != 0) | 791 | if (ret != 0) |
@@ -812,11 +806,11 @@ static int dev_close(struct inode *inode, struct file *file) | |||
812 | 806 | ||
813 | /* if the file did the capture, free the streaming resources */ | 807 | /* if the file did the capture, free the streaming resources */ |
814 | if (gspca_dev->capt_file == file) { | 808 | if (gspca_dev->capt_file == file) { |
815 | mutex_lock(&gspca_dev->usb_lock); | 809 | if (gspca_dev->streaming) { |
816 | if (gspca_dev->streaming) | 810 | mutex_lock(&gspca_dev->usb_lock); |
817 | gspca_stream_off(gspca_dev); | 811 | gspca_stream_off(gspca_dev); |
818 | gspca_dev->sd_desc->close(gspca_dev); | 812 | mutex_unlock(&gspca_dev->usb_lock); |
819 | mutex_unlock(&gspca_dev->usb_lock); | 813 | } |
820 | frame_free(gspca_dev); | 814 | frame_free(gspca_dev); |
821 | gspca_dev->capt_file = NULL; | 815 | gspca_dev->capt_file = NULL; |
822 | gspca_dev->memory = GSPCA_MEMORY_NO; | 816 | gspca_dev->memory = GSPCA_MEMORY_NO; |
@@ -853,42 +847,44 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
853 | return 0; | 847 | return 0; |
854 | } | 848 | } |
855 | 849 | ||
856 | /* the use of V4L2_CTRL_FLAG_NEXT_CTRL asks for the controls to be sorted */ | ||
857 | static int vidioc_queryctrl(struct file *file, void *priv, | 850 | static int vidioc_queryctrl(struct file *file, void *priv, |
858 | struct v4l2_queryctrl *q_ctrl) | 851 | struct v4l2_queryctrl *q_ctrl) |
859 | { | 852 | { |
860 | struct gspca_dev *gspca_dev = priv; | 853 | struct gspca_dev *gspca_dev = priv; |
861 | int i; | 854 | int i, ix; |
862 | u32 id; | 855 | u32 id; |
863 | 856 | ||
857 | ix = -1; | ||
864 | id = q_ctrl->id; | 858 | id = q_ctrl->id; |
865 | if (id & V4L2_CTRL_FLAG_NEXT_CTRL) { | 859 | if (id & V4L2_CTRL_FLAG_NEXT_CTRL) { |
866 | id &= V4L2_CTRL_ID_MASK; | 860 | id &= V4L2_CTRL_ID_MASK; |
867 | id++; | 861 | id++; |
868 | for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) { | 862 | for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) { |
869 | if (id >= gspca_dev->sd_desc->ctrls[i].qctrl.id) { | 863 | if (gspca_dev->sd_desc->ctrls[i].qctrl.id < id) |
870 | memcpy(q_ctrl, | 864 | continue; |
871 | &gspca_dev->sd_desc->ctrls[i].qctrl, | 865 | if (ix < 0) { |
872 | sizeof *q_ctrl); | 866 | ix = i; |
873 | return 0; | 867 | continue; |
874 | } | 868 | } |
869 | if (gspca_dev->sd_desc->ctrls[i].qctrl.id | ||
870 | > gspca_dev->sd_desc->ctrls[ix].qctrl.id) | ||
871 | continue; | ||
872 | ix = i; | ||
875 | } | 873 | } |
876 | return -EINVAL; | ||
877 | } | 874 | } |
878 | for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) { | 875 | for (i = 0; i < gspca_dev->sd_desc->nctrls; i++) { |
879 | if (id == gspca_dev->sd_desc->ctrls[i].qctrl.id) { | 876 | if (id == gspca_dev->sd_desc->ctrls[i].qctrl.id) { |
880 | memcpy(q_ctrl, | 877 | ix = i; |
881 | &gspca_dev->sd_desc->ctrls[i].qctrl, | 878 | break; |
882 | sizeof *q_ctrl); | ||
883 | return 0; | ||
884 | } | 879 | } |
885 | } | 880 | } |
886 | if (id >= V4L2_CID_BASE | 881 | if (ix < 0) |
887 | && id <= V4L2_CID_LASTP1) { | 882 | return -EINVAL; |
883 | memcpy(q_ctrl, &gspca_dev->sd_desc->ctrls[ix].qctrl, | ||
884 | sizeof *q_ctrl); | ||
885 | if (gspca_dev->ctrl_dis & (1 << ix)) | ||
888 | q_ctrl->flags |= V4L2_CTRL_FLAG_DISABLED; | 886 | q_ctrl->flags |= V4L2_CTRL_FLAG_DISABLED; |
889 | return 0; | 887 | return 0; |
890 | } | ||
891 | return -EINVAL; | ||
892 | } | 888 | } |
893 | 889 | ||
894 | static int vidioc_s_ctrl(struct file *file, void *priv, | 890 | static int vidioc_s_ctrl(struct file *file, void *priv, |
@@ -903,6 +899,8 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
903 | i++, ctrls++) { | 899 | i++, ctrls++) { |
904 | if (ctrl->id != ctrls->qctrl.id) | 900 | if (ctrl->id != ctrls->qctrl.id) |
905 | continue; | 901 | continue; |
902 | if (gspca_dev->ctrl_dis & (1 << i)) | ||
903 | return -EINVAL; | ||
906 | if (ctrl->value < ctrls->qctrl.minimum | 904 | if (ctrl->value < ctrls->qctrl.minimum |
907 | || ctrl->value > ctrls->qctrl.maximum) | 905 | || ctrl->value > ctrls->qctrl.maximum) |
908 | return -ERANGE; | 906 | return -ERANGE; |
@@ -929,6 +927,8 @@ static int vidioc_g_ctrl(struct file *file, void *priv, | |||
929 | i++, ctrls++) { | 927 | i++, ctrls++) { |
930 | if (ctrl->id != ctrls->qctrl.id) | 928 | if (ctrl->id != ctrls->qctrl.id) |
931 | continue; | 929 | continue; |
930 | if (gspca_dev->ctrl_dis & (1 << i)) | ||
931 | return -EINVAL; | ||
932 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) | 932 | if (mutex_lock_interruptible(&gspca_dev->usb_lock)) |
933 | return -ERESTARTSYS; | 933 | return -ERESTARTSYS; |
934 | ret = ctrls->get(gspca_dev, &ctrl->value); | 934 | ret = ctrls->get(gspca_dev, &ctrl->value); |
@@ -1403,7 +1403,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, | |||
1403 | i = ret; /* frame index */ | 1403 | i = ret; /* frame index */ |
1404 | frame = &gspca_dev->frame[i]; | 1404 | frame = &gspca_dev->frame[i]; |
1405 | if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { | 1405 | if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { |
1406 | if (copy_to_user((__u8 *) frame->v4l2_buf.m.userptr, | 1406 | if (copy_to_user((__u8 __user *) frame->v4l2_buf.m.userptr, |
1407 | frame->data, | 1407 | frame->data, |
1408 | frame->v4l2_buf.bytesused)) { | 1408 | frame->v4l2_buf.bytesused)) { |
1409 | PDEBUG(D_ERR|D_STREAM, | 1409 | PDEBUG(D_ERR|D_STREAM, |
@@ -1731,6 +1731,12 @@ int gspca_dev_probe(struct usb_interface *intf, | |||
1731 | err("couldn't kzalloc gspca struct"); | 1731 | err("couldn't kzalloc gspca struct"); |
1732 | return -EIO; | 1732 | return -EIO; |
1733 | } | 1733 | } |
1734 | gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL); | ||
1735 | if (!gspca_dev->usb_buf) { | ||
1736 | err("out of memory"); | ||
1737 | ret = -EIO; | ||
1738 | goto out; | ||
1739 | } | ||
1734 | gspca_dev->dev = dev; | 1740 | gspca_dev->dev = dev; |
1735 | gspca_dev->iface = interface->bInterfaceNumber; | 1741 | gspca_dev->iface = interface->bInterfaceNumber; |
1736 | gspca_dev->nbalt = intf->num_altsetting; | 1742 | gspca_dev->nbalt = intf->num_altsetting; |
@@ -1738,10 +1744,13 @@ int gspca_dev_probe(struct usb_interface *intf, | |||
1738 | /* gspca_dev->users = 0; (done by kzalloc) */ | 1744 | /* gspca_dev->users = 0; (done by kzalloc) */ |
1739 | gspca_dev->nbufread = 2; | 1745 | gspca_dev->nbufread = 2; |
1740 | 1746 | ||
1741 | /* configure the subdriver */ | 1747 | /* configure the subdriver and initialize the USB device */ |
1742 | ret = gspca_dev->sd_desc->config(gspca_dev, id); | 1748 | ret = gspca_dev->sd_desc->config(gspca_dev, id); |
1743 | if (ret < 0) | 1749 | if (ret < 0) |
1744 | goto out; | 1750 | goto out; |
1751 | ret = gspca_dev->sd_desc->init(gspca_dev); | ||
1752 | if (ret < 0) | ||
1753 | goto out; | ||
1745 | ret = gspca_set_alt0(gspca_dev); | 1754 | ret = gspca_set_alt0(gspca_dev); |
1746 | if (ret < 0) | 1755 | if (ret < 0) |
1747 | goto out; | 1756 | goto out; |
@@ -1771,6 +1780,7 @@ int gspca_dev_probe(struct usb_interface *intf, | |||
1771 | PDEBUG(D_PROBE, "probe ok"); | 1780 | PDEBUG(D_PROBE, "probe ok"); |
1772 | return 0; | 1781 | return 0; |
1773 | out: | 1782 | out: |
1783 | kfree(gspca_dev->usb_buf); | ||
1774 | kfree(gspca_dev); | 1784 | kfree(gspca_dev); |
1775 | return ret; | 1785 | return ret; |
1776 | } | 1786 | } |
@@ -1803,11 +1813,42 @@ void gspca_disconnect(struct usb_interface *intf) | |||
1803 | /* We don't want people trying to open up the device */ | 1813 | /* We don't want people trying to open up the device */ |
1804 | video_unregister_device(&gspca_dev->vdev); | 1814 | video_unregister_device(&gspca_dev->vdev); |
1805 | /* Free the memory */ | 1815 | /* Free the memory */ |
1816 | kfree(gspca_dev->usb_buf); | ||
1806 | kfree(gspca_dev); | 1817 | kfree(gspca_dev); |
1807 | PDEBUG(D_PROBE, "disconnect complete"); | 1818 | PDEBUG(D_PROBE, "disconnect complete"); |
1808 | } | 1819 | } |
1809 | EXPORT_SYMBOL(gspca_disconnect); | 1820 | EXPORT_SYMBOL(gspca_disconnect); |
1810 | 1821 | ||
1822 | #ifdef CONFIG_PM | ||
1823 | int gspca_suspend(struct usb_interface *intf, pm_message_t message) | ||
1824 | { | ||
1825 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | ||
1826 | |||
1827 | if (!gspca_dev->streaming) | ||
1828 | return 0; | ||
1829 | gspca_dev->frozen = 1; /* avoid urb error messages */ | ||
1830 | if (gspca_dev->sd_desc->stopN) | ||
1831 | gspca_dev->sd_desc->stopN(gspca_dev); | ||
1832 | destroy_urbs(gspca_dev); | ||
1833 | gspca_set_alt0(gspca_dev); | ||
1834 | if (gspca_dev->sd_desc->stop0) | ||
1835 | gspca_dev->sd_desc->stop0(gspca_dev); | ||
1836 | return 0; | ||
1837 | } | ||
1838 | EXPORT_SYMBOL(gspca_suspend); | ||
1839 | |||
1840 | int gspca_resume(struct usb_interface *intf) | ||
1841 | { | ||
1842 | struct gspca_dev *gspca_dev = usb_get_intfdata(intf); | ||
1843 | |||
1844 | gspca_dev->frozen = 0; | ||
1845 | gspca_dev->sd_desc->init(gspca_dev); | ||
1846 | if (gspca_dev->streaming) | ||
1847 | return gspca_init_transfer(gspca_dev); | ||
1848 | return 0; | ||
1849 | } | ||
1850 | EXPORT_SYMBOL(gspca_resume); | ||
1851 | #endif | ||
1811 | /* -- cam driver utility functions -- */ | 1852 | /* -- cam driver utility functions -- */ |
1812 | 1853 | ||
1813 | /* auto gain and exposure algorithm based on the knee algorithm described here: | 1854 | /* auto gain and exposure algorithm based on the knee algorithm described here: |
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index 67e448940eaa..c17625cff9ba 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -56,7 +56,6 @@ extern int gspca_debug; | |||
56 | 56 | ||
57 | /* device information - set at probe time */ | 57 | /* device information - set at probe time */ |
58 | struct cam { | 58 | struct cam { |
59 | char *dev_name; | ||
60 | struct v4l2_pix_format *cam_mode; /* size nmodes */ | 59 | struct v4l2_pix_format *cam_mode; /* size nmodes */ |
61 | char nmodes; | 60 | char nmodes; |
62 | __u8 epaddr; | 61 | __u8 epaddr; |
@@ -91,15 +90,14 @@ struct sd_desc { | |||
91 | /* controls */ | 90 | /* controls */ |
92 | const struct ctrl *ctrls; | 91 | const struct ctrl *ctrls; |
93 | int nctrls; | 92 | int nctrls; |
94 | /* operations */ | 93 | /* mandatory operations */ |
95 | cam_cf_op config; /* called on probe */ | 94 | cam_cf_op config; /* called on probe */ |
96 | cam_op open; /* called on open */ | 95 | cam_op init; /* called on probe and resume */ |
97 | cam_v_op start; /* called on stream on */ | 96 | cam_v_op start; /* called on stream on */ |
98 | cam_v_op stopN; /* called on stream off - main alt */ | ||
99 | cam_v_op stop0; /* called on stream off - alt 0 */ | ||
100 | cam_v_op close; /* called on close */ | ||
101 | cam_pkt_op pkt_scan; | 97 | cam_pkt_op pkt_scan; |
102 | /* optional operations */ | 98 | /* optional operations */ |
99 | cam_v_op stopN; /* called on stream off - main alt */ | ||
100 | cam_v_op stop0; /* called on stream off - alt 0 */ | ||
103 | cam_v_op dq_callback; /* called when a frame has been dequeued */ | 101 | cam_v_op dq_callback; /* called when a frame has been dequeued */ |
104 | cam_jpg_op get_jcomp; | 102 | cam_jpg_op get_jcomp; |
105 | cam_jpg_op set_jcomp; | 103 | cam_jpg_op set_jcomp; |
@@ -127,8 +125,10 @@ struct gspca_dev { | |||
127 | 125 | ||
128 | struct cam cam; /* device information */ | 126 | struct cam cam; /* device information */ |
129 | const struct sd_desc *sd_desc; /* subdriver description */ | 127 | const struct sd_desc *sd_desc; /* subdriver description */ |
128 | unsigned ctrl_dis; /* disabled controls (bit map) */ | ||
130 | 129 | ||
131 | __u8 usb_buf[8]; /* buffer for USB exchanges */ | 130 | #define USB_BUF_SZ 64 |
131 | __u8 *usb_buf; /* buffer for USB exchanges */ | ||
132 | struct urb *urb[MAX_NURBS]; | 132 | struct urb *urb[MAX_NURBS]; |
133 | 133 | ||
134 | __u8 *frbuf; /* buffer for nframes */ | 134 | __u8 *frbuf; /* buffer for nframes */ |
@@ -155,6 +155,9 @@ struct gspca_dev { | |||
155 | struct mutex queue_lock; /* ISOC queue protection */ | 155 | struct mutex queue_lock; /* ISOC queue protection */ |
156 | __u32 sequence; /* frame sequence number */ | 156 | __u32 sequence; /* frame sequence number */ |
157 | char streaming; | 157 | char streaming; |
158 | #ifdef CONFIG_PM | ||
159 | char frozen; /* suspend - resume */ | ||
160 | #endif | ||
158 | char users; /* number of opens */ | 161 | char users; /* number of opens */ |
159 | char present; /* device connected */ | 162 | char present; /* device connected */ |
160 | char nbufread; /* number of buffers for read() */ | 163 | char nbufread; /* number of buffers for read() */ |
@@ -174,6 +177,10 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, | |||
174 | struct gspca_frame *frame, | 177 | struct gspca_frame *frame, |
175 | const __u8 *data, | 178 | const __u8 *data, |
176 | int len); | 179 | int len); |
180 | #ifdef CONFIG_PM | ||
181 | int gspca_suspend(struct usb_interface *intf, pm_message_t message); | ||
182 | int gspca_resume(struct usb_interface *intf); | ||
183 | #endif | ||
177 | int gspca_auto_gain_n_exposure(struct gspca_dev *gspca_dev, int avg_lum, | 184 | int gspca_auto_gain_n_exposure(struct gspca_dev *gspca_dev, int avg_lum, |
178 | int desired_avg_lum, int deadzone, int gain_knee, int exposure_knee); | 185 | int desired_avg_lum, int deadzone, int gain_knee, int exposure_knee); |
179 | #endif /* GSPCAV2_H */ | 186 | #endif /* GSPCAV2_H */ |
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index 21c4ee56a10a..4d5db47ba8cb 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -100,22 +100,6 @@ static int reg_w(struct gspca_dev *gspca_dev, | |||
100 | return rc; | 100 | return rc; |
101 | } | 101 | } |
102 | 102 | ||
103 | static int reg_w_buf(struct gspca_dev *gspca_dev, | ||
104 | __u16 index, __u8 *buf, int len) | ||
105 | { | ||
106 | int rc; | ||
107 | |||
108 | rc = usb_control_msg(gspca_dev->dev, | ||
109 | usb_sndbulkpipe(gspca_dev->dev, 4), | ||
110 | 0x12, | ||
111 | 0xc8, /* ?? */ | ||
112 | 0, /* value */ | ||
113 | index, buf, len, 500); | ||
114 | if (rc < 0) | ||
115 | PDEBUG(D_ERR, "reg write [%02x] error %d", index, rc); | ||
116 | return rc; | ||
117 | } | ||
118 | |||
119 | static void bulk_w(struct gspca_dev *gspca_dev, | 103 | static void bulk_w(struct gspca_dev *gspca_dev, |
120 | __u16 *pch, | 104 | __u16 *pch, |
121 | __u16 Address) | 105 | __u16 Address) |
@@ -144,8 +128,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
144 | return 0; | 128 | return 0; |
145 | } | 129 | } |
146 | 130 | ||
147 | /* this function is called at open time */ | 131 | /* this function is called at probe and resume time */ |
148 | static int sd_open(struct gspca_dev *gspca_dev) | 132 | static int sd_init(struct gspca_dev *gspca_dev) |
149 | { | 133 | { |
150 | return 0; | 134 | return 0; |
151 | } | 135 | } |
@@ -175,7 +159,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
175 | /* | 159 | /* |
176 | Initialize the MR97113 chip register | 160 | Initialize the MR97113 chip register |
177 | */ | 161 | */ |
178 | data = kmalloc(16, GFP_KERNEL); | ||
179 | data[0] = 0x00; /* address */ | 162 | data[0] = 0x00; /* address */ |
180 | data[1] = 0x0c | 0x01; /* reg 0 */ | 163 | data[1] = 0x0c | 0x01; /* reg 0 */ |
181 | data[2] = 0x01; /* reg 1 */ | 164 | data[2] = 0x01; /* reg 1 */ |
@@ -195,12 +178,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
195 | data[10] = 0x5d; /* reg 9, I2C device address | 178 | data[10] = 0x5d; /* reg 9, I2C device address |
196 | * [for PAS5101 (0x40)] [for MI (0x5d)] */ | 179 | * [for PAS5101 (0x40)] [for MI (0x5d)] */ |
197 | 180 | ||
198 | err_code = reg_w_buf(gspca_dev, data[0], data, 11); | 181 | err_code = reg_w(gspca_dev, data[0], 11); |
199 | kfree(data); | ||
200 | if (err_code < 0) | 182 | if (err_code < 0) |
201 | return; | 183 | return; |
202 | 184 | ||
203 | data = gspca_dev->usb_buf; | ||
204 | data[0] = 0x23; /* address */ | 185 | data[0] = 0x23; /* address */ |
205 | data[1] = 0x09; /* reg 35, append frame header */ | 186 | data[1] = 0x09; /* reg 35, append frame header */ |
206 | 187 | ||
@@ -358,14 +339,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
358 | PDEBUG(D_ERR, "Camera Stop failed"); | 339 | PDEBUG(D_ERR, "Camera Stop failed"); |
359 | } | 340 | } |
360 | 341 | ||
361 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
362 | { | ||
363 | } | ||
364 | |||
365 | static void sd_close(struct gspca_dev *gspca_dev) | ||
366 | { | ||
367 | } | ||
368 | |||
369 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 342 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
370 | struct gspca_frame *frame, /* target */ | 343 | struct gspca_frame *frame, /* target */ |
371 | __u8 *data, /* isoc packet */ | 344 | __u8 *data, /* isoc packet */ |
@@ -411,11 +384,9 @@ static const struct sd_desc sd_desc = { | |||
411 | .ctrls = sd_ctrls, | 384 | .ctrls = sd_ctrls, |
412 | .nctrls = ARRAY_SIZE(sd_ctrls), | 385 | .nctrls = ARRAY_SIZE(sd_ctrls), |
413 | .config = sd_config, | 386 | .config = sd_config, |
414 | .open = sd_open, | 387 | .init = sd_init, |
415 | .start = sd_start, | 388 | .start = sd_start, |
416 | .stopN = sd_stopN, | 389 | .stopN = sd_stopN, |
417 | .stop0 = sd_stop0, | ||
418 | .close = sd_close, | ||
419 | .pkt_scan = sd_pkt_scan, | 390 | .pkt_scan = sd_pkt_scan, |
420 | }; | 391 | }; |
421 | 392 | ||
@@ -439,6 +410,10 @@ static struct usb_driver sd_driver = { | |||
439 | .id_table = device_table, | 410 | .id_table = device_table, |
440 | .probe = sd_probe, | 411 | .probe = sd_probe, |
441 | .disconnect = gspca_disconnect, | 412 | .disconnect = gspca_disconnect, |
413 | #ifdef CONFIG_PM | ||
414 | .suspend = gspca_suspend, | ||
415 | .resume = gspca_resume, | ||
416 | #endif | ||
442 | }; | 417 | }; |
443 | 418 | ||
444 | /* -- module insert / remove -- */ | 419 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index b4f00ec0885c..4df4eec9f7e7 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -63,11 +63,10 @@ struct sd { | |||
63 | #define SEN_OV6630 2 | 63 | #define SEN_OV6630 2 |
64 | #define SEN_OV7610 3 | 64 | #define SEN_OV7610 3 |
65 | #define SEN_OV7620 4 | 65 | #define SEN_OV7620 4 |
66 | #define SEN_OV7630 5 | 66 | #define SEN_OV7640 5 |
67 | #define SEN_OV7640 6 | 67 | #define SEN_OV7670 6 |
68 | #define SEN_OV7670 7 | 68 | #define SEN_OV76BE 7 |
69 | #define SEN_OV76BE 8 | 69 | #define SEN_OV8610 8 |
70 | #define SEN_OV8610 9 | ||
71 | 70 | ||
72 | }; | 71 | }; |
73 | 72 | ||
@@ -127,6 +126,7 @@ static struct ctrl sd_ctrls[] = { | |||
127 | .get = sd_getcolors, | 126 | .get = sd_getcolors, |
128 | }, | 127 | }, |
129 | /* next controls work with ov7670 only */ | 128 | /* next controls work with ov7670 only */ |
129 | #define HFLIP_IDX 3 | ||
130 | { | 130 | { |
131 | { | 131 | { |
132 | .id = V4L2_CID_HFLIP, | 132 | .id = V4L2_CID_HFLIP, |
@@ -141,6 +141,7 @@ static struct ctrl sd_ctrls[] = { | |||
141 | .set = sd_sethflip, | 141 | .set = sd_sethflip, |
142 | .get = sd_gethflip, | 142 | .get = sd_gethflip, |
143 | }, | 143 | }, |
144 | #define VFLIP_IDX 4 | ||
144 | { | 145 | { |
145 | { | 146 | { |
146 | .id = V4L2_CID_VFLIP, | 147 | .id = V4L2_CID_VFLIP, |
@@ -293,6 +294,541 @@ static struct v4l2_pix_format sif_mode[] = { | |||
293 | #define OV7670_REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */ | 294 | #define OV7670_REG_HAECC7 0xaa /* Hist AEC/AGC control 7 */ |
294 | #define OV7670_REG_BD60MAX 0xab /* 60hz banding step limit */ | 295 | #define OV7670_REG_BD60MAX 0xab /* 60hz banding step limit */ |
295 | 296 | ||
297 | struct ov_regvals { | ||
298 | __u8 reg; | ||
299 | __u8 val; | ||
300 | }; | ||
301 | struct ov_i2c_regvals { | ||
302 | __u8 reg; | ||
303 | __u8 val; | ||
304 | }; | ||
305 | |||
306 | static const struct ov_i2c_regvals norm_6x20[] = { | ||
307 | { 0x12, 0x80 }, /* reset */ | ||
308 | { 0x11, 0x01 }, | ||
309 | { 0x03, 0x60 }, | ||
310 | { 0x05, 0x7f }, /* For when autoadjust is off */ | ||
311 | { 0x07, 0xa8 }, | ||
312 | /* The ratio of 0x0c and 0x0d controls the white point */ | ||
313 | { 0x0c, 0x24 }, | ||
314 | { 0x0d, 0x24 }, | ||
315 | { 0x0f, 0x15 }, /* COMS */ | ||
316 | { 0x10, 0x75 }, /* AEC Exposure time */ | ||
317 | { 0x12, 0x24 }, /* Enable AGC */ | ||
318 | { 0x14, 0x04 }, | ||
319 | /* 0x16: 0x06 helps frame stability with moving objects */ | ||
320 | { 0x16, 0x06 }, | ||
321 | /* { 0x20, 0x30 }, * Aperture correction enable */ | ||
322 | { 0x26, 0xb2 }, /* BLC enable */ | ||
323 | /* 0x28: 0x05 Selects RGB format if RGB on */ | ||
324 | { 0x28, 0x05 }, | ||
325 | { 0x2a, 0x04 }, /* Disable framerate adjust */ | ||
326 | /* { 0x2b, 0xac }, * Framerate; Set 2a[7] first */ | ||
327 | { 0x2d, 0x99 }, | ||
328 | { 0x33, 0xa0 }, /* Color Processing Parameter */ | ||
329 | { 0x34, 0xd2 }, /* Max A/D range */ | ||
330 | { 0x38, 0x8b }, | ||
331 | { 0x39, 0x40 }, | ||
332 | |||
333 | { 0x3c, 0x39 }, /* Enable AEC mode changing */ | ||
334 | { 0x3c, 0x3c }, /* Change AEC mode */ | ||
335 | { 0x3c, 0x24 }, /* Disable AEC mode changing */ | ||
336 | |||
337 | { 0x3d, 0x80 }, | ||
338 | /* These next two registers (0x4a, 0x4b) are undocumented. | ||
339 | * They control the color balance */ | ||
340 | { 0x4a, 0x80 }, | ||
341 | { 0x4b, 0x80 }, | ||
342 | { 0x4d, 0xd2 }, /* This reduces noise a bit */ | ||
343 | { 0x4e, 0xc1 }, | ||
344 | { 0x4f, 0x04 }, | ||
345 | /* Do 50-53 have any effect? */ | ||
346 | /* Toggle 0x12[2] off and on here? */ | ||
347 | }; | ||
348 | |||
349 | static const struct ov_i2c_regvals norm_6x30[] = { | ||
350 | { 0x12, 0x80 }, /* Reset */ | ||
351 | { 0x00, 0x1f }, /* Gain */ | ||
352 | { 0x01, 0x99 }, /* Blue gain */ | ||
353 | { 0x02, 0x7c }, /* Red gain */ | ||
354 | { 0x03, 0xc0 }, /* Saturation */ | ||
355 | { 0x05, 0x0a }, /* Contrast */ | ||
356 | { 0x06, 0x95 }, /* Brightness */ | ||
357 | { 0x07, 0x2d }, /* Sharpness */ | ||
358 | { 0x0c, 0x20 }, | ||
359 | { 0x0d, 0x20 }, | ||
360 | { 0x0e, 0x20 }, | ||
361 | { 0x0f, 0x05 }, | ||
362 | { 0x10, 0x9a }, | ||
363 | { 0x11, 0x00 }, /* Pixel clock = fastest */ | ||
364 | { 0x12, 0x24 }, /* Enable AGC and AWB */ | ||
365 | { 0x13, 0x21 }, | ||
366 | { 0x14, 0x80 }, | ||
367 | { 0x15, 0x01 }, | ||
368 | { 0x16, 0x03 }, | ||
369 | { 0x17, 0x38 }, | ||
370 | { 0x18, 0xea }, | ||
371 | { 0x19, 0x04 }, | ||
372 | { 0x1a, 0x93 }, | ||
373 | { 0x1b, 0x00 }, | ||
374 | { 0x1e, 0xc4 }, | ||
375 | { 0x1f, 0x04 }, | ||
376 | { 0x20, 0x20 }, | ||
377 | { 0x21, 0x10 }, | ||
378 | { 0x22, 0x88 }, | ||
379 | { 0x23, 0xc0 }, /* Crystal circuit power level */ | ||
380 | { 0x25, 0x9a }, /* Increase AEC black ratio */ | ||
381 | { 0x26, 0xb2 }, /* BLC enable */ | ||
382 | { 0x27, 0xa2 }, | ||
383 | { 0x28, 0x00 }, | ||
384 | { 0x29, 0x00 }, | ||
385 | { 0x2a, 0x84 }, /* 60 Hz power */ | ||
386 | { 0x2b, 0xa8 }, /* 60 Hz power */ | ||
387 | { 0x2c, 0xa0 }, | ||
388 | { 0x2d, 0x95 }, /* Enable auto-brightness */ | ||
389 | { 0x2e, 0x88 }, | ||
390 | { 0x33, 0x26 }, | ||
391 | { 0x34, 0x03 }, | ||
392 | { 0x36, 0x8f }, | ||
393 | { 0x37, 0x80 }, | ||
394 | { 0x38, 0x83 }, | ||
395 | { 0x39, 0x80 }, | ||
396 | { 0x3a, 0x0f }, | ||
397 | { 0x3b, 0x3c }, | ||
398 | { 0x3c, 0x1a }, | ||
399 | { 0x3d, 0x80 }, | ||
400 | { 0x3e, 0x80 }, | ||
401 | { 0x3f, 0x0e }, | ||
402 | { 0x40, 0x00 }, /* White bal */ | ||
403 | { 0x41, 0x00 }, /* White bal */ | ||
404 | { 0x42, 0x80 }, | ||
405 | { 0x43, 0x3f }, /* White bal */ | ||
406 | { 0x44, 0x80 }, | ||
407 | { 0x45, 0x20 }, | ||
408 | { 0x46, 0x20 }, | ||
409 | { 0x47, 0x80 }, | ||
410 | { 0x48, 0x7f }, | ||
411 | { 0x49, 0x00 }, | ||
412 | { 0x4a, 0x00 }, | ||
413 | { 0x4b, 0x80 }, | ||
414 | { 0x4c, 0xd0 }, | ||
415 | { 0x4d, 0x10 }, /* U = 0.563u, V = 0.714v */ | ||
416 | { 0x4e, 0x40 }, | ||
417 | { 0x4f, 0x07 }, /* UV avg., col. killer: max */ | ||
418 | { 0x50, 0xff }, | ||
419 | { 0x54, 0x23 }, /* Max AGC gain: 18dB */ | ||
420 | { 0x55, 0xff }, | ||
421 | { 0x56, 0x12 }, | ||
422 | { 0x57, 0x81 }, | ||
423 | { 0x58, 0x75 }, | ||
424 | { 0x59, 0x01 }, /* AGC dark current comp.: +1 */ | ||
425 | { 0x5a, 0x2c }, | ||
426 | { 0x5b, 0x0f }, /* AWB chrominance levels */ | ||
427 | { 0x5c, 0x10 }, | ||
428 | { 0x3d, 0x80 }, | ||
429 | { 0x27, 0xa6 }, | ||
430 | { 0x12, 0x20 }, /* Toggle AWB */ | ||
431 | { 0x12, 0x24 }, | ||
432 | }; | ||
433 | |||
434 | /* Lawrence Glaister <lg@jfm.bc.ca> reports: | ||
435 | * | ||
436 | * Register 0x0f in the 7610 has the following effects: | ||
437 | * | ||
438 | * 0x85 (AEC method 1): Best overall, good contrast range | ||
439 | * 0x45 (AEC method 2): Very overexposed | ||
440 | * 0xa5 (spec sheet default): Ok, but the black level is | ||
441 | * shifted resulting in loss of contrast | ||
442 | * 0x05 (old driver setting): very overexposed, too much | ||
443 | * contrast | ||
444 | */ | ||
445 | static const struct ov_i2c_regvals norm_7610[] = { | ||
446 | { 0x10, 0xff }, | ||
447 | { 0x16, 0x06 }, | ||
448 | { 0x28, 0x24 }, | ||
449 | { 0x2b, 0xac }, | ||
450 | { 0x12, 0x00 }, | ||
451 | { 0x38, 0x81 }, | ||
452 | { 0x28, 0x24 }, /* 0c */ | ||
453 | { 0x0f, 0x85 }, /* lg's setting */ | ||
454 | { 0x15, 0x01 }, | ||
455 | { 0x20, 0x1c }, | ||
456 | { 0x23, 0x2a }, | ||
457 | { 0x24, 0x10 }, | ||
458 | { 0x25, 0x8a }, | ||
459 | { 0x26, 0xa2 }, | ||
460 | { 0x27, 0xc2 }, | ||
461 | { 0x2a, 0x04 }, | ||
462 | { 0x2c, 0xfe }, | ||
463 | { 0x2d, 0x93 }, | ||
464 | { 0x30, 0x71 }, | ||
465 | { 0x31, 0x60 }, | ||
466 | { 0x32, 0x26 }, | ||
467 | { 0x33, 0x20 }, | ||
468 | { 0x34, 0x48 }, | ||
469 | { 0x12, 0x24 }, | ||
470 | { 0x11, 0x01 }, | ||
471 | { 0x0c, 0x24 }, | ||
472 | { 0x0d, 0x24 }, | ||
473 | }; | ||
474 | |||
475 | static const struct ov_i2c_regvals norm_7620[] = { | ||
476 | { 0x00, 0x00 }, /* gain */ | ||
477 | { 0x01, 0x80 }, /* blue gain */ | ||
478 | { 0x02, 0x80 }, /* red gain */ | ||
479 | { 0x03, 0xc0 }, /* OV7670_REG_VREF */ | ||
480 | { 0x06, 0x60 }, | ||
481 | { 0x07, 0x00 }, | ||
482 | { 0x0c, 0x24 }, | ||
483 | { 0x0c, 0x24 }, | ||
484 | { 0x0d, 0x24 }, | ||
485 | { 0x11, 0x01 }, | ||
486 | { 0x12, 0x24 }, | ||
487 | { 0x13, 0x01 }, | ||
488 | { 0x14, 0x84 }, | ||
489 | { 0x15, 0x01 }, | ||
490 | { 0x16, 0x03 }, | ||
491 | { 0x17, 0x2f }, | ||
492 | { 0x18, 0xcf }, | ||
493 | { 0x19, 0x06 }, | ||
494 | { 0x1a, 0xf5 }, | ||
495 | { 0x1b, 0x00 }, | ||
496 | { 0x20, 0x18 }, | ||
497 | { 0x21, 0x80 }, | ||
498 | { 0x22, 0x80 }, | ||
499 | { 0x23, 0x00 }, | ||
500 | { 0x26, 0xa2 }, | ||
501 | { 0x27, 0xea }, | ||
502 | { 0x28, 0x20 }, | ||
503 | { 0x29, 0x00 }, | ||
504 | { 0x2a, 0x10 }, | ||
505 | { 0x2b, 0x00 }, | ||
506 | { 0x2c, 0x88 }, | ||
507 | { 0x2d, 0x91 }, | ||
508 | { 0x2e, 0x80 }, | ||
509 | { 0x2f, 0x44 }, | ||
510 | { 0x60, 0x27 }, | ||
511 | { 0x61, 0x02 }, | ||
512 | { 0x62, 0x5f }, | ||
513 | { 0x63, 0xd5 }, | ||
514 | { 0x64, 0x57 }, | ||
515 | { 0x65, 0x83 }, | ||
516 | { 0x66, 0x55 }, | ||
517 | { 0x67, 0x92 }, | ||
518 | { 0x68, 0xcf }, | ||
519 | { 0x69, 0x76 }, | ||
520 | { 0x6a, 0x22 }, | ||
521 | { 0x6b, 0x00 }, | ||
522 | { 0x6c, 0x02 }, | ||
523 | { 0x6d, 0x44 }, | ||
524 | { 0x6e, 0x80 }, | ||
525 | { 0x6f, 0x1d }, | ||
526 | { 0x70, 0x8b }, | ||
527 | { 0x71, 0x00 }, | ||
528 | { 0x72, 0x14 }, | ||
529 | { 0x73, 0x54 }, | ||
530 | { 0x74, 0x00 }, | ||
531 | { 0x75, 0x8e }, | ||
532 | { 0x76, 0x00 }, | ||
533 | { 0x77, 0xff }, | ||
534 | { 0x78, 0x80 }, | ||
535 | { 0x79, 0x80 }, | ||
536 | { 0x7a, 0x80 }, | ||
537 | { 0x7b, 0xe2 }, | ||
538 | { 0x7c, 0x00 }, | ||
539 | }; | ||
540 | |||
541 | /* 7640 and 7648. The defaults should be OK for most registers. */ | ||
542 | static const struct ov_i2c_regvals norm_7640[] = { | ||
543 | { 0x12, 0x80 }, | ||
544 | { 0x12, 0x14 }, | ||
545 | }; | ||
546 | |||
547 | /* 7670. Defaults taken from OmniVision provided data, | ||
548 | * as provided by Jonathan Corbet of OLPC */ | ||
549 | static const struct ov_i2c_regvals norm_7670[] = { | ||
550 | { OV7670_REG_COM7, OV7670_COM7_RESET }, | ||
551 | { OV7670_REG_TSLB, 0x04 }, /* OV */ | ||
552 | { OV7670_REG_COM7, OV7670_COM7_FMT_VGA }, /* VGA */ | ||
553 | { OV7670_REG_CLKRC, 0x01 }, | ||
554 | /* | ||
555 | * Set the hardware window. These values from OV don't entirely | ||
556 | * make sense - hstop is less than hstart. But they work... | ||
557 | */ | ||
558 | { OV7670_REG_HSTART, 0x13 }, | ||
559 | { OV7670_REG_HSTOP, 0x01 }, | ||
560 | { OV7670_REG_HREF, 0xb6 }, | ||
561 | { OV7670_REG_VSTART, 0x02 }, | ||
562 | { OV7670_REG_VSTOP, 0x7a }, | ||
563 | { OV7670_REG_VREF, 0x0a }, | ||
564 | |||
565 | { OV7670_REG_COM3, 0 }, | ||
566 | { OV7670_REG_COM14, 0 }, | ||
567 | /* Mystery scaling numbers */ | ||
568 | { 0x70, 0x3a }, | ||
569 | { 0x71, 0x35 }, | ||
570 | { 0x72, 0x11 }, | ||
571 | { 0x73, 0xf0 }, | ||
572 | { 0xa2, 0x02 }, | ||
573 | /* { OV7670_REG_COM10, 0x0 }, */ | ||
574 | |||
575 | /* Gamma curve values */ | ||
576 | { 0x7a, 0x20 }, | ||
577 | { 0x7b, 0x10 }, | ||
578 | { 0x7c, 0x1e }, | ||
579 | { 0x7d, 0x35 }, | ||
580 | { 0x7e, 0x5a }, | ||
581 | { 0x7f, 0x69 }, | ||
582 | { 0x80, 0x76 }, | ||
583 | { 0x81, 0x80 }, | ||
584 | { 0x82, 0x88 }, | ||
585 | { 0x83, 0x8f }, | ||
586 | { 0x84, 0x96 }, | ||
587 | { 0x85, 0xa3 }, | ||
588 | { 0x86, 0xaf }, | ||
589 | { 0x87, 0xc4 }, | ||
590 | { 0x88, 0xd7 }, | ||
591 | { 0x89, 0xe8 }, | ||
592 | |||
593 | /* AGC and AEC parameters. Note we start by disabling those features, | ||
594 | then turn them only after tweaking the values. */ | ||
595 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
596 | | OV7670_COM8_AECSTEP | ||
597 | | OV7670_COM8_BFILT }, | ||
598 | { OV7670_REG_GAIN, 0 }, | ||
599 | { OV7670_REG_AECH, 0 }, | ||
600 | { OV7670_REG_COM4, 0x40 }, /* magic reserved bit */ | ||
601 | { OV7670_REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ | ||
602 | { OV7670_REG_BD50MAX, 0x05 }, | ||
603 | { OV7670_REG_BD60MAX, 0x07 }, | ||
604 | { OV7670_REG_AEW, 0x95 }, | ||
605 | { OV7670_REG_AEB, 0x33 }, | ||
606 | { OV7670_REG_VPT, 0xe3 }, | ||
607 | { OV7670_REG_HAECC1, 0x78 }, | ||
608 | { OV7670_REG_HAECC2, 0x68 }, | ||
609 | { 0xa1, 0x03 }, /* magic */ | ||
610 | { OV7670_REG_HAECC3, 0xd8 }, | ||
611 | { OV7670_REG_HAECC4, 0xd8 }, | ||
612 | { OV7670_REG_HAECC5, 0xf0 }, | ||
613 | { OV7670_REG_HAECC6, 0x90 }, | ||
614 | { OV7670_REG_HAECC7, 0x94 }, | ||
615 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
616 | | OV7670_COM8_AECSTEP | ||
617 | | OV7670_COM8_BFILT | ||
618 | | OV7670_COM8_AGC | ||
619 | | OV7670_COM8_AEC }, | ||
620 | |||
621 | /* Almost all of these are magic "reserved" values. */ | ||
622 | { OV7670_REG_COM5, 0x61 }, | ||
623 | { OV7670_REG_COM6, 0x4b }, | ||
624 | { 0x16, 0x02 }, | ||
625 | { OV7670_REG_MVFP, 0x07 }, | ||
626 | { 0x21, 0x02 }, | ||
627 | { 0x22, 0x91 }, | ||
628 | { 0x29, 0x07 }, | ||
629 | { 0x33, 0x0b }, | ||
630 | { 0x35, 0x0b }, | ||
631 | { 0x37, 0x1d }, | ||
632 | { 0x38, 0x71 }, | ||
633 | { 0x39, 0x2a }, | ||
634 | { OV7670_REG_COM12, 0x78 }, | ||
635 | { 0x4d, 0x40 }, | ||
636 | { 0x4e, 0x20 }, | ||
637 | { OV7670_REG_GFIX, 0 }, | ||
638 | { 0x6b, 0x4a }, | ||
639 | { 0x74, 0x10 }, | ||
640 | { 0x8d, 0x4f }, | ||
641 | { 0x8e, 0 }, | ||
642 | { 0x8f, 0 }, | ||
643 | { 0x90, 0 }, | ||
644 | { 0x91, 0 }, | ||
645 | { 0x96, 0 }, | ||
646 | { 0x9a, 0 }, | ||
647 | { 0xb0, 0x84 }, | ||
648 | { 0xb1, 0x0c }, | ||
649 | { 0xb2, 0x0e }, | ||
650 | { 0xb3, 0x82 }, | ||
651 | { 0xb8, 0x0a }, | ||
652 | |||
653 | /* More reserved magic, some of which tweaks white balance */ | ||
654 | { 0x43, 0x0a }, | ||
655 | { 0x44, 0xf0 }, | ||
656 | { 0x45, 0x34 }, | ||
657 | { 0x46, 0x58 }, | ||
658 | { 0x47, 0x28 }, | ||
659 | { 0x48, 0x3a }, | ||
660 | { 0x59, 0x88 }, | ||
661 | { 0x5a, 0x88 }, | ||
662 | { 0x5b, 0x44 }, | ||
663 | { 0x5c, 0x67 }, | ||
664 | { 0x5d, 0x49 }, | ||
665 | { 0x5e, 0x0e }, | ||
666 | { 0x6c, 0x0a }, | ||
667 | { 0x6d, 0x55 }, | ||
668 | { 0x6e, 0x11 }, | ||
669 | { 0x6f, 0x9f }, | ||
670 | /* "9e for advance AWB" */ | ||
671 | { 0x6a, 0x40 }, | ||
672 | { OV7670_REG_BLUE, 0x40 }, | ||
673 | { OV7670_REG_RED, 0x60 }, | ||
674 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
675 | | OV7670_COM8_AECSTEP | ||
676 | | OV7670_COM8_BFILT | ||
677 | | OV7670_COM8_AGC | ||
678 | | OV7670_COM8_AEC | ||
679 | | OV7670_COM8_AWB }, | ||
680 | |||
681 | /* Matrix coefficients */ | ||
682 | { 0x4f, 0x80 }, | ||
683 | { 0x50, 0x80 }, | ||
684 | { 0x51, 0 }, | ||
685 | { 0x52, 0x22 }, | ||
686 | { 0x53, 0x5e }, | ||
687 | { 0x54, 0x80 }, | ||
688 | { 0x58, 0x9e }, | ||
689 | |||
690 | { OV7670_REG_COM16, OV7670_COM16_AWBGAIN }, | ||
691 | { OV7670_REG_EDGE, 0 }, | ||
692 | { 0x75, 0x05 }, | ||
693 | { 0x76, 0xe1 }, | ||
694 | { 0x4c, 0 }, | ||
695 | { 0x77, 0x01 }, | ||
696 | { OV7670_REG_COM13, OV7670_COM13_GAMMA | ||
697 | | OV7670_COM13_UVSAT | ||
698 | | 2}, /* was 3 */ | ||
699 | { 0x4b, 0x09 }, | ||
700 | { 0xc9, 0x60 }, | ||
701 | { OV7670_REG_COM16, 0x38 }, | ||
702 | { 0x56, 0x40 }, | ||
703 | |||
704 | { 0x34, 0x11 }, | ||
705 | { OV7670_REG_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO }, | ||
706 | { 0xa4, 0x88 }, | ||
707 | { 0x96, 0 }, | ||
708 | { 0x97, 0x30 }, | ||
709 | { 0x98, 0x20 }, | ||
710 | { 0x99, 0x30 }, | ||
711 | { 0x9a, 0x84 }, | ||
712 | { 0x9b, 0x29 }, | ||
713 | { 0x9c, 0x03 }, | ||
714 | { 0x9d, 0x4c }, | ||
715 | { 0x9e, 0x3f }, | ||
716 | { 0x78, 0x04 }, | ||
717 | |||
718 | /* Extra-weird stuff. Some sort of multiplexor register */ | ||
719 | { 0x79, 0x01 }, | ||
720 | { 0xc8, 0xf0 }, | ||
721 | { 0x79, 0x0f }, | ||
722 | { 0xc8, 0x00 }, | ||
723 | { 0x79, 0x10 }, | ||
724 | { 0xc8, 0x7e }, | ||
725 | { 0x79, 0x0a }, | ||
726 | { 0xc8, 0x80 }, | ||
727 | { 0x79, 0x0b }, | ||
728 | { 0xc8, 0x01 }, | ||
729 | { 0x79, 0x0c }, | ||
730 | { 0xc8, 0x0f }, | ||
731 | { 0x79, 0x0d }, | ||
732 | { 0xc8, 0x20 }, | ||
733 | { 0x79, 0x09 }, | ||
734 | { 0xc8, 0x80 }, | ||
735 | { 0x79, 0x02 }, | ||
736 | { 0xc8, 0xc0 }, | ||
737 | { 0x79, 0x03 }, | ||
738 | { 0xc8, 0x40 }, | ||
739 | { 0x79, 0x05 }, | ||
740 | { 0xc8, 0x30 }, | ||
741 | { 0x79, 0x26 }, | ||
742 | }; | ||
743 | |||
744 | static const struct ov_i2c_regvals norm_8610[] = { | ||
745 | { 0x12, 0x80 }, | ||
746 | { 0x00, 0x00 }, | ||
747 | { 0x01, 0x80 }, | ||
748 | { 0x02, 0x80 }, | ||
749 | { 0x03, 0xc0 }, | ||
750 | { 0x04, 0x30 }, | ||
751 | { 0x05, 0x30 }, /* was 0x10, new from windrv 090403 */ | ||
752 | { 0x06, 0x70 }, /* was 0x80, new from windrv 090403 */ | ||
753 | { 0x0a, 0x86 }, | ||
754 | { 0x0b, 0xb0 }, | ||
755 | { 0x0c, 0x20 }, | ||
756 | { 0x0d, 0x20 }, | ||
757 | { 0x11, 0x01 }, | ||
758 | { 0x12, 0x25 }, | ||
759 | { 0x13, 0x01 }, | ||
760 | { 0x14, 0x04 }, | ||
761 | { 0x15, 0x01 }, /* Lin and Win think different about UV order */ | ||
762 | { 0x16, 0x03 }, | ||
763 | { 0x17, 0x38 }, /* was 0x2f, new from windrv 090403 */ | ||
764 | { 0x18, 0xea }, /* was 0xcf, new from windrv 090403 */ | ||
765 | { 0x19, 0x02 }, /* was 0x06, new from windrv 090403 */ | ||
766 | { 0x1a, 0xf5 }, | ||
767 | { 0x1b, 0x00 }, | ||
768 | { 0x20, 0xd0 }, /* was 0x90, new from windrv 090403 */ | ||
769 | { 0x23, 0xc0 }, /* was 0x00, new from windrv 090403 */ | ||
770 | { 0x24, 0x30 }, /* was 0x1d, new from windrv 090403 */ | ||
771 | { 0x25, 0x50 }, /* was 0x57, new from windrv 090403 */ | ||
772 | { 0x26, 0xa2 }, | ||
773 | { 0x27, 0xea }, | ||
774 | { 0x28, 0x00 }, | ||
775 | { 0x29, 0x00 }, | ||
776 | { 0x2a, 0x80 }, | ||
777 | { 0x2b, 0xc8 }, /* was 0xcc, new from windrv 090403 */ | ||
778 | { 0x2c, 0xac }, | ||
779 | { 0x2d, 0x45 }, /* was 0xd5, new from windrv 090403 */ | ||
780 | { 0x2e, 0x80 }, | ||
781 | { 0x2f, 0x14 }, /* was 0x01, new from windrv 090403 */ | ||
782 | { 0x4c, 0x00 }, | ||
783 | { 0x4d, 0x30 }, /* was 0x10, new from windrv 090403 */ | ||
784 | { 0x60, 0x02 }, /* was 0x01, new from windrv 090403 */ | ||
785 | { 0x61, 0x00 }, /* was 0x09, new from windrv 090403 */ | ||
786 | { 0x62, 0x5f }, /* was 0xd7, new from windrv 090403 */ | ||
787 | { 0x63, 0xff }, | ||
788 | { 0x64, 0x53 }, /* new windrv 090403 says 0x57, | ||
789 | * maybe thats wrong */ | ||
790 | { 0x65, 0x00 }, | ||
791 | { 0x66, 0x55 }, | ||
792 | { 0x67, 0xb0 }, | ||
793 | { 0x68, 0xc0 }, /* was 0xaf, new from windrv 090403 */ | ||
794 | { 0x69, 0x02 }, | ||
795 | { 0x6a, 0x22 }, | ||
796 | { 0x6b, 0x00 }, | ||
797 | { 0x6c, 0x99 }, /* was 0x80, old windrv says 0x00, but | ||
798 | * deleting bit7 colors the first images red */ | ||
799 | { 0x6d, 0x11 }, /* was 0x00, new from windrv 090403 */ | ||
800 | { 0x6e, 0x11 }, /* was 0x00, new from windrv 090403 */ | ||
801 | { 0x6f, 0x01 }, | ||
802 | { 0x70, 0x8b }, | ||
803 | { 0x71, 0x00 }, | ||
804 | { 0x72, 0x14 }, | ||
805 | { 0x73, 0x54 }, | ||
806 | { 0x74, 0x00 },/* 0x60? - was 0x00, new from windrv 090403 */ | ||
807 | { 0x75, 0x0e }, | ||
808 | { 0x76, 0x02 }, /* was 0x02, new from windrv 090403 */ | ||
809 | { 0x77, 0xff }, | ||
810 | { 0x78, 0x80 }, | ||
811 | { 0x79, 0x80 }, | ||
812 | { 0x7a, 0x80 }, | ||
813 | { 0x7b, 0x10 }, /* was 0x13, new from windrv 090403 */ | ||
814 | { 0x7c, 0x00 }, | ||
815 | { 0x7d, 0x08 }, /* was 0x09, new from windrv 090403 */ | ||
816 | { 0x7e, 0x08 }, /* was 0xc0, new from windrv 090403 */ | ||
817 | { 0x7f, 0xfb }, | ||
818 | { 0x80, 0x28 }, | ||
819 | { 0x81, 0x00 }, | ||
820 | { 0x82, 0x23 }, | ||
821 | { 0x83, 0x0b }, | ||
822 | { 0x84, 0x00 }, | ||
823 | { 0x85, 0x62 }, /* was 0x61, new from windrv 090403 */ | ||
824 | { 0x86, 0xc9 }, | ||
825 | { 0x87, 0x00 }, | ||
826 | { 0x88, 0x00 }, | ||
827 | { 0x89, 0x01 }, | ||
828 | { 0x12, 0x20 }, | ||
829 | { 0x12, 0x25 }, /* was 0x24, new from windrv 090403 */ | ||
830 | }; | ||
831 | |||
296 | static unsigned char ov7670_abs_to_sm(unsigned char v) | 832 | static unsigned char ov7670_abs_to_sm(unsigned char v) |
297 | { | 833 | { |
298 | if (v > 127) | 834 | if (v > 127) |
@@ -537,18 +1073,10 @@ static int ov51x_set_slave_ids(struct sd *sd, | |||
537 | rc = reg_w(sd, R51x_I2C_W_SID, slave); | 1073 | rc = reg_w(sd, R51x_I2C_W_SID, slave); |
538 | if (rc < 0) | 1074 | if (rc < 0) |
539 | return rc; | 1075 | return rc; |
1076 | sd->primary_i2c_slave = slave; | ||
540 | return reg_w(sd, R51x_I2C_R_SID, slave + 1); | 1077 | return reg_w(sd, R51x_I2C_R_SID, slave + 1); |
541 | } | 1078 | } |
542 | 1079 | ||
543 | struct ov_regvals { | ||
544 | __u8 reg; | ||
545 | __u8 val; | ||
546 | }; | ||
547 | struct ov_i2c_regvals { | ||
548 | __u8 reg; | ||
549 | __u8 val; | ||
550 | }; | ||
551 | |||
552 | static int write_regvals(struct sd *sd, | 1080 | static int write_regvals(struct sd *sd, |
553 | const struct ov_regvals *regvals, | 1081 | const struct ov_regvals *regvals, |
554 | int n) | 1082 | int n) |
@@ -591,101 +1119,9 @@ static int write_i2c_regvals(struct sd *sd, | |||
591 | static int ov8xx0_configure(struct sd *sd) | 1119 | static int ov8xx0_configure(struct sd *sd) |
592 | { | 1120 | { |
593 | int rc; | 1121 | int rc; |
594 | static const struct ov_i2c_regvals norm_8610[] = { | ||
595 | { 0x12, 0x80 }, | ||
596 | { 0x00, 0x00 }, | ||
597 | { 0x01, 0x80 }, | ||
598 | { 0x02, 0x80 }, | ||
599 | { 0x03, 0xc0 }, | ||
600 | { 0x04, 0x30 }, | ||
601 | { 0x05, 0x30 }, /* was 0x10, new from windrv 090403 */ | ||
602 | { 0x06, 0x70 }, /* was 0x80, new from windrv 090403 */ | ||
603 | { 0x0a, 0x86 }, | ||
604 | { 0x0b, 0xb0 }, | ||
605 | { 0x0c, 0x20 }, | ||
606 | { 0x0d, 0x20 }, | ||
607 | { 0x11, 0x01 }, | ||
608 | { 0x12, 0x25 }, | ||
609 | { 0x13, 0x01 }, | ||
610 | { 0x14, 0x04 }, | ||
611 | { 0x15, 0x01 }, /* Lin and Win think different about UV order */ | ||
612 | { 0x16, 0x03 }, | ||
613 | { 0x17, 0x38 }, /* was 0x2f, new from windrv 090403 */ | ||
614 | { 0x18, 0xea }, /* was 0xcf, new from windrv 090403 */ | ||
615 | { 0x19, 0x02 }, /* was 0x06, new from windrv 090403 */ | ||
616 | { 0x1a, 0xf5 }, | ||
617 | { 0x1b, 0x00 }, | ||
618 | { 0x20, 0xd0 }, /* was 0x90, new from windrv 090403 */ | ||
619 | { 0x23, 0xc0 }, /* was 0x00, new from windrv 090403 */ | ||
620 | { 0x24, 0x30 }, /* was 0x1d, new from windrv 090403 */ | ||
621 | { 0x25, 0x50 }, /* was 0x57, new from windrv 090403 */ | ||
622 | { 0x26, 0xa2 }, | ||
623 | { 0x27, 0xea }, | ||
624 | { 0x28, 0x00 }, | ||
625 | { 0x29, 0x00 }, | ||
626 | { 0x2a, 0x80 }, | ||
627 | { 0x2b, 0xc8 }, /* was 0xcc, new from windrv 090403 */ | ||
628 | { 0x2c, 0xac }, | ||
629 | { 0x2d, 0x45 }, /* was 0xd5, new from windrv 090403 */ | ||
630 | { 0x2e, 0x80 }, | ||
631 | { 0x2f, 0x14 }, /* was 0x01, new from windrv 090403 */ | ||
632 | { 0x4c, 0x00 }, | ||
633 | { 0x4d, 0x30 }, /* was 0x10, new from windrv 090403 */ | ||
634 | { 0x60, 0x02 }, /* was 0x01, new from windrv 090403 */ | ||
635 | { 0x61, 0x00 }, /* was 0x09, new from windrv 090403 */ | ||
636 | { 0x62, 0x5f }, /* was 0xd7, new from windrv 090403 */ | ||
637 | { 0x63, 0xff }, | ||
638 | { 0x64, 0x53 }, /* new windrv 090403 says 0x57, | ||
639 | * maybe thats wrong */ | ||
640 | { 0x65, 0x00 }, | ||
641 | { 0x66, 0x55 }, | ||
642 | { 0x67, 0xb0 }, | ||
643 | { 0x68, 0xc0 }, /* was 0xaf, new from windrv 090403 */ | ||
644 | { 0x69, 0x02 }, | ||
645 | { 0x6a, 0x22 }, | ||
646 | { 0x6b, 0x00 }, | ||
647 | { 0x6c, 0x99 }, /* was 0x80, old windrv says 0x00, but | ||
648 | deleting bit7 colors the first images red */ | ||
649 | { 0x6d, 0x11 }, /* was 0x00, new from windrv 090403 */ | ||
650 | { 0x6e, 0x11 }, /* was 0x00, new from windrv 090403 */ | ||
651 | { 0x6f, 0x01 }, | ||
652 | { 0x70, 0x8b }, | ||
653 | { 0x71, 0x00 }, | ||
654 | { 0x72, 0x14 }, | ||
655 | { 0x73, 0x54 }, | ||
656 | { 0x74, 0x00 },/* 0x60? - was 0x00, new from windrv 090403 */ | ||
657 | { 0x75, 0x0e }, | ||
658 | { 0x76, 0x02 }, /* was 0x02, new from windrv 090403 */ | ||
659 | { 0x77, 0xff }, | ||
660 | { 0x78, 0x80 }, | ||
661 | { 0x79, 0x80 }, | ||
662 | { 0x7a, 0x80 }, | ||
663 | { 0x7b, 0x10 }, /* was 0x13, new from windrv 090403 */ | ||
664 | { 0x7c, 0x00 }, | ||
665 | { 0x7d, 0x08 }, /* was 0x09, new from windrv 090403 */ | ||
666 | { 0x7e, 0x08 }, /* was 0xc0, new from windrv 090403 */ | ||
667 | { 0x7f, 0xfb }, | ||
668 | { 0x80, 0x28 }, | ||
669 | { 0x81, 0x00 }, | ||
670 | { 0x82, 0x23 }, | ||
671 | { 0x83, 0x0b }, | ||
672 | { 0x84, 0x00 }, | ||
673 | { 0x85, 0x62 }, /* was 0x61, new from windrv 090403 */ | ||
674 | { 0x86, 0xc9 }, | ||
675 | { 0x87, 0x00 }, | ||
676 | { 0x88, 0x00 }, | ||
677 | { 0x89, 0x01 }, | ||
678 | { 0x12, 0x20 }, | ||
679 | { 0x12, 0x25 }, /* was 0x24, new from windrv 090403 */ | ||
680 | }; | ||
681 | 1122 | ||
682 | PDEBUG(D_PROBE, "starting ov8xx0 configuration"); | 1123 | PDEBUG(D_PROBE, "starting ov8xx0 configuration"); |
683 | 1124 | ||
684 | if (init_ov_sensor(sd) < 0) | ||
685 | PDEBUG(D_ERR|D_PROBE, "Failed to read sensor ID"); | ||
686 | else | ||
687 | PDEBUG(D_PROBE, "OV86x0 initialized"); | ||
688 | |||
689 | /* Detect sensor (sub)type */ | 1125 | /* Detect sensor (sub)type */ |
690 | rc = i2c_r(sd, OV7610_REG_COM_I); | 1126 | rc = i2c_r(sd, OV7610_REG_COM_I); |
691 | if (rc < 0) { | 1127 | if (rc < 0) { |
@@ -698,9 +1134,6 @@ static int ov8xx0_configure(struct sd *sd) | |||
698 | PDEBUG(D_ERR, "Unknown image sensor version: %d", rc & 3); | 1134 | PDEBUG(D_ERR, "Unknown image sensor version: %d", rc & 3); |
699 | return -1; | 1135 | return -1; |
700 | } | 1136 | } |
701 | PDEBUG(D_PROBE, "Writing 8610 registers"); | ||
702 | if (write_i2c_regvals(sd, norm_8610, ARRAY_SIZE(norm_8610))) | ||
703 | return -1; | ||
704 | 1137 | ||
705 | /* Set sensor-specific vars */ | 1138 | /* Set sensor-specific vars */ |
706 | /* sd->sif = 0; already done */ | 1139 | /* sd->sif = 0; already done */ |
@@ -714,252 +1147,6 @@ static int ov7xx0_configure(struct sd *sd) | |||
714 | { | 1147 | { |
715 | int rc, high, low; | 1148 | int rc, high, low; |
716 | 1149 | ||
717 | /* Lawrence Glaister <lg@jfm.bc.ca> reports: | ||
718 | * | ||
719 | * Register 0x0f in the 7610 has the following effects: | ||
720 | * | ||
721 | * 0x85 (AEC method 1): Best overall, good contrast range | ||
722 | * 0x45 (AEC method 2): Very overexposed | ||
723 | * 0xa5 (spec sheet default): Ok, but the black level is | ||
724 | * shifted resulting in loss of contrast | ||
725 | * 0x05 (old driver setting): very overexposed, too much | ||
726 | * contrast | ||
727 | */ | ||
728 | static const struct ov_i2c_regvals norm_7610[] = { | ||
729 | { 0x10, 0xff }, | ||
730 | { 0x16, 0x06 }, | ||
731 | { 0x28, 0x24 }, | ||
732 | { 0x2b, 0xac }, | ||
733 | { 0x12, 0x00 }, | ||
734 | { 0x38, 0x81 }, | ||
735 | { 0x28, 0x24 }, /* 0c */ | ||
736 | { 0x0f, 0x85 }, /* lg's setting */ | ||
737 | { 0x15, 0x01 }, | ||
738 | { 0x20, 0x1c }, | ||
739 | { 0x23, 0x2a }, | ||
740 | { 0x24, 0x10 }, | ||
741 | { 0x25, 0x8a }, | ||
742 | { 0x26, 0xa2 }, | ||
743 | { 0x27, 0xc2 }, | ||
744 | { 0x2a, 0x04 }, | ||
745 | { 0x2c, 0xfe }, | ||
746 | { 0x2d, 0x93 }, | ||
747 | { 0x30, 0x71 }, | ||
748 | { 0x31, 0x60 }, | ||
749 | { 0x32, 0x26 }, | ||
750 | { 0x33, 0x20 }, | ||
751 | { 0x34, 0x48 }, | ||
752 | { 0x12, 0x24 }, | ||
753 | { 0x11, 0x01 }, | ||
754 | { 0x0c, 0x24 }, | ||
755 | { 0x0d, 0x24 }, | ||
756 | }; | ||
757 | |||
758 | static const struct ov_i2c_regvals norm_7620[] = { | ||
759 | { 0x00, 0x00 }, /* gain */ | ||
760 | { 0x01, 0x80 }, /* blue gain */ | ||
761 | { 0x02, 0x80 }, /* red gain */ | ||
762 | { 0x03, 0xc0 }, /* OV7670_REG_VREF */ | ||
763 | { 0x06, 0x60 }, | ||
764 | { 0x07, 0x00 }, | ||
765 | { 0x0c, 0x24 }, | ||
766 | { 0x0c, 0x24 }, | ||
767 | { 0x0d, 0x24 }, | ||
768 | { 0x11, 0x01 }, | ||
769 | { 0x12, 0x24 }, | ||
770 | { 0x13, 0x01 }, | ||
771 | { 0x14, 0x84 }, | ||
772 | { 0x15, 0x01 }, | ||
773 | { 0x16, 0x03 }, | ||
774 | { 0x17, 0x2f }, | ||
775 | { 0x18, 0xcf }, | ||
776 | { 0x19, 0x06 }, | ||
777 | { 0x1a, 0xf5 }, | ||
778 | { 0x1b, 0x00 }, | ||
779 | { 0x20, 0x18 }, | ||
780 | { 0x21, 0x80 }, | ||
781 | { 0x22, 0x80 }, | ||
782 | { 0x23, 0x00 }, | ||
783 | { 0x26, 0xa2 }, | ||
784 | { 0x27, 0xea }, | ||
785 | { 0x28, 0x20 }, | ||
786 | { 0x29, 0x00 }, | ||
787 | { 0x2a, 0x10 }, | ||
788 | { 0x2b, 0x00 }, | ||
789 | { 0x2c, 0x88 }, | ||
790 | { 0x2d, 0x91 }, | ||
791 | { 0x2e, 0x80 }, | ||
792 | { 0x2f, 0x44 }, | ||
793 | { 0x60, 0x27 }, | ||
794 | { 0x61, 0x02 }, | ||
795 | { 0x62, 0x5f }, | ||
796 | { 0x63, 0xd5 }, | ||
797 | { 0x64, 0x57 }, | ||
798 | { 0x65, 0x83 }, | ||
799 | { 0x66, 0x55 }, | ||
800 | { 0x67, 0x92 }, | ||
801 | { 0x68, 0xcf }, | ||
802 | { 0x69, 0x76 }, | ||
803 | { 0x6a, 0x22 }, | ||
804 | { 0x6b, 0x00 }, | ||
805 | { 0x6c, 0x02 }, | ||
806 | { 0x6d, 0x44 }, | ||
807 | { 0x6e, 0x80 }, | ||
808 | { 0x6f, 0x1d }, | ||
809 | { 0x70, 0x8b }, | ||
810 | { 0x71, 0x00 }, | ||
811 | { 0x72, 0x14 }, | ||
812 | { 0x73, 0x54 }, | ||
813 | { 0x74, 0x00 }, | ||
814 | { 0x75, 0x8e }, | ||
815 | { 0x76, 0x00 }, | ||
816 | { 0x77, 0xff }, | ||
817 | { 0x78, 0x80 }, | ||
818 | { 0x79, 0x80 }, | ||
819 | { 0x7a, 0x80 }, | ||
820 | { 0x7b, 0xe2 }, | ||
821 | { 0x7c, 0x00 }, | ||
822 | }; | ||
823 | |||
824 | /* 7640 and 7648. The defaults should be OK for most registers. */ | ||
825 | static const struct ov_i2c_regvals norm_7640[] = { | ||
826 | { 0x12, 0x80 }, | ||
827 | { 0x12, 0x14 }, | ||
828 | }; | ||
829 | |||
830 | /* 7670. Defaults taken from OmniVision provided data, | ||
831 | * as provided by Jonathan Corbet of OLPC */ | ||
832 | static const struct ov_i2c_regvals norm_7670[] = { | ||
833 | { OV7670_REG_COM7, OV7670_COM7_RESET }, | ||
834 | { OV7670_REG_TSLB, 0x04 }, /* OV */ | ||
835 | { OV7670_REG_COM7, OV7670_COM7_FMT_VGA }, /* VGA */ | ||
836 | { OV7670_REG_CLKRC, 0x01 }, | ||
837 | /* | ||
838 | * Set the hardware window. These values from OV don't entirely | ||
839 | * make sense - hstop is less than hstart. But they work... | ||
840 | */ | ||
841 | { OV7670_REG_HSTART, 0x13 }, { OV7670_REG_HSTOP, 0x01 }, | ||
842 | { OV7670_REG_HREF, 0xb6 }, { OV7670_REG_VSTART, 0x02 }, | ||
843 | { OV7670_REG_VSTOP, 0x7a }, { OV7670_REG_VREF, 0x0a }, | ||
844 | |||
845 | { OV7670_REG_COM3, 0 }, { OV7670_REG_COM14, 0 }, | ||
846 | /* Mystery scaling numbers */ | ||
847 | { 0x70, 0x3a }, { 0x71, 0x35 }, | ||
848 | { 0x72, 0x11 }, { 0x73, 0xf0 }, | ||
849 | { 0xa2, 0x02 }, | ||
850 | /* { OV7670_REG_COM10, 0x0 }, */ | ||
851 | |||
852 | /* Gamma curve values */ | ||
853 | { 0x7a, 0x20 }, | ||
854 | { 0x7b, 0x10 }, | ||
855 | { 0x7c, 0x1e }, | ||
856 | { 0x7d, 0x35 }, | ||
857 | { 0x7e, 0x5a }, { 0x7f, 0x69 }, | ||
858 | { 0x80, 0x76 }, { 0x81, 0x80 }, | ||
859 | { 0x82, 0x88 }, { 0x83, 0x8f }, | ||
860 | { 0x84, 0x96 }, { 0x85, 0xa3 }, | ||
861 | { 0x86, 0xaf }, { 0x87, 0xc4 }, | ||
862 | { 0x88, 0xd7 }, { 0x89, 0xe8 }, | ||
863 | |||
864 | /* AGC and AEC parameters. Note we start by disabling those features, | ||
865 | then turn them only after tweaking the values. */ | ||
866 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
867 | | OV7670_COM8_AECSTEP | ||
868 | | OV7670_COM8_BFILT }, | ||
869 | { OV7670_REG_GAIN, 0 }, { OV7670_REG_AECH, 0 }, | ||
870 | { OV7670_REG_COM4, 0x40 }, /* magic reserved bit */ | ||
871 | { OV7670_REG_COM9, 0x18 }, /* 4x gain + magic rsvd bit */ | ||
872 | { OV7670_REG_BD50MAX, 0x05 }, { OV7670_REG_BD60MAX, 0x07 }, | ||
873 | { OV7670_REG_AEW, 0x95 }, { OV7670_REG_AEB, 0x33 }, | ||
874 | { OV7670_REG_VPT, 0xe3 }, { OV7670_REG_HAECC1, 0x78 }, | ||
875 | { OV7670_REG_HAECC2, 0x68 }, | ||
876 | { 0xa1, 0x03 }, /* magic */ | ||
877 | { OV7670_REG_HAECC3, 0xd8 }, { OV7670_REG_HAECC4, 0xd8 }, | ||
878 | { OV7670_REG_HAECC5, 0xf0 }, { OV7670_REG_HAECC6, 0x90 }, | ||
879 | { OV7670_REG_HAECC7, 0x94 }, | ||
880 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
881 | | OV7670_COM8_AECSTEP | ||
882 | | OV7670_COM8_BFILT | ||
883 | | OV7670_COM8_AGC | ||
884 | | OV7670_COM8_AEC }, | ||
885 | |||
886 | /* Almost all of these are magic "reserved" values. */ | ||
887 | { OV7670_REG_COM5, 0x61 }, { OV7670_REG_COM6, 0x4b }, | ||
888 | { 0x16, 0x02 }, | ||
889 | { OV7670_REG_MVFP, 0x07 }, | ||
890 | { 0x21, 0x02 }, { 0x22, 0x91 }, | ||
891 | { 0x29, 0x07 }, { 0x33, 0x0b }, | ||
892 | { 0x35, 0x0b }, { 0x37, 0x1d }, | ||
893 | { 0x38, 0x71 }, { 0x39, 0x2a }, | ||
894 | { OV7670_REG_COM12, 0x78 }, { 0x4d, 0x40 }, | ||
895 | { 0x4e, 0x20 }, { OV7670_REG_GFIX, 0 }, | ||
896 | { 0x6b, 0x4a }, { 0x74, 0x10 }, | ||
897 | { 0x8d, 0x4f }, { 0x8e, 0 }, | ||
898 | { 0x8f, 0 }, { 0x90, 0 }, | ||
899 | { 0x91, 0 }, { 0x96, 0 }, | ||
900 | { 0x9a, 0 }, { 0xb0, 0x84 }, | ||
901 | { 0xb1, 0x0c }, { 0xb2, 0x0e }, | ||
902 | { 0xb3, 0x82 }, { 0xb8, 0x0a }, | ||
903 | |||
904 | /* More reserved magic, some of which tweaks white balance */ | ||
905 | { 0x43, 0x0a }, { 0x44, 0xf0 }, | ||
906 | { 0x45, 0x34 }, { 0x46, 0x58 }, | ||
907 | { 0x47, 0x28 }, { 0x48, 0x3a }, | ||
908 | { 0x59, 0x88 }, { 0x5a, 0x88 }, | ||
909 | { 0x5b, 0x44 }, { 0x5c, 0x67 }, | ||
910 | { 0x5d, 0x49 }, { 0x5e, 0x0e }, | ||
911 | { 0x6c, 0x0a }, { 0x6d, 0x55 }, | ||
912 | { 0x6e, 0x11 }, { 0x6f, 0x9f }, | ||
913 | /* "9e for advance AWB" */ | ||
914 | { 0x6a, 0x40 }, { OV7670_REG_BLUE, 0x40 }, | ||
915 | { OV7670_REG_RED, 0x60 }, | ||
916 | { OV7670_REG_COM8, OV7670_COM8_FASTAEC | ||
917 | | OV7670_COM8_AECSTEP | ||
918 | | OV7670_COM8_BFILT | ||
919 | | OV7670_COM8_AGC | ||
920 | | OV7670_COM8_AEC | ||
921 | | OV7670_COM8_AWB }, | ||
922 | |||
923 | /* Matrix coefficients */ | ||
924 | { 0x4f, 0x80 }, { 0x50, 0x80 }, | ||
925 | { 0x51, 0 }, { 0x52, 0x22 }, | ||
926 | { 0x53, 0x5e }, { 0x54, 0x80 }, | ||
927 | { 0x58, 0x9e }, | ||
928 | |||
929 | { OV7670_REG_COM16, OV7670_COM16_AWBGAIN }, | ||
930 | { OV7670_REG_EDGE, 0 }, | ||
931 | { 0x75, 0x05 }, { 0x76, 0xe1 }, | ||
932 | { 0x4c, 0 }, { 0x77, 0x01 }, | ||
933 | { OV7670_REG_COM13, OV7670_COM13_GAMMA | ||
934 | | OV7670_COM13_UVSAT | ||
935 | | 2}, /* was 3 */ | ||
936 | { 0x4b, 0x09 }, | ||
937 | { 0xc9, 0x60 }, { OV7670_REG_COM16, 0x38 }, | ||
938 | { 0x56, 0x40 }, | ||
939 | |||
940 | { 0x34, 0x11 }, | ||
941 | { OV7670_REG_COM11, OV7670_COM11_EXP|OV7670_COM11_HZAUTO }, | ||
942 | { 0xa4, 0x88 }, { 0x96, 0 }, | ||
943 | { 0x97, 0x30 }, { 0x98, 0x20 }, | ||
944 | { 0x99, 0x30 }, { 0x9a, 0x84 }, | ||
945 | { 0x9b, 0x29 }, { 0x9c, 0x03 }, | ||
946 | { 0x9d, 0x4c }, { 0x9e, 0x3f }, | ||
947 | { 0x78, 0x04 }, | ||
948 | |||
949 | /* Extra-weird stuff. Some sort of multiplexor register */ | ||
950 | { 0x79, 0x01 }, { 0xc8, 0xf0 }, | ||
951 | { 0x79, 0x0f }, { 0xc8, 0x00 }, | ||
952 | { 0x79, 0x10 }, { 0xc8, 0x7e }, | ||
953 | { 0x79, 0x0a }, { 0xc8, 0x80 }, | ||
954 | { 0x79, 0x0b }, { 0xc8, 0x01 }, | ||
955 | { 0x79, 0x0c }, { 0xc8, 0x0f }, | ||
956 | { 0x79, 0x0d }, { 0xc8, 0x20 }, | ||
957 | { 0x79, 0x09 }, { 0xc8, 0x80 }, | ||
958 | { 0x79, 0x02 }, { 0xc8, 0xc0 }, | ||
959 | { 0x79, 0x03 }, { 0xc8, 0x40 }, | ||
960 | { 0x79, 0x05 }, { 0xc8, 0x30 }, | ||
961 | { 0x79, 0x26 }, | ||
962 | }; | ||
963 | 1150 | ||
964 | PDEBUG(D_PROBE, "starting OV7xx0 configuration"); | 1151 | PDEBUG(D_PROBE, "starting OV7xx0 configuration"); |
965 | 1152 | ||
@@ -1011,8 +1198,9 @@ static int ov7xx0_configure(struct sd *sd) | |||
1011 | switch (low) { | 1198 | switch (low) { |
1012 | case 0x30: | 1199 | case 0x30: |
1013 | PDEBUG(D_PROBE, "Sensor is an OV7630/OV7635"); | 1200 | PDEBUG(D_PROBE, "Sensor is an OV7630/OV7635"); |
1014 | sd->sensor = SEN_OV7630; | 1201 | PDEBUG(D_ERR, |
1015 | break; | 1202 | "7630 is not supported by this driver"); |
1203 | return -1; | ||
1016 | case 0x40: | 1204 | case 0x40: |
1017 | PDEBUG(D_PROBE, "Sensor is an OV7645"); | 1205 | PDEBUG(D_PROBE, "Sensor is an OV7645"); |
1018 | sd->sensor = SEN_OV7640; /* FIXME */ | 1206 | sd->sensor = SEN_OV7640; /* FIXME */ |
@@ -1038,32 +1226,6 @@ static int ov7xx0_configure(struct sd *sd) | |||
1038 | return -1; | 1226 | return -1; |
1039 | } | 1227 | } |
1040 | 1228 | ||
1041 | switch (sd->sensor) { | ||
1042 | case SEN_OV7620: | ||
1043 | PDEBUG(D_PROBE, "Writing 7620 registers"); | ||
1044 | if (write_i2c_regvals(sd, norm_7620, ARRAY_SIZE(norm_7620))) | ||
1045 | return -1; | ||
1046 | break; | ||
1047 | case SEN_OV7630: | ||
1048 | PDEBUG(D_ERR, "7630 is not supported by this driver version"); | ||
1049 | return -1; | ||
1050 | case SEN_OV7640: | ||
1051 | PDEBUG(D_PROBE, "Writing 7640 registers"); | ||
1052 | if (write_i2c_regvals(sd, norm_7640, ARRAY_SIZE(norm_7640))) | ||
1053 | return -1; | ||
1054 | break; | ||
1055 | case SEN_OV7670: | ||
1056 | PDEBUG(D_PROBE, "Writing 7670 registers"); | ||
1057 | if (write_i2c_regvals(sd, norm_7670, ARRAY_SIZE(norm_7670))) | ||
1058 | return -1; | ||
1059 | break; | ||
1060 | default: | ||
1061 | PDEBUG(D_PROBE, "Writing 7610 registers"); | ||
1062 | if (write_i2c_regvals(sd, norm_7610, ARRAY_SIZE(norm_7610))) | ||
1063 | return -1; | ||
1064 | break; | ||
1065 | } | ||
1066 | |||
1067 | /* Set sensor-specific vars */ | 1229 | /* Set sensor-specific vars */ |
1068 | /* sd->sif = 0; already done */ | 1230 | /* sd->sif = 0; already done */ |
1069 | return 0; | 1231 | return 0; |
@@ -1073,141 +1235,7 @@ static int ov7xx0_configure(struct sd *sd) | |||
1073 | static int ov6xx0_configure(struct sd *sd) | 1235 | static int ov6xx0_configure(struct sd *sd) |
1074 | { | 1236 | { |
1075 | int rc; | 1237 | int rc; |
1076 | static const struct ov_i2c_regvals norm_6x20[] = { | 1238 | PDEBUG(D_PROBE, "starting OV6xx0 configuration"); |
1077 | { 0x12, 0x80 }, /* reset */ | ||
1078 | { 0x11, 0x01 }, | ||
1079 | { 0x03, 0x60 }, | ||
1080 | { 0x05, 0x7f }, /* For when autoadjust is off */ | ||
1081 | { 0x07, 0xa8 }, | ||
1082 | /* The ratio of 0x0c and 0x0d controls the white point */ | ||
1083 | { 0x0c, 0x24 }, | ||
1084 | { 0x0d, 0x24 }, | ||
1085 | { 0x0f, 0x15 }, /* COMS */ | ||
1086 | { 0x10, 0x75 }, /* AEC Exposure time */ | ||
1087 | { 0x12, 0x24 }, /* Enable AGC */ | ||
1088 | { 0x14, 0x04 }, | ||
1089 | /* 0x16: 0x06 helps frame stability with moving objects */ | ||
1090 | { 0x16, 0x06 }, | ||
1091 | /* { 0x20, 0x30 }, * Aperture correction enable */ | ||
1092 | { 0x26, 0xb2 }, /* BLC enable */ | ||
1093 | /* 0x28: 0x05 Selects RGB format if RGB on */ | ||
1094 | { 0x28, 0x05 }, | ||
1095 | { 0x2a, 0x04 }, /* Disable framerate adjust */ | ||
1096 | /* { 0x2b, 0xac }, * Framerate; Set 2a[7] first */ | ||
1097 | { 0x2d, 0x99 }, | ||
1098 | { 0x33, 0xa0 }, /* Color Processing Parameter */ | ||
1099 | { 0x34, 0xd2 }, /* Max A/D range */ | ||
1100 | { 0x38, 0x8b }, | ||
1101 | { 0x39, 0x40 }, | ||
1102 | |||
1103 | { 0x3c, 0x39 }, /* Enable AEC mode changing */ | ||
1104 | { 0x3c, 0x3c }, /* Change AEC mode */ | ||
1105 | { 0x3c, 0x24 }, /* Disable AEC mode changing */ | ||
1106 | |||
1107 | { 0x3d, 0x80 }, | ||
1108 | /* These next two registers (0x4a, 0x4b) are undocumented. | ||
1109 | * They control the color balance */ | ||
1110 | { 0x4a, 0x80 }, | ||
1111 | { 0x4b, 0x80 }, | ||
1112 | { 0x4d, 0xd2 }, /* This reduces noise a bit */ | ||
1113 | { 0x4e, 0xc1 }, | ||
1114 | { 0x4f, 0x04 }, | ||
1115 | /* Do 50-53 have any effect? */ | ||
1116 | /* Toggle 0x12[2] off and on here? */ | ||
1117 | }; | ||
1118 | |||
1119 | static const struct ov_i2c_regvals norm_6x30[] = { | ||
1120 | { 0x12, 0x80 }, /* Reset */ | ||
1121 | { 0x00, 0x1f }, /* Gain */ | ||
1122 | { 0x01, 0x99 }, /* Blue gain */ | ||
1123 | { 0x02, 0x7c }, /* Red gain */ | ||
1124 | { 0x03, 0xc0 }, /* Saturation */ | ||
1125 | { 0x05, 0x0a }, /* Contrast */ | ||
1126 | { 0x06, 0x95 }, /* Brightness */ | ||
1127 | { 0x07, 0x2d }, /* Sharpness */ | ||
1128 | { 0x0c, 0x20 }, | ||
1129 | { 0x0d, 0x20 }, | ||
1130 | { 0x0e, 0x20 }, | ||
1131 | { 0x0f, 0x05 }, | ||
1132 | { 0x10, 0x9a }, | ||
1133 | { 0x11, 0x00 }, /* Pixel clock = fastest */ | ||
1134 | { 0x12, 0x24 }, /* Enable AGC and AWB */ | ||
1135 | { 0x13, 0x21 }, | ||
1136 | { 0x14, 0x80 }, | ||
1137 | { 0x15, 0x01 }, | ||
1138 | { 0x16, 0x03 }, | ||
1139 | { 0x17, 0x38 }, | ||
1140 | { 0x18, 0xea }, | ||
1141 | { 0x19, 0x04 }, | ||
1142 | { 0x1a, 0x93 }, | ||
1143 | { 0x1b, 0x00 }, | ||
1144 | { 0x1e, 0xc4 }, | ||
1145 | { 0x1f, 0x04 }, | ||
1146 | { 0x20, 0x20 }, | ||
1147 | { 0x21, 0x10 }, | ||
1148 | { 0x22, 0x88 }, | ||
1149 | { 0x23, 0xc0 }, /* Crystal circuit power level */ | ||
1150 | { 0x25, 0x9a }, /* Increase AEC black ratio */ | ||
1151 | { 0x26, 0xb2 }, /* BLC enable */ | ||
1152 | { 0x27, 0xa2 }, | ||
1153 | { 0x28, 0x00 }, | ||
1154 | { 0x29, 0x00 }, | ||
1155 | { 0x2a, 0x84 }, /* 60 Hz power */ | ||
1156 | { 0x2b, 0xa8 }, /* 60 Hz power */ | ||
1157 | { 0x2c, 0xa0 }, | ||
1158 | { 0x2d, 0x95 }, /* Enable auto-brightness */ | ||
1159 | { 0x2e, 0x88 }, | ||
1160 | { 0x33, 0x26 }, | ||
1161 | { 0x34, 0x03 }, | ||
1162 | { 0x36, 0x8f }, | ||
1163 | { 0x37, 0x80 }, | ||
1164 | { 0x38, 0x83 }, | ||
1165 | { 0x39, 0x80 }, | ||
1166 | { 0x3a, 0x0f }, | ||
1167 | { 0x3b, 0x3c }, | ||
1168 | { 0x3c, 0x1a }, | ||
1169 | { 0x3d, 0x80 }, | ||
1170 | { 0x3e, 0x80 }, | ||
1171 | { 0x3f, 0x0e }, | ||
1172 | { 0x40, 0x00 }, /* White bal */ | ||
1173 | { 0x41, 0x00 }, /* White bal */ | ||
1174 | { 0x42, 0x80 }, | ||
1175 | { 0x43, 0x3f }, /* White bal */ | ||
1176 | { 0x44, 0x80 }, | ||
1177 | { 0x45, 0x20 }, | ||
1178 | { 0x46, 0x20 }, | ||
1179 | { 0x47, 0x80 }, | ||
1180 | { 0x48, 0x7f }, | ||
1181 | { 0x49, 0x00 }, | ||
1182 | { 0x4a, 0x00 }, | ||
1183 | { 0x4b, 0x80 }, | ||
1184 | { 0x4c, 0xd0 }, | ||
1185 | { 0x4d, 0x10 }, /* U = 0.563u, V = 0.714v */ | ||
1186 | { 0x4e, 0x40 }, | ||
1187 | { 0x4f, 0x07 }, /* UV avg., col. killer: max */ | ||
1188 | { 0x50, 0xff }, | ||
1189 | { 0x54, 0x23 }, /* Max AGC gain: 18dB */ | ||
1190 | { 0x55, 0xff }, | ||
1191 | { 0x56, 0x12 }, | ||
1192 | { 0x57, 0x81 }, | ||
1193 | { 0x58, 0x75 }, | ||
1194 | { 0x59, 0x01 }, /* AGC dark current comp.: +1 */ | ||
1195 | { 0x5a, 0x2c }, | ||
1196 | { 0x5b, 0x0f }, /* AWB chrominance levels */ | ||
1197 | { 0x5c, 0x10 }, | ||
1198 | { 0x3d, 0x80 }, | ||
1199 | { 0x27, 0xa6 }, | ||
1200 | { 0x12, 0x20 }, /* Toggle AWB */ | ||
1201 | { 0x12, 0x24 }, | ||
1202 | }; | ||
1203 | |||
1204 | PDEBUG(D_PROBE, "starting sensor configuration"); | ||
1205 | |||
1206 | if (init_ov_sensor(sd) < 0) { | ||
1207 | PDEBUG(D_ERR, "Failed to read sensor ID."); | ||
1208 | return -1; | ||
1209 | } | ||
1210 | PDEBUG(D_PROBE, "OV6xx0 sensor detected"); | ||
1211 | 1239 | ||
1212 | /* Detect sensor (sub)type */ | 1240 | /* Detect sensor (sub)type */ |
1213 | rc = i2c_r(sd, OV7610_REG_COM_I); | 1241 | rc = i2c_r(sd, OV7610_REG_COM_I); |
@@ -1251,15 +1279,6 @@ static int ov6xx0_configure(struct sd *sd) | |||
1251 | /* Set sensor-specific vars */ | 1279 | /* Set sensor-specific vars */ |
1252 | sd->sif = 1; | 1280 | sd->sif = 1; |
1253 | 1281 | ||
1254 | if (sd->sensor == SEN_OV6620) { | ||
1255 | PDEBUG(D_PROBE, "Writing 6x20 registers"); | ||
1256 | if (write_i2c_regvals(sd, norm_6x20, ARRAY_SIZE(norm_6x20))) | ||
1257 | return -1; | ||
1258 | } else { | ||
1259 | PDEBUG(D_PROBE, "Writing 6x30 registers"); | ||
1260 | if (write_i2c_regvals(sd, norm_6x30, ARRAY_SIZE(norm_6x30))) | ||
1261 | return -1; | ||
1262 | } | ||
1263 | return 0; | 1282 | return 0; |
1264 | } | 1283 | } |
1265 | 1284 | ||
@@ -1298,22 +1317,31 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1298 | ov51x_led_control(sd, 0); /* turn LED off */ | 1317 | ov51x_led_control(sd, 0); /* turn LED off */ |
1299 | 1318 | ||
1300 | /* Test for 76xx */ | 1319 | /* Test for 76xx */ |
1301 | sd->primary_i2c_slave = OV7xx0_SID; | ||
1302 | if (ov51x_set_slave_ids(sd, OV7xx0_SID) < 0) | 1320 | if (ov51x_set_slave_ids(sd, OV7xx0_SID) < 0) |
1303 | goto error; | 1321 | goto error; |
1304 | 1322 | ||
1305 | /* The OV519 must be more aggressive about sensor detection since | 1323 | /* The OV519 must be more aggressive about sensor detection since |
1306 | * I2C write will never fail if the sensor is not present. We have | 1324 | * I2C write will never fail if the sensor is not present. We have |
1307 | * to try to initialize the sensor to detect its presence */ | 1325 | * to try to initialize the sensor to detect its presence */ |
1308 | if (init_ov_sensor(sd) < 0) { | 1326 | if (init_ov_sensor(sd) >= 0) { |
1327 | if (ov7xx0_configure(sd) < 0) { | ||
1328 | PDEBUG(D_ERR, "Failed to configure OV7xx0"); | ||
1329 | goto error; | ||
1330 | } | ||
1331 | } else { | ||
1332 | |||
1309 | /* Test for 6xx0 */ | 1333 | /* Test for 6xx0 */ |
1310 | sd->primary_i2c_slave = OV6xx0_SID; | ||
1311 | if (ov51x_set_slave_ids(sd, OV6xx0_SID) < 0) | 1334 | if (ov51x_set_slave_ids(sd, OV6xx0_SID) < 0) |
1312 | goto error; | 1335 | goto error; |
1313 | 1336 | ||
1314 | if (init_ov_sensor(sd) < 0) { | 1337 | if (init_ov_sensor(sd) >= 0) { |
1338 | if (ov6xx0_configure(sd) < 0) { | ||
1339 | PDEBUG(D_ERR, "Failed to configure OV6xx0"); | ||
1340 | goto error; | ||
1341 | } | ||
1342 | } else { | ||
1343 | |||
1315 | /* Test for 8xx0 */ | 1344 | /* Test for 8xx0 */ |
1316 | sd->primary_i2c_slave = OV8xx0_SID; | ||
1317 | if (ov51x_set_slave_ids(sd, OV8xx0_SID) < 0) | 1345 | if (ov51x_set_slave_ids(sd, OV8xx0_SID) < 0) |
1318 | goto error; | 1346 | goto error; |
1319 | 1347 | ||
@@ -1321,24 +1349,13 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1321 | PDEBUG(D_ERR, | 1349 | PDEBUG(D_ERR, |
1322 | "Can't determine sensor slave IDs"); | 1350 | "Can't determine sensor slave IDs"); |
1323 | goto error; | 1351 | goto error; |
1324 | } else { | ||
1325 | if (ov8xx0_configure(sd) < 0) { | ||
1326 | PDEBUG(D_ERR, | ||
1327 | "Failed to configure OV8xx0 sensor"); | ||
1328 | goto error; | ||
1329 | } | ||
1330 | } | 1352 | } |
1331 | } else { | 1353 | if (ov8xx0_configure(sd) < 0) { |
1332 | if (ov6xx0_configure(sd) < 0) { | 1354 | PDEBUG(D_ERR, |
1333 | PDEBUG(D_ERR, "Failed to configure OV6xx0"); | 1355 | "Failed to configure OV8xx0 sensor"); |
1334 | goto error; | 1356 | goto error; |
1335 | } | 1357 | } |
1336 | } | 1358 | } |
1337 | } else { | ||
1338 | if (ov7xx0_configure(sd) < 0) { | ||
1339 | PDEBUG(D_ERR, "Failed to configure OV7xx0"); | ||
1340 | goto error; | ||
1341 | } | ||
1342 | } | 1359 | } |
1343 | 1360 | ||
1344 | cam = &gspca_dev->cam; | 1361 | cam = &gspca_dev->cam; |
@@ -1355,15 +1372,53 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1355 | sd->colors = COLOR_DEF; | 1372 | sd->colors = COLOR_DEF; |
1356 | sd->hflip = HFLIP_DEF; | 1373 | sd->hflip = HFLIP_DEF; |
1357 | sd->vflip = VFLIP_DEF; | 1374 | sd->vflip = VFLIP_DEF; |
1375 | if (sd->sensor != SEN_OV7670) | ||
1376 | gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | ||
1377 | | (1 << VFLIP_IDX); | ||
1358 | return 0; | 1378 | return 0; |
1359 | error: | 1379 | error: |
1360 | PDEBUG(D_ERR, "OV519 Config failed"); | 1380 | PDEBUG(D_ERR, "OV519 Config failed"); |
1361 | return -EBUSY; | 1381 | return -EBUSY; |
1362 | } | 1382 | } |
1363 | 1383 | ||
1364 | /* this function is called at open time */ | 1384 | /* this function is called at probe and resume time */ |
1365 | static int sd_open(struct gspca_dev *gspca_dev) | 1385 | static int sd_init(struct gspca_dev *gspca_dev) |
1366 | { | 1386 | { |
1387 | struct sd *sd = (struct sd *) gspca_dev; | ||
1388 | |||
1389 | /* initialize the sensor */ | ||
1390 | switch (sd->sensor) { | ||
1391 | case SEN_OV6620: | ||
1392 | if (write_i2c_regvals(sd, norm_6x20, ARRAY_SIZE(norm_6x20))) | ||
1393 | return -EIO; | ||
1394 | break; | ||
1395 | case SEN_OV6630: | ||
1396 | if (write_i2c_regvals(sd, norm_6x30, ARRAY_SIZE(norm_6x30))) | ||
1397 | return -EIO; | ||
1398 | break; | ||
1399 | default: | ||
1400 | /* case SEN_OV7610: */ | ||
1401 | /* case SEN_OV76BE: */ | ||
1402 | if (write_i2c_regvals(sd, norm_7610, ARRAY_SIZE(norm_7610))) | ||
1403 | return -EIO; | ||
1404 | break; | ||
1405 | case SEN_OV7620: | ||
1406 | if (write_i2c_regvals(sd, norm_7620, ARRAY_SIZE(norm_7620))) | ||
1407 | return -EIO; | ||
1408 | break; | ||
1409 | case SEN_OV7640: | ||
1410 | if (write_i2c_regvals(sd, norm_7640, ARRAY_SIZE(norm_7640))) | ||
1411 | return -EIO; | ||
1412 | break; | ||
1413 | case SEN_OV7670: | ||
1414 | if (write_i2c_regvals(sd, norm_7670, ARRAY_SIZE(norm_7670))) | ||
1415 | return -EIO; | ||
1416 | break; | ||
1417 | case SEN_OV8610: | ||
1418 | if (write_i2c_regvals(sd, norm_8610, ARRAY_SIZE(norm_8610))) | ||
1419 | return -EIO; | ||
1420 | break; | ||
1421 | } | ||
1367 | return 0; | 1422 | return 0; |
1368 | } | 1423 | } |
1369 | 1424 | ||
@@ -1827,14 +1882,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1827 | ov51x_led_control((struct sd *) gspca_dev, 0); | 1882 | ov51x_led_control((struct sd *) gspca_dev, 0); |
1828 | } | 1883 | } |
1829 | 1884 | ||
1830 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1831 | { | ||
1832 | } | ||
1833 | |||
1834 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1835 | { | ||
1836 | } | ||
1837 | |||
1838 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1885 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1839 | struct gspca_frame *frame, /* target */ | 1886 | struct gspca_frame *frame, /* target */ |
1840 | __u8 *data, /* isoc packet */ | 1887 | __u8 *data, /* isoc packet */ |
@@ -2091,11 +2138,9 @@ static const struct sd_desc sd_desc = { | |||
2091 | .ctrls = sd_ctrls, | 2138 | .ctrls = sd_ctrls, |
2092 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2139 | .nctrls = ARRAY_SIZE(sd_ctrls), |
2093 | .config = sd_config, | 2140 | .config = sd_config, |
2094 | .open = sd_open, | 2141 | .init = sd_init, |
2095 | .start = sd_start, | 2142 | .start = sd_start, |
2096 | .stopN = sd_stopN, | 2143 | .stopN = sd_stopN, |
2097 | .stop0 = sd_stop0, | ||
2098 | .close = sd_close, | ||
2099 | .pkt_scan = sd_pkt_scan, | 2144 | .pkt_scan = sd_pkt_scan, |
2100 | }; | 2145 | }; |
2101 | 2146 | ||
@@ -2132,6 +2177,10 @@ static struct usb_driver sd_driver = { | |||
2132 | .id_table = device_table, | 2177 | .id_table = device_table, |
2133 | .probe = sd_probe, | 2178 | .probe = sd_probe, |
2134 | .disconnect = gspca_disconnect, | 2179 | .disconnect = gspca_disconnect, |
2180 | #ifdef CONFIG_PM | ||
2181 | .suspend = gspca_suspend, | ||
2182 | .resume = gspca_resume, | ||
2183 | #endif | ||
2135 | }; | 2184 | }; |
2136 | 2185 | ||
2137 | /* -- module insert / remove -- */ | 2186 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index 7ef18d578811..83b5f740c947 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c | |||
@@ -56,12 +56,6 @@ MODULE_LICENSE("GPL"); | |||
56 | #define PAC207_GAIN_KNEE 20 | 56 | #define PAC207_GAIN_KNEE 20 |
57 | 57 | ||
58 | #define PAC207_AUTOGAIN_DEADZONE 30 | 58 | #define PAC207_AUTOGAIN_DEADZONE 30 |
59 | /* We calculating the autogain at the end of the transfer of a frame, at this | ||
60 | moment a frame with the old settings is being transmitted, and a frame is | ||
61 | being captured with the old settings. So if we adjust the autogain we must | ||
62 | ignore atleast the 2 next frames for the new settings to come into effect | ||
63 | before doing any other adjustments */ | ||
64 | #define PAC207_AUTOGAIN_IGNORE_FRAMES 3 | ||
65 | 59 | ||
66 | /* specific webcam descriptor */ | 60 | /* specific webcam descriptor */ |
67 | struct sd { | 61 | struct sd { |
@@ -131,7 +125,8 @@ static struct ctrl sd_ctrls[] = { | |||
131 | .minimum = 0, | 125 | .minimum = 0, |
132 | .maximum = 1, | 126 | .maximum = 1, |
133 | .step = 1, | 127 | .step = 1, |
134 | .default_value = 1, | 128 | #define AUTOGAIN_DEF 1 |
129 | .default_value = AUTOGAIN_DEF, | ||
135 | .flags = 0, | 130 | .flags = 0, |
136 | }, | 131 | }, |
137 | .set = sd_setautogain, | 132 | .set = sd_setautogain, |
@@ -181,9 +176,6 @@ static const __u8 pac207_sensor_init[][8] = { | |||
181 | /* 48 reg_72 Rate Control end BalSize_4a =0x36 */ | 176 | /* 48 reg_72 Rate Control end BalSize_4a =0x36 */ |
182 | static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 }; | 177 | static const __u8 PacReg72[] = { 0x00, 0x00, 0x36, 0x00 }; |
183 | 178 | ||
184 | static const unsigned char pac207_sof_marker[5] = | ||
185 | { 0xff, 0xff, 0x00, 0xff, 0x96 }; | ||
186 | |||
187 | static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index, | 179 | static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index, |
188 | const u8 *buffer, u16 length) | 180 | const u8 *buffer, u16 length) |
189 | { | 181 | { |
@@ -259,35 +251,32 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
259 | return -ENODEV; | 251 | return -ENODEV; |
260 | } | 252 | } |
261 | 253 | ||
262 | pac207_write_reg(gspca_dev, 0x41, 0x00); | ||
263 | /* Bit_0=Image Format, | ||
264 | * Bit_1=LED, | ||
265 | * Bit_2=Compression test mode enable */ | ||
266 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ | ||
267 | pac207_write_reg(gspca_dev, 0x11, 0x30); /* Analog Bias */ | ||
268 | |||
269 | PDEBUG(D_PROBE, | 254 | PDEBUG(D_PROBE, |
270 | "Pixart PAC207BCA Image Processor and Control Chip detected" | 255 | "Pixart PAC207BCA Image Processor and Control Chip detected" |
271 | " (vid/pid 0x%04X:0x%04X)", id->idVendor, id->idProduct); | 256 | " (vid/pid 0x%04X:0x%04X)", id->idVendor, id->idProduct); |
272 | 257 | ||
273 | cam = &gspca_dev->cam; | 258 | cam = &gspca_dev->cam; |
274 | cam->dev_name = (char *) id->driver_info; | ||
275 | cam->epaddr = 0x05; | 259 | cam->epaddr = 0x05; |
276 | cam->cam_mode = sif_mode; | 260 | cam->cam_mode = sif_mode; |
277 | cam->nmodes = ARRAY_SIZE(sif_mode); | 261 | cam->nmodes = ARRAY_SIZE(sif_mode); |
278 | sd->brightness = PAC207_BRIGHTNESS_DEFAULT; | 262 | sd->brightness = PAC207_BRIGHTNESS_DEFAULT; |
279 | sd->exposure = PAC207_EXPOSURE_DEFAULT; | 263 | sd->exposure = PAC207_EXPOSURE_DEFAULT; |
280 | sd->gain = PAC207_GAIN_DEFAULT; | 264 | sd->gain = PAC207_GAIN_DEFAULT; |
265 | sd->autogain = AUTOGAIN_DEF; | ||
281 | 266 | ||
282 | return 0; | 267 | return 0; |
283 | } | 268 | } |
284 | 269 | ||
285 | /* this function is called at open time */ | 270 | /* this function is called at probe and resume time */ |
286 | static int sd_open(struct gspca_dev *gspca_dev) | 271 | static int sd_init(struct gspca_dev *gspca_dev) |
287 | { | 272 | { |
288 | struct sd *sd = (struct sd *) gspca_dev; | 273 | pac207_write_reg(gspca_dev, 0x41, 0x00); |
274 | /* Bit_0=Image Format, | ||
275 | * Bit_1=LED, | ||
276 | * Bit_2=Compression test mode enable */ | ||
277 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ | ||
278 | pac207_write_reg(gspca_dev, 0x11, 0x30); /* Analog Bias */ | ||
289 | 279 | ||
290 | sd->autogain = 1; | ||
291 | return 0; | 280 | return 0; |
292 | } | 281 | } |
293 | 282 | ||
@@ -343,14 +332,8 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
343 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ | 332 | pac207_write_reg(gspca_dev, 0x0f, 0x00); /* Power Control */ |
344 | } | 333 | } |
345 | 334 | ||
346 | static void sd_stop0(struct gspca_dev *gspca_dev) | 335 | /* Include pac common sof detection functions */ |
347 | { | 336 | #include "pac_common.h" |
348 | } | ||
349 | |||
350 | /* this function is called at close time */ | ||
351 | static void sd_close(struct gspca_dev *gspca_dev) | ||
352 | { | ||
353 | } | ||
354 | 337 | ||
355 | static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) | 338 | static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) |
356 | { | 339 | { |
@@ -365,33 +348,7 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev) | |||
365 | else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum, | 348 | else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum, |
366 | 100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE, | 349 | 100 + sd->brightness / 2, PAC207_AUTOGAIN_DEADZONE, |
367 | PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE)) | 350 | PAC207_GAIN_KNEE, PAC207_EXPOSURE_KNEE)) |
368 | sd->autogain_ignore_frames = PAC207_AUTOGAIN_IGNORE_FRAMES; | 351 | sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES; |
369 | } | ||
370 | |||
371 | static unsigned char *pac207_find_sof(struct gspca_dev *gspca_dev, | ||
372 | unsigned char *m, int len) | ||
373 | { | ||
374 | struct sd *sd = (struct sd *) gspca_dev; | ||
375 | int i; | ||
376 | |||
377 | /* Search for the SOF marker (fixed part) in the header */ | ||
378 | for (i = 0; i < len; i++) { | ||
379 | if (m[i] == pac207_sof_marker[sd->sof_read]) { | ||
380 | sd->sof_read++; | ||
381 | if (sd->sof_read == sizeof(pac207_sof_marker)) { | ||
382 | PDEBUG(D_STREAM, | ||
383 | "SOF found, bytes to analyze: %u." | ||
384 | " Frame starts at byte #%u", | ||
385 | len, i + 1); | ||
386 | sd->sof_read = 0; | ||
387 | return m + i + 1; | ||
388 | } | ||
389 | } else { | ||
390 | sd->sof_read = 0; | ||
391 | } | ||
392 | } | ||
393 | |||
394 | return NULL; | ||
395 | } | 352 | } |
396 | 353 | ||
397 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 354 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
@@ -402,14 +359,14 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
402 | struct sd *sd = (struct sd *) gspca_dev; | 359 | struct sd *sd = (struct sd *) gspca_dev; |
403 | unsigned char *sof; | 360 | unsigned char *sof; |
404 | 361 | ||
405 | sof = pac207_find_sof(gspca_dev, data, len); | 362 | sof = pac_find_sof(gspca_dev, data, len); |
406 | if (sof) { | 363 | if (sof) { |
407 | int n; | 364 | int n; |
408 | 365 | ||
409 | /* finish decoding current frame */ | 366 | /* finish decoding current frame */ |
410 | n = sof - data; | 367 | n = sof - data; |
411 | if (n > sizeof pac207_sof_marker) | 368 | if (n > sizeof pac_sof_marker) |
412 | n -= sizeof pac207_sof_marker; | 369 | n -= sizeof pac_sof_marker; |
413 | else | 370 | else |
414 | n = 0; | 371 | n = 0; |
415 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, | 372 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, |
@@ -537,7 +494,7 @@ static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val) | |||
537 | sd->gain = PAC207_GAIN_DEFAULT; | 494 | sd->gain = PAC207_GAIN_DEFAULT; |
538 | if (gspca_dev->streaming) { | 495 | if (gspca_dev->streaming) { |
539 | sd->autogain_ignore_frames = | 496 | sd->autogain_ignore_frames = |
540 | PAC207_AUTOGAIN_IGNORE_FRAMES; | 497 | PAC_AUTOGAIN_IGNORE_FRAMES; |
541 | setexposure(gspca_dev); | 498 | setexposure(gspca_dev); |
542 | setgain(gspca_dev); | 499 | setgain(gspca_dev); |
543 | } | 500 | } |
@@ -560,11 +517,9 @@ static const struct sd_desc sd_desc = { | |||
560 | .ctrls = sd_ctrls, | 517 | .ctrls = sd_ctrls, |
561 | .nctrls = ARRAY_SIZE(sd_ctrls), | 518 | .nctrls = ARRAY_SIZE(sd_ctrls), |
562 | .config = sd_config, | 519 | .config = sd_config, |
563 | .open = sd_open, | 520 | .init = sd_init, |
564 | .start = sd_start, | 521 | .start = sd_start, |
565 | .stopN = sd_stopN, | 522 | .stopN = sd_stopN, |
566 | .stop0 = sd_stop0, | ||
567 | .close = sd_close, | ||
568 | .dq_callback = pac207_do_auto_gain, | 523 | .dq_callback = pac207_do_auto_gain, |
569 | .pkt_scan = sd_pkt_scan, | 524 | .pkt_scan = sd_pkt_scan, |
570 | }; | 525 | }; |
@@ -597,6 +552,10 @@ static struct usb_driver sd_driver = { | |||
597 | .id_table = device_table, | 552 | .id_table = device_table, |
598 | .probe = sd_probe, | 553 | .probe = sd_probe, |
599 | .disconnect = gspca_disconnect, | 554 | .disconnect = gspca_disconnect, |
555 | #ifdef CONFIG_PM | ||
556 | .suspend = gspca_suspend, | ||
557 | .resume = gspca_resume, | ||
558 | #endif | ||
600 | }; | 559 | }; |
601 | 560 | ||
602 | /* -- module insert / remove -- */ | 561 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 815bea6edc44..d4be51843286 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -19,6 +19,36 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* Some documentation about various registers as determined by trial and error. | ||
23 | When the register addresses differ between the 7202 and the 7311 the 2 | ||
24 | different addresses are written as 7302addr/7311addr, when one of the 2 | ||
25 | addresses is a - sign that register description is not valid for the | ||
26 | matching IC. | ||
27 | |||
28 | Register page 1: | ||
29 | |||
30 | Address Description | ||
31 | -/0x08 Unknown compressor related, must always be 8 except when not | ||
32 | in 640x480 resolution and page 4 reg 2 <= 3 then set it to 9 ! | ||
33 | -/0x1b Auto white balance related, bit 0 is AWB enable (inverted) | ||
34 | bits 345 seem to toggle per color gains on/off (inverted) | ||
35 | 0x78 Global control, bit 6 controls the LED (inverted) | ||
36 | -/0x80 JPEG compression ratio ? Best not touched | ||
37 | |||
38 | Register page 3/4: | ||
39 | |||
40 | Address Description | ||
41 | 0x02 Clock divider 2-63, fps =~ 60 / val. Must be a multiple of 3 on | ||
42 | the 7302, so one of 3, 6, 9, ..., except when between 6 and 12? | ||
43 | -/0x0f Master gain 1-245, low value = high gain | ||
44 | 0x10/- Master gain 0-31 | ||
45 | -/0x10 Another gain 0-15, limited influence (1-2x gain I guess) | ||
46 | 0x21 Bitfield: 0-1 unused, 2-3 vflip/hflip, 4-5 unknown, 6-7 unused | ||
47 | -/0x27 Seems to toggle various gains on / off, Setting bit 7 seems to | ||
48 | completely disable the analog amplification block. Set to 0x68 | ||
49 | for max gain, 0x14 for minimal gain. | ||
50 | */ | ||
51 | |||
22 | #define MODULE_NAME "pac7311" | 52 | #define MODULE_NAME "pac7311" |
23 | 53 | ||
24 | #include "gspca.h" | 54 | #include "gspca.h" |
@@ -31,18 +61,23 @@ MODULE_LICENSE("GPL"); | |||
31 | struct sd { | 61 | struct sd { |
32 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 62 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
33 | 63 | ||
34 | int lum_sum; | ||
35 | atomic_t avg_lum; | ||
36 | atomic_t do_gain; | ||
37 | |||
38 | unsigned char brightness; | 64 | unsigned char brightness; |
39 | unsigned char contrast; | 65 | unsigned char contrast; |
40 | unsigned char colors; | 66 | unsigned char colors; |
67 | unsigned char gain; | ||
68 | unsigned char exposure; | ||
41 | unsigned char autogain; | 69 | unsigned char autogain; |
70 | __u8 hflip; | ||
71 | __u8 vflip; | ||
72 | |||
73 | __u8 sensor; | ||
74 | #define SENSOR_PAC7302 0 | ||
75 | #define SENSOR_PAC7311 1 | ||
42 | 76 | ||
43 | char ffseq; | 77 | u8 sof_read; |
44 | signed char ag_cnt; | 78 | u8 autogain_ignore_frames; |
45 | #define AG_CNT_START 13 | 79 | |
80 | atomic_t avg_lum; | ||
46 | }; | 81 | }; |
47 | 82 | ||
48 | /* V4L2 controls supported by the driver */ | 83 | /* V4L2 controls supported by the driver */ |
@@ -54,8 +89,18 @@ static int sd_setcolors(struct gspca_dev *gspca_dev, __s32 val); | |||
54 | static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val); | 89 | static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val); |
55 | static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); | 90 | static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); |
56 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); | 91 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); |
92 | static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val); | ||
93 | static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val); | ||
94 | static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val); | ||
95 | static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val); | ||
96 | static int sd_setgain(struct gspca_dev *gspca_dev, __s32 val); | ||
97 | static int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val); | ||
98 | static int sd_setexposure(struct gspca_dev *gspca_dev, __s32 val); | ||
99 | static int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val); | ||
57 | 100 | ||
58 | static struct ctrl sd_ctrls[] = { | 101 | static struct ctrl sd_ctrls[] = { |
102 | /* This control is pac7302 only */ | ||
103 | #define BRIGHTNESS_IDX 0 | ||
59 | { | 104 | { |
60 | { | 105 | { |
61 | .id = V4L2_CID_BRIGHTNESS, | 106 | .id = V4L2_CID_BRIGHTNESS, |
@@ -71,13 +116,15 @@ static struct ctrl sd_ctrls[] = { | |||
71 | .set = sd_setbrightness, | 116 | .set = sd_setbrightness, |
72 | .get = sd_getbrightness, | 117 | .get = sd_getbrightness, |
73 | }, | 118 | }, |
119 | /* This control is for both the 7302 and the 7311 */ | ||
74 | { | 120 | { |
75 | { | 121 | { |
76 | .id = V4L2_CID_CONTRAST, | 122 | .id = V4L2_CID_CONTRAST, |
77 | .type = V4L2_CTRL_TYPE_INTEGER, | 123 | .type = V4L2_CTRL_TYPE_INTEGER, |
78 | .name = "Contrast", | 124 | .name = "Contrast", |
79 | .minimum = 0, | 125 | .minimum = 0, |
80 | .maximum = 255, | 126 | #define CONTRAST_MAX 255 |
127 | .maximum = CONTRAST_MAX, | ||
81 | .step = 1, | 128 | .step = 1, |
82 | #define CONTRAST_DEF 127 | 129 | #define CONTRAST_DEF 127 |
83 | .default_value = CONTRAST_DEF, | 130 | .default_value = CONTRAST_DEF, |
@@ -85,13 +132,16 @@ static struct ctrl sd_ctrls[] = { | |||
85 | .set = sd_setcontrast, | 132 | .set = sd_setcontrast, |
86 | .get = sd_getcontrast, | 133 | .get = sd_getcontrast, |
87 | }, | 134 | }, |
135 | /* This control is pac7302 only */ | ||
136 | #define SATURATION_IDX 2 | ||
88 | { | 137 | { |
89 | { | 138 | { |
90 | .id = V4L2_CID_SATURATION, | 139 | .id = V4L2_CID_SATURATION, |
91 | .type = V4L2_CTRL_TYPE_INTEGER, | 140 | .type = V4L2_CTRL_TYPE_INTEGER, |
92 | .name = "Color", | 141 | .name = "Saturation", |
93 | .minimum = 0, | 142 | .minimum = 0, |
94 | .maximum = 255, | 143 | #define COLOR_MAX 255 |
144 | .maximum = COLOR_MAX, | ||
95 | .step = 1, | 145 | .step = 1, |
96 | #define COLOR_DEF 127 | 146 | #define COLOR_DEF 127 |
97 | .default_value = COLOR_DEF, | 147 | .default_value = COLOR_DEF, |
@@ -99,6 +149,39 @@ static struct ctrl sd_ctrls[] = { | |||
99 | .set = sd_setcolors, | 149 | .set = sd_setcolors, |
100 | .get = sd_getcolors, | 150 | .get = sd_getcolors, |
101 | }, | 151 | }, |
152 | /* All controls below are for both the 7302 and the 7311 */ | ||
153 | { | ||
154 | { | ||
155 | .id = V4L2_CID_GAIN, | ||
156 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
157 | .name = "Gain", | ||
158 | .minimum = 0, | ||
159 | #define GAIN_MAX 255 | ||
160 | .maximum = GAIN_MAX, | ||
161 | .step = 1, | ||
162 | #define GAIN_DEF 127 | ||
163 | #define GAIN_KNEE 255 /* Gain seems to cause little noise on the pac73xx */ | ||
164 | .default_value = GAIN_DEF, | ||
165 | }, | ||
166 | .set = sd_setgain, | ||
167 | .get = sd_getgain, | ||
168 | }, | ||
169 | { | ||
170 | { | ||
171 | .id = V4L2_CID_EXPOSURE, | ||
172 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
173 | .name = "Exposure", | ||
174 | .minimum = 0, | ||
175 | #define EXPOSURE_MAX 255 | ||
176 | .maximum = EXPOSURE_MAX, | ||
177 | .step = 1, | ||
178 | #define EXPOSURE_DEF 16 /* 32 ms / 30 fps */ | ||
179 | #define EXPOSURE_KNEE 50 /* 100 ms / 10 fps */ | ||
180 | .default_value = EXPOSURE_DEF, | ||
181 | }, | ||
182 | .set = sd_setexposure, | ||
183 | .get = sd_getexposure, | ||
184 | }, | ||
102 | { | 185 | { |
103 | { | 186 | { |
104 | .id = V4L2_CID_AUTOGAIN, | 187 | .id = V4L2_CID_AUTOGAIN, |
@@ -113,101 +196,207 @@ static struct ctrl sd_ctrls[] = { | |||
113 | .set = sd_setautogain, | 196 | .set = sd_setautogain, |
114 | .get = sd_getautogain, | 197 | .get = sd_getautogain, |
115 | }, | 198 | }, |
199 | { | ||
200 | { | ||
201 | .id = V4L2_CID_HFLIP, | ||
202 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
203 | .name = "Mirror", | ||
204 | .minimum = 0, | ||
205 | .maximum = 1, | ||
206 | .step = 1, | ||
207 | #define HFLIP_DEF 0 | ||
208 | .default_value = HFLIP_DEF, | ||
209 | }, | ||
210 | .set = sd_sethflip, | ||
211 | .get = sd_gethflip, | ||
212 | }, | ||
213 | { | ||
214 | { | ||
215 | .id = V4L2_CID_VFLIP, | ||
216 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
217 | .name = "Vflip", | ||
218 | .minimum = 0, | ||
219 | .maximum = 1, | ||
220 | .step = 1, | ||
221 | #define VFLIP_DEF 0 | ||
222 | .default_value = VFLIP_DEF, | ||
223 | }, | ||
224 | .set = sd_setvflip, | ||
225 | .get = sd_getvflip, | ||
226 | }, | ||
116 | }; | 227 | }; |
117 | 228 | ||
118 | static struct v4l2_pix_format vga_mode[] = { | 229 | static struct v4l2_pix_format vga_mode[] = { |
119 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 230 | {160, 120, V4L2_PIX_FMT_PJPG, V4L2_FIELD_NONE, |
120 | .bytesperline = 160, | 231 | .bytesperline = 160, |
121 | .sizeimage = 160 * 120 * 3 / 8 + 590, | 232 | .sizeimage = 160 * 120 * 3 / 8 + 590, |
122 | .colorspace = V4L2_COLORSPACE_JPEG, | 233 | .colorspace = V4L2_COLORSPACE_JPEG, |
123 | .priv = 2}, | 234 | .priv = 2}, |
124 | {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 235 | {320, 240, V4L2_PIX_FMT_PJPG, V4L2_FIELD_NONE, |
125 | .bytesperline = 320, | 236 | .bytesperline = 320, |
126 | .sizeimage = 320 * 240 * 3 / 8 + 590, | 237 | .sizeimage = 320 * 240 * 3 / 8 + 590, |
127 | .colorspace = V4L2_COLORSPACE_JPEG, | 238 | .colorspace = V4L2_COLORSPACE_JPEG, |
128 | .priv = 1}, | 239 | .priv = 1}, |
129 | {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 240 | {640, 480, V4L2_PIX_FMT_PJPG, V4L2_FIELD_NONE, |
130 | .bytesperline = 640, | 241 | .bytesperline = 640, |
131 | .sizeimage = 640 * 480 * 3 / 8 + 590, | 242 | .sizeimage = 640 * 480 * 3 / 8 + 590, |
132 | .colorspace = V4L2_COLORSPACE_JPEG, | 243 | .colorspace = V4L2_COLORSPACE_JPEG, |
133 | .priv = 0}, | 244 | .priv = 0}, |
134 | }; | 245 | }; |
135 | 246 | ||
136 | #define PAC7311_JPEG_HEADER_SIZE (sizeof pac7311_jpeg_header) /* (594) */ | 247 | /* pac 7302 */ |
137 | 248 | static const __u8 init_7302[] = { | |
138 | static const __u8 pac7311_jpeg_header[] = { | 249 | /* index,value */ |
139 | 0xff, 0xd8, | 250 | 0xff, 0x01, /* page 1 */ |
140 | 0xff, 0xe0, 0x00, 0x03, 0x20, | 251 | 0x78, 0x00, /* deactivate */ |
141 | 0xff, 0xc0, 0x00, 0x11, 0x08, | 252 | 0xff, 0x01, |
142 | 0x01, 0xe0, /* 12: height */ | 253 | 0x78, 0x40, /* led off */ |
143 | 0x02, 0x80, /* 14: width */ | 254 | }; |
144 | 0x03, /* 16 */ | 255 | static const __u8 start_7302[] = { |
145 | 0x01, 0x21, 0x00, | 256 | /* index, len, [value]* */ |
146 | 0x02, 0x11, 0x01, | 257 | 0xff, 1, 0x00, /* page 0 */ |
147 | 0x03, 0x11, 0x01, | 258 | 0x00, 12, 0x01, 0x40, 0x40, 0x40, 0x01, 0xe0, 0x02, 0x80, |
148 | 0xff, 0xdb, 0x00, 0x84, | 259 | 0x00, 0x00, 0x00, 0x00, |
149 | 0x00, 0x10, 0x0b, 0x0c, 0x0e, 0x0c, 0x0a, 0x10, 0x0e, 0x0d, | 260 | 0x0d, 24, 0x03, 0x01, 0x00, 0xb5, 0x07, 0xcb, 0x00, 0x00, |
150 | 0x0e, 0x12, 0x11, 0x10, 0x13, 0x18, 0x28, 0x1a, 0x18, 0x16, | 261 | 0x07, 0xc8, 0x00, 0xea, 0x07, 0xcf, 0x07, 0xf7, |
151 | 0x16, 0x18, 0x31, 0x23, 0x25, 0x1d, 0x28, 0x3a, 0x33, 0x3d, | 262 | 0x07, 0x7e, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x11, |
152 | 0x3c, 0x39, 0x33, 0x38, 0x37, 0x40, 0x48, 0x5c, 0x4e, 0x40, | 263 | 0x26, 2, 0xaa, 0xaa, |
153 | 0x44, 0x57, 0x45, 0x37, 0x38, 0x50, 0x6d, 0x51, 0x57, 0x5f, | 264 | 0x2e, 1, 0x31, |
154 | 0x62, 0x67, 0x68, 0x67, 0x3e, 0x4d, 0x71, 0x79, 0x70, 0x64, | 265 | 0x38, 1, 0x01, |
155 | 0x78, 0x5c, 0x65, 0x67, 0x63, 0x01, 0x11, 0x12, 0x12, 0x18, | 266 | 0x3a, 3, 0x14, 0xff, 0x5a, |
156 | 0x15, 0x18, 0x2f, 0x1a, 0x1a, 0x2f, 0x63, 0x42, 0x38, 0x42, | 267 | 0x43, 11, 0x00, 0x0a, 0x18, 0x11, 0x01, 0x2c, 0x88, 0x11, |
157 | 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, | 268 | 0x00, 0x54, 0x11, |
158 | 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, | 269 | 0x55, 1, 0x00, |
159 | 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, | 270 | 0x62, 4, 0x10, 0x1e, 0x1e, 0x18, |
160 | 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, | 271 | 0x6b, 1, 0x00, |
161 | 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, | 272 | 0x6e, 3, 0x08, 0x06, 0x00, |
162 | 0xff, 0xc4, 0x01, 0xa2, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, | 273 | 0x72, 3, 0x00, 0xff, 0x00, |
163 | 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 274 | 0x7d, 23, 0x01, 0x01, 0x58, 0x46, 0x50, 0x3c, 0x50, 0x3c, |
164 | 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, | 275 | 0x54, 0x46, 0x54, 0x56, 0x52, 0x50, 0x52, 0x50, |
165 | 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, | 276 | 0x56, 0x64, 0xa4, 0x00, 0xda, 0x00, 0x00, |
166 | 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, | 277 | 0xa2, 10, 0x22, 0x2c, 0x3c, 0x54, 0x69, 0x7c, 0x9c, 0xb9, |
167 | 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12, 0x21, 0x31, | 278 | 0xd2, 0xeb, |
168 | 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, | 279 | 0xaf, 1, 0x02, |
169 | 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, | 280 | 0xb5, 2, 0x08, 0x08, |
170 | 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16, | 281 | 0xb8, 2, 0x08, 0x88, |
171 | 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, | 282 | 0xc4, 4, 0xae, 0x01, 0x04, 0x01, |
172 | 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, | 283 | 0xcc, 1, 0x00, |
173 | 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, | 284 | 0xd1, 11, 0x01, 0x30, 0x49, 0x5e, 0x6f, 0x7f, 0x8e, 0xa9, |
174 | 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, | 285 | 0xc1, 0xd7, 0xec, |
175 | 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, | 286 | 0xdc, 1, 0x01, |
176 | 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, | 287 | 0xff, 1, 0x01, /* page 1 */ |
177 | 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, | 288 | 0x12, 3, 0x02, 0x00, 0x01, |
178 | 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, | 289 | 0x3e, 2, 0x00, 0x00, |
179 | 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, | 290 | 0x76, 5, 0x01, 0x20, 0x40, 0x00, 0xf2, |
180 | 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, | 291 | 0x7c, 1, 0x00, |
181 | 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, | 292 | 0x7f, 10, 0x4b, 0x0f, 0x01, 0x2c, 0x02, 0x58, 0x03, 0x20, |
182 | 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, | 293 | 0x02, 0x00, |
183 | 0xf9, 0xfa, 0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, | 294 | 0x96, 5, 0x01, 0x10, 0x04, 0x01, 0x04, |
184 | 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 295 | 0xc8, 14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, |
185 | 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, | 296 | 0x07, 0x00, 0x01, 0x07, 0x04, 0x01, |
186 | 0x0b, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, | 297 | 0xd8, 1, 0x01, |
187 | 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, | 298 | 0xdb, 2, 0x00, 0x01, |
188 | 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, | 299 | 0xde, 7, 0x00, 0x01, 0x04, 0x04, 0x00, 0x00, 0x00, |
189 | 0x51, 0x07, 0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, | 300 | 0xe6, 4, 0x00, 0x00, 0x00, 0x01, |
190 | 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, | 301 | 0xeb, 1, 0x00, |
191 | 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, | 302 | 0xff, 1, 0x02, /* page 2 */ |
192 | 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, | 303 | 0x22, 1, 0x00, |
193 | 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, | 304 | 0xff, 1, 0x03, /* page 3 */ |
194 | 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, | 305 | 0x00, 255, /* load the page 3 */ |
195 | 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, | 306 | 0x11, 1, 0x01, |
196 | 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, | 307 | 0xff, 1, 0x02, /* page 2 */ |
197 | 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, | 308 | 0x13, 1, 0x00, |
198 | 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, | 309 | 0x22, 4, 0x1f, 0xa4, 0xf0, 0x96, |
199 | 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, | 310 | 0x27, 2, 0x14, 0x0c, |
200 | 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, | 311 | 0x2a, 5, 0xc8, 0x00, 0x18, 0x12, 0x22, |
201 | 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, | 312 | 0x64, 8, 0x00, 0x00, 0xf0, 0x01, 0x14, 0x44, 0x44, 0x44, |
202 | 0xd9, 0xda, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, | 313 | 0x6e, 1, 0x08, |
203 | 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, | 314 | 0xff, 1, 0x01, /* page 1 */ |
204 | 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, | 315 | 0x78, 1, 0x00, |
205 | 0x11, 0x00, 0x3f, 0x00 | 316 | 0, 0 /* end of sequence */ |
317 | }; | ||
318 | |||
319 | /* page 3 - the value 0xaa says skip the index - see reg_w_page() */ | ||
320 | static const __u8 page3_7302[] = { | ||
321 | 0x90, 0x40, 0x03, 0x50, 0xc2, 0x01, 0x14, 0x16, | ||
322 | 0x14, 0x12, 0x00, 0x00, 0x00, 0x02, 0x33, 0x00, | ||
323 | 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
324 | 0x00, 0x00, 0x00, 0x47, 0x01, 0xb3, 0x01, 0x00, | ||
325 | 0x00, 0x08, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x21, | ||
326 | 0x00, 0x00, 0x00, 0x54, 0xf4, 0x02, 0x52, 0x54, | ||
327 | 0xa4, 0xb8, 0xe0, 0x2a, 0xf6, 0x00, 0x00, 0x00, | ||
328 | 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
329 | 0x00, 0xfc, 0x00, 0xf2, 0x1f, 0x04, 0x00, 0x00, | ||
330 | 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x10, 0x00, 0x00, | ||
331 | 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
332 | 0x00, 0x40, 0xff, 0x03, 0x19, 0x00, 0x00, 0x00, | ||
333 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
334 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0xc8, 0xc8, | ||
335 | 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, | ||
336 | 0x08, 0x10, 0x24, 0x40, 0x00, 0x00, 0x00, 0x00, | ||
337 | 0x01, 0x00, 0x02, 0x47, 0x00, 0x00, 0x00, 0x00, | ||
338 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
339 | 0x00, 0x02, 0xfa, 0x00, 0x64, 0x5a, 0x28, 0x00, | ||
340 | 0x00 | ||
341 | }; | ||
342 | |||
343 | /* pac 7311 */ | ||
344 | static const __u8 init_7311[] = { | ||
345 | 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ | ||
346 | 0x78, 0x40, /* Bit_0=start stream, Bit_6=LED */ | ||
347 | 0x78, 0x44, /* Bit_0=start stream, Bit_6=LED */ | ||
348 | 0xff, 0x04, | ||
349 | 0x27, 0x80, | ||
350 | 0x28, 0xca, | ||
351 | 0x29, 0x53, | ||
352 | 0x2a, 0x0e, | ||
353 | 0xff, 0x01, | ||
354 | 0x3e, 0x20, | ||
355 | }; | ||
356 | |||
357 | static const __u8 start_7311[] = { | ||
358 | /* index, len, [value]* */ | ||
359 | 0xff, 1, 0x01, /* page 1 */ | ||
360 | 0x02, 43, 0x48, 0x0a, 0x40, 0x08, 0x00, 0x00, 0x08, 0x00, | ||
361 | 0x06, 0xff, 0x11, 0xff, 0x5a, 0x30, 0x90, 0x4c, | ||
362 | 0x00, 0x07, 0x00, 0x0a, 0x10, 0x00, 0xa0, 0x10, | ||
363 | 0x02, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x01, 0x00, | ||
364 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
365 | 0x00, 0x00, 0x00, | ||
366 | 0x3e, 42, 0x00, 0x00, 0x78, 0x52, 0x4a, 0x52, 0x78, 0x6e, | ||
367 | 0x48, 0x46, 0x48, 0x6e, 0x5f, 0x49, 0x42, 0x49, | ||
368 | 0x5f, 0x5f, 0x49, 0x42, 0x49, 0x5f, 0x6e, 0x48, | ||
369 | 0x46, 0x48, 0x6e, 0x78, 0x52, 0x4a, 0x52, 0x78, | ||
370 | 0x00, 0x00, 0x09, 0x1b, 0x34, 0x49, 0x5c, 0x9b, | ||
371 | 0xd0, 0xff, | ||
372 | 0x78, 6, 0x44, 0x00, 0xf2, 0x01, 0x01, 0x80, | ||
373 | 0x7f, 18, 0x2a, 0x1c, 0x00, 0xc8, 0x02, 0x58, 0x03, 0x84, | ||
374 | 0x12, 0x00, 0x1a, 0x04, 0x08, 0x0c, 0x10, 0x14, | ||
375 | 0x18, 0x20, | ||
376 | 0x96, 3, 0x01, 0x08, 0x04, | ||
377 | 0xa0, 4, 0x44, 0x44, 0x44, 0x04, | ||
378 | 0xf0, 13, 0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00, | ||
379 | 0x3f, 0x00, 0x0a, 0x01, 0x00, | ||
380 | 0xff, 1, 0x04, /* page 4 */ | ||
381 | 0x00, 254, /* load the page 4 */ | ||
382 | 0x11, 1, 0x01, | ||
383 | 0, 0 /* end of sequence */ | ||
384 | }; | ||
385 | |||
386 | /* page 4 - the value 0xaa says skip the index - see reg_w_page() */ | ||
387 | static const __u8 page4_7311[] = { | ||
388 | 0xaa, 0xaa, 0x04, 0x54, 0x07, 0x2b, 0x09, 0x0f, | ||
389 | 0x09, 0x00, 0xaa, 0xaa, 0x07, 0x00, 0x00, 0x62, | ||
390 | 0x08, 0xaa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
391 | 0x00, 0x00, 0x00, 0x03, 0xa0, 0x01, 0xf4, 0xaa, | ||
392 | 0xaa, 0x00, 0x08, 0xaa, 0x03, 0xaa, 0x00, 0x68, | ||
393 | 0xca, 0x10, 0x06, 0x78, 0x00, 0x00, 0x00, 0x00, | ||
394 | 0x23, 0x28, 0x04, 0x11, 0x00, 0x00 | ||
206 | }; | 395 | }; |
207 | 396 | ||
208 | static void reg_w_buf(struct gspca_dev *gspca_dev, | 397 | static void reg_w_buf(struct gspca_dev *gspca_dev, |
209 | __u16 index, | 398 | __u8 index, |
210 | const char *buffer, __u16 len) | 399 | const char *buffer, int len) |
211 | { | 400 | { |
212 | memcpy(gspca_dev->usb_buf, buffer, len); | 401 | memcpy(gspca_dev->usb_buf, buffer, len); |
213 | usb_control_msg(gspca_dev->dev, | 402 | usb_control_msg(gspca_dev->dev, |
@@ -219,21 +408,9 @@ static void reg_w_buf(struct gspca_dev *gspca_dev, | |||
219 | 500); | 408 | 500); |
220 | } | 409 | } |
221 | 410 | ||
222 | static __u8 reg_r(struct gspca_dev *gspca_dev, | ||
223 | __u16 index) | ||
224 | { | ||
225 | usb_control_msg(gspca_dev->dev, | ||
226 | usb_rcvctrlpipe(gspca_dev->dev, 0), | ||
227 | 0, /* request */ | ||
228 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
229 | 0, /* value */ | ||
230 | index, gspca_dev->usb_buf, 1, | ||
231 | 500); | ||
232 | return gspca_dev->usb_buf[0]; | ||
233 | } | ||
234 | 411 | ||
235 | static void reg_w(struct gspca_dev *gspca_dev, | 412 | static void reg_w(struct gspca_dev *gspca_dev, |
236 | __u16 index, | 413 | __u8 index, |
237 | __u8 value) | 414 | __u8 value) |
238 | { | 415 | { |
239 | gspca_dev->usb_buf[0] = value; | 416 | gspca_dev->usb_buf[0] = value; |
@@ -241,10 +418,78 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
241 | usb_sndctrlpipe(gspca_dev->dev, 0), | 418 | usb_sndctrlpipe(gspca_dev->dev, 0), |
242 | 0, /* request */ | 419 | 0, /* request */ |
243 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 420 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
244 | value, index, gspca_dev->usb_buf, 1, | 421 | 0, index, gspca_dev->usb_buf, 1, |
245 | 500); | 422 | 500); |
246 | } | 423 | } |
247 | 424 | ||
425 | static void reg_w_seq(struct gspca_dev *gspca_dev, | ||
426 | const __u8 *seq, int len) | ||
427 | { | ||
428 | while (--len >= 0) { | ||
429 | reg_w(gspca_dev, seq[0], seq[1]); | ||
430 | seq += 2; | ||
431 | } | ||
432 | } | ||
433 | |||
434 | /* load the beginning of a page */ | ||
435 | static void reg_w_page(struct gspca_dev *gspca_dev, | ||
436 | const __u8 *page, int len) | ||
437 | { | ||
438 | int index; | ||
439 | |||
440 | for (index = 0; index < len; index++) { | ||
441 | if (page[index] == 0xaa) /* skip this index */ | ||
442 | continue; | ||
443 | gspca_dev->usb_buf[0] = page[index]; | ||
444 | usb_control_msg(gspca_dev->dev, | ||
445 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
446 | 0, /* request */ | ||
447 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | ||
448 | 0, index, gspca_dev->usb_buf, 1, | ||
449 | 500); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | /* output a variable sequence */ | ||
454 | static void reg_w_var(struct gspca_dev *gspca_dev, | ||
455 | const __u8 *seq) | ||
456 | { | ||
457 | int index, len; | ||
458 | |||
459 | for (;;) { | ||
460 | index = *seq++; | ||
461 | len = *seq++; | ||
462 | switch (len) { | ||
463 | case 0: | ||
464 | return; | ||
465 | case 254: | ||
466 | reg_w_page(gspca_dev, page4_7311, sizeof page4_7311); | ||
467 | break; | ||
468 | case 255: | ||
469 | reg_w_page(gspca_dev, page3_7302, sizeof page3_7302); | ||
470 | break; | ||
471 | default: | ||
472 | if (len > 64) { | ||
473 | PDEBUG(D_ERR|D_STREAM, | ||
474 | "Incorrect variable sequence"); | ||
475 | return; | ||
476 | } | ||
477 | while (len > 0) { | ||
478 | if (len < 8) { | ||
479 | reg_w_buf(gspca_dev, index, seq, len); | ||
480 | seq += len; | ||
481 | break; | ||
482 | } | ||
483 | reg_w_buf(gspca_dev, index, seq, 8); | ||
484 | seq += 8; | ||
485 | index += 8; | ||
486 | len -= 8; | ||
487 | } | ||
488 | } | ||
489 | } | ||
490 | /* not reached */ | ||
491 | } | ||
492 | |||
248 | /* this function is called at probe time */ | 493 | /* this function is called at probe time */ |
249 | static int sd_config(struct gspca_dev *gspca_dev, | 494 | static int sd_config(struct gspca_dev *gspca_dev, |
250 | const struct usb_device_id *id) | 495 | const struct usb_device_id *id) |
@@ -252,203 +497,245 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
252 | struct sd *sd = (struct sd *) gspca_dev; | 497 | struct sd *sd = (struct sd *) gspca_dev; |
253 | struct cam *cam; | 498 | struct cam *cam; |
254 | 499 | ||
255 | PDEBUG(D_CONF, "Find Sensor PAC7311"); | ||
256 | reg_w(gspca_dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */ | ||
257 | reg_w(gspca_dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */ | ||
258 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */ | ||
259 | reg_w(gspca_dev, 0xff, 0x04); | ||
260 | reg_w(gspca_dev, 0x27, 0x80); | ||
261 | reg_w(gspca_dev, 0x28, 0xca); | ||
262 | reg_w(gspca_dev, 0x29, 0x53); | ||
263 | reg_w(gspca_dev, 0x2a, 0x0e); | ||
264 | reg_w(gspca_dev, 0xff, 0x01); | ||
265 | reg_w(gspca_dev, 0x3e, 0x20); | ||
266 | |||
267 | cam = &gspca_dev->cam; | 500 | cam = &gspca_dev->cam; |
268 | cam->epaddr = 0x05; | 501 | cam->epaddr = 0x05; |
269 | cam->cam_mode = vga_mode; | 502 | |
270 | cam->nmodes = ARRAY_SIZE(vga_mode); | 503 | sd->sensor = id->driver_info; |
504 | if (sd->sensor == SENSOR_PAC7302) { | ||
505 | PDEBUG(D_CONF, "Find Sensor PAC7302"); | ||
506 | cam->cam_mode = &vga_mode[2]; /* only 640x480 */ | ||
507 | cam->nmodes = 1; | ||
508 | } else { | ||
509 | PDEBUG(D_CONF, "Find Sensor PAC7311"); | ||
510 | cam->cam_mode = vga_mode; | ||
511 | cam->nmodes = ARRAY_SIZE(vga_mode); | ||
512 | gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX) | ||
513 | | (1 << SATURATION_IDX); | ||
514 | } | ||
271 | 515 | ||
272 | sd->brightness = BRIGHTNESS_DEF; | 516 | sd->brightness = BRIGHTNESS_DEF; |
273 | sd->contrast = CONTRAST_DEF; | 517 | sd->contrast = CONTRAST_DEF; |
274 | sd->colors = COLOR_DEF; | 518 | sd->colors = COLOR_DEF; |
519 | sd->gain = GAIN_DEF; | ||
520 | sd->exposure = EXPOSURE_DEF; | ||
275 | sd->autogain = AUTOGAIN_DEF; | 521 | sd->autogain = AUTOGAIN_DEF; |
276 | sd->ag_cnt = -1; | 522 | sd->hflip = HFLIP_DEF; |
523 | sd->vflip = VFLIP_DEF; | ||
277 | return 0; | 524 | return 0; |
278 | } | 525 | } |
279 | 526 | ||
280 | static void setbrightness(struct gspca_dev *gspca_dev) | 527 | /* This function is used by pac7302 only */ |
528 | static void setbrightcont(struct gspca_dev *gspca_dev) | ||
529 | { | ||
530 | struct sd *sd = (struct sd *) gspca_dev; | ||
531 | int i, v; | ||
532 | static const __u8 max[10] = | ||
533 | {0x29, 0x33, 0x42, 0x5a, 0x6e, 0x80, 0x9f, 0xbb, | ||
534 | 0xd4, 0xec}; | ||
535 | static const __u8 delta[10] = | ||
536 | {0x35, 0x33, 0x33, 0x2f, 0x2a, 0x25, 0x1e, 0x17, | ||
537 | 0x11, 0x0b}; | ||
538 | |||
539 | reg_w(gspca_dev, 0xff, 0x00); /* page 0 */ | ||
540 | for (i = 0; i < 10; i++) { | ||
541 | v = max[i]; | ||
542 | v += (sd->brightness - BRIGHTNESS_MAX) | ||
543 | * 150 / BRIGHTNESS_MAX; /* 200 ? */ | ||
544 | v -= delta[i] * sd->contrast / CONTRAST_MAX; | ||
545 | if (v < 0) | ||
546 | v = 0; | ||
547 | else if (v > 0xff) | ||
548 | v = 0xff; | ||
549 | reg_w(gspca_dev, 0xa2 + i, v); | ||
550 | } | ||
551 | reg_w(gspca_dev, 0xdc, 0x01); | ||
552 | } | ||
553 | |||
554 | /* This function is used by pac7311 only */ | ||
555 | static void setcontrast(struct gspca_dev *gspca_dev) | ||
281 | { | 556 | { |
282 | struct sd *sd = (struct sd *) gspca_dev; | 557 | struct sd *sd = (struct sd *) gspca_dev; |
283 | int brightness; | ||
284 | 558 | ||
285 | /*jfm: inverted?*/ | ||
286 | brightness = BRIGHTNESS_MAX - sd->brightness; | ||
287 | reg_w(gspca_dev, 0xff, 0x04); | 559 | reg_w(gspca_dev, 0xff, 0x04); |
288 | /* reg_w(gspca_dev, 0x0e, 0x00); */ | 560 | reg_w(gspca_dev, 0x10, sd->contrast >> 4); |
289 | reg_w(gspca_dev, 0x0f, brightness); | ||
290 | /* load registers to sensor (Bit 0, auto clear) */ | 561 | /* load registers to sensor (Bit 0, auto clear) */ |
291 | reg_w(gspca_dev, 0x11, 0x01); | 562 | reg_w(gspca_dev, 0x11, 0x01); |
292 | PDEBUG(D_CONF|D_STREAM, "brightness: %i", brightness); | ||
293 | } | 563 | } |
294 | 564 | ||
295 | static void setcontrast(struct gspca_dev *gspca_dev) | 565 | /* This function is used by pac7302 only */ |
566 | static void setcolors(struct gspca_dev *gspca_dev) | ||
296 | { | 567 | { |
297 | struct sd *sd = (struct sd *) gspca_dev; | 568 | struct sd *sd = (struct sd *) gspca_dev; |
569 | int i, v; | ||
570 | static const int a[9] = | ||
571 | {217, -212, 0, -101, 170, -67, -38, -315, 355}; | ||
572 | static const int b[9] = | ||
573 | {19, 106, 0, 19, 106, 1, 19, 106, 1}; | ||
298 | 574 | ||
299 | reg_w(gspca_dev, 0xff, 0x01); | 575 | reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ |
300 | reg_w(gspca_dev, 0x80, sd->contrast); | ||
301 | /* load registers to sensor (Bit 0, auto clear) */ | ||
302 | reg_w(gspca_dev, 0x11, 0x01); | 576 | reg_w(gspca_dev, 0x11, 0x01); |
303 | PDEBUG(D_CONF|D_STREAM, "contrast: %i", sd->contrast); | 577 | reg_w(gspca_dev, 0xff, 0x00); /* page 0 */ |
578 | reg_w(gspca_dev, 0xff, 0x00); /* page 0 */ | ||
579 | for (i = 0; i < 9; i++) { | ||
580 | v = a[i] * sd->colors / COLOR_MAX + b[i]; | ||
581 | reg_w(gspca_dev, 0x0f + 2 * i, (v >> 8) & 0x07); | ||
582 | reg_w(gspca_dev, 0x0f + 2 * i + 1, v); | ||
583 | } | ||
584 | reg_w(gspca_dev, 0xdc, 0x01); | ||
585 | PDEBUG(D_CONF|D_STREAM, "color: %i", sd->colors); | ||
304 | } | 586 | } |
305 | 587 | ||
306 | static void setcolors(struct gspca_dev *gspca_dev) | 588 | static void setgain(struct gspca_dev *gspca_dev) |
307 | { | 589 | { |
308 | struct sd *sd = (struct sd *) gspca_dev; | 590 | struct sd *sd = (struct sd *) gspca_dev; |
309 | 591 | ||
310 | reg_w(gspca_dev, 0xff, 0x01); | 592 | if (sd->sensor == SENSOR_PAC7302) { |
311 | reg_w(gspca_dev, 0x10, sd->colors); | 593 | reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ |
594 | reg_w(gspca_dev, 0x10, sd->gain >> 3); | ||
595 | } else { | ||
596 | int gain = GAIN_MAX - sd->gain; | ||
597 | if (gain < 1) | ||
598 | gain = 1; | ||
599 | else if (gain > 245) | ||
600 | gain = 245; | ||
601 | reg_w(gspca_dev, 0xff, 0x04); /* page 4 */ | ||
602 | reg_w(gspca_dev, 0x0e, 0x00); | ||
603 | reg_w(gspca_dev, 0x0f, gain); | ||
604 | } | ||
312 | /* load registers to sensor (Bit 0, auto clear) */ | 605 | /* load registers to sensor (Bit 0, auto clear) */ |
313 | reg_w(gspca_dev, 0x11, 0x01); | 606 | reg_w(gspca_dev, 0x11, 0x01); |
314 | PDEBUG(D_CONF|D_STREAM, "color: %i", sd->colors); | ||
315 | } | 607 | } |
316 | 608 | ||
317 | static void setautogain(struct gspca_dev *gspca_dev) | 609 | static void setexposure(struct gspca_dev *gspca_dev) |
318 | { | 610 | { |
319 | struct sd *sd = (struct sd *) gspca_dev; | 611 | struct sd *sd = (struct sd *) gspca_dev; |
612 | __u8 reg; | ||
613 | |||
614 | /* register 2 of frame 3/4 contains the clock divider configuring the | ||
615 | no fps according to the formula: 60 / reg. sd->exposure is the | ||
616 | desired exposure time in ms. */ | ||
617 | reg = 120 * sd->exposure / 1000; | ||
618 | if (reg < 2) | ||
619 | reg = 2; | ||
620 | else if (reg > 63) | ||
621 | reg = 63; | ||
622 | |||
623 | if (sd->sensor == SENSOR_PAC7302) { | ||
624 | /* On the pac7302 reg2 MUST be a multiple of 3, so round it to | ||
625 | the nearest multiple of 3, except when between 6 and 12? */ | ||
626 | if (reg < 6 || reg > 12) | ||
627 | reg = ((reg + 1) / 3) * 3; | ||
628 | reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ | ||
629 | reg_w(gspca_dev, 0x02, reg); | ||
630 | } else { | ||
631 | reg_w(gspca_dev, 0xff, 0x04); /* page 4 */ | ||
632 | reg_w(gspca_dev, 0x02, reg); | ||
633 | /* Page 1 register 8 must always be 0x08 except when not in | ||
634 | 640x480 mode and Page3/4 reg 2 <= 3 then it must be 9 */ | ||
635 | reg_w(gspca_dev, 0xff, 0x01); | ||
636 | if (gspca_dev->cam.cam_mode[(int)gspca_dev->curr_mode].priv && | ||
637 | reg <= 3) | ||
638 | reg_w(gspca_dev, 0x08, 0x09); | ||
639 | else | ||
640 | reg_w(gspca_dev, 0x08, 0x08); | ||
641 | } | ||
642 | /* load registers to sensor (Bit 0, auto clear) */ | ||
643 | reg_w(gspca_dev, 0x11, 0x01); | ||
644 | } | ||
320 | 645 | ||
321 | if (sd->autogain) { | 646 | static void sethvflip(struct gspca_dev *gspca_dev) |
322 | sd->lum_sum = 0; | 647 | { |
323 | sd->ag_cnt = AG_CNT_START; | 648 | struct sd *sd = (struct sd *) gspca_dev; |
649 | __u8 data; | ||
650 | |||
651 | if (sd->sensor == SENSOR_PAC7302) { | ||
652 | reg_w(gspca_dev, 0xff, 0x03); /* page 3 */ | ||
653 | data = (sd->hflip ? 0x08 : 0x00) | ||
654 | | (sd->vflip ? 0x04 : 0x00); | ||
324 | } else { | 655 | } else { |
325 | sd->ag_cnt = -1; | 656 | reg_w(gspca_dev, 0xff, 0x04); /* page 4 */ |
657 | data = (sd->hflip ? 0x04 : 0x00) | ||
658 | | (sd->vflip ? 0x08 : 0x00); | ||
326 | } | 659 | } |
660 | reg_w(gspca_dev, 0x21, data); | ||
661 | /* load registers to sensor (Bit 0, auto clear) */ | ||
662 | reg_w(gspca_dev, 0x11, 0x01); | ||
327 | } | 663 | } |
328 | 664 | ||
329 | /* this function is called at open time */ | 665 | /* this function is called at probe and resume time */ |
330 | static int sd_open(struct gspca_dev *gspca_dev) | 666 | static int sd_init(struct gspca_dev *gspca_dev) |
331 | { | 667 | { |
332 | reg_w(gspca_dev, 0x78, 0x00); /* Turn on LED */ | 668 | struct sd *sd = (struct sd *) gspca_dev; |
669 | |||
670 | if (sd->sensor == SENSOR_PAC7302) | ||
671 | reg_w_seq(gspca_dev, init_7302, sizeof init_7302); | ||
672 | else | ||
673 | reg_w_seq(gspca_dev, init_7311, sizeof init_7311); | ||
674 | |||
333 | return 0; | 675 | return 0; |
334 | } | 676 | } |
335 | 677 | ||
336 | static void sd_start(struct gspca_dev *gspca_dev) | 678 | static void sd_start(struct gspca_dev *gspca_dev) |
337 | { | 679 | { |
338 | reg_w(gspca_dev, 0xff, 0x01); | 680 | struct sd *sd = (struct sd *) gspca_dev; |
339 | reg_w_buf(gspca_dev, 0x0002, "\x48\x0a\x40\x08\x00\x00\x08\x00", 8); | ||
340 | reg_w_buf(gspca_dev, 0x000a, "\x06\xff\x11\xff\x5a\x30\x90\x4c", 8); | ||
341 | reg_w_buf(gspca_dev, 0x0012, "\x00\x07\x00\x0a\x10\x00\xa0\x10", 8); | ||
342 | reg_w_buf(gspca_dev, 0x001a, "\x02\x00\x00\x00\x00\x0b\x01\x00", 8); | ||
343 | reg_w_buf(gspca_dev, 0x0022, "\x00\x00\x00\x00\x00\x00\x00\x00", 8); | ||
344 | reg_w_buf(gspca_dev, 0x002a, "\x00\x00\x00", 3); | ||
345 | reg_w_buf(gspca_dev, 0x003e, "\x00\x00\x78\x52\x4a\x52\x78\x6e", 8); | ||
346 | reg_w_buf(gspca_dev, 0x0046, "\x48\x46\x48\x6e\x5f\x49\x42\x49", 8); | ||
347 | reg_w_buf(gspca_dev, 0x004e, "\x5f\x5f\x49\x42\x49\x5f\x6e\x48", 8); | ||
348 | reg_w_buf(gspca_dev, 0x0056, "\x46\x48\x6e\x78\x52\x4a\x52\x78", 8); | ||
349 | reg_w_buf(gspca_dev, 0x005e, "\x00\x00\x09\x1b\x34\x49\x5c\x9b", 8); | ||
350 | reg_w_buf(gspca_dev, 0x0066, "\xd0\xff", 2); | ||
351 | reg_w_buf(gspca_dev, 0x0078, "\x44\x00\xf2\x01\x01\x80", 6); | ||
352 | reg_w_buf(gspca_dev, 0x007f, "\x2a\x1c\x00\xc8\x02\x58\x03\x84", 8); | ||
353 | reg_w_buf(gspca_dev, 0x0087, "\x12\x00\x1a\x04\x08\x0c\x10\x14", 8); | ||
354 | reg_w_buf(gspca_dev, 0x008f, "\x18\x20", 2); | ||
355 | reg_w_buf(gspca_dev, 0x0096, "\x01\x08\x04", 3); | ||
356 | reg_w_buf(gspca_dev, 0x00a0, "\x44\x44\x44\x04", 4); | ||
357 | reg_w_buf(gspca_dev, 0x00f0, "\x01\x00\x00\x00\x22\x00\x20\x00", 8); | ||
358 | reg_w_buf(gspca_dev, 0x00f8, "\x3f\x00\x0a\x01\x00", 5); | ||
359 | 681 | ||
360 | reg_w(gspca_dev, 0xff, 0x04); | 682 | sd->sof_read = 0; |
361 | reg_w(gspca_dev, 0x02, 0x04); | 683 | |
362 | reg_w(gspca_dev, 0x03, 0x54); | 684 | if (sd->sensor == SENSOR_PAC7302) { |
363 | reg_w(gspca_dev, 0x04, 0x07); | 685 | reg_w_var(gspca_dev, start_7302); |
364 | reg_w(gspca_dev, 0x05, 0x2b); | 686 | setbrightcont(gspca_dev); |
365 | reg_w(gspca_dev, 0x06, 0x09); | 687 | setcolors(gspca_dev); |
366 | reg_w(gspca_dev, 0x07, 0x0f); | 688 | } else { |
367 | reg_w(gspca_dev, 0x08, 0x09); | 689 | reg_w_var(gspca_dev, start_7311); |
368 | reg_w(gspca_dev, 0x09, 0x00); | 690 | setcontrast(gspca_dev); |
369 | reg_w(gspca_dev, 0x0c, 0x07); | 691 | } |
370 | reg_w(gspca_dev, 0x0d, 0x00); | 692 | setgain(gspca_dev); |
371 | reg_w(gspca_dev, 0x0e, 0x00); | 693 | setexposure(gspca_dev); |
372 | reg_w(gspca_dev, 0x0f, 0x62); | 694 | sethvflip(gspca_dev); |
373 | reg_w(gspca_dev, 0x10, 0x08); | ||
374 | reg_w(gspca_dev, 0x12, 0x07); | ||
375 | reg_w(gspca_dev, 0x13, 0x00); | ||
376 | reg_w(gspca_dev, 0x14, 0x00); | ||
377 | reg_w(gspca_dev, 0x15, 0x00); | ||
378 | reg_w(gspca_dev, 0x16, 0x00); | ||
379 | reg_w(gspca_dev, 0x17, 0x00); | ||
380 | reg_w(gspca_dev, 0x18, 0x00); | ||
381 | reg_w(gspca_dev, 0x19, 0x00); | ||
382 | reg_w(gspca_dev, 0x1a, 0x00); | ||
383 | reg_w(gspca_dev, 0x1b, 0x03); | ||
384 | reg_w(gspca_dev, 0x1c, 0xa0); | ||
385 | reg_w(gspca_dev, 0x1d, 0x01); | ||
386 | reg_w(gspca_dev, 0x1e, 0xf4); | ||
387 | reg_w(gspca_dev, 0x21, 0x00); | ||
388 | reg_w(gspca_dev, 0x22, 0x08); | ||
389 | reg_w(gspca_dev, 0x24, 0x03); | ||
390 | reg_w(gspca_dev, 0x26, 0x00); | ||
391 | reg_w(gspca_dev, 0x27, 0x01); | ||
392 | reg_w(gspca_dev, 0x28, 0xca); | ||
393 | reg_w(gspca_dev, 0x29, 0x10); | ||
394 | reg_w(gspca_dev, 0x2a, 0x06); | ||
395 | reg_w(gspca_dev, 0x2b, 0x78); | ||
396 | reg_w(gspca_dev, 0x2c, 0x00); | ||
397 | reg_w(gspca_dev, 0x2d, 0x00); | ||
398 | reg_w(gspca_dev, 0x2e, 0x00); | ||
399 | reg_w(gspca_dev, 0x2f, 0x00); | ||
400 | reg_w(gspca_dev, 0x30, 0x23); | ||
401 | reg_w(gspca_dev, 0x31, 0x28); | ||
402 | reg_w(gspca_dev, 0x32, 0x04); | ||
403 | reg_w(gspca_dev, 0x33, 0x11); | ||
404 | reg_w(gspca_dev, 0x34, 0x00); | ||
405 | reg_w(gspca_dev, 0x35, 0x00); | ||
406 | reg_w(gspca_dev, 0x11, 0x01); | ||
407 | setcontrast(gspca_dev); | ||
408 | setbrightness(gspca_dev); | ||
409 | setcolors(gspca_dev); | ||
410 | setautogain(gspca_dev); | ||
411 | 695 | ||
412 | /* set correct resolution */ | 696 | /* set correct resolution */ |
413 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) { | 697 | switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) { |
414 | case 2: /* 160x120 */ | 698 | case 2: /* 160x120 pac7311 */ |
415 | reg_w(gspca_dev, 0xff, 0x04); | ||
416 | reg_w(gspca_dev, 0x02, 0x03); | ||
417 | reg_w(gspca_dev, 0xff, 0x01); | 699 | reg_w(gspca_dev, 0xff, 0x01); |
418 | reg_w(gspca_dev, 0x08, 0x09); | ||
419 | reg_w(gspca_dev, 0x17, 0x20); | 700 | reg_w(gspca_dev, 0x17, 0x20); |
420 | reg_w(gspca_dev, 0x1b, 0x00); | ||
421 | /* reg_w(gspca_dev, 0x80, 0x69); */ | ||
422 | reg_w(gspca_dev, 0x87, 0x10); | 701 | reg_w(gspca_dev, 0x87, 0x10); |
423 | break; | 702 | break; |
424 | case 1: /* 320x240 */ | 703 | case 1: /* 320x240 pac7311 */ |
425 | reg_w(gspca_dev, 0xff, 0x04); | ||
426 | reg_w(gspca_dev, 0x02, 0x03); | ||
427 | reg_w(gspca_dev, 0xff, 0x01); | 704 | reg_w(gspca_dev, 0xff, 0x01); |
428 | reg_w(gspca_dev, 0x08, 0x09); | ||
429 | reg_w(gspca_dev, 0x17, 0x30); | 705 | reg_w(gspca_dev, 0x17, 0x30); |
430 | /* reg_w(gspca_dev, 0x80, 0x3f); */ | ||
431 | reg_w(gspca_dev, 0x87, 0x11); | 706 | reg_w(gspca_dev, 0x87, 0x11); |
432 | break; | 707 | break; |
433 | case 0: /* 640x480 */ | 708 | case 0: /* 640x480 */ |
434 | reg_w(gspca_dev, 0xff, 0x04); | 709 | if (sd->sensor == SENSOR_PAC7302) |
435 | reg_w(gspca_dev, 0x02, 0x03); | 710 | break; |
436 | reg_w(gspca_dev, 0xff, 0x01); | 711 | reg_w(gspca_dev, 0xff, 0x01); |
437 | reg_w(gspca_dev, 0x08, 0x08); | ||
438 | reg_w(gspca_dev, 0x17, 0x00); | 712 | reg_w(gspca_dev, 0x17, 0x00); |
439 | /* reg_w(gspca_dev, 0x80, 0x1c); */ | ||
440 | reg_w(gspca_dev, 0x87, 0x12); | 713 | reg_w(gspca_dev, 0x87, 0x12); |
441 | break; | 714 | break; |
442 | } | 715 | } |
443 | 716 | ||
717 | sd->sof_read = 0; | ||
718 | sd->autogain_ignore_frames = 0; | ||
719 | atomic_set(&sd->avg_lum, -1); | ||
720 | |||
444 | /* start stream */ | 721 | /* start stream */ |
445 | reg_w(gspca_dev, 0xff, 0x01); | 722 | reg_w(gspca_dev, 0xff, 0x01); |
446 | reg_w(gspca_dev, 0x78, 0x04); | 723 | if (sd->sensor == SENSOR_PAC7302) |
447 | reg_w(gspca_dev, 0x78, 0x05); | 724 | reg_w(gspca_dev, 0x78, 0x01); |
725 | else | ||
726 | reg_w(gspca_dev, 0x78, 0x05); | ||
448 | } | 727 | } |
449 | 728 | ||
450 | static void sd_stopN(struct gspca_dev *gspca_dev) | 729 | static void sd_stopN(struct gspca_dev *gspca_dev) |
451 | { | 730 | { |
731 | struct sd *sd = (struct sd *) gspca_dev; | ||
732 | |||
733 | if (sd->sensor == SENSOR_PAC7302) { | ||
734 | reg_w(gspca_dev, 0xff, 0x01); | ||
735 | reg_w(gspca_dev, 0x78, 0x00); | ||
736 | reg_w(gspca_dev, 0x78, 0x00); | ||
737 | return; | ||
738 | } | ||
452 | reg_w(gspca_dev, 0xff, 0x04); | 739 | reg_w(gspca_dev, 0xff, 0x04); |
453 | reg_w(gspca_dev, 0x27, 0x80); | 740 | reg_w(gspca_dev, 0x27, 0x80); |
454 | reg_w(gspca_dev, 0x28, 0xca); | 741 | reg_w(gspca_dev, 0x28, 0xca); |
@@ -456,187 +743,147 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
456 | reg_w(gspca_dev, 0x2a, 0x0e); | 743 | reg_w(gspca_dev, 0x2a, 0x0e); |
457 | reg_w(gspca_dev, 0xff, 0x01); | 744 | reg_w(gspca_dev, 0xff, 0x01); |
458 | reg_w(gspca_dev, 0x3e, 0x20); | 745 | reg_w(gspca_dev, 0x3e, 0x20); |
459 | reg_w(gspca_dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */ | 746 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ |
460 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */ | 747 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ |
461 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */ | 748 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_6=LED */ |
462 | } | 749 | } |
463 | 750 | ||
464 | static void sd_stop0(struct gspca_dev *gspca_dev) | 751 | static void sd_stop0(struct gspca_dev *gspca_dev) |
465 | { | 752 | { |
466 | } | 753 | struct sd *sd = (struct sd *) gspca_dev; |
467 | 754 | ||
468 | /* this function is called at close time */ | 755 | if (sd->sensor == SENSOR_PAC7302) { |
469 | static void sd_close(struct gspca_dev *gspca_dev) | 756 | reg_w(gspca_dev, 0xff, 0x01); |
470 | { | 757 | reg_w(gspca_dev, 0x78, 0x40); |
471 | reg_w(gspca_dev, 0xff, 0x04); | 758 | } |
472 | reg_w(gspca_dev, 0x27, 0x80); | ||
473 | reg_w(gspca_dev, 0x28, 0xca); | ||
474 | reg_w(gspca_dev, 0x29, 0x53); | ||
475 | reg_w(gspca_dev, 0x2a, 0x0e); | ||
476 | reg_w(gspca_dev, 0xff, 0x01); | ||
477 | reg_w(gspca_dev, 0x3e, 0x20); | ||
478 | reg_w(gspca_dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */ | ||
479 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */ | ||
480 | reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */ | ||
481 | } | 759 | } |
482 | 760 | ||
761 | /* Include pac common sof detection functions */ | ||
762 | #include "pac_common.h" | ||
763 | |||
483 | static void do_autogain(struct gspca_dev *gspca_dev) | 764 | static void do_autogain(struct gspca_dev *gspca_dev) |
484 | { | 765 | { |
485 | struct sd *sd = (struct sd *) gspca_dev; | 766 | struct sd *sd = (struct sd *) gspca_dev; |
486 | int luma; | 767 | int avg_lum = atomic_read(&sd->avg_lum); |
487 | int luma_mean = 128; | 768 | int desired_lum, deadzone; |
488 | int luma_delta = 20; | ||
489 | __u8 spring = 5; | ||
490 | int Gbright; | ||
491 | 769 | ||
492 | if (!atomic_read(&sd->do_gain)) | 770 | if (avg_lum == -1) |
493 | return; | 771 | return; |
494 | atomic_set(&sd->do_gain, 0); | 772 | |
495 | 773 | if (sd->sensor == SENSOR_PAC7302) { | |
496 | luma = atomic_read(&sd->avg_lum); | 774 | desired_lum = 270 + sd->brightness * 4; |
497 | Gbright = reg_r(gspca_dev, 0x02); | 775 | /* Hack hack, with the 7202 the first exposure step is |
498 | PDEBUG(D_FRAM, "luma mean %d", luma); | 776 | pretty large, so if we're about to make the first |
499 | if (luma < luma_mean - luma_delta || | 777 | exposure increase make the deadzone large to avoid |
500 | luma > luma_mean + luma_delta) { | 778 | oscilating */ |
501 | Gbright += (luma_mean - luma) >> spring; | 779 | if (desired_lum > avg_lum && sd->gain == GAIN_DEF && |
502 | if (Gbright > 0x1a) | 780 | sd->exposure > EXPOSURE_DEF && |
503 | Gbright = 0x1a; | 781 | sd->exposure < 42) |
504 | else if (Gbright < 4) | 782 | deadzone = 90; |
505 | Gbright = 4; | 783 | else |
506 | PDEBUG(D_FRAM, "gbright %d", Gbright); | 784 | deadzone = 30; |
507 | reg_w(gspca_dev, 0xff, 0x04); | 785 | } else { |
508 | reg_w(gspca_dev, 0x0f, Gbright); | 786 | desired_lum = 200; |
509 | /* load registers to sensor (Bit 0, auto clear) */ | 787 | deadzone = 20; |
510 | reg_w(gspca_dev, 0x11, 0x01); | ||
511 | } | 788 | } |
789 | |||
790 | if (sd->autogain_ignore_frames > 0) | ||
791 | sd->autogain_ignore_frames--; | ||
792 | else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum, desired_lum, | ||
793 | deadzone, GAIN_KNEE, EXPOSURE_KNEE)) | ||
794 | sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES; | ||
512 | } | 795 | } |
513 | 796 | ||
797 | static const unsigned char pac7311_jpeg_header1[] = { | ||
798 | 0xff, 0xd8, 0xff, 0xc0, 0x00, 0x11, 0x08 | ||
799 | }; | ||
800 | |||
801 | static const unsigned char pac7311_jpeg_header2[] = { | ||
802 | 0x03, 0x01, 0x21, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xda, | ||
803 | 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00 | ||
804 | }; | ||
805 | |||
806 | /* this function is run at interrupt level */ | ||
514 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 807 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
515 | struct gspca_frame *frame, /* target */ | 808 | struct gspca_frame *frame, /* target */ |
516 | __u8 *data, /* isoc packet */ | 809 | __u8 *data, /* isoc packet */ |
517 | int len) /* iso packet length */ | 810 | int len) /* iso packet length */ |
518 | { | 811 | { |
519 | struct sd *sd = (struct sd *) gspca_dev; | 812 | struct sd *sd = (struct sd *) gspca_dev; |
520 | unsigned char tmpbuf[4]; | 813 | unsigned char *sof; |
521 | int i, p, ffseq; | 814 | |
522 | 815 | sof = pac_find_sof(gspca_dev, data, len); | |
523 | /* if (len < 5) { */ | 816 | if (sof) { |
524 | if (len < 6) { | 817 | unsigned char tmpbuf[4]; |
525 | /* gspca_dev->last_packet_type = DISCARD_PACKET; */ | 818 | int n, lum_offset, footer_length; |
526 | return; | 819 | |
527 | } | 820 | if (sd->sensor == SENSOR_PAC7302) { |
528 | 821 | /* 6 bytes after the FF D9 EOF marker a number of lumination | |
529 | ffseq = sd->ffseq; | 822 | bytes are send corresponding to different parts of the |
530 | 823 | image, the 14th and 15th byte after the EOF seem to | |
531 | for (p = 0; p < len - 6; p++) { | 824 | correspond to the center of the image */ |
532 | if ((data[0 + p] == 0xff) | 825 | lum_offset = 61 + sizeof pac_sof_marker; |
533 | && (data[1 + p] == 0xff) | 826 | footer_length = 74; |
534 | && (data[2 + p] == 0x00) | 827 | } else { |
535 | && (data[3 + p] == 0xff) | 828 | lum_offset = 24 + sizeof pac_sof_marker; |
536 | && (data[4 + p] == 0x96)) { | 829 | footer_length = 26; |
537 | 830 | } | |
538 | /* start of frame */ | ||
539 | if (sd->ag_cnt >= 0 && p > 28) { | ||
540 | sd->lum_sum += data[p - 23]; | ||
541 | if (--sd->ag_cnt < 0) { | ||
542 | sd->ag_cnt = AG_CNT_START; | ||
543 | atomic_set(&sd->avg_lum, | ||
544 | sd->lum_sum / AG_CNT_START); | ||
545 | sd->lum_sum = 0; | ||
546 | atomic_set(&sd->do_gain, 1); | ||
547 | } | ||
548 | } | ||
549 | 831 | ||
550 | /* copy the end of data to the current frame */ | 832 | /* Finish decoding current frame */ |
833 | n = (sof - data) - (footer_length + sizeof pac_sof_marker); | ||
834 | if (n < 0) { | ||
835 | frame->data_end += n; | ||
836 | n = 0; | ||
837 | } | ||
838 | frame = gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
839 | data, n); | ||
840 | if (gspca_dev->last_packet_type != DISCARD_PACKET && | ||
841 | frame->data_end[-2] == 0xff && | ||
842 | frame->data_end[-1] == 0xd9) | ||
551 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, | 843 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, |
552 | data, p); | 844 | NULL, 0); |
553 | 845 | ||
554 | /* put the JPEG header in the new frame */ | 846 | n = sof - data; |
555 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, | 847 | len -= n; |
556 | (unsigned char *) pac7311_jpeg_header, | 848 | data = sof; |
557 | 12); | 849 | |
850 | /* Get average lumination */ | ||
851 | if (gspca_dev->last_packet_type == LAST_PACKET && | ||
852 | n >= lum_offset) | ||
853 | atomic_set(&sd->avg_lum, data[-lum_offset] + | ||
854 | data[-lum_offset + 1]); | ||
855 | else | ||
856 | atomic_set(&sd->avg_lum, -1); | ||
857 | |||
858 | /* Start the new frame with the jpeg header */ | ||
859 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, | ||
860 | pac7311_jpeg_header1, sizeof(pac7311_jpeg_header1)); | ||
861 | if (sd->sensor == SENSOR_PAC7302) { | ||
862 | /* The PAC7302 has the image rotated 90 degrees */ | ||
863 | tmpbuf[0] = gspca_dev->width >> 8; | ||
864 | tmpbuf[1] = gspca_dev->width & 0xff; | ||
865 | tmpbuf[2] = gspca_dev->height >> 8; | ||
866 | tmpbuf[3] = gspca_dev->height & 0xff; | ||
867 | } else { | ||
558 | tmpbuf[0] = gspca_dev->height >> 8; | 868 | tmpbuf[0] = gspca_dev->height >> 8; |
559 | tmpbuf[1] = gspca_dev->height & 0xff; | 869 | tmpbuf[1] = gspca_dev->height & 0xff; |
560 | tmpbuf[2] = gspca_dev->width >> 8; | 870 | tmpbuf[2] = gspca_dev->width >> 8; |
561 | tmpbuf[3] = gspca_dev->width & 0xff; | 871 | tmpbuf[3] = gspca_dev->width & 0xff; |
562 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
563 | tmpbuf, 4); | ||
564 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
565 | (unsigned char *) &pac7311_jpeg_header[16], | ||
566 | PAC7311_JPEG_HEADER_SIZE - 16); | ||
567 | |||
568 | data += p + 7; | ||
569 | len -= p + 7; | ||
570 | ffseq = 0; | ||
571 | break; | ||
572 | } | 872 | } |
873 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, tmpbuf, 4); | ||
874 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, | ||
875 | pac7311_jpeg_header2, sizeof(pac7311_jpeg_header2)); | ||
573 | } | 876 | } |
574 | |||
575 | /* remove the 'ff ff ff xx' sequences */ | ||
576 | switch (ffseq) { | ||
577 | case 3: | ||
578 | data += 1; | ||
579 | len -= 1; | ||
580 | break; | ||
581 | case 2: | ||
582 | if (data[0] == 0xff) { | ||
583 | data += 2; | ||
584 | len -= 2; | ||
585 | frame->data_end -= 2; | ||
586 | } | ||
587 | break; | ||
588 | case 1: | ||
589 | if (data[0] == 0xff | ||
590 | && data[1] == 0xff) { | ||
591 | data += 3; | ||
592 | len -= 3; | ||
593 | frame->data_end -= 1; | ||
594 | } | ||
595 | break; | ||
596 | } | ||
597 | for (i = 0; i < len - 4; i++) { | ||
598 | if (data[i] == 0xff | ||
599 | && data[i + 1] == 0xff | ||
600 | && data[i + 2] == 0xff) { | ||
601 | memmove(&data[i], &data[i + 4], len - i - 4); | ||
602 | len -= 4; | ||
603 | } | ||
604 | } | ||
605 | ffseq = 0; | ||
606 | if (data[len - 4] == 0xff) { | ||
607 | if (data[len - 3] == 0xff | ||
608 | && data[len - 2] == 0xff) { | ||
609 | len -= 4; | ||
610 | } | ||
611 | } else if (data[len - 3] == 0xff) { | ||
612 | if (data[len - 2] == 0xff | ||
613 | && data[len - 1] == 0xff) | ||
614 | ffseq = 3; | ||
615 | } else if (data[len - 2] == 0xff) { | ||
616 | if (data[len - 1] == 0xff) | ||
617 | ffseq = 2; | ||
618 | } else if (data[len - 1] == 0xff) | ||
619 | ffseq = 1; | ||
620 | sd->ffseq = ffseq; | ||
621 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | 877 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); |
622 | } | 878 | } |
623 | 879 | ||
624 | static void getbrightness(struct gspca_dev *gspca_dev) | ||
625 | { | ||
626 | /* sd->brightness = reg_r(gspca_dev, 0x08); | ||
627 | return sd->brightness; */ | ||
628 | /* PDEBUG(D_CONF, "Called pac7311_getbrightness: Not implemented yet"); */ | ||
629 | } | ||
630 | |||
631 | |||
632 | |||
633 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 880 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
634 | { | 881 | { |
635 | struct sd *sd = (struct sd *) gspca_dev; | 882 | struct sd *sd = (struct sd *) gspca_dev; |
636 | 883 | ||
637 | sd->brightness = val; | 884 | sd->brightness = val; |
638 | if (gspca_dev->streaming) | 885 | if (gspca_dev->streaming) |
639 | setbrightness(gspca_dev); | 886 | setbrightcont(gspca_dev); |
640 | return 0; | 887 | return 0; |
641 | } | 888 | } |
642 | 889 | ||
@@ -644,7 +891,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | |||
644 | { | 891 | { |
645 | struct sd *sd = (struct sd *) gspca_dev; | 892 | struct sd *sd = (struct sd *) gspca_dev; |
646 | 893 | ||
647 | getbrightness(gspca_dev); | ||
648 | *val = sd->brightness; | 894 | *val = sd->brightness; |
649 | return 0; | 895 | return 0; |
650 | } | 896 | } |
@@ -654,8 +900,12 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) | |||
654 | struct sd *sd = (struct sd *) gspca_dev; | 900 | struct sd *sd = (struct sd *) gspca_dev; |
655 | 901 | ||
656 | sd->contrast = val; | 902 | sd->contrast = val; |
657 | if (gspca_dev->streaming) | 903 | if (gspca_dev->streaming) { |
658 | setcontrast(gspca_dev); | 904 | if (sd->sensor == SENSOR_PAC7302) |
905 | setbrightcont(gspca_dev); | ||
906 | else | ||
907 | setcontrast(gspca_dev); | ||
908 | } | ||
659 | return 0; | 909 | return 0; |
660 | } | 910 | } |
661 | 911 | ||
@@ -663,7 +913,6 @@ static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val) | |||
663 | { | 913 | { |
664 | struct sd *sd = (struct sd *) gspca_dev; | 914 | struct sd *sd = (struct sd *) gspca_dev; |
665 | 915 | ||
666 | /* getcontrast(gspca_dev); */ | ||
667 | *val = sd->contrast; | 916 | *val = sd->contrast; |
668 | return 0; | 917 | return 0; |
669 | } | 918 | } |
@@ -682,18 +931,66 @@ static int sd_getcolors(struct gspca_dev *gspca_dev, __s32 *val) | |||
682 | { | 931 | { |
683 | struct sd *sd = (struct sd *) gspca_dev; | 932 | struct sd *sd = (struct sd *) gspca_dev; |
684 | 933 | ||
685 | /* getcolors(gspca_dev); */ | ||
686 | *val = sd->colors; | 934 | *val = sd->colors; |
687 | return 0; | 935 | return 0; |
688 | } | 936 | } |
689 | 937 | ||
938 | static int sd_setgain(struct gspca_dev *gspca_dev, __s32 val) | ||
939 | { | ||
940 | struct sd *sd = (struct sd *) gspca_dev; | ||
941 | |||
942 | sd->gain = val; | ||
943 | if (gspca_dev->streaming) | ||
944 | setgain(gspca_dev); | ||
945 | return 0; | ||
946 | } | ||
947 | |||
948 | static int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val) | ||
949 | { | ||
950 | struct sd *sd = (struct sd *) gspca_dev; | ||
951 | |||
952 | *val = sd->gain; | ||
953 | return 0; | ||
954 | } | ||
955 | |||
956 | static int sd_setexposure(struct gspca_dev *gspca_dev, __s32 val) | ||
957 | { | ||
958 | struct sd *sd = (struct sd *) gspca_dev; | ||
959 | |||
960 | sd->exposure = val; | ||
961 | if (gspca_dev->streaming) | ||
962 | setexposure(gspca_dev); | ||
963 | return 0; | ||
964 | } | ||
965 | |||
966 | static int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val) | ||
967 | { | ||
968 | struct sd *sd = (struct sd *) gspca_dev; | ||
969 | |||
970 | *val = sd->exposure; | ||
971 | return 0; | ||
972 | } | ||
973 | |||
690 | static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val) | 974 | static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val) |
691 | { | 975 | { |
692 | struct sd *sd = (struct sd *) gspca_dev; | 976 | struct sd *sd = (struct sd *) gspca_dev; |
693 | 977 | ||
694 | sd->autogain = val; | 978 | sd->autogain = val; |
695 | if (gspca_dev->streaming) | 979 | /* when switching to autogain set defaults to make sure |
696 | setautogain(gspca_dev); | 980 | we are on a valid point of the autogain gain / |
981 | exposure knee graph, and give this change time to | ||
982 | take effect before doing autogain. */ | ||
983 | if (sd->autogain) { | ||
984 | sd->exposure = EXPOSURE_DEF; | ||
985 | sd->gain = GAIN_DEF; | ||
986 | if (gspca_dev->streaming) { | ||
987 | sd->autogain_ignore_frames = | ||
988 | PAC_AUTOGAIN_IGNORE_FRAMES; | ||
989 | setexposure(gspca_dev); | ||
990 | setgain(gspca_dev); | ||
991 | } | ||
992 | } | ||
993 | |||
697 | return 0; | 994 | return 0; |
698 | } | 995 | } |
699 | 996 | ||
@@ -705,30 +1002,67 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
705 | return 0; | 1002 | return 0; |
706 | } | 1003 | } |
707 | 1004 | ||
1005 | static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val) | ||
1006 | { | ||
1007 | struct sd *sd = (struct sd *) gspca_dev; | ||
1008 | |||
1009 | sd->hflip = val; | ||
1010 | if (gspca_dev->streaming) | ||
1011 | sethvflip(gspca_dev); | ||
1012 | return 0; | ||
1013 | } | ||
1014 | |||
1015 | static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val) | ||
1016 | { | ||
1017 | struct sd *sd = (struct sd *) gspca_dev; | ||
1018 | |||
1019 | *val = sd->hflip; | ||
1020 | return 0; | ||
1021 | } | ||
1022 | |||
1023 | static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val) | ||
1024 | { | ||
1025 | struct sd *sd = (struct sd *) gspca_dev; | ||
1026 | |||
1027 | sd->vflip = val; | ||
1028 | if (gspca_dev->streaming) | ||
1029 | sethvflip(gspca_dev); | ||
1030 | return 0; | ||
1031 | } | ||
1032 | |||
1033 | static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val) | ||
1034 | { | ||
1035 | struct sd *sd = (struct sd *) gspca_dev; | ||
1036 | |||
1037 | *val = sd->vflip; | ||
1038 | return 0; | ||
1039 | } | ||
1040 | |||
708 | /* sub-driver description */ | 1041 | /* sub-driver description */ |
709 | static struct sd_desc sd_desc = { | 1042 | static struct sd_desc sd_desc = { |
710 | .name = MODULE_NAME, | 1043 | .name = MODULE_NAME, |
711 | .ctrls = sd_ctrls, | 1044 | .ctrls = sd_ctrls, |
712 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1045 | .nctrls = ARRAY_SIZE(sd_ctrls), |
713 | .config = sd_config, | 1046 | .config = sd_config, |
714 | .open = sd_open, | 1047 | .init = sd_init, |
715 | .start = sd_start, | 1048 | .start = sd_start, |
716 | .stopN = sd_stopN, | 1049 | .stopN = sd_stopN, |
717 | .stop0 = sd_stop0, | 1050 | .stop0 = sd_stop0, |
718 | .close = sd_close, | ||
719 | .pkt_scan = sd_pkt_scan, | 1051 | .pkt_scan = sd_pkt_scan, |
720 | .dq_callback = do_autogain, | 1052 | .dq_callback = do_autogain, |
721 | }; | 1053 | }; |
722 | 1054 | ||
723 | /* -- module initialisation -- */ | 1055 | /* -- module initialisation -- */ |
724 | static __devinitdata struct usb_device_id device_table[] = { | 1056 | static __devinitdata struct usb_device_id device_table[] = { |
725 | {USB_DEVICE(0x093a, 0x2600)}, | 1057 | {USB_DEVICE(0x093a, 0x2600), .driver_info = SENSOR_PAC7311}, |
726 | {USB_DEVICE(0x093a, 0x2601)}, | 1058 | {USB_DEVICE(0x093a, 0x2601), .driver_info = SENSOR_PAC7311}, |
727 | {USB_DEVICE(0x093a, 0x2603)}, | 1059 | {USB_DEVICE(0x093a, 0x2603), .driver_info = SENSOR_PAC7311}, |
728 | {USB_DEVICE(0x093a, 0x2608)}, | 1060 | {USB_DEVICE(0x093a, 0x2608), .driver_info = SENSOR_PAC7311}, |
729 | {USB_DEVICE(0x093a, 0x260e)}, | 1061 | {USB_DEVICE(0x093a, 0x260e), .driver_info = SENSOR_PAC7311}, |
730 | {USB_DEVICE(0x093a, 0x260f)}, | 1062 | {USB_DEVICE(0x093a, 0x260f), .driver_info = SENSOR_PAC7311}, |
731 | {USB_DEVICE(0x093a, 0x2621)}, | 1063 | {USB_DEVICE(0x093a, 0x2621), .driver_info = SENSOR_PAC7302}, |
1064 | {USB_DEVICE(0x093a, 0x2624), .driver_info = SENSOR_PAC7302}, | ||
1065 | {USB_DEVICE(0x093a, 0x2626), .driver_info = SENSOR_PAC7302}, | ||
732 | {} | 1066 | {} |
733 | }; | 1067 | }; |
734 | MODULE_DEVICE_TABLE(usb, device_table); | 1068 | MODULE_DEVICE_TABLE(usb, device_table); |
@@ -746,6 +1080,10 @@ static struct usb_driver sd_driver = { | |||
746 | .id_table = device_table, | 1080 | .id_table = device_table, |
747 | .probe = sd_probe, | 1081 | .probe = sd_probe, |
748 | .disconnect = gspca_disconnect, | 1082 | .disconnect = gspca_disconnect, |
1083 | #ifdef CONFIG_PM | ||
1084 | .suspend = gspca_suspend, | ||
1085 | .resume = gspca_resume, | ||
1086 | #endif | ||
749 | }; | 1087 | }; |
750 | 1088 | ||
751 | /* -- module insert / remove -- */ | 1089 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/pac_common.h b/drivers/media/video/gspca/pac_common.h new file mode 100644 index 000000000000..34d4b1494cd5 --- /dev/null +++ b/drivers/media/video/gspca/pac_common.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Pixart PAC207BCA / PAC73xx common functions | ||
3 | * | ||
4 | * Copyright (C) 2008 Hans de Goede <j.w.r.degoede@hhs.nl> | ||
5 | * Copyright (C) 2005 Thomas Kaiser thomas@kaiser-linux.li | ||
6 | * Copyleft (C) 2005 Michel Xhaard mxhaard@magic.fr | ||
7 | * | ||
8 | * V4L2 by Jean-Francois Moine <http://moinejf.free.fr> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | /* We calculate the autogain at the end of the transfer of a frame, at this | ||
27 | moment a frame with the old settings is being transmitted, and a frame is | ||
28 | being captured with the old settings. So if we adjust the autogain we must | ||
29 | ignore atleast the 2 next frames for the new settings to come into effect | ||
30 | before doing any other adjustments */ | ||
31 | #define PAC_AUTOGAIN_IGNORE_FRAMES 3 | ||
32 | |||
33 | static const unsigned char pac_sof_marker[5] = | ||
34 | { 0xff, 0xff, 0x00, 0xff, 0x96 }; | ||
35 | |||
36 | static unsigned char *pac_find_sof(struct gspca_dev *gspca_dev, | ||
37 | unsigned char *m, int len) | ||
38 | { | ||
39 | struct sd *sd = (struct sd *) gspca_dev; | ||
40 | int i; | ||
41 | |||
42 | /* Search for the SOF marker (fixed part) in the header */ | ||
43 | for (i = 0; i < len; i++) { | ||
44 | if (m[i] == pac_sof_marker[sd->sof_read]) { | ||
45 | sd->sof_read++; | ||
46 | if (sd->sof_read == sizeof(pac_sof_marker)) { | ||
47 | PDEBUG(D_FRAM, | ||
48 | "SOF found, bytes to analyze: %u." | ||
49 | " Frame starts at byte #%u", | ||
50 | len, i + 1); | ||
51 | sd->sof_read = 0; | ||
52 | return m + i + 1; | ||
53 | } | ||
54 | } else { | ||
55 | sd->sof_read = 0; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | return NULL; | ||
60 | } | ||
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 11210c71f66c..5dd78c6766ea 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -20,6 +20,26 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /* Some documentation on known sonixb registers: | ||
24 | |||
25 | Reg Use | ||
26 | 0x10 high nibble red gain low nibble blue gain | ||
27 | 0x11 low nibble green gain | ||
28 | 0x12 hstart | ||
29 | 0x13 vstart | ||
30 | 0x15 hsize (hsize = register-value * 16) | ||
31 | 0x16 vsize (vsize = register-value * 16) | ||
32 | 0x17 bit 0 toggle compression quality (according to sn9c102 driver) | ||
33 | 0x18 bit 7 enables compression, bit 4-5 set image down scaling: | ||
34 | 00 scale 1, 01 scale 1/2, 10, scale 1/4 | ||
35 | 0x19 high-nibble is sensor clock divider, changes exposure on sensors which | ||
36 | use a clock generated by the bridge. Some sensors have their own clock. | ||
37 | 0x1c auto_exposure area (for avg_lum) startx (startx = register-value * 32) | ||
38 | 0x1d auto_exposure area (for avg_lum) starty (starty = register-value * 32) | ||
39 | 0x1e auto_exposure area (for avg_lum) stopx (hsize = (0x1e - 0x1c) * 32) | ||
40 | 0x1f auto_exposure area (for avg_lum) stopy (vsize = (0x1f - 0x1d) * 32) | ||
41 | */ | ||
42 | |||
23 | #define MODULE_NAME "sonixb" | 43 | #define MODULE_NAME "sonixb" |
24 | 44 | ||
25 | #include "gspca.h" | 45 | #include "gspca.h" |
@@ -31,10 +51,8 @@ MODULE_LICENSE("GPL"); | |||
31 | /* specific webcam descriptor */ | 51 | /* specific webcam descriptor */ |
32 | struct sd { | 52 | struct sd { |
33 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 53 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
34 | |||
35 | struct sd_desc sd_desc; /* our nctrls differ dependend upon the | ||
36 | sensor, so we use a per cam copy */ | ||
37 | atomic_t avg_lum; | 54 | atomic_t avg_lum; |
55 | int prev_avg_lum; | ||
38 | 56 | ||
39 | unsigned char gain; | 57 | unsigned char gain; |
40 | unsigned char exposure; | 58 | unsigned char exposure; |
@@ -44,8 +62,12 @@ struct sd { | |||
44 | unsigned char frames_to_drop; | 62 | unsigned char frames_to_drop; |
45 | unsigned char freq; /* light freq filter setting */ | 63 | unsigned char freq; /* light freq filter setting */ |
46 | 64 | ||
47 | unsigned char fr_h_sz; /* size of frame header */ | 65 | __u8 bridge; /* Type of bridge */ |
48 | char sensor; /* Type of image sensor chip */ | 66 | #define BRIDGE_101 0 |
67 | #define BRIDGE_102 0 /* We make no difference between 101 and 102 */ | ||
68 | #define BRIDGE_103 1 | ||
69 | |||
70 | __u8 sensor; /* Type of image sensor chip */ | ||
49 | #define SENSOR_HV7131R 0 | 71 | #define SENSOR_HV7131R 0 |
50 | #define SENSOR_OV6650 1 | 72 | #define SENSOR_OV6650 1 |
51 | #define SENSOR_OV7630 2 | 73 | #define SENSOR_OV7630 2 |
@@ -53,16 +75,35 @@ struct sd { | |||
53 | #define SENSOR_PAS202 4 | 75 | #define SENSOR_PAS202 4 |
54 | #define SENSOR_TAS5110 5 | 76 | #define SENSOR_TAS5110 5 |
55 | #define SENSOR_TAS5130CXX 6 | 77 | #define SENSOR_TAS5130CXX 6 |
56 | char sensor_has_gain; | ||
57 | __u8 sensor_addr; | ||
58 | __u8 reg11; | 78 | __u8 reg11; |
59 | }; | 79 | }; |
60 | 80 | ||
61 | /* flags used in the device id table */ | 81 | typedef const __u8 sensor_init_t[8]; |
82 | |||
83 | struct sensor_data { | ||
84 | const __u8 *bridge_init[2]; | ||
85 | int bridge_init_size[2]; | ||
86 | sensor_init_t *sensor_init; | ||
87 | int sensor_init_size; | ||
88 | sensor_init_t *sensor_bridge_init[2]; | ||
89 | int sensor_bridge_init_size[2]; | ||
90 | int flags; | ||
91 | unsigned ctrl_dis; | ||
92 | __u8 sensor_addr; | ||
93 | }; | ||
94 | |||
95 | /* sensor_data flags */ | ||
62 | #define F_GAIN 0x01 /* has gain */ | 96 | #define F_GAIN 0x01 /* has gain */ |
63 | #define F_AUTO 0x02 /* has autogain */ | 97 | #define F_SIF 0x02 /* sif or vga */ |
64 | #define F_SIF 0x04 /* sif or vga */ | 98 | |
65 | #define F_H18 0x08 /* long (18 b) or short (12 b) frame header */ | 99 | /* priv field of struct v4l2_pix_format flags (do not use low nibble!) */ |
100 | #define MODE_RAW 0x10 /* raw bayer mode */ | ||
101 | #define MODE_REDUCED_SIF 0x20 /* vga mode (320x240 / 160x120) on sif cam */ | ||
102 | |||
103 | /* ctrl_dis helper macros */ | ||
104 | #define NO_EXPO ((1 << EXPOSURE_IDX) | (1 << AUTOGAIN_IDX)) | ||
105 | #define NO_FREQ (1 << FREQ_IDX) | ||
106 | #define NO_BRIGHTNESS (1 << BRIGHTNESS_IDX) | ||
66 | 107 | ||
67 | #define COMP2 0x8f | 108 | #define COMP2 0x8f |
68 | #define COMP 0xc7 /* 0x87 //0x07 */ | 109 | #define COMP 0xc7 /* 0x87 //0x07 */ |
@@ -73,6 +114,18 @@ struct sd { | |||
73 | 114 | ||
74 | #define SYS_CLK 0x04 | 115 | #define SYS_CLK 0x04 |
75 | 116 | ||
117 | #define SENS(bridge_1, bridge_3, sensor, sensor_1, \ | ||
118 | sensor_3, _flags, _ctrl_dis, _sensor_addr) \ | ||
119 | { \ | ||
120 | .bridge_init = { bridge_1, bridge_3 }, \ | ||
121 | .bridge_init_size = { sizeof(bridge_1), sizeof(bridge_3) }, \ | ||
122 | .sensor_init = sensor, \ | ||
123 | .sensor_init_size = sizeof(sensor), \ | ||
124 | .sensor_bridge_init = { sensor_1, sensor_3,}, \ | ||
125 | .sensor_bridge_init_size = { sizeof(sensor_1), sizeof(sensor_3)}, \ | ||
126 | .flags = _flags, .ctrl_dis = _ctrl_dis, .sensor_addr = _sensor_addr \ | ||
127 | } | ||
128 | |||
76 | /* We calculate the autogain at the end of the transfer of a frame, at this | 129 | /* We calculate the autogain at the end of the transfer of a frame, at this |
77 | moment a frame with the old settings is being transmitted, and a frame is | 130 | moment a frame with the old settings is being transmitted, and a frame is |
78 | being captured with the old settings. So if we adjust the autogain we must | 131 | being captured with the old settings. So if we adjust the autogain we must |
@@ -95,6 +148,7 @@ static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val); | |||
95 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); | 148 | static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val); |
96 | 149 | ||
97 | static struct ctrl sd_ctrls[] = { | 150 | static struct ctrl sd_ctrls[] = { |
151 | #define BRIGHTNESS_IDX 0 | ||
98 | { | 152 | { |
99 | { | 153 | { |
100 | .id = V4L2_CID_BRIGHTNESS, | 154 | .id = V4L2_CID_BRIGHTNESS, |
@@ -109,6 +163,7 @@ static struct ctrl sd_ctrls[] = { | |||
109 | .set = sd_setbrightness, | 163 | .set = sd_setbrightness, |
110 | .get = sd_getbrightness, | 164 | .get = sd_getbrightness, |
111 | }, | 165 | }, |
166 | #define GAIN_IDX 1 | ||
112 | { | 167 | { |
113 | { | 168 | { |
114 | .id = V4L2_CID_GAIN, | 169 | .id = V4L2_CID_GAIN, |
@@ -124,6 +179,7 @@ static struct ctrl sd_ctrls[] = { | |||
124 | .set = sd_setgain, | 179 | .set = sd_setgain, |
125 | .get = sd_getgain, | 180 | .get = sd_getgain, |
126 | }, | 181 | }, |
182 | #define EXPOSURE_IDX 2 | ||
127 | { | 183 | { |
128 | { | 184 | { |
129 | .id = V4L2_CID_EXPOSURE, | 185 | .id = V4L2_CID_EXPOSURE, |
@@ -140,6 +196,7 @@ static struct ctrl sd_ctrls[] = { | |||
140 | .set = sd_setexposure, | 196 | .set = sd_setexposure, |
141 | .get = sd_getexposure, | 197 | .get = sd_getexposure, |
142 | }, | 198 | }, |
199 | #define AUTOGAIN_IDX 3 | ||
143 | { | 200 | { |
144 | { | 201 | { |
145 | .id = V4L2_CID_AUTOGAIN, | 202 | .id = V4L2_CID_AUTOGAIN, |
@@ -155,6 +212,7 @@ static struct ctrl sd_ctrls[] = { | |||
155 | .set = sd_setautogain, | 212 | .set = sd_setautogain, |
156 | .get = sd_getautogain, | 213 | .get = sd_getautogain, |
157 | }, | 214 | }, |
215 | #define FREQ_IDX 4 | ||
158 | { | 216 | { |
159 | { | 217 | { |
160 | .id = V4L2_CID_POWER_LINE_FREQUENCY, | 218 | .id = V4L2_CID_POWER_LINE_FREQUENCY, |
@@ -172,31 +230,56 @@ static struct ctrl sd_ctrls[] = { | |||
172 | }; | 230 | }; |
173 | 231 | ||
174 | static struct v4l2_pix_format vga_mode[] = { | 232 | static struct v4l2_pix_format vga_mode[] = { |
233 | {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, | ||
234 | .bytesperline = 160, | ||
235 | .sizeimage = 160 * 120 * 5 / 4, | ||
236 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
237 | .priv = 2 | MODE_RAW}, | ||
175 | {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | 238 | {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, |
176 | .bytesperline = 160, | 239 | .bytesperline = 160, |
177 | .sizeimage = 160 * 120, | 240 | .sizeimage = 160 * 120 * 5 / 4, |
178 | .colorspace = V4L2_COLORSPACE_SRGB, | 241 | .colorspace = V4L2_COLORSPACE_SRGB, |
179 | .priv = 2}, | 242 | .priv = 2}, |
180 | {320, 240, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | 243 | {320, 240, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, |
181 | .bytesperline = 320, | 244 | .bytesperline = 320, |
182 | .sizeimage = 320 * 240, | 245 | .sizeimage = 320 * 240 * 5 / 4, |
183 | .colorspace = V4L2_COLORSPACE_SRGB, | 246 | .colorspace = V4L2_COLORSPACE_SRGB, |
184 | .priv = 1}, | 247 | .priv = 1}, |
185 | {640, 480, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | 248 | {640, 480, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, |
186 | .bytesperline = 640, | 249 | .bytesperline = 640, |
187 | .sizeimage = 640 * 480, | 250 | .sizeimage = 640 * 480 * 5 / 4, |
188 | .colorspace = V4L2_COLORSPACE_SRGB, | 251 | .colorspace = V4L2_COLORSPACE_SRGB, |
189 | .priv = 0}, | 252 | .priv = 0}, |
190 | }; | 253 | }; |
191 | static struct v4l2_pix_format sif_mode[] = { | 254 | static struct v4l2_pix_format sif_mode[] = { |
255 | {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, | ||
256 | .bytesperline = 160, | ||
257 | .sizeimage = 160 * 120, | ||
258 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
259 | .priv = 1 | MODE_RAW | MODE_REDUCED_SIF}, | ||
260 | {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | ||
261 | .bytesperline = 160, | ||
262 | .sizeimage = 160 * 120 * 5 / 4, | ||
263 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
264 | .priv = 1 | MODE_REDUCED_SIF}, | ||
265 | {176, 144, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, | ||
266 | .bytesperline = 176, | ||
267 | .sizeimage = 176 * 144 * 5 / 4, | ||
268 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
269 | .priv = 1 | MODE_RAW}, | ||
192 | {176, 144, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | 270 | {176, 144, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, |
193 | .bytesperline = 176, | 271 | .bytesperline = 176, |
194 | .sizeimage = 176 * 144, | 272 | .sizeimage = 176 * 144 * 5 / 4, |
195 | .colorspace = V4L2_COLORSPACE_SRGB, | 273 | .colorspace = V4L2_COLORSPACE_SRGB, |
196 | .priv = 1}, | 274 | .priv = 1}, |
275 | {320, 240, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | ||
276 | .bytesperline = 320, | ||
277 | .sizeimage = 320 * 240 * 5 / 4, | ||
278 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
279 | .priv = 0 | MODE_REDUCED_SIF}, | ||
197 | {352, 288, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, | 280 | {352, 288, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, |
198 | .bytesperline = 352, | 281 | .bytesperline = 352, |
199 | .sizeimage = 352 * 288, | 282 | .sizeimage = 352 * 288 * 5 / 4, |
200 | .colorspace = V4L2_COLORSPACE_SRGB, | 283 | .colorspace = V4L2_COLORSPACE_SRGB, |
201 | .priv = 0}, | 284 | .priv = 0}, |
202 | }; | 285 | }; |
@@ -204,7 +287,7 @@ static struct v4l2_pix_format sif_mode[] = { | |||
204 | static const __u8 initHv7131[] = { | 287 | static const __u8 initHv7131[] = { |
205 | 0x46, 0x77, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, | 288 | 0x46, 0x77, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x11, 0x00, 0x00, 0x00, |
206 | 0x00, 0x00, | 289 | 0x00, 0x00, |
207 | 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, /* shift from 0x02 0x01 0x00 */ | 290 | 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, |
208 | 0x28, 0x1e, 0x60, 0x8a, 0x20, | 291 | 0x28, 0x1e, 0x60, 0x8a, 0x20, |
209 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c | 292 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c |
210 | }; | 293 | }; |
@@ -218,8 +301,8 @@ static const __u8 hv7131_sensor_init[][8] = { | |||
218 | static const __u8 initOv6650[] = { | 301 | static const __u8 initOv6650[] = { |
219 | 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, | 302 | 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, |
220 | 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 303 | 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
221 | 0x00, 0x02, 0x01, 0x0a, 0x16, 0x12, 0x68, 0x0b, | 304 | 0x00, 0x01, 0x01, 0x0a, 0x16, 0x12, 0x68, 0x8b, |
222 | 0x10, 0x1d, 0x10, 0x00, 0x06, 0x1f, 0x00 | 305 | 0x10, 0x1d, 0x10, 0x02, 0x02, 0x09, 0x07 |
223 | }; | 306 | }; |
224 | static const __u8 ov6650_sensor_init[][8] = | 307 | static const __u8 ov6650_sensor_init[][8] = |
225 | { | 308 | { |
@@ -257,15 +340,15 @@ static const __u8 ov6650_sensor_init[][8] = | |||
257 | static const __u8 initOv7630[] = { | 340 | static const __u8 initOv7630[] = { |
258 | 0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* r01 .. r08 */ | 341 | 0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* r01 .. r08 */ |
259 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */ | 342 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */ |
260 | 0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */ | 343 | 0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */ |
261 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ | 344 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ |
262 | 0x68, COMP1, MCK_INIT1, /* r17 .. r19 */ | 345 | 0x68, COMP2, MCK_INIT1, /* r17 .. r19 */ |
263 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c /* r1a .. r1f */ | 346 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c /* r1a .. r1f */ |
264 | }; | 347 | }; |
265 | static const __u8 initOv7630_3[] = { | 348 | static const __u8 initOv7630_3[] = { |
266 | 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ | 349 | 0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */ |
267 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */ | 350 | 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, /* r09 .. r10 */ |
268 | 0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */ | 351 | 0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */ |
269 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ | 352 | 0x28, 0x1e, /* H & V sizes r15 .. r16 */ |
270 | 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ | 353 | 0x68, 0x8f, MCK_INIT1, /* r17 .. r19 */ |
271 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00, /* r1a .. r20 */ | 354 | 0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c, 0x00, /* r1a .. r20 */ |
@@ -294,47 +377,65 @@ static const __u8 ov7630_sensor_init[][8] = { | |||
294 | {0xd0, 0x21, 0x17, 0x1c, 0xbd, 0x06, 0xf6, 0x10}, | 377 | {0xd0, 0x21, 0x17, 0x1c, 0xbd, 0x06, 0xf6, 0x10}, |
295 | }; | 378 | }; |
296 | 379 | ||
380 | static const __u8 ov7630_sensor_init_3[][8] = { | ||
381 | {0xa0, 0x21, 0x13, 0x80, 0x00, 0x00, 0x00, 0x10}, | ||
382 | }; | ||
383 | |||
297 | static const __u8 initPas106[] = { | 384 | static const __u8 initPas106[] = { |
298 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x00, 0x00, | 385 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x40, 0x00, 0x00, 0x00, |
299 | 0x00, 0x00, | 386 | 0x00, 0x00, |
300 | 0x00, 0x00, 0x00, 0x05, 0x01, 0x00, | 387 | 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, |
301 | 0x16, 0x12, 0x28, COMP1, MCK_INIT1, | 388 | 0x16, 0x12, 0x24, COMP1, MCK_INIT1, |
302 | 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c | 389 | 0x18, 0x10, 0x02, 0x02, 0x09, 0x07 |
303 | }; | 390 | }; |
304 | /* compression 0x86 mckinit1 0x2b */ | 391 | /* compression 0x86 mckinit1 0x2b */ |
305 | static const __u8 pas106_data[][2] = { | 392 | static const __u8 pas106_sensor_init[][8] = { |
306 | {0x02, 0x04}, /* Pixel Clock Divider 6 */ | 393 | /* Pixel Clock Divider 6 */ |
307 | {0x03, 0x13}, /* Frame Time MSB */ | 394 | { 0xa1, 0x40, 0x02, 0x04, 0x00, 0x00, 0x00, 0x14 }, |
308 | /* {0x03, 0x12}, * Frame Time MSB */ | 395 | /* Frame Time MSB (also seen as 0x12) */ |
309 | {0x04, 0x06}, /* Frame Time LSB */ | 396 | { 0xa1, 0x40, 0x03, 0x13, 0x00, 0x00, 0x00, 0x14 }, |
310 | /* {0x04, 0x05}, * Frame Time LSB */ | 397 | /* Frame Time LSB (also seen as 0x05) */ |
311 | {0x05, 0x65}, /* Shutter Time Line Offset */ | 398 | { 0xa1, 0x40, 0x04, 0x06, 0x00, 0x00, 0x00, 0x14 }, |
312 | /* {0x05, 0x6d}, * Shutter Time Line Offset */ | 399 | /* Shutter Time Line Offset (also seen as 0x6d) */ |
313 | /* {0x06, 0xb1}, * Shutter Time Pixel Offset */ | 400 | { 0xa1, 0x40, 0x05, 0x65, 0x00, 0x00, 0x00, 0x14 }, |
314 | {0x06, 0xcd}, /* Shutter Time Pixel Offset */ | 401 | /* Shutter Time Pixel Offset (also seen as 0xb1) */ |
315 | {0x07, 0xc1}, /* Black Level Subtract Sign */ | 402 | { 0xa1, 0x40, 0x06, 0xcd, 0x00, 0x00, 0x00, 0x14 }, |
316 | /* {0x07, 0x00}, * Black Level Subtract Sign */ | 403 | /* Black Level Subtract Sign (also seen 0x00) */ |
317 | {0x08, 0x06}, /* Black Level Subtract Level */ | 404 | { 0xa1, 0x40, 0x07, 0xc1, 0x00, 0x00, 0x00, 0x14 }, |
318 | {0x08, 0x06}, /* Black Level Subtract Level */ | 405 | /* Black Level Subtract Level (also seen 0x01) */ |
319 | /* {0x08, 0x01}, * Black Level Subtract Level */ | 406 | { 0xa1, 0x40, 0x08, 0x06, 0x00, 0x00, 0x00, 0x14 }, |
320 | {0x09, 0x05}, /* Color Gain B Pixel 5 a */ | 407 | { 0xa1, 0x40, 0x08, 0x06, 0x00, 0x00, 0x00, 0x14 }, |
321 | {0x0a, 0x04}, /* Color Gain G1 Pixel 1 5 */ | 408 | /* Color Gain B Pixel 5 a */ |
322 | {0x0b, 0x04}, /* Color Gain G2 Pixel 1 0 5 */ | 409 | { 0xa1, 0x40, 0x09, 0x05, 0x00, 0x00, 0x00, 0x14 }, |
323 | {0x0c, 0x05}, /* Color Gain R Pixel 3 1 */ | 410 | /* Color Gain G1 Pixel 1 5 */ |
324 | {0x0d, 0x00}, /* Color GainH Pixel */ | 411 | { 0xa1, 0x40, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x14 }, |
325 | {0x0e, 0x0e}, /* Global Gain */ | 412 | /* Color Gain G2 Pixel 1 0 5 */ |
326 | {0x0f, 0x00}, /* Contrast */ | 413 | { 0xa1, 0x40, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x14 }, |
327 | {0x10, 0x06}, /* H&V synchro polarity */ | 414 | /* Color Gain R Pixel 3 1 */ |
328 | {0x11, 0x06}, /* ?default */ | 415 | { 0xa1, 0x40, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x14 }, |
329 | {0x12, 0x06}, /* DAC scale */ | 416 | /* Color GainH Pixel */ |
330 | {0x14, 0x02}, /* ?default */ | 417 | { 0xa1, 0x40, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x14 }, |
331 | {0x13, 0x01}, /* Validate Settings */ | 418 | /* Global Gain */ |
419 | { 0xa1, 0x40, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x14 }, | ||
420 | /* Contrast */ | ||
421 | { 0xa1, 0x40, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x14 }, | ||
422 | /* H&V synchro polarity */ | ||
423 | { 0xa1, 0x40, 0x10, 0x06, 0x00, 0x00, 0x00, 0x14 }, | ||
424 | /* ?default */ | ||
425 | { 0xa1, 0x40, 0x11, 0x06, 0x00, 0x00, 0x00, 0x14 }, | ||
426 | /* DAC scale */ | ||
427 | { 0xa1, 0x40, 0x12, 0x06, 0x00, 0x00, 0x00, 0x14 }, | ||
428 | /* ?default */ | ||
429 | { 0xa1, 0x40, 0x14, 0x02, 0x00, 0x00, 0x00, 0x14 }, | ||
430 | /* Validate Settings */ | ||
431 | { 0xa1, 0x40, 0x13, 0x01, 0x00, 0x00, 0x00, 0x14 }, | ||
332 | }; | 432 | }; |
433 | |||
333 | static const __u8 initPas202[] = { | 434 | static const __u8 initPas202[] = { |
334 | 0x44, 0x44, 0x21, 0x30, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, | 435 | 0x44, 0x44, 0x21, 0x30, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, |
335 | 0x00, 0x00, | 436 | 0x00, 0x00, |
336 | 0x00, 0x00, 0x00, 0x07, 0x03, 0x0a, /* 6 */ | 437 | 0x00, 0x00, 0x00, 0x06, 0x03, 0x0a, |
337 | 0x28, 0x1e, 0x28, 0x89, 0x30, | 438 | 0x28, 0x1e, 0x28, 0x89, 0x20, |
338 | 0x00, 0x00, 0x02, 0x03, 0x0f, 0x0c | 439 | 0x00, 0x00, 0x02, 0x03, 0x0f, 0x0c |
339 | }; | 440 | }; |
340 | static const __u8 pas202_sensor_init[][8] = { | 441 | static const __u8 pas202_sensor_init[][8] = { |
@@ -364,7 +465,7 @@ static const __u8 pas202_sensor_init[][8] = { | |||
364 | static const __u8 initTas5110[] = { | 465 | static const __u8 initTas5110[] = { |
365 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, | 466 | 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, |
366 | 0x00, 0x00, | 467 | 0x00, 0x00, |
367 | 0x00, 0x01, 0x00, 0x46, 0x09, 0x0a, /* shift from 0x45 0x09 0x0a */ | 468 | 0x00, 0x01, 0x00, 0x45, 0x09, 0x0a, |
368 | 0x16, 0x12, 0x60, 0x86, 0x2b, | 469 | 0x16, 0x12, 0x60, 0x86, 0x2b, |
369 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 | 470 | 0x14, 0x0a, 0x02, 0x02, 0x09, 0x07 |
370 | }; | 471 | }; |
@@ -377,7 +478,7 @@ static const __u8 tas5110_sensor_init[][8] = { | |||
377 | static const __u8 initTas5130[] = { | 478 | static const __u8 initTas5130[] = { |
378 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, | 479 | 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x11, 0x00, 0x00, 0x00, |
379 | 0x00, 0x00, | 480 | 0x00, 0x00, |
380 | 0x00, 0x01, 0x00, 0x69, 0x0c, 0x0a, | 481 | 0x00, 0x01, 0x00, 0x68, 0x0c, 0x0a, |
381 | 0x28, 0x1e, 0x60, COMP, MCK_INIT, | 482 | 0x28, 0x1e, 0x60, COMP, MCK_INIT, |
382 | 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c | 483 | 0x18, 0x10, 0x04, 0x03, 0x11, 0x0c |
383 | }; | 484 | }; |
@@ -389,6 +490,21 @@ static const __u8 tas5130_sensor_init[][8] = { | |||
389 | {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10}, | 490 | {0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10}, |
390 | }; | 491 | }; |
391 | 492 | ||
493 | struct sensor_data sensor_data[] = { | ||
494 | SENS(initHv7131, NULL, hv7131_sensor_init, NULL, NULL, 0, NO_EXPO|NO_FREQ, 0), | ||
495 | SENS(initOv6650, NULL, ov6650_sensor_init, NULL, NULL, F_GAIN|F_SIF, 0, 0x60), | ||
496 | SENS(initOv7630, initOv7630_3, ov7630_sensor_init, NULL, ov7630_sensor_init_3, | ||
497 | F_GAIN, 0, 0x21), | ||
498 | SENS(initPas106, NULL, pas106_sensor_init, NULL, NULL, F_SIF, NO_EXPO|NO_FREQ, | ||
499 | 0), | ||
500 | SENS(initPas202, initPas202, pas202_sensor_init, NULL, NULL, 0, | ||
501 | NO_EXPO|NO_FREQ, 0), | ||
502 | SENS(initTas5110, NULL, tas5110_sensor_init, NULL, NULL, F_GAIN|F_SIF, | ||
503 | NO_BRIGHTNESS|NO_FREQ, 0), | ||
504 | SENS(initTas5130, NULL, tas5130_sensor_init, NULL, NULL, 0, NO_EXPO|NO_FREQ, | ||
505 | 0), | ||
506 | }; | ||
507 | |||
392 | /* get one byte in gspca_dev->usb_buf */ | 508 | /* get one byte in gspca_dev->usb_buf */ |
393 | static void reg_r(struct gspca_dev *gspca_dev, | 509 | static void reg_r(struct gspca_dev *gspca_dev, |
394 | __u16 value) | 510 | __u16 value) |
@@ -409,7 +525,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
409 | int len) | 525 | int len) |
410 | { | 526 | { |
411 | #ifdef GSPCA_DEBUG | 527 | #ifdef GSPCA_DEBUG |
412 | if (len > sizeof gspca_dev->usb_buf) { | 528 | if (len > USB_BUF_SZ) { |
413 | PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow"); | 529 | PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow"); |
414 | return; | 530 | return; |
415 | } | 531 | } |
@@ -425,26 +541,6 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
425 | 500); | 541 | 500); |
426 | } | 542 | } |
427 | 543 | ||
428 | static void reg_w_big(struct gspca_dev *gspca_dev, | ||
429 | __u16 value, | ||
430 | const __u8 *buffer, | ||
431 | int len) | ||
432 | { | ||
433 | __u8 *tmpbuf; | ||
434 | |||
435 | tmpbuf = kmalloc(len, GFP_KERNEL); | ||
436 | memcpy(tmpbuf, buffer, len); | ||
437 | usb_control_msg(gspca_dev->dev, | ||
438 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
439 | 0x08, /* request */ | ||
440 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
441 | value, | ||
442 | 0, /* index */ | ||
443 | tmpbuf, len, | ||
444 | 500); | ||
445 | kfree(tmpbuf); | ||
446 | } | ||
447 | |||
448 | static int i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) | 544 | static int i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer) |
449 | { | 545 | { |
450 | int retry = 60; | 546 | int retry = 60; |
@@ -487,7 +583,7 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
487 | {0xa0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}; | 583 | {0xa0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10}; |
488 | 584 | ||
489 | /* change reg 0x06 */ | 585 | /* change reg 0x06 */ |
490 | i2cOV[1] = sd->sensor_addr; | 586 | i2cOV[1] = sensor_data[sd->sensor].sensor_addr; |
491 | i2cOV[3] = sd->brightness; | 587 | i2cOV[3] = sd->brightness; |
492 | if (i2c_w(gspca_dev, i2cOV) < 0) | 588 | if (i2c_w(gspca_dev, i2cOV) < 0) |
493 | goto err; | 589 | goto err; |
@@ -545,9 +641,6 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
545 | goto err; | 641 | goto err; |
546 | break; | 642 | break; |
547 | } | 643 | } |
548 | case SENSOR_TAS5110: | ||
549 | /* FIXME figure out howto control brightness on TAS5110 */ | ||
550 | break; | ||
551 | } | 644 | } |
552 | return; | 645 | return; |
553 | err: | 646 | err: |
@@ -577,7 +670,7 @@ static void setsensorgain(struct gspca_dev *gspca_dev) | |||
577 | case SENSOR_OV7630: { | 670 | case SENSOR_OV7630: { |
578 | __u8 i2c[] = {0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; | 671 | __u8 i2c[] = {0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}; |
579 | 672 | ||
580 | i2c[1] = sd->sensor_addr; | 673 | i2c[1] = sensor_data[sd->sensor].sensor_addr; |
581 | i2c[3] = gain >> 2; | 674 | i2c[3] = gain >> 2; |
582 | if (i2c_w(gspca_dev, i2c) < 0) | 675 | if (i2c_w(gspca_dev, i2c) < 0) |
583 | goto err; | 676 | goto err; |
@@ -604,7 +697,7 @@ static void setgain(struct gspca_dev *gspca_dev) | |||
604 | rgb_value = gain; | 697 | rgb_value = gain; |
605 | reg_w(gspca_dev, 0x11, &rgb_value, 1); | 698 | reg_w(gspca_dev, 0x11, &rgb_value, 1); |
606 | 699 | ||
607 | if (sd->sensor_has_gain) | 700 | if (sensor_data[sd->sensor].flags & F_GAIN) |
608 | setsensorgain(gspca_dev); | 701 | setsensorgain(gspca_dev); |
609 | } | 702 | } |
610 | 703 | ||
@@ -665,6 +758,11 @@ static void setexposure(struct gspca_dev *gspca_dev) | |||
665 | else if (reg11 > 16) | 758 | else if (reg11 > 16) |
666 | reg11 = 16; | 759 | reg11 = 16; |
667 | 760 | ||
761 | /* In 640x480, if the reg11 has less than 3, the image is | ||
762 | unstable (not enough bandwidth). */ | ||
763 | if (gspca_dev->width == 640 && reg11 < 3) | ||
764 | reg11 = 3; | ||
765 | |||
668 | /* frame exposure time in ms = 1000 * reg11 / 30 -> | 766 | /* frame exposure time in ms = 1000 * reg11 / 30 -> |
669 | reg10 = sd->exposure * 2 * reg10_max / (1000 * reg11 / 30) */ | 767 | reg10 = sd->exposure * 2 * reg10_max / (1000 * reg11 / 30) */ |
670 | reg10 = (sd->exposure * 60 * reg10_max) / (1000 * reg11); | 768 | reg10 = (sd->exposure * 60 * reg10_max) / (1000 * reg11); |
@@ -678,13 +776,8 @@ static void setexposure(struct gspca_dev *gspca_dev) | |||
678 | else if (reg10 > reg10_max) | 776 | else if (reg10 > reg10_max) |
679 | reg10 = reg10_max; | 777 | reg10 = reg10_max; |
680 | 778 | ||
681 | /* In 640x480, if the reg11 has less than 3, the image is | ||
682 | unstable (not enough bandwidth). */ | ||
683 | if (gspca_dev->width == 640 && reg11 < 3) | ||
684 | reg11 = 3; | ||
685 | |||
686 | /* Write reg 10 and reg11 low nibble */ | 779 | /* Write reg 10 and reg11 low nibble */ |
687 | i2c[1] = sd->sensor_addr; | 780 | i2c[1] = sensor_data[sd->sensor].sensor_addr; |
688 | i2c[3] = reg10; | 781 | i2c[3] = reg10; |
689 | i2c[4] |= reg11 - 1; | 782 | i2c[4] |= reg11 - 1; |
690 | 783 | ||
@@ -724,7 +817,7 @@ static void setfreq(struct gspca_dev *gspca_dev) | |||
724 | ? 0x4f : 0x8a; | 817 | ? 0x4f : 0x8a; |
725 | break; | 818 | break; |
726 | } | 819 | } |
727 | i2c[1] = sd->sensor_addr; | 820 | i2c[1] = sensor_data[sd->sensor].sensor_addr; |
728 | if (i2c_w(gspca_dev, i2c) < 0) | 821 | if (i2c_w(gspca_dev, i2c) < 0) |
729 | PDEBUG(D_ERR, "i2c error setfreq"); | 822 | PDEBUG(D_ERR, "i2c error setfreq"); |
730 | break; | 823 | break; |
@@ -757,30 +850,19 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
757 | { | 850 | { |
758 | struct sd *sd = (struct sd *) gspca_dev; | 851 | struct sd *sd = (struct sd *) gspca_dev; |
759 | struct cam *cam; | 852 | struct cam *cam; |
760 | int sif = 0; | ||
761 | 853 | ||
762 | /* nctrls depends upon the sensor, so we use a per cam copy */ | 854 | reg_r(gspca_dev, 0x00); |
763 | memcpy(&sd->sd_desc, gspca_dev->sd_desc, sizeof(struct sd_desc)); | 855 | if (gspca_dev->usb_buf[0] != 0x10) |
764 | gspca_dev->sd_desc = &sd->sd_desc; | 856 | return -ENODEV; |
765 | 857 | ||
766 | /* copy the webcam info from the device id */ | 858 | /* copy the webcam info from the device id */ |
767 | sd->sensor = (id->driver_info >> 24) & 0xff; | 859 | sd->sensor = id->driver_info >> 8; |
768 | if (id->driver_info & (F_GAIN << 16)) | 860 | sd->bridge = id->driver_info & 0xff; |
769 | sd->sensor_has_gain = 1; | 861 | gspca_dev->ctrl_dis = sensor_data[sd->sensor].ctrl_dis; |
770 | if (id->driver_info & (F_AUTO << 16)) | ||
771 | sd->sd_desc.dq_callback = do_autogain; | ||
772 | if (id->driver_info & (F_SIF << 16)) | ||
773 | sif = 1; | ||
774 | if (id->driver_info & (F_H18 << 16)) | ||
775 | sd->fr_h_sz = 18; /* size of frame header */ | ||
776 | else | ||
777 | sd->fr_h_sz = 12; | ||
778 | sd->sd_desc.nctrls = (id->driver_info >> 8) & 0xff; | ||
779 | sd->sensor_addr = id->driver_info & 0xff; | ||
780 | 862 | ||
781 | cam = &gspca_dev->cam; | 863 | cam = &gspca_dev->cam; |
782 | cam->epaddr = 0x01; | 864 | cam->epaddr = 0x01; |
783 | if (!sif) { | 865 | if (!(sensor_data[sd->sensor].flags & F_SIF)) { |
784 | cam->cam_mode = vga_mode; | 866 | cam->cam_mode = vga_mode; |
785 | cam->nmodes = ARRAY_SIZE(vga_mode); | 867 | cam->nmodes = ARRAY_SIZE(vga_mode); |
786 | } else { | 868 | } else { |
@@ -790,157 +872,98 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
790 | sd->brightness = BRIGHTNESS_DEF; | 872 | sd->brightness = BRIGHTNESS_DEF; |
791 | sd->gain = GAIN_DEF; | 873 | sd->gain = GAIN_DEF; |
792 | sd->exposure = EXPOSURE_DEF; | 874 | sd->exposure = EXPOSURE_DEF; |
793 | sd->autogain = AUTOGAIN_DEF; | 875 | if (gspca_dev->ctrl_dis & (1 << AUTOGAIN_IDX)) |
876 | sd->autogain = 0; /* Disable do_autogain callback */ | ||
877 | else | ||
878 | sd->autogain = AUTOGAIN_DEF; | ||
794 | sd->freq = FREQ_DEF; | 879 | sd->freq = FREQ_DEF; |
795 | 880 | ||
796 | return 0; | 881 | return 0; |
797 | } | 882 | } |
798 | 883 | ||
799 | /* this function is called at open time */ | 884 | /* this function is called at probe and resume time */ |
800 | static int sd_open(struct gspca_dev *gspca_dev) | 885 | static int sd_init(struct gspca_dev *gspca_dev) |
801 | { | 886 | { |
802 | reg_r(gspca_dev, 0x00); | 887 | const __u8 stop = 0x09; /* Disable stream turn of LED */ |
803 | if (gspca_dev->usb_buf[0] != 0x10) | ||
804 | return -ENODEV; | ||
805 | return 0; | ||
806 | } | ||
807 | 888 | ||
808 | static void pas106_i2cinit(struct gspca_dev *gspca_dev) | 889 | reg_w(gspca_dev, 0x01, &stop, 1); |
809 | { | 890 | |
810 | int i; | 891 | return 0; |
811 | const __u8 *data; | ||
812 | __u8 i2c1[] = { 0xa1, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14 }; | ||
813 | |||
814 | i = ARRAY_SIZE(pas106_data); | ||
815 | data = pas106_data[0]; | ||
816 | while (--i >= 0) { | ||
817 | memcpy(&i2c1[2], data, 2); | ||
818 | /* copy 2 bytes from the template */ | ||
819 | if (i2c_w(gspca_dev, i2c1) < 0) | ||
820 | PDEBUG(D_ERR, "i2c error pas106"); | ||
821 | data += 2; | ||
822 | } | ||
823 | } | 892 | } |
824 | 893 | ||
825 | /* -- start the camera -- */ | 894 | /* -- start the camera -- */ |
826 | static void sd_start(struct gspca_dev *gspca_dev) | 895 | static void sd_start(struct gspca_dev *gspca_dev) |
827 | { | 896 | { |
828 | struct sd *sd = (struct sd *) gspca_dev; | 897 | struct sd *sd = (struct sd *) gspca_dev; |
829 | int mode, l = 0x1f; | 898 | struct cam *cam = &gspca_dev->cam; |
899 | int mode, l; | ||
830 | const __u8 *sn9c10x; | 900 | const __u8 *sn9c10x; |
831 | __u8 reg17_19[3]; | 901 | __u8 reg12_19[8]; |
832 | 902 | ||
833 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 903 | mode = cam->cam_mode[gspca_dev->curr_mode].priv & 0x07; |
904 | sn9c10x = sensor_data[sd->sensor].bridge_init[sd->bridge]; | ||
905 | l = sensor_data[sd->sensor].bridge_init_size[sd->bridge]; | ||
906 | memcpy(reg12_19, &sn9c10x[0x12 - 1], 8); | ||
907 | reg12_19[6] = sn9c10x[0x18 - 1] | (mode << 4); | ||
908 | /* Special cases where reg 17 and or 19 value depends on mode */ | ||
834 | switch (sd->sensor) { | 909 | switch (sd->sensor) { |
835 | case SENSOR_HV7131R: | ||
836 | sn9c10x = initHv7131; | ||
837 | reg17_19[0] = 0x60; | ||
838 | reg17_19[1] = (mode << 4) | 0x8a; | ||
839 | reg17_19[2] = 0x20; | ||
840 | break; | ||
841 | case SENSOR_OV6650: | ||
842 | sn9c10x = initOv6650; | ||
843 | reg17_19[0] = 0x68; | ||
844 | reg17_19[1] = (mode << 4) | 0x8b; | ||
845 | reg17_19[2] = 0x20; | ||
846 | break; | ||
847 | case SENSOR_OV7630: | ||
848 | if (sd->fr_h_sz == 18) { /* SN9C103 */ | ||
849 | sn9c10x = initOv7630_3; | ||
850 | l = sizeof initOv7630_3; | ||
851 | } else | ||
852 | sn9c10x = initOv7630; | ||
853 | reg17_19[0] = 0x68; | ||
854 | reg17_19[1] = (mode << 4) | COMP2; | ||
855 | reg17_19[2] = MCK_INIT1; | ||
856 | break; | ||
857 | case SENSOR_PAS106: | ||
858 | sn9c10x = initPas106; | ||
859 | reg17_19[0] = 0x24; /* 0x28 */ | ||
860 | reg17_19[1] = (mode << 4) | COMP1; | ||
861 | reg17_19[2] = MCK_INIT1; | ||
862 | break; | ||
863 | case SENSOR_PAS202: | 910 | case SENSOR_PAS202: |
864 | sn9c10x = initPas202; | 911 | reg12_19[5] = mode ? 0x24 : 0x20; |
865 | reg17_19[0] = mode ? 0x24 : 0x20; | ||
866 | reg17_19[1] = (mode << 4) | 0x89; | ||
867 | reg17_19[2] = 0x20; | ||
868 | break; | 912 | break; |
869 | case SENSOR_TAS5110: | 913 | case SENSOR_TAS5130CXX: |
870 | sn9c10x = initTas5110; | 914 | /* probably not mode specific at all most likely the upper |
871 | reg17_19[0] = 0x60; | 915 | nibble of 0x19 is exposure (clock divider) just as with |
872 | reg17_19[1] = (mode << 4) | 0x86; | 916 | the tas5110, we need someone to test this. */ |
873 | reg17_19[2] = 0x2b; /* 0xf3; */ | 917 | reg12_19[7] = mode ? 0x23 : 0x43; |
874 | break; | ||
875 | default: | ||
876 | /* case SENSOR_TAS5130CXX: */ | ||
877 | sn9c10x = initTas5130; | ||
878 | reg17_19[0] = 0x60; | ||
879 | reg17_19[1] = (mode << 4) | COMP; | ||
880 | reg17_19[2] = mode ? 0x23 : 0x43; | ||
881 | break; | 918 | break; |
882 | } | 919 | } |
920 | /* Disable compression when the raw bayer format has been selected */ | ||
921 | if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) | ||
922 | reg12_19[6] &= ~0x80; | ||
923 | |||
924 | /* Vga mode emulation on SIF sensor? */ | ||
925 | if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_REDUCED_SIF) { | ||
926 | reg12_19[0] += 16; /* 0x12: hstart adjust */ | ||
927 | reg12_19[1] += 24; /* 0x13: vstart adjust */ | ||
928 | reg12_19[3] = 320 / 16; /* 0x15: hsize */ | ||
929 | reg12_19[4] = 240 / 16; /* 0x16: vsize */ | ||
930 | } | ||
883 | 931 | ||
884 | /* reg 0x01 bit 2 video transfert on */ | 932 | /* reg 0x01 bit 2 video transfert on */ |
885 | reg_w(gspca_dev, 0x01, &sn9c10x[0x01 - 1], 1); | 933 | reg_w(gspca_dev, 0x01, &sn9c10x[0x01 - 1], 1); |
886 | /* reg 0x17 SensorClk enable inv Clk 0x60 */ | 934 | /* reg 0x17 SensorClk enable inv Clk 0x60 */ |
887 | reg_w(gspca_dev, 0x17, &sn9c10x[0x17 - 1], 1); | 935 | reg_w(gspca_dev, 0x17, &sn9c10x[0x17 - 1], 1); |
888 | /* Set the registers from the template */ | 936 | /* Set the registers from the template */ |
889 | reg_w_big(gspca_dev, 0x01, sn9c10x, l); | 937 | reg_w(gspca_dev, 0x01, sn9c10x, l); |
890 | switch (sd->sensor) { | 938 | |
891 | case SENSOR_HV7131R: | 939 | /* Init the sensor */ |
892 | i2c_w_vector(gspca_dev, hv7131_sensor_init, | 940 | i2c_w_vector(gspca_dev, sensor_data[sd->sensor].sensor_init, |
893 | sizeof hv7131_sensor_init); | 941 | sensor_data[sd->sensor].sensor_init_size); |
894 | break; | 942 | if (sensor_data[sd->sensor].sensor_bridge_init[sd->bridge]) |
895 | case SENSOR_OV6650: | 943 | i2c_w_vector(gspca_dev, |
896 | i2c_w_vector(gspca_dev, ov6650_sensor_init, | 944 | sensor_data[sd->sensor].sensor_bridge_init[sd->bridge], |
897 | sizeof ov6650_sensor_init); | 945 | sensor_data[sd->sensor].sensor_bridge_init_size[ |
898 | break; | 946 | sd->bridge]); |
899 | case SENSOR_OV7630: | 947 | |
900 | i2c_w_vector(gspca_dev, ov7630_sensor_init, | ||
901 | sizeof ov7630_sensor_init); | ||
902 | if (sd->fr_h_sz == 18) { /* SN9C103 */ | ||
903 | const __u8 i2c[] = { 0xa0, 0x21, 0x13, 0x80, 0x00, | ||
904 | 0x00, 0x00, 0x10 }; | ||
905 | i2c_w(gspca_dev, i2c); | ||
906 | } | ||
907 | break; | ||
908 | case SENSOR_PAS106: | ||
909 | pas106_i2cinit(gspca_dev); | ||
910 | break; | ||
911 | case SENSOR_PAS202: | ||
912 | i2c_w_vector(gspca_dev, pas202_sensor_init, | ||
913 | sizeof pas202_sensor_init); | ||
914 | break; | ||
915 | case SENSOR_TAS5110: | ||
916 | i2c_w_vector(gspca_dev, tas5110_sensor_init, | ||
917 | sizeof tas5110_sensor_init); | ||
918 | break; | ||
919 | default: | ||
920 | /* case SENSOR_TAS5130CXX: */ | ||
921 | i2c_w_vector(gspca_dev, tas5130_sensor_init, | ||
922 | sizeof tas5130_sensor_init); | ||
923 | break; | ||
924 | } | ||
925 | /* H_size V_size 0x28, 0x1e -> 640x480. 0x16, 0x12 -> 352x288 */ | 948 | /* H_size V_size 0x28, 0x1e -> 640x480. 0x16, 0x12 -> 352x288 */ |
926 | reg_w(gspca_dev, 0x15, &sn9c10x[0x15 - 1], 2); | 949 | reg_w(gspca_dev, 0x15, ®12_19[3], 2); |
927 | /* compression register */ | 950 | /* compression register */ |
928 | reg_w(gspca_dev, 0x18, ®17_19[1], 1); | 951 | reg_w(gspca_dev, 0x18, ®12_19[6], 1); |
929 | /* H_start */ | 952 | /* H_start */ |
930 | reg_w(gspca_dev, 0x12, &sn9c10x[0x12 - 1], 1); | 953 | reg_w(gspca_dev, 0x12, ®12_19[0], 1); |
931 | /* V_START */ | 954 | /* V_START */ |
932 | reg_w(gspca_dev, 0x13, &sn9c10x[0x13 - 1], 1); | 955 | reg_w(gspca_dev, 0x13, ®12_19[1], 1); |
933 | /* reset 0x17 SensorClk enable inv Clk 0x60 */ | 956 | /* reset 0x17 SensorClk enable inv Clk 0x60 */ |
934 | /*fixme: ov7630 [17]=68 8f (+20 if 102)*/ | 957 | /*fixme: ov7630 [17]=68 8f (+20 if 102)*/ |
935 | reg_w(gspca_dev, 0x17, ®17_19[0], 1); | 958 | reg_w(gspca_dev, 0x17, ®12_19[5], 1); |
936 | /*MCKSIZE ->3 */ /*fixme: not ov7630*/ | 959 | /*MCKSIZE ->3 */ /*fixme: not ov7630*/ |
937 | reg_w(gspca_dev, 0x19, ®17_19[2], 1); | 960 | reg_w(gspca_dev, 0x19, ®12_19[7], 1); |
938 | /* AE_STRX AE_STRY AE_ENDX AE_ENDY */ | 961 | /* AE_STRX AE_STRY AE_ENDX AE_ENDY */ |
939 | reg_w(gspca_dev, 0x1c, &sn9c10x[0x1c - 1], 4); | 962 | reg_w(gspca_dev, 0x1c, &sn9c10x[0x1c - 1], 4); |
940 | /* Enable video transfert */ | 963 | /* Enable video transfert */ |
941 | reg_w(gspca_dev, 0x01, &sn9c10x[0], 1); | 964 | reg_w(gspca_dev, 0x01, &sn9c10x[0], 1); |
942 | /* Compression */ | 965 | /* Compression */ |
943 | reg_w(gspca_dev, 0x18, ®17_19[1], 2); | 966 | reg_w(gspca_dev, 0x18, ®12_19[6], 2); |
944 | msleep(20); | 967 | msleep(20); |
945 | 968 | ||
946 | sd->reg11 = -1; | 969 | sd->reg11 = -1; |
@@ -957,18 +980,7 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
957 | 980 | ||
958 | static void sd_stopN(struct gspca_dev *gspca_dev) | 981 | static void sd_stopN(struct gspca_dev *gspca_dev) |
959 | { | 982 | { |
960 | __u8 ByteSend; | 983 | sd_init(gspca_dev); |
961 | |||
962 | ByteSend = 0x09; /* 0X00 */ | ||
963 | reg_w(gspca_dev, 0x01, &ByteSend, 1); | ||
964 | } | ||
965 | |||
966 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
967 | { | ||
968 | } | ||
969 | |||
970 | static void sd_close(struct gspca_dev *gspca_dev) | ||
971 | { | ||
972 | } | 984 | } |
973 | 985 | ||
974 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 986 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
@@ -978,6 +990,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
978 | { | 990 | { |
979 | int i; | 991 | int i; |
980 | struct sd *sd = (struct sd *) gspca_dev; | 992 | struct sd *sd = (struct sd *) gspca_dev; |
993 | struct cam *cam = &gspca_dev->cam; | ||
981 | 994 | ||
982 | /* frames start with: | 995 | /* frames start with: |
983 | * ff ff 00 c4 c4 96 synchro | 996 | * ff ff 00 c4 c4 96 synchro |
@@ -998,20 +1011,31 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
998 | && data[5 + i] == 0x96) { /* start of frame */ | 1011 | && data[5 + i] == 0x96) { /* start of frame */ |
999 | int lum = -1; | 1012 | int lum = -1; |
1000 | int pkt_type = LAST_PACKET; | 1013 | int pkt_type = LAST_PACKET; |
1014 | int fr_h_sz = (sd->bridge == BRIDGE_103) ? | ||
1015 | 18 : 12; | ||
1001 | 1016 | ||
1002 | if (len - i < sd->fr_h_sz) { | 1017 | if (len - i < fr_h_sz) { |
1003 | PDEBUG(D_STREAM, "packet too short to" | 1018 | PDEBUG(D_STREAM, "packet too short to" |
1004 | " get avg brightness"); | 1019 | " get avg brightness"); |
1005 | } else if (sd->fr_h_sz == 12) { | 1020 | } else if (sd->bridge == BRIDGE_103) { |
1006 | lum = data[i + 8] + (data[i + 9] << 8); | ||
1007 | } else { | ||
1008 | lum = data[i + 9] + | 1021 | lum = data[i + 9] + |
1009 | (data[i + 10] << 8); | 1022 | (data[i + 10] << 8); |
1023 | } else { | ||
1024 | lum = data[i + 8] + (data[i + 9] << 8); | ||
1010 | } | 1025 | } |
1011 | if (lum == 0) { | 1026 | /* When exposure changes midway a frame we |
1027 | get a lum of 0 in this case drop 2 frames | ||
1028 | as the frames directly after an exposure | ||
1029 | change have an unstable image. Sometimes lum | ||
1030 | *really* is 0 (cam used in low light with | ||
1031 | low exposure setting), so do not drop frames | ||
1032 | if the previous lum was 0 too. */ | ||
1033 | if (lum == 0 && sd->prev_avg_lum != 0) { | ||
1012 | lum = -1; | 1034 | lum = -1; |
1013 | sd->frames_to_drop = 2; | 1035 | sd->frames_to_drop = 2; |
1014 | } | 1036 | sd->prev_avg_lum = 0; |
1037 | } else | ||
1038 | sd->prev_avg_lum = lum; | ||
1015 | atomic_set(&sd->avg_lum, lum); | 1039 | atomic_set(&sd->avg_lum, lum); |
1016 | 1040 | ||
1017 | if (sd->frames_to_drop) { | 1041 | if (sd->frames_to_drop) { |
@@ -1021,14 +1045,25 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
1021 | 1045 | ||
1022 | frame = gspca_frame_add(gspca_dev, pkt_type, | 1046 | frame = gspca_frame_add(gspca_dev, pkt_type, |
1023 | frame, data, 0); | 1047 | frame, data, 0); |
1024 | data += i + sd->fr_h_sz; | 1048 | data += i + fr_h_sz; |
1025 | len -= i + sd->fr_h_sz; | 1049 | len -= i + fr_h_sz; |
1026 | gspca_frame_add(gspca_dev, FIRST_PACKET, | 1050 | gspca_frame_add(gspca_dev, FIRST_PACKET, |
1027 | frame, data, len); | 1051 | frame, data, len); |
1028 | return; | 1052 | return; |
1029 | } | 1053 | } |
1030 | } | 1054 | } |
1031 | } | 1055 | } |
1056 | |||
1057 | if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) { | ||
1058 | /* In raw mode we sometimes get some garbage after the frame | ||
1059 | ignore this */ | ||
1060 | int used = frame->data_end - frame->data; | ||
1061 | int size = cam->cam_mode[gspca_dev->curr_mode].sizeimage; | ||
1062 | |||
1063 | if (used + len > size) | ||
1064 | len = size - used; | ||
1065 | } | ||
1066 | |||
1032 | gspca_frame_add(gspca_dev, INTER_PACKET, | 1067 | gspca_frame_add(gspca_dev, INTER_PACKET, |
1033 | frame, data, len); | 1068 | frame, data, len); |
1034 | } | 1069 | } |
@@ -1162,58 +1197,45 @@ static const struct sd_desc sd_desc = { | |||
1162 | .ctrls = sd_ctrls, | 1197 | .ctrls = sd_ctrls, |
1163 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1198 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1164 | .config = sd_config, | 1199 | .config = sd_config, |
1165 | .open = sd_open, | 1200 | .init = sd_init, |
1166 | .start = sd_start, | 1201 | .start = sd_start, |
1167 | .stopN = sd_stopN, | 1202 | .stopN = sd_stopN, |
1168 | .stop0 = sd_stop0, | ||
1169 | .close = sd_close, | ||
1170 | .pkt_scan = sd_pkt_scan, | 1203 | .pkt_scan = sd_pkt_scan, |
1171 | .querymenu = sd_querymenu, | 1204 | .querymenu = sd_querymenu, |
1205 | .dq_callback = do_autogain, | ||
1172 | }; | 1206 | }; |
1173 | 1207 | ||
1174 | /* -- module initialisation -- */ | 1208 | /* -- module initialisation -- */ |
1175 | #define SFCI(sensor, flags, nctrls, i2c_addr) \ | 1209 | #define SB(sensor, bridge) \ |
1176 | .driver_info = (SENSOR_ ## sensor << 24) \ | 1210 | .driver_info = (SENSOR_ ## sensor << 8) | BRIDGE_ ## bridge |
1177 | | ((flags) << 16) \ | 1211 | |
1178 | | ((nctrls) << 8) \ | 1212 | |
1179 | | (i2c_addr) | ||
1180 | static __devinitdata struct usb_device_id device_table[] = { | 1213 | static __devinitdata struct usb_device_id device_table[] = { |
1181 | #ifndef CONFIG_USB_SN9C102 | 1214 | {USB_DEVICE(0x0c45, 0x6001), SB(TAS5110, 102)}, /* TAS5110C1B */ |
1182 | {USB_DEVICE(0x0c45, 0x6001), /* SN9C102 */ | 1215 | {USB_DEVICE(0x0c45, 0x6005), SB(TAS5110, 101)}, /* TAS5110C1B */ |
1183 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, | 1216 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE |
1184 | {USB_DEVICE(0x0c45, 0x6005), /* SN9C101 */ | 1217 | {USB_DEVICE(0x0c45, 0x6007), SB(TAS5110, 101)}, /* TAS5110D */ |
1185 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, | 1218 | {USB_DEVICE(0x0c45, 0x6009), SB(PAS106, 101)}, |
1186 | {USB_DEVICE(0x0c45, 0x6007), /* SN9C101 */ | 1219 | {USB_DEVICE(0x0c45, 0x600d), SB(PAS106, 101)}, |
1187 | SFCI(TAS5110, F_GAIN|F_AUTO|F_SIF, 4, 0)}, | ||
1188 | {USB_DEVICE(0x0c45, 0x6009), /* SN9C101 */ | ||
1189 | SFCI(PAS106, F_SIF, 2, 0)}, | ||
1190 | {USB_DEVICE(0x0c45, 0x600d), /* SN9C101 */ | ||
1191 | SFCI(PAS106, F_SIF, 2, 0)}, | ||
1192 | #endif | 1220 | #endif |
1193 | {USB_DEVICE(0x0c45, 0x6011), /* SN9C101 - SN9C101G */ | 1221 | {USB_DEVICE(0x0c45, 0x6011), SB(OV6650, 101)}, |
1194 | SFCI(OV6650, F_GAIN|F_AUTO|F_SIF, 5, 0x60)}, | 1222 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE |
1195 | #ifndef CONFIG_USB_SN9C102 | 1223 | {USB_DEVICE(0x0c45, 0x6019), SB(OV7630, 101)}, |
1196 | {USB_DEVICE(0x0c45, 0x6019), /* SN9C101 */ | 1224 | {USB_DEVICE(0x0c45, 0x6024), SB(TAS5130CXX, 102)}, |
1197 | SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, | 1225 | {USB_DEVICE(0x0c45, 0x6025), SB(TAS5130CXX, 102)}, |
1198 | {USB_DEVICE(0x0c45, 0x6024), /* SN9C102 */ | 1226 | {USB_DEVICE(0x0c45, 0x6028), SB(PAS202, 102)}, |
1199 | SFCI(TAS5130CXX, 0, 2, 0)}, | 1227 | {USB_DEVICE(0x0c45, 0x6029), SB(PAS106, 102)}, |
1200 | {USB_DEVICE(0x0c45, 0x6025), /* SN9C102 */ | 1228 | {USB_DEVICE(0x0c45, 0x602c), SB(OV7630, 102)}, |
1201 | SFCI(TAS5130CXX, 0, 2, 0)}, | ||
1202 | {USB_DEVICE(0x0c45, 0x6028), /* SN9C102 */ | ||
1203 | SFCI(PAS202, 0, 2, 0)}, | ||
1204 | {USB_DEVICE(0x0c45, 0x6029), /* SN9C101 */ | ||
1205 | SFCI(PAS106, F_SIF, 2, 0)}, | ||
1206 | {USB_DEVICE(0x0c45, 0x602c), /* SN9C102 */ | ||
1207 | SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, | ||
1208 | {USB_DEVICE(0x0c45, 0x602d), /* SN9C102 */ | ||
1209 | SFCI(HV7131R, 0, 2, 0)}, | ||
1210 | {USB_DEVICE(0x0c45, 0x602e), /* SN9C102 */ | ||
1211 | SFCI(OV7630, F_GAIN|F_AUTO, 5, 0x21)}, | ||
1212 | {USB_DEVICE(0x0c45, 0x60af), /* SN9C103 */ | ||
1213 | SFCI(PAS202, F_H18, 2, 0)}, | ||
1214 | {USB_DEVICE(0x0c45, 0x60b0), /* SN9C103 */ | ||
1215 | SFCI(OV7630, F_GAIN|F_AUTO|F_H18, 5, 0x21)}, | ||
1216 | #endif | 1229 | #endif |
1230 | {USB_DEVICE(0x0c45, 0x602d), SB(HV7131R, 102)}, | ||
1231 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE | ||
1232 | {USB_DEVICE(0x0c45, 0x602e), SB(OV7630, 102)}, | ||
1233 | #endif | ||
1234 | {USB_DEVICE(0x0c45, 0x608f), SB(OV7630, 103)}, | ||
1235 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE | ||
1236 | {USB_DEVICE(0x0c45, 0x60af), SB(PAS202, 103)}, | ||
1237 | #endif | ||
1238 | {USB_DEVICE(0x0c45, 0x60b0), SB(OV7630, 103)}, | ||
1217 | {} | 1239 | {} |
1218 | }; | 1240 | }; |
1219 | MODULE_DEVICE_TABLE(usb, device_table); | 1241 | MODULE_DEVICE_TABLE(usb, device_table); |
@@ -1231,6 +1253,10 @@ static struct usb_driver sd_driver = { | |||
1231 | .id_table = device_table, | 1253 | .id_table = device_table, |
1232 | .probe = sd_probe, | 1254 | .probe = sd_probe, |
1233 | .disconnect = gspca_disconnect, | 1255 | .disconnect = gspca_disconnect, |
1256 | #ifdef CONFIG_PM | ||
1257 | .suspend = gspca_suspend, | ||
1258 | .resume = gspca_resume, | ||
1259 | #endif | ||
1234 | }; | 1260 | }; |
1235 | 1261 | ||
1236 | /* -- module insert / remove -- */ | 1262 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 245a30ec5fb1..d75b1d20b318 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -54,8 +54,10 @@ struct sd { | |||
54 | #define SENSOR_HV7131R 0 | 54 | #define SENSOR_HV7131R 0 |
55 | #define SENSOR_MI0360 1 | 55 | #define SENSOR_MI0360 1 |
56 | #define SENSOR_MO4000 2 | 56 | #define SENSOR_MO4000 2 |
57 | #define SENSOR_OV7648 3 | 57 | #define SENSOR_OM6802 3 |
58 | #define SENSOR_OV7660 4 | 58 | #define SENSOR_OV7630 4 |
59 | #define SENSOR_OV7648 5 | ||
60 | #define SENSOR_OV7660 6 | ||
59 | unsigned char i2c_base; | 61 | unsigned char i2c_base; |
60 | }; | 62 | }; |
61 | 63 | ||
@@ -76,7 +78,8 @@ static struct ctrl sd_ctrls[] = { | |||
76 | .type = V4L2_CTRL_TYPE_INTEGER, | 78 | .type = V4L2_CTRL_TYPE_INTEGER, |
77 | .name = "Brightness", | 79 | .name = "Brightness", |
78 | .minimum = 0, | 80 | .minimum = 0, |
79 | .maximum = 0xffff, | 81 | #define BRIGHTNESS_MAX 0xffff |
82 | .maximum = BRIGHTNESS_MAX, | ||
80 | .step = 1, | 83 | .step = 1, |
81 | #define BRIGHTNESS_DEF 0x7fff | 84 | #define BRIGHTNESS_DEF 0x7fff |
82 | .default_value = BRIGHTNESS_DEF, | 85 | .default_value = BRIGHTNESS_DEF, |
@@ -90,7 +93,8 @@ static struct ctrl sd_ctrls[] = { | |||
90 | .type = V4L2_CTRL_TYPE_INTEGER, | 93 | .type = V4L2_CTRL_TYPE_INTEGER, |
91 | .name = "Contrast", | 94 | .name = "Contrast", |
92 | .minimum = 0, | 95 | .minimum = 0, |
93 | .maximum = 127, | 96 | #define CONTRAST_MAX 127 |
97 | .maximum = CONTRAST_MAX, | ||
94 | .step = 1, | 98 | .step = 1, |
95 | #define CONTRAST_DEF 63 | 99 | #define CONTRAST_DEF 63 |
96 | .default_value = CONTRAST_DEF, | 100 | .default_value = CONTRAST_DEF, |
@@ -104,14 +108,15 @@ static struct ctrl sd_ctrls[] = { | |||
104 | .type = V4L2_CTRL_TYPE_INTEGER, | 108 | .type = V4L2_CTRL_TYPE_INTEGER, |
105 | .name = "Color", | 109 | .name = "Color", |
106 | .minimum = 0, | 110 | .minimum = 0, |
107 | .maximum = 255, | 111 | .maximum = 64, |
108 | .step = 1, | 112 | .step = 1, |
109 | #define COLOR_DEF 127 | 113 | #define COLOR_DEF 32 |
110 | .default_value = COLOR_DEF, | 114 | .default_value = COLOR_DEF, |
111 | }, | 115 | }, |
112 | .set = sd_setcolors, | 116 | .set = sd_setcolors, |
113 | .get = sd_getcolors, | 117 | .get = sd_getcolors, |
114 | }, | 118 | }, |
119 | #define AUTOGAIN_IDX 3 | ||
115 | { | 120 | { |
116 | { | 121 | { |
117 | .id = V4L2_CID_AUTOGAIN, | 122 | .id = V4L2_CID_AUTOGAIN, |
@@ -131,7 +136,7 @@ static struct ctrl sd_ctrls[] = { | |||
131 | static struct v4l2_pix_format vga_mode[] = { | 136 | static struct v4l2_pix_format vga_mode[] = { |
132 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 137 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
133 | .bytesperline = 160, | 138 | .bytesperline = 160, |
134 | .sizeimage = 160 * 120 * 3 / 8 + 590, | 139 | .sizeimage = 160 * 120 * 4 / 8 + 590, |
135 | .colorspace = V4L2_COLORSPACE_JPEG, | 140 | .colorspace = V4L2_COLORSPACE_JPEG, |
136 | .priv = 2}, | 141 | .priv = 2}, |
137 | {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 142 | {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
@@ -180,6 +185,31 @@ static const __u8 sn_mo4000[] = { | |||
180 | 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | 185 | 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 |
181 | }; | 186 | }; |
182 | 187 | ||
188 | static const __u8 sn_om6802[] = { | ||
189 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ | ||
190 | 0x00, 0x23, 0x72, 0x00, 0x1a, 0x34, 0x27, 0x20, | ||
191 | /* reg8 reg9 rega regb regc regd rege regf */ | ||
192 | 0x80, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
193 | /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */ | ||
194 | 0x03, 0x00, 0x51, 0x01, 0x00, 0x28, 0x1e, 0x40, | ||
195 | /* reg18 reg19 reg1a reg1b reg1c reg1d reg1e reg1f */ | ||
196 | 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
197 | 0x08, 0x22, 0x44, 0x63, 0x7d, 0x92, 0xa3, 0xaf, | ||
198 | 0xbc, 0xc4, 0xcd, 0xd5, 0xdc, 0xe1, 0xe8, 0xef, | ||
199 | 0xf7 | ||
200 | }; | ||
201 | |||
202 | static const __u8 sn_ov7630[] = { | ||
203 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ | ||
204 | 0x00, 0x21, 0x40, 0x00, 0x1a, 0x20, 0x1f, 0x20, | ||
205 | /* reg8 reg9 rega regb regc regd rege regf */ | ||
206 | 0xa1, 0x21, 0x76, 0x21, 0x00, 0x00, 0x00, 0x10, | ||
207 | /* reg10 reg11 reg12 reg13 reg14 reg15 reg16 reg17 */ | ||
208 | 0x03, 0x00, 0x04, 0x01, 0x0a, 0x28, 0x1e, 0xc2, | ||
209 | /* reg18 reg19 reg1a reg1b reg1c reg1d reg1e reg1f */ | ||
210 | 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00 | ||
211 | }; | ||
212 | |||
183 | static const __u8 sn_ov7648[] = { | 213 | static const __u8 sn_ov7648[] = { |
184 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ | 214 | /* reg0 reg1 reg2 reg3 reg4 reg5 reg6 reg7 */ |
185 | 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20, | 215 | 0x00, 0x21, 0x62, 0x00, 0x1a, 0x20, 0x20, 0x20, |
@@ -207,31 +237,22 @@ static const __u8 *sn_tb[] = { | |||
207 | sn_hv7131, | 237 | sn_hv7131, |
208 | sn_mi0360, | 238 | sn_mi0360, |
209 | sn_mo4000, | 239 | sn_mo4000, |
240 | sn_om6802, | ||
241 | sn_ov7630, | ||
210 | sn_ov7648, | 242 | sn_ov7648, |
211 | sn_ov7660 | 243 | sn_ov7660 |
212 | }; | 244 | }; |
213 | 245 | ||
214 | static const __u8 regsn20[] = { | 246 | static const __u8 gamma_def[] = { |
215 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, | 247 | 0x00, 0x2d, 0x46, 0x5a, 0x6c, 0x7c, 0x8b, 0x99, |
216 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff | 248 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff |
217 | }; | 249 | }; |
218 | static const __u8 regsn20_sn9c325[] = { | ||
219 | 0x0a, 0x3a, 0x56, 0x6c, 0x7e, 0x8d, 0x9a, 0xa4, | ||
220 | 0xaf, 0xbb, 0xc5, 0xcd, 0xd5, 0xde, 0xe8, 0xed, 0xf5 | ||
221 | }; | ||
222 | 250 | ||
223 | static const __u8 reg84[] = { | 251 | static const __u8 reg84[] = { |
224 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe5, 0x0f, | 252 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe5, 0x0f, |
225 | 0xe4, 0x0f, 0x38, 0x00, 0x3e, 0x00, 0xc3, 0x0f, | 253 | 0xe4, 0x0f, 0x38, 0x00, 0x3e, 0x00, 0xc3, 0x0f, |
226 | /* 0x00, 0x00, 0x00, 0x00, 0x00 */ | 254 | 0xf7, 0x0f, 0x00, 0x00, 0x00 |
227 | 0xf7, 0x0f, 0x0a, 0x00, 0x00 | ||
228 | }; | ||
229 | static const __u8 reg84_sn9c325[] = { | ||
230 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe4, 0x0f, | ||
231 | 0xd3, 0x0f, 0x4b, 0x00, 0x48, 0x00, 0xc0, 0x0f, | ||
232 | 0xf8, 0x0f, 0x00, 0x00, 0x00 | ||
233 | }; | 255 | }; |
234 | |||
235 | static const __u8 hv7131r_sensor_init[][8] = { | 256 | static const __u8 hv7131r_sensor_init[][8] = { |
236 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, | 257 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, |
237 | {0xB1, 0x11, 0x34, 0x17, 0x7F, 0x00, 0x00, 0x10}, | 258 | {0xB1, 0x11, 0x34, 0x17, 0x7F, 0x00, 0x00, 0x10}, |
@@ -340,6 +361,92 @@ static const __u8 mo4000_sensor_init[][8] = { | |||
340 | {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10}, | 361 | {0xa1, 0x21, 0x11, 0x38, 0x00, 0x00, 0x00, 0x10}, |
341 | {} | 362 | {} |
342 | }; | 363 | }; |
364 | static __u8 om6802_sensor_init[][8] = { | ||
365 | {0xa0, 0x34, 0x90, 0x05, 0x00, 0x00, 0x00, 0x10}, | ||
366 | {0xa0, 0x34, 0x49, 0x85, 0x00, 0x00, 0x00, 0x10}, | ||
367 | {0xa0, 0x34, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10}, | ||
368 | {0xa0, 0x34, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10}, | ||
369 | /* {0xa0, 0x34, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10}, */ | ||
370 | {0xa0, 0x34, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x10}, | ||
371 | /* white balance & auto-exposure */ | ||
372 | /* {0xa0, 0x34, 0xf1, 0x02, 0x00, 0x00, 0x00, 0x10}, | ||
373 | * set color mode */ | ||
374 | /* {0xa0, 0x34, 0xfe, 0x5b, 0x00, 0x00, 0x00, 0x10}, | ||
375 | * max AGC value in AE */ | ||
376 | /* {0xa0, 0x34, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
377 | * preset AGC */ | ||
378 | /* {0xa0, 0x34, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
379 | * preset brightness */ | ||
380 | /* {0xa0, 0x34, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
381 | * preset contrast */ | ||
382 | /* {0xa0, 0x34, 0xe8, 0x31, 0x00, 0x00, 0x00, 0x10}, | ||
383 | * preset gamma */ | ||
384 | {0xa0, 0x34, 0xe9, 0x0f, 0x00, 0x00, 0x00, 0x10}, | ||
385 | /* luminance mode (0x4f = AE) */ | ||
386 | {0xa0, 0x34, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x10}, | ||
387 | /* preset shutter */ | ||
388 | /* {0xa0, 0x34, 0xef, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
389 | * auto frame rate */ | ||
390 | /* {0xa0, 0x34, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10}, */ | ||
391 | |||
392 | /* {0xa0, 0x34, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10}, */ | ||
393 | /* {0xa0, 0x34, 0x72, 0x05, 0x00, 0x00, 0x00, 0x10}, */ | ||
394 | /* {0xa0, 0x34, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10}, */ | ||
395 | /* {0xa0, 0x34, 0x69, 0x01, 0x00, 0x00, 0x00, 0x10}, */ | ||
396 | {} | ||
397 | }; | ||
398 | static const __u8 ov7630_sensor_init[][8] = { | ||
399 | {0xa1, 0x21, 0x76, 0x01, 0x00, 0x00, 0x00, 0x10}, | ||
400 | {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10}, | ||
401 | /* win: delay 20ms */ | ||
402 | {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10}, | ||
403 | {0xa1, 0x21, 0x12, 0xc8, 0x00, 0x00, 0x00, 0x10}, | ||
404 | /* win: delay 20ms */ | ||
405 | {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10}, | ||
406 | /* win: i2c_r from 00 to 80 */ | ||
407 | {0xd1, 0x21, 0x03, 0x80, 0x10, 0x20, 0x80, 0x10}, | ||
408 | {0xb1, 0x21, 0x0c, 0x20, 0x20, 0x00, 0x00, 0x10}, | ||
409 | {0xd1, 0x21, 0x11, 0x00, 0x48, 0xc0, 0x00, 0x10}, | ||
410 | {0xb1, 0x21, 0x15, 0x80, 0x03, 0x00, 0x00, 0x10}, | ||
411 | {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10}, | ||
412 | {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10}, | ||
413 | {0xd1, 0x21, 0x1f, 0x00, 0x80, 0x80, 0x80, 0x10}, | ||
414 | {0xd1, 0x21, 0x23, 0xde, 0x10, 0x8a, 0xa0, 0x10}, | ||
415 | {0xc1, 0x21, 0x27, 0xca, 0xa2, 0x74, 0x00, 0x10}, | ||
416 | {0xd1, 0x21, 0x2a, 0x88, 0x00, 0x88, 0x01, 0x10}, | ||
417 | {0xc1, 0x21, 0x2e, 0x80, 0x00, 0x18, 0x00, 0x10}, | ||
418 | {0xa1, 0x21, 0x21, 0x08, 0x00, 0x00, 0x00, 0x10}, | ||
419 | {0xa1, 0x21, 0x22, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
420 | {0xa1, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
421 | {0xb1, 0x21, 0x32, 0xc2, 0x08, 0x00, 0x00, 0x10}, | ||
422 | {0xb1, 0x21, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
423 | {0xd1, 0x21, 0x60, 0x05, 0x40, 0x12, 0x57, 0x10}, | ||
424 | {0xa1, 0x21, 0x64, 0x73, 0x00, 0x00, 0x00, 0x10}, | ||
425 | {0xd1, 0x21, 0x65, 0x00, 0x55, 0x01, 0xac, 0x10}, | ||
426 | {0xa1, 0x21, 0x69, 0x38, 0x00, 0x00, 0x00, 0x10}, | ||
427 | {0xd1, 0x21, 0x6f, 0x1f, 0x01, 0x00, 0x10, 0x10}, | ||
428 | {0xd1, 0x21, 0x73, 0x50, 0x20, 0x02, 0x01, 0x10}, | ||
429 | {0xd1, 0x21, 0x77, 0xf3, 0x90, 0x98, 0x98, 0x10}, | ||
430 | {0xc1, 0x21, 0x7b, 0x00, 0x4c, 0xf7, 0x00, 0x10}, | ||
431 | {0xd1, 0x21, 0x17, 0x1b, 0xbd, 0x05, 0xf6, 0x10}, | ||
432 | {0xa1, 0x21, 0x1b, 0x04, 0x00, 0x00, 0x00, 0x10}, | ||
433 | /* */ | ||
434 | {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10}, | ||
435 | {0xa1, 0x21, 0x12, 0x48, 0x00, 0x00, 0x00, 0x10}, | ||
436 | /*fixme: + 0x12, 0x04*/ | ||
437 | {0xa1, 0x21, 0x75, 0x82, 0x00, 0x00, 0x00, 0x10}, | ||
438 | {0xa1, 0x21, 0x10, 0x32, 0x00, 0x00, 0x00, 0x10}, | ||
439 | {0xa1, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
440 | {0xb1, 0x21, 0x01, 0x80, 0x80, 0x00, 0x00, 0x10}, | ||
441 | /* */ | ||
442 | {0xa1, 0x21, 0x11, 0x00, 0x00, 0x00, 0x00, 0x10}, | ||
443 | {0xa1, 0x21, 0x2a, 0x88, 0x00, 0x00, 0x00, 0x10}, | ||
444 | {0xa1, 0x21, 0x2b, 0x34, 0x00, 0x00, 0x00, 0x10}, | ||
445 | /* */ | ||
446 | {0xa1, 0x21, 0x10, 0x83, 0x00, 0x00, 0x00, 0x10}, | ||
447 | /* {0xb1, 0x21, 0x01, 0x88, 0x70, 0x00, 0x00, 0x10}, */ | ||
448 | {} | ||
449 | }; | ||
343 | static const __u8 ov7660_sensor_init[][8] = { | 450 | static const __u8 ov7660_sensor_init[][8] = { |
344 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ | 451 | {0xa1, 0x21, 0x12, 0x80, 0x00, 0x00, 0x00, 0x10}, /* reset SCCB */ |
345 | /* (delay 20ms) */ | 452 | /* (delay 20ms) */ |
@@ -506,10 +613,16 @@ static const __u8 qtable4[] = { | |||
506 | 0x29, 0x29, 0x29, 0x29 | 613 | 0x29, 0x29, 0x29, 0x29 |
507 | }; | 614 | }; |
508 | 615 | ||
509 | /* read <len> bytes (len < sizeof gspca_dev->usb_buf) to gspca_dev->usb_buf */ | 616 | /* read <len> bytes to gspca_dev->usb_buf */ |
510 | static void reg_r(struct gspca_dev *gspca_dev, | 617 | static void reg_r(struct gspca_dev *gspca_dev, |
511 | __u16 value, int len) | 618 | __u16 value, int len) |
512 | { | 619 | { |
620 | #ifdef GSPCA_DEBUG | ||
621 | if (len > USB_BUF_SZ) { | ||
622 | err("reg_r: buffer overflow"); | ||
623 | return; | ||
624 | } | ||
625 | #endif | ||
513 | usb_control_msg(gspca_dev->dev, | 626 | usb_control_msg(gspca_dev->dev, |
514 | usb_rcvctrlpipe(gspca_dev->dev, 0), | 627 | usb_rcvctrlpipe(gspca_dev->dev, 0), |
515 | 0, | 628 | 0, |
@@ -542,29 +655,20 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
542 | { | 655 | { |
543 | PDEBUG(D_USBO, "reg_w [%02x] = %02x %02x ..", | 656 | PDEBUG(D_USBO, "reg_w [%02x] = %02x %02x ..", |
544 | value, buffer[0], buffer[1]); | 657 | value, buffer[0], buffer[1]); |
545 | if (len <= sizeof gspca_dev->usb_buf) { | 658 | #ifdef GSPCA_DEBUG |
546 | memcpy(gspca_dev->usb_buf, buffer, len); | 659 | if (len > USB_BUF_SZ) { |
547 | usb_control_msg(gspca_dev->dev, | 660 | err("reg_w: buffer overflow"); |
548 | usb_sndctrlpipe(gspca_dev->dev, 0), | 661 | return; |
549 | 0x08, | ||
550 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
551 | value, 0, | ||
552 | gspca_dev->usb_buf, len, | ||
553 | 500); | ||
554 | } else { | ||
555 | __u8 *tmpbuf; | ||
556 | |||
557 | tmpbuf = kmalloc(len, GFP_KERNEL); | ||
558 | memcpy(tmpbuf, buffer, len); | ||
559 | usb_control_msg(gspca_dev->dev, | ||
560 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
561 | 0x08, | ||
562 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
563 | value, 0, | ||
564 | tmpbuf, len, | ||
565 | 500); | ||
566 | kfree(tmpbuf); | ||
567 | } | 662 | } |
663 | #endif | ||
664 | memcpy(gspca_dev->usb_buf, buffer, len); | ||
665 | usb_control_msg(gspca_dev->dev, | ||
666 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
667 | 0x08, | ||
668 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, | ||
669 | value, 0, | ||
670 | gspca_dev->usb_buf, len, | ||
671 | 500); | ||
568 | } | 672 | } |
569 | 673 | ||
570 | /* I2C write 1 byte */ | 674 | /* I2C write 1 byte */ |
@@ -665,7 +769,7 @@ static int configure_gpio(struct gspca_dev *gspca_dev, | |||
665 | static const __u8 regd4[] = {0x60, 0x00, 0x00}; | 769 | static const __u8 regd4[] = {0x60, 0x00, 0x00}; |
666 | 770 | ||
667 | reg_w1(gspca_dev, 0xf1, 0x00); | 771 | reg_w1(gspca_dev, 0xf1, 0x00); |
668 | reg_w1(gspca_dev, 0x01, 0x00); /*jfm was sn9c1xx[1] in v1*/ | 772 | reg_w1(gspca_dev, 0x01, sn9c1xx[1]); |
669 | 773 | ||
670 | /* configure gpio */ | 774 | /* configure gpio */ |
671 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); | 775 | reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2); |
@@ -685,21 +789,41 @@ static int configure_gpio(struct gspca_dev *gspca_dev, | |||
685 | 789 | ||
686 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); | 790 | reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f); |
687 | 791 | ||
688 | switch (sd->bridge) { | 792 | switch (sd->sensor) { |
689 | case BRIDGE_SN9C325: | 793 | case SENSOR_OM6802: |
794 | reg_w1(gspca_dev, 0x02, 0x71); | ||
795 | reg_w1(gspca_dev, 0x01, 0x42); | ||
796 | reg_w1(gspca_dev, 0x17, 0x64); | ||
797 | reg_w1(gspca_dev, 0x01, 0x42); | ||
798 | break; | ||
799 | /*jfm: from win trace */ | ||
800 | case SENSOR_OV7630: | ||
801 | reg_w1(gspca_dev, 0x01, 0x61); | ||
802 | reg_w1(gspca_dev, 0x17, 0xe2); | ||
803 | reg_w1(gspca_dev, 0x01, 0x60); | ||
804 | reg_w1(gspca_dev, 0x01, 0x40); | ||
805 | break; | ||
806 | case SENSOR_OV7648: | ||
690 | reg_w1(gspca_dev, 0x01, 0x43); | 807 | reg_w1(gspca_dev, 0x01, 0x43); |
691 | reg_w1(gspca_dev, 0x17, 0xae); | 808 | reg_w1(gspca_dev, 0x17, 0xae); |
692 | reg_w1(gspca_dev, 0x01, 0x42); | 809 | reg_w1(gspca_dev, 0x01, 0x42); |
693 | break; | 810 | break; |
811 | /*jfm: from win trace */ | ||
812 | case SENSOR_OV7660: | ||
813 | reg_w1(gspca_dev, 0x01, 0x61); | ||
814 | reg_w1(gspca_dev, 0x17, 0x20); | ||
815 | reg_w1(gspca_dev, 0x01, 0x60); | ||
816 | reg_w1(gspca_dev, 0x01, 0x40); | ||
817 | break; | ||
694 | default: | 818 | default: |
695 | reg_w1(gspca_dev, 0x01, 0x43); | 819 | reg_w1(gspca_dev, 0x01, 0x43); |
696 | reg_w1(gspca_dev, 0x17, 0x61); | 820 | reg_w1(gspca_dev, 0x17, 0x61); |
697 | reg_w1(gspca_dev, 0x01, 0x42); | 821 | reg_w1(gspca_dev, 0x01, 0x42); |
698 | } | 822 | if (sd->sensor == SENSOR_HV7131R) { |
699 | 823 | if (probesensor(gspca_dev) < 0) | |
700 | if (sd->sensor == SENSOR_HV7131R) { | 824 | return -ENODEV; |
701 | if (probesensor(gspca_dev) < 0) | 825 | } |
702 | return -ENODEV; | 826 | break; |
703 | } | 827 | } |
704 | return 0; | 828 | return 0; |
705 | } | 829 | } |
@@ -737,6 +861,40 @@ static void mo4000_InitSensor(struct gspca_dev *gspca_dev) | |||
737 | } | 861 | } |
738 | } | 862 | } |
739 | 863 | ||
864 | static void om6802_InitSensor(struct gspca_dev *gspca_dev) | ||
865 | { | ||
866 | int i = 0; | ||
867 | |||
868 | while (om6802_sensor_init[i][0]) { | ||
869 | i2c_w8(gspca_dev, om6802_sensor_init[i]); | ||
870 | i++; | ||
871 | } | ||
872 | } | ||
873 | |||
874 | static void ov7630_InitSensor(struct gspca_dev *gspca_dev) | ||
875 | { | ||
876 | int i = 0; | ||
877 | |||
878 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); /* 76 01 */ | ||
879 | i++; | ||
880 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); /* 12 c8 (RGB+SRST) */ | ||
881 | i++; | ||
882 | msleep(20); | ||
883 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); /* 12 48 */ | ||
884 | i++; | ||
885 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); /* 12 c8 */ | ||
886 | i++; | ||
887 | msleep(20); | ||
888 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); /* 12 48 */ | ||
889 | i++; | ||
890 | /*jfm:win i2c_r from 00 to 80*/ | ||
891 | |||
892 | while (ov7630_sensor_init[i][0]) { | ||
893 | i2c_w8(gspca_dev, ov7630_sensor_init[i]); | ||
894 | i++; | ||
895 | } | ||
896 | } | ||
897 | |||
740 | static void ov7648_InitSensor(struct gspca_dev *gspca_dev) | 898 | static void ov7648_InitSensor(struct gspca_dev *gspca_dev) |
741 | { | 899 | { |
742 | int i = 0; | 900 | int i = 0; |
@@ -783,11 +941,19 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
783 | sd->autogain = AUTOGAIN_DEF; | 941 | sd->autogain = AUTOGAIN_DEF; |
784 | sd->ag_cnt = -1; | 942 | sd->ag_cnt = -1; |
785 | 943 | ||
944 | switch (sd->sensor) { | ||
945 | case SENSOR_OV7630: | ||
946 | case SENSOR_OV7648: | ||
947 | case SENSOR_OV7660: | ||
948 | gspca_dev->ctrl_dis = (1 << AUTOGAIN_IDX); | ||
949 | break; | ||
950 | } | ||
951 | |||
786 | return 0; | 952 | return 0; |
787 | } | 953 | } |
788 | 954 | ||
789 | /* this function is called at open time */ | 955 | /* this function is called at probe and resume time */ |
790 | static int sd_open(struct gspca_dev *gspca_dev) | 956 | static int sd_init(struct gspca_dev *gspca_dev) |
791 | { | 957 | { |
792 | struct sd *sd = (struct sd *) gspca_dev; | 958 | struct sd *sd = (struct sd *) gspca_dev; |
793 | /* const __u8 *sn9c1xx; */ | 959 | /* const __u8 *sn9c1xx; */ |
@@ -891,16 +1057,53 @@ static unsigned int setexposure(struct gspca_dev *gspca_dev, | |||
891 | | ((expoMo10[3] & 0x30) >> 4)); | 1057 | | ((expoMo10[3] & 0x30) >> 4)); |
892 | break; | 1058 | break; |
893 | } | 1059 | } |
1060 | case SENSOR_OM6802: { | ||
1061 | __u8 gainOm[] = | ||
1062 | { 0xa0, 0x34, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x10 }; | ||
1063 | |||
1064 | if (expo > 0x03ff) | ||
1065 | expo = 0x03ff; | ||
1066 | if (expo < 0x0001) | ||
1067 | expo = 0x0001; | ||
1068 | gainOm[3] = expo >> 2; | ||
1069 | i2c_w8(gspca_dev, gainOm); | ||
1070 | reg_w1(gspca_dev, 0x96, (expo >> 5) & 0x1f); | ||
1071 | PDEBUG(D_CONF, "set exposure %d", gainOm[3]); | ||
1072 | break; | ||
1073 | } | ||
894 | } | 1074 | } |
895 | return expo; | 1075 | return expo; |
896 | } | 1076 | } |
897 | 1077 | ||
1078 | /* this function is used for sensors o76xx only */ | ||
1079 | static void setbrightcont(struct gspca_dev *gspca_dev) | ||
1080 | { | ||
1081 | struct sd *sd = (struct sd *) gspca_dev; | ||
1082 | unsigned val; | ||
1083 | __u8 reg84_full[0x15]; | ||
1084 | |||
1085 | memset(reg84_full, 0, sizeof reg84_full); | ||
1086 | val = sd->contrast * 0x20 / CONTRAST_MAX + 0x10; /* 10..30 */ | ||
1087 | reg84_full[2] = val; | ||
1088 | reg84_full[0] = (val + 1) / 2; | ||
1089 | reg84_full[4] = (val + 1) / 5; | ||
1090 | if (val > BRIGHTNESS_DEF) | ||
1091 | val = (sd->brightness - BRIGHTNESS_DEF) * 0x20 | ||
1092 | / BRIGHTNESS_MAX; | ||
1093 | else | ||
1094 | val = 0; | ||
1095 | reg84_full[0x12] = val; /* 00..1f */ | ||
1096 | reg_w(gspca_dev, 0x84, reg84_full, sizeof reg84_full); | ||
1097 | } | ||
1098 | |||
1099 | /* sensor != ov76xx */ | ||
898 | static void setbrightness(struct gspca_dev *gspca_dev) | 1100 | static void setbrightness(struct gspca_dev *gspca_dev) |
899 | { | 1101 | { |
900 | struct sd *sd = (struct sd *) gspca_dev; | 1102 | struct sd *sd = (struct sd *) gspca_dev; |
901 | unsigned int expo; | 1103 | unsigned int expo; |
902 | __u8 k2; | 1104 | __u8 k2; |
903 | 1105 | ||
1106 | k2 = sd->brightness >> 10; | ||
904 | switch (sd->sensor) { | 1107 | switch (sd->sensor) { |
905 | case SENSOR_HV7131R: | 1108 | case SENSOR_HV7131R: |
906 | expo = sd->brightness << 4; | 1109 | expo = sd->brightness << 4; |
@@ -915,12 +1118,17 @@ static void setbrightness(struct gspca_dev *gspca_dev) | |||
915 | expo = sd->brightness >> 4; | 1118 | expo = sd->brightness >> 4; |
916 | sd->exposure = setexposure(gspca_dev, expo); | 1119 | sd->exposure = setexposure(gspca_dev, expo); |
917 | break; | 1120 | break; |
1121 | case SENSOR_OM6802: | ||
1122 | expo = sd->brightness >> 6; | ||
1123 | sd->exposure = setexposure(gspca_dev, expo); | ||
1124 | k2 = sd->brightness >> 11; | ||
1125 | break; | ||
918 | } | 1126 | } |
919 | 1127 | ||
920 | k2 = sd->brightness >> 10; | ||
921 | reg_w1(gspca_dev, 0x96, k2); | 1128 | reg_w1(gspca_dev, 0x96, k2); |
922 | } | 1129 | } |
923 | 1130 | ||
1131 | /* sensor != ov76xx */ | ||
924 | static void setcontrast(struct gspca_dev *gspca_dev) | 1132 | static void setcontrast(struct gspca_dev *gspca_dev) |
925 | { | 1133 | { |
926 | struct sd *sd = (struct sd *) gspca_dev; | 1134 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -937,31 +1145,30 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
937 | static void setcolors(struct gspca_dev *gspca_dev) | 1145 | static void setcolors(struct gspca_dev *gspca_dev) |
938 | { | 1146 | { |
939 | struct sd *sd = (struct sd *) gspca_dev; | 1147 | struct sd *sd = (struct sd *) gspca_dev; |
940 | __u8 data; | 1148 | __u8 blue, red; |
941 | int colour; | ||
942 | 1149 | ||
943 | colour = sd->colors - 128; | 1150 | if (sd->colors >= 32) { |
944 | if (colour > 0) | 1151 | red = 32 + (sd->colors - 32) / 2; |
945 | data = (colour + 32) & 0x7f; /* blue */ | 1152 | blue = 64 - sd->colors; |
946 | else | 1153 | } else { |
947 | data = (-colour + 32) & 0x7f; /* red */ | 1154 | red = sd->colors; |
948 | reg_w1(gspca_dev, 0x05, data); | 1155 | blue = 32 + (32 - sd->colors) / 2; |
1156 | } | ||
1157 | reg_w1(gspca_dev, 0x05, red); | ||
1158 | /* reg_w1(gspca_dev, 0x07, 32); */ | ||
1159 | reg_w1(gspca_dev, 0x06, blue); | ||
949 | } | 1160 | } |
950 | 1161 | ||
951 | static void setautogain(struct gspca_dev *gspca_dev) | 1162 | static void setautogain(struct gspca_dev *gspca_dev) |
952 | { | 1163 | { |
953 | struct sd *sd = (struct sd *) gspca_dev; | 1164 | struct sd *sd = (struct sd *) gspca_dev; |
954 | 1165 | ||
955 | switch (sd->sensor) { | 1166 | if (gspca_dev->ctrl_dis & (1 << AUTOGAIN_IDX)) |
956 | case SENSOR_HV7131R: | 1167 | return; |
957 | case SENSOR_MO4000: | 1168 | if (sd->autogain) |
958 | case SENSOR_MI0360: | 1169 | sd->ag_cnt = AG_CNT_START; |
959 | if (sd->autogain) | 1170 | else |
960 | sd->ag_cnt = AG_CNT_START; | 1171 | sd->ag_cnt = -1; |
961 | else | ||
962 | sd->ag_cnt = -1; | ||
963 | break; | ||
964 | } | ||
965 | } | 1172 | } |
966 | 1173 | ||
967 | /* -- start the camera -- */ | 1174 | /* -- start the camera -- */ |
@@ -975,13 +1182,12 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
975 | static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; | 1182 | static const __u8 C0[] = { 0x2d, 0x2d, 0x3a, 0x05, 0x04, 0x3f }; |
976 | static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; | 1183 | static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; |
977 | static const __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ | 1184 | static const __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ |
978 | static const __u8 CE_sn9c325[] = | 1185 | static const __u8 CE_ov76xx[] = |
979 | { 0x32, 0xdd, 0x32, 0xdd }; /* OV7648 - SN9C325 */ | 1186 | { 0x32, 0xdd, 0x32, 0xdd }; /* OV7630/48 */ |
980 | 1187 | ||
981 | sn9c1xx = sn_tb[(int) sd->sensor]; | 1188 | sn9c1xx = sn_tb[(int) sd->sensor]; |
982 | configure_gpio(gspca_dev, sn9c1xx); | 1189 | configure_gpio(gspca_dev, sn9c1xx); |
983 | 1190 | ||
984 | /* reg_w1(gspca_dev, 0x01, 0x44); jfm from win trace*/ | ||
985 | reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); | 1191 | reg_w1(gspca_dev, 0x15, sn9c1xx[0x15]); |
986 | reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); | 1192 | reg_w1(gspca_dev, 0x16, sn9c1xx[0x16]); |
987 | reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); | 1193 | reg_w1(gspca_dev, 0x12, sn9c1xx[0x12]); |
@@ -994,10 +1200,17 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
994 | reg_w1(gspca_dev, 0xc8, 0x50); | 1200 | reg_w1(gspca_dev, 0xc8, 0x50); |
995 | reg_w1(gspca_dev, 0xc9, 0x3c); | 1201 | reg_w1(gspca_dev, 0xc9, 0x3c); |
996 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); | 1202 | reg_w1(gspca_dev, 0x18, sn9c1xx[0x18]); |
997 | switch (sd->bridge) { | 1203 | switch (sd->sensor) { |
998 | case BRIDGE_SN9C325: | 1204 | case SENSOR_OV7630: |
1205 | reg17 = 0xe2; | ||
1206 | break; | ||
1207 | case SENSOR_OV7648: | ||
999 | reg17 = 0xae; | 1208 | reg17 = 0xae; |
1000 | break; | 1209 | break; |
1210 | /*jfm: from win trace */ | ||
1211 | case SENSOR_OV7660: | ||
1212 | reg17 = 0xa0; | ||
1213 | break; | ||
1001 | default: | 1214 | default: |
1002 | reg17 = 0x60; | 1215 | reg17 = 0x60; |
1003 | break; | 1216 | break; |
@@ -1007,24 +1220,11 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1007 | reg_w1(gspca_dev, 0x07, sn9c1xx[7]); | 1220 | reg_w1(gspca_dev, 0x07, sn9c1xx[7]); |
1008 | reg_w1(gspca_dev, 0x06, sn9c1xx[6]); | 1221 | reg_w1(gspca_dev, 0x06, sn9c1xx[6]); |
1009 | reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]); | 1222 | reg_w1(gspca_dev, 0x14, sn9c1xx[0x14]); |
1010 | switch (sd->bridge) { | 1223 | reg_w(gspca_dev, 0x20, gamma_def, sizeof gamma_def); |
1011 | case BRIDGE_SN9C325: | 1224 | for (i = 0; i < 8; i++) |
1012 | reg_w(gspca_dev, 0x20, regsn20_sn9c325, | 1225 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); |
1013 | sizeof regsn20_sn9c325); | ||
1014 | for (i = 0; i < 8; i++) | ||
1015 | reg_w(gspca_dev, 0x84, reg84_sn9c325, | ||
1016 | sizeof reg84_sn9c325); | ||
1017 | reg_w1(gspca_dev, 0x9a, 0x0a); | ||
1018 | reg_w1(gspca_dev, 0x99, 0x60); | ||
1019 | break; | ||
1020 | default: | ||
1021 | reg_w(gspca_dev, 0x20, regsn20, sizeof regsn20); | ||
1022 | for (i = 0; i < 8; i++) | ||
1023 | reg_w(gspca_dev, 0x84, reg84, sizeof reg84); | ||
1024 | reg_w1(gspca_dev, 0x9a, 0x08); | 1226 | reg_w1(gspca_dev, 0x9a, 0x08); |
1025 | reg_w1(gspca_dev, 0x99, 0x59); | 1227 | reg_w1(gspca_dev, 0x99, 0x59); |
1026 | break; | ||
1027 | } | ||
1028 | 1228 | ||
1029 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 1229 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; |
1030 | if (mode) | 1230 | if (mode) |
@@ -1049,6 +1249,15 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1049 | /* reg1 = 0x06; * 640 clk 24Mz (done) */ | 1249 | /* reg1 = 0x06; * 640 clk 24Mz (done) */ |
1050 | } | 1250 | } |
1051 | break; | 1251 | break; |
1252 | case SENSOR_OM6802: | ||
1253 | om6802_InitSensor(gspca_dev); | ||
1254 | reg17 = 0x64; /* 640 MCKSIZE */ | ||
1255 | break; | ||
1256 | case SENSOR_OV7630: | ||
1257 | ov7630_InitSensor(gspca_dev); | ||
1258 | reg17 = 0xe2; | ||
1259 | reg1 = 0x44; | ||
1260 | break; | ||
1052 | case SENSOR_OV7648: | 1261 | case SENSOR_OV7648: |
1053 | ov7648_InitSensor(gspca_dev); | 1262 | ov7648_InitSensor(gspca_dev); |
1054 | reg17 = 0xa2; | 1263 | reg17 = 0xa2; |
@@ -1073,9 +1282,10 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1073 | } | 1282 | } |
1074 | reg_w(gspca_dev, 0xc0, C0, 6); | 1283 | reg_w(gspca_dev, 0xc0, C0, 6); |
1075 | reg_w(gspca_dev, 0xca, CA, 4); | 1284 | reg_w(gspca_dev, 0xca, CA, 4); |
1076 | switch (sd->bridge) { | 1285 | switch (sd->sensor) { |
1077 | case BRIDGE_SN9C325: | 1286 | case SENSOR_OV7630: |
1078 | reg_w(gspca_dev, 0xce, CE_sn9c325, 4); | 1287 | case SENSOR_OV7648: |
1288 | reg_w(gspca_dev, 0xce, CE_ov76xx, 4); | ||
1079 | break; | 1289 | break; |
1080 | default: | 1290 | default: |
1081 | reg_w(gspca_dev, 0xce, CE, 4); | 1291 | reg_w(gspca_dev, 0xce, CE, 4); |
@@ -1093,10 +1303,20 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
1093 | reg_w1(gspca_dev, 0x18, reg18); | 1303 | reg_w1(gspca_dev, 0x18, reg18); |
1094 | 1304 | ||
1095 | reg_w1(gspca_dev, 0x17, reg17); | 1305 | reg_w1(gspca_dev, 0x17, reg17); |
1096 | reg_w1(gspca_dev, 0x01, reg1); | 1306 | switch (sd->sensor) { |
1097 | setbrightness(gspca_dev); | 1307 | case SENSOR_HV7131R: |
1098 | setcontrast(gspca_dev); | 1308 | case SENSOR_MI0360: |
1309 | case SENSOR_MO4000: | ||
1310 | case SENSOR_OM6802: | ||
1311 | setbrightness(gspca_dev); | ||
1312 | setcontrast(gspca_dev); | ||
1313 | break; | ||
1314 | default: /* OV76xx */ | ||
1315 | setbrightcont(gspca_dev); | ||
1316 | break; | ||
1317 | } | ||
1099 | setautogain(gspca_dev); | 1318 | setautogain(gspca_dev); |
1319 | reg_w1(gspca_dev, 0x01, reg1); | ||
1100 | } | 1320 | } |
1101 | 1321 | ||
1102 | static void sd_stopN(struct gspca_dev *gspca_dev) | 1322 | static void sd_stopN(struct gspca_dev *gspca_dev) |
@@ -1119,6 +1339,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1119 | i2c_w8(gspca_dev, stopmi0360); | 1339 | i2c_w8(gspca_dev, stopmi0360); |
1120 | data = 0x29; | 1340 | data = 0x29; |
1121 | break; | 1341 | break; |
1342 | case SENSOR_OV7630: | ||
1122 | case SENSOR_OV7648: | 1343 | case SENSOR_OV7648: |
1123 | data = 0x29; | 1344 | data = 0x29; |
1124 | break; | 1345 | break; |
@@ -1132,15 +1353,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1132 | reg_w1(gspca_dev, 0x17, sn9c1xx[0x17]); | 1353 | reg_w1(gspca_dev, 0x17, sn9c1xx[0x17]); |
1133 | reg_w1(gspca_dev, 0x01, sn9c1xx[1]); | 1354 | reg_w1(gspca_dev, 0x01, sn9c1xx[1]); |
1134 | reg_w1(gspca_dev, 0x01, data); | 1355 | reg_w1(gspca_dev, 0x01, data); |
1135 | reg_w1(gspca_dev, 0xf1, 0x01); | 1356 | reg_w1(gspca_dev, 0xf1, 0x00); |
1136 | } | ||
1137 | |||
1138 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1139 | { | ||
1140 | } | ||
1141 | |||
1142 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1143 | { | ||
1144 | } | 1357 | } |
1145 | 1358 | ||
1146 | static void do_autogain(struct gspca_dev *gspca_dev) | 1359 | static void do_autogain(struct gspca_dev *gspca_dev) |
@@ -1174,6 +1387,7 @@ static void do_autogain(struct gspca_dev *gspca_dev) | |||
1174 | default: | 1387 | default: |
1175 | /* case SENSOR_MO4000: */ | 1388 | /* case SENSOR_MO4000: */ |
1176 | /* case SENSOR_MI0360: */ | 1389 | /* case SENSOR_MI0360: */ |
1390 | /* case SENSOR_OM6802: */ | ||
1177 | expotimes = sd->exposure; | 1391 | expotimes = sd->exposure; |
1178 | expotimes += (luma_mean - delta) >> 6; | 1392 | expotimes += (luma_mean - delta) >> 6; |
1179 | if (expotimes < 0) | 1393 | if (expotimes < 0) |
@@ -1229,69 +1443,24 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
1229 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | 1443 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); |
1230 | } | 1444 | } |
1231 | 1445 | ||
1232 | static unsigned int getexposure(struct gspca_dev *gspca_dev) | ||
1233 | { | ||
1234 | struct sd *sd = (struct sd *) gspca_dev; | ||
1235 | __u8 hexpo, mexpo, lexpo; | ||
1236 | |||
1237 | switch (sd->sensor) { | ||
1238 | case SENSOR_HV7131R: | ||
1239 | /* read sensor exposure */ | ||
1240 | i2c_r5(gspca_dev, 0x25); | ||
1241 | return (gspca_dev->usb_buf[0] << 16) | ||
1242 | | (gspca_dev->usb_buf[1] << 8) | ||
1243 | | gspca_dev->usb_buf[2]; | ||
1244 | case SENSOR_MI0360: | ||
1245 | /* read sensor exposure */ | ||
1246 | i2c_r5(gspca_dev, 0x09); | ||
1247 | return (gspca_dev->usb_buf[0] << 8) | ||
1248 | | gspca_dev->usb_buf[1]; | ||
1249 | case SENSOR_MO4000: | ||
1250 | i2c_r5(gspca_dev, 0x0e); | ||
1251 | hexpo = 0; /* gspca_dev->usb_buf[1] & 0x07; */ | ||
1252 | mexpo = 0x40; /* gspca_dev->usb_buf[2] & 0xff; */ | ||
1253 | lexpo = (gspca_dev->usb_buf[1] & 0x30) >> 4; | ||
1254 | PDEBUG(D_CONF, "exposure %d", | ||
1255 | (hexpo << 10) | (mexpo << 2) | lexpo); | ||
1256 | return (hexpo << 10) | (mexpo << 2) | lexpo; | ||
1257 | default: | ||
1258 | /* case SENSOR_OV7648: * jfm: is it ok for 7648? */ | ||
1259 | /* case SENSOR_OV7660: */ | ||
1260 | /* read sensor exposure */ | ||
1261 | i2c_r5(gspca_dev, 0x04); | ||
1262 | hexpo = gspca_dev->usb_buf[3] & 0x2f; | ||
1263 | lexpo = gspca_dev->usb_buf[0] & 0x02; | ||
1264 | i2c_r5(gspca_dev, 0x08); | ||
1265 | mexpo = gspca_dev->usb_buf[2]; | ||
1266 | return (hexpo << 10) | (mexpo << 2) | lexpo; | ||
1267 | } | ||
1268 | } | ||
1269 | |||
1270 | static void getbrightness(struct gspca_dev *gspca_dev) | ||
1271 | { | ||
1272 | struct sd *sd = (struct sd *) gspca_dev; | ||
1273 | |||
1274 | /* hardcoded registers seem not readable */ | ||
1275 | switch (sd->sensor) { | ||
1276 | case SENSOR_HV7131R: | ||
1277 | sd->brightness = getexposure(gspca_dev) >> 4; | ||
1278 | break; | ||
1279 | case SENSOR_MI0360: | ||
1280 | sd->brightness = getexposure(gspca_dev) << 4; | ||
1281 | break; | ||
1282 | case SENSOR_MO4000: | ||
1283 | sd->brightness = getexposure(gspca_dev) << 4; | ||
1284 | break; | ||
1285 | } | ||
1286 | } | ||
1287 | |||
1288 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 1446 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
1289 | { | 1447 | { |
1290 | struct sd *sd = (struct sd *) gspca_dev; | 1448 | struct sd *sd = (struct sd *) gspca_dev; |
1291 | 1449 | ||
1292 | sd->brightness = val; | 1450 | sd->brightness = val; |
1293 | if (gspca_dev->streaming) | 1451 | if (gspca_dev->streaming) { |
1294 | setbrightness(gspca_dev); | 1452 | switch (sd->sensor) { |
1453 | case SENSOR_HV7131R: | ||
1454 | case SENSOR_MI0360: | ||
1455 | case SENSOR_MO4000: | ||
1456 | case SENSOR_OM6802: | ||
1457 | setbrightness(gspca_dev); | ||
1458 | break; | ||
1459 | default: /* OV76xx */ | ||
1460 | setbrightcont(gspca_dev); | ||
1461 | break; | ||
1462 | } | ||
1463 | } | ||
1295 | return 0; | 1464 | return 0; |
1296 | } | 1465 | } |
1297 | 1466 | ||
@@ -1299,7 +1468,6 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | |||
1299 | { | 1468 | { |
1300 | struct sd *sd = (struct sd *) gspca_dev; | 1469 | struct sd *sd = (struct sd *) gspca_dev; |
1301 | 1470 | ||
1302 | getbrightness(gspca_dev); | ||
1303 | *val = sd->brightness; | 1471 | *val = sd->brightness; |
1304 | return 0; | 1472 | return 0; |
1305 | } | 1473 | } |
@@ -1309,8 +1477,19 @@ static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) | |||
1309 | struct sd *sd = (struct sd *) gspca_dev; | 1477 | struct sd *sd = (struct sd *) gspca_dev; |
1310 | 1478 | ||
1311 | sd->contrast = val; | 1479 | sd->contrast = val; |
1312 | if (gspca_dev->streaming) | 1480 | if (gspca_dev->streaming) { |
1313 | setcontrast(gspca_dev); | 1481 | switch (sd->sensor) { |
1482 | case SENSOR_HV7131R: | ||
1483 | case SENSOR_MI0360: | ||
1484 | case SENSOR_MO4000: | ||
1485 | case SENSOR_OM6802: | ||
1486 | setcontrast(gspca_dev); | ||
1487 | break; | ||
1488 | default: /* OV76xx */ | ||
1489 | setbrightcont(gspca_dev); | ||
1490 | break; | ||
1491 | } | ||
1492 | } | ||
1314 | return 0; | 1493 | return 0; |
1315 | } | 1494 | } |
1316 | 1495 | ||
@@ -1364,11 +1543,9 @@ static const struct sd_desc sd_desc = { | |||
1364 | .ctrls = sd_ctrls, | 1543 | .ctrls = sd_ctrls, |
1365 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1544 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1366 | .config = sd_config, | 1545 | .config = sd_config, |
1367 | .open = sd_open, | 1546 | .init = sd_init, |
1368 | .start = sd_start, | 1547 | .start = sd_start, |
1369 | .stopN = sd_stopN, | 1548 | .stopN = sd_stopN, |
1370 | .stop0 = sd_stop0, | ||
1371 | .close = sd_close, | ||
1372 | .pkt_scan = sd_pkt_scan, | 1549 | .pkt_scan = sd_pkt_scan, |
1373 | .dq_callback = do_autogain, | 1550 | .dq_callback = do_autogain, |
1374 | }; | 1551 | }; |
@@ -1379,7 +1556,7 @@ static const struct sd_desc sd_desc = { | |||
1379 | | (SENSOR_ ## sensor << 8) \ | 1556 | | (SENSOR_ ## sensor << 8) \ |
1380 | | (i2c_addr) | 1557 | | (i2c_addr) |
1381 | static const __devinitdata struct usb_device_id device_table[] = { | 1558 | static const __devinitdata struct usb_device_id device_table[] = { |
1382 | #ifndef CONFIG_USB_SN9C102 | 1559 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE |
1383 | {USB_DEVICE(0x0458, 0x7025), BSI(SN9C120, MI0360, 0x5d)}, | 1560 | {USB_DEVICE(0x0458, 0x7025), BSI(SN9C120, MI0360, 0x5d)}, |
1384 | {USB_DEVICE(0x045e, 0x00f5), BSI(SN9C105, OV7660, 0x21)}, | 1561 | {USB_DEVICE(0x045e, 0x00f5), BSI(SN9C105, OV7660, 0x21)}, |
1385 | {USB_DEVICE(0x045e, 0x00f7), BSI(SN9C105, OV7660, 0x21)}, | 1562 | {USB_DEVICE(0x045e, 0x00f7), BSI(SN9C105, OV7660, 0x21)}, |
@@ -1406,15 +1583,17 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
1406 | /* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6801, 0x??)}, */ | 1583 | /* {USB_DEVICE(0x0c45, 0x6108), BSI(SN9C120, OM6801, 0x??)}, */ |
1407 | /* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */ | 1584 | /* {USB_DEVICE(0x0c45, 0x6122), BSI(SN9C110, ICM105C, 0x??)}, */ |
1408 | /* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */ | 1585 | /* {USB_DEVICE(0x0c45, 0x6123), BSI(SN9C110, SanyoCCD, 0x??)}, */ |
1409 | {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C325, OV7648, 0x21)}, | 1586 | {USB_DEVICE(0x0c45, 0x6128), BSI(SN9C110, OM6802, 0x21)}, /*sn9c325?*/ |
1410 | /* bw600.inf: | 1587 | /*bw600.inf:*/ |
1411 | {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C110, OV7648, 0x21)}, */ | 1588 | {USB_DEVICE(0x0c45, 0x612a), BSI(SN9C110, OV7648, 0x21)}, /*sn9c325?*/ |
1412 | {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)}, | 1589 | {USB_DEVICE(0x0c45, 0x612c), BSI(SN9C110, MO4000, 0x21)}, |
1413 | /* {USB_DEVICE(0x0c45, 0x612e), BSI(SN9C110, OV7630, 0x??)}, */ | 1590 | {USB_DEVICE(0x0c45, 0x612e), BSI(SN9C110, OV7630, 0x21)}, |
1414 | /* {USB_DEVICE(0x0c45, 0x612f), BSI(SN9C110, ICM105C, 0x??)}, */ | 1591 | /* {USB_DEVICE(0x0c45, 0x612f), BSI(SN9C110, ICM105C, 0x??)}, */ |
1415 | #ifndef CONFIG_USB_SN9C102 | 1592 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE |
1416 | {USB_DEVICE(0x0c45, 0x6130), BSI(SN9C120, MI0360, 0x5d)}, | 1593 | {USB_DEVICE(0x0c45, 0x6130), BSI(SN9C120, MI0360, 0x5d)}, |
1594 | #endif | ||
1417 | {USB_DEVICE(0x0c45, 0x6138), BSI(SN9C120, MO4000, 0x21)}, | 1595 | {USB_DEVICE(0x0c45, 0x6138), BSI(SN9C120, MO4000, 0x21)}, |
1596 | #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE | ||
1418 | /* {USB_DEVICE(0x0c45, 0x613a), BSI(SN9C120, OV7648, 0x??)}, */ | 1597 | /* {USB_DEVICE(0x0c45, 0x613a), BSI(SN9C120, OV7648, 0x??)}, */ |
1419 | {USB_DEVICE(0x0c45, 0x613b), BSI(SN9C120, OV7660, 0x21)}, | 1598 | {USB_DEVICE(0x0c45, 0x613b), BSI(SN9C120, OV7660, 0x21)}, |
1420 | {USB_DEVICE(0x0c45, 0x613c), BSI(SN9C120, HV7131R, 0x11)}, | 1599 | {USB_DEVICE(0x0c45, 0x613c), BSI(SN9C120, HV7131R, 0x11)}, |
@@ -1438,6 +1617,10 @@ static struct usb_driver sd_driver = { | |||
1438 | .id_table = device_table, | 1617 | .id_table = device_table, |
1439 | .probe = sd_probe, | 1618 | .probe = sd_probe, |
1440 | .disconnect = gspca_disconnect, | 1619 | .disconnect = gspca_disconnect, |
1620 | #ifdef CONFIG_PM | ||
1621 | .suspend = gspca_suspend, | ||
1622 | .resume = gspca_resume, | ||
1623 | #endif | ||
1441 | }; | 1624 | }; |
1442 | 1625 | ||
1443 | /* -- module insert / remove -- */ | 1626 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c index 17fe2c2a440d..6e733901fcca 100644 --- a/drivers/media/video/gspca/spca500.c +++ b/drivers/media/video/gspca/spca500.c | |||
@@ -645,8 +645,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
645 | return 0; | 645 | return 0; |
646 | } | 646 | } |
647 | 647 | ||
648 | /* this function is called at open time */ | 648 | /* this function is called at probe and resume time */ |
649 | static int sd_open(struct gspca_dev *gspca_dev) | 649 | static int sd_init(struct gspca_dev *gspca_dev) |
650 | { | 650 | { |
651 | struct sd *sd = (struct sd *) gspca_dev; | 651 | struct sd *sd = (struct sd *) gspca_dev; |
652 | 652 | ||
@@ -880,14 +880,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
880 | gspca_dev->usb_buf[0]); | 880 | gspca_dev->usb_buf[0]); |
881 | } | 881 | } |
882 | 882 | ||
883 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
884 | { | ||
885 | } | ||
886 | |||
887 | static void sd_close(struct gspca_dev *gspca_dev) | ||
888 | { | ||
889 | } | ||
890 | |||
891 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 883 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
892 | struct gspca_frame *frame, /* target */ | 884 | struct gspca_frame *frame, /* target */ |
893 | __u8 *data, /* isoc packet */ | 885 | __u8 *data, /* isoc packet */ |
@@ -1051,11 +1043,9 @@ static struct sd_desc sd_desc = { | |||
1051 | .ctrls = sd_ctrls, | 1043 | .ctrls = sd_ctrls, |
1052 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1044 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1053 | .config = sd_config, | 1045 | .config = sd_config, |
1054 | .open = sd_open, | 1046 | .init = sd_init, |
1055 | .start = sd_start, | 1047 | .start = sd_start, |
1056 | .stopN = sd_stopN, | 1048 | .stopN = sd_stopN, |
1057 | .stop0 = sd_stop0, | ||
1058 | .close = sd_close, | ||
1059 | .pkt_scan = sd_pkt_scan, | 1049 | .pkt_scan = sd_pkt_scan, |
1060 | }; | 1050 | }; |
1061 | 1051 | ||
@@ -1093,6 +1083,10 @@ static struct usb_driver sd_driver = { | |||
1093 | .id_table = device_table, | 1083 | .id_table = device_table, |
1094 | .probe = sd_probe, | 1084 | .probe = sd_probe, |
1095 | .disconnect = gspca_disconnect, | 1085 | .disconnect = gspca_disconnect, |
1086 | #ifdef CONFIG_PM | ||
1087 | .suspend = gspca_suspend, | ||
1088 | .resume = gspca_resume, | ||
1089 | #endif | ||
1096 | }; | 1090 | }; |
1097 | 1091 | ||
1098 | /* -- module insert / remove -- */ | 1092 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index 51a3c3429ef0..e9eb59bae4fb 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.c | |||
@@ -1953,8 +1953,8 @@ error: | |||
1953 | return -EINVAL; | 1953 | return -EINVAL; |
1954 | } | 1954 | } |
1955 | 1955 | ||
1956 | /* this function is called at open time */ | 1956 | /* this function is called at probe and resume time */ |
1957 | static int sd_open(struct gspca_dev *gspca_dev) | 1957 | static int sd_init(struct gspca_dev *gspca_dev) |
1958 | { | 1958 | { |
1959 | struct sd *sd = (struct sd *) gspca_dev; | 1959 | struct sd *sd = (struct sd *) gspca_dev; |
1960 | 1960 | ||
@@ -2023,11 +2023,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
2023 | 2023 | ||
2024 | static void sd_stop0(struct gspca_dev *gspca_dev) | 2024 | static void sd_stop0(struct gspca_dev *gspca_dev) |
2025 | { | 2025 | { |
2026 | } | ||
2027 | |||
2028 | /* this function is called at close time */ | ||
2029 | static void sd_close(struct gspca_dev *gspca_dev) | ||
2030 | { | ||
2031 | reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x05, 0x00); | 2026 | reg_write(gspca_dev->dev, SPCA501_REG_CTLRL, 0x05, 0x00); |
2032 | } | 2027 | } |
2033 | 2028 | ||
@@ -2120,11 +2115,10 @@ static const struct sd_desc sd_desc = { | |||
2120 | .ctrls = sd_ctrls, | 2115 | .ctrls = sd_ctrls, |
2121 | .nctrls = ARRAY_SIZE(sd_ctrls), | 2116 | .nctrls = ARRAY_SIZE(sd_ctrls), |
2122 | .config = sd_config, | 2117 | .config = sd_config, |
2123 | .open = sd_open, | 2118 | .init = sd_init, |
2124 | .start = sd_start, | 2119 | .start = sd_start, |
2125 | .stopN = sd_stopN, | 2120 | .stopN = sd_stopN, |
2126 | .stop0 = sd_stop0, | 2121 | .stop0 = sd_stop0, |
2127 | .close = sd_close, | ||
2128 | .pkt_scan = sd_pkt_scan, | 2122 | .pkt_scan = sd_pkt_scan, |
2129 | }; | 2123 | }; |
2130 | 2124 | ||
@@ -2154,6 +2148,10 @@ static struct usb_driver sd_driver = { | |||
2154 | .id_table = device_table, | 2148 | .id_table = device_table, |
2155 | .probe = sd_probe, | 2149 | .probe = sd_probe, |
2156 | .disconnect = gspca_disconnect, | 2150 | .disconnect = gspca_disconnect, |
2151 | #ifdef CONFIG_PM | ||
2152 | .suspend = gspca_suspend, | ||
2153 | .resume = gspca_resume, | ||
2154 | #endif | ||
2157 | }; | 2155 | }; |
2158 | 2156 | ||
2159 | /* -- module insert / remove -- */ | 2157 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index eda29d609359..f601daf19ebe 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -655,8 +655,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
655 | return 0; | 655 | return 0; |
656 | } | 656 | } |
657 | 657 | ||
658 | /* this function is called at open time */ | 658 | /* this function is called at probe and resume time */ |
659 | static int sd_open(struct gspca_dev *gspca_dev) | 659 | static int sd_init(struct gspca_dev *gspca_dev) |
660 | { | 660 | { |
661 | struct sd *sd = (struct sd *) gspca_dev; | 661 | struct sd *sd = (struct sd *) gspca_dev; |
662 | int ret; | 662 | int ret; |
@@ -743,11 +743,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
743 | 743 | ||
744 | static void sd_stop0(struct gspca_dev *gspca_dev) | 744 | static void sd_stop0(struct gspca_dev *gspca_dev) |
745 | { | 745 | { |
746 | } | ||
747 | |||
748 | /* this function is called at close time */ | ||
749 | static void sd_close(struct gspca_dev *gspca_dev) | ||
750 | { | ||
751 | /* This maybe reset or power control */ | 746 | /* This maybe reset or power control */ |
752 | reg_write(gspca_dev->dev, 0x03, 0x03, 0x20); | 747 | reg_write(gspca_dev->dev, 0x03, 0x03, 0x20); |
753 | reg_write(gspca_dev->dev, 0x03, 0x01, 0x0); | 748 | reg_write(gspca_dev->dev, 0x03, 0x01, 0x0); |
@@ -825,11 +820,10 @@ static const struct sd_desc sd_desc = { | |||
825 | .ctrls = sd_ctrls, | 820 | .ctrls = sd_ctrls, |
826 | .nctrls = ARRAY_SIZE(sd_ctrls), | 821 | .nctrls = ARRAY_SIZE(sd_ctrls), |
827 | .config = sd_config, | 822 | .config = sd_config, |
828 | .open = sd_open, | 823 | .init = sd_init, |
829 | .start = sd_start, | 824 | .start = sd_start, |
830 | .stopN = sd_stopN, | 825 | .stopN = sd_stopN, |
831 | .stop0 = sd_stop0, | 826 | .stop0 = sd_stop0, |
832 | .close = sd_close, | ||
833 | .pkt_scan = sd_pkt_scan, | 827 | .pkt_scan = sd_pkt_scan, |
834 | }; | 828 | }; |
835 | 829 | ||
@@ -855,6 +849,10 @@ static struct usb_driver sd_driver = { | |||
855 | .id_table = device_table, | 849 | .id_table = device_table, |
856 | .probe = sd_probe, | 850 | .probe = sd_probe, |
857 | .disconnect = gspca_disconnect, | 851 | .disconnect = gspca_disconnect, |
852 | #ifdef CONFIG_PM | ||
853 | .suspend = gspca_suspend, | ||
854 | .resume = gspca_resume, | ||
855 | #endif | ||
858 | }; | 856 | }; |
859 | 857 | ||
860 | /* -- module insert / remove -- */ | 858 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c index f622fa75766d..195dce96ef06 100644 --- a/drivers/media/video/gspca/spca506.c +++ b/drivers/media/video/gspca/spca506.c | |||
@@ -313,8 +313,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
313 | return 0; | 313 | return 0; |
314 | } | 314 | } |
315 | 315 | ||
316 | /* this function is called at open time */ | 316 | /* this function is called at probe and resume time */ |
317 | static int sd_open(struct gspca_dev *gspca_dev) | 317 | static int sd_init(struct gspca_dev *gspca_dev) |
318 | { | 318 | { |
319 | struct usb_device *dev = gspca_dev->dev; | 319 | struct usb_device *dev = gspca_dev->dev; |
320 | 320 | ||
@@ -560,14 +560,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
560 | reg_w(dev, 0x03, 0x00, 0x0003); | 560 | reg_w(dev, 0x03, 0x00, 0x0003); |
561 | } | 561 | } |
562 | 562 | ||
563 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
564 | { | ||
565 | } | ||
566 | |||
567 | static void sd_close(struct gspca_dev *gspca_dev) | ||
568 | { | ||
569 | } | ||
570 | |||
571 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 563 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
572 | struct gspca_frame *frame, /* target */ | 564 | struct gspca_frame *frame, /* target */ |
573 | __u8 *data, /* isoc packet */ | 565 | __u8 *data, /* isoc packet */ |
@@ -740,11 +732,9 @@ static struct sd_desc sd_desc = { | |||
740 | .ctrls = sd_ctrls, | 732 | .ctrls = sd_ctrls, |
741 | .nctrls = ARRAY_SIZE(sd_ctrls), | 733 | .nctrls = ARRAY_SIZE(sd_ctrls), |
742 | .config = sd_config, | 734 | .config = sd_config, |
743 | .open = sd_open, | 735 | .init = sd_init, |
744 | .start = sd_start, | 736 | .start = sd_start, |
745 | .stopN = sd_stopN, | 737 | .stopN = sd_stopN, |
746 | .stop0 = sd_stop0, | ||
747 | .close = sd_close, | ||
748 | .pkt_scan = sd_pkt_scan, | 738 | .pkt_scan = sd_pkt_scan, |
749 | }; | 739 | }; |
750 | 740 | ||
@@ -772,6 +762,10 @@ static struct usb_driver sd_driver = { | |||
772 | .id_table = device_table, | 762 | .id_table = device_table, |
773 | .probe = sd_probe, | 763 | .probe = sd_probe, |
774 | .disconnect = gspca_disconnect, | 764 | .disconnect = gspca_disconnect, |
765 | #ifdef CONFIG_PM | ||
766 | .suspend = gspca_suspend, | ||
767 | .resume = gspca_resume, | ||
768 | #endif | ||
775 | }; | 769 | }; |
776 | 770 | ||
777 | /* -- module insert / remove -- */ | 771 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c index 699340c17dea..281ce02103a3 100644 --- a/drivers/media/video/gspca/spca508.c +++ b/drivers/media/video/gspca/spca508.c | |||
@@ -1521,8 +1521,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1521 | return 0; /* success */ | 1521 | return 0; /* success */ |
1522 | } | 1522 | } |
1523 | 1523 | ||
1524 | /* this function is called at open time */ | 1524 | /* this function is called at probe and resume time */ |
1525 | static int sd_open(struct gspca_dev *gspca_dev) | 1525 | static int sd_init(struct gspca_dev *gspca_dev) |
1526 | { | 1526 | { |
1527 | /* write_vector(gspca_dev, spca508_open_data); */ | 1527 | /* write_vector(gspca_dev, spca508_open_data); */ |
1528 | return 0; | 1528 | return 0; |
@@ -1554,15 +1554,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1554 | reg_write(gspca_dev->dev, 0x8112, 0x20); | 1554 | reg_write(gspca_dev->dev, 0x8112, 0x20); |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1558 | { | ||
1559 | } | ||
1560 | |||
1561 | /* this function is called at close time */ | ||
1562 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1563 | { | ||
1564 | } | ||
1565 | |||
1566 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1557 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1567 | struct gspca_frame *frame, /* target */ | 1558 | struct gspca_frame *frame, /* target */ |
1568 | __u8 *data, /* isoc packet */ | 1559 | __u8 *data, /* isoc packet */ |
@@ -1633,11 +1624,9 @@ static const struct sd_desc sd_desc = { | |||
1633 | .ctrls = sd_ctrls, | 1624 | .ctrls = sd_ctrls, |
1634 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1625 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1635 | .config = sd_config, | 1626 | .config = sd_config, |
1636 | .open = sd_open, | 1627 | .init = sd_init, |
1637 | .start = sd_start, | 1628 | .start = sd_start, |
1638 | .stopN = sd_stopN, | 1629 | .stopN = sd_stopN, |
1639 | .stop0 = sd_stop0, | ||
1640 | .close = sd_close, | ||
1641 | .pkt_scan = sd_pkt_scan, | 1630 | .pkt_scan = sd_pkt_scan, |
1642 | }; | 1631 | }; |
1643 | 1632 | ||
@@ -1667,6 +1656,10 @@ static struct usb_driver sd_driver = { | |||
1667 | .id_table = device_table, | 1656 | .id_table = device_table, |
1668 | .probe = sd_probe, | 1657 | .probe = sd_probe, |
1669 | .disconnect = gspca_disconnect, | 1658 | .disconnect = gspca_disconnect, |
1659 | #ifdef CONFIG_PM | ||
1660 | .suspend = gspca_suspend, | ||
1661 | .resume = gspca_resume, | ||
1662 | #endif | ||
1670 | }; | 1663 | }; |
1671 | 1664 | ||
1672 | /* -- module insert / remove -- */ | 1665 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c index 1073ac3d2ec6..cfbc9ebc5c5d 100644 --- a/drivers/media/video/gspca/spca561.c +++ b/drivers/media/video/gspca/spca561.c | |||
@@ -32,69 +32,48 @@ MODULE_LICENSE("GPL"); | |||
32 | struct sd { | 32 | struct sd { |
33 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 33 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
34 | 34 | ||
35 | unsigned short contrast; | 35 | __u16 contrast; /* rev72a only */ |
36 | __u8 brightness; | 36 | #define CONTRAST_MIN 0x0000 |
37 | #define CONTRAST_DEF 0x2000 | ||
38 | #define CONTRAST_MAX 0x3fff | ||
39 | |||
40 | __u16 exposure; /* rev12a only */ | ||
41 | #define EXPOSURE_MIN 1 | ||
42 | #define EXPOSURE_DEF 200 | ||
43 | #define EXPOSURE_MAX (4095 - 900) /* see set_exposure */ | ||
44 | |||
45 | __u8 brightness; /* rev72a only */ | ||
46 | #define BRIGHTNESS_MIN 0 | ||
47 | #define BRIGHTNESS_DEF 32 | ||
48 | #define BRIGHTNESS_MAX 63 | ||
49 | |||
50 | __u8 white; /* rev12a only */ | ||
51 | #define WHITE_MIN 1 | ||
52 | #define WHITE_DEF 0x40 | ||
53 | #define WHITE_MAX 0x7f | ||
54 | |||
37 | __u8 autogain; | 55 | __u8 autogain; |
56 | #define AUTOGAIN_MIN 0 | ||
57 | #define AUTOGAIN_DEF 1 | ||
58 | #define AUTOGAIN_MAX 1 | ||
59 | |||
60 | __u8 gain; /* rev12a only */ | ||
61 | #define GAIN_MIN 0x0 | ||
62 | #define GAIN_DEF 0x24 | ||
63 | #define GAIN_MAX 0x24 | ||
64 | |||
65 | #define EXPO12A_DEF 3 | ||
66 | __u8 expo12a; /* expo/gain? for rev 12a */ | ||
38 | 67 | ||
39 | __u8 chip_revision; | 68 | __u8 chip_revision; |
69 | #define Rev012A 0 | ||
70 | #define Rev072A 1 | ||
71 | |||
40 | signed char ag_cnt; | 72 | signed char ag_cnt; |
41 | #define AG_CNT_START 13 | 73 | #define AG_CNT_START 13 |
42 | }; | 74 | }; |
43 | 75 | ||
44 | /* V4L2 controls supported by the driver */ | 76 | static struct v4l2_pix_format sif_012a_mode[] = { |
45 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val); | ||
46 | static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val); | ||
47 | static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val); | ||
48 | static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val); | ||
49 | static int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val); | ||
50 | static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val); | ||
51 | |||
52 | static struct ctrl sd_ctrls[] = { | ||
53 | #define SD_BRIGHTNESS 0 | ||
54 | { | ||
55 | { | ||
56 | .id = V4L2_CID_BRIGHTNESS, | ||
57 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
58 | .name = "Brightness", | ||
59 | .minimum = 0, | ||
60 | .maximum = 63, | ||
61 | .step = 1, | ||
62 | .default_value = 32, | ||
63 | }, | ||
64 | .set = sd_setbrightness, | ||
65 | .get = sd_getbrightness, | ||
66 | }, | ||
67 | #define SD_CONTRAST 1 | ||
68 | { | ||
69 | { | ||
70 | .id = V4L2_CID_CONTRAST, | ||
71 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
72 | .name = "Contrast", | ||
73 | .minimum = 0, | ||
74 | .maximum = 0x3fff, | ||
75 | .step = 1, | ||
76 | .default_value = 0x2000, | ||
77 | }, | ||
78 | .set = sd_setcontrast, | ||
79 | .get = sd_getcontrast, | ||
80 | }, | ||
81 | #define SD_AUTOGAIN 2 | ||
82 | { | ||
83 | { | ||
84 | .id = V4L2_CID_AUTOGAIN, | ||
85 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
86 | .name = "Auto Gain", | ||
87 | .minimum = 0, | ||
88 | .maximum = 1, | ||
89 | .step = 1, | ||
90 | .default_value = 1, | ||
91 | }, | ||
92 | .set = sd_setautogain, | ||
93 | .get = sd_getautogain, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct v4l2_pix_format sif_mode[] = { | ||
98 | {160, 120, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, | 77 | {160, 120, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, |
99 | .bytesperline = 160, | 78 | .bytesperline = 160, |
100 | .sizeimage = 160 * 120, | 79 | .sizeimage = 160 * 120, |
@@ -117,6 +96,29 @@ static struct v4l2_pix_format sif_mode[] = { | |||
117 | .priv = 0}, | 96 | .priv = 0}, |
118 | }; | 97 | }; |
119 | 98 | ||
99 | static struct v4l2_pix_format sif_072a_mode[] = { | ||
100 | {160, 120, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, | ||
101 | .bytesperline = 160, | ||
102 | .sizeimage = 160 * 120, | ||
103 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
104 | .priv = 3}, | ||
105 | {176, 144, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, | ||
106 | .bytesperline = 176, | ||
107 | .sizeimage = 176 * 144, | ||
108 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
109 | .priv = 2}, | ||
110 | {320, 240, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, | ||
111 | .bytesperline = 320, | ||
112 | .sizeimage = 320 * 240, | ||
113 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
114 | .priv = 1}, | ||
115 | {352, 288, V4L2_PIX_FMT_SGBRG8, V4L2_FIELD_NONE, | ||
116 | .bytesperline = 352, | ||
117 | .sizeimage = 352 * 288, | ||
118 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
119 | .priv = 0}, | ||
120 | }; | ||
121 | |||
120 | /* | 122 | /* |
121 | * Initialization data | 123 | * Initialization data |
122 | * I'm not very sure how to split initialization from open data | 124 | * I'm not very sure how to split initialization from open data |
@@ -143,12 +145,8 @@ static struct v4l2_pix_format sif_mode[] = { | |||
143 | #define SPCA561_INDEX_I2C_BASE 0x8800 | 145 | #define SPCA561_INDEX_I2C_BASE 0x8800 |
144 | #define SPCA561_SNAPBIT 0x20 | 146 | #define SPCA561_SNAPBIT 0x20 |
145 | #define SPCA561_SNAPCTRL 0x40 | 147 | #define SPCA561_SNAPCTRL 0x40 |
146 | enum { | ||
147 | Rev072A = 0, | ||
148 | Rev012A, | ||
149 | }; | ||
150 | 148 | ||
151 | static void reg_w_val(struct usb_device *dev, __u16 index, __u16 value) | 149 | static void reg_w_val(struct usb_device *dev, __u16 index, __u8 value) |
152 | { | 150 | { |
153 | int ret; | 151 | int ret; |
154 | 152 | ||
@@ -198,12 +196,6 @@ static void reg_w_buf(struct gspca_dev *gspca_dev, | |||
198 | index, gspca_dev->usb_buf, len, 500); | 196 | index, gspca_dev->usb_buf, len, 500); |
199 | } | 197 | } |
200 | 198 | ||
201 | static void i2c_init(struct gspca_dev *gspca_dev, __u8 mode) | ||
202 | { | ||
203 | reg_w_val(gspca_dev->dev, 0x92, 0x8804); | ||
204 | reg_w_val(gspca_dev->dev, mode, 0x8802); | ||
205 | } | ||
206 | |||
207 | static void i2c_write(struct gspca_dev *gspca_dev, __u16 valeur, __u16 reg) | 199 | static void i2c_write(struct gspca_dev *gspca_dev, __u16 valeur, __u16 reg) |
208 | { | 200 | { |
209 | int retry = 60; | 201 | int retry = 60; |
@@ -212,9 +204,9 @@ static void i2c_write(struct gspca_dev *gspca_dev, __u16 valeur, __u16 reg) | |||
212 | 204 | ||
213 | DataLow = valeur; | 205 | DataLow = valeur; |
214 | DataHight = valeur >> 8; | 206 | DataHight = valeur >> 8; |
215 | reg_w_val(gspca_dev->dev, reg, 0x8801); | 207 | reg_w_val(gspca_dev->dev, 0x8801, reg); |
216 | reg_w_val(gspca_dev->dev, DataLow, 0x8805); | 208 | reg_w_val(gspca_dev->dev, 0x8805, DataLow); |
217 | reg_w_val(gspca_dev->dev, DataHight, 0x8800); | 209 | reg_w_val(gspca_dev->dev, 0x8800, DataHight); |
218 | while (retry--) { | 210 | while (retry--) { |
219 | reg_r(gspca_dev, 0x8803, 1); | 211 | reg_r(gspca_dev, 0x8803, 1); |
220 | if (!gspca_dev->usb_buf[0]) | 212 | if (!gspca_dev->usb_buf[0]) |
@@ -228,14 +220,14 @@ static int i2c_read(struct gspca_dev *gspca_dev, __u16 reg, __u8 mode) | |||
228 | __u8 value; | 220 | __u8 value; |
229 | __u8 vallsb; | 221 | __u8 vallsb; |
230 | 222 | ||
231 | reg_w_val(gspca_dev->dev, 0x92, 0x8804); | 223 | reg_w_val(gspca_dev->dev, 0x8804, 0x92); |
232 | reg_w_val(gspca_dev->dev, reg, 0x8801); | 224 | reg_w_val(gspca_dev->dev, 0x8801, reg); |
233 | reg_w_val(gspca_dev->dev, (mode | 0x01), 0x8802); | 225 | reg_w_val(gspca_dev->dev, 0x8802, (mode | 0x01)); |
234 | while (retry--) { | 226 | do { |
235 | reg_r(gspca_dev, 0x8803, 1); | 227 | reg_r(gspca_dev, 0x8803, 1); |
236 | if (!gspca_dev->usb_buf) | 228 | if (!gspca_dev->usb_buf) |
237 | break; | 229 | break; |
238 | } | 230 | } while (--retry); |
239 | if (retry == 0) | 231 | if (retry == 0) |
240 | return -1; | 232 | return -1; |
241 | reg_r(gspca_dev, 0x8800, 1); | 233 | reg_r(gspca_dev, 0x8800, 1); |
@@ -438,21 +430,10 @@ static const __u16 spca561_init_data[][2] = { | |||
438 | {0x0035, 0x8801}, /* 0x14 - set gain general */ | 430 | {0x0035, 0x8801}, /* 0x14 - set gain general */ |
439 | {0x001f, 0x8805}, /* 0x14 */ | 431 | {0x001f, 0x8805}, /* 0x14 */ |
440 | {0x0000, 0x8800}, | 432 | {0x0000, 0x8800}, |
441 | {0x0030, 0x8112}, | 433 | {0x000e, 0x8112}, /* white balance - was 30 */ |
442 | {} | 434 | {} |
443 | }; | 435 | }; |
444 | 436 | ||
445 | static void sensor_reset(struct gspca_dev *gspca_dev) | ||
446 | { | ||
447 | reg_w_val(gspca_dev->dev, 0x8631, 0xc8); | ||
448 | reg_w_val(gspca_dev->dev, 0x8634, 0xc8); | ||
449 | reg_w_val(gspca_dev->dev, 0x8112, 0x00); | ||
450 | reg_w_val(gspca_dev->dev, 0x8114, 0x00); | ||
451 | reg_w_val(gspca_dev->dev, 0x8118, 0x21); | ||
452 | i2c_init(gspca_dev, 0x14); | ||
453 | i2c_write(gspca_dev, 1, 0x0d); | ||
454 | i2c_write(gspca_dev, 0, 0x0d); | ||
455 | } | ||
456 | 437 | ||
457 | /******************** QC Express etch2 stuff ********************/ | 438 | /******************** QC Express etch2 stuff ********************/ |
458 | static const __u16 Pb100_1map8300[][2] = { | 439 | static const __u16 Pb100_1map8300[][2] = { |
@@ -462,9 +443,9 @@ static const __u16 Pb100_1map8300[][2] = { | |||
462 | {0x8303, 0x0125}, /* image area */ | 443 | {0x8303, 0x0125}, /* image area */ |
463 | {0x8304, 0x0169}, | 444 | {0x8304, 0x0169}, |
464 | {0x8328, 0x000b}, | 445 | {0x8328, 0x000b}, |
465 | {0x833c, 0x0001}, | 446 | {0x833c, 0x0001}, /*fixme: win:07*/ |
466 | 447 | ||
467 | {0x832f, 0x0419}, | 448 | {0x832f, 0x1904}, /*fixme: was 0419*/ |
468 | {0x8307, 0x00aa}, | 449 | {0x8307, 0x00aa}, |
469 | {0x8301, 0x0003}, | 450 | {0x8301, 0x0003}, |
470 | {0x8302, 0x000e}, | 451 | {0x8302, 0x000e}, |
@@ -478,9 +459,10 @@ static const __u16 Pb100_2map8300[][2] = { | |||
478 | }; | 459 | }; |
479 | 460 | ||
480 | static const __u16 spca561_161rev12A_data1[][2] = { | 461 | static const __u16 spca561_161rev12A_data1[][2] = { |
481 | {0x21, 0x8118}, | 462 | {0x29, 0x8118}, /* white balance - was 21 */ |
482 | {0x01, 0x8114}, | 463 | {0x08, 0x8114}, /* white balance - was 01 */ |
483 | {0x00, 0x8112}, | 464 | {0x0e, 0x8112}, /* white balance - was 00 */ |
465 | {0x00, 0x8102}, /* white balance - new */ | ||
484 | {0x92, 0x8804}, | 466 | {0x92, 0x8804}, |
485 | {0x04, 0x8802}, /* windows uses 08 */ | 467 | {0x04, 0x8802}, /* windows uses 08 */ |
486 | {} | 468 | {} |
@@ -505,14 +487,16 @@ static const __u16 spca561_161rev12A_data2[][2] = { | |||
505 | {0xb0, 0x8603}, | 487 | {0xb0, 0x8603}, |
506 | 488 | ||
507 | /* sensor gains */ | 489 | /* sensor gains */ |
490 | {0x07, 0x8601}, /* white balance - new */ | ||
491 | {0x07, 0x8602}, /* white balance - new */ | ||
508 | {0x00, 0x8610}, /* *red */ | 492 | {0x00, 0x8610}, /* *red */ |
509 | {0x00, 0x8611}, /* 3f *green */ | 493 | {0x00, 0x8611}, /* 3f *green */ |
510 | {0x00, 0x8612}, /* green *blue */ | 494 | {0x00, 0x8612}, /* green *blue */ |
511 | {0x00, 0x8613}, /* blue *green */ | 495 | {0x00, 0x8613}, /* blue *green */ |
512 | {0x35, 0x8614}, /* green *red */ | 496 | {0x43, 0x8614}, /* green *red - white balance - was 0x35 */ |
513 | {0x35, 0x8615}, /* 40 *green */ | 497 | {0x40, 0x8615}, /* 40 *green - white balance - was 0x35 */ |
514 | {0x35, 0x8616}, /* 7a *blue */ | 498 | {0x71, 0x8616}, /* 7a *blue - white balance - was 0x35 */ |
515 | {0x35, 0x8617}, /* 40 *green */ | 499 | {0x40, 0x8617}, /* 40 *green - white balance - was 0x35 */ |
516 | 500 | ||
517 | {0x0c, 0x8620}, /* 0c */ | 501 | {0x0c, 0x8620}, /* 0c */ |
518 | {0xc8, 0x8631}, /* c8 */ | 502 | {0xc8, 0x8631}, /* c8 */ |
@@ -527,6 +511,7 @@ static const __u16 spca561_161rev12A_data2[][2] = { | |||
527 | {0xdf, 0x863c}, /* df */ | 511 | {0xdf, 0x863c}, /* df */ |
528 | {0xf0, 0x8505}, | 512 | {0xf0, 0x8505}, |
529 | {0x32, 0x850a}, | 513 | {0x32, 0x850a}, |
514 | /* {0x99, 0x8700}, * - white balance - new (removed) */ | ||
530 | {} | 515 | {} |
531 | }; | 516 | }; |
532 | 517 | ||
@@ -545,9 +530,10 @@ static void sensor_mapwrite(struct gspca_dev *gspca_dev, | |||
545 | } | 530 | } |
546 | static void init_161rev12A(struct gspca_dev *gspca_dev) | 531 | static void init_161rev12A(struct gspca_dev *gspca_dev) |
547 | { | 532 | { |
548 | sensor_reset(gspca_dev); | 533 | /* sensor_reset(gspca_dev); (not in win) */ |
549 | write_vector(gspca_dev, spca561_161rev12A_data1); | 534 | write_vector(gspca_dev, spca561_161rev12A_data1); |
550 | sensor_mapwrite(gspca_dev, Pb100_1map8300); | 535 | sensor_mapwrite(gspca_dev, Pb100_1map8300); |
536 | /*fixme: should be in sd_start*/ | ||
551 | write_vector(gspca_dev, spca561_161rev12A_data2); | 537 | write_vector(gspca_dev, spca561_161rev12A_data2); |
552 | sensor_mapwrite(gspca_dev, Pb100_2map8300); | 538 | sensor_mapwrite(gspca_dev, Pb100_2map8300); |
553 | } | 539 | } |
@@ -581,35 +567,38 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
581 | } | 567 | } |
582 | 568 | ||
583 | cam = &gspca_dev->cam; | 569 | cam = &gspca_dev->cam; |
584 | cam->dev_name = (char *) id->driver_info; | ||
585 | cam->epaddr = 0x01; | 570 | cam->epaddr = 0x01; |
586 | gspca_dev->nbalt = 7 + 1; /* choose alternate 7 first */ | 571 | gspca_dev->nbalt = 7 + 1; /* choose alternate 7 first */ |
587 | cam->cam_mode = sif_mode; | ||
588 | cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; | ||
589 | 572 | ||
590 | sd->chip_revision = id->driver_info; | 573 | sd->chip_revision = id->driver_info; |
591 | sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; | 574 | if (sd->chip_revision == Rev012A) { |
592 | sd->contrast = sd_ctrls[SD_CONTRAST].qctrl.default_value; | 575 | cam->cam_mode = sif_012a_mode; |
593 | sd->autogain = sd_ctrls[SD_AUTOGAIN].qctrl.default_value; | 576 | cam->nmodes = ARRAY_SIZE(sif_012a_mode); |
577 | } else { | ||
578 | cam->cam_mode = sif_072a_mode; | ||
579 | cam->nmodes = ARRAY_SIZE(sif_072a_mode); | ||
580 | } | ||
581 | sd->brightness = BRIGHTNESS_DEF; | ||
582 | sd->contrast = CONTRAST_DEF; | ||
583 | sd->white = WHITE_DEF; | ||
584 | sd->exposure = EXPOSURE_DEF; | ||
585 | sd->autogain = AUTOGAIN_DEF; | ||
586 | sd->gain = GAIN_DEF; | ||
587 | sd->expo12a = EXPO12A_DEF; | ||
594 | return 0; | 588 | return 0; |
595 | } | 589 | } |
596 | 590 | ||
597 | /* this function is called at open time */ | 591 | /* this function is called at probe and resume time */ |
598 | static int sd_open(struct gspca_dev *gspca_dev) | 592 | static int sd_init_12a(struct gspca_dev *gspca_dev) |
599 | { | 593 | { |
600 | struct sd *sd = (struct sd *) gspca_dev; | 594 | PDEBUG(D_STREAM, "Chip revision: 012a"); |
601 | 595 | init_161rev12A(gspca_dev); | |
602 | switch (sd->chip_revision) { | 596 | return 0; |
603 | case Rev072A: | 597 | } |
604 | PDEBUG(D_STREAM, "Chip revision id: 072a"); | 598 | static int sd_init_72a(struct gspca_dev *gspca_dev) |
605 | write_vector(gspca_dev, spca561_init_data); | 599 | { |
606 | break; | 600 | PDEBUG(D_STREAM, "Chip revision: 072a"); |
607 | default: | 601 | write_vector(gspca_dev, spca561_init_data); |
608 | /* case Rev012A: */ | ||
609 | PDEBUG(D_STREAM, "Chip revision id: 012a"); | ||
610 | init_161rev12A(gspca_dev); | ||
611 | break; | ||
612 | } | ||
613 | return 0; | 602 | return 0; |
614 | } | 603 | } |
615 | 604 | ||
@@ -618,25 +607,20 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
618 | struct sd *sd = (struct sd *) gspca_dev; | 607 | struct sd *sd = (struct sd *) gspca_dev; |
619 | struct usb_device *dev = gspca_dev->dev; | 608 | struct usb_device *dev = gspca_dev->dev; |
620 | __u8 lowb; | 609 | __u8 lowb; |
621 | int expotimes; | ||
622 | 610 | ||
623 | switch (sd->chip_revision) { | 611 | switch (sd->chip_revision) { |
624 | case Rev072A: | 612 | case Rev072A: |
625 | lowb = sd->contrast >> 8; | 613 | lowb = sd->contrast >> 8; |
626 | reg_w_val(dev, lowb, 0x8651); | 614 | reg_w_val(dev, 0x8651, lowb); |
627 | reg_w_val(dev, lowb, 0x8652); | 615 | reg_w_val(dev, 0x8652, lowb); |
628 | reg_w_val(dev, lowb, 0x8653); | 616 | reg_w_val(dev, 0x8653, lowb); |
629 | reg_w_val(dev, lowb, 0x8654); | 617 | reg_w_val(dev, 0x8654, lowb); |
630 | break; | 618 | break; |
631 | case Rev012A: { | 619 | default: { |
632 | __u8 Reg8391[] = | 620 | /* case Rev012A: { */ |
633 | { 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00 }; | 621 | static const __u8 Reg8391[] = |
634 | 622 | { 0x92, 0x30, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x00 }; | |
635 | /* Write camera sensor settings */ | 623 | |
636 | expotimes = (sd->contrast >> 5) & 0x07ff; | ||
637 | Reg8391[0] = expotimes & 0xff; /* exposure */ | ||
638 | Reg8391[1] = 0x18 | (expotimes >> 8); | ||
639 | Reg8391[2] = sd->brightness; /* gain */ | ||
640 | reg_w_buf(gspca_dev, 0x8391, Reg8391, 8); | 624 | reg_w_buf(gspca_dev, 0x8391, Reg8391, 8); |
641 | reg_w_buf(gspca_dev, 0x8390, Reg8391, 8); | 625 | reg_w_buf(gspca_dev, 0x8390, Reg8391, 8); |
642 | break; | 626 | break; |
@@ -644,93 +628,151 @@ static void setcontrast(struct gspca_dev *gspca_dev) | |||
644 | } | 628 | } |
645 | } | 629 | } |
646 | 630 | ||
647 | static void setautogain(struct gspca_dev *gspca_dev) | 631 | /* rev12a only */ |
632 | static void setwhite(struct gspca_dev *gspca_dev) | ||
648 | { | 633 | { |
649 | struct sd *sd = (struct sd *) gspca_dev; | 634 | struct sd *sd = (struct sd *) gspca_dev; |
635 | __u16 white; | ||
636 | __u8 reg8614, reg8616; | ||
637 | |||
638 | white = sd->white; | ||
639 | /* try to emulate MS-win as possible */ | ||
640 | reg8616 = 0x90 - white * 5 / 8; | ||
641 | reg_w_val(gspca_dev->dev, 0x8616, reg8616); | ||
642 | reg8614 = 0x20 + white * 3 / 8; | ||
643 | reg_w_val(gspca_dev->dev, 0x8614, reg8614); | ||
644 | } | ||
650 | 645 | ||
651 | if (sd->chip_revision == Rev072A) { | 646 | /* rev 12a only */ |
652 | if (sd->autogain) | 647 | static void setexposure(struct gspca_dev *gspca_dev) |
653 | sd->ag_cnt = AG_CNT_START; | 648 | { |
654 | else | 649 | struct sd *sd = (struct sd *) gspca_dev; |
655 | sd->ag_cnt = -1; | 650 | int expo; |
651 | int clock_divider; | ||
652 | __u8 data[2]; | ||
653 | |||
654 | /* Register 0x8309 controls exposure for the spca561, | ||
655 | the basic exposure setting goes from 1-2047, where 1 is completely | ||
656 | dark and 2047 is very bright. It not only influences exposure but | ||
657 | also the framerate (to allow for longer exposure) from 1 - 300 it | ||
658 | only raises the exposure time then from 300 - 600 it halves the | ||
659 | framerate to be able to further raise the exposure time and for every | ||
660 | 300 more it halves the framerate again. This allows for a maximum | ||
661 | exposure time of circa 0.2 - 0.25 seconds (30 / (2000/3000) fps). | ||
662 | Sometimes this is not enough, the 1-2047 uses bits 0-10, bits 11-12 | ||
663 | configure a divider for the base framerate which us used at the | ||
664 | exposure setting of 1-300. These bits configure the base framerate | ||
665 | according to the following formula: fps = 60 / (value + 2) */ | ||
666 | if (sd->exposure < 2048) { | ||
667 | expo = sd->exposure; | ||
668 | clock_divider = 0; | ||
669 | } else { | ||
670 | /* Add 900 to make the 0 setting of the second part of the | ||
671 | exposure equal to the 2047 setting of the first part. */ | ||
672 | expo = (sd->exposure - 2048) + 900; | ||
673 | clock_divider = 3; | ||
656 | } | 674 | } |
675 | expo |= clock_divider << 11; | ||
676 | data[0] = expo; | ||
677 | data[1] = expo >> 8; | ||
678 | reg_w_buf(gspca_dev, 0x8309, data, 2); | ||
657 | } | 679 | } |
658 | 680 | ||
659 | static void sd_start(struct gspca_dev *gspca_dev) | 681 | /* rev 12a only */ |
682 | static void setgain(struct gspca_dev *gspca_dev) | ||
660 | { | 683 | { |
661 | struct sd *sd = (struct sd *) gspca_dev; | 684 | struct sd *sd = (struct sd *) gspca_dev; |
685 | __u8 data[2]; | ||
686 | |||
687 | data[0] = sd->gain; | ||
688 | data[1] = 0; | ||
689 | reg_w_buf(gspca_dev, 0x8335, data, 2); | ||
690 | } | ||
691 | |||
692 | static void setautogain(struct gspca_dev *gspca_dev) | ||
693 | { | ||
694 | struct sd *sd = (struct sd *) gspca_dev; | ||
695 | |||
696 | if (sd->autogain) | ||
697 | sd->ag_cnt = AG_CNT_START; | ||
698 | else | ||
699 | sd->ag_cnt = -1; | ||
700 | } | ||
701 | |||
702 | static void sd_start_12a(struct gspca_dev *gspca_dev) | ||
703 | { | ||
662 | struct usb_device *dev = gspca_dev->dev; | 704 | struct usb_device *dev = gspca_dev->dev; |
663 | int Clck; | 705 | int Clck = 0x8a; /* lower 0x8X values lead to fps > 30 */ |
664 | __u8 Reg8307[] = { 0xaa, 0x00 }; | 706 | __u8 Reg8307[] = { 0xaa, 0x00 }; |
665 | int mode; | 707 | int mode; |
666 | 708 | ||
667 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | 709 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; |
668 | switch (sd->chip_revision) { | 710 | if (mode <= 1) { |
669 | case Rev072A: | 711 | /* Use compression on 320x240 and above */ |
670 | switch (mode) { | 712 | reg_w_val(dev, 0x8500, 0x10 | mode); |
671 | default: | 713 | } else { |
672 | /* case 0: | 714 | /* I couldn't get the compression to work below 320x240 |
673 | case 1: */ | 715 | * Fortunately at these resolutions the bandwidth |
674 | Clck = 0x25; | 716 | * is sufficient to push raw frames at ~20fps */ |
675 | break; | 717 | reg_w_val(dev, 0x8500, mode); |
676 | case 2: | 718 | } /* -- qq@kuku.eu.org */ |
677 | Clck = 0x22; | 719 | reg_w_buf(gspca_dev, 0x8307, Reg8307, 2); |
678 | break; | 720 | reg_w_val(gspca_dev->dev, 0x8700, Clck); |
679 | case 3: | 721 | /* 0x8f 0x85 0x27 clock */ |
680 | Clck = 0x21; | 722 | reg_w_val(gspca_dev->dev, 0x8112, 0x1e | 0x20); |
681 | break; | 723 | reg_w_val(gspca_dev->dev, 0x850b, 0x03); |
682 | } | 724 | setcontrast(gspca_dev); |
683 | reg_w_val(dev, 0x8500, mode); /* mode */ | 725 | setwhite(gspca_dev); |
684 | reg_w_val(dev, 0x8700, Clck); /* 0x27 clock */ | 726 | setautogain(gspca_dev); |
685 | reg_w_val(dev, 0x8112, 0x10 | 0x20); | 727 | setexposure(gspca_dev); |
686 | setautogain(gspca_dev); | 728 | } |
687 | break; | 729 | static void sd_start_72a(struct gspca_dev *gspca_dev) |
730 | { | ||
731 | struct usb_device *dev = gspca_dev->dev; | ||
732 | int Clck; | ||
733 | int mode; | ||
734 | |||
735 | mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; | ||
736 | switch (mode) { | ||
688 | default: | 737 | default: |
689 | /* case Rev012A: */ | 738 | /* case 0: |
690 | switch (mode) { | 739 | case 1: */ |
691 | case 0: | 740 | Clck = 0x25; |
692 | case 1: | 741 | break; |
693 | Clck = 0x8a; | 742 | case 2: |
694 | break; | 743 | Clck = 0x22; |
695 | case 2: | 744 | break; |
696 | Clck = 0x85; | 745 | case 3: |
697 | break; | 746 | Clck = 0x21; |
698 | default: | ||
699 | Clck = 0x83; | ||
700 | break; | ||
701 | } | ||
702 | if (mode <= 1) { | ||
703 | /* Use compression on 320x240 and above */ | ||
704 | reg_w_val(dev, 0x8500, 0x10 | mode); | ||
705 | } else { | ||
706 | /* I couldn't get the compression to work below 320x240 | ||
707 | * Fortunately at these resolutions the bandwidth | ||
708 | * is sufficient to push raw frames at ~20fps */ | ||
709 | reg_w_val(dev, 0x8500, mode); | ||
710 | } /* -- qq@kuku.eu.org */ | ||
711 | reg_w_buf(gspca_dev, 0x8307, Reg8307, 2); | ||
712 | reg_w_val(gspca_dev->dev, 0x8700, Clck); | ||
713 | /* 0x8f 0x85 0x27 clock */ | ||
714 | reg_w_val(gspca_dev->dev, 0x8112, 0x1e | 0x20); | ||
715 | reg_w_val(gspca_dev->dev, 0x850b, 0x03); | ||
716 | setcontrast(gspca_dev); | ||
717 | break; | 747 | break; |
718 | } | 748 | } |
749 | reg_w_val(dev, 0x8500, mode); /* mode */ | ||
750 | reg_w_val(dev, 0x8700, Clck); /* 0x27 clock */ | ||
751 | reg_w_val(dev, 0x8112, 0x10 | 0x20); | ||
752 | setautogain(gspca_dev); | ||
719 | } | 753 | } |
720 | 754 | ||
721 | static void sd_stopN(struct gspca_dev *gspca_dev) | 755 | static void sd_stopN(struct gspca_dev *gspca_dev) |
722 | { | 756 | { |
723 | reg_w_val(gspca_dev->dev, 0x8112, 0x20); | 757 | struct sd *sd = (struct sd *) gspca_dev; |
758 | |||
759 | if (sd->chip_revision == Rev012A) { | ||
760 | reg_w_val(gspca_dev->dev, 0x8112, 0x0e); | ||
761 | } else { | ||
762 | reg_w_val(gspca_dev->dev, 0x8112, 0x20); | ||
763 | /* reg_w_val(gspca_dev->dev, 0x8102, 0x00); ?? */ | ||
764 | } | ||
724 | } | 765 | } |
725 | 766 | ||
726 | static void sd_stop0(struct gspca_dev *gspca_dev) | 767 | static void sd_stop0(struct gspca_dev *gspca_dev) |
727 | { | 768 | { |
728 | } | 769 | struct sd *sd = (struct sd *) gspca_dev; |
729 | 770 | ||
730 | /* this function is called at close time */ | 771 | if (sd->chip_revision == Rev012A) { |
731 | static void sd_close(struct gspca_dev *gspca_dev) | 772 | reg_w_val(gspca_dev->dev, 0x8118, 0x29); |
732 | { | 773 | reg_w_val(gspca_dev->dev, 0x8114, 0x08); |
733 | reg_w_val(gspca_dev->dev, 0x8114, 0); | 774 | } |
775 | /* reg_w_val(gspca_dev->dev, 0x8114, 0); */ | ||
734 | } | 776 | } |
735 | 777 | ||
736 | static void do_autogain(struct gspca_dev *gspca_dev) | 778 | static void do_autogain(struct gspca_dev *gspca_dev) |
@@ -744,6 +786,7 @@ static void do_autogain(struct gspca_dev *gspca_dev) | |||
744 | __u8 luma_mean = 110; | 786 | __u8 luma_mean = 110; |
745 | __u8 luma_delta = 20; | 787 | __u8 luma_delta = 20; |
746 | __u8 spring = 4; | 788 | __u8 spring = 4; |
789 | __u8 reg8339[2]; | ||
747 | 790 | ||
748 | if (sd->ag_cnt < 0) | 791 | if (sd->ag_cnt < 0) |
749 | return; | 792 | return; |
@@ -798,13 +841,16 @@ static void do_autogain(struct gspca_dev *gspca_dev) | |||
798 | } | 841 | } |
799 | break; | 842 | break; |
800 | case Rev012A: | 843 | case Rev012A: |
801 | /* sensor registers is access and memory mapped to 0x8300 */ | 844 | reg_r(gspca_dev, 0x8330, 2); |
802 | /* readind all 0x83xx block the sensor */ | 845 | if (gspca_dev->usb_buf[1] > 0x08) { |
803 | /* | 846 | reg8339[0] = ++sd->expo12a; |
804 | * The data from the header seem wrong where is the luma | 847 | reg8339[1] = 0; |
805 | * and chroma mean value | 848 | reg_w_buf(gspca_dev, 0x8339, reg8339, 2); |
806 | * at the moment set exposure in contrast set | 849 | } else if (gspca_dev->usb_buf[1] < 0x02) { |
807 | */ | 850 | reg8339[0] = --sd->expo12a; |
851 | reg8339[1] = 0; | ||
852 | reg_w_buf(gspca_dev, 0x8339, reg8339, 2); | ||
853 | } | ||
808 | break; | 854 | break; |
809 | } | 855 | } |
810 | } | 856 | } |
@@ -814,6 +860,8 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
814 | __u8 *data, /* isoc packet */ | 860 | __u8 *data, /* isoc packet */ |
815 | int len) /* iso packet length */ | 861 | int len) /* iso packet length */ |
816 | { | 862 | { |
863 | struct sd *sd = (struct sd *) gspca_dev; | ||
864 | |||
817 | switch (data[0]) { | 865 | switch (data[0]) { |
818 | case 0: /* start of frame */ | 866 | case 0: /* start of frame */ |
819 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, | 867 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, |
@@ -826,8 +874,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
826 | frame, data, len); | 874 | frame, data, len); |
827 | } else { | 875 | } else { |
828 | /* raw bayer (with a header, which we skip) */ | 876 | /* raw bayer (with a header, which we skip) */ |
829 | data += 20; | 877 | if (sd->chip_revision == Rev012A) { |
830 | len -= 20; | 878 | data += 20; |
879 | len -= 20; | ||
880 | } else { | ||
881 | data += 16; | ||
882 | len -= 16; | ||
883 | } | ||
831 | gspca_frame_add(gspca_dev, FIRST_PACKET, | 884 | gspca_frame_add(gspca_dev, FIRST_PACKET, |
832 | frame, data, len); | 885 | frame, data, len); |
833 | } | 886 | } |
@@ -841,24 +894,17 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
841 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | 894 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); |
842 | } | 895 | } |
843 | 896 | ||
897 | /* rev 72a only */ | ||
844 | static void setbrightness(struct gspca_dev *gspca_dev) | 898 | static void setbrightness(struct gspca_dev *gspca_dev) |
845 | { | 899 | { |
846 | struct sd *sd = (struct sd *) gspca_dev; | 900 | struct sd *sd = (struct sd *) gspca_dev; |
847 | __u8 value; | 901 | __u8 value; |
848 | 902 | ||
849 | switch (sd->chip_revision) { | 903 | value = sd->brightness; |
850 | case Rev072A: | 904 | reg_w_val(gspca_dev->dev, 0x8611, value); |
851 | value = sd->brightness; | 905 | reg_w_val(gspca_dev->dev, 0x8612, value); |
852 | reg_w_val(gspca_dev->dev, value, 0x8611); | 906 | reg_w_val(gspca_dev->dev, 0x8613, value); |
853 | reg_w_val(gspca_dev->dev, value, 0x8612); | 907 | reg_w_val(gspca_dev->dev, 0x8614, value); |
854 | reg_w_val(gspca_dev->dev, value, 0x8613); | ||
855 | reg_w_val(gspca_dev->dev, value, 0x8614); | ||
856 | break; | ||
857 | default: | ||
858 | /* case Rev012A: */ | ||
859 | setcontrast(gspca_dev); | ||
860 | break; | ||
861 | } | ||
862 | } | 908 | } |
863 | 909 | ||
864 | static void getbrightness(struct gspca_dev *gspca_dev) | 910 | static void getbrightness(struct gspca_dev *gspca_dev) |
@@ -866,52 +912,38 @@ static void getbrightness(struct gspca_dev *gspca_dev) | |||
866 | struct sd *sd = (struct sd *) gspca_dev; | 912 | struct sd *sd = (struct sd *) gspca_dev; |
867 | __u16 tot; | 913 | __u16 tot; |
868 | 914 | ||
869 | switch (sd->chip_revision) { | 915 | tot = 0; |
870 | case Rev072A: | 916 | reg_r(gspca_dev, 0x8611, 1); |
871 | tot = 0; | 917 | tot += gspca_dev->usb_buf[0]; |
872 | reg_r(gspca_dev, 0x8611, 1); | 918 | reg_r(gspca_dev, 0x8612, 1); |
873 | tot += gspca_dev->usb_buf[0]; | 919 | tot += gspca_dev->usb_buf[0]; |
874 | reg_r(gspca_dev, 0x8612, 1); | 920 | reg_r(gspca_dev, 0x8613, 1); |
875 | tot += gspca_dev->usb_buf[0]; | 921 | tot += gspca_dev->usb_buf[0]; |
876 | reg_r(gspca_dev, 0x8613, 1); | 922 | reg_r(gspca_dev, 0x8614, 1); |
877 | tot += gspca_dev->usb_buf[0]; | 923 | tot += gspca_dev->usb_buf[0]; |
878 | reg_r(gspca_dev, 0x8614, 1); | 924 | sd->brightness = tot >> 2; |
879 | tot += gspca_dev->usb_buf[0]; | ||
880 | sd->brightness = tot >> 2; | ||
881 | break; | ||
882 | default: | ||
883 | /* case Rev012A: */ | ||
884 | /* no way to read sensor settings */ | ||
885 | break; | ||
886 | } | ||
887 | } | 925 | } |
888 | 926 | ||
927 | /* rev72a only */ | ||
889 | static void getcontrast(struct gspca_dev *gspca_dev) | 928 | static void getcontrast(struct gspca_dev *gspca_dev) |
890 | { | 929 | { |
891 | struct sd *sd = (struct sd *) gspca_dev; | 930 | struct sd *sd = (struct sd *) gspca_dev; |
892 | __u16 tot; | 931 | __u16 tot; |
893 | 932 | ||
894 | switch (sd->chip_revision) { | 933 | tot = 0; |
895 | case Rev072A: | 934 | reg_r(gspca_dev, 0x8651, 1); |
896 | tot = 0; | 935 | tot += gspca_dev->usb_buf[0]; |
897 | reg_r(gspca_dev, 0x8651, 1); | 936 | reg_r(gspca_dev, 0x8652, 1); |
898 | tot += gspca_dev->usb_buf[0]; | 937 | tot += gspca_dev->usb_buf[0]; |
899 | reg_r(gspca_dev, 0x8652, 1); | 938 | reg_r(gspca_dev, 0x8653, 1); |
900 | tot += gspca_dev->usb_buf[0]; | 939 | tot += gspca_dev->usb_buf[0]; |
901 | reg_r(gspca_dev, 0x8653, 1); | 940 | reg_r(gspca_dev, 0x8654, 1); |
902 | tot += gspca_dev->usb_buf[0]; | 941 | tot += gspca_dev->usb_buf[0]; |
903 | reg_r(gspca_dev, 0x8654, 1); | 942 | sd->contrast = tot << 6; |
904 | tot += gspca_dev->usb_buf[0]; | ||
905 | sd->contrast = tot << 6; | ||
906 | break; | ||
907 | default: | ||
908 | /* case Rev012A: */ | ||
909 | /* no way to read sensor settings */ | ||
910 | break; | ||
911 | } | ||
912 | PDEBUG(D_CONF, "get contrast %d", sd->contrast); | 943 | PDEBUG(D_CONF, "get contrast %d", sd->contrast); |
913 | } | 944 | } |
914 | 945 | ||
946 | /* rev 72a only */ | ||
915 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) | 947 | static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) |
916 | { | 948 | { |
917 | struct sd *sd = (struct sd *) gspca_dev; | 949 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -931,6 +963,7 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) | |||
931 | return 0; | 963 | return 0; |
932 | } | 964 | } |
933 | 965 | ||
966 | /* rev 72a only */ | ||
934 | static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) | 967 | static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) |
935 | { | 968 | { |
936 | struct sd *sd = (struct sd *) gspca_dev; | 969 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -968,20 +1001,190 @@ static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) | |||
968 | return 0; | 1001 | return 0; |
969 | } | 1002 | } |
970 | 1003 | ||
1004 | /* rev12a only */ | ||
1005 | static int sd_setwhite(struct gspca_dev *gspca_dev, __s32 val) | ||
1006 | { | ||
1007 | struct sd *sd = (struct sd *) gspca_dev; | ||
1008 | |||
1009 | sd->white = val; | ||
1010 | if (gspca_dev->streaming) | ||
1011 | setwhite(gspca_dev); | ||
1012 | return 0; | ||
1013 | } | ||
1014 | |||
1015 | static int sd_getwhite(struct gspca_dev *gspca_dev, __s32 *val) | ||
1016 | { | ||
1017 | struct sd *sd = (struct sd *) gspca_dev; | ||
1018 | |||
1019 | *val = sd->white; | ||
1020 | return 0; | ||
1021 | } | ||
1022 | |||
1023 | /* rev12a only */ | ||
1024 | static int sd_setexposure(struct gspca_dev *gspca_dev, __s32 val) | ||
1025 | { | ||
1026 | struct sd *sd = (struct sd *) gspca_dev; | ||
1027 | |||
1028 | sd->exposure = val; | ||
1029 | if (gspca_dev->streaming) | ||
1030 | setexposure(gspca_dev); | ||
1031 | return 0; | ||
1032 | } | ||
1033 | |||
1034 | static int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val) | ||
1035 | { | ||
1036 | struct sd *sd = (struct sd *) gspca_dev; | ||
1037 | |||
1038 | *val = sd->exposure; | ||
1039 | return 0; | ||
1040 | } | ||
1041 | |||
1042 | /* rev12a only */ | ||
1043 | static int sd_setgain(struct gspca_dev *gspca_dev, __s32 val) | ||
1044 | { | ||
1045 | struct sd *sd = (struct sd *) gspca_dev; | ||
1046 | |||
1047 | sd->gain = val; | ||
1048 | if (gspca_dev->streaming) | ||
1049 | setgain(gspca_dev); | ||
1050 | return 0; | ||
1051 | } | ||
1052 | |||
1053 | static int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val) | ||
1054 | { | ||
1055 | struct sd *sd = (struct sd *) gspca_dev; | ||
1056 | |||
1057 | *val = sd->gain; | ||
1058 | return 0; | ||
1059 | } | ||
1060 | |||
1061 | /* control tables */ | ||
1062 | static struct ctrl sd_ctrls_12a[] = { | ||
1063 | { | ||
1064 | { | ||
1065 | .id = V4L2_CID_DO_WHITE_BALANCE, | ||
1066 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
1067 | .name = "While Balance", | ||
1068 | .minimum = WHITE_MIN, | ||
1069 | .maximum = WHITE_MAX, | ||
1070 | .step = 1, | ||
1071 | .default_value = WHITE_DEF, | ||
1072 | }, | ||
1073 | .set = sd_setwhite, | ||
1074 | .get = sd_getwhite, | ||
1075 | }, | ||
1076 | { | ||
1077 | { | ||
1078 | .id = V4L2_CID_EXPOSURE, | ||
1079 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
1080 | .name = "Exposure", | ||
1081 | .minimum = EXPOSURE_MIN, | ||
1082 | .maximum = EXPOSURE_MAX, | ||
1083 | .step = 1, | ||
1084 | .default_value = EXPOSURE_DEF, | ||
1085 | }, | ||
1086 | .set = sd_setexposure, | ||
1087 | .get = sd_getexposure, | ||
1088 | }, | ||
1089 | { | ||
1090 | { | ||
1091 | .id = V4L2_CID_AUTOGAIN, | ||
1092 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
1093 | .name = "Auto Gain", | ||
1094 | .minimum = AUTOGAIN_MIN, | ||
1095 | .maximum = AUTOGAIN_MAX, | ||
1096 | .step = 1, | ||
1097 | .default_value = AUTOGAIN_DEF, | ||
1098 | }, | ||
1099 | .set = sd_setautogain, | ||
1100 | .get = sd_getautogain, | ||
1101 | }, | ||
1102 | { | ||
1103 | { | ||
1104 | .id = V4L2_CID_GAIN, | ||
1105 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
1106 | .name = "Gain", | ||
1107 | .minimum = GAIN_MIN, | ||
1108 | .maximum = GAIN_MAX, | ||
1109 | .step = 1, | ||
1110 | .default_value = GAIN_DEF, | ||
1111 | }, | ||
1112 | .set = sd_setgain, | ||
1113 | .get = sd_getgain, | ||
1114 | }, | ||
1115 | }; | ||
1116 | |||
1117 | static struct ctrl sd_ctrls_72a[] = { | ||
1118 | { | ||
1119 | { | ||
1120 | .id = V4L2_CID_BRIGHTNESS, | ||
1121 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
1122 | .name = "Brightness", | ||
1123 | .minimum = BRIGHTNESS_MIN, | ||
1124 | .maximum = BRIGHTNESS_MAX, | ||
1125 | .step = 1, | ||
1126 | .default_value = BRIGHTNESS_DEF, | ||
1127 | }, | ||
1128 | .set = sd_setbrightness, | ||
1129 | .get = sd_getbrightness, | ||
1130 | }, | ||
1131 | { | ||
1132 | { | ||
1133 | .id = V4L2_CID_CONTRAST, | ||
1134 | .type = V4L2_CTRL_TYPE_INTEGER, | ||
1135 | .name = "Contrast", | ||
1136 | .minimum = CONTRAST_MIN, | ||
1137 | .maximum = CONTRAST_MAX, | ||
1138 | .step = 1, | ||
1139 | .default_value = CONTRAST_DEF, | ||
1140 | }, | ||
1141 | .set = sd_setcontrast, | ||
1142 | .get = sd_getcontrast, | ||
1143 | }, | ||
1144 | { | ||
1145 | { | ||
1146 | .id = V4L2_CID_AUTOGAIN, | ||
1147 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
1148 | .name = "Auto Gain", | ||
1149 | .minimum = AUTOGAIN_MIN, | ||
1150 | .maximum = AUTOGAIN_MAX, | ||
1151 | .step = 1, | ||
1152 | .default_value = AUTOGAIN_DEF, | ||
1153 | }, | ||
1154 | .set = sd_setautogain, | ||
1155 | .get = sd_getautogain, | ||
1156 | }, | ||
1157 | }; | ||
1158 | |||
971 | /* sub-driver description */ | 1159 | /* sub-driver description */ |
972 | static const struct sd_desc sd_desc = { | 1160 | static const struct sd_desc sd_desc_12a = { |
1161 | .name = MODULE_NAME, | ||
1162 | .ctrls = sd_ctrls_12a, | ||
1163 | .nctrls = ARRAY_SIZE(sd_ctrls_12a), | ||
1164 | .config = sd_config, | ||
1165 | .init = sd_init_12a, | ||
1166 | .start = sd_start_12a, | ||
1167 | .stopN = sd_stopN, | ||
1168 | .stop0 = sd_stop0, | ||
1169 | .pkt_scan = sd_pkt_scan, | ||
1170 | /* .dq_callback = do_autogain, * fixme */ | ||
1171 | }; | ||
1172 | static const struct sd_desc sd_desc_72a = { | ||
973 | .name = MODULE_NAME, | 1173 | .name = MODULE_NAME, |
974 | .ctrls = sd_ctrls, | 1174 | .ctrls = sd_ctrls_72a, |
975 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1175 | .nctrls = ARRAY_SIZE(sd_ctrls_72a), |
976 | .config = sd_config, | 1176 | .config = sd_config, |
977 | .open = sd_open, | 1177 | .init = sd_init_72a, |
978 | .start = sd_start, | 1178 | .start = sd_start_72a, |
979 | .stopN = sd_stopN, | 1179 | .stopN = sd_stopN, |
980 | .stop0 = sd_stop0, | 1180 | .stop0 = sd_stop0, |
981 | .close = sd_close, | ||
982 | .pkt_scan = sd_pkt_scan, | 1181 | .pkt_scan = sd_pkt_scan, |
983 | .dq_callback = do_autogain, | 1182 | .dq_callback = do_autogain, |
984 | }; | 1183 | }; |
1184 | static const struct sd_desc *sd_desc[2] = { | ||
1185 | &sd_desc_12a, | ||
1186 | &sd_desc_72a | ||
1187 | }; | ||
985 | 1188 | ||
986 | /* -- module initialisation -- */ | 1189 | /* -- module initialisation -- */ |
987 | static const __devinitdata struct usb_device_id device_table[] = { | 1190 | static const __devinitdata struct usb_device_id device_table[] = { |
@@ -1009,7 +1212,9 @@ MODULE_DEVICE_TABLE(usb, device_table); | |||
1009 | static int sd_probe(struct usb_interface *intf, | 1212 | static int sd_probe(struct usb_interface *intf, |
1010 | const struct usb_device_id *id) | 1213 | const struct usb_device_id *id) |
1011 | { | 1214 | { |
1012 | return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), | 1215 | return gspca_dev_probe(intf, id, |
1216 | sd_desc[id->driver_info], | ||
1217 | sizeof(struct sd), | ||
1013 | THIS_MODULE); | 1218 | THIS_MODULE); |
1014 | } | 1219 | } |
1015 | 1220 | ||
@@ -1018,6 +1223,10 @@ static struct usb_driver sd_driver = { | |||
1018 | .id_table = device_table, | 1223 | .id_table = device_table, |
1019 | .probe = sd_probe, | 1224 | .probe = sd_probe, |
1020 | .disconnect = gspca_disconnect, | 1225 | .disconnect = gspca_disconnect, |
1226 | #ifdef CONFIG_PM | ||
1227 | .suspend = gspca_suspend, | ||
1228 | .resume = gspca_resume, | ||
1229 | #endif | ||
1021 | }; | 1230 | }; |
1022 | 1231 | ||
1023 | /* -- module insert / remove -- */ | 1232 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 16219cf6a6d5..2f2de429e273 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c | |||
@@ -306,8 +306,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | 308 | ||
309 | /* this function is called at open time */ | 309 | /* this function is called at probe and resume time */ |
310 | static int sd_open(struct gspca_dev *gspca_dev) | 310 | static int sd_init(struct gspca_dev *gspca_dev) |
311 | { | 311 | { |
312 | int ret; | 312 | int ret; |
313 | 313 | ||
@@ -398,14 +398,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
398 | PDEBUG(D_STREAM, "camera stopped"); | 398 | PDEBUG(D_STREAM, "camera stopped"); |
399 | } | 399 | } |
400 | 400 | ||
401 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
402 | { | ||
403 | } | ||
404 | |||
405 | static void sd_close(struct gspca_dev *gspca_dev) | ||
406 | { | ||
407 | } | ||
408 | |||
409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 401 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
410 | struct gspca_frame *frame, /* target */ | 402 | struct gspca_frame *frame, /* target */ |
411 | __u8 *data, /* isoc packet */ | 403 | __u8 *data, /* isoc packet */ |
@@ -535,11 +527,9 @@ static const struct sd_desc sd_desc = { | |||
535 | .ctrls = sd_ctrls, | 527 | .ctrls = sd_ctrls, |
536 | .nctrls = ARRAY_SIZE(sd_ctrls), | 528 | .nctrls = ARRAY_SIZE(sd_ctrls), |
537 | .config = sd_config, | 529 | .config = sd_config, |
538 | .open = sd_open, | 530 | .init = sd_init, |
539 | .start = sd_start, | 531 | .start = sd_start, |
540 | .stopN = sd_stopN, | 532 | .stopN = sd_stopN, |
541 | .stop0 = sd_stop0, | ||
542 | .close = sd_close, | ||
543 | .pkt_scan = sd_pkt_scan, | 533 | .pkt_scan = sd_pkt_scan, |
544 | .querymenu = sd_querymenu, | 534 | .querymenu = sd_querymenu, |
545 | }; | 535 | }; |
@@ -564,6 +554,10 @@ static struct usb_driver sd_driver = { | |||
564 | .id_table = device_table, | 554 | .id_table = device_table, |
565 | .probe = sd_probe, | 555 | .probe = sd_probe, |
566 | .disconnect = gspca_disconnect, | 556 | .disconnect = gspca_disconnect, |
557 | #ifdef CONFIG_PM | ||
558 | .suspend = gspca_suspend, | ||
559 | .resume = gspca_resume, | ||
560 | #endif | ||
567 | }; | 561 | }; |
568 | 562 | ||
569 | /* -- module insert / remove -- */ | 563 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index 54efa48bee01..1cfcc6c49558 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -449,31 +449,47 @@ static const __u8 qtable_spca504_default[2][64] = { | |||
449 | 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e} | 449 | 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e} |
450 | }; | 450 | }; |
451 | 451 | ||
452 | static void reg_r(struct usb_device *dev, | 452 | /* read <len> bytes to gspca_dev->usb_buf */ |
453 | __u16 req, | 453 | static void reg_r(struct gspca_dev *gspca_dev, |
454 | __u16 index, | 454 | __u16 req, |
455 | __u8 *buffer, __u16 length) | 455 | __u16 index, |
456 | __u16 len) | ||
456 | { | 457 | { |
457 | usb_control_msg(dev, | 458 | #ifdef GSPCA_DEBUG |
458 | usb_rcvctrlpipe(dev, 0), | 459 | if (len > USB_BUF_SZ) { |
460 | err("reg_r: buffer overflow"); | ||
461 | return; | ||
462 | } | ||
463 | #endif | ||
464 | usb_control_msg(gspca_dev->dev, | ||
465 | usb_rcvctrlpipe(gspca_dev->dev, 0), | ||
459 | req, | 466 | req, |
460 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 467 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
461 | 0, /* value */ | 468 | 0, /* value */ |
462 | index, buffer, length, | 469 | index, |
470 | len ? gspca_dev->usb_buf : NULL, len, | ||
463 | 500); | 471 | 500); |
464 | } | 472 | } |
465 | 473 | ||
466 | static void reg_w(struct usb_device *dev, | 474 | /* write <len> bytes from gspca_dev->usb_buf */ |
467 | __u16 req, | 475 | static void reg_w(struct gspca_dev *gspca_dev, |
468 | __u16 value, | 476 | __u16 req, |
469 | __u16 index, | 477 | __u16 value, |
470 | __u8 *buffer, __u16 length) | 478 | __u16 index, |
479 | __u16 len) | ||
471 | { | 480 | { |
472 | usb_control_msg(dev, | 481 | #ifdef GSPCA_DEBUG |
473 | usb_sndctrlpipe(dev, 0), | 482 | if (len > USB_BUF_SZ) { |
483 | err("reg_w: buffer overflow"); | ||
484 | return; | ||
485 | } | ||
486 | #endif | ||
487 | usb_control_msg(gspca_dev->dev, | ||
488 | usb_sndctrlpipe(gspca_dev->dev, 0), | ||
474 | req, | 489 | req, |
475 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 490 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
476 | value, index, buffer, length, | 491 | value, index, |
492 | len ? gspca_dev->usb_buf : NULL, len, | ||
477 | 500); | 493 | 500); |
478 | } | 494 | } |
479 | 495 | ||
@@ -634,7 +650,7 @@ static int spca504B_PollingDataReady(struct gspca_dev *gspca_dev) | |||
634 | int count = 10; | 650 | int count = 10; |
635 | 651 | ||
636 | while (--count > 0) { | 652 | while (--count > 0) { |
637 | reg_r(gspca_dev->dev, 0x21, 0, gspca_dev->usb_buf, 1); | 653 | reg_r(gspca_dev, 0x21, 0, 1); |
638 | if ((gspca_dev->usb_buf[0] & 0x01) == 0) | 654 | if ((gspca_dev->usb_buf[0] & 0x01) == 0) |
639 | break; | 655 | break; |
640 | msleep(10); | 656 | msleep(10); |
@@ -644,15 +660,14 @@ static int spca504B_PollingDataReady(struct gspca_dev *gspca_dev) | |||
644 | 660 | ||
645 | static void spca504B_WaitCmdStatus(struct gspca_dev *gspca_dev) | 661 | static void spca504B_WaitCmdStatus(struct gspca_dev *gspca_dev) |
646 | { | 662 | { |
647 | struct usb_device *dev = gspca_dev->dev; | ||
648 | int count = 50; | 663 | int count = 50; |
649 | 664 | ||
650 | while (--count > 0) { | 665 | while (--count > 0) { |
651 | reg_r(dev, 0x21, 1, gspca_dev->usb_buf, 1); | 666 | reg_r(gspca_dev, 0x21, 1, 1); |
652 | if (gspca_dev->usb_buf[0] != 0) { | 667 | if (gspca_dev->usb_buf[0] != 0) { |
653 | gspca_dev->usb_buf[0] = 0; | 668 | gspca_dev->usb_buf[0] = 0; |
654 | reg_w(dev, 0x21, 0, 1, gspca_dev->usb_buf, 1); | 669 | reg_w(gspca_dev, 0x21, 0, 1, 1); |
655 | reg_r(dev, 0x21, 1, gspca_dev->usb_buf, 1); | 670 | reg_r(gspca_dev, 0x21, 1, 1); |
656 | spca504B_PollingDataReady(gspca_dev); | 671 | spca504B_PollingDataReady(gspca_dev); |
657 | break; | 672 | break; |
658 | } | 673 | } |
@@ -662,16 +677,14 @@ static void spca504B_WaitCmdStatus(struct gspca_dev *gspca_dev) | |||
662 | 677 | ||
663 | static void spca50x_GetFirmware(struct gspca_dev *gspca_dev) | 678 | static void spca50x_GetFirmware(struct gspca_dev *gspca_dev) |
664 | { | 679 | { |
665 | struct usb_device *dev = gspca_dev->dev; | ||
666 | __u8 *data; | 680 | __u8 *data; |
667 | 681 | ||
668 | data = kmalloc(64, GFP_KERNEL); | 682 | data = gspca_dev->usb_buf; |
669 | reg_r(dev, 0x20, 0, data, 5); | 683 | reg_r(gspca_dev, 0x20, 0, 5); |
670 | PDEBUG(D_STREAM, "FirmWare : %d %d %d %d %d ", | 684 | PDEBUG(D_STREAM, "FirmWare : %d %d %d %d %d ", |
671 | data[0], data[1], data[2], data[3], data[4]); | 685 | data[0], data[1], data[2], data[3], data[4]); |
672 | reg_r(dev, 0x23, 0, data, 64); | 686 | reg_r(gspca_dev, 0x23, 0, 64); |
673 | reg_r(dev, 0x23, 1, data, 64); | 687 | reg_r(gspca_dev, 0x23, 1, 64); |
674 | kfree(data); | ||
675 | } | 688 | } |
676 | 689 | ||
677 | static void spca504B_SetSizeType(struct gspca_dev *gspca_dev) | 690 | static void spca504B_SetSizeType(struct gspca_dev *gspca_dev) |
@@ -686,21 +699,21 @@ static void spca504B_SetSizeType(struct gspca_dev *gspca_dev) | |||
686 | Type = 0; | 699 | Type = 0; |
687 | switch (sd->bridge) { | 700 | switch (sd->bridge) { |
688 | case BRIDGE_SPCA533: | 701 | case BRIDGE_SPCA533: |
689 | reg_w(dev, 0x31, 0, 0, NULL, 0); | 702 | reg_w(gspca_dev, 0x31, 0, 0, 0); |
690 | spca504B_WaitCmdStatus(gspca_dev); | 703 | spca504B_WaitCmdStatus(gspca_dev); |
691 | rc = spca504B_PollingDataReady(gspca_dev); | 704 | rc = spca504B_PollingDataReady(gspca_dev); |
692 | spca50x_GetFirmware(gspca_dev); | 705 | spca50x_GetFirmware(gspca_dev); |
693 | gspca_dev->usb_buf[0] = 2; /* type */ | 706 | gspca_dev->usb_buf[0] = 2; /* type */ |
694 | reg_w(dev, 0x24, 0, 8, gspca_dev->usb_buf, 1); | 707 | reg_w(gspca_dev, 0x24, 0, 8, 1); |
695 | reg_r(dev, 0x24, 8, gspca_dev->usb_buf, 1); | 708 | reg_r(gspca_dev, 0x24, 8, 1); |
696 | 709 | ||
697 | gspca_dev->usb_buf[0] = Size; | 710 | gspca_dev->usb_buf[0] = Size; |
698 | reg_w(dev, 0x25, 0, 4, gspca_dev->usb_buf, 1); | 711 | reg_w(gspca_dev, 0x25, 0, 4, 1); |
699 | reg_r(dev, 0x25, 4, gspca_dev->usb_buf, 1); /* size */ | 712 | reg_r(gspca_dev, 0x25, 4, 1); /* size */ |
700 | rc = spca504B_PollingDataReady(gspca_dev); | 713 | rc = spca504B_PollingDataReady(gspca_dev); |
701 | 714 | ||
702 | /* Init the cam width height with some values get on init ? */ | 715 | /* Init the cam width height with some values get on init ? */ |
703 | reg_w(dev, 0x31, 0, 4, NULL, 0); | 716 | reg_w(gspca_dev, 0x31, 0, 4, 0); |
704 | spca504B_WaitCmdStatus(gspca_dev); | 717 | spca504B_WaitCmdStatus(gspca_dev); |
705 | rc = spca504B_PollingDataReady(gspca_dev); | 718 | rc = spca504B_PollingDataReady(gspca_dev); |
706 | break; | 719 | break; |
@@ -708,12 +721,12 @@ static void spca504B_SetSizeType(struct gspca_dev *gspca_dev) | |||
708 | /* case BRIDGE_SPCA504B: */ | 721 | /* case BRIDGE_SPCA504B: */ |
709 | /* case BRIDGE_SPCA536: */ | 722 | /* case BRIDGE_SPCA536: */ |
710 | gspca_dev->usb_buf[0] = Size; | 723 | gspca_dev->usb_buf[0] = Size; |
711 | reg_w(dev, 0x25, 0, 4, gspca_dev->usb_buf, 1); | 724 | reg_w(gspca_dev, 0x25, 0, 4, 1); |
712 | reg_r(dev, 0x25, 4, gspca_dev->usb_buf, 1); /* size */ | 725 | reg_r(gspca_dev, 0x25, 4, 1); /* size */ |
713 | Type = 6; | 726 | Type = 6; |
714 | gspca_dev->usb_buf[0] = Type; | 727 | gspca_dev->usb_buf[0] = Type; |
715 | reg_w(dev, 0x27, 0, 0, gspca_dev->usb_buf, 1); | 728 | reg_w(gspca_dev, 0x27, 0, 0, 1); |
716 | reg_r(dev, 0x27, 0, gspca_dev->usb_buf, 1); /* type */ | 729 | reg_r(gspca_dev, 0x27, 0, 1); /* type */ |
717 | rc = spca504B_PollingDataReady(gspca_dev); | 730 | rc = spca504B_PollingDataReady(gspca_dev); |
718 | break; | 731 | break; |
719 | case BRIDGE_SPCA504: | 732 | case BRIDGE_SPCA504: |
@@ -752,18 +765,15 @@ static void spca504_wait_status(struct gspca_dev *gspca_dev) | |||
752 | 765 | ||
753 | static void spca504B_setQtable(struct gspca_dev *gspca_dev) | 766 | static void spca504B_setQtable(struct gspca_dev *gspca_dev) |
754 | { | 767 | { |
755 | struct usb_device *dev = gspca_dev->dev; | ||
756 | |||
757 | gspca_dev->usb_buf[0] = 3; | 768 | gspca_dev->usb_buf[0] = 3; |
758 | reg_w(dev, 0x26, 0, 0, gspca_dev->usb_buf, 1); | 769 | reg_w(gspca_dev, 0x26, 0, 0, 1); |
759 | reg_r(dev, 0x26, 0, gspca_dev->usb_buf, 1); | 770 | reg_r(gspca_dev, 0x26, 0, 1); |
760 | spca504B_PollingDataReady(gspca_dev); | 771 | spca504B_PollingDataReady(gspca_dev); |
761 | } | 772 | } |
762 | 773 | ||
763 | static void sp5xx_initContBrigHueRegisters(struct gspca_dev *gspca_dev) | 774 | static void sp5xx_initContBrigHueRegisters(struct gspca_dev *gspca_dev) |
764 | { | 775 | { |
765 | struct sd *sd = (struct sd *) gspca_dev; | 776 | struct sd *sd = (struct sd *) gspca_dev; |
766 | struct usb_device *dev = gspca_dev->dev; | ||
767 | int pollreg = 1; | 777 | int pollreg = 1; |
768 | 778 | ||
769 | switch (sd->bridge) { | 779 | switch (sd->bridge) { |
@@ -774,20 +784,20 @@ static void sp5xx_initContBrigHueRegisters(struct gspca_dev *gspca_dev) | |||
774 | default: | 784 | default: |
775 | /* case BRIDGE_SPCA533: */ | 785 | /* case BRIDGE_SPCA533: */ |
776 | /* case BRIDGE_SPCA504B: */ | 786 | /* case BRIDGE_SPCA504B: */ |
777 | reg_w(dev, 0, 0, 0x21a7, NULL, 0); /* brightness */ | 787 | reg_w(gspca_dev, 0, 0, 0x21a7, 0); /* brightness */ |
778 | reg_w(dev, 0, 0x20, 0x21a8, NULL, 0); /* contrast */ | 788 | reg_w(gspca_dev, 0, 0x20, 0x21a8, 0); /* contrast */ |
779 | reg_w(dev, 0, 0, 0x21ad, NULL, 0); /* hue */ | 789 | reg_w(gspca_dev, 0, 0, 0x21ad, 0); /* hue */ |
780 | reg_w(dev, 0, 1, 0x21ac, NULL, 0); /* sat/hue */ | 790 | reg_w(gspca_dev, 0, 1, 0x21ac, 0); /* sat/hue */ |
781 | reg_w(dev, 0, 0x20, 0x21ae, NULL, 0); /* saturation */ | 791 | reg_w(gspca_dev, 0, 0x20, 0x21ae, 0); /* saturation */ |
782 | reg_w(dev, 0, 0, 0x21a3, NULL, 0); /* gamma */ | 792 | reg_w(gspca_dev, 0, 0, 0x21a3, 0); /* gamma */ |
783 | break; | 793 | break; |
784 | case BRIDGE_SPCA536: | 794 | case BRIDGE_SPCA536: |
785 | reg_w(dev, 0, 0, 0x20f0, NULL, 0); | 795 | reg_w(gspca_dev, 0, 0, 0x20f0, 0); |
786 | reg_w(dev, 0, 0x21, 0x20f1, NULL, 0); | 796 | reg_w(gspca_dev, 0, 0x21, 0x20f1, 0); |
787 | reg_w(dev, 0, 0x40, 0x20f5, NULL, 0); | 797 | reg_w(gspca_dev, 0, 0x40, 0x20f5, 0); |
788 | reg_w(dev, 0, 1, 0x20f4, NULL, 0); | 798 | reg_w(gspca_dev, 0, 1, 0x20f4, 0); |
789 | reg_w(dev, 0, 0x40, 0x20f6, NULL, 0); | 799 | reg_w(gspca_dev, 0, 0x40, 0x20f6, 0); |
790 | reg_w(dev, 0, 0, 0x2089, NULL, 0); | 800 | reg_w(gspca_dev, 0, 0, 0x2089, 0); |
791 | break; | 801 | break; |
792 | } | 802 | } |
793 | if (pollreg) | 803 | if (pollreg) |
@@ -799,7 +809,6 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
799 | const struct usb_device_id *id) | 809 | const struct usb_device_id *id) |
800 | { | 810 | { |
801 | struct sd *sd = (struct sd *) gspca_dev; | 811 | struct sd *sd = (struct sd *) gspca_dev; |
802 | struct usb_device *dev = gspca_dev->dev; | ||
803 | struct cam *cam; | 812 | struct cam *cam; |
804 | 813 | ||
805 | cam = &gspca_dev->cam; | 814 | cam = &gspca_dev->cam; |
@@ -811,7 +820,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
811 | if (sd->subtype == AiptekMiniPenCam13) { | 820 | if (sd->subtype == AiptekMiniPenCam13) { |
812 | /* try to get the firmware as some cam answer 2.0.1.2.2 | 821 | /* try to get the firmware as some cam answer 2.0.1.2.2 |
813 | * and should be a spca504b then overwrite that setting */ | 822 | * and should be a spca504b then overwrite that setting */ |
814 | reg_r(dev, 0x20, 0, gspca_dev->usb_buf, 1); | 823 | reg_r(gspca_dev, 0x20, 0, 1); |
815 | switch (gspca_dev->usb_buf[0]) { | 824 | switch (gspca_dev->usb_buf[0]) { |
816 | case 1: | 825 | case 1: |
817 | break; /* (right bridge/subtype) */ | 826 | break; /* (right bridge/subtype) */ |
@@ -848,8 +857,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
848 | return 0; | 857 | return 0; |
849 | } | 858 | } |
850 | 859 | ||
851 | /* this function is called at open time */ | 860 | /* this function is called at probe and resume time */ |
852 | static int sd_open(struct gspca_dev *gspca_dev) | 861 | static int sd_init(struct gspca_dev *gspca_dev) |
853 | { | 862 | { |
854 | struct sd *sd = (struct sd *) gspca_dev; | 863 | struct sd *sd = (struct sd *) gspca_dev; |
855 | struct usb_device *dev = gspca_dev->dev; | 864 | struct usb_device *dev = gspca_dev->dev; |
@@ -860,12 +869,12 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
860 | 869 | ||
861 | switch (sd->bridge) { | 870 | switch (sd->bridge) { |
862 | case BRIDGE_SPCA504B: | 871 | case BRIDGE_SPCA504B: |
863 | reg_w(dev, 0x1d, 0, 0, NULL, 0); | 872 | reg_w(gspca_dev, 0x1d, 0, 0, 0); |
864 | reg_w(dev, 0, 1, 0x2306, NULL, 0); | 873 | reg_w(gspca_dev, 0, 1, 0x2306, 0); |
865 | reg_w(dev, 0, 0, 0x0d04, NULL, 0); | 874 | reg_w(gspca_dev, 0, 0, 0x0d04, 0); |
866 | reg_w(dev, 0, 0, 0x2000, NULL, 0); | 875 | reg_w(gspca_dev, 0, 0, 0x2000, 0); |
867 | reg_w(dev, 0, 0x13, 0x2301, NULL, 0); | 876 | reg_w(gspca_dev, 0, 0x13, 0x2301, 0); |
868 | reg_w(dev, 0, 0, 0x2306, NULL, 0); | 877 | reg_w(gspca_dev, 0, 0, 0x2306, 0); |
869 | /* fall thru */ | 878 | /* fall thru */ |
870 | case BRIDGE_SPCA533: | 879 | case BRIDGE_SPCA533: |
871 | rc = spca504B_PollingDataReady(gspca_dev); | 880 | rc = spca504B_PollingDataReady(gspca_dev); |
@@ -873,12 +882,12 @@ static int sd_open(struct gspca_dev *gspca_dev) | |||
873 | break; | 882 | break; |
874 | case BRIDGE_SPCA536: | 883 | case BRIDGE_SPCA536: |
875 | spca50x_GetFirmware(gspca_dev); | 884 | spca50x_GetFirmware(gspca_dev); |
876 | reg_r(dev, 0x00, 0x5002, gspca_dev->usb_buf, 1); | 885 | reg_r(gspca_dev, 0x00, 0x5002, 1); |
877 | gspca_dev->usb_buf[0] = 0; | 886 | gspca_dev->usb_buf[0] = 0; |
878 | reg_w(dev, 0x24, 0, 0, gspca_dev->usb_buf, 1); | 887 | reg_w(gspca_dev, 0x24, 0, 0, 1); |
879 | reg_r(dev, 0x24, 0, gspca_dev->usb_buf, 1); | 888 | reg_r(gspca_dev, 0x24, 0, 1); |
880 | rc = spca504B_PollingDataReady(gspca_dev); | 889 | rc = spca504B_PollingDataReady(gspca_dev); |
881 | reg_w(dev, 0x34, 0, 0, NULL, 0); | 890 | reg_w(gspca_dev, 0x34, 0, 0, 0); |
882 | spca504B_WaitCmdStatus(gspca_dev); | 891 | spca504B_WaitCmdStatus(gspca_dev); |
883 | break; | 892 | break; |
884 | case BRIDGE_SPCA504C: /* pccam600 */ | 893 | case BRIDGE_SPCA504C: /* pccam600 */ |
@@ -971,12 +980,12 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
971 | /* case BRIDGE_SPCA536: */ | 980 | /* case BRIDGE_SPCA536: */ |
972 | if (sd->subtype == MegapixV4 || | 981 | if (sd->subtype == MegapixV4 || |
973 | sd->subtype == LogitechClickSmart820) { | 982 | sd->subtype == LogitechClickSmart820) { |
974 | reg_w(dev, 0xf0, 0, 0, NULL, 0); | 983 | reg_w(gspca_dev, 0xf0, 0, 0, 0); |
975 | spca504B_WaitCmdStatus(gspca_dev); | 984 | spca504B_WaitCmdStatus(gspca_dev); |
976 | reg_r(dev, 0xf0, 4, NULL, 0); | 985 | reg_r(gspca_dev, 0xf0, 4, 0); |
977 | spca504B_WaitCmdStatus(gspca_dev); | 986 | spca504B_WaitCmdStatus(gspca_dev); |
978 | } else { | 987 | } else { |
979 | reg_w(dev, 0x31, 0, 4, NULL, 0); | 988 | reg_w(gspca_dev, 0x31, 0, 4, 0); |
980 | spca504B_WaitCmdStatus(gspca_dev); | 989 | spca504B_WaitCmdStatus(gspca_dev); |
981 | rc = spca504B_PollingDataReady(gspca_dev); | 990 | rc = spca504B_PollingDataReady(gspca_dev); |
982 | } | 991 | } |
@@ -1045,7 +1054,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1045 | /* case BRIDGE_SPCA533: */ | 1054 | /* case BRIDGE_SPCA533: */ |
1046 | /* case BRIDGE_SPCA536: */ | 1055 | /* case BRIDGE_SPCA536: */ |
1047 | /* case BRIDGE_SPCA504B: */ | 1056 | /* case BRIDGE_SPCA504B: */ |
1048 | reg_w(dev, 0x31, 0, 0, NULL, 0); | 1057 | reg_w(gspca_dev, 0x31, 0, 0, 0); |
1049 | spca504B_WaitCmdStatus(gspca_dev); | 1058 | spca504B_WaitCmdStatus(gspca_dev); |
1050 | spca504B_PollingDataReady(gspca_dev); | 1059 | spca504B_PollingDataReady(gspca_dev); |
1051 | break; | 1060 | break; |
@@ -1069,14 +1078,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
1069 | } | 1078 | } |
1070 | } | 1079 | } |
1071 | 1080 | ||
1072 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
1073 | { | ||
1074 | } | ||
1075 | |||
1076 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1077 | { | ||
1078 | } | ||
1079 | |||
1080 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1081 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1081 | struct gspca_frame *frame, /* target */ | 1082 | struct gspca_frame *frame, /* target */ |
1082 | __u8 *data, /* isoc packet */ | 1083 | __u8 *data, /* isoc packet */ |
@@ -1369,11 +1370,9 @@ static const struct sd_desc sd_desc = { | |||
1369 | .ctrls = sd_ctrls, | 1370 | .ctrls = sd_ctrls, |
1370 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1371 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1371 | .config = sd_config, | 1372 | .config = sd_config, |
1372 | .open = sd_open, | 1373 | .init = sd_init, |
1373 | .start = sd_start, | 1374 | .start = sd_start, |
1374 | .stopN = sd_stopN, | 1375 | .stopN = sd_stopN, |
1375 | .stop0 = sd_stop0, | ||
1376 | .close = sd_close, | ||
1377 | .pkt_scan = sd_pkt_scan, | 1376 | .pkt_scan = sd_pkt_scan, |
1378 | }; | 1377 | }; |
1379 | 1378 | ||
@@ -1456,6 +1455,10 @@ static struct usb_driver sd_driver = { | |||
1456 | .id_table = device_table, | 1455 | .id_table = device_table, |
1457 | .probe = sd_probe, | 1456 | .probe = sd_probe, |
1458 | .disconnect = gspca_disconnect, | 1457 | .disconnect = gspca_disconnect, |
1458 | #ifdef CONFIG_PM | ||
1459 | .suspend = gspca_suspend, | ||
1460 | .resume = gspca_resume, | ||
1461 | #endif | ||
1459 | }; | 1462 | }; |
1460 | 1463 | ||
1461 | /* -- module insert / remove -- */ | 1464 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index 91b555c34c68..f034c748fc7e 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | #define MAX_GAMMA 0x10 /* 0 to 15 */ | 31 | #define MAX_GAMMA 0x10 /* 0 to 15 */ |
32 | 32 | ||
33 | #define V4L2_CID_EFFECTS (V4L2_CID_PRIVATE_BASE + 3) | 33 | #define V4L2_CID_EFFECTS (V4L2_CID_PRIVATE_BASE + 0) |
34 | 34 | ||
35 | MODULE_AUTHOR("Leandro Costantino <le_costantino@pixartargentina.com.ar>"); | 35 | MODULE_AUTHOR("Leandro Costantino <le_costantino@pixartargentina.com.ar>"); |
36 | MODULE_DESCRIPTION("GSPCA/T613 (JPEG Compliance) USB Camera Driver"); | 36 | MODULE_DESCRIPTION("GSPCA/T613 (JPEG Compliance) USB Camera Driver"); |
@@ -233,7 +233,7 @@ static char *effects_control[] = { | |||
233 | static struct v4l2_pix_format vga_mode_t16[] = { | 233 | static struct v4l2_pix_format vga_mode_t16[] = { |
234 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 234 | {160, 120, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
235 | .bytesperline = 160, | 235 | .bytesperline = 160, |
236 | .sizeimage = 160 * 120 * 3 / 8 + 590, | 236 | .sizeimage = 160 * 120 * 4 / 8 + 590, |
237 | .colorspace = V4L2_COLORSPACE_JPEG, | 237 | .colorspace = V4L2_COLORSPACE_JPEG, |
238 | .priv = 4}, | 238 | .priv = 4}, |
239 | {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, | 239 | {176, 144, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, |
@@ -391,7 +391,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
391 | NULL, 0, 500); | 391 | NULL, 0, 500); |
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | if (len <= sizeof gspca_dev->usb_buf) { | 394 | if (len <= USB_BUF_SZ) { |
395 | memcpy(gspca_dev->usb_buf, buffer, len); | 395 | memcpy(gspca_dev->usb_buf, buffer, len); |
396 | usb_control_msg(gspca_dev->dev, | 396 | usb_control_msg(gspca_dev->dev, |
397 | usb_sndctrlpipe(gspca_dev->dev, 0), | 397 | usb_sndctrlpipe(gspca_dev->dev, 0), |
@@ -552,6 +552,13 @@ static int init_default_parameters(struct gspca_dev *gspca_dev) | |||
552 | return 0; | 552 | return 0; |
553 | } | 553 | } |
554 | 554 | ||
555 | /* this function is called at probe and resume time */ | ||
556 | static int sd_init(struct gspca_dev *gspca_dev) | ||
557 | { | ||
558 | init_default_parameters(gspca_dev); | ||
559 | return 0; | ||
560 | } | ||
561 | |||
555 | static void setbrightness(struct gspca_dev *gspca_dev) | 562 | static void setbrightness(struct gspca_dev *gspca_dev) |
556 | { | 563 | { |
557 | struct sd *sd = (struct sd *) gspca_dev; | 564 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -893,18 +900,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
893 | setcolors(gspca_dev); | 900 | setcolors(gspca_dev); |
894 | } | 901 | } |
895 | 902 | ||
896 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
897 | { | ||
898 | } | ||
899 | |||
900 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
901 | { | ||
902 | } | ||
903 | |||
904 | static void sd_close(struct gspca_dev *gspca_dev) | ||
905 | { | ||
906 | } | ||
907 | |||
908 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 903 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
909 | struct gspca_frame *frame, /* target */ | 904 | struct gspca_frame *frame, /* target */ |
910 | __u8 *data, /* isoc packet */ | 905 | __u8 *data, /* isoc packet */ |
@@ -972,24 +967,14 @@ static int sd_querymenu(struct gspca_dev *gspca_dev, | |||
972 | return -EINVAL; | 967 | return -EINVAL; |
973 | } | 968 | } |
974 | 969 | ||
975 | /* this function is called at open time */ | ||
976 | static int sd_open(struct gspca_dev *gspca_dev) | ||
977 | { | ||
978 | init_default_parameters(gspca_dev); | ||
979 | return 0; | ||
980 | } | ||
981 | |||
982 | /* sub-driver description */ | 970 | /* sub-driver description */ |
983 | static const struct sd_desc sd_desc = { | 971 | static const struct sd_desc sd_desc = { |
984 | .name = MODULE_NAME, | 972 | .name = MODULE_NAME, |
985 | .ctrls = sd_ctrls, | 973 | .ctrls = sd_ctrls, |
986 | .nctrls = ARRAY_SIZE(sd_ctrls), | 974 | .nctrls = ARRAY_SIZE(sd_ctrls), |
987 | .config = sd_config, | 975 | .config = sd_config, |
988 | .open = sd_open, | 976 | .init = sd_init, |
989 | .start = sd_start, | 977 | .start = sd_start, |
990 | .stopN = sd_stopN, | ||
991 | .stop0 = sd_stop0, | ||
992 | .close = sd_close, | ||
993 | .pkt_scan = sd_pkt_scan, | 978 | .pkt_scan = sd_pkt_scan, |
994 | .querymenu = sd_querymenu, | 979 | .querymenu = sd_querymenu, |
995 | }; | 980 | }; |
@@ -1014,6 +999,10 @@ static struct usb_driver sd_driver = { | |||
1014 | .id_table = device_table, | 999 | .id_table = device_table, |
1015 | .probe = sd_probe, | 1000 | .probe = sd_probe, |
1016 | .disconnect = gspca_disconnect, | 1001 | .disconnect = gspca_disconnect, |
1002 | #ifdef CONFIG_PM | ||
1003 | .suspend = gspca_suspend, | ||
1004 | .resume = gspca_resume, | ||
1005 | #endif | ||
1017 | }; | 1006 | }; |
1018 | 1007 | ||
1019 | /* -- module insert / remove -- */ | 1008 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c index 1ff8ba2f7fe5..084af05302a0 100644 --- a/drivers/media/video/gspca/tv8532.c +++ b/drivers/media/video/gspca/tv8532.c | |||
@@ -331,8 +331,8 @@ static void tv_8532_PollReg(struct gspca_dev *gspca_dev) | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | /* this function is called at open time */ | 334 | /* this function is called at probe and resume time */ |
335 | static int sd_open(struct gspca_dev *gspca_dev) | 335 | static int sd_init(struct gspca_dev *gspca_dev) |
336 | { | 336 | { |
337 | reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32); | 337 | reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32); |
338 | reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00); | 338 | reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00); |
@@ -450,14 +450,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
450 | reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b); | 450 | reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b); |
451 | } | 451 | } |
452 | 452 | ||
453 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
454 | { | ||
455 | } | ||
456 | |||
457 | static void sd_close(struct gspca_dev *gspca_dev) | ||
458 | { | ||
459 | } | ||
460 | |||
461 | static void tv8532_preprocess(struct gspca_dev *gspca_dev) | 453 | static void tv8532_preprocess(struct gspca_dev *gspca_dev) |
462 | { | 454 | { |
463 | struct sd *sd = (struct sd *) gspca_dev; | 455 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -611,11 +603,9 @@ static const struct sd_desc sd_desc = { | |||
611 | .ctrls = sd_ctrls, | 603 | .ctrls = sd_ctrls, |
612 | .nctrls = ARRAY_SIZE(sd_ctrls), | 604 | .nctrls = ARRAY_SIZE(sd_ctrls), |
613 | .config = sd_config, | 605 | .config = sd_config, |
614 | .open = sd_open, | 606 | .init = sd_init, |
615 | .start = sd_start, | 607 | .start = sd_start, |
616 | .stopN = sd_stopN, | 608 | .stopN = sd_stopN, |
617 | .stop0 = sd_stop0, | ||
618 | .close = sd_close, | ||
619 | .pkt_scan = sd_pkt_scan, | 609 | .pkt_scan = sd_pkt_scan, |
620 | }; | 610 | }; |
621 | 611 | ||
@@ -644,6 +634,10 @@ static struct usb_driver sd_driver = { | |||
644 | .id_table = device_table, | 634 | .id_table = device_table, |
645 | .probe = sd_probe, | 635 | .probe = sd_probe, |
646 | .disconnect = gspca_disconnect, | 636 | .disconnect = gspca_disconnect, |
637 | #ifdef CONFIG_PM | ||
638 | .suspend = gspca_suspend, | ||
639 | .resume = gspca_resume, | ||
640 | #endif | ||
647 | }; | 641 | }; |
648 | 642 | ||
649 | /* -- module insert / remove -- */ | 643 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index f4a52956e0d9..bd4c226c9a07 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -69,6 +69,7 @@ static struct ctrl sd_ctrls[] = { | |||
69 | .set = sd_setautogain, | 69 | .set = sd_setautogain, |
70 | .get = sd_getautogain, | 70 | .get = sd_getautogain, |
71 | }, | 71 | }, |
72 | #define LIGHTFREQ_IDX 1 | ||
72 | { | 73 | { |
73 | { | 74 | { |
74 | .id = V4L2_CID_POWER_LINE_FREQUENCY, | 75 | .id = V4L2_CID_POWER_LINE_FREQUENCY, |
@@ -87,12 +88,12 @@ static struct ctrl sd_ctrls[] = { | |||
87 | }; | 88 | }; |
88 | 89 | ||
89 | static struct v4l2_pix_format vc0321_mode[] = { | 90 | static struct v4l2_pix_format vc0321_mode[] = { |
90 | {320, 240, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, | 91 | {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE, |
91 | .bytesperline = 320, | 92 | .bytesperline = 320, |
92 | .sizeimage = 320 * 240 * 2, | 93 | .sizeimage = 320 * 240 * 2, |
93 | .colorspace = V4L2_COLORSPACE_SRGB, | 94 | .colorspace = V4L2_COLORSPACE_SRGB, |
94 | .priv = 1}, | 95 | .priv = 1}, |
95 | {640, 480, V4L2_PIX_FMT_YUV420, V4L2_FIELD_NONE, | 96 | {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE, |
96 | .bytesperline = 640, | 97 | .bytesperline = 640, |
97 | .sizeimage = 640 * 480 * 2, | 98 | .sizeimage = 640 * 480 * 2, |
98 | .colorspace = V4L2_COLORSPACE_SRGB, | 99 | .colorspace = V4L2_COLORSPACE_SRGB, |
@@ -1463,6 +1464,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1463 | sd->qindex = 7; | 1464 | sd->qindex = 7; |
1464 | sd->autogain = AUTOGAIN_DEF; | 1465 | sd->autogain = AUTOGAIN_DEF; |
1465 | sd->lightfreq = FREQ_DEF; | 1466 | sd->lightfreq = FREQ_DEF; |
1467 | if (sd->sensor != SENSOR_OV7670) | ||
1468 | gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX); | ||
1466 | 1469 | ||
1467 | if (sd->bridge == BRIDGE_VC0321) { | 1470 | if (sd->bridge == BRIDGE_VC0321) { |
1468 | reg_r(gspca_dev, 0x8a, 0, 3); | 1471 | reg_r(gspca_dev, 0x8a, 0, 3); |
@@ -1474,8 +1477,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1474 | return 0; | 1477 | return 0; |
1475 | } | 1478 | } |
1476 | 1479 | ||
1477 | /* this function is called at open time */ | 1480 | /* this function is called at probe and time */ |
1478 | static int sd_open(struct gspca_dev *gspca_dev) | 1481 | static int sd_init(struct gspca_dev *gspca_dev) |
1479 | { | 1482 | { |
1480 | return 0; | 1483 | return 0; |
1481 | } | 1484 | } |
@@ -1637,19 +1640,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
1637 | reg_w(dev, 0x89, 0xffff, 0xffff); | 1640 | reg_w(dev, 0x89, 0xffff, 0xffff); |
1638 | } | 1641 | } |
1639 | 1642 | ||
1640 | /* this function is called at close time */ | ||
1641 | static void sd_close(struct gspca_dev *gspca_dev) | ||
1642 | { | ||
1643 | /* struct usb_device *dev = gspca_dev->dev; | ||
1644 | __u8 buffread; | ||
1645 | |||
1646 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1647 | reg_w(dev, 0xa0, 0x01, 0xb301); | ||
1648 | reg_w(dev, 0xa0, 0x09, 0xb303); | ||
1649 | reg_w(dev, 0x89, 0xffff, 0xffff); | ||
1650 | */ | ||
1651 | } | ||
1652 | |||
1653 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 1643 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
1654 | struct gspca_frame *frame, /* target */ | 1644 | struct gspca_frame *frame, /* target */ |
1655 | __u8 *data, /* isoc packet */ | 1645 | __u8 *data, /* isoc packet */ |
@@ -1738,11 +1728,10 @@ static const struct sd_desc sd_desc = { | |||
1738 | .ctrls = sd_ctrls, | 1728 | .ctrls = sd_ctrls, |
1739 | .nctrls = ARRAY_SIZE(sd_ctrls), | 1729 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1740 | .config = sd_config, | 1730 | .config = sd_config, |
1741 | .open = sd_open, | 1731 | .init = sd_init, |
1742 | .start = sd_start, | 1732 | .start = sd_start, |
1743 | .stopN = sd_stopN, | 1733 | .stopN = sd_stopN, |
1744 | .stop0 = sd_stop0, | 1734 | .stop0 = sd_stop0, |
1745 | .close = sd_close, | ||
1746 | .pkt_scan = sd_pkt_scan, | 1735 | .pkt_scan = sd_pkt_scan, |
1747 | .querymenu = sd_querymenu, | 1736 | .querymenu = sd_querymenu, |
1748 | }; | 1737 | }; |
@@ -1774,6 +1763,10 @@ static struct usb_driver sd_driver = { | |||
1774 | .id_table = device_table, | 1763 | .id_table = device_table, |
1775 | .probe = sd_probe, | 1764 | .probe = sd_probe, |
1776 | .disconnect = gspca_disconnect, | 1765 | .disconnect = gspca_disconnect, |
1766 | #ifdef CONFIG_PM | ||
1767 | .suspend = gspca_suspend, | ||
1768 | .resume = gspca_resume, | ||
1769 | #endif | ||
1777 | }; | 1770 | }; |
1778 | 1771 | ||
1779 | /* -- module insert / remove -- */ | 1772 | /* -- module insert / remove -- */ |
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index bc7d0eedcd81..8d7c27e6ac77 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -85,6 +85,7 @@ static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val); | |||
85 | static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val); | 85 | static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val); |
86 | 86 | ||
87 | static struct ctrl sd_ctrls[] = { | 87 | static struct ctrl sd_ctrls[] = { |
88 | #define BRIGHTNESS_IDX 0 | ||
88 | #define SD_BRIGHTNESS 0 | 89 | #define SD_BRIGHTNESS 0 |
89 | { | 90 | { |
90 | { | 91 | { |
@@ -141,6 +142,7 @@ static struct ctrl sd_ctrls[] = { | |||
141 | .set = sd_setautogain, | 142 | .set = sd_setautogain, |
142 | .get = sd_getautogain, | 143 | .get = sd_getautogain, |
143 | }, | 144 | }, |
145 | #define LIGHTFREQ_IDX 4 | ||
144 | #define SD_FREQ 4 | 146 | #define SD_FREQ 4 |
145 | { | 147 | { |
146 | { | 148 | { |
@@ -6964,8 +6966,13 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev) | |||
6964 | case SENSOR_MC501CB: | 6966 | case SENSOR_MC501CB: |
6965 | return -1; /* don't probe */ | 6967 | return -1; /* don't probe */ |
6966 | case SENSOR_TAS5130C_VF0250: | 6968 | case SENSOR_TAS5130C_VF0250: |
6967 | /* may probe but with write in reg 0x0010 */ | 6969 | /* may probe but with no write in reg 0x0010 */ |
6968 | return -1; /* don't probe */ | 6970 | return -1; /* don't probe */ |
6971 | case SENSOR_PAS106: | ||
6972 | sensor = sif_probe(gspca_dev); | ||
6973 | if (sensor >= 0) | ||
6974 | return sensor; | ||
6975 | break; | ||
6969 | } | 6976 | } |
6970 | sensor = vga_2wr_probe(gspca_dev); | 6977 | sensor = vga_2wr_probe(gspca_dev); |
6971 | if (sensor >= 0) { | 6978 | if (sensor >= 0) { |
@@ -6974,12 +6981,10 @@ static int zcxx_probeSensor(struct gspca_dev *gspca_dev) | |||
6974 | /* next probe is needed for OmniVision ? */ | 6981 | /* next probe is needed for OmniVision ? */ |
6975 | } | 6982 | } |
6976 | sensor2 = vga_3wr_probe(gspca_dev); | 6983 | sensor2 = vga_3wr_probe(gspca_dev); |
6977 | if (sensor2 >= 0) { | 6984 | if (sensor2 >= 0 |
6978 | if (sensor >= 0) | 6985 | && sensor >= 0) |
6979 | return sensor; | 6986 | return sensor; |
6980 | return sensor2; | 6987 | return sensor2; |
6981 | } | ||
6982 | return sif_probe(gspca_dev); | ||
6983 | } | 6988 | } |
6984 | 6989 | ||
6985 | /* this function is called at probe time */ | 6990 | /* this function is called at probe time */ |
@@ -7147,13 +7152,27 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
7147 | sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value; | 7152 | sd->lightfreq = sd_ctrls[SD_FREQ].qctrl.default_value; |
7148 | sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value; | 7153 | sd->sharpness = sd_ctrls[SD_SHARPNESS].qctrl.default_value; |
7149 | 7154 | ||
7155 | switch (sd->sensor) { | ||
7156 | case SENSOR_GC0305: | ||
7157 | case SENSOR_OV7620: | ||
7158 | case SENSOR_PO2030: | ||
7159 | gspca_dev->ctrl_dis = (1 << BRIGHTNESS_IDX); | ||
7160 | break; | ||
7161 | case SENSOR_HDCS2020: | ||
7162 | case SENSOR_HV7131B: | ||
7163 | case SENSOR_HV7131C: | ||
7164 | case SENSOR_OV7630C: | ||
7165 | gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX); | ||
7166 | break; | ||
7167 | } | ||
7168 | |||
7150 | /* switch the led off */ | 7169 | /* switch the led off */ |
7151 | reg_w(gspca_dev->dev, 0x01, 0x0000); | 7170 | reg_w(gspca_dev->dev, 0x01, 0x0000); |
7152 | return 0; | 7171 | return 0; |
7153 | } | 7172 | } |
7154 | 7173 | ||
7155 | /* this function is called at open time */ | 7174 | /* this function is called at probe and resume time */ |
7156 | static int sd_open(struct gspca_dev *gspca_dev) | 7175 | static int sd_init(struct gspca_dev *gspca_dev) |
7157 | { | 7176 | { |
7158 | reg_w(gspca_dev->dev, 0x01, 0x0000); | 7177 | reg_w(gspca_dev->dev, 0x01, 0x0000); |
7159 | return 0; | 7178 | return 0; |
@@ -7314,10 +7333,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
7314 | } | 7333 | } |
7315 | } | 7334 | } |
7316 | 7335 | ||
7317 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
7318 | { | ||
7319 | } | ||
7320 | |||
7321 | static void sd_stop0(struct gspca_dev *gspca_dev) | 7336 | static void sd_stop0(struct gspca_dev *gspca_dev) |
7322 | { | 7337 | { |
7323 | struct sd *sd = (struct sd *) gspca_dev; | 7338 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -7325,11 +7340,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
7325 | send_unknown(gspca_dev->dev, sd->sensor); | 7340 | send_unknown(gspca_dev->dev, sd->sensor); |
7326 | } | 7341 | } |
7327 | 7342 | ||
7328 | /* this function is called at close time */ | ||
7329 | static void sd_close(struct gspca_dev *gspca_dev) | ||
7330 | { | ||
7331 | } | ||
7332 | |||
7333 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 7343 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
7334 | struct gspca_frame *frame, | 7344 | struct gspca_frame *frame, |
7335 | __u8 *data, | 7345 | __u8 *data, |
@@ -7489,37 +7499,30 @@ static const struct sd_desc sd_desc = { | |||
7489 | .ctrls = sd_ctrls, | 7499 | .ctrls = sd_ctrls, |
7490 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], | 7500 | .nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0], |
7491 | .config = sd_config, | 7501 | .config = sd_config, |
7492 | .open = sd_open, | 7502 | .init = sd_init, |
7493 | .start = sd_start, | 7503 | .start = sd_start, |
7494 | .stopN = sd_stopN, | ||
7495 | .stop0 = sd_stop0, | 7504 | .stop0 = sd_stop0, |
7496 | .close = sd_close, | ||
7497 | .pkt_scan = sd_pkt_scan, | 7505 | .pkt_scan = sd_pkt_scan, |
7498 | .querymenu = sd_querymenu, | 7506 | .querymenu = sd_querymenu, |
7499 | }; | 7507 | }; |
7500 | 7508 | ||
7501 | static const __devinitdata struct usb_device_id device_table[] = { | 7509 | static const __devinitdata struct usb_device_id device_table[] = { |
7502 | {USB_DEVICE(0x041e, 0x041e)}, | 7510 | {USB_DEVICE(0x041e, 0x041e)}, |
7503 | #ifndef CONFIG_USB_ZC0301 | ||
7504 | {USB_DEVICE(0x041e, 0x4017)}, | 7511 | {USB_DEVICE(0x041e, 0x4017)}, |
7505 | {USB_DEVICE(0x041e, 0x401c)}, | 7512 | {USB_DEVICE(0x041e, 0x401c), .driver_info = SENSOR_PAS106}, |
7506 | {USB_DEVICE(0x041e, 0x401e)}, | 7513 | {USB_DEVICE(0x041e, 0x401e)}, |
7507 | {USB_DEVICE(0x041e, 0x401f)}, | 7514 | {USB_DEVICE(0x041e, 0x401f)}, |
7508 | #endif | 7515 | {USB_DEVICE(0x041e, 0x4022)}, |
7509 | {USB_DEVICE(0x041e, 0x4029)}, | 7516 | {USB_DEVICE(0x041e, 0x4029)}, |
7510 | #ifndef CONFIG_USB_ZC0301 | 7517 | {USB_DEVICE(0x041e, 0x4034), .driver_info = SENSOR_PAS106}, |
7511 | {USB_DEVICE(0x041e, 0x4034)}, | 7518 | {USB_DEVICE(0x041e, 0x4035), .driver_info = SENSOR_PAS106}, |
7512 | {USB_DEVICE(0x041e, 0x4035)}, | ||
7513 | {USB_DEVICE(0x041e, 0x4036)}, | 7519 | {USB_DEVICE(0x041e, 0x4036)}, |
7514 | {USB_DEVICE(0x041e, 0x403a)}, | 7520 | {USB_DEVICE(0x041e, 0x403a)}, |
7515 | #endif | ||
7516 | {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250}, | 7521 | {USB_DEVICE(0x041e, 0x4051), .driver_info = SENSOR_TAS5130C_VF0250}, |
7517 | {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250}, | 7522 | {USB_DEVICE(0x041e, 0x4053), .driver_info = SENSOR_TAS5130C_VF0250}, |
7518 | #ifndef CONFIG_USB_ZC0301 | ||
7519 | {USB_DEVICE(0x0458, 0x7007)}, | 7523 | {USB_DEVICE(0x0458, 0x7007)}, |
7520 | {USB_DEVICE(0x0458, 0x700c)}, | 7524 | {USB_DEVICE(0x0458, 0x700c)}, |
7521 | {USB_DEVICE(0x0458, 0x700f)}, | 7525 | {USB_DEVICE(0x0458, 0x700f)}, |
7522 | #endif | ||
7523 | {USB_DEVICE(0x0461, 0x0a00)}, | 7526 | {USB_DEVICE(0x0461, 0x0a00)}, |
7524 | {USB_DEVICE(0x046d, 0x08a0)}, | 7527 | {USB_DEVICE(0x046d, 0x08a0)}, |
7525 | {USB_DEVICE(0x046d, 0x08a1)}, | 7528 | {USB_DEVICE(0x046d, 0x08a1)}, |
@@ -7531,7 +7534,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7531 | {USB_DEVICE(0x046d, 0x08aa)}, | 7534 | {USB_DEVICE(0x046d, 0x08aa)}, |
7532 | {USB_DEVICE(0x046d, 0x08ac)}, | 7535 | {USB_DEVICE(0x046d, 0x08ac)}, |
7533 | {USB_DEVICE(0x046d, 0x08ad)}, | 7536 | {USB_DEVICE(0x046d, 0x08ad)}, |
7534 | #ifndef CONFIG_USB_ZC0301 | 7537 | #if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE |
7535 | {USB_DEVICE(0x046d, 0x08ae)}, | 7538 | {USB_DEVICE(0x046d, 0x08ae)}, |
7536 | #endif | 7539 | #endif |
7537 | {USB_DEVICE(0x046d, 0x08af)}, | 7540 | {USB_DEVICE(0x046d, 0x08af)}, |
@@ -7541,27 +7544,25 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
7541 | {USB_DEVICE(0x046d, 0x08d8)}, | 7544 | {USB_DEVICE(0x046d, 0x08d8)}, |
7542 | {USB_DEVICE(0x046d, 0x08da)}, | 7545 | {USB_DEVICE(0x046d, 0x08da)}, |
7543 | {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB}, | 7546 | {USB_DEVICE(0x046d, 0x08dd), .driver_info = SENSOR_MC501CB}, |
7544 | {USB_DEVICE(0x0471, 0x0325)}, | 7547 | {USB_DEVICE(0x0471, 0x0325), .driver_info = SENSOR_PAS106}, |
7545 | {USB_DEVICE(0x0471, 0x0326)}, | 7548 | {USB_DEVICE(0x0471, 0x0326), .driver_info = SENSOR_PAS106}, |
7546 | {USB_DEVICE(0x0471, 0x032d)}, | 7549 | {USB_DEVICE(0x0471, 0x032d), .driver_info = SENSOR_PAS106}, |
7547 | {USB_DEVICE(0x0471, 0x032e)}, | 7550 | {USB_DEVICE(0x0471, 0x032e), .driver_info = SENSOR_PAS106}, |
7548 | {USB_DEVICE(0x055f, 0xc005)}, | 7551 | {USB_DEVICE(0x055f, 0xc005)}, |
7549 | #ifndef CONFIG_USB_ZC0301 | ||
7550 | {USB_DEVICE(0x055f, 0xd003)}, | 7552 | {USB_DEVICE(0x055f, 0xd003)}, |
7551 | {USB_DEVICE(0x055f, 0xd004)}, | 7553 | {USB_DEVICE(0x055f, 0xd004)}, |
7552 | #endif | ||
7553 | {USB_DEVICE(0x0698, 0x2003)}, | 7554 | {USB_DEVICE(0x0698, 0x2003)}, |
7555 | {USB_DEVICE(0x0ac8, 0x0301), .driver_info = SENSOR_PAS106}, | ||
7554 | {USB_DEVICE(0x0ac8, 0x0302)}, | 7556 | {USB_DEVICE(0x0ac8, 0x0302)}, |
7555 | #ifndef CONFIG_USB_ZC0301 | ||
7556 | {USB_DEVICE(0x0ac8, 0x301b)}, | 7557 | {USB_DEVICE(0x0ac8, 0x301b)}, |
7558 | #if !defined CONFIG_USB_ZC0301 && !defined CONFIG_USB_ZC0301_MODULE | ||
7557 | {USB_DEVICE(0x0ac8, 0x303b)}, | 7559 | {USB_DEVICE(0x0ac8, 0x303b)}, |
7558 | #endif | 7560 | #endif |
7559 | {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, | 7561 | {USB_DEVICE(0x0ac8, 0x305b), .driver_info = SENSOR_TAS5130C_VF0250}, |
7560 | #ifndef CONFIG_USB_ZC0301 | ||
7561 | {USB_DEVICE(0x0ac8, 0x307b)}, | 7562 | {USB_DEVICE(0x0ac8, 0x307b)}, |
7562 | {USB_DEVICE(0x10fd, 0x0128)}, | 7563 | {USB_DEVICE(0x10fd, 0x0128)}, |
7564 | {USB_DEVICE(0x10fd, 0x804d)}, | ||
7563 | {USB_DEVICE(0x10fd, 0x8050)}, | 7565 | {USB_DEVICE(0x10fd, 0x8050)}, |
7564 | #endif | ||
7565 | {} /* end of entry */ | 7566 | {} /* end of entry */ |
7566 | }; | 7567 | }; |
7567 | #undef DVNAME | 7568 | #undef DVNAME |
@@ -7581,6 +7582,10 @@ static struct usb_driver sd_driver = { | |||
7581 | .id_table = device_table, | 7582 | .id_table = device_table, |
7582 | .probe = sd_probe, | 7583 | .probe = sd_probe, |
7583 | .disconnect = gspca_disconnect, | 7584 | .disconnect = gspca_disconnect, |
7585 | #ifdef CONFIG_PM | ||
7586 | .suspend = gspca_suspend, | ||
7587 | .resume = gspca_resume, | ||
7588 | #endif | ||
7584 | }; | 7589 | }; |
7585 | 7590 | ||
7586 | static int __init sd_mod_init(void) | 7591 | static int __init sd_mod_init(void) |
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index aea1664948ce..4afc7ea07e86 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -688,7 +688,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv) | |||
688 | spin_lock_init(&itv->lock); | 688 | spin_lock_init(&itv->lock); |
689 | spin_lock_init(&itv->dma_reg_lock); | 689 | spin_lock_init(&itv->dma_reg_lock); |
690 | 690 | ||
691 | itv->irq_work_queues = create_workqueue(itv->name); | 691 | itv->irq_work_queues = create_singlethread_workqueue(itv->name); |
692 | if (itv->irq_work_queues == NULL) { | 692 | if (itv->irq_work_queues == NULL) { |
693 | IVTV_ERR("Could not create ivtv workqueue\n"); | 693 | IVTV_ERR("Could not create ivtv workqueue\n"); |
694 | return -1; | 694 | return -1; |
diff --git a/drivers/media/video/ivtv/ivtv-driver.h b/drivers/media/video/ivtv/ivtv-driver.h index ab287b48fc2b..2ceb5227637c 100644 --- a/drivers/media/video/ivtv/ivtv-driver.h +++ b/drivers/media/video/ivtv/ivtv-driver.h | |||
@@ -251,6 +251,7 @@ struct ivtv_mailbox_data { | |||
251 | #define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */ | 251 | #define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */ |
252 | #define IVTV_F_I_INITED 21 /* set after first open */ | 252 | #define IVTV_F_I_INITED 21 /* set after first open */ |
253 | #define IVTV_F_I_FAILED 22 /* set if first open failed */ | 253 | #define IVTV_F_I_FAILED 22 /* set if first open failed */ |
254 | #define IVTV_F_I_WORK_INITED 23 /* worker thread was initialized */ | ||
254 | 255 | ||
255 | /* Event notifications */ | 256 | /* Event notifications */ |
256 | #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ | 257 | #define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */ |
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index fba150a6cd23..34f3ab827858 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
@@ -76,6 +76,13 @@ void ivtv_irq_work_handler(struct work_struct *work) | |||
76 | 76 | ||
77 | DEFINE_WAIT(wait); | 77 | DEFINE_WAIT(wait); |
78 | 78 | ||
79 | if (test_and_clear_bit(IVTV_F_I_WORK_INITED, &itv->i_flags)) { | ||
80 | struct sched_param param = { .sched_priority = 99 }; | ||
81 | |||
82 | /* This thread must use the FIFO scheduler as it | ||
83 | is realtime sensitive. */ | ||
84 | sched_setscheduler(current, SCHED_FIFO, ¶m); | ||
85 | } | ||
79 | if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) | 86 | if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) |
80 | ivtv_pio_work_handler(itv); | 87 | ivtv_pio_work_handler(itv); |
81 | 88 | ||
@@ -678,34 +685,14 @@ static void ivtv_irq_enc_start_cap(struct ivtv *itv) | |||
678 | 685 | ||
679 | static void ivtv_irq_enc_vbi_cap(struct ivtv *itv) | 686 | static void ivtv_irq_enc_vbi_cap(struct ivtv *itv) |
680 | { | 687 | { |
681 | struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG]; | ||
682 | u32 data[CX2341X_MBOX_MAX_DATA]; | 688 | u32 data[CX2341X_MBOX_MAX_DATA]; |
683 | struct ivtv_stream *s; | 689 | struct ivtv_stream *s; |
684 | 690 | ||
685 | IVTV_DEBUG_HI_IRQ("ENC START VBI CAP\n"); | 691 | IVTV_DEBUG_HI_IRQ("ENC START VBI CAP\n"); |
686 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI]; | 692 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI]; |
687 | 693 | ||
688 | /* If more than two VBI buffers are pending, then | 694 | if (!stream_enc_dma_append(s, data)) |
689 | clear the old ones and start with this new one. | ||
690 | This can happen during transition stages when MPEG capturing is | ||
691 | started, but the first interrupts haven't arrived yet. During | ||
692 | that period VBI requests can accumulate without being able to | ||
693 | DMA the data. Since at most four VBI DMA buffers are available, | ||
694 | we just drop the old requests when there are already three | ||
695 | requests queued. */ | ||
696 | if (s->sg_pending_size > 2) { | ||
697 | struct ivtv_buffer *buf; | ||
698 | list_for_each_entry(buf, &s->q_predma.list, list) | ||
699 | ivtv_buf_sync_for_cpu(s, buf); | ||
700 | ivtv_queue_move(s, &s->q_predma, NULL, &s->q_free, 0); | ||
701 | s->sg_pending_size = 0; | ||
702 | } | ||
703 | /* if we can append the data, and the MPEG stream isn't capturing, | ||
704 | then start a DMA request for just the VBI data. */ | ||
705 | if (!stream_enc_dma_append(s, data) && | ||
706 | !test_bit(IVTV_F_S_STREAMING, &s_mpg->s_flags)) { | ||
707 | set_bit(ivtv_use_pio(s) ? IVTV_F_S_PIO_PENDING : IVTV_F_S_DMA_PENDING, &s->s_flags); | 695 | set_bit(ivtv_use_pio(s) ? IVTV_F_S_PIO_PENDING : IVTV_F_S_DMA_PENDING, &s->s_flags); |
708 | } | ||
709 | } | 696 | } |
710 | 697 | ||
711 | static void ivtv_irq_dec_vbi_reinsert(struct ivtv *itv) | 698 | static void ivtv_irq_dec_vbi_reinsert(struct ivtv *itv) |
diff --git a/drivers/media/video/ivtv/ivtv-queue.h b/drivers/media/video/ivtv/ivtv-queue.h index 7cfc0c9ab050..476556afd39a 100644 --- a/drivers/media/video/ivtv/ivtv-queue.h +++ b/drivers/media/video/ivtv/ivtv-queue.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define IVTV_QUEUE_H | 23 | #define IVTV_QUEUE_H |
24 | 24 | ||
25 | #define IVTV_DMA_UNMAPPED ((u32) -1) | 25 | #define IVTV_DMA_UNMAPPED ((u32) -1) |
26 | #define SLICED_VBI_PIO 1 | 26 | #define SLICED_VBI_PIO 0 |
27 | 27 | ||
28 | /* ivtv_buffer utility functions */ | 28 | /* ivtv_buffer utility functions */ |
29 | 29 | ||
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 54d2023b26c4..730e85d86fc8 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -363,7 +363,7 @@ static void ivtv_vbi_setup(struct ivtv *itv) | |||
363 | /* Every X number of frames a VBI interrupt arrives (frames as in 25 or 30 fps) */ | 363 | /* Every X number of frames a VBI interrupt arrives (frames as in 25 or 30 fps) */ |
364 | data[1] = 1; | 364 | data[1] = 1; |
365 | /* The VBI frames are stored in a ringbuffer with this size (with a VBI frame as unit) */ | 365 | /* The VBI frames are stored in a ringbuffer with this size (with a VBI frame as unit) */ |
366 | data[2] = raw ? 4 : 8; | 366 | data[2] = raw ? 4 : 4 * (itv->vbi.raw_size / itv->vbi.enc_size); |
367 | /* The start/stop codes determine which VBI lines end up in the raw VBI data area. | 367 | /* The start/stop codes determine which VBI lines end up in the raw VBI data area. |
368 | The codes are from table 24 in the saa7115 datasheet. Each raw/sliced/video line | 368 | The codes are from table 24 in the saa7115 datasheet. Each raw/sliced/video line |
369 | is framed with codes FF0000XX where XX is the SAV/EAV (Start/End of Active Video) | 369 | is framed with codes FF0000XX where XX is the SAV/EAV (Start/End of Active Video) |
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c b/drivers/media/video/ivtv/ivtv-vbi.c index 71798f0da27f..1ce9deb1104f 100644 --- a/drivers/media/video/ivtv/ivtv-vbi.c +++ b/drivers/media/video/ivtv/ivtv-vbi.c | |||
@@ -293,6 +293,7 @@ static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8 | |||
293 | u32 line_size = itv->vbi.sliced_decoder_line_size; | 293 | u32 line_size = itv->vbi.sliced_decoder_line_size; |
294 | struct v4l2_decode_vbi_line vbi; | 294 | struct v4l2_decode_vbi_line vbi; |
295 | int i; | 295 | int i; |
296 | unsigned lines = 0; | ||
296 | 297 | ||
297 | /* find the first valid line */ | 298 | /* find the first valid line */ |
298 | for (i = 0; i < size; i++, buf++) { | 299 | for (i = 0; i < size; i++, buf++) { |
@@ -313,7 +314,8 @@ static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8 | |||
313 | } | 314 | } |
314 | vbi.p = p + 4; | 315 | vbi.p = p + 4; |
315 | itv->video_dec_func(itv, VIDIOC_INT_DECODE_VBI_LINE, &vbi); | 316 | itv->video_dec_func(itv, VIDIOC_INT_DECODE_VBI_LINE, &vbi); |
316 | if (vbi.type) { | 317 | if (vbi.type && !(lines & (1 << vbi.line))) { |
318 | lines |= 1 << vbi.line; | ||
317 | itv->vbi.sliced_data[line].id = vbi.type; | 319 | itv->vbi.sliced_data[line].id = vbi.type; |
318 | itv->vbi.sliced_data[line].field = vbi.is_second_field; | 320 | itv->vbi.sliced_data[line].field = vbi.is_second_field; |
319 | itv->vbi.sliced_data[line].line = vbi.line; | 321 | itv->vbi.sliced_data[line].line = vbi.line; |
diff --git a/drivers/media/video/ivtv/ivtv-version.h b/drivers/media/video/ivtv/ivtv-version.h index 442f43f11b73..8cd753d30bf7 100644 --- a/drivers/media/video/ivtv/ivtv-version.h +++ b/drivers/media/video/ivtv/ivtv-version.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #define IVTV_DRIVER_NAME "ivtv" | 23 | #define IVTV_DRIVER_NAME "ivtv" |
24 | #define IVTV_DRIVER_VERSION_MAJOR 1 | 24 | #define IVTV_DRIVER_VERSION_MAJOR 1 |
25 | #define IVTV_DRIVER_VERSION_MINOR 3 | 25 | #define IVTV_DRIVER_VERSION_MINOR 4 |
26 | #define IVTV_DRIVER_VERSION_PATCHLEVEL 0 | 26 | #define IVTV_DRIVER_VERSION_PATCHLEVEL 0 |
27 | 27 | ||
28 | #define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) "." __stringify(IVTV_DRIVER_VERSION_MINOR) "." __stringify(IVTV_DRIVER_VERSION_PATCHLEVEL) | 28 | #define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) "." __stringify(IVTV_DRIVER_VERSION_MINOR) "." __stringify(IVTV_DRIVER_VERSION_PATCHLEVEL) |
diff --git a/drivers/media/video/ks0127.c b/drivers/media/video/ks0127.c index 4895540be195..2fd4b4a44aa9 100644 --- a/drivers/media/video/ks0127.c +++ b/drivers/media/video/ks0127.c | |||
@@ -679,26 +679,27 @@ static int ks0127_command(struct i2c_client *client, | |||
679 | 679 | ||
680 | case DECODER_ENABLE_OUTPUT: | 680 | case DECODER_ENABLE_OUTPUT: |
681 | { | 681 | { |
682 | int enable; | ||
682 | 683 | ||
683 | int *iarg = arg; | 684 | iarg = arg; |
684 | int enable = (*iarg != 0); | 685 | enable = (*iarg != 0); |
685 | if (enable) { | 686 | if (enable) { |
686 | dprintk("ks0127: command " | 687 | dprintk("ks0127: command " |
687 | "DECODER_ENABLE_OUTPUT on " | 688 | "DECODER_ENABLE_OUTPUT on " |
688 | "(%d)\n", enable); | 689 | "(%d)\n", enable); |
689 | /* All output pins on */ | 690 | /* All output pins on */ |
690 | ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30); | 691 | ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30); |
691 | /* Obey the OEN pin */ | 692 | /* Obey the OEN pin */ |
692 | ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00); | 693 | ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00); |
693 | } else { | 694 | } else { |
694 | dprintk("ks0127: command " | 695 | dprintk("ks0127: command " |
695 | "DECODER_ENABLE_OUTPUT off " | 696 | "DECODER_ENABLE_OUTPUT off " |
696 | "(%d)\n", enable); | 697 | "(%d)\n", enable); |
697 | /* Video output pins off */ | 698 | /* Video output pins off */ |
698 | ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00); | 699 | ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00); |
699 | /* Ignore the OEN pin */ | 700 | /* Ignore the OEN pin */ |
700 | ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80); | 701 | ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80); |
701 | } | 702 | } |
702 | } | 703 | } |
703 | break; | 704 | break; |
704 | 705 | ||
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index 7c8ef6ac6c39..a9ef7802eb5f 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c | |||
@@ -1806,6 +1806,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev, | |||
1806 | memcpy(meye.video_dev, &meye_template, sizeof(meye_template)); | 1806 | memcpy(meye.video_dev, &meye_template, sizeof(meye_template)); |
1807 | meye.video_dev->parent = &meye.mchip_dev->dev; | 1807 | meye.video_dev->parent = &meye.mchip_dev->dev; |
1808 | 1808 | ||
1809 | ret = -EIO; | ||
1809 | if ((ret = sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 1))) { | 1810 | if ((ret = sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 1))) { |
1810 | printk(KERN_ERR "meye: unable to power on the camera\n"); | 1811 | printk(KERN_ERR "meye: unable to power on the camera\n"); |
1811 | printk(KERN_ERR "meye: did you enable the camera in " | 1812 | printk(KERN_ERR "meye: did you enable the camera in " |
@@ -1813,7 +1814,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev, | |||
1813 | goto outsonypienable; | 1814 | goto outsonypienable; |
1814 | } | 1815 | } |
1815 | 1816 | ||
1816 | ret = -EIO; | ||
1817 | if ((ret = pci_enable_device(meye.mchip_dev))) { | 1817 | if ((ret = pci_enable_device(meye.mchip_dev))) { |
1818 | printk(KERN_ERR "meye: pci_enable_device failed\n"); | 1818 | printk(KERN_ERR "meye: pci_enable_device failed\n"); |
1819 | goto outenabledev; | 1819 | goto outenabledev; |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index f68e91fbe7fb..8ef578caba3b 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -931,27 +931,29 @@ static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) | |||
931 | return 0; | 931 | return 0; |
932 | } | 932 | } |
933 | 933 | ||
934 | static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) | 934 | static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *standard) |
935 | { | 935 | { |
936 | struct mxb* mxb = (struct mxb*)dev->ext_priv; | 936 | struct mxb *mxb = (struct mxb *)dev->ext_priv; |
937 | int zero = 0; | 937 | int zero = 0; |
938 | int one = 1; | 938 | int one = 1; |
939 | 939 | ||
940 | if(V4L2_STD_PAL_I == std->id ) { | 940 | if (V4L2_STD_PAL_I == standard->id) { |
941 | v4l2_std_id std = V4L2_STD_PAL_I; | 941 | v4l2_std_id std = V4L2_STD_PAL_I; |
942 | |||
942 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); | 943 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); |
943 | /* set the 7146 gpio register -- I don't know what this does exactly */ | 944 | /* set the 7146 gpio register -- I don't know what this does exactly */ |
944 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 945 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
945 | /* unset the 7111 gpio register -- I don't know what this does exactly */ | 946 | /* unset the 7111 gpio register -- I don't know what this does exactly */ |
946 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); | 947 | mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_SET_GPIO, &zero); |
947 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); | 948 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); |
948 | } else { | 949 | } else { |
949 | v4l2_std_id std = V4L2_STD_PAL_BG; | 950 | v4l2_std_id std = V4L2_STD_PAL_BG; |
951 | |||
950 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); | 952 | DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); |
951 | /* set the 7146 gpio register -- I don't know what this does exactly */ | 953 | /* set the 7146 gpio register -- I don't know what this does exactly */ |
952 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 954 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
953 | /* set the 7111 gpio register -- I don't know what this does exactly */ | 955 | /* set the 7111 gpio register -- I don't know what this does exactly */ |
954 | mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); | 956 | mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_SET_GPIO, &one); |
955 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); | 957 | mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); |
956 | } | 958 | } |
957 | return 0; | 959 | return 0; |
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index 9edaca4371d7..3d3c48db45d9 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c | |||
@@ -626,9 +626,9 @@ ov511_i2c_write_internal(struct usb_ov511 *ov, | |||
626 | break; | 626 | break; |
627 | 627 | ||
628 | /* Retry until idle */ | 628 | /* Retry until idle */ |
629 | do | 629 | do { |
630 | rc = reg_r(ov, R511_I2C_CTL); | 630 | rc = reg_r(ov, R511_I2C_CTL); |
631 | while (rc > 0 && ((rc&1) == 0)); | 631 | } while (rc > 0 && ((rc&1) == 0)); |
632 | if (rc < 0) | 632 | if (rc < 0) |
633 | break; | 633 | break; |
634 | 634 | ||
@@ -703,9 +703,9 @@ ov511_i2c_read_internal(struct usb_ov511 *ov, unsigned char reg) | |||
703 | return rc; | 703 | return rc; |
704 | 704 | ||
705 | /* Retry until idle */ | 705 | /* Retry until idle */ |
706 | do | 706 | do { |
707 | rc = reg_r(ov, R511_I2C_CTL); | 707 | rc = reg_r(ov, R511_I2C_CTL); |
708 | while (rc > 0 && ((rc&1) == 0)); | 708 | } while (rc > 0 && ((rc & 1) == 0)); |
709 | if (rc < 0) | 709 | if (rc < 0) |
710 | return rc; | 710 | return rc; |
711 | 711 | ||
@@ -729,9 +729,9 @@ ov511_i2c_read_internal(struct usb_ov511 *ov, unsigned char reg) | |||
729 | return rc; | 729 | return rc; |
730 | 730 | ||
731 | /* Retry until idle */ | 731 | /* Retry until idle */ |
732 | do | 732 | do { |
733 | rc = reg_r(ov, R511_I2C_CTL); | 733 | rc = reg_r(ov, R511_I2C_CTL); |
734 | while (rc > 0 && ((rc&1) == 0)); | 734 | } while (rc > 0 && ((rc&1) == 0)); |
735 | if (rc < 0) | 735 | if (rc < 0) |
736 | return rc; | 736 | return rc; |
737 | 737 | ||
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index 00425d743656..7c84f795db54 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c | |||
@@ -1019,10 +1019,23 @@ static int init_mediavision(void) | |||
1019 | * Initialization and module stuff | 1019 | * Initialization and module stuff |
1020 | */ | 1020 | */ |
1021 | 1021 | ||
1022 | #ifndef MODULE | ||
1023 | static int enable; | ||
1024 | module_param(enable, int, 0); | ||
1025 | #endif | ||
1026 | |||
1022 | static int __init init_pms_cards(void) | 1027 | static int __init init_pms_cards(void) |
1023 | { | 1028 | { |
1024 | printk(KERN_INFO "Mediavision Pro Movie Studio driver 0.02\n"); | 1029 | printk(KERN_INFO "Mediavision Pro Movie Studio driver 0.02\n"); |
1025 | 1030 | ||
1031 | #ifndef MODULE | ||
1032 | if (!enable) { | ||
1033 | printk(KERN_INFO "PMS: not enabled, use pms.enable=1 to " | ||
1034 | "probe\n"); | ||
1035 | return -ENODEV; | ||
1036 | } | ||
1037 | #endif | ||
1038 | |||
1026 | data_port = io_port +1; | 1039 | data_port = io_port +1; |
1027 | 1040 | ||
1028 | if(init_mediavision()) | 1041 | if(init_mediavision()) |
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c index 1cccd5c77048..dbc560742553 100644 --- a/drivers/media/video/pwc/pwc-ctrl.c +++ b/drivers/media/video/pwc/pwc-ctrl.c | |||
@@ -1635,15 +1635,15 @@ int pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg) | |||
1635 | 1635 | ||
1636 | case VIDIOCPWCGVIDCMD: | 1636 | case VIDIOCPWCGVIDCMD: |
1637 | { | 1637 | { |
1638 | ARG_DEF(struct pwc_video_command, cmd); | 1638 | ARG_DEF(struct pwc_video_command, vcmd); |
1639 | 1639 | ||
1640 | ARGR(cmd).type = pdev->type; | 1640 | ARGR(vcmd).type = pdev->type; |
1641 | ARGR(cmd).release = pdev->release; | 1641 | ARGR(vcmd).release = pdev->release; |
1642 | ARGR(cmd).command_len = pdev->cmd_len; | 1642 | ARGR(vcmd).command_len = pdev->cmd_len; |
1643 | memcpy(&ARGR(cmd).command_buf, pdev->cmd_buf, pdev->cmd_len); | 1643 | memcpy(&ARGR(vcmd).command_buf, pdev->cmd_buf, pdev->cmd_len); |
1644 | ARGR(cmd).bandlength = pdev->vbandlength; | 1644 | ARGR(vcmd).bandlength = pdev->vbandlength; |
1645 | ARGR(cmd).frame_size = pdev->frame_size; | 1645 | ARGR(vcmd).frame_size = pdev->frame_size; |
1646 | ARG_OUT(cmd) | 1646 | ARG_OUT(vcmd) |
1647 | break; | 1647 | break; |
1648 | } | 1648 | } |
1649 | /* | 1649 | /* |
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index bcd1c8f6cf6b..ad733caec720 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1489,10 +1489,9 @@ static int saa7115_probe(struct i2c_client *client, | |||
1489 | client->addr << 1, client->adapter->name); | 1489 | client->addr << 1, client->adapter->name); |
1490 | 1490 | ||
1491 | state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL); | 1491 | state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL); |
1492 | i2c_set_clientdata(client, state); | 1492 | if (state == NULL) |
1493 | if (state == NULL) { | ||
1494 | return -ENOMEM; | 1493 | return -ENOMEM; |
1495 | } | 1494 | i2c_set_clientdata(client, state); |
1496 | state->input = -1; | 1495 | state->input = -1; |
1497 | state->output = SAA7115_IPORT_ON; | 1496 | state->output = SAA7115_IPORT_ON; |
1498 | state->enable = 1; | 1497 | state->enable = 1; |
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index f481277892da..acceed5d04ae 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c | |||
@@ -1397,7 +1397,7 @@ static int se401_probe(struct usb_interface *intf, | |||
1397 | mutex_init(&se401->lock); | 1397 | mutex_init(&se401->lock); |
1398 | wmb(); | 1398 | wmb(); |
1399 | 1399 | ||
1400 | if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { | 1400 | if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
1401 | kfree(se401); | 1401 | kfree(se401); |
1402 | err("video_register_device failed"); | 1402 | err("video_register_device failed"); |
1403 | return -EIO; | 1403 | return -EIO; |
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 23408764d0ef..2da6938718f2 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -3312,6 +3312,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
3312 | cam->v4ldev->fops = &sn9c102_fops; | 3312 | cam->v4ldev->fops = &sn9c102_fops; |
3313 | cam->v4ldev->minor = video_nr[dev_nr]; | 3313 | cam->v4ldev->minor = video_nr[dev_nr]; |
3314 | cam->v4ldev->release = video_device_release; | 3314 | cam->v4ldev->release = video_device_release; |
3315 | cam->v4ldev->parent = &udev->dev; | ||
3315 | 3316 | ||
3316 | init_completion(&cam->probe); | 3317 | init_completion(&cam->probe); |
3317 | 3318 | ||
diff --git a/drivers/media/video/sn9c102/sn9c102_devtable.h b/drivers/media/video/sn9c102/sn9c102_devtable.h index 6ff489baacf3..90a401dc3884 100644 --- a/drivers/media/video/sn9c102/sn9c102_devtable.h +++ b/drivers/media/video/sn9c102/sn9c102_devtable.h | |||
@@ -40,11 +40,14 @@ struct sn9c102_device; | |||
40 | 40 | ||
41 | static const struct usb_device_id sn9c102_id_table[] = { | 41 | static const struct usb_device_id sn9c102_id_table[] = { |
42 | /* SN9C101 and SN9C102 */ | 42 | /* SN9C101 and SN9C102 */ |
43 | #if !defined CONFIG_USB_GSPCA && !defined CONFIG_USB_GSPCA_MODULE | ||
43 | { SN9C102_USB_DEVICE(0x0c45, 0x6001, BRIDGE_SN9C102), }, | 44 | { SN9C102_USB_DEVICE(0x0c45, 0x6001, BRIDGE_SN9C102), }, |
44 | { SN9C102_USB_DEVICE(0x0c45, 0x6005, BRIDGE_SN9C102), }, | 45 | { SN9C102_USB_DEVICE(0x0c45, 0x6005, BRIDGE_SN9C102), }, |
46 | #endif | ||
45 | { SN9C102_USB_DEVICE(0x0c45, 0x6007, BRIDGE_SN9C102), }, | 47 | { SN9C102_USB_DEVICE(0x0c45, 0x6007, BRIDGE_SN9C102), }, |
46 | { SN9C102_USB_DEVICE(0x0c45, 0x6009, BRIDGE_SN9C102), }, | 48 | { SN9C102_USB_DEVICE(0x0c45, 0x6009, BRIDGE_SN9C102), }, |
47 | { SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), }, | 49 | { SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), }, |
50 | /* { SN9C102_USB_DEVICE(0x0c45, 0x6011, BRIDGE_SN9C102), }, OV6650 */ | ||
48 | { SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), }, | 51 | { SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), }, |
49 | { SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), }, | 52 | { SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), }, |
50 | { SN9C102_USB_DEVICE(0x0c45, 0x6025, BRIDGE_SN9C102), }, | 53 | { SN9C102_USB_DEVICE(0x0c45, 0x6025, BRIDGE_SN9C102), }, |
@@ -53,29 +56,33 @@ static const struct usb_device_id sn9c102_id_table[] = { | |||
53 | { SN9C102_USB_DEVICE(0x0c45, 0x602a, BRIDGE_SN9C102), }, | 56 | { SN9C102_USB_DEVICE(0x0c45, 0x602a, BRIDGE_SN9C102), }, |
54 | { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), }, | 57 | { SN9C102_USB_DEVICE(0x0c45, 0x602b, BRIDGE_SN9C102), }, |
55 | { SN9C102_USB_DEVICE(0x0c45, 0x602c, BRIDGE_SN9C102), }, | 58 | { SN9C102_USB_DEVICE(0x0c45, 0x602c, BRIDGE_SN9C102), }, |
56 | { SN9C102_USB_DEVICE(0x0c45, 0x602d, BRIDGE_SN9C102), }, | 59 | /* { SN9C102_USB_DEVICE(0x0c45, 0x602d, BRIDGE_SN9C102), }, HV7131R */ |
57 | { SN9C102_USB_DEVICE(0x0c45, 0x602e, BRIDGE_SN9C102), }, | 60 | { SN9C102_USB_DEVICE(0x0c45, 0x602e, BRIDGE_SN9C102), }, |
58 | { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), }, | 61 | { SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), }, |
59 | /* SN9C103 */ | 62 | /* SN9C103 */ |
60 | { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), }, | 63 | { SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), }, |
61 | { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), }, | 64 | { SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), }, |
62 | { SN9C102_USB_DEVICE(0x0c45, 0x6083, BRIDGE_SN9C103), }, | 65 | /* { SN9C102_USB_DEVICE(0x0c45, 0x6083, BRIDGE_SN9C103), }, HY7131D/E */ |
63 | { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), }, | 66 | { SN9C102_USB_DEVICE(0x0c45, 0x6088, BRIDGE_SN9C103), }, |
64 | { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), }, | 67 | { SN9C102_USB_DEVICE(0x0c45, 0x608a, BRIDGE_SN9C103), }, |
65 | { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), }, | 68 | { SN9C102_USB_DEVICE(0x0c45, 0x608b, BRIDGE_SN9C103), }, |
66 | { SN9C102_USB_DEVICE(0x0c45, 0x608c, BRIDGE_SN9C103), }, | 69 | { SN9C102_USB_DEVICE(0x0c45, 0x608c, BRIDGE_SN9C103), }, |
67 | { SN9C102_USB_DEVICE(0x0c45, 0x608e, BRIDGE_SN9C103), }, | 70 | /* { SN9C102_USB_DEVICE(0x0c45, 0x608e, BRIDGE_SN9C103), }, CISVF10 */ |
71 | #if !defined CONFIG_USB_GSPCA && !defined CONFIG_USB_GSPCA_MODULE | ||
68 | { SN9C102_USB_DEVICE(0x0c45, 0x608f, BRIDGE_SN9C103), }, | 72 | { SN9C102_USB_DEVICE(0x0c45, 0x608f, BRIDGE_SN9C103), }, |
73 | #endif | ||
69 | { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), }, | 74 | { SN9C102_USB_DEVICE(0x0c45, 0x60a0, BRIDGE_SN9C103), }, |
70 | { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), }, | 75 | { SN9C102_USB_DEVICE(0x0c45, 0x60a2, BRIDGE_SN9C103), }, |
71 | { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), }, | 76 | { SN9C102_USB_DEVICE(0x0c45, 0x60a3, BRIDGE_SN9C103), }, |
72 | { SN9C102_USB_DEVICE(0x0c45, 0x60a8, BRIDGE_SN9C103), }, | 77 | /* { SN9C102_USB_DEVICE(0x0c45, 0x60a8, BRIDGE_SN9C103), }, PAS106 */ |
73 | { SN9C102_USB_DEVICE(0x0c45, 0x60aa, BRIDGE_SN9C103), }, | 78 | /* { SN9C102_USB_DEVICE(0x0c45, 0x60aa, BRIDGE_SN9C103), }, TAS5130 */ |
74 | { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, | 79 | /* { SN9C102_USB_DEVICE(0x0c45, 0x60ab, BRIDGE_SN9C103), }, TAS5130 */ |
75 | { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), }, | 80 | { SN9C102_USB_DEVICE(0x0c45, 0x60ac, BRIDGE_SN9C103), }, |
76 | { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), }, | 81 | { SN9C102_USB_DEVICE(0x0c45, 0x60ae, BRIDGE_SN9C103), }, |
77 | { SN9C102_USB_DEVICE(0x0c45, 0x60af, BRIDGE_SN9C103), }, | 82 | { SN9C102_USB_DEVICE(0x0c45, 0x60af, BRIDGE_SN9C103), }, |
83 | #if !defined CONFIG_USB_GSPCA && !defined CONFIG_USB_GSPCA_MODULE | ||
78 | { SN9C102_USB_DEVICE(0x0c45, 0x60b0, BRIDGE_SN9C103), }, | 84 | { SN9C102_USB_DEVICE(0x0c45, 0x60b0, BRIDGE_SN9C103), }, |
85 | #endif | ||
79 | { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), }, | 86 | { SN9C102_USB_DEVICE(0x0c45, 0x60b2, BRIDGE_SN9C103), }, |
80 | { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), }, | 87 | { SN9C102_USB_DEVICE(0x0c45, 0x60b3, BRIDGE_SN9C103), }, |
81 | { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), }, | 88 | { SN9C102_USB_DEVICE(0x0c45, 0x60b8, BRIDGE_SN9C103), }, |
@@ -105,7 +112,7 @@ static const struct usb_device_id sn9c102_id_table[] = { | |||
105 | { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, | 112 | { SN9C102_USB_DEVICE(0x0c45, 0x6108, BRIDGE_SN9C120), }, |
106 | { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), }, | 113 | { SN9C102_USB_DEVICE(0x0c45, 0x610f, BRIDGE_SN9C120), }, |
107 | { SN9C102_USB_DEVICE(0x0c45, 0x6130, BRIDGE_SN9C120), }, | 114 | { SN9C102_USB_DEVICE(0x0c45, 0x6130, BRIDGE_SN9C120), }, |
108 | { SN9C102_USB_DEVICE(0x0c45, 0x6138, BRIDGE_SN9C120), }, | 115 | /* { SN9C102_USB_DEVICE(0x0c45, 0x6138, BRIDGE_SN9C120), }, MO8000 */ |
109 | { SN9C102_USB_DEVICE(0x0c45, 0x613a, BRIDGE_SN9C120), }, | 116 | { SN9C102_USB_DEVICE(0x0c45, 0x613a, BRIDGE_SN9C120), }, |
110 | { SN9C102_USB_DEVICE(0x0c45, 0x613b, BRIDGE_SN9C120), }, | 117 | { SN9C102_USB_DEVICE(0x0c45, 0x613b, BRIDGE_SN9C120), }, |
111 | { SN9C102_USB_DEVICE(0x0c45, 0x613c, BRIDGE_SN9C120), }, | 118 | { SN9C102_USB_DEVICE(0x0c45, 0x613c, BRIDGE_SN9C120), }, |
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c index 56dc3d6b5b29..dce947439459 100644 --- a/drivers/media/video/stv680.c +++ b/drivers/media/video/stv680.c | |||
@@ -1462,7 +1462,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id | |||
1462 | mutex_init (&stv680->lock); | 1462 | mutex_init (&stv680->lock); |
1463 | wmb (); | 1463 | wmb (); |
1464 | 1464 | ||
1465 | if (video_register_device (stv680->vdev, VFL_TYPE_GRABBER, video_nr) == -1) { | 1465 | if (video_register_device(stv680->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { |
1466 | PDEBUG (0, "STV(e): video_register_device failed"); | 1466 | PDEBUG (0, "STV(e): video_register_device failed"); |
1467 | retval = -EIO; | 1467 | retval = -EIO; |
1468 | goto error_vdev; | 1468 | goto error_vdev; |
diff --git a/drivers/media/video/usbvideo/ibmcam.c b/drivers/media/video/usbvideo/ibmcam.c index 59166b760104..cc27efe121dd 100644 --- a/drivers/media/video/usbvideo/ibmcam.c +++ b/drivers/media/video/usbvideo/ibmcam.c | |||
@@ -736,12 +736,12 @@ static enum ParseState ibmcam_model2_320x240_parse_lines( | |||
736 | * make black color and quit the horizontal scanning loop. | 736 | * make black color and quit the horizontal scanning loop. |
737 | */ | 737 | */ |
738 | if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) { | 738 | if (((frame->curline + 2) >= scanHeight) || (i >= scanLength)) { |
739 | const int j = i * V4L_BYTES_PER_PIXEL; | 739 | const int offset = i * V4L_BYTES_PER_PIXEL; |
740 | #if USES_IBMCAM_PUTPIXEL | 740 | #if USES_IBMCAM_PUTPIXEL |
741 | /* Refresh 'f' because we don't use it much with PUTPIXEL */ | 741 | /* Refresh 'f' because we don't use it much with PUTPIXEL */ |
742 | f = frame->data + (v4l_linesize * frame->curline) + j; | 742 | f = frame->data + (v4l_linesize * frame->curline) + offset; |
743 | #endif | 743 | #endif |
744 | memset(f, 0, v4l_linesize - j); | 744 | memset(f, 0, v4l_linesize - offset); |
745 | break; | 745 | break; |
746 | } | 746 | } |
747 | 747 | ||
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index b7792451a299..2eb45829791c 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c | |||
@@ -866,7 +866,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id) | |||
866 | cam->udev = dev; | 866 | cam->udev = dev; |
867 | cam->bulkEndpoint = bulkEndpoint; | 867 | cam->bulkEndpoint = bulkEndpoint; |
868 | 868 | ||
869 | if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) { | 869 | if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) < 0) { |
870 | kfree(cam); | 870 | kfree(cam); |
871 | printk(KERN_WARNING "video_register_device failed\n"); | 871 | printk(KERN_WARNING "video_register_device failed\n"); |
872 | return -EIO; | 872 | return -EIO; |
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 6f36006aecda..155fdec9ac7d 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -257,6 +257,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, | |||
257 | int ret; | 257 | int ret; |
258 | char *name_base; | 258 | char *name_base; |
259 | 259 | ||
260 | if (vfd == NULL) | ||
261 | return -EINVAL; | ||
262 | |||
260 | switch (type) { | 263 | switch (type) { |
261 | case VFL_TYPE_GRABBER: | 264 | case VFL_TYPE_GRABBER: |
262 | base = MINOR_VFL_TYPE_GRABBER_MIN; | 265 | base = MINOR_VFL_TYPE_GRABBER_MIN; |
@@ -281,7 +284,7 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, | |||
281 | default: | 284 | default: |
282 | printk(KERN_ERR "%s called with unknown type: %d\n", | 285 | printk(KERN_ERR "%s called with unknown type: %d\n", |
283 | __func__, type); | 286 | __func__, type); |
284 | return -1; | 287 | return -EINVAL; |
285 | } | 288 | } |
286 | 289 | ||
287 | /* pick a minor number */ | 290 | /* pick a minor number */ |
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index fdfe7739c96e..140ef92c19c1 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -499,7 +499,7 @@ static void dbgbuf(unsigned int cmd, struct video_device *vfd, | |||
499 | p->timestamp.tv_sec / 3600, | 499 | p->timestamp.tv_sec / 3600, |
500 | (int)(p->timestamp.tv_sec / 60) % 60, | 500 | (int)(p->timestamp.tv_sec / 60) % 60, |
501 | (int)(p->timestamp.tv_sec % 60), | 501 | (int)(p->timestamp.tv_sec % 60), |
502 | p->timestamp.tv_usec, | 502 | (long)p->timestamp.tv_usec, |
503 | p->index, | 503 | p->index, |
504 | prt_names(p->type, v4l2_type_names), | 504 | prt_names(p->type, v4l2_type_names), |
505 | p->bytesused, p->flags, | 505 | p->bytesused, p->flags, |
@@ -674,7 +674,7 @@ static int __video_do_ioctl(struct inode *inode, struct file *file, | |||
674 | __video_do_ioctl will be called again, with one or more | 674 | __video_do_ioctl will be called again, with one or more |
675 | V4L2 ioctls. | 675 | V4L2 ioctls. |
676 | ********************************************************/ | 676 | ********************************************************/ |
677 | if (_IOC_TYPE(cmd) == 'v') | 677 | if (_IOC_TYPE(cmd) == 'v' && _IOC_NR(cmd) < BASE_VIDIOCPRIVATE) |
678 | return v4l_compat_translate_ioctl(inode, file, cmd, arg, | 678 | return v4l_compat_translate_ioctl(inode, file, cmd, arg, |
679 | __video_do_ioctl); | 679 | __video_do_ioctl); |
680 | #endif | 680 | #endif |
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 3518af071a2e..8ba8daafd7ea 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -1021,13 +1021,13 @@ static int vivi_release(void) | |||
1021 | dev = list_entry(list, struct vivi_dev, vivi_devlist); | 1021 | dev = list_entry(list, struct vivi_dev, vivi_devlist); |
1022 | 1022 | ||
1023 | if (-1 != dev->vfd->minor) { | 1023 | if (-1 != dev->vfd->minor) { |
1024 | video_unregister_device(dev->vfd); | 1024 | printk(KERN_INFO "%s: unregistering /dev/video%d\n", |
1025 | printk(KERN_INFO "%s: /dev/video%d unregistered.\n", | ||
1026 | VIVI_MODULE_NAME, dev->vfd->minor); | 1025 | VIVI_MODULE_NAME, dev->vfd->minor); |
1026 | video_unregister_device(dev->vfd); | ||
1027 | } else { | 1027 | } else { |
1028 | video_device_release(dev->vfd); | 1028 | printk(KERN_INFO "%s: releasing /dev/video%d\n", |
1029 | printk(KERN_INFO "%s: /dev/video%d released.\n", | ||
1030 | VIVI_MODULE_NAME, dev->vfd->minor); | 1029 | VIVI_MODULE_NAME, dev->vfd->minor); |
1030 | video_device_release(dev->vfd); | ||
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | kfree(dev); | 1033 | kfree(dev); |
@@ -1104,19 +1104,29 @@ static struct video_device vivi_template = { | |||
1104 | Initialization and module stuff | 1104 | Initialization and module stuff |
1105 | ------------------------------------------------------------------*/ | 1105 | ------------------------------------------------------------------*/ |
1106 | 1106 | ||
1107 | /* This routine allocates from 1 to n_devs virtual drivers. | ||
1108 | |||
1109 | The real maximum number of virtual drivers will depend on how many drivers | ||
1110 | will succeed. This is limited to the maximum number of devices that | ||
1111 | videodev supports. Since there are 64 minors for video grabbers, this is | ||
1112 | currently the theoretical maximum limit. However, a further limit does | ||
1113 | exist at videodev that forbids any driver to register more than 32 video | ||
1114 | grabbers. | ||
1115 | */ | ||
1107 | static int __init vivi_init(void) | 1116 | static int __init vivi_init(void) |
1108 | { | 1117 | { |
1109 | int ret = -ENOMEM, i; | 1118 | int ret = -ENOMEM, i; |
1110 | struct vivi_dev *dev; | 1119 | struct vivi_dev *dev; |
1111 | struct video_device *vfd; | 1120 | struct video_device *vfd; |
1112 | 1121 | ||
1122 | if (n_devs <= 0) | ||
1123 | n_devs = 1; | ||
1124 | |||
1113 | for (i = 0; i < n_devs; i++) { | 1125 | for (i = 0; i < n_devs; i++) { |
1114 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 1126 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
1115 | if (NULL == dev) | 1127 | if (!dev) |
1116 | break; | 1128 | break; |
1117 | 1129 | ||
1118 | list_add_tail(&dev->vivi_devlist, &vivi_devlist); | ||
1119 | |||
1120 | /* init video dma queues */ | 1130 | /* init video dma queues */ |
1121 | INIT_LIST_HEAD(&dev->vidq.active); | 1131 | INIT_LIST_HEAD(&dev->vidq.active); |
1122 | init_waitqueue_head(&dev->vidq.wq); | 1132 | init_waitqueue_head(&dev->vidq.wq); |
@@ -1126,14 +1136,27 @@ static int __init vivi_init(void) | |||
1126 | mutex_init(&dev->mutex); | 1136 | mutex_init(&dev->mutex); |
1127 | 1137 | ||
1128 | vfd = video_device_alloc(); | 1138 | vfd = video_device_alloc(); |
1129 | if (NULL == vfd) | 1139 | if (!vfd) { |
1140 | kfree(dev); | ||
1130 | break; | 1141 | break; |
1142 | } | ||
1131 | 1143 | ||
1132 | *vfd = vivi_template; | 1144 | *vfd = vivi_template; |
1133 | 1145 | ||
1134 | ret = video_register_device(vfd, VFL_TYPE_GRABBER, video_nr); | 1146 | ret = video_register_device(vfd, VFL_TYPE_GRABBER, video_nr); |
1135 | if (ret < 0) | 1147 | if (ret < 0) { |
1148 | video_device_release(vfd); | ||
1149 | kfree(dev); | ||
1150 | |||
1151 | /* If some registers succeeded, keep driver */ | ||
1152 | if (i) | ||
1153 | ret = 0; | ||
1154 | |||
1136 | break; | 1155 | break; |
1156 | } | ||
1157 | |||
1158 | /* Now that everything is fine, let's add it to device list */ | ||
1159 | list_add_tail(&dev->vivi_devlist, &vivi_devlist); | ||
1137 | 1160 | ||
1138 | snprintf(vfd->name, sizeof(vfd->name), "%s (%i)", | 1161 | snprintf(vfd->name, sizeof(vfd->name), "%s (%i)", |
1139 | vivi_template.name, vfd->minor); | 1162 | vivi_template.name, vfd->minor); |
@@ -1149,11 +1172,16 @@ static int __init vivi_init(void) | |||
1149 | if (ret < 0) { | 1172 | if (ret < 0) { |
1150 | vivi_release(); | 1173 | vivi_release(); |
1151 | printk(KERN_INFO "Error %d while loading vivi driver\n", ret); | 1174 | printk(KERN_INFO "Error %d while loading vivi driver\n", ret); |
1152 | } else | 1175 | } else { |
1153 | printk(KERN_INFO "Video Technology Magazine Virtual Video " | 1176 | printk(KERN_INFO "Video Technology Magazine Virtual Video " |
1154 | "Capture Board ver %u.%u.%u successfully loaded.\n", | 1177 | "Capture Board ver %u.%u.%u successfully loaded.\n", |
1155 | (VIVI_VERSION >> 16) & 0xFF, (VIVI_VERSION >> 8) & 0xFF, | 1178 | (VIVI_VERSION >> 16) & 0xFF, (VIVI_VERSION >> 8) & 0xFF, |
1156 | VIVI_VERSION & 0xFF); | 1179 | VIVI_VERSION & 0xFF); |
1180 | |||
1181 | /* n_devs will reflect the actual number of allocated devices */ | ||
1182 | n_devs = i; | ||
1183 | } | ||
1184 | |||
1157 | return ret; | 1185 | return ret; |
1158 | } | 1186 | } |
1159 | 1187 | ||
@@ -1169,10 +1197,10 @@ MODULE_DESCRIPTION("Video Technology Magazine Virtual Video Capture Board"); | |||
1169 | MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); | 1197 | MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); |
1170 | MODULE_LICENSE("Dual BSD/GPL"); | 1198 | MODULE_LICENSE("Dual BSD/GPL"); |
1171 | 1199 | ||
1172 | module_param(video_nr, int, 0); | 1200 | module_param(video_nr, uint, 0444); |
1173 | MODULE_PARM_DESC(video_nr, "video iminor start number"); | 1201 | MODULE_PARM_DESC(video_nr, "video iminor start number"); |
1174 | 1202 | ||
1175 | module_param(n_devs, int, 0); | 1203 | module_param(n_devs, uint, 0444); |
1176 | MODULE_PARM_DESC(n_devs, "number of video devices to create"); | 1204 | MODULE_PARM_DESC(n_devs, "number of video devices to create"); |
1177 | 1205 | ||
1178 | module_param_named(debug, vivi_template.debug, int, 0444); | 1206 | module_param_named(debug, vivi_template.debug, int, 0444); |
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c index 9402f40095b4..2ff00bc5ad64 100644 --- a/drivers/media/video/w9966.c +++ b/drivers/media/video/w9966.c | |||
@@ -334,7 +334,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port) | |||
334 | memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); | 334 | memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); |
335 | cam->vdev.priv = cam; | 335 | cam->vdev.priv = cam; |
336 | 336 | ||
337 | if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) | 337 | if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) |
338 | return -1; | 338 | return -1; |
339 | 339 | ||
340 | w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV); | 340 | w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV); |
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c index 550ce7bd5c87..0c3287734c93 100644 --- a/drivers/media/video/zc0301/zc0301_core.c +++ b/drivers/media/video/zc0301/zc0301_core.c | |||
@@ -1988,6 +1988,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
1988 | cam->v4ldev->fops = &zc0301_fops; | 1988 | cam->v4ldev->fops = &zc0301_fops; |
1989 | cam->v4ldev->minor = video_nr[dev_nr]; | 1989 | cam->v4ldev->minor = video_nr[dev_nr]; |
1990 | cam->v4ldev->release = video_device_release; | 1990 | cam->v4ldev->release = video_device_release; |
1991 | cam->v4ldev->parent = &udev->dev; | ||
1991 | video_set_drvdata(cam->v4ldev, cam); | 1992 | video_set_drvdata(cam->v4ldev, cam); |
1992 | 1993 | ||
1993 | init_completion(&cam->probe); | 1994 | init_completion(&cam->probe); |
diff --git a/drivers/media/video/zc0301/zc0301_sensor.h b/drivers/media/video/zc0301/zc0301_sensor.h index 70fe6fc6cdd5..b0cd49c438a3 100644 --- a/drivers/media/video/zc0301/zc0301_sensor.h +++ b/drivers/media/video/zc0301/zc0301_sensor.h | |||
@@ -60,27 +60,8 @@ zc0301_attach_sensor(struct zc0301_device* cam, struct zc0301_sensor* sensor); | |||
60 | 60 | ||
61 | #define ZC0301_ID_TABLE \ | 61 | #define ZC0301_ID_TABLE \ |
62 | static const struct usb_device_id zc0301_id_table[] = { \ | 62 | static const struct usb_device_id zc0301_id_table[] = { \ |
63 | { ZC0301_USB_DEVICE(0x041e, 0x4017, 0xff), }, /* ICM105 */ \ | ||
64 | { ZC0301_USB_DEVICE(0x041e, 0x401c, 0xff), }, /* PAS106 */ \ | ||
65 | { ZC0301_USB_DEVICE(0x041e, 0x401e, 0xff), }, /* HV7131 */ \ | ||
66 | { ZC0301_USB_DEVICE(0x041e, 0x401f, 0xff), }, /* TAS5130 */ \ | ||
67 | { ZC0301_USB_DEVICE(0x041e, 0x4022, 0xff), }, \ | ||
68 | { ZC0301_USB_DEVICE(0x041e, 0x4034, 0xff), }, /* PAS106 */ \ | ||
69 | { ZC0301_USB_DEVICE(0x041e, 0x4035, 0xff), }, /* PAS106 */ \ | ||
70 | { ZC0301_USB_DEVICE(0x041e, 0x4036, 0xff), }, /* HV7131 */ \ | ||
71 | { ZC0301_USB_DEVICE(0x041e, 0x403a, 0xff), }, /* HV7131 */ \ | ||
72 | { ZC0301_USB_DEVICE(0x0458, 0x7007, 0xff), }, /* TAS5130 */ \ | ||
73 | { ZC0301_USB_DEVICE(0x0458, 0x700c, 0xff), }, /* TAS5130 */ \ | ||
74 | { ZC0301_USB_DEVICE(0x0458, 0x700f, 0xff), }, /* TAS5130 */ \ | ||
75 | { ZC0301_USB_DEVICE(0x046d, 0x08ae, 0xff), }, /* PAS202 */ \ | 63 | { ZC0301_USB_DEVICE(0x046d, 0x08ae, 0xff), }, /* PAS202 */ \ |
76 | { ZC0301_USB_DEVICE(0x055f, 0xd003, 0xff), }, /* TAS5130 */ \ | ||
77 | { ZC0301_USB_DEVICE(0x055f, 0xd004, 0xff), }, /* TAS5130 */ \ | ||
78 | { ZC0301_USB_DEVICE(0x0ac8, 0x0301, 0xff), }, \ | ||
79 | { ZC0301_USB_DEVICE(0x0ac8, 0x301b, 0xff), }, /* PB-0330/HV7131 */ \ | ||
80 | { ZC0301_USB_DEVICE(0x0ac8, 0x303b, 0xff), }, /* PB-0330 */ \ | 64 | { ZC0301_USB_DEVICE(0x0ac8, 0x303b, 0xff), }, /* PB-0330 */ \ |
81 | { ZC0301_USB_DEVICE(0x10fd, 0x0128, 0xff), }, /* TAS5130 */ \ | ||
82 | { ZC0301_USB_DEVICE(0x10fd, 0x8050, 0xff), }, /* TAS5130 */ \ | ||
83 | { ZC0301_USB_DEVICE(0x10fd, 0x804e, 0xff), }, /* TAS5130 */ \ | ||
84 | { } \ | 65 | { } \ |
85 | }; | 66 | }; |
86 | 67 | ||
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index a38005008a20..cea46906408e 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c | |||
@@ -185,7 +185,7 @@ static void memstick_free(struct device *dev) | |||
185 | } | 185 | } |
186 | 186 | ||
187 | static struct class memstick_host_class = { | 187 | static struct class memstick_host_class = { |
188 | .name = "memstick_host", | 188 | .name = "memstick_host", |
189 | .dev_release = memstick_free | 189 | .dev_release = memstick_free |
190 | }; | 190 | }; |
191 | 191 | ||
@@ -264,7 +264,7 @@ EXPORT_SYMBOL(memstick_new_req); | |||
264 | * @sg - TPC argument | 264 | * @sg - TPC argument |
265 | */ | 265 | */ |
266 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, | 266 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, |
267 | struct scatterlist *sg) | 267 | const struct scatterlist *sg) |
268 | { | 268 | { |
269 | mrq->tpc = tpc; | 269 | mrq->tpc = tpc; |
270 | if (tpc & 8) | 270 | if (tpc & 8) |
@@ -294,7 +294,7 @@ EXPORT_SYMBOL(memstick_init_req_sg); | |||
294 | * user supplied buffer. | 294 | * user supplied buffer. |
295 | */ | 295 | */ |
296 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, | 296 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, |
297 | void *buf, size_t length) | 297 | const void *buf, size_t length) |
298 | { | 298 | { |
299 | mrq->tpc = tpc; | 299 | mrq->tpc = tpc; |
300 | if (tpc & 8) | 300 | if (tpc & 8) |
@@ -439,7 +439,7 @@ static void memstick_check(struct work_struct *work) | |||
439 | if (!host->card) { | 439 | if (!host->card) { |
440 | if (memstick_power_on(host)) | 440 | if (memstick_power_on(host)) |
441 | goto out_power_off; | 441 | goto out_power_off; |
442 | } else | 442 | } else if (host->card->stop) |
443 | host->card->stop(host->card); | 443 | host->card->stop(host->card); |
444 | 444 | ||
445 | card = memstick_alloc_card(host); | 445 | card = memstick_alloc_card(host); |
@@ -458,7 +458,7 @@ static void memstick_check(struct work_struct *work) | |||
458 | || !(host->card->check(host->card))) { | 458 | || !(host->card->check(host->card))) { |
459 | device_unregister(&host->card->dev); | 459 | device_unregister(&host->card->dev); |
460 | host->card = NULL; | 460 | host->card = NULL; |
461 | } else | 461 | } else if (host->card->start) |
462 | host->card->start(host->card); | 462 | host->card->start(host->card); |
463 | } | 463 | } |
464 | 464 | ||
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 44b1817f2f2f..d2d2318dafa4 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c | |||
@@ -30,6 +30,8 @@ module_param(major, int, 0644); | |||
30 | #define MSPRO_BLOCK_SIGNATURE 0xa5c3 | 30 | #define MSPRO_BLOCK_SIGNATURE 0xa5c3 |
31 | #define MSPRO_BLOCK_MAX_ATTRIBUTES 41 | 31 | #define MSPRO_BLOCK_MAX_ATTRIBUTES 41 |
32 | 32 | ||
33 | #define MSPRO_BLOCK_PART_SHIFT 3 | ||
34 | |||
33 | enum { | 35 | enum { |
34 | MSPRO_BLOCK_ID_SYSINFO = 0x10, | 36 | MSPRO_BLOCK_ID_SYSINFO = 0x10, |
35 | MSPRO_BLOCK_ID_MODELNAME = 0x15, | 37 | MSPRO_BLOCK_ID_MODELNAME = 0x15, |
@@ -195,7 +197,7 @@ static int mspro_block_bd_open(struct inode *inode, struct file *filp) | |||
195 | static int mspro_block_disk_release(struct gendisk *disk) | 197 | static int mspro_block_disk_release(struct gendisk *disk) |
196 | { | 198 | { |
197 | struct mspro_block_data *msb = disk->private_data; | 199 | struct mspro_block_data *msb = disk->private_data; |
198 | int disk_id = disk->first_minor >> MEMSTICK_PART_SHIFT; | 200 | int disk_id = disk->first_minor >> MSPRO_BLOCK_PART_SHIFT; |
199 | 201 | ||
200 | mutex_lock(&mspro_block_disk_lock); | 202 | mutex_lock(&mspro_block_disk_lock); |
201 | 203 | ||
@@ -877,6 +879,7 @@ static int mspro_block_switch_interface(struct memstick_dev *card) | |||
877 | struct mspro_block_data *msb = memstick_get_drvdata(card); | 879 | struct mspro_block_data *msb = memstick_get_drvdata(card); |
878 | int rc = 0; | 880 | int rc = 0; |
879 | 881 | ||
882 | try_again: | ||
880 | if (msb->caps & MEMSTICK_CAP_PAR4) | 883 | if (msb->caps & MEMSTICK_CAP_PAR4) |
881 | rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR4); | 884 | rc = mspro_block_set_interface(card, MEMSTICK_SYS_PAR4); |
882 | else | 885 | else |
@@ -930,6 +933,18 @@ static int mspro_block_switch_interface(struct memstick_dev *card) | |||
930 | rc = memstick_set_rw_addr(card); | 933 | rc = memstick_set_rw_addr(card); |
931 | if (!rc) | 934 | if (!rc) |
932 | rc = mspro_block_set_interface(card, msb->system); | 935 | rc = mspro_block_set_interface(card, msb->system); |
936 | |||
937 | if (!rc) { | ||
938 | msleep(150); | ||
939 | rc = mspro_block_wait_for_ced(card); | ||
940 | if (rc) | ||
941 | return rc; | ||
942 | |||
943 | if (msb->caps & MEMSTICK_CAP_PAR8) { | ||
944 | msb->caps &= ~MEMSTICK_CAP_PAR8; | ||
945 | goto try_again; | ||
946 | } | ||
947 | } | ||
933 | } | 948 | } |
934 | return rc; | 949 | return rc; |
935 | } | 950 | } |
@@ -1117,14 +1132,16 @@ static int mspro_block_init_card(struct memstick_dev *card) | |||
1117 | return -EIO; | 1132 | return -EIO; |
1118 | 1133 | ||
1119 | msb->caps = host->caps; | 1134 | msb->caps = host->caps; |
1120 | rc = mspro_block_switch_interface(card); | 1135 | |
1136 | msleep(150); | ||
1137 | rc = mspro_block_wait_for_ced(card); | ||
1121 | if (rc) | 1138 | if (rc) |
1122 | return rc; | 1139 | return rc; |
1123 | 1140 | ||
1124 | msleep(200); | 1141 | rc = mspro_block_switch_interface(card); |
1125 | rc = mspro_block_wait_for_ced(card); | ||
1126 | if (rc) | 1142 | if (rc) |
1127 | return rc; | 1143 | return rc; |
1144 | |||
1128 | dev_dbg(&card->dev, "card activated\n"); | 1145 | dev_dbg(&card->dev, "card activated\n"); |
1129 | if (msb->system != MEMSTICK_SYS_SERIAL) | 1146 | if (msb->system != MEMSTICK_SYS_SERIAL) |
1130 | msb->caps |= MEMSTICK_CAP_AUTO_GET_INT; | 1147 | msb->caps |= MEMSTICK_CAP_AUTO_GET_INT; |
@@ -1192,12 +1209,12 @@ static int mspro_block_init_disk(struct memstick_dev *card) | |||
1192 | if (rc) | 1209 | if (rc) |
1193 | return rc; | 1210 | return rc; |
1194 | 1211 | ||
1195 | if ((disk_id << MEMSTICK_PART_SHIFT) > 255) { | 1212 | if ((disk_id << MSPRO_BLOCK_PART_SHIFT) > 255) { |
1196 | rc = -ENOSPC; | 1213 | rc = -ENOSPC; |
1197 | goto out_release_id; | 1214 | goto out_release_id; |
1198 | } | 1215 | } |
1199 | 1216 | ||
1200 | msb->disk = alloc_disk(1 << MEMSTICK_PART_SHIFT); | 1217 | msb->disk = alloc_disk(1 << MSPRO_BLOCK_PART_SHIFT); |
1201 | if (!msb->disk) { | 1218 | if (!msb->disk) { |
1202 | rc = -ENOMEM; | 1219 | rc = -ENOMEM; |
1203 | goto out_release_id; | 1220 | goto out_release_id; |
@@ -1220,7 +1237,7 @@ static int mspro_block_init_disk(struct memstick_dev *card) | |||
1220 | MSPRO_BLOCK_MAX_PAGES * msb->page_size); | 1237 | MSPRO_BLOCK_MAX_PAGES * msb->page_size); |
1221 | 1238 | ||
1222 | msb->disk->major = major; | 1239 | msb->disk->major = major; |
1223 | msb->disk->first_minor = disk_id << MEMSTICK_PART_SHIFT; | 1240 | msb->disk->first_minor = disk_id << MSPRO_BLOCK_PART_SHIFT; |
1224 | msb->disk->fops = &ms_block_bdops; | 1241 | msb->disk->fops = &ms_block_bdops; |
1225 | msb->usage_count = 1; | 1242 | msb->usage_count = 1; |
1226 | msb->disk->private_data = msb; | 1243 | msb->disk->private_data = msb; |
@@ -1416,7 +1433,7 @@ out_unlock: | |||
1416 | 1433 | ||
1417 | static struct memstick_device_id mspro_block_id_tbl[] = { | 1434 | static struct memstick_device_id mspro_block_id_tbl[] = { |
1418 | {MEMSTICK_MATCH_ALL, MEMSTICK_TYPE_PRO, MEMSTICK_CATEGORY_STORAGE_DUO, | 1435 | {MEMSTICK_MATCH_ALL, MEMSTICK_TYPE_PRO, MEMSTICK_CATEGORY_STORAGE_DUO, |
1419 | MEMSTICK_CLASS_GENERIC_DUO}, | 1436 | MEMSTICK_CLASS_DUO}, |
1420 | {} | 1437 | {} |
1421 | }; | 1438 | }; |
1422 | 1439 | ||
diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c index 3485c63d20b0..2fb95a5b72eb 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c | |||
@@ -81,6 +81,8 @@ struct jmb38x_ms { | |||
81 | #define TPC_CODE_SZ_MASK 0x00000700 | 81 | #define TPC_CODE_SZ_MASK 0x00000700 |
82 | #define TPC_DATA_SZ_MASK 0x00000007 | 82 | #define TPC_DATA_SZ_MASK 0x00000007 |
83 | 83 | ||
84 | #define HOST_CONTROL_TDELAY_EN 0x00040000 | ||
85 | #define HOST_CONTROL_HW_OC_P 0x00010000 | ||
84 | #define HOST_CONTROL_RESET_REQ 0x00008000 | 86 | #define HOST_CONTROL_RESET_REQ 0x00008000 |
85 | #define HOST_CONTROL_REI 0x00004000 | 87 | #define HOST_CONTROL_REI 0x00004000 |
86 | #define HOST_CONTROL_LED 0x00000400 | 88 | #define HOST_CONTROL_LED 0x00000400 |
@@ -88,6 +90,7 @@ struct jmb38x_ms { | |||
88 | #define HOST_CONTROL_RESET 0x00000100 | 90 | #define HOST_CONTROL_RESET 0x00000100 |
89 | #define HOST_CONTROL_POWER_EN 0x00000080 | 91 | #define HOST_CONTROL_POWER_EN 0x00000080 |
90 | #define HOST_CONTROL_CLOCK_EN 0x00000040 | 92 | #define HOST_CONTROL_CLOCK_EN 0x00000040 |
93 | #define HOST_CONTROL_REO 0x00000008 | ||
91 | #define HOST_CONTROL_IF_SHIFT 4 | 94 | #define HOST_CONTROL_IF_SHIFT 4 |
92 | 95 | ||
93 | #define HOST_CONTROL_IF_SERIAL 0x0 | 96 | #define HOST_CONTROL_IF_SERIAL 0x0 |
@@ -133,11 +136,15 @@ struct jmb38x_ms { | |||
133 | #define PAD_PU_PD_ON_MS_SOCK1 0x0f0f0000 | 136 | #define PAD_PU_PD_ON_MS_SOCK1 0x0f0f0000 |
134 | 137 | ||
135 | #define CLOCK_CONTROL_40MHZ 0x00000001 | 138 | #define CLOCK_CONTROL_40MHZ 0x00000001 |
136 | #define CLOCK_CONTROL_50MHZ 0x00000002 | 139 | #define CLOCK_CONTROL_50MHZ 0x0000000a |
137 | #define CLOCK_CONTROL_60MHZ 0x00000008 | 140 | #define CLOCK_CONTROL_60MHZ 0x00000008 |
138 | #define CLOCK_CONTROL_62_5MHZ 0x0000000c | 141 | #define CLOCK_CONTROL_62_5MHZ 0x0000000c |
139 | #define CLOCK_CONTROL_OFF 0x00000000 | 142 | #define CLOCK_CONTROL_OFF 0x00000000 |
140 | 143 | ||
144 | #define PCI_CTL_CLOCK_DLY_ADDR 0x000000b0 | ||
145 | #define PCI_CTL_CLOCK_DLY_MASK_A 0x00000f00 | ||
146 | #define PCI_CTL_CLOCK_DLY_MASK_B 0x0000f000 | ||
147 | |||
141 | enum { | 148 | enum { |
142 | CMD_READY = 0x01, | 149 | CMD_READY = 0x01, |
143 | FIFO_READY = 0x02, | 150 | FIFO_READY = 0x02, |
@@ -367,8 +374,7 @@ static int jmb38x_ms_issue_cmd(struct memstick_host *msh) | |||
367 | return host->req->error; | 374 | return host->req->error; |
368 | } | 375 | } |
369 | 376 | ||
370 | dev_dbg(&msh->dev, "control %08x\n", | 377 | dev_dbg(&msh->dev, "control %08x\n", readl(host->addr + HOST_CONTROL)); |
371 | readl(host->addr + HOST_CONTROL)); | ||
372 | dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS)); | 378 | dev_dbg(&msh->dev, "status %08x\n", readl(host->addr + INT_STATUS)); |
373 | dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS)); | 379 | dev_dbg(&msh->dev, "hstatus %08x\n", readl(host->addr + STATUS)); |
374 | 380 | ||
@@ -637,7 +643,7 @@ static int jmb38x_ms_reset(struct jmb38x_ms_host *host) | |||
637 | ndelay(20); | 643 | ndelay(20); |
638 | } | 644 | } |
639 | dev_dbg(&host->chip->pdev->dev, "reset_req timeout\n"); | 645 | dev_dbg(&host->chip->pdev->dev, "reset_req timeout\n"); |
640 | return -EIO; | 646 | /* return -EIO; */ |
641 | 647 | ||
642 | reset_next: | 648 | reset_next: |
643 | writel(HOST_CONTROL_RESET | HOST_CONTROL_CLOCK_EN | 649 | writel(HOST_CONTROL_RESET | HOST_CONTROL_CLOCK_EN |
@@ -680,7 +686,9 @@ static int jmb38x_ms_set_param(struct memstick_host *msh, | |||
680 | 686 | ||
681 | host_ctl = 7; | 687 | host_ctl = 7; |
682 | host_ctl |= HOST_CONTROL_POWER_EN | 688 | host_ctl |= HOST_CONTROL_POWER_EN |
683 | | HOST_CONTROL_CLOCK_EN; | 689 | | HOST_CONTROL_CLOCK_EN |
690 | | HOST_CONTROL_HW_OC_P | ||
691 | | HOST_CONTROL_TDELAY_EN; | ||
684 | writel(host_ctl, host->addr + HOST_CONTROL); | 692 | writel(host_ctl, host->addr + HOST_CONTROL); |
685 | 693 | ||
686 | writel(host->id ? PAD_PU_PD_ON_MS_SOCK1 | 694 | writel(host->id ? PAD_PU_PD_ON_MS_SOCK1 |
@@ -704,33 +712,40 @@ static int jmb38x_ms_set_param(struct memstick_host *msh, | |||
704 | break; | 712 | break; |
705 | case MEMSTICK_INTERFACE: | 713 | case MEMSTICK_INTERFACE: |
706 | host_ctl &= ~(3 << HOST_CONTROL_IF_SHIFT); | 714 | host_ctl &= ~(3 << HOST_CONTROL_IF_SHIFT); |
715 | pci_read_config_dword(host->chip->pdev, | ||
716 | PCI_CTL_CLOCK_DLY_ADDR, | ||
717 | &clock_delay); | ||
718 | clock_delay &= host->id ? ~PCI_CTL_CLOCK_DLY_MASK_B | ||
719 | : ~PCI_CTL_CLOCK_DLY_MASK_A; | ||
707 | 720 | ||
708 | if (value == MEMSTICK_SERIAL) { | 721 | if (value == MEMSTICK_SERIAL) { |
709 | host_ctl &= ~HOST_CONTROL_FAST_CLK; | 722 | host_ctl &= ~HOST_CONTROL_FAST_CLK; |
723 | host_ctl &= ~HOST_CONTROL_REO; | ||
710 | host_ctl |= HOST_CONTROL_IF_SERIAL | 724 | host_ctl |= HOST_CONTROL_IF_SERIAL |
711 | << HOST_CONTROL_IF_SHIFT; | 725 | << HOST_CONTROL_IF_SHIFT; |
712 | host_ctl |= HOST_CONTROL_REI; | 726 | host_ctl |= HOST_CONTROL_REI; |
713 | clock_ctl = CLOCK_CONTROL_40MHZ; | 727 | clock_ctl = CLOCK_CONTROL_40MHZ; |
714 | clock_delay = 0; | ||
715 | } else if (value == MEMSTICK_PAR4) { | 728 | } else if (value == MEMSTICK_PAR4) { |
716 | host_ctl |= HOST_CONTROL_FAST_CLK; | 729 | host_ctl |= HOST_CONTROL_FAST_CLK | HOST_CONTROL_REO; |
717 | host_ctl |= HOST_CONTROL_IF_PAR4 | 730 | host_ctl |= HOST_CONTROL_IF_PAR4 |
718 | << HOST_CONTROL_IF_SHIFT; | 731 | << HOST_CONTROL_IF_SHIFT; |
719 | host_ctl &= ~HOST_CONTROL_REI; | 732 | host_ctl &= ~HOST_CONTROL_REI; |
720 | clock_ctl = CLOCK_CONTROL_40MHZ; | 733 | clock_ctl = CLOCK_CONTROL_40MHZ; |
721 | clock_delay = 4; | 734 | clock_delay |= host->id ? (4 << 12) : (4 << 8); |
722 | } else if (value == MEMSTICK_PAR8) { | 735 | } else if (value == MEMSTICK_PAR8) { |
723 | host_ctl |= HOST_CONTROL_FAST_CLK; | 736 | host_ctl |= HOST_CONTROL_FAST_CLK; |
724 | host_ctl |= HOST_CONTROL_IF_PAR8 | 737 | host_ctl |= HOST_CONTROL_IF_PAR8 |
725 | << HOST_CONTROL_IF_SHIFT; | 738 | << HOST_CONTROL_IF_SHIFT; |
726 | host_ctl &= ~HOST_CONTROL_REI; | 739 | host_ctl &= ~(HOST_CONTROL_REI | HOST_CONTROL_REO); |
727 | clock_ctl = CLOCK_CONTROL_60MHZ; | 740 | clock_ctl = CLOCK_CONTROL_50MHZ; |
728 | clock_delay = 0; | ||
729 | } else | 741 | } else |
730 | return -EINVAL; | 742 | return -EINVAL; |
743 | |||
731 | writel(host_ctl, host->addr + HOST_CONTROL); | 744 | writel(host_ctl, host->addr + HOST_CONTROL); |
732 | writel(clock_ctl, host->addr + CLOCK_CONTROL); | 745 | writel(clock_ctl, host->addr + CLOCK_CONTROL); |
733 | writel(clock_delay, host->addr + CLOCK_DELAY); | 746 | pci_write_config_dword(host->chip->pdev, |
747 | PCI_CTL_CLOCK_DLY_ADDR, | ||
748 | clock_delay); | ||
734 | break; | 749 | break; |
735 | }; | 750 | }; |
736 | return 0; | 751 | return 0; |
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index c6c77a505ec1..d8b0d326e452 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c | |||
@@ -1189,7 +1189,7 @@ static int create_debugfs(void) | |||
1189 | return 0; | 1189 | return 0; |
1190 | 1190 | ||
1191 | error_debugfs: | 1191 | error_debugfs: |
1192 | remove_debugfs(); | 1192 | remove_debugfs(); |
1193 | return -ENOMEM; | 1193 | return -ENOMEM; |
1194 | } | 1194 | } |
1195 | 1195 | ||
@@ -1272,6 +1272,7 @@ error_platform_register: | |||
1272 | static void __exit acer_wmi_exit(void) | 1272 | static void __exit acer_wmi_exit(void) |
1273 | { | 1273 | { |
1274 | remove_sysfs(acer_platform_device); | 1274 | remove_sysfs(acer_platform_device); |
1275 | remove_debugfs(); | ||
1275 | platform_device_del(acer_platform_device); | 1276 | platform_device_del(acer_platform_device); |
1276 | platform_driver_unregister(&acer_platform_driver); | 1277 | platform_driver_unregister(&acer_platform_driver); |
1277 | 1278 | ||
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c index 7a1ef6c262de..3e56203e4947 100644 --- a/drivers/misc/fujitsu-laptop.c +++ b/drivers/misc/fujitsu-laptop.c | |||
@@ -463,6 +463,13 @@ static struct dmi_system_id __initdata fujitsu_dmi_table[] = { | |||
463 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6410"), | 463 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK S6410"), |
464 | }, | 464 | }, |
465 | .callback = dmi_check_cb_s6410}, | 465 | .callback = dmi_check_cb_s6410}, |
466 | { | ||
467 | .ident = "FUJITSU LifeBook P8010", | ||
468 | .matches = { | ||
469 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
470 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P8010"), | ||
471 | }, | ||
472 | .callback = dmi_check_cb_s6410}, | ||
466 | {} | 473 | {} |
467 | }; | 474 | }; |
468 | 475 | ||
diff --git a/drivers/misc/hp-wmi.c b/drivers/misc/hp-wmi.c index 1dbcbcb323a2..6d407c2a4f91 100644 --- a/drivers/misc/hp-wmi.c +++ b/drivers/misc/hp-wmi.c | |||
@@ -49,6 +49,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); | |||
49 | #define HPWMI_ALS_QUERY 0x3 | 49 | #define HPWMI_ALS_QUERY 0x3 |
50 | #define HPWMI_DOCK_QUERY 0x4 | 50 | #define HPWMI_DOCK_QUERY 0x4 |
51 | #define HPWMI_WIRELESS_QUERY 0x5 | 51 | #define HPWMI_WIRELESS_QUERY 0x5 |
52 | #define HPWMI_HOTKEY_QUERY 0xc | ||
52 | 53 | ||
53 | static int __init hp_wmi_bios_setup(struct platform_device *device); | 54 | static int __init hp_wmi_bios_setup(struct platform_device *device); |
54 | static int __exit hp_wmi_bios_remove(struct platform_device *device); | 55 | static int __exit hp_wmi_bios_remove(struct platform_device *device); |
@@ -69,7 +70,7 @@ struct bios_return { | |||
69 | 70 | ||
70 | struct key_entry { | 71 | struct key_entry { |
71 | char type; /* See KE_* below */ | 72 | char type; /* See KE_* below */ |
72 | u8 code; | 73 | u16 code; |
73 | u16 keycode; | 74 | u16 keycode; |
74 | }; | 75 | }; |
75 | 76 | ||
@@ -79,7 +80,9 @@ static struct key_entry hp_wmi_keymap[] = { | |||
79 | {KE_SW, 0x01, SW_DOCK}, | 80 | {KE_SW, 0x01, SW_DOCK}, |
80 | {KE_KEY, 0x02, KEY_BRIGHTNESSUP}, | 81 | {KE_KEY, 0x02, KEY_BRIGHTNESSUP}, |
81 | {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN}, | 82 | {KE_KEY, 0x03, KEY_BRIGHTNESSDOWN}, |
82 | {KE_KEY, 0x04, KEY_HELP}, | 83 | {KE_KEY, 0x20e6, KEY_PROG1}, |
84 | {KE_KEY, 0x2142, KEY_MEDIA}, | ||
85 | {KE_KEY, 0x231b, KEY_HELP}, | ||
83 | {KE_END, 0} | 86 | {KE_END, 0} |
84 | }; | 87 | }; |
85 | 88 | ||
@@ -177,9 +180,9 @@ static int hp_wmi_wifi_state(void) | |||
177 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 180 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
178 | 181 | ||
179 | if (wireless & 0x100) | 182 | if (wireless & 0x100) |
180 | return 1; | 183 | return RFKILL_STATE_UNBLOCKED; |
181 | else | 184 | else |
182 | return 0; | 185 | return RFKILL_STATE_SOFT_BLOCKED; |
183 | } | 186 | } |
184 | 187 | ||
185 | static int hp_wmi_bluetooth_state(void) | 188 | static int hp_wmi_bluetooth_state(void) |
@@ -187,9 +190,9 @@ static int hp_wmi_bluetooth_state(void) | |||
187 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 190 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
188 | 191 | ||
189 | if (wireless & 0x10000) | 192 | if (wireless & 0x10000) |
190 | return 1; | 193 | return RFKILL_STATE_UNBLOCKED; |
191 | else | 194 | else |
192 | return 0; | 195 | return RFKILL_STATE_SOFT_BLOCKED; |
193 | } | 196 | } |
194 | 197 | ||
195 | static int hp_wmi_wwan_state(void) | 198 | static int hp_wmi_wwan_state(void) |
@@ -197,9 +200,9 @@ static int hp_wmi_wwan_state(void) | |||
197 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | 200 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); |
198 | 201 | ||
199 | if (wireless & 0x1000000) | 202 | if (wireless & 0x1000000) |
200 | return 1; | 203 | return RFKILL_STATE_UNBLOCKED; |
201 | else | 204 | else |
202 | return 0; | 205 | return RFKILL_STATE_SOFT_BLOCKED; |
203 | } | 206 | } |
204 | 207 | ||
205 | static ssize_t show_display(struct device *dev, struct device_attribute *attr, | 208 | static ssize_t show_display(struct device *dev, struct device_attribute *attr, |
@@ -318,6 +321,9 @@ void hp_wmi_notify(u32 value, void *context) | |||
318 | 321 | ||
319 | if (obj && obj->type == ACPI_TYPE_BUFFER && obj->buffer.length == 8) { | 322 | if (obj && obj->type == ACPI_TYPE_BUFFER && obj->buffer.length == 8) { |
320 | int eventcode = *((u8 *) obj->buffer.pointer); | 323 | int eventcode = *((u8 *) obj->buffer.pointer); |
324 | if (eventcode == 0x4) | ||
325 | eventcode = hp_wmi_perform_query(HPWMI_HOTKEY_QUERY, 0, | ||
326 | 0); | ||
321 | key = hp_wmi_get_entry_by_scancode(eventcode); | 327 | key = hp_wmi_get_entry_by_scancode(eventcode); |
322 | if (key) { | 328 | if (key) { |
323 | switch (key->type) { | 329 | switch (key->type) { |
@@ -338,12 +344,14 @@ void hp_wmi_notify(u32 value, void *context) | |||
338 | } | 344 | } |
339 | } else if (eventcode == 0x5) { | 345 | } else if (eventcode == 0x5) { |
340 | if (wifi_rfkill) | 346 | if (wifi_rfkill) |
341 | wifi_rfkill->state = hp_wmi_wifi_state(); | 347 | rfkill_force_state(wifi_rfkill, |
348 | hp_wmi_wifi_state()); | ||
342 | if (bluetooth_rfkill) | 349 | if (bluetooth_rfkill) |
343 | bluetooth_rfkill->state = | 350 | rfkill_force_state(bluetooth_rfkill, |
344 | hp_wmi_bluetooth_state(); | 351 | hp_wmi_bluetooth_state()); |
345 | if (wwan_rfkill) | 352 | if (wwan_rfkill) |
346 | wwan_rfkill->state = hp_wmi_wwan_state(); | 353 | rfkill_force_state(wwan_rfkill, |
354 | hp_wmi_wwan_state()); | ||
347 | } else | 355 | } else |
348 | printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", | 356 | printk(KERN_INFO "HP WMI: Unknown key pressed - %x\n", |
349 | eventcode); | 357 | eventcode); |
@@ -398,6 +406,7 @@ static void cleanup_sysfs(struct platform_device *device) | |||
398 | static int __init hp_wmi_bios_setup(struct platform_device *device) | 406 | static int __init hp_wmi_bios_setup(struct platform_device *device) |
399 | { | 407 | { |
400 | int err; | 408 | int err; |
409 | int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0); | ||
401 | 410 | ||
402 | err = device_create_file(&device->dev, &dev_attr_display); | 411 | err = device_create_file(&device->dev, &dev_attr_display); |
403 | if (err) | 412 | if (err) |
@@ -412,28 +421,33 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) | |||
412 | if (err) | 421 | if (err) |
413 | goto add_sysfs_error; | 422 | goto add_sysfs_error; |
414 | 423 | ||
415 | wifi_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WLAN); | 424 | if (wireless & 0x1) { |
416 | wifi_rfkill->name = "hp-wifi"; | 425 | wifi_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WLAN); |
417 | wifi_rfkill->state = hp_wmi_wifi_state(); | 426 | wifi_rfkill->name = "hp-wifi"; |
418 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; | 427 | wifi_rfkill->state = hp_wmi_wifi_state(); |
419 | wifi_rfkill->user_claim_unsupported = 1; | 428 | wifi_rfkill->toggle_radio = hp_wmi_wifi_set; |
420 | 429 | wifi_rfkill->user_claim_unsupported = 1; | |
421 | bluetooth_rfkill = rfkill_allocate(&device->dev, | 430 | rfkill_register(wifi_rfkill); |
422 | RFKILL_TYPE_BLUETOOTH); | 431 | } |
423 | bluetooth_rfkill->name = "hp-bluetooth"; | 432 | |
424 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); | 433 | if (wireless & 0x2) { |
425 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; | 434 | bluetooth_rfkill = rfkill_allocate(&device->dev, |
426 | bluetooth_rfkill->user_claim_unsupported = 1; | 435 | RFKILL_TYPE_BLUETOOTH); |
427 | 436 | bluetooth_rfkill->name = "hp-bluetooth"; | |
428 | wwan_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WIMAX); | 437 | bluetooth_rfkill->state = hp_wmi_bluetooth_state(); |
429 | wwan_rfkill->name = "hp-wwan"; | 438 | bluetooth_rfkill->toggle_radio = hp_wmi_bluetooth_set; |
430 | wwan_rfkill->state = hp_wmi_wwan_state(); | 439 | bluetooth_rfkill->user_claim_unsupported = 1; |
431 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; | 440 | rfkill_register(bluetooth_rfkill); |
432 | wwan_rfkill->user_claim_unsupported = 1; | 441 | } |
433 | 442 | ||
434 | rfkill_register(wifi_rfkill); | 443 | if (wireless & 0x4) { |
435 | rfkill_register(bluetooth_rfkill); | 444 | wwan_rfkill = rfkill_allocate(&device->dev, RFKILL_TYPE_WWAN); |
436 | rfkill_register(wwan_rfkill); | 445 | wwan_rfkill->name = "hp-wwan"; |
446 | wwan_rfkill->state = hp_wmi_wwan_state(); | ||
447 | wwan_rfkill->toggle_radio = hp_wmi_wwan_set; | ||
448 | wwan_rfkill->user_claim_unsupported = 1; | ||
449 | rfkill_register(wwan_rfkill); | ||
450 | } | ||
437 | 451 | ||
438 | return 0; | 452 | return 0; |
439 | add_sysfs_error: | 453 | add_sysfs_error: |
@@ -445,9 +459,12 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device) | |||
445 | { | 459 | { |
446 | cleanup_sysfs(device); | 460 | cleanup_sysfs(device); |
447 | 461 | ||
448 | rfkill_unregister(wifi_rfkill); | 462 | if (wifi_rfkill) |
449 | rfkill_unregister(bluetooth_rfkill); | 463 | rfkill_unregister(wifi_rfkill); |
450 | rfkill_unregister(wwan_rfkill); | 464 | if (bluetooth_rfkill) |
465 | rfkill_unregister(bluetooth_rfkill); | ||
466 | if (wwan_rfkill) | ||
467 | rfkill_unregister(wwan_rfkill); | ||
451 | 468 | ||
452 | return 0; | 469 | return 0; |
453 | } | 470 | } |
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 23c91f5f6b61..d61cee796efd 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c | |||
@@ -445,6 +445,9 @@ static void __exit gru_exit(void) | |||
445 | int order = get_order(sizeof(struct gru_state) * | 445 | int order = get_order(sizeof(struct gru_state) * |
446 | GRU_CHIPLETS_PER_BLADE); | 446 | GRU_CHIPLETS_PER_BLADE); |
447 | 447 | ||
448 | if (!IS_UV()) | ||
449 | return; | ||
450 | |||
448 | for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) | 451 | for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++) |
449 | free_irq(IRQ_GRU + i, NULL); | 452 | free_irq(IRQ_GRU + i, NULL); |
450 | 453 | ||
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index d3eb7903c346..6b9300779a43 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -3086,7 +3086,6 @@ static struct ibm_struct wan_driver_data = { | |||
3086 | .read = wan_read, | 3086 | .read = wan_read, |
3087 | .write = wan_write, | 3087 | .write = wan_write, |
3088 | .exit = wan_exit, | 3088 | .exit = wan_exit, |
3089 | .flags.experimental = 1, | ||
3090 | }; | 3089 | }; |
3091 | 3090 | ||
3092 | /************************************************************************* | 3091 | /************************************************************************* |
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 43d9a5b53e8d..ebc8b9d77613 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -103,8 +103,10 @@ static int mmc_blk_open(struct inode *inode, struct file *filp) | |||
103 | check_disk_change(inode->i_bdev); | 103 | check_disk_change(inode->i_bdev); |
104 | ret = 0; | 104 | ret = 0; |
105 | 105 | ||
106 | if ((filp->f_mode & FMODE_WRITE) && md->read_only) | 106 | if ((filp->f_mode & FMODE_WRITE) && md->read_only) { |
107 | mmc_blk_put(md); | ||
107 | ret = -EROFS; | 108 | ret = -EROFS; |
109 | } | ||
108 | } | 110 | } |
109 | 111 | ||
110 | return ret; | 112 | return ret; |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 6915f40ac8ab..1f8b5b36222c 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
@@ -621,12 +621,21 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command | |||
621 | if (cpu_is_at91sam9260 () || cpu_is_at91sam9263()) | 621 | if (cpu_is_at91sam9260 () || cpu_is_at91sam9263()) |
622 | if (host->total_length < 12) | 622 | if (host->total_length < 12) |
623 | host->total_length = 12; | 623 | host->total_length = 12; |
624 | host->buffer = dma_alloc_coherent(NULL, | 624 | |
625 | host->total_length, | 625 | host->buffer = kmalloc(host->total_length, GFP_KERNEL); |
626 | &host->physical_address, GFP_KERNEL); | 626 | if (!host->buffer) { |
627 | pr_debug("Can't alloc tx buffer\n"); | ||
628 | cmd->error = -ENOMEM; | ||
629 | mmc_request_done(host->mmc, host->request); | ||
630 | return; | ||
631 | } | ||
627 | 632 | ||
628 | at91_mci_sg_to_dma(host, data); | 633 | at91_mci_sg_to_dma(host, data); |
629 | 634 | ||
635 | host->physical_address = dma_map_single(NULL, | ||
636 | host->buffer, host->total_length, | ||
637 | DMA_TO_DEVICE); | ||
638 | |||
630 | pr_debug("Transmitting %d bytes\n", host->total_length); | 639 | pr_debug("Transmitting %d bytes\n", host->total_length); |
631 | 640 | ||
632 | at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address); | 641 | at91_mci_write(host, ATMEL_PDC_TPR, host->physical_address); |
@@ -694,7 +703,10 @@ static void at91_mci_completed_command(struct at91mci_host *host, unsigned int s | |||
694 | cmd->resp[3] = at91_mci_read(host, AT91_MCI_RSPR(3)); | 703 | cmd->resp[3] = at91_mci_read(host, AT91_MCI_RSPR(3)); |
695 | 704 | ||
696 | if (host->buffer) { | 705 | if (host->buffer) { |
697 | dma_free_coherent(NULL, host->total_length, host->buffer, host->physical_address); | 706 | dma_unmap_single(NULL, |
707 | host->physical_address, host->total_length, | ||
708 | DMA_TO_DEVICE); | ||
709 | kfree(host->buffer); | ||
698 | host->buffer = NULL; | 710 | host->buffer = NULL; |
699 | } | 711 | } |
700 | 712 | ||
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index d2f331876e4c..e00d424e6575 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -410,16 +410,20 @@ static int mtd_ioctl(struct inode *inode, struct file *file, | |||
410 | 410 | ||
411 | case MEMGETREGIONINFO: | 411 | case MEMGETREGIONINFO: |
412 | { | 412 | { |
413 | struct region_info_user ur; | 413 | uint32_t ur_idx; |
414 | struct mtd_erase_region_info *kr; | ||
415 | struct region_info_user *ur = (struct region_info_user *) argp; | ||
414 | 416 | ||
415 | if (copy_from_user(&ur, argp, sizeof(struct region_info_user))) | 417 | if (get_user(ur_idx, &(ur->regionindex))) |
416 | return -EFAULT; | 418 | return -EFAULT; |
417 | 419 | ||
418 | if (ur.regionindex >= mtd->numeraseregions) | 420 | kr = &(mtd->eraseregions[ur_idx]); |
419 | return -EINVAL; | 421 | |
420 | if (copy_to_user(argp, &(mtd->eraseregions[ur.regionindex]), | 422 | if (put_user(kr->offset, &(ur->offset)) |
421 | sizeof(struct mtd_erase_region_info))) | 423 | || put_user(kr->erasesize, &(ur->erasesize)) |
424 | || put_user(kr->numblocks, &(ur->numblocks))) | ||
422 | return -EFAULT; | 425 | return -EFAULT; |
426 | |||
423 | break; | 427 | break; |
424 | } | 428 | } |
425 | 429 | ||
diff --git a/drivers/mtd/nand/tmio_nand.c b/drivers/mtd/nand/tmio_nand.c index cbab654b03c8..edb1e322113d 100644 --- a/drivers/mtd/nand/tmio_nand.c +++ b/drivers/mtd/nand/tmio_nand.c | |||
@@ -109,7 +109,7 @@ struct tmio_nand { | |||
109 | 109 | ||
110 | void __iomem *ccr; | 110 | void __iomem *ccr; |
111 | void __iomem *fcr; | 111 | void __iomem *fcr; |
112 | unsigned long fcr_phys; | 112 | unsigned long fcr_base; |
113 | 113 | ||
114 | unsigned int irq; | 114 | unsigned int irq; |
115 | 115 | ||
@@ -316,8 +316,8 @@ static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio) | |||
316 | tmio_iowrite8(0x81, tmio->ccr + CCR_ICC); | 316 | tmio_iowrite8(0x81, tmio->ccr + CCR_ICC); |
317 | 317 | ||
318 | /* (10h)BaseAddress 0x1000 spba.spba2 */ | 318 | /* (10h)BaseAddress 0x1000 spba.spba2 */ |
319 | tmio_iowrite16(tmio->fcr_phys, tmio->ccr + CCR_BASE); | 319 | tmio_iowrite16(tmio->fcr_base, tmio->ccr + CCR_BASE); |
320 | tmio_iowrite16(tmio->fcr_phys >> 16, tmio->ccr + CCR_BASE + 16); | 320 | tmio_iowrite16(tmio->fcr_base >> 16, tmio->ccr + CCR_BASE + 2); |
321 | 321 | ||
322 | /* (04h)Command Register I/O spcmd */ | 322 | /* (04h)Command Register I/O spcmd */ |
323 | tmio_iowrite8(0x02, tmio->ccr + CCR_COMMAND); | 323 | tmio_iowrite8(0x02, tmio->ccr + CCR_COMMAND); |
@@ -395,7 +395,7 @@ static int tmio_probe(struct platform_device *dev) | |||
395 | goto err_iomap_ccr; | 395 | goto err_iomap_ccr; |
396 | } | 396 | } |
397 | 397 | ||
398 | tmio->fcr_phys = (unsigned long)fcr->start; | 398 | tmio->fcr_base = fcr->start & 0xfffff; |
399 | tmio->fcr = ioremap(fcr->start, fcr->end - fcr->start + 1); | 399 | tmio->fcr = ioremap(fcr->start, fcr->end - fcr->start + 1); |
400 | if (!tmio->fcr) { | 400 | if (!tmio->fcr) { |
401 | retval = -EIO; | 401 | retval = -EIO; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index c3c579f98ed0..dfacd31f7ed0 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6597,7 +6597,7 @@ struct flash_spec { | |||
6597 | 6597 | ||
6598 | struct bnx2_irq { | 6598 | struct bnx2_irq { |
6599 | irq_handler_t handler; | 6599 | irq_handler_t handler; |
6600 | u16 vector; | 6600 | unsigned int vector; |
6601 | u8 requested; | 6601 | u8 requested; |
6602 | char name[16]; | 6602 | char name[16]; |
6603 | }; | 6603 | }; |
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index a14dba1afcc5..fd705d1295a7 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -151,6 +151,8 @@ struct sw_rx_page { | |||
151 | #define PAGES_PER_SGE_SHIFT 0 | 151 | #define PAGES_PER_SGE_SHIFT 0 |
152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) | 152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) |
153 | 153 | ||
154 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | ||
155 | |||
154 | /* SGE ring related macros */ | 156 | /* SGE ring related macros */ |
155 | #define NUM_RX_SGE_PAGES 2 | 157 | #define NUM_RX_SGE_PAGES 2 |
156 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) | 158 | #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) |
@@ -750,8 +752,7 @@ struct bnx2x { | |||
750 | 752 | ||
751 | u32 rx_csum; | 753 | u32 rx_csum; |
752 | u32 rx_offset; | 754 | u32 rx_offset; |
753 | u32 rx_buf_use_size; /* useable size */ | 755 | u32 rx_buf_size; |
754 | u32 rx_buf_size; /* with alignment */ | ||
755 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ | 756 | #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ |
756 | #define ETH_MIN_PACKET_SIZE 60 | 757 | #define ETH_MIN_PACKET_SIZE 60 |
757 | #define ETH_MAX_PACKET_SIZE 1500 | 758 | #define ETH_MAX_PACKET_SIZE 1500 |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 82deea0a63f5..a8eb3c4a47c8 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -59,8 +59,8 @@ | |||
59 | #include "bnx2x.h" | 59 | #include "bnx2x.h" |
60 | #include "bnx2x_init.h" | 60 | #include "bnx2x_init.h" |
61 | 61 | ||
62 | #define DRV_MODULE_VERSION "1.45.20" | 62 | #define DRV_MODULE_VERSION "1.45.21" |
63 | #define DRV_MODULE_RELDATE "2008/08/25" | 63 | #define DRV_MODULE_RELDATE "2008/09/03" |
64 | #define BNX2X_BC_VER 0x040200 | 64 | #define BNX2X_BC_VER 0x040200 |
65 | 65 | ||
66 | /* Time in jiffies before concluding the transmitter is hung */ | 66 | /* Time in jiffies before concluding the transmitter is hung */ |
@@ -1027,7 +1027,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp, | |||
1027 | if (unlikely(skb == NULL)) | 1027 | if (unlikely(skb == NULL)) |
1028 | return -ENOMEM; | 1028 | return -ENOMEM; |
1029 | 1029 | ||
1030 | mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size, | 1030 | mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_size, |
1031 | PCI_DMA_FROMDEVICE); | 1031 | PCI_DMA_FROMDEVICE); |
1032 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { | 1032 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { |
1033 | dev_kfree_skb(skb); | 1033 | dev_kfree_skb(skb); |
@@ -1169,7 +1169,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, | |||
1169 | /* move empty skb from pool to prod and map it */ | 1169 | /* move empty skb from pool to prod and map it */ |
1170 | prod_rx_buf->skb = fp->tpa_pool[queue].skb; | 1170 | prod_rx_buf->skb = fp->tpa_pool[queue].skb; |
1171 | mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, | 1171 | mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, |
1172 | bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); | 1172 | bp->rx_buf_size, PCI_DMA_FROMDEVICE); |
1173 | pci_unmap_addr_set(prod_rx_buf, mapping, mapping); | 1173 | pci_unmap_addr_set(prod_rx_buf, mapping, mapping); |
1174 | 1174 | ||
1175 | /* move partial skb from cons to pool (don't unmap yet) */ | 1175 | /* move partial skb from cons to pool (don't unmap yet) */ |
@@ -1276,7 +1276,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1276 | pool entry status to BNX2X_TPA_STOP even if new skb allocation | 1276 | pool entry status to BNX2X_TPA_STOP even if new skb allocation |
1277 | fails. */ | 1277 | fails. */ |
1278 | pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), | 1278 | pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), |
1279 | bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); | 1279 | bp->rx_buf_size, PCI_DMA_FROMDEVICE); |
1280 | 1280 | ||
1281 | if (likely(new_skb)) { | 1281 | if (likely(new_skb)) { |
1282 | /* fix ip xsum and give it to the stack */ | 1282 | /* fix ip xsum and give it to the stack */ |
@@ -1520,7 +1520,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | |||
1520 | } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { | 1520 | } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { |
1521 | pci_unmap_single(bp->pdev, | 1521 | pci_unmap_single(bp->pdev, |
1522 | pci_unmap_addr(rx_buf, mapping), | 1522 | pci_unmap_addr(rx_buf, mapping), |
1523 | bp->rx_buf_use_size, | 1523 | bp->rx_buf_size, |
1524 | PCI_DMA_FROMDEVICE); | 1524 | PCI_DMA_FROMDEVICE); |
1525 | skb_reserve(skb, pad); | 1525 | skb_reserve(skb, pad); |
1526 | skb_put(skb, len); | 1526 | skb_put(skb, len); |
@@ -4229,7 +4229,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp, | |||
4229 | if (fp->tpa_state[i] == BNX2X_TPA_START) | 4229 | if (fp->tpa_state[i] == BNX2X_TPA_START) |
4230 | pci_unmap_single(bp->pdev, | 4230 | pci_unmap_single(bp->pdev, |
4231 | pci_unmap_addr(rx_buf, mapping), | 4231 | pci_unmap_addr(rx_buf, mapping), |
4232 | bp->rx_buf_use_size, | 4232 | bp->rx_buf_size, |
4233 | PCI_DMA_FROMDEVICE); | 4233 | PCI_DMA_FROMDEVICE); |
4234 | 4234 | ||
4235 | dev_kfree_skb(skb); | 4235 | dev_kfree_skb(skb); |
@@ -4245,15 +4245,14 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
4245 | u16 ring_prod, cqe_ring_prod; | 4245 | u16 ring_prod, cqe_ring_prod; |
4246 | int i, j; | 4246 | int i, j; |
4247 | 4247 | ||
4248 | bp->rx_buf_use_size = bp->dev->mtu; | 4248 | bp->rx_buf_size = bp->dev->mtu; |
4249 | bp->rx_buf_use_size += bp->rx_offset + ETH_OVREHEAD; | 4249 | bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD + |
4250 | bp->rx_buf_size = bp->rx_buf_use_size + 64; | 4250 | BCM_RX_ETH_PAYLOAD_ALIGN; |
4251 | 4251 | ||
4252 | if (bp->flags & TPA_ENABLE_FLAG) { | 4252 | if (bp->flags & TPA_ENABLE_FLAG) { |
4253 | DP(NETIF_MSG_IFUP, | 4253 | DP(NETIF_MSG_IFUP, |
4254 | "rx_buf_use_size %d rx_buf_size %d effective_mtu %d\n", | 4254 | "rx_buf_size %d effective_mtu %d\n", |
4255 | bp->rx_buf_use_size, bp->rx_buf_size, | 4255 | bp->rx_buf_size, bp->dev->mtu + ETH_OVREHEAD); |
4256 | bp->dev->mtu + ETH_OVREHEAD); | ||
4257 | 4256 | ||
4258 | for_each_queue(bp, j) { | 4257 | for_each_queue(bp, j) { |
4259 | struct bnx2x_fastpath *fp = &bp->fp[j]; | 4258 | struct bnx2x_fastpath *fp = &bp->fp[j]; |
@@ -4462,9 +4461,10 @@ static void bnx2x_init_context(struct bnx2x *bp) | |||
4462 | context->ustorm_st_context.common.status_block_id = sb_id; | 4461 | context->ustorm_st_context.common.status_block_id = sb_id; |
4463 | context->ustorm_st_context.common.flags = | 4462 | context->ustorm_st_context.common.flags = |
4464 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; | 4463 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; |
4465 | context->ustorm_st_context.common.mc_alignment_size = 64; | 4464 | context->ustorm_st_context.common.mc_alignment_size = |
4465 | BCM_RX_ETH_PAYLOAD_ALIGN; | ||
4466 | context->ustorm_st_context.common.bd_buff_size = | 4466 | context->ustorm_st_context.common.bd_buff_size = |
4467 | bp->rx_buf_use_size; | 4467 | bp->rx_buf_size; |
4468 | context->ustorm_st_context.common.bd_page_base_hi = | 4468 | context->ustorm_st_context.common.bd_page_base_hi = |
4469 | U64_HI(fp->rx_desc_mapping); | 4469 | U64_HI(fp->rx_desc_mapping); |
4470 | context->ustorm_st_context.common.bd_page_base_lo = | 4470 | context->ustorm_st_context.common.bd_page_base_lo = |
@@ -4717,7 +4717,7 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) | |||
4717 | } | 4717 | } |
4718 | 4718 | ||
4719 | /* Init CQ ring mapping and aggregation size */ | 4719 | /* Init CQ ring mapping and aggregation size */ |
4720 | max_agg_size = min((u32)(bp->rx_buf_use_size + | 4720 | max_agg_size = min((u32)(bp->rx_buf_size + |
4721 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), | 4721 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), |
4722 | (u32)0xffff); | 4722 | (u32)0xffff); |
4723 | for_each_queue(bp, i) { | 4723 | for_each_queue(bp, i) { |
@@ -5940,7 +5940,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) | |||
5940 | 5940 | ||
5941 | pci_unmap_single(bp->pdev, | 5941 | pci_unmap_single(bp->pdev, |
5942 | pci_unmap_addr(rx_buf, mapping), | 5942 | pci_unmap_addr(rx_buf, mapping), |
5943 | bp->rx_buf_use_size, | 5943 | bp->rx_buf_size, |
5944 | PCI_DMA_FROMDEVICE); | 5944 | PCI_DMA_FROMDEVICE); |
5945 | 5945 | ||
5946 | rx_buf->skb = NULL; | 5946 | rx_buf->skb = NULL; |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 453115acaad2..5cf78d612c45 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -2738,9 +2738,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2738 | nic->flags |= wol_magic; | 2738 | nic->flags |= wol_magic; |
2739 | 2739 | ||
2740 | /* ack any pending wake events, disable PME */ | 2740 | /* ack any pending wake events, disable PME */ |
2741 | err = pci_enable_wake(pdev, 0, 0); | 2741 | pci_pme_active(pdev, false); |
2742 | if (err) | ||
2743 | DPRINTK(PROBE, ERR, "Error clearing wake event\n"); | ||
2744 | 2742 | ||
2745 | strcpy(netdev->name, "eth%d"); | 2743 | strcpy(netdev->name, "eth%d"); |
2746 | if((err = register_netdev(netdev))) { | 2744 | if((err = register_netdev(netdev))) { |
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 9d6edf3e73f9..d04eef53571e 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -144,6 +144,8 @@ static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); | |||
144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); | 144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); |
145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); | 145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); |
146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); | 146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); |
147 | static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | ||
148 | static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | ||
147 | 149 | ||
148 | /* IGP cable length table */ | 150 | /* IGP cable length table */ |
149 | static const | 151 | static const |
@@ -168,6 +170,8 @@ u16 e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] = | |||
168 | 83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124, | 170 | 83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124, |
169 | 104, 109, 114, 118, 121, 124}; | 171 | 104, 109, 114, 118, 121, 124}; |
170 | 172 | ||
173 | static DEFINE_SPINLOCK(e1000_eeprom_lock); | ||
174 | |||
171 | /****************************************************************************** | 175 | /****************************************************************************** |
172 | * Set the phy type member in the hw struct. | 176 | * Set the phy type member in the hw struct. |
173 | * | 177 | * |
@@ -4904,6 +4908,15 @@ static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw) | |||
4904 | *****************************************************************************/ | 4908 | *****************************************************************************/ |
4905 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 4909 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
4906 | { | 4910 | { |
4911 | s32 ret; | ||
4912 | spin_lock(&e1000_eeprom_lock); | ||
4913 | ret = e1000_do_read_eeprom(hw, offset, words, data); | ||
4914 | spin_unlock(&e1000_eeprom_lock); | ||
4915 | return ret; | ||
4916 | } | ||
4917 | |||
4918 | static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | ||
4919 | { | ||
4907 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4920 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4908 | u32 i = 0; | 4921 | u32 i = 0; |
4909 | 4922 | ||
@@ -5236,6 +5249,16 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw) | |||
5236 | *****************************************************************************/ | 5249 | *****************************************************************************/ |
5237 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 5250 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
5238 | { | 5251 | { |
5252 | s32 ret; | ||
5253 | spin_lock(&e1000_eeprom_lock); | ||
5254 | ret = e1000_do_write_eeprom(hw, offset, words, data); | ||
5255 | spin_unlock(&e1000_eeprom_lock); | ||
5256 | return ret; | ||
5257 | } | ||
5258 | |||
5259 | |||
5260 | static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | ||
5261 | { | ||
5239 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5262 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5240 | s32 status = 0; | 5263 | s32 status = 0; |
5241 | 5264 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 331b86b01fa9..eeb55ed2152d 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5643,6 +5643,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5643 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; | 5643 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; |
5644 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; | 5644 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; |
5645 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); | 5645 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); |
5646 | printk(KERN_DEBUG "nv_probe: set workaround bit for reversed mac addr\n"); | ||
5646 | } | 5647 | } |
5647 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 5648 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
5648 | 5649 | ||
@@ -5890,14 +5891,12 @@ static void nv_restore_phy(struct net_device *dev) | |||
5890 | } | 5891 | } |
5891 | } | 5892 | } |
5892 | 5893 | ||
5893 | static void __devexit nv_remove(struct pci_dev *pci_dev) | 5894 | static void nv_restore_mac_addr(struct pci_dev *pci_dev) |
5894 | { | 5895 | { |
5895 | struct net_device *dev = pci_get_drvdata(pci_dev); | 5896 | struct net_device *dev = pci_get_drvdata(pci_dev); |
5896 | struct fe_priv *np = netdev_priv(dev); | 5897 | struct fe_priv *np = netdev_priv(dev); |
5897 | u8 __iomem *base = get_hwbase(dev); | 5898 | u8 __iomem *base = get_hwbase(dev); |
5898 | 5899 | ||
5899 | unregister_netdev(dev); | ||
5900 | |||
5901 | /* special op: write back the misordered MAC address - otherwise | 5900 | /* special op: write back the misordered MAC address - otherwise |
5902 | * the next nv_probe would see a wrong address. | 5901 | * the next nv_probe would see a wrong address. |
5903 | */ | 5902 | */ |
@@ -5905,6 +5904,15 @@ static void __devexit nv_remove(struct pci_dev *pci_dev) | |||
5905 | writel(np->orig_mac[1], base + NvRegMacAddrB); | 5904 | writel(np->orig_mac[1], base + NvRegMacAddrB); |
5906 | writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV, | 5905 | writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV, |
5907 | base + NvRegTransmitPoll); | 5906 | base + NvRegTransmitPoll); |
5907 | } | ||
5908 | |||
5909 | static void __devexit nv_remove(struct pci_dev *pci_dev) | ||
5910 | { | ||
5911 | struct net_device *dev = pci_get_drvdata(pci_dev); | ||
5912 | |||
5913 | unregister_netdev(dev); | ||
5914 | |||
5915 | nv_restore_mac_addr(pci_dev); | ||
5908 | 5916 | ||
5909 | /* restore any phy related changes */ | 5917 | /* restore any phy related changes */ |
5910 | nv_restore_phy(dev); | 5918 | nv_restore_phy(dev); |
@@ -5975,10 +5983,14 @@ static void nv_shutdown(struct pci_dev *pdev) | |||
5975 | if (netif_running(dev)) | 5983 | if (netif_running(dev)) |
5976 | nv_close(dev); | 5984 | nv_close(dev); |
5977 | 5985 | ||
5978 | pci_enable_wake(pdev, PCI_D3hot, np->wolenabled); | 5986 | nv_restore_mac_addr(pdev); |
5979 | pci_enable_wake(pdev, PCI_D3cold, np->wolenabled); | 5987 | |
5980 | pci_disable_device(pdev); | 5988 | pci_disable_device(pdev); |
5981 | pci_set_power_state(pdev, PCI_D3hot); | 5989 | if (system_state == SYSTEM_POWER_OFF) { |
5990 | if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled)) | ||
5991 | pci_enable_wake(pdev, PCI_D3hot, np->wolenabled); | ||
5992 | pci_set_power_state(pdev, PCI_D3hot); | ||
5993 | } | ||
5982 | } | 5994 | } |
5983 | #else | 5995 | #else |
5984 | #define nv_suspend NULL | 5996 | #define nv_suspend NULL |
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index 8239939554bc..fbbd3e660c27 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c | |||
@@ -139,7 +139,7 @@ static int __init do_hpp_probe(struct net_device *dev) | |||
139 | #ifndef MODULE | 139 | #ifndef MODULE |
140 | struct net_device * __init hp_plus_probe(int unit) | 140 | struct net_device * __init hp_plus_probe(int unit) |
141 | { | 141 | { |
142 | struct net_device *dev = alloc_ei_netdev(); | 142 | struct net_device *dev = alloc_eip_netdev(); |
143 | int err; | 143 | int err; |
144 | 144 | ||
145 | if (!dev) | 145 | if (!dev) |
@@ -284,7 +284,7 @@ hpp_open(struct net_device *dev) | |||
284 | int option_reg; | 284 | int option_reg; |
285 | int retval; | 285 | int retval; |
286 | 286 | ||
287 | if ((retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev))) { | 287 | if ((retval = request_irq(dev->irq, eip_interrupt, 0, dev->name, dev))) { |
288 | return retval; | 288 | return retval; |
289 | } | 289 | } |
290 | 290 | ||
@@ -302,7 +302,7 @@ hpp_open(struct net_device *dev) | |||
302 | /* Select the operational page. */ | 302 | /* Select the operational page. */ |
303 | outw(Perf_Page, ioaddr + HP_PAGING); | 303 | outw(Perf_Page, ioaddr + HP_PAGING); |
304 | 304 | ||
305 | ei_open(dev); | 305 | eip_open(dev); |
306 | return 0; | 306 | return 0; |
307 | } | 307 | } |
308 | 308 | ||
@@ -313,7 +313,7 @@ hpp_close(struct net_device *dev) | |||
313 | int option_reg = inw(ioaddr + HPP_OPTION); | 313 | int option_reg = inw(ioaddr + HPP_OPTION); |
314 | 314 | ||
315 | free_irq(dev->irq, dev); | 315 | free_irq(dev->irq, dev); |
316 | ei_close(dev); | 316 | eip_close(dev); |
317 | outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset, | 317 | outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset, |
318 | ioaddr + HPP_OPTION); | 318 | ioaddr + HPP_OPTION); |
319 | 319 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 53f41b649f03..a417be7f8be5 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2304,6 +2304,12 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter | |||
2304 | int vector, v_budget; | 2304 | int vector, v_budget; |
2305 | 2305 | ||
2306 | /* | 2306 | /* |
2307 | * Set the default interrupt throttle rate. | ||
2308 | */ | ||
2309 | adapter->rx_eitr = (1000000 / IXGBE_DEFAULT_ITR_RX_USECS); | ||
2310 | adapter->tx_eitr = (1000000 / IXGBE_DEFAULT_ITR_TX_USECS); | ||
2311 | |||
2312 | /* | ||
2307 | * It's easy to be greedy for MSI-X vectors, but it really | 2313 | * It's easy to be greedy for MSI-X vectors, but it really |
2308 | * doesn't do us much good if we have a lot more vectors | 2314 | * doesn't do us much good if we have a lot more vectors |
2309 | * than CPU's. So let's be conservative and only ask for | 2315 | * than CPU's. So let's be conservative and only ask for |
diff --git a/drivers/net/mlx4/mr.c b/drivers/net/mlx4/mr.c index 62071d9c4a55..d1dd5b48dbd1 100644 --- a/drivers/net/mlx4/mr.c +++ b/drivers/net/mlx4/mr.c | |||
@@ -67,11 +67,10 @@ struct mlx4_mpt_entry { | |||
67 | #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) | 67 | #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) |
68 | #define MLX4_MPT_FLAG_REGION (1 << 8) | 68 | #define MLX4_MPT_FLAG_REGION (1 << 8) |
69 | 69 | ||
70 | #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 26) | 70 | #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 27) |
71 | #define MLX4_MPT_PD_FLAG_RAE (1 << 28) | ||
71 | #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) | 72 | #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) |
72 | 73 | ||
73 | #define MLX4_MTT_FLAG_PRESENT 1 | ||
74 | |||
75 | #define MLX4_MPT_STATUS_SW 0xF0 | 74 | #define MLX4_MPT_STATUS_SW 0xF0 |
76 | #define MLX4_MPT_STATUS_HW 0x00 | 75 | #define MLX4_MPT_STATUS_HW 0x00 |
77 | 76 | ||
@@ -348,7 +347,10 @@ int mlx4_mr_enable(struct mlx4_dev *dev, struct mlx4_mr *mr) | |||
348 | if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { | 347 | if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { |
349 | /* fast register MR in free state */ | 348 | /* fast register MR in free state */ |
350 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); | 349 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); |
351 | mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG); | 350 | mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | |
351 | MLX4_MPT_PD_FLAG_RAE); | ||
352 | mpt_entry->mtt_sz = cpu_to_be32((1 << mr->mtt.order) * | ||
353 | MLX4_MTT_ENTRY_PER_SEG); | ||
352 | } else { | 354 | } else { |
353 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); | 355 | mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); |
354 | } | 356 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 32bb47adbe39..008fd6618a5f 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -359,16 +359,6 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter) | |||
359 | int i, pos; | 359 | int i, pos; |
360 | struct pci_dev *pdev; | 360 | struct pci_dev *pdev; |
361 | 361 | ||
362 | pdev = pci_get_device(0x1166, 0x0140, NULL); | ||
363 | if (pdev) { | ||
364 | pci_dev_put(pdev); | ||
365 | adapter->hw_read_wx(adapter, | ||
366 | NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); | ||
367 | chicken |= 0x4000; | ||
368 | adapter->hw_write_wx(adapter, | ||
369 | NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); | ||
370 | } | ||
371 | |||
372 | pdev = adapter->pdev; | 362 | pdev = adapter->pdev; |
373 | 363 | ||
374 | adapter->hw_read_wx(adapter, | 364 | adapter->hw_read_wx(adapter, |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index e4765b713aba..e3be81eba8a4 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -5984,6 +5984,56 @@ static void niu_netif_start(struct niu *np) | |||
5984 | niu_enable_interrupts(np, 1); | 5984 | niu_enable_interrupts(np, 1); |
5985 | } | 5985 | } |
5986 | 5986 | ||
5987 | static void niu_reset_buffers(struct niu *np) | ||
5988 | { | ||
5989 | int i, j, k, err; | ||
5990 | |||
5991 | if (np->rx_rings) { | ||
5992 | for (i = 0; i < np->num_rx_rings; i++) { | ||
5993 | struct rx_ring_info *rp = &np->rx_rings[i]; | ||
5994 | |||
5995 | for (j = 0, k = 0; j < MAX_RBR_RING_SIZE; j++) { | ||
5996 | struct page *page; | ||
5997 | |||
5998 | page = rp->rxhash[j]; | ||
5999 | while (page) { | ||
6000 | struct page *next = | ||
6001 | (struct page *) page->mapping; | ||
6002 | u64 base = page->index; | ||
6003 | base = base >> RBR_DESCR_ADDR_SHIFT; | ||
6004 | rp->rbr[k++] = cpu_to_le32(base); | ||
6005 | page = next; | ||
6006 | } | ||
6007 | } | ||
6008 | for (; k < MAX_RBR_RING_SIZE; k++) { | ||
6009 | err = niu_rbr_add_page(np, rp, GFP_ATOMIC, k); | ||
6010 | if (unlikely(err)) | ||
6011 | break; | ||
6012 | } | ||
6013 | |||
6014 | rp->rbr_index = rp->rbr_table_size - 1; | ||
6015 | rp->rcr_index = 0; | ||
6016 | rp->rbr_pending = 0; | ||
6017 | rp->rbr_refill_pending = 0; | ||
6018 | } | ||
6019 | } | ||
6020 | if (np->tx_rings) { | ||
6021 | for (i = 0; i < np->num_tx_rings; i++) { | ||
6022 | struct tx_ring_info *rp = &np->tx_rings[i]; | ||
6023 | |||
6024 | for (j = 0; j < MAX_TX_RING_SIZE; j++) { | ||
6025 | if (rp->tx_buffs[j].skb) | ||
6026 | (void) release_tx_packet(np, rp, j); | ||
6027 | } | ||
6028 | |||
6029 | rp->pending = MAX_TX_RING_SIZE; | ||
6030 | rp->prod = 0; | ||
6031 | rp->cons = 0; | ||
6032 | rp->wrap_bit = 0; | ||
6033 | } | ||
6034 | } | ||
6035 | } | ||
6036 | |||
5987 | static void niu_reset_task(struct work_struct *work) | 6037 | static void niu_reset_task(struct work_struct *work) |
5988 | { | 6038 | { |
5989 | struct niu *np = container_of(work, struct niu, reset_task); | 6039 | struct niu *np = container_of(work, struct niu, reset_task); |
@@ -6006,6 +6056,12 @@ static void niu_reset_task(struct work_struct *work) | |||
6006 | 6056 | ||
6007 | niu_stop_hw(np); | 6057 | niu_stop_hw(np); |
6008 | 6058 | ||
6059 | spin_unlock_irqrestore(&np->lock, flags); | ||
6060 | |||
6061 | niu_reset_buffers(np); | ||
6062 | |||
6063 | spin_lock_irqsave(&np->lock, flags); | ||
6064 | |||
6009 | err = niu_init_hw(np); | 6065 | err = niu_init_hw(np); |
6010 | if (!err) { | 6066 | if (!err) { |
6011 | np->timer.expires = jiffies + HZ; | 6067 | np->timer.expires = jiffies + HZ; |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 3f682d49a4e6..52bf11b73c6e 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -784,6 +784,7 @@ static struct pcmcia_device_id axnet_ids[] = { | |||
784 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), | 784 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), |
785 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), | 785 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), |
786 | PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), | 786 | PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), |
787 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "ETXPCM", 0x547e66dc, 0x233adac2), | ||
787 | PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), | 788 | PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), |
788 | PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), | 789 | PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), |
789 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), | 790 | PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 2d4c4ad89b8d..ebc1ae6bcbe5 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -1626,6 +1626,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1626 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), | 1626 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), |
1627 | PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), | 1627 | PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), |
1628 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), | 1628 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), |
1629 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-TD", 0x5261440f, 0x47d5ca83), | ||
1629 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), | 1630 | PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), |
1630 | PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), | 1631 | PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), |
1631 | PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), | 1632 | PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), |
@@ -1737,7 +1738,6 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
1737 | PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), | 1738 | PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), |
1738 | PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), | 1739 | PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), |
1739 | PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), | 1740 | PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), |
1740 | PCMCIA_DEVICE_PROD_ID1("IC-CARD", 0x60cb09a6), | ||
1741 | PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), | 1741 | PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), |
1742 | PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), | 1742 | PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), |
1743 | /* too generic! */ | 1743 | /* too generic! */ |
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index a84ba487c713..8c19307e5040 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c | |||
@@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb) | |||
117 | case -ENOENT: | 117 | case -ENOENT: |
118 | break; | 118 | break; |
119 | default: | 119 | default: |
120 | if (netif_msg_drv(pegasus)) | 120 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", | 121 | dev_dbg(&pegasus->intf->dev, "%s, status %d\n", |
122 | __FUNCTION__, urb->status); | 122 | __FUNCTION__, urb->status); |
123 | } | 123 | } |
@@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, | |||
166 | set_current_state(TASK_RUNNING); | 166 | set_current_state(TASK_RUNNING); |
167 | if (ret == -ENODEV) | 167 | if (ret == -ENODEV) |
168 | netif_device_detach(pegasus->net); | 168 | netif_device_detach(pegasus->net); |
169 | if (netif_msg_drv(pegasus)) | 169 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 170 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
171 | __FUNCTION__, ret); | 171 | __FUNCTION__, ret); |
172 | goto out; | 172 | goto out; |
@@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) | |||
275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { | 275 | if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { |
276 | if (ret == -ENODEV) | 276 | if (ret == -ENODEV) |
277 | netif_device_detach(pegasus->net); | 277 | netif_device_detach(pegasus->net); |
278 | if (netif_msg_drv(pegasus)) | 278 | if (netif_msg_drv(pegasus) && printk_ratelimit()) |
279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", | 279 | dev_err(&pegasus->intf->dev, "%s, status %d\n", |
280 | __FUNCTION__, ret); | 280 | __FUNCTION__, ret); |
281 | goto out; | 281 | goto out; |
@@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; | 1209 | pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; |
1210 | if (netif_msg_link(pegasus)) | 1210 | if (netif_msg_link(pegasus)) |
1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); | 1211 | pr_info("%s: Promiscuous mode enabled.\n", net->name); |
1212 | } else if (net->mc_count || | 1212 | } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { |
1213 | (net->flags & IFF_ALLMULTI)) { | ||
1214 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; | 1213 | pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; |
1215 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1214 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1216 | if (netif_msg_link(pegasus)) | 1215 | if (netif_msg_link(pegasus)) |
@@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) | |||
1220 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; | 1219 | pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; |
1221 | } | 1220 | } |
1222 | 1221 | ||
1222 | pegasus->ctrl_urb->status = 0; | ||
1223 | |||
1223 | pegasus->flags |= ETH_REGS_CHANGE; | 1224 | pegasus->flags |= ETH_REGS_CHANGE; |
1224 | ctrl_callback(pegasus->ctrl_urb); | 1225 | ctrl_callback(pegasus->ctrl_urb); |
1225 | } | 1226 | } |
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index caf569401a34..00a0eaa08866 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -209,6 +209,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
209 | unsigned int curlen; | 209 | unsigned int curlen; |
210 | struct ath_txq *cabq; | 210 | struct ath_txq *cabq; |
211 | struct ath_txq *mcastq; | 211 | struct ath_txq *mcastq; |
212 | struct ieee80211_tx_info *info; | ||
212 | avp = sc->sc_vaps[if_id]; | 213 | avp = sc->sc_vaps[if_id]; |
213 | 214 | ||
214 | mcastq = &avp->av_mcastq; | 215 | mcastq = &avp->av_mcastq; |
@@ -232,6 +233,18 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
232 | */ | 233 | */ |
233 | curlen = skb->len; | 234 | curlen = skb->len; |
234 | 235 | ||
236 | info = IEEE80211_SKB_CB(skb); | ||
237 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
238 | /* | ||
239 | * TODO: make sure the seq# gets assigned properly (vs. other | ||
240 | * TX frames) | ||
241 | */ | ||
242 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
243 | sc->seq_no += 0x10; | ||
244 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
245 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
246 | } | ||
247 | |||
235 | /* XXX: spin_lock_bh should not be used here, but sparse bitches | 248 | /* XXX: spin_lock_bh should not be used here, but sparse bitches |
236 | * otherwise. We should fix sparse :) */ | 249 | * otherwise. We should fix sparse :) */ |
237 | spin_lock_bh(&mcastq->axq_lock); | 250 | spin_lock_bh(&mcastq->axq_lock); |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 673b3d81133a..4ee695b76b88 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -992,6 +992,7 @@ struct ath_softc { | |||
992 | u32 sc_txintrperiod; /* tx interrupt batching */ | 992 | u32 sc_txintrperiod; /* tx interrupt batching */ |
993 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ | 993 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */ |
994 | u32 sc_ant_tx[8]; /* recent tx frames/antenna */ | 994 | u32 sc_ant_tx[8]; /* recent tx frames/antenna */ |
995 | u16 seq_no; /* TX sequence number */ | ||
995 | 996 | ||
996 | /* Beacon */ | 997 | /* Beacon */ |
997 | struct ath9k_tx_queue_info sc_beacon_qi; | 998 | struct ath9k_tx_queue_info sc_beacon_qi; |
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index a17eb130f574..6dbfed0b4149 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -7285,15 +7285,15 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7285 | } | 7285 | } |
7286 | break; | 7286 | break; |
7287 | case ATH9K_CIPHER_WEP: | 7287 | case ATH9K_CIPHER_WEP: |
7288 | if (k->kv_len < 40 / NBBY) { | 7288 | if (k->kv_len < LEN_WEP40) { |
7289 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, | 7289 | DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, |
7290 | "%s: WEP key length %u too small\n", | 7290 | "%s: WEP key length %u too small\n", |
7291 | __func__, k->kv_len); | 7291 | __func__, k->kv_len); |
7292 | return false; | 7292 | return false; |
7293 | } | 7293 | } |
7294 | if (k->kv_len <= 40 / NBBY) | 7294 | if (k->kv_len <= LEN_WEP40) |
7295 | keyType = AR_KEYTABLE_TYPE_40; | 7295 | keyType = AR_KEYTABLE_TYPE_40; |
7296 | else if (k->kv_len <= 104 / NBBY) | 7296 | else if (k->kv_len <= LEN_WEP104) |
7297 | keyType = AR_KEYTABLE_TYPE_104; | 7297 | keyType = AR_KEYTABLE_TYPE_104; |
7298 | else | 7298 | else |
7299 | keyType = AR_KEYTABLE_TYPE_128; | 7299 | keyType = AR_KEYTABLE_TYPE_128; |
@@ -7313,7 +7313,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, | |||
7313 | key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; | 7313 | key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; |
7314 | key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; | 7314 | key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; |
7315 | key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; | 7315 | key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; |
7316 | if (k->kv_len <= 104 / NBBY) | 7316 | if (k->kv_len <= LEN_WEP104) |
7317 | key4 &= 0xff; | 7317 | key4 &= 0xff; |
7318 | 7318 | ||
7319 | if (keyType == AR_KEYTABLE_TYPE_TKIP && ATH9K_IS_MIC_ENABLED(ah)) { | 7319 | if (keyType == AR_KEYTABLE_TYPE_TKIP && ATH9K_IS_MIC_ENABLED(ah)) { |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 2888778040e4..99badf1404c3 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -206,7 +206,8 @@ static int ath_key_config(struct ath_softc *sc, | |||
206 | if (!ret) | 206 | if (!ret) |
207 | return -EIO; | 207 | return -EIO; |
208 | 208 | ||
209 | sc->sc_keytype = hk.kv_type; | 209 | if (mac) |
210 | sc->sc_keytype = hk.kv_type; | ||
210 | return 0; | 211 | return 0; |
211 | } | 212 | } |
212 | 213 | ||
@@ -368,6 +369,20 @@ static int ath9k_tx(struct ieee80211_hw *hw, | |||
368 | { | 369 | { |
369 | struct ath_softc *sc = hw->priv; | 370 | struct ath_softc *sc = hw->priv; |
370 | int hdrlen, padsize; | 371 | int hdrlen, padsize; |
372 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | ||
373 | |||
374 | /* | ||
375 | * As a temporary workaround, assign seq# here; this will likely need | ||
376 | * to be cleaned up to work better with Beacon transmission and virtual | ||
377 | * BSSes. | ||
378 | */ | ||
379 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
380 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | ||
381 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | ||
382 | sc->seq_no += 0x10; | ||
383 | hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
384 | hdr->seq_ctrl |= cpu_to_le16(sc->seq_no); | ||
385 | } | ||
371 | 386 | ||
372 | /* Add the padding after the header if this is not already done */ | 387 | /* Add the padding after the header if this is not already done */ |
373 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 388 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
@@ -756,7 +771,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
756 | key->hw_key_idx = key->keyidx; | 771 | key->hw_key_idx = key->keyidx; |
757 | /* push IV and Michael MIC generation to stack */ | 772 | /* push IV and Michael MIC generation to stack */ |
758 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 773 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
759 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | 774 | if (key->alg == ALG_TKIP) |
775 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; | ||
760 | } | 776 | } |
761 | break; | 777 | break; |
762 | case DISABLE_KEY: | 778 | case DISABLE_KEY: |
@@ -1065,8 +1081,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
1065 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | 1081 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; |
1066 | tx_status->flags &= ~ATH_TX_BAR; | 1082 | tx_status->flags &= ~ATH_TX_BAR; |
1067 | } | 1083 | } |
1068 | if (tx_status->flags) | 1084 | |
1069 | tx_info->status.excessive_retries = 1; | 1085 | if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) { |
1086 | if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { | ||
1087 | /* Frame was not ACKed, but an ACK was expected */ | ||
1088 | tx_info->status.excessive_retries = 1; | ||
1089 | } | ||
1090 | } else { | ||
1091 | /* Frame was ACKed */ | ||
1092 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | ||
1093 | } | ||
1070 | 1094 | ||
1071 | tx_info->status.retry_count = tx_status->retries; | 1095 | tx_info->status.retry_count = tx_status->retries; |
1072 | 1096 | ||
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 2fe806175c01..20ddb7acdb94 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -360,8 +360,9 @@ static void ath_rx_flush_tid(struct ath_softc *sc, | |||
360 | struct ath_arx_tid *rxtid, int drop) | 360 | struct ath_arx_tid *rxtid, int drop) |
361 | { | 361 | { |
362 | struct ath_rxbuf *rxbuf; | 362 | struct ath_rxbuf *rxbuf; |
363 | unsigned long flag; | ||
363 | 364 | ||
364 | spin_lock_bh(&rxtid->tidlock); | 365 | spin_lock_irqsave(&rxtid->tidlock, flag); |
365 | while (rxtid->baw_head != rxtid->baw_tail) { | 366 | while (rxtid->baw_head != rxtid->baw_tail) { |
366 | rxbuf = rxtid->rxbuf + rxtid->baw_head; | 367 | rxbuf = rxtid->rxbuf + rxtid->baw_head; |
367 | if (!rxbuf->rx_wbuf) { | 368 | if (!rxbuf->rx_wbuf) { |
@@ -382,7 +383,7 @@ static void ath_rx_flush_tid(struct ath_softc *sc, | |||
382 | INCR(rxtid->baw_head, ATH_TID_MAX_BUFS); | 383 | INCR(rxtid->baw_head, ATH_TID_MAX_BUFS); |
383 | INCR(rxtid->seq_next, IEEE80211_SEQ_MAX); | 384 | INCR(rxtid->seq_next, IEEE80211_SEQ_MAX); |
384 | } | 385 | } |
385 | spin_unlock_bh(&rxtid->tidlock); | 386 | spin_unlock_irqrestore(&rxtid->tidlock, flag); |
386 | } | 387 | } |
387 | 388 | ||
388 | static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc, | 389 | static struct sk_buff *ath_rxbuf_alloc(struct ath_softc *sc, |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 157f830ee6b8..550129f717e2 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -357,9 +357,9 @@ static int ath_tx_prepare(struct ath_softc *sc, | |||
357 | txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ | 357 | txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ |
358 | 358 | ||
359 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) | 359 | if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) |
360 | tx_info->flags |= ATH9K_TXDESC_NOACK; | 360 | txctl->flags |= ATH9K_TXDESC_NOACK; |
361 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) | 361 | if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) |
362 | tx_info->flags |= ATH9K_TXDESC_RTSENA; | 362 | txctl->flags |= ATH9K_TXDESC_RTSENA; |
363 | 363 | ||
364 | /* | 364 | /* |
365 | * Setup for rate calculations. | 365 | * Setup for rate calculations. |
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index fec5645944a4..34ae125d5384 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
@@ -43,23 +43,6 @@ static bool b43_is_hw_radio_enabled(struct b43_wldev *dev) | |||
43 | return 0; | 43 | return 0; |
44 | } | 44 | } |
45 | 45 | ||
46 | /* Update the rfkill state */ | ||
47 | static void b43_rfkill_update_state(struct b43_wldev *dev) | ||
48 | { | ||
49 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | ||
50 | |||
51 | if (!dev->radio_hw_enable) { | ||
52 | rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED; | ||
53 | return; | ||
54 | } | ||
55 | |||
56 | if (!dev->phy.radio_on) | ||
57 | rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED; | ||
58 | else | ||
59 | rfk->rfkill->state = RFKILL_STATE_UNBLOCKED; | ||
60 | |||
61 | } | ||
62 | |||
63 | /* The poll callback for the hardware button. */ | 46 | /* The poll callback for the hardware button. */ |
64 | static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | 47 | static void b43_rfkill_poll(struct input_polled_dev *poll_dev) |
65 | { | 48 | { |
@@ -77,7 +60,6 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
77 | if (unlikely(enabled != dev->radio_hw_enable)) { | 60 | if (unlikely(enabled != dev->radio_hw_enable)) { |
78 | dev->radio_hw_enable = enabled; | 61 | dev->radio_hw_enable = enabled; |
79 | report_change = 1; | 62 | report_change = 1; |
80 | b43_rfkill_update_state(dev); | ||
81 | b43info(wl, "Radio hardware status changed to %s\n", | 63 | b43info(wl, "Radio hardware status changed to %s\n", |
82 | enabled ? "ENABLED" : "DISABLED"); | 64 | enabled ? "ENABLED" : "DISABLED"); |
83 | } | 65 | } |
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c index 476add97e974..b32bf6a94f19 100644 --- a/drivers/net/wireless/b43legacy/rfkill.c +++ b/drivers/net/wireless/b43legacy/rfkill.c | |||
@@ -44,23 +44,6 @@ static bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | /* Update the rfkill state */ | ||
48 | static void b43legacy_rfkill_update_state(struct b43legacy_wldev *dev) | ||
49 | { | ||
50 | struct b43legacy_rfkill *rfk = &(dev->wl->rfkill); | ||
51 | |||
52 | if (!dev->radio_hw_enable) { | ||
53 | rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED; | ||
54 | return; | ||
55 | } | ||
56 | |||
57 | if (!dev->phy.radio_on) | ||
58 | rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED; | ||
59 | else | ||
60 | rfk->rfkill->state = RFKILL_STATE_UNBLOCKED; | ||
61 | |||
62 | } | ||
63 | |||
64 | /* The poll callback for the hardware button. */ | 47 | /* The poll callback for the hardware button. */ |
65 | static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) | 48 | static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) |
66 | { | 49 | { |
@@ -78,7 +61,6 @@ static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev) | |||
78 | if (unlikely(enabled != dev->radio_hw_enable)) { | 61 | if (unlikely(enabled != dev->radio_hw_enable)) { |
79 | dev->radio_hw_enable = enabled; | 62 | dev->radio_hw_enable = enabled; |
80 | report_change = 1; | 63 | report_change = 1; |
81 | b43legacy_rfkill_update_state(dev); | ||
82 | b43legacyinfo(wl, "Radio hardware status changed to %s\n", | 64 | b43legacyinfo(wl, "Radio hardware status changed to %s\n", |
83 | enabled ? "ENABLED" : "DISABLED"); | 65 | enabled ? "ENABLED" : "DISABLED"); |
84 | } | 66 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index e2581229d8b2..23fed3298962 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -474,8 +474,8 @@ static void iwl4965_apm_stop(struct iwl_priv *priv) | |||
474 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); | 474 | iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); |
475 | 475 | ||
476 | udelay(10); | 476 | udelay(10); |
477 | 477 | /* clear "init complete" move adapter D0A* --> D0U state */ | |
478 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 478 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); |
479 | spin_unlock_irqrestore(&priv->lock, flags); | 479 | spin_unlock_irqrestore(&priv->lock, flags); |
480 | } | 480 | } |
481 | 481 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index cbc01a00eaf4..b08036a9d894 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -145,7 +145,8 @@ static void iwl5000_apm_stop(struct iwl_priv *priv) | |||
145 | 145 | ||
146 | udelay(10); | 146 | udelay(10); |
147 | 147 | ||
148 | iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | 148 | /* clear "init complete" move adapter D0A* --> D0U state */ |
149 | iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); | ||
149 | 150 | ||
150 | spin_unlock_irqrestore(&priv->lock, flags); | 151 | spin_unlock_irqrestore(&priv->lock, flags); |
151 | } | 152 | } |
@@ -577,14 +578,11 @@ static int iwl5000_load_section(struct iwl_priv *priv, | |||
577 | FH_TFDIB_CTRL0_REG(FH_SRVC_CHNL), | 578 | FH_TFDIB_CTRL0_REG(FH_SRVC_CHNL), |
578 | phy_addr & FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); | 579 | phy_addr & FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); |
579 | 580 | ||
580 | /* FIME: write the MSB of the phy_addr in CTRL1 | ||
581 | * iwl_write_direct32(priv, | ||
582 | IWL_FH_TFDIB_CTRL1_REG(IWL_FH_SRVC_CHNL), | ||
583 | ((phy_addr & MSB_MSK) | ||
584 | << FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_count); | ||
585 | */ | ||
586 | iwl_write_direct32(priv, | 581 | iwl_write_direct32(priv, |
587 | FH_TFDIB_CTRL1_REG(FH_SRVC_CHNL), byte_cnt); | 582 | FH_TFDIB_CTRL1_REG(FH_SRVC_CHNL), |
583 | (iwl_get_dma_hi_address(phy_addr) | ||
584 | << FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); | ||
585 | |||
588 | iwl_write_direct32(priv, | 586 | iwl_write_direct32(priv, |
589 | FH_TCSR_CHNL_TX_BUF_STS_REG(FH_SRVC_CHNL), | 587 | FH_TCSR_CHNL_TX_BUF_STS_REG(FH_SRVC_CHNL), |
590 | 1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | | 588 | 1 << FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 754fef5b592f..90a2b6dee7c0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -1153,7 +1153,8 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, | |||
1153 | !sta->ht_info.ht_supported) | 1153 | !sta->ht_info.ht_supported) |
1154 | return -1; | 1154 | return -1; |
1155 | 1155 | ||
1156 | if (priv->current_ht_config.tx_mimo_ps_mode == IWL_MIMO_PS_STATIC) | 1156 | if (((sta->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS) >> 2) |
1157 | == IWL_MIMO_PS_STATIC) | ||
1157 | return -1; | 1158 | return -1; |
1158 | 1159 | ||
1159 | /* Need both Tx chains/antennas to support MIMO */ | 1160 | /* Need both Tx chains/antennas to support MIMO */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 061ffba9c884..e01f048a02dd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -181,14 +181,14 @@ static int iwl4965_check_rxon_cmd(struct iwl_rxon_cmd *rxon) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | /** | 183 | /** |
184 | * iwl4965_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed | 184 | * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed |
185 | * @priv: staging_rxon is compared to active_rxon | 185 | * @priv: staging_rxon is compared to active_rxon |
186 | * | 186 | * |
187 | * If the RXON structure is changing enough to require a new tune, | 187 | * If the RXON structure is changing enough to require a new tune, |
188 | * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that | 188 | * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that |
189 | * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. | 189 | * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. |
190 | */ | 190 | */ |
191 | static int iwl4965_full_rxon_required(struct iwl_priv *priv) | 191 | static int iwl_full_rxon_required(struct iwl_priv *priv) |
192 | { | 192 | { |
193 | 193 | ||
194 | /* These items are only settable from the full RXON command */ | 194 | /* These items are only settable from the full RXON command */ |
@@ -207,7 +207,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv) | |||
207 | priv->active_rxon.ofdm_ht_single_stream_basic_rates) || | 207 | priv->active_rxon.ofdm_ht_single_stream_basic_rates) || |
208 | (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != | 208 | (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != |
209 | priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || | 209 | priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || |
210 | (priv->staging_rxon.rx_chain != priv->active_rxon.rx_chain) || | ||
211 | (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) | 210 | (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) |
212 | return 1; | 211 | return 1; |
213 | 212 | ||
@@ -263,7 +262,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv) | |||
263 | /* If we don't need to send a full RXON, we can use | 262 | /* If we don't need to send a full RXON, we can use |
264 | * iwl4965_rxon_assoc_cmd which is used to reconfigure filter | 263 | * iwl4965_rxon_assoc_cmd which is used to reconfigure filter |
265 | * and other flags for the current radio configuration. */ | 264 | * and other flags for the current radio configuration. */ |
266 | if (!iwl4965_full_rxon_required(priv)) { | 265 | if (!iwl_full_rxon_required(priv)) { |
267 | ret = iwl_send_rxon_assoc(priv); | 266 | ret = iwl_send_rxon_assoc(priv); |
268 | if (ret) { | 267 | if (ret) { |
269 | IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); | 268 | IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); |
@@ -587,8 +586,6 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, | |||
587 | iwl_conf->supported_chan_width = 0; | 586 | iwl_conf->supported_chan_width = 0; |
588 | } | 587 | } |
589 | 588 | ||
590 | iwl_conf->tx_mimo_ps_mode = | ||
591 | (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
592 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); | 589 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); |
593 | 590 | ||
594 | iwl_conf->control_channel = ht_bss_conf->primary_channel; | 591 | iwl_conf->control_channel = ht_bss_conf->primary_channel; |
@@ -2190,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv) | |||
2190 | udelay(5); | 2187 | udelay(5); |
2191 | 2188 | ||
2192 | /* FIXME: apm_ops.suspend(priv) */ | 2189 | /* FIXME: apm_ops.suspend(priv) */ |
2193 | priv->cfg->ops->lib->apm_ops.reset(priv); | 2190 | if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status)) |
2191 | priv->cfg->ops->lib->apm_ops.stop(priv); | ||
2192 | else | ||
2193 | priv->cfg->ops->lib->apm_ops.reset(priv); | ||
2194 | priv->cfg->ops->lib->free_shared_mem(priv); | 2194 | priv->cfg->ops->lib->free_shared_mem(priv); |
2195 | 2195 | ||
2196 | exit: | 2196 | exit: |
@@ -2602,6 +2602,7 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) | |||
2602 | { | 2602 | { |
2603 | struct iwl_priv *priv = hw->priv; | 2603 | struct iwl_priv *priv = hw->priv; |
2604 | int ret; | 2604 | int ret; |
2605 | u16 pci_cmd; | ||
2605 | 2606 | ||
2606 | IWL_DEBUG_MAC80211("enter\n"); | 2607 | IWL_DEBUG_MAC80211("enter\n"); |
2607 | 2608 | ||
@@ -2612,6 +2613,13 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) | |||
2612 | pci_restore_state(priv->pci_dev); | 2613 | pci_restore_state(priv->pci_dev); |
2613 | pci_enable_msi(priv->pci_dev); | 2614 | pci_enable_msi(priv->pci_dev); |
2614 | 2615 | ||
2616 | /* enable interrupts if needed: hw bug w/a */ | ||
2617 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); | ||
2618 | if (pci_cmd & PCI_COMMAND_INTX_DISABLE) { | ||
2619 | pci_cmd &= ~PCI_COMMAND_INTX_DISABLE; | ||
2620 | pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd); | ||
2621 | } | ||
2622 | |||
2615 | ret = request_irq(priv->pci_dev->irq, iwl4965_isr, IRQF_SHARED, | 2623 | ret = request_irq(priv->pci_dev->irq, iwl4965_isr, IRQF_SHARED, |
2616 | DRV_NAME, priv); | 2624 | DRV_NAME, priv); |
2617 | if (ret) { | 2625 | if (ret) { |
@@ -3580,7 +3588,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
3580 | 3588 | ||
3581 | priv->assoc_id = 0; | 3589 | priv->assoc_id = 0; |
3582 | timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; | 3590 | timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; |
3583 | priv->timestamp = le64_to_cpu(timestamp) + (priv->beacon_int * 1000); | 3591 | priv->timestamp = le64_to_cpu(timestamp); |
3584 | 3592 | ||
3585 | IWL_DEBUG_MAC80211("leave\n"); | 3593 | IWL_DEBUG_MAC80211("leave\n"); |
3586 | spin_unlock_irqrestore(&priv->lock, flags); | 3594 | spin_unlock_irqrestore(&priv->lock, flags); |
@@ -4364,15 +4372,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) | |||
4364 | iwl_dbgfs_unregister(priv); | 4372 | iwl_dbgfs_unregister(priv); |
4365 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); | 4373 | sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); |
4366 | 4374 | ||
4375 | /* ieee80211_unregister_hw call wil cause iwl4965_mac_stop to | ||
4376 | * to be called and iwl4965_down since we are removing the device | ||
4377 | * we need to set STATUS_EXIT_PENDING bit. | ||
4378 | */ | ||
4379 | set_bit(STATUS_EXIT_PENDING, &priv->status); | ||
4367 | if (priv->mac80211_registered) { | 4380 | if (priv->mac80211_registered) { |
4368 | ieee80211_unregister_hw(priv->hw); | 4381 | ieee80211_unregister_hw(priv->hw); |
4369 | priv->mac80211_registered = 0; | 4382 | priv->mac80211_registered = 0; |
4383 | } else { | ||
4384 | iwl4965_down(priv); | ||
4370 | } | 4385 | } |
4371 | 4386 | ||
4372 | set_bit(STATUS_EXIT_PENDING, &priv->status); | ||
4373 | |||
4374 | iwl4965_down(priv); | ||
4375 | |||
4376 | /* make sure we flush any pending irq or | 4387 | /* make sure we flush any pending irq or |
4377 | * tasklet for the driver | 4388 | * tasklet for the driver |
4378 | */ | 4389 | */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c72f72579bea..80f2f84defa8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -592,12 +592,11 @@ static void iwlcore_free_geos(struct iwl_priv *priv) | |||
592 | clear_bit(STATUS_GEO_CONFIGURED, &priv->status); | 592 | clear_bit(STATUS_GEO_CONFIGURED, &priv->status); |
593 | } | 593 | } |
594 | 594 | ||
595 | static u8 is_single_rx_stream(struct iwl_priv *priv) | 595 | static bool is_single_rx_stream(struct iwl_priv *priv) |
596 | { | 596 | { |
597 | return !priv->current_ht_config.is_ht || | 597 | return !priv->current_ht_config.is_ht || |
598 | ((priv->current_ht_config.supp_mcs_set[1] == 0) && | 598 | ((priv->current_ht_config.supp_mcs_set[1] == 0) && |
599 | (priv->current_ht_config.supp_mcs_set[2] == 0)) || | 599 | (priv->current_ht_config.supp_mcs_set[2] == 0)); |
600 | priv->ps_mode == IWL_MIMO_PS_STATIC; | ||
601 | } | 600 | } |
602 | 601 | ||
603 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, | 602 | static u8 iwl_is_channel_extension(struct iwl_priv *priv, |
@@ -704,33 +703,39 @@ EXPORT_SYMBOL(iwl_set_rxon_ht); | |||
704 | * MIMO (dual stream) requires at least 2, but works better with 3. | 703 | * MIMO (dual stream) requires at least 2, but works better with 3. |
705 | * This does not determine *which* chains to use, just how many. | 704 | * This does not determine *which* chains to use, just how many. |
706 | */ | 705 | */ |
707 | static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, | 706 | static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) |
708 | u8 *idle_state, u8 *rx_state) | ||
709 | { | 707 | { |
710 | u8 is_single = is_single_rx_stream(priv); | 708 | bool is_single = is_single_rx_stream(priv); |
711 | u8 is_cam = test_bit(STATUS_POWER_PMI, &priv->status) ? 0 : 1; | 709 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); |
712 | 710 | ||
713 | /* # of Rx chains to use when expecting MIMO. */ | 711 | /* # of Rx chains to use when expecting MIMO. */ |
714 | if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) | 712 | if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) |
715 | *rx_state = 2; | 713 | return 2; |
716 | else | 714 | else |
717 | *rx_state = 3; | 715 | return 3; |
716 | } | ||
718 | 717 | ||
718 | static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) | ||
719 | { | ||
720 | int idle_cnt; | ||
721 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); | ||
719 | /* # Rx chains when idling and maybe trying to save power */ | 722 | /* # Rx chains when idling and maybe trying to save power */ |
720 | switch (priv->ps_mode) { | 723 | switch (priv->ps_mode) { |
721 | case IWL_MIMO_PS_STATIC: | 724 | case IWL_MIMO_PS_STATIC: |
722 | case IWL_MIMO_PS_DYNAMIC: | 725 | case IWL_MIMO_PS_DYNAMIC: |
723 | *idle_state = (is_cam) ? 2 : 1; | 726 | idle_cnt = (is_cam) ? 2 : 1; |
724 | break; | 727 | break; |
725 | case IWL_MIMO_PS_NONE: | 728 | case IWL_MIMO_PS_NONE: |
726 | *idle_state = (is_cam) ? *rx_state : 1; | 729 | idle_cnt = (is_cam) ? active_cnt : 1; |
727 | break; | 730 | break; |
731 | case IWL_MIMO_PS_INVALID: | ||
728 | default: | 732 | default: |
729 | *idle_state = 1; | 733 | IWL_ERROR("invalide mimo ps mode %d\n", priv->ps_mode); |
734 | WARN_ON(1); | ||
735 | idle_cnt = -1; | ||
730 | break; | 736 | break; |
731 | } | 737 | } |
732 | 738 | return idle_cnt; | |
733 | return 0; | ||
734 | } | 739 | } |
735 | 740 | ||
736 | /** | 741 | /** |
@@ -741,34 +746,44 @@ static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, | |||
741 | */ | 746 | */ |
742 | void iwl_set_rxon_chain(struct iwl_priv *priv) | 747 | void iwl_set_rxon_chain(struct iwl_priv *priv) |
743 | { | 748 | { |
744 | u8 is_single = is_single_rx_stream(priv); | 749 | bool is_single = is_single_rx_stream(priv); |
745 | u8 idle_state, rx_state; | 750 | bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); |
746 | 751 | u8 idle_rx_cnt, active_rx_cnt; | |
747 | priv->staging_rxon.rx_chain = 0; | 752 | u16 rx_chain; |
748 | rx_state = idle_state = 3; | ||
749 | 753 | ||
750 | /* Tell uCode which antennas are actually connected. | 754 | /* Tell uCode which antennas are actually connected. |
751 | * Before first association, we assume all antennas are connected. | 755 | * Before first association, we assume all antennas are connected. |
752 | * Just after first association, iwl_chain_noise_calibration() | 756 | * Just after first association, iwl_chain_noise_calibration() |
753 | * checks which antennas actually *are* connected. */ | 757 | * checks which antennas actually *are* connected. */ |
754 | priv->staging_rxon.rx_chain |= | 758 | rx_chain = priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS; |
755 | cpu_to_le16(priv->hw_params.valid_rx_ant << | ||
756 | RXON_RX_CHAIN_VALID_POS); | ||
757 | 759 | ||
758 | /* How many receivers should we use? */ | 760 | /* How many receivers should we use? */ |
759 | iwlcore_get_rx_chain_counter(priv, &idle_state, &rx_state); | 761 | active_rx_cnt = iwl_get_active_rx_chain_count(priv); |
760 | priv->staging_rxon.rx_chain |= | 762 | idle_rx_cnt = iwl_get_idle_rx_chain_count(priv, active_rx_cnt); |
761 | cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS); | 763 | |
762 | priv->staging_rxon.rx_chain |= | 764 | /* correct rx chain count accoridng hw settings */ |
763 | cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS); | 765 | if (priv->hw_params.rx_chains_num < active_rx_cnt) |
764 | 766 | active_rx_cnt = priv->hw_params.rx_chains_num; | |
765 | if (!is_single && (rx_state >= 2) && | 767 | |
766 | !test_bit(STATUS_POWER_PMI, &priv->status)) | 768 | if (priv->hw_params.rx_chains_num < idle_rx_cnt) |
769 | idle_rx_cnt = priv->hw_params.rx_chains_num; | ||
770 | |||
771 | rx_chain |= active_rx_cnt << RXON_RX_CHAIN_MIMO_CNT_POS; | ||
772 | rx_chain |= idle_rx_cnt << RXON_RX_CHAIN_CNT_POS; | ||
773 | |||
774 | priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain); | ||
775 | |||
776 | if (!is_single && (active_rx_cnt >= 2) && is_cam) | ||
767 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; | 777 | priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; |
768 | else | 778 | else |
769 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; | 779 | priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; |
770 | 780 | ||
771 | IWL_DEBUG_ASSOC("rx chain %X\n", priv->staging_rxon.rx_chain); | 781 | IWL_DEBUG_ASSOC("rx_chain=0x%Xi active=%d idle=%d\n", |
782 | priv->staging_rxon.rx_chain, | ||
783 | active_rx_cnt, idle_rx_cnt); | ||
784 | |||
785 | WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 || | ||
786 | active_rx_cnt < idle_rx_cnt); | ||
772 | } | 787 | } |
773 | EXPORT_SYMBOL(iwl_set_rxon_chain); | 788 | EXPORT_SYMBOL(iwl_set_rxon_chain); |
774 | 789 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index c19db438306c..cdfb343c7ec6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -412,7 +412,6 @@ struct iwl_ht_info { | |||
412 | /* self configuration data */ | 412 | /* self configuration data */ |
413 | u8 is_ht; | 413 | u8 is_ht; |
414 | u8 supported_chan_width; | 414 | u8 supported_chan_width; |
415 | u16 tx_mimo_ps_mode; | ||
416 | u8 is_green_field; | 415 | u8 is_green_field; |
417 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ | 416 | u8 sgf; /* HT_SHORT_GI_* short guard interval */ |
418 | u8 max_amsdu_size; | 417 | u8 max_amsdu_size; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index 944642450d3d..cd11c0ca2991 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h | |||
@@ -287,6 +287,7 @@ | |||
287 | 287 | ||
288 | #define FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE (0x01000000) | 288 | #define FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE (0x01000000) |
289 | 289 | ||
290 | #define FH_MEM_TFDIB_REG1_ADDR_BITSHIFT 28 | ||
290 | 291 | ||
291 | /** | 292 | /** |
292 | * Transmit DMA Channel Control/Status Registers (TCSR) | 293 | * Transmit DMA Channel Control/Status Registers (TCSR) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index f3f6ea49fdd2..e81bfc42a7cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1173,7 +1173,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, | |||
1173 | 1173 | ||
1174 | rx_status.antenna = 0; | 1174 | rx_status.antenna = 0; |
1175 | rx_status.flag = 0; | 1175 | rx_status.flag = 0; |
1176 | rx_status.flag |= RX_FLAG_TSFT; | 1176 | |
1177 | /* TSF isn't reliable. In order to allow smooth user experience, | ||
1178 | * this W/A doesn't propagate it to the mac80211 */ | ||
1179 | /*rx_status.flag |= RX_FLAG_TSFT;*/ | ||
1177 | 1180 | ||
1178 | if ((unlikely(rx_start->cfg_phy_cnt > 20))) { | 1181 | if ((unlikely(rx_start->cfg_phy_cnt > 20))) { |
1179 | IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", | 1182 | IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 9bb6adb28b73..6c8ac3a87d54 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, | |||
421 | else | 421 | else |
422 | scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; | 422 | scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; |
423 | 423 | ||
424 | if ((scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) && n_probes) | 424 | if (n_probes) |
425 | scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); | 425 | scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); |
426 | 426 | ||
427 | scan_ch->active_dwell = cpu_to_le16(active_dwell); | 427 | scan_ch->active_dwell = cpu_to_le16(active_dwell); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index d82823b5c8ab..78b1a7a4ca40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -402,12 +402,11 @@ static int iwl_hw_tx_queue_init(struct iwl_priv *priv, | |||
402 | /** | 402 | /** |
403 | * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue | 403 | * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue |
404 | */ | 404 | */ |
405 | static int iwl_tx_queue_init(struct iwl_priv *priv, | 405 | static int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, |
406 | struct iwl_tx_queue *txq, | ||
407 | int slots_num, u32 txq_id) | 406 | int slots_num, u32 txq_id) |
408 | { | 407 | { |
409 | int i, len; | 408 | int i, len; |
410 | int rc = 0; | 409 | int ret; |
411 | 410 | ||
412 | /* | 411 | /* |
413 | * Alloc buffer array for commands (Tx or other types of commands). | 412 | * Alloc buffer array for commands (Tx or other types of commands). |
@@ -426,19 +425,16 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, | |||
426 | continue; | 425 | continue; |
427 | } | 426 | } |
428 | 427 | ||
429 | txq->cmd[i] = kmalloc(len, GFP_KERNEL | GFP_DMA); | 428 | txq->cmd[i] = kmalloc(len, GFP_KERNEL); |
430 | if (!txq->cmd[i]) | 429 | if (!txq->cmd[i]) |
431 | return -ENOMEM; | 430 | goto err; |
432 | } | 431 | } |
433 | 432 | ||
434 | /* Alloc driver data array and TFD circular buffer */ | 433 | /* Alloc driver data array and TFD circular buffer */ |
435 | rc = iwl_tx_queue_alloc(priv, txq, txq_id); | 434 | ret = iwl_tx_queue_alloc(priv, txq, txq_id); |
436 | if (rc) { | 435 | if (ret) |
437 | for (i = 0; i < slots_num; i++) | 436 | goto err; |
438 | kfree(txq->cmd[i]); | ||
439 | 437 | ||
440 | return -ENOMEM; | ||
441 | } | ||
442 | txq->need_update = 0; | 438 | txq->need_update = 0; |
443 | 439 | ||
444 | /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise | 440 | /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise |
@@ -452,6 +448,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, | |||
452 | iwl_hw_tx_queue_init(priv, txq); | 448 | iwl_hw_tx_queue_init(priv, txq); |
453 | 449 | ||
454 | return 0; | 450 | return 0; |
451 | err: | ||
452 | for (i = 0; i < slots_num; i++) { | ||
453 | kfree(txq->cmd[i]); | ||
454 | txq->cmd[i] = NULL; | ||
455 | } | ||
456 | |||
457 | if (txq_id == IWL_CMD_QUEUE_NUM) { | ||
458 | kfree(txq->cmd[slots_num]); | ||
459 | txq->cmd[slots_num] = NULL; | ||
460 | } | ||
461 | return -ENOMEM; | ||
455 | } | 462 | } |
456 | /** | 463 | /** |
457 | * iwl_hw_txq_ctx_free - Free TXQ Context | 464 | * iwl_hw_txq_ctx_free - Free TXQ Context |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 04d7a251e3f0..8941919001bb 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -595,7 +595,7 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
595 | if (ret < 0) { | 595 | if (ret < 0) { |
596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", | 596 | lbs_pr_err("can't download helper at 0x%x, ret %d\n", |
597 | sent, ret); | 597 | sent, ret); |
598 | goto done; | 598 | goto err_release; |
599 | } | 599 | } |
600 | 600 | ||
601 | if (count == 0) | 601 | if (count == 0) |
@@ -604,9 +604,8 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
604 | sent += count; | 604 | sent += count; |
605 | } | 605 | } |
606 | 606 | ||
607 | err_release: | ||
607 | release_firmware(fw); | 608 | release_firmware(fw); |
608 | ret = 0; | ||
609 | |||
610 | done: | 609 | done: |
611 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); | 610 | lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret); |
612 | return ret; | 611 | return ret; |
@@ -676,14 +675,8 @@ static int if_cs_prog_real(struct if_cs_card *card) | |||
676 | } | 675 | } |
677 | 676 | ||
678 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); | 677 | ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a); |
679 | if (ret < 0) { | 678 | if (ret < 0) |
680 | lbs_pr_err("firmware download failed\n"); | 679 | lbs_pr_err("firmware download failed\n"); |
681 | goto err_release; | ||
682 | } | ||
683 | |||
684 | ret = 0; | ||
685 | goto done; | ||
686 | |||
687 | 680 | ||
688 | err_release: | 681 | err_release: |
689 | release_firmware(fw); | 682 | release_firmware(fw); |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 1ebcafe7ca5f..36c004e15602 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -1970,6 +1970,9 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1970 | priv->promiscuous = promisc; | 1970 | priv->promiscuous = promisc; |
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | /* If we're not in promiscuous mode, then we need to set the | ||
1974 | * group address if either we want to multicast, or if we were | ||
1975 | * multicasting and want to stop */ | ||
1973 | if (! promisc && (mc_count || priv->mc_count) ) { | 1976 | if (! promisc && (mc_count || priv->mc_count) ) { |
1974 | struct dev_mc_list *p = dev->mc_list; | 1977 | struct dev_mc_list *p = dev->mc_list; |
1975 | struct hermes_multicast mclist; | 1978 | struct hermes_multicast mclist; |
@@ -1989,9 +1992,10 @@ __orinoco_set_multicast_list(struct net_device *dev) | |||
1989 | printk(KERN_WARNING "%s: Multicast list is " | 1992 | printk(KERN_WARNING "%s: Multicast list is " |
1990 | "longer than mc_count\n", dev->name); | 1993 | "longer than mc_count\n", dev->name); |
1991 | 1994 | ||
1992 | err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES, | 1995 | err = hermes_write_ltv(hw, USER_BAP, |
1993 | HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN), | 1996 | HERMES_RID_CNFGROUPADDRESSES, |
1994 | &mclist); | 1997 | HERMES_BYTES_TO_RECLEN(mc_count * ETH_ALEN), |
1998 | &mclist); | ||
1995 | if (err) | 1999 | if (err) |
1996 | printk(KERN_ERR "%s: Error %d setting multicast list.\n", | 2000 | printk(KERN_ERR "%s: Error %d setting multicast list.\n", |
1997 | dev->name, err); | 2001 | dev->name, err); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h index 7e88ce5651b9..2ea7866abd5d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00reg.h +++ b/drivers/net/wireless/rt2x00/rt2x00reg.h | |||
@@ -136,7 +136,7 @@ struct rt2x00_field32 { | |||
136 | */ | 136 | */ |
137 | #define is_power_of_two(x) ( !((x) & ((x)-1)) ) | 137 | #define is_power_of_two(x) ( !((x) & ((x)-1)) ) |
138 | #define low_bit_mask(x) ( ((x)-1) & ~(x) ) | 138 | #define low_bit_mask(x) ( ((x)-1) & ~(x) ) |
139 | #define is_valid_mask(x) is_power_of_two(1 + (x) + low_bit_mask(x)) | 139 | #define is_valid_mask(x) is_power_of_two(1LU + (x) + low_bit_mask(x)) |
140 | 140 | ||
141 | /* | 141 | /* |
142 | * Macro's to find first set bit in a variable. | 142 | * Macro's to find first set bit in a variable. |
@@ -173,8 +173,7 @@ struct rt2x00_field32 { | |||
173 | * does not exceed the given typelimit. | 173 | * does not exceed the given typelimit. |
174 | */ | 174 | */ |
175 | #define FIELD_CHECK(__mask, __type) \ | 175 | #define FIELD_CHECK(__mask, __type) \ |
176 | BUILD_BUG_ON(!__builtin_constant_p(__mask) || \ | 176 | BUILD_BUG_ON(!(__mask) || \ |
177 | !(__mask) || \ | ||
178 | !is_valid_mask(__mask) || \ | 177 | !is_valid_mask(__mask) || \ |
179 | (__mask) != (__type)(__mask)) \ | 178 | (__mask) != (__type)(__mask)) \ |
180 | 179 | ||
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 40337a06c18a..146ca9cd1567 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
@@ -320,15 +320,15 @@ static int disable_slot(struct hotplug_slot *slot) | |||
320 | return -ENODEV; | 320 | return -ENODEV; |
321 | } | 321 | } |
322 | 322 | ||
323 | /* remove the device from the pci core */ | ||
324 | pci_remove_bus_device(dev); | ||
325 | |||
323 | /* queue work item to blow away this sysfs entry and other | 326 | /* queue work item to blow away this sysfs entry and other |
324 | * parts. | 327 | * parts. |
325 | */ | 328 | */ |
326 | INIT_WORK(&dslot->remove_work, remove_slot_worker); | 329 | INIT_WORK(&dslot->remove_work, remove_slot_worker); |
327 | queue_work(dummyphp_wq, &dslot->remove_work); | 330 | queue_work(dummyphp_wq, &dslot->remove_work); |
328 | 331 | ||
329 | /* blow away this sysfs entry and other parts. */ | ||
330 | remove_slot(dslot); | ||
331 | |||
332 | pci_dev_put(dev); | 332 | pci_dev_put(dev); |
333 | } | 333 | } |
334 | return 0; | 334 | return 0; |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index ab31f5ba665d..9d934ddee956 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -258,7 +258,7 @@ static int pcie_poll_cmd(struct controller *ctrl) | |||
258 | return 1; | 258 | return 1; |
259 | } | 259 | } |
260 | } | 260 | } |
261 | while (timeout > 1000) { | 261 | while (timeout > 0) { |
262 | msleep(10); | 262 | msleep(10); |
263 | timeout -= 10; | 263 | timeout -= 10; |
264 | if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) { | 264 | if (!pciehp_readw(ctrl, SLOTSTATUS, &slot_status)) { |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 8d0e60ac849c..c3edcdc08e72 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -2348,11 +2348,34 @@ static void __init iommu_exit_mempool(void) | |||
2348 | 2348 | ||
2349 | } | 2349 | } |
2350 | 2350 | ||
2351 | static int blacklist_iommu(const struct dmi_system_id *id) | ||
2352 | { | ||
2353 | printk(KERN_INFO "%s detected; disabling IOMMU\n", | ||
2354 | id->ident); | ||
2355 | dmar_disabled = 1; | ||
2356 | return 0; | ||
2357 | } | ||
2358 | |||
2359 | static struct dmi_system_id __initdata intel_iommu_dmi_table[] = { | ||
2360 | { /* Some DG33BU BIOS revisions advertised non-existent VT-d */ | ||
2361 | .callback = blacklist_iommu, | ||
2362 | .ident = "Intel DG33BU", | ||
2363 | { DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), | ||
2364 | DMI_MATCH(DMI_BOARD_NAME, "DG33BU"), | ||
2365 | } | ||
2366 | }, | ||
2367 | { } | ||
2368 | }; | ||
2369 | |||
2370 | |||
2351 | void __init detect_intel_iommu(void) | 2371 | void __init detect_intel_iommu(void) |
2352 | { | 2372 | { |
2353 | if (swiotlb || no_iommu || iommu_detected || dmar_disabled) | 2373 | if (swiotlb || no_iommu || iommu_detected || dmar_disabled) |
2354 | return; | 2374 | return; |
2355 | if (early_dmar_detect()) { | 2375 | if (early_dmar_detect()) { |
2376 | dmi_check_system(intel_iommu_dmi_table); | ||
2377 | if (dmar_disabled) | ||
2378 | return; | ||
2356 | iommu_detected = 1; | 2379 | iommu_detected = 1; |
2357 | } | 2380 | } |
2358 | } | 2381 | } |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index cce2f4cb1fbf..36698e57b97f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -304,6 +304,9 @@ static int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
304 | } else { | 304 | } else { |
305 | res->start = l64; | 305 | res->start = l64; |
306 | res->end = l64 + sz64; | 306 | res->end = l64 + sz64; |
307 | printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n", | ||
308 | pci_name(dev), pos, (unsigned long long)res->start, | ||
309 | (unsigned long long)res->end); | ||
307 | } | 310 | } |
308 | } else { | 311 | } else { |
309 | sz = pci_size(l, sz, mask); | 312 | sz = pci_size(l, sz, mask); |
@@ -313,6 +316,9 @@ static int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, | |||
313 | 316 | ||
314 | res->start = l; | 317 | res->start = l; |
315 | res->end = l + sz; | 318 | res->end = l + sz; |
319 | printk(KERN_DEBUG "PCI: %s reg %x %s: [%llx, %llx]\n", pci_name(dev), | ||
320 | pos, (res->flags & IORESOURCE_IO) ? "io port":"32bit mmio", | ||
321 | (unsigned long long)res->start, (unsigned long long)res->end); | ||
316 | } | 322 | } |
317 | 323 | ||
318 | out: | 324 | out: |
@@ -383,7 +389,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
383 | res->start = base; | 389 | res->start = base; |
384 | if (!res->end) | 390 | if (!res->end) |
385 | res->end = limit + 0xfff; | 391 | res->end = limit + 0xfff; |
386 | printk(KERN_INFO "PCI: bridge %s io port: [%llx, %llx]\n", pci_name(dev), res->start, res->end); | 392 | printk(KERN_DEBUG "PCI: bridge %s io port: [%llx, %llx]\n", |
393 | pci_name(dev), (unsigned long long) res->start, | ||
394 | (unsigned long long) res->end); | ||
387 | } | 395 | } |
388 | 396 | ||
389 | res = child->resource[1]; | 397 | res = child->resource[1]; |
@@ -395,7 +403,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
395 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; | 403 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM; |
396 | res->start = base; | 404 | res->start = base; |
397 | res->end = limit + 0xfffff; | 405 | res->end = limit + 0xfffff; |
398 | printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", pci_name(dev), res->start, res->end); | 406 | printk(KERN_DEBUG "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", |
407 | pci_name(dev), (unsigned long long) res->start, | ||
408 | (unsigned long long) res->end); | ||
399 | } | 409 | } |
400 | 410 | ||
401 | res = child->resource[2]; | 411 | res = child->resource[2]; |
@@ -431,7 +441,9 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child) | |||
431 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH; | 441 | res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH; |
432 | res->start = base; | 442 | res->start = base; |
433 | res->end = limit + 0xfffff; | 443 | res->end = limit + 0xfffff; |
434 | printk(KERN_INFO "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",res->start, res->end); | 444 | printk(KERN_DEBUG "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", |
445 | pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32", | ||
446 | (unsigned long long) res->start, (unsigned long long) res->end); | ||
435 | } | 447 | } |
436 | } | 448 | } |
437 | 449 | ||
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 82634a2f1b1d..3abbfad9ddab 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -352,11 +352,12 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long | |||
352 | continue; | 352 | continue; |
353 | r_size = r->end - r->start + 1; | 353 | r_size = r->end - r->start + 1; |
354 | /* For bridges size != alignment */ | 354 | /* For bridges size != alignment */ |
355 | align = (i < PCI_BRIDGE_RESOURCES) ? r_size : r->start; | 355 | align = resource_alignment(r); |
356 | order = __ffs(align) - 20; | 356 | order = __ffs(align) - 20; |
357 | if (order > 11) { | 357 | if (order > 11) { |
358 | dev_warn(&dev->dev, "BAR %d too large: " | 358 | dev_warn(&dev->dev, "BAR %d bad alignment %llx: " |
359 | "%#016llx-%#016llx\n", i, | 359 | "%#016llx-%#016llx\n", i, |
360 | (unsigned long long)align, | ||
360 | (unsigned long long)r->start, | 361 | (unsigned long long)r->start, |
361 | (unsigned long long)r->end); | 362 | (unsigned long long)r->end); |
362 | r->flags = 0; | 363 | r->flags = 0; |
@@ -539,7 +540,11 @@ static void pci_bus_dump_res(struct pci_bus *bus) | |||
539 | if (!res) | 540 | if (!res) |
540 | continue; | 541 | continue; |
541 | 542 | ||
542 | printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end); | 543 | printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", |
544 | bus->number, i, | ||
545 | (res->flags & IORESOURCE_IO) ? "io port" : "mmio", | ||
546 | (unsigned long long) res->start, | ||
547 | (unsigned long long) res->end); | ||
543 | } | 548 | } |
544 | } | 549 | } |
545 | 550 | ||
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index c48f3f69bdaf..da3972153226 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -748,7 +748,9 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
748 | 748 | ||
749 | add_timer(&skt->poll_timer); | 749 | add_timer(&skt->poll_timer); |
750 | 750 | ||
751 | device_create_file(&skt->socket.dev, &dev_attr_status); | 751 | ret = device_create_file(&skt->socket.dev, &dev_attr_status); |
752 | if (ret) | ||
753 | goto out_err_8; | ||
752 | } | 754 | } |
753 | 755 | ||
754 | dev_set_drvdata(dev, sinfo); | 756 | dev_set_drvdata(dev, sinfo); |
@@ -758,6 +760,8 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
758 | do { | 760 | do { |
759 | skt = &sinfo->skt[i]; | 761 | skt = &sinfo->skt[i]; |
760 | 762 | ||
763 | device_remove_file(&skt->socket.dev, &dev_attr_status); | ||
764 | out_err_8: | ||
761 | del_timer_sync(&skt->poll_timer); | 765 | del_timer_sync(&skt->poll_timer); |
762 | pcmcia_unregister_socket(&skt->socket); | 766 | pcmcia_unregister_socket(&skt->socket); |
763 | 767 | ||
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index d7e9f2152df0..95015cbfd33f 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -405,8 +405,6 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, | |||
405 | 405 | ||
406 | case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: | 406 | case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: |
407 | extended_irq = &res->data.extended_irq; | 407 | extended_irq = &res->data.extended_irq; |
408 | if (extended_irq->producer_consumer == ACPI_PRODUCER) | ||
409 | return AE_OK; | ||
410 | 408 | ||
411 | if (extended_irq->interrupt_count == 0) | 409 | if (extended_irq->interrupt_count == 0) |
412 | pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); | 410 | pnp_add_irq_resource(dev, 0, IORESOURCE_DISABLED); |
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 6ea349aba3ba..b184367637d0 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c | |||
@@ -800,7 +800,6 @@ static void __exit cmos_do_remove(struct device *dev) | |||
800 | static int cmos_suspend(struct device *dev, pm_message_t mesg) | 800 | static int cmos_suspend(struct device *dev, pm_message_t mesg) |
801 | { | 801 | { |
802 | struct cmos_rtc *cmos = dev_get_drvdata(dev); | 802 | struct cmos_rtc *cmos = dev_get_drvdata(dev); |
803 | int do_wake = device_may_wakeup(dev); | ||
804 | unsigned char tmp; | 803 | unsigned char tmp; |
805 | 804 | ||
806 | /* only the alarm might be a wakeup event source */ | 805 | /* only the alarm might be a wakeup event source */ |
@@ -809,7 +808,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg) | |||
809 | if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) { | 808 | if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) { |
810 | unsigned char mask; | 809 | unsigned char mask; |
811 | 810 | ||
812 | if (do_wake) | 811 | if (device_may_wakeup(dev)) |
813 | mask = RTC_IRQMASK & ~RTC_AIE; | 812 | mask = RTC_IRQMASK & ~RTC_AIE; |
814 | else | 813 | else |
815 | mask = RTC_IRQMASK; | 814 | mask = RTC_IRQMASK; |
@@ -837,6 +836,17 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg) | |||
837 | return 0; | 836 | return 0; |
838 | } | 837 | } |
839 | 838 | ||
839 | /* We want RTC alarms to wake us from e.g. ACPI G2/S5 "soft off", even | ||
840 | * after a detour through G3 "mechanical off", although the ACPI spec | ||
841 | * says wakeup should only work from G1/S4 "hibernate". To most users, | ||
842 | * distinctions between S4 and S5 are pointless. So when the hardware | ||
843 | * allows, don't draw that distinction. | ||
844 | */ | ||
845 | static inline int cmos_poweroff(struct device *dev) | ||
846 | { | ||
847 | return cmos_suspend(dev, PMSG_HIBERNATE); | ||
848 | } | ||
849 | |||
840 | static int cmos_resume(struct device *dev) | 850 | static int cmos_resume(struct device *dev) |
841 | { | 851 | { |
842 | struct cmos_rtc *cmos = dev_get_drvdata(dev); | 852 | struct cmos_rtc *cmos = dev_get_drvdata(dev); |
@@ -884,6 +894,12 @@ static int cmos_resume(struct device *dev) | |||
884 | #else | 894 | #else |
885 | #define cmos_suspend NULL | 895 | #define cmos_suspend NULL |
886 | #define cmos_resume NULL | 896 | #define cmos_resume NULL |
897 | |||
898 | static inline int cmos_poweroff(struct device *dev) | ||
899 | { | ||
900 | return -ENOSYS; | ||
901 | } | ||
902 | |||
887 | #endif | 903 | #endif |
888 | 904 | ||
889 | /*----------------------------------------------------------------*/ | 905 | /*----------------------------------------------------------------*/ |
@@ -903,10 +919,6 @@ static int cmos_resume(struct device *dev) | |||
903 | static int __devinit | 919 | static int __devinit |
904 | cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) | 920 | cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) |
905 | { | 921 | { |
906 | /* REVISIT paranoia argues for a shutdown notifier, since PNP | ||
907 | * drivers can't provide shutdown() methods to disable IRQs. | ||
908 | * Or better yet, fix PNP to allow those methods... | ||
909 | */ | ||
910 | if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0)) | 922 | if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0)) |
911 | /* Some machines contain a PNP entry for the RTC, but | 923 | /* Some machines contain a PNP entry for the RTC, but |
912 | * don't define the IRQ. It should always be safe to | 924 | * don't define the IRQ. It should always be safe to |
@@ -942,6 +954,13 @@ static int cmos_pnp_resume(struct pnp_dev *pnp) | |||
942 | #define cmos_pnp_resume NULL | 954 | #define cmos_pnp_resume NULL |
943 | #endif | 955 | #endif |
944 | 956 | ||
957 | static void cmos_pnp_shutdown(struct device *pdev) | ||
958 | { | ||
959 | if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(pdev)) | ||
960 | return; | ||
961 | |||
962 | cmos_do_shutdown(); | ||
963 | } | ||
945 | 964 | ||
946 | static const struct pnp_device_id rtc_ids[] = { | 965 | static const struct pnp_device_id rtc_ids[] = { |
947 | { .id = "PNP0b00", }, | 966 | { .id = "PNP0b00", }, |
@@ -961,6 +980,10 @@ static struct pnp_driver cmos_pnp_driver = { | |||
961 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, | 980 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, |
962 | .suspend = cmos_pnp_suspend, | 981 | .suspend = cmos_pnp_suspend, |
963 | .resume = cmos_pnp_resume, | 982 | .resume = cmos_pnp_resume, |
983 | .driver = { | ||
984 | .name = (char *)driver_name, | ||
985 | .shutdown = cmos_pnp_shutdown, | ||
986 | } | ||
964 | }; | 987 | }; |
965 | 988 | ||
966 | #endif /* CONFIG_PNP */ | 989 | #endif /* CONFIG_PNP */ |
@@ -986,6 +1009,9 @@ static int __exit cmos_platform_remove(struct platform_device *pdev) | |||
986 | 1009 | ||
987 | static void cmos_platform_shutdown(struct platform_device *pdev) | 1010 | static void cmos_platform_shutdown(struct platform_device *pdev) |
988 | { | 1011 | { |
1012 | if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(&pdev->dev)) | ||
1013 | return; | ||
1014 | |||
989 | cmos_do_shutdown(); | 1015 | cmos_do_shutdown(); |
990 | } | 1016 | } |
991 | 1017 | ||
diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 9f996ec881ce..dd70bf73ce9d 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c | |||
@@ -51,10 +51,11 @@ EXPORT_SYMBOL(rtc_year_days); | |||
51 | */ | 51 | */ |
52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) | 52 | void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) |
53 | { | 53 | { |
54 | unsigned int days, month, year; | 54 | unsigned int month, year; |
55 | int days; | ||
55 | 56 | ||
56 | days = time / 86400; | 57 | days = time / 86400; |
57 | time -= days * 86400; | 58 | time -= (unsigned int) days * 86400; |
58 | 59 | ||
59 | /* day of the week, 1970-01-01 was a Thursday */ | 60 | /* day of the week, 1970-01-01 was a Thursday */ |
60 | tm->tm_wday = (days + 4) % 7; | 61 | tm->tm_wday = (days + 4) % 7; |
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index e0ce65fca4e7..9a50f245774b 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -113,7 +113,8 @@ ccwgroup_release (struct device *dev) | |||
113 | 113 | ||
114 | for (i = 0; i < gdev->count; i++) { | 114 | for (i = 0; i < gdev->count; i++) { |
115 | if (gdev->cdev[i]) { | 115 | if (gdev->cdev[i]) { |
116 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); | 116 | if (dev_get_drvdata(&gdev->cdev[i]->dev) == gdev) |
117 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); | ||
117 | put_device(&gdev->cdev[i]->dev); | 118 | put_device(&gdev->cdev[i]->dev); |
118 | } | 119 | } |
119 | } | 120 | } |
@@ -296,6 +297,7 @@ error: | |||
296 | if (dev_get_drvdata(&gdev->cdev[i]->dev) == gdev) | 297 | if (dev_get_drvdata(&gdev->cdev[i]->dev) == gdev) |
297 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); | 298 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); |
298 | put_device(&gdev->cdev[i]->dev); | 299 | put_device(&gdev->cdev[i]->dev); |
300 | gdev->cdev[i] = NULL; | ||
299 | } | 301 | } |
300 | mutex_unlock(&gdev->reg_mutex); | 302 | mutex_unlock(&gdev->reg_mutex); |
301 | put_device(&gdev->dev); | 303 | put_device(&gdev->dev); |
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index db00b0591733..f1216cf6fa8f 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c | |||
@@ -423,7 +423,7 @@ int chp_new(struct chp_id chpid) | |||
423 | ret = sysfs_create_group(&chp->dev.kobj, &chp_attr_group); | 423 | ret = sysfs_create_group(&chp->dev.kobj, &chp_attr_group); |
424 | if (ret) { | 424 | if (ret) { |
425 | device_unregister(&chp->dev); | 425 | device_unregister(&chp->dev); |
426 | goto out_free; | 426 | goto out; |
427 | } | 427 | } |
428 | mutex_lock(&channel_subsystems[chpid.cssid]->mutex); | 428 | mutex_lock(&channel_subsystems[chpid.cssid]->mutex); |
429 | if (channel_subsystems[chpid.cssid]->cm_enabled) { | 429 | if (channel_subsystems[chpid.cssid]->cm_enabled) { |
@@ -432,14 +432,15 @@ int chp_new(struct chp_id chpid) | |||
432 | sysfs_remove_group(&chp->dev.kobj, &chp_attr_group); | 432 | sysfs_remove_group(&chp->dev.kobj, &chp_attr_group); |
433 | device_unregister(&chp->dev); | 433 | device_unregister(&chp->dev); |
434 | mutex_unlock(&channel_subsystems[chpid.cssid]->mutex); | 434 | mutex_unlock(&channel_subsystems[chpid.cssid]->mutex); |
435 | goto out_free; | 435 | goto out; |
436 | } | 436 | } |
437 | } | 437 | } |
438 | channel_subsystems[chpid.cssid]->chps[chpid.id] = chp; | 438 | channel_subsystems[chpid.cssid]->chps[chpid.id] = chp; |
439 | mutex_unlock(&channel_subsystems[chpid.cssid]->mutex); | 439 | mutex_unlock(&channel_subsystems[chpid.cssid]->mutex); |
440 | return ret; | 440 | goto out; |
441 | out_free: | 441 | out_free: |
442 | kfree(chp); | 442 | kfree(chp); |
443 | out: | ||
443 | return ret; | 444 | return ret; |
444 | } | 445 | } |
445 | 446 | ||
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index 33bff8fec7d1..326f4cc7f92c 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -174,6 +174,7 @@ cio_start_key (struct subchannel *sch, /* subchannel structure */ | |||
174 | CIO_TRACE_EVENT(4, sch->dev.bus_id); | 174 | CIO_TRACE_EVENT(4, sch->dev.bus_id); |
175 | 175 | ||
176 | orb = &to_io_private(sch)->orb; | 176 | orb = &to_io_private(sch)->orb; |
177 | memset(orb, 0, sizeof(union orb)); | ||
177 | /* sch is always under 2G. */ | 178 | /* sch is always under 2G. */ |
178 | orb->cmd.intparm = (u32)(addr_t)sch; | 179 | orb->cmd.intparm = (u32)(addr_t)sch; |
179 | orb->cmd.fmt = 1; | 180 | orb->cmd.fmt = 1; |
@@ -208,8 +209,10 @@ cio_start_key (struct subchannel *sch, /* subchannel structure */ | |||
208 | case 1: /* status pending */ | 209 | case 1: /* status pending */ |
209 | case 2: /* busy */ | 210 | case 2: /* busy */ |
210 | return -EBUSY; | 211 | return -EBUSY; |
211 | default: /* device/path not operational */ | 212 | case 3: /* device/path not operational */ |
212 | return cio_start_handle_notoper(sch, lpm); | 213 | return cio_start_handle_notoper(sch, lpm); |
214 | default: | ||
215 | return ccode; | ||
213 | } | 216 | } |
214 | } | 217 | } |
215 | 218 | ||
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 51489eff6b0b..1261e1a9e8cd 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -633,6 +633,11 @@ channel_subsystem_release(struct device *dev) | |||
633 | 633 | ||
634 | css = to_css(dev); | 634 | css = to_css(dev); |
635 | mutex_destroy(&css->mutex); | 635 | mutex_destroy(&css->mutex); |
636 | if (css->pseudo_subchannel) { | ||
637 | /* Implies that it has been generated but never registered. */ | ||
638 | css_subchannel_release(&css->pseudo_subchannel->dev); | ||
639 | css->pseudo_subchannel = NULL; | ||
640 | } | ||
636 | kfree(css); | 641 | kfree(css); |
637 | } | 642 | } |
638 | 643 | ||
@@ -785,11 +790,15 @@ init_channel_subsystem (void) | |||
785 | } | 790 | } |
786 | channel_subsystems[i] = css; | 791 | channel_subsystems[i] = css; |
787 | ret = setup_css(i); | 792 | ret = setup_css(i); |
788 | if (ret) | 793 | if (ret) { |
789 | goto out_free; | 794 | kfree(channel_subsystems[i]); |
795 | goto out_unregister; | ||
796 | } | ||
790 | ret = device_register(&css->device); | 797 | ret = device_register(&css->device); |
791 | if (ret) | 798 | if (ret) { |
792 | goto out_free_all; | 799 | put_device(&css->device); |
800 | goto out_unregister; | ||
801 | } | ||
793 | if (css_chsc_characteristics.secm) { | 802 | if (css_chsc_characteristics.secm) { |
794 | ret = device_create_file(&css->device, | 803 | ret = device_create_file(&css->device, |
795 | &dev_attr_cm_enable); | 804 | &dev_attr_cm_enable); |
@@ -802,7 +811,7 @@ init_channel_subsystem (void) | |||
802 | } | 811 | } |
803 | ret = register_reboot_notifier(&css_reboot_notifier); | 812 | ret = register_reboot_notifier(&css_reboot_notifier); |
804 | if (ret) | 813 | if (ret) |
805 | goto out_pseudo; | 814 | goto out_unregister; |
806 | css_init_done = 1; | 815 | css_init_done = 1; |
807 | 816 | ||
808 | /* Enable default isc for I/O subchannels. */ | 817 | /* Enable default isc for I/O subchannels. */ |
@@ -810,18 +819,12 @@ init_channel_subsystem (void) | |||
810 | 819 | ||
811 | for_each_subchannel(__init_channel_subsystem, NULL); | 820 | for_each_subchannel(__init_channel_subsystem, NULL); |
812 | return 0; | 821 | return 0; |
813 | out_pseudo: | ||
814 | device_unregister(&channel_subsystems[i]->pseudo_subchannel->dev); | ||
815 | out_file: | 822 | out_file: |
816 | device_remove_file(&channel_subsystems[i]->device, | 823 | if (css_chsc_characteristics.secm) |
817 | &dev_attr_cm_enable); | 824 | device_remove_file(&channel_subsystems[i]->device, |
825 | &dev_attr_cm_enable); | ||
818 | out_device: | 826 | out_device: |
819 | device_unregister(&channel_subsystems[i]->device); | 827 | device_unregister(&channel_subsystems[i]->device); |
820 | out_free_all: | ||
821 | kfree(channel_subsystems[i]->pseudo_subchannel->lock); | ||
822 | kfree(channel_subsystems[i]->pseudo_subchannel); | ||
823 | out_free: | ||
824 | kfree(channel_subsystems[i]); | ||
825 | out_unregister: | 828 | out_unregister: |
826 | while (i > 0) { | 829 | while (i > 0) { |
827 | struct channel_subsystem *css; | 830 | struct channel_subsystem *css; |
@@ -829,6 +832,7 @@ out_unregister: | |||
829 | i--; | 832 | i--; |
830 | css = channel_subsystems[i]; | 833 | css = channel_subsystems[i]; |
831 | device_unregister(&css->pseudo_subchannel->dev); | 834 | device_unregister(&css->pseudo_subchannel->dev); |
835 | css->pseudo_subchannel = NULL; | ||
832 | if (css_chsc_characteristics.secm) | 836 | if (css_chsc_characteristics.secm) |
833 | device_remove_file(&css->device, | 837 | device_remove_file(&css->device, |
834 | &dev_attr_cm_enable); | 838 | &dev_attr_cm_enable); |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 550508df952b..84cc9ea346db 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -658,6 +658,13 @@ ccw_device_offline(struct ccw_device *cdev) | |||
658 | { | 658 | { |
659 | struct subchannel *sch; | 659 | struct subchannel *sch; |
660 | 660 | ||
661 | /* Allow ccw_device_offline while disconnected. */ | ||
662 | if (cdev->private->state == DEV_STATE_DISCONNECTED || | ||
663 | cdev->private->state == DEV_STATE_NOT_OPER) { | ||
664 | cdev->private->flags.donotify = 0; | ||
665 | ccw_device_done(cdev, DEV_STATE_NOT_OPER); | ||
666 | return 0; | ||
667 | } | ||
661 | if (ccw_device_is_orphan(cdev)) { | 668 | if (ccw_device_is_orphan(cdev)) { |
662 | ccw_device_done(cdev, DEV_STATE_OFFLINE); | 669 | ccw_device_done(cdev, DEV_STATE_OFFLINE); |
663 | return 0; | 670 | return 0; |
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 391dd29749f8..51b6a05f4d12 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -152,10 +152,8 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device) | |||
152 | */ | 152 | */ |
153 | static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) | 153 | static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) |
154 | { | 154 | { |
155 | struct zfcp_adapter *adapter; | 155 | struct zfcp_adapter *adapter = dev_get_drvdata(&ccw_device->dev); |
156 | 156 | ||
157 | down(&zfcp_data.config_sema); | ||
158 | adapter = dev_get_drvdata(&ccw_device->dev); | ||
159 | switch (event) { | 157 | switch (event) { |
160 | case CIO_GONE: | 158 | case CIO_GONE: |
161 | dev_warn(&adapter->ccw_device->dev, "device gone\n"); | 159 | dev_warn(&adapter->ccw_device->dev, "device gone\n"); |
@@ -174,8 +172,6 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) | |||
174 | 89, NULL); | 172 | 89, NULL); |
175 | break; | 173 | break; |
176 | } | 174 | } |
177 | zfcp_erp_wait(adapter); | ||
178 | up(&zfcp_data.config_sema); | ||
179 | return 1; | 175 | return 1; |
180 | } | 176 | } |
181 | 177 | ||
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index e984469bb98b..56196c98c07b 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -39,18 +39,6 @@ struct zfcp_gpn_ft { | |||
39 | struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS]; | 39 | struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS]; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static struct zfcp_port *zfcp_get_port_by_did(struct zfcp_adapter *adapter, | ||
43 | u32 d_id) | ||
44 | { | ||
45 | struct zfcp_port *port; | ||
46 | |||
47 | list_for_each_entry(port, &adapter->port_list_head, list) | ||
48 | if ((port->d_id == d_id) && | ||
49 | !atomic_test_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status)) | ||
50 | return port; | ||
51 | return NULL; | ||
52 | } | ||
53 | |||
54 | static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, | 42 | static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range, |
55 | struct fcp_rscn_element *elem) | 43 | struct fcp_rscn_element *elem) |
56 | { | 44 | { |
@@ -341,12 +329,13 @@ void zfcp_test_link(struct zfcp_port *port) | |||
341 | 329 | ||
342 | zfcp_port_get(port); | 330 | zfcp_port_get(port); |
343 | retval = zfcp_fc_adisc(port); | 331 | retval = zfcp_fc_adisc(port); |
344 | if (retval == 0 || retval == -EBUSY) | 332 | if (retval == 0) |
345 | return; | 333 | return; |
346 | 334 | ||
347 | /* send of ADISC was not possible */ | 335 | /* send of ADISC was not possible */ |
348 | zfcp_port_put(port); | 336 | zfcp_port_put(port); |
349 | zfcp_erp_port_forced_reopen(port, 0, 65, NULL); | 337 | if (retval != -EBUSY) |
338 | zfcp_erp_port_forced_reopen(port, 0, 65, NULL); | ||
350 | } | 339 | } |
351 | 340 | ||
352 | static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) | 341 | static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) |
@@ -363,7 +352,6 @@ static int zfcp_scan_get_nameserver(struct zfcp_adapter *adapter) | |||
363 | if (ret) | 352 | if (ret) |
364 | return ret; | 353 | return ret; |
365 | zfcp_erp_wait(adapter); | 354 | zfcp_erp_wait(adapter); |
366 | zfcp_port_put(adapter->nameserver_port); | ||
367 | } | 355 | } |
368 | return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, | 356 | return !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
369 | &adapter->nameserver_port->status); | 357 | &adapter->nameserver_port->status); |
@@ -475,7 +463,7 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
475 | struct zfcp_adapter *adapter = ct->port->adapter; | 463 | struct zfcp_adapter *adapter = ct->port->adapter; |
476 | struct zfcp_port *port, *tmp; | 464 | struct zfcp_port *port, *tmp; |
477 | u32 d_id; | 465 | u32 d_id; |
478 | int ret = 0, x; | 466 | int ret = 0, x, last = 0; |
479 | 467 | ||
480 | if (ct->status) | 468 | if (ct->status) |
481 | return -EIO; | 469 | return -EIO; |
@@ -492,19 +480,24 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
492 | down(&zfcp_data.config_sema); | 480 | down(&zfcp_data.config_sema); |
493 | 481 | ||
494 | /* first entry is the header */ | 482 | /* first entry is the header */ |
495 | for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES; x++) { | 483 | for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES && !last; x++) { |
496 | if (x % (ZFCP_GPN_FT_ENTRIES + 1)) | 484 | if (x % (ZFCP_GPN_FT_ENTRIES + 1)) |
497 | acc++; | 485 | acc++; |
498 | else | 486 | else |
499 | acc = sg_virt(++sg); | 487 | acc = sg_virt(++sg); |
500 | 488 | ||
489 | last = acc->control & 0x80; | ||
501 | d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | | 490 | d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | |
502 | acc->port_id[2]; | 491 | acc->port_id[2]; |
503 | 492 | ||
504 | /* skip the adapter's port and known remote ports */ | 493 | /* skip the adapter's port and known remote ports */ |
505 | if (acc->wwpn == fc_host_port_name(adapter->scsi_host) || | 494 | if (acc->wwpn == fc_host_port_name(adapter->scsi_host)) |
506 | zfcp_get_port_by_did(adapter, d_id)) | 495 | continue; |
496 | port = zfcp_get_port_by_wwpn(adapter, acc->wwpn); | ||
497 | if (port) { | ||
498 | zfcp_port_get(port); | ||
507 | continue; | 499 | continue; |
500 | } | ||
508 | 501 | ||
509 | port = zfcp_port_enqueue(adapter, acc->wwpn, | 502 | port = zfcp_port_enqueue(adapter, acc->wwpn, |
510 | ZFCP_STATUS_PORT_DID_DID | | 503 | ZFCP_STATUS_PORT_DID_DID | |
@@ -513,8 +506,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
513 | ret = PTR_ERR(port); | 506 | ret = PTR_ERR(port); |
514 | else | 507 | else |
515 | zfcp_erp_port_reopen(port, 0, 149, NULL); | 508 | zfcp_erp_port_reopen(port, 0, 149, NULL); |
516 | if (acc->control & 0x80) /* last entry */ | ||
517 | break; | ||
518 | } | 509 | } |
519 | 510 | ||
520 | zfcp_erp_wait(adapter); | 511 | zfcp_erp_wait(adapter); |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 19c1ca913874..49dbeb754e5f 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -710,10 +710,10 @@ static void zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *req) | |||
710 | 710 | ||
711 | static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) | 711 | static int zfcp_fsf_sbal_check(struct zfcp_qdio_queue *queue) |
712 | { | 712 | { |
713 | spin_lock(&queue->lock); | 713 | spin_lock_bh(&queue->lock); |
714 | if (atomic_read(&queue->count)) | 714 | if (atomic_read(&queue->count)) |
715 | return 1; | 715 | return 1; |
716 | spin_unlock(&queue->lock); | 716 | spin_unlock_bh(&queue->lock); |
717 | return 0; | 717 | return 0; |
718 | } | 718 | } |
719 | 719 | ||
@@ -722,13 +722,13 @@ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) | |||
722 | long ret; | 722 | long ret; |
723 | struct zfcp_qdio_queue *req_q = &adapter->req_q; | 723 | struct zfcp_qdio_queue *req_q = &adapter->req_q; |
724 | 724 | ||
725 | spin_unlock(&req_q->lock); | 725 | spin_unlock_bh(&req_q->lock); |
726 | ret = wait_event_interruptible_timeout(adapter->request_wq, | 726 | ret = wait_event_interruptible_timeout(adapter->request_wq, |
727 | zfcp_fsf_sbal_check(req_q), 5 * HZ); | 727 | zfcp_fsf_sbal_check(req_q), 5 * HZ); |
728 | if (ret > 0) | 728 | if (ret > 0) |
729 | return 0; | 729 | return 0; |
730 | 730 | ||
731 | spin_lock(&req_q->lock); | 731 | spin_lock_bh(&req_q->lock); |
732 | return -EIO; | 732 | return -EIO; |
733 | } | 733 | } |
734 | 734 | ||
@@ -870,14 +870,14 @@ int zfcp_fsf_status_read(struct zfcp_adapter *adapter) | |||
870 | volatile struct qdio_buffer_element *sbale; | 870 | volatile struct qdio_buffer_element *sbale; |
871 | int retval = -EIO; | 871 | int retval = -EIO; |
872 | 872 | ||
873 | spin_lock(&adapter->req_q.lock); | 873 | spin_lock_bh(&adapter->req_q.lock); |
874 | if (zfcp_fsf_req_sbal_get(adapter)) | 874 | if (zfcp_fsf_req_sbal_get(adapter)) |
875 | goto out; | 875 | goto out; |
876 | 876 | ||
877 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS, | 877 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_UNSOLICITED_STATUS, |
878 | ZFCP_REQ_NO_QTCB, | 878 | ZFCP_REQ_NO_QTCB, |
879 | adapter->pool.fsf_req_status_read); | 879 | adapter->pool.fsf_req_status_read); |
880 | if (unlikely(IS_ERR(req))) { | 880 | if (IS_ERR(req)) { |
881 | retval = PTR_ERR(req); | 881 | retval = PTR_ERR(req); |
882 | goto out; | 882 | goto out; |
883 | } | 883 | } |
@@ -910,7 +910,7 @@ failed_buf: | |||
910 | zfcp_fsf_req_free(req); | 910 | zfcp_fsf_req_free(req); |
911 | zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); | 911 | zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); |
912 | out: | 912 | out: |
913 | spin_unlock(&adapter->req_q.lock); | 913 | spin_unlock_bh(&adapter->req_q.lock); |
914 | return retval; | 914 | return retval; |
915 | } | 915 | } |
916 | 916 | ||
@@ -988,7 +988,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id, | |||
988 | goto out; | 988 | goto out; |
989 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, | 989 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, |
990 | req_flags, adapter->pool.fsf_req_abort); | 990 | req_flags, adapter->pool.fsf_req_abort); |
991 | if (unlikely(IS_ERR(req))) | 991 | if (IS_ERR(req)) |
992 | goto out; | 992 | goto out; |
993 | 993 | ||
994 | if (unlikely(!(atomic_read(&unit->status) & | 994 | if (unlikely(!(atomic_read(&unit->status) & |
@@ -1106,13 +1106,13 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, | |||
1106 | struct zfcp_fsf_req *req; | 1106 | struct zfcp_fsf_req *req; |
1107 | int ret = -EIO; | 1107 | int ret = -EIO; |
1108 | 1108 | ||
1109 | spin_lock(&adapter->req_q.lock); | 1109 | spin_lock_bh(&adapter->req_q.lock); |
1110 | if (zfcp_fsf_req_sbal_get(adapter)) | 1110 | if (zfcp_fsf_req_sbal_get(adapter)) |
1111 | goto out; | 1111 | goto out; |
1112 | 1112 | ||
1113 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC, | 1113 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_GENERIC, |
1114 | ZFCP_REQ_AUTO_CLEANUP, pool); | 1114 | ZFCP_REQ_AUTO_CLEANUP, pool); |
1115 | if (unlikely(IS_ERR(req))) { | 1115 | if (IS_ERR(req)) { |
1116 | ret = PTR_ERR(req); | 1116 | ret = PTR_ERR(req); |
1117 | goto out; | 1117 | goto out; |
1118 | } | 1118 | } |
@@ -1148,7 +1148,7 @@ failed_send: | |||
1148 | if (erp_action) | 1148 | if (erp_action) |
1149 | erp_action->fsf_req = NULL; | 1149 | erp_action->fsf_req = NULL; |
1150 | out: | 1150 | out: |
1151 | spin_unlock(&adapter->req_q.lock); | 1151 | spin_unlock_bh(&adapter->req_q.lock); |
1152 | return ret; | 1152 | return ret; |
1153 | } | 1153 | } |
1154 | 1154 | ||
@@ -1223,7 +1223,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1223 | goto out; | 1223 | goto out; |
1224 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, | 1224 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, |
1225 | ZFCP_REQ_AUTO_CLEANUP, NULL); | 1225 | ZFCP_REQ_AUTO_CLEANUP, NULL); |
1226 | if (unlikely(IS_ERR(req))) { | 1226 | if (IS_ERR(req)) { |
1227 | ret = PTR_ERR(req); | 1227 | ret = PTR_ERR(req); |
1228 | goto out; | 1228 | goto out; |
1229 | } | 1229 | } |
@@ -1263,14 +1263,14 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1263 | struct zfcp_adapter *adapter = erp_action->adapter; | 1263 | struct zfcp_adapter *adapter = erp_action->adapter; |
1264 | int retval = -EIO; | 1264 | int retval = -EIO; |
1265 | 1265 | ||
1266 | spin_lock(&adapter->req_q.lock); | 1266 | spin_lock_bh(&adapter->req_q.lock); |
1267 | if (!atomic_read(&adapter->req_q.count)) | 1267 | if (!atomic_read(&adapter->req_q.count)) |
1268 | goto out; | 1268 | goto out; |
1269 | req = zfcp_fsf_req_create(adapter, | 1269 | req = zfcp_fsf_req_create(adapter, |
1270 | FSF_QTCB_EXCHANGE_CONFIG_DATA, | 1270 | FSF_QTCB_EXCHANGE_CONFIG_DATA, |
1271 | ZFCP_REQ_AUTO_CLEANUP, | 1271 | ZFCP_REQ_AUTO_CLEANUP, |
1272 | adapter->pool.fsf_req_erp); | 1272 | adapter->pool.fsf_req_erp); |
1273 | if (unlikely(IS_ERR(req))) { | 1273 | if (IS_ERR(req)) { |
1274 | retval = PTR_ERR(req); | 1274 | retval = PTR_ERR(req); |
1275 | goto out; | 1275 | goto out; |
1276 | } | 1276 | } |
@@ -1295,7 +1295,7 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1295 | erp_action->fsf_req = NULL; | 1295 | erp_action->fsf_req = NULL; |
1296 | } | 1296 | } |
1297 | out: | 1297 | out: |
1298 | spin_unlock(&adapter->req_q.lock); | 1298 | spin_unlock_bh(&adapter->req_q.lock); |
1299 | return retval; | 1299 | return retval; |
1300 | } | 1300 | } |
1301 | 1301 | ||
@@ -1306,13 +1306,13 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, | |||
1306 | struct zfcp_fsf_req *req = NULL; | 1306 | struct zfcp_fsf_req *req = NULL; |
1307 | int retval = -EIO; | 1307 | int retval = -EIO; |
1308 | 1308 | ||
1309 | spin_lock(&adapter->req_q.lock); | 1309 | spin_lock_bh(&adapter->req_q.lock); |
1310 | if (zfcp_fsf_req_sbal_get(adapter)) | 1310 | if (zfcp_fsf_req_sbal_get(adapter)) |
1311 | goto out; | 1311 | goto out; |
1312 | 1312 | ||
1313 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA, | 1313 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA, |
1314 | 0, NULL); | 1314 | 0, NULL); |
1315 | if (unlikely(IS_ERR(req))) { | 1315 | if (IS_ERR(req)) { |
1316 | retval = PTR_ERR(req); | 1316 | retval = PTR_ERR(req); |
1317 | goto out; | 1317 | goto out; |
1318 | } | 1318 | } |
@@ -1334,7 +1334,7 @@ int zfcp_fsf_exchange_config_data_sync(struct zfcp_adapter *adapter, | |||
1334 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1334 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1335 | retval = zfcp_fsf_req_send(req); | 1335 | retval = zfcp_fsf_req_send(req); |
1336 | out: | 1336 | out: |
1337 | spin_unlock(&adapter->req_q.lock); | 1337 | spin_unlock_bh(&adapter->req_q.lock); |
1338 | if (!retval) | 1338 | if (!retval) |
1339 | wait_event(req->completion_wq, | 1339 | wait_event(req->completion_wq, |
1340 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 1340 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
@@ -1359,13 +1359,13 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | |||
1359 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) | 1359 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
1360 | return -EOPNOTSUPP; | 1360 | return -EOPNOTSUPP; |
1361 | 1361 | ||
1362 | spin_lock(&adapter->req_q.lock); | 1362 | spin_lock_bh(&adapter->req_q.lock); |
1363 | if (!atomic_read(&adapter->req_q.count)) | 1363 | if (!atomic_read(&adapter->req_q.count)) |
1364 | goto out; | 1364 | goto out; |
1365 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, | 1365 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, |
1366 | ZFCP_REQ_AUTO_CLEANUP, | 1366 | ZFCP_REQ_AUTO_CLEANUP, |
1367 | adapter->pool.fsf_req_erp); | 1367 | adapter->pool.fsf_req_erp); |
1368 | if (unlikely(IS_ERR(req))) { | 1368 | if (IS_ERR(req)) { |
1369 | retval = PTR_ERR(req); | 1369 | retval = PTR_ERR(req); |
1370 | goto out; | 1370 | goto out; |
1371 | } | 1371 | } |
@@ -1385,7 +1385,7 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | |||
1385 | erp_action->fsf_req = NULL; | 1385 | erp_action->fsf_req = NULL; |
1386 | } | 1386 | } |
1387 | out: | 1387 | out: |
1388 | spin_unlock(&adapter->req_q.lock); | 1388 | spin_unlock_bh(&adapter->req_q.lock); |
1389 | return retval; | 1389 | return retval; |
1390 | } | 1390 | } |
1391 | 1391 | ||
@@ -1405,13 +1405,13 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, | |||
1405 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) | 1405 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) |
1406 | return -EOPNOTSUPP; | 1406 | return -EOPNOTSUPP; |
1407 | 1407 | ||
1408 | spin_lock(&adapter->req_q.lock); | 1408 | spin_lock_bh(&adapter->req_q.lock); |
1409 | if (!atomic_read(&adapter->req_q.count)) | 1409 | if (!atomic_read(&adapter->req_q.count)) |
1410 | goto out; | 1410 | goto out; |
1411 | 1411 | ||
1412 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0, | 1412 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0, |
1413 | NULL); | 1413 | NULL); |
1414 | if (unlikely(IS_ERR(req))) { | 1414 | if (IS_ERR(req)) { |
1415 | retval = PTR_ERR(req); | 1415 | retval = PTR_ERR(req); |
1416 | goto out; | 1416 | goto out; |
1417 | } | 1417 | } |
@@ -1427,7 +1427,7 @@ int zfcp_fsf_exchange_port_data_sync(struct zfcp_adapter *adapter, | |||
1427 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1427 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1428 | retval = zfcp_fsf_req_send(req); | 1428 | retval = zfcp_fsf_req_send(req); |
1429 | out: | 1429 | out: |
1430 | spin_unlock(&adapter->req_q.lock); | 1430 | spin_unlock_bh(&adapter->req_q.lock); |
1431 | if (!retval) | 1431 | if (!retval) |
1432 | wait_event(req->completion_wq, | 1432 | wait_event(req->completion_wq, |
1433 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 1433 | req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
@@ -1531,7 +1531,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1531 | struct zfcp_fsf_req *req; | 1531 | struct zfcp_fsf_req *req; |
1532 | int retval = -EIO; | 1532 | int retval = -EIO; |
1533 | 1533 | ||
1534 | spin_lock(&adapter->req_q.lock); | 1534 | spin_lock_bh(&adapter->req_q.lock); |
1535 | if (zfcp_fsf_req_sbal_get(adapter)) | 1535 | if (zfcp_fsf_req_sbal_get(adapter)) |
1536 | goto out; | 1536 | goto out; |
1537 | 1537 | ||
@@ -1539,7 +1539,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1539 | FSF_QTCB_OPEN_PORT_WITH_DID, | 1539 | FSF_QTCB_OPEN_PORT_WITH_DID, |
1540 | ZFCP_REQ_AUTO_CLEANUP, | 1540 | ZFCP_REQ_AUTO_CLEANUP, |
1541 | adapter->pool.fsf_req_erp); | 1541 | adapter->pool.fsf_req_erp); |
1542 | if (unlikely(IS_ERR(req))) { | 1542 | if (IS_ERR(req)) { |
1543 | retval = PTR_ERR(req); | 1543 | retval = PTR_ERR(req); |
1544 | goto out; | 1544 | goto out; |
1545 | } | 1545 | } |
@@ -1562,7 +1562,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1562 | erp_action->fsf_req = NULL; | 1562 | erp_action->fsf_req = NULL; |
1563 | } | 1563 | } |
1564 | out: | 1564 | out: |
1565 | spin_unlock(&adapter->req_q.lock); | 1565 | spin_unlock_bh(&adapter->req_q.lock); |
1566 | return retval; | 1566 | return retval; |
1567 | } | 1567 | } |
1568 | 1568 | ||
@@ -1603,14 +1603,14 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1603 | struct zfcp_fsf_req *req; | 1603 | struct zfcp_fsf_req *req; |
1604 | int retval = -EIO; | 1604 | int retval = -EIO; |
1605 | 1605 | ||
1606 | spin_lock(&adapter->req_q.lock); | 1606 | spin_lock_bh(&adapter->req_q.lock); |
1607 | if (zfcp_fsf_req_sbal_get(adapter)) | 1607 | if (zfcp_fsf_req_sbal_get(adapter)) |
1608 | goto out; | 1608 | goto out; |
1609 | 1609 | ||
1610 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PORT, | 1610 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PORT, |
1611 | ZFCP_REQ_AUTO_CLEANUP, | 1611 | ZFCP_REQ_AUTO_CLEANUP, |
1612 | adapter->pool.fsf_req_erp); | 1612 | adapter->pool.fsf_req_erp); |
1613 | if (unlikely(IS_ERR(req))) { | 1613 | if (IS_ERR(req)) { |
1614 | retval = PTR_ERR(req); | 1614 | retval = PTR_ERR(req); |
1615 | goto out; | 1615 | goto out; |
1616 | } | 1616 | } |
@@ -1633,7 +1633,7 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1633 | erp_action->fsf_req = NULL; | 1633 | erp_action->fsf_req = NULL; |
1634 | } | 1634 | } |
1635 | out: | 1635 | out: |
1636 | spin_unlock(&adapter->req_q.lock); | 1636 | spin_unlock_bh(&adapter->req_q.lock); |
1637 | return retval; | 1637 | return retval; |
1638 | } | 1638 | } |
1639 | 1639 | ||
@@ -1700,14 +1700,14 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1700 | struct zfcp_fsf_req *req; | 1700 | struct zfcp_fsf_req *req; |
1701 | int retval = -EIO; | 1701 | int retval = -EIO; |
1702 | 1702 | ||
1703 | spin_lock(&adapter->req_q.lock); | 1703 | spin_lock_bh(&adapter->req_q.lock); |
1704 | if (zfcp_fsf_req_sbal_get(adapter)) | 1704 | if (zfcp_fsf_req_sbal_get(adapter)) |
1705 | goto out; | 1705 | goto out; |
1706 | 1706 | ||
1707 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PHYSICAL_PORT, | 1707 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_PHYSICAL_PORT, |
1708 | ZFCP_REQ_AUTO_CLEANUP, | 1708 | ZFCP_REQ_AUTO_CLEANUP, |
1709 | adapter->pool.fsf_req_erp); | 1709 | adapter->pool.fsf_req_erp); |
1710 | if (unlikely(IS_ERR(req))) { | 1710 | if (IS_ERR(req)) { |
1711 | retval = PTR_ERR(req); | 1711 | retval = PTR_ERR(req); |
1712 | goto out; | 1712 | goto out; |
1713 | } | 1713 | } |
@@ -1731,7 +1731,7 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1731 | erp_action->fsf_req = NULL; | 1731 | erp_action->fsf_req = NULL; |
1732 | } | 1732 | } |
1733 | out: | 1733 | out: |
1734 | spin_unlock(&adapter->req_q.lock); | 1734 | spin_unlock_bh(&adapter->req_q.lock); |
1735 | return retval; | 1735 | return retval; |
1736 | } | 1736 | } |
1737 | 1737 | ||
@@ -1875,14 +1875,14 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1875 | struct zfcp_fsf_req *req; | 1875 | struct zfcp_fsf_req *req; |
1876 | int retval = -EIO; | 1876 | int retval = -EIO; |
1877 | 1877 | ||
1878 | spin_lock(&adapter->req_q.lock); | 1878 | spin_lock_bh(&adapter->req_q.lock); |
1879 | if (zfcp_fsf_req_sbal_get(adapter)) | 1879 | if (zfcp_fsf_req_sbal_get(adapter)) |
1880 | goto out; | 1880 | goto out; |
1881 | 1881 | ||
1882 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_OPEN_LUN, | 1882 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_OPEN_LUN, |
1883 | ZFCP_REQ_AUTO_CLEANUP, | 1883 | ZFCP_REQ_AUTO_CLEANUP, |
1884 | adapter->pool.fsf_req_erp); | 1884 | adapter->pool.fsf_req_erp); |
1885 | if (unlikely(IS_ERR(req))) { | 1885 | if (IS_ERR(req)) { |
1886 | retval = PTR_ERR(req); | 1886 | retval = PTR_ERR(req); |
1887 | goto out; | 1887 | goto out; |
1888 | } | 1888 | } |
@@ -1910,7 +1910,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1910 | erp_action->fsf_req = NULL; | 1910 | erp_action->fsf_req = NULL; |
1911 | } | 1911 | } |
1912 | out: | 1912 | out: |
1913 | spin_unlock(&adapter->req_q.lock); | 1913 | spin_unlock_bh(&adapter->req_q.lock); |
1914 | return retval; | 1914 | return retval; |
1915 | } | 1915 | } |
1916 | 1916 | ||
@@ -1965,13 +1965,13 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1965 | struct zfcp_fsf_req *req; | 1965 | struct zfcp_fsf_req *req; |
1966 | int retval = -EIO; | 1966 | int retval = -EIO; |
1967 | 1967 | ||
1968 | spin_lock(&adapter->req_q.lock); | 1968 | spin_lock_bh(&adapter->req_q.lock); |
1969 | if (zfcp_fsf_req_sbal_get(adapter)) | 1969 | if (zfcp_fsf_req_sbal_get(adapter)) |
1970 | goto out; | 1970 | goto out; |
1971 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, | 1971 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_CLOSE_LUN, |
1972 | ZFCP_REQ_AUTO_CLEANUP, | 1972 | ZFCP_REQ_AUTO_CLEANUP, |
1973 | adapter->pool.fsf_req_erp); | 1973 | adapter->pool.fsf_req_erp); |
1974 | if (unlikely(IS_ERR(req))) { | 1974 | if (IS_ERR(req)) { |
1975 | retval = PTR_ERR(req); | 1975 | retval = PTR_ERR(req); |
1976 | goto out; | 1976 | goto out; |
1977 | } | 1977 | } |
@@ -1995,7 +1995,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1995 | erp_action->fsf_req = NULL; | 1995 | erp_action->fsf_req = NULL; |
1996 | } | 1996 | } |
1997 | out: | 1997 | out: |
1998 | spin_unlock(&adapter->req_q.lock); | 1998 | spin_unlock_bh(&adapter->req_q.lock); |
1999 | return retval; | 1999 | return retval; |
2000 | } | 2000 | } |
2001 | 2001 | ||
@@ -2228,7 +2228,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, | |||
2228 | goto out; | 2228 | goto out; |
2229 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, | 2229 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, |
2230 | adapter->pool.fsf_req_scsi); | 2230 | adapter->pool.fsf_req_scsi); |
2231 | if (unlikely(IS_ERR(req))) { | 2231 | if (IS_ERR(req)) { |
2232 | retval = PTR_ERR(req); | 2232 | retval = PTR_ERR(req); |
2233 | goto out; | 2233 | goto out; |
2234 | } | 2234 | } |
@@ -2351,7 +2351,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter, | |||
2351 | goto out; | 2351 | goto out; |
2352 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, | 2352 | req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, |
2353 | adapter->pool.fsf_req_scsi); | 2353 | adapter->pool.fsf_req_scsi); |
2354 | if (unlikely(IS_ERR(req))) | 2354 | if (IS_ERR(req)) |
2355 | goto out; | 2355 | goto out; |
2356 | 2356 | ||
2357 | req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT; | 2357 | req->status |= ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT; |
@@ -2417,12 +2417,12 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
2417 | return ERR_PTR(-EINVAL); | 2417 | return ERR_PTR(-EINVAL); |
2418 | } | 2418 | } |
2419 | 2419 | ||
2420 | spin_lock(&adapter->req_q.lock); | 2420 | spin_lock_bh(&adapter->req_q.lock); |
2421 | if (zfcp_fsf_req_sbal_get(adapter)) | 2421 | if (zfcp_fsf_req_sbal_get(adapter)) |
2422 | goto out; | 2422 | goto out; |
2423 | 2423 | ||
2424 | req = zfcp_fsf_req_create(adapter, fsf_cfdc->command, 0, NULL); | 2424 | req = zfcp_fsf_req_create(adapter, fsf_cfdc->command, 0, NULL); |
2425 | if (unlikely(IS_ERR(req))) { | 2425 | if (IS_ERR(req)) { |
2426 | retval = -EPERM; | 2426 | retval = -EPERM; |
2427 | goto out; | 2427 | goto out; |
2428 | } | 2428 | } |
@@ -2447,7 +2447,7 @@ struct zfcp_fsf_req *zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
2447 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 2447 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
2448 | retval = zfcp_fsf_req_send(req); | 2448 | retval = zfcp_fsf_req_send(req); |
2449 | out: | 2449 | out: |
2450 | spin_unlock(&adapter->req_q.lock); | 2450 | spin_unlock_bh(&adapter->req_q.lock); |
2451 | 2451 | ||
2452 | if (!retval) { | 2452 | if (!retval) { |
2453 | wait_event(req->completion_wq, | 2453 | wait_event(req->completion_wq, |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index d6dbd653fde9..69d632d851d9 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -423,9 +423,9 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter) | |||
423 | 423 | ||
424 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ | 424 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ |
425 | req_q = &adapter->req_q; | 425 | req_q = &adapter->req_q; |
426 | spin_lock(&req_q->lock); | 426 | spin_lock_bh(&req_q->lock); |
427 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); | 427 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); |
428 | spin_unlock(&req_q->lock); | 428 | spin_unlock_bh(&req_q->lock); |
429 | 429 | ||
430 | qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); | 430 | qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR); |
431 | 431 | ||
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index c7f06298bd3c..4e0322b1c1ea 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -63,7 +63,7 @@ comment "SCSI support type (disk, tape, CD-ROM)" | |||
63 | config BLK_DEV_SD | 63 | config BLK_DEV_SD |
64 | tristate "SCSI disk support" | 64 | tristate "SCSI disk support" |
65 | depends on SCSI | 65 | depends on SCSI |
66 | select CRC_T10DIF | 66 | select CRC_T10DIF if BLK_DEV_INTEGRITY |
67 | ---help--- | 67 | ---help--- |
68 | If you want to use SCSI hard disks, Fibre Channel disks, | 68 | If you want to use SCSI hard disks, Fibre Channel disks, |
69 | Serial ATA (SATA) or Parallel ATA (PATA) hard disks, | 69 | Serial ATA (SATA) or Parallel ATA (PATA) hard disks, |
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 994da56fffed..708e475896b9 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c | |||
@@ -425,7 +425,7 @@ static int alua_check_sense(struct scsi_device *sdev, | |||
425 | /* | 425 | /* |
426 | * LUN Not Accessible - ALUA state transition | 426 | * LUN Not Accessible - ALUA state transition |
427 | */ | 427 | */ |
428 | return NEEDS_RETRY; | 428 | return ADD_TO_MLQUEUE; |
429 | if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0b) | 429 | if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0b) |
430 | /* | 430 | /* |
431 | * LUN Not Accessible -- Target port in standby state | 431 | * LUN Not Accessible -- Target port in standby state |
@@ -447,18 +447,18 @@ static int alua_check_sense(struct scsi_device *sdev, | |||
447 | /* | 447 | /* |
448 | * Power On, Reset, or Bus Device Reset, just retry. | 448 | * Power On, Reset, or Bus Device Reset, just retry. |
449 | */ | 449 | */ |
450 | return NEEDS_RETRY; | 450 | return ADD_TO_MLQUEUE; |
451 | if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06) { | 451 | if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x06) { |
452 | /* | 452 | /* |
453 | * ALUA state changed | 453 | * ALUA state changed |
454 | */ | 454 | */ |
455 | return NEEDS_RETRY; | 455 | return ADD_TO_MLQUEUE; |
456 | } | 456 | } |
457 | if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07) { | 457 | if (sense_hdr->asc == 0x2a && sense_hdr->ascq == 0x07) { |
458 | /* | 458 | /* |
459 | * Implicit ALUA state transition failed | 459 | * Implicit ALUA state transition failed |
460 | */ | 460 | */ |
461 | return NEEDS_RETRY; | 461 | return ADD_TO_MLQUEUE; |
462 | } | 462 | } |
463 | break; | 463 | break; |
464 | } | 464 | } |
@@ -490,7 +490,7 @@ static int alua_stpg(struct scsi_device *sdev, int state, | |||
490 | if (!err) | 490 | if (!err) |
491 | return SCSI_DH_IO; | 491 | return SCSI_DH_IO; |
492 | err = alua_check_sense(sdev, &sense_hdr); | 492 | err = alua_check_sense(sdev, &sense_hdr); |
493 | if (retry > 0 && err == NEEDS_RETRY) { | 493 | if (retry > 0 && err == ADD_TO_MLQUEUE) { |
494 | retry--; | 494 | retry--; |
495 | goto retry; | 495 | goto retry; |
496 | } | 496 | } |
@@ -535,7 +535,7 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h) | |||
535 | return SCSI_DH_IO; | 535 | return SCSI_DH_IO; |
536 | 536 | ||
537 | err = alua_check_sense(sdev, &sense_hdr); | 537 | err = alua_check_sense(sdev, &sense_hdr); |
538 | if (err == NEEDS_RETRY) | 538 | if (err == ADD_TO_MLQUEUE) |
539 | goto retry; | 539 | goto retry; |
540 | sdev_printk(KERN_INFO, sdev, | 540 | sdev_printk(KERN_INFO, sdev, |
541 | "%s: rtpg sense code %02x/%02x/%02x\n", | 541 | "%s: rtpg sense code %02x/%02x/%02x\n", |
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index b9d23e9e9a44..ef693e8412e9 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c | |||
@@ -439,7 +439,7 @@ static int clariion_check_sense(struct scsi_device *sdev, | |||
439 | * Unit Attention Code. This is the first IO | 439 | * Unit Attention Code. This is the first IO |
440 | * to the new path, so just retry. | 440 | * to the new path, so just retry. |
441 | */ | 441 | */ |
442 | return NEEDS_RETRY; | 442 | return ADD_TO_MLQUEUE; |
443 | break; | 443 | break; |
444 | } | 444 | } |
445 | 445 | ||
@@ -514,7 +514,7 @@ retry: | |||
514 | return SCSI_DH_IO; | 514 | return SCSI_DH_IO; |
515 | 515 | ||
516 | err = clariion_check_sense(sdev, &sshdr); | 516 | err = clariion_check_sense(sdev, &sshdr); |
517 | if (retry > 0 && err == NEEDS_RETRY) { | 517 | if (retry > 0 && err == ADD_TO_MLQUEUE) { |
518 | retry--; | 518 | retry--; |
519 | goto retry; | 519 | goto retry; |
520 | } | 520 | } |
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 2dee69da35cf..6e2f130d56de 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
@@ -551,7 +551,7 @@ static int rdac_check_sense(struct scsi_device *sdev, | |||
551 | * | 551 | * |
552 | * Just retry and wait. | 552 | * Just retry and wait. |
553 | */ | 553 | */ |
554 | return NEEDS_RETRY; | 554 | return ADD_TO_MLQUEUE; |
555 | break; | 555 | break; |
556 | case ILLEGAL_REQUEST: | 556 | case ILLEGAL_REQUEST: |
557 | if (sense_hdr->asc == 0x94 && sense_hdr->ascq == 0x01) { | 557 | if (sense_hdr->asc == 0x94 && sense_hdr->ascq == 0x01) { |
@@ -568,7 +568,7 @@ static int rdac_check_sense(struct scsi_device *sdev, | |||
568 | /* | 568 | /* |
569 | * Power On, Reset, or Bus Device Reset, just retry. | 569 | * Power On, Reset, or Bus Device Reset, just retry. |
570 | */ | 570 | */ |
571 | return NEEDS_RETRY; | 571 | return ADD_TO_MLQUEUE; |
572 | break; | 572 | break; |
573 | } | 573 | } |
574 | /* success just means we do not care what scsi-ml does */ | 574 | /* success just means we do not care what scsi-ml does */ |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 880051c89bde..39ce3aba1dac 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -391,7 +391,7 @@ static int scsi_check_sense(struct scsi_cmnd *scmd) | |||
391 | 391 | ||
392 | case HARDWARE_ERROR: | 392 | case HARDWARE_ERROR: |
393 | if (scmd->device->retry_hwerror) | 393 | if (scmd->device->retry_hwerror) |
394 | return NEEDS_RETRY; | 394 | return ADD_TO_MLQUEUE; |
395 | else | 395 | else |
396 | return SUCCESS; | 396 | return SUCCESS; |
397 | 397 | ||
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 84b4879cff11..34d0de6cd511 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -1080,7 +1080,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
1080 | * PDT=1Fh none (no FDD connected to the requested logical unit) | 1080 | * PDT=1Fh none (no FDD connected to the requested logical unit) |
1081 | */ | 1081 | */ |
1082 | if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && | 1082 | if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && |
1083 | (result[0] & 0x1f) == 0x1f) { | 1083 | (result[0] & 0x1f) == 0x1f && |
1084 | !scsi_is_wlun(lun)) { | ||
1084 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO | 1085 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO |
1085 | "scsi scan: peripheral device type" | 1086 | "scsi scan: peripheral device type" |
1086 | " of 31, no device added\n")); | 1087 | " of 31, no device added\n")); |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 342e12fb1c25..9ccc563d8730 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -1908,15 +1908,23 @@ static int serial8250_startup(struct uart_port *port) | |||
1908 | * kick the UART on a regular basis. | 1908 | * kick the UART on a regular basis. |
1909 | */ | 1909 | */ |
1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { | 1910 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { |
1911 | up->bugs |= UART_BUG_THRE; | ||
1911 | pr_debug("ttyS%d - using backup timer\n", port->line); | 1912 | pr_debug("ttyS%d - using backup timer\n", port->line); |
1912 | up->timer.function = serial8250_backup_timeout; | ||
1913 | up->timer.data = (unsigned long)up; | ||
1914 | mod_timer(&up->timer, jiffies + | ||
1915 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1916 | } | 1913 | } |
1917 | } | 1914 | } |
1918 | 1915 | ||
1919 | /* | 1916 | /* |
1917 | * The above check will only give an accurate result the first time | ||
1918 | * the port is opened so this value needs to be preserved. | ||
1919 | */ | ||
1920 | if (up->bugs & UART_BUG_THRE) { | ||
1921 | up->timer.function = serial8250_backup_timeout; | ||
1922 | up->timer.data = (unsigned long)up; | ||
1923 | mod_timer(&up->timer, jiffies + | ||
1924 | poll_timeout(up->port.timeout) + HZ / 5); | ||
1925 | } | ||
1926 | |||
1927 | /* | ||
1920 | * If the "interrupt" for this port doesn't correspond with any | 1928 | * If the "interrupt" for this port doesn't correspond with any |
1921 | * hardware interrupt, we use a timer-based system. The original | 1929 | * hardware interrupt, we use a timer-based system. The original |
1922 | * driver used to do this with IRQ0. | 1930 | * driver used to do this with IRQ0. |
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 78c00162b04e..520260326f3d 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h | |||
@@ -47,6 +47,7 @@ struct serial8250_config { | |||
47 | #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ | 47 | #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ |
48 | #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ | 48 | #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ |
49 | #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ | 49 | #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ |
50 | #define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */ | ||
50 | 51 | ||
51 | #define PROBE_RSA (1 << 0) | 52 | #define PROBE_RSA (1 << 0) |
52 | #define PROBE_ANY (~0) | 53 | #define PROBE_ANY (~0) |
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index 6a29f9330a73..3f90f1bbbbcd 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -127,8 +127,13 @@ | |||
127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ | 127 | #define UCR3_RXDSEN (1<<6) /* Receive status interrupt enable */ |
128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ | 128 | #define UCR3_AIRINTEN (1<<5) /* Async IR wake interrupt enable */ |
129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ | 129 | #define UCR3_AWAKEN (1<<4) /* Async wake interrupt enable */ |
130 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz */ | 130 | #ifdef CONFIG_ARCH_IMX |
131 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz */ | 131 | #define UCR3_REF25 (1<<3) /* Ref freq 25 MHz, only on mx1 */ |
132 | #define UCR3_REF30 (1<<2) /* Ref Freq 30 MHz, only on mx1 */ | ||
133 | #endif | ||
134 | #if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3 | ||
135 | #define UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */ | ||
136 | #endif | ||
132 | #define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ | 137 | #define UCR3_INVT (1<<1) /* Inverted Infrared transmission */ |
133 | #define UCR3_BPEN (1<<0) /* Preset registers enable */ | 138 | #define UCR3_BPEN (1<<0) /* Preset registers enable */ |
134 | #define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ | 139 | #define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */ |
@@ -445,7 +450,7 @@ static irqreturn_t imx_int(int irq, void *dev_id) | |||
445 | readl(sport->port.membase + UCR1) & UCR1_TXMPTYEN) | 450 | readl(sport->port.membase + UCR1) & UCR1_TXMPTYEN) |
446 | imx_txint(irq, dev_id); | 451 | imx_txint(irq, dev_id); |
447 | 452 | ||
448 | if (sts & USR1_RTSS) | 453 | if (sts & USR1_RTSD) |
449 | imx_rtsint(irq, dev_id); | 454 | imx_rtsint(irq, dev_id); |
450 | 455 | ||
451 | return IRQ_HANDLED; | 456 | return IRQ_HANDLED; |
@@ -598,6 +603,12 @@ static int imx_startup(struct uart_port *port) | |||
598 | temp |= (UCR2_RXEN | UCR2_TXEN); | 603 | temp |= (UCR2_RXEN | UCR2_TXEN); |
599 | writel(temp, sport->port.membase + UCR2); | 604 | writel(temp, sport->port.membase + UCR2); |
600 | 605 | ||
606 | #if defined CONFIG_ARCH_MX2 || defined CONFIG_ARCH_MX3 | ||
607 | temp = readl(sport->port.membase + UCR3); | ||
608 | temp |= UCR3_RXDMUXSEL; | ||
609 | writel(temp, sport->port.membase + UCR3); | ||
610 | #endif | ||
611 | |||
601 | /* | 612 | /* |
602 | * Enable modem status interrupts | 613 | * Enable modem status interrupts |
603 | */ | 614 | */ |
@@ -1133,13 +1144,19 @@ static int serial_imx_probe(struct platform_device *pdev) | |||
1133 | if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS)) | 1144 | if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS)) |
1134 | sport->have_rtscts = 1; | 1145 | sport->have_rtscts = 1; |
1135 | 1146 | ||
1136 | if (pdata->init) | 1147 | if (pdata->init) { |
1137 | pdata->init(pdev); | 1148 | ret = pdata->init(pdev); |
1149 | if (ret) | ||
1150 | goto clkput; | ||
1151 | } | ||
1138 | 1152 | ||
1139 | uart_add_one_port(&imx_reg, &sport->port); | 1153 | uart_add_one_port(&imx_reg, &sport->port); |
1140 | platform_set_drvdata(pdev, &sport->port); | 1154 | platform_set_drvdata(pdev, &sport->port); |
1141 | 1155 | ||
1142 | return 0; | 1156 | return 0; |
1157 | clkput: | ||
1158 | clk_put(sport->clk); | ||
1159 | clk_disable(sport->clk); | ||
1143 | unmap: | 1160 | unmap: |
1144 | iounmap(sport->port.membase); | 1161 | iounmap(sport->port.membase); |
1145 | free: | 1162 | free: |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 34c7c9875681..0e53354c1cfe 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -47,9 +47,10 @@ MODULE_ALIAS("platform:pxa2xx-spi"); | |||
47 | 47 | ||
48 | #define MAX_BUSES 3 | 48 | #define MAX_BUSES 3 |
49 | 49 | ||
50 | #define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR) | 50 | #define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR) |
51 | #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK) | 51 | #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK) |
52 | #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0) | 52 | #define IS_DMA_ALIGNED(x) (((x) & 0x07) == 0) |
53 | #define MAX_DMA_LEN 8191 | ||
53 | 54 | ||
54 | /* | 55 | /* |
55 | * for testing SSCR1 changes that require SSP restart, basically | 56 | * for testing SSCR1 changes that require SSP restart, basically |
@@ -144,7 +145,6 @@ struct driver_data { | |||
144 | size_t tx_map_len; | 145 | size_t tx_map_len; |
145 | u8 n_bytes; | 146 | u8 n_bytes; |
146 | u32 dma_width; | 147 | u32 dma_width; |
147 | int cs_change; | ||
148 | int (*write)(struct driver_data *drv_data); | 148 | int (*write)(struct driver_data *drv_data); |
149 | int (*read)(struct driver_data *drv_data); | 149 | int (*read)(struct driver_data *drv_data); |
150 | irqreturn_t (*transfer_handler)(struct driver_data *drv_data); | 150 | irqreturn_t (*transfer_handler)(struct driver_data *drv_data); |
@@ -406,8 +406,45 @@ static void giveback(struct driver_data *drv_data) | |||
406 | struct spi_transfer, | 406 | struct spi_transfer, |
407 | transfer_list); | 407 | transfer_list); |
408 | 408 | ||
409 | /* Delay if requested before any change in chip select */ | ||
410 | if (last_transfer->delay_usecs) | ||
411 | udelay(last_transfer->delay_usecs); | ||
412 | |||
413 | /* Drop chip select UNLESS cs_change is true or we are returning | ||
414 | * a message with an error, or next message is for another chip | ||
415 | */ | ||
409 | if (!last_transfer->cs_change) | 416 | if (!last_transfer->cs_change) |
410 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | 417 | drv_data->cs_control(PXA2XX_CS_DEASSERT); |
418 | else { | ||
419 | struct spi_message *next_msg; | ||
420 | |||
421 | /* Holding of cs was hinted, but we need to make sure | ||
422 | * the next message is for the same chip. Don't waste | ||
423 | * time with the following tests unless this was hinted. | ||
424 | * | ||
425 | * We cannot postpone this until pump_messages, because | ||
426 | * after calling msg->complete (below) the driver that | ||
427 | * sent the current message could be unloaded, which | ||
428 | * could invalidate the cs_control() callback... | ||
429 | */ | ||
430 | |||
431 | /* get a pointer to the next message, if any */ | ||
432 | spin_lock_irqsave(&drv_data->lock, flags); | ||
433 | if (list_empty(&drv_data->queue)) | ||
434 | next_msg = NULL; | ||
435 | else | ||
436 | next_msg = list_entry(drv_data->queue.next, | ||
437 | struct spi_message, queue); | ||
438 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
439 | |||
440 | /* see if the next and current messages point | ||
441 | * to the same chip | ||
442 | */ | ||
443 | if (next_msg && next_msg->spi != msg->spi) | ||
444 | next_msg = NULL; | ||
445 | if (!next_msg || msg->state == ERROR_STATE) | ||
446 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
447 | } | ||
411 | 448 | ||
412 | msg->state = NULL; | 449 | msg->state = NULL; |
413 | if (msg->complete) | 450 | if (msg->complete) |
@@ -490,10 +527,9 @@ static void dma_transfer_complete(struct driver_data *drv_data) | |||
490 | msg->actual_length += drv_data->len - | 527 | msg->actual_length += drv_data->len - |
491 | (drv_data->rx_end - drv_data->rx); | 528 | (drv_data->rx_end - drv_data->rx); |
492 | 529 | ||
493 | /* Release chip select if requested, transfer delays are | 530 | /* Transfer delays and chip select release are |
494 | * handled in pump_transfers */ | 531 | * handled in pump_transfers or giveback |
495 | if (drv_data->cs_change) | 532 | */ |
496 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
497 | 533 | ||
498 | /* Move to next transfer */ | 534 | /* Move to next transfer */ |
499 | msg->state = next_transfer(drv_data); | 535 | msg->state = next_transfer(drv_data); |
@@ -602,10 +638,9 @@ static void int_transfer_complete(struct driver_data *drv_data) | |||
602 | drv_data->cur_msg->actual_length += drv_data->len - | 638 | drv_data->cur_msg->actual_length += drv_data->len - |
603 | (drv_data->rx_end - drv_data->rx); | 639 | (drv_data->rx_end - drv_data->rx); |
604 | 640 | ||
605 | /* Release chip select if requested, transfer delays are | 641 | /* Transfer delays and chip select release are |
606 | * handled in pump_transfers */ | 642 | * handled in pump_transfers or giveback |
607 | if (drv_data->cs_change) | 643 | */ |
608 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
609 | 644 | ||
610 | /* Move to next transfer */ | 645 | /* Move to next transfer */ |
611 | drv_data->cur_msg->state = next_transfer(drv_data); | 646 | drv_data->cur_msg->state = next_transfer(drv_data); |
@@ -840,23 +875,40 @@ static void pump_transfers(unsigned long data) | |||
840 | return; | 875 | return; |
841 | } | 876 | } |
842 | 877 | ||
843 | /* Delay if requested at end of transfer*/ | 878 | /* Delay if requested at end of transfer before CS change */ |
844 | if (message->state == RUNNING_STATE) { | 879 | if (message->state == RUNNING_STATE) { |
845 | previous = list_entry(transfer->transfer_list.prev, | 880 | previous = list_entry(transfer->transfer_list.prev, |
846 | struct spi_transfer, | 881 | struct spi_transfer, |
847 | transfer_list); | 882 | transfer_list); |
848 | if (previous->delay_usecs) | 883 | if (previous->delay_usecs) |
849 | udelay(previous->delay_usecs); | 884 | udelay(previous->delay_usecs); |
885 | |||
886 | /* Drop chip select only if cs_change is requested */ | ||
887 | if (previous->cs_change) | ||
888 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
850 | } | 889 | } |
851 | 890 | ||
852 | /* Check transfer length */ | 891 | /* Check for transfers that need multiple DMA segments */ |
853 | if (transfer->len > 8191) | 892 | if (transfer->len > MAX_DMA_LEN && chip->enable_dma) { |
854 | { | 893 | |
855 | dev_warn(&drv_data->pdev->dev, "pump_transfers: transfer " | 894 | /* reject already-mapped transfers; PIO won't always work */ |
856 | "length greater than 8191\n"); | 895 | if (message->is_dma_mapped |
857 | message->status = -EINVAL; | 896 | || transfer->rx_dma || transfer->tx_dma) { |
858 | giveback(drv_data); | 897 | dev_err(&drv_data->pdev->dev, |
859 | return; | 898 | "pump_transfers: mapped transfer length " |
899 | "of %lu is greater than %d\n", | ||
900 | transfer->len, MAX_DMA_LEN); | ||
901 | message->status = -EINVAL; | ||
902 | giveback(drv_data); | ||
903 | return; | ||
904 | } | ||
905 | |||
906 | /* warn ... we force this to PIO mode */ | ||
907 | if (printk_ratelimit()) | ||
908 | dev_warn(&message->spi->dev, "pump_transfers: " | ||
909 | "DMA disabled for transfer length %ld " | ||
910 | "greater than %d\n", | ||
911 | (long)drv_data->len, MAX_DMA_LEN); | ||
860 | } | 912 | } |
861 | 913 | ||
862 | /* Setup the transfer state based on the type of transfer */ | 914 | /* Setup the transfer state based on the type of transfer */ |
@@ -878,7 +930,6 @@ static void pump_transfers(unsigned long data) | |||
878 | drv_data->len = transfer->len & DCMD_LENGTH; | 930 | drv_data->len = transfer->len & DCMD_LENGTH; |
879 | drv_data->write = drv_data->tx ? chip->write : null_writer; | 931 | drv_data->write = drv_data->tx ? chip->write : null_writer; |
880 | drv_data->read = drv_data->rx ? chip->read : null_reader; | 932 | drv_data->read = drv_data->rx ? chip->read : null_reader; |
881 | drv_data->cs_change = transfer->cs_change; | ||
882 | 933 | ||
883 | /* Change speed and bit per word on a per transfer */ | 934 | /* Change speed and bit per word on a per transfer */ |
884 | cr0 = chip->cr0; | 935 | cr0 = chip->cr0; |
@@ -925,7 +976,7 @@ static void pump_transfers(unsigned long data) | |||
925 | &dma_thresh)) | 976 | &dma_thresh)) |
926 | if (printk_ratelimit()) | 977 | if (printk_ratelimit()) |
927 | dev_warn(&message->spi->dev, | 978 | dev_warn(&message->spi->dev, |
928 | "pump_transfer: " | 979 | "pump_transfers: " |
929 | "DMA burst size reduced to " | 980 | "DMA burst size reduced to " |
930 | "match bits_per_word\n"); | 981 | "match bits_per_word\n"); |
931 | } | 982 | } |
@@ -939,8 +990,23 @@ static void pump_transfers(unsigned long data) | |||
939 | 990 | ||
940 | message->state = RUNNING_STATE; | 991 | message->state = RUNNING_STATE; |
941 | 992 | ||
942 | /* Try to map dma buffer and do a dma transfer if successful */ | 993 | /* Try to map dma buffer and do a dma transfer if successful, but |
943 | if ((drv_data->dma_mapped = map_dma_buffers(drv_data))) { | 994 | * only if the length is non-zero and less than MAX_DMA_LEN. |
995 | * | ||
996 | * Zero-length non-descriptor DMA is illegal on PXA2xx; force use | ||
997 | * of PIO instead. Care is needed above because the transfer may | ||
998 | * have have been passed with buffers that are already dma mapped. | ||
999 | * A zero-length transfer in PIO mode will not try to write/read | ||
1000 | * to/from the buffers | ||
1001 | * | ||
1002 | * REVISIT large transfers are exactly where we most want to be | ||
1003 | * using DMA. If this happens much, split those transfers into | ||
1004 | * multiple DMA segments rather than forcing PIO. | ||
1005 | */ | ||
1006 | drv_data->dma_mapped = 0; | ||
1007 | if (drv_data->len > 0 && drv_data->len <= MAX_DMA_LEN) | ||
1008 | drv_data->dma_mapped = map_dma_buffers(drv_data); | ||
1009 | if (drv_data->dma_mapped) { | ||
944 | 1010 | ||
945 | /* Ensure we have the correct interrupt handler */ | 1011 | /* Ensure we have the correct interrupt handler */ |
946 | drv_data->transfer_handler = dma_transfer; | 1012 | drv_data->transfer_handler = dma_transfer; |
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 070c6219e2d6..ac0e3e4b3c54 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -267,16 +267,13 @@ int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | |||
267 | cs->hw_mode |= SPMODE_LEN(bits_per_word); | 267 | cs->hw_mode |= SPMODE_LEN(bits_per_word); |
268 | 268 | ||
269 | if ((mpc83xx_spi->spibrg / hz) > 64) { | 269 | if ((mpc83xx_spi->spibrg / hz) > 64) { |
270 | cs->hw_mode |= SPMODE_DIV16; | ||
270 | pm = mpc83xx_spi->spibrg / (hz * 64); | 271 | pm = mpc83xx_spi->spibrg / (hz * 64); |
271 | if (pm > 16) { | 272 | if (pm > 16) { |
272 | cs->hw_mode |= SPMODE_DIV16; | 273 | dev_err(&spi->dev, "Requested speed is too " |
273 | pm /= 16; | 274 | "low: %d Hz. Will use %d Hz instead.\n", |
274 | if (pm > 16) { | 275 | hz, mpc83xx_spi->spibrg / 1024); |
275 | dev_err(&spi->dev, "Requested speed is too " | 276 | pm = 16; |
276 | "low: %d Hz. Will use %d Hz instead.\n", | ||
277 | hz, mpc83xx_spi->spibrg / 1024); | ||
278 | pm = 16; | ||
279 | } | ||
280 | } | 277 | } |
281 | } else | 278 | } else |
282 | pm = mpc83xx_spi->spibrg / (hz * 4); | 279 | pm = mpc83xx_spi->spibrg / (hz * 4); |
@@ -315,11 +312,20 @@ static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | |||
315 | if (t->bits_per_word) | 312 | if (t->bits_per_word) |
316 | bits_per_word = t->bits_per_word; | 313 | bits_per_word = t->bits_per_word; |
317 | len = t->len; | 314 | len = t->len; |
318 | if (bits_per_word > 8) | 315 | if (bits_per_word > 8) { |
316 | /* invalid length? */ | ||
317 | if (len & 1) | ||
318 | return -EINVAL; | ||
319 | len /= 2; | 319 | len /= 2; |
320 | if (bits_per_word > 16) | 320 | } |
321 | if (bits_per_word > 16) { | ||
322 | /* invalid length? */ | ||
323 | if (len & 1) | ||
324 | return -EINVAL; | ||
321 | len /= 2; | 325 | len /= 2; |
326 | } | ||
322 | mpc83xx_spi->count = len; | 327 | mpc83xx_spi->count = len; |
328 | |||
323 | INIT_COMPLETION(mpc83xx_spi->done); | 329 | INIT_COMPLETION(mpc83xx_spi->done); |
324 | 330 | ||
325 | /* enable rx ints */ | 331 | /* enable rx ints */ |
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 98abc73c1a1d..3eb414b84a9d 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -430,7 +430,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev) | |||
430 | #endif | 430 | #endif |
431 | 431 | ||
432 | MODULE_ALIAS("platform:s3c2410-spi"); | 432 | MODULE_ALIAS("platform:s3c2410-spi"); |
433 | static struct platform_driver s3c24xx_spidrv = { | 433 | static struct platform_driver s3c24xx_spi_driver = { |
434 | .remove = __exit_p(s3c24xx_spi_remove), | 434 | .remove = __exit_p(s3c24xx_spi_remove), |
435 | .suspend = s3c24xx_spi_suspend, | 435 | .suspend = s3c24xx_spi_suspend, |
436 | .resume = s3c24xx_spi_resume, | 436 | .resume = s3c24xx_spi_resume, |
@@ -442,12 +442,12 @@ static struct platform_driver s3c24xx_spidrv = { | |||
442 | 442 | ||
443 | static int __init s3c24xx_spi_init(void) | 443 | static int __init s3c24xx_spi_init(void) |
444 | { | 444 | { |
445 | return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe); | 445 | return platform_driver_probe(&s3c24xx_spi_driver, s3c24xx_spi_probe); |
446 | } | 446 | } |
447 | 447 | ||
448 | static void __exit s3c24xx_spi_exit(void) | 448 | static void __exit s3c24xx_spi_exit(void) |
449 | { | 449 | { |
450 | platform_driver_unregister(&s3c24xx_spidrv); | 450 | platform_driver_unregister(&s3c24xx_spi_driver); |
451 | } | 451 | } |
452 | 452 | ||
453 | module_init(s3c24xx_spi_init); | 453 | module_init(s3c24xx_spi_init); |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 1eb64d08b60a..95b3ec89c126 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -208,7 +208,7 @@ static int ohci_omap_init(struct usb_hcd *hcd) | |||
208 | if (cpu_is_omap16xx()) | 208 | if (cpu_is_omap16xx()) |
209 | ocpi_enable(); | 209 | ocpi_enable(); |
210 | 210 | ||
211 | #ifdef CONFIG_ARCH_OMAP_OTG | 211 | #ifdef CONFIG_USB_OTG |
212 | if (need_transceiver) { | 212 | if (need_transceiver) { |
213 | ohci->transceiver = otg_get_transceiver(); | 213 | ohci->transceiver = otg_get_transceiver(); |
214 | if (ohci->transceiver) { | 214 | if (ohci->transceiver) { |
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 7b74238ad1c7..e980766bb84b 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -161,7 +161,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
161 | if (serial->type->set_termios) { | 161 | if (serial->type->set_termios) { |
162 | termios->c_cflag = cflag; | 162 | termios->c_cflag = cflag; |
163 | tty_termios_encode_baud_rate(termios, baud, baud); | 163 | tty_termios_encode_baud_rate(termios, baud, baud); |
164 | serial->type->set_termios(NULL, port, &dummy); | 164 | serial->type->set_termios(tty, port, &dummy); |
165 | 165 | ||
166 | port->port.tty = NULL; | 166 | port->port.tty = NULL; |
167 | kfree(termios); | 167 | kfree(termios); |
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 9c5925927ece..75dac578104f 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -208,6 +208,36 @@ static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2) | |||
208 | return value; | 208 | return value; |
209 | } | 209 | } |
210 | 210 | ||
211 | static void atmel_lcdfb_stop_nowait(struct atmel_lcdfb_info *sinfo) | ||
212 | { | ||
213 | /* Turn off the LCD controller and the DMA controller */ | ||
214 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, | ||
215 | sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET); | ||
216 | |||
217 | /* Wait for the LCDC core to become idle */ | ||
218 | while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY) | ||
219 | msleep(10); | ||
220 | |||
221 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0); | ||
222 | } | ||
223 | |||
224 | static void atmel_lcdfb_stop(struct atmel_lcdfb_info *sinfo) | ||
225 | { | ||
226 | atmel_lcdfb_stop_nowait(sinfo); | ||
227 | |||
228 | /* Wait for DMA engine to become idle... */ | ||
229 | while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) | ||
230 | msleep(10); | ||
231 | } | ||
232 | |||
233 | static void atmel_lcdfb_start(struct atmel_lcdfb_info *sinfo) | ||
234 | { | ||
235 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon); | ||
236 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, | ||
237 | (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ||
238 | | ATMEL_LCDC_PWR); | ||
239 | } | ||
240 | |||
211 | static void atmel_lcdfb_update_dma(struct fb_info *info, | 241 | static void atmel_lcdfb_update_dma(struct fb_info *info, |
212 | struct fb_var_screeninfo *var) | 242 | struct fb_var_screeninfo *var) |
213 | { | 243 | { |
@@ -420,26 +450,8 @@ static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo) | |||
420 | { | 450 | { |
421 | might_sleep(); | 451 | might_sleep(); |
422 | 452 | ||
423 | /* LCD power off */ | 453 | atmel_lcdfb_stop(sinfo); |
424 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET); | 454 | atmel_lcdfb_start(sinfo); |
425 | |||
426 | /* wait for the LCDC core to become idle */ | ||
427 | while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY) | ||
428 | msleep(10); | ||
429 | |||
430 | /* DMA disable */ | ||
431 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0); | ||
432 | |||
433 | /* wait for DMA engine to become idle */ | ||
434 | while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) | ||
435 | msleep(10); | ||
436 | |||
437 | /* LCD power on */ | ||
438 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, | ||
439 | (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR); | ||
440 | |||
441 | /* DMA enable */ | ||
442 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon); | ||
443 | } | 455 | } |
444 | 456 | ||
445 | /** | 457 | /** |
@@ -471,14 +483,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) | |||
471 | info->var.xres, info->var.yres, | 483 | info->var.xres, info->var.yres, |
472 | info->var.xres_virtual, info->var.yres_virtual); | 484 | info->var.xres_virtual, info->var.yres_virtual); |
473 | 485 | ||
474 | /* Turn off the LCD controller and the DMA controller */ | 486 | atmel_lcdfb_stop_nowait(sinfo); |
475 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET); | ||
476 | |||
477 | /* Wait for the LCDC core to become idle */ | ||
478 | while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY) | ||
479 | msleep(10); | ||
480 | |||
481 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, 0); | ||
482 | 487 | ||
483 | if (info->var.bits_per_pixel == 1) | 488 | if (info->var.bits_per_pixel == 1) |
484 | info->fix.visual = FB_VISUAL_MONO01; | 489 | info->fix.visual = FB_VISUAL_MONO01; |
@@ -583,13 +588,7 @@ static int atmel_lcdfb_set_par(struct fb_info *info) | |||
583 | while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) | 588 | while (lcdc_readl(sinfo, ATMEL_LCDC_DMACON) & ATMEL_LCDC_DMABUSY) |
584 | msleep(10); | 589 | msleep(10); |
585 | 590 | ||
586 | dev_dbg(info->device, " * re-enable DMA engine\n"); | 591 | atmel_lcdfb_start(sinfo); |
587 | /* ...and enable it with updated configuration */ | ||
588 | lcdc_writel(sinfo, ATMEL_LCDC_DMACON, sinfo->default_dmacon); | ||
589 | |||
590 | dev_dbg(info->device, " * re-enable LCDC core\n"); | ||
591 | lcdc_writel(sinfo, ATMEL_LCDC_PWRCON, | ||
592 | (sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET) | ATMEL_LCDC_PWR); | ||
593 | 592 | ||
594 | dev_dbg(info->device, " * DONE\n"); | 593 | dev_dbg(info->device, " * DONE\n"); |
595 | 594 | ||
@@ -939,7 +938,7 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
939 | ret = register_framebuffer(info); | 938 | ret = register_framebuffer(info); |
940 | if (ret < 0) { | 939 | if (ret < 0) { |
941 | dev_err(dev, "failed to register framebuffer device: %d\n", ret); | 940 | dev_err(dev, "failed to register framebuffer device: %d\n", ret); |
942 | goto free_cmap; | 941 | goto reset_drvdata; |
943 | } | 942 | } |
944 | 943 | ||
945 | /* add selected videomode to modelist */ | 944 | /* add selected videomode to modelist */ |
@@ -955,7 +954,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) | |||
955 | 954 | ||
956 | return 0; | 955 | return 0; |
957 | 956 | ||
958 | 957 | reset_drvdata: | |
958 | dev_set_drvdata(dev, NULL); | ||
959 | free_cmap: | 959 | free_cmap: |
960 | fb_dealloc_cmap(&info->cmap); | 960 | fb_dealloc_cmap(&info->cmap); |
961 | unregister_irqs: | 961 | unregister_irqs: |
@@ -992,10 +992,11 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev) | |||
992 | { | 992 | { |
993 | struct device *dev = &pdev->dev; | 993 | struct device *dev = &pdev->dev; |
994 | struct fb_info *info = dev_get_drvdata(dev); | 994 | struct fb_info *info = dev_get_drvdata(dev); |
995 | struct atmel_lcdfb_info *sinfo = info->par; | 995 | struct atmel_lcdfb_info *sinfo; |
996 | 996 | ||
997 | if (!sinfo) | 997 | if (!info || !info->par) |
998 | return 0; | 998 | return 0; |
999 | sinfo = info->par; | ||
999 | 1000 | ||
1000 | cancel_work_sync(&sinfo->task); | 1001 | cancel_work_sync(&sinfo->task); |
1001 | exit_backlight(sinfo); | 1002 | exit_backlight(sinfo); |
@@ -1030,11 +1031,20 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg) | |||
1030 | struct fb_info *info = platform_get_drvdata(pdev); | 1031 | struct fb_info *info = platform_get_drvdata(pdev); |
1031 | struct atmel_lcdfb_info *sinfo = info->par; | 1032 | struct atmel_lcdfb_info *sinfo = info->par; |
1032 | 1033 | ||
1034 | /* | ||
1035 | * We don't want to handle interrupts while the clock is | ||
1036 | * stopped. It may take forever. | ||
1037 | */ | ||
1038 | lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL); | ||
1039 | |||
1033 | sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); | 1040 | sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); |
1034 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0); | 1041 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0); |
1035 | if (sinfo->atmel_lcdfb_power_control) | 1042 | if (sinfo->atmel_lcdfb_power_control) |
1036 | sinfo->atmel_lcdfb_power_control(0); | 1043 | sinfo->atmel_lcdfb_power_control(0); |
1044 | |||
1045 | atmel_lcdfb_stop(sinfo); | ||
1037 | atmel_lcdfb_stop_clock(sinfo); | 1046 | atmel_lcdfb_stop_clock(sinfo); |
1047 | |||
1038 | return 0; | 1048 | return 0; |
1039 | } | 1049 | } |
1040 | 1050 | ||
@@ -1044,9 +1054,15 @@ static int atmel_lcdfb_resume(struct platform_device *pdev) | |||
1044 | struct atmel_lcdfb_info *sinfo = info->par; | 1054 | struct atmel_lcdfb_info *sinfo = info->par; |
1045 | 1055 | ||
1046 | atmel_lcdfb_start_clock(sinfo); | 1056 | atmel_lcdfb_start_clock(sinfo); |
1057 | atmel_lcdfb_start(sinfo); | ||
1047 | if (sinfo->atmel_lcdfb_power_control) | 1058 | if (sinfo->atmel_lcdfb_power_control) |
1048 | sinfo->atmel_lcdfb_power_control(1); | 1059 | sinfo->atmel_lcdfb_power_control(1); |
1049 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon); | 1060 | lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon); |
1061 | |||
1062 | /* Enable FIFO & DMA errors */ | ||
1063 | lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI | ||
1064 | | ATMEL_LCDC_OWRI | ATMEL_LCDC_MERI); | ||
1065 | |||
1050 | return 0; | 1066 | return 0; |
1051 | } | 1067 | } |
1052 | 1068 | ||
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index c14b2435d23e..e729fb279645 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -628,27 +628,18 @@ static long cirrusfb_get_mclk(long freq, int bpp, long *div) | |||
628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, | 628 | static int cirrusfb_check_var(struct fb_var_screeninfo *var, |
629 | struct fb_info *info) | 629 | struct fb_info *info) |
630 | { | 630 | { |
631 | int nom, den; /* translyting from pixels->bytes */ | 631 | int yres; |
632 | int yres, i; | 632 | /* memory size in pixels */ |
633 | static struct { int xres, yres; } modes[] = | 633 | unsigned pixels = info->screen_size * 8 / var->bits_per_pixel; |
634 | { { 1600, 1280 }, | ||
635 | { 1280, 1024 }, | ||
636 | { 1024, 768 }, | ||
637 | { 800, 600 }, | ||
638 | { 640, 480 }, | ||
639 | { -1, -1 } }; | ||
640 | 634 | ||
641 | switch (var->bits_per_pixel) { | 635 | switch (var->bits_per_pixel) { |
642 | case 1: | 636 | case 1: |
643 | nom = 4; | 637 | pixels /= 4; |
644 | den = 8; | ||
645 | break; /* 8 pixel per byte, only 1/4th of mem usable */ | 638 | break; /* 8 pixel per byte, only 1/4th of mem usable */ |
646 | case 8: | 639 | case 8: |
647 | case 16: | 640 | case 16: |
648 | case 24: | 641 | case 24: |
649 | case 32: | 642 | case 32: |
650 | nom = var->bits_per_pixel / 8; | ||
651 | den = 1; | ||
652 | break; /* 1 pixel == 1 byte */ | 643 | break; /* 1 pixel == 1 byte */ |
653 | default: | 644 | default: |
654 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 645 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." |
@@ -658,43 +649,29 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var, | |||
658 | return -EINVAL; | 649 | return -EINVAL; |
659 | } | 650 | } |
660 | 651 | ||
661 | if (var->xres * nom / den * var->yres > info->screen_size) { | 652 | if (var->xres_virtual < var->xres) |
662 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected..." | 653 | var->xres_virtual = var->xres; |
663 | "resolution too high to fit into video memory!\n", | ||
664 | var->xres, var->yres, var->bits_per_pixel); | ||
665 | DPRINTK("EXIT - EINVAL error\n"); | ||
666 | return -EINVAL; | ||
667 | } | ||
668 | |||
669 | /* use highest possible virtual resolution */ | 654 | /* use highest possible virtual resolution */ |
670 | if (var->xres_virtual == -1 && | 655 | if (var->yres_virtual == -1) { |
671 | var->yres_virtual == -1) { | 656 | var->yres_virtual = pixels / var->xres_virtual; |
672 | printk(KERN_INFO | ||
673 | "cirrusfb: using maximum available virtual resolution\n"); | ||
674 | for (i = 0; modes[i].xres != -1; i++) { | ||
675 | int size = modes[i].xres * nom / den * modes[i].yres; | ||
676 | if (size < info->screen_size / 2) | ||
677 | break; | ||
678 | } | ||
679 | if (modes[i].xres == -1) { | ||
680 | printk(KERN_ERR "cirrusfb: could not find a virtual " | ||
681 | "resolution that fits into video memory!!\n"); | ||
682 | DPRINTK("EXIT - EINVAL error\n"); | ||
683 | return -EINVAL; | ||
684 | } | ||
685 | var->xres_virtual = modes[i].xres; | ||
686 | var->yres_virtual = modes[i].yres; | ||
687 | 657 | ||
688 | printk(KERN_INFO "cirrusfb: virtual resolution set to " | 658 | printk(KERN_INFO "cirrusfb: virtual resolution set to " |
689 | "maximum of %dx%d\n", var->xres_virtual, | 659 | "maximum of %dx%d\n", var->xres_virtual, |
690 | var->yres_virtual); | 660 | var->yres_virtual); |
691 | } | 661 | } |
692 | |||
693 | if (var->xres_virtual < var->xres) | ||
694 | var->xres_virtual = var->xres; | ||
695 | if (var->yres_virtual < var->yres) | 662 | if (var->yres_virtual < var->yres) |
696 | var->yres_virtual = var->yres; | 663 | var->yres_virtual = var->yres; |
697 | 664 | ||
665 | if (var->xres_virtual * var->yres_virtual > pixels) { | ||
666 | printk(KERN_ERR "cirrusfb: mode %dx%dx%d rejected... " | ||
667 | "virtual resolution too high to fit into video memory!\n", | ||
668 | var->xres_virtual, var->yres_virtual, | ||
669 | var->bits_per_pixel); | ||
670 | DPRINTK("EXIT - EINVAL error\n"); | ||
671 | return -EINVAL; | ||
672 | } | ||
673 | |||
674 | |||
698 | if (var->xoffset < 0) | 675 | if (var->xoffset < 0) |
699 | var->xoffset = 0; | 676 | var->xoffset = 0; |
700 | if (var->yoffset < 0) | 677 | if (var->yoffset < 0) |
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 77aafcfae037..4599a4385bc9 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c | |||
@@ -95,7 +95,6 @@ static inline int mtrr_del(int reg, unsigned long base, | |||
95 | #define VOODOO5_MAX_PIXCLOCK 350000 | 95 | #define VOODOO5_MAX_PIXCLOCK 350000 |
96 | 96 | ||
97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { | 97 | static struct fb_fix_screeninfo tdfx_fix __devinitdata = { |
98 | .id = "3Dfx", | ||
99 | .type = FB_TYPE_PACKED_PIXELS, | 98 | .type = FB_TYPE_PACKED_PIXELS, |
100 | .visual = FB_VISUAL_PSEUDOCOLOR, | 99 | .visual = FB_VISUAL_PSEUDOCOLOR, |
101 | .ypanstep = 1, | 100 | .ypanstep = 1, |
@@ -426,7 +425,7 @@ static unsigned long do_lfb_size(struct tdfx_par *par, unsigned short dev_id) | |||
426 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { | 425 | if (dev_id < PCI_DEVICE_ID_3DFX_VOODOO5) { |
427 | /* Banshee/Voodoo3 */ | 426 | /* Banshee/Voodoo3 */ |
428 | chip_size = 2; | 427 | chip_size = 2; |
429 | if (has_sgram && (draminit0 & DRAMINIT0_SGRAM_TYPE)) | 428 | if (has_sgram && !(draminit0 & DRAMINIT0_SGRAM_TYPE)) |
430 | chip_size = 1; | 429 | chip_size = 1; |
431 | } else { | 430 | } else { |
432 | /* Voodoo4/5 */ | 431 | /* Voodoo4/5 */ |
@@ -1200,15 +1199,15 @@ static int __devinit tdfxfb_probe(struct pci_dev *pdev, | |||
1200 | /* Configure the default fb_fix_screeninfo first */ | 1199 | /* Configure the default fb_fix_screeninfo first */ |
1201 | switch (pdev->device) { | 1200 | switch (pdev->device) { |
1202 | case PCI_DEVICE_ID_3DFX_BANSHEE: | 1201 | case PCI_DEVICE_ID_3DFX_BANSHEE: |
1203 | strcat(tdfx_fix.id, " Banshee"); | 1202 | strcpy(tdfx_fix.id, "3Dfx Banshee"); |
1204 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; | 1203 | default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK; |
1205 | break; | 1204 | break; |
1206 | case PCI_DEVICE_ID_3DFX_VOODOO3: | 1205 | case PCI_DEVICE_ID_3DFX_VOODOO3: |
1207 | strcat(tdfx_fix.id, " Voodoo3"); | 1206 | strcpy(tdfx_fix.id, "3Dfx Voodoo3"); |
1208 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; | 1207 | default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK; |
1209 | break; | 1208 | break; |
1210 | case PCI_DEVICE_ID_3DFX_VOODOO5: | 1209 | case PCI_DEVICE_ID_3DFX_VOODOO5: |
1211 | strcat(tdfx_fix.id, " Voodoo5"); | 1210 | strcpy(tdfx_fix.id, "3Dfx Voodoo5"); |
1212 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; | 1211 | default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK; |
1213 | break; | 1212 | break; |
1214 | } | 1213 | } |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index d4427cb86979..2e15da5459cf 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -60,7 +60,7 @@ | |||
60 | 60 | ||
61 | #define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10)) | 61 | #define PAGES2KB(_p) ((_p)<<(PAGE_SHIFT-10)) |
62 | 62 | ||
63 | #define BALLOON_CLASS_NAME "memory" | 63 | #define BALLOON_CLASS_NAME "xen_memory" |
64 | 64 | ||
65 | struct balloon_stats { | 65 | struct balloon_stats { |
66 | /* We aim for 'current allocation' == 'target allocation'. */ | 66 | /* We aim for 'current allocation' == 'target allocation'. */ |
diff --git a/firmware/Makefile b/firmware/Makefile index 9fe86041f86e..da75a6fbc6ba 100644 --- a/firmware/Makefile +++ b/firmware/Makefile | |||
@@ -146,15 +146,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/% | |||
146 | $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) | 146 | $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) |
147 | $(call cmd,ihex) | 147 | $(call cmd,ihex) |
148 | 148 | ||
149 | # Don't depend on ihex2fw if we're installing and it already exists. | ||
150 | # Putting it after | in the dependencies doesn't seem sufficient when | ||
151 | # we're installing after a cross-compile, because ihex2fw has dependencies | ||
152 | # on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and | ||
153 | # thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree | ||
154 | # is exported read-only for someone to run 'make install'. | ||
155 | ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw) | ||
156 | ihex2fw_dep := | ||
157 | else | ||
158 | ihex2fw_dep := $(obj)/ihex2fw | ||
159 | endif | ||
160 | |||
149 | # .HEX is also Intel HEX, but where the offset and length in each record | 161 | # .HEX is also Intel HEX, but where the offset and length in each record |
150 | # is actually meaningful, because the firmware has to be loaded in a certain | 162 | # is actually meaningful, because the firmware has to be loaded in a certain |
151 | # order rather than as a single binary blob. Thus, we convert them into our | 163 | # order rather than as a single binary blob. Thus, we convert them into our |
152 | # more compact binary representation of ihex records (<linux/ihex.h>) | 164 | # more compact binary representation of ihex records (<linux/ihex.h>) |
153 | $(obj)/%.fw: $(obj)/%.HEX $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) | 165 | $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) |
154 | $(call cmd,ihex2fw) | 166 | $(call cmd,ihex2fw) |
155 | 167 | ||
156 | # .H16 is our own modified form of Intel HEX, with 16-bit length for records. | 168 | # .H16 is our own modified form of Intel HEX, with 16-bit length for records. |
157 | $(obj)/%.fw: $(obj)/%.H16 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) | 169 | $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) |
158 | $(call cmd,h16tofw) | 170 | $(call cmd,h16tofw) |
159 | 171 | ||
160 | $(firmware-dirs): | 172 | $(firmware-dirs): |
diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 87ee5ccee348..ed8feb052df9 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c | |||
@@ -125,8 +125,8 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
125 | inode->i_ino); | 125 | inode->i_ino); |
126 | if (err) { | 126 | if (err) { |
127 | inode_dec_link_count(inode); | 127 | inode_dec_link_count(inode); |
128 | iput(inode); | ||
129 | mutex_unlock(&info->bfs_lock); | 128 | mutex_unlock(&info->bfs_lock); |
129 | iput(inode); | ||
130 | return err; | 130 | return err; |
131 | } | 131 | } |
132 | mutex_unlock(&info->bfs_lock); | 132 | mutex_unlock(&info->bfs_lock); |
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index f9e4ad97a79e..06e521a945c3 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
@@ -9,7 +9,10 @@ files (e.g. "cp -a") to Windows servers. For mkdir and create honor setgid bit | |||
9 | on parent directory when server supports Unix Extensions but not POSIX | 9 | on parent directory when server supports Unix Extensions but not POSIX |
10 | create. Update cifs.upcall version to handle new Kerberos sec flags | 10 | create. Update cifs.upcall version to handle new Kerberos sec flags |
11 | (this requires update of cifs.upcall program from Samba). Fix memory leak | 11 | (this requires update of cifs.upcall program from Samba). Fix memory leak |
12 | on dns_upcall (resolving DFS referralls). | 12 | on dns_upcall (resolving DFS referralls). Fix plain text password |
13 | authentication (requires setting SecurityFlags to 0x30030 to enable | ||
14 | lanman and plain text though). Fix writes to be at correct offset when | ||
15 | file is open with O_APPEND and file is on a directio (forcediretio) mount. | ||
13 | 16 | ||
14 | Version 1.53 | 17 | Version 1.53 |
15 | ------------ | 18 | ------------ |
diff --git a/fs/cifs/README b/fs/cifs/README index 68b5c1169d9d..bd2343d4c6a6 100644 --- a/fs/cifs/README +++ b/fs/cifs/README | |||
@@ -542,10 +542,20 @@ SecurityFlags Flags which control security negotiation and | |||
542 | hashing mechanisms (as "must use") on the other hand | 542 | hashing mechanisms (as "must use") on the other hand |
543 | does not make much sense. Default flags are | 543 | does not make much sense. Default flags are |
544 | 0x07007 | 544 | 0x07007 |
545 | (NTLM, NTLMv2 and packet signing allowed). Maximum | 545 | (NTLM, NTLMv2 and packet signing allowed). The maximum |
546 | allowable flags if you want to allow mounts to servers | 546 | allowable flags if you want to allow mounts to servers |
547 | using weaker password hashes is 0x37037 (lanman, | 547 | using weaker password hashes is 0x37037 (lanman, |
548 | plaintext, ntlm, ntlmv2, signing allowed): | 548 | plaintext, ntlm, ntlmv2, signing allowed). Some |
549 | SecurityFlags require the corresponding menuconfig | ||
550 | options to be enabled (lanman and plaintext require | ||
551 | CONFIG_CIFS_WEAK_PW_HASH for example). Enabling | ||
552 | plaintext authentication currently requires also | ||
553 | enabling lanman authentication in the security flags | ||
554 | because the cifs module only supports sending | ||
555 | laintext passwords using the older lanman dialect | ||
556 | form of the session setup SMB. (e.g. for authentication | ||
557 | using plain text passwords, set the SecurityFlags | ||
558 | to 0x30030): | ||
549 | 559 | ||
550 | may use packet signing 0x00001 | 560 | may use packet signing 0x00001 |
551 | must use packet signing 0x01001 | 561 | must use packet signing 0x01001 |
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 83fd40dc1ef0..bd5f13d38450 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
@@ -294,6 +294,7 @@ void calc_lanman_hash(struct cifsSesInfo *ses, char *lnm_session_key) | |||
294 | 294 | ||
295 | if ((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0) | 295 | if ((ses->server->secMode & SECMODE_PW_ENCRYPT) == 0) |
296 | if (extended_security & CIFSSEC_MAY_PLNTXT) { | 296 | if (extended_security & CIFSSEC_MAY_PLNTXT) { |
297 | memset(lnm_session_key, 0, CIFS_SESS_KEY_SIZE); | ||
297 | memcpy(lnm_session_key, password_with_pad, | 298 | memcpy(lnm_session_key, password_with_pad, |
298 | CIFS_ENCPWD_SIZE); | 299 | CIFS_ENCPWD_SIZE); |
299 | return; | 300 | return; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index ff14d14903a0..cbefe1f1f9fe 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -833,6 +833,10 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, | |||
833 | return -EBADF; | 833 | return -EBADF; |
834 | open_file = (struct cifsFileInfo *) file->private_data; | 834 | open_file = (struct cifsFileInfo *) file->private_data; |
835 | 835 | ||
836 | rc = generic_write_checks(file, poffset, &write_size, 0); | ||
837 | if (rc) | ||
838 | return rc; | ||
839 | |||
836 | xid = GetXid(); | 840 | xid = GetXid(); |
837 | 841 | ||
838 | if (*poffset > file->f_path.dentry->d_inode->i_size) | 842 | if (*poffset > file->f_path.dentry->d_inode->i_size) |
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index b537fad3bf50..252fdc0567f1 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -409,6 +409,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
409 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | 409 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
410 | char lnm_session_key[CIFS_SESS_KEY_SIZE]; | 410 | char lnm_session_key[CIFS_SESS_KEY_SIZE]; |
411 | 411 | ||
412 | pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE; | ||
413 | |||
412 | /* no capabilities flags in old lanman negotiation */ | 414 | /* no capabilities flags in old lanman negotiation */ |
413 | 415 | ||
414 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); | 416 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 9abcd2b329f7..e9b20173fef3 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -1279,6 +1279,12 @@ static int nfs_parse_mount_options(char *raw, | |||
1279 | } | 1279 | } |
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | if (errors > 0) { | ||
1283 | dfprintk(MOUNT, "NFS: parsing encountered %d error%s\n", | ||
1284 | errors, (errors == 1 ? "" : "s")); | ||
1285 | if (!sloppy) | ||
1286 | return 0; | ||
1287 | } | ||
1282 | return 1; | 1288 | return 1; |
1283 | 1289 | ||
1284 | out_nomem: | 1290 | out_nomem: |
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index b6ed38380ab8..54b8b4140c8f 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -443,7 +443,7 @@ init_state(struct posix_acl_state *state, int cnt) | |||
443 | * enough space for either: | 443 | * enough space for either: |
444 | */ | 444 | */ |
445 | alloc = sizeof(struct posix_ace_state_array) | 445 | alloc = sizeof(struct posix_ace_state_array) |
446 | + cnt*sizeof(struct posix_ace_state); | 446 | + cnt*sizeof(struct posix_user_ace_state); |
447 | state->users = kzalloc(alloc, GFP_KERNEL); | 447 | state->users = kzalloc(alloc, GFP_KERNEL); |
448 | if (!state->users) | 448 | if (!state->users) |
449 | return -ENOMEM; | 449 | return -ENOMEM; |
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 2e51adac65de..e5b51ffafc6c 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -867,11 +867,6 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
867 | int slack_bytes; | 867 | int slack_bytes; |
868 | __be32 status; | 868 | __be32 status; |
869 | 869 | ||
870 | status = nfserr_resource; | ||
871 | cstate = cstate_alloc(); | ||
872 | if (cstate == NULL) | ||
873 | goto out; | ||
874 | |||
875 | resp->xbuf = &rqstp->rq_res; | 870 | resp->xbuf = &rqstp->rq_res; |
876 | resp->p = rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len; | 871 | resp->p = rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len; |
877 | resp->tagp = resp->p; | 872 | resp->tagp = resp->p; |
@@ -890,6 +885,11 @@ nfsd4_proc_compound(struct svc_rqst *rqstp, | |||
890 | if (args->minorversion > NFSD_SUPPORTED_MINOR_VERSION) | 885 | if (args->minorversion > NFSD_SUPPORTED_MINOR_VERSION) |
891 | goto out; | 886 | goto out; |
892 | 887 | ||
888 | status = nfserr_resource; | ||
889 | cstate = cstate_alloc(); | ||
890 | if (cstate == NULL) | ||
891 | goto out; | ||
892 | |||
893 | status = nfs_ok; | 893 | status = nfs_ok; |
894 | while (!status && resp->opcnt < args->opcnt) { | 894 | while (!status && resp->opcnt < args->opcnt) { |
895 | op = &args->ops[resp->opcnt++]; | 895 | op = &args->ops[resp->opcnt++]; |
@@ -957,9 +957,9 @@ encode_op: | |||
957 | nfsd4_increment_op_stats(op->opnum); | 957 | nfsd4_increment_op_stats(op->opnum); |
958 | } | 958 | } |
959 | 959 | ||
960 | cstate_free(cstate); | ||
960 | out: | 961 | out: |
961 | nfsd4_release_compoundargs(args); | 962 | nfsd4_release_compoundargs(args); |
962 | cstate_free(cstate); | ||
963 | dprintk("nfsv4 compound returned %d\n", ntohl(status)); | 963 | dprintk("nfsv4 compound returned %d\n", ntohl(status)); |
964 | return status; | 964 | return status; |
965 | } | 965 | } |
diff --git a/fs/ntfs/usnjrnl.h b/fs/ntfs/usnjrnl.h index 3a8af75351e8..4087fbdac327 100644 --- a/fs/ntfs/usnjrnl.h +++ b/fs/ntfs/usnjrnl.h | |||
@@ -113,7 +113,7 @@ typedef struct { | |||
113 | * Reason flags (32-bit). Cumulative flags describing the change(s) to the | 113 | * Reason flags (32-bit). Cumulative flags describing the change(s) to the |
114 | * file since it was last opened. I think the names speak for themselves but | 114 | * file since it was last opened. I think the names speak for themselves but |
115 | * if you disagree check out the descriptions in the Linux NTFS project NTFS | 115 | * if you disagree check out the descriptions in the Linux NTFS project NTFS |
116 | * documentation: http://linux-ntfs.sourceforge.net/ntfs/files/usnjrnl.html | 116 | * documentation: http://www.linux-ntfs.org/ |
117 | */ | 117 | */ |
118 | enum { | 118 | enum { |
119 | USN_REASON_DATA_OVERWRITE = const_cpu_to_le32(0x00000001), | 119 | USN_REASON_DATA_OVERWRITE = const_cpu_to_le32(0x00000001), |
@@ -145,7 +145,7 @@ typedef le32 USN_REASON_FLAGS; | |||
145 | * Source info flags (32-bit). Information about the source of the change(s) | 145 | * Source info flags (32-bit). Information about the source of the change(s) |
146 | * to the file. For detailed descriptions of what these mean, see the Linux | 146 | * to the file. For detailed descriptions of what these mean, see the Linux |
147 | * NTFS project NTFS documentation: | 147 | * NTFS project NTFS documentation: |
148 | * http://linux-ntfs.sourceforge.net/ntfs/files/usnjrnl.html | 148 | * http://www.linux-ntfs.org/ |
149 | */ | 149 | */ |
150 | enum { | 150 | enum { |
151 | USN_SOURCE_DATA_MANAGEMENT = const_cpu_to_le32(0x00000001), | 151 | USN_SOURCE_DATA_MANAGEMENT = const_cpu_to_le32(0x00000001), |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 506c24fb5078..a53da1466277 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -594,7 +594,7 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock, | |||
594 | goto bail; | 594 | goto bail; |
595 | } | 595 | } |
596 | 596 | ||
597 | if (!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)) && !p_blkno) { | 597 | if (!ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb)) && !p_blkno && create) { |
598 | ocfs2_error(inode->i_sb, | 598 | ocfs2_error(inode->i_sb, |
599 | "Inode %llu has a hole at block %llu\n", | 599 | "Inode %llu has a hole at block %llu\n", |
600 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 600 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 7d6b34e201db..ecc3330972e5 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -499,9 +499,9 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) | |||
499 | if (!size) | 499 | if (!size) |
500 | continue; | 500 | continue; |
501 | if (from + size > get_capacity(disk)) { | 501 | if (from + size > get_capacity(disk)) { |
502 | printk(KERN_ERR " %s: p%d exceeds device capacity\n", | 502 | printk(KERN_WARNING |
503 | "%s: p%d exceeds device capacity\n", | ||
503 | disk->disk_name, p); | 504 | disk->disk_name, p); |
504 | continue; | ||
505 | } | 505 | } |
506 | res = add_partition(disk, p, from, size, state->parts[p].flags); | 506 | res = add_partition(disk, p, from, size, state->parts[p].flags); |
507 | if (res) { | 507 | if (res) { |
diff --git a/fs/proc/array.c b/fs/proc/array.c index 0d6eb33597c6..71c9be59c9c2 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -337,65 +337,6 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, | |||
337 | return 0; | 337 | return 0; |
338 | } | 338 | } |
339 | 339 | ||
340 | /* | ||
341 | * Use precise platform statistics if available: | ||
342 | */ | ||
343 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
344 | static cputime_t task_utime(struct task_struct *p) | ||
345 | { | ||
346 | return p->utime; | ||
347 | } | ||
348 | |||
349 | static cputime_t task_stime(struct task_struct *p) | ||
350 | { | ||
351 | return p->stime; | ||
352 | } | ||
353 | #else | ||
354 | static cputime_t task_utime(struct task_struct *p) | ||
355 | { | ||
356 | clock_t utime = cputime_to_clock_t(p->utime), | ||
357 | total = utime + cputime_to_clock_t(p->stime); | ||
358 | u64 temp; | ||
359 | |||
360 | /* | ||
361 | * Use CFS's precise accounting: | ||
362 | */ | ||
363 | temp = (u64)nsec_to_clock_t(p->se.sum_exec_runtime); | ||
364 | |||
365 | if (total) { | ||
366 | temp *= utime; | ||
367 | do_div(temp, total); | ||
368 | } | ||
369 | utime = (clock_t)temp; | ||
370 | |||
371 | p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime)); | ||
372 | return p->prev_utime; | ||
373 | } | ||
374 | |||
375 | static cputime_t task_stime(struct task_struct *p) | ||
376 | { | ||
377 | clock_t stime; | ||
378 | |||
379 | /* | ||
380 | * Use CFS's precise accounting. (we subtract utime from | ||
381 | * the total, to make sure the total observed by userspace | ||
382 | * grows monotonically - apps rely on that): | ||
383 | */ | ||
384 | stime = nsec_to_clock_t(p->se.sum_exec_runtime) - | ||
385 | cputime_to_clock_t(task_utime(p)); | ||
386 | |||
387 | if (stime >= 0) | ||
388 | p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime)); | ||
389 | |||
390 | return p->prev_stime; | ||
391 | } | ||
392 | #endif | ||
393 | |||
394 | static cputime_t task_gtime(struct task_struct *p) | ||
395 | { | ||
396 | return p->gtime; | ||
397 | } | ||
398 | |||
399 | static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, | 340 | static int do_task_stat(struct seq_file *m, struct pid_namespace *ns, |
400 | struct pid *pid, struct task_struct *task, int whole) | 341 | struct pid *pid, struct task_struct *task, int whole) |
401 | { | 342 | { |
diff --git a/fs/proc/generic.c b/fs/proc/generic.c index bca0f81eb687..7821589a17d5 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c | |||
@@ -547,8 +547,8 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp | |||
547 | 547 | ||
548 | for (tmp = dir->subdir; tmp; tmp = tmp->next) | 548 | for (tmp = dir->subdir; tmp; tmp = tmp->next) |
549 | if (strcmp(tmp->name, dp->name) == 0) { | 549 | if (strcmp(tmp->name, dp->name) == 0) { |
550 | printk(KERN_WARNING "proc_dir_entry '%s' already " | 550 | printk(KERN_WARNING "proc_dir_entry '%s/%s' already registered\n", |
551 | "registered\n", dp->name); | 551 | dir->name, dp->name); |
552 | dump_stack(); | 552 | dump_stack(); |
553 | break; | 553 | break; |
554 | } | 554 | } |
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index ded969862960..29e20c6b1f7f 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/tty.h> | 24 | #include <linux/tty.h> |
25 | #include <linux/string.h> | 25 | #include <linux/string.h> |
26 | #include <linux/mman.h> | 26 | #include <linux/mman.h> |
27 | #include <linux/quicklist.h> | ||
27 | #include <linux/proc_fs.h> | 28 | #include <linux/proc_fs.h> |
28 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
29 | #include <linux/mm.h> | 30 | #include <linux/mm.h> |
@@ -182,6 +183,9 @@ static int meminfo_read_proc(char *page, char **start, off_t off, | |||
182 | "SReclaimable: %8lu kB\n" | 183 | "SReclaimable: %8lu kB\n" |
183 | "SUnreclaim: %8lu kB\n" | 184 | "SUnreclaim: %8lu kB\n" |
184 | "PageTables: %8lu kB\n" | 185 | "PageTables: %8lu kB\n" |
186 | #ifdef CONFIG_QUICKLIST | ||
187 | "Quicklists: %8lu kB\n" | ||
188 | #endif | ||
185 | "NFS_Unstable: %8lu kB\n" | 189 | "NFS_Unstable: %8lu kB\n" |
186 | "Bounce: %8lu kB\n" | 190 | "Bounce: %8lu kB\n" |
187 | "WritebackTmp: %8lu kB\n" | 191 | "WritebackTmp: %8lu kB\n" |
@@ -214,6 +218,9 @@ static int meminfo_read_proc(char *page, char **start, off_t off, | |||
214 | K(global_page_state(NR_SLAB_RECLAIMABLE)), | 218 | K(global_page_state(NR_SLAB_RECLAIMABLE)), |
215 | K(global_page_state(NR_SLAB_UNRECLAIMABLE)), | 219 | K(global_page_state(NR_SLAB_UNRECLAIMABLE)), |
216 | K(global_page_state(NR_PAGETABLE)), | 220 | K(global_page_state(NR_PAGETABLE)), |
221 | #ifdef CONFIG_QUICKLIST | ||
222 | K(quicklist_total_size()), | ||
223 | #endif | ||
217 | K(global_page_state(NR_UNSTABLE_NFS)), | 224 | K(global_page_state(NR_UNSTABLE_NFS)), |
218 | K(global_page_state(NR_BOUNCE)), | 225 | K(global_page_state(NR_BOUNCE)), |
219 | K(global_page_state(NR_WRITEBACK_TEMP)), | 226 | K(global_page_state(NR_WRITEBACK_TEMP)), |
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index 154098157473..73db464cd08b 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -302,18 +302,6 @@ long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs) | |||
302 | int subtract_lebs; | 302 | int subtract_lebs; |
303 | long long available; | 303 | long long available; |
304 | 304 | ||
305 | /* | ||
306 | * Force the amount available to the total size reported if the used | ||
307 | * space is zero. | ||
308 | */ | ||
309 | if (c->lst.total_used <= UBIFS_INO_NODE_SZ && | ||
310 | c->budg_data_growth + c->budg_dd_growth == 0) { | ||
311 | /* Do the same calculation as for c->block_cnt */ | ||
312 | available = c->main_lebs - 2; | ||
313 | available *= c->leb_size - c->dark_wm; | ||
314 | return available; | ||
315 | } | ||
316 | |||
317 | available = c->main_bytes - c->lst.total_used; | 305 | available = c->main_bytes - c->lst.total_used; |
318 | 306 | ||
319 | /* | 307 | /* |
@@ -714,34 +702,106 @@ void ubifs_release_dirty_inode_budget(struct ubifs_info *c, | |||
714 | } | 702 | } |
715 | 703 | ||
716 | /** | 704 | /** |
717 | * ubifs_budg_get_free_space - return amount of free space. | 705 | * ubifs_reported_space - calculate reported free space. |
706 | * @c: the UBIFS file-system description object | ||
707 | * @free: amount of free space | ||
708 | * | ||
709 | * This function calculates amount of free space which will be reported to | ||
710 | * user-space. User-space application tend to expect that if the file-system | ||
711 | * (e.g., via the 'statfs()' call) reports that it has N bytes available, they | ||
712 | * are able to write a file of size N. UBIFS attaches node headers to each data | ||
713 | * node and it has to write indexind nodes as well. This introduces additional | ||
714 | * overhead, and UBIFS it has to report sligtly less free space to meet the | ||
715 | * above expectetion. | ||
716 | * | ||
717 | * This function assumes free space is made up of uncompressed data nodes and | ||
718 | * full index nodes (one per data node, tripled because we always allow enough | ||
719 | * space to write the index thrice). | ||
720 | * | ||
721 | * Note, the calculation is pessimistic, which means that most of the time | ||
722 | * UBIFS reports less space than it actually has. | ||
723 | */ | ||
724 | long long ubifs_reported_space(const struct ubifs_info *c, uint64_t free) | ||
725 | { | ||
726 | int divisor, factor, f; | ||
727 | |||
728 | /* | ||
729 | * Reported space size is @free * X, where X is UBIFS block size | ||
730 | * divided by UBIFS block size + all overhead one data block | ||
731 | * introduces. The overhead is the node header + indexing overhead. | ||
732 | * | ||
733 | * Indexing overhead calculations are based on the following formula: | ||
734 | * I = N/(f - 1) + 1, where I - number of indexing nodes, N - number | ||
735 | * of data nodes, f - fanout. Because effective UBIFS fanout is twice | ||
736 | * as less than maximum fanout, we assume that each data node | ||
737 | * introduces 3 * @c->max_idx_node_sz / (@c->fanout/2 - 1) bytes. | ||
738 | * Note, the multiplier 3 is because UBIFS reseves thrice as more space | ||
739 | * for the index. | ||
740 | */ | ||
741 | f = c->fanout > 3 ? c->fanout >> 1 : 2; | ||
742 | factor = UBIFS_BLOCK_SIZE; | ||
743 | divisor = UBIFS_MAX_DATA_NODE_SZ; | ||
744 | divisor += (c->max_idx_node_sz * 3) / (f - 1); | ||
745 | free *= factor; | ||
746 | do_div(free, divisor); | ||
747 | return free; | ||
748 | } | ||
749 | |||
750 | /** | ||
751 | * ubifs_get_free_space - return amount of free space. | ||
718 | * @c: UBIFS file-system description object | 752 | * @c: UBIFS file-system description object |
719 | * | 753 | * |
720 | * This function returns amount of free space on the file-system. | 754 | * This function calculates amount of free space to report to user-space. |
755 | * | ||
756 | * Because UBIFS may introduce substantial overhead (the index, node headers, | ||
757 | * alighment, wastage at the end of eraseblocks, etc), it cannot report real | ||
758 | * amount of free flash space it has (well, because not all dirty space is | ||
759 | * reclamable, UBIFS does not actually know the real amount). If UBIFS did so, | ||
760 | * it would bread user expectetion about what free space is. Users seem to | ||
761 | * accustomed to assume that if the file-system reports N bytes of free space, | ||
762 | * they would be able to fit a file of N bytes to the FS. This almost works for | ||
763 | * traditional file-systems, because they have way less overhead than UBIFS. | ||
764 | * So, to keep users happy, UBIFS tries to take the overhead into account. | ||
721 | */ | 765 | */ |
722 | long long ubifs_budg_get_free_space(struct ubifs_info *c) | 766 | long long ubifs_get_free_space(struct ubifs_info *c) |
723 | { | 767 | { |
724 | int min_idx_lebs, rsvd_idx_lebs; | 768 | int min_idx_lebs, rsvd_idx_lebs, lebs; |
725 | long long available, outstanding, free; | 769 | long long available, outstanding, free; |
726 | 770 | ||
727 | /* Do exactly the same calculations as in 'do_budget_space()' */ | ||
728 | spin_lock(&c->space_lock); | 771 | spin_lock(&c->space_lock); |
729 | min_idx_lebs = ubifs_calc_min_idx_lebs(c); | 772 | min_idx_lebs = ubifs_calc_min_idx_lebs(c); |
773 | outstanding = c->budg_data_growth + c->budg_dd_growth; | ||
730 | 774 | ||
731 | if (min_idx_lebs > c->lst.idx_lebs) | 775 | /* |
732 | rsvd_idx_lebs = min_idx_lebs - c->lst.idx_lebs; | 776 | * Force the amount available to the total size reported if the used |
733 | else | 777 | * space is zero. |
734 | rsvd_idx_lebs = 0; | 778 | */ |
735 | 779 | if (c->lst.total_used <= UBIFS_INO_NODE_SZ && !outstanding) { | |
736 | if (rsvd_idx_lebs > c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt | ||
737 | - c->lst.taken_empty_lebs) { | ||
738 | spin_unlock(&c->space_lock); | 780 | spin_unlock(&c->space_lock); |
739 | return 0; | 781 | return (long long)c->block_cnt << UBIFS_BLOCK_SHIFT; |
740 | } | 782 | } |
741 | 783 | ||
742 | available = ubifs_calc_available(c, min_idx_lebs); | 784 | available = ubifs_calc_available(c, min_idx_lebs); |
743 | outstanding = c->budg_data_growth + c->budg_dd_growth; | 785 | |
744 | c->min_idx_lebs = min_idx_lebs; | 786 | /* |
787 | * When reporting free space to user-space, UBIFS guarantees that it is | ||
788 | * possible to write a file of free space size. This means that for | ||
789 | * empty LEBs we may use more precise calculations than | ||
790 | * 'ubifs_calc_available()' is using. Namely, we know that in empty | ||
791 | * LEBs we would waste only @c->leb_overhead bytes, not @c->dark_wm. | ||
792 | * Thus, amend the available space. | ||
793 | * | ||
794 | * Note, the calculations below are similar to what we have in | ||
795 | * 'do_budget_space()', so refer there for comments. | ||
796 | */ | ||
797 | if (min_idx_lebs > c->lst.idx_lebs) | ||
798 | rsvd_idx_lebs = min_idx_lebs - c->lst.idx_lebs; | ||
799 | else | ||
800 | rsvd_idx_lebs = 0; | ||
801 | lebs = c->lst.empty_lebs + c->freeable_cnt + c->idx_gc_cnt - | ||
802 | c->lst.taken_empty_lebs; | ||
803 | lebs -= rsvd_idx_lebs; | ||
804 | available += lebs * (c->dark_wm - c->leb_overhead); | ||
745 | spin_unlock(&c->space_lock); | 805 | spin_unlock(&c->space_lock); |
746 | 806 | ||
747 | if (available > outstanding) | 807 | if (available > outstanding) |
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 5c96f1fb7016..2b267c9a1806 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c | |||
@@ -587,7 +587,6 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) | |||
587 | if (err) { | 587 | if (err) { |
588 | if (err != -ENOSPC) | 588 | if (err != -ENOSPC) |
589 | return err; | 589 | return err; |
590 | err = 0; | ||
591 | budgeted = 0; | 590 | budgeted = 0; |
592 | } | 591 | } |
593 | 592 | ||
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 4071d1cae29f..3d698e2022b1 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -793,7 +793,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, | |||
793 | int err; | 793 | int err; |
794 | struct ubifs_budget_req req; | 794 | struct ubifs_budget_req req; |
795 | loff_t old_size = inode->i_size, new_size = attr->ia_size; | 795 | loff_t old_size = inode->i_size, new_size = attr->ia_size; |
796 | int offset = new_size & (UBIFS_BLOCK_SIZE - 1); | 796 | int offset = new_size & (UBIFS_BLOCK_SIZE - 1), budgeted = 1; |
797 | struct ubifs_inode *ui = ubifs_inode(inode); | 797 | struct ubifs_inode *ui = ubifs_inode(inode); |
798 | 798 | ||
799 | dbg_gen("ino %lu, size %lld -> %lld", inode->i_ino, old_size, new_size); | 799 | dbg_gen("ino %lu, size %lld -> %lld", inode->i_ino, old_size, new_size); |
@@ -811,8 +811,15 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, | |||
811 | /* A funny way to budget for truncation node */ | 811 | /* A funny way to budget for truncation node */ |
812 | req.dirtied_ino_d = UBIFS_TRUN_NODE_SZ; | 812 | req.dirtied_ino_d = UBIFS_TRUN_NODE_SZ; |
813 | err = ubifs_budget_space(c, &req); | 813 | err = ubifs_budget_space(c, &req); |
814 | if (err) | 814 | if (err) { |
815 | return err; | 815 | /* |
816 | * Treat truncations to zero as deletion and always allow them, | ||
817 | * just like we do for '->unlink()'. | ||
818 | */ | ||
819 | if (new_size || err != -ENOSPC) | ||
820 | return err; | ||
821 | budgeted = 0; | ||
822 | } | ||
816 | 823 | ||
817 | err = vmtruncate(inode, new_size); | 824 | err = vmtruncate(inode, new_size); |
818 | if (err) | 825 | if (err) |
@@ -869,7 +876,12 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, | |||
869 | err = ubifs_jnl_truncate(c, inode, old_size, new_size); | 876 | err = ubifs_jnl_truncate(c, inode, old_size, new_size); |
870 | mutex_unlock(&ui->ui_mutex); | 877 | mutex_unlock(&ui->ui_mutex); |
871 | out_budg: | 878 | out_budg: |
872 | ubifs_release_budget(c, &req); | 879 | if (budgeted) |
880 | ubifs_release_budget(c, &req); | ||
881 | else { | ||
882 | c->nospace = c->nospace_rp = 0; | ||
883 | smp_wmb(); | ||
884 | } | ||
873 | return err; | 885 | return err; |
874 | } | 886 | } |
875 | 887 | ||
diff --git a/fs/ubifs/find.c b/fs/ubifs/find.c index adee7b5ddeab..e045c8b55423 100644 --- a/fs/ubifs/find.c +++ b/fs/ubifs/find.c | |||
@@ -211,14 +211,8 @@ static const struct ubifs_lprops *scan_for_dirty(struct ubifs_info *c, | |||
211 | * dirty index heap, and it falls-back to LPT scanning if the heaps are empty | 211 | * dirty index heap, and it falls-back to LPT scanning if the heaps are empty |
212 | * or do not have an LEB which satisfies the @min_space criteria. | 212 | * or do not have an LEB which satisfies the @min_space criteria. |
213 | * | 213 | * |
214 | * Note: | 214 | * Note, LEBs which have less than dead watermark of free + dirty space are |
215 | * o LEBs which have less than dead watermark of dirty space are never picked | 215 | * never picked by this function. |
216 | * by this function; | ||
217 | * | ||
218 | * Returns zero and the LEB properties of | ||
219 | * found dirty LEB in case of success, %-ENOSPC if no dirty LEB was found and a | ||
220 | * negative error code in case of other failures. The returned LEB is marked as | ||
221 | * "taken". | ||
222 | * | 216 | * |
223 | * The additional @pick_free argument controls if this function has to return a | 217 | * The additional @pick_free argument controls if this function has to return a |
224 | * free or freeable LEB if one is present. For example, GC must to set it to %1, | 218 | * free or freeable LEB if one is present. For example, GC must to set it to %1, |
@@ -231,6 +225,10 @@ static const struct ubifs_lprops *scan_for_dirty(struct ubifs_info *c, | |||
231 | * | 225 | * |
232 | * In addition @pick_free is set to %2 by the recovery process in order to | 226 | * In addition @pick_free is set to %2 by the recovery process in order to |
233 | * recover gc_lnum in which case an index LEB must not be returned. | 227 | * recover gc_lnum in which case an index LEB must not be returned. |
228 | * | ||
229 | * This function returns zero and the LEB properties of found dirty LEB in case | ||
230 | * of success, %-ENOSPC if no dirty LEB was found and a negative error code in | ||
231 | * case of other failures. The returned LEB is marked as "taken". | ||
234 | */ | 232 | */ |
235 | int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, | 233 | int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, |
236 | int min_space, int pick_free) | 234 | int min_space, int pick_free) |
@@ -245,7 +243,7 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, | |||
245 | int lebs, rsvd_idx_lebs = 0; | 243 | int lebs, rsvd_idx_lebs = 0; |
246 | 244 | ||
247 | spin_lock(&c->space_lock); | 245 | spin_lock(&c->space_lock); |
248 | lebs = c->lst.empty_lebs; | 246 | lebs = c->lst.empty_lebs + c->idx_gc_cnt; |
249 | lebs += c->freeable_cnt - c->lst.taken_empty_lebs; | 247 | lebs += c->freeable_cnt - c->lst.taken_empty_lebs; |
250 | 248 | ||
251 | /* | 249 | /* |
@@ -317,7 +315,7 @@ int ubifs_find_dirty_leb(struct ubifs_info *c, struct ubifs_lprops *ret_lp, | |||
317 | lp = idx_lp; | 315 | lp = idx_lp; |
318 | 316 | ||
319 | if (lp) { | 317 | if (lp) { |
320 | ubifs_assert(lp->dirty >= c->dead_wm); | 318 | ubifs_assert(lp->free + lp->dirty >= c->dead_wm); |
321 | goto found; | 319 | goto found; |
322 | } | 320 | } |
323 | 321 | ||
diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c index d0f3dac29081..13f1019c859f 100644 --- a/fs/ubifs/gc.c +++ b/fs/ubifs/gc.c | |||
@@ -344,6 +344,12 @@ int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp) | |||
344 | if (err) | 344 | if (err) |
345 | goto out; | 345 | goto out; |
346 | 346 | ||
347 | /* Allow for races with TNC */ | ||
348 | c->gced_lnum = lnum; | ||
349 | smp_wmb(); | ||
350 | c->gc_seq += 1; | ||
351 | smp_wmb(); | ||
352 | |||
347 | if (c->gc_lnum == -1) { | 353 | if (c->gc_lnum == -1) { |
348 | c->gc_lnum = lnum; | 354 | c->gc_lnum = lnum; |
349 | err = LEB_RETAINED; | 355 | err = LEB_RETAINED; |
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 87dabf9fe742..4c12a9215d7f 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h | |||
@@ -284,38 +284,6 @@ static inline void *ubifs_idx_key(const struct ubifs_info *c, | |||
284 | } | 284 | } |
285 | 285 | ||
286 | /** | 286 | /** |
287 | * ubifs_reported_space - calculate reported free space. | ||
288 | * @c: the UBIFS file-system description object | ||
289 | * @free: amount of free space | ||
290 | * | ||
291 | * This function calculates amount of free space which will be reported to | ||
292 | * user-space. User-space application tend to expect that if the file-system | ||
293 | * (e.g., via the 'statfs()' call) reports that it has N bytes available, they | ||
294 | * are able to write a file of size N. UBIFS attaches node headers to each data | ||
295 | * node and it has to write indexind nodes as well. This introduces additional | ||
296 | * overhead, and UBIFS it has to report sligtly less free space to meet the | ||
297 | * above expectetion. | ||
298 | * | ||
299 | * This function assumes free space is made up of uncompressed data nodes and | ||
300 | * full index nodes (one per data node, doubled because we always allow enough | ||
301 | * space to write the index twice). | ||
302 | * | ||
303 | * Note, the calculation is pessimistic, which means that most of the time | ||
304 | * UBIFS reports less space than it actually has. | ||
305 | */ | ||
306 | static inline long long ubifs_reported_space(const struct ubifs_info *c, | ||
307 | uint64_t free) | ||
308 | { | ||
309 | int divisor, factor; | ||
310 | |||
311 | divisor = UBIFS_MAX_DATA_NODE_SZ + (c->max_idx_node_sz * 3); | ||
312 | factor = UBIFS_MAX_DATA_NODE_SZ - UBIFS_DATA_NODE_SZ; | ||
313 | do_div(free, divisor); | ||
314 | |||
315 | return free * factor; | ||
316 | } | ||
317 | |||
318 | /** | ||
319 | * ubifs_current_time - round current time to time granularity. | 287 | * ubifs_current_time - round current time to time granularity. |
320 | * @inode: inode | 288 | * @inode: inode |
321 | */ | 289 | */ |
@@ -325,4 +293,21 @@ static inline struct timespec ubifs_current_time(struct inode *inode) | |||
325 | current_fs_time(inode->i_sb) : CURRENT_TIME_SEC; | 293 | current_fs_time(inode->i_sb) : CURRENT_TIME_SEC; |
326 | } | 294 | } |
327 | 295 | ||
296 | /** | ||
297 | * ubifs_tnc_lookup - look up a file-system node. | ||
298 | * @c: UBIFS file-system description object | ||
299 | * @key: node key to lookup | ||
300 | * @node: the node is returned here | ||
301 | * | ||
302 | * This function look up and reads node with key @key. The caller has to make | ||
303 | * sure the @node buffer is large enough to fit the node. Returns zero in case | ||
304 | * of success, %-ENOENT if the node was not found, and a negative error code in | ||
305 | * case of failure. | ||
306 | */ | ||
307 | static inline int ubifs_tnc_lookup(struct ubifs_info *c, | ||
308 | const union ubifs_key *key, void *node) | ||
309 | { | ||
310 | return ubifs_tnc_locate(c, key, node, NULL, NULL); | ||
311 | } | ||
312 | |||
328 | #endif /* __UBIFS_MISC_H__ */ | 313 | #endif /* __UBIFS_MISC_H__ */ |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index f71e6b8822c4..7562464ac83f 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -370,8 +370,9 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
370 | { | 370 | { |
371 | struct ubifs_info *c = dentry->d_sb->s_fs_info; | 371 | struct ubifs_info *c = dentry->d_sb->s_fs_info; |
372 | unsigned long long free; | 372 | unsigned long long free; |
373 | __le32 *uuid = (__le32 *)c->uuid; | ||
373 | 374 | ||
374 | free = ubifs_budg_get_free_space(c); | 375 | free = ubifs_get_free_space(c); |
375 | dbg_gen("free space %lld bytes (%lld blocks)", | 376 | dbg_gen("free space %lld bytes (%lld blocks)", |
376 | free, free >> UBIFS_BLOCK_SHIFT); | 377 | free, free >> UBIFS_BLOCK_SHIFT); |
377 | 378 | ||
@@ -386,7 +387,8 @@ static int ubifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
386 | buf->f_files = 0; | 387 | buf->f_files = 0; |
387 | buf->f_ffree = 0; | 388 | buf->f_ffree = 0; |
388 | buf->f_namelen = UBIFS_MAX_NLEN; | 389 | buf->f_namelen = UBIFS_MAX_NLEN; |
389 | 390 | buf->f_fsid.val[0] = le32_to_cpu(uuid[0]) ^ le32_to_cpu(uuid[2]); | |
391 | buf->f_fsid.val[1] = le32_to_cpu(uuid[1]) ^ le32_to_cpu(uuid[3]); | ||
390 | return 0; | 392 | return 0; |
391 | } | 393 | } |
392 | 394 | ||
@@ -530,6 +532,12 @@ static int init_constants_early(struct ubifs_info *c) | |||
530 | c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); | 532 | c->dead_wm = ALIGN(MIN_WRITE_SZ, c->min_io_size); |
531 | c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); | 533 | c->dark_wm = ALIGN(UBIFS_MAX_NODE_SZ, c->min_io_size); |
532 | 534 | ||
535 | /* | ||
536 | * Calculate how many bytes would be wasted at the end of LEB if it was | ||
537 | * fully filled with data nodes of maximum size. This is used in | ||
538 | * calculations when reporting free space. | ||
539 | */ | ||
540 | c->leb_overhead = c->leb_size % UBIFS_MAX_DATA_NODE_SZ; | ||
533 | return 0; | 541 | return 0; |
534 | } | 542 | } |
535 | 543 | ||
@@ -647,13 +655,11 @@ static int init_constants_late(struct ubifs_info *c) | |||
647 | * internally because it does not make much sense for UBIFS, but it is | 655 | * internally because it does not make much sense for UBIFS, but it is |
648 | * necessary to report something for the 'statfs()' call. | 656 | * necessary to report something for the 'statfs()' call. |
649 | * | 657 | * |
650 | * Subtract the LEB reserved for GC and the LEB which is reserved for | 658 | * Subtract the LEB reserved for GC, the LEB which is reserved for |
651 | * deletions. | 659 | * deletions, and assume only one journal head is available. |
652 | * | ||
653 | * Review 'ubifs_calc_available()' if changing this calculation. | ||
654 | */ | 660 | */ |
655 | tmp64 = c->main_lebs - 2; | 661 | tmp64 = c->main_lebs - 2 - c->jhead_cnt + 1; |
656 | tmp64 *= (uint64_t)c->leb_size - c->dark_wm; | 662 | tmp64 *= (uint64_t)c->leb_size - c->leb_overhead; |
657 | tmp64 = ubifs_reported_space(c, tmp64); | 663 | tmp64 = ubifs_reported_space(c, tmp64); |
658 | c->block_cnt = tmp64 >> UBIFS_BLOCK_SHIFT; | 664 | c->block_cnt = tmp64 >> UBIFS_BLOCK_SHIFT; |
659 | 665 | ||
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index e909f4a96443..7da209ab9378 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c | |||
@@ -506,7 +506,7 @@ static int fallible_read_node(struct ubifs_info *c, const union ubifs_key *key, | |||
506 | if (keys_cmp(c, key, &node_key) != 0) | 506 | if (keys_cmp(c, key, &node_key) != 0) |
507 | ret = 0; | 507 | ret = 0; |
508 | } | 508 | } |
509 | if (ret == 0) | 509 | if (ret == 0 && c->replaying) |
510 | dbg_mnt("dangling branch LEB %d:%d len %d, key %s", | 510 | dbg_mnt("dangling branch LEB %d:%d len %d, key %s", |
511 | zbr->lnum, zbr->offs, zbr->len, DBGKEY(key)); | 511 | zbr->lnum, zbr->offs, zbr->len, DBGKEY(key)); |
512 | return ret; | 512 | return ret; |
@@ -1382,50 +1382,39 @@ static int lookup_level0_dirty(struct ubifs_info *c, const union ubifs_key *key, | |||
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | /** | 1384 | /** |
1385 | * ubifs_tnc_lookup - look up a file-system node. | 1385 | * maybe_leb_gced - determine if a LEB may have been garbage collected. |
1386 | * @c: UBIFS file-system description object | 1386 | * @c: UBIFS file-system description object |
1387 | * @key: node key to lookup | 1387 | * @lnum: LEB number |
1388 | * @node: the node is returned here | 1388 | * @gc_seq1: garbage collection sequence number |
1389 | * | 1389 | * |
1390 | * This function look up and reads node with key @key. The caller has to make | 1390 | * This function determines if @lnum may have been garbage collected since |
1391 | * sure the @node buffer is large enough to fit the node. Returns zero in case | 1391 | * sequence number @gc_seq1. If it may have been then %1 is returned, otherwise |
1392 | * of success, %-ENOENT if the node was not found, and a negative error code in | 1392 | * %0 is returned. |
1393 | * case of failure. | ||
1394 | */ | 1393 | */ |
1395 | int ubifs_tnc_lookup(struct ubifs_info *c, const union ubifs_key *key, | 1394 | static int maybe_leb_gced(struct ubifs_info *c, int lnum, int gc_seq1) |
1396 | void *node) | ||
1397 | { | 1395 | { |
1398 | int found, n, err; | 1396 | int gc_seq2, gced_lnum; |
1399 | struct ubifs_znode *znode; | ||
1400 | struct ubifs_zbranch zbr, *zt; | ||
1401 | 1397 | ||
1402 | mutex_lock(&c->tnc_mutex); | 1398 | gced_lnum = c->gced_lnum; |
1403 | found = ubifs_lookup_level0(c, key, &znode, &n); | 1399 | smp_rmb(); |
1404 | if (!found) { | 1400 | gc_seq2 = c->gc_seq; |
1405 | err = -ENOENT; | 1401 | /* Same seq means no GC */ |
1406 | goto out; | 1402 | if (gc_seq1 == gc_seq2) |
1407 | } else if (found < 0) { | 1403 | return 0; |
1408 | err = found; | 1404 | /* Different by more than 1 means we don't know */ |
1409 | goto out; | 1405 | if (gc_seq1 + 1 != gc_seq2) |
1410 | } | 1406 | return 1; |
1411 | zt = &znode->zbranch[n]; | 1407 | /* |
1412 | if (is_hash_key(c, key)) { | 1408 | * We have seen the sequence number has increased by 1. Now we need to |
1413 | /* | 1409 | * be sure we read the right LEB number, so read it again. |
1414 | * In this case the leaf node cache gets used, so we pass the | 1410 | */ |
1415 | * address of the zbranch and keep the mutex locked | 1411 | smp_rmb(); |
1416 | */ | 1412 | if (gced_lnum != c->gced_lnum) |
1417 | err = tnc_read_node_nm(c, zt, node); | 1413 | return 1; |
1418 | goto out; | 1414 | /* Finally we can check lnum */ |
1419 | } | 1415 | if (gced_lnum == lnum) |
1420 | zbr = znode->zbranch[n]; | 1416 | return 1; |
1421 | mutex_unlock(&c->tnc_mutex); | 1417 | return 0; |
1422 | |||
1423 | err = ubifs_tnc_read_node(c, &zbr, node); | ||
1424 | return err; | ||
1425 | |||
1426 | out: | ||
1427 | mutex_unlock(&c->tnc_mutex); | ||
1428 | return err; | ||
1429 | } | 1418 | } |
1430 | 1419 | ||
1431 | /** | 1420 | /** |
@@ -1436,16 +1425,19 @@ out: | |||
1436 | * @lnum: LEB number is returned here | 1425 | * @lnum: LEB number is returned here |
1437 | * @offs: offset is returned here | 1426 | * @offs: offset is returned here |
1438 | * | 1427 | * |
1439 | * This function is the same as 'ubifs_tnc_lookup()' but it returns the node | 1428 | * This function look up and reads node with key @key. The caller has to make |
1440 | * location also. See 'ubifs_tnc_lookup()'. | 1429 | * sure the @node buffer is large enough to fit the node. Returns zero in case |
1430 | * of success, %-ENOENT if the node was not found, and a negative error code in | ||
1431 | * case of failure. The node location can be returned in @lnum and @offs. | ||
1441 | */ | 1432 | */ |
1442 | int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key, | 1433 | int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key, |
1443 | void *node, int *lnum, int *offs) | 1434 | void *node, int *lnum, int *offs) |
1444 | { | 1435 | { |
1445 | int found, n, err; | 1436 | int found, n, err, safely = 0, gc_seq1; |
1446 | struct ubifs_znode *znode; | 1437 | struct ubifs_znode *znode; |
1447 | struct ubifs_zbranch zbr, *zt; | 1438 | struct ubifs_zbranch zbr, *zt; |
1448 | 1439 | ||
1440 | again: | ||
1449 | mutex_lock(&c->tnc_mutex); | 1441 | mutex_lock(&c->tnc_mutex); |
1450 | found = ubifs_lookup_level0(c, key, &znode, &n); | 1442 | found = ubifs_lookup_level0(c, key, &znode, &n); |
1451 | if (!found) { | 1443 | if (!found) { |
@@ -1456,24 +1448,43 @@ int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key, | |||
1456 | goto out; | 1448 | goto out; |
1457 | } | 1449 | } |
1458 | zt = &znode->zbranch[n]; | 1450 | zt = &znode->zbranch[n]; |
1451 | if (lnum) { | ||
1452 | *lnum = zt->lnum; | ||
1453 | *offs = zt->offs; | ||
1454 | } | ||
1459 | if (is_hash_key(c, key)) { | 1455 | if (is_hash_key(c, key)) { |
1460 | /* | 1456 | /* |
1461 | * In this case the leaf node cache gets used, so we pass the | 1457 | * In this case the leaf node cache gets used, so we pass the |
1462 | * address of the zbranch and keep the mutex locked | 1458 | * address of the zbranch and keep the mutex locked |
1463 | */ | 1459 | */ |
1464 | *lnum = zt->lnum; | ||
1465 | *offs = zt->offs; | ||
1466 | err = tnc_read_node_nm(c, zt, node); | 1460 | err = tnc_read_node_nm(c, zt, node); |
1467 | goto out; | 1461 | goto out; |
1468 | } | 1462 | } |
1463 | if (safely) { | ||
1464 | err = ubifs_tnc_read_node(c, zt, node); | ||
1465 | goto out; | ||
1466 | } | ||
1467 | /* Drop the TNC mutex prematurely and race with garbage collection */ | ||
1469 | zbr = znode->zbranch[n]; | 1468 | zbr = znode->zbranch[n]; |
1469 | gc_seq1 = c->gc_seq; | ||
1470 | mutex_unlock(&c->tnc_mutex); | 1470 | mutex_unlock(&c->tnc_mutex); |
1471 | 1471 | ||
1472 | *lnum = zbr.lnum; | 1472 | if (ubifs_get_wbuf(c, zbr.lnum)) { |
1473 | *offs = zbr.offs; | 1473 | /* We do not GC journal heads */ |
1474 | err = ubifs_tnc_read_node(c, &zbr, node); | ||
1475 | return err; | ||
1476 | } | ||
1474 | 1477 | ||
1475 | err = ubifs_tnc_read_node(c, &zbr, node); | 1478 | err = fallible_read_node(c, key, &zbr, node); |
1476 | return err; | 1479 | if (maybe_leb_gced(c, zbr.lnum, gc_seq1)) { |
1480 | /* | ||
1481 | * The node may have been GC'ed out from under us so try again | ||
1482 | * while keeping the TNC mutex locked. | ||
1483 | */ | ||
1484 | safely = 1; | ||
1485 | goto again; | ||
1486 | } | ||
1487 | return 0; | ||
1477 | 1488 | ||
1478 | out: | 1489 | out: |
1479 | mutex_unlock(&c->tnc_mutex); | 1490 | mutex_unlock(&c->tnc_mutex); |
@@ -1498,7 +1509,6 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, | |||
1498 | { | 1509 | { |
1499 | int found, n, err; | 1510 | int found, n, err; |
1500 | struct ubifs_znode *znode; | 1511 | struct ubifs_znode *znode; |
1501 | struct ubifs_zbranch zbr; | ||
1502 | 1512 | ||
1503 | dbg_tnc("name '%.*s' key %s", nm->len, nm->name, DBGKEY(key)); | 1513 | dbg_tnc("name '%.*s' key %s", nm->len, nm->name, DBGKEY(key)); |
1504 | mutex_lock(&c->tnc_mutex); | 1514 | mutex_lock(&c->tnc_mutex); |
@@ -1522,11 +1532,7 @@ static int do_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, | |||
1522 | goto out_unlock; | 1532 | goto out_unlock; |
1523 | } | 1533 | } |
1524 | 1534 | ||
1525 | zbr = znode->zbranch[n]; | 1535 | err = tnc_read_node_nm(c, &znode->zbranch[n], node); |
1526 | mutex_unlock(&c->tnc_mutex); | ||
1527 | |||
1528 | err = tnc_read_node_nm(c, &zbr, node); | ||
1529 | return err; | ||
1530 | 1536 | ||
1531 | out_unlock: | 1537 | out_unlock: |
1532 | mutex_unlock(&c->tnc_mutex); | 1538 | mutex_unlock(&c->tnc_mutex); |
diff --git a/fs/ubifs/ubifs-media.h b/fs/ubifs/ubifs-media.h index bd2121f3426e..a9ecbd9af20d 100644 --- a/fs/ubifs/ubifs-media.h +++ b/fs/ubifs/ubifs-media.h | |||
@@ -87,7 +87,7 @@ | |||
87 | #define UBIFS_SK_LEN 8 | 87 | #define UBIFS_SK_LEN 8 |
88 | 88 | ||
89 | /* Minimum index tree fanout */ | 89 | /* Minimum index tree fanout */ |
90 | #define UBIFS_MIN_FANOUT 2 | 90 | #define UBIFS_MIN_FANOUT 3 |
91 | 91 | ||
92 | /* Maximum number of levels in UBIFS indexing B-tree */ | 92 | /* Maximum number of levels in UBIFS indexing B-tree */ |
93 | #define UBIFS_MAX_LEVELS 512 | 93 | #define UBIFS_MAX_LEVELS 512 |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index d7f706f7a302..17c620b93eec 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -995,6 +995,9 @@ struct ubifs_mount_opts { | |||
995 | * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary | 995 | * @max_idx_node_sz: maximum indexing node aligned on 8-bytes boundary |
996 | * @max_inode_sz: maximum possible inode size in bytes | 996 | * @max_inode_sz: maximum possible inode size in bytes |
997 | * @max_znode_sz: size of znode in bytes | 997 | * @max_znode_sz: size of znode in bytes |
998 | * | ||
999 | * @leb_overhead: how many bytes are wasted in an LEB when it is filled with | ||
1000 | * data nodes of maximum size - used in free space reporting | ||
998 | * @dead_wm: LEB dead space watermark | 1001 | * @dead_wm: LEB dead space watermark |
999 | * @dark_wm: LEB dark space watermark | 1002 | * @dark_wm: LEB dark space watermark |
1000 | * @block_cnt: count of 4KiB blocks on the FS | 1003 | * @block_cnt: count of 4KiB blocks on the FS |
@@ -1028,6 +1031,8 @@ struct ubifs_mount_opts { | |||
1028 | * @sbuf: a buffer of LEB size used by GC and replay for scanning | 1031 | * @sbuf: a buffer of LEB size used by GC and replay for scanning |
1029 | * @idx_gc: list of index LEBs that have been garbage collected | 1032 | * @idx_gc: list of index LEBs that have been garbage collected |
1030 | * @idx_gc_cnt: number of elements on the idx_gc list | 1033 | * @idx_gc_cnt: number of elements on the idx_gc list |
1034 | * @gc_seq: incremented for every non-index LEB garbage collected | ||
1035 | * @gced_lnum: last non-index LEB that was garbage collected | ||
1031 | * | 1036 | * |
1032 | * @infos_list: links all 'ubifs_info' objects | 1037 | * @infos_list: links all 'ubifs_info' objects |
1033 | * @umount_mutex: serializes shrinker and un-mount | 1038 | * @umount_mutex: serializes shrinker and un-mount |
@@ -1224,6 +1229,8 @@ struct ubifs_info { | |||
1224 | int max_idx_node_sz; | 1229 | int max_idx_node_sz; |
1225 | long long max_inode_sz; | 1230 | long long max_inode_sz; |
1226 | int max_znode_sz; | 1231 | int max_znode_sz; |
1232 | |||
1233 | int leb_overhead; | ||
1227 | int dead_wm; | 1234 | int dead_wm; |
1228 | int dark_wm; | 1235 | int dark_wm; |
1229 | int block_cnt; | 1236 | int block_cnt; |
@@ -1257,6 +1264,8 @@ struct ubifs_info { | |||
1257 | void *sbuf; | 1264 | void *sbuf; |
1258 | struct list_head idx_gc; | 1265 | struct list_head idx_gc; |
1259 | int idx_gc_cnt; | 1266 | int idx_gc_cnt; |
1267 | volatile int gc_seq; | ||
1268 | volatile int gced_lnum; | ||
1260 | 1269 | ||
1261 | struct list_head infos_list; | 1270 | struct list_head infos_list; |
1262 | struct mutex umount_mutex; | 1271 | struct mutex umount_mutex; |
@@ -1434,9 +1443,10 @@ void ubifs_release_ino_dirty(struct ubifs_info *c, struct inode *inode, | |||
1434 | struct ubifs_budget_req *req); | 1443 | struct ubifs_budget_req *req); |
1435 | void ubifs_cancel_ino_op(struct ubifs_info *c, struct inode *inode, | 1444 | void ubifs_cancel_ino_op(struct ubifs_info *c, struct inode *inode, |
1436 | struct ubifs_budget_req *req); | 1445 | struct ubifs_budget_req *req); |
1437 | long long ubifs_budg_get_free_space(struct ubifs_info *c); | 1446 | long long ubifs_get_free_space(struct ubifs_info *c); |
1438 | int ubifs_calc_min_idx_lebs(struct ubifs_info *c); | 1447 | int ubifs_calc_min_idx_lebs(struct ubifs_info *c); |
1439 | void ubifs_convert_page_budget(struct ubifs_info *c); | 1448 | void ubifs_convert_page_budget(struct ubifs_info *c); |
1449 | long long ubifs_reported_space(const struct ubifs_info *c, uint64_t free); | ||
1440 | long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs); | 1450 | long long ubifs_calc_available(const struct ubifs_info *c, int min_idx_lebs); |
1441 | 1451 | ||
1442 | /* find.c */ | 1452 | /* find.c */ |
@@ -1451,8 +1461,6 @@ int ubifs_save_dirty_idx_lnums(struct ubifs_info *c); | |||
1451 | /* tnc.c */ | 1461 | /* tnc.c */ |
1452 | int ubifs_lookup_level0(struct ubifs_info *c, const union ubifs_key *key, | 1462 | int ubifs_lookup_level0(struct ubifs_info *c, const union ubifs_key *key, |
1453 | struct ubifs_znode **zn, int *n); | 1463 | struct ubifs_znode **zn, int *n); |
1454 | int ubifs_tnc_lookup(struct ubifs_info *c, const union ubifs_key *key, | ||
1455 | void *node); | ||
1456 | int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, | 1464 | int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key, |
1457 | void *node, const struct qstr *nm); | 1465 | void *node, const struct qstr *nm); |
1458 | int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key, | 1466 | int ubifs_tnc_locate(struct ubifs_info *c, const union ubifs_key *key, |
diff --git a/fs/udf/file.c b/fs/udf/file.c index 0ed6e146a0d9..eb91f3b70320 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -211,6 +211,7 @@ const struct file_operations udf_file_operations = { | |||
211 | .release = udf_release_file, | 211 | .release = udf_release_file, |
212 | .fsync = udf_fsync_file, | 212 | .fsync = udf_fsync_file, |
213 | .splice_read = generic_file_splice_read, | 213 | .splice_read = generic_file_splice_read, |
214 | .llseek = generic_file_llseek, | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | const struct inode_operations udf_file_inode_operations = { | 217 | const struct inode_operations udf_file_inode_operations = { |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index eb9cfa23dc3d..a4f2b3ce45b0 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -76,11 +76,24 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
76 | *err = -ENOSPC; | 76 | *err = -ENOSPC; |
77 | 77 | ||
78 | iinfo = UDF_I(inode); | 78 | iinfo = UDF_I(inode); |
79 | iinfo->i_unique = 0; | 79 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { |
80 | iinfo->i_lenExtents = 0; | 80 | iinfo->i_efe = 1; |
81 | iinfo->i_next_alloc_block = 0; | 81 | if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) |
82 | iinfo->i_next_alloc_goal = 0; | 82 | sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; |
83 | iinfo->i_strat4096 = 0; | 83 | iinfo->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize - |
84 | sizeof(struct extendedFileEntry), | ||
85 | GFP_KERNEL); | ||
86 | } else { | ||
87 | iinfo->i_efe = 0; | ||
88 | iinfo->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize - | ||
89 | sizeof(struct fileEntry), | ||
90 | GFP_KERNEL); | ||
91 | } | ||
92 | if (!iinfo->i_ext.i_data) { | ||
93 | iput(inode); | ||
94 | *err = -ENOMEM; | ||
95 | return NULL; | ||
96 | } | ||
84 | 97 | ||
85 | block = udf_new_block(dir->i_sb, NULL, | 98 | block = udf_new_block(dir->i_sb, NULL, |
86 | dinfo->i_location.partitionReferenceNum, | 99 | dinfo->i_location.partitionReferenceNum, |
@@ -111,6 +124,7 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
111 | lvhd->uniqueID = cpu_to_le64(uniqueID); | 124 | lvhd->uniqueID = cpu_to_le64(uniqueID); |
112 | mark_buffer_dirty(sbi->s_lvid_bh); | 125 | mark_buffer_dirty(sbi->s_lvid_bh); |
113 | } | 126 | } |
127 | mutex_unlock(&sbi->s_alloc_mutex); | ||
114 | inode->i_mode = mode; | 128 | inode->i_mode = mode; |
115 | inode->i_uid = current->fsuid; | 129 | inode->i_uid = current->fsuid; |
116 | if (dir->i_mode & S_ISGID) { | 130 | if (dir->i_mode & S_ISGID) { |
@@ -129,25 +143,6 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
129 | iinfo->i_lenEAttr = 0; | 143 | iinfo->i_lenEAttr = 0; |
130 | iinfo->i_lenAlloc = 0; | 144 | iinfo->i_lenAlloc = 0; |
131 | iinfo->i_use = 0; | 145 | iinfo->i_use = 0; |
132 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_EXTENDED_FE)) { | ||
133 | iinfo->i_efe = 1; | ||
134 | if (UDF_VERS_USE_EXTENDED_FE > sbi->s_udfrev) | ||
135 | sbi->s_udfrev = UDF_VERS_USE_EXTENDED_FE; | ||
136 | iinfo->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize - | ||
137 | sizeof(struct extendedFileEntry), | ||
138 | GFP_KERNEL); | ||
139 | } else { | ||
140 | iinfo->i_efe = 0; | ||
141 | iinfo->i_ext.i_data = kzalloc(inode->i_sb->s_blocksize - | ||
142 | sizeof(struct fileEntry), | ||
143 | GFP_KERNEL); | ||
144 | } | ||
145 | if (!iinfo->i_ext.i_data) { | ||
146 | iput(inode); | ||
147 | *err = -ENOMEM; | ||
148 | mutex_unlock(&sbi->s_alloc_mutex); | ||
149 | return NULL; | ||
150 | } | ||
151 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) | 146 | if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_AD_IN_ICB)) |
152 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; | 147 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; |
153 | else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) | 148 | else if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_USE_SHORT_AD)) |
@@ -158,7 +153,6 @@ struct inode *udf_new_inode(struct inode *dir, int mode, int *err) | |||
158 | iinfo->i_crtime = current_fs_time(inode->i_sb); | 153 | iinfo->i_crtime = current_fs_time(inode->i_sb); |
159 | insert_inode_hash(inode); | 154 | insert_inode_hash(inode); |
160 | mark_inode_dirty(inode); | 155 | mark_inode_dirty(inode); |
161 | mutex_unlock(&sbi->s_alloc_mutex); | ||
162 | 156 | ||
163 | if (DQUOT_ALLOC_INODE(inode)) { | 157 | if (DQUOT_ALLOC_INODE(inode)) { |
164 | DQUOT_DROP(inode); | 158 | DQUOT_DROP(inode); |
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index f42f80a3b1fa..a44d68eb50b5 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -1338,6 +1338,10 @@ __xfs_get_blocks( | |||
1338 | offset = (xfs_off_t)iblock << inode->i_blkbits; | 1338 | offset = (xfs_off_t)iblock << inode->i_blkbits; |
1339 | ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); | 1339 | ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); |
1340 | size = bh_result->b_size; | 1340 | size = bh_result->b_size; |
1341 | |||
1342 | if (!create && direct && offset >= i_size_read(inode)) | ||
1343 | return 0; | ||
1344 | |||
1341 | error = xfs_iomap(XFS_I(inode), offset, size, | 1345 | error = xfs_iomap(XFS_I(inode), offset, size, |
1342 | create ? flags : BMAPI_READ, &iomap, &niomap); | 1346 | create ? flags : BMAPI_READ, &iomap, &niomap); |
1343 | if (error) | 1347 | if (error) |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 73c65f19e549..18d3c8487835 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1302,9 +1302,29 @@ xfs_fs_remount( | |||
1302 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 1302 | mp->m_flags &= ~XFS_MOUNT_BARRIER; |
1303 | break; | 1303 | break; |
1304 | default: | 1304 | default: |
1305 | /* | ||
1306 | * Logically we would return an error here to prevent | ||
1307 | * users from believing they might have changed | ||
1308 | * mount options using remount which can't be changed. | ||
1309 | * | ||
1310 | * But unfortunately mount(8) adds all options from | ||
1311 | * mtab and fstab to the mount arguments in some cases | ||
1312 | * so we can't blindly reject options, but have to | ||
1313 | * check for each specified option if it actually | ||
1314 | * differs from the currently set option and only | ||
1315 | * reject it if that's the case. | ||
1316 | * | ||
1317 | * Until that is implemented we return success for | ||
1318 | * every remount request, and silently ignore all | ||
1319 | * options that we can't actually change. | ||
1320 | */ | ||
1321 | #if 0 | ||
1305 | printk(KERN_INFO | 1322 | printk(KERN_INFO |
1306 | "XFS: mount option \"%s\" not supported for remount\n", p); | 1323 | "XFS: mount option \"%s\" not supported for remount\n", p); |
1307 | return -EINVAL; | 1324 | return -EINVAL; |
1325 | #else | ||
1326 | return 0; | ||
1327 | #endif | ||
1308 | } | 1328 | } |
1309 | } | 1329 | } |
1310 | 1330 | ||
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 608c30c3f76b..002fc2617c8e 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -732,6 +732,7 @@ xfs_buf_item_init( | |||
732 | bip->bli_item.li_ops = &xfs_buf_item_ops; | 732 | bip->bli_item.li_ops = &xfs_buf_item_ops; |
733 | bip->bli_item.li_mountp = mp; | 733 | bip->bli_item.li_mountp = mp; |
734 | bip->bli_buf = bp; | 734 | bip->bli_buf = bp; |
735 | xfs_buf_hold(bp); | ||
735 | bip->bli_format.blf_type = XFS_LI_BUF; | 736 | bip->bli_format.blf_type = XFS_LI_BUF; |
736 | bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp); | 737 | bip->bli_format.blf_blkno = (__int64_t)XFS_BUF_ADDR(bp); |
737 | bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); | 738 | bip->bli_format.blf_len = (ushort)BTOBB(XFS_BUF_COUNT(bp)); |
@@ -867,6 +868,21 @@ xfs_buf_item_dirty( | |||
867 | return (bip->bli_flags & XFS_BLI_DIRTY); | 868 | return (bip->bli_flags & XFS_BLI_DIRTY); |
868 | } | 869 | } |
869 | 870 | ||
871 | STATIC void | ||
872 | xfs_buf_item_free( | ||
873 | xfs_buf_log_item_t *bip) | ||
874 | { | ||
875 | #ifdef XFS_TRANS_DEBUG | ||
876 | kmem_free(bip->bli_orig); | ||
877 | kmem_free(bip->bli_logged); | ||
878 | #endif /* XFS_TRANS_DEBUG */ | ||
879 | |||
880 | #ifdef XFS_BLI_TRACE | ||
881 | ktrace_free(bip->bli_trace); | ||
882 | #endif | ||
883 | kmem_zone_free(xfs_buf_item_zone, bip); | ||
884 | } | ||
885 | |||
870 | /* | 886 | /* |
871 | * This is called when the buf log item is no longer needed. It should | 887 | * This is called when the buf log item is no longer needed. It should |
872 | * free the buf log item associated with the given buffer and clear | 888 | * free the buf log item associated with the given buffer and clear |
@@ -887,18 +903,8 @@ xfs_buf_item_relse( | |||
887 | (XFS_BUF_IODONE_FUNC(bp) != NULL)) { | 903 | (XFS_BUF_IODONE_FUNC(bp) != NULL)) { |
888 | XFS_BUF_CLR_IODONE_FUNC(bp); | 904 | XFS_BUF_CLR_IODONE_FUNC(bp); |
889 | } | 905 | } |
890 | 906 | xfs_buf_rele(bp); | |
891 | #ifdef XFS_TRANS_DEBUG | 907 | xfs_buf_item_free(bip); |
892 | kmem_free(bip->bli_orig); | ||
893 | bip->bli_orig = NULL; | ||
894 | kmem_free(bip->bli_logged); | ||
895 | bip->bli_logged = NULL; | ||
896 | #endif /* XFS_TRANS_DEBUG */ | ||
897 | |||
898 | #ifdef XFS_BLI_TRACE | ||
899 | ktrace_free(bip->bli_trace); | ||
900 | #endif | ||
901 | kmem_zone_free(xfs_buf_item_zone, bip); | ||
902 | } | 908 | } |
903 | 909 | ||
904 | 910 | ||
@@ -1120,6 +1126,7 @@ xfs_buf_iodone( | |||
1120 | 1126 | ||
1121 | ASSERT(bip->bli_buf == bp); | 1127 | ASSERT(bip->bli_buf == bp); |
1122 | 1128 | ||
1129 | xfs_buf_rele(bp); | ||
1123 | mp = bip->bli_item.li_mountp; | 1130 | mp = bip->bli_item.li_mountp; |
1124 | 1131 | ||
1125 | /* | 1132 | /* |
@@ -1136,18 +1143,7 @@ xfs_buf_iodone( | |||
1136 | * xfs_trans_delete_ail() drops the AIL lock. | 1143 | * xfs_trans_delete_ail() drops the AIL lock. |
1137 | */ | 1144 | */ |
1138 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); | 1145 | xfs_trans_delete_ail(mp, (xfs_log_item_t *)bip); |
1139 | 1146 | xfs_buf_item_free(bip); | |
1140 | #ifdef XFS_TRANS_DEBUG | ||
1141 | kmem_free(bip->bli_orig); | ||
1142 | bip->bli_orig = NULL; | ||
1143 | kmem_free(bip->bli_logged); | ||
1144 | bip->bli_logged = NULL; | ||
1145 | #endif /* XFS_TRANS_DEBUG */ | ||
1146 | |||
1147 | #ifdef XFS_BLI_TRACE | ||
1148 | ktrace_free(bip->bli_trace); | ||
1149 | #endif | ||
1150 | kmem_zone_free(xfs_buf_item_zone, bip); | ||
1151 | } | 1147 | } |
1152 | 1148 | ||
1153 | #if defined(XFS_BLI_TRACE) | 1149 | #if defined(XFS_BLI_TRACE) |
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 760f4c5b5160..75b0cd4da0ea 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
@@ -149,7 +149,14 @@ xfs_swap_extents( | |||
149 | 149 | ||
150 | sbp = &sxp->sx_stat; | 150 | sbp = &sxp->sx_stat; |
151 | 151 | ||
152 | xfs_lock_two_inodes(ip, tip, lock_flags); | 152 | /* |
153 | * we have to do two separate lock calls here to keep lockdep | ||
154 | * happy. If we try to get all the locks in one call, lock will | ||
155 | * report false positives when we drop the ILOCK and regain them | ||
156 | * below. | ||
157 | */ | ||
158 | xfs_lock_two_inodes(ip, tip, XFS_IOLOCK_EXCL); | ||
159 | xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); | ||
153 | locked = 1; | 160 | locked = 1; |
154 | 161 | ||
155 | /* Verify that both files have the same format */ | 162 | /* Verify that both files have the same format */ |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index ccba14eb9dbe..503ea89e8b9a 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -124,16 +124,27 @@ STATIC void xlog_verify_tail_lsn(xlog_t *log, xlog_in_core_t *iclog, | |||
124 | STATIC int xlog_iclogs_empty(xlog_t *log); | 124 | STATIC int xlog_iclogs_empty(xlog_t *log); |
125 | 125 | ||
126 | #if defined(XFS_LOG_TRACE) | 126 | #if defined(XFS_LOG_TRACE) |
127 | |||
128 | #define XLOG_TRACE_LOGGRANT_SIZE 2048 | ||
129 | #define XLOG_TRACE_ICLOG_SIZE 256 | ||
130 | |||
131 | void | ||
132 | xlog_trace_loggrant_alloc(xlog_t *log) | ||
133 | { | ||
134 | log->l_grant_trace = ktrace_alloc(XLOG_TRACE_LOGGRANT_SIZE, KM_NOFS); | ||
135 | } | ||
136 | |||
137 | void | ||
138 | xlog_trace_loggrant_dealloc(xlog_t *log) | ||
139 | { | ||
140 | ktrace_free(log->l_grant_trace); | ||
141 | } | ||
142 | |||
127 | void | 143 | void |
128 | xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) | 144 | xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) |
129 | { | 145 | { |
130 | unsigned long cnts; | 146 | unsigned long cnts; |
131 | 147 | ||
132 | if (!log->l_grant_trace) { | ||
133 | log->l_grant_trace = ktrace_alloc(2048, KM_NOSLEEP); | ||
134 | if (!log->l_grant_trace) | ||
135 | return; | ||
136 | } | ||
137 | /* ticket counts are 1 byte each */ | 148 | /* ticket counts are 1 byte each */ |
138 | cnts = ((unsigned long)tic->t_ocnt) | ((unsigned long)tic->t_cnt) << 8; | 149 | cnts = ((unsigned long)tic->t_ocnt) | ((unsigned long)tic->t_cnt) << 8; |
139 | 150 | ||
@@ -157,10 +168,20 @@ xlog_trace_loggrant(xlog_t *log, xlog_ticket_t *tic, xfs_caddr_t string) | |||
157 | } | 168 | } |
158 | 169 | ||
159 | void | 170 | void |
171 | xlog_trace_iclog_alloc(xlog_in_core_t *iclog) | ||
172 | { | ||
173 | iclog->ic_trace = ktrace_alloc(XLOG_TRACE_ICLOG_SIZE, KM_NOFS); | ||
174 | } | ||
175 | |||
176 | void | ||
177 | xlog_trace_iclog_dealloc(xlog_in_core_t *iclog) | ||
178 | { | ||
179 | ktrace_free(iclog->ic_trace); | ||
180 | } | ||
181 | |||
182 | void | ||
160 | xlog_trace_iclog(xlog_in_core_t *iclog, uint state) | 183 | xlog_trace_iclog(xlog_in_core_t *iclog, uint state) |
161 | { | 184 | { |
162 | if (!iclog->ic_trace) | ||
163 | iclog->ic_trace = ktrace_alloc(256, KM_NOFS); | ||
164 | ktrace_enter(iclog->ic_trace, | 185 | ktrace_enter(iclog->ic_trace, |
165 | (void *)((unsigned long)state), | 186 | (void *)((unsigned long)state), |
166 | (void *)((unsigned long)current_pid()), | 187 | (void *)((unsigned long)current_pid()), |
@@ -170,8 +191,15 @@ xlog_trace_iclog(xlog_in_core_t *iclog, uint state) | |||
170 | (void *)NULL, (void *)NULL); | 191 | (void *)NULL, (void *)NULL); |
171 | } | 192 | } |
172 | #else | 193 | #else |
194 | |||
195 | #define xlog_trace_loggrant_alloc(log) | ||
196 | #define xlog_trace_loggrant_dealloc(log) | ||
173 | #define xlog_trace_loggrant(log,tic,string) | 197 | #define xlog_trace_loggrant(log,tic,string) |
198 | |||
199 | #define xlog_trace_iclog_alloc(iclog) | ||
200 | #define xlog_trace_iclog_dealloc(iclog) | ||
174 | #define xlog_trace_iclog(iclog,state) | 201 | #define xlog_trace_iclog(iclog,state) |
202 | |||
175 | #endif /* XFS_LOG_TRACE */ | 203 | #endif /* XFS_LOG_TRACE */ |
176 | 204 | ||
177 | 205 | ||
@@ -1009,7 +1037,7 @@ xlog_iodone(xfs_buf_t *bp) | |||
1009 | * layer, it means the underlyin device no longer supports | 1037 | * layer, it means the underlyin device no longer supports |
1010 | * barrier I/O. Warn loudly and turn off barriers. | 1038 | * barrier I/O. Warn loudly and turn off barriers. |
1011 | */ | 1039 | */ |
1012 | if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ORDERED(bp)) { | 1040 | if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ISORDERED(bp)) { |
1013 | l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; | 1041 | l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER; |
1014 | xfs_fs_cmn_err(CE_WARN, l->l_mp, | 1042 | xfs_fs_cmn_err(CE_WARN, l->l_mp, |
1015 | "xlog_iodone: Barriers are no longer supported" | 1043 | "xlog_iodone: Barriers are no longer supported" |
@@ -1231,6 +1259,7 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1231 | spin_lock_init(&log->l_grant_lock); | 1259 | spin_lock_init(&log->l_grant_lock); |
1232 | sv_init(&log->l_flush_wait, 0, "flush_wait"); | 1260 | sv_init(&log->l_flush_wait, 0, "flush_wait"); |
1233 | 1261 | ||
1262 | xlog_trace_loggrant_alloc(log); | ||
1234 | /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */ | 1263 | /* log record size must be multiple of BBSIZE; see xlog_rec_header_t */ |
1235 | ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0); | 1264 | ASSERT((XFS_BUF_SIZE(bp) & BBMASK) == 0); |
1236 | 1265 | ||
@@ -1285,6 +1314,8 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1285 | sv_init(&iclog->ic_force_wait, SV_DEFAULT, "iclog-force"); | 1314 | sv_init(&iclog->ic_force_wait, SV_DEFAULT, "iclog-force"); |
1286 | sv_init(&iclog->ic_write_wait, SV_DEFAULT, "iclog-write"); | 1315 | sv_init(&iclog->ic_write_wait, SV_DEFAULT, "iclog-write"); |
1287 | 1316 | ||
1317 | xlog_trace_iclog_alloc(iclog); | ||
1318 | |||
1288 | iclogp = &iclog->ic_next; | 1319 | iclogp = &iclog->ic_next; |
1289 | } | 1320 | } |
1290 | *iclogp = log->l_iclog; /* complete ring */ | 1321 | *iclogp = log->l_iclog; /* complete ring */ |
@@ -1565,11 +1596,7 @@ xlog_dealloc_log(xlog_t *log) | |||
1565 | sv_destroy(&iclog->ic_force_wait); | 1596 | sv_destroy(&iclog->ic_force_wait); |
1566 | sv_destroy(&iclog->ic_write_wait); | 1597 | sv_destroy(&iclog->ic_write_wait); |
1567 | xfs_buf_free(iclog->ic_bp); | 1598 | xfs_buf_free(iclog->ic_bp); |
1568 | #ifdef XFS_LOG_TRACE | 1599 | xlog_trace_iclog_dealloc(iclog); |
1569 | if (iclog->ic_trace != NULL) { | ||
1570 | ktrace_free(iclog->ic_trace); | ||
1571 | } | ||
1572 | #endif | ||
1573 | next_iclog = iclog->ic_next; | 1600 | next_iclog = iclog->ic_next; |
1574 | kmem_free(iclog); | 1601 | kmem_free(iclog); |
1575 | iclog = next_iclog; | 1602 | iclog = next_iclog; |
@@ -1578,14 +1605,7 @@ xlog_dealloc_log(xlog_t *log) | |||
1578 | spinlock_destroy(&log->l_grant_lock); | 1605 | spinlock_destroy(&log->l_grant_lock); |
1579 | 1606 | ||
1580 | xfs_buf_free(log->l_xbuf); | 1607 | xfs_buf_free(log->l_xbuf); |
1581 | #ifdef XFS_LOG_TRACE | 1608 | xlog_trace_loggrant_dealloc(log); |
1582 | if (log->l_trace != NULL) { | ||
1583 | ktrace_free(log->l_trace); | ||
1584 | } | ||
1585 | if (log->l_grant_trace != NULL) { | ||
1586 | ktrace_free(log->l_grant_trace); | ||
1587 | } | ||
1588 | #endif | ||
1589 | log->l_mp->m_log = NULL; | 1609 | log->l_mp->m_log = NULL; |
1590 | kmem_free(log); | 1610 | kmem_free(log); |
1591 | } /* xlog_dealloc_log */ | 1611 | } /* xlog_dealloc_log */ |
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index c8a5b22ee3e3..e7d8f84443fa 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
@@ -448,7 +448,6 @@ typedef struct log { | |||
448 | int l_grant_write_bytes; | 448 | int l_grant_write_bytes; |
449 | 449 | ||
450 | #ifdef XFS_LOG_TRACE | 450 | #ifdef XFS_LOG_TRACE |
451 | struct ktrace *l_trace; | ||
452 | struct ktrace *l_grant_trace; | 451 | struct ktrace *l_grant_trace; |
453 | #endif | 452 | #endif |
454 | 453 | ||
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index aa238c8fbd7a..8b6812f66a15 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -1838,6 +1838,12 @@ again: | |||
1838 | #endif | 1838 | #endif |
1839 | } | 1839 | } |
1840 | 1840 | ||
1841 | /* | ||
1842 | * xfs_lock_two_inodes() can only be used to lock one type of lock | ||
1843 | * at a time - the iolock or the ilock, but not both at once. If | ||
1844 | * we lock both at once, lockdep will report false positives saying | ||
1845 | * we have violated locking orders. | ||
1846 | */ | ||
1841 | void | 1847 | void |
1842 | xfs_lock_two_inodes( | 1848 | xfs_lock_two_inodes( |
1843 | xfs_inode_t *ip0, | 1849 | xfs_inode_t *ip0, |
@@ -1848,6 +1854,8 @@ xfs_lock_two_inodes( | |||
1848 | int attempts = 0; | 1854 | int attempts = 0; |
1849 | xfs_log_item_t *lp; | 1855 | xfs_log_item_t *lp; |
1850 | 1856 | ||
1857 | if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) | ||
1858 | ASSERT((lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) == 0); | ||
1851 | ASSERT(ip0->i_ino != ip1->i_ino); | 1859 | ASSERT(ip0->i_ino != ip1->i_ino); |
1852 | 1860 | ||
1853 | if (ip0->i_ino > ip1->i_ino) { | 1861 | if (ip0->i_ino > ip1->i_ino) { |
@@ -3152,6 +3160,13 @@ error1: /* Just cancel transaction */ | |||
3152 | /* | 3160 | /* |
3153 | * Zero file bytes between startoff and endoff inclusive. | 3161 | * Zero file bytes between startoff and endoff inclusive. |
3154 | * The iolock is held exclusive and no blocks are buffered. | 3162 | * The iolock is held exclusive and no blocks are buffered. |
3163 | * | ||
3164 | * This function is used by xfs_free_file_space() to zero | ||
3165 | * partial blocks when the range to free is not block aligned. | ||
3166 | * When unreserving space with boundaries that are not block | ||
3167 | * aligned we round up the start and round down the end | ||
3168 | * boundaries and then use this function to zero the parts of | ||
3169 | * the blocks that got dropped during the rounding. | ||
3155 | */ | 3170 | */ |
3156 | STATIC int | 3171 | STATIC int |
3157 | xfs_zero_remaining_bytes( | 3172 | xfs_zero_remaining_bytes( |
@@ -3168,6 +3183,17 @@ xfs_zero_remaining_bytes( | |||
3168 | int nimap; | 3183 | int nimap; |
3169 | int error = 0; | 3184 | int error = 0; |
3170 | 3185 | ||
3186 | /* | ||
3187 | * Avoid doing I/O beyond eof - it's not necessary | ||
3188 | * since nothing can read beyond eof. The space will | ||
3189 | * be zeroed when the file is extended anyway. | ||
3190 | */ | ||
3191 | if (startoff >= ip->i_size) | ||
3192 | return 0; | ||
3193 | |||
3194 | if (endoff > ip->i_size) | ||
3195 | endoff = ip->i_size; | ||
3196 | |||
3171 | bp = xfs_buf_get_noaddr(mp->m_sb.sb_blocksize, | 3197 | bp = xfs_buf_get_noaddr(mp->m_sb.sb_blocksize, |
3172 | XFS_IS_REALTIME_INODE(ip) ? | 3198 | XFS_IS_REALTIME_INODE(ip) ? |
3173 | mp->m_rtdev_targp : mp->m_ddev_targp); | 3199 | mp->m_rtdev_targp : mp->m_ddev_targp); |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index 1170dc60e638..1870d5e05f1c 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
@@ -1,8 +1,10 @@ | |||
1 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 1 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
2 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
2 | header-y += kvm.h | 3 | header-y += kvm.h |
3 | endif | 4 | endif |
4 | 5 | ||
5 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 6 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
7 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | ||
6 | unifdef-y += a.out.h | 8 | unifdef-y += a.out.h |
7 | endif | 9 | endif |
8 | unifdef-y += auxvec.h | 10 | unifdef-y += auxvec.h |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index a3f738cffdb6..edc6ba82e090 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -97,6 +97,16 @@ extern void warn_slowpath(const char *file, const int line, | |||
97 | unlikely(__ret_warn_once); \ | 97 | unlikely(__ret_warn_once); \ |
98 | }) | 98 | }) |
99 | 99 | ||
100 | #define WARN_ONCE(condition, format...) ({ \ | ||
101 | static int __warned; \ | ||
102 | int __ret_warn_once = !!(condition); \ | ||
103 | \ | ||
104 | if (unlikely(__ret_warn_once)) \ | ||
105 | if (WARN(!__warned, format)) \ | ||
106 | __warned = 1; \ | ||
107 | unlikely(__ret_warn_once); \ | ||
108 | }) | ||
109 | |||
100 | #define WARN_ON_RATELIMIT(condition, state) \ | 110 | #define WARN_ON_RATELIMIT(condition, state) \ |
101 | WARN_ON((condition) && __ratelimit(state)) | 111 | WARN_ON((condition) && __ratelimit(state)) |
102 | 112 | ||
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 8feeae1f2369..79a7ff925bf8 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -14,4 +14,10 @@ extern char __kprobes_text_start[], __kprobes_text_end[]; | |||
14 | extern char __initdata_begin[], __initdata_end[]; | 14 | extern char __initdata_begin[], __initdata_end[]; |
15 | extern char __start_rodata[], __end_rodata[]; | 15 | extern char __start_rodata[], __end_rodata[]; |
16 | 16 | ||
17 | /* function descriptor handling (if any). Override | ||
18 | * in asm/sections.h */ | ||
19 | #ifndef dereference_function_descriptor | ||
20 | #define dereference_function_descriptor(p) (p) | ||
21 | #endif | ||
22 | |||
17 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ | 23 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h index abcf34c2fdc7..ea8087b55ffc 100644 --- a/include/asm-generic/syscall.h +++ b/include/asm-generic/syscall.h | |||
@@ -126,7 +126,7 @@ void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, | |||
126 | * @args: array of argument values to store | 126 | * @args: array of argument values to store |
127 | * | 127 | * |
128 | * Changes @n arguments to the system call starting with the @i'th argument. | 128 | * Changes @n arguments to the system call starting with the @i'th argument. |
129 | * @n'th argument to @val. Argument @i gets value @args[0], and so on. | 129 | * Argument @i gets value @args[0], and so on. |
130 | * An arch inline version is probably optimal when @i and @n are constants. | 130 | * An arch inline version is probably optimal when @i and @n are constants. |
131 | * | 131 | * |
132 | * It's only valid to call this when @task is stopped for tracing on | 132 | * It's only valid to call this when @task is stopped for tracing on |
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index d5c0f2fda51b..03b1d69b142f 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h | |||
@@ -63,6 +63,7 @@ static inline void flush_icache_page(struct vm_area_struct *vma, | |||
63 | } | 63 | } |
64 | 64 | ||
65 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); | 65 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); |
66 | extern void (*local_flush_icache_range)(unsigned long start, unsigned long end); | ||
66 | 67 | ||
67 | extern void (*__flush_cache_vmap)(void); | 68 | extern void (*__flush_cache_vmap)(void); |
68 | 69 | ||
diff --git a/include/asm-parisc/sections.h b/include/asm-parisc/sections.h index fdd43ec42ec5..9d13c3507ad6 100644 --- a/include/asm-parisc/sections.h +++ b/include/asm-parisc/sections.h | |||
@@ -4,4 +4,9 @@ | |||
4 | /* nothing to see, move along */ | 4 | /* nothing to see, move along */ |
5 | #include <asm-generic/sections.h> | 5 | #include <asm-generic/sections.h> |
6 | 6 | ||
7 | #ifdef CONFIG_64BIT | ||
8 | #undef dereference_function_descriptor | ||
9 | void *dereference_function_descriptor(void *); | ||
10 | #endif | ||
11 | |||
7 | #endif | 12 | #endif |
diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h index 762f6a6bc707..9489283a4bcf 100644 --- a/include/asm-x86/cpufeature.h +++ b/include/asm-x86/cpufeature.h | |||
@@ -72,14 +72,15 @@ | |||
72 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ | 72 | #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ |
73 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ | 73 | #define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ |
74 | #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ | 74 | #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ |
75 | #define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ | 75 | #define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ |
76 | #define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ | 76 | #define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ |
77 | #define X86_FEATURE_SYSCALL32 (3*32+14) /* syscall in ia32 userspace */ | 77 | #define X86_FEATURE_SYSCALL32 (3*32+14) /* syscall in ia32 userspace */ |
78 | #define X86_FEATURE_SYSENTER32 (3*32+15) /* sysenter in ia32 userspace */ | 78 | #define X86_FEATURE_SYSENTER32 (3*32+15) /* sysenter in ia32 userspace */ |
79 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ | 79 | #define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ |
80 | #define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ | 80 | #define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ |
81 | #define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ | 81 | #define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ |
82 | #define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ | 82 | #define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ |
83 | #define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */ | ||
83 | 84 | ||
84 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ | 85 | /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ |
85 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ | 86 | #define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ |
diff --git a/include/asm-x86/required-features.h b/include/asm-x86/required-features.h index adec887dd7cd..5c2ff4bc2980 100644 --- a/include/asm-x86/required-features.h +++ b/include/asm-x86/required-features.h | |||
@@ -41,6 +41,12 @@ | |||
41 | # define NEED_3DNOW 0 | 41 | # define NEED_3DNOW 0 |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64) | ||
45 | # define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) | ||
46 | #else | ||
47 | # define NEED_NOPL 0 | ||
48 | #endif | ||
49 | |||
44 | #ifdef CONFIG_X86_64 | 50 | #ifdef CONFIG_X86_64 |
45 | #define NEED_PSE 0 | 51 | #define NEED_PSE 0 |
46 | #define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) | 52 | #define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) |
@@ -67,7 +73,7 @@ | |||
67 | #define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) | 73 | #define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) |
68 | 74 | ||
69 | #define REQUIRED_MASK2 0 | 75 | #define REQUIRED_MASK2 0 |
70 | #define REQUIRED_MASK3 0 | 76 | #define REQUIRED_MASK3 (NEED_NOPL) |
71 | #define REQUIRED_MASK4 0 | 77 | #define REQUIRED_MASK4 0 |
72 | #define REQUIRED_MASK5 0 | 78 | #define REQUIRED_MASK5 0 |
73 | #define REQUIRED_MASK6 0 | 79 | #define REQUIRED_MASK6 0 |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 7d970678f940..b68ec09399be 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -167,7 +167,8 @@ unifdef-y += acct.h | |||
167 | unifdef-y += adb.h | 167 | unifdef-y += adb.h |
168 | unifdef-y += adfs_fs.h | 168 | unifdef-y += adfs_fs.h |
169 | unifdef-y += agpgart.h | 169 | unifdef-y += agpgart.h |
170 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 170 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
171 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | ||
171 | unifdef-y += a.out.h | 172 | unifdef-y += a.out.h |
172 | endif | 173 | endif |
173 | unifdef-y += apm_bios.h | 174 | unifdef-y += apm_bios.h |
@@ -258,7 +259,8 @@ unifdef-y += kd.h | |||
258 | unifdef-y += kernelcapi.h | 259 | unifdef-y += kernelcapi.h |
259 | unifdef-y += kernel.h | 260 | unifdef-y += kernel.h |
260 | unifdef-y += keyboard.h | 261 | unifdef-y += keyboard.h |
261 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 262 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
263 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
262 | unifdef-y += kvm.h | 264 | unifdef-y += kvm.h |
263 | endif | 265 | endif |
264 | unifdef-y += llc.h | 266 | unifdef-y += llc.h |
@@ -297,7 +299,6 @@ unifdef-y += parport.h | |||
297 | unifdef-y += patchkey.h | 299 | unifdef-y += patchkey.h |
298 | unifdef-y += pci.h | 300 | unifdef-y += pci.h |
299 | unifdef-y += personality.h | 301 | unifdef-y += personality.h |
300 | unifdef-y += pim.h | ||
301 | unifdef-y += pktcdvd.h | 302 | unifdef-y += pktcdvd.h |
302 | unifdef-y += pmu.h | 303 | unifdef-y += pmu.h |
303 | unifdef-y += poll.h | 304 | unifdef-y += poll.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 1ce19c1ef0e9..8a12d718c169 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -745,7 +745,7 @@ static inline int ata_ok(u8 status) | |||
745 | static inline int lba_28_ok(u64 block, u32 n_block) | 745 | static inline int lba_28_ok(u64 block, u32 n_block) |
746 | { | 746 | { |
747 | /* check the ending block number */ | 747 | /* check the ending block number */ |
748 | return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); | 748 | return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); |
749 | } | 749 | } |
750 | 750 | ||
751 | static inline int lba_48_ok(u64 block, u32 n_block) | 751 | static inline int lba_48_ok(u64 block, u32 n_block) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 44710d7e7bff..53ea933cf60b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -843,8 +843,6 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *); | |||
843 | */ | 843 | */ |
844 | extern int blk_verify_command(struct blk_cmd_filter *filter, | 844 | extern int blk_verify_command(struct blk_cmd_filter *filter, |
845 | unsigned char *cmd, int has_write_perm); | 845 | unsigned char *cmd, int has_write_perm); |
846 | extern int blk_register_filter(struct gendisk *disk); | ||
847 | extern void blk_unregister_filter(struct gendisk *disk); | ||
848 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | 846 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); |
849 | 847 | ||
850 | #define MAX_PHYS_SEGMENTS 128 | 848 | #define MAX_PHYS_SEGMENTS 128 |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index c33b0dc28e4d..ed3a5d473e52 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -127,6 +127,8 @@ extern int clockevents_register_notifier(struct notifier_block *nb); | |||
127 | extern int clockevents_program_event(struct clock_event_device *dev, | 127 | extern int clockevents_program_event(struct clock_event_device *dev, |
128 | ktime_t expires, ktime_t now); | 128 | ktime_t expires, ktime_t now); |
129 | 129 | ||
130 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
131 | |||
130 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 132 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
131 | extern void clockevents_notify(unsigned long reason, void *arg); | 133 | extern void clockevents_notify(unsigned long reason, void *arg); |
132 | #else | 134 | #else |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index e8f450c499b0..2691926fb506 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -160,7 +160,7 @@ static inline int current_cpuset_is_being_rebound(void) | |||
160 | 160 | ||
161 | static inline void rebuild_sched_domains(void) | 161 | static inline void rebuild_sched_domains(void) |
162 | { | 162 | { |
163 | partition_sched_domains(0, NULL, NULL); | 163 | partition_sched_domains(1, NULL, NULL); |
164 | } | 164 | } |
165 | 165 | ||
166 | #endif /* !CONFIG_CPUSETS */ | 166 | #endif /* !CONFIG_CPUSETS */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 87c12ed96954..1524829f73f2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1111,7 +1111,6 @@ void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | |||
1111 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1111 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1112 | int ide_pci_set_master(struct pci_dev *, const char *); | 1112 | int ide_pci_set_master(struct pci_dev *, const char *); |
1113 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | 1113 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1114 | extern const struct ide_dma_ops sff_dma_ops; | ||
1115 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); | 1114 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); |
1116 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1115 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1117 | #else | 1116 | #else |
@@ -1275,6 +1274,7 @@ extern int __ide_dma_end(ide_drive_t *); | |||
1275 | int ide_dma_test_irq(ide_drive_t *); | 1274 | int ide_dma_test_irq(ide_drive_t *); |
1276 | extern void ide_dma_lost_irq(ide_drive_t *); | 1275 | extern void ide_dma_lost_irq(ide_drive_t *); |
1277 | extern void ide_dma_timeout(ide_drive_t *); | 1276 | extern void ide_dma_timeout(ide_drive_t *); |
1277 | extern const struct ide_dma_ops sff_dma_ops; | ||
1278 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ | 1278 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ |
1279 | 1279 | ||
1280 | #else | 1280 | #else |
@@ -1448,8 +1448,7 @@ static inline void ide_dump_identify(u8 *id) | |||
1448 | 1448 | ||
1449 | static inline int hwif_to_node(ide_hwif_t *hwif) | 1449 | static inline int hwif_to_node(ide_hwif_t *hwif) |
1450 | { | 1450 | { |
1451 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1451 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1452 | return hwif->dev ? pcibus_to_node(dev->bus) : -1; | ||
1453 | } | 1452 | } |
1454 | 1453 | ||
1455 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1454 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 8d3b7a9afd17..350033e8f4e1 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -159,9 +159,9 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
159 | struct resource *parent, resource_size_t start, | 159 | struct resource *parent, resource_size_t start, |
160 | resource_size_t n, const char *name); | 160 | resource_size_t n, const char *name); |
161 | 161 | ||
162 | #define devm_release_region(start,n) \ | 162 | #define devm_release_region(dev, start, n) \ |
163 | __devm_release_region(dev, &ioport_resource, (start), (n)) | 163 | __devm_release_region(dev, &ioport_resource, (start), (n)) |
164 | #define devm_release_mem_region(start,n) \ | 164 | #define devm_release_mem_region(dev, start, n) \ |
165 | __devm_release_region(dev, &iomem_resource, (start), (n)) | 165 | __devm_release_region(dev, &iomem_resource, (start), (n)) |
166 | 166 | ||
167 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 167 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
diff --git a/include/linux/list.h b/include/linux/list.h index db35ef02e745..969f6e92d089 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -619,6 +619,19 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
619 | next->next->pprev = &next->next; | 619 | next->next->pprev = &next->next; |
620 | } | 620 | } |
621 | 621 | ||
622 | /* | ||
623 | * Move a list from one list head to another. Fixup the pprev | ||
624 | * reference of the first entry if it exists. | ||
625 | */ | ||
626 | static inline void hlist_move_list(struct hlist_head *old, | ||
627 | struct hlist_head *new) | ||
628 | { | ||
629 | new->first = old->first; | ||
630 | if (new->first) | ||
631 | new->first->pprev = &new->first; | ||
632 | old->first = NULL; | ||
633 | } | ||
634 | |||
622 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) | 635 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) |
623 | 636 | ||
624 | #define hlist_for_each(pos, head) \ | 637 | #define hlist_for_each(pos, head) \ |
diff --git a/include/linux/memstick.h b/include/linux/memstick.h index a9f998a3f48b..d0c37e682234 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h | |||
@@ -21,30 +21,30 @@ | |||
21 | struct ms_status_register { | 21 | struct ms_status_register { |
22 | unsigned char reserved; | 22 | unsigned char reserved; |
23 | unsigned char interrupt; | 23 | unsigned char interrupt; |
24 | #define MEMSTICK_INT_CMDNAK 0x0001 | 24 | #define MEMSTICK_INT_CMDNAK 0x01 |
25 | #define MEMSTICK_INT_IOREQ 0x0008 | 25 | #define MEMSTICK_INT_IOREQ 0x08 |
26 | #define MEMSTICK_INT_IOBREQ 0x0010 | 26 | #define MEMSTICK_INT_IOBREQ 0x10 |
27 | #define MEMSTICK_INT_BREQ 0x0020 | 27 | #define MEMSTICK_INT_BREQ 0x20 |
28 | #define MEMSTICK_INT_ERR 0x0040 | 28 | #define MEMSTICK_INT_ERR 0x40 |
29 | #define MEMSTICK_INT_CED 0x0080 | 29 | #define MEMSTICK_INT_CED 0x80 |
30 | 30 | ||
31 | unsigned char status0; | 31 | unsigned char status0; |
32 | #define MEMSTICK_STATUS0_WP 0x0001 | 32 | #define MEMSTICK_STATUS0_WP 0x01 |
33 | #define MEMSTICK_STATUS0_SL 0x0002 | 33 | #define MEMSTICK_STATUS0_SL 0x02 |
34 | #define MEMSTICK_STATUS0_BF 0x0010 | 34 | #define MEMSTICK_STATUS0_BF 0x10 |
35 | #define MEMSTICK_STATUS0_BE 0x0020 | 35 | #define MEMSTICK_STATUS0_BE 0x20 |
36 | #define MEMSTICK_STATUS0_FB0 0x0040 | 36 | #define MEMSTICK_STATUS0_FB0 0x40 |
37 | #define MEMSTICK_STATUS0_MB 0x0080 | 37 | #define MEMSTICK_STATUS0_MB 0x80 |
38 | 38 | ||
39 | unsigned char status1; | 39 | unsigned char status1; |
40 | #define MEMSTICK_STATUS1_UCFG 0x0001 | 40 | #define MEMSTICK_STATUS1_UCFG 0x01 |
41 | #define MEMSTICK_STATUS1_FGER 0x0002 | 41 | #define MEMSTICK_STATUS1_FGER 0x02 |
42 | #define MEMSTICK_STATUS1_UCEX 0x0004 | 42 | #define MEMSTICK_STATUS1_UCEX 0x04 |
43 | #define MEMSTICK_STATUS1_EXER 0x0008 | 43 | #define MEMSTICK_STATUS1_EXER 0x08 |
44 | #define MEMSTICK_STATUS1_UCDT 0x0010 | 44 | #define MEMSTICK_STATUS1_UCDT 0x10 |
45 | #define MEMSTICK_STATUS1_DTER 0x0020 | 45 | #define MEMSTICK_STATUS1_DTER 0x20 |
46 | #define MEMSTICK_STATUS1_FBI 0x0040 | 46 | #define MEMSTICK_STATUS1_FB1 0x40 |
47 | #define MEMSTICK_STATUS1_MB 0x0080 | 47 | #define MEMSTICK_STATUS1_MB 0x80 |
48 | } __attribute__((packed)); | 48 | } __attribute__((packed)); |
49 | 49 | ||
50 | struct ms_id_register { | 50 | struct ms_id_register { |
@@ -56,32 +56,32 @@ struct ms_id_register { | |||
56 | 56 | ||
57 | struct ms_param_register { | 57 | struct ms_param_register { |
58 | unsigned char system; | 58 | unsigned char system; |
59 | #define MEMSTICK_SYS_ATEN 0xc0 | ||
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
61 | #define MEMSTICK_SYS_PAM 0x08 | 59 | #define MEMSTICK_SYS_PAM 0x08 |
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
62 | 61 | ||
63 | unsigned char block_address_msb; | 62 | unsigned char block_address_msb; |
64 | unsigned short block_address; | 63 | unsigned short block_address; |
65 | unsigned char cp; | 64 | unsigned char cp; |
66 | #define MEMSTICK_CP_BLOCK 0x0000 | 65 | #define MEMSTICK_CP_BLOCK 0x00 |
67 | #define MEMSTICK_CP_PAGE 0x0020 | 66 | #define MEMSTICK_CP_PAGE 0x20 |
68 | #define MEMSTICK_CP_EXTRA 0x0040 | 67 | #define MEMSTICK_CP_EXTRA 0x40 |
69 | #define MEMSTICK_CP_OVERWRITE 0x0080 | 68 | #define MEMSTICK_CP_OVERWRITE 0x80 |
70 | 69 | ||
71 | unsigned char page_address; | 70 | unsigned char page_address; |
72 | } __attribute__((packed)); | 71 | } __attribute__((packed)); |
73 | 72 | ||
74 | struct ms_extra_data_register { | 73 | struct ms_extra_data_register { |
75 | unsigned char overwrite_flag; | 74 | unsigned char overwrite_flag; |
76 | #define MEMSTICK_OVERWRITE_UPDATA 0x0010 | 75 | #define MEMSTICK_OVERWRITE_UDST 0x10 |
77 | #define MEMSTICK_OVERWRITE_PAGE 0x0060 | 76 | #define MEMSTICK_OVERWRITE_PGST1 0x20 |
78 | #define MEMSTICK_OVERWRITE_BLOCK 0x0080 | 77 | #define MEMSTICK_OVERWRITE_PGST0 0x40 |
78 | #define MEMSTICK_OVERWRITE_BKST 0x80 | ||
79 | 79 | ||
80 | unsigned char management_flag; | 80 | unsigned char management_flag; |
81 | #define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 | 81 | #define MEMSTICK_MANAGEMENT_SYSFLG 0x04 |
82 | #define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 | 82 | #define MEMSTICK_MANAGEMENT_ATFLG 0x08 |
83 | #define MEMSTICK_MANAGEMENT_COPY 0x0010 | 83 | #define MEMSTICK_MANAGEMENT_SCMS1 0x10 |
84 | #define MEMSTICK_MANAGEMENT_ACCESS 0x0020 | 84 | #define MEMSTICK_MANAGEMENT_SCMS0 0x20 |
85 | 85 | ||
86 | unsigned short logical_address; | 86 | unsigned short logical_address; |
87 | } __attribute__((packed)); | 87 | } __attribute__((packed)); |
@@ -96,9 +96,9 @@ struct ms_register { | |||
96 | 96 | ||
97 | struct mspro_param_register { | 97 | struct mspro_param_register { |
98 | unsigned char system; | 98 | unsigned char system; |
99 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
100 | #define MEMSTICK_SYS_PAR4 0x00 | 99 | #define MEMSTICK_SYS_PAR4 0x00 |
101 | #define MEMSTICK_SYS_PAR8 0x40 | 100 | #define MEMSTICK_SYS_PAR8 0x40 |
101 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
102 | 102 | ||
103 | unsigned short data_count; | 103 | unsigned short data_count; |
104 | unsigned int data_address; | 104 | unsigned int data_address; |
@@ -147,7 +147,7 @@ struct ms_register_addr { | |||
147 | unsigned char w_length; | 147 | unsigned char w_length; |
148 | } __attribute__((packed)); | 148 | } __attribute__((packed)); |
149 | 149 | ||
150 | enum { | 150 | enum memstick_tpc { |
151 | MS_TPC_READ_MG_STATUS = 0x01, | 151 | MS_TPC_READ_MG_STATUS = 0x01, |
152 | MS_TPC_READ_LONG_DATA = 0x02, | 152 | MS_TPC_READ_LONG_DATA = 0x02, |
153 | MS_TPC_READ_SHORT_DATA = 0x03, | 153 | MS_TPC_READ_SHORT_DATA = 0x03, |
@@ -167,7 +167,7 @@ enum { | |||
167 | MS_TPC_SET_CMD = 0x0e | 167 | MS_TPC_SET_CMD = 0x0e |
168 | }; | 168 | }; |
169 | 169 | ||
170 | enum { | 170 | enum memstick_command { |
171 | MS_CMD_BLOCK_END = 0x33, | 171 | MS_CMD_BLOCK_END = 0x33, |
172 | MS_CMD_RESET = 0x3c, | 172 | MS_CMD_RESET = 0x3c, |
173 | MS_CMD_BLOCK_WRITE = 0x55, | 173 | MS_CMD_BLOCK_WRITE = 0x55, |
@@ -201,8 +201,6 @@ enum { | |||
201 | 201 | ||
202 | /*** Driver structures and functions ***/ | 202 | /*** Driver structures and functions ***/ |
203 | 203 | ||
204 | #define MEMSTICK_PART_SHIFT 3 | ||
205 | |||
206 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | 204 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; |
207 | 205 | ||
208 | #define MEMSTICK_POWER_OFF 0 | 206 | #define MEMSTICK_POWER_OFF 0 |
@@ -215,24 +213,27 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | |||
215 | struct memstick_host; | 213 | struct memstick_host; |
216 | struct memstick_driver; | 214 | struct memstick_driver; |
217 | 215 | ||
216 | struct memstick_device_id { | ||
217 | unsigned char match_flags; | ||
218 | #define MEMSTICK_MATCH_ALL 0x01 | 218 | #define MEMSTICK_MATCH_ALL 0x01 |
219 | 219 | ||
220 | unsigned char type; | ||
220 | #define MEMSTICK_TYPE_LEGACY 0xff | 221 | #define MEMSTICK_TYPE_LEGACY 0xff |
221 | #define MEMSTICK_TYPE_DUO 0x00 | 222 | #define MEMSTICK_TYPE_DUO 0x00 |
222 | #define MEMSTICK_TYPE_PRO 0x01 | 223 | #define MEMSTICK_TYPE_PRO 0x01 |
223 | 224 | ||
225 | unsigned char category; | ||
224 | #define MEMSTICK_CATEGORY_STORAGE 0xff | 226 | #define MEMSTICK_CATEGORY_STORAGE 0xff |
225 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 | 227 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 |
228 | #define MEMSTICK_CATEGORY_IO 0x01 | ||
229 | #define MEMSTICK_CATEGORY_IO_PRO 0x10 | ||
226 | 230 | ||
227 | #define MEMSTICK_CLASS_GENERIC 0xff | ||
228 | #define MEMSTICK_CLASS_GENERIC_DUO 0x00 | ||
229 | |||
230 | |||
231 | struct memstick_device_id { | ||
232 | unsigned char match_flags; | ||
233 | unsigned char type; | ||
234 | unsigned char category; | ||
235 | unsigned char class; | 231 | unsigned char class; |
232 | #define MEMSTICK_CLASS_FLASH 0xff | ||
233 | #define MEMSTICK_CLASS_DUO 0x00 | ||
234 | #define MEMSTICK_CLASS_ROM 0x01 | ||
235 | #define MEMSTICK_CLASS_RO 0x02 | ||
236 | #define MEMSTICK_CLASS_WP 0x03 | ||
236 | }; | 237 | }; |
237 | 238 | ||
238 | struct memstick_request { | 239 | struct memstick_request { |
@@ -319,9 +320,9 @@ void memstick_suspend_host(struct memstick_host *host); | |||
319 | void memstick_resume_host(struct memstick_host *host); | 320 | void memstick_resume_host(struct memstick_host *host); |
320 | 321 | ||
321 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, | 322 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, |
322 | struct scatterlist *sg); | 323 | const struct scatterlist *sg); |
323 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, | 324 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, |
324 | void *buf, size_t length); | 325 | const void *buf, size_t length); |
325 | int memstick_next_req(struct memstick_host *host, | 326 | int memstick_next_req(struct memstick_host *host, |
326 | struct memstick_request **mrq); | 327 | struct memstick_request **mrq); |
327 | void memstick_new_req(struct memstick_host *host); | 328 | void memstick_new_req(struct memstick_host *host); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 655ea0d1ee14..b2f944468313 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -141,6 +141,10 @@ enum { | |||
141 | MLX4_STAT_RATE_OFFSET = 5 | 141 | MLX4_STAT_RATE_OFFSET = 5 |
142 | }; | 142 | }; |
143 | 143 | ||
144 | enum { | ||
145 | MLX4_MTT_FLAG_PRESENT = 1 | ||
146 | }; | ||
147 | |||
144 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 148 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
145 | { | 149 | { |
146 | return (major << 32) | (minor << 16) | subminor; | 150 | return (major << 32) | (minor << 16) | subminor; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 443bc7cd8c62..428328a05fa1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -751,8 +751,9 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
751 | * | 751 | * |
752 | * This function returns the next zone at or below a given zone index that is | 752 | * This function returns the next zone at or below a given zone index that is |
753 | * within the allowed nodemask using a cursor as the starting point for the | 753 | * within the allowed nodemask using a cursor as the starting point for the |
754 | * search. The zoneref returned is a cursor that is used as the next starting | 754 | * search. The zoneref returned is a cursor that represents the current zone |
755 | * point for future calls to next_zones_zonelist(). | 755 | * being examined. It should be advanced by one before calling |
756 | * next_zones_zonelist again. | ||
756 | */ | 757 | */ |
757 | struct zoneref *next_zones_zonelist(struct zoneref *z, | 758 | struct zoneref *next_zones_zonelist(struct zoneref *z, |
758 | enum zone_type highest_zoneidx, | 759 | enum zone_type highest_zoneidx, |
@@ -768,9 +769,8 @@ struct zoneref *next_zones_zonelist(struct zoneref *z, | |||
768 | * | 769 | * |
769 | * This function returns the first zone at or below a given zone index that is | 770 | * This function returns the first zone at or below a given zone index that is |
770 | * within the allowed nodemask. The zoneref returned is a cursor that can be | 771 | * within the allowed nodemask. The zoneref returned is a cursor that can be |
771 | * used to iterate the zonelist with next_zones_zonelist. The cursor should | 772 | * used to iterate the zonelist with next_zones_zonelist by advancing it by |
772 | * not be used by the caller as it does not match the value of the zone | 773 | * one before calling. |
773 | * returned. | ||
774 | */ | 774 | */ |
775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | 775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, |
776 | enum zone_type highest_zoneidx, | 776 | enum zone_type highest_zoneidx, |
@@ -795,7 +795,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ | 795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ |
796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ | 796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ |
797 | zone; \ | 797 | zone; \ |
798 | z = next_zones_zonelist(z, highidx, nodemask, &zone)) \ | 798 | z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \ |
799 | 799 | ||
800 | /** | 800 | /** |
801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index | 801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 07112ee9293a..8a455694d682 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/in.h> | 7 | #include <linux/in.h> |
8 | #endif | 8 | #endif |
9 | #include <linux/pim.h> | ||
10 | 9 | ||
11 | /* | 10 | /* |
12 | * Based on the MROUTING 3.5 defines primarily to keep | 11 | * Based on the MROUTING 3.5 defines primarily to keep |
@@ -130,6 +129,7 @@ struct igmpmsg | |||
130 | */ | 129 | */ |
131 | 130 | ||
132 | #ifdef __KERNEL__ | 131 | #ifdef __KERNEL__ |
132 | #include <linux/pim.h> | ||
133 | #include <net/sock.h> | 133 | #include <net/sock.h> |
134 | 134 | ||
135 | #ifdef CONFIG_IP_MROUTE | 135 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 5cf50473a10f..6f4c180179e2 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -115,6 +115,7 @@ struct sioc_mif_req6 | |||
115 | 115 | ||
116 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
117 | 117 | ||
118 | #include <linux/pim.h> | ||
118 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | 119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ |
119 | 120 | ||
120 | #ifdef CONFIG_IPV6_MROUTE | 121 | #ifdef CONFIG_IPV6_MROUTE |
diff --git a/include/linux/pim.h b/include/linux/pim.h index 236ffd317394..1ba0661561a4 100644 --- a/include/linux/pim.h +++ b/include/linux/pim.h | |||
@@ -3,22 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/byteorder.h> | 4 | #include <asm/byteorder.h> |
5 | 5 | ||
6 | #ifndef __KERNEL__ | ||
7 | struct pim { | ||
8 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
9 | __u8 pim_type:4, /* PIM message type */ | ||
10 | pim_ver:4; /* PIM version */ | ||
11 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
12 | __u8 pim_ver:4; /* PIM version */ | ||
13 | pim_type:4; /* PIM message type */ | ||
14 | #endif | ||
15 | __u8 pim_rsv; /* Reserved */ | ||
16 | __be16 pim_cksum; /* Checksum */ | ||
17 | }; | ||
18 | |||
19 | #define PIM_MINLEN 8 | ||
20 | #endif | ||
21 | |||
22 | /* Message types - V1 */ | 6 | /* Message types - V1 */ |
23 | #define PIM_V1_VERSION __constant_htonl(0x10000000) | 7 | #define PIM_V1_VERSION __constant_htonl(0x10000000) |
24 | #define PIM_V1_REGISTER 1 | 8 | #define PIM_V1_REGISTER 1 |
@@ -27,7 +11,6 @@ struct pim { | |||
27 | #define PIM_VERSION 2 | 11 | #define PIM_VERSION 2 |
28 | #define PIM_REGISTER 1 | 12 | #define PIM_REGISTER 1 |
29 | 13 | ||
30 | #if defined(__KERNEL__) | ||
31 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) | 14 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) |
32 | 15 | ||
33 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ | 16 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ |
@@ -42,4 +25,3 @@ struct pimreghdr | |||
42 | struct sk_buff; | 25 | struct sk_buff; |
43 | extern int pim_rcv_v1(struct sk_buff *); | 26 | extern int pim_rcv_v1(struct sk_buff *); |
44 | #endif | 27 | #endif |
45 | #endif | ||
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 1ce54b63085d..be764e514e35 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -21,7 +21,14 @@ struct pnp_dev; | |||
21 | /* | 21 | /* |
22 | * Resource Management | 22 | * Resource Management |
23 | */ | 23 | */ |
24 | #ifdef CONFIG_PNP | ||
24 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); | 25 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); |
26 | #else | ||
27 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num) | ||
28 | { | ||
29 | return NULL; | ||
30 | } | ||
31 | #endif | ||
25 | 32 | ||
26 | static inline int pnp_resource_valid(struct resource *res) | 33 | static inline int pnp_resource_valid(struct resource *res) |
27 | { | 34 | { |
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h index 39b66713a0bb..bd466439c588 100644 --- a/include/linux/quicklist.h +++ b/include/linux/quicklist.h | |||
@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *), | |||
80 | 80 | ||
81 | unsigned long quicklist_total_size(void); | 81 | unsigned long quicklist_total_size(void); |
82 | 82 | ||
83 | #else | ||
84 | |||
85 | static inline unsigned long quicklist_total_size(void) | ||
86 | { | ||
87 | return 0; | ||
88 | } | ||
89 | |||
83 | #endif | 90 | #endif |
84 | 91 | ||
85 | #endif /* LINUX_QUICKLIST_H */ | 92 | #endif /* LINUX_QUICKLIST_H */ |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index fdeadd9740dc..271c1c2c9f6f 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -166,7 +166,7 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
166 | int ret = -EBUSY; | 166 | int ret = -EBUSY; |
167 | 167 | ||
168 | spin_lock_irqsave(&cnt->lock, flags); | 168 | spin_lock_irqsave(&cnt->lock, flags); |
169 | if (cnt->usage < limit) { | 169 | if (cnt->usage <= limit) { |
170 | cnt->limit = limit; | 170 | cnt->limit = limit; |
171 | ret = 0; | 171 | ret = 0; |
172 | } | 172 | } |
diff --git a/include/linux/sched.h b/include/linux/sched.h index cfb0d87b99fc..3d9120c5ad15 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1475,6 +1475,10 @@ static inline void put_task_struct(struct task_struct *t) | |||
1475 | __put_task_struct(t); | 1475 | __put_task_struct(t); |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | extern cputime_t task_utime(struct task_struct *p); | ||
1479 | extern cputime_t task_stime(struct task_struct *p); | ||
1480 | extern cputime_t task_gtime(struct task_struct *p); | ||
1481 | |||
1478 | /* | 1482 | /* |
1479 | * Per process flags | 1483 | * Per process flags |
1480 | */ | 1484 | */ |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index ef2e3a20bf3b..dc05b54bd3a3 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -143,7 +143,6 @@ struct svcxprt_rdma { | |||
143 | unsigned long sc_flags; | 143 | unsigned long sc_flags; |
144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ | 144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ |
145 | struct list_head sc_read_complete_q; | 145 | struct list_head sc_read_complete_q; |
146 | spinlock_t sc_read_complete_lock; | ||
147 | struct work_struct sc_work; | 146 | struct work_struct sc_work; |
148 | }; | 147 | }; |
149 | /* sc_flags */ | 148 | /* sc_flags */ |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index b48d81969574..6186a789d6c7 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -272,7 +272,7 @@ static inline void tracehook_finish_clone(struct task_struct *child, | |||
272 | * tracehook_report_clone_complete(). This must prevent the child from | 272 | * tracehook_report_clone_complete(). This must prevent the child from |
273 | * self-reaping if tracehook_report_clone_complete() uses the @child | 273 | * self-reaping if tracehook_report_clone_complete() uses the @child |
274 | * pointer; otherwise it might have died and been released by the time | 274 | * pointer; otherwise it might have died and been released by the time |
275 | * tracehook_report_report_clone_complete() is called. | 275 | * tracehook_report_clone_complete() is called. |
276 | * | 276 | * |
277 | * Called with no locks held, but the child cannot run until this returns. | 277 | * Called with no locks held, but the child cannot run until this returns. |
278 | */ | 278 | */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index e65a6bed4e3e..303d93ffd6b2 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -334,6 +334,8 @@ struct v4l2_pix_format { | |||
334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ | 334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ |
335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
337 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | ||
338 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | ||
337 | 339 | ||
338 | /* | 340 | /* |
339 | * F O R M A T E N U M E R A T I O N | 341 | * F O R M A T E N U M E R A T I O N |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index cbf751094688..46a43b721dd6 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -325,7 +325,8 @@ int hci_conn_del(struct hci_conn *conn); | |||
325 | void hci_conn_hash_flush(struct hci_dev *hdev); | 325 | void hci_conn_hash_flush(struct hci_dev *hdev); |
326 | void hci_conn_check_pending(struct hci_dev *hdev); | 326 | void hci_conn_check_pending(struct hci_dev *hdev); |
327 | 327 | ||
328 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *src); | 328 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 auth_type); |
329 | int hci_conn_check_link_mode(struct hci_conn *conn); | ||
329 | int hci_conn_auth(struct hci_conn *conn); | 330 | int hci_conn_auth(struct hci_conn *conn); |
330 | int hci_conn_encrypt(struct hci_conn *conn); | 331 | int hci_conn_encrypt(struct hci_conn *conn); |
331 | int hci_conn_change_link_key(struct hci_conn *conn); | 332 | int hci_conn_change_link_key(struct hci_conn *conn); |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index 95c660c9719b..91324908fccd 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -208,6 +208,9 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | |||
208 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | 208 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, |
209 | struct inet_timewait_death_row *twdr); | 209 | struct inet_timewait_death_row *twdr); |
210 | 210 | ||
211 | extern void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, | ||
212 | struct inet_timewait_death_row *twdr, int family); | ||
213 | |||
211 | static inline | 214 | static inline |
212 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 215 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
213 | { | 216 | { |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 18024b8cecb8..208fe5a38546 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -702,7 +702,7 @@ static inline int nla_len(const struct nlattr *nla) | |||
702 | */ | 702 | */ |
703 | static inline int nla_ok(const struct nlattr *nla, int remaining) | 703 | static inline int nla_ok(const struct nlattr *nla, int remaining) |
704 | { | 704 | { |
705 | return remaining >= sizeof(*nla) && | 705 | return remaining >= (int) sizeof(*nla) && |
706 | nla->nla_len >= sizeof(*nla) && | 706 | nla->nla_len >= sizeof(*nla) && |
707 | nla->nla_len <= remaining; | 707 | nla->nla_len <= remaining; |
708 | } | 708 | } |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 5c40cc537d4c..192f8716aa9e 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -309,6 +309,20 @@ struct scsi_lun { | |||
309 | }; | 309 | }; |
310 | 310 | ||
311 | /* | 311 | /* |
312 | * The Well Known LUNS (SAM-3) in our int representation of a LUN | ||
313 | */ | ||
314 | #define SCSI_W_LUN_BASE 0xc100 | ||
315 | #define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1) | ||
316 | #define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) | ||
317 | #define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) | ||
318 | |||
319 | static inline int scsi_is_wlun(unsigned int lun) | ||
320 | { | ||
321 | return (lun & 0xff00) == SCSI_W_LUN_BASE; | ||
322 | } | ||
323 | |||
324 | |||
325 | /* | ||
312 | * MESSAGE CODES | 326 | * MESSAGE CODES |
313 | */ | 327 | */ |
314 | 328 | ||
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 972f8e61d36a..59cedfb040e7 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -243,10 +243,11 @@ static inline int open_arg(int flags, int mask) | |||
243 | 243 | ||
244 | static int audit_match_perm(struct audit_context *ctx, int mask) | 244 | static int audit_match_perm(struct audit_context *ctx, int mask) |
245 | { | 245 | { |
246 | unsigned n; | ||
246 | if (unlikely(!ctx)) | 247 | if (unlikely(!ctx)) |
247 | return 0; | 248 | return 0; |
248 | 249 | ||
249 | unsigned n = ctx->major; | 250 | n = ctx->major; |
250 | switch (audit_classify_syscall(ctx->arch, n)) { | 251 | switch (audit_classify_syscall(ctx->arch, n)) { |
251 | case 0: /* native */ | 252 | case 0: /* native */ |
252 | if ((mask & AUDIT_PERM_WRITE) && | 253 | if ((mask & AUDIT_PERM_WRITE) && |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index d5ab79cf516d..827cd9adccb2 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * 2003-10-22 Updates by Stephen Hemminger. | 14 | * 2003-10-22 Updates by Stephen Hemminger. |
15 | * 2004 May-July Rework by Paul Jackson. | 15 | * 2004 May-July Rework by Paul Jackson. |
16 | * 2006 Rework by Paul Menage to use generic cgroups | 16 | * 2006 Rework by Paul Menage to use generic cgroups |
17 | * 2008 Rework of the scheduler domains and CPU hotplug handling | ||
18 | * by Max Krasnyansky | ||
17 | * | 19 | * |
18 | * This file is subject to the terms and conditions of the GNU General Public | 20 | * This file is subject to the terms and conditions of the GNU General Public |
19 | * License. See the file COPYING in the main directory of the Linux | 21 | * License. See the file COPYING in the main directory of the Linux |
@@ -236,9 +238,11 @@ static struct cpuset top_cpuset = { | |||
236 | 238 | ||
237 | static DEFINE_MUTEX(callback_mutex); | 239 | static DEFINE_MUTEX(callback_mutex); |
238 | 240 | ||
239 | /* This is ugly, but preserves the userspace API for existing cpuset | 241 | /* |
242 | * This is ugly, but preserves the userspace API for existing cpuset | ||
240 | * users. If someone tries to mount the "cpuset" filesystem, we | 243 | * users. If someone tries to mount the "cpuset" filesystem, we |
241 | * silently switch it to mount "cgroup" instead */ | 244 | * silently switch it to mount "cgroup" instead |
245 | */ | ||
242 | static int cpuset_get_sb(struct file_system_type *fs_type, | 246 | static int cpuset_get_sb(struct file_system_type *fs_type, |
243 | int flags, const char *unused_dev_name, | 247 | int flags, const char *unused_dev_name, |
244 | void *data, struct vfsmount *mnt) | 248 | void *data, struct vfsmount *mnt) |
@@ -473,10 +477,9 @@ static int validate_change(const struct cpuset *cur, const struct cpuset *trial) | |||
473 | } | 477 | } |
474 | 478 | ||
475 | /* | 479 | /* |
476 | * Helper routine for rebuild_sched_domains(). | 480 | * Helper routine for generate_sched_domains(). |
477 | * Do cpusets a, b have overlapping cpus_allowed masks? | 481 | * Do cpusets a, b have overlapping cpus_allowed masks? |
478 | */ | 482 | */ |
479 | |||
480 | static int cpusets_overlap(struct cpuset *a, struct cpuset *b) | 483 | static int cpusets_overlap(struct cpuset *a, struct cpuset *b) |
481 | { | 484 | { |
482 | return cpus_intersects(a->cpus_allowed, b->cpus_allowed); | 485 | return cpus_intersects(a->cpus_allowed, b->cpus_allowed); |
@@ -518,26 +521,15 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c) | |||
518 | } | 521 | } |
519 | 522 | ||
520 | /* | 523 | /* |
521 | * rebuild_sched_domains() | 524 | * generate_sched_domains() |
522 | * | 525 | * |
523 | * This routine will be called to rebuild the scheduler's dynamic | 526 | * This function builds a partial partition of the systems CPUs |
524 | * sched domains: | 527 | * A 'partial partition' is a set of non-overlapping subsets whose |
525 | * - if the flag 'sched_load_balance' of any cpuset with non-empty | 528 | * union is a subset of that set. |
526 | * 'cpus' changes, | 529 | * The output of this function needs to be passed to kernel/sched.c |
527 | * - or if the 'cpus' allowed changes in any cpuset which has that | 530 | * partition_sched_domains() routine, which will rebuild the scheduler's |
528 | * flag enabled, | 531 | * load balancing domains (sched domains) as specified by that partial |
529 | * - or if the 'sched_relax_domain_level' of any cpuset which has | 532 | * partition. |
530 | * that flag enabled and with non-empty 'cpus' changes, | ||
531 | * - or if any cpuset with non-empty 'cpus' is removed, | ||
532 | * - or if a cpu gets offlined. | ||
533 | * | ||
534 | * This routine builds a partial partition of the systems CPUs | ||
535 | * (the set of non-overlappping cpumask_t's in the array 'part' | ||
536 | * below), and passes that partial partition to the kernel/sched.c | ||
537 | * partition_sched_domains() routine, which will rebuild the | ||
538 | * schedulers load balancing domains (sched domains) as specified | ||
539 | * by that partial partition. A 'partial partition' is a set of | ||
540 | * non-overlapping subsets whose union is a subset of that set. | ||
541 | * | 533 | * |
542 | * See "What is sched_load_balance" in Documentation/cpusets.txt | 534 | * See "What is sched_load_balance" in Documentation/cpusets.txt |
543 | * for a background explanation of this. | 535 | * for a background explanation of this. |
@@ -547,13 +539,7 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c) | |||
547 | * domains when operating in the severe memory shortage situations | 539 | * domains when operating in the severe memory shortage situations |
548 | * that could cause allocation failures below. | 540 | * that could cause allocation failures below. |
549 | * | 541 | * |
550 | * Call with cgroup_mutex held. May take callback_mutex during | 542 | * Must be called with cgroup_lock held. |
551 | * call due to the kfifo_alloc() and kmalloc() calls. May nest | ||
552 | * a call to the get_online_cpus()/put_online_cpus() pair. | ||
553 | * Must not be called holding callback_mutex, because we must not | ||
554 | * call get_online_cpus() while holding callback_mutex. Elsewhere | ||
555 | * the kernel nests callback_mutex inside get_online_cpus() calls. | ||
556 | * So the reverse nesting would risk an ABBA deadlock. | ||
557 | * | 543 | * |
558 | * The three key local variables below are: | 544 | * The three key local variables below are: |
559 | * q - a linked-list queue of cpuset pointers, used to implement a | 545 | * q - a linked-list queue of cpuset pointers, used to implement a |
@@ -588,10 +574,10 @@ update_domain_attr_tree(struct sched_domain_attr *dattr, struct cpuset *c) | |||
588 | * element of the partition (one sched domain) to be passed to | 574 | * element of the partition (one sched domain) to be passed to |
589 | * partition_sched_domains(). | 575 | * partition_sched_domains(). |
590 | */ | 576 | */ |
591 | 577 | static int generate_sched_domains(cpumask_t **domains, | |
592 | void rebuild_sched_domains(void) | 578 | struct sched_domain_attr **attributes) |
593 | { | 579 | { |
594 | LIST_HEAD(q); /* queue of cpusets to be scanned*/ | 580 | LIST_HEAD(q); /* queue of cpusets to be scanned */ |
595 | struct cpuset *cp; /* scans q */ | 581 | struct cpuset *cp; /* scans q */ |
596 | struct cpuset **csa; /* array of all cpuset ptrs */ | 582 | struct cpuset **csa; /* array of all cpuset ptrs */ |
597 | int csn; /* how many cpuset ptrs in csa so far */ | 583 | int csn; /* how many cpuset ptrs in csa so far */ |
@@ -601,23 +587,26 @@ void rebuild_sched_domains(void) | |||
601 | int ndoms; /* number of sched domains in result */ | 587 | int ndoms; /* number of sched domains in result */ |
602 | int nslot; /* next empty doms[] cpumask_t slot */ | 588 | int nslot; /* next empty doms[] cpumask_t slot */ |
603 | 589 | ||
604 | csa = NULL; | 590 | ndoms = 0; |
605 | doms = NULL; | 591 | doms = NULL; |
606 | dattr = NULL; | 592 | dattr = NULL; |
593 | csa = NULL; | ||
607 | 594 | ||
608 | /* Special case for the 99% of systems with one, full, sched domain */ | 595 | /* Special case for the 99% of systems with one, full, sched domain */ |
609 | if (is_sched_load_balance(&top_cpuset)) { | 596 | if (is_sched_load_balance(&top_cpuset)) { |
610 | ndoms = 1; | ||
611 | doms = kmalloc(sizeof(cpumask_t), GFP_KERNEL); | 597 | doms = kmalloc(sizeof(cpumask_t), GFP_KERNEL); |
612 | if (!doms) | 598 | if (!doms) |
613 | goto rebuild; | 599 | goto done; |
600 | |||
614 | dattr = kmalloc(sizeof(struct sched_domain_attr), GFP_KERNEL); | 601 | dattr = kmalloc(sizeof(struct sched_domain_attr), GFP_KERNEL); |
615 | if (dattr) { | 602 | if (dattr) { |
616 | *dattr = SD_ATTR_INIT; | 603 | *dattr = SD_ATTR_INIT; |
617 | update_domain_attr_tree(dattr, &top_cpuset); | 604 | update_domain_attr_tree(dattr, &top_cpuset); |
618 | } | 605 | } |
619 | *doms = top_cpuset.cpus_allowed; | 606 | *doms = top_cpuset.cpus_allowed; |
620 | goto rebuild; | 607 | |
608 | ndoms = 1; | ||
609 | goto done; | ||
621 | } | 610 | } |
622 | 611 | ||
623 | csa = kmalloc(number_of_cpusets * sizeof(cp), GFP_KERNEL); | 612 | csa = kmalloc(number_of_cpusets * sizeof(cp), GFP_KERNEL); |
@@ -680,61 +669,141 @@ restart: | |||
680 | } | 669 | } |
681 | } | 670 | } |
682 | 671 | ||
683 | /* Convert <csn, csa> to <ndoms, doms> */ | 672 | /* |
673 | * Now we know how many domains to create. | ||
674 | * Convert <csn, csa> to <ndoms, doms> and populate cpu masks. | ||
675 | */ | ||
684 | doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL); | 676 | doms = kmalloc(ndoms * sizeof(cpumask_t), GFP_KERNEL); |
685 | if (!doms) | 677 | if (!doms) { |
686 | goto rebuild; | 678 | ndoms = 0; |
679 | goto done; | ||
680 | } | ||
681 | |||
682 | /* | ||
683 | * The rest of the code, including the scheduler, can deal with | ||
684 | * dattr==NULL case. No need to abort if alloc fails. | ||
685 | */ | ||
687 | dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL); | 686 | dattr = kmalloc(ndoms * sizeof(struct sched_domain_attr), GFP_KERNEL); |
688 | 687 | ||
689 | for (nslot = 0, i = 0; i < csn; i++) { | 688 | for (nslot = 0, i = 0; i < csn; i++) { |
690 | struct cpuset *a = csa[i]; | 689 | struct cpuset *a = csa[i]; |
690 | cpumask_t *dp; | ||
691 | int apn = a->pn; | 691 | int apn = a->pn; |
692 | 692 | ||
693 | if (apn >= 0) { | 693 | if (apn < 0) { |
694 | cpumask_t *dp = doms + nslot; | 694 | /* Skip completed partitions */ |
695 | 695 | continue; | |
696 | if (nslot == ndoms) { | 696 | } |
697 | static int warnings = 10; | 697 | |
698 | if (warnings) { | 698 | dp = doms + nslot; |
699 | printk(KERN_WARNING | 699 | |
700 | "rebuild_sched_domains confused:" | 700 | if (nslot == ndoms) { |
701 | " nslot %d, ndoms %d, csn %d, i %d," | 701 | static int warnings = 10; |
702 | " apn %d\n", | 702 | if (warnings) { |
703 | nslot, ndoms, csn, i, apn); | 703 | printk(KERN_WARNING |
704 | warnings--; | 704 | "rebuild_sched_domains confused:" |
705 | } | 705 | " nslot %d, ndoms %d, csn %d, i %d," |
706 | continue; | 706 | " apn %d\n", |
707 | nslot, ndoms, csn, i, apn); | ||
708 | warnings--; | ||
707 | } | 709 | } |
710 | continue; | ||
711 | } | ||
708 | 712 | ||
709 | cpus_clear(*dp); | 713 | cpus_clear(*dp); |
710 | if (dattr) | 714 | if (dattr) |
711 | *(dattr + nslot) = SD_ATTR_INIT; | 715 | *(dattr + nslot) = SD_ATTR_INIT; |
712 | for (j = i; j < csn; j++) { | 716 | for (j = i; j < csn; j++) { |
713 | struct cpuset *b = csa[j]; | 717 | struct cpuset *b = csa[j]; |
714 | 718 | ||
715 | if (apn == b->pn) { | 719 | if (apn == b->pn) { |
716 | cpus_or(*dp, *dp, b->cpus_allowed); | 720 | cpus_or(*dp, *dp, b->cpus_allowed); |
717 | b->pn = -1; | 721 | if (dattr) |
718 | if (dattr) | 722 | update_domain_attr_tree(dattr + nslot, b); |
719 | update_domain_attr_tree(dattr | 723 | |
720 | + nslot, b); | 724 | /* Done with this partition */ |
721 | } | 725 | b->pn = -1; |
722 | } | 726 | } |
723 | nslot++; | ||
724 | } | 727 | } |
728 | nslot++; | ||
725 | } | 729 | } |
726 | BUG_ON(nslot != ndoms); | 730 | BUG_ON(nslot != ndoms); |
727 | 731 | ||
728 | rebuild: | 732 | done: |
729 | /* Have scheduler rebuild sched domains */ | 733 | kfree(csa); |
734 | |||
735 | *domains = doms; | ||
736 | *attributes = dattr; | ||
737 | return ndoms; | ||
738 | } | ||
739 | |||
740 | /* | ||
741 | * Rebuild scheduler domains. | ||
742 | * | ||
743 | * Call with neither cgroup_mutex held nor within get_online_cpus(). | ||
744 | * Takes both cgroup_mutex and get_online_cpus(). | ||
745 | * | ||
746 | * Cannot be directly called from cpuset code handling changes | ||
747 | * to the cpuset pseudo-filesystem, because it cannot be called | ||
748 | * from code that already holds cgroup_mutex. | ||
749 | */ | ||
750 | static void do_rebuild_sched_domains(struct work_struct *unused) | ||
751 | { | ||
752 | struct sched_domain_attr *attr; | ||
753 | cpumask_t *doms; | ||
754 | int ndoms; | ||
755 | |||
730 | get_online_cpus(); | 756 | get_online_cpus(); |
731 | partition_sched_domains(ndoms, doms, dattr); | 757 | |
758 | /* Generate domain masks and attrs */ | ||
759 | cgroup_lock(); | ||
760 | ndoms = generate_sched_domains(&doms, &attr); | ||
761 | cgroup_unlock(); | ||
762 | |||
763 | /* Have scheduler rebuild the domains */ | ||
764 | partition_sched_domains(ndoms, doms, attr); | ||
765 | |||
732 | put_online_cpus(); | 766 | put_online_cpus(); |
767 | } | ||
733 | 768 | ||
734 | done: | 769 | static DECLARE_WORK(rebuild_sched_domains_work, do_rebuild_sched_domains); |
735 | kfree(csa); | 770 | |
736 | /* Don't kfree(doms) -- partition_sched_domains() does that. */ | 771 | /* |
737 | /* Don't kfree(dattr) -- partition_sched_domains() does that. */ | 772 | * Rebuild scheduler domains, asynchronously via workqueue. |
773 | * | ||
774 | * If the flag 'sched_load_balance' of any cpuset with non-empty | ||
775 | * 'cpus' changes, or if the 'cpus' allowed changes in any cpuset | ||
776 | * which has that flag enabled, or if any cpuset with a non-empty | ||
777 | * 'cpus' is removed, then call this routine to rebuild the | ||
778 | * scheduler's dynamic sched domains. | ||
779 | * | ||
780 | * The rebuild_sched_domains() and partition_sched_domains() | ||
781 | * routines must nest cgroup_lock() inside get_online_cpus(), | ||
782 | * but such cpuset changes as these must nest that locking the | ||
783 | * other way, holding cgroup_lock() for much of the code. | ||
784 | * | ||
785 | * So in order to avoid an ABBA deadlock, the cpuset code handling | ||
786 | * these user changes delegates the actual sched domain rebuilding | ||
787 | * to a separate workqueue thread, which ends up processing the | ||
788 | * above do_rebuild_sched_domains() function. | ||
789 | */ | ||
790 | static void async_rebuild_sched_domains(void) | ||
791 | { | ||
792 | schedule_work(&rebuild_sched_domains_work); | ||
793 | } | ||
794 | |||
795 | /* | ||
796 | * Accomplishes the same scheduler domain rebuild as the above | ||
797 | * async_rebuild_sched_domains(), however it directly calls the | ||
798 | * rebuild routine synchronously rather than calling it via an | ||
799 | * asynchronous work thread. | ||
800 | * | ||
801 | * This can only be called from code that is not holding | ||
802 | * cgroup_mutex (not nested in a cgroup_lock() call.) | ||
803 | */ | ||
804 | void rebuild_sched_domains(void) | ||
805 | { | ||
806 | do_rebuild_sched_domains(NULL); | ||
738 | } | 807 | } |
739 | 808 | ||
740 | /** | 809 | /** |
@@ -774,37 +843,25 @@ static void cpuset_change_cpumask(struct task_struct *tsk, | |||
774 | /** | 843 | /** |
775 | * update_tasks_cpumask - Update the cpumasks of tasks in the cpuset. | 844 | * update_tasks_cpumask - Update the cpumasks of tasks in the cpuset. |
776 | * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed | 845 | * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed |
846 | * @heap: if NULL, defer allocating heap memory to cgroup_scan_tasks() | ||
777 | * | 847 | * |
778 | * Called with cgroup_mutex held | 848 | * Called with cgroup_mutex held |
779 | * | 849 | * |
780 | * The cgroup_scan_tasks() function will scan all the tasks in a cgroup, | 850 | * The cgroup_scan_tasks() function will scan all the tasks in a cgroup, |
781 | * calling callback functions for each. | 851 | * calling callback functions for each. |
782 | * | 852 | * |
783 | * Return 0 if successful, -errno if not. | 853 | * No return value. It's guaranteed that cgroup_scan_tasks() always returns 0 |
854 | * if @heap != NULL. | ||
784 | */ | 855 | */ |
785 | static int update_tasks_cpumask(struct cpuset *cs) | 856 | static void update_tasks_cpumask(struct cpuset *cs, struct ptr_heap *heap) |
786 | { | 857 | { |
787 | struct cgroup_scanner scan; | 858 | struct cgroup_scanner scan; |
788 | struct ptr_heap heap; | ||
789 | int retval; | ||
790 | |||
791 | /* | ||
792 | * cgroup_scan_tasks() will initialize heap->gt for us. | ||
793 | * heap_init() is still needed here for we should not change | ||
794 | * cs->cpus_allowed when heap_init() fails. | ||
795 | */ | ||
796 | retval = heap_init(&heap, PAGE_SIZE, GFP_KERNEL, NULL); | ||
797 | if (retval) | ||
798 | return retval; | ||
799 | 859 | ||
800 | scan.cg = cs->css.cgroup; | 860 | scan.cg = cs->css.cgroup; |
801 | scan.test_task = cpuset_test_cpumask; | 861 | scan.test_task = cpuset_test_cpumask; |
802 | scan.process_task = cpuset_change_cpumask; | 862 | scan.process_task = cpuset_change_cpumask; |
803 | scan.heap = &heap; | 863 | scan.heap = heap; |
804 | retval = cgroup_scan_tasks(&scan); | 864 | cgroup_scan_tasks(&scan); |
805 | |||
806 | heap_free(&heap); | ||
807 | return retval; | ||
808 | } | 865 | } |
809 | 866 | ||
810 | /** | 867 | /** |
@@ -814,6 +871,7 @@ static int update_tasks_cpumask(struct cpuset *cs) | |||
814 | */ | 871 | */ |
815 | static int update_cpumask(struct cpuset *cs, const char *buf) | 872 | static int update_cpumask(struct cpuset *cs, const char *buf) |
816 | { | 873 | { |
874 | struct ptr_heap heap; | ||
817 | struct cpuset trialcs; | 875 | struct cpuset trialcs; |
818 | int retval; | 876 | int retval; |
819 | int is_load_balanced; | 877 | int is_load_balanced; |
@@ -848,6 +906,10 @@ static int update_cpumask(struct cpuset *cs, const char *buf) | |||
848 | if (cpus_equal(cs->cpus_allowed, trialcs.cpus_allowed)) | 906 | if (cpus_equal(cs->cpus_allowed, trialcs.cpus_allowed)) |
849 | return 0; | 907 | return 0; |
850 | 908 | ||
909 | retval = heap_init(&heap, PAGE_SIZE, GFP_KERNEL, NULL); | ||
910 | if (retval) | ||
911 | return retval; | ||
912 | |||
851 | is_load_balanced = is_sched_load_balance(&trialcs); | 913 | is_load_balanced = is_sched_load_balance(&trialcs); |
852 | 914 | ||
853 | mutex_lock(&callback_mutex); | 915 | mutex_lock(&callback_mutex); |
@@ -858,12 +920,12 @@ static int update_cpumask(struct cpuset *cs, const char *buf) | |||
858 | * Scan tasks in the cpuset, and update the cpumasks of any | 920 | * Scan tasks in the cpuset, and update the cpumasks of any |
859 | * that need an update. | 921 | * that need an update. |
860 | */ | 922 | */ |
861 | retval = update_tasks_cpumask(cs); | 923 | update_tasks_cpumask(cs, &heap); |
862 | if (retval < 0) | 924 | |
863 | return retval; | 925 | heap_free(&heap); |
864 | 926 | ||
865 | if (is_load_balanced) | 927 | if (is_load_balanced) |
866 | rebuild_sched_domains(); | 928 | async_rebuild_sched_domains(); |
867 | return 0; | 929 | return 0; |
868 | } | 930 | } |
869 | 931 | ||
@@ -1090,7 +1152,7 @@ static int update_relax_domain_level(struct cpuset *cs, s64 val) | |||
1090 | if (val != cs->relax_domain_level) { | 1152 | if (val != cs->relax_domain_level) { |
1091 | cs->relax_domain_level = val; | 1153 | cs->relax_domain_level = val; |
1092 | if (!cpus_empty(cs->cpus_allowed) && is_sched_load_balance(cs)) | 1154 | if (!cpus_empty(cs->cpus_allowed) && is_sched_load_balance(cs)) |
1093 | rebuild_sched_domains(); | 1155 | async_rebuild_sched_domains(); |
1094 | } | 1156 | } |
1095 | 1157 | ||
1096 | return 0; | 1158 | return 0; |
@@ -1131,7 +1193,7 @@ static int update_flag(cpuset_flagbits_t bit, struct cpuset *cs, | |||
1131 | mutex_unlock(&callback_mutex); | 1193 | mutex_unlock(&callback_mutex); |
1132 | 1194 | ||
1133 | if (cpus_nonempty && balance_flag_changed) | 1195 | if (cpus_nonempty && balance_flag_changed) |
1134 | rebuild_sched_domains(); | 1196 | async_rebuild_sched_domains(); |
1135 | 1197 | ||
1136 | return 0; | 1198 | return 0; |
1137 | } | 1199 | } |
@@ -1492,6 +1554,9 @@ static u64 cpuset_read_u64(struct cgroup *cont, struct cftype *cft) | |||
1492 | default: | 1554 | default: |
1493 | BUG(); | 1555 | BUG(); |
1494 | } | 1556 | } |
1557 | |||
1558 | /* Unreachable but makes gcc happy */ | ||
1559 | return 0; | ||
1495 | } | 1560 | } |
1496 | 1561 | ||
1497 | static s64 cpuset_read_s64(struct cgroup *cont, struct cftype *cft) | 1562 | static s64 cpuset_read_s64(struct cgroup *cont, struct cftype *cft) |
@@ -1504,6 +1569,9 @@ static s64 cpuset_read_s64(struct cgroup *cont, struct cftype *cft) | |||
1504 | default: | 1569 | default: |
1505 | BUG(); | 1570 | BUG(); |
1506 | } | 1571 | } |
1572 | |||
1573 | /* Unrechable but makes gcc happy */ | ||
1574 | return 0; | ||
1507 | } | 1575 | } |
1508 | 1576 | ||
1509 | 1577 | ||
@@ -1692,15 +1760,9 @@ static struct cgroup_subsys_state *cpuset_create( | |||
1692 | } | 1760 | } |
1693 | 1761 | ||
1694 | /* | 1762 | /* |
1695 | * Locking note on the strange update_flag() call below: | ||
1696 | * | ||
1697 | * If the cpuset being removed has its flag 'sched_load_balance' | 1763 | * If the cpuset being removed has its flag 'sched_load_balance' |
1698 | * enabled, then simulate turning sched_load_balance off, which | 1764 | * enabled, then simulate turning sched_load_balance off, which |
1699 | * will call rebuild_sched_domains(). The get_online_cpus() | 1765 | * will call async_rebuild_sched_domains(). |
1700 | * call in rebuild_sched_domains() must not be made while holding | ||
1701 | * callback_mutex. Elsewhere the kernel nests callback_mutex inside | ||
1702 | * get_online_cpus() calls. So the reverse nesting would risk an | ||
1703 | * ABBA deadlock. | ||
1704 | */ | 1766 | */ |
1705 | 1767 | ||
1706 | static void cpuset_destroy(struct cgroup_subsys *ss, struct cgroup *cont) | 1768 | static void cpuset_destroy(struct cgroup_subsys *ss, struct cgroup *cont) |
@@ -1719,7 +1781,7 @@ static void cpuset_destroy(struct cgroup_subsys *ss, struct cgroup *cont) | |||
1719 | struct cgroup_subsys cpuset_subsys = { | 1781 | struct cgroup_subsys cpuset_subsys = { |
1720 | .name = "cpuset", | 1782 | .name = "cpuset", |
1721 | .create = cpuset_create, | 1783 | .create = cpuset_create, |
1722 | .destroy = cpuset_destroy, | 1784 | .destroy = cpuset_destroy, |
1723 | .can_attach = cpuset_can_attach, | 1785 | .can_attach = cpuset_can_attach, |
1724 | .attach = cpuset_attach, | 1786 | .attach = cpuset_attach, |
1725 | .populate = cpuset_populate, | 1787 | .populate = cpuset_populate, |
@@ -1811,7 +1873,7 @@ static void move_member_tasks_to_cpuset(struct cpuset *from, struct cpuset *to) | |||
1811 | } | 1873 | } |
1812 | 1874 | ||
1813 | /* | 1875 | /* |
1814 | * If common_cpu_mem_hotplug_unplug(), below, unplugs any CPUs | 1876 | * If CPU and/or memory hotplug handlers, below, unplug any CPUs |
1815 | * or memory nodes, we need to walk over the cpuset hierarchy, | 1877 | * or memory nodes, we need to walk over the cpuset hierarchy, |
1816 | * removing that CPU or node from all cpusets. If this removes the | 1878 | * removing that CPU or node from all cpusets. If this removes the |
1817 | * last CPU or node from a cpuset, then move the tasks in the empty | 1879 | * last CPU or node from a cpuset, then move the tasks in the empty |
@@ -1896,42 +1958,13 @@ static void scan_for_empty_cpusets(const struct cpuset *root) | |||
1896 | nodes_empty(cp->mems_allowed)) | 1958 | nodes_empty(cp->mems_allowed)) |
1897 | remove_tasks_in_empty_cpuset(cp); | 1959 | remove_tasks_in_empty_cpuset(cp); |
1898 | else { | 1960 | else { |
1899 | update_tasks_cpumask(cp); | 1961 | update_tasks_cpumask(cp, NULL); |
1900 | update_tasks_nodemask(cp, &oldmems); | 1962 | update_tasks_nodemask(cp, &oldmems); |
1901 | } | 1963 | } |
1902 | } | 1964 | } |
1903 | } | 1965 | } |
1904 | 1966 | ||
1905 | /* | 1967 | /* |
1906 | * The cpus_allowed and mems_allowed nodemasks in the top_cpuset track | ||
1907 | * cpu_online_map and node_states[N_HIGH_MEMORY]. Force the top cpuset to | ||
1908 | * track what's online after any CPU or memory node hotplug or unplug event. | ||
1909 | * | ||
1910 | * Since there are two callers of this routine, one for CPU hotplug | ||
1911 | * events and one for memory node hotplug events, we could have coded | ||
1912 | * two separate routines here. We code it as a single common routine | ||
1913 | * in order to minimize text size. | ||
1914 | */ | ||
1915 | |||
1916 | static void common_cpu_mem_hotplug_unplug(int rebuild_sd) | ||
1917 | { | ||
1918 | cgroup_lock(); | ||
1919 | |||
1920 | top_cpuset.cpus_allowed = cpu_online_map; | ||
1921 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; | ||
1922 | scan_for_empty_cpusets(&top_cpuset); | ||
1923 | |||
1924 | /* | ||
1925 | * Scheduler destroys domains on hotplug events. | ||
1926 | * Rebuild them based on the current settings. | ||
1927 | */ | ||
1928 | if (rebuild_sd) | ||
1929 | rebuild_sched_domains(); | ||
1930 | |||
1931 | cgroup_unlock(); | ||
1932 | } | ||
1933 | |||
1934 | /* | ||
1935 | * The top_cpuset tracks what CPUs and Memory Nodes are online, | 1968 | * The top_cpuset tracks what CPUs and Memory Nodes are online, |
1936 | * period. This is necessary in order to make cpusets transparent | 1969 | * period. This is necessary in order to make cpusets transparent |
1937 | * (of no affect) on systems that are actively using CPU hotplug | 1970 | * (of no affect) on systems that are actively using CPU hotplug |
@@ -1939,40 +1972,52 @@ static void common_cpu_mem_hotplug_unplug(int rebuild_sd) | |||
1939 | * | 1972 | * |
1940 | * This routine ensures that top_cpuset.cpus_allowed tracks | 1973 | * This routine ensures that top_cpuset.cpus_allowed tracks |
1941 | * cpu_online_map on each CPU hotplug (cpuhp) event. | 1974 | * cpu_online_map on each CPU hotplug (cpuhp) event. |
1975 | * | ||
1976 | * Called within get_online_cpus(). Needs to call cgroup_lock() | ||
1977 | * before calling generate_sched_domains(). | ||
1942 | */ | 1978 | */ |
1943 | 1979 | static int cpuset_track_online_cpus(struct notifier_block *unused_nb, | |
1944 | static int cpuset_handle_cpuhp(struct notifier_block *unused_nb, | ||
1945 | unsigned long phase, void *unused_cpu) | 1980 | unsigned long phase, void *unused_cpu) |
1946 | { | 1981 | { |
1982 | struct sched_domain_attr *attr; | ||
1983 | cpumask_t *doms; | ||
1984 | int ndoms; | ||
1985 | |||
1947 | switch (phase) { | 1986 | switch (phase) { |
1948 | case CPU_UP_CANCELED: | ||
1949 | case CPU_UP_CANCELED_FROZEN: | ||
1950 | case CPU_DOWN_FAILED: | ||
1951 | case CPU_DOWN_FAILED_FROZEN: | ||
1952 | case CPU_ONLINE: | 1987 | case CPU_ONLINE: |
1953 | case CPU_ONLINE_FROZEN: | 1988 | case CPU_ONLINE_FROZEN: |
1954 | case CPU_DEAD: | 1989 | case CPU_DEAD: |
1955 | case CPU_DEAD_FROZEN: | 1990 | case CPU_DEAD_FROZEN: |
1956 | common_cpu_mem_hotplug_unplug(1); | ||
1957 | break; | 1991 | break; |
1992 | |||
1958 | default: | 1993 | default: |
1959 | return NOTIFY_DONE; | 1994 | return NOTIFY_DONE; |
1960 | } | 1995 | } |
1961 | 1996 | ||
1997 | cgroup_lock(); | ||
1998 | top_cpuset.cpus_allowed = cpu_online_map; | ||
1999 | scan_for_empty_cpusets(&top_cpuset); | ||
2000 | ndoms = generate_sched_domains(&doms, &attr); | ||
2001 | cgroup_unlock(); | ||
2002 | |||
2003 | /* Have scheduler rebuild the domains */ | ||
2004 | partition_sched_domains(ndoms, doms, attr); | ||
2005 | |||
1962 | return NOTIFY_OK; | 2006 | return NOTIFY_OK; |
1963 | } | 2007 | } |
1964 | 2008 | ||
1965 | #ifdef CONFIG_MEMORY_HOTPLUG | 2009 | #ifdef CONFIG_MEMORY_HOTPLUG |
1966 | /* | 2010 | /* |
1967 | * Keep top_cpuset.mems_allowed tracking node_states[N_HIGH_MEMORY]. | 2011 | * Keep top_cpuset.mems_allowed tracking node_states[N_HIGH_MEMORY]. |
1968 | * Call this routine anytime after you change | 2012 | * Call this routine anytime after node_states[N_HIGH_MEMORY] changes. |
1969 | * node_states[N_HIGH_MEMORY]. | 2013 | * See also the previous routine cpuset_track_online_cpus(). |
1970 | * See also the previous routine cpuset_handle_cpuhp(). | ||
1971 | */ | 2014 | */ |
1972 | |||
1973 | void cpuset_track_online_nodes(void) | 2015 | void cpuset_track_online_nodes(void) |
1974 | { | 2016 | { |
1975 | common_cpu_mem_hotplug_unplug(0); | 2017 | cgroup_lock(); |
2018 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; | ||
2019 | scan_for_empty_cpusets(&top_cpuset); | ||
2020 | cgroup_unlock(); | ||
1976 | } | 2021 | } |
1977 | #endif | 2022 | #endif |
1978 | 2023 | ||
@@ -1987,7 +2032,7 @@ void __init cpuset_init_smp(void) | |||
1987 | top_cpuset.cpus_allowed = cpu_online_map; | 2032 | top_cpuset.cpus_allowed = cpu_online_map; |
1988 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; | 2033 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; |
1989 | 2034 | ||
1990 | hotcpu_notifier(cpuset_handle_cpuhp, 0); | 2035 | hotcpu_notifier(cpuset_track_online_cpus, 0); |
1991 | } | 2036 | } |
1992 | 2037 | ||
1993 | /** | 2038 | /** |
diff --git a/kernel/exit.c b/kernel/exit.c index 75c647387639..16395644a98f 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -112,9 +112,9 @@ static void __exit_signal(struct task_struct *tsk) | |||
112 | * We won't ever get here for the group leader, since it | 112 | * We won't ever get here for the group leader, since it |
113 | * will have been the last reference on the signal_struct. | 113 | * will have been the last reference on the signal_struct. |
114 | */ | 114 | */ |
115 | sig->utime = cputime_add(sig->utime, tsk->utime); | 115 | sig->utime = cputime_add(sig->utime, task_utime(tsk)); |
116 | sig->stime = cputime_add(sig->stime, tsk->stime); | 116 | sig->stime = cputime_add(sig->stime, task_stime(tsk)); |
117 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); | 117 | sig->gtime = cputime_add(sig->gtime, task_gtime(tsk)); |
118 | sig->min_flt += tsk->min_flt; | 118 | sig->min_flt += tsk->min_flt; |
119 | sig->maj_flt += tsk->maj_flt; | 119 | sig->maj_flt += tsk->maj_flt; |
120 | sig->nvcsw += tsk->nvcsw; | 120 | sig->nvcsw += tsk->nvcsw; |
@@ -831,26 +831,50 @@ static void reparent_thread(struct task_struct *p, struct task_struct *father) | |||
831 | * the child reaper process (ie "init") in our pid | 831 | * the child reaper process (ie "init") in our pid |
832 | * space. | 832 | * space. |
833 | */ | 833 | */ |
834 | static struct task_struct *find_new_reaper(struct task_struct *father) | ||
835 | { | ||
836 | struct pid_namespace *pid_ns = task_active_pid_ns(father); | ||
837 | struct task_struct *thread; | ||
838 | |||
839 | thread = father; | ||
840 | while_each_thread(father, thread) { | ||
841 | if (thread->flags & PF_EXITING) | ||
842 | continue; | ||
843 | if (unlikely(pid_ns->child_reaper == father)) | ||
844 | pid_ns->child_reaper = thread; | ||
845 | return thread; | ||
846 | } | ||
847 | |||
848 | if (unlikely(pid_ns->child_reaper == father)) { | ||
849 | write_unlock_irq(&tasklist_lock); | ||
850 | if (unlikely(pid_ns == &init_pid_ns)) | ||
851 | panic("Attempted to kill init!"); | ||
852 | |||
853 | zap_pid_ns_processes(pid_ns); | ||
854 | write_lock_irq(&tasklist_lock); | ||
855 | /* | ||
856 | * We can not clear ->child_reaper or leave it alone. | ||
857 | * There may by stealth EXIT_DEAD tasks on ->children, | ||
858 | * forget_original_parent() must move them somewhere. | ||
859 | */ | ||
860 | pid_ns->child_reaper = init_pid_ns.child_reaper; | ||
861 | } | ||
862 | |||
863 | return pid_ns->child_reaper; | ||
864 | } | ||
865 | |||
834 | static void forget_original_parent(struct task_struct *father) | 866 | static void forget_original_parent(struct task_struct *father) |
835 | { | 867 | { |
836 | struct task_struct *p, *n, *reaper = father; | 868 | struct task_struct *p, *n, *reaper; |
837 | LIST_HEAD(ptrace_dead); | 869 | LIST_HEAD(ptrace_dead); |
838 | 870 | ||
839 | write_lock_irq(&tasklist_lock); | 871 | write_lock_irq(&tasklist_lock); |
840 | 872 | reaper = find_new_reaper(father); | |
841 | /* | 873 | /* |
842 | * First clean up ptrace if we were using it. | 874 | * First clean up ptrace if we were using it. |
843 | */ | 875 | */ |
844 | ptrace_exit(father, &ptrace_dead); | 876 | ptrace_exit(father, &ptrace_dead); |
845 | 877 | ||
846 | do { | ||
847 | reaper = next_thread(reaper); | ||
848 | if (reaper == father) { | ||
849 | reaper = task_child_reaper(father); | ||
850 | break; | ||
851 | } | ||
852 | } while (reaper->flags & PF_EXITING); | ||
853 | |||
854 | list_for_each_entry_safe(p, n, &father->children, sibling) { | 878 | list_for_each_entry_safe(p, n, &father->children, sibling) { |
855 | p->real_parent = reaper; | 879 | p->real_parent = reaper; |
856 | if (p->parent == father) { | 880 | if (p->parent == father) { |
@@ -959,39 +983,6 @@ static void check_stack_usage(void) | |||
959 | static inline void check_stack_usage(void) {} | 983 | static inline void check_stack_usage(void) {} |
960 | #endif | 984 | #endif |
961 | 985 | ||
962 | static inline void exit_child_reaper(struct task_struct *tsk) | ||
963 | { | ||
964 | if (likely(tsk->group_leader != task_child_reaper(tsk))) | ||
965 | return; | ||
966 | |||
967 | if (tsk->nsproxy->pid_ns == &init_pid_ns) | ||
968 | panic("Attempted to kill init!"); | ||
969 | |||
970 | /* | ||
971 | * @tsk is the last thread in the 'cgroup-init' and is exiting. | ||
972 | * Terminate all remaining processes in the namespace and reap them | ||
973 | * before exiting @tsk. | ||
974 | * | ||
975 | * Note that @tsk (last thread of cgroup-init) may not necessarily | ||
976 | * be the child-reaper (i.e main thread of cgroup-init) of the | ||
977 | * namespace i.e the child_reaper may have already exited. | ||
978 | * | ||
979 | * Even after a child_reaper exits, we let it inherit orphaned children, | ||
980 | * because, pid_ns->child_reaper remains valid as long as there is | ||
981 | * at least one living sub-thread in the cgroup init. | ||
982 | |||
983 | * This living sub-thread of the cgroup-init will be notified when | ||
984 | * a child inherited by the 'child-reaper' exits (do_notify_parent() | ||
985 | * uses __group_send_sig_info()). Further, when reaping child processes, | ||
986 | * do_wait() iterates over children of all living sub threads. | ||
987 | |||
988 | * i.e even though 'child_reaper' thread is listed as the parent of the | ||
989 | * orphaned children, any living sub-thread in the cgroup-init can | ||
990 | * perform the role of the child_reaper. | ||
991 | */ | ||
992 | zap_pid_ns_processes(tsk->nsproxy->pid_ns); | ||
993 | } | ||
994 | |||
995 | NORET_TYPE void do_exit(long code) | 986 | NORET_TYPE void do_exit(long code) |
996 | { | 987 | { |
997 | struct task_struct *tsk = current; | 988 | struct task_struct *tsk = current; |
@@ -1051,7 +1042,6 @@ NORET_TYPE void do_exit(long code) | |||
1051 | } | 1042 | } |
1052 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 1043 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
1053 | if (group_dead) { | 1044 | if (group_dead) { |
1054 | exit_child_reaper(tsk); | ||
1055 | hrtimer_cancel(&tsk->signal->real_timer); | 1045 | hrtimer_cancel(&tsk->signal->real_timer); |
1056 | exit_itimers(tsk->signal); | 1046 | exit_itimers(tsk->signal); |
1057 | } | 1047 | } |
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index ea567b78d1aa..fab8ea86fac3 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -179,9 +179,6 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
179 | rc = sys_wait4(-1, NULL, __WALL, NULL); | 179 | rc = sys_wait4(-1, NULL, __WALL, NULL); |
180 | } while (rc != -ECHILD); | 180 | } while (rc != -ECHILD); |
181 | 181 | ||
182 | |||
183 | /* Child reaper for the pid namespace is going away */ | ||
184 | pid_ns->child_reaper = NULL; | ||
185 | acct_exit_ns(pid_ns); | 182 | acct_exit_ns(pid_ns); |
186 | return; | 183 | return; |
187 | } | 184 | } |
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c index da9c2dda6a4e..dfdec524d1b7 100644 --- a/kernel/pm_qos_params.c +++ b/kernel/pm_qos_params.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #include <linux/uaccess.h> | 43 | #include <linux/uaccess.h> |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * locking rule: all changes to target_value or requirements or notifiers lists | 46 | * locking rule: all changes to requirements or notifiers lists |
47 | * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock | 47 | * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock |
48 | * held, taken with _irqsave. One lock to rule them all | 48 | * held, taken with _irqsave. One lock to rule them all |
49 | */ | 49 | */ |
@@ -66,7 +66,7 @@ struct pm_qos_object { | |||
66 | struct miscdevice pm_qos_power_miscdev; | 66 | struct miscdevice pm_qos_power_miscdev; |
67 | char *name; | 67 | char *name; |
68 | s32 default_value; | 68 | s32 default_value; |
69 | s32 target_value; | 69 | atomic_t target_value; |
70 | s32 (*comparitor)(s32, s32); | 70 | s32 (*comparitor)(s32, s32); |
71 | }; | 71 | }; |
72 | 72 | ||
@@ -77,7 +77,7 @@ static struct pm_qos_object cpu_dma_pm_qos = { | |||
77 | .notifiers = &cpu_dma_lat_notifier, | 77 | .notifiers = &cpu_dma_lat_notifier, |
78 | .name = "cpu_dma_latency", | 78 | .name = "cpu_dma_latency", |
79 | .default_value = 2000 * USEC_PER_SEC, | 79 | .default_value = 2000 * USEC_PER_SEC, |
80 | .target_value = 2000 * USEC_PER_SEC, | 80 | .target_value = ATOMIC_INIT(2000 * USEC_PER_SEC), |
81 | .comparitor = min_compare | 81 | .comparitor = min_compare |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -87,7 +87,7 @@ static struct pm_qos_object network_lat_pm_qos = { | |||
87 | .notifiers = &network_lat_notifier, | 87 | .notifiers = &network_lat_notifier, |
88 | .name = "network_latency", | 88 | .name = "network_latency", |
89 | .default_value = 2000 * USEC_PER_SEC, | 89 | .default_value = 2000 * USEC_PER_SEC, |
90 | .target_value = 2000 * USEC_PER_SEC, | 90 | .target_value = ATOMIC_INIT(2000 * USEC_PER_SEC), |
91 | .comparitor = min_compare | 91 | .comparitor = min_compare |
92 | }; | 92 | }; |
93 | 93 | ||
@@ -99,7 +99,7 @@ static struct pm_qos_object network_throughput_pm_qos = { | |||
99 | .notifiers = &network_throughput_notifier, | 99 | .notifiers = &network_throughput_notifier, |
100 | .name = "network_throughput", | 100 | .name = "network_throughput", |
101 | .default_value = 0, | 101 | .default_value = 0, |
102 | .target_value = 0, | 102 | .target_value = ATOMIC_INIT(0), |
103 | .comparitor = max_compare | 103 | .comparitor = max_compare |
104 | }; | 104 | }; |
105 | 105 | ||
@@ -150,11 +150,11 @@ static void update_target(int target) | |||
150 | extreme_value = pm_qos_array[target]->comparitor( | 150 | extreme_value = pm_qos_array[target]->comparitor( |
151 | extreme_value, node->value); | 151 | extreme_value, node->value); |
152 | } | 152 | } |
153 | if (pm_qos_array[target]->target_value != extreme_value) { | 153 | if (atomic_read(&pm_qos_array[target]->target_value) != extreme_value) { |
154 | call_notifier = 1; | 154 | call_notifier = 1; |
155 | pm_qos_array[target]->target_value = extreme_value; | 155 | atomic_set(&pm_qos_array[target]->target_value, extreme_value); |
156 | pr_debug(KERN_ERR "new target for qos %d is %d\n", target, | 156 | pr_debug(KERN_ERR "new target for qos %d is %d\n", target, |
157 | pm_qos_array[target]->target_value); | 157 | atomic_read(&pm_qos_array[target]->target_value)); |
158 | } | 158 | } |
159 | spin_unlock_irqrestore(&pm_qos_lock, flags); | 159 | spin_unlock_irqrestore(&pm_qos_lock, flags); |
160 | 160 | ||
@@ -193,14 +193,7 @@ static int find_pm_qos_object_by_minor(int minor) | |||
193 | */ | 193 | */ |
194 | int pm_qos_requirement(int pm_qos_class) | 194 | int pm_qos_requirement(int pm_qos_class) |
195 | { | 195 | { |
196 | int ret_val; | 196 | return atomic_read(&pm_qos_array[pm_qos_class]->target_value); |
197 | unsigned long flags; | ||
198 | |||
199 | spin_lock_irqsave(&pm_qos_lock, flags); | ||
200 | ret_val = pm_qos_array[pm_qos_class]->target_value; | ||
201 | spin_unlock_irqrestore(&pm_qos_lock, flags); | ||
202 | |||
203 | return ret_val; | ||
204 | } | 197 | } |
205 | EXPORT_SYMBOL_GPL(pm_qos_requirement); | 198 | EXPORT_SYMBOL_GPL(pm_qos_requirement); |
206 | 199 | ||
diff --git a/kernel/resource.c b/kernel/resource.c index cf0a178c7513..03d796c1b2e9 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -438,7 +438,7 @@ int insert_resource(struct resource *parent, struct resource *new) | |||
438 | 438 | ||
439 | /** | 439 | /** |
440 | * insert_resource_expand_to_fit - Insert a resource into the resource tree | 440 | * insert_resource_expand_to_fit - Insert a resource into the resource tree |
441 | * @parent: parent of the new resource | 441 | * @root: root resource descriptor |
442 | * @new: new resource to insert | 442 | * @new: new resource to insert |
443 | * | 443 | * |
444 | * Insert a resource into the resource tree, possibly expanding it in order | 444 | * Insert a resource into the resource tree, possibly expanding it in order |
diff --git a/kernel/sched.c b/kernel/sched.c index 9a1ddb84e26d..98890807375b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4179,6 +4179,65 @@ void account_steal_time(struct task_struct *p, cputime_t steal) | |||
4179 | } | 4179 | } |
4180 | 4180 | ||
4181 | /* | 4181 | /* |
4182 | * Use precise platform statistics if available: | ||
4183 | */ | ||
4184 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
4185 | cputime_t task_utime(struct task_struct *p) | ||
4186 | { | ||
4187 | return p->utime; | ||
4188 | } | ||
4189 | |||
4190 | cputime_t task_stime(struct task_struct *p) | ||
4191 | { | ||
4192 | return p->stime; | ||
4193 | } | ||
4194 | #else | ||
4195 | cputime_t task_utime(struct task_struct *p) | ||
4196 | { | ||
4197 | clock_t utime = cputime_to_clock_t(p->utime), | ||
4198 | total = utime + cputime_to_clock_t(p->stime); | ||
4199 | u64 temp; | ||
4200 | |||
4201 | /* | ||
4202 | * Use CFS's precise accounting: | ||
4203 | */ | ||
4204 | temp = (u64)nsec_to_clock_t(p->se.sum_exec_runtime); | ||
4205 | |||
4206 | if (total) { | ||
4207 | temp *= utime; | ||
4208 | do_div(temp, total); | ||
4209 | } | ||
4210 | utime = (clock_t)temp; | ||
4211 | |||
4212 | p->prev_utime = max(p->prev_utime, clock_t_to_cputime(utime)); | ||
4213 | return p->prev_utime; | ||
4214 | } | ||
4215 | |||
4216 | cputime_t task_stime(struct task_struct *p) | ||
4217 | { | ||
4218 | clock_t stime; | ||
4219 | |||
4220 | /* | ||
4221 | * Use CFS's precise accounting. (we subtract utime from | ||
4222 | * the total, to make sure the total observed by userspace | ||
4223 | * grows monotonically - apps rely on that): | ||
4224 | */ | ||
4225 | stime = nsec_to_clock_t(p->se.sum_exec_runtime) - | ||
4226 | cputime_to_clock_t(task_utime(p)); | ||
4227 | |||
4228 | if (stime >= 0) | ||
4229 | p->prev_stime = max(p->prev_stime, clock_t_to_cputime(stime)); | ||
4230 | |||
4231 | return p->prev_stime; | ||
4232 | } | ||
4233 | #endif | ||
4234 | |||
4235 | inline cputime_t task_gtime(struct task_struct *p) | ||
4236 | { | ||
4237 | return p->gtime; | ||
4238 | } | ||
4239 | |||
4240 | /* | ||
4182 | * This function gets called by the timer code, with HZ frequency. | 4241 | * This function gets called by the timer code, with HZ frequency. |
4183 | * We call it with interrupts disabled. | 4242 | * We call it with interrupts disabled. |
4184 | * | 4243 | * |
@@ -7637,24 +7696,27 @@ static int dattrs_equal(struct sched_domain_attr *cur, int idx_cur, | |||
7637 | * and partition_sched_domains() will fallback to the single partition | 7696 | * and partition_sched_domains() will fallback to the single partition |
7638 | * 'fallback_doms', it also forces the domains to be rebuilt. | 7697 | * 'fallback_doms', it also forces the domains to be rebuilt. |
7639 | * | 7698 | * |
7699 | * If doms_new==NULL it will be replaced with cpu_online_map. | ||
7700 | * ndoms_new==0 is a special case for destroying existing domains. | ||
7701 | * It will not create the default domain. | ||
7702 | * | ||
7640 | * Call with hotplug lock held | 7703 | * Call with hotplug lock held |
7641 | */ | 7704 | */ |
7642 | void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 7705 | void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, |
7643 | struct sched_domain_attr *dattr_new) | 7706 | struct sched_domain_attr *dattr_new) |
7644 | { | 7707 | { |
7645 | int i, j; | 7708 | int i, j, n; |
7646 | 7709 | ||
7647 | mutex_lock(&sched_domains_mutex); | 7710 | mutex_lock(&sched_domains_mutex); |
7648 | 7711 | ||
7649 | /* always unregister in case we don't destroy any domains */ | 7712 | /* always unregister in case we don't destroy any domains */ |
7650 | unregister_sched_domain_sysctl(); | 7713 | unregister_sched_domain_sysctl(); |
7651 | 7714 | ||
7652 | if (doms_new == NULL) | 7715 | n = doms_new ? ndoms_new : 0; |
7653 | ndoms_new = 0; | ||
7654 | 7716 | ||
7655 | /* Destroy deleted domains */ | 7717 | /* Destroy deleted domains */ |
7656 | for (i = 0; i < ndoms_cur; i++) { | 7718 | for (i = 0; i < ndoms_cur; i++) { |
7657 | for (j = 0; j < ndoms_new; j++) { | 7719 | for (j = 0; j < n; j++) { |
7658 | if (cpus_equal(doms_cur[i], doms_new[j]) | 7720 | if (cpus_equal(doms_cur[i], doms_new[j]) |
7659 | && dattrs_equal(dattr_cur, i, dattr_new, j)) | 7721 | && dattrs_equal(dattr_cur, i, dattr_new, j)) |
7660 | goto match1; | 7722 | goto match1; |
@@ -7667,7 +7729,6 @@ match1: | |||
7667 | 7729 | ||
7668 | if (doms_new == NULL) { | 7730 | if (doms_new == NULL) { |
7669 | ndoms_cur = 0; | 7731 | ndoms_cur = 0; |
7670 | ndoms_new = 1; | ||
7671 | doms_new = &fallback_doms; | 7732 | doms_new = &fallback_doms; |
7672 | cpus_andnot(doms_new[0], cpu_online_map, cpu_isolated_map); | 7733 | cpus_andnot(doms_new[0], cpu_online_map, cpu_isolated_map); |
7673 | dattr_new = NULL; | 7734 | dattr_new = NULL; |
@@ -7704,8 +7765,13 @@ match2: | |||
7704 | int arch_reinit_sched_domains(void) | 7765 | int arch_reinit_sched_domains(void) |
7705 | { | 7766 | { |
7706 | get_online_cpus(); | 7767 | get_online_cpus(); |
7768 | |||
7769 | /* Destroy domains first to force the rebuild */ | ||
7770 | partition_sched_domains(0, NULL, NULL); | ||
7771 | |||
7707 | rebuild_sched_domains(); | 7772 | rebuild_sched_domains(); |
7708 | put_online_cpus(); | 7773 | put_online_cpus(); |
7774 | |||
7709 | return 0; | 7775 | return 0; |
7710 | } | 7776 | } |
7711 | 7777 | ||
@@ -7789,7 +7855,7 @@ static int update_sched_domains(struct notifier_block *nfb, | |||
7789 | case CPU_ONLINE_FROZEN: | 7855 | case CPU_ONLINE_FROZEN: |
7790 | case CPU_DEAD: | 7856 | case CPU_DEAD: |
7791 | case CPU_DEAD_FROZEN: | 7857 | case CPU_DEAD_FROZEN: |
7792 | partition_sched_domains(0, NULL, NULL); | 7858 | partition_sched_domains(1, NULL, NULL); |
7793 | return NOTIFY_OK; | 7859 | return NOTIFY_OK; |
7794 | 7860 | ||
7795 | default: | 7861 | default: |
@@ -8843,6 +8909,9 @@ static int sched_rt_global_constraints(void) | |||
8843 | u64 rt_runtime, rt_period; | 8909 | u64 rt_runtime, rt_period; |
8844 | int ret = 0; | 8910 | int ret = 0; |
8845 | 8911 | ||
8912 | if (sysctl_sched_rt_period <= 0) | ||
8913 | return -EINVAL; | ||
8914 | |||
8846 | rt_period = ktime_to_ns(tg->rt_bandwidth.rt_period); | 8915 | rt_period = ktime_to_ns(tg->rt_bandwidth.rt_period); |
8847 | rt_runtime = tg->rt_bandwidth.rt_runtime; | 8916 | rt_runtime = tg->rt_bandwidth.rt_runtime; |
8848 | 8917 | ||
@@ -8859,6 +8928,9 @@ static int sched_rt_global_constraints(void) | |||
8859 | unsigned long flags; | 8928 | unsigned long flags; |
8860 | int i; | 8929 | int i; |
8861 | 8930 | ||
8931 | if (sysctl_sched_rt_period <= 0) | ||
8932 | return -EINVAL; | ||
8933 | |||
8862 | spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags); | 8934 | spin_lock_irqsave(&def_rt_bandwidth.rt_runtime_lock, flags); |
8863 | for_each_possible_cpu(i) { | 8935 | for_each_possible_cpu(i) { |
8864 | struct rt_rq *rt_rq = &cpu_rq(i)->rt; | 8936 | struct rt_rq *rt_rq = &cpu_rq(i)->rt; |
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c index 552310798dad..1113157b2058 100644 --- a/kernel/sched_rt.c +++ b/kernel/sched_rt.c | |||
@@ -350,6 +350,7 @@ static void __enable_runtime(struct rq *rq) | |||
350 | spin_lock(&rt_rq->rt_runtime_lock); | 350 | spin_lock(&rt_rq->rt_runtime_lock); |
351 | rt_rq->rt_runtime = rt_b->rt_runtime; | 351 | rt_rq->rt_runtime = rt_b->rt_runtime; |
352 | rt_rq->rt_time = 0; | 352 | rt_rq->rt_time = 0; |
353 | rt_rq->rt_throttled = 0; | ||
353 | spin_unlock(&rt_rq->rt_runtime_lock); | 354 | spin_unlock(&rt_rq->rt_runtime_lock); |
354 | spin_unlock(&rt_b->rt_runtime_lock); | 355 | spin_unlock(&rt_b->rt_runtime_lock); |
355 | } | 356 | } |
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index 1a07f8ca4b92..cb838ee93a82 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -180,10 +180,6 @@ static void check_hung_task(struct task_struct *t, unsigned long now) | |||
180 | if (t->flags & PF_FROZEN) | 180 | if (t->flags & PF_FROZEN) |
181 | return; | 181 | return; |
182 | 182 | ||
183 | /* Don't check for tasks waiting on network file systems like NFS */ | ||
184 | if (t->state & TASK_KILLABLE) | ||
185 | return; | ||
186 | |||
187 | if (switch_count != t->last_switch_count || !t->last_switch_timestamp) { | 183 | if (switch_count != t->last_switch_count || !t->last_switch_timestamp) { |
188 | t->last_switch_count = switch_count; | 184 | t->last_switch_count = switch_count; |
189 | t->last_switch_timestamp = now; | 185 | t->last_switch_timestamp = now; |
@@ -237,7 +233,8 @@ static void check_hung_uninterruptible_tasks(int this_cpu) | |||
237 | do_each_thread(g, t) { | 233 | do_each_thread(g, t) { |
238 | if (!--max_count) | 234 | if (!--max_count) |
239 | goto unlock; | 235 | goto unlock; |
240 | if (t->state & TASK_UNINTERRUPTIBLE) | 236 | /* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */ |
237 | if (t->state == TASK_UNINTERRUPTIBLE) | ||
241 | check_hung_task(t, now); | 238 | check_hung_task(t, now); |
242 | } while_each_thread(g, t); | 239 | } while_each_thread(g, t); |
243 | unlock: | 240 | unlock: |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index fe4713347275..50ec0886fa3d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -159,6 +159,7 @@ static int proc_dointvec_taint(struct ctl_table *table, int write, struct file * | |||
159 | static struct ctl_table root_table[]; | 159 | static struct ctl_table root_table[]; |
160 | static struct ctl_table_root sysctl_table_root; | 160 | static struct ctl_table_root sysctl_table_root; |
161 | static struct ctl_table_header root_table_header = { | 161 | static struct ctl_table_header root_table_header = { |
162 | .count = 1, | ||
162 | .ctl_table = root_table, | 163 | .ctl_table = root_table, |
163 | .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list), | 164 | .ctl_entry = LIST_HEAD_INIT(sysctl_table_root.default_set.list), |
164 | .root = &sysctl_table_root, | 165 | .root = &sysctl_table_root, |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 3d1e3e1a1971..f8d968063cea 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -72,6 +72,16 @@ void clockevents_set_mode(struct clock_event_device *dev, | |||
72 | } | 72 | } |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * clockevents_shutdown - shutdown the device and clear next_event | ||
76 | * @dev: device to shutdown | ||
77 | */ | ||
78 | void clockevents_shutdown(struct clock_event_device *dev) | ||
79 | { | ||
80 | clockevents_set_mode(dev, CLOCK_EVT_MODE_SHUTDOWN); | ||
81 | dev->next_event.tv64 = KTIME_MAX; | ||
82 | } | ||
83 | |||
84 | /** | ||
75 | * clockevents_program_event - Reprogram the clock event device. | 85 | * clockevents_program_event - Reprogram the clock event device. |
76 | * @expires: absolute expiry time (monotonic clock) | 86 | * @expires: absolute expiry time (monotonic clock) |
77 | * | 87 | * |
@@ -177,7 +187,7 @@ void clockevents_register_device(struct clock_event_device *dev) | |||
177 | /* | 187 | /* |
178 | * Noop handler when we shut down an event device | 188 | * Noop handler when we shut down an event device |
179 | */ | 189 | */ |
180 | static void clockevents_handle_noop(struct clock_event_device *dev) | 190 | void clockevents_handle_noop(struct clock_event_device *dev) |
181 | { | 191 | { |
182 | } | 192 | } |
183 | 193 | ||
@@ -199,7 +209,6 @@ void clockevents_exchange_device(struct clock_event_device *old, | |||
199 | * released list and do a notify add later. | 209 | * released list and do a notify add later. |
200 | */ | 210 | */ |
201 | if (old) { | 211 | if (old) { |
202 | old->event_handler = clockevents_handle_noop; | ||
203 | clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED); | 212 | clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED); |
204 | list_del(&old->list); | 213 | list_del(&old->list); |
205 | list_add(&old->list, &clockevents_released); | 214 | list_add(&old->list, &clockevents_released); |
@@ -207,7 +216,7 @@ void clockevents_exchange_device(struct clock_event_device *old, | |||
207 | 216 | ||
208 | if (new) { | 217 | if (new) { |
209 | BUG_ON(new->mode != CLOCK_EVT_MODE_UNUSED); | 218 | BUG_ON(new->mode != CLOCK_EVT_MODE_UNUSED); |
210 | clockevents_set_mode(new, CLOCK_EVT_MODE_SHUTDOWN); | 219 | clockevents_shutdown(new); |
211 | } | 220 | } |
212 | local_irq_restore(flags); | 221 | local_irq_restore(flags); |
213 | } | 222 | } |
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 5125ddd8196b..1ad46f3df6e7 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -245,7 +245,7 @@ static void sync_cmos_clock(unsigned long dummy) | |||
245 | if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2) | 245 | if (abs(now.tv_nsec - (NSEC_PER_SEC / 2)) <= tick_nsec / 2) |
246 | fail = update_persistent_clock(now); | 246 | fail = update_persistent_clock(now); |
247 | 247 | ||
248 | next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec; | 248 | next.tv_nsec = (NSEC_PER_SEC / 2) - now.tv_nsec - (TICK_NSEC / 2); |
249 | if (next.tv_nsec <= 0) | 249 | if (next.tv_nsec <= 0) |
250 | next.tv_nsec += NSEC_PER_SEC; | 250 | next.tv_nsec += NSEC_PER_SEC; |
251 | 251 | ||
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 31463d370b94..f1f3eee28113 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -175,6 +175,8 @@ static void tick_do_periodic_broadcast(void) | |||
175 | */ | 175 | */ |
176 | static void tick_handle_periodic_broadcast(struct clock_event_device *dev) | 176 | static void tick_handle_periodic_broadcast(struct clock_event_device *dev) |
177 | { | 177 | { |
178 | ktime_t next; | ||
179 | |||
178 | tick_do_periodic_broadcast(); | 180 | tick_do_periodic_broadcast(); |
179 | 181 | ||
180 | /* | 182 | /* |
@@ -185,10 +187,13 @@ static void tick_handle_periodic_broadcast(struct clock_event_device *dev) | |||
185 | 187 | ||
186 | /* | 188 | /* |
187 | * Setup the next period for devices, which do not have | 189 | * Setup the next period for devices, which do not have |
188 | * periodic mode: | 190 | * periodic mode. We read dev->next_event first and add to it |
191 | * when the event alrady expired. clockevents_program_event() | ||
192 | * sets dev->next_event only when the event is really | ||
193 | * programmed to the device. | ||
189 | */ | 194 | */ |
190 | for (;;) { | 195 | for (next = dev->next_event; ;) { |
191 | ktime_t next = ktime_add(dev->next_event, tick_period); | 196 | next = ktime_add(next, tick_period); |
192 | 197 | ||
193 | if (!clockevents_program_event(dev, next, ktime_get())) | 198 | if (!clockevents_program_event(dev, next, ktime_get())) |
194 | return; | 199 | return; |
@@ -205,7 +210,7 @@ static void tick_do_broadcast_on_off(void *why) | |||
205 | struct clock_event_device *bc, *dev; | 210 | struct clock_event_device *bc, *dev; |
206 | struct tick_device *td; | 211 | struct tick_device *td; |
207 | unsigned long flags, *reason = why; | 212 | unsigned long flags, *reason = why; |
208 | int cpu; | 213 | int cpu, bc_stopped; |
209 | 214 | ||
210 | spin_lock_irqsave(&tick_broadcast_lock, flags); | 215 | spin_lock_irqsave(&tick_broadcast_lock, flags); |
211 | 216 | ||
@@ -223,14 +228,15 @@ static void tick_do_broadcast_on_off(void *why) | |||
223 | if (!tick_device_is_functional(dev)) | 228 | if (!tick_device_is_functional(dev)) |
224 | goto out; | 229 | goto out; |
225 | 230 | ||
231 | bc_stopped = cpus_empty(tick_broadcast_mask); | ||
232 | |||
226 | switch (*reason) { | 233 | switch (*reason) { |
227 | case CLOCK_EVT_NOTIFY_BROADCAST_ON: | 234 | case CLOCK_EVT_NOTIFY_BROADCAST_ON: |
228 | case CLOCK_EVT_NOTIFY_BROADCAST_FORCE: | 235 | case CLOCK_EVT_NOTIFY_BROADCAST_FORCE: |
229 | if (!cpu_isset(cpu, tick_broadcast_mask)) { | 236 | if (!cpu_isset(cpu, tick_broadcast_mask)) { |
230 | cpu_set(cpu, tick_broadcast_mask); | 237 | cpu_set(cpu, tick_broadcast_mask); |
231 | if (td->mode == TICKDEV_MODE_PERIODIC) | 238 | if (td->mode == TICKDEV_MODE_PERIODIC) |
232 | clockevents_set_mode(dev, | 239 | clockevents_shutdown(dev); |
233 | CLOCK_EVT_MODE_SHUTDOWN); | ||
234 | } | 240 | } |
235 | if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE) | 241 | if (*reason == CLOCK_EVT_NOTIFY_BROADCAST_FORCE) |
236 | tick_broadcast_force = 1; | 242 | tick_broadcast_force = 1; |
@@ -245,9 +251,10 @@ static void tick_do_broadcast_on_off(void *why) | |||
245 | break; | 251 | break; |
246 | } | 252 | } |
247 | 253 | ||
248 | if (cpus_empty(tick_broadcast_mask)) | 254 | if (cpus_empty(tick_broadcast_mask)) { |
249 | clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); | 255 | if (!bc_stopped) |
250 | else { | 256 | clockevents_shutdown(bc); |
257 | } else if (bc_stopped) { | ||
251 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) | 258 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) |
252 | tick_broadcast_start_periodic(bc); | 259 | tick_broadcast_start_periodic(bc); |
253 | else | 260 | else |
@@ -298,7 +305,7 @@ void tick_shutdown_broadcast(unsigned int *cpup) | |||
298 | 305 | ||
299 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) { | 306 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC) { |
300 | if (bc && cpus_empty(tick_broadcast_mask)) | 307 | if (bc && cpus_empty(tick_broadcast_mask)) |
301 | clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); | 308 | clockevents_shutdown(bc); |
302 | } | 309 | } |
303 | 310 | ||
304 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | 311 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); |
@@ -313,7 +320,7 @@ void tick_suspend_broadcast(void) | |||
313 | 320 | ||
314 | bc = tick_broadcast_device.evtdev; | 321 | bc = tick_broadcast_device.evtdev; |
315 | if (bc) | 322 | if (bc) |
316 | clockevents_set_mode(bc, CLOCK_EVT_MODE_SHUTDOWN); | 323 | clockevents_shutdown(bc); |
317 | 324 | ||
318 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | 325 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); |
319 | } | 326 | } |
@@ -364,16 +371,8 @@ cpumask_t *tick_get_broadcast_oneshot_mask(void) | |||
364 | static int tick_broadcast_set_event(ktime_t expires, int force) | 371 | static int tick_broadcast_set_event(ktime_t expires, int force) |
365 | { | 372 | { |
366 | struct clock_event_device *bc = tick_broadcast_device.evtdev; | 373 | struct clock_event_device *bc = tick_broadcast_device.evtdev; |
367 | ktime_t now = ktime_get(); | 374 | |
368 | int res; | 375 | return tick_dev_program_event(bc, expires, force); |
369 | |||
370 | for(;;) { | ||
371 | res = clockevents_program_event(bc, expires, now); | ||
372 | if (!res || !force) | ||
373 | return res; | ||
374 | now = ktime_get(); | ||
375 | expires = ktime_add(now, ktime_set(0, bc->min_delta_ns)); | ||
376 | } | ||
377 | } | 376 | } |
378 | 377 | ||
379 | int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | 378 | int tick_resume_broadcast_oneshot(struct clock_event_device *bc) |
@@ -491,14 +490,52 @@ static void tick_broadcast_clear_oneshot(int cpu) | |||
491 | cpu_clear(cpu, tick_broadcast_oneshot_mask); | 490 | cpu_clear(cpu, tick_broadcast_oneshot_mask); |
492 | } | 491 | } |
493 | 492 | ||
493 | static void tick_broadcast_init_next_event(cpumask_t *mask, ktime_t expires) | ||
494 | { | ||
495 | struct tick_device *td; | ||
496 | int cpu; | ||
497 | |||
498 | for_each_cpu_mask_nr(cpu, *mask) { | ||
499 | td = &per_cpu(tick_cpu_device, cpu); | ||
500 | if (td->evtdev) | ||
501 | td->evtdev->next_event = expires; | ||
502 | } | ||
503 | } | ||
504 | |||
494 | /** | 505 | /** |
495 | * tick_broadcast_setup_oneshot - setup the broadcast device | 506 | * tick_broadcast_setup_oneshot - setup the broadcast device |
496 | */ | 507 | */ |
497 | void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | 508 | void tick_broadcast_setup_oneshot(struct clock_event_device *bc) |
498 | { | 509 | { |
499 | bc->event_handler = tick_handle_oneshot_broadcast; | 510 | /* Set it up only once ! */ |
500 | clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | 511 | if (bc->event_handler != tick_handle_oneshot_broadcast) { |
501 | bc->next_event.tv64 = KTIME_MAX; | 512 | int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; |
513 | int cpu = smp_processor_id(); | ||
514 | cpumask_t mask; | ||
515 | |||
516 | bc->event_handler = tick_handle_oneshot_broadcast; | ||
517 | clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | ||
518 | |||
519 | /* Take the do_timer update */ | ||
520 | tick_do_timer_cpu = cpu; | ||
521 | |||
522 | /* | ||
523 | * We must be careful here. There might be other CPUs | ||
524 | * waiting for periodic broadcast. We need to set the | ||
525 | * oneshot_mask bits for those and program the | ||
526 | * broadcast device to fire. | ||
527 | */ | ||
528 | mask = tick_broadcast_mask; | ||
529 | cpu_clear(cpu, mask); | ||
530 | cpus_or(tick_broadcast_oneshot_mask, | ||
531 | tick_broadcast_oneshot_mask, mask); | ||
532 | |||
533 | if (was_periodic && !cpus_empty(mask)) { | ||
534 | tick_broadcast_init_next_event(&mask, tick_next_period); | ||
535 | tick_broadcast_set_event(tick_next_period, 1); | ||
536 | } else | ||
537 | bc->next_event.tv64 = KTIME_MAX; | ||
538 | } | ||
502 | } | 539 | } |
503 | 540 | ||
504 | /* | 541 | /* |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 80c4336f4188..019315ebf9de 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -161,6 +161,7 @@ static void tick_setup_device(struct tick_device *td, | |||
161 | } else { | 161 | } else { |
162 | handler = td->evtdev->event_handler; | 162 | handler = td->evtdev->event_handler; |
163 | next_event = td->evtdev->next_event; | 163 | next_event = td->evtdev->next_event; |
164 | td->evtdev->event_handler = clockevents_handle_noop; | ||
164 | } | 165 | } |
165 | 166 | ||
166 | td->evtdev = newdev; | 167 | td->evtdev = newdev; |
@@ -248,7 +249,7 @@ static int tick_check_new_device(struct clock_event_device *newdev) | |||
248 | * not give it back to the clockevents layer ! | 249 | * not give it back to the clockevents layer ! |
249 | */ | 250 | */ |
250 | if (tick_is_broadcast_device(curdev)) { | 251 | if (tick_is_broadcast_device(curdev)) { |
251 | clockevents_set_mode(curdev, CLOCK_EVT_MODE_SHUTDOWN); | 252 | clockevents_shutdown(curdev); |
252 | curdev = NULL; | 253 | curdev = NULL; |
253 | } | 254 | } |
254 | clockevents_exchange_device(curdev, newdev); | 255 | clockevents_exchange_device(curdev, newdev); |
@@ -310,7 +311,7 @@ static void tick_suspend(void) | |||
310 | unsigned long flags; | 311 | unsigned long flags; |
311 | 312 | ||
312 | spin_lock_irqsave(&tick_device_lock, flags); | 313 | spin_lock_irqsave(&tick_device_lock, flags); |
313 | clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN); | 314 | clockevents_shutdown(td->evtdev); |
314 | spin_unlock_irqrestore(&tick_device_lock, flags); | 315 | spin_unlock_irqrestore(&tick_device_lock, flags); |
315 | } | 316 | } |
316 | 317 | ||
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index f13f2b7f4fd4..6e9db9734aa6 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -10,6 +10,8 @@ extern int tick_do_timer_cpu __read_mostly; | |||
10 | extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast); | 10 | extern void tick_setup_periodic(struct clock_event_device *dev, int broadcast); |
11 | extern void tick_handle_periodic(struct clock_event_device *dev); | 11 | extern void tick_handle_periodic(struct clock_event_device *dev); |
12 | 12 | ||
13 | extern void clockevents_shutdown(struct clock_event_device *dev); | ||
14 | |||
13 | /* | 15 | /* |
14 | * NO_HZ / high resolution timer shared code | 16 | * NO_HZ / high resolution timer shared code |
15 | */ | 17 | */ |
@@ -17,6 +19,8 @@ extern void tick_handle_periodic(struct clock_event_device *dev); | |||
17 | extern void tick_setup_oneshot(struct clock_event_device *newdev, | 19 | extern void tick_setup_oneshot(struct clock_event_device *newdev, |
18 | void (*handler)(struct clock_event_device *), | 20 | void (*handler)(struct clock_event_device *), |
19 | ktime_t nextevt); | 21 | ktime_t nextevt); |
22 | extern int tick_dev_program_event(struct clock_event_device *dev, | ||
23 | ktime_t expires, int force); | ||
20 | extern int tick_program_event(ktime_t expires, int force); | 24 | extern int tick_program_event(ktime_t expires, int force); |
21 | extern void tick_oneshot_notify(void); | 25 | extern void tick_oneshot_notify(void); |
22 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); | 26 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); |
diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c index 450c04935b66..2e8de678e767 100644 --- a/kernel/time/tick-oneshot.c +++ b/kernel/time/tick-oneshot.c | |||
@@ -23,24 +23,56 @@ | |||
23 | #include "tick-internal.h" | 23 | #include "tick-internal.h" |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * tick_program_event | 26 | * tick_program_event internal worker function |
27 | */ | 27 | */ |
28 | int tick_program_event(ktime_t expires, int force) | 28 | int tick_dev_program_event(struct clock_event_device *dev, ktime_t expires, |
29 | int force) | ||
29 | { | 30 | { |
30 | struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; | ||
31 | ktime_t now = ktime_get(); | 31 | ktime_t now = ktime_get(); |
32 | int i; | ||
32 | 33 | ||
33 | while (1) { | 34 | for (i = 0;;) { |
34 | int ret = clockevents_program_event(dev, expires, now); | 35 | int ret = clockevents_program_event(dev, expires, now); |
35 | 36 | ||
36 | if (!ret || !force) | 37 | if (!ret || !force) |
37 | return ret; | 38 | return ret; |
39 | |||
40 | /* | ||
41 | * We tried 2 times to program the device with the given | ||
42 | * min_delta_ns. If that's not working then we double it | ||
43 | * and emit a warning. | ||
44 | */ | ||
45 | if (++i > 2) { | ||
46 | /* Increase the min. delta and try again */ | ||
47 | if (!dev->min_delta_ns) | ||
48 | dev->min_delta_ns = 5000; | ||
49 | else | ||
50 | dev->min_delta_ns += dev->min_delta_ns >> 1; | ||
51 | |||
52 | printk(KERN_WARNING | ||
53 | "CE: %s increasing min_delta_ns to %lu nsec\n", | ||
54 | dev->name ? dev->name : "?", | ||
55 | dev->min_delta_ns << 1); | ||
56 | |||
57 | i = 0; | ||
58 | } | ||
59 | |||
38 | now = ktime_get(); | 60 | now = ktime_get(); |
39 | expires = ktime_add(now, ktime_set(0, dev->min_delta_ns)); | 61 | expires = ktime_add_ns(now, dev->min_delta_ns); |
40 | } | 62 | } |
41 | } | 63 | } |
42 | 64 | ||
43 | /** | 65 | /** |
66 | * tick_program_event | ||
67 | */ | ||
68 | int tick_program_event(ktime_t expires, int force) | ||
69 | { | ||
70 | struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev; | ||
71 | |||
72 | return tick_dev_program_event(dev, expires, force); | ||
73 | } | ||
74 | |||
75 | /** | ||
44 | * tick_resume_onshot - resume oneshot mode | 76 | * tick_resume_onshot - resume oneshot mode |
45 | */ | 77 | */ |
46 | void tick_resume_oneshot(void) | 78 | void tick_resume_oneshot(void) |
@@ -61,7 +93,7 @@ void tick_setup_oneshot(struct clock_event_device *newdev, | |||
61 | { | 93 | { |
62 | newdev->event_handler = handler; | 94 | newdev->event_handler = handler; |
63 | clockevents_set_mode(newdev, CLOCK_EVT_MODE_ONESHOT); | 95 | clockevents_set_mode(newdev, CLOCK_EVT_MODE_ONESHOT); |
64 | clockevents_program_event(newdev, next_event, ktime_get()); | 96 | tick_dev_program_event(newdev, next_event, 1); |
65 | } | 97 | } |
66 | 98 | ||
67 | /** | 99 | /** |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 7a46bde78c66..a87b0468568b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -162,6 +162,8 @@ void tick_nohz_stop_idle(int cpu) | |||
162 | ts->idle_lastupdate = now; | 162 | ts->idle_lastupdate = now; |
163 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); | 163 | ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); |
164 | ts->idle_active = 0; | 164 | ts->idle_active = 0; |
165 | |||
166 | sched_clock_idle_wakeup_event(0); | ||
165 | } | 167 | } |
166 | } | 168 | } |
167 | 169 | ||
@@ -177,6 +179,7 @@ static ktime_t tick_nohz_start_idle(struct tick_sched *ts) | |||
177 | } | 179 | } |
178 | ts->idle_entrytime = now; | 180 | ts->idle_entrytime = now; |
179 | ts->idle_active = 1; | 181 | ts->idle_active = 1; |
182 | sched_clock_idle_sleep_event(); | ||
180 | return now; | 183 | return now; |
181 | } | 184 | } |
182 | 185 | ||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 8b5a7d304a5f..0b504814e378 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -394,7 +394,7 @@ config LOCKDEP | |||
394 | bool | 394 | bool |
395 | depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | 395 | depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT |
396 | select STACKTRACE | 396 | select STACKTRACE |
397 | select FRAME_POINTER if !X86 && !MIPS | 397 | select FRAME_POINTER if !X86 && !MIPS && !PPC |
398 | select KALLSYMS | 398 | select KALLSYMS |
399 | select KALLSYMS_ALL | 399 | select KALLSYMS_ALL |
400 | 400 | ||
@@ -676,13 +676,13 @@ config FAULT_INJECTION_STACKTRACE_FILTER | |||
676 | depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT | 676 | depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT |
677 | depends on !X86_64 | 677 | depends on !X86_64 |
678 | select STACKTRACE | 678 | select STACKTRACE |
679 | select FRAME_POINTER | 679 | select FRAME_POINTER if !PPC |
680 | help | 680 | help |
681 | Provide stacktrace filter for fault-injection capabilities | 681 | Provide stacktrace filter for fault-injection capabilities |
682 | 682 | ||
683 | config LATENCYTOP | 683 | config LATENCYTOP |
684 | bool "Latency measuring infrastructure" | 684 | bool "Latency measuring infrastructure" |
685 | select FRAME_POINTER if !MIPS | 685 | select FRAME_POINTER if !MIPS && !PPC |
686 | select KALLSYMS | 686 | select KALLSYMS |
687 | select KALLSYMS_ALL | 687 | select KALLSYMS_ALL |
688 | select STACKTRACE | 688 | select STACKTRACE |
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 45a6bde762d1..e3ab374e1334 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c | |||
@@ -112,6 +112,7 @@ static struct debug_obj *lookup_object(void *addr, struct debug_bucket *b) | |||
112 | 112 | ||
113 | /* | 113 | /* |
114 | * Allocate a new object. If the pool is empty, switch off the debugger. | 114 | * Allocate a new object. If the pool is empty, switch off the debugger. |
115 | * Must be called with interrupts disabled. | ||
115 | */ | 116 | */ |
116 | static struct debug_obj * | 117 | static struct debug_obj * |
117 | alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr) | 118 | alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr) |
@@ -148,17 +149,18 @@ alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr) | |||
148 | static void free_object(struct debug_obj *obj) | 149 | static void free_object(struct debug_obj *obj) |
149 | { | 150 | { |
150 | unsigned long idx = (unsigned long)(obj - obj_static_pool); | 151 | unsigned long idx = (unsigned long)(obj - obj_static_pool); |
152 | unsigned long flags; | ||
151 | 153 | ||
152 | if (obj_pool_free < ODEBUG_POOL_SIZE || idx < ODEBUG_POOL_SIZE) { | 154 | if (obj_pool_free < ODEBUG_POOL_SIZE || idx < ODEBUG_POOL_SIZE) { |
153 | spin_lock(&pool_lock); | 155 | spin_lock_irqsave(&pool_lock, flags); |
154 | hlist_add_head(&obj->node, &obj_pool); | 156 | hlist_add_head(&obj->node, &obj_pool); |
155 | obj_pool_free++; | 157 | obj_pool_free++; |
156 | obj_pool_used--; | 158 | obj_pool_used--; |
157 | spin_unlock(&pool_lock); | 159 | spin_unlock_irqrestore(&pool_lock, flags); |
158 | } else { | 160 | } else { |
159 | spin_lock(&pool_lock); | 161 | spin_lock_irqsave(&pool_lock, flags); |
160 | obj_pool_used--; | 162 | obj_pool_used--; |
161 | spin_unlock(&pool_lock); | 163 | spin_unlock_irqrestore(&pool_lock, flags); |
162 | kmem_cache_free(obj_cache, obj); | 164 | kmem_cache_free(obj_cache, obj); |
163 | } | 165 | } |
164 | } | 166 | } |
@@ -171,6 +173,7 @@ static void debug_objects_oom(void) | |||
171 | { | 173 | { |
172 | struct debug_bucket *db = obj_hash; | 174 | struct debug_bucket *db = obj_hash; |
173 | struct hlist_node *node, *tmp; | 175 | struct hlist_node *node, *tmp; |
176 | HLIST_HEAD(freelist); | ||
174 | struct debug_obj *obj; | 177 | struct debug_obj *obj; |
175 | unsigned long flags; | 178 | unsigned long flags; |
176 | int i; | 179 | int i; |
@@ -179,11 +182,14 @@ static void debug_objects_oom(void) | |||
179 | 182 | ||
180 | for (i = 0; i < ODEBUG_HASH_SIZE; i++, db++) { | 183 | for (i = 0; i < ODEBUG_HASH_SIZE; i++, db++) { |
181 | spin_lock_irqsave(&db->lock, flags); | 184 | spin_lock_irqsave(&db->lock, flags); |
182 | hlist_for_each_entry_safe(obj, node, tmp, &db->list, node) { | 185 | hlist_move_list(&db->list, &freelist); |
186 | spin_unlock_irqrestore(&db->lock, flags); | ||
187 | |||
188 | /* Now free them */ | ||
189 | hlist_for_each_entry_safe(obj, node, tmp, &freelist, node) { | ||
183 | hlist_del(&obj->node); | 190 | hlist_del(&obj->node); |
184 | free_object(obj); | 191 | free_object(obj); |
185 | } | 192 | } |
186 | spin_unlock_irqrestore(&db->lock, flags); | ||
187 | } | 193 | } |
188 | } | 194 | } |
189 | 195 | ||
@@ -498,8 +504,9 @@ void debug_object_free(void *addr, struct debug_obj_descr *descr) | |||
498 | return; | 504 | return; |
499 | default: | 505 | default: |
500 | hlist_del(&obj->node); | 506 | hlist_del(&obj->node); |
507 | spin_unlock_irqrestore(&db->lock, flags); | ||
501 | free_object(obj); | 508 | free_object(obj); |
502 | break; | 509 | return; |
503 | } | 510 | } |
504 | out_unlock: | 511 | out_unlock: |
505 | spin_unlock_irqrestore(&db->lock, flags); | 512 | spin_unlock_irqrestore(&db->lock, flags); |
@@ -510,6 +517,7 @@ static void __debug_check_no_obj_freed(const void *address, unsigned long size) | |||
510 | { | 517 | { |
511 | unsigned long flags, oaddr, saddr, eaddr, paddr, chunks; | 518 | unsigned long flags, oaddr, saddr, eaddr, paddr, chunks; |
512 | struct hlist_node *node, *tmp; | 519 | struct hlist_node *node, *tmp; |
520 | HLIST_HEAD(freelist); | ||
513 | struct debug_obj_descr *descr; | 521 | struct debug_obj_descr *descr; |
514 | enum debug_obj_state state; | 522 | enum debug_obj_state state; |
515 | struct debug_bucket *db; | 523 | struct debug_bucket *db; |
@@ -545,11 +553,18 @@ repeat: | |||
545 | goto repeat; | 553 | goto repeat; |
546 | default: | 554 | default: |
547 | hlist_del(&obj->node); | 555 | hlist_del(&obj->node); |
548 | free_object(obj); | 556 | hlist_add_head(&obj->node, &freelist); |
549 | break; | 557 | break; |
550 | } | 558 | } |
551 | } | 559 | } |
552 | spin_unlock_irqrestore(&db->lock, flags); | 560 | spin_unlock_irqrestore(&db->lock, flags); |
561 | |||
562 | /* Now free them */ | ||
563 | hlist_for_each_entry_safe(obj, node, tmp, &freelist, node) { | ||
564 | hlist_del(&obj->node); | ||
565 | free_object(obj); | ||
566 | } | ||
567 | |||
553 | if (cnt > debug_objects_maxchain) | 568 | if (cnt > debug_objects_maxchain) |
554 | debug_objects_maxchain = cnt; | 569 | debug_objects_maxchain = cnt; |
555 | } | 570 | } |
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 876ba6d5b670..8d2688ff1352 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
@@ -422,9 +422,12 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, | |||
422 | { | 422 | { |
423 | unsigned int offset = 0; | 423 | unsigned int offset = 0; |
424 | struct sg_mapping_iter miter; | 424 | struct sg_mapping_iter miter; |
425 | unsigned long flags; | ||
425 | 426 | ||
426 | sg_miter_start(&miter, sgl, nents, SG_MITER_ATOMIC); | 427 | sg_miter_start(&miter, sgl, nents, SG_MITER_ATOMIC); |
427 | 428 | ||
429 | local_irq_save(flags); | ||
430 | |||
428 | while (sg_miter_next(&miter) && offset < buflen) { | 431 | while (sg_miter_next(&miter) && offset < buflen) { |
429 | unsigned int len; | 432 | unsigned int len; |
430 | 433 | ||
@@ -442,6 +445,7 @@ static size_t sg_copy_buffer(struct scatterlist *sgl, unsigned int nents, | |||
442 | 445 | ||
443 | sg_miter_stop(&miter); | 446 | sg_miter_stop(&miter); |
444 | 447 | ||
448 | local_irq_restore(flags); | ||
445 | return offset; | 449 | return offset; |
446 | } | 450 | } |
447 | 451 | ||
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 977edbdbc1de..8826fdf0f180 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -491,7 +491,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |||
491 | * the lowest available address range. | 491 | * the lowest available address range. |
492 | */ | 492 | */ |
493 | dma_addr_t handle; | 493 | dma_addr_t handle; |
494 | handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE); | 494 | handle = swiotlb_map_single(hwdev, NULL, size, DMA_FROM_DEVICE); |
495 | if (swiotlb_dma_mapping_error(hwdev, handle)) | 495 | if (swiotlb_dma_mapping_error(hwdev, handle)) |
496 | return NULL; | 496 | return NULL; |
497 | 497 | ||
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index d8d1d1142248..c399bc1093cb 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <asm/page.h> /* for PAGE_SIZE */ | 28 | #include <asm/page.h> /* for PAGE_SIZE */ |
29 | #include <asm/div64.h> | 29 | #include <asm/div64.h> |
30 | #include <asm/sections.h> /* for dereference_function_descriptor() */ | ||
30 | 31 | ||
31 | /* Works only for digits and letters, but small and fast */ | 32 | /* Works only for digits and letters, but small and fast */ |
32 | #define TOLOWER(x) ((x) | 0x20) | 33 | #define TOLOWER(x) ((x) | 0x20) |
@@ -513,16 +514,6 @@ static char *string(char *buf, char *end, char *s, int field_width, int precisio | |||
513 | return buf; | 514 | return buf; |
514 | } | 515 | } |
515 | 516 | ||
516 | static inline void *dereference_function_descriptor(void *ptr) | ||
517 | { | ||
518 | #if defined(CONFIG_IA64) || defined(CONFIG_PPC64) | ||
519 | void *p; | ||
520 | if (!probe_kernel_address(ptr, p)) | ||
521 | ptr = p; | ||
522 | #endif | ||
523 | return ptr; | ||
524 | } | ||
525 | |||
526 | static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) | 517 | static char *symbol_string(char *buf, char *end, void *ptr, int field_width, int precision, int flags) |
527 | { | 518 | { |
528 | unsigned long value = (unsigned long) ptr; | 519 | unsigned long value = (unsigned long) ptr; |
diff --git a/mm/filemap.c b/mm/filemap.c index 54e968650855..876bc595d0f8 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2129,13 +2129,20 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
2129 | * After a write we want buffered reads to be sure to go to disk to get | 2129 | * After a write we want buffered reads to be sure to go to disk to get |
2130 | * the new data. We invalidate clean cached page from the region we're | 2130 | * the new data. We invalidate clean cached page from the region we're |
2131 | * about to write. We do this *before* the write so that we can return | 2131 | * about to write. We do this *before* the write so that we can return |
2132 | * -EIO without clobbering -EIOCBQUEUED from ->direct_IO(). | 2132 | * without clobbering -EIOCBQUEUED from ->direct_IO(). |
2133 | */ | 2133 | */ |
2134 | if (mapping->nrpages) { | 2134 | if (mapping->nrpages) { |
2135 | written = invalidate_inode_pages2_range(mapping, | 2135 | written = invalidate_inode_pages2_range(mapping, |
2136 | pos >> PAGE_CACHE_SHIFT, end); | 2136 | pos >> PAGE_CACHE_SHIFT, end); |
2137 | if (written) | 2137 | /* |
2138 | * If a page can not be invalidated, return 0 to fall back | ||
2139 | * to buffered write. | ||
2140 | */ | ||
2141 | if (written) { | ||
2142 | if (written == -EBUSY) | ||
2143 | return 0; | ||
2138 | goto out; | 2144 | goto out; |
2145 | } | ||
2139 | } | 2146 | } |
2140 | 2147 | ||
2141 | written = mapping->a_ops->direct_IO(WRITE, iocb, iov, pos, *nr_segs); | 2148 | written = mapping->a_ops->direct_IO(WRITE, iocb, iov, pos, *nr_segs); |
@@ -1030,6 +1030,10 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, | |||
1030 | } else { | 1030 | } else { |
1031 | switch (flags & MAP_TYPE) { | 1031 | switch (flags & MAP_TYPE) { |
1032 | case MAP_SHARED: | 1032 | case MAP_SHARED: |
1033 | /* | ||
1034 | * Ignore pgoff. | ||
1035 | */ | ||
1036 | pgoff = 0; | ||
1033 | vm_flags |= VM_SHARED | VM_MAYSHARE; | 1037 | vm_flags |= VM_SHARED | VM_MAYSHARE; |
1034 | break; | 1038 | break; |
1035 | case MAP_PRIVATE: | 1039 | case MAP_PRIVATE: |
diff --git a/mm/mmzone.c b/mm/mmzone.c index 486ed595ee6f..16ce8b955dcf 100644 --- a/mm/mmzone.c +++ b/mm/mmzone.c | |||
@@ -69,6 +69,6 @@ struct zoneref *next_zones_zonelist(struct zoneref *z, | |||
69 | (z->zone && !zref_in_nodemask(z, nodes))) | 69 | (z->zone && !zref_in_nodemask(z, nodes))) |
70 | z++; | 70 | z++; |
71 | 71 | ||
72 | *zone = zonelist_zone(z++); | 72 | *zone = zonelist_zone(z); |
73 | return z; | 73 | return z; |
74 | } | 74 | } |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index af982f7cdb2a..e293c58bea58 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -694,6 +694,9 @@ static int move_freepages(struct zone *zone, | |||
694 | #endif | 694 | #endif |
695 | 695 | ||
696 | for (page = start_page; page <= end_page;) { | 696 | for (page = start_page; page <= end_page;) { |
697 | /* Make sure we are not inadvertently changing nodes */ | ||
698 | VM_BUG_ON(page_to_nid(page) != zone_to_nid(zone)); | ||
699 | |||
697 | if (!pfn_valid_within(page_to_pfn(page))) { | 700 | if (!pfn_valid_within(page_to_pfn(page))) { |
698 | page++; | 701 | page++; |
699 | continue; | 702 | continue; |
@@ -2516,6 +2519,10 @@ static void setup_zone_migrate_reserve(struct zone *zone) | |||
2516 | continue; | 2519 | continue; |
2517 | page = pfn_to_page(pfn); | 2520 | page = pfn_to_page(pfn); |
2518 | 2521 | ||
2522 | /* Watch out for overlapping nodes */ | ||
2523 | if (page_to_nid(page) != zone_to_nid(zone)) | ||
2524 | continue; | ||
2525 | |||
2519 | /* Blocks with reserved pages will never free, skip them. */ | 2526 | /* Blocks with reserved pages will never free, skip them. */ |
2520 | if (PageReserved(page)) | 2527 | if (PageReserved(page)) |
2521 | continue; | 2528 | continue; |
@@ -4064,7 +4071,7 @@ void __init set_dma_reserve(unsigned long new_dma_reserve) | |||
4064 | } | 4071 | } |
4065 | 4072 | ||
4066 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 4073 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
4067 | struct pglist_data contig_page_data = { .bdata = &bootmem_node_data[0] }; | 4074 | struct pglist_data __refdata contig_page_data = { .bdata = &bootmem_node_data[0] }; |
4068 | EXPORT_SYMBOL(contig_page_data); | 4075 | EXPORT_SYMBOL(contig_page_data); |
4069 | #endif | 4076 | #endif |
4070 | 4077 | ||
diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 3444b58033c8..c69f84fe038d 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c | |||
@@ -2,7 +2,6 @@ | |||
2 | * linux/mm/page_isolation.c | 2 | * linux/mm/page_isolation.c |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <stddef.h> | ||
6 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
7 | #include <linux/page-isolation.h> | 6 | #include <linux/page-isolation.h> |
8 | #include <linux/pageblock-flags.h> | 7 | #include <linux/pageblock-flags.h> |
diff --git a/mm/quicklist.c b/mm/quicklist.c index 3f703f7cb398..8dbb6805ef35 100644 --- a/mm/quicklist.c +++ b/mm/quicklist.c | |||
@@ -26,7 +26,10 @@ DEFINE_PER_CPU(struct quicklist, quicklist)[CONFIG_NR_QUICK]; | |||
26 | static unsigned long max_pages(unsigned long min_pages) | 26 | static unsigned long max_pages(unsigned long min_pages) |
27 | { | 27 | { |
28 | unsigned long node_free_pages, max; | 28 | unsigned long node_free_pages, max; |
29 | struct zone *zones = NODE_DATA(numa_node_id())->node_zones; | 29 | int node = numa_node_id(); |
30 | struct zone *zones = NODE_DATA(node)->node_zones; | ||
31 | int num_cpus_on_node; | ||
32 | node_to_cpumask_ptr(cpumask_on_node, node); | ||
30 | 33 | ||
31 | node_free_pages = | 34 | node_free_pages = |
32 | #ifdef CONFIG_ZONE_DMA | 35 | #ifdef CONFIG_ZONE_DMA |
@@ -38,6 +41,10 @@ static unsigned long max_pages(unsigned long min_pages) | |||
38 | zone_page_state(&zones[ZONE_NORMAL], NR_FREE_PAGES); | 41 | zone_page_state(&zones[ZONE_NORMAL], NR_FREE_PAGES); |
39 | 42 | ||
40 | max = node_free_pages / FRACTION_OF_NODE_MEM; | 43 | max = node_free_pages / FRACTION_OF_NODE_MEM; |
44 | |||
45 | num_cpus_on_node = cpus_weight_nr(*cpumask_on_node); | ||
46 | max /= num_cpus_on_node; | ||
47 | |||
41 | return max(max, min_pages); | 48 | return max(max, min_pages); |
42 | } | 49 | } |
43 | 50 | ||
@@ -1932,6 +1932,7 @@ init_kmem_cache_node(struct kmem_cache_node *n, struct kmem_cache *s) | |||
1932 | INIT_LIST_HEAD(&n->partial); | 1932 | INIT_LIST_HEAD(&n->partial); |
1933 | #ifdef CONFIG_SLUB_DEBUG | 1933 | #ifdef CONFIG_SLUB_DEBUG |
1934 | atomic_long_set(&n->nr_slabs, 0); | 1934 | atomic_long_set(&n->nr_slabs, 0); |
1935 | atomic_long_set(&n->total_objects, 0); | ||
1935 | INIT_LIST_HEAD(&n->full); | 1936 | INIT_LIST_HEAD(&n->full); |
1936 | #endif | 1937 | #endif |
1937 | } | 1938 | } |
diff --git a/mm/truncate.c b/mm/truncate.c index 250505091d37..6650c1d878b4 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
@@ -380,7 +380,7 @@ static int do_launder_page(struct address_space *mapping, struct page *page) | |||
380 | * Any pages which are found to be mapped into pagetables are unmapped prior to | 380 | * Any pages which are found to be mapped into pagetables are unmapped prior to |
381 | * invalidation. | 381 | * invalidation. |
382 | * | 382 | * |
383 | * Returns -EIO if any pages could not be invalidated. | 383 | * Returns -EBUSY if any pages could not be invalidated. |
384 | */ | 384 | */ |
385 | int invalidate_inode_pages2_range(struct address_space *mapping, | 385 | int invalidate_inode_pages2_range(struct address_space *mapping, |
386 | pgoff_t start, pgoff_t end) | 386 | pgoff_t start, pgoff_t end) |
@@ -440,7 +440,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping, | |||
440 | ret2 = do_launder_page(mapping, page); | 440 | ret2 = do_launder_page(mapping, page); |
441 | if (ret2 == 0) { | 441 | if (ret2 == 0) { |
442 | if (!invalidate_complete_page2(mapping, page)) | 442 | if (!invalidate_complete_page2(mapping, page)) |
443 | ret2 = -EIO; | 443 | ret2 = -EBUSY; |
444 | } | 444 | } |
445 | if (ret2 < 0) | 445 | if (ret2 < 0) |
446 | ret = ret2; | 446 | ret = ret2; |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 1edfdf4c095b..f6348e078aa4 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #define BT_DBG(D...) | 49 | #define BT_DBG(D...) |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #define VERSION "2.12" | 52 | #define VERSION "2.13" |
53 | 53 | ||
54 | /* Bluetooth sockets */ | 54 | /* Bluetooth sockets */ |
55 | #define BT_MAX_PROTO 8 | 55 | #define BT_MAX_PROTO 8 |
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index ca8d05245ca0..b7002429f152 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -330,7 +330,7 @@ EXPORT_SYMBOL(hci_get_route); | |||
330 | 330 | ||
331 | /* Create SCO or ACL connection. | 331 | /* Create SCO or ACL connection. |
332 | * Device _must_ be locked */ | 332 | * Device _must_ be locked */ |
333 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst) | 333 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 auth_type) |
334 | { | 334 | { |
335 | struct hci_conn *acl; | 335 | struct hci_conn *acl; |
336 | struct hci_conn *sco; | 336 | struct hci_conn *sco; |
@@ -344,8 +344,10 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
344 | 344 | ||
345 | hci_conn_hold(acl); | 345 | hci_conn_hold(acl); |
346 | 346 | ||
347 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) | 347 | if (acl->state == BT_OPEN || acl->state == BT_CLOSED) { |
348 | acl->auth_type = auth_type; | ||
348 | hci_acl_connect(acl); | 349 | hci_acl_connect(acl); |
350 | } | ||
349 | 351 | ||
350 | if (type == ACL_LINK) | 352 | if (type == ACL_LINK) |
351 | return acl; | 353 | return acl; |
@@ -374,6 +376,19 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
374 | } | 376 | } |
375 | EXPORT_SYMBOL(hci_connect); | 377 | EXPORT_SYMBOL(hci_connect); |
376 | 378 | ||
379 | /* Check link security requirement */ | ||
380 | int hci_conn_check_link_mode(struct hci_conn *conn) | ||
381 | { | ||
382 | BT_DBG("conn %p", conn); | ||
383 | |||
384 | if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0 && | ||
385 | !(conn->link_mode & HCI_LM_ENCRYPT)) | ||
386 | return 0; | ||
387 | |||
388 | return 1; | ||
389 | } | ||
390 | EXPORT_SYMBOL(hci_conn_check_link_mode); | ||
391 | |||
377 | /* Authenticate remote device */ | 392 | /* Authenticate remote device */ |
378 | int hci_conn_auth(struct hci_conn *conn) | 393 | int hci_conn_auth(struct hci_conn *conn) |
379 | { | 394 | { |
@@ -381,7 +396,7 @@ int hci_conn_auth(struct hci_conn *conn) | |||
381 | 396 | ||
382 | if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0) { | 397 | if (conn->ssp_mode > 0 && conn->hdev->ssp_mode > 0) { |
383 | if (!(conn->auth_type & 0x01)) { | 398 | if (!(conn->auth_type & 0x01)) { |
384 | conn->auth_type = HCI_AT_GENERAL_BONDING_MITM; | 399 | conn->auth_type |= 0x01; |
385 | conn->link_mode &= ~HCI_LM_AUTH; | 400 | conn->link_mode &= ~HCI_LM_AUTH; |
386 | } | 401 | } |
387 | } | 402 | } |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index f5b21cb93699..278a3ace14f6 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -164,6 +164,9 @@ static inline int hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev * | |||
164 | { | 164 | { |
165 | int ret; | 165 | int ret; |
166 | 166 | ||
167 | if (!test_bit(HCI_UP, &hdev->flags)) | ||
168 | return -ENETDOWN; | ||
169 | |||
167 | /* Serialize all requests */ | 170 | /* Serialize all requests */ |
168 | hci_req_lock(hdev); | 171 | hci_req_lock(hdev); |
169 | ret = __hci_request(hdev, req, opt, timeout); | 172 | ret = __hci_request(hdev, req, opt, timeout); |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 0e3db289f4be..ad7a553d7713 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1605,14 +1605,11 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b | |||
1605 | 1605 | ||
1606 | if (conn->state == BT_CONFIG) { | 1606 | if (conn->state == BT_CONFIG) { |
1607 | if (!ev->status && hdev->ssp_mode > 0 && | 1607 | if (!ev->status && hdev->ssp_mode > 0 && |
1608 | conn->ssp_mode > 0) { | 1608 | conn->ssp_mode > 0 && conn->out) { |
1609 | if (conn->out) { | 1609 | struct hci_cp_auth_requested cp; |
1610 | struct hci_cp_auth_requested cp; | 1610 | cp.handle = ev->handle; |
1611 | cp.handle = ev->handle; | 1611 | hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, |
1612 | hci_send_cmd(hdev, | ||
1613 | HCI_OP_AUTH_REQUESTED, | ||
1614 | sizeof(cp), &cp); | 1612 | sizeof(cp), &cp); |
1615 | } | ||
1616 | } else { | 1613 | } else { |
1617 | conn->state = BT_CONNECTED; | 1614 | conn->state = BT_CONNECTED; |
1618 | hci_proto_connect_cfm(conn, ev->status); | 1615 | hci_proto_connect_cfm(conn, ev->status); |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 3396d5bdef1c..9610a9c85b98 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -55,7 +55,7 @@ | |||
55 | #define BT_DBG(D...) | 55 | #define BT_DBG(D...) |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #define VERSION "2.10" | 58 | #define VERSION "2.11" |
59 | 59 | ||
60 | static u32 l2cap_feat_mask = 0x0000; | 60 | static u32 l2cap_feat_mask = 0x0000; |
61 | 61 | ||
@@ -778,6 +778,7 @@ static int l2cap_do_connect(struct sock *sk) | |||
778 | struct l2cap_conn *conn; | 778 | struct l2cap_conn *conn; |
779 | struct hci_conn *hcon; | 779 | struct hci_conn *hcon; |
780 | struct hci_dev *hdev; | 780 | struct hci_dev *hdev; |
781 | __u8 auth_type; | ||
781 | int err = 0; | 782 | int err = 0; |
782 | 783 | ||
783 | BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), l2cap_pi(sk)->psm); | 784 | BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), l2cap_pi(sk)->psm); |
@@ -789,7 +790,21 @@ static int l2cap_do_connect(struct sock *sk) | |||
789 | 790 | ||
790 | err = -ENOMEM; | 791 | err = -ENOMEM; |
791 | 792 | ||
792 | hcon = hci_connect(hdev, ACL_LINK, dst); | 793 | if (l2cap_pi(sk)->link_mode & L2CAP_LM_AUTH || |
794 | l2cap_pi(sk)->link_mode & L2CAP_LM_ENCRYPT || | ||
795 | l2cap_pi(sk)->link_mode & L2CAP_LM_SECURE) { | ||
796 | if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) | ||
797 | auth_type = HCI_AT_NO_BONDING_MITM; | ||
798 | else | ||
799 | auth_type = HCI_AT_GENERAL_BONDING_MITM; | ||
800 | } else { | ||
801 | if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) | ||
802 | auth_type = HCI_AT_NO_BONDING; | ||
803 | else | ||
804 | auth_type = HCI_AT_GENERAL_BONDING; | ||
805 | } | ||
806 | |||
807 | hcon = hci_connect(hdev, ACL_LINK, dst, auth_type); | ||
793 | if (!hcon) | 808 | if (!hcon) |
794 | goto done; | 809 | goto done; |
795 | 810 | ||
@@ -1553,10 +1568,10 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
1553 | struct l2cap_conn_req *req = (struct l2cap_conn_req *) data; | 1568 | struct l2cap_conn_req *req = (struct l2cap_conn_req *) data; |
1554 | struct l2cap_conn_rsp rsp; | 1569 | struct l2cap_conn_rsp rsp; |
1555 | struct sock *sk, *parent; | 1570 | struct sock *sk, *parent; |
1556 | int result, status = 0; | 1571 | int result, status = L2CAP_CS_NO_INFO; |
1557 | 1572 | ||
1558 | u16 dcid = 0, scid = __le16_to_cpu(req->scid); | 1573 | u16 dcid = 0, scid = __le16_to_cpu(req->scid); |
1559 | __le16 psm = req->psm; | 1574 | __le16 psm = req->psm; |
1560 | 1575 | ||
1561 | BT_DBG("psm 0x%2.2x scid 0x%4.4x", psm, scid); | 1576 | BT_DBG("psm 0x%2.2x scid 0x%4.4x", psm, scid); |
1562 | 1577 | ||
@@ -1567,6 +1582,13 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
1567 | goto sendresp; | 1582 | goto sendresp; |
1568 | } | 1583 | } |
1569 | 1584 | ||
1585 | /* Check if the ACL is secure enough (if not SDP) */ | ||
1586 | if (psm != cpu_to_le16(0x0001) && | ||
1587 | !hci_conn_check_link_mode(conn->hcon)) { | ||
1588 | result = L2CAP_CR_SEC_BLOCK; | ||
1589 | goto response; | ||
1590 | } | ||
1591 | |||
1570 | result = L2CAP_CR_NO_MEM; | 1592 | result = L2CAP_CR_NO_MEM; |
1571 | 1593 | ||
1572 | /* Check for backlog size */ | 1594 | /* Check for backlog size */ |
@@ -2224,7 +2246,7 @@ static int l2cap_auth_cfm(struct hci_conn *hcon, u8 status) | |||
2224 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); | 2246 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); |
2225 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); | 2247 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); |
2226 | rsp.result = cpu_to_le16(result); | 2248 | rsp.result = cpu_to_le16(result); |
2227 | rsp.status = cpu_to_le16(0); | 2249 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
2228 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 2250 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
2229 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); | 2251 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); |
2230 | } | 2252 | } |
@@ -2296,7 +2318,7 @@ static int l2cap_encrypt_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
2296 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); | 2318 | rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid); |
2297 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); | 2319 | rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid); |
2298 | rsp.result = cpu_to_le16(result); | 2320 | rsp.result = cpu_to_le16(result); |
2299 | rsp.status = cpu_to_le16(0); | 2321 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
2300 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 2322 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
2301 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); | 2323 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); |
2302 | } | 2324 | } |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index a16011fedc1d..0cc91e6da76d 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -200,7 +200,7 @@ static int sco_connect(struct sock *sk) | |||
200 | else | 200 | else |
201 | type = SCO_LINK; | 201 | type = SCO_LINK; |
202 | 202 | ||
203 | hcon = hci_connect(hdev, type, dst); | 203 | hcon = hci_connect(hdev, type, dst, HCI_AT_NO_BONDING); |
204 | if (!hcon) | 204 | if (!hcon) |
205 | goto done; | 205 | goto done; |
206 | 206 | ||
diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c index eeee218eed80..5bbf07362172 100644 --- a/net/bridge/br_ioctl.c +++ b/net/bridge/br_ioctl.c | |||
@@ -188,15 +188,21 @@ static int old_dev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
188 | return 0; | 188 | return 0; |
189 | 189 | ||
190 | case BRCTL_SET_BRIDGE_HELLO_TIME: | 190 | case BRCTL_SET_BRIDGE_HELLO_TIME: |
191 | { | ||
192 | unsigned long t = clock_t_to_jiffies(args[1]); | ||
191 | if (!capable(CAP_NET_ADMIN)) | 193 | if (!capable(CAP_NET_ADMIN)) |
192 | return -EPERM; | 194 | return -EPERM; |
193 | 195 | ||
196 | if (t < HZ) | ||
197 | return -EINVAL; | ||
198 | |||
194 | spin_lock_bh(&br->lock); | 199 | spin_lock_bh(&br->lock); |
195 | br->bridge_hello_time = clock_t_to_jiffies(args[1]); | 200 | br->bridge_hello_time = t; |
196 | if (br_is_root_bridge(br)) | 201 | if (br_is_root_bridge(br)) |
197 | br->hello_time = br->bridge_hello_time; | 202 | br->hello_time = br->bridge_hello_time; |
198 | spin_unlock_bh(&br->lock); | 203 | spin_unlock_bh(&br->lock); |
199 | return 0; | 204 | return 0; |
205 | } | ||
200 | 206 | ||
201 | case BRCTL_SET_BRIDGE_MAX_AGE: | 207 | case BRCTL_SET_BRIDGE_MAX_AGE: |
202 | if (!capable(CAP_NET_ADMIN)) | 208 | if (!capable(CAP_NET_ADMIN)) |
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c index 27d6a511c8c1..158dee8b4965 100644 --- a/net/bridge/br_sysfs_br.c +++ b/net/bridge/br_sysfs_br.c | |||
@@ -29,11 +29,12 @@ | |||
29 | */ | 29 | */ |
30 | static ssize_t store_bridge_parm(struct device *d, | 30 | static ssize_t store_bridge_parm(struct device *d, |
31 | const char *buf, size_t len, | 31 | const char *buf, size_t len, |
32 | void (*set)(struct net_bridge *, unsigned long)) | 32 | int (*set)(struct net_bridge *, unsigned long)) |
33 | { | 33 | { |
34 | struct net_bridge *br = to_bridge(d); | 34 | struct net_bridge *br = to_bridge(d); |
35 | char *endp; | 35 | char *endp; |
36 | unsigned long val; | 36 | unsigned long val; |
37 | int err; | ||
37 | 38 | ||
38 | if (!capable(CAP_NET_ADMIN)) | 39 | if (!capable(CAP_NET_ADMIN)) |
39 | return -EPERM; | 40 | return -EPERM; |
@@ -43,9 +44,9 @@ static ssize_t store_bridge_parm(struct device *d, | |||
43 | return -EINVAL; | 44 | return -EINVAL; |
44 | 45 | ||
45 | spin_lock_bh(&br->lock); | 46 | spin_lock_bh(&br->lock); |
46 | (*set)(br, val); | 47 | err = (*set)(br, val); |
47 | spin_unlock_bh(&br->lock); | 48 | spin_unlock_bh(&br->lock); |
48 | return len; | 49 | return err ? err : len; |
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
@@ -56,12 +57,13 @@ static ssize_t show_forward_delay(struct device *d, | |||
56 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); | 57 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); |
57 | } | 58 | } |
58 | 59 | ||
59 | static void set_forward_delay(struct net_bridge *br, unsigned long val) | 60 | static int set_forward_delay(struct net_bridge *br, unsigned long val) |
60 | { | 61 | { |
61 | unsigned long delay = clock_t_to_jiffies(val); | 62 | unsigned long delay = clock_t_to_jiffies(val); |
62 | br->forward_delay = delay; | 63 | br->forward_delay = delay; |
63 | if (br_is_root_bridge(br)) | 64 | if (br_is_root_bridge(br)) |
64 | br->bridge_forward_delay = delay; | 65 | br->bridge_forward_delay = delay; |
66 | return 0; | ||
65 | } | 67 | } |
66 | 68 | ||
67 | static ssize_t store_forward_delay(struct device *d, | 69 | static ssize_t store_forward_delay(struct device *d, |
@@ -80,12 +82,17 @@ static ssize_t show_hello_time(struct device *d, struct device_attribute *attr, | |||
80 | jiffies_to_clock_t(to_bridge(d)->hello_time)); | 82 | jiffies_to_clock_t(to_bridge(d)->hello_time)); |
81 | } | 83 | } |
82 | 84 | ||
83 | static void set_hello_time(struct net_bridge *br, unsigned long val) | 85 | static int set_hello_time(struct net_bridge *br, unsigned long val) |
84 | { | 86 | { |
85 | unsigned long t = clock_t_to_jiffies(val); | 87 | unsigned long t = clock_t_to_jiffies(val); |
88 | |||
89 | if (t < HZ) | ||
90 | return -EINVAL; | ||
91 | |||
86 | br->hello_time = t; | 92 | br->hello_time = t; |
87 | if (br_is_root_bridge(br)) | 93 | if (br_is_root_bridge(br)) |
88 | br->bridge_hello_time = t; | 94 | br->bridge_hello_time = t; |
95 | return 0; | ||
89 | } | 96 | } |
90 | 97 | ||
91 | static ssize_t store_hello_time(struct device *d, | 98 | static ssize_t store_hello_time(struct device *d, |
@@ -104,12 +111,13 @@ static ssize_t show_max_age(struct device *d, struct device_attribute *attr, | |||
104 | jiffies_to_clock_t(to_bridge(d)->max_age)); | 111 | jiffies_to_clock_t(to_bridge(d)->max_age)); |
105 | } | 112 | } |
106 | 113 | ||
107 | static void set_max_age(struct net_bridge *br, unsigned long val) | 114 | static int set_max_age(struct net_bridge *br, unsigned long val) |
108 | { | 115 | { |
109 | unsigned long t = clock_t_to_jiffies(val); | 116 | unsigned long t = clock_t_to_jiffies(val); |
110 | br->max_age = t; | 117 | br->max_age = t; |
111 | if (br_is_root_bridge(br)) | 118 | if (br_is_root_bridge(br)) |
112 | br->bridge_max_age = t; | 119 | br->bridge_max_age = t; |
120 | return 0; | ||
113 | } | 121 | } |
114 | 122 | ||
115 | static ssize_t store_max_age(struct device *d, struct device_attribute *attr, | 123 | static ssize_t store_max_age(struct device *d, struct device_attribute *attr, |
@@ -126,9 +134,10 @@ static ssize_t show_ageing_time(struct device *d, | |||
126 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); | 134 | return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); |
127 | } | 135 | } |
128 | 136 | ||
129 | static void set_ageing_time(struct net_bridge *br, unsigned long val) | 137 | static int set_ageing_time(struct net_bridge *br, unsigned long val) |
130 | { | 138 | { |
131 | br->ageing_time = clock_t_to_jiffies(val); | 139 | br->ageing_time = clock_t_to_jiffies(val); |
140 | return 0; | ||
132 | } | 141 | } |
133 | 142 | ||
134 | static ssize_t store_ageing_time(struct device *d, | 143 | static ssize_t store_ageing_time(struct device *d, |
@@ -180,9 +189,10 @@ static ssize_t show_priority(struct device *d, struct device_attribute *attr, | |||
180 | (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1]); | 189 | (br->bridge_id.prio[0] << 8) | br->bridge_id.prio[1]); |
181 | } | 190 | } |
182 | 191 | ||
183 | static void set_priority(struct net_bridge *br, unsigned long val) | 192 | static int set_priority(struct net_bridge *br, unsigned long val) |
184 | { | 193 | { |
185 | br_stp_set_bridge_priority(br, (u16) val); | 194 | br_stp_set_bridge_priority(br, (u16) val); |
195 | return 0; | ||
186 | } | 196 | } |
187 | 197 | ||
188 | static ssize_t store_priority(struct device *d, struct device_attribute *attr, | 198 | static ssize_t store_priority(struct device *d, struct device_attribute *attr, |
diff --git a/net/core/dev.c b/net/core/dev.c index 60c51f765887..e719ed29310f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1991,8 +1991,13 @@ static void net_tx_action(struct softirq_action *h) | |||
1991 | spin_unlock(root_lock); | 1991 | spin_unlock(root_lock); |
1992 | } else { | 1992 | } else { |
1993 | if (!test_bit(__QDISC_STATE_DEACTIVATED, | 1993 | if (!test_bit(__QDISC_STATE_DEACTIVATED, |
1994 | &q->state)) | 1994 | &q->state)) { |
1995 | __netif_reschedule(q); | 1995 | __netif_reschedule(q); |
1996 | } else { | ||
1997 | smp_mb__before_clear_bit(); | ||
1998 | clear_bit(__QDISC_STATE_SCHED, | ||
1999 | &q->state); | ||
2000 | } | ||
1996 | } | 2001 | } |
1997 | } | 2002 | } |
1998 | } | 2003 | } |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 91d3d96805d0..b12dae2b0b2d 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -1029,6 +1029,11 @@ skip: | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static inline bool inetdev_valid_mtu(unsigned mtu) | ||
1033 | { | ||
1034 | return mtu >= 68; | ||
1035 | } | ||
1036 | |||
1032 | /* Called only under RTNL semaphore */ | 1037 | /* Called only under RTNL semaphore */ |
1033 | 1038 | ||
1034 | static int inetdev_event(struct notifier_block *this, unsigned long event, | 1039 | static int inetdev_event(struct notifier_block *this, unsigned long event, |
@@ -1048,6 +1053,10 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1048 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); | 1053 | IN_DEV_CONF_SET(in_dev, NOXFRM, 1); |
1049 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); | 1054 | IN_DEV_CONF_SET(in_dev, NOPOLICY, 1); |
1050 | } | 1055 | } |
1056 | } else if (event == NETDEV_CHANGEMTU) { | ||
1057 | /* Re-enabling IP */ | ||
1058 | if (inetdev_valid_mtu(dev->mtu)) | ||
1059 | in_dev = inetdev_init(dev); | ||
1051 | } | 1060 | } |
1052 | goto out; | 1061 | goto out; |
1053 | } | 1062 | } |
@@ -1058,7 +1067,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1058 | dev->ip_ptr = NULL; | 1067 | dev->ip_ptr = NULL; |
1059 | break; | 1068 | break; |
1060 | case NETDEV_UP: | 1069 | case NETDEV_UP: |
1061 | if (dev->mtu < 68) | 1070 | if (!inetdev_valid_mtu(dev->mtu)) |
1062 | break; | 1071 | break; |
1063 | if (dev->flags & IFF_LOOPBACK) { | 1072 | if (dev->flags & IFF_LOOPBACK) { |
1064 | struct in_ifaddr *ifa; | 1073 | struct in_ifaddr *ifa; |
@@ -1080,9 +1089,9 @@ static int inetdev_event(struct notifier_block *this, unsigned long event, | |||
1080 | ip_mc_down(in_dev); | 1089 | ip_mc_down(in_dev); |
1081 | break; | 1090 | break; |
1082 | case NETDEV_CHANGEMTU: | 1091 | case NETDEV_CHANGEMTU: |
1083 | if (dev->mtu >= 68) | 1092 | if (inetdev_valid_mtu(dev->mtu)) |
1084 | break; | 1093 | break; |
1085 | /* MTU falled under 68, disable IP */ | 1094 | /* disable IP when MTU is not enough */ |
1086 | case NETDEV_UNREGISTER: | 1095 | case NETDEV_UNREGISTER: |
1087 | inetdev_destroy(in_dev); | 1096 | inetdev_destroy(in_dev); |
1088 | break; | 1097 | break; |
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index d985bd613d25..743f011b9a84 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
@@ -409,3 +409,38 @@ out: | |||
409 | } | 409 | } |
410 | 410 | ||
411 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); | 411 | EXPORT_SYMBOL_GPL(inet_twdr_twcal_tick); |
412 | |||
413 | void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, | ||
414 | struct inet_timewait_death_row *twdr, int family) | ||
415 | { | ||
416 | struct inet_timewait_sock *tw; | ||
417 | struct sock *sk; | ||
418 | struct hlist_node *node; | ||
419 | int h; | ||
420 | |||
421 | local_bh_disable(); | ||
422 | for (h = 0; h < (hashinfo->ehash_size); h++) { | ||
423 | struct inet_ehash_bucket *head = | ||
424 | inet_ehash_bucket(hashinfo, h); | ||
425 | rwlock_t *lock = inet_ehash_lockp(hashinfo, h); | ||
426 | restart: | ||
427 | write_lock(lock); | ||
428 | sk_for_each(sk, node, &head->twchain) { | ||
429 | |||
430 | tw = inet_twsk(sk); | ||
431 | if (!net_eq(twsk_net(tw), net) || | ||
432 | tw->tw_family != family) | ||
433 | continue; | ||
434 | |||
435 | atomic_inc(&tw->tw_refcnt); | ||
436 | write_unlock(lock); | ||
437 | inet_twsk_deschedule(tw, twdr); | ||
438 | inet_twsk_put(tw); | ||
439 | |||
440 | goto restart; | ||
441 | } | ||
442 | write_unlock(lock); | ||
443 | } | ||
444 | local_bh_enable(); | ||
445 | } | ||
446 | EXPORT_SYMBOL_GPL(inet_twsk_purge); | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 44c1e934824b..1b4fee20fc93 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -2376,6 +2376,7 @@ static int __net_init tcp_sk_init(struct net *net) | |||
2376 | static void __net_exit tcp_sk_exit(struct net *net) | 2376 | static void __net_exit tcp_sk_exit(struct net *net) |
2377 | { | 2377 | { |
2378 | inet_ctl_sock_destroy(net->ipv4.tcp_sock); | 2378 | inet_ctl_sock_destroy(net->ipv4.tcp_sock); |
2379 | inet_twsk_purge(net, &tcp_hashinfo, &tcp_death_row, AF_INET); | ||
2379 | } | 2380 | } |
2380 | 2381 | ||
2381 | static struct pernet_operations __net_initdata tcp_sk_ops = { | 2382 | static struct pernet_operations __net_initdata tcp_sk_ops = { |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 8e42fbbd5761..57e26fa66185 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -951,6 +951,27 @@ int udp_disconnect(struct sock *sk, int flags) | |||
951 | return 0; | 951 | return 0; |
952 | } | 952 | } |
953 | 953 | ||
954 | static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) | ||
955 | { | ||
956 | int is_udplite = IS_UDPLITE(sk); | ||
957 | int rc; | ||
958 | |||
959 | if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) { | ||
960 | /* Note that an ENOMEM error is charged twice */ | ||
961 | if (rc == -ENOMEM) | ||
962 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS, | ||
963 | is_udplite); | ||
964 | goto drop; | ||
965 | } | ||
966 | |||
967 | return 0; | ||
968 | |||
969 | drop: | ||
970 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); | ||
971 | kfree_skb(skb); | ||
972 | return -1; | ||
973 | } | ||
974 | |||
954 | /* returns: | 975 | /* returns: |
955 | * -1: error | 976 | * -1: error |
956 | * 0: success | 977 | * 0: success |
@@ -989,9 +1010,7 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) | |||
989 | up->encap_rcv != NULL) { | 1010 | up->encap_rcv != NULL) { |
990 | int ret; | 1011 | int ret; |
991 | 1012 | ||
992 | bh_unlock_sock(sk); | ||
993 | ret = (*up->encap_rcv)(sk, skb); | 1013 | ret = (*up->encap_rcv)(sk, skb); |
994 | bh_lock_sock(sk); | ||
995 | if (ret <= 0) { | 1014 | if (ret <= 0) { |
996 | UDP_INC_STATS_BH(sock_net(sk), | 1015 | UDP_INC_STATS_BH(sock_net(sk), |
997 | UDP_MIB_INDATAGRAMS, | 1016 | UDP_MIB_INDATAGRAMS, |
@@ -1044,17 +1063,16 @@ int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) | |||
1044 | goto drop; | 1063 | goto drop; |
1045 | } | 1064 | } |
1046 | 1065 | ||
1047 | if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) { | 1066 | rc = 0; |
1048 | /* Note that an ENOMEM error is charged twice */ | ||
1049 | if (rc == -ENOMEM) { | ||
1050 | UDP_INC_STATS_BH(sock_net(sk), | ||
1051 | UDP_MIB_RCVBUFERRORS, is_udplite); | ||
1052 | atomic_inc(&sk->sk_drops); | ||
1053 | } | ||
1054 | goto drop; | ||
1055 | } | ||
1056 | 1067 | ||
1057 | return 0; | 1068 | bh_lock_sock(sk); |
1069 | if (!sock_owned_by_user(sk)) | ||
1070 | rc = __udp_queue_rcv_skb(sk, skb); | ||
1071 | else | ||
1072 | sk_add_backlog(sk, skb); | ||
1073 | bh_unlock_sock(sk); | ||
1074 | |||
1075 | return rc; | ||
1058 | 1076 | ||
1059 | drop: | 1077 | drop: |
1060 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); | 1078 | UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite); |
@@ -1092,15 +1110,7 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb, | |||
1092 | skb1 = skb_clone(skb, GFP_ATOMIC); | 1110 | skb1 = skb_clone(skb, GFP_ATOMIC); |
1093 | 1111 | ||
1094 | if (skb1) { | 1112 | if (skb1) { |
1095 | int ret = 0; | 1113 | int ret = udp_queue_rcv_skb(sk, skb1); |
1096 | |||
1097 | bh_lock_sock(sk); | ||
1098 | if (!sock_owned_by_user(sk)) | ||
1099 | ret = udp_queue_rcv_skb(sk, skb1); | ||
1100 | else | ||
1101 | sk_add_backlog(sk, skb1); | ||
1102 | bh_unlock_sock(sk); | ||
1103 | |||
1104 | if (ret > 0) | 1114 | if (ret > 0) |
1105 | /* we should probably re-process instead | 1115 | /* we should probably re-process instead |
1106 | * of dropping packets here. */ | 1116 | * of dropping packets here. */ |
@@ -1195,13 +1205,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], | |||
1195 | uh->dest, inet_iif(skb), udptable); | 1205 | uh->dest, inet_iif(skb), udptable); |
1196 | 1206 | ||
1197 | if (sk != NULL) { | 1207 | if (sk != NULL) { |
1198 | int ret = 0; | 1208 | int ret = udp_queue_rcv_skb(sk, skb); |
1199 | bh_lock_sock(sk); | ||
1200 | if (!sock_owned_by_user(sk)) | ||
1201 | ret = udp_queue_rcv_skb(sk, skb); | ||
1202 | else | ||
1203 | sk_add_backlog(sk, skb); | ||
1204 | bh_unlock_sock(sk); | ||
1205 | sock_put(sk); | 1209 | sock_put(sk); |
1206 | 1210 | ||
1207 | /* a return value > 0 means to resubmit the input, but | 1211 | /* a return value > 0 means to resubmit the input, but |
@@ -1494,7 +1498,7 @@ struct proto udp_prot = { | |||
1494 | .sendmsg = udp_sendmsg, | 1498 | .sendmsg = udp_sendmsg, |
1495 | .recvmsg = udp_recvmsg, | 1499 | .recvmsg = udp_recvmsg, |
1496 | .sendpage = udp_sendpage, | 1500 | .sendpage = udp_sendpage, |
1497 | .backlog_rcv = udp_queue_rcv_skb, | 1501 | .backlog_rcv = __udp_queue_rcv_skb, |
1498 | .hash = udp_lib_hash, | 1502 | .hash = udp_lib_hash, |
1499 | .unhash = udp_lib_unhash, | 1503 | .unhash = udp_lib_unhash, |
1500 | .get_port = udp_v4_get_port, | 1504 | .get_port = udp_v4_get_port, |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 0e844c2736a7..3df2c442d90b 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -943,39 +943,39 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
943 | } | 943 | } |
944 | 944 | ||
945 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 945 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
946 | /* | 946 | /* |
947 | * Here if the dst entry we've looked up | 947 | * Here if the dst entry we've looked up |
948 | * has a neighbour entry that is in the INCOMPLETE | 948 | * has a neighbour entry that is in the INCOMPLETE |
949 | * state and the src address from the flow is | 949 | * state and the src address from the flow is |
950 | * marked as OPTIMISTIC, we release the found | 950 | * marked as OPTIMISTIC, we release the found |
951 | * dst entry and replace it instead with the | 951 | * dst entry and replace it instead with the |
952 | * dst entry of the nexthop router | 952 | * dst entry of the nexthop router |
953 | */ | 953 | */ |
954 | if (!((*dst)->neighbour->nud_state & NUD_VALID)) { | 954 | if ((*dst)->neighbour && !((*dst)->neighbour->nud_state & NUD_VALID)) { |
955 | struct inet6_ifaddr *ifp; | 955 | struct inet6_ifaddr *ifp; |
956 | struct flowi fl_gw; | 956 | struct flowi fl_gw; |
957 | int redirect; | 957 | int redirect; |
958 | 958 | ||
959 | ifp = ipv6_get_ifaddr(net, &fl->fl6_src, | 959 | ifp = ipv6_get_ifaddr(net, &fl->fl6_src, |
960 | (*dst)->dev, 1); | 960 | (*dst)->dev, 1); |
961 | 961 | ||
962 | redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); | 962 | redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); |
963 | if (ifp) | 963 | if (ifp) |
964 | in6_ifa_put(ifp); | 964 | in6_ifa_put(ifp); |
965 | 965 | ||
966 | if (redirect) { | 966 | if (redirect) { |
967 | /* | 967 | /* |
968 | * We need to get the dst entry for the | 968 | * We need to get the dst entry for the |
969 | * default router instead | 969 | * default router instead |
970 | */ | 970 | */ |
971 | dst_release(*dst); | 971 | dst_release(*dst); |
972 | memcpy(&fl_gw, fl, sizeof(struct flowi)); | 972 | memcpy(&fl_gw, fl, sizeof(struct flowi)); |
973 | memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); | 973 | memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); |
974 | *dst = ip6_route_output(net, sk, &fl_gw); | 974 | *dst = ip6_route_output(net, sk, &fl_gw); |
975 | if ((err = (*dst)->error)) | 975 | if ((err = (*dst)->error)) |
976 | goto out_err_release; | 976 | goto out_err_release; |
977 | } | ||
978 | } | 977 | } |
978 | } | ||
979 | #endif | 979 | #endif |
980 | 980 | ||
981 | return 0; | 981 | return 0; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 01d47674f7e5..e53e493606c5 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -377,14 +377,14 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb) | |||
377 | skb_checksum_complete(skb)) { | 377 | skb_checksum_complete(skb)) { |
378 | atomic_inc(&sk->sk_drops); | 378 | atomic_inc(&sk->sk_drops); |
379 | kfree_skb(skb); | 379 | kfree_skb(skb); |
380 | return 0; | 380 | return NET_RX_DROP; |
381 | } | 381 | } |
382 | 382 | ||
383 | /* Charge it to the socket. */ | 383 | /* Charge it to the socket. */ |
384 | if (sock_queue_rcv_skb(sk,skb)<0) { | 384 | if (sock_queue_rcv_skb(sk,skb)<0) { |
385 | atomic_inc(&sk->sk_drops); | 385 | atomic_inc(&sk->sk_drops); |
386 | kfree_skb(skb); | 386 | kfree_skb(skb); |
387 | return 0; | 387 | return NET_RX_DROP; |
388 | } | 388 | } |
389 | 389 | ||
390 | return 0; | 390 | return 0; |
@@ -429,7 +429,7 @@ int rawv6_rcv(struct sock *sk, struct sk_buff *skb) | |||
429 | if (skb_checksum_complete(skb)) { | 429 | if (skb_checksum_complete(skb)) { |
430 | atomic_inc(&sk->sk_drops); | 430 | atomic_inc(&sk->sk_drops); |
431 | kfree_skb(skb); | 431 | kfree_skb(skb); |
432 | return 0; | 432 | return NET_RX_DROP; |
433 | } | 433 | } |
434 | } | 434 | } |
435 | 435 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5b90b369ccb2..b585c850a89a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -2148,6 +2148,7 @@ static int tcpv6_net_init(struct net *net) | |||
2148 | static void tcpv6_net_exit(struct net *net) | 2148 | static void tcpv6_net_exit(struct net *net) |
2149 | { | 2149 | { |
2150 | inet_ctl_sock_destroy(net->ipv6.tcp_sk); | 2150 | inet_ctl_sock_destroy(net->ipv6.tcp_sk); |
2151 | inet_twsk_purge(net, &tcp_hashinfo, &tcp_death_row, AF_INET6); | ||
2151 | } | 2152 | } |
2152 | 2153 | ||
2153 | static struct pernet_operations tcpv6_net_ops = { | 2154 | static struct pernet_operations tcpv6_net_ops = { |
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index 7439b63df5d0..cf82acec913a 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
@@ -265,7 +265,7 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) | |||
265 | key = sdata->default_key; | 265 | key = sdata->default_key; |
266 | if (key) { | 266 | if (key) { |
267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); | 267 | sprintf(buf, "../keys/%d", key->debugfs.cnt); |
268 | sdata->debugfs.default_key = | 268 | sdata->common_debugfs.default_key = |
269 | debugfs_create_symlink("default_key", | 269 | debugfs_create_symlink("default_key", |
270 | sdata->debugfsdir, buf); | 270 | sdata->debugfsdir, buf); |
271 | } else | 271 | } else |
@@ -277,8 +277,8 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata) | |||
277 | if (!sdata) | 277 | if (!sdata) |
278 | return; | 278 | return; |
279 | 279 | ||
280 | debugfs_remove(sdata->debugfs.default_key); | 280 | debugfs_remove(sdata->common_debugfs.default_key); |
281 | sdata->debugfs.default_key = NULL; | 281 | sdata->common_debugfs.default_key = NULL; |
282 | } | 282 | } |
283 | 283 | ||
284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, | 284 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 586a9b49b0fc..4498d8713652 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -496,8 +496,10 @@ struct ieee80211_sub_if_data { | |||
496 | struct { | 496 | struct { |
497 | struct dentry *mode; | 497 | struct dentry *mode; |
498 | } monitor; | 498 | } monitor; |
499 | struct dentry *default_key; | ||
500 | } debugfs; | 499 | } debugfs; |
500 | struct { | ||
501 | struct dentry *default_key; | ||
502 | } common_debugfs; | ||
501 | 503 | ||
502 | #ifdef CONFIG_MAC80211_MESH | 504 | #ifdef CONFIG_MAC80211_MESH |
503 | struct dentry *mesh_stats_dir; | 505 | struct dentry *mesh_stats_dir; |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 9bb68c6a8f44..902cac1bd246 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -478,21 +478,51 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_info( | |||
478 | static void ieee80211_sta_send_associnfo(struct net_device *dev, | 478 | static void ieee80211_sta_send_associnfo(struct net_device *dev, |
479 | struct ieee80211_if_sta *ifsta) | 479 | struct ieee80211_if_sta *ifsta) |
480 | { | 480 | { |
481 | char *buf; | ||
482 | size_t len; | ||
483 | int i; | ||
481 | union iwreq_data wrqu; | 484 | union iwreq_data wrqu; |
482 | 485 | ||
486 | if (!ifsta->assocreq_ies && !ifsta->assocresp_ies) | ||
487 | return; | ||
488 | |||
489 | buf = kmalloc(50 + 2 * (ifsta->assocreq_ies_len + | ||
490 | ifsta->assocresp_ies_len), GFP_KERNEL); | ||
491 | if (!buf) | ||
492 | return; | ||
493 | |||
494 | len = sprintf(buf, "ASSOCINFO("); | ||
483 | if (ifsta->assocreq_ies) { | 495 | if (ifsta->assocreq_ies) { |
484 | memset(&wrqu, 0, sizeof(wrqu)); | 496 | len += sprintf(buf + len, "ReqIEs="); |
485 | wrqu.data.length = ifsta->assocreq_ies_len; | 497 | for (i = 0; i < ifsta->assocreq_ies_len; i++) { |
486 | wireless_send_event(dev, IWEVASSOCREQIE, &wrqu, | 498 | len += sprintf(buf + len, "%02x", |
487 | ifsta->assocreq_ies); | 499 | ifsta->assocreq_ies[i]); |
500 | } | ||
488 | } | 501 | } |
489 | |||
490 | if (ifsta->assocresp_ies) { | 502 | if (ifsta->assocresp_ies) { |
491 | memset(&wrqu, 0, sizeof(wrqu)); | 503 | if (ifsta->assocreq_ies) |
492 | wrqu.data.length = ifsta->assocresp_ies_len; | 504 | len += sprintf(buf + len, " "); |
493 | wireless_send_event(dev, IWEVASSOCRESPIE, &wrqu, | 505 | len += sprintf(buf + len, "RespIEs="); |
494 | ifsta->assocresp_ies); | 506 | for (i = 0; i < ifsta->assocresp_ies_len; i++) { |
507 | len += sprintf(buf + len, "%02x", | ||
508 | ifsta->assocresp_ies[i]); | ||
509 | } | ||
510 | } | ||
511 | len += sprintf(buf + len, ")"); | ||
512 | |||
513 | if (len > IW_CUSTOM_MAX) { | ||
514 | len = sprintf(buf, "ASSOCRESPIE="); | ||
515 | for (i = 0; i < ifsta->assocresp_ies_len; i++) { | ||
516 | len += sprintf(buf + len, "%02x", | ||
517 | ifsta->assocresp_ies[i]); | ||
518 | } | ||
495 | } | 519 | } |
520 | |||
521 | memset(&wrqu, 0, sizeof(wrqu)); | ||
522 | wrqu.data.length = len; | ||
523 | wireless_send_event(dev, IWEVCUSTOM, &wrqu, buf); | ||
524 | |||
525 | kfree(buf); | ||
496 | } | 526 | } |
497 | 527 | ||
498 | 528 | ||
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c index 1b1226d6653f..20633fdf7e6b 100644 --- a/net/netfilter/nf_conntrack_irc.c +++ b/net/netfilter/nf_conntrack_irc.c | |||
@@ -68,11 +68,21 @@ static const char *const dccprotos[] = { | |||
68 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, | 68 | static int parse_dcc(char *data, const char *data_end, u_int32_t *ip, |
69 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) | 69 | u_int16_t *port, char **ad_beg_p, char **ad_end_p) |
70 | { | 70 | { |
71 | char *tmp; | ||
72 | |||
71 | /* at least 12: "AAAAAAAA P\1\n" */ | 73 | /* at least 12: "AAAAAAAA P\1\n" */ |
72 | while (*data++ != ' ') | 74 | while (*data++ != ' ') |
73 | if (data > data_end - 12) | 75 | if (data > data_end - 12) |
74 | return -1; | 76 | return -1; |
75 | 77 | ||
78 | /* Make sure we have a newline character within the packet boundaries | ||
79 | * because simple_strtoul parses until the first invalid character. */ | ||
80 | for (tmp = data; tmp <= data_end; tmp++) | ||
81 | if (*tmp == '\n') | ||
82 | break; | ||
83 | if (tmp > data_end || *tmp != '\n') | ||
84 | return -1; | ||
85 | |||
76 | *ad_beg_p = data; | 86 | *ad_beg_p = data; |
77 | *ip = simple_strtoul(data, &data, 10); | 87 | *ip = simple_strtoul(data, &data, 10); |
78 | 88 | ||
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c index 654a4f7f12c6..9bd03967fea4 100644 --- a/net/netfilter/nf_conntrack_proto_gre.c +++ b/net/netfilter/nf_conntrack_proto_gre.c | |||
@@ -45,12 +45,12 @@ static LIST_HEAD(gre_keymap_list); | |||
45 | 45 | ||
46 | void nf_ct_gre_keymap_flush(void) | 46 | void nf_ct_gre_keymap_flush(void) |
47 | { | 47 | { |
48 | struct list_head *pos, *n; | 48 | struct nf_ct_gre_keymap *km, *tmp; |
49 | 49 | ||
50 | write_lock_bh(&nf_ct_gre_lock); | 50 | write_lock_bh(&nf_ct_gre_lock); |
51 | list_for_each_safe(pos, n, &gre_keymap_list) { | 51 | list_for_each_entry_safe(km, tmp, &gre_keymap_list, list) { |
52 | list_del(pos); | 52 | list_del(&km->list); |
53 | kfree(pos); | 53 | kfree(km); |
54 | } | 54 | } |
55 | write_unlock_bh(&nf_ct_gre_lock); | 55 | write_unlock_bh(&nf_ct_gre_lock); |
56 | } | 56 | } |
@@ -97,10 +97,14 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | |||
97 | kmp = &help->help.ct_pptp_info.keymap[dir]; | 97 | kmp = &help->help.ct_pptp_info.keymap[dir]; |
98 | if (*kmp) { | 98 | if (*kmp) { |
99 | /* check whether it's a retransmission */ | 99 | /* check whether it's a retransmission */ |
100 | read_lock_bh(&nf_ct_gre_lock); | ||
100 | list_for_each_entry(km, &gre_keymap_list, list) { | 101 | list_for_each_entry(km, &gre_keymap_list, list) { |
101 | if (gre_key_cmpfn(km, t) && km == *kmp) | 102 | if (gre_key_cmpfn(km, t) && km == *kmp) { |
103 | read_unlock_bh(&nf_ct_gre_lock); | ||
102 | return 0; | 104 | return 0; |
105 | } | ||
103 | } | 106 | } |
107 | read_unlock_bh(&nf_ct_gre_lock); | ||
104 | pr_debug("trying to override keymap_%s for ct %p\n", | 108 | pr_debug("trying to override keymap_%s for ct %p\n", |
105 | dir == IP_CT_DIR_REPLY ? "reply" : "orig", ct); | 109 | dir == IP_CT_DIR_REPLY ? "reply" : "orig", ct); |
106 | return -EEXIST; | 110 | return -EEXIST; |
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c index 2f9bbc058b48..1fa306be60fb 100644 --- a/net/netfilter/nf_conntrack_sip.c +++ b/net/netfilter/nf_conntrack_sip.c | |||
@@ -1193,7 +1193,6 @@ static const struct sip_handler sip_handlers[] = { | |||
1193 | static int process_sip_response(struct sk_buff *skb, | 1193 | static int process_sip_response(struct sk_buff *skb, |
1194 | const char **dptr, unsigned int *datalen) | 1194 | const char **dptr, unsigned int *datalen) |
1195 | { | 1195 | { |
1196 | static const struct sip_handler *handler; | ||
1197 | enum ip_conntrack_info ctinfo; | 1196 | enum ip_conntrack_info ctinfo; |
1198 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); | 1197 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); |
1199 | unsigned int matchoff, matchlen; | 1198 | unsigned int matchoff, matchlen; |
@@ -1214,6 +1213,8 @@ static int process_sip_response(struct sk_buff *skb, | |||
1214 | dataoff = matchoff + matchlen + 1; | 1213 | dataoff = matchoff + matchlen + 1; |
1215 | 1214 | ||
1216 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { | 1215 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { |
1216 | const struct sip_handler *handler; | ||
1217 | |||
1217 | handler = &sip_handlers[i]; | 1218 | handler = &sip_handlers[i]; |
1218 | if (handler->response == NULL) | 1219 | if (handler->response == NULL) |
1219 | continue; | 1220 | continue; |
@@ -1228,13 +1229,14 @@ static int process_sip_response(struct sk_buff *skb, | |||
1228 | static int process_sip_request(struct sk_buff *skb, | 1229 | static int process_sip_request(struct sk_buff *skb, |
1229 | const char **dptr, unsigned int *datalen) | 1230 | const char **dptr, unsigned int *datalen) |
1230 | { | 1231 | { |
1231 | static const struct sip_handler *handler; | ||
1232 | enum ip_conntrack_info ctinfo; | 1232 | enum ip_conntrack_info ctinfo; |
1233 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); | 1233 | struct nf_conn *ct = nf_ct_get(skb, &ctinfo); |
1234 | unsigned int matchoff, matchlen; | 1234 | unsigned int matchoff, matchlen; |
1235 | unsigned int cseq, i; | 1235 | unsigned int cseq, i; |
1236 | 1236 | ||
1237 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { | 1237 | for (i = 0; i < ARRAY_SIZE(sip_handlers); i++) { |
1238 | const struct sip_handler *handler; | ||
1239 | |||
1238 | handler = &sip_handlers[i]; | 1240 | handler = &sip_handlers[i]; |
1239 | if (handler->request == NULL) | 1241 | if (handler->request == NULL) |
1240 | continue; | 1242 | continue; |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 5cafdd4c8018..8eb79e92e94c 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -205,7 +205,7 @@ replay: | |||
205 | } | 205 | } |
206 | } | 206 | } |
207 | 207 | ||
208 | root_lock = qdisc_root_lock(q); | 208 | root_lock = qdisc_root_sleeping_lock(q); |
209 | 209 | ||
210 | if (tp == NULL) { | 210 | if (tp == NULL) { |
211 | /* Proto-tcf does not exist, create new one */ | 211 | /* Proto-tcf does not exist, create new one */ |
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 481260a4f10f..e3d8455eebc2 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
@@ -75,7 +75,7 @@ static __inline__ int route4_fastmap_hash(u32 id, int iif) | |||
75 | static inline | 75 | static inline |
76 | void route4_reset_fastmap(struct Qdisc *q, struct route4_head *head, u32 id) | 76 | void route4_reset_fastmap(struct Qdisc *q, struct route4_head *head, u32 id) |
77 | { | 77 | { |
78 | spinlock_t *root_lock = qdisc_root_lock(q); | 78 | spinlock_t *root_lock = qdisc_root_sleeping_lock(q); |
79 | 79 | ||
80 | spin_lock_bh(root_lock); | 80 | spin_lock_bh(root_lock); |
81 | memset(head->fastmap, 0, sizeof(head->fastmap)); | 81 | memset(head->fastmap, 0, sizeof(head->fastmap)); |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 506b709510b6..1122c952aa99 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1169,8 +1169,8 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, | |||
1169 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) | 1169 | if (q->stab && qdisc_dump_stab(skb, q->stab) < 0) |
1170 | goto nla_put_failure; | 1170 | goto nla_put_failure; |
1171 | 1171 | ||
1172 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1172 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1173 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1173 | qdisc_root_sleeping_lock(q), &d) < 0) |
1174 | goto nla_put_failure; | 1174 | goto nla_put_failure; |
1175 | 1175 | ||
1176 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) | 1176 | if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0) |
@@ -1461,8 +1461,8 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, | |||
1461 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) | 1461 | if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) |
1462 | goto nla_put_failure; | 1462 | goto nla_put_failure; |
1463 | 1463 | ||
1464 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, | 1464 | if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, TCA_XSTATS, |
1465 | TCA_XSTATS, qdisc_root_lock(q), &d) < 0) | 1465 | qdisc_root_sleeping_lock(q), &d) < 0) |
1466 | goto nla_put_failure; | 1466 | goto nla_put_failure; |
1467 | 1467 | ||
1468 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) | 1468 | if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 9b720adedead..8b06fa900482 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1754,7 +1754,7 @@ static void cbq_put(struct Qdisc *sch, unsigned long arg) | |||
1754 | 1754 | ||
1755 | if (--cl->refcnt == 0) { | 1755 | if (--cl->refcnt == 0) { |
1756 | #ifdef CONFIG_NET_CLS_ACT | 1756 | #ifdef CONFIG_NET_CLS_ACT |
1757 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1757 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1758 | struct cbq_sched_data *q = qdisc_priv(sch); | 1758 | struct cbq_sched_data *q = qdisc_priv(sch); |
1759 | 1759 | ||
1760 | spin_lock_bh(root_lock); | 1760 | spin_lock_bh(root_lock); |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 9634091ee2f0..ec0a0839ce51 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -215,10 +215,9 @@ static void dev_watchdog(unsigned long arg) | |||
215 | time_after(jiffies, (dev->trans_start + | 215 | time_after(jiffies, (dev->trans_start + |
216 | dev->watchdog_timeo))) { | 216 | dev->watchdog_timeo))) { |
217 | char drivername[64]; | 217 | char drivername[64]; |
218 | printk(KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n", | 218 | WARN_ONCE(1, KERN_INFO "NETDEV WATCHDOG: %s (%s): transmit timed out\n", |
219 | dev->name, netdev_drivername(dev, drivername, 64)); | 219 | dev->name, netdev_drivername(dev, drivername, 64)); |
220 | dev->tx_timeout(dev); | 220 | dev->tx_timeout(dev); |
221 | WARN_ON_ONCE(1); | ||
222 | } | 221 | } |
223 | if (!mod_timer(&dev->watchdog_timer, | 222 | if (!mod_timer(&dev->watchdog_timer, |
224 | round_jiffies(jiffies + | 223 | round_jiffies(jiffies + |
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 97d4761cc31e..d14f02056ae6 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -1043,7 +1043,7 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt) | |||
1043 | 1043 | ||
1044 | static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) | 1044 | static int htb_dump(struct Qdisc *sch, struct sk_buff *skb) |
1045 | { | 1045 | { |
1046 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1046 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1047 | struct htb_sched *q = qdisc_priv(sch); | 1047 | struct htb_sched *q = qdisc_priv(sch); |
1048 | struct nlattr *nest; | 1048 | struct nlattr *nest; |
1049 | struct tc_htb_glob gopt; | 1049 | struct tc_htb_glob gopt; |
@@ -1075,7 +1075,7 @@ static int htb_dump_class(struct Qdisc *sch, unsigned long arg, | |||
1075 | struct sk_buff *skb, struct tcmsg *tcm) | 1075 | struct sk_buff *skb, struct tcmsg *tcm) |
1076 | { | 1076 | { |
1077 | struct htb_class *cl = (struct htb_class *)arg; | 1077 | struct htb_class *cl = (struct htb_class *)arg; |
1078 | spinlock_t *root_lock = qdisc_root_lock(sch); | 1078 | spinlock_t *root_lock = qdisc_root_sleeping_lock(sch); |
1079 | struct nlattr *nest; | 1079 | struct nlattr *nest; |
1080 | struct tc_htb_opt opt; | 1080 | struct tc_htb_opt opt; |
1081 | 1081 | ||
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index fb0294d0b55e..3781e55046d0 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -341,7 +341,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr) | |||
341 | for (i = 0; i < n; i++) | 341 | for (i = 0; i < n; i++) |
342 | d->table[i] = data[i]; | 342 | d->table[i] = data[i]; |
343 | 343 | ||
344 | root_lock = qdisc_root_lock(sch); | 344 | root_lock = qdisc_root_sleeping_lock(sch); |
345 | 345 | ||
346 | spin_lock_bh(root_lock); | 346 | spin_lock_bh(root_lock); |
347 | d = xchg(&q->delay_dist, d); | 347 | d = xchg(&q->delay_dist, d); |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 2c35c678563b..d35ef059abb1 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
@@ -161,7 +161,7 @@ teql_destroy(struct Qdisc* sch) | |||
161 | txq = netdev_get_tx_queue(master->dev, 0); | 161 | txq = netdev_get_tx_queue(master->dev, 0); |
162 | master->slaves = NULL; | 162 | master->slaves = NULL; |
163 | 163 | ||
164 | root_lock = qdisc_root_lock(txq->qdisc); | 164 | root_lock = qdisc_root_sleeping_lock(txq->qdisc); |
165 | spin_lock_bh(root_lock); | 165 | spin_lock_bh(root_lock); |
166 | qdisc_reset(txq->qdisc); | 166 | qdisc_reset(txq->qdisc); |
167 | spin_unlock_bh(root_lock); | 167 | spin_unlock_bh(root_lock); |
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 8472b8b349c4..abd51cef2413 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -599,11 +599,12 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, | |||
599 | /* Check to see if this is a duplicate. */ | 599 | /* Check to see if this is a duplicate. */ |
600 | peer = sctp_assoc_lookup_paddr(asoc, addr); | 600 | peer = sctp_assoc_lookup_paddr(asoc, addr); |
601 | if (peer) { | 601 | if (peer) { |
602 | /* An UNKNOWN state is only set on transports added by | ||
603 | * user in sctp_connectx() call. Such transports should be | ||
604 | * considered CONFIRMED per RFC 4960, Section 5.4. | ||
605 | */ | ||
602 | if (peer->state == SCTP_UNKNOWN) { | 606 | if (peer->state == SCTP_UNKNOWN) { |
603 | if (peer_state == SCTP_ACTIVE) | 607 | peer->state = SCTP_ACTIVE; |
604 | peer->state = SCTP_ACTIVE; | ||
605 | if (peer_state == SCTP_UNCONFIRMED) | ||
606 | peer->state = SCTP_UNCONFIRMED; | ||
607 | } | 608 | } |
608 | return peer; | 609 | return peer; |
609 | } | 610 | } |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 0dc4a7dfb234..225c7123c41f 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -533,7 +533,8 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
533 | if (!(dst->dev->features & NETIF_F_NO_CSUM)) { | 533 | if (!(dst->dev->features & NETIF_F_NO_CSUM)) { |
534 | crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); | 534 | crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); |
535 | crc32 = sctp_end_cksum(crc32); | 535 | crc32 = sctp_end_cksum(crc32); |
536 | } | 536 | } else |
537 | nskb->ip_summed = CHECKSUM_UNNECESSARY; | ||
537 | 538 | ||
538 | /* 3) Put the resultant value into the checksum field in the | 539 | /* 3) Put the resultant value into the checksum field in the |
539 | * common header, and leave the rest of the bits unchanged. | 540 | * common header, and leave the rest of the bits unchanged. |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index e8ca4e54981f..b599cbba4fbe 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -1886,11 +1886,13 @@ static void sctp_process_ext_param(struct sctp_association *asoc, | |||
1886 | /* if the peer reports AUTH, assume that he | 1886 | /* if the peer reports AUTH, assume that he |
1887 | * supports AUTH. | 1887 | * supports AUTH. |
1888 | */ | 1888 | */ |
1889 | asoc->peer.auth_capable = 1; | 1889 | if (sctp_auth_enable) |
1890 | asoc->peer.auth_capable = 1; | ||
1890 | break; | 1891 | break; |
1891 | case SCTP_CID_ASCONF: | 1892 | case SCTP_CID_ASCONF: |
1892 | case SCTP_CID_ASCONF_ACK: | 1893 | case SCTP_CID_ASCONF_ACK: |
1893 | asoc->peer.asconf_capable = 1; | 1894 | if (sctp_addip_enable) |
1895 | asoc->peer.asconf_capable = 1; | ||
1894 | break; | 1896 | break; |
1895 | default: | 1897 | default: |
1896 | break; | 1898 | break; |
@@ -2319,12 +2321,10 @@ clean_up: | |||
2319 | /* Release the transport structures. */ | 2321 | /* Release the transport structures. */ |
2320 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { | 2322 | list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { |
2321 | transport = list_entry(pos, struct sctp_transport, transports); | 2323 | transport = list_entry(pos, struct sctp_transport, transports); |
2322 | list_del_init(pos); | 2324 | if (transport->state != SCTP_ACTIVE) |
2323 | sctp_transport_free(transport); | 2325 | sctp_assoc_rm_peer(asoc, transport); |
2324 | } | 2326 | } |
2325 | 2327 | ||
2326 | asoc->peer.transport_count = 0; | ||
2327 | |||
2328 | nomem: | 2328 | nomem: |
2329 | return 0; | 2329 | return 0; |
2330 | } | 2330 | } |
@@ -2460,6 +2460,9 @@ do_addr_param: | |||
2460 | break; | 2460 | break; |
2461 | 2461 | ||
2462 | case SCTP_PARAM_SET_PRIMARY: | 2462 | case SCTP_PARAM_SET_PRIMARY: |
2463 | if (!sctp_addip_enable) | ||
2464 | goto fall_through; | ||
2465 | |||
2463 | addr_param = param.v + sizeof(sctp_addip_param_t); | 2466 | addr_param = param.v + sizeof(sctp_addip_param_t); |
2464 | 2467 | ||
2465 | af = sctp_get_af_specific(param_type2af(param.p->type)); | 2468 | af = sctp_get_af_specific(param_type2af(param.p->type)); |
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 0f8c439b848a..5231f7aaac0e 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c | |||
@@ -60,24 +60,14 @@ static int proc_do_xprt(ctl_table *table, int write, struct file *file, | |||
60 | void __user *buffer, size_t *lenp, loff_t *ppos) | 60 | void __user *buffer, size_t *lenp, loff_t *ppos) |
61 | { | 61 | { |
62 | char tmpbuf[256]; | 62 | char tmpbuf[256]; |
63 | int len; | 63 | size_t len; |
64 | |||
64 | if ((*ppos && !write) || !*lenp) { | 65 | if ((*ppos && !write) || !*lenp) { |
65 | *lenp = 0; | 66 | *lenp = 0; |
66 | return 0; | 67 | return 0; |
67 | } | 68 | } |
68 | if (write) | 69 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); |
69 | return -EINVAL; | 70 | return simple_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len); |
70 | else { | ||
71 | len = svc_print_xprts(tmpbuf, sizeof(tmpbuf)); | ||
72 | if (!access_ok(VERIFY_WRITE, buffer, len)) | ||
73 | return -EFAULT; | ||
74 | |||
75 | if (__copy_to_user(buffer, tmpbuf, len)) | ||
76 | return -EFAULT; | ||
77 | } | ||
78 | *lenp -= len; | ||
79 | *ppos += len; | ||
80 | return 0; | ||
81 | } | 71 | } |
82 | 72 | ||
83 | static int | 73 | static int |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index b4b17f44cb29..74de31a06616 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -443,18 +443,18 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) | |||
443 | 443 | ||
444 | dprintk("svcrdma: rqstp=%p\n", rqstp); | 444 | dprintk("svcrdma: rqstp=%p\n", rqstp); |
445 | 445 | ||
446 | spin_lock_bh(&rdma_xprt->sc_read_complete_lock); | 446 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); |
447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { | 447 | if (!list_empty(&rdma_xprt->sc_read_complete_q)) { |
448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, | 448 | ctxt = list_entry(rdma_xprt->sc_read_complete_q.next, |
449 | struct svc_rdma_op_ctxt, | 449 | struct svc_rdma_op_ctxt, |
450 | dto_q); | 450 | dto_q); |
451 | list_del_init(&ctxt->dto_q); | 451 | list_del_init(&ctxt->dto_q); |
452 | } | 452 | } |
453 | spin_unlock_bh(&rdma_xprt->sc_read_complete_lock); | 453 | if (ctxt) { |
454 | if (ctxt) | 454 | spin_unlock_bh(&rdma_xprt->sc_rq_dto_lock); |
455 | return rdma_read_complete(rqstp, ctxt); | 455 | return rdma_read_complete(rqstp, ctxt); |
456 | } | ||
456 | 457 | ||
457 | spin_lock_bh(&rdma_xprt->sc_rq_dto_lock); | ||
458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { | 458 | if (!list_empty(&rdma_xprt->sc_rq_dto_q)) { |
459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, | 459 | ctxt = list_entry(rdma_xprt->sc_rq_dto_q.next, |
460 | struct svc_rdma_op_ctxt, | 460 | struct svc_rdma_op_ctxt, |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 19ddc382b777..900cb69728c6 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -359,11 +359,11 @@ static void sq_cq_reap(struct svcxprt_rdma *xprt) | |||
359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { | 359 | if (test_bit(RDMACTXT_F_LAST_CTXT, &ctxt->flags)) { |
360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; | 360 | struct svc_rdma_op_ctxt *read_hdr = ctxt->read_hdr; |
361 | BUG_ON(!read_hdr); | 361 | BUG_ON(!read_hdr); |
362 | spin_lock_bh(&xprt->sc_rq_dto_lock); | ||
362 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); | 363 | set_bit(XPT_DATA, &xprt->sc_xprt.xpt_flags); |
363 | spin_lock_bh(&xprt->sc_read_complete_lock); | ||
364 | list_add_tail(&read_hdr->dto_q, | 364 | list_add_tail(&read_hdr->dto_q, |
365 | &xprt->sc_read_complete_q); | 365 | &xprt->sc_read_complete_q); |
366 | spin_unlock_bh(&xprt->sc_read_complete_lock); | 366 | spin_unlock_bh(&xprt->sc_rq_dto_lock); |
367 | svc_xprt_enqueue(&xprt->sc_xprt); | 367 | svc_xprt_enqueue(&xprt->sc_xprt); |
368 | } | 368 | } |
369 | svc_rdma_put_context(ctxt, 0); | 369 | svc_rdma_put_context(ctxt, 0); |
@@ -428,7 +428,6 @@ static struct svcxprt_rdma *rdma_create_xprt(struct svc_serv *serv, | |||
428 | init_waitqueue_head(&cma_xprt->sc_send_wait); | 428 | init_waitqueue_head(&cma_xprt->sc_send_wait); |
429 | 429 | ||
430 | spin_lock_init(&cma_xprt->sc_lock); | 430 | spin_lock_init(&cma_xprt->sc_lock); |
431 | spin_lock_init(&cma_xprt->sc_read_complete_lock); | ||
432 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); | 431 | spin_lock_init(&cma_xprt->sc_rq_dto_lock); |
433 | 432 | ||
434 | cma_xprt->sc_ord = svcrdma_ord; | 433 | cma_xprt->sc_ord = svcrdma_ord; |
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index b1ff16aa4bdb..3ddaff42d1bb 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c | |||
@@ -96,8 +96,8 @@ struct bcbearer { | |||
96 | struct media media; | 96 | struct media media; |
97 | struct bcbearer_pair bpairs[MAX_BEARERS]; | 97 | struct bcbearer_pair bpairs[MAX_BEARERS]; |
98 | struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; | 98 | struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; |
99 | struct node_map remains; | 99 | struct tipc_node_map remains; |
100 | struct node_map remains_new; | 100 | struct tipc_node_map remains_new; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | /** | 103 | /** |
@@ -110,7 +110,7 @@ struct bcbearer { | |||
110 | 110 | ||
111 | struct bclink { | 111 | struct bclink { |
112 | struct link link; | 112 | struct link link; |
113 | struct node node; | 113 | struct tipc_node node; |
114 | }; | 114 | }; |
115 | 115 | ||
116 | 116 | ||
@@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf) | |||
149 | * Called with 'node' locked, bc_lock unlocked | 149 | * Called with 'node' locked, bc_lock unlocked |
150 | */ | 150 | */ |
151 | 151 | ||
152 | static void bclink_set_gap(struct node *n_ptr) | 152 | static void bclink_set_gap(struct tipc_node *n_ptr) |
153 | { | 153 | { |
154 | struct sk_buff *buf = n_ptr->bclink.deferred_head; | 154 | struct sk_buff *buf = n_ptr->bclink.deferred_head; |
155 | 155 | ||
@@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to) | |||
202 | * Node is locked, bc_lock unlocked. | 202 | * Node is locked, bc_lock unlocked. |
203 | */ | 203 | */ |
204 | 204 | ||
205 | void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) | 205 | void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) |
206 | { | 206 | { |
207 | struct sk_buff *crs; | 207 | struct sk_buff *crs; |
208 | struct sk_buff *next; | 208 | struct sk_buff *next; |
@@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) | |||
250 | * tipc_net_lock and node lock set | 250 | * tipc_net_lock and node lock set |
251 | */ | 251 | */ |
252 | 252 | ||
253 | static void bclink_send_ack(struct node *n_ptr) | 253 | static void bclink_send_ack(struct tipc_node *n_ptr) |
254 | { | 254 | { |
255 | struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; | 255 | struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; |
256 | 256 | ||
@@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr) | |||
264 | * tipc_net_lock and node lock set | 264 | * tipc_net_lock and node lock set |
265 | */ | 265 | */ |
266 | 266 | ||
267 | static void bclink_send_nack(struct node *n_ptr) | 267 | static void bclink_send_nack(struct tipc_node *n_ptr) |
268 | { | 268 | { |
269 | struct sk_buff *buf; | 269 | struct sk_buff *buf; |
270 | struct tipc_msg *msg; | 270 | struct tipc_msg *msg; |
@@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr) | |||
308 | * tipc_net_lock and node lock set | 308 | * tipc_net_lock and node lock set |
309 | */ | 309 | */ |
310 | 310 | ||
311 | void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) | 311 | void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 last_sent) |
312 | { | 312 | { |
313 | if (!n_ptr->bclink.supported || | 313 | if (!n_ptr->bclink.supported || |
314 | less_eq(last_sent, mod(n_ptr->bclink.last_in))) | 314 | less_eq(last_sent, mod(n_ptr->bclink.last_in))) |
@@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) | |||
328 | 328 | ||
329 | static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) | 329 | static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) |
330 | { | 330 | { |
331 | struct node *n_ptr = tipc_node_find(dest); | 331 | struct tipc_node *n_ptr = tipc_node_find(dest); |
332 | u32 my_after, my_to; | 332 | u32 my_after, my_to; |
333 | 333 | ||
334 | if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) | 334 | if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) |
@@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) | |||
418 | static int rx_count = 0; | 418 | static int rx_count = 0; |
419 | #endif | 419 | #endif |
420 | struct tipc_msg *msg = buf_msg(buf); | 420 | struct tipc_msg *msg = buf_msg(buf); |
421 | struct node* node = tipc_node_find(msg_prevnode(msg)); | 421 | struct tipc_node* node = tipc_node_find(msg_prevnode(msg)); |
422 | u32 next_in; | 422 | u32 next_in; |
423 | u32 seqno; | 423 | u32 seqno; |
424 | struct sk_buff *deferred; | 424 | struct sk_buff *deferred; |
@@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void) | |||
538 | return last_sent; | 538 | return last_sent; |
539 | } | 539 | } |
540 | 540 | ||
541 | u32 tipc_bclink_acks_missing(struct node *n_ptr) | 541 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) |
542 | { | 542 | { |
543 | return (n_ptr->bclink.supported && | 543 | return (n_ptr->bclink.supported && |
544 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); | 544 | (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); |
diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index a2416fa6b906..5aa024b99c55 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h | |||
@@ -41,12 +41,12 @@ | |||
41 | #define WSIZE 32 | 41 | #define WSIZE 32 |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct node_map - set of node identifiers | 44 | * struct tipc_node_map - set of node identifiers |
45 | * @count: # of nodes in set | 45 | * @count: # of nodes in set |
46 | * @map: bitmap of node identifiers that are in the set | 46 | * @map: bitmap of node identifiers that are in the set |
47 | */ | 47 | */ |
48 | 48 | ||
49 | struct node_map { | 49 | struct tipc_node_map { |
50 | u32 count; | 50 | u32 count; |
51 | u32 map[MAX_NODES / WSIZE]; | 51 | u32 map[MAX_NODES / WSIZE]; |
52 | }; | 52 | }; |
@@ -68,7 +68,7 @@ struct port_list { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | 70 | ||
71 | struct node; | 71 | struct tipc_node; |
72 | 72 | ||
73 | extern char tipc_bclink_name[]; | 73 | extern char tipc_bclink_name[]; |
74 | 74 | ||
@@ -77,7 +77,7 @@ extern char tipc_bclink_name[]; | |||
77 | * nmap_add - add a node to a node map | 77 | * nmap_add - add a node to a node map |
78 | */ | 78 | */ |
79 | 79 | ||
80 | static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) | 80 | static inline void tipc_nmap_add(struct tipc_node_map *nm_ptr, u32 node) |
81 | { | 81 | { |
82 | int n = tipc_node(node); | 82 | int n = tipc_node(node); |
83 | int w = n / WSIZE; | 83 | int w = n / WSIZE; |
@@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) | |||
93 | * nmap_remove - remove a node from a node map | 93 | * nmap_remove - remove a node from a node map |
94 | */ | 94 | */ |
95 | 95 | ||
96 | static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) | 96 | static inline void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node) |
97 | { | 97 | { |
98 | int n = tipc_node(node); | 98 | int n = tipc_node(node); |
99 | int w = n / WSIZE; | 99 | int w = n / WSIZE; |
@@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) | |||
109 | * nmap_equal - test for equality of node maps | 109 | * nmap_equal - test for equality of node maps |
110 | */ | 110 | */ |
111 | 111 | ||
112 | static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) | 112 | static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b) |
113 | { | 113 | { |
114 | return !memcmp(nm_a, nm_b, sizeof(*nm_a)); | 114 | return !memcmp(nm_a, nm_b, sizeof(*nm_a)); |
115 | } | 115 | } |
@@ -121,8 +121,8 @@ static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) | |||
121 | * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) | 121 | * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) |
122 | */ | 122 | */ |
123 | 123 | ||
124 | static inline void tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b, | 124 | static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b, |
125 | struct node_map *nm_diff) | 125 | struct tipc_node_map *nm_diff) |
126 | { | 126 | { |
127 | int stop = sizeof(nm_a->map) / sizeof(u32); | 127 | int stop = sizeof(nm_a->map) / sizeof(u32); |
128 | int w; | 128 | int w; |
@@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr) | |||
195 | 195 | ||
196 | int tipc_bclink_init(void); | 196 | int tipc_bclink_init(void); |
197 | void tipc_bclink_stop(void); | 197 | void tipc_bclink_stop(void); |
198 | void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked); | 198 | void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); |
199 | int tipc_bclink_send_msg(struct sk_buff *buf); | 199 | int tipc_bclink_send_msg(struct sk_buff *buf); |
200 | void tipc_bclink_recv_pkt(struct sk_buff *buf); | 200 | void tipc_bclink_recv_pkt(struct sk_buff *buf); |
201 | u32 tipc_bclink_get_last_sent(void); | 201 | u32 tipc_bclink_get_last_sent(void); |
202 | u32 tipc_bclink_acks_missing(struct node *n_ptr); | 202 | u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr); |
203 | void tipc_bclink_check_gap(struct node *n_ptr, u32 seqno); | 203 | void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 seqno); |
204 | int tipc_bclink_stats(char *stats_buf, const u32 buf_size); | 204 | int tipc_bclink_stats(char *stats_buf, const u32 buf_size); |
205 | int tipc_bclink_reset_stats(void); | 205 | int tipc_bclink_reset_stats(void); |
206 | int tipc_bclink_set_queue_limits(u32 limit); | 206 | int tipc_bclink_set_queue_limits(u32 limit); |
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c index 6a9aba3edd08..a7a36779b9b3 100644 --- a/net/tipc/bearer.c +++ b/net/tipc/bearer.c | |||
@@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name) | |||
599 | spin_lock_bh(&b_ptr->publ.lock); | 599 | spin_lock_bh(&b_ptr->publ.lock); |
600 | b_ptr->publ.blocked = 1; | 600 | b_ptr->publ.blocked = 1; |
601 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { | 601 | list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { |
602 | struct node *n_ptr = l_ptr->owner; | 602 | struct tipc_node *n_ptr = l_ptr->owner; |
603 | 603 | ||
604 | spin_lock_bh(&n_ptr->lock); | 604 | spin_lock_bh(&n_ptr->lock); |
605 | tipc_link_reset(l_ptr); | 605 | tipc_link_reset(l_ptr); |
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h index 6a36b6600e6c..ca5734892713 100644 --- a/net/tipc/bearer.h +++ b/net/tipc/bearer.h | |||
@@ -104,7 +104,7 @@ struct bearer { | |||
104 | u32 continue_count; | 104 | u32 continue_count; |
105 | int active; | 105 | int active; |
106 | char net_plane; | 106 | char net_plane; |
107 | struct node_map nodes; | 107 | struct tipc_node_map nodes; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | struct bearer_name { | 110 | struct bearer_name { |
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c index 46ee6c58532d..689fdefe9d04 100644 --- a/net/tipc/cluster.c +++ b/net/tipc/cluster.c | |||
@@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
48 | u32 lower, u32 upper); | 48 | u32 lower, u32 upper); |
49 | static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); | 49 | static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); |
50 | 50 | ||
51 | struct node **tipc_local_nodes = NULL; | 51 | struct tipc_node **tipc_local_nodes = NULL; |
52 | struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; | 52 | struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}}; |
53 | u32 tipc_highest_allowed_slave = 0; | 53 | u32 tipc_highest_allowed_slave = 0; |
54 | 54 | ||
55 | struct cluster *tipc_cltr_create(u32 addr) | 55 | struct cluster *tipc_cltr_create(u32 addr) |
@@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr) | |||
115 | 115 | ||
116 | u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) | 116 | u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) |
117 | { | 117 | { |
118 | struct node *n_ptr; | 118 | struct tipc_node *n_ptr; |
119 | u32 n_num = tipc_node(addr) + 1; | 119 | u32 n_num = tipc_node(addr) + 1; |
120 | 120 | ||
121 | if (!c_ptr) | 121 | if (!c_ptr) |
@@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) | |||
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
136 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) | 136 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr) |
137 | { | 137 | { |
138 | u32 n_num = tipc_node(n_ptr->addr); | 138 | u32 n_num = tipc_node(n_ptr->addr); |
139 | u32 max_n_num = tipc_max_nodes; | 139 | u32 max_n_num = tipc_max_nodes; |
@@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) | |||
196 | * Uses deterministic and fair algorithm. | 196 | * Uses deterministic and fair algorithm. |
197 | */ | 197 | */ |
198 | 198 | ||
199 | struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) | 199 | struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) |
200 | { | 200 | { |
201 | u32 n_num; | 201 | u32 n_num; |
202 | u32 mask = tipc_max_nodes; | 202 | u32 mask = tipc_max_nodes; |
@@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf) | |||
379 | { | 379 | { |
380 | struct tipc_msg *msg = buf_msg(buf); | 380 | struct tipc_msg *msg = buf_msg(buf); |
381 | struct cluster *c_ptr; | 381 | struct cluster *c_ptr; |
382 | struct node *n_ptr; | 382 | struct tipc_node *n_ptr; |
383 | unchar *node_table; | 383 | unchar *node_table; |
384 | u32 table_size; | 384 | u32 table_size; |
385 | u32 router; | 385 | u32 router; |
@@ -499,7 +499,7 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, | |||
499 | u32 lower, u32 upper) | 499 | u32 lower, u32 upper) |
500 | { | 500 | { |
501 | struct sk_buff *buf_copy; | 501 | struct sk_buff *buf_copy; |
502 | struct node *n_ptr; | 502 | struct tipc_node *n_ptr; |
503 | u32 n_num; | 503 | u32 n_num; |
504 | u32 tstop; | 504 | u32 tstop; |
505 | 505 | ||
@@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf) | |||
534 | { | 534 | { |
535 | struct sk_buff *buf_copy; | 535 | struct sk_buff *buf_copy; |
536 | struct cluster *c_ptr; | 536 | struct cluster *c_ptr; |
537 | struct node *n_ptr; | 537 | struct tipc_node *n_ptr; |
538 | u32 n_num; | 538 | u32 n_num; |
539 | u32 tstart; | 539 | u32 tstart; |
540 | u32 tstop; | 540 | u32 tstop; |
diff --git a/net/tipc/cluster.h b/net/tipc/cluster.h index 62df074afaec..333efb0b9c44 100644 --- a/net/tipc/cluster.h +++ b/net/tipc/cluster.h | |||
@@ -54,24 +54,24 @@ | |||
54 | struct cluster { | 54 | struct cluster { |
55 | u32 addr; | 55 | u32 addr; |
56 | struct _zone *owner; | 56 | struct _zone *owner; |
57 | struct node **nodes; | 57 | struct tipc_node **nodes; |
58 | u32 highest_node; | 58 | u32 highest_node; |
59 | u32 highest_slave; | 59 | u32 highest_slave; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | 62 | ||
63 | extern struct node **tipc_local_nodes; | 63 | extern struct tipc_node **tipc_local_nodes; |
64 | extern u32 tipc_highest_allowed_slave; | 64 | extern u32 tipc_highest_allowed_slave; |
65 | extern struct node_map tipc_cltr_bcast_nodes; | 65 | extern struct tipc_node_map tipc_cltr_bcast_nodes; |
66 | 66 | ||
67 | void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); | 67 | void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); |
68 | void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); | 68 | void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); |
69 | struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); | 69 | struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); |
70 | u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); | 70 | u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); |
71 | void tipc_cltr_recv_routing_table(struct sk_buff *buf); | 71 | void tipc_cltr_recv_routing_table(struct sk_buff *buf); |
72 | struct cluster *tipc_cltr_create(u32 addr); | 72 | struct cluster *tipc_cltr_create(u32 addr); |
73 | void tipc_cltr_delete(struct cluster *c_ptr); | 73 | void tipc_cltr_delete(struct cluster *c_ptr); |
74 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr); | 74 | void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr); |
75 | void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); | 75 | void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); |
76 | void tipc_cltr_broadcast(struct sk_buff *buf); | 76 | void tipc_cltr_broadcast(struct sk_buff *buf); |
77 | int tipc_cltr_init(void); | 77 | int tipc_cltr_init(void); |
diff --git a/net/tipc/discover.c b/net/tipc/discover.c index 1657f0e795ff..74b7d1e28aec 100644 --- a/net/tipc/discover.c +++ b/net/tipc/discover.c | |||
@@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr) | |||
193 | /* Always accept link here */ | 193 | /* Always accept link here */ |
194 | struct sk_buff *rbuf; | 194 | struct sk_buff *rbuf; |
195 | struct tipc_media_addr *addr; | 195 | struct tipc_media_addr *addr; |
196 | struct node *n_ptr = tipc_node_find(orig); | 196 | struct tipc_node *n_ptr = tipc_node_find(orig); |
197 | int link_fully_up; | 197 | int link_fully_up; |
198 | 198 | ||
199 | dbg(" in own cluster\n"); | 199 | dbg(" in own cluster\n"); |
diff --git a/net/tipc/link.c b/net/tipc/link.c index d60113ba4b1b..dd4c18b9a35b 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -1155,7 +1155,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
1155 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) | 1155 | int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) |
1156 | { | 1156 | { |
1157 | struct link *l_ptr; | 1157 | struct link *l_ptr; |
1158 | struct node *n_ptr; | 1158 | struct tipc_node *n_ptr; |
1159 | int res = -ELINKCONG; | 1159 | int res = -ELINKCONG; |
1160 | 1160 | ||
1161 | read_lock_bh(&tipc_net_lock); | 1161 | read_lock_bh(&tipc_net_lock); |
@@ -1226,7 +1226,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, | |||
1226 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) | 1226 | int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) |
1227 | { | 1227 | { |
1228 | struct link *l_ptr; | 1228 | struct link *l_ptr; |
1229 | struct node *n_ptr; | 1229 | struct tipc_node *n_ptr; |
1230 | int res; | 1230 | int res; |
1231 | u32 selector = msg_origport(buf_msg(buf)) & 1; | 1231 | u32 selector = msg_origport(buf_msg(buf)) & 1; |
1232 | u32 dummy; | 1232 | u32 dummy; |
@@ -1270,7 +1270,7 @@ int tipc_link_send_sections_fast(struct port *sender, | |||
1270 | struct tipc_msg *hdr = &sender->publ.phdr; | 1270 | struct tipc_msg *hdr = &sender->publ.phdr; |
1271 | struct link *l_ptr; | 1271 | struct link *l_ptr; |
1272 | struct sk_buff *buf; | 1272 | struct sk_buff *buf; |
1273 | struct node *node; | 1273 | struct tipc_node *node; |
1274 | int res; | 1274 | int res; |
1275 | u32 selector = msg_origport(hdr) & 1; | 1275 | u32 selector = msg_origport(hdr) & 1; |
1276 | 1276 | ||
@@ -1364,7 +1364,7 @@ static int link_send_sections_long(struct port *sender, | |||
1364 | u32 destaddr) | 1364 | u32 destaddr) |
1365 | { | 1365 | { |
1366 | struct link *l_ptr; | 1366 | struct link *l_ptr; |
1367 | struct node *node; | 1367 | struct tipc_node *node; |
1368 | struct tipc_msg *hdr = &sender->publ.phdr; | 1368 | struct tipc_msg *hdr = &sender->publ.phdr; |
1369 | u32 dsz = msg_data_sz(hdr); | 1369 | u32 dsz = msg_data_sz(hdr); |
1370 | u32 max_pkt,fragm_sz,rest; | 1370 | u32 max_pkt,fragm_sz,rest; |
@@ -1636,7 +1636,7 @@ void tipc_link_push_queue(struct link *l_ptr) | |||
1636 | 1636 | ||
1637 | static void link_reset_all(unsigned long addr) | 1637 | static void link_reset_all(unsigned long addr) |
1638 | { | 1638 | { |
1639 | struct node *n_ptr; | 1639 | struct tipc_node *n_ptr; |
1640 | char addr_string[16]; | 1640 | char addr_string[16]; |
1641 | u32 i; | 1641 | u32 i; |
1642 | 1642 | ||
@@ -1682,7 +1682,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) | |||
1682 | 1682 | ||
1683 | /* Handle failure on broadcast link */ | 1683 | /* Handle failure on broadcast link */ |
1684 | 1684 | ||
1685 | struct node *n_ptr; | 1685 | struct tipc_node *n_ptr; |
1686 | char addr_string[16]; | 1686 | char addr_string[16]; |
1687 | 1687 | ||
1688 | tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); | 1688 | tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); |
@@ -1843,7 +1843,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) | |||
1843 | read_lock_bh(&tipc_net_lock); | 1843 | read_lock_bh(&tipc_net_lock); |
1844 | while (head) { | 1844 | while (head) { |
1845 | struct bearer *b_ptr = (struct bearer *)tb_ptr; | 1845 | struct bearer *b_ptr = (struct bearer *)tb_ptr; |
1846 | struct node *n_ptr; | 1846 | struct tipc_node *n_ptr; |
1847 | struct link *l_ptr; | 1847 | struct link *l_ptr; |
1848 | struct sk_buff *crs; | 1848 | struct sk_buff *crs; |
1849 | struct sk_buff *buf = head; | 1849 | struct sk_buff *buf = head; |
@@ -2935,7 +2935,7 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) | |||
2935 | * Returns pointer to link (or 0 if invalid link name). | 2935 | * Returns pointer to link (or 0 if invalid link name). |
2936 | */ | 2936 | */ |
2937 | 2937 | ||
2938 | static struct link *link_find_link(const char *name, struct node **node) | 2938 | static struct link *link_find_link(const char *name, struct tipc_node **node) |
2939 | { | 2939 | { |
2940 | struct link_name link_name_parts; | 2940 | struct link_name link_name_parts; |
2941 | struct bearer *b_ptr; | 2941 | struct bearer *b_ptr; |
@@ -2965,7 +2965,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space | |||
2965 | struct tipc_link_config *args; | 2965 | struct tipc_link_config *args; |
2966 | u32 new_value; | 2966 | u32 new_value; |
2967 | struct link *l_ptr; | 2967 | struct link *l_ptr; |
2968 | struct node *node; | 2968 | struct tipc_node *node; |
2969 | int res; | 2969 | int res; |
2970 | 2970 | ||
2971 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) | 2971 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) |
@@ -3043,7 +3043,7 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_ | |||
3043 | { | 3043 | { |
3044 | char *link_name; | 3044 | char *link_name; |
3045 | struct link *l_ptr; | 3045 | struct link *l_ptr; |
3046 | struct node *node; | 3046 | struct tipc_node *node; |
3047 | 3047 | ||
3048 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) | 3048 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) |
3049 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | 3049 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); |
@@ -3091,7 +3091,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size) | |||
3091 | { | 3091 | { |
3092 | struct print_buf pb; | 3092 | struct print_buf pb; |
3093 | struct link *l_ptr; | 3093 | struct link *l_ptr; |
3094 | struct node *node; | 3094 | struct tipc_node *node; |
3095 | char *status; | 3095 | char *status; |
3096 | u32 profile_total = 0; | 3096 | u32 profile_total = 0; |
3097 | 3097 | ||
@@ -3207,7 +3207,7 @@ int link_control(const char *name, u32 op, u32 val) | |||
3207 | int res = -EINVAL; | 3207 | int res = -EINVAL; |
3208 | struct link *l_ptr; | 3208 | struct link *l_ptr; |
3209 | u32 bearer_id; | 3209 | u32 bearer_id; |
3210 | struct node * node; | 3210 | struct tipc_node * node; |
3211 | u32 a; | 3211 | u32 a; |
3212 | 3212 | ||
3213 | a = link_name2addr(name, &bearer_id); | 3213 | a = link_name2addr(name, &bearer_id); |
@@ -3249,7 +3249,7 @@ int link_control(const char *name, u32 op, u32 val) | |||
3249 | 3249 | ||
3250 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector) | 3250 | u32 tipc_link_get_max_pkt(u32 dest, u32 selector) |
3251 | { | 3251 | { |
3252 | struct node *n_ptr; | 3252 | struct tipc_node *n_ptr; |
3253 | struct link *l_ptr; | 3253 | struct link *l_ptr; |
3254 | u32 res = MAX_PKT_DEFAULT; | 3254 | u32 res = MAX_PKT_DEFAULT; |
3255 | 3255 | ||
diff --git a/net/tipc/link.h b/net/tipc/link.h index 52f3e7c1871f..6a51e38ad25c 100644 --- a/net/tipc/link.h +++ b/net/tipc/link.h | |||
@@ -116,7 +116,7 @@ struct link { | |||
116 | char name[TIPC_MAX_LINK_NAME]; | 116 | char name[TIPC_MAX_LINK_NAME]; |
117 | struct tipc_media_addr media_addr; | 117 | struct tipc_media_addr media_addr; |
118 | struct timer_list timer; | 118 | struct timer_list timer; |
119 | struct node *owner; | 119 | struct tipc_node *owner; |
120 | struct list_head link_list; | 120 | struct list_head link_list; |
121 | 121 | ||
122 | /* Management and link supervision data */ | 122 | /* Management and link supervision data */ |
diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h index b9e7cd336d76..139882d4ed00 100644 --- a/net/tipc/name_table.h +++ b/net/tipc/name_table.h | |||
@@ -76,7 +76,7 @@ struct publication { | |||
76 | u32 node; | 76 | u32 node; |
77 | u32 ref; | 77 | u32 ref; |
78 | u32 key; | 78 | u32 key; |
79 | struct node_subscr subscr; | 79 | struct tipc_node_subscr subscr; |
80 | struct list_head local_list; | 80 | struct list_head local_list; |
81 | struct list_head pport_list; | 81 | struct list_head pport_list; |
82 | struct publication *node_list_next; | 82 | struct publication *node_list_next; |
diff --git a/net/tipc/net.c b/net/tipc/net.c index ec7b04fbdc43..7906608bf510 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -118,7 +118,7 @@ | |||
118 | DEFINE_RWLOCK(tipc_net_lock); | 118 | DEFINE_RWLOCK(tipc_net_lock); |
119 | struct network tipc_net = { NULL }; | 119 | struct network tipc_net = { NULL }; |
120 | 120 | ||
121 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref) | 121 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) |
122 | { | 122 | { |
123 | return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); | 123 | return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); |
124 | } | 124 | } |
diff --git a/net/tipc/net.h b/net/tipc/net.h index d154ac2bda9a..de2b9ad8f646 100644 --- a/net/tipc/net.h +++ b/net/tipc/net.h | |||
@@ -55,7 +55,7 @@ extern rwlock_t tipc_net_lock; | |||
55 | void tipc_net_remove_as_router(u32 router); | 55 | void tipc_net_remove_as_router(u32 router); |
56 | void tipc_net_send_external_routes(u32 dest); | 56 | void tipc_net_send_external_routes(u32 dest); |
57 | void tipc_net_route_msg(struct sk_buff *buf); | 57 | void tipc_net_route_msg(struct sk_buff *buf); |
58 | struct node *tipc_net_select_remote_node(u32 addr, u32 ref); | 58 | struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref); |
59 | u32 tipc_net_select_router(u32 addr, u32 ref); | 59 | u32 tipc_net_select_router(u32 addr, u32 ref); |
60 | 60 | ||
61 | int tipc_net_start(u32 addr); | 61 | int tipc_net_start(u32 addr); |
diff --git a/net/tipc/node.c b/net/tipc/node.c index ee952ad60218..20d98c56e152 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -46,11 +46,11 @@ | |||
46 | #include "bearer.h" | 46 | #include "bearer.h" |
47 | #include "name_distr.h" | 47 | #include "name_distr.h" |
48 | 48 | ||
49 | void node_print(struct print_buf *buf, struct node *n_ptr, char *str); | 49 | void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str); |
50 | static void node_lost_contact(struct node *n_ptr); | 50 | static void node_lost_contact(struct tipc_node *n_ptr); |
51 | static void node_established_contact(struct node *n_ptr); | 51 | static void node_established_contact(struct tipc_node *n_ptr); |
52 | 52 | ||
53 | struct node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ | 53 | struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ |
54 | 54 | ||
55 | static DEFINE_SPINLOCK(node_create_lock); | 55 | static DEFINE_SPINLOCK(node_create_lock); |
56 | 56 | ||
@@ -66,11 +66,11 @@ u32 tipc_own_tag = 0; | |||
66 | * but this is a non-trivial change.) | 66 | * but this is a non-trivial change.) |
67 | */ | 67 | */ |
68 | 68 | ||
69 | struct node *tipc_node_create(u32 addr) | 69 | struct tipc_node *tipc_node_create(u32 addr) |
70 | { | 70 | { |
71 | struct cluster *c_ptr; | 71 | struct cluster *c_ptr; |
72 | struct node *n_ptr; | 72 | struct tipc_node *n_ptr; |
73 | struct node **curr_node; | 73 | struct tipc_node **curr_node; |
74 | 74 | ||
75 | spin_lock_bh(&node_create_lock); | 75 | spin_lock_bh(&node_create_lock); |
76 | 76 | ||
@@ -120,7 +120,7 @@ struct node *tipc_node_create(u32 addr) | |||
120 | return n_ptr; | 120 | return n_ptr; |
121 | } | 121 | } |
122 | 122 | ||
123 | void tipc_node_delete(struct node *n_ptr) | 123 | void tipc_node_delete(struct tipc_node *n_ptr) |
124 | { | 124 | { |
125 | if (!n_ptr) | 125 | if (!n_ptr) |
126 | return; | 126 | return; |
@@ -146,7 +146,7 @@ void tipc_node_delete(struct node *n_ptr) | |||
146 | * Link becomes active (alone or shared) or standby, depending on its priority. | 146 | * Link becomes active (alone or shared) or standby, depending on its priority. |
147 | */ | 147 | */ |
148 | 148 | ||
149 | void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) | 149 | void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr) |
150 | { | 150 | { |
151 | struct link **active = &n_ptr->active_links[0]; | 151 | struct link **active = &n_ptr->active_links[0]; |
152 | 152 | ||
@@ -180,7 +180,7 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) | |||
180 | * node_select_active_links - select active link | 180 | * node_select_active_links - select active link |
181 | */ | 181 | */ |
182 | 182 | ||
183 | static void node_select_active_links(struct node *n_ptr) | 183 | static void node_select_active_links(struct tipc_node *n_ptr) |
184 | { | 184 | { |
185 | struct link **active = &n_ptr->active_links[0]; | 185 | struct link **active = &n_ptr->active_links[0]; |
186 | u32 i; | 186 | u32 i; |
@@ -208,7 +208,7 @@ static void node_select_active_links(struct node *n_ptr) | |||
208 | * tipc_node_link_down - handle loss of link | 208 | * tipc_node_link_down - handle loss of link |
209 | */ | 209 | */ |
210 | 210 | ||
211 | void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) | 211 | void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr) |
212 | { | 212 | { |
213 | struct link **active; | 213 | struct link **active; |
214 | 214 | ||
@@ -235,30 +235,30 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) | |||
235 | node_lost_contact(n_ptr); | 235 | node_lost_contact(n_ptr); |
236 | } | 236 | } |
237 | 237 | ||
238 | int tipc_node_has_active_links(struct node *n_ptr) | 238 | int tipc_node_has_active_links(struct tipc_node *n_ptr) |
239 | { | 239 | { |
240 | return (n_ptr && | 240 | return (n_ptr && |
241 | ((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); | 241 | ((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); |
242 | } | 242 | } |
243 | 243 | ||
244 | int tipc_node_has_redundant_links(struct node *n_ptr) | 244 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr) |
245 | { | 245 | { |
246 | return (n_ptr->working_links > 1); | 246 | return (n_ptr->working_links > 1); |
247 | } | 247 | } |
248 | 248 | ||
249 | static int tipc_node_has_active_routes(struct node *n_ptr) | 249 | static int tipc_node_has_active_routes(struct tipc_node *n_ptr) |
250 | { | 250 | { |
251 | return (n_ptr && (n_ptr->last_router >= 0)); | 251 | return (n_ptr && (n_ptr->last_router >= 0)); |
252 | } | 252 | } |
253 | 253 | ||
254 | int tipc_node_is_up(struct node *n_ptr) | 254 | int tipc_node_is_up(struct tipc_node *n_ptr) |
255 | { | 255 | { |
256 | return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); | 256 | return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); |
257 | } | 257 | } |
258 | 258 | ||
259 | struct node *tipc_node_attach_link(struct link *l_ptr) | 259 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr) |
260 | { | 260 | { |
261 | struct node *n_ptr = tipc_node_find(l_ptr->addr); | 261 | struct tipc_node *n_ptr = tipc_node_find(l_ptr->addr); |
262 | 262 | ||
263 | if (!n_ptr) | 263 | if (!n_ptr) |
264 | n_ptr = tipc_node_create(l_ptr->addr); | 264 | n_ptr = tipc_node_create(l_ptr->addr); |
@@ -285,7 +285,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr) | |||
285 | return NULL; | 285 | return NULL; |
286 | } | 286 | } |
287 | 287 | ||
288 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) | 288 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) |
289 | { | 289 | { |
290 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; | 290 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; |
291 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; | 291 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; |
@@ -338,7 +338,7 @@ void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) | |||
338 | * | 338 | * |
339 | */ | 339 | */ |
340 | 340 | ||
341 | static void node_established_contact(struct node *n_ptr) | 341 | static void node_established_contact(struct tipc_node *n_ptr) |
342 | { | 342 | { |
343 | struct cluster *c_ptr; | 343 | struct cluster *c_ptr; |
344 | 344 | ||
@@ -384,10 +384,10 @@ static void node_established_contact(struct node *n_ptr) | |||
384 | tipc_highest_allowed_slave); | 384 | tipc_highest_allowed_slave); |
385 | } | 385 | } |
386 | 386 | ||
387 | static void node_lost_contact(struct node *n_ptr) | 387 | static void node_lost_contact(struct tipc_node *n_ptr) |
388 | { | 388 | { |
389 | struct cluster *c_ptr; | 389 | struct cluster *c_ptr; |
390 | struct node_subscr *ns, *tns; | 390 | struct tipc_node_subscr *ns, *tns; |
391 | char addr_string[16]; | 391 | char addr_string[16]; |
392 | u32 i; | 392 | u32 i; |
393 | 393 | ||
@@ -466,9 +466,9 @@ static void node_lost_contact(struct node *n_ptr) | |||
466 | * Called by when cluster local lookup has failed. | 466 | * Called by when cluster local lookup has failed. |
467 | */ | 467 | */ |
468 | 468 | ||
469 | struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | 469 | struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector) |
470 | { | 470 | { |
471 | struct node *n_ptr; | 471 | struct tipc_node *n_ptr; |
472 | u32 router_addr; | 472 | u32 router_addr; |
473 | 473 | ||
474 | if (!tipc_addr_domain_valid(addr)) | 474 | if (!tipc_addr_domain_valid(addr)) |
@@ -513,7 +513,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | |||
513 | * Uses a deterministic and fair algorithm for selecting router node. | 513 | * Uses a deterministic and fair algorithm for selecting router node. |
514 | */ | 514 | */ |
515 | 515 | ||
516 | u32 tipc_node_select_router(struct node *n_ptr, u32 ref) | 516 | u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref) |
517 | { | 517 | { |
518 | u32 ulim; | 518 | u32 ulim; |
519 | u32 mask; | 519 | u32 mask; |
@@ -551,7 +551,7 @@ u32 tipc_node_select_router(struct node *n_ptr, u32 ref) | |||
551 | return tipc_addr(own_zone(), own_cluster(), r); | 551 | return tipc_addr(own_zone(), own_cluster(), r); |
552 | } | 552 | } |
553 | 553 | ||
554 | void tipc_node_add_router(struct node *n_ptr, u32 router) | 554 | void tipc_node_add_router(struct tipc_node *n_ptr, u32 router) |
555 | { | 555 | { |
556 | u32 r_num = tipc_node(router); | 556 | u32 r_num = tipc_node(router); |
557 | 557 | ||
@@ -562,7 +562,7 @@ void tipc_node_add_router(struct node *n_ptr, u32 router) | |||
562 | !n_ptr->routers[n_ptr->last_router]); | 562 | !n_ptr->routers[n_ptr->last_router]); |
563 | } | 563 | } |
564 | 564 | ||
565 | void tipc_node_remove_router(struct node *n_ptr, u32 router) | 565 | void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router) |
566 | { | 566 | { |
567 | u32 r_num = tipc_node(router); | 567 | u32 r_num = tipc_node(router); |
568 | 568 | ||
@@ -580,7 +580,7 @@ void tipc_node_remove_router(struct node *n_ptr, u32 router) | |||
580 | } | 580 | } |
581 | 581 | ||
582 | #if 0 | 582 | #if 0 |
583 | void node_print(struct print_buf *buf, struct node *n_ptr, char *str) | 583 | void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str) |
584 | { | 584 | { |
585 | u32 i; | 585 | u32 i; |
586 | 586 | ||
@@ -597,7 +597,7 @@ void node_print(struct print_buf *buf, struct node *n_ptr, char *str) | |||
597 | 597 | ||
598 | u32 tipc_available_nodes(const u32 domain) | 598 | u32 tipc_available_nodes(const u32 domain) |
599 | { | 599 | { |
600 | struct node *n_ptr; | 600 | struct tipc_node *n_ptr; |
601 | u32 cnt = 0; | 601 | u32 cnt = 0; |
602 | 602 | ||
603 | read_lock_bh(&tipc_net_lock); | 603 | read_lock_bh(&tipc_net_lock); |
@@ -615,7 +615,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space) | |||
615 | { | 615 | { |
616 | u32 domain; | 616 | u32 domain; |
617 | struct sk_buff *buf; | 617 | struct sk_buff *buf; |
618 | struct node *n_ptr; | 618 | struct tipc_node *n_ptr; |
619 | struct tipc_node_info node_info; | 619 | struct tipc_node_info node_info; |
620 | u32 payload_size; | 620 | u32 payload_size; |
621 | 621 | ||
@@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) | |||
667 | { | 667 | { |
668 | u32 domain; | 668 | u32 domain; |
669 | struct sk_buff *buf; | 669 | struct sk_buff *buf; |
670 | struct node *n_ptr; | 670 | struct tipc_node *n_ptr; |
671 | struct tipc_link_info link_info; | 671 | struct tipc_link_info link_info; |
672 | u32 payload_size; | 672 | u32 payload_size; |
673 | 673 | ||
diff --git a/net/tipc/node.h b/net/tipc/node.h index cd1882654bbb..6f990da5d143 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h | |||
@@ -43,7 +43,7 @@ | |||
43 | #include "bearer.h" | 43 | #include "bearer.h" |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * struct node - TIPC node structure | 46 | * struct tipc_node - TIPC node structure |
47 | * @addr: network address of node | 47 | * @addr: network address of node |
48 | * @lock: spinlock governing access to structure | 48 | * @lock: spinlock governing access to structure |
49 | * @owner: pointer to cluster that node belongs to | 49 | * @owner: pointer to cluster that node belongs to |
@@ -68,11 +68,11 @@ | |||
68 | * @defragm: list of partially reassembled b'cast message fragments from node | 68 | * @defragm: list of partially reassembled b'cast message fragments from node |
69 | */ | 69 | */ |
70 | 70 | ||
71 | struct node { | 71 | struct tipc_node { |
72 | u32 addr; | 72 | u32 addr; |
73 | spinlock_t lock; | 73 | spinlock_t lock; |
74 | struct cluster *owner; | 74 | struct cluster *owner; |
75 | struct node *next; | 75 | struct tipc_node *next; |
76 | struct list_head nsub; | 76 | struct list_head nsub; |
77 | struct link *active_links[2]; | 77 | struct link *active_links[2]; |
78 | struct link *links[MAX_BEARERS]; | 78 | struct link *links[MAX_BEARERS]; |
@@ -94,26 +94,26 @@ struct node { | |||
94 | } bclink; | 94 | } bclink; |
95 | }; | 95 | }; |
96 | 96 | ||
97 | extern struct node *tipc_nodes; | 97 | extern struct tipc_node *tipc_nodes; |
98 | extern u32 tipc_own_tag; | 98 | extern u32 tipc_own_tag; |
99 | 99 | ||
100 | struct node *tipc_node_create(u32 addr); | 100 | struct tipc_node *tipc_node_create(u32 addr); |
101 | void tipc_node_delete(struct node *n_ptr); | 101 | void tipc_node_delete(struct tipc_node *n_ptr); |
102 | struct node *tipc_node_attach_link(struct link *l_ptr); | 102 | struct tipc_node *tipc_node_attach_link(struct link *l_ptr); |
103 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr); | 103 | void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr); |
104 | void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr); | 104 | void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr); |
105 | void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr); | 105 | void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr); |
106 | int tipc_node_has_active_links(struct node *n_ptr); | 106 | int tipc_node_has_active_links(struct tipc_node *n_ptr); |
107 | int tipc_node_has_redundant_links(struct node *n_ptr); | 107 | int tipc_node_has_redundant_links(struct tipc_node *n_ptr); |
108 | u32 tipc_node_select_router(struct node *n_ptr, u32 ref); | 108 | u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref); |
109 | struct node *tipc_node_select_next_hop(u32 addr, u32 selector); | 109 | struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector); |
110 | int tipc_node_is_up(struct node *n_ptr); | 110 | int tipc_node_is_up(struct tipc_node *n_ptr); |
111 | void tipc_node_add_router(struct node *n_ptr, u32 router); | 111 | void tipc_node_add_router(struct tipc_node *n_ptr, u32 router); |
112 | void tipc_node_remove_router(struct node *n_ptr, u32 router); | 112 | void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router); |
113 | struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); | 113 | struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); |
114 | struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); | 114 | struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); |
115 | 115 | ||
116 | static inline struct node *tipc_node_find(u32 addr) | 116 | static inline struct tipc_node *tipc_node_find(u32 addr) |
117 | { | 117 | { |
118 | if (likely(in_own_cluster(addr))) | 118 | if (likely(in_own_cluster(addr))) |
119 | return tipc_local_nodes[tipc_node(addr)]; | 119 | return tipc_local_nodes[tipc_node(addr)]; |
@@ -126,19 +126,19 @@ static inline struct node *tipc_node_find(u32 addr) | |||
126 | return NULL; | 126 | return NULL; |
127 | } | 127 | } |
128 | 128 | ||
129 | static inline struct node *tipc_node_select(u32 addr, u32 selector) | 129 | static inline struct tipc_node *tipc_node_select(u32 addr, u32 selector) |
130 | { | 130 | { |
131 | if (likely(in_own_cluster(addr))) | 131 | if (likely(in_own_cluster(addr))) |
132 | return tipc_local_nodes[tipc_node(addr)]; | 132 | return tipc_local_nodes[tipc_node(addr)]; |
133 | return tipc_node_select_next_hop(addr, selector); | 133 | return tipc_node_select_next_hop(addr, selector); |
134 | } | 134 | } |
135 | 135 | ||
136 | static inline void tipc_node_lock(struct node *n_ptr) | 136 | static inline void tipc_node_lock(struct tipc_node *n_ptr) |
137 | { | 137 | { |
138 | spin_lock_bh(&n_ptr->lock); | 138 | spin_lock_bh(&n_ptr->lock); |
139 | } | 139 | } |
140 | 140 | ||
141 | static inline void tipc_node_unlock(struct node *n_ptr) | 141 | static inline void tipc_node_unlock(struct tipc_node *n_ptr) |
142 | { | 142 | { |
143 | spin_unlock_bh(&n_ptr->lock); | 143 | spin_unlock_bh(&n_ptr->lock); |
144 | } | 144 | } |
diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index 8ecbd0fb6103..19194d476a9e 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c | |||
@@ -44,7 +44,7 @@ | |||
44 | * tipc_nodesub_subscribe - create "node down" subscription for specified node | 44 | * tipc_nodesub_subscribe - create "node down" subscription for specified node |
45 | */ | 45 | */ |
46 | 46 | ||
47 | void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | 47 | void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, |
48 | void *usr_handle, net_ev_handler handle_down) | 48 | void *usr_handle, net_ev_handler handle_down) |
49 | { | 49 | { |
50 | if (addr == tipc_own_addr) { | 50 | if (addr == tipc_own_addr) { |
@@ -69,7 +69,7 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | |||
69 | * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) | 69 | * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) |
70 | */ | 70 | */ |
71 | 71 | ||
72 | void tipc_nodesub_unsubscribe(struct node_subscr *node_sub) | 72 | void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub) |
73 | { | 73 | { |
74 | if (!node_sub->node) | 74 | if (!node_sub->node) |
75 | return; | 75 | return; |
diff --git a/net/tipc/node_subscr.h b/net/tipc/node_subscr.h index 5f3f5859b84c..006ed739f515 100644 --- a/net/tipc/node_subscr.h +++ b/net/tipc/node_subscr.h | |||
@@ -42,22 +42,22 @@ | |||
42 | typedef void (*net_ev_handler) (void *usr_handle); | 42 | typedef void (*net_ev_handler) (void *usr_handle); |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * struct node_subscr - "node down" subscription entry | 45 | * struct tipc_node_subscr - "node down" subscription entry |
46 | * @node: ptr to node structure of interest (or NULL, if none) | 46 | * @node: ptr to node structure of interest (or NULL, if none) |
47 | * @handle_node_down: routine to invoke when node fails | 47 | * @handle_node_down: routine to invoke when node fails |
48 | * @usr_handle: argument to pass to routine when node fails | 48 | * @usr_handle: argument to pass to routine when node fails |
49 | * @nodesub_list: adjacent entries in list of subscriptions for the node | 49 | * @nodesub_list: adjacent entries in list of subscriptions for the node |
50 | */ | 50 | */ |
51 | 51 | ||
52 | struct node_subscr { | 52 | struct tipc_node_subscr { |
53 | struct node *node; | 53 | struct tipc_node *node; |
54 | net_ev_handler handle_node_down; | 54 | net_ev_handler handle_node_down; |
55 | void *usr_handle; | 55 | void *usr_handle; |
56 | struct list_head nodesub_list; | 56 | struct list_head nodesub_list; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, | 59 | void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, |
60 | void *usr_handle, net_ev_handler handle_down); | 60 | void *usr_handle, net_ev_handler handle_down); |
61 | void tipc_nodesub_unsubscribe(struct node_subscr *node_sub); | 61 | void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub); |
62 | 62 | ||
63 | #endif | 63 | #endif |
diff --git a/net/tipc/port.h b/net/tipc/port.h index e5f8c16429bd..ff31ee4a1dc3 100644 --- a/net/tipc/port.h +++ b/net/tipc/port.h | |||
@@ -105,7 +105,7 @@ struct port { | |||
105 | u32 probing_interval; | 105 | u32 probing_interval; |
106 | u32 last_in_seqno; | 106 | u32 last_in_seqno; |
107 | struct timer_list timer; | 107 | struct timer_list timer; |
108 | struct node_subscr subscription; | 108 | struct tipc_node_subscr subscription; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | extern spinlock_t tipc_port_list_lock; | 111 | extern spinlock_t tipc_port_list_lock; |
diff --git a/net/tipc/zone.c b/net/tipc/zone.c index 3506f8563441..2c01ba2d86bf 100644 --- a/net/tipc/zone.c +++ b/net/tipc/zone.c | |||
@@ -111,10 +111,10 @@ void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest) | |||
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) | 114 | struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) |
115 | { | 115 | { |
116 | struct cluster *c_ptr; | 116 | struct cluster *c_ptr; |
117 | struct node *n_ptr; | 117 | struct tipc_node *n_ptr; |
118 | u32 c_num; | 118 | u32 c_num; |
119 | 119 | ||
120 | if (!z_ptr) | 120 | if (!z_ptr) |
diff --git a/net/tipc/zone.h b/net/tipc/zone.h index 6e7a08df8af5..7bdc3406ba9b 100644 --- a/net/tipc/zone.h +++ b/net/tipc/zone.h | |||
@@ -54,7 +54,7 @@ struct _zone { | |||
54 | u32 links; | 54 | u32 links; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); | 57 | struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); |
58 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); | 58 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); |
59 | void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); | 59 | void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); |
60 | void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); | 60 | void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); |
diff --git a/net/wireless/Kconfig b/net/wireless/Kconfig index ab015c62d561..833b024f8f66 100644 --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig | |||
@@ -39,4 +39,5 @@ config WIRELESS_EXT_SYSFS | |||
39 | files in /sys/class/net/*/wireless/. The same information | 39 | files in /sys/class/net/*/wireless/. The same information |
40 | is available via the ioctls as well. | 40 | is available via the ioctls as well. |
41 | 41 | ||
42 | Say Y if you have programs using it (we don't know of any). | 42 | Say Y if you have programs using it, like old versions of |
43 | hal. | ||
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 841b32a2e680..b7754b1b73a4 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -1077,6 +1077,7 @@ static void __xfrm_policy_link(struct xfrm_policy *pol, int dir) | |||
1077 | struct hlist_head *chain = policy_hash_bysel(&pol->selector, | 1077 | struct hlist_head *chain = policy_hash_bysel(&pol->selector, |
1078 | pol->family, dir); | 1078 | pol->family, dir); |
1079 | 1079 | ||
1080 | list_add_tail(&pol->bytype, &xfrm_policy_bytype[pol->type]); | ||
1080 | hlist_add_head(&pol->bydst, chain); | 1081 | hlist_add_head(&pol->bydst, chain); |
1081 | hlist_add_head(&pol->byidx, xfrm_policy_byidx+idx_hash(pol->index)); | 1082 | hlist_add_head(&pol->byidx, xfrm_policy_byidx+idx_hash(pol->index)); |
1082 | xfrm_policy_count[dir]++; | 1083 | xfrm_policy_count[dir]++; |
@@ -1731,8 +1732,7 @@ restart: | |||
1731 | * We can't enlist stable bundles either. | 1732 | * We can't enlist stable bundles either. |
1732 | */ | 1733 | */ |
1733 | write_unlock_bh(&policy->lock); | 1734 | write_unlock_bh(&policy->lock); |
1734 | if (dst) | 1735 | dst_free(dst); |
1735 | dst_free(dst); | ||
1736 | 1736 | ||
1737 | if (pol_dead) | 1737 | if (pol_dead) |
1738 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); | 1738 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLDEAD); |
@@ -1748,8 +1748,7 @@ restart: | |||
1748 | err = xfrm_dst_update_origin(dst, fl); | 1748 | err = xfrm_dst_update_origin(dst, fl); |
1749 | if (unlikely(err)) { | 1749 | if (unlikely(err)) { |
1750 | write_unlock_bh(&policy->lock); | 1750 | write_unlock_bh(&policy->lock); |
1751 | if (dst) | 1751 | dst_free(dst); |
1752 | dst_free(dst); | ||
1753 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); | 1752 | XFRM_INC_STATS(LINUX_MIB_XFRMOUTBUNDLECHECKERROR); |
1754 | goto error; | 1753 | goto error; |
1755 | } | 1754 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 4c6914ef7d92..0a8f09c3144c 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -780,11 +780,13 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
780 | { | 780 | { |
781 | unsigned int h; | 781 | unsigned int h; |
782 | struct hlist_node *entry; | 782 | struct hlist_node *entry; |
783 | struct xfrm_state *x, *x0; | 783 | struct xfrm_state *x, *x0, *to_put; |
784 | int acquire_in_progress = 0; | 784 | int acquire_in_progress = 0; |
785 | int error = 0; | 785 | int error = 0; |
786 | struct xfrm_state *best = NULL; | 786 | struct xfrm_state *best = NULL; |
787 | 787 | ||
788 | to_put = NULL; | ||
789 | |||
788 | spin_lock_bh(&xfrm_state_lock); | 790 | spin_lock_bh(&xfrm_state_lock); |
789 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); | 791 | h = xfrm_dst_hash(daddr, saddr, tmpl->reqid, family); |
790 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { | 792 | hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { |
@@ -833,7 +835,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
833 | if (tmpl->id.spi && | 835 | if (tmpl->id.spi && |
834 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, | 836 | (x0 = __xfrm_state_lookup(daddr, tmpl->id.spi, |
835 | tmpl->id.proto, family)) != NULL) { | 837 | tmpl->id.proto, family)) != NULL) { |
836 | xfrm_state_put(x0); | 838 | to_put = x0; |
837 | error = -EEXIST; | 839 | error = -EEXIST; |
838 | goto out; | 840 | goto out; |
839 | } | 841 | } |
@@ -849,13 +851,14 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
849 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); | 851 | error = security_xfrm_state_alloc_acquire(x, pol->security, fl->secid); |
850 | if (error) { | 852 | if (error) { |
851 | x->km.state = XFRM_STATE_DEAD; | 853 | x->km.state = XFRM_STATE_DEAD; |
852 | xfrm_state_put(x); | 854 | to_put = x; |
853 | x = NULL; | 855 | x = NULL; |
854 | goto out; | 856 | goto out; |
855 | } | 857 | } |
856 | 858 | ||
857 | if (km_query(x, tmpl, pol) == 0) { | 859 | if (km_query(x, tmpl, pol) == 0) { |
858 | x->km.state = XFRM_STATE_ACQ; | 860 | x->km.state = XFRM_STATE_ACQ; |
861 | list_add_tail(&x->all, &xfrm_state_all); | ||
859 | hlist_add_head(&x->bydst, xfrm_state_bydst+h); | 862 | hlist_add_head(&x->bydst, xfrm_state_bydst+h); |
860 | h = xfrm_src_hash(daddr, saddr, family); | 863 | h = xfrm_src_hash(daddr, saddr, family); |
861 | hlist_add_head(&x->bysrc, xfrm_state_bysrc+h); | 864 | hlist_add_head(&x->bysrc, xfrm_state_bysrc+h); |
@@ -870,7 +873,7 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
870 | xfrm_hash_grow_check(x->bydst.next != NULL); | 873 | xfrm_hash_grow_check(x->bydst.next != NULL); |
871 | } else { | 874 | } else { |
872 | x->km.state = XFRM_STATE_DEAD; | 875 | x->km.state = XFRM_STATE_DEAD; |
873 | xfrm_state_put(x); | 876 | to_put = x; |
874 | x = NULL; | 877 | x = NULL; |
875 | error = -ESRCH; | 878 | error = -ESRCH; |
876 | } | 879 | } |
@@ -881,6 +884,8 @@ out: | |||
881 | else | 884 | else |
882 | *err = acquire_in_progress ? -EAGAIN : error; | 885 | *err = acquire_in_progress ? -EAGAIN : error; |
883 | spin_unlock_bh(&xfrm_state_lock); | 886 | spin_unlock_bh(&xfrm_state_lock); |
887 | if (to_put) | ||
888 | xfrm_state_put(to_put); | ||
884 | return x; | 889 | return x; |
885 | } | 890 | } |
886 | 891 | ||
@@ -1051,6 +1056,7 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re | |||
1051 | xfrm_state_hold(x); | 1056 | xfrm_state_hold(x); |
1052 | x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; | 1057 | x->timer.expires = jiffies + sysctl_xfrm_acq_expires*HZ; |
1053 | add_timer(&x->timer); | 1058 | add_timer(&x->timer); |
1059 | list_add_tail(&x->all, &xfrm_state_all); | ||
1054 | hlist_add_head(&x->bydst, xfrm_state_bydst+h); | 1060 | hlist_add_head(&x->bydst, xfrm_state_bydst+h); |
1055 | h = xfrm_src_hash(daddr, saddr, family); | 1061 | h = xfrm_src_hash(daddr, saddr, family); |
1056 | hlist_add_head(&x->bysrc, xfrm_state_bysrc+h); | 1062 | hlist_add_head(&x->bysrc, xfrm_state_bysrc+h); |
@@ -1067,18 +1073,20 @@ static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq); | |||
1067 | 1073 | ||
1068 | int xfrm_state_add(struct xfrm_state *x) | 1074 | int xfrm_state_add(struct xfrm_state *x) |
1069 | { | 1075 | { |
1070 | struct xfrm_state *x1; | 1076 | struct xfrm_state *x1, *to_put; |
1071 | int family; | 1077 | int family; |
1072 | int err; | 1078 | int err; |
1073 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1079 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1074 | 1080 | ||
1075 | family = x->props.family; | 1081 | family = x->props.family; |
1076 | 1082 | ||
1083 | to_put = NULL; | ||
1084 | |||
1077 | spin_lock_bh(&xfrm_state_lock); | 1085 | spin_lock_bh(&xfrm_state_lock); |
1078 | 1086 | ||
1079 | x1 = __xfrm_state_locate(x, use_spi, family); | 1087 | x1 = __xfrm_state_locate(x, use_spi, family); |
1080 | if (x1) { | 1088 | if (x1) { |
1081 | xfrm_state_put(x1); | 1089 | to_put = x1; |
1082 | x1 = NULL; | 1090 | x1 = NULL; |
1083 | err = -EEXIST; | 1091 | err = -EEXIST; |
1084 | goto out; | 1092 | goto out; |
@@ -1088,7 +1096,7 @@ int xfrm_state_add(struct xfrm_state *x) | |||
1088 | x1 = __xfrm_find_acq_byseq(x->km.seq); | 1096 | x1 = __xfrm_find_acq_byseq(x->km.seq); |
1089 | if (x1 && ((x1->id.proto != x->id.proto) || | 1097 | if (x1 && ((x1->id.proto != x->id.proto) || |
1090 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { | 1098 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { |
1091 | xfrm_state_put(x1); | 1099 | to_put = x1; |
1092 | x1 = NULL; | 1100 | x1 = NULL; |
1093 | } | 1101 | } |
1094 | } | 1102 | } |
@@ -1110,6 +1118,9 @@ out: | |||
1110 | xfrm_state_put(x1); | 1118 | xfrm_state_put(x1); |
1111 | } | 1119 | } |
1112 | 1120 | ||
1121 | if (to_put) | ||
1122 | xfrm_state_put(to_put); | ||
1123 | |||
1113 | return err; | 1124 | return err; |
1114 | } | 1125 | } |
1115 | EXPORT_SYMBOL(xfrm_state_add); | 1126 | EXPORT_SYMBOL(xfrm_state_add); |
@@ -1269,10 +1280,12 @@ EXPORT_SYMBOL(xfrm_state_migrate); | |||
1269 | 1280 | ||
1270 | int xfrm_state_update(struct xfrm_state *x) | 1281 | int xfrm_state_update(struct xfrm_state *x) |
1271 | { | 1282 | { |
1272 | struct xfrm_state *x1; | 1283 | struct xfrm_state *x1, *to_put; |
1273 | int err; | 1284 | int err; |
1274 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); | 1285 | int use_spi = xfrm_id_proto_match(x->id.proto, IPSEC_PROTO_ANY); |
1275 | 1286 | ||
1287 | to_put = NULL; | ||
1288 | |||
1276 | spin_lock_bh(&xfrm_state_lock); | 1289 | spin_lock_bh(&xfrm_state_lock); |
1277 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); | 1290 | x1 = __xfrm_state_locate(x, use_spi, x->props.family); |
1278 | 1291 | ||
@@ -1281,7 +1294,7 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1281 | goto out; | 1294 | goto out; |
1282 | 1295 | ||
1283 | if (xfrm_state_kern(x1)) { | 1296 | if (xfrm_state_kern(x1)) { |
1284 | xfrm_state_put(x1); | 1297 | to_put = x1; |
1285 | err = -EEXIST; | 1298 | err = -EEXIST; |
1286 | goto out; | 1299 | goto out; |
1287 | } | 1300 | } |
@@ -1295,6 +1308,9 @@ int xfrm_state_update(struct xfrm_state *x) | |||
1295 | out: | 1308 | out: |
1296 | spin_unlock_bh(&xfrm_state_lock); | 1309 | spin_unlock_bh(&xfrm_state_lock); |
1297 | 1310 | ||
1311 | if (to_put) | ||
1312 | xfrm_state_put(to_put); | ||
1313 | |||
1298 | if (err) | 1314 | if (err) |
1299 | return err; | 1315 | return err; |
1300 | 1316 | ||
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 7bd296cca041..46f23971f7e4 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -508,12 +508,11 @@ int devcgroup_inode_permission(struct inode *inode, int mask) | |||
508 | return 0; | 508 | return 0; |
509 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) | 509 | if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode)) |
510 | return 0; | 510 | return 0; |
511 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, | ||
512 | devices_subsys_id)); | ||
513 | if (!dev_cgroup) | ||
514 | return 0; | ||
515 | 511 | ||
516 | rcu_read_lock(); | 512 | rcu_read_lock(); |
513 | |||
514 | dev_cgroup = task_devcgroup(current); | ||
515 | |||
517 | list_for_each_entry_rcu(wh, &dev_cgroup->whitelist, list) { | 516 | list_for_each_entry_rcu(wh, &dev_cgroup->whitelist, list) { |
518 | if (wh->type & DEV_ALL) | 517 | if (wh->type & DEV_ALL) |
519 | goto acc_check; | 518 | goto acc_check; |
@@ -533,6 +532,7 @@ acc_check: | |||
533 | rcu_read_unlock(); | 532 | rcu_read_unlock(); |
534 | return 0; | 533 | return 0; |
535 | } | 534 | } |
535 | |||
536 | rcu_read_unlock(); | 536 | rcu_read_unlock(); |
537 | 537 | ||
538 | return -EPERM; | 538 | return -EPERM; |
@@ -543,12 +543,10 @@ int devcgroup_inode_mknod(int mode, dev_t dev) | |||
543 | struct dev_cgroup *dev_cgroup; | 543 | struct dev_cgroup *dev_cgroup; |
544 | struct dev_whitelist_item *wh; | 544 | struct dev_whitelist_item *wh; |
545 | 545 | ||
546 | dev_cgroup = css_to_devcgroup(task_subsys_state(current, | ||
547 | devices_subsys_id)); | ||
548 | if (!dev_cgroup) | ||
549 | return 0; | ||
550 | |||
551 | rcu_read_lock(); | 546 | rcu_read_lock(); |
547 | |||
548 | dev_cgroup = task_devcgroup(current); | ||
549 | |||
552 | list_for_each_entry(wh, &dev_cgroup->whitelist, list) { | 550 | list_for_each_entry(wh, &dev_cgroup->whitelist, list) { |
553 | if (wh->type & DEV_ALL) | 551 | if (wh->type & DEV_ALL) |
554 | goto acc_check; | 552 | goto acc_check; |
@@ -566,6 +564,8 @@ acc_check: | |||
566 | rcu_read_unlock(); | 564 | rcu_read_unlock(); |
567 | return 0; | 565 | return 0; |
568 | } | 566 | } |
567 | |||
569 | rcu_read_unlock(); | 568 | rcu_read_unlock(); |
569 | |||
570 | return -EPERM; | 570 | return -EPERM; |
571 | } | 571 | } |
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index b52f923ce680..d11a8154500f 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -811,11 +811,12 @@ static int string_to_context_struct(struct policydb *pol, | |||
811 | /* Check the validity of the new context. */ | 811 | /* Check the validity of the new context. */ |
812 | if (!policydb_context_isvalid(pol, ctx)) { | 812 | if (!policydb_context_isvalid(pol, ctx)) { |
813 | rc = -EINVAL; | 813 | rc = -EINVAL; |
814 | context_destroy(ctx); | ||
815 | goto out; | 814 | goto out; |
816 | } | 815 | } |
817 | rc = 0; | 816 | rc = 0; |
818 | out: | 817 | out: |
818 | if (rc) | ||
819 | context_destroy(ctx); | ||
819 | return rc; | 820 | return rc; |
820 | } | 821 | } |
821 | 822 | ||
@@ -868,8 +869,7 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len, | |||
868 | } else if (rc) | 869 | } else if (rc) |
869 | goto out; | 870 | goto out; |
870 | rc = sidtab_context_to_sid(&sidtab, &context, sid); | 871 | rc = sidtab_context_to_sid(&sidtab, &context, sid); |
871 | if (rc) | 872 | context_destroy(&context); |
872 | context_destroy(&context); | ||
873 | out: | 873 | out: |
874 | read_unlock(&policy_rwlock); | 874 | read_unlock(&policy_rwlock); |
875 | kfree(scontext2); | 875 | kfree(scontext2); |
diff --git a/sound/Kconfig b/sound/Kconfig index a37bee094eba..8ebf512ced6c 100644 --- a/sound/Kconfig +++ b/sound/Kconfig | |||
@@ -91,6 +91,9 @@ endif # SOUND_PRIME | |||
91 | 91 | ||
92 | endif # !M68K | 92 | endif # !M68K |
93 | 93 | ||
94 | endif # SOUND | ||
95 | |||
96 | # AC97_BUS is used from both sound and ucb1400 | ||
94 | config AC97_BUS | 97 | config AC97_BUS |
95 | tristate | 98 | tristate |
96 | help | 99 | help |
@@ -99,4 +102,3 @@ config AC97_BUS | |||
99 | sound although they're sharing the AC97 bus. Concerned drivers | 102 | sound although they're sharing the AC97 bus. Concerned drivers |
100 | should "select" this. | 103 | should "select" this. |
101 | 104 | ||
102 | endif # SOUND | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index d6ec9eef2910..66025161bd69 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -14066,6 +14066,13 @@ static struct hda_verb alc662_auto_init_verbs[] = { | |||
14066 | { } | 14066 | { } |
14067 | }; | 14067 | }; |
14068 | 14068 | ||
14069 | /* additional verbs for ALC663 */ | ||
14070 | static struct hda_verb alc663_auto_init_verbs[] = { | ||
14071 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, | ||
14072 | {0x0f, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, | ||
14073 | { } | ||
14074 | }; | ||
14075 | |||
14069 | static struct hda_verb alc663_m51va_init_verbs[] = { | 14076 | static struct hda_verb alc663_m51va_init_verbs[] = { |
14070 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, | 14077 | {0x21, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, |
14071 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, | 14078 | {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE}, |
@@ -14594,6 +14601,14 @@ static int alc662_auto_create_extra_out(struct alc_spec *spec, hda_nid_t pin, | |||
14594 | if (!pin) | 14601 | if (!pin) |
14595 | return 0; | 14602 | return 0; |
14596 | 14603 | ||
14604 | if (pin == 0x17) { | ||
14605 | /* ALC663 has a mono output pin on 0x17 */ | ||
14606 | sprintf(name, "%s Playback Switch", pfx); | ||
14607 | err = add_control(spec, ALC_CTL_WIDGET_MUTE, name, | ||
14608 | HDA_COMPOSE_AMP_VAL(pin, 2, 0, HDA_OUTPUT)); | ||
14609 | return err; | ||
14610 | } | ||
14611 | |||
14597 | if (alc880_is_fixed_pin(pin)) { | 14612 | if (alc880_is_fixed_pin(pin)) { |
14598 | nid = alc880_idx_to_dac(alc880_fixed_pin_idx(pin)); | 14613 | nid = alc880_idx_to_dac(alc880_fixed_pin_idx(pin)); |
14599 | /* printk("DAC nid=%x\n",nid); */ | 14614 | /* printk("DAC nid=%x\n",nid); */ |
@@ -14764,6 +14779,14 @@ static int alc662_parse_auto_config(struct hda_codec *codec) | |||
14764 | spec->input_mux = &spec->private_imux; | 14779 | spec->input_mux = &spec->private_imux; |
14765 | 14780 | ||
14766 | spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; | 14781 | spec->init_verbs[spec->num_init_verbs++] = alc662_auto_init_verbs; |
14782 | if (codec->vendor_id == 0x10ec0663) | ||
14783 | spec->init_verbs[spec->num_init_verbs++] = | ||
14784 | alc663_auto_init_verbs; | ||
14785 | |||
14786 | err = alc_auto_add_mic_boost(codec); | ||
14787 | if (err < 0) | ||
14788 | return err; | ||
14789 | |||
14767 | spec->mixers[spec->num_mixers] = alc662_capture_mixer; | 14790 | spec->mixers[spec->num_mixers] = alc662_capture_mixer; |
14768 | spec->num_mixers++; | 14791 | spec->num_mixers++; |
14769 | return 1; | 14792 | return 1; |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 7fdafcb0015d..ad994fcab725 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -560,8 +560,9 @@ static struct hda_verb dell_eq_core_init[] = { | |||
560 | }; | 560 | }; |
561 | 561 | ||
562 | static struct hda_verb dell_m6_core_init[] = { | 562 | static struct hda_verb dell_m6_core_init[] = { |
563 | /* set master volume and direct control */ | 563 | /* set master volume to max value without distortion |
564 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff}, | 564 | * and direct control */ |
565 | { 0x1f, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xec}, | ||
565 | /* setup audio connections */ | 566 | /* setup audio connections */ |
566 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, | 567 | { 0x0d, AC_VERB_SET_CONNECT_SEL, 0x00}, |
567 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, | 568 | { 0x0a, AC_VERB_SET_CONNECT_SEL, 0x01}, |
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 8548818eea08..c796b1882776 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/clk.h> | 18 | #include <linux/clk.h> |
19 | #include <linux/platform_device.h> | ||
19 | #include <sound/core.h> | 20 | #include <sound/core.h> |
20 | #include <sound/pcm.h> | 21 | #include <sound/pcm.h> |
21 | #include <sound/initval.h> | 22 | #include <sound/initval.h> |
@@ -81,7 +82,6 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream) | |||
81 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 82 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
82 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; | 83 | struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; |
83 | 84 | ||
84 | clk_i2s = clk_get(NULL, "I2SCLK"); | ||
85 | if (IS_ERR(clk_i2s)) | 85 | if (IS_ERR(clk_i2s)) |
86 | return PTR_ERR(clk_i2s); | 86 | return PTR_ERR(clk_i2s); |
87 | 87 | ||
@@ -152,6 +152,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, | |||
152 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); | 152 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); |
153 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); | 153 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); |
154 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); | 154 | pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); |
155 | BUG_ON(IS_ERR(clk_i2s)); | ||
155 | clk_enable(clk_i2s); | 156 | clk_enable(clk_i2s); |
156 | pxa_i2s_wait(); | 157 | pxa_i2s_wait(); |
157 | 158 | ||
@@ -317,6 +318,43 @@ struct snd_soc_dai pxa_i2s_dai = { | |||
317 | 318 | ||
318 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); | 319 | EXPORT_SYMBOL_GPL(pxa_i2s_dai); |
319 | 320 | ||
321 | static int pxa2xx_i2s_probe(struct platform_device *dev) | ||
322 | { | ||
323 | clk_i2s = clk_get(&dev->dev, "I2SCLK"); | ||
324 | return IS_ERR(clk_i2s) ? PTR_ERR(clk_i2s) : 0; | ||
325 | } | ||
326 | |||
327 | static int __devexit pxa2xx_i2s_remove(struct platform_device *dev) | ||
328 | { | ||
329 | clk_put(clk_i2s); | ||
330 | clk_i2s = ERR_PTR(-ENOENT); | ||
331 | return 0; | ||
332 | } | ||
333 | |||
334 | static struct platform_driver pxa2xx_i2s_driver = { | ||
335 | .probe = pxa2xx_i2s_probe, | ||
336 | .remove = __devexit_p(pxa2xx_i2s_remove), | ||
337 | |||
338 | .driver = { | ||
339 | .name = "pxa2xx-i2s", | ||
340 | .owner = THIS_MODULE, | ||
341 | }, | ||
342 | }; | ||
343 | |||
344 | static int __init pxa2xx_i2s_init(void) | ||
345 | { | ||
346 | clk_i2s = ERR_PTR(-ENOENT); | ||
347 | return platform_driver_register(&pxa2xx_i2s_driver); | ||
348 | } | ||
349 | |||
350 | static void __exit pxa2xx_i2s_exit(void) | ||
351 | { | ||
352 | platform_driver_unregister(&pxa2xx_i2s_driver); | ||
353 | } | ||
354 | |||
355 | module_init(pxa2xx_i2s_init); | ||
356 | module_exit(pxa2xx_i2s_exit); | ||
357 | |||
320 | /* Module information */ | 358 | /* Module information */ |
321 | MODULE_AUTHOR("Liam Girdwood, liam.girdwood@wolfsonmicro.com, www.wolfsonmicro.com"); | 359 | MODULE_AUTHOR("Liam Girdwood, liam.girdwood@wolfsonmicro.com, www.wolfsonmicro.com"); |
322 | MODULE_DESCRIPTION("pxa2xx I2S SoC Interface"); | 360 | MODULE_DESCRIPTION("pxa2xx I2S SoC Interface"); |