diff options
381 files changed, 4193 insertions, 4592 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index f2668390e8f7..42008395534d 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c | |||
| @@ -62,8 +62,8 @@ typedef uint8_t u8; | |||
| 62 | #endif | 62 | #endif |
| 63 | /* We can have up to 256 pages for devices. */ | 63 | /* We can have up to 256 pages for devices. */ |
| 64 | #define DEVICE_PAGES 256 | 64 | #define DEVICE_PAGES 256 |
| 65 | /* This fits nicely in a single 4096-byte page. */ | 65 | /* This will occupy 2 pages: it must be a power of 2. */ |
| 66 | #define VIRTQUEUE_NUM 127 | 66 | #define VIRTQUEUE_NUM 128 |
| 67 | 67 | ||
| 68 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows | 68 | /*L:120 verbose is both a global flag and a macro. The C preprocessor allows |
| 69 | * this, and although I wouldn't recommend it, it works quite nicely here. */ | 69 | * this, and although I wouldn't recommend it, it works quite nicely here. */ |
| @@ -1036,7 +1036,8 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
| 1036 | void *p; | 1036 | void *p; |
| 1037 | 1037 | ||
| 1038 | /* First we need some pages for this virtqueue. */ | 1038 | /* First we need some pages for this virtqueue. */ |
| 1039 | pages = (vring_size(num_descs) + getpagesize() - 1) / getpagesize(); | 1039 | pages = (vring_size(num_descs, getpagesize()) + getpagesize() - 1) |
| 1040 | / getpagesize(); | ||
| 1040 | p = get_pages(pages); | 1041 | p = get_pages(pages); |
| 1041 | 1042 | ||
| 1042 | /* Initialize the configuration. */ | 1043 | /* Initialize the configuration. */ |
| @@ -1045,7 +1046,7 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs, | |||
| 1045 | vq->config.pfn = to_guest_phys(p) / getpagesize(); | 1046 | vq->config.pfn = to_guest_phys(p) / getpagesize(); |
| 1046 | 1047 | ||
| 1047 | /* Initialize the vring. */ | 1048 | /* Initialize the vring. */ |
| 1048 | vring_init(&vq->vring, num_descs, p); | 1049 | vring_init(&vq->vring, num_descs, p, getpagesize()); |
| 1049 | 1050 | ||
| 1050 | /* Add the configuration information to this device's descriptor. */ | 1051 | /* Add the configuration information to this device's descriptor. */ |
| 1051 | add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE, | 1052 | add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE, |
| @@ -1342,7 +1343,7 @@ static bool service_io(struct device *dev) | |||
| 1342 | if (out->type & VIRTIO_BLK_T_SCSI_CMD) { | 1343 | if (out->type & VIRTIO_BLK_T_SCSI_CMD) { |
| 1343 | fprintf(stderr, "Scsi commands unsupported\n"); | 1344 | fprintf(stderr, "Scsi commands unsupported\n"); |
| 1344 | in->status = VIRTIO_BLK_S_UNSUPP; | 1345 | in->status = VIRTIO_BLK_S_UNSUPP; |
| 1345 | wlen = sizeof(in); | 1346 | wlen = sizeof(*in); |
| 1346 | } else if (out->type & VIRTIO_BLK_T_OUT) { | 1347 | } else if (out->type & VIRTIO_BLK_T_OUT) { |
| 1347 | /* Write */ | 1348 | /* Write */ |
| 1348 | 1349 | ||
| @@ -1363,7 +1364,7 @@ static bool service_io(struct device *dev) | |||
| 1363 | /* Die, bad Guest, die. */ | 1364 | /* Die, bad Guest, die. */ |
| 1364 | errx(1, "Write past end %llu+%u", off, ret); | 1365 | errx(1, "Write past end %llu+%u", off, ret); |
| 1365 | } | 1366 | } |
| 1366 | wlen = sizeof(in); | 1367 | wlen = sizeof(*in); |
| 1367 | in->status = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); | 1368 | in->status = (ret >= 0 ? VIRTIO_BLK_S_OK : VIRTIO_BLK_S_IOERR); |
| 1368 | } else { | 1369 | } else { |
| 1369 | /* Read */ | 1370 | /* Read */ |
| @@ -1376,10 +1377,10 @@ static bool service_io(struct device *dev) | |||
| 1376 | ret = readv(vblk->fd, iov+1, in_num-1); | 1377 | ret = readv(vblk->fd, iov+1, in_num-1); |
| 1377 | verbose("READ from sector %llu: %i\n", out->sector, ret); | 1378 | verbose("READ from sector %llu: %i\n", out->sector, ret); |
| 1378 | if (ret >= 0) { | 1379 | if (ret >= 0) { |
| 1379 | wlen = sizeof(in) + ret; | 1380 | wlen = sizeof(*in) + ret; |
| 1380 | in->status = VIRTIO_BLK_S_OK; | 1381 | in->status = VIRTIO_BLK_S_OK; |
| 1381 | } else { | 1382 | } else { |
| 1382 | wlen = sizeof(in); | 1383 | wlen = sizeof(*in); |
| 1383 | in->status = VIRTIO_BLK_S_IOERR; | 1384 | in->status = VIRTIO_BLK_S_IOERR; |
| 1384 | } | 1385 | } |
| 1385 | } | 1386 | } |
diff --git a/Documentation/networking/00-INDEX b/Documentation/networking/00-INDEX index f5a5e6d3d541..563e442f2d42 100644 --- a/Documentation/networking/00-INDEX +++ b/Documentation/networking/00-INDEX | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | - information on the 3Com EtherLink Plus (3c505) driver. | 4 | - information on the 3Com EtherLink Plus (3c505) driver. |
| 5 | 6pack.txt | 5 | 6pack.txt |
| 6 | - info on the 6pack protocol, an alternative to KISS for AX.25 | 6 | - info on the 6pack protocol, an alternative to KISS for AX.25 |
| 7 | Configurable | ||
| 8 | - info on some of the configurable network parameters | ||
| 9 | DLINK.txt | 7 | DLINK.txt |
| 10 | - info on the D-Link DE-600/DE-620 parallel port pocket adapters | 8 | - info on the D-Link DE-600/DE-620 parallel port pocket adapters |
| 11 | PLIP.txt | 9 | PLIP.txt |
| @@ -26,8 +24,6 @@ baycom.txt | |||
| 26 | - info on the driver for Baycom style amateur radio modems | 24 | - info on the driver for Baycom style amateur radio modems |
| 27 | bridge.txt | 25 | bridge.txt |
| 28 | - where to get user space programs for ethernet bridging with Linux. | 26 | - where to get user space programs for ethernet bridging with Linux. |
| 29 | comx.txt | ||
| 30 | - info on drivers for COMX line of synchronous serial adapters. | ||
| 31 | cops.txt | 27 | cops.txt |
| 32 | - info on the COPS LocalTalk Linux driver | 28 | - info on the COPS LocalTalk Linux driver |
| 33 | cs89x0.txt | 29 | cs89x0.txt |
| @@ -78,20 +74,14 @@ ltpc.txt | |||
| 78 | - the Apple or Farallon LocalTalk PC card driver | 74 | - the Apple or Farallon LocalTalk PC card driver |
| 79 | multicast.txt | 75 | multicast.txt |
| 80 | - Behaviour of cards under Multicast | 76 | - Behaviour of cards under Multicast |
| 81 | ncsa-telnet | ||
| 82 | - notes on how NCSA telnet (DOS) breaks with MTU discovery enabled. | ||
| 83 | netdevices.txt | 77 | netdevices.txt |
| 84 | - info on network device driver functions exported to the kernel. | 78 | - info on network device driver functions exported to the kernel. |
| 85 | olympic.txt | 79 | olympic.txt |
| 86 | - IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info. | 80 | - IBM PCI Pit/Pit-Phy/Olympic Token Ring driver info. |
| 87 | policy-routing.txt | 81 | policy-routing.txt |
| 88 | - IP policy-based routing | 82 | - IP policy-based routing |
| 89 | pt.txt | ||
| 90 | - the Gracilis Packetwin AX.25 device driver | ||
| 91 | ray_cs.txt | 83 | ray_cs.txt |
| 92 | - Raylink Wireless LAN card driver info. | 84 | - Raylink Wireless LAN card driver info. |
| 93 | routing.txt | ||
| 94 | - the new routing mechanism | ||
| 95 | shaper.txt | 85 | shaper.txt |
| 96 | - info on the module that can shape/limit transmitted traffic. | 86 | - info on the module that can shape/limit transmitted traffic. |
| 97 | sk98lin.txt | 87 | sk98lin.txt |
diff --git a/Documentation/networking/Configurable b/Documentation/networking/Configurable deleted file mode 100644 index 69c0dd466ead..000000000000 --- a/Documentation/networking/Configurable +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | |||
| 2 | There are a few network parameters that can be tuned to better match | ||
| 3 | the kernel to your system hardware and intended usage. The defaults | ||
| 4 | are usually a good choice for 99% of the people 99% of the time, but | ||
| 5 | you should be aware they do exist and can be changed. | ||
| 6 | |||
| 7 | The current list of parameters can be found in the files: | ||
| 8 | |||
| 9 | linux/net/TUNABLE | ||
| 10 | Documentation/networking/ip-sysctl.txt | ||
| 11 | |||
| 12 | Some of these are accessible via the sysctl interface, and many more are | ||
| 13 | scheduled to be added in this way. For example, some parameters related | ||
| 14 | to Address Resolution Protocol (ARP) are very easily viewed and altered. | ||
| 15 | |||
| 16 | # cat /proc/sys/net/ipv4/arp_timeout | ||
| 17 | 6000 | ||
| 18 | # echo 7000 > /proc/sys/net/ipv4/arp_timeout | ||
| 19 | # cat /proc/sys/net/ipv4/arp_timeout | ||
| 20 | 7000 | ||
| 21 | |||
| 22 | Others are already accessible via the related user space programs. | ||
| 23 | For example, MAX_WINDOW has a default of 32 k which is a good choice for | ||
| 24 | modern hardware, but if you have a slow (8 bit) Ethernet card and/or a slow | ||
| 25 | machine, then this will be far too big for the card to keep up with fast | ||
| 26 | machines transmitting on the same net, resulting in overruns and receive errors. | ||
| 27 | A value of about 4 k would be more appropriate, which can be set via: | ||
| 28 | |||
| 29 | # route add -net 192.168.3.0 window 4096 | ||
| 30 | |||
| 31 | The remainder of these can only be presently changed by altering a #define | ||
| 32 | in the related header file. This means an edit and recompile cycle. | ||
| 33 | |||
| 34 | Paul Gortmaker 06/96 | ||
diff --git a/Documentation/networking/comx.txt b/Documentation/networking/comx.txt deleted file mode 100644 index d1526eba2645..000000000000 --- a/Documentation/networking/comx.txt +++ /dev/null | |||
| @@ -1,248 +0,0 @@ | |||
| 1 | |||
| 2 | COMX drivers for the 2.2 kernel | ||
| 3 | |||
| 4 | Originally written by: Tivadar Szemethy, <tiv@itc.hu> | ||
| 5 | Currently maintained by: Gergely Madarasz <gorgo@itc.hu> | ||
| 6 | |||
| 7 | Last change: 21/06/1999. | ||
| 8 | |||
| 9 | INTRODUCTION | ||
| 10 | |||
| 11 | This document describes the software drivers and their use for the | ||
| 12 | COMX line of synchronous serial adapters for Linux version 2.2.0 and | ||
| 13 | above. | ||
| 14 | The cards are produced and sold by ITC-Pro Ltd. Budapest, Hungary | ||
| 15 | For further info contact <info@itc.hu> | ||
| 16 | or http://www.itc.hu (mostly in Hungarian). | ||
| 17 | The firmware files and software are available from ftp://ftp.itc.hu | ||
| 18 | |||
| 19 | Currently, the drivers support the following cards and protocols: | ||
| 20 | |||
| 21 | COMX (2x64 kbps intelligent board) | ||
| 22 | CMX (1x256 + 1x128 kbps intelligent board) | ||
| 23 | HiCOMX (2x2Mbps intelligent board) | ||
| 24 | LoCOMX (1x512 kbps passive board) | ||
| 25 | MixCOM (1x512 or 2x512kbps passive board with a hardware watchdog an | ||
| 26 | optional BRI interface and optional flashROM (1-32M)) | ||
| 27 | SliceCOM (1x2Mbps channelized E1 board) | ||
| 28 | PciCOM (X21) | ||
| 29 | |||
| 30 | At the moment of writing this document, the (Cisco)-HDLC, LAPB, SyncPPP and | ||
| 31 | Frame Relay (DTE, rfc1294 IP encapsulation with partially implemented Q933a | ||
| 32 | LMI) protocols are available as link-level protocol. | ||
| 33 | X.25 support is being worked on. | ||
| 34 | |||
| 35 | USAGE | ||
| 36 | |||
| 37 | Load the comx.o module and the hardware-specific and protocol-specific | ||
| 38 | modules you'll need into the running kernel using the insmod utility. | ||
| 39 | This creates the /proc/comx directory. | ||
| 40 | See the example scripts in the 'etc' directory. | ||
| 41 | |||
| 42 | /proc INTERFACE INTRO | ||
| 43 | |||
| 44 | The COMX driver set has a new type of user interface based on the /proc | ||
| 45 | filesystem which eliminates the need for external user-land software doing | ||
| 46 | IOCTL calls. | ||
| 47 | Each network interface or device (i.e. those ones you configure with 'ifconfig' | ||
| 48 | and 'route' etc.) has a corresponding directory under /proc/comx. You can | ||
| 49 | dynamically create a new interface by saying 'mkdir /proc/comx/comx0' (or you | ||
| 50 | can name it whatever you want up to 8 characters long, comx[n] is just a | ||
| 51 | convention). | ||
| 52 | Generally the files contained in these directories are text files, which can | ||
| 53 | be viewed by 'cat filename' and you can write a string to such a file by | ||
| 54 | saying 'echo _string_ >filename'. This is very similar to the sysctl interface. | ||
| 55 | Don't use a text editor to edit these files, always use 'echo' (or 'cat' | ||
| 56 | where appropriate). | ||
| 57 | When you've created the comx[n] directory, two files are created automagically | ||
| 58 | in it: 'boardtype' and 'protocol'. You have to fill in these files correctly | ||
| 59 | for your board and protocol you intend to use (see the board and protocol | ||
| 60 | descriptions in this file below or the example scripts in the 'etc' directory). | ||
| 61 | After filling in these files, other files will appear in the directory for | ||
| 62 | setting the various hardware- and protocol-related informations (for example | ||
| 63 | irq and io addresses, keepalive values etc.) These files are set to default | ||
| 64 | values upon creation, so you don't necessarily have to change all of them. | ||
| 65 | |||
| 66 | When you're ready with filling in the files in the comx[n] directory, you can | ||
| 67 | configure the corresponding network interface with the standard network | ||
| 68 | configuration utilities. If you're unable to bring the interfaces up, look up | ||
| 69 | the various kernel log files on your system, and consult the messages for | ||
| 70 | a probable reason. | ||
| 71 | |||
| 72 | EXAMPLE | ||
| 73 | |||
| 74 | To create the interface 'comx0' which is the first channel of a COMX card: | ||
| 75 | |||
| 76 | insmod comx | ||
| 77 | # insmod comx-hw-comx ; insmod comx-proto-ppp (these are usually | ||
| 78 | autoloaded if you use the kernel module loader) | ||
| 79 | |||
| 80 | mkdir /proc/comx/comx0 | ||
| 81 | echo comx >/proc/comx/comx0/boardtype | ||
| 82 | echo 0x360 >/proc/comx/comx0/io <- jumper-selectable I/O port | ||
| 83 | echo 0x0a >/proc/comx/comx0/irq <- jumper-selectable IRQ line | ||
| 84 | echo 0xd000 >/proc/comx/comx0/memaddr <- software-configurable memory | ||
| 85 | address. COMX uses 64 KB, and this | ||
| 86 | can be: 0xa000, 0xb000, 0xc000, | ||
| 87 | 0xd000, 0xe000. Avoid conflicts | ||
| 88 | with other hardware. | ||
| 89 | cat </etc/siol1.rom >/proc/comx/comx0/firmware <- the firmware for the card | ||
| 90 | echo HDLC >/proc/comx/comx0/protocol <- the data-link protocol | ||
| 91 | echo 10 >/proc/comx/comx0/keepalive <- the keepalive for the protocol | ||
| 92 | ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255 <- | ||
| 93 | finally configure it with ifconfig | ||
| 94 | Check its status: | ||
| 95 | cat /proc/comx/comx0/status | ||
| 96 | |||
| 97 | If you want to use the second channel of this board: | ||
| 98 | |||
| 99 | mkdir /proc/comx/comx1 | ||
| 100 | echo comx >/proc/comx/comx1/boardtype | ||
| 101 | echo 0x360 >/proc/comx/comx1/io | ||
| 102 | echo 10 >/proc/comx/comx1/irq | ||
| 103 | echo 0xd000 >/proc/comx/comx1/memaddr | ||
| 104 | echo 1 >/proc/comx/comx1/channel <- channels are numbered | ||
| 105 | as 0 (default) and 1 | ||
| 106 | |||
| 107 | Now, check if the driver recognized that you're going to use the other | ||
| 108 | channel of the same adapter: | ||
| 109 | |||
| 110 | cat /proc/comx/comx0/twin | ||
| 111 | comx1 | ||
| 112 | cat /proc/comx/comx1/twin | ||
| 113 | comx0 | ||
| 114 | |||
| 115 | You don't have to load the firmware twice, if you use both channels of | ||
| 116 | an adapter, just write it into the channel 0's /proc firmware file. | ||
| 117 | |||
| 118 | Default values: io 0x360 for COMX, 0x320 (HICOMX), irq 10, memaddr 0xd0000 | ||
| 119 | |||
| 120 | THE LOCOMX HARDWARE DRIVER | ||
| 121 | |||
| 122 | The LoCOMX driver doesn't require firmware, and it doesn't use memory either, | ||
| 123 | but it uses DMA channels 1 and 3. You can set the clock rate (if enabled by | ||
| 124 | jumpers on the board) by writing the kbps value into the file named 'clock'. | ||
| 125 | Set it to 'external' (it is the default) if you have external clock source. | ||
| 126 | |||
| 127 | (Note: currently the LoCOMX driver does not support the internal clock) | ||
| 128 | |||
| 129 | THE COMX, CMX AND HICOMX DRIVERS | ||
| 130 | |||
| 131 | On the HICOMX, COMX and CMX, you have to load the firmware (it is different for | ||
| 132 | the three cards!). All these adapters can share the same memory | ||
| 133 | address (we usually use 0xd0000). On the CMX you can set the internal | ||
| 134 | clock rate (if enabled by jumpers on the small adapter boards) by writing | ||
| 135 | the kbps value into the 'clock' file. You have to do this before initializing | ||
| 136 | the card. If you use both HICOMX and CMX/COMX cards, initialize the HICOMX | ||
| 137 | first. The I/O address of the HICOMX board is not configurable by any | ||
| 138 | method available to the user: it is hardwired to 0x320, and if you have to | ||
| 139 | change it, consult ITC-Pro Ltd. | ||
| 140 | |||
| 141 | THE MIXCOM DRIVER | ||
| 142 | |||
| 143 | The MixCOM board doesn't require firmware, the driver communicates with | ||
| 144 | it through I/O ports. You can have three of these cards in one machine. | ||
| 145 | |||
| 146 | THE SLICECOM DRIVER | ||
| 147 | |||
| 148 | The SliceCOM board doesn't require firmware. You can have 4 of these cards | ||
| 149 | in one machine. The driver doesn't (yet) support shared interrupts, so | ||
| 150 | you will need a separate IRQ line for every board. | ||
| 151 | Read Documentation/networking/slicecom.txt for help on configuring | ||
| 152 | this adapter. | ||
| 153 | |||
| 154 | THE HDLC/PPP LINE PROTOCOL DRIVER | ||
| 155 | |||
| 156 | The HDLC/SyncPPP line protocol driver uses the kernel's built-in syncppp | ||
| 157 | driver (syncppp.o). You don't have to manually select syncppp.o when building | ||
| 158 | the kernel, the dependencies compile it in automatically. | ||
| 159 | |||
| 160 | |||
| 161 | |||
| 162 | |||
| 163 | EXAMPLE | ||
| 164 | (setting up hw parameters, see above) | ||
| 165 | |||
| 166 | # using HDLC: | ||
| 167 | echo hdlc >/proc/comx/comx0/protocol | ||
| 168 | echo 10 >/proc/comx/comx0/keepalive <- not necessary, 10 is the default | ||
| 169 | ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255 | ||
| 170 | |||
| 171 | (setting up hw parameters, see above) | ||
| 172 | |||
| 173 | # using PPP: | ||
| 174 | echo ppp >/proc/comx/comx0/protocol | ||
| 175 | ifconfig comx0 up | ||
| 176 | ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255 | ||
| 177 | |||
| 178 | |||
| 179 | THE LAPB LINE PROTOCOL DRIVER | ||
| 180 | |||
| 181 | For this, you'll need to configure LAPB support (See 'LAPB Data Link Driver' in | ||
| 182 | 'Network options' section) into your kernel (thanks to Jonathan Naylor for his | ||
| 183 | excellent implementation). | ||
| 184 | comx-proto-lapb.o provides the following files in the appropriate directory | ||
| 185 | (the default values in parens): t1 (5), t2 (1), n2 (20), mode (DTE, STD) and | ||
| 186 | window (7). Agree with the administrator of your peer router on these | ||
| 187 | settings (most people use defaults, but you have to know if you are DTE or | ||
| 188 | DCE). | ||
| 189 | |||
| 190 | EXAMPLE | ||
| 191 | |||
| 192 | (setting up hw parameters, see above) | ||
| 193 | echo lapb >/proc/comx/comx0/protocol | ||
| 194 | echo dce >/proc/comx/comx0/mode <- DCE interface in this example | ||
| 195 | ifconfig comx0 1.2.3.4 pointopoint 5.6.7.8 netmask 255.255.255.255 | ||
| 196 | |||
| 197 | |||
| 198 | THE FRAME RELAY PROTOCOL DRIVER | ||
| 199 | |||
| 200 | You DON'T need any other frame relay related modules from the kernel to use | ||
| 201 | COMX-Frame Relay. This protocol is a bit more complicated than the others, | ||
| 202 | because it allows to use 'subinterfaces' or DLCIs within one physical device. | ||
| 203 | First you have to create the 'master' device (the actual physical interface) | ||
| 204 | as you would do for other protocols. Specify 'frad' as protocol type. | ||
| 205 | Now you can bring this interface up by saying 'ifconfig comx0 up' (or whatever | ||
| 206 | you've named the interface). Do not assign any IP address to this interface | ||
| 207 | and do not set any routes through it. | ||
| 208 | Then, set up your DLCIs the following way: create a comx interface for each | ||
| 209 | DLCI you intend to use (with mkdir), and write 'dlci' to the 'boardtype' file, | ||
| 210 | and 'ietf-ip' to the 'protocol' file. Currently, the only supported | ||
| 211 | encapsulation type is this (also called as RFC1294/1490 IP encapsulation). | ||
| 212 | Write the DLCI number to the 'dlci' file, and write the name of the physical | ||
| 213 | COMX device to the file called 'master'. | ||
| 214 | Now you can assign an IP address to this interface and set routes using it. | ||
| 215 | See the example file for further info and example config script. | ||
| 216 | Notes: this driver implements a DTE interface with partially implemented | ||
| 217 | Q933a LMI. | ||
| 218 | You can find an extensively commented example in the 'etc' directory. | ||
| 219 | |||
| 220 | FURTHER /proc FILES | ||
| 221 | |||
| 222 | boardtype: | ||
| 223 | Type of the hardware. Valid values are: | ||
| 224 | 'comx', 'hicomx', 'locomx', 'cmx', 'slicecom'. | ||
| 225 | |||
| 226 | protocol: | ||
| 227 | Data-link protocol on this channel. Can be: HDLC, LAPB, PPP, FRAD | ||
| 228 | |||
| 229 | status: | ||
| 230 | You can read the channel's actual status from the 'status' file, for example | ||
| 231 | 'cat /proc/comx/comx3/status'. | ||
| 232 | |||
| 233 | lineup_delay: | ||
| 234 | Interpreted in seconds (default is 1). Used to avoid line jitter: the system | ||
| 235 | will consider the line status 'UP' only if it is up for at least this number | ||
| 236 | of seconds. | ||
| 237 | |||
| 238 | debug: | ||
| 239 | You can set various debug options through this file. Valid options are: | ||
| 240 | 'comx_events', 'comx_tx', 'comx_rx', 'hw_events', 'hw_tx', 'hw_rx'. | ||
| 241 | You can enable a debug options by writing its name prepended by a '+' into | ||
| 242 | the debug file, for example 'echo +comx_rx >comx0/debug'. | ||
| 243 | Disabling an option happens similarly, use the '-' prefix | ||
| 244 | (e.g. 'echo -hw_rx >debug'). | ||
| 245 | Debug results can be read from the debug file, for example: | ||
| 246 | tail -f /proc/comx/comx2/debug | ||
| 247 | |||
| 248 | |||
diff --git a/Documentation/networking/ncsa-telnet b/Documentation/networking/ncsa-telnet deleted file mode 100644 index d77d28b09093..000000000000 --- a/Documentation/networking/ncsa-telnet +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | NCSA telnet doesn't work with path MTU discovery enabled. This is due to a | ||
| 2 | bug in NCSA that also stops it working with other modern networking code | ||
| 3 | such as Solaris. | ||
| 4 | |||
| 5 | The following information is courtesy of | ||
| 6 | Marek <marekm@i17linuxb.ists.pwr.wroc.pl> | ||
| 7 | |||
| 8 | There is a fixed version somewhere on ftp.upe.ac.za (sorry, I don't | ||
| 9 | remember the exact pathname, and this site is very slow from here). | ||
| 10 | It may or may not be faster for you to get it from | ||
| 11 | ftp://ftp.ists.pwr.wroc.pl/pub/msdos/telnet/ncsa_upe/tel23074.zip | ||
| 12 | (source is in v230704s.zip). I have tested it with 1.3.79 (with | ||
| 13 | path mtu discovery enabled - ncsa 2.3.08 didn't work) and it seems | ||
| 14 | to work. I don't know if anyone is working on this code - this | ||
| 15 | version is over a year old. Too bad - it's faster and often more | ||
| 16 | stable than these windoze telnets, and runs on almost anything... | ||
diff --git a/Documentation/networking/pt.txt b/Documentation/networking/pt.txt deleted file mode 100644 index 72e888c1d988..000000000000 --- a/Documentation/networking/pt.txt +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | This is the README for the Gracilis Packetwin device driver, version 0.5 | ||
| 2 | ALPHA for Linux 1.3.43. | ||
| 3 | |||
| 4 | These files will allow you to talk to the PackeTwin (now know as PT) and | ||
| 5 | connect through it just like a pair of TNCs. To do this you will also | ||
| 6 | require the AX.25 code in the kernel enabled. | ||
| 7 | |||
| 8 | There are four files in this archive; this readme, a patch file, a .c file | ||
| 9 | and finally a .h file. The two program files need to be put into the | ||
| 10 | drivers/net directory in the Linux source tree, for me this is the | ||
| 11 | directory /usr/src/linux/drivers/net. The patch file needs to be patched in | ||
| 12 | at the top of the Linux source tree (/usr/src/linux in my case). | ||
| 13 | |||
| 14 | You will most probably have to edit the pt.c file to suit your own setup, | ||
| 15 | this should just involve changing some of the defines at the top of the file. | ||
| 16 | Please note that if you run an external modem you must specify a speed of 0. | ||
| 17 | |||
| 18 | The program is currently setup to run a 4800 baud external modem on port A | ||
| 19 | and a Kantronics DE-9600 daughter board on port B so if you have this (or | ||
| 20 | something similar) then you're right. | ||
| 21 | |||
| 22 | To compile in the driver, put the files in the correct place and patch in | ||
| 23 | the diff. You will have to re-configure the kernel again before you | ||
| 24 | recompile it. | ||
| 25 | |||
| 26 | The driver is not real good at the moment for finding the card. You can | ||
| 27 | 'help' it by changing the order of the potential addresses in the structure | ||
| 28 | found in the pt_init() function so the address of where the card is is put | ||
| 29 | first. | ||
| 30 | |||
| 31 | After compiling, you have to get them going, they are pretty well like any | ||
| 32 | other net device and just need ifconfig to get them going. | ||
| 33 | As an example, here is my /etc/rc.net | ||
| 34 | -------------------------- | ||
| 35 | |||
| 36 | # | ||
| 37 | # Configure the PackeTwin, port A. | ||
| 38 | /sbin/ifconfig pt0a 44.136.8.87 hw ax25 vk2xlz mtu 512 | ||
| 39 | /sbin/ifconfig pt0a 44.136.8.87 broadcast 44.136.8.255 netmask 255.255.255.0 | ||
| 40 | /sbin/route add -net 44.136.8.0 netmask 255.255.255.0 dev pt0a | ||
| 41 | /sbin/route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.136.8.68 dev pt0a | ||
| 42 | /sbin/route add -net 138.25.16.0 netmask 255.255.240.0 dev pt0a | ||
| 43 | /sbin/route add -host 44.136.8.255 dev pt0a | ||
| 44 | # | ||
| 45 | # Configure the PackeTwin, port B. | ||
| 46 | /sbin/ifconfig pt0b 44.136.8.87 hw ax25 vk2xlz-1 mtu 512 | ||
| 47 | /sbin/ifconfig pt0b 44.136.8.87 broadcast 44.255.255.255 netmask 255.0.0.0 | ||
| 48 | /sbin/route add -host 44.136.8.216 dev pt0b | ||
| 49 | /sbin/route add -host 44.136.8.95 dev pt0b | ||
| 50 | /sbin/route add -host 44.255.255.255 dev pt0b | ||
| 51 | |||
| 52 | This version of the driver comes under the GNU GPL. If you have one of my | ||
| 53 | previous (non-GPL) versions of the driver, please update to this one. | ||
| 54 | |||
| 55 | I hope that this all works well for you. I would be pleased to hear how | ||
| 56 | many people use the driver and if it does its job. | ||
| 57 | |||
| 58 | - Craig vk2xlz <csmall@small.dropbear.id.au> | ||
diff --git a/Documentation/networking/routing.txt b/Documentation/networking/routing.txt deleted file mode 100644 index a26838b930f2..000000000000 --- a/Documentation/networking/routing.txt +++ /dev/null | |||
| @@ -1,46 +0,0 @@ | |||
| 1 | The directory ftp.inr.ac.ru:/ip-routing contains: | ||
| 2 | |||
| 3 | - iproute.c - "professional" routing table maintenance utility. | ||
| 4 | |||
| 5 | - rdisc.tar.gz - rdisc daemon, ported from Sun. | ||
| 6 | STRONGLY RECOMMENDED FOR ALL HOSTS. | ||
| 7 | |||
| 8 | - routing.tgz - original Mike McLagan's route by source patch. | ||
| 9 | Currently it is obsolete. | ||
| 10 | |||
| 11 | - gated.dif-ss<NEWEST>.gz - gated-R3_6Alpha_2 fixes. | ||
| 12 | Look at README.gated | ||
| 13 | |||
| 14 | - mrouted-3.8.dif.gz - mrouted-3.8 fixes. | ||
| 15 | |||
| 16 | - rtmon.c - trivial debugging utility: reads and stores netlink. | ||
| 17 | |||
| 18 | |||
| 19 | NEWS for user. | ||
| 20 | |||
| 21 | - Policy based routing. Routing decisions are made on the basis | ||
| 22 | not only of destination address, but also source address, | ||
| 23 | TOS and incoming interface. | ||
| 24 | - Complete set of IP level control messages. | ||
| 25 | Now Linux is the only OS in the world complying to RFC requirements. | ||
| 26 | Great win 8) | ||
| 27 | - New interface addressing paradigm. | ||
| 28 | Assignment of address ranges to interface, | ||
| 29 | multiple prefixes etc. etc. | ||
| 30 | Do not bother, it is compatible with the old one. Moreover: | ||
| 31 | - You don't need to do "route add aaa.bbb.ccc... eth0" anymore, | ||
| 32 | it is done automatically. | ||
| 33 | - "Abstract" UNIX sockets and security enhancements. | ||
| 34 | This is necessary to use TIRPC and TLI emulation library. | ||
| 35 | |||
| 36 | NEWS for hacker. | ||
| 37 | |||
| 38 | - New destination cache. Flexible, robust and just beautiful. | ||
| 39 | - Network stack is reordered, simplified, optimized, a lot of bugs fixed. | ||
| 40 | (well, and new bugs were introduced, but I haven't seen them yet 8)) | ||
| 41 | It is difficult to describe all the changes, look into source. | ||
| 42 | |||
| 43 | If you see this file, then this patch works 8) | ||
| 44 | |||
| 45 | Alexey Kuznetsov. | ||
| 46 | kuznet@ms2.inr.ac.ru | ||
diff --git a/Documentation/networking/slicecom.hun b/Documentation/networking/slicecom.hun deleted file mode 100644 index bed2f045e550..000000000000 --- a/Documentation/networking/slicecom.hun +++ /dev/null | |||
| @@ -1,371 +0,0 @@ | |||
| 1 | |||
| 2 | SliceCOM adapter felhasznaloi dokumentacioja - 0.51 verziohoz | ||
| 3 | |||
| 4 | Bartók István <bartoki@itc.hu> | ||
| 5 | Utolso modositas: Wed Aug 29 17:26:58 CEST 2001 | ||
| 6 | |||
| 7 | ----------------------------------------------------------------- | ||
| 8 | |||
| 9 | Hasznalata: | ||
| 10 | |||
| 11 | Forditas: | ||
| 12 | |||
| 13 | Code maturity level options | ||
| 14 | [*] Prompt for development and/or incomplete code/drivers | ||
| 15 | |||
| 16 | Network device support | ||
| 17 | Wan interfaces | ||
| 18 | <M> MultiGate (COMX) synchronous | ||
| 19 | <M> Support for MUNICH based boards: SliceCOM, PCICOM (NEW) | ||
| 20 | <M> Support for HDLC and syncPPP... | ||
| 21 | |||
| 22 | |||
| 23 | A modulok betoltese: | ||
| 24 | |||
| 25 | modprobe comx | ||
| 26 | |||
| 27 | modprobe comx-proto-ppp # a Cisco-HDLC es a SyncPPP protokollt is | ||
| 28 | # ez a modul adja | ||
| 29 | |||
| 30 | modprobe comx-hw-munich # a modul betoltodeskor azonnal jelent a | ||
| 31 | # syslogba a detektalt kartyakrol | ||
| 32 | |||
| 33 | |||
| 34 | Konfiguralas: | ||
| 35 | |||
| 36 | # Ezen az interfeszen Cisco-HDLC vonali protokoll fog futni | ||
| 37 | # Az interfeszhez rendelt idoszeletek: 1,2 (128 kbit/sec-es vonal) | ||
| 38 | # (a G.703 keretben az elso adatot vivo idoszelet az 1-es) | ||
| 39 | # | ||
| 40 | mkdir /proc/comx/comx0.1/ | ||
| 41 | echo slicecom >/proc/comx/comx0.1/boardtype | ||
| 42 | echo hdlc >/proc/comx/comx0.1/protocol | ||
| 43 | echo 1 2 >/proc/comx/comx0.1/timeslots | ||
| 44 | |||
| 45 | |||
| 46 | # Ezen az interfeszen SyncPPP vonali protokoll fog futni | ||
| 47 | # Az interfeszhez rendelt idoszelet: 3 (64 kbit/sec-es vonal) | ||
| 48 | # | ||
| 49 | mkdir /proc/comx/comx0.2/ | ||
| 50 | echo slicecom >/proc/comx/comx0.2/boardtype | ||
| 51 | echo ppp >/proc/comx/comx0.2/protocol | ||
| 52 | echo 3 >/proc/comx/comx0.2/timeslots | ||
| 53 | |||
| 54 | ... | ||
| 55 | |||
| 56 | ifconfig comx0.1 up | ||
| 57 | ifconfig comx0.2 up | ||
| 58 | |||
| 59 | ----------------------------------------------------------------- | ||
| 60 | |||
| 61 | A COMX driverek default 20 csomagnyi transmit queue-t rendelnek a halozati | ||
| 62 | interfeszekhez. WAN halozatokban ennel hosszabbat is szokas hasznalni | ||
| 63 | (20 es 100 kozott), hogy a vonal kihasznaltsaga nagy terheles eseten jobb | ||
| 64 | legyen (bar ezzel megno a varhato kesleltetes a csomagok sorban allasa miatt): | ||
| 65 | |||
| 66 | # ifconfig comx0 txqueuelen 50 | ||
| 67 | |||
| 68 | Ezt a beallitasi lehetoseget csak az ujabb disztribuciok ifconfig parancsa | ||
| 69 | tamogatja (amik mar a 2.2 kernelekhez keszultek, mint a RedHat 6.1 vagy a | ||
| 70 | Debian 2.2). | ||
| 71 | |||
| 72 | A 2.1-es Debian disztribuciohoz a http://www.debian.org/~rcw/2.2/netbase/ | ||
| 73 | cimrol toltheto le ujabb netbase csomag, ami mar ilyet tamogato ifconfig | ||
| 74 | parancsot tartalmaz. Bovebben a 2.2 kernel hasznalatarol Debian 2.1 alatt: | ||
| 75 | http://www.debian.org/releases/stable/running-kernel-2.2 | ||
| 76 | |||
| 77 | ----------------------------------------------------------------- | ||
| 78 | |||
| 79 | A kartya LED-jeinek jelentese: | ||
| 80 | |||
| 81 | piros - eg, ha Remote Alarm-ot kuld a tuloldal | ||
| 82 | zold - eg, ha a vett jelben megtalalja a keretszinkront | ||
| 83 | |||
| 84 | Reszletesebben: | ||
| 85 | |||
| 86 | piros: zold: jelentes: | ||
| 87 | |||
| 88 | - - nincs keretszinkron (nincs jel, vagy rossz a jel) | ||
| 89 | - eg "minden rendben" | ||
| 90 | eg eg a vetel OK, de a tuloldal Remote Alarm-ot kuld | ||
| 91 | eg - ez nincs ertelmezve, egyelore funkcio nelkul | ||
| 92 | |||
| 93 | ----------------------------------------------------------------- | ||
| 94 | |||
| 95 | Reszletesebb leiras a hardver beallitasi lehetosegeirol: | ||
| 96 | |||
| 97 | Az altalanos,- es a protokoll-retegek beallitasi lehetosegeirol a 'comx.txt' | ||
| 98 | fajlban leirtak SliceCOM kartyanal is ervenyesek, itt csak a hardver-specifikus | ||
| 99 | beallitasi lehetosegek vannak osszefoglalva: | ||
| 100 | |||
| 101 | Konfiguralasi interfesz a /proc/comx/ alatt: | ||
| 102 | |||
| 103 | Minden timeslot-csoportnak kulon comx* interfeszt kell letrehozni mkdir-rel: | ||
| 104 | comx0, comx1, .. stb. Itt beallithato, hogy az adott interfesz hanyadik kartya | ||
| 105 | melyik timeslotja(i)bol alljon ossze. A Cisco-fele serial3:1 elnevezesek | ||
| 106 | (serial3:1 = a 3. kartyaban az 1-es idoszelet-csoport) Linuxon aliasing-ot | ||
| 107 | jelentenenek, ezert mi nem tudunk ilyen elnevezest hasznalni. | ||
| 108 | |||
| 109 | Tobb kartya eseten a comx0.1, comx0.2, ... vagy slice0.1, slice0.2 nevek | ||
| 110 | hasznalhatoak. | ||
| 111 | |||
| 112 | Tobb SliceCOM kartya is lehet egy gepben, de sajat interrupt kell mindegyiknek, | ||
| 113 | nem tud meg megosztott interruptot kezelni. | ||
| 114 | |||
| 115 | Az egesz kartyat erinto beallitasok: | ||
| 116 | |||
| 117 | Az ioport es irq beallitas nincs: amit a PCI BIOS kioszt a rendszernek, | ||
| 118 | azt hasznalja a driver. | ||
| 119 | |||
| 120 | |||
| 121 | comx0/boardnum - hanyadik SliceCOM kartya a gepben (a 'termeszetes' PCI | ||
| 122 | sorrendben ertve: ahogyan a /proc/pci-ban vagy az 'lspci' | ||
| 123 | kimeneteben megjelenik, altalaban az alaplapi PCI meghajto | ||
| 124 | aramkorokhoz kozelebb eso kartyak a kisebb sorszamuak) | ||
| 125 | |||
| 126 | Default: 0 (0-tol kezdodik a szamolas) | ||
| 127 | |||
| 128 | |||
| 129 | Bar a kovetkezoket csak egy-egy interfeszen allitjuk at, megis az egesz kartya | ||
| 130 | mukodeset egyszerre allitjak. A megkotes hogy csak UP-ban levo interfeszen | ||
| 131 | hasznalhatoak, azert van, mert kulonben nem vart eredmenyekre vezetne egy ilyen | ||
| 132 | paranccsorozat: | ||
| 133 | |||
| 134 | echo 0 >boardnum | ||
| 135 | echo internal >clock_source | ||
| 136 | echo 1 >boardnum | ||
| 137 | |||
| 138 | - Ez a 0-s board clock_source-at allitana at. | ||
| 139 | |||
| 140 | Ezek a beallitasok megmaradnak az osszes interfesz torlesekor, de torlodnek | ||
| 141 | a driver modul ki/betoltesekor. | ||
| 142 | |||
| 143 | |||
| 144 | comx0/clock_source - A Tx orajelforrasa, a Cisco-val hasonlatosra keszult. | ||
| 145 | Hasznalata: | ||
| 146 | |||
| 147 | papaya:# echo line >/proc/comx/comx0/clock_source | ||
| 148 | papaya:# echo internal >/proc/comx/comx0/clock_source | ||
| 149 | |||
| 150 | line - A Tx orajelet a vett adatfolyambol dekodolja, igyekszik | ||
| 151 | igazodni hozza. Ha nem lat orajelet az inputon, akkor | ||
| 152 | atall a sajat orajelgeneratorara. | ||
| 153 | internal - A Tx orajelet a sajat orajelgeneratora szolgaltatja. | ||
| 154 | |||
| 155 | Default: line | ||
| 156 | |||
| 157 | Normal osszeallitas eseten a tavkozlesi szolgaltato eszkoze | ||
| 158 | (pl. HDSL modem) adja az orajelet, ezert ez a default. | ||
| 159 | |||
| 160 | |||
| 161 | comx0/framing - A CRC4 ki/be kapcsolasa | ||
| 162 | |||
| 163 | A CRC4: 16 PCM keretet (A PCM keret az, amibe a 32 darab 64 | ||
| 164 | kilobites csatorna van bemultiplexalva. Nem osszetevesztendo a HDLC | ||
| 165 | kerettel.) 2x8 -as csoportokra osztanak, es azokhoz 4-4 bites CRC-t | ||
| 166 | szamolnak. Elsosorban a vonal minosegenek a monitorozasara szolgal. | ||
| 167 | |||
| 168 | papaya:~# echo crc4 >/proc/comx/comx0/framing | ||
| 169 | papaya:~# echo no-crc4 >/proc/comx/comx0/framing | ||
| 170 | |||
| 171 | Default a 'crc4', a MATAV vonalak altalaban igy futnak. De ha nem | ||
| 172 | egyforma is a beallitas a vonal ket vegen, attol a forgalom altalaban | ||
| 173 | at tud menni. | ||
| 174 | |||
| 175 | |||
| 176 | comx0/linecode - A vonali kodolas beallitasa | ||
| 177 | |||
| 178 | papaya:~# echo hdb3 >/proc/comx/comx0/linecode | ||
| 179 | papaya:~# echo ami >/proc/comx/comx0/linecode | ||
| 180 | |||
| 181 | Default a 'hdb3', a MATAV vonalak igy futnak. | ||
| 182 | |||
| 183 | (az AMI kodolas igen ritka E1-es vonalaknal). Ha ez a beallitas nem | ||
| 184 | egyezik a vonal ket vegen, akkor elofordulhat hogy a keretszinkron | ||
| 185 | osszejon, de CRC4-hibak es a vonalakon atvitt adatokban is hibak | ||
| 186 | keletkeznek (amit a HDLC/SyncPPP szinten CRC-hibaval jelez) | ||
| 187 | |||
| 188 | |||
| 189 | comx0/reg - a kartya aramkoreinek, a MUNICH (reg) es a FALC (lbireg) | ||
| 190 | comx0/lbireg regisztereinek kozvetlen elerese. Hasznalata: | ||
| 191 | |||
| 192 | echo >reg 0x04 0x0 - a 4-es regiszterbe 0-t ir | ||
| 193 | echo >reg 0x104 - printk()-val kiirja a 4-es regiszter | ||
| 194 | tartalmat a syslogba. | ||
| 195 | |||
| 196 | WARNING: ezek csak a fejleszteshez keszultek, sok galibat | ||
| 197 | lehet veluk okozni! | ||
| 198 | |||
| 199 | |||
| 200 | comx0/loopback - A kartya G.703 jelenek a visszahurkolasara is van lehetoseg: | ||
| 201 | |||
| 202 | papaya:# echo none >/proc/comx/comx0/loopback | ||
| 203 | papaya:# echo local >/proc/comx/comx0/loopback | ||
| 204 | papaya:# echo remote >/proc/comx/comx0/loopback | ||
| 205 | |||
| 206 | none - nincs visszahurkolas, normal mukodes | ||
| 207 | local - a kartya a sajat maga altal adott jelet kapja vissza | ||
| 208 | remote - a kartya a kivulrol vett jelet adja kifele | ||
| 209 | |||
| 210 | Default: none | ||
| 211 | |||
| 212 | ----------------------------------------------------------------- | ||
| 213 | |||
| 214 | Az interfeszhez (Cisco terminologiaban 'channel-group') kapcsolodo beallitasok: | ||
| 215 | |||
| 216 | comx0/timeslots - mely timeslotok (idoszeletek) tartoznak az adott interfeszhez. | ||
| 217 | |||
| 218 | papaya:~# cat /proc/comx/comx0/timeslots | ||
| 219 | 1 3 4 5 6 | ||
| 220 | papaya:~# | ||
| 221 | |||
| 222 | Egy timeslot megkeresese (hanyas interfeszbe tartozik nalunk): | ||
| 223 | |||
| 224 | papaya:~# grep ' 4' /proc/comx/comx*/timeslots | ||
| 225 | /proc/comx/comx0/timeslots:1 3 4 5 6 | ||
| 226 | papaya:~# | ||
| 227 | |||
| 228 | Beallitasa: | ||
| 229 | papaya:~# echo '1 5 2 6 7 8' >/proc/comx/comx0/timeslots | ||
| 230 | |||
| 231 | A timeslotok sorrendje nem szamit, '1 3 2' ugyanaz mint az '1 2 3'. | ||
| 232 | |||
| 233 | Beallitashoz az adott interfesznek DOWN-ban kell lennie | ||
| 234 | (ifconfig comx0 down), de ugyanannak a kartyanak a tobbi interfesze | ||
| 235 | uzemelhet kozben. | ||
| 236 | |||
| 237 | Beallitaskor leellenorzi, hogy az uj timeslotok nem utkoznek-e egy | ||
| 238 | masik interfesz timeslotjaival. Ha utkoznek, akkor nem allitja at. | ||
| 239 | |||
| 240 | Mindig 10-es szamrendszerben tortenik a timeslotok ertelmezese, nehogy | ||
| 241 | a 08, 09 alaku felirast rosszul ertelmezze. | ||
| 242 | |||
| 243 | ----------------------------------------------------------------- | ||
| 244 | |||
| 245 | Az interfeszek es a kartya allapotanak lekerdezese: | ||
| 246 | |||
| 247 | - A ' '-szel kezdodo sorok az eredeti kimenetet, a //-rel kezdodo sorok a | ||
| 248 | magyarazatot jelzik. | ||
| 249 | |||
| 250 | papaya:~$ cat /proc/comx/comx1/status | ||
| 251 | Interface administrative status is UP, modem status is UP, protocol is UP | ||
| 252 | Modem status changes: 0, Transmitter status is IDLE, tbusy: 0 | ||
| 253 | Interface load (input): 978376 / 947808 / 951024 bits/s (5s/5m/15m) | ||
| 254 | (output): 978376 / 947848 / 951024 bits/s (5s/5m/15m) | ||
| 255 | Debug flags: none | ||
| 256 | RX errors: len: 22, overrun: 1, crc: 0, aborts: 0 | ||
| 257 | buffer overrun: 0, pbuffer overrun: 0 | ||
| 258 | TX errors: underrun: 0 | ||
| 259 | Line keepalive (value: 10) status UP [0] | ||
| 260 | |||
| 261 | // Itt kezdodik a hardver-specifikus resz: | ||
| 262 | Controller status: | ||
| 263 | No alarms | ||
| 264 | |||
| 265 | // Alarm: hibajelzes: | ||
| 266 | // | ||
| 267 | // No alarms - minden rendben | ||
| 268 | // | ||
| 269 | // LOS - Loss Of Signal - nem erzekel jelet a bemeneten. | ||
| 270 | // AIS - Alarm Indication Signal - csak egymas utani 1-esek jonnek | ||
| 271 | // a bemeneten, a tuloldal igy is jelezheti hogy meghibasodott vagy | ||
| 272 | // nincs inicializalva. | ||
| 273 | // AUXP - Auxiliary Pattern Indication - 01010101.. sorozat jon a bemeneten. | ||
| 274 | // LFA - Loss of Frame Alignment - nincs keretszinkron | ||
| 275 | // RRA - Receive Remote Alarm - a tuloldal el, de hibat jelez. | ||
| 276 | // LMFA - Loss of CRC4 Multiframe Alignment - nincs CRC4-multikeret-szinkron | ||
| 277 | // NMF - No Multiframe alignment Found after 400 msec - ilyen alarm a no-crc4 | ||
| 278 | // es crc4 keretezesek eseten nincs, lasd lentebb | ||
| 279 | // | ||
| 280 | // Egyeb lehetseges hibajelzesek: | ||
| 281 | // | ||
| 282 | // Transmit Line Short - a kartya ugy erzi hogy az adasi kimenete rovidre | ||
| 283 | // van zarva, ezert kikapcsolta az adast. (nem feltetlenul veszi eszre | ||
| 284 | // a kulso rovidzarat) | ||
| 285 | |||
| 286 | // A veteli oldal csomagjainak lancolt listai, debug celokra: | ||
| 287 | |||
| 288 | Rx ring: | ||
| 289 | rafutott: 0 | ||
| 290 | lastcheck: 50845731, jiffies: 51314281 | ||
| 291 | base: 017b1858 | ||
| 292 | rx_desc_ptr: 0 | ||
| 293 | rx_desc_ptr: 017b1858 | ||
| 294 | hw_curr_ptr: 017b1858 | ||
| 295 | 06040000 017b1868 017b1898 c016ff00 | ||
| 296 | 06040000 017b1878 017b1e9c c016ff00 | ||
| 297 | 46040000 017b1888 017b24a0 c016ff00 | ||
| 298 | 06040000 017b1858 017b2aa4 c016ff00 | ||
| 299 | |||
| 300 | // A kartyat hasznalo tobbi interfesz: a 0-s channel-group a comx1 interfesz, | ||
| 301 | // es az 1,2,...,16 timeslotok tartoznak hozza: | ||
| 302 | |||
| 303 | Interfaces using this board: (channel-group, interface, timeslots) | ||
| 304 | 0 comx1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ||
| 305 | 1 comx2: 17 | ||
| 306 | 2 comx3: 18 | ||
| 307 | 3 comx4: 19 | ||
| 308 | 4 comx5: 20 | ||
| 309 | 5 comx6: 21 | ||
| 310 | 6 comx7: 22 | ||
| 311 | 7 comx8: 23 | ||
| 312 | 8 comx9: 24 | ||
| 313 | 9 comx10: 25 | ||
| 314 | 10 comx11: 26 | ||
| 315 | 11 comx12: 27 | ||
| 316 | 12 comx13: 28 | ||
| 317 | 13 comx14: 29 | ||
| 318 | 14 comx15: 30 | ||
| 319 | 15 comx16: 31 | ||
| 320 | |||
| 321 | // Hany esemenyt kezelt le a driver egy-egy hardver-interrupt kiszolgalasanal: | ||
| 322 | |||
| 323 | Interrupt work histogram: | ||
| 324 | hist[ 0]: 0 hist[ 1]: 2 hist[ 2]: 18574 hist[ 3]: 79 | ||
| 325 | hist[ 4]: 14 hist[ 5]: 1 hist[ 6]: 0 hist[ 7]: 1 | ||
| 326 | hist[ 8]: 0 hist[ 9]: 7 | ||
| 327 | |||
| 328 | // Hany kikuldendo csomag volt mar a Tx-ringben amikor ujabb lett irva bele: | ||
| 329 | |||
| 330 | Tx ring histogram: | ||
| 331 | hist[ 0]: 2329 hist[ 1]: 0 hist[ 2]: 0 hist[ 3]: 0 | ||
| 332 | |||
| 333 | // Az E1-interfesz hiba-szamlaloi, az rfc2495-nek megfeleloen: | ||
| 334 | // (kb. a Cisco routerek "show controllers e1" formatumaban: http://www.cisco.com/univercd/cc/td/doc/product/software/ios11/rbook/rinterfc.htm#xtocid25669126) | ||
| 335 | |||
| 336 | Data in current interval (91 seconds elapsed): | ||
| 337 | 9516 Line Code Violations, 65 Path Code Violations, 2 E-Bit Errors | ||
| 338 | 0 Slip Secs, 2 Fr Loss Secs, 2 Line Err Secs, 0 Degraded Mins | ||
| 339 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 11 Unavail Secs | ||
| 340 | Data in Interval 1 (15 minutes): | ||
| 341 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 342 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 343 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 344 | Data in last 4 intervals (1 hour): | ||
| 345 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 346 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 347 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 348 | Data in last 96 intervals (24 hours): | ||
| 349 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 350 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 351 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 352 | |||
| 353 | ----------------------------------------------------------------- | ||
| 354 | |||
| 355 | Nehany kulonlegesebb beallitasi lehetoseg (idovel beepulhetnek majd a driverbe): | ||
| 356 | Ezekkel sok galibat lehet okozni, nagyon ovatosan kell oket hasznalni! | ||
| 357 | |||
| 358 | modified CRC-4, for improved interworking of CRC-4 and non-CRC-4 | ||
| 359 | devices: (lasd page 107 es g706 Annex B) | ||
| 360 | lbireg[ 0x1b ] |= 0x08 | ||
| 361 | lbireg[ 0x1c ] |= 0xc0 | ||
| 362 | - ilyenkor ertelmezett az NMF - 'No Multiframe alignment Found after | ||
| 363 | 400 msec' alarm. | ||
| 364 | |||
| 365 | FALC - a vonali meghajto IC | ||
| 366 | local loop - a sajat adasomat halljam vissza | ||
| 367 | remote loop - a kivulrol jovo adast adom vissza | ||
| 368 | |||
| 369 | Egy hibakeresesre hasznalhato dolog: | ||
| 370 | - 1-es timeslot local loop a FALC-ban: echo >lbireg 0x1d 0x21 | ||
| 371 | - local loop kikapcsolasa: echo >lbireg 0x1d 0x00 | ||
diff --git a/Documentation/networking/slicecom.txt b/Documentation/networking/slicecom.txt deleted file mode 100644 index c82c0cf981b4..000000000000 --- a/Documentation/networking/slicecom.txt +++ /dev/null | |||
| @@ -1,369 +0,0 @@ | |||
| 1 | |||
| 2 | SliceCOM adapter user's documentation - for the 0.51 driver version | ||
| 3 | |||
| 4 | Written by Bartók István <bartoki@itc.hu> | ||
| 5 | |||
| 6 | English translation: Lakatos György <gyuri@itc.hu> | ||
| 7 | Mon Dec 11 15:28:42 CET 2000 | ||
| 8 | |||
| 9 | Last modified: Wed Aug 29 17:25:37 CEST 2001 | ||
| 10 | |||
| 11 | ----------------------------------------------------------------- | ||
| 12 | |||
| 13 | Usage: | ||
| 14 | |||
| 15 | Compiling the kernel: | ||
| 16 | |||
| 17 | Code maturity level options | ||
| 18 | [*] Prompt for development and/or incomplete code/drivers | ||
| 19 | |||
| 20 | Network device support | ||
| 21 | Wan interfaces | ||
| 22 | <M> MultiGate (COMX) synchronous | ||
| 23 | <M> Support for MUNICH based boards: SliceCOM, PCICOM (NEW) | ||
| 24 | <M> Support for HDLC and syncPPP... | ||
| 25 | |||
| 26 | |||
| 27 | Loading the modules: | ||
| 28 | |||
| 29 | modprobe comx | ||
| 30 | |||
| 31 | modprobe comx-proto-ppp # module for Cisco-HDLC and SyncPPP protocols | ||
| 32 | |||
| 33 | modprobe comx-hw-munich # the module logs information by the kernel | ||
| 34 | # about the detected boards | ||
| 35 | |||
| 36 | |||
| 37 | Configuring the board: | ||
| 38 | |||
| 39 | # This interface will use the Cisco-HDLC line protocol, | ||
| 40 | # the timeslices assigned are 1,2 (128 KiBit line speed) | ||
| 41 | # (the first data timeslice in the G.703 frame is no. 1) | ||
| 42 | # | ||
| 43 | mkdir /proc/comx/comx0.1/ | ||
| 44 | echo slicecom >/proc/comx/comx0.1/boardtype | ||
| 45 | echo hdlc >/proc/comx/comx0.1/protocol | ||
| 46 | echo 1 2 >/proc/comx/comx0.1/timeslots | ||
| 47 | |||
| 48 | |||
| 49 | # This interface uses SyncPPP line protocol, the assigned | ||
| 50 | # is no. 3 (64 KiBit line speed) | ||
| 51 | # | ||
| 52 | mkdir /proc/comx/comx0.2/ | ||
| 53 | echo slicecom >/proc/comx/comx0.2/boardtype | ||
| 54 | echo ppp >/proc/comx/comx0.2/protocol | ||
| 55 | echo 3 >/proc/comx/comx0.2/timeslots | ||
| 56 | |||
| 57 | ... | ||
| 58 | |||
| 59 | ifconfig comx0.1 up | ||
| 60 | ifconfig comx0.2 up | ||
| 61 | |||
| 62 | ----------------------------------------------------------------- | ||
| 63 | |||
| 64 | The COMX interfaces use a 10 packet transmit queue by default, however WAN | ||
| 65 | networks sometimes use bigger values (20 to 100), to utilize the line better | ||
| 66 | by large traffic (though the line delay increases because of more packets | ||
| 67 | join the queue). | ||
| 68 | |||
| 69 | # ifconfig comx0 txqueuelen 50 | ||
| 70 | |||
| 71 | This option is only supported by the ifconfig command of the later | ||
| 72 | distributions, which came with 2.2 kernels, such as RedHat 6.1 or Debian 2.2. | ||
| 73 | |||
| 74 | You can download a newer netbase packet from | ||
| 75 | http://www.debian.org/~rcw/2.2/netbase/ for Debian 2.1, which has a new | ||
| 76 | ifconfig. You can get further information about using 2.2 kernel with | ||
| 77 | Debian 2.1 from http://www.debian.org/releases/stable/running-kernel-2.2 | ||
| 78 | |||
| 79 | ----------------------------------------------------------------- | ||
| 80 | |||
| 81 | The SliceCom LEDs: | ||
| 82 | |||
| 83 | red - on, if the interface is unconfigured, or it gets Remote Alarm-s | ||
| 84 | green - on, if the board finds frame-sync in the received signal | ||
| 85 | |||
| 86 | A bit more detailed: | ||
| 87 | |||
| 88 | red: green: meaning: | ||
| 89 | |||
| 90 | - - no frame-sync, no signal received, or signal SNAFU. | ||
| 91 | - on "Everything is OK" | ||
| 92 | on on Reception is ok, but the remote end sends Remote Alarm | ||
| 93 | on - The interface is unconfigured | ||
| 94 | |||
| 95 | ----------------------------------------------------------------- | ||
| 96 | |||
| 97 | A more detailed description of the hardware setting options: | ||
| 98 | |||
| 99 | The general and the protocol layer options described in the 'comx.txt' file | ||
| 100 | apply to the SliceCom as well, I only summarize the SliceCom hardware specific | ||
| 101 | settings below. | ||
| 102 | |||
| 103 | The '/proc/comx' configuring interface: | ||
| 104 | |||
| 105 | An interface directory should be created for every timeslot group with | ||
| 106 | 'mkdir', e,g: 'comx0', 'comx1' etc. The timeslots can be assigned here to the | ||
| 107 | specific interface. The Cisco-like naming convention (serial3:1 - first | ||
| 108 | timeslot group of the 3rd. board) can't be used here, because these mean IP | ||
| 109 | aliasing in Linux. | ||
| 110 | |||
| 111 | You can give any meaningful name to keep the configuration clear; | ||
| 112 | e.g: 'comx0.1', 'comx0.2', 'comx1.1', comx1.2', if you have two boards | ||
| 113 | with two interfaces each. | ||
| 114 | |||
| 115 | Settings, which apply to the board: | ||
| 116 | |||
| 117 | Neither 'io' nor 'irq' settings required, the driver uses the resources | ||
| 118 | given by the PCI BIOS. | ||
| 119 | |||
| 120 | comx0/boardnum - board number of the SliceCom in the PC (using the 'natural' | ||
| 121 | PCI order) as listed in '/proc/pci' or the output of the | ||
| 122 | 'lspci' command, generally the slots nearer to the motherboard | ||
| 123 | PCI driver chips have the lower numbers. | ||
| 124 | |||
| 125 | Default: 0 (the counting starts with 0) | ||
| 126 | |||
| 127 | Though the options below are to be set on a single interface, they apply to the | ||
| 128 | whole board. The restriction, to use them on 'UP' interfaces, is because the | ||
| 129 | command sequence below could lead to unpredictable results. | ||
| 130 | |||
| 131 | # echo 0 >boardnum | ||
| 132 | # echo internal >clock_source | ||
| 133 | # echo 1 >boardnum | ||
| 134 | |||
| 135 | The sequence would set the clock source of board 0. | ||
| 136 | |||
| 137 | These settings will persist after all the interfaces are cleared, but are | ||
| 138 | cleared when the driver module is unloaded and loaded again. | ||
| 139 | |||
| 140 | comx0/clock_source - source of the transmit clock | ||
| 141 | Usage: | ||
| 142 | |||
| 143 | # echo line >/proc/comx/comx0/clock_source | ||
| 144 | # echo internal >/proc/comx/comx0/clock_source | ||
| 145 | |||
| 146 | line - The Tx clock is being decoded if the input data stream, | ||
| 147 | if no clock seen on the input, then the board will use it's | ||
| 148 | own clock generator. | ||
| 149 | |||
| 150 | internal - The Tx clock is supplied by the builtin clock generator. | ||
| 151 | |||
| 152 | Default: line | ||
| 153 | |||
| 154 | Normally, the telecommunication company's end device (the HDSL | ||
| 155 | modem) provides the Tx clock, that's why 'line' is the default. | ||
| 156 | |||
| 157 | comx0/framing - Switching CRC4 off/on | ||
| 158 | |||
| 159 | CRC4: 16 PCM frames (The 32 64Kibit channels are multiplexed into a | ||
| 160 | PCM frame, nothing to do with HDLC frames) are divided into 2x8 | ||
| 161 | groups, each group has a 4 bit CRC. | ||
| 162 | |||
| 163 | # echo crc4 >/proc/comx/comx0/framing | ||
| 164 | # echo no-crc4 >/proc/comx/comx0/framing | ||
| 165 | |||
| 166 | Default is 'crc4', the Hungarian MATAV lines behave like this. | ||
| 167 | The traffic generally passes if this setting on both ends don't match. | ||
| 168 | |||
| 169 | comx0/linecode - Setting the line coding | ||
| 170 | |||
| 171 | # echo hdb3 >/proc/comx/comx0/linecode | ||
| 172 | # echo ami >/proc/comx/comx0/linecode | ||
| 173 | |||
| 174 | Default a 'hdb3', MATAV lines use this. | ||
| 175 | |||
| 176 | (AMI coding is rarely used with E1 lines). Frame sync may occur, if | ||
| 177 | this setting doesn't match the other end's, but CRC4 and data errors | ||
| 178 | will come, which will result in CRC errors on HDLC/SyncPPP level. | ||
| 179 | |||
| 180 | comx0/reg - direct access to the board's MUNICH (reg) and FALC (lbireg) | ||
| 181 | comx0/lbireg circuit's registers | ||
| 182 | |||
| 183 | # echo >reg 0x04 0x0 - write 0 to register 4 | ||
| 184 | # echo >reg 0x104 - write the contents of register 4 with | ||
| 185 | printk() to syslog | ||
| 186 | |||
| 187 | WARNING! These are only for development purposes, messing with this will | ||
| 188 | result much trouble! | ||
| 189 | |||
| 190 | comx0/loopback - Places a loop to the board's G.703 signals | ||
| 191 | |||
| 192 | # echo none >/proc/comx/comx0/loopback | ||
| 193 | # echo local >/proc/comx/comx0/loopback | ||
| 194 | # echo remote >/proc/comx/comx0/loopback | ||
| 195 | |||
| 196 | none - normal operation, no loop | ||
| 197 | local - the board receives it's own output | ||
| 198 | remote - the board sends the received data to the remote side | ||
| 199 | |||
| 200 | Default: none | ||
| 201 | |||
| 202 | ----------------------------------------------------------------- | ||
| 203 | |||
| 204 | Interface (channel group in Cisco terms) settings: | ||
| 205 | |||
| 206 | comx0/timeslots - which timeslots belong to the given interface | ||
| 207 | |||
| 208 | Setting: | ||
| 209 | |||
| 210 | # echo '1 5 2 6 7 8' >/proc/comx/comx0/timeslots | ||
| 211 | |||
| 212 | # cat /proc/comx/comx0/timeslots | ||
| 213 | 1 2 5 6 7 8 | ||
| 214 | # | ||
| 215 | |||
| 216 | Finding a timeslot: | ||
| 217 | |||
| 218 | # grep ' 4' /proc/comx/comx*/timeslots | ||
| 219 | /proc/comx/comx0/timeslots:1 3 4 5 6 | ||
| 220 | # | ||
| 221 | |||
| 222 | The timeslots can be in any order, '1 2 3' is the same as '1 3 2'. | ||
| 223 | |||
| 224 | The interface has to be DOWN during the setting ('ifconfig comx0 | ||
| 225 | down'), but the other interfaces could operate normally. | ||
| 226 | |||
| 227 | The driver checks if the assigned timeslots are vacant, if not, then | ||
| 228 | the setting won't be applied. | ||
| 229 | |||
| 230 | The timeslot values are treated as decimal numbers, not to misunderstand | ||
| 231 | values of 08, 09 form. | ||
| 232 | |||
| 233 | ----------------------------------------------------------------- | ||
| 234 | |||
| 235 | Checking the interface and board status: | ||
| 236 | |||
| 237 | - Lines beginning with ' ' (space) belong to the original output, the lines | ||
| 238 | which begin with '//' are the comments. | ||
| 239 | |||
| 240 | papaya:~$ cat /proc/comx/comx1/status | ||
| 241 | Interface administrative status is UP, modem status is UP, protocol is UP | ||
| 242 | Modem status changes: 0, Transmitter status is IDLE, tbusy: 0 | ||
| 243 | Interface load (input): 978376 / 947808 / 951024 bits/s (5s/5m/15m) | ||
| 244 | (output): 978376 / 947848 / 951024 bits/s (5s/5m/15m) | ||
| 245 | Debug flags: none | ||
| 246 | RX errors: len: 22, overrun: 1, crc: 0, aborts: 0 | ||
| 247 | buffer overrun: 0, pbuffer overrun: 0 | ||
| 248 | TX errors: underrun: 0 | ||
| 249 | Line keepalive (value: 10) status UP [0] | ||
| 250 | |||
| 251 | // The hardware specific part starts here: | ||
| 252 | Controller status: | ||
| 253 | No alarms | ||
| 254 | |||
| 255 | // Alarm: | ||
| 256 | // | ||
| 257 | // No alarms - Everything OK | ||
| 258 | // | ||
| 259 | // LOS - Loss Of Signal - No signal sensed on the input | ||
| 260 | // AIS - Alarm Indication Signal - The remote side sends '11111111'-s, | ||
| 261 | // it tells, that there's an error condition, or it's not | ||
| 262 | // initialised. | ||
| 263 | // AUXP - Auxiliary Pattern Indication - 01010101.. received. | ||
| 264 | // LFA - Loss of Frame Alignment - no frame sync received. | ||
| 265 | // RRA - Receive Remote Alarm - the remote end's OK, but signals error cond. | ||
| 266 | // LMFA - Loss of CRC4 Multiframe Alignment - no CRC4 multiframe sync. | ||
| 267 | // NMF - No Multiframe alignment Found after 400 msec - no such alarm using | ||
| 268 | // no-crc4 or crc4 framing, see below. | ||
| 269 | // | ||
| 270 | // Other possible error messages: | ||
| 271 | // | ||
| 272 | // Transmit Line Short - the board felt, that it's output is short-circuited, | ||
| 273 | // so it switched the transmission off. (The board can't definitely tell, | ||
| 274 | // that it's output is short-circuited.) | ||
| 275 | |||
| 276 | // Chained list of the received packets, for debug purposes: | ||
| 277 | |||
| 278 | Rx ring: | ||
| 279 | rafutott: 0 | ||
| 280 | lastcheck: 50845731, jiffies: 51314281 | ||
| 281 | base: 017b1858 | ||
| 282 | rx_desc_ptr: 0 | ||
| 283 | rx_desc_ptr: 017b1858 | ||
| 284 | hw_curr_ptr: 017b1858 | ||
| 285 | 06040000 017b1868 017b1898 c016ff00 | ||
| 286 | 06040000 017b1878 017b1e9c c016ff00 | ||
| 287 | 46040000 017b1888 017b24a0 c016ff00 | ||
| 288 | 06040000 017b1858 017b2aa4 c016ff00 | ||
| 289 | |||
| 290 | // All the interfaces using the board: comx1, using the 1,2,...16 timeslots, | ||
| 291 | // comx2, using timeslot 17, etc. | ||
| 292 | |||
| 293 | Interfaces using this board: (channel-group, interface, timeslots) | ||
| 294 | 0 comx1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ||
| 295 | 1 comx2: 17 | ||
| 296 | 2 comx3: 18 | ||
| 297 | 3 comx4: 19 | ||
| 298 | 4 comx5: 20 | ||
| 299 | 5 comx6: 21 | ||
| 300 | 6 comx7: 22 | ||
| 301 | 7 comx8: 23 | ||
| 302 | 8 comx9: 24 | ||
| 303 | 9 comx10: 25 | ||
| 304 | 10 comx11: 26 | ||
| 305 | 11 comx12: 27 | ||
| 306 | 12 comx13: 28 | ||
| 307 | 13 comx14: 29 | ||
| 308 | 14 comx15: 30 | ||
| 309 | 15 comx16: 31 | ||
| 310 | |||
| 311 | // The number of events handled by the driver during an interrupt cycle: | ||
| 312 | |||
| 313 | Interrupt work histogram: | ||
| 314 | hist[ 0]: 0 hist[ 1]: 2 hist[ 2]: 18574 hist[ 3]: 79 | ||
| 315 | hist[ 4]: 14 hist[ 5]: 1 hist[ 6]: 0 hist[ 7]: 1 | ||
| 316 | hist[ 8]: 0 hist[ 9]: 7 | ||
| 317 | |||
| 318 | // The number of packets to send in the Tx ring, when a new one arrived: | ||
| 319 | |||
| 320 | Tx ring histogram: | ||
| 321 | hist[ 0]: 2329 hist[ 1]: 0 hist[ 2]: 0 hist[ 3]: 0 | ||
| 322 | |||
| 323 | // The error counters of the E1 interface, according to the RFC2495, | ||
| 324 | // (similar to the Cisco "show controllers e1" command's output: | ||
| 325 | // http://www.cisco.com/univercd/cc/td/doc/product/software/ios11/rbook/rinterfc.htm#xtocid25669126) | ||
| 326 | |||
| 327 | Data in current interval (91 seconds elapsed): | ||
| 328 | 9516 Line Code Violations, 65 Path Code Violations, 2 E-Bit Errors | ||
| 329 | 0 Slip Secs, 2 Fr Loss Secs, 2 Line Err Secs, 0 Degraded Mins | ||
| 330 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 11 Unavail Secs | ||
| 331 | Data in Interval 1 (15 minutes): | ||
| 332 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 333 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 334 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 335 | Data in last 4 intervals (1 hour): | ||
| 336 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 337 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 338 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 339 | Data in last 96 intervals (24 hours): | ||
| 340 | 0 Line Code Violations, 0 Path Code Violations, 0 E-Bit Errors | ||
| 341 | 0 Slip Secs, 0 Fr Loss Secs, 0 Line Err Secs, 0 Degraded Mins | ||
| 342 | 0 Errored Secs, 0 Bursty Err Secs, 0 Severely Err Secs, 0 Unavail Secs | ||
| 343 | |||
| 344 | ----------------------------------------------------------------- | ||
| 345 | |||
| 346 | Some unique options, (may get into the driver later): | ||
| 347 | Treat them very carefully, these can cause much trouble! | ||
| 348 | |||
| 349 | modified CRC-4, for improved interworking of CRC-4 and non-CRC-4 | ||
| 350 | devices: (see page 107 and g706 Annex B) | ||
| 351 | lbireg[ 0x1b ] |= 0x08 | ||
| 352 | lbireg[ 0x1c ] |= 0xc0 | ||
| 353 | |||
| 354 | - The NMF - 'No Multiframe alignment Found after 400 msec' alarm | ||
| 355 | comes into account. | ||
| 356 | |||
| 357 | FALC - the line driver chip. | ||
| 358 | local loop - I hear my transmission back. | ||
| 359 | remote loop - I echo the remote transmission back. | ||
| 360 | |||
| 361 | Something useful for finding errors: | ||
| 362 | |||
| 363 | - local loop for timeslot 1 in the FALC chip: | ||
| 364 | |||
| 365 | # echo >lbireg 0x1d 0x21 | ||
| 366 | |||
| 367 | - Switching the loop off: | ||
| 368 | |||
| 369 | # echo >lbireg 0x1d 0x00 | ||
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index a96e85397eb7..ac1be25c1e25 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
| @@ -52,6 +52,7 @@ Table of Contents | |||
| 52 | i) Freescale QUICC Engine module (QE) | 52 | i) Freescale QUICC Engine module (QE) |
| 53 | j) CFI or JEDEC memory-mapped NOR flash | 53 | j) CFI or JEDEC memory-mapped NOR flash |
| 54 | k) Global Utilities Block | 54 | k) Global Utilities Block |
| 55 | l) Xilinx IP cores | ||
| 55 | 56 | ||
| 56 | VII - Specifying interrupt information for devices | 57 | VII - Specifying interrupt information for devices |
| 57 | 1) interrupts property | 58 | 1) interrupts property |
| @@ -851,12 +852,18 @@ address which can extend beyond that limit. | |||
| 851 | /cpus/PowerPC,970FX@0 | 852 | /cpus/PowerPC,970FX@0 |
| 852 | /cpus/PowerPC,970FX@1 | 853 | /cpus/PowerPC,970FX@1 |
| 853 | (unit addresses do not require leading zeroes) | 854 | (unit addresses do not require leading zeroes) |
| 854 | - d-cache-line-size : one cell, L1 data cache line size in bytes | 855 | - d-cache-block-size : one cell, L1 data cache block size in bytes (*) |
| 855 | - i-cache-line-size : one cell, L1 instruction cache line size in | 856 | - i-cache-block-size : one cell, L1 instruction cache block size in |
| 856 | bytes | 857 | bytes |
| 857 | - d-cache-size : one cell, size of L1 data cache in bytes | 858 | - d-cache-size : one cell, size of L1 data cache in bytes |
| 858 | - i-cache-size : one cell, size of L1 instruction cache in bytes | 859 | - i-cache-size : one cell, size of L1 instruction cache in bytes |
| 859 | 860 | ||
| 861 | (*) The cache "block" size is the size on which the cache management | ||
| 862 | instructions operate. Historically, this document used the cache | ||
| 863 | "line" size here which is incorrect. The kernel will prefer the cache | ||
| 864 | block size and will fallback to cache line size for backward | ||
| 865 | compatibility. | ||
| 866 | |||
| 860 | Recommended properties: | 867 | Recommended properties: |
| 861 | 868 | ||
| 862 | - timebase-frequency : a cell indicating the frequency of the | 869 | - timebase-frequency : a cell indicating the frequency of the |
| @@ -870,6 +877,10 @@ address which can extend beyond that limit. | |||
| 870 | for the above, the common code doesn't use that property, but | 877 | for the above, the common code doesn't use that property, but |
| 871 | you are welcome to re-use the pSeries or Maple one. A future | 878 | you are welcome to re-use the pSeries or Maple one. A future |
| 872 | kernel version might provide a common function for this. | 879 | kernel version might provide a common function for this. |
| 880 | - d-cache-line-size : one cell, L1 data cache line size in bytes | ||
| 881 | if different from the block size | ||
| 882 | - i-cache-line-size : one cell, L1 instruction cache line size in | ||
| 883 | bytes if different from the block size | ||
| 873 | 884 | ||
| 874 | You are welcome to add any property you find relevant to your board, | 885 | You are welcome to add any property you find relevant to your board, |
| 875 | like some information about the mechanism used to soft-reset the | 886 | like some information about the mechanism used to soft-reset the |
| @@ -2242,6 +2253,266 @@ platforms are moved over to use the flattened-device-tree model. | |||
| 2242 | available. | 2253 | available. |
| 2243 | For Axon: 0x0000012a | 2254 | For Axon: 0x0000012a |
| 2244 | 2255 | ||
| 2256 | l) Xilinx IP cores | ||
| 2257 | |||
| 2258 | The Xilinx EDK toolchain ships with a set of IP cores (devices) for use | ||
| 2259 | in Xilinx Spartan and Virtex FPGAs. The devices cover the whole range | ||
| 2260 | of standard device types (network, serial, etc.) and miscellanious | ||
| 2261 | devices (gpio, LCD, spi, etc). Also, since these devices are | ||
| 2262 | implemented within the fpga fabric every instance of the device can be | ||
| 2263 | synthesised with different options that change the behaviour. | ||
| 2264 | |||
| 2265 | Each IP-core has a set of parameters which the FPGA designer can use to | ||
| 2266 | control how the core is synthesized. Historically, the EDK tool would | ||
| 2267 | extract the device parameters relevant to device drivers and copy them | ||
| 2268 | into an 'xparameters.h' in the form of #define symbols. This tells the | ||
| 2269 | device drivers how the IP cores are configured, but it requres the kernel | ||
| 2270 | to be recompiled every time the FPGA bitstream is resynthesized. | ||
| 2271 | |||
| 2272 | The new approach is to export the parameters into the device tree and | ||
| 2273 | generate a new device tree each time the FPGA bitstream changes. The | ||
| 2274 | parameters which used to be exported as #defines will now become | ||
| 2275 | properties of the device node. In general, device nodes for IP-cores | ||
| 2276 | will take the following form: | ||
| 2277 | |||
| 2278 | (name)@(base-address) { | ||
| 2279 | compatible = "xlnx,(ip-core-name)-(HW_VER)" | ||
| 2280 | [, (list of compatible devices), ...]; | ||
| 2281 | reg = <(baseaddr) (size)>; | ||
| 2282 | interrupt-parent = <&interrupt-controller-phandle>; | ||
| 2283 | interrupts = < ... >; | ||
| 2284 | xlnx,(parameter1) = "(string-value)"; | ||
| 2285 | xlnx,(parameter2) = <(int-value)>; | ||
| 2286 | }; | ||
| 2287 | |||
| 2288 | (ip-core-name): the name of the ip block (given after the BEGIN | ||
| 2289 | directive in system.mhs). Should be in lowercase | ||
| 2290 | and all underscores '_' converted to dashes '-'. | ||
| 2291 | (name): is derived from the "PARAMETER INSTANCE" value. | ||
| 2292 | (parameter#): C_* parameters from system.mhs. The C_ prefix is | ||
| 2293 | dropped from the parameter name, the name is converted | ||
| 2294 | to lowercase and all underscore '_' characters are | ||
| 2295 | converted to dashes '-'. | ||
| 2296 | (baseaddr): the C_BASEADDR parameter. | ||
| 2297 | (HW_VER): from the HW_VER parameter. | ||
| 2298 | (size): equals C_HIGHADDR - C_BASEADDR + 1 | ||
| 2299 | |||
| 2300 | Typically, the compatible list will include the exact IP core version | ||
| 2301 | followed by an older IP core version which implements the same | ||
| 2302 | interface or any other device with the same interface. | ||
| 2303 | |||
| 2304 | 'reg', 'interrupt-parent' and 'interrupts' are all optional properties. | ||
| 2305 | |||
| 2306 | For example, the following block from system.mhs: | ||
| 2307 | |||
| 2308 | BEGIN opb_uartlite | ||
| 2309 | PARAMETER INSTANCE = opb_uartlite_0 | ||
| 2310 | PARAMETER HW_VER = 1.00.b | ||
| 2311 | PARAMETER C_BAUDRATE = 115200 | ||
| 2312 | PARAMETER C_DATA_BITS = 8 | ||
| 2313 | PARAMETER C_ODD_PARITY = 0 | ||
| 2314 | PARAMETER C_USE_PARITY = 0 | ||
| 2315 | PARAMETER C_CLK_FREQ = 50000000 | ||
| 2316 | PARAMETER C_BASEADDR = 0xEC100000 | ||
| 2317 | PARAMETER C_HIGHADDR = 0xEC10FFFF | ||
| 2318 | BUS_INTERFACE SOPB = opb_7 | ||
| 2319 | PORT OPB_Clk = CLK_50MHz | ||
| 2320 | PORT Interrupt = opb_uartlite_0_Interrupt | ||
| 2321 | PORT RX = opb_uartlite_0_RX | ||
| 2322 | PORT TX = opb_uartlite_0_TX | ||
| 2323 | PORT OPB_Rst = sys_bus_reset_0 | ||
| 2324 | END | ||
| 2325 | |||
| 2326 | becomes the following device tree node: | ||
| 2327 | |||
| 2328 | opb-uartlite-0@ec100000 { | ||
| 2329 | device_type = "serial"; | ||
| 2330 | compatible = "xlnx,opb-uartlite-1.00.b"; | ||
| 2331 | reg = <ec100000 10000>; | ||
| 2332 | interrupt-parent = <&opb-intc>; | ||
| 2333 | interrupts = <1 0>; // got this from the opb_intc parameters | ||
| 2334 | current-speed = <d#115200>; // standard serial device prop | ||
| 2335 | clock-frequency = <d#50000000>; // standard serial device prop | ||
| 2336 | xlnx,data-bits = <8>; | ||
| 2337 | xlnx,odd-parity = <0>; | ||
| 2338 | xlnx,use-parity = <0>; | ||
| 2339 | }; | ||
| 2340 | |||
| 2341 | Some IP cores actually implement 2 or more logical devices. In this case, | ||
| 2342 | the device should still describe the whole IP core with a single node | ||
| 2343 | and add a child node for each logical device. The ranges property can | ||
| 2344 | be used to translate from parent IP-core to the registers of each device. | ||
| 2345 | (Note: this makes the assumption that both logical devices have the same | ||
| 2346 | bus binding. If this is not true, then separate nodes should be used for | ||
| 2347 | each logical device). The 'cell-index' property can be used to enumerate | ||
| 2348 | logical devices within an IP core. For example, the following is the | ||
| 2349 | system.mhs entry for the dual ps2 controller found on the ml403 reference | ||
| 2350 | design. | ||
| 2351 | |||
| 2352 | BEGIN opb_ps2_dual_ref | ||
| 2353 | PARAMETER INSTANCE = opb_ps2_dual_ref_0 | ||
| 2354 | PARAMETER HW_VER = 1.00.a | ||
| 2355 | PARAMETER C_BASEADDR = 0xA9000000 | ||
| 2356 | PARAMETER C_HIGHADDR = 0xA9001FFF | ||
| 2357 | BUS_INTERFACE SOPB = opb_v20_0 | ||
| 2358 | PORT Sys_Intr1 = ps2_1_intr | ||
| 2359 | PORT Sys_Intr2 = ps2_2_intr | ||
| 2360 | PORT Clkin1 = ps2_clk_rx_1 | ||
| 2361 | PORT Clkin2 = ps2_clk_rx_2 | ||
| 2362 | PORT Clkpd1 = ps2_clk_tx_1 | ||
| 2363 | PORT Clkpd2 = ps2_clk_tx_2 | ||
| 2364 | PORT Rx1 = ps2_d_rx_1 | ||
| 2365 | PORT Rx2 = ps2_d_rx_2 | ||
| 2366 | PORT Txpd1 = ps2_d_tx_1 | ||
| 2367 | PORT Txpd2 = ps2_d_tx_2 | ||
| 2368 | END | ||
| 2369 | |||
| 2370 | It would result in the following device tree nodes: | ||
| 2371 | |||
| 2372 | opb_ps2_dual_ref_0@a9000000 { | ||
| 2373 | ranges = <0 a9000000 2000>; | ||
| 2374 | // If this device had extra parameters, then they would | ||
| 2375 | // go here. | ||
| 2376 | ps2@0 { | ||
| 2377 | compatible = "xlnx,opb-ps2-dual-ref-1.00.a"; | ||
| 2378 | reg = <0 40>; | ||
| 2379 | interrupt-parent = <&opb-intc>; | ||
| 2380 | interrupts = <3 0>; | ||
| 2381 | cell-index = <0>; | ||
| 2382 | }; | ||
| 2383 | ps2@1000 { | ||
| 2384 | compatible = "xlnx,opb-ps2-dual-ref-1.00.a"; | ||
| 2385 | reg = <1000 40>; | ||
| 2386 | interrupt-parent = <&opb-intc>; | ||
| 2387 | interrupts = <3 0>; | ||
| 2388 | cell-index = <0>; | ||
| 2389 | }; | ||
| 2390 | }; | ||
| 2391 | |||
| 2392 | Also, the system.mhs file defines bus attachments from the processor | ||
| 2393 | to the devices. The device tree structure should reflect the bus | ||
| 2394 | attachments. Again an example; this system.mhs fragment: | ||
| 2395 | |||
| 2396 | BEGIN ppc405_virtex4 | ||
| 2397 | PARAMETER INSTANCE = ppc405_0 | ||
| 2398 | PARAMETER HW_VER = 1.01.a | ||
| 2399 | BUS_INTERFACE DPLB = plb_v34_0 | ||
| 2400 | BUS_INTERFACE IPLB = plb_v34_0 | ||
| 2401 | END | ||
| 2402 | |||
| 2403 | BEGIN opb_intc | ||
| 2404 | PARAMETER INSTANCE = opb_intc_0 | ||
| 2405 | PARAMETER HW_VER = 1.00.c | ||
| 2406 | PARAMETER C_BASEADDR = 0xD1000FC0 | ||
| 2407 | PARAMETER C_HIGHADDR = 0xD1000FDF | ||
| 2408 | BUS_INTERFACE SOPB = opb_v20_0 | ||
| 2409 | END | ||
| 2410 | |||
| 2411 | BEGIN opb_uart16550 | ||
| 2412 | PARAMETER INSTANCE = opb_uart16550_0 | ||
| 2413 | PARAMETER HW_VER = 1.00.d | ||
| 2414 | PARAMETER C_BASEADDR = 0xa0000000 | ||
| 2415 | PARAMETER C_HIGHADDR = 0xa0001FFF | ||
| 2416 | BUS_INTERFACE SOPB = opb_v20_0 | ||
| 2417 | END | ||
| 2418 | |||
| 2419 | BEGIN plb_v34 | ||
| 2420 | PARAMETER INSTANCE = plb_v34_0 | ||
| 2421 | PARAMETER HW_VER = 1.02.a | ||
| 2422 | END | ||
| 2423 | |||
| 2424 | BEGIN plb_bram_if_cntlr | ||
| 2425 | PARAMETER INSTANCE = plb_bram_if_cntlr_0 | ||
| 2426 | PARAMETER HW_VER = 1.00.b | ||
| 2427 | PARAMETER C_BASEADDR = 0xFFFF0000 | ||
| 2428 | PARAMETER C_HIGHADDR = 0xFFFFFFFF | ||
| 2429 | BUS_INTERFACE SPLB = plb_v34_0 | ||
| 2430 | END | ||
| 2431 | |||
| 2432 | BEGIN plb2opb_bridge | ||
| 2433 | PARAMETER INSTANCE = plb2opb_bridge_0 | ||
| 2434 | PARAMETER HW_VER = 1.01.a | ||
| 2435 | PARAMETER C_RNG0_BASEADDR = 0x20000000 | ||
| 2436 | PARAMETER C_RNG0_HIGHADDR = 0x3FFFFFFF | ||
| 2437 | PARAMETER C_RNG1_BASEADDR = 0x60000000 | ||
| 2438 | PARAMETER C_RNG1_HIGHADDR = 0x7FFFFFFF | ||
| 2439 | PARAMETER C_RNG2_BASEADDR = 0x80000000 | ||
| 2440 | PARAMETER C_RNG2_HIGHADDR = 0xBFFFFFFF | ||
| 2441 | PARAMETER C_RNG3_BASEADDR = 0xC0000000 | ||
| 2442 | PARAMETER C_RNG3_HIGHADDR = 0xDFFFFFFF | ||
| 2443 | BUS_INTERFACE SPLB = plb_v34_0 | ||
| 2444 | BUS_INTERFACE MOPB = opb_v20_0 | ||
| 2445 | END | ||
| 2446 | |||
| 2447 | Gives this device tree (some properties removed for clarity): | ||
| 2448 | |||
| 2449 | plb-v34-0 { | ||
| 2450 | #address-cells = <1>; | ||
| 2451 | #size-cells = <1>; | ||
| 2452 | device_type = "ibm,plb"; | ||
| 2453 | ranges; // 1:1 translation | ||
| 2454 | |||
| 2455 | plb-bram-if-cntrl-0@ffff0000 { | ||
| 2456 | reg = <ffff0000 10000>; | ||
| 2457 | } | ||
| 2458 | |||
| 2459 | opb-v20-0 { | ||
| 2460 | #address-cells = <1>; | ||
| 2461 | #size-cells = <1>; | ||
| 2462 | ranges = <20000000 20000000 20000000 | ||
| 2463 | 60000000 60000000 20000000 | ||
| 2464 | 80000000 80000000 40000000 | ||
| 2465 | c0000000 c0000000 20000000>; | ||
| 2466 | |||
| 2467 | opb-uart16550-0@a0000000 { | ||
| 2468 | reg = <a00000000 2000>; | ||
| 2469 | }; | ||
| 2470 | |||
| 2471 | opb-intc-0@d1000fc0 { | ||
| 2472 | reg = <d1000fc0 20>; | ||
| 2473 | }; | ||
| 2474 | }; | ||
| 2475 | }; | ||
| 2476 | |||
| 2477 | That covers the general approach to binding xilinx IP cores into the | ||
| 2478 | device tree. The following are bindings for specific devices: | ||
| 2479 | |||
| 2480 | i) Xilinx ML300 Framebuffer | ||
| 2481 | |||
| 2482 | Simple framebuffer device from the ML300 reference design (also on the | ||
| 2483 | ML403 reference design as well as others). | ||
| 2484 | |||
| 2485 | Optional properties: | ||
| 2486 | - resolution = <xres yres> : pixel resolution of framebuffer. Some | ||
| 2487 | implementations use a different resolution. | ||
| 2488 | Default is <d#640 d#480> | ||
| 2489 | - virt-resolution = <xvirt yvirt> : Size of framebuffer in memory. | ||
| 2490 | Default is <d#1024 d#480>. | ||
| 2491 | - rotate-display (empty) : rotate display 180 degrees. | ||
| 2492 | |||
| 2493 | ii) Xilinx SystemACE | ||
| 2494 | |||
| 2495 | The Xilinx SystemACE device is used to program FPGAs from an FPGA | ||
| 2496 | bitstream stored on a CF card. It can also be used as a generic CF | ||
| 2497 | interface device. | ||
| 2498 | |||
| 2499 | Optional properties: | ||
| 2500 | - 8-bit (empty) : Set this property for SystemACE in 8 bit mode | ||
| 2501 | |||
| 2502 | iii) Xilinx EMAC and Xilinx TEMAC | ||
| 2503 | |||
| 2504 | Xilinx Ethernet devices. In addition to general xilinx properties | ||
| 2505 | listed above, nodes for these devices should include a phy-handle | ||
| 2506 | property, and may include other common network device properties | ||
| 2507 | like local-mac-address. | ||
| 2508 | |||
| 2509 | iv) Xilinx Uartlite | ||
| 2510 | |||
| 2511 | Xilinx uartlite devices are simple fixed speed serial ports. | ||
| 2512 | |||
| 2513 | Requred properties: | ||
| 2514 | - current-speed : Baud rate of uartlite | ||
| 2515 | |||
| 2245 | More devices will be defined as this spec matures. | 2516 | More devices will be defined as this spec matures. |
| 2246 | 2517 | ||
| 2247 | VII - Specifying interrupt information for devices | 2518 | VII - Specifying interrupt information for devices |
diff --git a/MAINTAINERS b/MAINTAINERS index 1c7c229a0926..cad0882754a6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -787,23 +787,25 @@ B43 WIRELESS DRIVER | |||
| 787 | P: Michael Buesch | 787 | P: Michael Buesch |
| 788 | M: mb@bu3sch.de | 788 | M: mb@bu3sch.de |
| 789 | P: Stefano Brivio | 789 | P: Stefano Brivio |
| 790 | M: st3@riseup.net | 790 | M: stefano.brivio@polimi.it |
| 791 | L: linux-wireless@vger.kernel.org | 791 | L: linux-wireless@vger.kernel.org |
| 792 | W: http://bcm43xx.berlios.de/ | 792 | W: http://linuxwireless.org/en/users/Drivers/b43 |
| 793 | S: Maintained | 793 | S: Maintained |
| 794 | 794 | ||
| 795 | B43LEGACY WIRELESS DRIVER | 795 | B43LEGACY WIRELESS DRIVER |
| 796 | P: Larry Finger | 796 | P: Larry Finger |
| 797 | M: Larry.Finger@lwfinger.net | 797 | M: Larry.Finger@lwfinger.net |
| 798 | P: Stefano Brivio | ||
| 799 | M: stefano.brivio@polimi.it | ||
| 798 | L: linux-wireless@vger.kernel.org | 800 | L: linux-wireless@vger.kernel.org |
| 799 | W: http://bcm43xx.berlios.de/ | 801 | W: http://linuxwireless.org/en/users/Drivers/b43 |
| 800 | S: Maintained | 802 | S: Maintained |
| 801 | 803 | ||
| 802 | BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION) | 804 | BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION) |
| 803 | P: Larry Finger | 805 | P: Larry Finger |
| 804 | M: Larry.Finger@lwfinger.net | 806 | M: Larry.Finger@lwfinger.net |
| 805 | P: Stefano Brivio | 807 | P: Stefano Brivio |
| 806 | M: st3@riseup.net | 808 | M: stefano.brivio@polimi.it |
| 807 | L: linux-wireless@vger.kernel.org | 809 | L: linux-wireless@vger.kernel.org |
| 808 | W: http://bcm43xx.berlios.de/ | 810 | W: http://bcm43xx.berlios.de/ |
| 809 | S: Maintained | 811 | S: Maintained |
| @@ -3452,15 +3454,10 @@ L: lm-sensors@lm-sensors.org | |||
| 3452 | S: Maintained | 3454 | S: Maintained |
| 3453 | 3455 | ||
| 3454 | SOFTMAC LAYER (IEEE 802.11) | 3456 | SOFTMAC LAYER (IEEE 802.11) |
| 3455 | P: Johannes Berg | ||
| 3456 | M: johannes@sipsolutions.net | ||
| 3457 | P: Joe Jezak | ||
| 3458 | M: josejx@gentoo.org | ||
| 3459 | P: Daniel Drake | 3457 | P: Daniel Drake |
| 3460 | M: dsd@gentoo.org | 3458 | M: dsd@gentoo.org |
| 3461 | W: http://softmac.sipsolutions.net/ | ||
| 3462 | L: linux-wireless@vger.kernel.org | 3459 | L: linux-wireless@vger.kernel.org |
| 3463 | S: Maintained | 3460 | S: Obsolete |
| 3464 | 3461 | ||
| 3465 | SOFTWARE RAID (Multiple Disks) SUPPORT | 3462 | SOFTWARE RAID (Multiple Disks) SUPPORT |
| 3466 | P: Ingo Molnar | 3463 | P: Ingo Molnar |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index a0cdaafa115b..a7e9fea978a6 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -1040,6 +1040,8 @@ source "drivers/power/Kconfig" | |||
| 1040 | 1040 | ||
| 1041 | source "drivers/hwmon/Kconfig" | 1041 | source "drivers/hwmon/Kconfig" |
| 1042 | 1042 | ||
| 1043 | source "drivers/watchdog/Kconfig" | ||
| 1044 | |||
| 1043 | source "drivers/ssb/Kconfig" | 1045 | source "drivers/ssb/Kconfig" |
| 1044 | 1046 | ||
| 1045 | #source "drivers/l3/Kconfig" | 1047 | #source "drivers/l3/Kconfig" |
diff --git a/arch/arm/mach-netx/xc.c b/arch/arm/mach-netx/xc.c index bd5184fe177c..ca9c5b61283a 100644 --- a/arch/arm/mach-netx/xc.c +++ b/arch/arm/mach-netx/xc.c | |||
| @@ -190,15 +190,15 @@ struct xc *request_xc(int xcno, struct device *dev) | |||
| 190 | goto exit; | 190 | goto exit; |
| 191 | 191 | ||
| 192 | if (!request_mem_region | 192 | if (!request_mem_region |
| 193 | (NETX_PA_XPEC(xcno), XPEC_MEM_SIZE, kobject_name(dev->kobj))) | 193 | (NETX_PA_XPEC(xcno), XPEC_MEM_SIZE, kobject_name(&dev->kobj))) |
| 194 | goto exit_free; | 194 | goto exit_free; |
| 195 | 195 | ||
| 196 | if (!request_mem_region | 196 | if (!request_mem_region |
| 197 | (NETX_PA_XMAC(xcno), XMAC_MEM_SIZE, kobject_name(dev->kobj))) | 197 | (NETX_PA_XMAC(xcno), XMAC_MEM_SIZE, kobject_name(&dev->kobj))) |
| 198 | goto exit_release_1; | 198 | goto exit_release_1; |
| 199 | 199 | ||
| 200 | if (!request_mem_region | 200 | if (!request_mem_region |
| 201 | (SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE, kobject_name(dev->kobj))) | 201 | (SRAM_INTERNAL_PHYS(xcno), SRAM_MEM_SIZE, kobject_name(&dev->kobj))) |
| 202 | goto exit_release_2; | 202 | goto exit_release_2; |
| 203 | 203 | ||
| 204 | x->xpec_base = (void * __iomem)io_p2v(NETX_PA_XPEC(xcno)); | 204 | x->xpec_base = (void * __iomem)io_p2v(NETX_PA_XPEC(xcno)); |
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index a2d45d742ce4..fbfa1920353d 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
| @@ -68,6 +68,7 @@ pxa_ost0_interrupt(int irq, void *dev_id) | |||
| 68 | if (c->mode == CLOCK_EVT_MODE_ONESHOT) { | 68 | if (c->mode == CLOCK_EVT_MODE_ONESHOT) { |
| 69 | /* Disarm the compare/match, signal the event. */ | 69 | /* Disarm the compare/match, signal the event. */ |
| 70 | OIER &= ~OIER_E0; | 70 | OIER &= ~OIER_E0; |
| 71 | OSSR = OSSR_M0; | ||
| 71 | c->event_handler(c); | 72 | c->event_handler(c); |
| 72 | } else if (c->mode == CLOCK_EVT_MODE_PERIODIC) { | 73 | } else if (c->mode == CLOCK_EVT_MODE_PERIODIC) { |
| 73 | /* Call the event handler as many times as necessary | 74 | /* Call the event handler as many times as necessary |
| @@ -100,9 +101,9 @@ pxa_ost0_interrupt(int irq, void *dev_id) | |||
| 100 | * anything that might put us "very close". | 101 | * anything that might put us "very close". |
| 101 | */ | 102 | */ |
| 102 | #define MIN_OSCR_DELTA 16 | 103 | #define MIN_OSCR_DELTA 16 |
| 103 | do { | 104 | do { |
| 104 | OSSR = OSSR_M0; | 105 | OSSR = OSSR_M0; |
| 105 | next_match = (OSMR0 += LATCH); | 106 | next_match = (OSMR0 += LATCH); |
| 106 | c->event_handler(c); | 107 | c->event_handler(c); |
| 107 | } while (((signed long)(next_match - OSCR) <= MIN_OSCR_DELTA) | 108 | } while (((signed long)(next_match - OSCR) <= MIN_OSCR_DELTA) |
| 108 | && (c->mode == CLOCK_EVT_MODE_PERIODIC)); | 109 | && (c->mode == CLOCK_EVT_MODE_PERIODIC)); |
| @@ -114,14 +115,16 @@ pxa_ost0_interrupt(int irq, void *dev_id) | |||
| 114 | static int | 115 | static int |
| 115 | pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) | 116 | pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) |
| 116 | { | 117 | { |
| 117 | unsigned long irqflags; | 118 | unsigned long flags, next, oscr; |
| 118 | 119 | ||
| 119 | raw_local_irq_save(irqflags); | 120 | raw_local_irq_save(flags); |
| 120 | OSMR0 = OSCR + delta; | ||
| 121 | OSSR = OSSR_M0; | ||
| 122 | OIER |= OIER_E0; | 121 | OIER |= OIER_E0; |
| 123 | raw_local_irq_restore(irqflags); | 122 | next = OSCR + delta; |
| 124 | return 0; | 123 | OSMR0 = next; |
| 124 | oscr = OSCR; | ||
| 125 | raw_local_irq_restore(flags); | ||
| 126 | |||
| 127 | return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; | ||
| 125 | } | 128 | } |
| 126 | 129 | ||
| 127 | static void | 130 | static void |
| @@ -132,15 +135,16 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
| 132 | switch (mode) { | 135 | switch (mode) { |
| 133 | case CLOCK_EVT_MODE_PERIODIC: | 136 | case CLOCK_EVT_MODE_PERIODIC: |
| 134 | raw_local_irq_save(irqflags); | 137 | raw_local_irq_save(irqflags); |
| 135 | OSMR0 = OSCR + LATCH; | ||
| 136 | OSSR = OSSR_M0; | 138 | OSSR = OSSR_M0; |
| 137 | OIER |= OIER_E0; | 139 | OIER |= OIER_E0; |
| 140 | OSMR0 = OSCR + LATCH; | ||
| 138 | raw_local_irq_restore(irqflags); | 141 | raw_local_irq_restore(irqflags); |
| 139 | break; | 142 | break; |
| 140 | 143 | ||
| 141 | case CLOCK_EVT_MODE_ONESHOT: | 144 | case CLOCK_EVT_MODE_ONESHOT: |
| 142 | raw_local_irq_save(irqflags); | 145 | raw_local_irq_save(irqflags); |
| 143 | OIER &= ~OIER_E0; | 146 | OIER &= ~OIER_E0; |
| 147 | OSSR = OSSR_M0; | ||
| 144 | raw_local_irq_restore(irqflags); | 148 | raw_local_irq_restore(irqflags); |
| 145 | break; | 149 | break; |
| 146 | 150 | ||
| @@ -149,6 +153,7 @@ pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) | |||
| 149 | /* initializing, released, or preparing for suspend */ | 153 | /* initializing, released, or preparing for suspend */ |
| 150 | raw_local_irq_save(irqflags); | 154 | raw_local_irq_save(irqflags); |
| 151 | OIER &= ~OIER_E0; | 155 | OIER &= ~OIER_E0; |
| 156 | OSSR = OSSR_M0; | ||
| 152 | raw_local_irq_restore(irqflags); | 157 | raw_local_irq_restore(irqflags); |
| 153 | break; | 158 | break; |
| 154 | 159 | ||
diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index 4493bcff5172..ee40c1a0b83d 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c | |||
| @@ -171,7 +171,7 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg, | |||
| 171 | * Called from map_io. We need to call to this early enough so that we | 171 | * Called from map_io. We need to call to this early enough so that we |
| 172 | * can reserve the fixed SDRAM regions before VM could get hold of them. | 172 | * can reserve the fixed SDRAM regions before VM could get hold of them. |
| 173 | */ | 173 | */ |
| 174 | void omapfb_reserve_sdram(void) | 174 | void __init omapfb_reserve_sdram(void) |
| 175 | { | 175 | { |
| 176 | struct bootmem_data *bdata; | 176 | struct bootmem_data *bdata; |
| 177 | unsigned long sdram_start, sdram_size; | 177 | unsigned long sdram_start, sdram_size; |
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c index 4103c2c487f3..b841ecfd5d5a 100644 --- a/arch/frv/mm/init.c +++ b/arch/frv/mm/init.c | |||
| @@ -197,7 +197,7 @@ void __init mem_init(void) | |||
| 197 | /* | 197 | /* |
| 198 | * free the memory that was only required for initialisation | 198 | * free the memory that was only required for initialisation |
| 199 | */ | 199 | */ |
| 200 | void __init free_initmem(void) | 200 | void free_initmem(void) |
| 201 | { | 201 | { |
| 202 | #if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL) | 202 | #if defined(CONFIG_RAMKERNEL) && !defined(CONFIG_PROTECT_KERNEL) |
| 203 | unsigned long start, end, addr; | 203 | unsigned long start, end, addr; |
diff --git a/arch/ia64/hp/sim/boot/fw-emu.c b/arch/ia64/hp/sim/boot/fw-emu.c index 1189d035d316..bf6d9d8c802f 100644 --- a/arch/ia64/hp/sim/boot/fw-emu.c +++ b/arch/ia64/hp/sim/boot/fw-emu.c | |||
| @@ -285,7 +285,7 @@ sys_fw_init (const char *args, int arglen) | |||
| 285 | } | 285 | } |
| 286 | cmd_line[arglen] = '\0'; | 286 | cmd_line[arglen] = '\0'; |
| 287 | 287 | ||
| 288 | memset(efi_systab, 0, sizeof(efi_systab)); | 288 | memset(efi_systab, 0, sizeof(*efi_systab)); |
| 289 | efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE; | 289 | efi_systab->hdr.signature = EFI_SYSTEM_TABLE_SIGNATURE; |
| 290 | efi_systab->hdr.revision = ((1 << 16) | 00); | 290 | efi_systab->hdr.revision = ((1 << 16) | 00); |
| 291 | efi_systab->hdr.headersize = sizeof(efi_systab->hdr); | 291 | efi_systab->hdr.headersize = sizeof(efi_systab->hdr); |
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h index 466bbcb138b2..c5c872b250da 100644 --- a/arch/ia64/ia32/ia32priv.h +++ b/arch/ia64/ia32/ia32priv.h | |||
| @@ -290,7 +290,6 @@ struct old_linux32_dirent { | |||
| 290 | #define _ASM_IA64_ELF_H /* Don't include elf.h */ | 290 | #define _ASM_IA64_ELF_H /* Don't include elf.h */ |
| 291 | 291 | ||
| 292 | #include <linux/sched.h> | 292 | #include <linux/sched.h> |
| 293 | #include <asm/processor.h> | ||
| 294 | 293 | ||
| 295 | /* | 294 | /* |
| 296 | * This is used to ensure we don't load something for the wrong architecture. | 295 | * This is used to ensure we don't load something for the wrong architecture. |
diff --git a/arch/ia64/kernel/.gitignore b/arch/ia64/kernel/.gitignore new file mode 100644 index 000000000000..98307759a3b8 --- /dev/null +++ b/arch/ia64/kernel/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| gate.lds | |||
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 3d45d24a9d61..897e2083a3b1 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
| @@ -678,9 +678,11 @@ int __init acpi_boot_init(void) | |||
| 678 | /* I/O APIC */ | 678 | /* I/O APIC */ |
| 679 | 679 | ||
| 680 | if (acpi_table_parse_madt | 680 | if (acpi_table_parse_madt |
| 681 | (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) | 681 | (ACPI_MADT_TYPE_IO_SAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1) { |
| 682 | printk(KERN_ERR PREFIX | 682 | if (!ia64_platform_is("sn2")) |
| 683 | "Error parsing MADT - no IOSAPIC entries\n"); | 683 | printk(KERN_ERR PREFIX |
| 684 | "Error parsing MADT - no IOSAPIC entries\n"); | ||
| 685 | } | ||
| 684 | 686 | ||
| 685 | /* System-Level Interrupt Routing */ | 687 | /* System-Level Interrupt Routing */ |
| 686 | 688 | ||
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 6216eba2e38f..5181bf551f3c 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
| @@ -218,9 +218,10 @@ efi_gettimeofday (struct timespec *ts) | |||
| 218 | { | 218 | { |
| 219 | efi_time_t tm; | 219 | efi_time_t tm; |
| 220 | 220 | ||
| 221 | memset(ts, 0, sizeof(ts)); | 221 | if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) { |
| 222 | if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) | 222 | memset(ts, 0, sizeof(*ts)); |
| 223 | return; | 223 | return; |
| 224 | } | ||
| 224 | 225 | ||
| 225 | ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second); | 226 | ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second); |
| 226 | ts->tv_nsec = tm.nanosecond; | 227 | ts->tv_nsec = tm.nanosecond; |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index cfe4654838f4..274a59383043 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
| @@ -748,6 +748,15 @@ skip_numa_setup: | |||
| 748 | #endif | 748 | #endif |
| 749 | } | 749 | } |
| 750 | 750 | ||
| 751 | static inline unsigned char choose_dmode(void) | ||
| 752 | { | ||
| 753 | #ifdef CONFIG_SMP | ||
| 754 | if (smp_int_redirect & SMP_IRQ_REDIRECTION) | ||
| 755 | return IOSAPIC_LOWEST_PRIORITY; | ||
| 756 | #endif | ||
| 757 | return IOSAPIC_FIXED; | ||
| 758 | } | ||
| 759 | |||
| 751 | /* | 760 | /* |
| 752 | * ACPI can describe IOSAPIC interrupts via static tables and namespace | 761 | * ACPI can describe IOSAPIC interrupts via static tables and namespace |
| 753 | * methods. This provides an interface to register those interrupts and | 762 | * methods. This provides an interface to register those interrupts and |
| @@ -762,6 +771,7 @@ iosapic_register_intr (unsigned int gsi, | |||
| 762 | unsigned long flags; | 771 | unsigned long flags; |
| 763 | struct iosapic_rte_info *rte; | 772 | struct iosapic_rte_info *rte; |
| 764 | u32 low32; | 773 | u32 low32; |
| 774 | unsigned char dmode; | ||
| 765 | 775 | ||
| 766 | /* | 776 | /* |
| 767 | * If this GSI has already been registered (i.e., it's a | 777 | * If this GSI has already been registered (i.e., it's a |
| @@ -791,8 +801,8 @@ iosapic_register_intr (unsigned int gsi, | |||
| 791 | 801 | ||
| 792 | spin_lock(&irq_desc[irq].lock); | 802 | spin_lock(&irq_desc[irq].lock); |
| 793 | dest = get_target_cpu(gsi, irq); | 803 | dest = get_target_cpu(gsi, irq); |
| 794 | err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY, | 804 | dmode = choose_dmode(); |
| 795 | polarity, trigger); | 805 | err = register_intr(gsi, irq, dmode, polarity, trigger); |
| 796 | if (err < 0) { | 806 | if (err < 0) { |
| 797 | spin_unlock(&irq_desc[irq].lock); | 807 | spin_unlock(&irq_desc[irq].lock); |
| 798 | irq = err; | 808 | irq = err; |
| @@ -961,10 +971,12 @@ iosapic_override_isa_irq (unsigned int isa_irq, unsigned int gsi, | |||
| 961 | { | 971 | { |
| 962 | int vector, irq; | 972 | int vector, irq; |
| 963 | unsigned int dest = cpu_physical_id(smp_processor_id()); | 973 | unsigned int dest = cpu_physical_id(smp_processor_id()); |
| 974 | unsigned char dmode; | ||
| 964 | 975 | ||
| 965 | irq = vector = isa_irq_to_vector(isa_irq); | 976 | irq = vector = isa_irq_to_vector(isa_irq); |
| 966 | BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); | 977 | BUG_ON(bind_irq_vector(irq, vector, CPU_MASK_ALL)); |
| 967 | register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY, polarity, trigger); | 978 | dmode = choose_dmode(); |
| 979 | register_intr(gsi, irq, dmode, polarity, trigger); | ||
| 968 | 980 | ||
| 969 | DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n", | 981 | DBG("ISA: IRQ %u -> GSI %u (%s,%s) -> CPU %d (0x%04x) vector %d\n", |
| 970 | isa_irq, gsi, trigger == IOSAPIC_EDGE ? "edge" : "level", | 982 | isa_irq, gsi, trigger == IOSAPIC_EDGE ? "edge" : "level", |
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index 44be1c952b7c..6dee579f205f 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c | |||
| @@ -61,9 +61,11 @@ int show_interrupts(struct seq_file *p, void *v) | |||
| 61 | unsigned long flags; | 61 | unsigned long flags; |
| 62 | 62 | ||
| 63 | if (i == 0) { | 63 | if (i == 0) { |
| 64 | seq_printf(p, " "); | 64 | char cpuname[16]; |
| 65 | seq_printf(p, " "); | ||
| 65 | for_each_online_cpu(j) { | 66 | for_each_online_cpu(j) { |
| 66 | seq_printf(p, "CPU%d ",j); | 67 | snprintf(cpuname, 10, "CPU%d", j); |
| 68 | seq_printf(p, "%10s ", cpuname); | ||
| 67 | } | 69 | } |
| 68 | seq_putc(p, '\n'); | 70 | seq_putc(p, '\n'); |
| 69 | } | 71 | } |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index cc87025e8f54..10b48cd15a87 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
| @@ -571,7 +571,7 @@ out: | |||
| 571 | * Outputs | 571 | * Outputs |
| 572 | * None | 572 | * None |
| 573 | */ | 573 | */ |
| 574 | static void __init | 574 | void |
| 575 | ia64_mca_register_cpev (int cpev) | 575 | ia64_mca_register_cpev (int cpev) |
| 576 | { | 576 | { |
| 577 | /* Register the CPE interrupt vector with SAL */ | 577 | /* Register the CPE interrupt vector with SAL */ |
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 6ef6ffb943a0..396004e8cd14 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
| @@ -470,7 +470,7 @@ register_info(char *page) | |||
| 470 | return p - page; | 470 | return p - page; |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | static const char *proc_features[]={ | 473 | static char *proc_features_0[]={ /* Feature set 0 */ |
| 474 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, | 474 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, |
| 475 | NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL, | 475 | NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL, |
| 476 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, | 476 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, |
| @@ -502,25 +502,92 @@ static const char *proc_features[]={ | |||
| 502 | "Enable BERR promotion" | 502 | "Enable BERR promotion" |
| 503 | }; | 503 | }; |
| 504 | 504 | ||
| 505 | static char *proc_features_16[]={ /* Feature set 16 */ | ||
| 506 | "Disable ETM", | ||
| 507 | "Enable ETM", | ||
| 508 | "Enable MCA on half-way timer", | ||
| 509 | "Enable snoop WC", | ||
| 510 | NULL, | ||
| 511 | "Enable Fast Deferral", | ||
| 512 | "Disable MCA on memory aliasing", | ||
| 513 | "Enable RSB", | ||
| 514 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 515 | "DP system processor", | ||
| 516 | "Low Voltage", | ||
| 517 | "HT supported", | ||
| 518 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 519 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 520 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 521 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 522 | NULL, NULL, NULL, NULL, NULL | ||
| 523 | }; | ||
| 524 | |||
| 525 | static char **proc_features[]={ | ||
| 526 | proc_features_0, | ||
| 527 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
| 528 | NULL, NULL, NULL, NULL, | ||
| 529 | proc_features_16, | ||
| 530 | NULL, NULL, NULL, NULL, | ||
| 531 | }; | ||
| 532 | |||
| 533 | static char * | ||
| 534 | feature_set_info(char *page, u64 avail, u64 status, u64 control, u64 set) | ||
| 535 | { | ||
| 536 | char *p = page; | ||
| 537 | char **vf, **v; | ||
| 538 | int i; | ||
| 539 | |||
| 540 | vf = v = proc_features[set]; | ||
| 541 | for(i=0; i < 64; i++, avail >>=1, status >>=1, control >>=1) { | ||
| 542 | |||
| 543 | if (!(control)) /* No remaining bits set */ | ||
| 544 | break; | ||
| 545 | if (!(avail & 0x1)) /* Print only bits that are available */ | ||
| 546 | continue; | ||
| 547 | if (vf) | ||
| 548 | v = vf + i; | ||
| 549 | if ( v && *v ) { | ||
| 550 | p += sprintf(p, "%-40s : %s %s\n", *v, | ||
| 551 | avail & 0x1 ? (status & 0x1 ? | ||
| 552 | "On " : "Off"): "", | ||
| 553 | avail & 0x1 ? (control & 0x1 ? | ||
| 554 | "Ctrl" : "NoCtrl"): ""); | ||
| 555 | } else { | ||
| 556 | p += sprintf(p, "Feature set %2ld bit %2d\t\t\t" | ||
| 557 | " : %s %s\n", | ||
| 558 | set, i, | ||
| 559 | avail & 0x1 ? (status & 0x1 ? | ||
| 560 | "On " : "Off"): "", | ||
| 561 | avail & 0x1 ? (control & 0x1 ? | ||
| 562 | "Ctrl" : "NoCtrl"): ""); | ||
| 563 | } | ||
| 564 | } | ||
| 565 | return p; | ||
| 566 | } | ||
| 505 | 567 | ||
| 506 | static int | 568 | static int |
| 507 | processor_info(char *page) | 569 | processor_info(char *page) |
| 508 | { | 570 | { |
| 509 | char *p = page; | 571 | char *p = page; |
| 510 | const char **v = proc_features; | 572 | u64 avail=1, status=1, control=1, feature_set=0; |
| 511 | u64 avail=1, status=1, control=1; | ||
| 512 | int i; | ||
| 513 | s64 ret; | 573 | s64 ret; |
| 514 | 574 | ||
| 515 | if ((ret=ia64_pal_proc_get_features(&avail, &status, &control)) != 0) return 0; | 575 | do { |
| 576 | ret = ia64_pal_proc_get_features(&avail, &status, &control, | ||
| 577 | feature_set); | ||
| 578 | if (ret < 0) { | ||
| 579 | return p - page; | ||
| 580 | } | ||
| 581 | if (ret == 1) { | ||
| 582 | feature_set++; | ||
| 583 | continue; | ||
| 584 | } | ||
| 585 | |||
| 586 | p = feature_set_info(p, avail, status, control, feature_set); | ||
| 587 | |||
| 588 | feature_set++; | ||
| 589 | } while(1); | ||
| 516 | 590 | ||
| 517 | for(i=0; i < 64; i++, v++,avail >>=1, status >>=1, control >>=1) { | ||
| 518 | if ( ! *v ) continue; | ||
| 519 | p += sprintf(p, "%-40s : %s%s %s\n", *v, | ||
| 520 | avail & 0x1 ? "" : "NotImpl", | ||
| 521 | avail & 0x1 ? (status & 0x1 ? "On" : "Off"): "", | ||
| 522 | avail & 0x1 ? (control & 0x1 ? "Ctrl" : "NoCtrl"): ""); | ||
| 523 | } | ||
| 524 | return p - page; | 591 | return p - page; |
| 525 | } | 592 | } |
| 526 | 593 | ||
diff --git a/arch/ia64/kernel/patch.c b/arch/ia64/kernel/patch.c index e796e29f8e15..2cb9425e0421 100644 --- a/arch/ia64/kernel/patch.c +++ b/arch/ia64/kernel/patch.c | |||
| @@ -129,9 +129,6 @@ ia64_patch_mckinley_e9 (unsigned long start, unsigned long end) | |||
| 129 | first_time = 0; | 129 | first_time = 0; |
| 130 | if (need_workaround) | 130 | if (need_workaround) |
| 131 | printk(KERN_INFO "Leaving McKinley Errata 9 workaround enabled\n"); | 131 | printk(KERN_INFO "Leaving McKinley Errata 9 workaround enabled\n"); |
| 132 | else | ||
| 133 | printk(KERN_INFO "McKinley Errata 9 workaround not needed; " | ||
| 134 | "disabling it\n"); | ||
| 135 | } | 132 | } |
| 136 | if (need_workaround) | 133 | if (need_workaround) |
| 137 | return; | 134 | return; |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 59169bf7145f..73e7c2e40b54 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
| @@ -558,7 +558,7 @@ static ctl_table pfm_sysctl_dir[] = { | |||
| 558 | { | 558 | { |
| 559 | .ctl_name = CTL_UNNUMBERED, | 559 | .ctl_name = CTL_UNNUMBERED, |
| 560 | .procname = "perfmon", | 560 | .procname = "perfmon", |
| 561 | .mode = 0755, | 561 | .mode = 0555, |
| 562 | .child = pfm_ctl_table, | 562 | .child = pfm_ctl_table, |
| 563 | }, | 563 | }, |
| 564 | {} | 564 | {} |
| @@ -567,7 +567,7 @@ static ctl_table pfm_sysctl_root[] = { | |||
| 567 | { | 567 | { |
| 568 | .ctl_name = CTL_KERN, | 568 | .ctl_name = CTL_KERN, |
| 569 | .procname = "kernel", | 569 | .procname = "kernel", |
| 570 | .mode = 0755, | 570 | .mode = 0555, |
| 571 | .child = pfm_sysctl_dir, | 571 | .child = pfm_sysctl_dir, |
| 572 | }, | 572 | }, |
| 573 | {} | 573 | {} |
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index d3c538be466c..7e9c275ea148 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
| @@ -146,6 +146,46 @@ find_bootmap_location (unsigned long start, unsigned long end, void *arg) | |||
| 146 | return 0; | 146 | return 0; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | #ifdef CONFIG_SMP | ||
| 150 | static void *cpu_data; | ||
| 151 | /** | ||
| 152 | * per_cpu_init - setup per-cpu variables | ||
| 153 | * | ||
| 154 | * Allocate and setup per-cpu data areas. | ||
| 155 | */ | ||
| 156 | void * __cpuinit | ||
| 157 | per_cpu_init (void) | ||
| 158 | { | ||
| 159 | int cpu; | ||
| 160 | static int first_time=1; | ||
| 161 | |||
| 162 | /* | ||
| 163 | * get_free_pages() cannot be used before cpu_init() done. BSP | ||
| 164 | * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls | ||
| 165 | * get_zeroed_page(). | ||
| 166 | */ | ||
| 167 | if (first_time) { | ||
| 168 | first_time=0; | ||
| 169 | for (cpu = 0; cpu < NR_CPUS; cpu++) { | ||
| 170 | memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); | ||
| 171 | __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start; | ||
| 172 | cpu_data += PERCPU_PAGE_SIZE; | ||
| 173 | per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; | ||
| 174 | } | ||
| 175 | } | ||
| 176 | return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; | ||
| 177 | } | ||
| 178 | |||
| 179 | static inline void | ||
| 180 | alloc_per_cpu_data(void) | ||
| 181 | { | ||
| 182 | cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS, | ||
| 183 | PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); | ||
| 184 | } | ||
| 185 | #else | ||
| 186 | #define alloc_per_cpu_data() do { } while (0) | ||
| 187 | #endif /* CONFIG_SMP */ | ||
| 188 | |||
| 149 | /** | 189 | /** |
| 150 | * find_memory - setup memory map | 190 | * find_memory - setup memory map |
| 151 | * | 191 | * |
| @@ -182,41 +222,9 @@ find_memory (void) | |||
| 182 | 222 | ||
| 183 | find_initrd(); | 223 | find_initrd(); |
| 184 | 224 | ||
| 225 | alloc_per_cpu_data(); | ||
| 185 | } | 226 | } |
| 186 | 227 | ||
| 187 | #ifdef CONFIG_SMP | ||
| 188 | /** | ||
| 189 | * per_cpu_init - setup per-cpu variables | ||
| 190 | * | ||
| 191 | * Allocate and setup per-cpu data areas. | ||
| 192 | */ | ||
| 193 | void * __cpuinit | ||
| 194 | per_cpu_init (void) | ||
| 195 | { | ||
| 196 | void *cpu_data; | ||
| 197 | int cpu; | ||
| 198 | static int first_time=1; | ||
| 199 | |||
| 200 | /* | ||
| 201 | * get_free_pages() cannot be used before cpu_init() done. BSP | ||
| 202 | * allocates "NR_CPUS" pages for all CPUs to avoid that AP calls | ||
| 203 | * get_zeroed_page(). | ||
| 204 | */ | ||
| 205 | if (first_time) { | ||
| 206 | first_time=0; | ||
| 207 | cpu_data = __alloc_bootmem(PERCPU_PAGE_SIZE * NR_CPUS, | ||
| 208 | PERCPU_PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); | ||
| 209 | for (cpu = 0; cpu < NR_CPUS; cpu++) { | ||
| 210 | memcpy(cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); | ||
| 211 | __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start; | ||
| 212 | cpu_data += PERCPU_PAGE_SIZE; | ||
| 213 | per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; | ||
| 214 | } | ||
| 215 | } | ||
| 216 | return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; | ||
| 217 | } | ||
| 218 | #endif /* CONFIG_SMP */ | ||
| 219 | |||
| 220 | static int | 228 | static int |
| 221 | count_pages (u64 start, u64 end, void *arg) | 229 | count_pages (u64 start, u64 end, void *arg) |
| 222 | { | 230 | { |
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 0f9b12683bf3..53351c3cd7b1 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
| 6 | * for more details. | 6 | * for more details. |
| 7 | * | 7 | * |
| 8 | * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. | 8 | * Copyright (c) 2000-2007 Silicon Graphics, Inc. All Rights Reserved. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
| @@ -85,12 +85,18 @@ static void sn_shutdown_irq(unsigned int irq) | |||
| 85 | { | 85 | { |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | extern void ia64_mca_register_cpev(int); | ||
| 89 | |||
| 88 | static void sn_disable_irq(unsigned int irq) | 90 | static void sn_disable_irq(unsigned int irq) |
| 89 | { | 91 | { |
| 92 | if (irq == local_vector_to_irq(IA64_CPE_VECTOR)) | ||
| 93 | ia64_mca_register_cpev(0); | ||
| 90 | } | 94 | } |
| 91 | 95 | ||
| 92 | static void sn_enable_irq(unsigned int irq) | 96 | static void sn_enable_irq(unsigned int irq) |
| 93 | { | 97 | { |
| 98 | if (irq == local_vector_to_irq(IA64_CPE_VECTOR)) | ||
| 99 | ia64_mca_register_cpev(irq); | ||
| 94 | } | 100 | } |
| 95 | 101 | ||
| 96 | static void sn_ack_irq(unsigned int irq) | 102 | static void sn_ack_irq(unsigned int irq) |
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c index e336e1692a73..81785b78bc1e 100644 --- a/arch/ia64/sn/kernel/xpc_main.c +++ b/arch/ia64/sn/kernel/xpc_main.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. | 4 | * for more details. |
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2004-2006 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (c) 2004-2007 Silicon Graphics, Inc. All Rights Reserved. |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | 9 | ||
| @@ -257,7 +257,9 @@ xpc_hb_checker(void *ignore) | |||
| 257 | 257 | ||
| 258 | set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU)); | 258 | set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU)); |
| 259 | 259 | ||
| 260 | /* set our heartbeating to other partitions into motion */ | ||
| 260 | xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ); | 261 | xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ); |
| 262 | xpc_hb_beater(0); | ||
| 261 | 263 | ||
| 262 | while (!(volatile int) xpc_exiting) { | 264 | while (!(volatile int) xpc_exiting) { |
| 263 | 265 | ||
| @@ -1338,16 +1340,8 @@ xpc_init(void) | |||
| 1338 | dev_warn(xpc_part, "can't register die notifier\n"); | 1340 | dev_warn(xpc_part, "can't register die notifier\n"); |
| 1339 | } | 1341 | } |
| 1340 | 1342 | ||
| 1341 | |||
| 1342 | /* | ||
| 1343 | * Set the beating to other partitions into motion. This is | ||
| 1344 | * the last requirement for other partitions' discovery to | ||
| 1345 | * initiate communications with us. | ||
| 1346 | */ | ||
| 1347 | init_timer(&xpc_hb_timer); | 1343 | init_timer(&xpc_hb_timer); |
| 1348 | xpc_hb_timer.function = xpc_hb_beater; | 1344 | xpc_hb_timer.function = xpc_hb_beater; |
| 1349 | xpc_hb_beater(0); | ||
| 1350 | |||
| 1351 | 1345 | ||
| 1352 | /* | 1346 | /* |
| 1353 | * The real work-horse behind xpc. This processes incoming | 1347 | * The real work-horse behind xpc. This processes incoming |
diff --git a/arch/powerpc/boot/dts/walnut.dts b/arch/powerpc/boot/dts/walnut.dts index fa681f5343fe..754fa3960f83 100644 --- a/arch/powerpc/boot/dts/walnut.dts +++ b/arch/powerpc/boot/dts/walnut.dts | |||
| @@ -122,7 +122,9 @@ | |||
| 122 | device_type = "network"; | 122 | device_type = "network"; |
| 123 | compatible = "ibm,emac-405gp", "ibm,emac"; | 123 | compatible = "ibm,emac-405gp", "ibm,emac"; |
| 124 | interrupt-parent = <&UIC0>; | 124 | interrupt-parent = <&UIC0>; |
| 125 | interrupts = <9 4 f 4>; | 125 | interrupts = < |
| 126 | f 4 /* Ethernet */ | ||
| 127 | 9 4 /* Ethernet Wake Up */>; | ||
| 126 | local-mac-address = [000000000000]; /* Filled in by zImage */ | 128 | local-mac-address = [000000000000]; /* Filled in by zImage */ |
| 127 | reg = <ef600800 70>; | 129 | reg = <ef600800 70>; |
| 128 | mal-device = <&MAL>; | 130 | mal-device = <&MAL>; |
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 39b27e5ef6c1..31147a037728 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
| @@ -21,6 +21,14 @@ | |||
| 21 | # (default ./arch/powerpc/boot) | 21 | # (default ./arch/powerpc/boot) |
| 22 | # -W dir specify working directory for temporary files (default .) | 22 | # -W dir specify working directory for temporary files (default .) |
| 23 | 23 | ||
| 24 | # Stop execution if any command fails | ||
| 25 | set -e | ||
| 26 | |||
| 27 | # Allow for verbose output | ||
| 28 | if [ "$V" = 1 ]; then | ||
| 29 | set -x | ||
| 30 | fi | ||
| 31 | |||
| 24 | # defaults | 32 | # defaults |
| 25 | kernel= | 33 | kernel= |
| 26 | ofile=zImage | 34 | ofile=zImage |
| @@ -111,7 +119,7 @@ if [ -n "$dts" ]; then | |||
| 111 | if [ -z "$dtb" ]; then | 119 | if [ -z "$dtb" ]; then |
| 112 | dtb="$platform.dtb" | 120 | dtb="$platform.dtb" |
| 113 | fi | 121 | fi |
| 114 | dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" || exit 1 | 122 | dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" |
| 115 | fi | 123 | fi |
| 116 | 124 | ||
| 117 | if [ -z "$kernel" ]; then | 125 | if [ -z "$kernel" ]; then |
| @@ -149,7 +157,6 @@ cuboot*) | |||
| 149 | ps3) | 157 | ps3) |
| 150 | platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" | 158 | platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" |
| 151 | lds=$object/zImage.ps3.lds | 159 | lds=$object/zImage.ps3.lds |
| 152 | binary=y | ||
| 153 | gzip= | 160 | gzip= |
| 154 | ext=bin | 161 | ext=bin |
| 155 | objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" | 162 | objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" |
| @@ -233,7 +240,7 @@ entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3` | |||
| 233 | 240 | ||
| 234 | if [ -n "$binary" ]; then | 241 | if [ -n "$binary" ]; then |
| 235 | mv "$ofile" "$ofile".elf | 242 | mv "$ofile" "$ofile".elf |
| 236 | ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin | 243 | ${CROSS}objcopy -O binary "$ofile".elf "$ofile" |
| 237 | fi | 244 | fi |
| 238 | 245 | ||
| 239 | # post-processing needed for some platforms | 246 | # post-processing needed for some platforms |
| @@ -246,9 +253,9 @@ coff) | |||
| 246 | $object/hack-coff "$ofile" | 253 | $object/hack-coff "$ofile" |
| 247 | ;; | 254 | ;; |
| 248 | cuboot*) | 255 | cuboot*) |
| 249 | gzip -f -9 "$ofile".bin | 256 | gzip -f -9 "$ofile" |
| 250 | mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ | 257 | mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ |
| 251 | $uboot_version -d "$ofile".bin.gz "$ofile" | 258 | $uboot_version -d "$ofile".gz "$ofile" |
| 252 | ;; | 259 | ;; |
| 253 | treeboot*) | 260 | treeboot*) |
| 254 | mv "$ofile" "$ofile.elf" | 261 | mv "$ofile" "$ofile.elf" |
| @@ -269,11 +276,11 @@ ps3) | |||
| 269 | # then copied to offset 0x100. At runtime the bootwrapper program | 276 | # then copied to offset 0x100. At runtime the bootwrapper program |
| 270 | # copies the 0x100 bytes at __system_reset_kernel to addr 0x100. | 277 | # copies the 0x100 bytes at __system_reset_kernel to addr 0x100. |
| 271 | 278 | ||
| 272 | system_reset_overlay=0x`${CROSS}nm "$ofile".elf \ | 279 | system_reset_overlay=0x`${CROSS}nm "$ofile" \ |
| 273 | | grep ' __system_reset_overlay$' \ | 280 | | grep ' __system_reset_overlay$' \ |
| 274 | | cut -d' ' -f1` | 281 | | cut -d' ' -f1` |
| 275 | system_reset_overlay=`printf "%d" $system_reset_overlay` | 282 | system_reset_overlay=`printf "%d" $system_reset_overlay` |
| 276 | system_reset_kernel=0x`${CROSS}nm "$ofile".elf \ | 283 | system_reset_kernel=0x`${CROSS}nm "$ofile" \ |
| 277 | | grep ' __system_reset_kernel$' \ | 284 | | grep ' __system_reset_kernel$' \ |
| 278 | | cut -d' ' -f1` | 285 | | cut -d' ' -f1` |
| 279 | system_reset_kernel=`printf "%d" $system_reset_kernel` | 286 | system_reset_kernel=`printf "%d" $system_reset_kernel` |
| @@ -282,23 +289,15 @@ ps3) | |||
| 282 | 289 | ||
| 283 | rm -f "$object/otheros.bld" | 290 | rm -f "$object/otheros.bld" |
| 284 | 291 | ||
| 285 | msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ | 292 | ${CROSS}objcopy -O binary "$ofile" "$ofile.bin" |
| 286 | skip=$overlay_dest seek=$system_reset_kernel \ | ||
| 287 | count=$overlay_size bs=1 2>&1) | ||
| 288 | 293 | ||
| 289 | if [ $? -ne "0" ]; then | 294 | dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ |
| 290 | echo $msg | 295 | skip=$overlay_dest seek=$system_reset_kernel \ |
| 291 | exit 1 | 296 | count=$overlay_size bs=1 |
| 292 | fi | ||
| 293 | |||
| 294 | msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ | ||
| 295 | skip=$system_reset_overlay seek=$overlay_dest \ | ||
| 296 | count=$overlay_size bs=1 2>&1) | ||
| 297 | 297 | ||
| 298 | if [ $? -ne "0" ]; then | 298 | dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ |
| 299 | echo $msg | 299 | skip=$system_reset_overlay seek=$overlay_dest \ |
| 300 | exit 2 | 300 | count=$overlay_size bs=1 |
| 301 | fi | ||
| 302 | 301 | ||
| 303 | gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" | 302 | gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld" |
| 304 | ;; | 303 | ;; |
diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig index 1ccf3ed7693e..78c968aade4e 100644 --- a/arch/powerpc/configs/pasemi_defconfig +++ b/arch/powerpc/configs/pasemi_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.23-rc4 | 3 | # Linux kernel version: 2.6.24-rc2 |
| 4 | # Thu Aug 30 16:40:47 2007 | 4 | # Tue Nov 6 23:23:50 2007 |
| 5 | # | 5 | # |
| 6 | CONFIG_PPC64=y | 6 | CONFIG_PPC64=y |
| 7 | 7 | ||
| @@ -10,6 +10,7 @@ CONFIG_PPC64=y | |||
| 10 | # | 10 | # |
| 11 | CONFIG_POWER4_ONLY=y | 11 | CONFIG_POWER4_ONLY=y |
| 12 | CONFIG_POWER4=y | 12 | CONFIG_POWER4=y |
| 13 | # CONFIG_TUNE_CELL is not set | ||
| 13 | CONFIG_PPC_FPU=y | 14 | CONFIG_PPC_FPU=y |
| 14 | CONFIG_ALTIVEC=y | 15 | CONFIG_ALTIVEC=y |
| 15 | CONFIG_PPC_STD_MMU=y | 16 | CONFIG_PPC_STD_MMU=y |
| @@ -18,8 +19,13 @@ CONFIG_PPC_MM_SLICES=y | |||
| 18 | CONFIG_SMP=y | 19 | CONFIG_SMP=y |
| 19 | CONFIG_NR_CPUS=2 | 20 | CONFIG_NR_CPUS=2 |
| 20 | CONFIG_64BIT=y | 21 | CONFIG_64BIT=y |
| 22 | CONFIG_WORD_SIZE=64 | ||
| 21 | CONFIG_PPC_MERGE=y | 23 | CONFIG_PPC_MERGE=y |
| 22 | CONFIG_MMU=y | 24 | CONFIG_MMU=y |
| 25 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
| 26 | CONFIG_GENERIC_TIME=y | ||
| 27 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
| 28 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 23 | CONFIG_GENERIC_HARDIRQS=y | 29 | CONFIG_GENERIC_HARDIRQS=y |
| 24 | CONFIG_IRQ_PER_CPU=y | 30 | CONFIG_IRQ_PER_CPU=y |
| 25 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 31 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
| @@ -65,7 +71,10 @@ CONFIG_SYSVIPC_SYSCTL=y | |||
| 65 | # CONFIG_AUDIT is not set | 71 | # CONFIG_AUDIT is not set |
| 66 | # CONFIG_IKCONFIG is not set | 72 | # CONFIG_IKCONFIG is not set |
| 67 | CONFIG_LOG_BUF_SHIFT=17 | 73 | CONFIG_LOG_BUF_SHIFT=17 |
| 68 | # CONFIG_CPUSETS is not set | 74 | # CONFIG_CGROUPS is not set |
| 75 | CONFIG_FAIR_GROUP_SCHED=y | ||
| 76 | CONFIG_FAIR_USER_SCHED=y | ||
| 77 | # CONFIG_FAIR_CGROUP_SCHED is not set | ||
| 69 | CONFIG_SYSFS_DEPRECATED=y | 78 | CONFIG_SYSFS_DEPRECATED=y |
| 70 | # CONFIG_RELAY is not set | 79 | # CONFIG_RELAY is not set |
| 71 | CONFIG_BLK_DEV_INITRD=y | 80 | CONFIG_BLK_DEV_INITRD=y |
| @@ -86,7 +95,6 @@ CONFIG_FUTEX=y | |||
| 86 | CONFIG_ANON_INODES=y | 95 | CONFIG_ANON_INODES=y |
| 87 | CONFIG_EPOLL=y | 96 | CONFIG_EPOLL=y |
| 88 | CONFIG_SIGNALFD=y | 97 | CONFIG_SIGNALFD=y |
| 89 | CONFIG_TIMERFD=y | ||
| 90 | CONFIG_EVENTFD=y | 98 | CONFIG_EVENTFD=y |
| 91 | CONFIG_SHMEM=y | 99 | CONFIG_SHMEM=y |
| 92 | CONFIG_VM_EVENT_COUNTERS=y | 100 | CONFIG_VM_EVENT_COUNTERS=y |
| @@ -107,14 +115,15 @@ CONFIG_STOP_MACHINE=y | |||
| 107 | CONFIG_BLOCK=y | 115 | CONFIG_BLOCK=y |
| 108 | # CONFIG_BLK_DEV_IO_TRACE is not set | 116 | # CONFIG_BLK_DEV_IO_TRACE is not set |
| 109 | # CONFIG_BLK_DEV_BSG is not set | 117 | # CONFIG_BLK_DEV_BSG is not set |
| 118 | CONFIG_BLOCK_COMPAT=y | ||
| 110 | 119 | ||
| 111 | # | 120 | # |
| 112 | # IO Schedulers | 121 | # IO Schedulers |
| 113 | # | 122 | # |
| 114 | CONFIG_IOSCHED_NOOP=y | 123 | CONFIG_IOSCHED_NOOP=y |
| 115 | CONFIG_IOSCHED_AS=y | 124 | CONFIG_IOSCHED_AS=y |
| 116 | # CONFIG_IOSCHED_DEADLINE is not set | 125 | CONFIG_IOSCHED_DEADLINE=y |
| 117 | # CONFIG_IOSCHED_CFQ is not set | 126 | CONFIG_IOSCHED_CFQ=y |
| 118 | CONFIG_DEFAULT_AS=y | 127 | CONFIG_DEFAULT_AS=y |
| 119 | # CONFIG_DEFAULT_DEADLINE is not set | 128 | # CONFIG_DEFAULT_DEADLINE is not set |
| 120 | # CONFIG_DEFAULT_CFQ is not set | 129 | # CONFIG_DEFAULT_CFQ is not set |
| @@ -125,7 +134,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" | |||
| 125 | # Platform support | 134 | # Platform support |
| 126 | # | 135 | # |
| 127 | CONFIG_PPC_MULTIPLATFORM=y | 136 | CONFIG_PPC_MULTIPLATFORM=y |
| 128 | # CONFIG_EMBEDDED6xx is not set | ||
| 129 | # CONFIG_PPC_82xx is not set | 137 | # CONFIG_PPC_82xx is not set |
| 130 | # CONFIG_PPC_83xx is not set | 138 | # CONFIG_PPC_83xx is not set |
| 131 | # CONFIG_PPC_86xx is not set | 139 | # CONFIG_PPC_86xx is not set |
| @@ -141,6 +149,7 @@ CONFIG_PPC_PASEMI=y | |||
| 141 | # PA Semi PWRficient options | 149 | # PA Semi PWRficient options |
| 142 | # | 150 | # |
| 143 | CONFIG_PPC_PASEMI_IOMMU=y | 151 | CONFIG_PPC_PASEMI_IOMMU=y |
| 152 | # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set | ||
| 144 | CONFIG_PPC_PASEMI_MDIO=y | 153 | CONFIG_PPC_PASEMI_MDIO=y |
| 145 | CONFIG_ELECTRA_IDE=y | 154 | CONFIG_ELECTRA_IDE=y |
| 146 | # CONFIG_PPC_CELLEB is not set | 155 | # CONFIG_PPC_CELLEB is not set |
| @@ -156,29 +165,52 @@ CONFIG_MPIC=y | |||
| 156 | # CONFIG_U3_DART is not set | 165 | # CONFIG_U3_DART is not set |
| 157 | # CONFIG_PPC_RTAS is not set | 166 | # CONFIG_PPC_RTAS is not set |
| 158 | # CONFIG_MMIO_NVRAM is not set | 167 | # CONFIG_MMIO_NVRAM is not set |
| 168 | CONFIG_MPIC_BROKEN_REGREAD=y | ||
| 159 | # CONFIG_PPC_MPC106 is not set | 169 | # CONFIG_PPC_MPC106 is not set |
| 160 | # CONFIG_PPC_970_NAP is not set | 170 | # CONFIG_PPC_970_NAP is not set |
| 161 | # CONFIG_PPC_INDIRECT_IO is not set | 171 | # CONFIG_PPC_INDIRECT_IO is not set |
| 162 | # CONFIG_GENERIC_IOMAP is not set | 172 | # CONFIG_GENERIC_IOMAP is not set |
| 163 | # CONFIG_CPU_FREQ is not set | 173 | CONFIG_CPU_FREQ=y |
| 174 | CONFIG_CPU_FREQ_TABLE=y | ||
| 175 | CONFIG_CPU_FREQ_DEBUG=y | ||
| 176 | CONFIG_CPU_FREQ_STAT=y | ||
| 177 | # CONFIG_CPU_FREQ_STAT_DETAILS is not set | ||
| 178 | CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y | ||
| 179 | # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set | ||
| 180 | # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set | ||
| 181 | # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set | ||
| 182 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y | ||
| 183 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y | ||
| 184 | CONFIG_CPU_FREQ_GOV_USERSPACE=y | ||
| 185 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y | ||
| 186 | # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set | ||
| 187 | |||
| 188 | # | ||
| 189 | # CPU Frequency drivers | ||
| 190 | # | ||
| 191 | CONFIG_PPC_PASEMI_CPUFREQ=y | ||
| 164 | # CONFIG_CPM2 is not set | 192 | # CONFIG_CPM2 is not set |
| 165 | # CONFIG_FSL_ULI1575 is not set | 193 | # CONFIG_FSL_ULI1575 is not set |
| 166 | 194 | ||
| 167 | # | 195 | # |
| 168 | # Kernel options | 196 | # Kernel options |
| 169 | # | 197 | # |
| 170 | CONFIG_HZ_100=y | 198 | CONFIG_TICK_ONESHOT=y |
| 199 | CONFIG_NO_HZ=y | ||
| 200 | CONFIG_HIGH_RES_TIMERS=y | ||
| 201 | CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | ||
| 202 | # CONFIG_HZ_100 is not set | ||
| 171 | # CONFIG_HZ_250 is not set | 203 | # CONFIG_HZ_250 is not set |
| 172 | # CONFIG_HZ_300 is not set | 204 | # CONFIG_HZ_300 is not set |
| 173 | # CONFIG_HZ_1000 is not set | 205 | CONFIG_HZ_1000=y |
| 174 | CONFIG_HZ=100 | 206 | CONFIG_HZ=1000 |
| 175 | CONFIG_PREEMPT_NONE=y | 207 | CONFIG_PREEMPT_NONE=y |
| 176 | # CONFIG_PREEMPT_VOLUNTARY is not set | 208 | # CONFIG_PREEMPT_VOLUNTARY is not set |
| 177 | # CONFIG_PREEMPT is not set | 209 | # CONFIG_PREEMPT is not set |
| 178 | CONFIG_PREEMPT_BKL=y | 210 | # CONFIG_PREEMPT_BKL is not set |
| 179 | CONFIG_BINFMT_ELF=y | 211 | CONFIG_BINFMT_ELF=y |
| 180 | # CONFIG_BINFMT_MISC is not set | 212 | # CONFIG_BINFMT_MISC is not set |
| 181 | CONFIG_FORCE_MAX_ZONEORDER=13 | 213 | CONFIG_FORCE_MAX_ZONEORDER=9 |
| 182 | CONFIG_IOMMU_VMERGE=y | 214 | CONFIG_IOMMU_VMERGE=y |
| 183 | CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y | 215 | CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y |
| 184 | # CONFIG_KEXEC is not set | 216 | # CONFIG_KEXEC is not set |
| @@ -196,12 +228,13 @@ CONFIG_FLATMEM_MANUAL=y | |||
| 196 | CONFIG_FLATMEM=y | 228 | CONFIG_FLATMEM=y |
| 197 | CONFIG_FLAT_NODE_MEM_MAP=y | 229 | CONFIG_FLAT_NODE_MEM_MAP=y |
| 198 | # CONFIG_SPARSEMEM_STATIC is not set | 230 | # CONFIG_SPARSEMEM_STATIC is not set |
| 231 | CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y | ||
| 199 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 232 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
| 200 | CONFIG_RESOURCES_64BIT=y | 233 | CONFIG_RESOURCES_64BIT=y |
| 201 | CONFIG_ZONE_DMA_FLAG=1 | 234 | CONFIG_ZONE_DMA_FLAG=1 |
| 202 | CONFIG_BOUNCE=y | 235 | CONFIG_BOUNCE=y |
| 203 | # CONFIG_PPC_HAS_HASH_64K is not set | 236 | CONFIG_PPC_HAS_HASH_64K=y |
| 204 | # CONFIG_PPC_64K_PAGES is not set | 237 | CONFIG_PPC_64K_PAGES=y |
| 205 | # CONFIG_SCHED_SMT is not set | 238 | # CONFIG_SCHED_SMT is not set |
| 206 | CONFIG_PROC_DEVICETREE=y | 239 | CONFIG_PROC_DEVICETREE=y |
| 207 | # CONFIG_CMDLINE_BOOL is not set | 240 | # CONFIG_CMDLINE_BOOL is not set |
| @@ -222,11 +255,8 @@ CONFIG_PCI_SYSCALL=y | |||
| 222 | # CONFIG_PCIEPORTBUS is not set | 255 | # CONFIG_PCIEPORTBUS is not set |
| 223 | CONFIG_ARCH_SUPPORTS_MSI=y | 256 | CONFIG_ARCH_SUPPORTS_MSI=y |
| 224 | # CONFIG_PCI_MSI is not set | 257 | # CONFIG_PCI_MSI is not set |
| 258 | CONFIG_PCI_LEGACY=y | ||
| 225 | # CONFIG_PCI_DEBUG is not set | 259 | # CONFIG_PCI_DEBUG is not set |
| 226 | |||
| 227 | # | ||
| 228 | # PCCARD (PCMCIA/CardBus) support | ||
| 229 | # | ||
| 230 | CONFIG_PCCARD=y | 260 | CONFIG_PCCARD=y |
| 231 | CONFIG_PCMCIA_DEBUG=y | 261 | CONFIG_PCMCIA_DEBUG=y |
| 232 | CONFIG_PCMCIA=y | 262 | CONFIG_PCMCIA=y |
| @@ -240,6 +270,7 @@ CONFIG_CARDBUS=y | |||
| 240 | # CONFIG_YENTA is not set | 270 | # CONFIG_YENTA is not set |
| 241 | # CONFIG_PD6729 is not set | 271 | # CONFIG_PD6729 is not set |
| 242 | # CONFIG_I82092 is not set | 272 | # CONFIG_I82092 is not set |
| 273 | # CONFIG_ELECTRA_CF is not set | ||
| 243 | # CONFIG_HOTPLUG_PCI is not set | 274 | # CONFIG_HOTPLUG_PCI is not set |
| 244 | CONFIG_KERNEL_START=0xc000000000000000 | 275 | CONFIG_KERNEL_START=0xc000000000000000 |
| 245 | 276 | ||
| @@ -255,7 +286,7 @@ CONFIG_PACKET=y | |||
| 255 | # CONFIG_PACKET_MMAP is not set | 286 | # CONFIG_PACKET_MMAP is not set |
| 256 | CONFIG_UNIX=y | 287 | CONFIG_UNIX=y |
| 257 | CONFIG_XFRM=y | 288 | CONFIG_XFRM=y |
| 258 | # CONFIG_XFRM_USER is not set | 289 | CONFIG_XFRM_USER=y |
| 259 | # CONFIG_XFRM_SUB_POLICY is not set | 290 | # CONFIG_XFRM_SUB_POLICY is not set |
| 260 | # CONFIG_XFRM_MIGRATE is not set | 291 | # CONFIG_XFRM_MIGRATE is not set |
| 261 | CONFIG_NET_KEY=y | 292 | CONFIG_NET_KEY=y |
| @@ -281,6 +312,7 @@ CONFIG_INET_TUNNEL=y | |||
| 281 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | 312 | CONFIG_INET_XFRM_MODE_TRANSPORT=y |
| 282 | CONFIG_INET_XFRM_MODE_TUNNEL=y | 313 | CONFIG_INET_XFRM_MODE_TUNNEL=y |
| 283 | CONFIG_INET_XFRM_MODE_BEET=y | 314 | CONFIG_INET_XFRM_MODE_BEET=y |
| 315 | CONFIG_INET_LRO=y | ||
| 284 | CONFIG_INET_DIAG=y | 316 | CONFIG_INET_DIAG=y |
| 285 | CONFIG_INET_TCP_DIAG=y | 317 | CONFIG_INET_TCP_DIAG=y |
| 286 | # CONFIG_TCP_CONG_ADVANCED is not set | 318 | # CONFIG_TCP_CONG_ADVANCED is not set |
| @@ -306,10 +338,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
| 306 | # CONFIG_LAPB is not set | 338 | # CONFIG_LAPB is not set |
| 307 | # CONFIG_ECONET is not set | 339 | # CONFIG_ECONET is not set |
| 308 | # CONFIG_WAN_ROUTER is not set | 340 | # CONFIG_WAN_ROUTER is not set |
| 309 | |||
| 310 | # | ||
| 311 | # QoS and/or fair queueing | ||
| 312 | # | ||
| 313 | # CONFIG_NET_SCHED is not set | 341 | # CONFIG_NET_SCHED is not set |
| 314 | 342 | ||
| 315 | # | 343 | # |
| @@ -338,6 +366,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic" | |||
| 338 | # | 366 | # |
| 339 | # Generic Driver Options | 367 | # Generic Driver Options |
| 340 | # | 368 | # |
| 369 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 341 | CONFIG_STANDALONE=y | 370 | CONFIG_STANDALONE=y |
| 342 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 371 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
| 343 | CONFIG_FW_LOADER=y | 372 | CONFIG_FW_LOADER=y |
| @@ -361,6 +390,7 @@ CONFIG_MTD_BLOCK=y | |||
| 361 | # CONFIG_INFTL is not set | 390 | # CONFIG_INFTL is not set |
| 362 | # CONFIG_RFD_FTL is not set | 391 | # CONFIG_RFD_FTL is not set |
| 363 | # CONFIG_SSFDC is not set | 392 | # CONFIG_SSFDC is not set |
| 393 | # CONFIG_MTD_OOPS is not set | ||
| 364 | 394 | ||
| 365 | # | 395 | # |
| 366 | # RAM/ROM/Flash chip drivers | 396 | # RAM/ROM/Flash chip drivers |
| @@ -385,6 +415,7 @@ CONFIG_MTD_CFI_I2=y | |||
| 385 | # Mapping drivers for chip access | 415 | # Mapping drivers for chip access |
| 386 | # | 416 | # |
| 387 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 417 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
| 418 | # CONFIG_MTD_INTEL_VR_NOR is not set | ||
| 388 | # CONFIG_MTD_PLATRAM is not set | 419 | # CONFIG_MTD_PLATRAM is not set |
| 389 | 420 | ||
| 390 | # | 421 | # |
| @@ -402,7 +433,15 @@ CONFIG_MTD_PHRAM=y | |||
| 402 | # CONFIG_MTD_DOC2000 is not set | 433 | # CONFIG_MTD_DOC2000 is not set |
| 403 | # CONFIG_MTD_DOC2001 is not set | 434 | # CONFIG_MTD_DOC2001 is not set |
| 404 | # CONFIG_MTD_DOC2001PLUS is not set | 435 | # CONFIG_MTD_DOC2001PLUS is not set |
| 405 | # CONFIG_MTD_NAND is not set | 436 | CONFIG_MTD_NAND=y |
| 437 | # CONFIG_MTD_NAND_VERIFY_WRITE is not set | ||
| 438 | # CONFIG_MTD_NAND_ECC_SMC is not set | ||
| 439 | # CONFIG_MTD_NAND_MUSEUM_IDS is not set | ||
| 440 | CONFIG_MTD_NAND_IDS=y | ||
| 441 | # CONFIG_MTD_NAND_DISKONCHIP is not set | ||
| 442 | # CONFIG_MTD_NAND_CAFE is not set | ||
| 443 | # CONFIG_MTD_NAND_PLATFORM is not set | ||
| 444 | # CONFIG_MTD_ALAUDA is not set | ||
| 406 | # CONFIG_MTD_ONENAND is not set | 445 | # CONFIG_MTD_ONENAND is not set |
| 407 | 446 | ||
| 408 | # | 447 | # |
| @@ -455,10 +494,42 @@ CONFIG_IDE_PROC_FS=y | |||
| 455 | # IDE chipset support/bugfixes | 494 | # IDE chipset support/bugfixes |
| 456 | # | 495 | # |
| 457 | # CONFIG_IDE_GENERIC is not set | 496 | # CONFIG_IDE_GENERIC is not set |
| 458 | # CONFIG_BLK_DEV_IDEPCI is not set | 497 | # CONFIG_BLK_DEV_PLATFORM is not set |
| 498 | |||
| 499 | # | ||
| 500 | # PCI IDE chipsets support | ||
| 501 | # | ||
| 459 | # CONFIG_IDEPCI_PCIBUS_ORDER is not set | 502 | # CONFIG_IDEPCI_PCIBUS_ORDER is not set |
| 503 | # CONFIG_BLK_DEV_GENERIC is not set | ||
| 504 | # CONFIG_BLK_DEV_OPTI621 is not set | ||
| 505 | # CONFIG_BLK_DEV_AEC62XX is not set | ||
| 506 | # CONFIG_BLK_DEV_ALI15X3 is not set | ||
| 507 | # CONFIG_BLK_DEV_AMD74XX is not set | ||
| 508 | # CONFIG_BLK_DEV_CMD64X is not set | ||
| 509 | # CONFIG_BLK_DEV_TRIFLEX is not set | ||
| 510 | # CONFIG_BLK_DEV_CY82C693 is not set | ||
| 511 | # CONFIG_BLK_DEV_CS5520 is not set | ||
| 512 | # CONFIG_BLK_DEV_CS5530 is not set | ||
| 513 | # CONFIG_BLK_DEV_HPT34X is not set | ||
| 514 | # CONFIG_BLK_DEV_HPT366 is not set | ||
| 515 | # CONFIG_BLK_DEV_JMICRON is not set | ||
| 516 | # CONFIG_BLK_DEV_SC1200 is not set | ||
| 517 | # CONFIG_BLK_DEV_PIIX is not set | ||
| 518 | # CONFIG_BLK_DEV_IT8213 is not set | ||
| 519 | # CONFIG_BLK_DEV_IT821X is not set | ||
| 520 | # CONFIG_BLK_DEV_NS87415 is not set | ||
| 521 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | ||
| 522 | # CONFIG_BLK_DEV_PDC202XX_NEW is not set | ||
| 523 | # CONFIG_BLK_DEV_SVWKS is not set | ||
| 524 | # CONFIG_BLK_DEV_SIIMAGE is not set | ||
| 525 | # CONFIG_BLK_DEV_SL82C105 is not set | ||
| 526 | # CONFIG_BLK_DEV_SLC90E66 is not set | ||
| 527 | # CONFIG_BLK_DEV_TRM290 is not set | ||
| 528 | # CONFIG_BLK_DEV_VIA82CXXX is not set | ||
| 529 | # CONFIG_BLK_DEV_TC86C001 is not set | ||
| 460 | # CONFIG_IDE_ARM is not set | 530 | # CONFIG_IDE_ARM is not set |
| 461 | # CONFIG_BLK_DEV_IDEDMA is not set | 531 | # CONFIG_BLK_DEV_IDEDMA is not set |
| 532 | CONFIG_IDE_ARCH_OBSOLETE_INIT=y | ||
| 462 | # CONFIG_BLK_DEV_HD is not set | 533 | # CONFIG_BLK_DEV_HD is not set |
| 463 | 534 | ||
| 464 | # | 535 | # |
| @@ -498,10 +569,11 @@ CONFIG_SCSI_WAIT_SCAN=m | |||
| 498 | # CONFIG_SCSI_FC_ATTRS is not set | 569 | # CONFIG_SCSI_FC_ATTRS is not set |
| 499 | # CONFIG_SCSI_ISCSI_ATTRS is not set | 570 | # CONFIG_SCSI_ISCSI_ATTRS is not set |
| 500 | # CONFIG_SCSI_SAS_LIBSAS is not set | 571 | # CONFIG_SCSI_SAS_LIBSAS is not set |
| 572 | # CONFIG_SCSI_SRP_ATTRS is not set | ||
| 501 | CONFIG_SCSI_LOWLEVEL=y | 573 | CONFIG_SCSI_LOWLEVEL=y |
| 502 | # CONFIG_ISCSI_TCP is not set | 574 | # CONFIG_ISCSI_TCP is not set |
| 503 | CONFIG_BLK_DEV_3W_XXXX_RAID=y | 575 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
| 504 | CONFIG_SCSI_3W_9XXX=y | 576 | # CONFIG_SCSI_3W_9XXX is not set |
| 505 | # CONFIG_SCSI_ACARD is not set | 577 | # CONFIG_SCSI_ACARD is not set |
| 506 | # CONFIG_SCSI_AACRAID is not set | 578 | # CONFIG_SCSI_AACRAID is not set |
| 507 | # CONFIG_SCSI_AIC7XXX is not set | 579 | # CONFIG_SCSI_AIC7XXX is not set |
| @@ -574,9 +646,10 @@ CONFIG_ATA_GENERIC=y | |||
| 574 | # CONFIG_PATA_OLDPIIX is not set | 646 | # CONFIG_PATA_OLDPIIX is not set |
| 575 | # CONFIG_PATA_NETCELL is not set | 647 | # CONFIG_PATA_NETCELL is not set |
| 576 | # CONFIG_PATA_NS87410 is not set | 648 | # CONFIG_PATA_NS87410 is not set |
| 649 | # CONFIG_PATA_NS87415 is not set | ||
| 577 | # CONFIG_PATA_OPTI is not set | 650 | # CONFIG_PATA_OPTI is not set |
| 578 | # CONFIG_PATA_OPTIDMA is not set | 651 | # CONFIG_PATA_OPTIDMA is not set |
| 579 | # CONFIG_PATA_PCMCIA is not set | 652 | CONFIG_PATA_PCMCIA=y |
| 580 | # CONFIG_PATA_PDC_OLD is not set | 653 | # CONFIG_PATA_PDC_OLD is not set |
| 581 | # CONFIG_PATA_RADISYS is not set | 654 | # CONFIG_PATA_RADISYS is not set |
| 582 | # CONFIG_PATA_RZ1000 is not set | 655 | # CONFIG_PATA_RZ1000 is not set |
| @@ -589,41 +662,13 @@ CONFIG_ATA_GENERIC=y | |||
| 589 | # CONFIG_PATA_WINBOND is not set | 662 | # CONFIG_PATA_WINBOND is not set |
| 590 | CONFIG_PATA_PLATFORM=y | 663 | CONFIG_PATA_PLATFORM=y |
| 591 | # CONFIG_MD is not set | 664 | # CONFIG_MD is not set |
| 592 | |||
| 593 | # | ||
| 594 | # Fusion MPT device support | ||
| 595 | # | ||
| 596 | # CONFIG_FUSION is not set | 665 | # CONFIG_FUSION is not set |
| 597 | # CONFIG_FUSION_SPI is not set | ||
| 598 | # CONFIG_FUSION_FC is not set | ||
| 599 | # CONFIG_FUSION_SAS is not set | ||
| 600 | 666 | ||
| 601 | # | 667 | # |
| 602 | # IEEE 1394 (FireWire) support | 668 | # IEEE 1394 (FireWire) support |
| 603 | # | 669 | # |
| 604 | # CONFIG_FIREWIRE is not set | 670 | # CONFIG_FIREWIRE is not set |
| 605 | CONFIG_IEEE1394=y | 671 | # CONFIG_IEEE1394 is not set |
| 606 | |||
| 607 | # | ||
| 608 | # Subsystem Options | ||
| 609 | # | ||
| 610 | # CONFIG_IEEE1394_VERBOSEDEBUG is not set | ||
| 611 | |||
| 612 | # | ||
| 613 | # Controllers | ||
| 614 | # | ||
| 615 | CONFIG_IEEE1394_PCILYNX=y | ||
| 616 | CONFIG_IEEE1394_OHCI1394=y | ||
| 617 | |||
| 618 | # | ||
| 619 | # Protocols | ||
| 620 | # | ||
| 621 | # CONFIG_IEEE1394_VIDEO1394 is not set | ||
| 622 | CONFIG_IEEE1394_SBP2=y | ||
| 623 | # CONFIG_IEEE1394_ETH1394_ROM_ENTRY is not set | ||
| 624 | # CONFIG_IEEE1394_ETH1394 is not set | ||
| 625 | # CONFIG_IEEE1394_DV1394 is not set | ||
| 626 | CONFIG_IEEE1394_RAWIO=y | ||
| 627 | # CONFIG_I2O is not set | 672 | # CONFIG_I2O is not set |
| 628 | # CONFIG_MACINTOSH_DRIVERS is not set | 673 | # CONFIG_MACINTOSH_DRIVERS is not set |
| 629 | CONFIG_NETDEVICES=y | 674 | CONFIG_NETDEVICES=y |
| @@ -633,6 +678,8 @@ CONFIG_DUMMY=y | |||
| 633 | # CONFIG_MACVLAN is not set | 678 | # CONFIG_MACVLAN is not set |
| 634 | # CONFIG_EQUALIZER is not set | 679 | # CONFIG_EQUALIZER is not set |
| 635 | # CONFIG_TUN is not set | 680 | # CONFIG_TUN is not set |
| 681 | # CONFIG_VETH is not set | ||
| 682 | # CONFIG_IP1000 is not set | ||
| 636 | # CONFIG_ARCNET is not set | 683 | # CONFIG_ARCNET is not set |
| 637 | CONFIG_PHYLIB=y | 684 | CONFIG_PHYLIB=y |
| 638 | 685 | ||
| @@ -649,6 +696,7 @@ CONFIG_MARVELL_PHY=y | |||
| 649 | # CONFIG_BROADCOM_PHY is not set | 696 | # CONFIG_BROADCOM_PHY is not set |
| 650 | # CONFIG_ICPLUS_PHY is not set | 697 | # CONFIG_ICPLUS_PHY is not set |
| 651 | # CONFIG_FIXED_PHY is not set | 698 | # CONFIG_FIXED_PHY is not set |
| 699 | # CONFIG_MDIO_BITBANG is not set | ||
| 652 | CONFIG_NET_ETHERNET=y | 700 | CONFIG_NET_ETHERNET=y |
| 653 | CONFIG_MII=y | 701 | CONFIG_MII=y |
| 654 | # CONFIG_HAPPYMEAL is not set | 702 | # CONFIG_HAPPYMEAL is not set |
| @@ -657,13 +705,16 @@ CONFIG_MII=y | |||
| 657 | # CONFIG_NET_VENDOR_3COM is not set | 705 | # CONFIG_NET_VENDOR_3COM is not set |
| 658 | # CONFIG_NET_TULIP is not set | 706 | # CONFIG_NET_TULIP is not set |
| 659 | # CONFIG_HP100 is not set | 707 | # CONFIG_HP100 is not set |
| 708 | # CONFIG_IBM_NEW_EMAC_ZMII is not set | ||
| 709 | # CONFIG_IBM_NEW_EMAC_RGMII is not set | ||
| 710 | # CONFIG_IBM_NEW_EMAC_TAH is not set | ||
| 711 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | ||
| 660 | CONFIG_NET_PCI=y | 712 | CONFIG_NET_PCI=y |
| 661 | # CONFIG_PCNET32 is not set | 713 | # CONFIG_PCNET32 is not set |
| 662 | # CONFIG_AMD8111_ETH is not set | 714 | # CONFIG_AMD8111_ETH is not set |
| 663 | # CONFIG_ADAPTEC_STARFIRE is not set | 715 | # CONFIG_ADAPTEC_STARFIRE is not set |
| 664 | # CONFIG_B44 is not set | 716 | # CONFIG_B44 is not set |
| 665 | # CONFIG_FORCEDETH is not set | 717 | # CONFIG_FORCEDETH is not set |
| 666 | # CONFIG_DGRS is not set | ||
| 667 | # CONFIG_EEPRO100 is not set | 718 | # CONFIG_EEPRO100 is not set |
| 668 | # CONFIG_E100 is not set | 719 | # CONFIG_E100 is not set |
| 669 | # CONFIG_FEALNX is not set | 720 | # CONFIG_FEALNX is not set |
| @@ -682,6 +733,7 @@ CONFIG_NETDEV_1000=y | |||
| 682 | CONFIG_E1000=y | 733 | CONFIG_E1000=y |
| 683 | CONFIG_E1000_NAPI=y | 734 | CONFIG_E1000_NAPI=y |
| 684 | # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set | 735 | # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set |
| 736 | # CONFIG_E1000E is not set | ||
| 685 | # CONFIG_NS83820 is not set | 737 | # CONFIG_NS83820 is not set |
| 686 | # CONFIG_HAMACHI is not set | 738 | # CONFIG_HAMACHI is not set |
| 687 | # CONFIG_YELLOWFIN is not set | 739 | # CONFIG_YELLOWFIN is not set |
| @@ -689,6 +741,7 @@ CONFIG_E1000_NAPI=y | |||
| 689 | # CONFIG_SIS190 is not set | 741 | # CONFIG_SIS190 is not set |
| 690 | # CONFIG_SKGE is not set | 742 | # CONFIG_SKGE is not set |
| 691 | # CONFIG_SKY2 is not set | 743 | # CONFIG_SKY2 is not set |
| 744 | # CONFIG_SK98LIN is not set | ||
| 692 | # CONFIG_VIA_VELOCITY is not set | 745 | # CONFIG_VIA_VELOCITY is not set |
| 693 | CONFIG_TIGON3=y | 746 | CONFIG_TIGON3=y |
| 694 | # CONFIG_BNX2 is not set | 747 | # CONFIG_BNX2 is not set |
| @@ -697,12 +750,15 @@ CONFIG_TIGON3=y | |||
| 697 | CONFIG_NETDEV_10000=y | 750 | CONFIG_NETDEV_10000=y |
| 698 | # CONFIG_CHELSIO_T1 is not set | 751 | # CONFIG_CHELSIO_T1 is not set |
| 699 | # CONFIG_CHELSIO_T3 is not set | 752 | # CONFIG_CHELSIO_T3 is not set |
| 753 | # CONFIG_IXGBE is not set | ||
| 700 | # CONFIG_IXGB is not set | 754 | # CONFIG_IXGB is not set |
| 701 | # CONFIG_S2IO is not set | 755 | # CONFIG_S2IO is not set |
| 702 | # CONFIG_MYRI10GE is not set | 756 | # CONFIG_MYRI10GE is not set |
| 703 | # CONFIG_NETXEN_NIC is not set | 757 | # CONFIG_NETXEN_NIC is not set |
| 758 | # CONFIG_NIU is not set | ||
| 704 | CONFIG_PASEMI_MAC=y | 759 | CONFIG_PASEMI_MAC=y |
| 705 | # CONFIG_MLX4_CORE is not set | 760 | # CONFIG_MLX4_CORE is not set |
| 761 | # CONFIG_TEHUTI is not set | ||
| 706 | # CONFIG_TR is not set | 762 | # CONFIG_TR is not set |
| 707 | 763 | ||
| 708 | # | 764 | # |
| @@ -749,7 +805,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y | |||
| 749 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | 805 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 |
| 750 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | 806 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 |
| 751 | CONFIG_INPUT_JOYDEV=y | 807 | CONFIG_INPUT_JOYDEV=y |
| 752 | # CONFIG_INPUT_TSDEV is not set | ||
| 753 | CONFIG_INPUT_EVDEV=y | 808 | CONFIG_INPUT_EVDEV=y |
| 754 | # CONFIG_INPUT_EVBUG is not set | 809 | # CONFIG_INPUT_EVBUG is not set |
| 755 | 810 | ||
| @@ -810,15 +865,12 @@ CONFIG_UNIX98_PTYS=y | |||
| 810 | CONFIG_LEGACY_PTYS=y | 865 | CONFIG_LEGACY_PTYS=y |
| 811 | CONFIG_LEGACY_PTY_COUNT=4 | 866 | CONFIG_LEGACY_PTY_COUNT=4 |
| 812 | # CONFIG_IPMI_HANDLER is not set | 867 | # CONFIG_IPMI_HANDLER is not set |
| 813 | # CONFIG_WATCHDOG is not set | ||
| 814 | CONFIG_HW_RANDOM=y | 868 | CONFIG_HW_RANDOM=y |
| 815 | CONFIG_HW_RANDOM_PASEMI=y | 869 | CONFIG_HW_RANDOM_PASEMI=y |
| 816 | CONFIG_GEN_RTC=y | 870 | CONFIG_GEN_RTC=y |
| 817 | CONFIG_GEN_RTC_X=y | 871 | CONFIG_GEN_RTC_X=y |
| 818 | # CONFIG_R3964 is not set | 872 | # CONFIG_R3964 is not set |
| 819 | # CONFIG_APPLICOM is not set | 873 | # CONFIG_APPLICOM is not set |
| 820 | # CONFIG_AGP is not set | ||
| 821 | # CONFIG_DRM is not set | ||
| 822 | 874 | ||
| 823 | # | 875 | # |
| 824 | # PCMCIA character devices | 876 | # PCMCIA character devices |
| @@ -896,8 +948,6 @@ CONFIG_SENSORS_EEPROM=y | |||
| 896 | # CONFIG_POWER_SUPPLY is not set | 948 | # CONFIG_POWER_SUPPLY is not set |
| 897 | CONFIG_HWMON=y | 949 | CONFIG_HWMON=y |
| 898 | CONFIG_HWMON_VID=y | 950 | CONFIG_HWMON_VID=y |
| 899 | # CONFIG_SENSORS_ABITUGURU is not set | ||
| 900 | # CONFIG_SENSORS_ABITUGURU3 is not set | ||
| 901 | # CONFIG_SENSORS_AD7418 is not set | 951 | # CONFIG_SENSORS_AD7418 is not set |
| 902 | # CONFIG_SENSORS_ADM1021 is not set | 952 | # CONFIG_SENSORS_ADM1021 is not set |
| 903 | # CONFIG_SENSORS_ADM1025 is not set | 953 | # CONFIG_SENSORS_ADM1025 is not set |
| @@ -905,12 +955,12 @@ CONFIG_HWMON_VID=y | |||
| 905 | # CONFIG_SENSORS_ADM1029 is not set | 955 | # CONFIG_SENSORS_ADM1029 is not set |
| 906 | # CONFIG_SENSORS_ADM1031 is not set | 956 | # CONFIG_SENSORS_ADM1031 is not set |
| 907 | # CONFIG_SENSORS_ADM9240 is not set | 957 | # CONFIG_SENSORS_ADM9240 is not set |
| 908 | # CONFIG_SENSORS_ASB100 is not set | 958 | # CONFIG_SENSORS_ADT7470 is not set |
| 909 | # CONFIG_SENSORS_ATXP1 is not set | 959 | # CONFIG_SENSORS_ATXP1 is not set |
| 910 | # CONFIG_SENSORS_DS1621 is not set | 960 | # CONFIG_SENSORS_DS1621 is not set |
| 911 | # CONFIG_SENSORS_F71805F is not set | 961 | # CONFIG_SENSORS_F71805F is not set |
| 912 | # CONFIG_SENSORS_FSCHER is not set | 962 | # CONFIG_SENSORS_F71882FG is not set |
| 913 | # CONFIG_SENSORS_FSCPOS is not set | 963 | # CONFIG_SENSORS_F75375S is not set |
| 914 | # CONFIG_SENSORS_GL518SM is not set | 964 | # CONFIG_SENSORS_GL518SM is not set |
| 915 | # CONFIG_SENSORS_GL520SM is not set | 965 | # CONFIG_SENSORS_GL520SM is not set |
| 916 | # CONFIG_SENSORS_IT87 is not set | 966 | # CONFIG_SENSORS_IT87 is not set |
| @@ -946,6 +996,13 @@ CONFIG_SENSORS_LM90=y | |||
| 946 | # CONFIG_SENSORS_W83627HF is not set | 996 | # CONFIG_SENSORS_W83627HF is not set |
| 947 | # CONFIG_SENSORS_W83627EHF is not set | 997 | # CONFIG_SENSORS_W83627EHF is not set |
| 948 | # CONFIG_HWMON_DEBUG_CHIP is not set | 998 | # CONFIG_HWMON_DEBUG_CHIP is not set |
| 999 | # CONFIG_WATCHDOG is not set | ||
| 1000 | |||
| 1001 | # | ||
| 1002 | # Sonics Silicon Backplane | ||
| 1003 | # | ||
| 1004 | CONFIG_SSB_POSSIBLE=y | ||
| 1005 | # CONFIG_SSB is not set | ||
| 949 | 1006 | ||
| 950 | # | 1007 | # |
| 951 | # Multifunction device drivers | 1008 | # Multifunction device drivers |
| @@ -963,14 +1020,14 @@ CONFIG_DAB=y | |||
| 963 | # | 1020 | # |
| 964 | # Graphics support | 1021 | # Graphics support |
| 965 | # | 1022 | # |
| 966 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 1023 | # CONFIG_AGP is not set |
| 967 | CONFIG_LCD_CLASS_DEVICE=m | 1024 | CONFIG_DRM=y |
| 968 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | 1025 | # CONFIG_DRM_TDFX is not set |
| 969 | 1026 | # CONFIG_DRM_R128 is not set | |
| 970 | # | 1027 | CONFIG_DRM_RADEON=y |
| 971 | # Display device support | 1028 | # CONFIG_DRM_MGA is not set |
| 972 | # | 1029 | # CONFIG_DRM_VIA is not set |
| 973 | # CONFIG_DISPLAY_SUPPORT is not set | 1030 | # CONFIG_DRM_SAVAGE is not set |
| 974 | CONFIG_VGASTATE=y | 1031 | CONFIG_VGASTATE=y |
| 975 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set | 1032 | # CONFIG_VIDEO_OUTPUT_CONTROL is not set |
| 976 | CONFIG_FB=y | 1033 | CONFIG_FB=y |
| @@ -979,6 +1036,7 @@ CONFIG_FB_DDC=y | |||
| 979 | CONFIG_FB_CFB_FILLRECT=y | 1036 | CONFIG_FB_CFB_FILLRECT=y |
| 980 | CONFIG_FB_CFB_COPYAREA=y | 1037 | CONFIG_FB_CFB_COPYAREA=y |
| 981 | CONFIG_FB_CFB_IMAGEBLIT=y | 1038 | CONFIG_FB_CFB_IMAGEBLIT=y |
| 1039 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
| 982 | # CONFIG_FB_SYS_FILLRECT is not set | 1040 | # CONFIG_FB_SYS_FILLRECT is not set |
| 983 | # CONFIG_FB_SYS_COPYAREA is not set | 1041 | # CONFIG_FB_SYS_COPYAREA is not set |
| 984 | # CONFIG_FB_SYS_IMAGEBLIT is not set | 1042 | # CONFIG_FB_SYS_IMAGEBLIT is not set |
| @@ -1026,6 +1084,15 @@ CONFIG_FB_RADEON_BACKLIGHT=y | |||
| 1026 | # CONFIG_FB_PM3 is not set | 1084 | # CONFIG_FB_PM3 is not set |
| 1027 | # CONFIG_FB_IBM_GXT4500 is not set | 1085 | # CONFIG_FB_IBM_GXT4500 is not set |
| 1028 | # CONFIG_FB_VIRTUAL is not set | 1086 | # CONFIG_FB_VIRTUAL is not set |
| 1087 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 1088 | # CONFIG_LCD_CLASS_DEVICE is not set | ||
| 1089 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 1090 | # CONFIG_BACKLIGHT_CORGI is not set | ||
| 1091 | |||
| 1092 | # | ||
| 1093 | # Display device support | ||
| 1094 | # | ||
| 1095 | # CONFIG_DISPLAY_SUPPORT is not set | ||
| 1029 | 1096 | ||
| 1030 | # | 1097 | # |
| 1031 | # Console display driver support | 1098 | # Console display driver support |
| @@ -1178,6 +1245,7 @@ CONFIG_SND_USB_USX2Y=y | |||
| 1178 | CONFIG_HID_SUPPORT=y | 1245 | CONFIG_HID_SUPPORT=y |
| 1179 | CONFIG_HID=y | 1246 | CONFIG_HID=y |
| 1180 | # CONFIG_HID_DEBUG is not set | 1247 | # CONFIG_HID_DEBUG is not set |
| 1248 | # CONFIG_HIDRAW is not set | ||
| 1181 | 1249 | ||
| 1182 | # | 1250 | # |
| 1183 | # USB Input Devices | 1251 | # USB Input Devices |
| @@ -1328,6 +1396,7 @@ CONFIG_RTC_INTF_DEV=y | |||
| 1328 | # I2C RTC drivers | 1396 | # I2C RTC drivers |
| 1329 | # | 1397 | # |
| 1330 | CONFIG_RTC_DRV_DS1307=y | 1398 | CONFIG_RTC_DRV_DS1307=y |
| 1399 | # CONFIG_RTC_DRV_DS1374 is not set | ||
| 1331 | # CONFIG_RTC_DRV_DS1672 is not set | 1400 | # CONFIG_RTC_DRV_DS1672 is not set |
| 1332 | # CONFIG_RTC_DRV_MAX6900 is not set | 1401 | # CONFIG_RTC_DRV_MAX6900 is not set |
| 1333 | # CONFIG_RTC_DRV_RS5C372 is not set | 1402 | # CONFIG_RTC_DRV_RS5C372 is not set |
| @@ -1357,19 +1426,6 @@ CONFIG_RTC_DRV_DS1307=y | |||
| 1357 | # | 1426 | # |
| 1358 | 1427 | ||
| 1359 | # | 1428 | # |
| 1360 | # DMA Engine support | ||
| 1361 | # | ||
| 1362 | # CONFIG_DMA_ENGINE is not set | ||
| 1363 | |||
| 1364 | # | ||
| 1365 | # DMA Clients | ||
| 1366 | # | ||
| 1367 | |||
| 1368 | # | ||
| 1369 | # DMA Devices | ||
| 1370 | # | ||
| 1371 | |||
| 1372 | # | ||
| 1373 | # Userspace I/O | 1429 | # Userspace I/O |
| 1374 | # | 1430 | # |
| 1375 | # CONFIG_UIO is not set | 1431 | # CONFIG_UIO is not set |
| @@ -1388,7 +1444,6 @@ CONFIG_EXT3_FS_XATTR=y | |||
| 1388 | # CONFIG_EXT3_FS_SECURITY is not set | 1444 | # CONFIG_EXT3_FS_SECURITY is not set |
| 1389 | # CONFIG_EXT4DEV_FS is not set | 1445 | # CONFIG_EXT4DEV_FS is not set |
| 1390 | CONFIG_JBD=y | 1446 | CONFIG_JBD=y |
| 1391 | # CONFIG_JBD_DEBUG is not set | ||
| 1392 | CONFIG_FS_MBCACHE=y | 1447 | CONFIG_FS_MBCACHE=y |
| 1393 | # CONFIG_REISERFS_FS is not set | 1448 | # CONFIG_REISERFS_FS is not set |
| 1394 | # CONFIG_JFS_FS is not set | 1449 | # CONFIG_JFS_FS is not set |
| @@ -1436,7 +1491,6 @@ CONFIG_TMPFS=y | |||
| 1436 | # CONFIG_TMPFS_POSIX_ACL is not set | 1491 | # CONFIG_TMPFS_POSIX_ACL is not set |
| 1437 | CONFIG_HUGETLBFS=y | 1492 | CONFIG_HUGETLBFS=y |
| 1438 | CONFIG_HUGETLB_PAGE=y | 1493 | CONFIG_HUGETLB_PAGE=y |
| 1439 | CONFIG_RAMFS=y | ||
| 1440 | CONFIG_CONFIGFS_FS=y | 1494 | CONFIG_CONFIGFS_FS=y |
| 1441 | 1495 | ||
| 1442 | # | 1496 | # |
| @@ -1449,30 +1503,43 @@ CONFIG_CONFIGFS_FS=y | |||
| 1449 | # CONFIG_BEFS_FS is not set | 1503 | # CONFIG_BEFS_FS is not set |
| 1450 | # CONFIG_BFS_FS is not set | 1504 | # CONFIG_BFS_FS is not set |
| 1451 | # CONFIG_EFS_FS is not set | 1505 | # CONFIG_EFS_FS is not set |
| 1452 | # CONFIG_JFFS2_FS is not set | 1506 | CONFIG_JFFS2_FS=y |
| 1507 | CONFIG_JFFS2_FS_DEBUG=0 | ||
| 1508 | CONFIG_JFFS2_FS_WRITEBUFFER=y | ||
| 1509 | # CONFIG_JFFS2_FS_WBUF_VERIFY is not set | ||
| 1510 | # CONFIG_JFFS2_SUMMARY is not set | ||
| 1511 | # CONFIG_JFFS2_FS_XATTR is not set | ||
| 1512 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | ||
| 1513 | CONFIG_JFFS2_ZLIB=y | ||
| 1514 | # CONFIG_JFFS2_LZO is not set | ||
| 1515 | CONFIG_JFFS2_RTIME=y | ||
| 1516 | # CONFIG_JFFS2_RUBIN is not set | ||
| 1453 | # CONFIG_CRAMFS is not set | 1517 | # CONFIG_CRAMFS is not set |
| 1454 | # CONFIG_VXFS_FS is not set | 1518 | # CONFIG_VXFS_FS is not set |
| 1455 | # CONFIG_HPFS_FS is not set | 1519 | # CONFIG_HPFS_FS is not set |
| 1456 | # CONFIG_QNX4FS_FS is not set | 1520 | # CONFIG_QNX4FS_FS is not set |
| 1457 | # CONFIG_SYSV_FS is not set | 1521 | # CONFIG_SYSV_FS is not set |
| 1458 | # CONFIG_UFS_FS is not set | 1522 | # CONFIG_UFS_FS is not set |
| 1459 | 1523 | CONFIG_NETWORK_FILESYSTEMS=y | |
| 1460 | # | ||
| 1461 | # Network File Systems | ||
| 1462 | # | ||
| 1463 | CONFIG_NFS_FS=y | 1524 | CONFIG_NFS_FS=y |
| 1464 | CONFIG_NFS_V3=y | 1525 | CONFIG_NFS_V3=y |
| 1465 | # CONFIG_NFS_V3_ACL is not set | 1526 | # CONFIG_NFS_V3_ACL is not set |
| 1466 | # CONFIG_NFS_V4 is not set | 1527 | # CONFIG_NFS_V4 is not set |
| 1467 | # CONFIG_NFS_DIRECTIO is not set | 1528 | # CONFIG_NFS_DIRECTIO is not set |
| 1468 | # CONFIG_NFSD is not set | 1529 | CONFIG_NFSD=y |
| 1530 | CONFIG_NFSD_V3=y | ||
| 1531 | # CONFIG_NFSD_V3_ACL is not set | ||
| 1532 | CONFIG_NFSD_V4=y | ||
| 1533 | CONFIG_NFSD_TCP=y | ||
| 1469 | CONFIG_ROOT_NFS=y | 1534 | CONFIG_ROOT_NFS=y |
| 1470 | CONFIG_LOCKD=y | 1535 | CONFIG_LOCKD=y |
| 1471 | CONFIG_LOCKD_V4=y | 1536 | CONFIG_LOCKD_V4=y |
| 1537 | CONFIG_EXPORTFS=y | ||
| 1472 | CONFIG_NFS_COMMON=y | 1538 | CONFIG_NFS_COMMON=y |
| 1473 | CONFIG_SUNRPC=y | 1539 | CONFIG_SUNRPC=y |
| 1540 | CONFIG_SUNRPC_GSS=y | ||
| 1474 | # CONFIG_SUNRPC_BIND34 is not set | 1541 | # CONFIG_SUNRPC_BIND34 is not set |
| 1475 | # CONFIG_RPCSEC_GSS_KRB5 is not set | 1542 | CONFIG_RPCSEC_GSS_KRB5=y |
| 1476 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 1543 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
| 1477 | # CONFIG_SMB_FS is not set | 1544 | # CONFIG_SMB_FS is not set |
| 1478 | # CONFIG_CIFS is not set | 1545 | # CONFIG_CIFS is not set |
| @@ -1501,10 +1568,6 @@ CONFIG_MSDOS_PARTITION=y | |||
| 1501 | # CONFIG_KARMA_PARTITION is not set | 1568 | # CONFIG_KARMA_PARTITION is not set |
| 1502 | # CONFIG_EFI_PARTITION is not set | 1569 | # CONFIG_EFI_PARTITION is not set |
| 1503 | # CONFIG_SYSV68_PARTITION is not set | 1570 | # CONFIG_SYSV68_PARTITION is not set |
| 1504 | |||
| 1505 | # | ||
| 1506 | # Native Language Support | ||
| 1507 | # | ||
| 1508 | CONFIG_NLS=y | 1571 | CONFIG_NLS=y |
| 1509 | CONFIG_NLS_DEFAULT="iso8859-1" | 1572 | CONFIG_NLS_DEFAULT="iso8859-1" |
| 1510 | CONFIG_NLS_CODEPAGE_437=y | 1573 | CONFIG_NLS_CODEPAGE_437=y |
| @@ -1545,10 +1608,6 @@ CONFIG_NLS_ISO8859_1=y | |||
| 1545 | # CONFIG_NLS_KOI8_R is not set | 1608 | # CONFIG_NLS_KOI8_R is not set |
| 1546 | # CONFIG_NLS_KOI8_U is not set | 1609 | # CONFIG_NLS_KOI8_U is not set |
| 1547 | # CONFIG_NLS_UTF8 is not set | 1610 | # CONFIG_NLS_UTF8 is not set |
| 1548 | |||
| 1549 | # | ||
| 1550 | # Distributed Lock Manager | ||
| 1551 | # | ||
| 1552 | # CONFIG_DLM is not set | 1611 | # CONFIG_DLM is not set |
| 1553 | # CONFIG_UCC_SLOW is not set | 1612 | # CONFIG_UCC_SLOW is not set |
| 1554 | 1613 | ||
| @@ -1561,23 +1620,24 @@ CONFIG_CRC_CCITT=y | |||
| 1561 | # CONFIG_CRC_ITU_T is not set | 1620 | # CONFIG_CRC_ITU_T is not set |
| 1562 | CONFIG_CRC32=y | 1621 | CONFIG_CRC32=y |
| 1563 | # CONFIG_CRC7 is not set | 1622 | # CONFIG_CRC7 is not set |
| 1564 | # CONFIG_LIBCRC32C is not set | 1623 | CONFIG_LIBCRC32C=m |
| 1624 | CONFIG_ZLIB_INFLATE=y | ||
| 1625 | CONFIG_ZLIB_DEFLATE=y | ||
| 1565 | CONFIG_PLIST=y | 1626 | CONFIG_PLIST=y |
| 1566 | CONFIG_HAS_IOMEM=y | 1627 | CONFIG_HAS_IOMEM=y |
| 1567 | CONFIG_HAS_IOPORT=y | 1628 | CONFIG_HAS_IOPORT=y |
| 1568 | CONFIG_HAS_DMA=y | 1629 | CONFIG_HAS_DMA=y |
| 1569 | 1630 | CONFIG_INSTRUMENTATION=y | |
| 1570 | # | ||
| 1571 | # Instrumentation Support | ||
| 1572 | # | ||
| 1573 | CONFIG_PROFILING=y | 1631 | CONFIG_PROFILING=y |
| 1574 | CONFIG_OPROFILE=y | 1632 | CONFIG_OPROFILE=y |
| 1575 | # CONFIG_KPROBES is not set | 1633 | # CONFIG_KPROBES is not set |
| 1634 | # CONFIG_MARKERS is not set | ||
| 1576 | 1635 | ||
| 1577 | # | 1636 | # |
| 1578 | # Kernel hacking | 1637 | # Kernel hacking |
| 1579 | # | 1638 | # |
| 1580 | # CONFIG_PRINTK_TIME is not set | 1639 | # CONFIG_PRINTK_TIME is not set |
| 1640 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 1581 | CONFIG_ENABLE_MUST_CHECK=y | 1641 | CONFIG_ENABLE_MUST_CHECK=y |
| 1582 | CONFIG_MAGIC_SYSRQ=y | 1642 | CONFIG_MAGIC_SYSRQ=y |
| 1583 | # CONFIG_UNUSED_SYMBOLS is not set | 1643 | # CONFIG_UNUSED_SYMBOLS is not set |
| @@ -1586,7 +1646,7 @@ CONFIG_MAGIC_SYSRQ=y | |||
| 1586 | CONFIG_DEBUG_KERNEL=y | 1646 | CONFIG_DEBUG_KERNEL=y |
| 1587 | # CONFIG_DEBUG_SHIRQ is not set | 1647 | # CONFIG_DEBUG_SHIRQ is not set |
| 1588 | CONFIG_DETECT_SOFTLOCKUP=y | 1648 | CONFIG_DETECT_SOFTLOCKUP=y |
| 1589 | CONFIG_SCHED_DEBUG=y | 1649 | # CONFIG_SCHED_DEBUG is not set |
| 1590 | # CONFIG_SCHEDSTATS is not set | 1650 | # CONFIG_SCHEDSTATS is not set |
| 1591 | # CONFIG_TIMER_STATS is not set | 1651 | # CONFIG_TIMER_STATS is not set |
| 1592 | # CONFIG_SLUB_DEBUG_ON is not set | 1652 | # CONFIG_SLUB_DEBUG_ON is not set |
| @@ -1601,9 +1661,12 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
| 1601 | # CONFIG_DEBUG_INFO is not set | 1661 | # CONFIG_DEBUG_INFO is not set |
| 1602 | # CONFIG_DEBUG_VM is not set | 1662 | # CONFIG_DEBUG_VM is not set |
| 1603 | # CONFIG_DEBUG_LIST is not set | 1663 | # CONFIG_DEBUG_LIST is not set |
| 1664 | # CONFIG_DEBUG_SG is not set | ||
| 1604 | # CONFIG_FORCED_INLINING is not set | 1665 | # CONFIG_FORCED_INLINING is not set |
| 1666 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 1605 | # CONFIG_RCU_TORTURE_TEST is not set | 1667 | # CONFIG_RCU_TORTURE_TEST is not set |
| 1606 | # CONFIG_FAULT_INJECTION is not set | 1668 | # CONFIG_FAULT_INJECTION is not set |
| 1669 | # CONFIG_SAMPLES is not set | ||
| 1607 | # CONFIG_DEBUG_STACKOVERFLOW is not set | 1670 | # CONFIG_DEBUG_STACKOVERFLOW is not set |
| 1608 | # CONFIG_DEBUG_STACK_USAGE is not set | 1671 | # CONFIG_DEBUG_STACK_USAGE is not set |
| 1609 | # CONFIG_DEBUG_PAGEALLOC is not set | 1672 | # CONFIG_DEBUG_PAGEALLOC is not set |
| @@ -1620,6 +1683,7 @@ CONFIG_XMON_DISASSEMBLY=y | |||
| 1620 | # | 1683 | # |
| 1621 | # CONFIG_KEYS is not set | 1684 | # CONFIG_KEYS is not set |
| 1622 | # CONFIG_SECURITY is not set | 1685 | # CONFIG_SECURITY is not set |
| 1686 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 1623 | CONFIG_CRYPTO=y | 1687 | CONFIG_CRYPTO=y |
| 1624 | CONFIG_CRYPTO_ALGAPI=y | 1688 | CONFIG_CRYPTO_ALGAPI=y |
| 1625 | CONFIG_CRYPTO_BLKCIPHER=y | 1689 | CONFIG_CRYPTO_BLKCIPHER=y |
| @@ -1628,34 +1692,38 @@ CONFIG_CRYPTO_MANAGER=y | |||
| 1628 | CONFIG_CRYPTO_HMAC=y | 1692 | CONFIG_CRYPTO_HMAC=y |
| 1629 | # CONFIG_CRYPTO_XCBC is not set | 1693 | # CONFIG_CRYPTO_XCBC is not set |
| 1630 | # CONFIG_CRYPTO_NULL is not set | 1694 | # CONFIG_CRYPTO_NULL is not set |
| 1631 | # CONFIG_CRYPTO_MD4 is not set | 1695 | CONFIG_CRYPTO_MD4=y |
| 1632 | CONFIG_CRYPTO_MD5=y | 1696 | CONFIG_CRYPTO_MD5=y |
| 1633 | CONFIG_CRYPTO_SHA1=y | 1697 | CONFIG_CRYPTO_SHA1=y |
| 1634 | # CONFIG_CRYPTO_SHA256 is not set | 1698 | CONFIG_CRYPTO_SHA256=y |
| 1635 | # CONFIG_CRYPTO_SHA512 is not set | 1699 | CONFIG_CRYPTO_SHA512=y |
| 1636 | # CONFIG_CRYPTO_WP512 is not set | 1700 | # CONFIG_CRYPTO_WP512 is not set |
| 1637 | # CONFIG_CRYPTO_TGR192 is not set | 1701 | # CONFIG_CRYPTO_TGR192 is not set |
| 1638 | # CONFIG_CRYPTO_GF128MUL is not set | 1702 | # CONFIG_CRYPTO_GF128MUL is not set |
| 1639 | CONFIG_CRYPTO_ECB=m | 1703 | # CONFIG_CRYPTO_ECB is not set |
| 1640 | CONFIG_CRYPTO_CBC=y | 1704 | CONFIG_CRYPTO_CBC=y |
| 1641 | CONFIG_CRYPTO_PCBC=m | 1705 | # CONFIG_CRYPTO_PCBC is not set |
| 1642 | # CONFIG_CRYPTO_LRW is not set | 1706 | # CONFIG_CRYPTO_LRW is not set |
| 1707 | # CONFIG_CRYPTO_XTS is not set | ||
| 1643 | # CONFIG_CRYPTO_CRYPTD is not set | 1708 | # CONFIG_CRYPTO_CRYPTD is not set |
| 1644 | CONFIG_CRYPTO_DES=y | 1709 | CONFIG_CRYPTO_DES=y |
| 1645 | # CONFIG_CRYPTO_FCRYPT is not set | 1710 | # CONFIG_CRYPTO_FCRYPT is not set |
| 1646 | # CONFIG_CRYPTO_BLOWFISH is not set | 1711 | CONFIG_CRYPTO_BLOWFISH=y |
| 1647 | # CONFIG_CRYPTO_TWOFISH is not set | 1712 | # CONFIG_CRYPTO_TWOFISH is not set |
| 1648 | # CONFIG_CRYPTO_SERPENT is not set | 1713 | # CONFIG_CRYPTO_SERPENT is not set |
| 1649 | # CONFIG_CRYPTO_AES is not set | 1714 | CONFIG_CRYPTO_AES=y |
| 1650 | # CONFIG_CRYPTO_CAST5 is not set | 1715 | # CONFIG_CRYPTO_CAST5 is not set |
| 1651 | # CONFIG_CRYPTO_CAST6 is not set | 1716 | # CONFIG_CRYPTO_CAST6 is not set |
| 1652 | # CONFIG_CRYPTO_TEA is not set | 1717 | # CONFIG_CRYPTO_TEA is not set |
| 1653 | # CONFIG_CRYPTO_ARC4 is not set | 1718 | # CONFIG_CRYPTO_ARC4 is not set |
| 1654 | # CONFIG_CRYPTO_KHAZAD is not set | 1719 | # CONFIG_CRYPTO_KHAZAD is not set |
| 1655 | # CONFIG_CRYPTO_ANUBIS is not set | 1720 | # CONFIG_CRYPTO_ANUBIS is not set |
| 1721 | # CONFIG_CRYPTO_SEED is not set | ||
| 1656 | # CONFIG_CRYPTO_DEFLATE is not set | 1722 | # CONFIG_CRYPTO_DEFLATE is not set |
| 1657 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 1723 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
| 1658 | # CONFIG_CRYPTO_CRC32C is not set | 1724 | # CONFIG_CRYPTO_CRC32C is not set |
| 1659 | # CONFIG_CRYPTO_CAMELLIA is not set | 1725 | # CONFIG_CRYPTO_CAMELLIA is not set |
| 1660 | # CONFIG_CRYPTO_TEST is not set | 1726 | # CONFIG_CRYPTO_TEST is not set |
| 1661 | # CONFIG_CRYPTO_HW is not set | 1727 | # CONFIG_CRYPTO_AUTHENC is not set |
| 1728 | CONFIG_CRYPTO_HW=y | ||
| 1729 | # CONFIG_PPC_CLOCK is not set | ||
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index 05582af50c5b..3e90c835fe12 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # | 1 | # |
| 2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
| 3 | # Linux kernel version: 2.6.23-rc4 | 3 | # Linux kernel version: 2.6.24-rc2 |
| 4 | # Thu Aug 30 16:47:09 2007 | 4 | # Tue Nov 6 23:43:56 2007 |
| 5 | # | 5 | # |
| 6 | CONFIG_PPC64=y | 6 | CONFIG_PPC64=y |
| 7 | 7 | ||
| @@ -11,6 +11,7 @@ CONFIG_PPC64=y | |||
| 11 | # CONFIG_POWER4_ONLY is not set | 11 | # CONFIG_POWER4_ONLY is not set |
| 12 | CONFIG_POWER3=y | 12 | CONFIG_POWER3=y |
| 13 | CONFIG_POWER4=y | 13 | CONFIG_POWER4=y |
| 14 | # CONFIG_TUNE_CELL is not set | ||
| 14 | CONFIG_PPC_FPU=y | 15 | CONFIG_PPC_FPU=y |
| 15 | CONFIG_ALTIVEC=y | 16 | CONFIG_ALTIVEC=y |
| 16 | CONFIG_PPC_STD_MMU=y | 17 | CONFIG_PPC_STD_MMU=y |
| @@ -19,8 +20,13 @@ CONFIG_VIRT_CPU_ACCOUNTING=y | |||
| 19 | CONFIG_SMP=y | 20 | CONFIG_SMP=y |
| 20 | CONFIG_NR_CPUS=32 | 21 | CONFIG_NR_CPUS=32 |
| 21 | CONFIG_64BIT=y | 22 | CONFIG_64BIT=y |
| 23 | CONFIG_WORD_SIZE=64 | ||
| 22 | CONFIG_PPC_MERGE=y | 24 | CONFIG_PPC_MERGE=y |
| 23 | CONFIG_MMU=y | 25 | CONFIG_MMU=y |
| 26 | CONFIG_GENERIC_CMOS_UPDATE=y | ||
| 27 | CONFIG_GENERIC_TIME=y | ||
| 28 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
| 29 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
| 24 | CONFIG_GENERIC_HARDIRQS=y | 30 | CONFIG_GENERIC_HARDIRQS=y |
| 25 | CONFIG_IRQ_PER_CPU=y | 31 | CONFIG_IRQ_PER_CPU=y |
| 26 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | 32 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y |
| @@ -72,8 +78,15 @@ CONFIG_IKCONFIG=y | |||
| 72 | CONFIG_IKCONFIG_PROC=y | 78 | CONFIG_IKCONFIG_PROC=y |
| 73 | CONFIG_LOG_BUF_SHIFT=17 | 79 | CONFIG_LOG_BUF_SHIFT=17 |
| 74 | CONFIG_CGROUPS=y | 80 | CONFIG_CGROUPS=y |
| 81 | # CONFIG_CGROUP_DEBUG is not set | ||
| 82 | # CONFIG_CGROUP_NS is not set | ||
| 83 | # CONFIG_CGROUP_CPUACCT is not set | ||
| 75 | CONFIG_CPUSETS=y | 84 | CONFIG_CPUSETS=y |
| 85 | CONFIG_FAIR_GROUP_SCHED=y | ||
| 86 | CONFIG_FAIR_USER_SCHED=y | ||
| 87 | # CONFIG_FAIR_CGROUP_SCHED is not set | ||
| 76 | CONFIG_SYSFS_DEPRECATED=y | 88 | CONFIG_SYSFS_DEPRECATED=y |
| 89 | CONFIG_PROC_PID_CPUSET=y | ||
| 77 | CONFIG_RELAY=y | 90 | CONFIG_RELAY=y |
| 78 | CONFIG_BLK_DEV_INITRD=y | 91 | CONFIG_BLK_DEV_INITRD=y |
| 79 | CONFIG_INITRAMFS_SOURCE="" | 92 | CONFIG_INITRAMFS_SOURCE="" |
| @@ -93,7 +106,6 @@ CONFIG_FUTEX=y | |||
| 93 | CONFIG_ANON_INODES=y | 106 | CONFIG_ANON_INODES=y |
| 94 | CONFIG_EPOLL=y | 107 | CONFIG_EPOLL=y |
| 95 | CONFIG_SIGNALFD=y | 108 | CONFIG_SIGNALFD=y |
| 96 | CONFIG_TIMERFD=y | ||
| 97 | CONFIG_EVENTFD=y | 109 | CONFIG_EVENTFD=y |
| 98 | CONFIG_SHMEM=y | 110 | CONFIG_SHMEM=y |
| 99 | CONFIG_VM_EVENT_COUNTERS=y | 111 | CONFIG_VM_EVENT_COUNTERS=y |
| @@ -114,6 +126,7 @@ CONFIG_STOP_MACHINE=y | |||
| 114 | CONFIG_BLOCK=y | 126 | CONFIG_BLOCK=y |
| 115 | CONFIG_BLK_DEV_IO_TRACE=y | 127 | CONFIG_BLK_DEV_IO_TRACE=y |
| 116 | CONFIG_BLK_DEV_BSG=y | 128 | CONFIG_BLK_DEV_BSG=y |
| 129 | CONFIG_BLOCK_COMPAT=y | ||
| 117 | 130 | ||
| 118 | # | 131 | # |
| 119 | # IO Schedulers | 132 | # IO Schedulers |
| @@ -132,7 +145,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" | |||
| 132 | # Platform support | 145 | # Platform support |
| 133 | # | 146 | # |
| 134 | CONFIG_PPC_MULTIPLATFORM=y | 147 | CONFIG_PPC_MULTIPLATFORM=y |
| 135 | # CONFIG_EMBEDDED6xx is not set | ||
| 136 | # CONFIG_PPC_82xx is not set | 148 | # CONFIG_PPC_82xx is not set |
| 137 | # CONFIG_PPC_83xx is not set | 149 | # CONFIG_PPC_83xx is not set |
| 138 | # CONFIG_PPC_86xx is not set | 150 | # CONFIG_PPC_86xx is not set |
| @@ -155,7 +167,15 @@ CONFIG_VIOPATH=y | |||
| 155 | CONFIG_PPC_PMAC=y | 167 | CONFIG_PPC_PMAC=y |
| 156 | CONFIG_PPC_PMAC64=y | 168 | CONFIG_PPC_PMAC64=y |
| 157 | CONFIG_PPC_MAPLE=y | 169 | CONFIG_PPC_MAPLE=y |
| 158 | # CONFIG_PPC_PASEMI is not set | 170 | CONFIG_PPC_PASEMI=y |
| 171 | |||
| 172 | # | ||
| 173 | # PA Semi PWRficient options | ||
| 174 | # | ||
| 175 | CONFIG_PPC_PASEMI_IOMMU=y | ||
| 176 | # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set | ||
| 177 | CONFIG_PPC_PASEMI_MDIO=y | ||
| 178 | CONFIG_ELECTRA_IDE=y | ||
| 159 | CONFIG_PPC_CELLEB=y | 179 | CONFIG_PPC_CELLEB=y |
| 160 | # CONFIG_PPC_PS3 is not set | 180 | # CONFIG_PPC_PS3 is not set |
| 161 | CONFIG_PPC_CELL=y | 181 | CONFIG_PPC_CELL=y |
| @@ -188,6 +208,7 @@ CONFIG_RTAS_FLASH=m | |||
| 188 | CONFIG_PPC_PMI=m | 208 | CONFIG_PPC_PMI=m |
| 189 | CONFIG_MMIO_NVRAM=y | 209 | CONFIG_MMIO_NVRAM=y |
| 190 | CONFIG_MPIC_U3_HT_IRQS=y | 210 | CONFIG_MPIC_U3_HT_IRQS=y |
| 211 | CONFIG_MPIC_BROKEN_REGREAD=y | ||
| 191 | CONFIG_IBMVIO=y | 212 | CONFIG_IBMVIO=y |
| 192 | # CONFIG_IBMEBUS is not set | 213 | # CONFIG_IBMEBUS is not set |
| 193 | # CONFIG_PPC_MPC106 is not set | 214 | # CONFIG_PPC_MPC106 is not set |
| @@ -201,6 +222,8 @@ CONFIG_CPU_FREQ_STAT=y | |||
| 201 | # CONFIG_CPU_FREQ_STAT_DETAILS is not set | 222 | # CONFIG_CPU_FREQ_STAT_DETAILS is not set |
| 202 | CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y | 223 | CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y |
| 203 | # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set | 224 | # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set |
| 225 | # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set | ||
| 226 | # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set | ||
| 204 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y | 227 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y |
| 205 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y | 228 | CONFIG_CPU_FREQ_GOV_POWERSAVE=y |
| 206 | CONFIG_CPU_FREQ_GOV_USERSPACE=y | 229 | CONFIG_CPU_FREQ_GOV_USERSPACE=y |
| @@ -211,6 +234,7 @@ CONFIG_CPU_FREQ_GOV_USERSPACE=y | |||
| 211 | # CPU Frequency drivers | 234 | # CPU Frequency drivers |
| 212 | # | 235 | # |
| 213 | CONFIG_CPU_FREQ_PMAC64=y | 236 | CONFIG_CPU_FREQ_PMAC64=y |
| 237 | CONFIG_PPC_PASEMI_CPUFREQ=y | ||
| 214 | # CONFIG_CPM2 is not set | 238 | # CONFIG_CPM2 is not set |
| 215 | CONFIG_AXON_RAM=m | 239 | CONFIG_AXON_RAM=m |
| 216 | # CONFIG_FSL_ULI1575 is not set | 240 | # CONFIG_FSL_ULI1575 is not set |
| @@ -254,6 +278,8 @@ CONFIG_SPARSEMEM=y | |||
| 254 | CONFIG_HAVE_MEMORY_PRESENT=y | 278 | CONFIG_HAVE_MEMORY_PRESENT=y |
| 255 | # CONFIG_SPARSEMEM_STATIC is not set | 279 | # CONFIG_SPARSEMEM_STATIC is not set |
| 256 | CONFIG_SPARSEMEM_EXTREME=y | 280 | CONFIG_SPARSEMEM_EXTREME=y |
| 281 | CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y | ||
| 282 | CONFIG_SPARSEMEM_VMEMMAP=y | ||
| 257 | CONFIG_MEMORY_HOTPLUG=y | 283 | CONFIG_MEMORY_HOTPLUG=y |
| 258 | CONFIG_MEMORY_HOTPLUG_SPARSE=y | 284 | CONFIG_MEMORY_HOTPLUG_SPARSE=y |
| 259 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 285 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
| @@ -268,6 +294,7 @@ CONFIG_PROC_DEVICETREE=y | |||
| 268 | # CONFIG_CMDLINE_BOOL is not set | 294 | # CONFIG_CMDLINE_BOOL is not set |
| 269 | # CONFIG_PM is not set | 295 | # CONFIG_PM is not set |
| 270 | CONFIG_SUSPEND_SMP_POSSIBLE=y | 296 | CONFIG_SUSPEND_SMP_POSSIBLE=y |
| 297 | CONFIG_HIBERNATION_SMP_POSSIBLE=y | ||
| 271 | CONFIG_SECCOMP=y | 298 | CONFIG_SECCOMP=y |
| 272 | # CONFIG_WANT_DEVICE_TREE is not set | 299 | # CONFIG_WANT_DEVICE_TREE is not set |
| 273 | CONFIG_ISA_DMA_API=y | 300 | CONFIG_ISA_DMA_API=y |
| @@ -284,12 +311,22 @@ CONFIG_PCI_SYSCALL=y | |||
| 284 | # CONFIG_PCIEPORTBUS is not set | 311 | # CONFIG_PCIEPORTBUS is not set |
| 285 | CONFIG_ARCH_SUPPORTS_MSI=y | 312 | CONFIG_ARCH_SUPPORTS_MSI=y |
| 286 | CONFIG_PCI_MSI=y | 313 | CONFIG_PCI_MSI=y |
| 314 | CONFIG_PCI_LEGACY=y | ||
| 287 | # CONFIG_PCI_DEBUG is not set | 315 | # CONFIG_PCI_DEBUG is not set |
| 316 | CONFIG_PCCARD=y | ||
| 317 | # CONFIG_PCMCIA_DEBUG is not set | ||
| 318 | CONFIG_PCMCIA=y | ||
| 319 | CONFIG_PCMCIA_LOAD_CIS=y | ||
| 320 | CONFIG_PCMCIA_IOCTL=y | ||
| 321 | CONFIG_CARDBUS=y | ||
| 288 | 322 | ||
| 289 | # | 323 | # |
| 290 | # PCCARD (PCMCIA/CardBus) support | 324 | # PC-card bridges |
| 291 | # | 325 | # |
| 292 | # CONFIG_PCCARD is not set | 326 | # CONFIG_YENTA is not set |
| 327 | # CONFIG_PD6729 is not set | ||
| 328 | # CONFIG_I82092 is not set | ||
| 329 | CONFIG_ELECTRA_CF=y | ||
| 293 | CONFIG_HOTPLUG_PCI=m | 330 | CONFIG_HOTPLUG_PCI=m |
| 294 | # CONFIG_HOTPLUG_PCI_FAKE is not set | 331 | # CONFIG_HOTPLUG_PCI_FAKE is not set |
| 295 | # CONFIG_HOTPLUG_PCI_CPCI is not set | 332 | # CONFIG_HOTPLUG_PCI_CPCI is not set |
| @@ -319,7 +356,10 @@ CONFIG_INET=y | |||
| 319 | CONFIG_IP_MULTICAST=y | 356 | CONFIG_IP_MULTICAST=y |
| 320 | # CONFIG_IP_ADVANCED_ROUTER is not set | 357 | # CONFIG_IP_ADVANCED_ROUTER is not set |
| 321 | CONFIG_IP_FIB_HASH=y | 358 | CONFIG_IP_FIB_HASH=y |
| 322 | # CONFIG_IP_PNP is not set | 359 | CONFIG_IP_PNP=y |
| 360 | CONFIG_IP_PNP_DHCP=y | ||
| 361 | CONFIG_IP_PNP_BOOTP=y | ||
| 362 | # CONFIG_IP_PNP_RARP is not set | ||
| 323 | CONFIG_NET_IPIP=y | 363 | CONFIG_NET_IPIP=y |
| 324 | # CONFIG_NET_IPGRE is not set | 364 | # CONFIG_NET_IPGRE is not set |
| 325 | # CONFIG_IP_MROUTE is not set | 365 | # CONFIG_IP_MROUTE is not set |
| @@ -333,6 +373,7 @@ CONFIG_INET_TUNNEL=y | |||
| 333 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | 373 | CONFIG_INET_XFRM_MODE_TRANSPORT=y |
| 334 | CONFIG_INET_XFRM_MODE_TUNNEL=y | 374 | CONFIG_INET_XFRM_MODE_TUNNEL=y |
| 335 | CONFIG_INET_XFRM_MODE_BEET=y | 375 | CONFIG_INET_XFRM_MODE_BEET=y |
| 376 | # CONFIG_INET_LRO is not set | ||
| 336 | CONFIG_INET_DIAG=y | 377 | CONFIG_INET_DIAG=y |
| 337 | CONFIG_INET_TCP_DIAG=y | 378 | CONFIG_INET_TCP_DIAG=y |
| 338 | # CONFIG_TCP_CONG_ADVANCED is not set | 379 | # CONFIG_TCP_CONG_ADVANCED is not set |
| @@ -404,6 +445,7 @@ CONFIG_NETFILTER_XT_MATCH_STATE=m | |||
| 404 | CONFIG_NETFILTER_XT_MATCH_STATISTIC=m | 445 | CONFIG_NETFILTER_XT_MATCH_STATISTIC=m |
| 405 | CONFIG_NETFILTER_XT_MATCH_STRING=m | 446 | CONFIG_NETFILTER_XT_MATCH_STRING=m |
| 406 | CONFIG_NETFILTER_XT_MATCH_TCPMSS=m | 447 | CONFIG_NETFILTER_XT_MATCH_TCPMSS=m |
| 448 | # CONFIG_NETFILTER_XT_MATCH_TIME is not set | ||
| 407 | CONFIG_NETFILTER_XT_MATCH_U32=m | 449 | CONFIG_NETFILTER_XT_MATCH_U32=m |
| 408 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 450 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 409 | 451 | ||
| @@ -465,10 +507,6 @@ CONFIG_LLC=y | |||
| 465 | # CONFIG_LAPB is not set | 507 | # CONFIG_LAPB is not set |
| 466 | # CONFIG_ECONET is not set | 508 | # CONFIG_ECONET is not set |
| 467 | # CONFIG_WAN_ROUTER is not set | 509 | # CONFIG_WAN_ROUTER is not set |
| 468 | |||
| 469 | # | ||
| 470 | # QoS and/or fair queueing | ||
| 471 | # | ||
| 472 | # CONFIG_NET_SCHED is not set | 510 | # CONFIG_NET_SCHED is not set |
| 473 | CONFIG_NET_CLS_ROUTE=y | 511 | CONFIG_NET_CLS_ROUTE=y |
| 474 | 512 | ||
| @@ -498,6 +536,7 @@ CONFIG_NET_CLS_ROUTE=y | |||
| 498 | # | 536 | # |
| 499 | # Generic Driver Options | 537 | # Generic Driver Options |
| 500 | # | 538 | # |
| 539 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 501 | CONFIG_STANDALONE=y | 540 | CONFIG_STANDALONE=y |
| 502 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 541 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
| 503 | CONFIG_FW_LOADER=y | 542 | CONFIG_FW_LOADER=y |
| @@ -539,6 +578,8 @@ CONFIG_BLK_DEV_IDE=y | |||
| 539 | # CONFIG_BLK_DEV_IDE_SATA is not set | 578 | # CONFIG_BLK_DEV_IDE_SATA is not set |
| 540 | CONFIG_BLK_DEV_IDEDISK=y | 579 | CONFIG_BLK_DEV_IDEDISK=y |
| 541 | # CONFIG_IDEDISK_MULTI_MODE is not set | 580 | # CONFIG_IDEDISK_MULTI_MODE is not set |
| 581 | # CONFIG_BLK_DEV_IDECS is not set | ||
| 582 | # CONFIG_BLK_DEV_DELKIN is not set | ||
| 542 | CONFIG_BLK_DEV_IDECD=y | 583 | CONFIG_BLK_DEV_IDECD=y |
| 543 | # CONFIG_BLK_DEV_IDETAPE is not set | 584 | # CONFIG_BLK_DEV_IDETAPE is not set |
| 544 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | 585 | # CONFIG_BLK_DEV_IDEFLOPPY is not set |
| @@ -550,6 +591,11 @@ CONFIG_IDE_PROC_FS=y | |||
| 550 | # IDE chipset support/bugfixes | 591 | # IDE chipset support/bugfixes |
| 551 | # | 592 | # |
| 552 | CONFIG_IDE_GENERIC=y | 593 | CONFIG_IDE_GENERIC=y |
| 594 | # CONFIG_BLK_DEV_PLATFORM is not set | ||
| 595 | |||
| 596 | # | ||
| 597 | # PCI IDE chipsets support | ||
| 598 | # | ||
| 553 | CONFIG_BLK_DEV_IDEPCI=y | 599 | CONFIG_BLK_DEV_IDEPCI=y |
| 554 | CONFIG_IDEPCI_SHARE_IRQ=y | 600 | CONFIG_IDEPCI_SHARE_IRQ=y |
| 555 | CONFIG_IDEPCI_PCIBUS_ORDER=y | 601 | CONFIG_IDEPCI_PCIBUS_ORDER=y |
| @@ -557,8 +603,6 @@ CONFIG_IDEPCI_PCIBUS_ORDER=y | |||
| 557 | CONFIG_BLK_DEV_GENERIC=y | 603 | CONFIG_BLK_DEV_GENERIC=y |
| 558 | # CONFIG_BLK_DEV_OPTI621 is not set | 604 | # CONFIG_BLK_DEV_OPTI621 is not set |
| 559 | CONFIG_BLK_DEV_IDEDMA_PCI=y | 605 | CONFIG_BLK_DEV_IDEDMA_PCI=y |
| 560 | # CONFIG_BLK_DEV_IDEDMA_FORCED is not set | ||
| 561 | # CONFIG_IDEDMA_ONLYDISK is not set | ||
| 562 | # CONFIG_BLK_DEV_AEC62XX is not set | 606 | # CONFIG_BLK_DEV_AEC62XX is not set |
| 563 | # CONFIG_BLK_DEV_ALI15X3 is not set | 607 | # CONFIG_BLK_DEV_ALI15X3 is not set |
| 564 | CONFIG_BLK_DEV_AMD74XX=y | 608 | CONFIG_BLK_DEV_AMD74XX=y |
| @@ -590,7 +634,7 @@ CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y | |||
| 590 | CONFIG_BLK_DEV_IDEDMA_PMAC=y | 634 | CONFIG_BLK_DEV_IDEDMA_PMAC=y |
| 591 | # CONFIG_IDE_ARM is not set | 635 | # CONFIG_IDE_ARM is not set |
| 592 | CONFIG_BLK_DEV_IDEDMA=y | 636 | CONFIG_BLK_DEV_IDEDMA=y |
| 593 | # CONFIG_IDEDMA_IVB is not set | 637 | CONFIG_IDE_ARCH_OBSOLETE_INIT=y |
| 594 | # CONFIG_BLK_DEV_HD is not set | 638 | # CONFIG_BLK_DEV_HD is not set |
| 595 | 639 | ||
| 596 | # | 640 | # |
| @@ -631,6 +675,7 @@ CONFIG_SCSI_FC_ATTRS=y | |||
| 631 | CONFIG_SCSI_ISCSI_ATTRS=m | 675 | CONFIG_SCSI_ISCSI_ATTRS=m |
| 632 | # CONFIG_SCSI_SAS_ATTRS is not set | 676 | # CONFIG_SCSI_SAS_ATTRS is not set |
| 633 | # CONFIG_SCSI_SAS_LIBSAS is not set | 677 | # CONFIG_SCSI_SAS_LIBSAS is not set |
| 678 | CONFIG_SCSI_SRP_ATTRS=y | ||
| 634 | CONFIG_SCSI_LOWLEVEL=y | 679 | CONFIG_SCSI_LOWLEVEL=y |
| 635 | # CONFIG_ISCSI_TCP is not set | 680 | # CONFIG_ISCSI_TCP is not set |
| 636 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 681 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
| @@ -671,19 +716,20 @@ CONFIG_SCSI_LPFC=m | |||
| 671 | # CONFIG_SCSI_DC390T is not set | 716 | # CONFIG_SCSI_DC390T is not set |
| 672 | CONFIG_SCSI_DEBUG=m | 717 | CONFIG_SCSI_DEBUG=m |
| 673 | # CONFIG_SCSI_SRP is not set | 718 | # CONFIG_SCSI_SRP is not set |
| 719 | # CONFIG_SCSI_LOWLEVEL_PCMCIA is not set | ||
| 674 | CONFIG_ATA=y | 720 | CONFIG_ATA=y |
| 675 | CONFIG_ATA_NONSTANDARD=y | 721 | CONFIG_ATA_NONSTANDARD=y |
| 676 | # CONFIG_SATA_AHCI is not set | 722 | # CONFIG_SATA_AHCI is not set |
| 677 | CONFIG_SATA_SVW=y | 723 | CONFIG_SATA_SVW=y |
| 678 | # CONFIG_ATA_PIIX is not set | 724 | # CONFIG_ATA_PIIX is not set |
| 679 | # CONFIG_SATA_MV is not set | 725 | CONFIG_SATA_MV=y |
| 680 | # CONFIG_SATA_NV is not set | 726 | # CONFIG_SATA_NV is not set |
| 681 | # CONFIG_PDC_ADMA is not set | 727 | # CONFIG_PDC_ADMA is not set |
| 682 | # CONFIG_SATA_QSTOR is not set | 728 | # CONFIG_SATA_QSTOR is not set |
| 683 | # CONFIG_SATA_PROMISE is not set | 729 | # CONFIG_SATA_PROMISE is not set |
| 684 | # CONFIG_SATA_SX4 is not set | 730 | # CONFIG_SATA_SX4 is not set |
| 685 | # CONFIG_SATA_SIL is not set | 731 | # CONFIG_SATA_SIL is not set |
| 686 | # CONFIG_SATA_SIL24 is not set | 732 | CONFIG_SATA_SIL24=y |
| 687 | # CONFIG_SATA_SIS is not set | 733 | # CONFIG_SATA_SIS is not set |
| 688 | # CONFIG_SATA_ULI is not set | 734 | # CONFIG_SATA_ULI is not set |
| 689 | # CONFIG_SATA_VIA is not set | 735 | # CONFIG_SATA_VIA is not set |
| @@ -713,8 +759,10 @@ CONFIG_SATA_SVW=y | |||
| 713 | # CONFIG_PATA_OLDPIIX is not set | 759 | # CONFIG_PATA_OLDPIIX is not set |
| 714 | # CONFIG_PATA_NETCELL is not set | 760 | # CONFIG_PATA_NETCELL is not set |
| 715 | # CONFIG_PATA_NS87410 is not set | 761 | # CONFIG_PATA_NS87410 is not set |
| 762 | # CONFIG_PATA_NS87415 is not set | ||
| 716 | # CONFIG_PATA_OPTI is not set | 763 | # CONFIG_PATA_OPTI is not set |
| 717 | # CONFIG_PATA_OPTIDMA is not set | 764 | # CONFIG_PATA_OPTIDMA is not set |
| 765 | CONFIG_PATA_PCMCIA=y | ||
| 718 | # CONFIG_PATA_PDC_OLD is not set | 766 | # CONFIG_PATA_PDC_OLD is not set |
| 719 | # CONFIG_PATA_RADISYS is not set | 767 | # CONFIG_PATA_RADISYS is not set |
| 720 | # CONFIG_PATA_RZ1000 is not set | 768 | # CONFIG_PATA_RZ1000 is not set |
| @@ -725,6 +773,7 @@ CONFIG_SATA_SVW=y | |||
| 725 | # CONFIG_PATA_SIS is not set | 773 | # CONFIG_PATA_SIS is not set |
| 726 | # CONFIG_PATA_VIA is not set | 774 | # CONFIG_PATA_VIA is not set |
| 727 | CONFIG_PATA_WINBOND=y | 775 | CONFIG_PATA_WINBOND=y |
| 776 | CONFIG_PATA_PLATFORM=y | ||
| 728 | CONFIG_PATA_SCC=y | 777 | CONFIG_PATA_SCC=y |
| 729 | CONFIG_MD=y | 778 | CONFIG_MD=y |
| 730 | CONFIG_BLK_DEV_MD=y | 779 | CONFIG_BLK_DEV_MD=y |
| @@ -745,15 +794,10 @@ CONFIG_DM_ZERO=m | |||
| 745 | CONFIG_DM_MULTIPATH=m | 794 | CONFIG_DM_MULTIPATH=m |
| 746 | CONFIG_DM_MULTIPATH_EMC=m | 795 | CONFIG_DM_MULTIPATH_EMC=m |
| 747 | # CONFIG_DM_MULTIPATH_RDAC is not set | 796 | # CONFIG_DM_MULTIPATH_RDAC is not set |
| 797 | # CONFIG_DM_MULTIPATH_HP is not set | ||
| 748 | # CONFIG_DM_DELAY is not set | 798 | # CONFIG_DM_DELAY is not set |
| 749 | 799 | # CONFIG_DM_UEVENT is not set | |
| 750 | # | ||
| 751 | # Fusion MPT device support | ||
| 752 | # | ||
| 753 | # CONFIG_FUSION is not set | 800 | # CONFIG_FUSION is not set |
| 754 | # CONFIG_FUSION_SPI is not set | ||
| 755 | # CONFIG_FUSION_FC is not set | ||
| 756 | # CONFIG_FUSION_SAS is not set | ||
| 757 | 801 | ||
| 758 | # | 802 | # |
| 759 | # IEEE 1394 (FireWire) support | 803 | # IEEE 1394 (FireWire) support |
| @@ -800,13 +844,15 @@ CONFIG_BONDING=m | |||
| 800 | # CONFIG_MACVLAN is not set | 844 | # CONFIG_MACVLAN is not set |
| 801 | # CONFIG_EQUALIZER is not set | 845 | # CONFIG_EQUALIZER is not set |
| 802 | CONFIG_TUN=m | 846 | CONFIG_TUN=m |
| 847 | # CONFIG_VETH is not set | ||
| 848 | # CONFIG_IP1000 is not set | ||
| 803 | # CONFIG_ARCNET is not set | 849 | # CONFIG_ARCNET is not set |
| 804 | CONFIG_PHYLIB=m | 850 | CONFIG_PHYLIB=y |
| 805 | 851 | ||
| 806 | # | 852 | # |
| 807 | # MII PHY device drivers | 853 | # MII PHY device drivers |
| 808 | # | 854 | # |
| 809 | CONFIG_MARVELL_PHY=m | 855 | CONFIG_MARVELL_PHY=y |
| 810 | # CONFIG_DAVICOM_PHY is not set | 856 | # CONFIG_DAVICOM_PHY is not set |
| 811 | # CONFIG_QSEMI_PHY is not set | 857 | # CONFIG_QSEMI_PHY is not set |
| 812 | # CONFIG_LXT_PHY is not set | 858 | # CONFIG_LXT_PHY is not set |
| @@ -818,6 +864,9 @@ CONFIG_BROADCOM_PHY=m | |||
| 818 | CONFIG_FIXED_PHY=m | 864 | CONFIG_FIXED_PHY=m |
| 819 | CONFIG_FIXED_MII_10_FDX=y | 865 | CONFIG_FIXED_MII_10_FDX=y |
| 820 | CONFIG_FIXED_MII_100_FDX=y | 866 | CONFIG_FIXED_MII_100_FDX=y |
| 867 | # CONFIG_FIXED_MII_1000_FDX is not set | ||
| 868 | CONFIG_FIXED_MII_AMNT=1 | ||
| 869 | # CONFIG_MDIO_BITBANG is not set | ||
| 821 | CONFIG_NET_ETHERNET=y | 870 | CONFIG_NET_ETHERNET=y |
| 822 | CONFIG_MII=y | 871 | CONFIG_MII=y |
| 823 | # CONFIG_HAPPYMEAL is not set | 872 | # CONFIG_HAPPYMEAL is not set |
| @@ -829,6 +878,11 @@ CONFIG_VORTEX=y | |||
| 829 | # CONFIG_NET_TULIP is not set | 878 | # CONFIG_NET_TULIP is not set |
| 830 | # CONFIG_HP100 is not set | 879 | # CONFIG_HP100 is not set |
| 831 | CONFIG_IBMVETH=m | 880 | CONFIG_IBMVETH=m |
| 881 | # CONFIG_IBM_NEW_EMAC is not set | ||
| 882 | CONFIG_IBM_NEW_EMAC_ZMII=y | ||
| 883 | CONFIG_IBM_NEW_EMAC_RGMII=y | ||
| 884 | CONFIG_IBM_NEW_EMAC_TAH=y | ||
| 885 | CONFIG_IBM_NEW_EMAC_EMAC4=y | ||
| 832 | CONFIG_NET_PCI=y | 886 | CONFIG_NET_PCI=y |
| 833 | CONFIG_PCNET32=y | 887 | CONFIG_PCNET32=y |
| 834 | # CONFIG_PCNET32_NAPI is not set | 888 | # CONFIG_PCNET32_NAPI is not set |
| @@ -836,7 +890,6 @@ CONFIG_PCNET32=y | |||
| 836 | # CONFIG_ADAPTEC_STARFIRE is not set | 890 | # CONFIG_ADAPTEC_STARFIRE is not set |
| 837 | # CONFIG_B44 is not set | 891 | # CONFIG_B44 is not set |
| 838 | # CONFIG_FORCEDETH is not set | 892 | # CONFIG_FORCEDETH is not set |
| 839 | # CONFIG_DGRS is not set | ||
| 840 | # CONFIG_EEPRO100 is not set | 893 | # CONFIG_EEPRO100 is not set |
| 841 | CONFIG_E100=y | 894 | CONFIG_E100=y |
| 842 | # CONFIG_FEALNX is not set | 895 | # CONFIG_FEALNX is not set |
| @@ -856,6 +909,7 @@ CONFIG_ACENIC_OMIT_TIGON_I=y | |||
| 856 | CONFIG_E1000=y | 909 | CONFIG_E1000=y |
| 857 | # CONFIG_E1000_NAPI is not set | 910 | # CONFIG_E1000_NAPI is not set |
| 858 | # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set | 911 | # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set |
| 912 | # CONFIG_E1000E is not set | ||
| 859 | # CONFIG_NS83820 is not set | 913 | # CONFIG_NS83820 is not set |
| 860 | # CONFIG_HAMACHI is not set | 914 | # CONFIG_HAMACHI is not set |
| 861 | # CONFIG_YELLOWFIN is not set | 915 | # CONFIG_YELLOWFIN is not set |
| @@ -863,6 +917,7 @@ CONFIG_E1000=y | |||
| 863 | # CONFIG_SIS190 is not set | 917 | # CONFIG_SIS190 is not set |
| 864 | # CONFIG_SKGE is not set | 918 | # CONFIG_SKGE is not set |
| 865 | # CONFIG_SKY2 is not set | 919 | # CONFIG_SKY2 is not set |
| 920 | # CONFIG_SK98LIN is not set | ||
| 866 | # CONFIG_VIA_VELOCITY is not set | 921 | # CONFIG_VIA_VELOCITY is not set |
| 867 | CONFIG_TIGON3=y | 922 | CONFIG_TIGON3=y |
| 868 | # CONFIG_BNX2 is not set | 923 | # CONFIG_BNX2 is not set |
| @@ -872,13 +927,16 @@ CONFIG_SPIDER_NET=m | |||
| 872 | CONFIG_NETDEV_10000=y | 927 | CONFIG_NETDEV_10000=y |
| 873 | # CONFIG_CHELSIO_T1 is not set | 928 | # CONFIG_CHELSIO_T1 is not set |
| 874 | # CONFIG_CHELSIO_T3 is not set | 929 | # CONFIG_CHELSIO_T3 is not set |
| 930 | # CONFIG_IXGBE is not set | ||
| 875 | CONFIG_IXGB=m | 931 | CONFIG_IXGB=m |
| 876 | # CONFIG_IXGB_NAPI is not set | 932 | # CONFIG_IXGB_NAPI is not set |
| 877 | # CONFIG_S2IO is not set | 933 | # CONFIG_S2IO is not set |
| 878 | # CONFIG_MYRI10GE is not set | 934 | # CONFIG_MYRI10GE is not set |
| 879 | # CONFIG_NETXEN_NIC is not set | 935 | # CONFIG_NETXEN_NIC is not set |
| 880 | CONFIG_PASEMI_MAC=m | 936 | # CONFIG_NIU is not set |
| 937 | CONFIG_PASEMI_MAC=y | ||
| 881 | # CONFIG_MLX4_CORE is not set | 938 | # CONFIG_MLX4_CORE is not set |
| 939 | # CONFIG_TEHUTI is not set | ||
| 882 | CONFIG_TR=y | 940 | CONFIG_TR=y |
| 883 | CONFIG_IBMOL=y | 941 | CONFIG_IBMOL=y |
| 884 | # CONFIG_3C359 is not set | 942 | # CONFIG_3C359 is not set |
| @@ -899,6 +957,7 @@ CONFIG_IBMOL=y | |||
| 899 | # CONFIG_USB_RTL8150 is not set | 957 | # CONFIG_USB_RTL8150 is not set |
| 900 | # CONFIG_USB_USBNET_MII is not set | 958 | # CONFIG_USB_USBNET_MII is not set |
| 901 | # CONFIG_USB_USBNET is not set | 959 | # CONFIG_USB_USBNET is not set |
| 960 | # CONFIG_NET_PCMCIA is not set | ||
| 902 | # CONFIG_WAN is not set | 961 | # CONFIG_WAN is not set |
| 903 | CONFIG_ISERIES_VETH=m | 962 | CONFIG_ISERIES_VETH=m |
| 904 | # CONFIG_FDDI is not set | 963 | # CONFIG_FDDI is not set |
| @@ -918,6 +977,7 @@ CONFIG_SLHC=m | |||
| 918 | # CONFIG_NET_FC is not set | 977 | # CONFIG_NET_FC is not set |
| 919 | # CONFIG_SHAPER is not set | 978 | # CONFIG_SHAPER is not set |
| 920 | CONFIG_NETCONSOLE=y | 979 | CONFIG_NETCONSOLE=y |
| 980 | # CONFIG_NETCONSOLE_DYNAMIC is not set | ||
| 921 | CONFIG_NETPOLL=y | 981 | CONFIG_NETPOLL=y |
| 922 | CONFIG_NETPOLL_TRAP=y | 982 | CONFIG_NETPOLL_TRAP=y |
| 923 | CONFIG_NET_POLL_CONTROLLER=y | 983 | CONFIG_NET_POLL_CONTROLLER=y |
| @@ -939,7 +999,6 @@ CONFIG_INPUT_MOUSEDEV=y | |||
| 939 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 | 999 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 |
| 940 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 | 1000 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 |
| 941 | # CONFIG_INPUT_JOYDEV is not set | 1001 | # CONFIG_INPUT_JOYDEV is not set |
| 942 | # CONFIG_INPUT_TSDEV is not set | ||
| 943 | CONFIG_INPUT_EVDEV=m | 1002 | CONFIG_INPUT_EVDEV=m |
| 944 | # CONFIG_INPUT_EVBUG is not set | 1003 | # CONFIG_INPUT_EVBUG is not set |
| 945 | 1004 | ||
| @@ -1002,6 +1061,7 @@ CONFIG_HW_CONSOLE=y | |||
| 1002 | CONFIG_SERIAL_8250=y | 1061 | CONFIG_SERIAL_8250=y |
| 1003 | CONFIG_SERIAL_8250_CONSOLE=y | 1062 | CONFIG_SERIAL_8250_CONSOLE=y |
| 1004 | CONFIG_SERIAL_8250_PCI=y | 1063 | CONFIG_SERIAL_8250_PCI=y |
| 1064 | # CONFIG_SERIAL_8250_CS is not set | ||
| 1005 | CONFIG_SERIAL_8250_NR_UARTS=4 | 1065 | CONFIG_SERIAL_8250_NR_UARTS=4 |
| 1006 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | 1066 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 |
| 1007 | # CONFIG_SERIAL_8250_EXTENDED is not set | 1067 | # CONFIG_SERIAL_8250_EXTENDED is not set |
| @@ -1029,14 +1089,18 @@ CONFIG_HVC_RTAS=y | |||
| 1029 | CONFIG_HVC_BEAT=y | 1089 | CONFIG_HVC_BEAT=y |
| 1030 | CONFIG_HVCS=m | 1090 | CONFIG_HVCS=m |
| 1031 | # CONFIG_IPMI_HANDLER is not set | 1091 | # CONFIG_IPMI_HANDLER is not set |
| 1032 | # CONFIG_WATCHDOG is not set | ||
| 1033 | # CONFIG_HW_RANDOM is not set | 1092 | # CONFIG_HW_RANDOM is not set |
| 1034 | CONFIG_GEN_RTC=y | 1093 | CONFIG_GEN_RTC=y |
| 1035 | # CONFIG_GEN_RTC_X is not set | 1094 | # CONFIG_GEN_RTC_X is not set |
| 1036 | # CONFIG_R3964 is not set | 1095 | # CONFIG_R3964 is not set |
| 1037 | # CONFIG_APPLICOM is not set | 1096 | # CONFIG_APPLICOM is not set |
| 1038 | # CONFIG_AGP is not set | 1097 | |
| 1039 | # CONFIG_DRM is not set | 1098 | # |
| 1099 | # PCMCIA character devices | ||
| 1100 | # | ||
| 1101 | # CONFIG_SYNCLINK_CS is not set | ||
| 1102 | # CONFIG_CARDMAN_4000 is not set | ||
| 1103 | # CONFIG_CARDMAN_4040 is not set | ||
| 1040 | CONFIG_RAW_DRIVER=y | 1104 | CONFIG_RAW_DRIVER=y |
| 1041 | CONFIG_MAX_RAW_DEVS=256 | 1105 | CONFIG_MAX_RAW_DEVS=256 |
| 1042 | # CONFIG_HANGCHECK_TIMER is not set | 1106 | # CONFIG_HANGCHECK_TIMER is not set |
| @@ -1068,6 +1132,7 @@ CONFIG_I2C_POWERMAC=y | |||
| 1068 | # CONFIG_I2C_NFORCE2 is not set | 1132 | # CONFIG_I2C_NFORCE2 is not set |
| 1069 | # CONFIG_I2C_OCORES is not set | 1133 | # CONFIG_I2C_OCORES is not set |
| 1070 | # CONFIG_I2C_PARPORT_LIGHT is not set | 1134 | # CONFIG_I2C_PARPORT_LIGHT is not set |
| 1135 | CONFIG_I2C_PASEMI=y | ||
| 1071 | # CONFIG_I2C_PROSAVAGE is not set | 1136 | # CONFIG_I2C_PROSAVAGE is not set |
| 1072 | # CONFIG_I2C_SAVAGE4 is not set | 1137 | # CONFIG_I2C_SAVAGE4 is not set |
| 1073 | # CONFIG_I2C_SIMTEC is not set | 1138 | # CONFIG_I2C_SIMTEC is not set |
| @@ -1106,6 +1171,13 @@ CONFIG_I2C_POWERMAC=y | |||
| 1106 | # CONFIG_W1 is not set | 1171 | # CONFIG_W1 is not set |
| 1107 | # CONFIG_POWER_SUPPLY is not set | 1172 | # CONFIG_POWER_SUPPLY is not set |
| 1108 | # CONFIG_HWMON is not set | 1173 | # CONFIG_HWMON is not set |
| 1174 | # CONFIG_WATCHDOG is not set | ||
| 1175 | |||
| 1176 | # | ||
| 1177 | # Sonics Silicon Backplane | ||
| 1178 | # | ||
| 1179 | CONFIG_SSB_POSSIBLE=y | ||
| 1180 | # CONFIG_SSB is not set | ||
| 1109 | 1181 | ||
| 1110 | # | 1182 | # |
| 1111 | # Multifunction device drivers | 1183 | # Multifunction device drivers |
| @@ -1122,18 +1194,8 @@ CONFIG_I2C_POWERMAC=y | |||
| 1122 | # | 1194 | # |
| 1123 | # Graphics support | 1195 | # Graphics support |
| 1124 | # | 1196 | # |
| 1125 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 1197 | # CONFIG_AGP is not set |
| 1126 | CONFIG_LCD_CLASS_DEVICE=y | 1198 | # CONFIG_DRM is not set |
| 1127 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 1128 | |||
| 1129 | # | ||
| 1130 | # Display device support | ||
| 1131 | # | ||
| 1132 | CONFIG_DISPLAY_SUPPORT=y | ||
| 1133 | |||
| 1134 | # | ||
| 1135 | # Display hardware drivers | ||
| 1136 | # | ||
| 1137 | # CONFIG_VGASTATE is not set | 1199 | # CONFIG_VGASTATE is not set |
| 1138 | CONFIG_VIDEO_OUTPUT_CONTROL=m | 1200 | CONFIG_VIDEO_OUTPUT_CONTROL=m |
| 1139 | CONFIG_FB=y | 1201 | CONFIG_FB=y |
| @@ -1142,6 +1204,7 @@ CONFIG_FB_DDC=y | |||
| 1142 | CONFIG_FB_CFB_FILLRECT=y | 1204 | CONFIG_FB_CFB_FILLRECT=y |
| 1143 | CONFIG_FB_CFB_COPYAREA=y | 1205 | CONFIG_FB_CFB_COPYAREA=y |
| 1144 | CONFIG_FB_CFB_IMAGEBLIT=y | 1206 | CONFIG_FB_CFB_IMAGEBLIT=y |
| 1207 | # CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | ||
| 1145 | # CONFIG_FB_SYS_FILLRECT is not set | 1208 | # CONFIG_FB_SYS_FILLRECT is not set |
| 1146 | # CONFIG_FB_SYS_COPYAREA is not set | 1209 | # CONFIG_FB_SYS_COPYAREA is not set |
| 1147 | # CONFIG_FB_SYS_IMAGEBLIT is not set | 1210 | # CONFIG_FB_SYS_IMAGEBLIT is not set |
| @@ -1192,6 +1255,19 @@ CONFIG_FB_RADEON_BACKLIGHT=y | |||
| 1192 | # CONFIG_FB_PM3 is not set | 1255 | # CONFIG_FB_PM3 is not set |
| 1193 | CONFIG_FB_IBM_GXT4500=y | 1256 | CONFIG_FB_IBM_GXT4500=y |
| 1194 | # CONFIG_FB_VIRTUAL is not set | 1257 | # CONFIG_FB_VIRTUAL is not set |
| 1258 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 1259 | CONFIG_LCD_CLASS_DEVICE=y | ||
| 1260 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 1261 | # CONFIG_BACKLIGHT_CORGI is not set | ||
| 1262 | |||
| 1263 | # | ||
| 1264 | # Display device support | ||
| 1265 | # | ||
| 1266 | CONFIG_DISPLAY_SUPPORT=y | ||
| 1267 | |||
| 1268 | # | ||
| 1269 | # Display hardware drivers | ||
| 1270 | # | ||
| 1195 | 1271 | ||
| 1196 | # | 1272 | # |
| 1197 | # Console display driver support | 1273 | # Console display driver support |
| @@ -1333,6 +1409,12 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m | |||
| 1333 | # CONFIG_SND_USB_CAIAQ is not set | 1409 | # CONFIG_SND_USB_CAIAQ is not set |
| 1334 | 1410 | ||
| 1335 | # | 1411 | # |
| 1412 | # PCMCIA devices | ||
| 1413 | # | ||
| 1414 | # CONFIG_SND_VXPOCKET is not set | ||
| 1415 | # CONFIG_SND_PDAUDIOCF is not set | ||
| 1416 | |||
| 1417 | # | ||
| 1336 | # System on Chip audio support | 1418 | # System on Chip audio support |
| 1337 | # | 1419 | # |
| 1338 | # CONFIG_SND_SOC is not set | 1420 | # CONFIG_SND_SOC is not set |
| @@ -1348,6 +1430,7 @@ CONFIG_SND_AOA_SOUNDBUS_I2S=m | |||
| 1348 | CONFIG_HID_SUPPORT=y | 1430 | CONFIG_HID_SUPPORT=y |
| 1349 | CONFIG_HID=y | 1431 | CONFIG_HID=y |
| 1350 | # CONFIG_HID_DEBUG is not set | 1432 | # CONFIG_HID_DEBUG is not set |
| 1433 | # CONFIG_HIDRAW is not set | ||
| 1351 | 1434 | ||
| 1352 | # | 1435 | # |
| 1353 | # USB Input Devices | 1436 | # USB Input Devices |
| @@ -1489,19 +1572,53 @@ CONFIG_EDAC=y | |||
| 1489 | # | 1572 | # |
| 1490 | # CONFIG_EDAC_DEBUG is not set | 1573 | # CONFIG_EDAC_DEBUG is not set |
| 1491 | CONFIG_EDAC_MM_EDAC=y | 1574 | CONFIG_EDAC_MM_EDAC=y |
| 1492 | # CONFIG_RTC_CLASS is not set | 1575 | CONFIG_EDAC_PASEMI=y |
| 1576 | CONFIG_RTC_LIB=y | ||
| 1577 | CONFIG_RTC_CLASS=y | ||
| 1578 | CONFIG_RTC_HCTOSYS=y | ||
| 1579 | CONFIG_RTC_HCTOSYS_DEVICE="rtc0" | ||
| 1580 | # CONFIG_RTC_DEBUG is not set | ||
| 1581 | |||
| 1582 | # | ||
| 1583 | # RTC interfaces | ||
| 1584 | # | ||
| 1585 | CONFIG_RTC_INTF_SYSFS=y | ||
| 1586 | CONFIG_RTC_INTF_PROC=y | ||
| 1587 | CONFIG_RTC_INTF_DEV=y | ||
| 1588 | # CONFIG_RTC_INTF_DEV_UIE_EMUL is not set | ||
| 1589 | # CONFIG_RTC_DRV_TEST is not set | ||
| 1590 | |||
| 1591 | # | ||
| 1592 | # I2C RTC drivers | ||
| 1593 | # | ||
| 1594 | CONFIG_RTC_DRV_DS1307=y | ||
| 1595 | # CONFIG_RTC_DRV_DS1374 is not set | ||
| 1596 | # CONFIG_RTC_DRV_DS1672 is not set | ||
| 1597 | # CONFIG_RTC_DRV_MAX6900 is not set | ||
| 1598 | # CONFIG_RTC_DRV_RS5C372 is not set | ||
| 1599 | # CONFIG_RTC_DRV_ISL1208 is not set | ||
| 1600 | # CONFIG_RTC_DRV_X1205 is not set | ||
| 1601 | # CONFIG_RTC_DRV_PCF8563 is not set | ||
| 1602 | # CONFIG_RTC_DRV_PCF8583 is not set | ||
| 1603 | # CONFIG_RTC_DRV_M41T80 is not set | ||
| 1493 | 1604 | ||
| 1494 | # | 1605 | # |
| 1495 | # DMA Engine support | 1606 | # SPI RTC drivers |
| 1496 | # | 1607 | # |
| 1497 | # CONFIG_DMA_ENGINE is not set | ||
| 1498 | 1608 | ||
| 1499 | # | 1609 | # |
| 1500 | # DMA Clients | 1610 | # Platform RTC drivers |
| 1501 | # | 1611 | # |
| 1612 | # CONFIG_RTC_DRV_CMOS is not set | ||
| 1613 | # CONFIG_RTC_DRV_DS1553 is not set | ||
| 1614 | # CONFIG_RTC_DRV_STK17TA8 is not set | ||
| 1615 | # CONFIG_RTC_DRV_DS1742 is not set | ||
| 1616 | # CONFIG_RTC_DRV_M48T86 is not set | ||
| 1617 | # CONFIG_RTC_DRV_M48T59 is not set | ||
| 1618 | # CONFIG_RTC_DRV_V3020 is not set | ||
| 1502 | 1619 | ||
| 1503 | # | 1620 | # |
| 1504 | # DMA Devices | 1621 | # on-CPU RTC drivers |
| 1505 | # | 1622 | # |
| 1506 | 1623 | ||
| 1507 | # | 1624 | # |
| @@ -1585,7 +1702,6 @@ CONFIG_TMPFS=y | |||
| 1585 | # CONFIG_TMPFS_POSIX_ACL is not set | 1702 | # CONFIG_TMPFS_POSIX_ACL is not set |
| 1586 | CONFIG_HUGETLBFS=y | 1703 | CONFIG_HUGETLBFS=y |
| 1587 | CONFIG_HUGETLB_PAGE=y | 1704 | CONFIG_HUGETLB_PAGE=y |
| 1588 | CONFIG_RAMFS=y | ||
| 1589 | # CONFIG_CONFIGFS_FS is not set | 1705 | # CONFIG_CONFIGFS_FS is not set |
| 1590 | 1706 | ||
| 1591 | # | 1707 | # |
| @@ -1604,10 +1720,7 @@ CONFIG_CRAMFS=y | |||
| 1604 | # CONFIG_QNX4FS_FS is not set | 1720 | # CONFIG_QNX4FS_FS is not set |
| 1605 | # CONFIG_SYSV_FS is not set | 1721 | # CONFIG_SYSV_FS is not set |
| 1606 | # CONFIG_UFS_FS is not set | 1722 | # CONFIG_UFS_FS is not set |
| 1607 | 1723 | CONFIG_NETWORK_FILESYSTEMS=y | |
| 1608 | # | ||
| 1609 | # Network File Systems | ||
| 1610 | # | ||
| 1611 | CONFIG_NFS_FS=y | 1724 | CONFIG_NFS_FS=y |
| 1612 | CONFIG_NFS_V3=y | 1725 | CONFIG_NFS_V3=y |
| 1613 | CONFIG_NFS_V3_ACL=y | 1726 | CONFIG_NFS_V3_ACL=y |
| @@ -1619,6 +1732,7 @@ CONFIG_NFSD_V3=y | |||
| 1619 | CONFIG_NFSD_V3_ACL=y | 1732 | CONFIG_NFSD_V3_ACL=y |
| 1620 | CONFIG_NFSD_V4=y | 1733 | CONFIG_NFSD_V4=y |
| 1621 | CONFIG_NFSD_TCP=y | 1734 | CONFIG_NFSD_TCP=y |
| 1735 | CONFIG_ROOT_NFS=y | ||
| 1622 | CONFIG_LOCKD=y | 1736 | CONFIG_LOCKD=y |
| 1623 | CONFIG_LOCKD_V4=y | 1737 | CONFIG_LOCKD_V4=y |
| 1624 | CONFIG_EXPORTFS=m | 1738 | CONFIG_EXPORTFS=m |
| @@ -1626,6 +1740,7 @@ CONFIG_NFS_ACL_SUPPORT=y | |||
| 1626 | CONFIG_NFS_COMMON=y | 1740 | CONFIG_NFS_COMMON=y |
| 1627 | CONFIG_SUNRPC=y | 1741 | CONFIG_SUNRPC=y |
| 1628 | CONFIG_SUNRPC_GSS=y | 1742 | CONFIG_SUNRPC_GSS=y |
| 1743 | CONFIG_SUNRPC_XPRT_RDMA=m | ||
| 1629 | # CONFIG_SUNRPC_BIND34 is not set | 1744 | # CONFIG_SUNRPC_BIND34 is not set |
| 1630 | CONFIG_RPCSEC_GSS_KRB5=y | 1745 | CONFIG_RPCSEC_GSS_KRB5=y |
| 1631 | CONFIG_RPCSEC_GSS_SPKM3=m | 1746 | CONFIG_RPCSEC_GSS_SPKM3=m |
| @@ -1662,10 +1777,6 @@ CONFIG_MSDOS_PARTITION=y | |||
| 1662 | # CONFIG_KARMA_PARTITION is not set | 1777 | # CONFIG_KARMA_PARTITION is not set |
| 1663 | # CONFIG_EFI_PARTITION is not set | 1778 | # CONFIG_EFI_PARTITION is not set |
| 1664 | # CONFIG_SYSV68_PARTITION is not set | 1779 | # CONFIG_SYSV68_PARTITION is not set |
| 1665 | |||
| 1666 | # | ||
| 1667 | # Native Language Support | ||
| 1668 | # | ||
| 1669 | CONFIG_NLS=y | 1780 | CONFIG_NLS=y |
| 1670 | CONFIG_NLS_DEFAULT="iso8859-1" | 1781 | CONFIG_NLS_DEFAULT="iso8859-1" |
| 1671 | CONFIG_NLS_CODEPAGE_437=y | 1782 | CONFIG_NLS_CODEPAGE_437=y |
| @@ -1706,10 +1817,6 @@ CONFIG_NLS_ISO8859_15=m | |||
| 1706 | CONFIG_NLS_KOI8_R=m | 1817 | CONFIG_NLS_KOI8_R=m |
| 1707 | CONFIG_NLS_KOI8_U=m | 1818 | CONFIG_NLS_KOI8_U=m |
| 1708 | CONFIG_NLS_UTF8=m | 1819 | CONFIG_NLS_UTF8=m |
| 1709 | |||
| 1710 | # | ||
| 1711 | # Distributed Lock Manager | ||
| 1712 | # | ||
| 1713 | # CONFIG_DLM is not set | 1820 | # CONFIG_DLM is not set |
| 1714 | # CONFIG_UCC_SLOW is not set | 1821 | # CONFIG_UCC_SLOW is not set |
| 1715 | 1822 | ||
| @@ -1733,18 +1840,17 @@ CONFIG_PLIST=y | |||
| 1733 | CONFIG_HAS_IOMEM=y | 1840 | CONFIG_HAS_IOMEM=y |
| 1734 | CONFIG_HAS_IOPORT=y | 1841 | CONFIG_HAS_IOPORT=y |
| 1735 | CONFIG_HAS_DMA=y | 1842 | CONFIG_HAS_DMA=y |
| 1736 | 1843 | CONFIG_INSTRUMENTATION=y | |
| 1737 | # | ||
| 1738 | # Instrumentation Support | ||
| 1739 | # | ||
| 1740 | CONFIG_PROFILING=y | 1844 | CONFIG_PROFILING=y |
| 1741 | CONFIG_OPROFILE=y | 1845 | CONFIG_OPROFILE=y |
| 1742 | # CONFIG_KPROBES is not set | 1846 | # CONFIG_KPROBES is not set |
| 1847 | # CONFIG_MARKERS is not set | ||
| 1743 | 1848 | ||
| 1744 | # | 1849 | # |
| 1745 | # Kernel hacking | 1850 | # Kernel hacking |
| 1746 | # | 1851 | # |
| 1747 | # CONFIG_PRINTK_TIME is not set | 1852 | # CONFIG_PRINTK_TIME is not set |
| 1853 | CONFIG_ENABLE_WARN_DEPRECATED=y | ||
| 1748 | CONFIG_ENABLE_MUST_CHECK=y | 1854 | CONFIG_ENABLE_MUST_CHECK=y |
| 1749 | CONFIG_MAGIC_SYSRQ=y | 1855 | CONFIG_MAGIC_SYSRQ=y |
| 1750 | # CONFIG_UNUSED_SYMBOLS is not set | 1856 | # CONFIG_UNUSED_SYMBOLS is not set |
| @@ -1768,9 +1874,12 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
| 1768 | # CONFIG_DEBUG_INFO is not set | 1874 | # CONFIG_DEBUG_INFO is not set |
| 1769 | # CONFIG_DEBUG_VM is not set | 1875 | # CONFIG_DEBUG_VM is not set |
| 1770 | # CONFIG_DEBUG_LIST is not set | 1876 | # CONFIG_DEBUG_LIST is not set |
| 1877 | # CONFIG_DEBUG_SG is not set | ||
| 1771 | CONFIG_FORCED_INLINING=y | 1878 | CONFIG_FORCED_INLINING=y |
| 1879 | # CONFIG_BOOT_PRINTK_DELAY is not set | ||
| 1772 | # CONFIG_RCU_TORTURE_TEST is not set | 1880 | # CONFIG_RCU_TORTURE_TEST is not set |
| 1773 | # CONFIG_FAULT_INJECTION is not set | 1881 | # CONFIG_FAULT_INJECTION is not set |
| 1882 | # CONFIG_SAMPLES is not set | ||
| 1774 | CONFIG_DEBUG_STACKOVERFLOW=y | 1883 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 1775 | CONFIG_DEBUG_STACK_USAGE=y | 1884 | CONFIG_DEBUG_STACK_USAGE=y |
| 1776 | # CONFIG_DEBUG_PAGEALLOC is not set | 1885 | # CONFIG_DEBUG_PAGEALLOC is not set |
| @@ -1780,6 +1889,7 @@ CONFIG_XMON=y | |||
| 1780 | # CONFIG_XMON_DEFAULT is not set | 1889 | # CONFIG_XMON_DEFAULT is not set |
| 1781 | CONFIG_XMON_DISASSEMBLY=y | 1890 | CONFIG_XMON_DISASSEMBLY=y |
| 1782 | CONFIG_IRQSTACKS=y | 1891 | CONFIG_IRQSTACKS=y |
| 1892 | # CONFIG_VIRQ_DEBUG is not set | ||
| 1783 | CONFIG_BOOTX_TEXT=y | 1893 | CONFIG_BOOTX_TEXT=y |
| 1784 | # CONFIG_PPC_EARLY_DEBUG is not set | 1894 | # CONFIG_PPC_EARLY_DEBUG is not set |
| 1785 | 1895 | ||
| @@ -1788,6 +1898,7 @@ CONFIG_BOOTX_TEXT=y | |||
| 1788 | # | 1898 | # |
| 1789 | # CONFIG_KEYS is not set | 1899 | # CONFIG_KEYS is not set |
| 1790 | # CONFIG_SECURITY is not set | 1900 | # CONFIG_SECURITY is not set |
| 1901 | # CONFIG_SECURITY_FILE_CAPABILITIES is not set | ||
| 1791 | CONFIG_XOR_BLOCKS=y | 1902 | CONFIG_XOR_BLOCKS=y |
| 1792 | CONFIG_ASYNC_CORE=y | 1903 | CONFIG_ASYNC_CORE=y |
| 1793 | CONFIG_ASYNC_MEMCPY=y | 1904 | CONFIG_ASYNC_MEMCPY=y |
| @@ -1812,6 +1923,7 @@ CONFIG_CRYPTO_ECB=m | |||
| 1812 | CONFIG_CRYPTO_CBC=y | 1923 | CONFIG_CRYPTO_CBC=y |
| 1813 | CONFIG_CRYPTO_PCBC=m | 1924 | CONFIG_CRYPTO_PCBC=m |
| 1814 | # CONFIG_CRYPTO_LRW is not set | 1925 | # CONFIG_CRYPTO_LRW is not set |
| 1926 | # CONFIG_CRYPTO_XTS is not set | ||
| 1815 | # CONFIG_CRYPTO_CRYPTD is not set | 1927 | # CONFIG_CRYPTO_CRYPTD is not set |
| 1816 | CONFIG_CRYPTO_DES=y | 1928 | CONFIG_CRYPTO_DES=y |
| 1817 | # CONFIG_CRYPTO_FCRYPT is not set | 1929 | # CONFIG_CRYPTO_FCRYPT is not set |
| @@ -1826,9 +1938,12 @@ CONFIG_CRYPTO_TEA=m | |||
| 1826 | CONFIG_CRYPTO_ARC4=m | 1938 | CONFIG_CRYPTO_ARC4=m |
| 1827 | CONFIG_CRYPTO_KHAZAD=m | 1939 | CONFIG_CRYPTO_KHAZAD=m |
| 1828 | CONFIG_CRYPTO_ANUBIS=m | 1940 | CONFIG_CRYPTO_ANUBIS=m |
| 1941 | # CONFIG_CRYPTO_SEED is not set | ||
| 1829 | CONFIG_CRYPTO_DEFLATE=m | 1942 | CONFIG_CRYPTO_DEFLATE=m |
| 1830 | CONFIG_CRYPTO_MICHAEL_MIC=m | 1943 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 1831 | CONFIG_CRYPTO_CRC32C=m | 1944 | CONFIG_CRYPTO_CRC32C=m |
| 1832 | # CONFIG_CRYPTO_CAMELLIA is not set | 1945 | # CONFIG_CRYPTO_CAMELLIA is not set |
| 1833 | CONFIG_CRYPTO_TEST=m | 1946 | CONFIG_CRYPTO_TEST=m |
| 1947 | # CONFIG_CRYPTO_AUTHENC is not set | ||
| 1834 | # CONFIG_CRYPTO_HW is not set | 1948 | # CONFIG_CRYPTO_HW is not set |
| 1949 | # CONFIG_PPC_CLOCK is not set | ||
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index d3fb7d0c6c1c..9ed351f3c966 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
| @@ -1104,6 +1104,16 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 1104 | { | 1104 | { |
| 1105 | .pvr_mask = 0xf0000fff, | 1105 | .pvr_mask = 0xf0000fff, |
| 1106 | .pvr_value = 0x40000850, | 1106 | .pvr_value = 0x40000850, |
| 1107 | .cpu_name = "440GR Rev. A", | ||
| 1108 | .cpu_features = CPU_FTRS_44X, | ||
| 1109 | .cpu_user_features = COMMON_USER_BOOKE, | ||
| 1110 | .icache_bsize = 32, | ||
| 1111 | .dcache_bsize = 32, | ||
| 1112 | .platform = "ppc440", | ||
| 1113 | }, | ||
| 1114 | { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */ | ||
| 1115 | .pvr_mask = 0xf0000fff, | ||
| 1116 | .pvr_value = 0x40000858, | ||
| 1107 | .cpu_name = "440EP Rev. A", | 1117 | .cpu_name = "440EP Rev. A", |
| 1108 | .cpu_features = CPU_FTRS_44X, | 1118 | .cpu_features = CPU_FTRS_44X, |
| 1109 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | 1119 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, |
| @@ -1115,28 +1125,27 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 1115 | { | 1125 | { |
| 1116 | .pvr_mask = 0xf0000fff, | 1126 | .pvr_mask = 0xf0000fff, |
| 1117 | .pvr_value = 0x400008d3, | 1127 | .pvr_value = 0x400008d3, |
| 1118 | .cpu_name = "440EP Rev. B", | 1128 | .cpu_name = "440GR Rev. B", |
| 1119 | .cpu_features = CPU_FTRS_44X, | 1129 | .cpu_features = CPU_FTRS_44X, |
| 1120 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | 1130 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, |
| 1121 | .icache_bsize = 32, | 1131 | .icache_bsize = 32, |
| 1122 | .dcache_bsize = 32, | 1132 | .dcache_bsize = 32, |
| 1123 | .cpu_setup = __setup_cpu_440ep, | ||
| 1124 | .platform = "ppc440", | 1133 | .platform = "ppc440", |
| 1125 | }, | 1134 | }, |
| 1126 | { /* 440EPX */ | 1135 | { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */ |
| 1127 | .pvr_mask = 0xf0000ffb, | 1136 | .pvr_mask = 0xf0000fff, |
| 1128 | .pvr_value = 0x200008D0, | 1137 | .pvr_value = 0x400008db, |
| 1129 | .cpu_name = "440EPX", | 1138 | .cpu_name = "440EP Rev. B", |
| 1130 | .cpu_features = CPU_FTRS_44X, | 1139 | .cpu_features = CPU_FTRS_44X, |
| 1131 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | 1140 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, |
| 1132 | .icache_bsize = 32, | 1141 | .icache_bsize = 32, |
| 1133 | .dcache_bsize = 32, | 1142 | .dcache_bsize = 32, |
| 1134 | .cpu_setup = __setup_cpu_440epx, | 1143 | .cpu_setup = __setup_cpu_440ep, |
| 1135 | .platform = "ppc440", | 1144 | .platform = "ppc440", |
| 1136 | }, | 1145 | }, |
| 1137 | { /* 440GRX */ | 1146 | { /* 440GRX */ |
| 1138 | .pvr_mask = 0xf0000ffb, | 1147 | .pvr_mask = 0xf0000ffb, |
| 1139 | .pvr_value = 0x200008D8, | 1148 | .pvr_value = 0x200008D0, |
| 1140 | .cpu_name = "440GRX", | 1149 | .cpu_name = "440GRX", |
| 1141 | .cpu_features = CPU_FTRS_44X, | 1150 | .cpu_features = CPU_FTRS_44X, |
| 1142 | .cpu_user_features = COMMON_USER_BOOKE, | 1151 | .cpu_user_features = COMMON_USER_BOOKE, |
| @@ -1145,6 +1154,17 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
| 1145 | .cpu_setup = __setup_cpu_440grx, | 1154 | .cpu_setup = __setup_cpu_440grx, |
| 1146 | .platform = "ppc440", | 1155 | .platform = "ppc440", |
| 1147 | }, | 1156 | }, |
| 1157 | { /* Use logical PVR for 440EPx (logical pvr = pvr | 0x8) */ | ||
| 1158 | .pvr_mask = 0xf0000ffb, | ||
| 1159 | .pvr_value = 0x200008D8, | ||
| 1160 | .cpu_name = "440EPX", | ||
| 1161 | .cpu_features = CPU_FTRS_44X, | ||
| 1162 | .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, | ||
| 1163 | .icache_bsize = 32, | ||
| 1164 | .dcache_bsize = 32, | ||
| 1165 | .cpu_setup = __setup_cpu_440epx, | ||
| 1166 | .platform = "ppc440", | ||
| 1167 | }, | ||
| 1148 | { /* 440GP Rev. B */ | 1168 | { /* 440GP Rev. B */ |
| 1149 | .pvr_mask = 0xf0000fff, | 1169 | .pvr_mask = 0xf0000fff, |
| 1150 | .pvr_value = 0x40000440, | 1170 | .pvr_value = 0x40000440, |
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 21d889e63e87..a7572cf464bd 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
| @@ -244,6 +244,13 @@ syscall_exit_cont: | |||
| 244 | andis. r10,r0,DBCR0_IC@h | 244 | andis. r10,r0,DBCR0_IC@h |
| 245 | bnel- load_dbcr0 | 245 | bnel- load_dbcr0 |
| 246 | #endif | 246 | #endif |
| 247 | #ifdef CONFIG_44x | ||
| 248 | lis r4,icache_44x_need_flush@ha | ||
| 249 | lwz r5,icache_44x_need_flush@l(r4) | ||
| 250 | cmplwi cr0,r5,0 | ||
| 251 | bne- 2f | ||
| 252 | 1: | ||
| 253 | #endif /* CONFIG_44x */ | ||
| 247 | stwcx. r0,0,r1 /* to clear the reservation */ | 254 | stwcx. r0,0,r1 /* to clear the reservation */ |
| 248 | lwz r4,_LINK(r1) | 255 | lwz r4,_LINK(r1) |
| 249 | lwz r5,_CCR(r1) | 256 | lwz r5,_CCR(r1) |
| @@ -258,6 +265,12 @@ syscall_exit_cont: | |||
| 258 | mtspr SPRN_SRR1,r8 | 265 | mtspr SPRN_SRR1,r8 |
| 259 | SYNC | 266 | SYNC |
| 260 | RFI | 267 | RFI |
| 268 | #ifdef CONFIG_44x | ||
| 269 | 2: li r7,0 | ||
| 270 | iccci r0,r0 | ||
| 271 | stw r7,icache_44x_need_flush@l(r4) | ||
| 272 | b 1b | ||
| 273 | #endif /* CONFIG_44x */ | ||
| 261 | 274 | ||
| 262 | 66: li r3,-ENOSYS | 275 | 66: li r3,-ENOSYS |
| 263 | b ret_from_syscall | 276 | b ret_from_syscall |
| @@ -683,6 +696,16 @@ resume_kernel: | |||
| 683 | 696 | ||
| 684 | /* interrupts are hard-disabled at this point */ | 697 | /* interrupts are hard-disabled at this point */ |
| 685 | restore: | 698 | restore: |
| 699 | #ifdef CONFIG_44x | ||
| 700 | lis r4,icache_44x_need_flush@ha | ||
| 701 | lwz r5,icache_44x_need_flush@l(r4) | ||
| 702 | cmplwi cr0,r5,0 | ||
| 703 | beq+ 1f | ||
| 704 | li r6,0 | ||
| 705 | iccci r0,r0 | ||
| 706 | stw r6,icache_44x_need_flush@l(r4) | ||
| 707 | 1: | ||
| 708 | #endif /* CONFIG_44x */ | ||
| 686 | lwz r0,GPR0(r1) | 709 | lwz r0,GPR0(r1) |
| 687 | lwz r2,GPR2(r1) | 710 | lwz r2,GPR2(r1) |
| 688 | REST_4GPRS(3, r1) | 711 | REST_4GPRS(3, r1) |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 97c5857faf00..c34986835a4e 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
| @@ -904,7 +904,7 @@ handle_page_fault: | |||
| 904 | */ | 904 | */ |
| 905 | 12: bl .save_nvgprs | 905 | 12: bl .save_nvgprs |
| 906 | addi r3,r1,STACK_FRAME_OVERHEAD | 906 | addi r3,r1,STACK_FRAME_OVERHEAD |
| 907 | lwz r4,_DAR(r1) | 907 | ld r4,_DAR(r1) |
| 908 | bl .low_hash_fault | 908 | bl .low_hash_fault |
| 909 | b .ret_from_except | 909 | b .ret_from_except |
| 910 | 910 | ||
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index abd2957fe537..c3cf0e8f3ac1 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c | |||
| @@ -122,7 +122,7 @@ static ctl_table powersave_nap_sysctl_root[] = { | |||
| 122 | { | 122 | { |
| 123 | .ctl_name = CTL_KERN, | 123 | .ctl_name = CTL_KERN, |
| 124 | .procname = "kernel", | 124 | .procname = "kernel", |
| 125 | .mode = 0755, | 125 | .mode = 0555, |
| 126 | .child = powersave_nap_ctl_table, | 126 | .child = powersave_nap_ctl_table, |
| 127 | }, | 127 | }, |
| 128 | {} | 128 | {} |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 8533de50347d..8b642ab26d37 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
| @@ -288,7 +288,16 @@ _GLOBAL(_tlbia) | |||
| 288 | */ | 288 | */ |
| 289 | _GLOBAL(_tlbie) | 289 | _GLOBAL(_tlbie) |
| 290 | #if defined(CONFIG_40x) | 290 | #if defined(CONFIG_40x) |
| 291 | /* We run the search with interrupts disabled because we have to change | ||
| 292 | * the PID and I don't want to preempt when that happens. | ||
| 293 | */ | ||
| 294 | mfmsr r5 | ||
| 295 | mfspr r6,SPRN_PID | ||
| 296 | wrteei 0 | ||
| 297 | mtspr SPRN_PID,r4 | ||
| 291 | tlbsx. r3, 0, r3 | 298 | tlbsx. r3, 0, r3 |
| 299 | mtspr SPRN_PID,r6 | ||
| 300 | wrtee r5 | ||
| 292 | bne 10f | 301 | bne 10f |
| 293 | sync | 302 | sync |
| 294 | /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear. | 303 | /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear. |
| @@ -297,23 +306,23 @@ _GLOBAL(_tlbie) | |||
| 297 | tlbwe r3, r3, TLB_TAG | 306 | tlbwe r3, r3, TLB_TAG |
| 298 | isync | 307 | isync |
| 299 | 10: | 308 | 10: |
| 309 | |||
| 300 | #elif defined(CONFIG_44x) | 310 | #elif defined(CONFIG_44x) |
| 301 | mfspr r4,SPRN_MMUCR | 311 | mfspr r5,SPRN_MMUCR |
| 302 | mfspr r5,SPRN_PID /* Get PID */ | 312 | rlwimi r5,r4,0,24,31 /* Set TID */ |
| 303 | rlwimi r4,r5,0,24,31 /* Set TID */ | ||
| 304 | 313 | ||
| 305 | /* We have to run the search with interrupts disabled, even critical | 314 | /* We have to run the search with interrupts disabled, even critical |
| 306 | * and debug interrupts (in fact the only critical exceptions we have | 315 | * and debug interrupts (in fact the only critical exceptions we have |
| 307 | * are debug and machine check). Otherwise an interrupt which causes | 316 | * are debug and machine check). Otherwise an interrupt which causes |
| 308 | * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */ | 317 | * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */ |
| 309 | mfmsr r5 | 318 | mfmsr r4 |
| 310 | lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha | 319 | lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha |
| 311 | addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l | 320 | addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l |
| 312 | andc r6,r5,r6 | 321 | andc r6,r4,r6 |
| 313 | mtmsr r6 | 322 | mtmsr r6 |
| 314 | mtspr SPRN_MMUCR,r4 | 323 | mtspr SPRN_MMUCR,r5 |
| 315 | tlbsx. r3, 0, r3 | 324 | tlbsx. r3, 0, r3 |
| 316 | mtmsr r5 | 325 | mtmsr r4 |
| 317 | bne 10f | 326 | bne 10f |
| 318 | sync | 327 | sync |
| 319 | /* There are only 64 TLB entries, so r3 < 64, | 328 | /* There are only 64 TLB entries, so r3 < 64, |
| @@ -534,12 +543,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | |||
| 534 | addi r3,r3,L1_CACHE_BYTES | 543 | addi r3,r3,L1_CACHE_BYTES |
| 535 | bdnz 0b | 544 | bdnz 0b |
| 536 | sync | 545 | sync |
| 546 | #ifndef CONFIG_44x | ||
| 547 | /* We don't flush the icache on 44x. Those have a virtual icache | ||
| 548 | * and we don't have access to the virtual address here (it's | ||
| 549 | * not the page vaddr but where it's mapped in user space). The | ||
| 550 | * flushing of the icache on these is handled elsewhere, when | ||
| 551 | * a change in the address space occurs, before returning to | ||
| 552 | * user space | ||
| 553 | */ | ||
| 537 | mtctr r4 | 554 | mtctr r4 |
| 538 | 1: icbi 0,r6 | 555 | 1: icbi 0,r6 |
| 539 | addi r6,r6,L1_CACHE_BYTES | 556 | addi r6,r6,L1_CACHE_BYTES |
| 540 | bdnz 1b | 557 | bdnz 1b |
| 541 | sync | 558 | sync |
| 542 | isync | 559 | isync |
| 560 | #endif /* CONFIG_44x */ | ||
| 543 | blr | 561 | blr |
| 544 | 562 | ||
| 545 | /* | 563 | /* |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index b9d88374f14f..41e13f4cc6e3 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
| @@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
| 350 | local_irq_save(flags); | 350 | local_irq_save(flags); |
| 351 | 351 | ||
| 352 | account_system_vtime(current); | 352 | account_system_vtime(current); |
| 353 | account_process_vtime(current); | 353 | account_process_tick(current, 0); |
| 354 | calculate_steal_time(); | 354 | calculate_steal_time(); |
| 355 | 355 | ||
| 356 | last = _switch(old_thread, new_thread); | 356 | last = _switch(old_thread, new_thread); |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 9f329a8928ea..acc0d247d3c3 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
| @@ -697,6 +697,18 @@ static int __init early_init_dt_scan_cpus(unsigned long node, | |||
| 697 | prop = of_get_flat_dt_prop(node, "cpu-version", NULL); | 697 | prop = of_get_flat_dt_prop(node, "cpu-version", NULL); |
| 698 | if (prop && (*prop & 0xff000000) == 0x0f000000) | 698 | if (prop && (*prop & 0xff000000) == 0x0f000000) |
| 699 | identify_cpu(0, *prop); | 699 | identify_cpu(0, *prop); |
| 700 | #if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU) | ||
| 701 | /* | ||
| 702 | * Since 440GR(x)/440EP(x) processors have the same pvr, | ||
| 703 | * we check the node path and set bit 28 in the cur_cpu_spec | ||
| 704 | * pvr for EP(x) processor version. This bit is always 0 in | ||
| 705 | * the "real" pvr. Then we call identify_cpu again with | ||
| 706 | * the new logical pvr to enable FPU support. | ||
| 707 | */ | ||
| 708 | if (strstr(uname, "440EP")) { | ||
| 709 | identify_cpu(0, cur_cpu_spec->pvr_value | 0x8); | ||
| 710 | } | ||
| 711 | #endif | ||
| 700 | } | 712 | } |
| 701 | 713 | ||
| 702 | check_cpu_feature_properties(node); | 714 | check_cpu_feature_properties(node); |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 1db10f70ae69..1add6efdb315 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
| @@ -1244,7 +1244,7 @@ static void __init prom_initialize_tce_table(void) | |||
| 1244 | local_alloc_bottom = base; | 1244 | local_alloc_bottom = base; |
| 1245 | 1245 | ||
| 1246 | /* It seems OF doesn't null-terminate the path :-( */ | 1246 | /* It seems OF doesn't null-terminate the path :-( */ |
| 1247 | memset(path, 0, sizeof(path)); | 1247 | memset(path, 0, PROM_SCRATCH_SIZE); |
| 1248 | /* Call OF to setup the TCE hardware */ | 1248 | /* Call OF to setup the TCE hardware */ |
| 1249 | if (call_prom("package-to-path", 3, 1, node, | 1249 | if (call_prom("package-to-path", 3, 1, node, |
| 1250 | path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) { | 1250 | path, PROM_SCRATCH_SIZE-1) == PROM_ERROR) { |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index ede77dbbd4df..3b1529c103ef 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -291,23 +291,16 @@ static void __init initialize_cache_info(void) | |||
| 291 | if ( num_cpus == 1 ) { | 291 | if ( num_cpus == 1 ) { |
| 292 | const u32 *sizep, *lsizep; | 292 | const u32 *sizep, *lsizep; |
| 293 | u32 size, lsize; | 293 | u32 size, lsize; |
| 294 | const char *dc, *ic; | ||
| 295 | |||
| 296 | /* Then read cache informations */ | ||
| 297 | if (machine_is(powermac)) { | ||
| 298 | dc = "d-cache-block-size"; | ||
| 299 | ic = "i-cache-block-size"; | ||
| 300 | } else { | ||
| 301 | dc = "d-cache-line-size"; | ||
| 302 | ic = "i-cache-line-size"; | ||
| 303 | } | ||
| 304 | 294 | ||
| 305 | size = 0; | 295 | size = 0; |
| 306 | lsize = cur_cpu_spec->dcache_bsize; | 296 | lsize = cur_cpu_spec->dcache_bsize; |
| 307 | sizep = of_get_property(np, "d-cache-size", NULL); | 297 | sizep = of_get_property(np, "d-cache-size", NULL); |
| 308 | if (sizep != NULL) | 298 | if (sizep != NULL) |
| 309 | size = *sizep; | 299 | size = *sizep; |
| 310 | lsizep = of_get_property(np, dc, NULL); | 300 | lsizep = of_get_property(np, "d-cache-block-size", NULL); |
| 301 | /* fallback if block size missing */ | ||
| 302 | if (lsizep == NULL) | ||
| 303 | lsizep = of_get_property(np, "d-cache-line-size", NULL); | ||
| 311 | if (lsizep != NULL) | 304 | if (lsizep != NULL) |
| 312 | lsize = *lsizep; | 305 | lsize = *lsizep; |
| 313 | if (sizep == 0 || lsizep == 0) | 306 | if (sizep == 0 || lsizep == 0) |
| @@ -324,7 +317,9 @@ static void __init initialize_cache_info(void) | |||
| 324 | sizep = of_get_property(np, "i-cache-size", NULL); | 317 | sizep = of_get_property(np, "i-cache-size", NULL); |
| 325 | if (sizep != NULL) | 318 | if (sizep != NULL) |
| 326 | size = *sizep; | 319 | size = *sizep; |
| 327 | lsizep = of_get_property(np, ic, NULL); | 320 | lsizep = of_get_property(np, "i-cache-block-size", NULL); |
| 321 | if (lsizep == NULL) | ||
| 322 | lsizep = of_get_property(np, "i-cache-line-size", NULL); | ||
| 328 | if (lsizep != NULL) | 323 | if (lsizep != NULL) |
| 329 | lsize = *lsizep; | 324 | lsize = *lsizep; |
| 330 | if (sizep == 0 || lsizep == 0) | 325 | if (sizep == 0 || lsizep == 0) |
diff --git a/arch/powerpc/kernel/swsusp_32.S b/arch/powerpc/kernel/swsusp_32.S index 69e8f86aa4f8..77fc76607ab2 100644 --- a/arch/powerpc/kernel/swsusp_32.S +++ b/arch/powerpc/kernel/swsusp_32.S | |||
| @@ -133,10 +133,12 @@ _GLOBAL(swsusp_arch_suspend) | |||
| 133 | /* Resume code */ | 133 | /* Resume code */ |
| 134 | _GLOBAL(swsusp_arch_resume) | 134 | _GLOBAL(swsusp_arch_resume) |
| 135 | 135 | ||
| 136 | #ifdef CONFIG_ALTIVEC | ||
| 136 | /* Stop pending alitvec streams and memory accesses */ | 137 | /* Stop pending alitvec streams and memory accesses */ |
| 137 | BEGIN_FTR_SECTION | 138 | BEGIN_FTR_SECTION |
| 138 | DSSALL | 139 | DSSALL |
| 139 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | 140 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) |
| 141 | #endif | ||
| 140 | sync | 142 | sync |
| 141 | 143 | ||
| 142 | /* Disable MSR:DR to make sure we don't take a TLB or | 144 | /* Disable MSR:DR to make sure we don't take a TLB or |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 9eb3284deac4..4beb6329dfb7 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
| @@ -259,7 +259,7 @@ void account_system_vtime(struct task_struct *tsk) | |||
| 259 | * user and system time records. | 259 | * user and system time records. |
| 260 | * Must be called with interrupts disabled. | 260 | * Must be called with interrupts disabled. |
| 261 | */ | 261 | */ |
| 262 | void account_process_vtime(struct task_struct *tsk) | 262 | void account_process_tick(struct task_struct *tsk, int user_tick) |
| 263 | { | 263 | { |
| 264 | cputime_t utime, utimescaled; | 264 | cputime_t utime, utimescaled; |
| 265 | 265 | ||
| @@ -274,18 +274,6 @@ void account_process_vtime(struct task_struct *tsk) | |||
| 274 | account_user_time_scaled(tsk, utimescaled); | 274 | account_user_time_scaled(tsk, utimescaled); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | static void account_process_time(struct pt_regs *regs) | ||
| 278 | { | ||
| 279 | int cpu = smp_processor_id(); | ||
| 280 | |||
| 281 | account_process_vtime(current); | ||
| 282 | run_local_timers(); | ||
| 283 | if (rcu_pending(cpu)) | ||
| 284 | rcu_check_callbacks(cpu, user_mode(regs)); | ||
| 285 | scheduler_tick(); | ||
| 286 | run_posix_cpu_timers(current); | ||
| 287 | } | ||
| 288 | |||
| 289 | /* | 277 | /* |
| 290 | * Stuff for accounting stolen time. | 278 | * Stuff for accounting stolen time. |
| 291 | */ | 279 | */ |
| @@ -375,7 +363,6 @@ static void snapshot_purr(void) | |||
| 375 | 363 | ||
| 376 | #else /* ! CONFIG_VIRT_CPU_ACCOUNTING */ | 364 | #else /* ! CONFIG_VIRT_CPU_ACCOUNTING */ |
| 377 | #define calc_cputime_factors() | 365 | #define calc_cputime_factors() |
| 378 | #define account_process_time(regs) update_process_times(user_mode(regs)) | ||
| 379 | #define calculate_steal_time() do { } while (0) | 366 | #define calculate_steal_time() do { } while (0) |
| 380 | #endif | 367 | #endif |
| 381 | 368 | ||
| @@ -586,7 +573,7 @@ void timer_interrupt(struct pt_regs * regs) | |||
| 586 | /* not time for this event yet */ | 573 | /* not time for this event yet */ |
| 587 | now = per_cpu(decrementer_next_tb, cpu) - now; | 574 | now = per_cpu(decrementer_next_tb, cpu) - now; |
| 588 | if (now <= DECREMENTER_MAX) | 575 | if (now <= DECREMENTER_MAX) |
| 589 | set_dec((unsigned int)now - 1); | 576 | set_dec((int)now); |
| 590 | return; | 577 | return; |
| 591 | } | 578 | } |
| 592 | old_regs = set_irq_regs(regs); | 579 | old_regs = set_irq_regs(regs); |
| @@ -599,20 +586,8 @@ void timer_interrupt(struct pt_regs * regs) | |||
| 599 | get_lppaca()->int_dword.fields.decr_int = 0; | 586 | get_lppaca()->int_dword.fields.decr_int = 0; |
| 600 | #endif | 587 | #endif |
| 601 | 588 | ||
| 602 | /* | ||
| 603 | * We cannot disable the decrementer, so in the period | ||
| 604 | * between this cpu's being marked offline in cpu_online_map | ||
| 605 | * and calling stop-self, it is taking timer interrupts. | ||
| 606 | * Avoid calling into the scheduler rebalancing code if this | ||
| 607 | * is the case. | ||
| 608 | */ | ||
| 609 | if (!cpu_is_offline(cpu)) | ||
| 610 | account_process_time(regs); | ||
| 611 | |||
| 612 | if (evt->event_handler) | 589 | if (evt->event_handler) |
| 613 | evt->event_handler(evt); | 590 | evt->event_handler(evt); |
| 614 | else | ||
| 615 | evt->set_next_event(DECREMENTER_MAX, evt); | ||
| 616 | 591 | ||
| 617 | #ifdef CONFIG_PPC_ISERIES | 592 | #ifdef CONFIG_PPC_ISERIES |
| 618 | if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending()) | 593 | if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending()) |
| @@ -836,9 +811,6 @@ static int decrementer_set_next_event(unsigned long evt, | |||
| 836 | struct clock_event_device *dev) | 811 | struct clock_event_device *dev) |
| 837 | { | 812 | { |
| 838 | __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt; | 813 | __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt; |
| 839 | /* The decrementer interrupts on the 0 -> -1 transition */ | ||
| 840 | if (evt) | ||
| 841 | --evt; | ||
| 842 | set_dec(evt); | 814 | set_dec(evt); |
| 843 | return 0; | 815 | return 0; |
| 844 | } | 816 | } |
| @@ -871,7 +843,8 @@ void init_decrementer_clockevent(void) | |||
| 871 | decrementer_clockevent.shift); | 843 | decrementer_clockevent.shift); |
| 872 | decrementer_clockevent.max_delta_ns = | 844 | decrementer_clockevent.max_delta_ns = |
| 873 | clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent); | 845 | clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent); |
| 874 | decrementer_clockevent.min_delta_ns = 1000; | 846 | decrementer_clockevent.min_delta_ns = |
| 847 | clockevent_delta2ns(2, &decrementer_clockevent); | ||
| 875 | 848 | ||
| 876 | register_decrementer_clockevent(cpu); | 849 | register_decrementer_clockevent(cpu); |
| 877 | } | 850 | } |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 823a8cbd60b5..f66fa5d966b0 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
| @@ -37,11 +37,10 @@ SECTIONS | |||
| 37 | ALIGN_FUNCTION(); | 37 | ALIGN_FUNCTION(); |
| 38 | *(.text.head) | 38 | *(.text.head) |
| 39 | _text = .; | 39 | _text = .; |
| 40 | TEXT_TEXT | 40 | *(.text .fixup .text.init.refok .exit.text.refok) |
| 41 | SCHED_TEXT | 41 | SCHED_TEXT |
| 42 | LOCK_TEXT | 42 | LOCK_TEXT |
| 43 | KPROBES_TEXT | 43 | KPROBES_TEXT |
| 44 | *(.fixup) | ||
| 45 | 44 | ||
| 46 | #ifdef CONFIG_PPC32 | 45 | #ifdef CONFIG_PPC32 |
| 47 | *(.got1) | 46 | *(.got1) |
diff --git a/arch/powerpc/mm/40x_mmu.c b/arch/powerpc/mm/40x_mmu.c index e067df836be2..3899ea97fbdf 100644 --- a/arch/powerpc/mm/40x_mmu.c +++ b/arch/powerpc/mm/40x_mmu.c | |||
| @@ -98,13 +98,12 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 98 | 98 | ||
| 99 | v = KERNELBASE; | 99 | v = KERNELBASE; |
| 100 | p = PPC_MEMSTART; | 100 | p = PPC_MEMSTART; |
| 101 | s = 0; | 101 | s = total_lowmem; |
| 102 | 102 | ||
| 103 | if (__map_without_ltlbs) { | 103 | if (__map_without_ltlbs) |
| 104 | return s; | 104 | return 0; |
| 105 | } | ||
| 106 | 105 | ||
| 107 | while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) { | 106 | while (s >= LARGE_PAGE_SIZE_16M) { |
| 108 | pmd_t *pmdp; | 107 | pmd_t *pmdp; |
| 109 | unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; | 108 | unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; |
| 110 | 109 | ||
| @@ -116,10 +115,10 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 116 | 115 | ||
| 117 | v += LARGE_PAGE_SIZE_16M; | 116 | v += LARGE_PAGE_SIZE_16M; |
| 118 | p += LARGE_PAGE_SIZE_16M; | 117 | p += LARGE_PAGE_SIZE_16M; |
| 119 | s += LARGE_PAGE_SIZE_16M; | 118 | s -= LARGE_PAGE_SIZE_16M; |
| 120 | } | 119 | } |
| 121 | 120 | ||
| 122 | while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) { | 121 | while (s >= LARGE_PAGE_SIZE_4M) { |
| 123 | pmd_t *pmdp; | 122 | pmd_t *pmdp; |
| 124 | unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; | 123 | unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; |
| 125 | 124 | ||
| @@ -128,8 +127,8 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 128 | 127 | ||
| 129 | v += LARGE_PAGE_SIZE_4M; | 128 | v += LARGE_PAGE_SIZE_4M; |
| 130 | p += LARGE_PAGE_SIZE_4M; | 129 | p += LARGE_PAGE_SIZE_4M; |
| 131 | s += LARGE_PAGE_SIZE_4M; | 130 | s -= LARGE_PAGE_SIZE_4M; |
| 132 | } | 131 | } |
| 133 | 132 | ||
| 134 | return s; | 133 | return total_lowmem - s; |
| 135 | } | 134 | } |
diff --git a/arch/powerpc/mm/44x_mmu.c b/arch/powerpc/mm/44x_mmu.c index c3df50476539..04dc08798d3d 100644 --- a/arch/powerpc/mm/44x_mmu.c +++ b/arch/powerpc/mm/44x_mmu.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | */ | 35 | */ |
| 36 | unsigned int tlb_44x_index; /* = 0 */ | 36 | unsigned int tlb_44x_index; /* = 0 */ |
| 37 | unsigned int tlb_44x_hwater = PPC44x_TLB_SIZE - 1 - PPC44x_EARLY_TLBS; | 37 | unsigned int tlb_44x_hwater = PPC44x_TLB_SIZE - 1 - PPC44x_EARLY_TLBS; |
| 38 | int icache_44x_need_flush; | ||
| 38 | 39 | ||
| 39 | /* | 40 | /* |
| 40 | * "Pins" a 256MB TLB entry in AS0 for kernel lowmem | 41 | * "Pins" a 256MB TLB entry in AS0 for kernel lowmem |
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index a18fda361cc0..8135da06e0a4 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c | |||
| @@ -309,7 +309,7 @@ good_area: | |||
| 309 | set_bit(PG_arch_1, &page->flags); | 309 | set_bit(PG_arch_1, &page->flags); |
| 310 | } | 310 | } |
| 311 | pte_update(ptep, 0, _PAGE_HWEXEC); | 311 | pte_update(ptep, 0, _PAGE_HWEXEC); |
| 312 | _tlbie(address); | 312 | _tlbie(address, mm->context.id); |
| 313 | pte_unmap_unlock(ptep, ptl); | 313 | pte_unmap_unlock(ptep, ptl); |
| 314 | up_read(&mm->mmap_sem); | 314 | up_read(&mm->mmap_sem); |
| 315 | return 0; | 315 | return 0; |
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S index ad253b959030..e935edd6b72b 100644 --- a/arch/powerpc/mm/hash_low_64.S +++ b/arch/powerpc/mm/hash_low_64.S | |||
| @@ -331,7 +331,7 @@ htab_pte_insert_failure: | |||
| 331 | *****************************************************************************/ | 331 | *****************************************************************************/ |
| 332 | 332 | ||
| 333 | /* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid, | 333 | /* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid, |
| 334 | * pte_t *ptep, unsigned long trap, int local) | 334 | * pte_t *ptep, unsigned long trap, int local, int ssize) |
| 335 | */ | 335 | */ |
| 336 | 336 | ||
| 337 | /* | 337 | /* |
| @@ -557,7 +557,8 @@ htab_inval_old_hpte: | |||
| 557 | mr r4,r31 /* PTE.pte */ | 557 | mr r4,r31 /* PTE.pte */ |
| 558 | li r5,0 /* PTE.hidx */ | 558 | li r5,0 /* PTE.hidx */ |
| 559 | li r6,MMU_PAGE_64K /* psize */ | 559 | li r6,MMU_PAGE_64K /* psize */ |
| 560 | ld r7,STK_PARM(r8)(r1) /* local */ | 560 | ld r7,STK_PARM(r9)(r1) /* ssize */ |
| 561 | ld r8,STK_PARM(r8)(r1) /* local */ | ||
| 561 | bl .flush_hash_page | 562 | bl .flush_hash_page |
| 562 | b htab_insert_pte | 563 | b htab_insert_pte |
| 563 | 564 | ||
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index c78dc912411f..f09730bf3a33 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <asm/cputable.h> | 51 | #include <asm/cputable.h> |
| 52 | #include <asm/sections.h> | 52 | #include <asm/sections.h> |
| 53 | #include <asm/spu.h> | 53 | #include <asm/spu.h> |
| 54 | #include <asm/udbg.h> | ||
| 54 | 55 | ||
| 55 | #ifdef DEBUG | 56 | #ifdef DEBUG |
| 56 | #define DBG(fmt...) udbg_printf(fmt) | 57 | #define DBG(fmt...) udbg_printf(fmt) |
| @@ -791,8 +792,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
| 791 | } | 792 | } |
| 792 | if (user_region) { | 793 | if (user_region) { |
| 793 | if (psize != get_paca()->context.user_psize) { | 794 | if (psize != get_paca()->context.user_psize) { |
| 794 | get_paca()->context.user_psize = | 795 | get_paca()->context = mm->context; |
| 795 | mm->context.user_psize; | ||
| 796 | slb_flush_and_rebolt(); | 796 | slb_flush_and_rebolt(); |
| 797 | } | 797 | } |
| 798 | } else if (get_paca()->vmalloc_sllp != | 798 | } else if (get_paca()->vmalloc_sllp != |
| @@ -885,6 +885,9 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
| 885 | local_irq_restore(flags); | 885 | local_irq_restore(flags); |
| 886 | } | 886 | } |
| 887 | 887 | ||
| 888 | /* WARNING: This is called from hash_low_64.S, if you change this prototype, | ||
| 889 | * do not forget to update the assembly call site ! | ||
| 890 | */ | ||
| 888 | void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int ssize, | 891 | void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int ssize, |
| 889 | int local) | 892 | int local) |
| 890 | { | 893 | { |
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index c94a64fd3c01..eb3a732e91db 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h | |||
| @@ -61,12 +61,12 @@ extern unsigned long total_lowmem; | |||
| 61 | #define mmu_mapin_ram() (0UL) | 61 | #define mmu_mapin_ram() (0UL) |
| 62 | 62 | ||
| 63 | #elif defined(CONFIG_4xx) | 63 | #elif defined(CONFIG_4xx) |
| 64 | #define flush_HPTE(X, va, pg) _tlbie(va) | 64 | #define flush_HPTE(pid, va, pg) _tlbie(va, pid) |
| 65 | extern void MMU_init_hw(void); | 65 | extern void MMU_init_hw(void); |
| 66 | extern unsigned long mmu_mapin_ram(void); | 66 | extern unsigned long mmu_mapin_ram(void); |
| 67 | 67 | ||
| 68 | #elif defined(CONFIG_FSL_BOOKE) | 68 | #elif defined(CONFIG_FSL_BOOKE) |
| 69 | #define flush_HPTE(X, va, pg) _tlbie(va) | 69 | #define flush_HPTE(pid, va, pg) _tlbie(va, pid) |
| 70 | extern void MMU_init_hw(void); | 70 | extern void MMU_init_hw(void); |
| 71 | extern unsigned long mmu_mapin_ram(void); | 71 | extern unsigned long mmu_mapin_ram(void); |
| 72 | extern void adjust_total_lowmem(void); | 72 | extern void adjust_total_lowmem(void); |
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c index bbd2c512ee05..27922dff8b94 100644 --- a/arch/powerpc/mm/slb.c +++ b/arch/powerpc/mm/slb.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <asm/smp.h> | 25 | #include <asm/smp.h> |
| 26 | #include <asm/firmware.h> | 26 | #include <asm/firmware.h> |
| 27 | #include <linux/compiler.h> | 27 | #include <linux/compiler.h> |
| 28 | #include <asm/udbg.h> | ||
| 28 | 29 | ||
| 29 | #ifdef DEBUG | 30 | #ifdef DEBUG |
| 30 | #define DBG(fmt...) udbg_printf(fmt) | 31 | #define DBG(fmt...) udbg_printf(fmt) |
| @@ -148,6 +149,35 @@ void slb_vmalloc_update(void) | |||
| 148 | slb_flush_and_rebolt(); | 149 | slb_flush_and_rebolt(); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 152 | /* Helper function to compare esids. There are four cases to handle. | ||
| 153 | * 1. The system is not 1T segment size capable. Use the GET_ESID compare. | ||
| 154 | * 2. The system is 1T capable, both addresses are < 1T, use the GET_ESID compare. | ||
| 155 | * 3. The system is 1T capable, only one of the two addresses is > 1T. This is not a match. | ||
| 156 | * 4. The system is 1T capable, both addresses are > 1T, use the GET_ESID_1T macro to compare. | ||
| 157 | */ | ||
| 158 | static inline int esids_match(unsigned long addr1, unsigned long addr2) | ||
| 159 | { | ||
| 160 | int esid_1t_count; | ||
| 161 | |||
| 162 | /* System is not 1T segment size capable. */ | ||
| 163 | if (!cpu_has_feature(CPU_FTR_1T_SEGMENT)) | ||
| 164 | return (GET_ESID(addr1) == GET_ESID(addr2)); | ||
| 165 | |||
| 166 | esid_1t_count = (((addr1 >> SID_SHIFT_1T) != 0) + | ||
| 167 | ((addr2 >> SID_SHIFT_1T) != 0)); | ||
| 168 | |||
| 169 | /* both addresses are < 1T */ | ||
| 170 | if (esid_1t_count == 0) | ||
| 171 | return (GET_ESID(addr1) == GET_ESID(addr2)); | ||
| 172 | |||
| 173 | /* One address < 1T, the other > 1T. Not a match */ | ||
| 174 | if (esid_1t_count == 1) | ||
| 175 | return 0; | ||
| 176 | |||
| 177 | /* Both addresses are > 1T. */ | ||
| 178 | return (GET_ESID_1T(addr1) == GET_ESID_1T(addr2)); | ||
| 179 | } | ||
| 180 | |||
| 151 | /* Flush all user entries from the segment table of the current processor. */ | 181 | /* Flush all user entries from the segment table of the current processor. */ |
| 152 | void switch_slb(struct task_struct *tsk, struct mm_struct *mm) | 182 | void switch_slb(struct task_struct *tsk, struct mm_struct *mm) |
| 153 | { | 183 | { |
| @@ -193,15 +223,14 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm) | |||
| 193 | return; | 223 | return; |
| 194 | slb_allocate(pc); | 224 | slb_allocate(pc); |
| 195 | 225 | ||
| 196 | if (GET_ESID(pc) == GET_ESID(stack)) | 226 | if (esids_match(pc,stack)) |
| 197 | return; | 227 | return; |
| 198 | 228 | ||
| 199 | if (is_kernel_addr(stack)) | 229 | if (is_kernel_addr(stack)) |
| 200 | return; | 230 | return; |
| 201 | slb_allocate(stack); | 231 | slb_allocate(stack); |
| 202 | 232 | ||
| 203 | if ((GET_ESID(pc) == GET_ESID(unmapped_base)) | 233 | if (esids_match(pc,unmapped_base) || esids_match(stack,unmapped_base)) |
| 204 | || (GET_ESID(stack) == GET_ESID(unmapped_base))) | ||
| 205 | return; | 234 | return; |
| 206 | 235 | ||
| 207 | if (is_kernel_addr(unmapped_base)) | 236 | if (is_kernel_addr(unmapped_base)) |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index 151fd8b82d63..04f74f9f9ab6 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
| @@ -158,6 +158,18 @@ static unsigned int iic_get_irq(void) | |||
| 158 | return virq; | 158 | return virq; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | void iic_setup_cpu(void) | ||
| 162 | { | ||
| 163 | out_be64(&__get_cpu_var(iic).regs->prio, 0xff); | ||
| 164 | } | ||
| 165 | |||
| 166 | u8 iic_get_target_id(int cpu) | ||
| 167 | { | ||
| 168 | return per_cpu(iic, cpu).target_id; | ||
| 169 | } | ||
| 170 | |||
| 171 | EXPORT_SYMBOL_GPL(iic_get_target_id); | ||
| 172 | |||
| 161 | #ifdef CONFIG_SMP | 173 | #ifdef CONFIG_SMP |
| 162 | 174 | ||
| 163 | /* Use the highest interrupt priorities for IPI */ | 175 | /* Use the highest interrupt priorities for IPI */ |
| @@ -166,29 +178,17 @@ static inline int iic_ipi_to_irq(int ipi) | |||
| 166 | return IIC_IRQ_TYPE_IPI + 0xf - ipi; | 178 | return IIC_IRQ_TYPE_IPI + 0xf - ipi; |
| 167 | } | 179 | } |
| 168 | 180 | ||
| 169 | void iic_setup_cpu(void) | ||
| 170 | { | ||
| 171 | out_be64(&__get_cpu_var(iic).regs->prio, 0xff); | ||
| 172 | } | ||
| 173 | |||
| 174 | void iic_cause_IPI(int cpu, int mesg) | 181 | void iic_cause_IPI(int cpu, int mesg) |
| 175 | { | 182 | { |
| 176 | out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4); | 183 | out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4); |
| 177 | } | 184 | } |
| 178 | 185 | ||
| 179 | u8 iic_get_target_id(int cpu) | ||
| 180 | { | ||
| 181 | return per_cpu(iic, cpu).target_id; | ||
| 182 | } | ||
| 183 | EXPORT_SYMBOL_GPL(iic_get_target_id); | ||
| 184 | |||
| 185 | struct irq_host *iic_get_irq_host(int node) | 186 | struct irq_host *iic_get_irq_host(int node) |
| 186 | { | 187 | { |
| 187 | return iic_host; | 188 | return iic_host; |
| 188 | } | 189 | } |
| 189 | EXPORT_SYMBOL_GPL(iic_get_irq_host); | 190 | EXPORT_SYMBOL_GPL(iic_get_irq_host); |
| 190 | 191 | ||
| 191 | |||
| 192 | static irqreturn_t iic_ipi_action(int irq, void *dev_id) | 192 | static irqreturn_t iic_ipi_action(int irq, void *dev_id) |
| 193 | { | 193 | { |
| 194 | int ipi = (int)(long)dev_id; | 194 | int ipi = (int)(long)dev_id; |
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index 1c0acbad7425..e4438456c867 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #include <asm/rtas.h> | 44 | #include <asm/rtas.h> |
| 45 | 45 | ||
| 46 | #include "interrupt.h" | 46 | #include "interrupt.h" |
| 47 | #include <asm/udbg.h> | ||
| 47 | 48 | ||
| 48 | #ifdef DEBUG | 49 | #ifdef DEBUG |
| 49 | #define DBG(fmt...) udbg_printf(fmt) | 50 | #define DBG(fmt...) udbg_printf(fmt) |
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c index 1769d755eff3..ddfb35ae741f 100644 --- a/arch/powerpc/platforms/celleb/setup.c +++ b/arch/powerpc/platforms/celleb/setup.c | |||
| @@ -49,6 +49,7 @@ | |||
| 49 | #include <asm/machdep.h> | 49 | #include <asm/machdep.h> |
| 50 | #include <asm/cputable.h> | 50 | #include <asm/cputable.h> |
| 51 | #include <asm/irq.h> | 51 | #include <asm/irq.h> |
| 52 | #include <asm/time.h> | ||
| 52 | #include <asm/spu_priv1.h> | 53 | #include <asm/spu_priv1.h> |
| 53 | #include <asm/firmware.h> | 54 | #include <asm/firmware.h> |
| 54 | #include <asm/of_platform.h> | 55 | #include <asm/of_platform.h> |
diff --git a/arch/powerpc/platforms/iseries/irq.h b/arch/powerpc/platforms/iseries/irq.h index 69f1b437fc7b..a1c236074034 100644 --- a/arch/powerpc/platforms/iseries/irq.h +++ b/arch/powerpc/platforms/iseries/irq.h | |||
| @@ -1,9 +1,13 @@ | |||
| 1 | #ifndef _ISERIES_IRQ_H | 1 | #ifndef _ISERIES_IRQ_H |
| 2 | #define _ISERIES_IRQ_H | 2 | #define _ISERIES_IRQ_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_PCI | ||
| 4 | extern void iSeries_init_IRQ(void); | 5 | extern void iSeries_init_IRQ(void); |
| 5 | extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32); | 6 | extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32); |
| 6 | extern void iSeries_activate_IRQs(void); | 7 | extern void iSeries_activate_IRQs(void); |
| 8 | #else | ||
| 9 | #define iSeries_init_IRQ NULL | ||
| 10 | #endif | ||
| 7 | extern unsigned int iSeries_get_irq(void); | 11 | extern unsigned int iSeries_get_irq(void); |
| 8 | 12 | ||
| 9 | #endif /* _ISERIES_IRQ_H */ | 13 | #endif /* _ISERIES_IRQ_H */ |
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 37ae07ee54a9..0877a8834110 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
| @@ -617,10 +617,6 @@ static void iseries_dedicated_idle(void) | |||
| 617 | } | 617 | } |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | #ifndef CONFIG_PCI | ||
| 621 | void __init iSeries_init_IRQ(void) { } | ||
| 622 | #endif | ||
| 623 | |||
| 624 | static void __iomem *iseries_ioremap(phys_addr_t address, unsigned long size, | 620 | static void __iomem *iseries_ioremap(phys_addr_t address, unsigned long size, |
| 625 | unsigned long flags) | 621 | unsigned long flags) |
| 626 | { | 622 | { |
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c index d6435b03971f..be06cfd9fa3d 100644 --- a/arch/powerpc/platforms/iseries/vio.c +++ b/arch/powerpc/platforms/iseries/vio.c | |||
| @@ -523,15 +523,16 @@ static void __init get_viotape_info(struct device_node *vio_root) | |||
| 523 | static int __init iseries_vio_init(void) | 523 | static int __init iseries_vio_init(void) |
| 524 | { | 524 | { |
| 525 | struct device_node *vio_root; | 525 | struct device_node *vio_root; |
| 526 | int ret = -ENODEV; | ||
| 526 | 527 | ||
| 527 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) | 528 | if (!firmware_has_feature(FW_FEATURE_ISERIES)) |
| 528 | return -ENODEV; | 529 | goto out; |
| 529 | 530 | ||
| 530 | iommu_vio_init(); | 531 | iommu_vio_init(); |
| 531 | 532 | ||
| 532 | vio_root = of_find_node_by_path("/vdevice"); | 533 | vio_root = of_find_node_by_path("/vdevice"); |
| 533 | if (!vio_root) | 534 | if (!vio_root) |
| 534 | return -ENODEV; | 535 | goto out; |
| 535 | 536 | ||
| 536 | if (viopath_hostLp == HvLpIndexInvalid) { | 537 | if (viopath_hostLp == HvLpIndexInvalid) { |
| 537 | vio_set_hostlp(); | 538 | vio_set_hostlp(); |
| @@ -544,10 +545,11 @@ static int __init iseries_vio_init(void) | |||
| 544 | get_viocd_info(vio_root); | 545 | get_viocd_info(vio_root); |
| 545 | get_viotape_info(vio_root); | 546 | get_viotape_info(vio_root); |
| 546 | 547 | ||
| 547 | return 0; | 548 | ret = 0; |
| 548 | 549 | ||
| 549 | put_node: | 550 | put_node: |
| 550 | of_node_put(vio_root); | 551 | of_node_put(vio_root); |
| 551 | return -ENODEV; | 552 | out: |
| 553 | return ret; | ||
| 552 | } | 554 | } |
| 553 | arch_initcall(iseries_vio_init); | 555 | arch_initcall(iseries_vio_init); |
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 22322b35a0ff..fb3d636e088b 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
| @@ -186,6 +186,11 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
| 186 | n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); | 186 | n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); |
| 187 | printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); | 187 | printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); |
| 188 | 188 | ||
| 189 | if (!dev) { | ||
| 190 | printk(KERN_WARNING "EEH: no PCI device for this of node\n"); | ||
| 191 | return n; | ||
| 192 | } | ||
| 193 | |||
| 189 | /* Gather bridge-specific registers */ | 194 | /* Gather bridge-specific registers */ |
| 190 | if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { | 195 | if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) { |
| 191 | rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg); | 196 | rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg); |
| @@ -198,7 +203,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
| 198 | } | 203 | } |
| 199 | 204 | ||
| 200 | /* Dump out the PCI-X command and status regs */ | 205 | /* Dump out the PCI-X command and status regs */ |
| 201 | cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX); | 206 | cap = pci_find_capability(dev, PCI_CAP_ID_PCIX); |
| 202 | if (cap) { | 207 | if (cap) { |
| 203 | rtas_read_config(pdn, cap, 4, &cfg); | 208 | rtas_read_config(pdn, cap, 4, &cfg); |
| 204 | n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg); | 209 | n += scnprintf(buf+n, len-n, "pcix-cmd:%x\n", cfg); |
| @@ -210,7 +215,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
| 210 | } | 215 | } |
| 211 | 216 | ||
| 212 | /* If PCI-E capable, dump PCI-E cap 10, and the AER */ | 217 | /* If PCI-E capable, dump PCI-E cap 10, and the AER */ |
| 213 | cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_EXP); | 218 | cap = pci_find_capability(dev, PCI_CAP_ID_EXP); |
| 214 | if (cap) { | 219 | if (cap) { |
| 215 | n += scnprintf(buf+n, len-n, "pci-e cap10:\n"); | 220 | n += scnprintf(buf+n, len-n, "pci-e cap10:\n"); |
| 216 | printk(KERN_WARNING | 221 | printk(KERN_WARNING |
| @@ -222,7 +227,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) | |||
| 222 | printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); | 227 | printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); |
| 223 | } | 228 | } |
| 224 | 229 | ||
| 225 | cap = pci_find_ext_capability(pdn->pcidev, PCI_EXT_CAP_ID_ERR); | 230 | cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
| 226 | if (cap) { | 231 | if (cap) { |
| 227 | n += scnprintf(buf+n, len-n, "pci-e AER:\n"); | 232 | n += scnprintf(buf+n, len-n, "pci-e AER:\n"); |
| 228 | printk(KERN_WARNING | 233 | printk(KERN_WARNING |
| @@ -318,7 +323,7 @@ eeh_wait_for_slot_status(struct pci_dn *pdn, int max_wait_msecs) | |||
| 318 | 323 | ||
| 319 | if (rets[2] == 0) return -1; /* permanently unavailable */ | 324 | if (rets[2] == 0) return -1; /* permanently unavailable */ |
| 320 | 325 | ||
| 321 | if (max_wait_msecs <= 0) return -1; | 326 | if (max_wait_msecs <= 0) break; |
| 322 | 327 | ||
| 323 | mwait = rets[2]; | 328 | mwait = rets[2]; |
| 324 | if (mwait <= 0) { | 329 | if (mwait <= 0) { |
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index 15e015ef6865..57e025e84ab4 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
| @@ -105,17 +105,18 @@ static void eeh_report_error(struct pci_dev *dev, void *userdata) | |||
| 105 | return; | 105 | return; |
| 106 | 106 | ||
| 107 | rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen); | 107 | rc = driver->err_handler->error_detected (dev, pci_channel_io_frozen); |
| 108 | |||
| 109 | /* A driver that needs a reset trumps all others */ | ||
| 110 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | ||
| 108 | if (*res == PCI_ERS_RESULT_NONE) *res = rc; | 111 | if (*res == PCI_ERS_RESULT_NONE) *res = rc; |
| 109 | if (*res == PCI_ERS_RESULT_DISCONNECT && | ||
| 110 | rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | ||
| 111 | } | 112 | } |
| 112 | 113 | ||
| 113 | /** | 114 | /** |
| 114 | * eeh_report_mmio_enabled - tell drivers that MMIO has been enabled | 115 | * eeh_report_mmio_enabled - tell drivers that MMIO has been enabled |
| 115 | * | 116 | * |
| 116 | * Report an EEH error to each device driver, collect up and | 117 | * Tells each device driver that IO ports, MMIO and config space I/O |
| 117 | * merge the device driver responses. Cumulative response | 118 | * are now enabled. Collects up and merges the device driver responses. |
| 118 | * passed back in "userdata". | 119 | * Cumulative response passed back in "userdata". |
| 119 | */ | 120 | */ |
| 120 | 121 | ||
| 121 | static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) | 122 | static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) |
| @@ -123,17 +124,16 @@ static void eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata) | |||
| 123 | enum pci_ers_result rc, *res = userdata; | 124 | enum pci_ers_result rc, *res = userdata; |
| 124 | struct pci_driver *driver = dev->driver; | 125 | struct pci_driver *driver = dev->driver; |
| 125 | 126 | ||
| 126 | // dev->error_state = pci_channel_mmio_enabled; | ||
| 127 | |||
| 128 | if (!driver || | 127 | if (!driver || |
| 129 | !driver->err_handler || | 128 | !driver->err_handler || |
| 130 | !driver->err_handler->mmio_enabled) | 129 | !driver->err_handler->mmio_enabled) |
| 131 | return; | 130 | return; |
| 132 | 131 | ||
| 133 | rc = driver->err_handler->mmio_enabled (dev); | 132 | rc = driver->err_handler->mmio_enabled (dev); |
| 133 | |||
| 134 | /* A driver that needs a reset trumps all others */ | ||
| 135 | if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | ||
| 134 | if (*res == PCI_ERS_RESULT_NONE) *res = rc; | 136 | if (*res == PCI_ERS_RESULT_NONE) *res = rc; |
| 135 | if (*res == PCI_ERS_RESULT_DISCONNECT && | ||
| 136 | rc == PCI_ERS_RESULT_NEED_RESET) *res = rc; | ||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | /** | 139 | /** |
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 8b18a1c40092..b765b7c77b65 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #include <asm/firmware.h> | 26 | #include <asm/firmware.h> |
| 27 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
| 28 | #include <asm/udbg.h> | ||
| 28 | 29 | ||
| 29 | #ifdef DEBUG | 30 | #ifdef DEBUG |
| 30 | #define DBG(fmt...) udbg_printf(fmt) | 31 | #define DBG(fmt...) udbg_printf(fmt) |
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 2793a1b100e6..f15222bbe136 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
| @@ -171,6 +171,7 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
| 171 | struct pci_dn *pdn; | 171 | struct pci_dn *pdn; |
| 172 | int hwirq, virq, i, rc; | 172 | int hwirq, virq, i, rc; |
| 173 | struct msi_desc *entry; | 173 | struct msi_desc *entry; |
| 174 | struct msi_msg msg; | ||
| 174 | 175 | ||
| 175 | pdn = get_pdn(pdev); | 176 | pdn = get_pdn(pdev); |
| 176 | if (!pdn) | 177 | if (!pdn) |
| @@ -213,6 +214,11 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
| 213 | 214 | ||
| 214 | dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); | 215 | dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); |
| 215 | set_irq_msi(virq, entry); | 216 | set_irq_msi(virq, entry); |
| 217 | |||
| 218 | /* Read config space back so we can restore after reset */ | ||
| 219 | read_msi_msg(virq, &msg); | ||
| 220 | entry->msg = msg; | ||
| 221 | |||
| 216 | unmask_msi_irq(virq); | 222 | unmask_msi_irq(virq); |
| 217 | } | 223 | } |
| 218 | 224 | ||
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c index 7c1b27ac7d3c..216c0f5680d2 100644 --- a/arch/powerpc/sysdev/i8259.c +++ b/arch/powerpc/sysdev/i8259.c | |||
| @@ -137,6 +137,7 @@ static void i8259_unmask_irq(unsigned int irq_nr) | |||
| 137 | static struct irq_chip i8259_pic = { | 137 | static struct irq_chip i8259_pic = { |
| 138 | .typename = " i8259 ", | 138 | .typename = " i8259 ", |
| 139 | .mask = i8259_mask_irq, | 139 | .mask = i8259_mask_irq, |
| 140 | .disable = i8259_mask_irq, | ||
| 140 | .unmask = i8259_unmask_irq, | 141 | .unmask = i8259_unmask_irq, |
| 141 | .mask_ack = i8259_mask_and_ack_irq, | 142 | .mask_ack = i8259_mask_and_ack_irq, |
| 142 | }; | 143 | }; |
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c index 9b3baa7317d7..6933f9c73b43 100644 --- a/arch/powerpc/sysdev/mv64x60_pci.c +++ b/arch/powerpc/sysdev/mv64x60_pci.c | |||
| @@ -24,8 +24,9 @@ | |||
| 24 | #define MV64X60_VAL_LEN_MAX 11 | 24 | #define MV64X60_VAL_LEN_MAX 11 |
| 25 | #define MV64X60_PCICFG_CPCI_HOTSWAP 0x68 | 25 | #define MV64X60_PCICFG_CPCI_HOTSWAP 0x68 |
| 26 | 26 | ||
| 27 | static ssize_t mv64x60_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, | 27 | static ssize_t mv64x60_hs_reg_read(struct kobject *kobj, |
| 28 | size_t count) | 28 | struct bin_attribute *attr, char *buf, |
| 29 | loff_t off, size_t count) | ||
| 29 | { | 30 | { |
| 30 | struct pci_dev *phb; | 31 | struct pci_dev *phb; |
| 31 | u32 v; | 32 | u32 v; |
| @@ -44,8 +45,9 @@ static ssize_t mv64x60_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, | |||
| 44 | return sprintf(buf, "0x%08x\n", v); | 45 | return sprintf(buf, "0x%08x\n", v); |
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | static ssize_t mv64x60_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, | 48 | static ssize_t mv64x60_hs_reg_write(struct kobject *kobj, |
| 48 | size_t count) | 49 | struct bin_attribute *attr, char *buf, |
| 50 | loff_t off, size_t count) | ||
| 49 | { | 51 | { |
| 50 | struct pci_dev *phb; | 52 | struct pci_dev *phb; |
| 51 | u32 v; | 53 | u32 v; |
diff --git a/arch/ppc/kernel/entry.S b/arch/ppc/kernel/entry.S index fba7ca17a67e..b19bfef2034d 100644 --- a/arch/ppc/kernel/entry.S +++ b/arch/ppc/kernel/entry.S | |||
| @@ -244,6 +244,13 @@ syscall_exit_cont: | |||
| 244 | andis. r10,r0,DBCR0_IC@h | 244 | andis. r10,r0,DBCR0_IC@h |
| 245 | bnel- load_dbcr0 | 245 | bnel- load_dbcr0 |
| 246 | #endif | 246 | #endif |
| 247 | #ifdef CONFIG_44x | ||
| 248 | lis r4,icache_44x_need_flush@ha | ||
| 249 | lwz r5,icache_44x_need_flush@l(r4) | ||
| 250 | cmplwi cr0,r5,0 | ||
| 251 | bne- 2f | ||
| 252 | 1: | ||
| 253 | #endif /* CONFIG_44x */ | ||
| 247 | stwcx. r0,0,r1 /* to clear the reservation */ | 254 | stwcx. r0,0,r1 /* to clear the reservation */ |
| 248 | lwz r4,_LINK(r1) | 255 | lwz r4,_LINK(r1) |
| 249 | lwz r5,_CCR(r1) | 256 | lwz r5,_CCR(r1) |
| @@ -258,6 +265,12 @@ syscall_exit_cont: | |||
| 258 | mtspr SPRN_SRR1,r8 | 265 | mtspr SPRN_SRR1,r8 |
| 259 | SYNC | 266 | SYNC |
| 260 | RFI | 267 | RFI |
| 268 | #ifdef CONFIG_44x | ||
| 269 | 2: li r7,0 | ||
| 270 | iccci r0,r0 | ||
| 271 | stw r7,icache_44x_need_flush@l(r4) | ||
| 272 | b 1b | ||
| 273 | #endif /* CONFIG_44x */ | ||
| 261 | 274 | ||
| 262 | 66: li r3,-ENOSYS | 275 | 66: li r3,-ENOSYS |
| 263 | b ret_from_syscall | 276 | b ret_from_syscall |
| @@ -679,6 +692,16 @@ resume_kernel: | |||
| 679 | 692 | ||
| 680 | /* interrupts are hard-disabled at this point */ | 693 | /* interrupts are hard-disabled at this point */ |
| 681 | restore: | 694 | restore: |
| 695 | #ifdef CONFIG_44x | ||
| 696 | lis r4,icache_44x_need_flush@ha | ||
| 697 | lwz r5,icache_44x_need_flush@l(r4) | ||
| 698 | cmplwi cr0,r5,0 | ||
| 699 | beq+ 1f | ||
| 700 | li r6,0 | ||
| 701 | iccci r0,r0 | ||
| 702 | stw r6,icache_44x_need_flush@l(r4) | ||
| 703 | 1: | ||
| 704 | #endif /* CONFIG_44x */ | ||
| 682 | lwz r0,GPR0(r1) | 705 | lwz r0,GPR0(r1) |
| 683 | lwz r2,GPR2(r1) | 706 | lwz r2,GPR2(r1) |
| 684 | REST_4GPRS(3, r1) | 707 | REST_4GPRS(3, r1) |
diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S index a22e1f4d94c8..e0c850d85c53 100644 --- a/arch/ppc/kernel/misc.S +++ b/arch/ppc/kernel/misc.S | |||
| @@ -224,7 +224,16 @@ _GLOBAL(_tlbia) | |||
| 224 | */ | 224 | */ |
| 225 | _GLOBAL(_tlbie) | 225 | _GLOBAL(_tlbie) |
| 226 | #if defined(CONFIG_40x) | 226 | #if defined(CONFIG_40x) |
| 227 | /* We run the search with interrupts disabled because we have to change | ||
| 228 | * the PID and I don't want to preempt when that happens. | ||
| 229 | */ | ||
| 230 | mfmsr r5 | ||
| 231 | mfspr r6,SPRN_PID | ||
| 232 | wrteei 0 | ||
| 233 | mtspr SPRN_PID,r4 | ||
| 227 | tlbsx. r3, 0, r3 | 234 | tlbsx. r3, 0, r3 |
| 235 | mtspr SPRN_PID,r6 | ||
| 236 | wrtee r5 | ||
| 228 | bne 10f | 237 | bne 10f |
| 229 | sync | 238 | sync |
| 230 | /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear. | 239 | /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is clear. |
| @@ -234,22 +243,21 @@ _GLOBAL(_tlbie) | |||
| 234 | isync | 243 | isync |
| 235 | 10: | 244 | 10: |
| 236 | #elif defined(CONFIG_44x) | 245 | #elif defined(CONFIG_44x) |
| 237 | mfspr r4,SPRN_MMUCR | 246 | mfspr r5,SPRN_MMUCR |
| 238 | mfspr r5,SPRN_PID /* Get PID */ | 247 | rlwimi r5,r4,0,24,31 /* Set TID */ |
| 239 | rlwimi r4,r5,0,24,31 /* Set TID */ | ||
| 240 | 248 | ||
| 241 | /* We have to run the search with interrupts disabled, even critical | 249 | /* We have to run the search with interrupts disabled, even critical |
| 242 | * and debug interrupts (in fact the only critical exceptions we have | 250 | * and debug interrupts (in fact the only critical exceptions we have |
| 243 | * are debug and machine check). Otherwise an interrupt which causes | 251 | * are debug and machine check). Otherwise an interrupt which causes |
| 244 | * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */ | 252 | * a TLB miss can clobber the MMUCR between the mtspr and the tlbsx. */ |
| 245 | mfmsr r5 | 253 | mfmsr r4 |
| 246 | lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha | 254 | lis r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@ha |
| 247 | addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l | 255 | addi r6,r6,(MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l |
| 248 | andc r6,r5,r6 | 256 | andc r6,r4,r6 |
| 249 | mtmsr r6 | 257 | mtmsr r6 |
| 250 | mtspr SPRN_MMUCR,r4 | 258 | mtspr SPRN_MMUCR,r5 |
| 251 | tlbsx. r3, 0, r3 | 259 | tlbsx. r3, 0, r3 |
| 252 | mtmsr r5 | 260 | mtmsr r4 |
| 253 | bne 10f | 261 | bne 10f |
| 254 | sync | 262 | sync |
| 255 | /* There are only 64 TLB entries, so r3 < 64, | 263 | /* There are only 64 TLB entries, so r3 < 64, |
| @@ -491,12 +499,21 @@ END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE) | |||
| 491 | addi r3,r3,L1_CACHE_BYTES | 499 | addi r3,r3,L1_CACHE_BYTES |
| 492 | bdnz 0b | 500 | bdnz 0b |
| 493 | sync | 501 | sync |
| 502 | #ifndef CONFIG_44x | ||
| 503 | /* We don't flush the icache on 44x. Those have a virtual icache | ||
| 504 | * and we don't have access to the virtual address here (it's | ||
| 505 | * not the page vaddr but where it's mapped in user space). The | ||
| 506 | * flushing of the icache on these is handled elsewhere, when | ||
| 507 | * a change in the address space occurs, before returning to | ||
| 508 | * user space | ||
| 509 | */ | ||
| 494 | mtctr r4 | 510 | mtctr r4 |
| 495 | 1: icbi 0,r6 | 511 | 1: icbi 0,r6 |
| 496 | addi r6,r6,L1_CACHE_BYTES | 512 | addi r6,r6,L1_CACHE_BYTES |
| 497 | bdnz 1b | 513 | bdnz 1b |
| 498 | sync | 514 | sync |
| 499 | isync | 515 | isync |
| 516 | #endif /* CONFIG_44x */ | ||
| 500 | blr | 517 | blr |
| 501 | 518 | ||
| 502 | /* | 519 | /* |
diff --git a/arch/ppc/mm/44x_mmu.c b/arch/ppc/mm/44x_mmu.c index 0a0a0487b334..6536a25cfcb8 100644 --- a/arch/ppc/mm/44x_mmu.c +++ b/arch/ppc/mm/44x_mmu.c | |||
| @@ -61,6 +61,7 @@ extern char etext[], _stext[]; | |||
| 61 | */ | 61 | */ |
| 62 | unsigned int tlb_44x_index = 0; | 62 | unsigned int tlb_44x_index = 0; |
| 63 | unsigned int tlb_44x_hwater = 62; | 63 | unsigned int tlb_44x_hwater = 62; |
| 64 | int icache_44x_need_flush; | ||
| 64 | 65 | ||
| 65 | /* | 66 | /* |
| 66 | * "Pins" a 256MB TLB entry in AS0 for kernel lowmem | 67 | * "Pins" a 256MB TLB entry in AS0 for kernel lowmem |
diff --git a/arch/ppc/mm/4xx_mmu.c b/arch/ppc/mm/4xx_mmu.c index 838e09db71d9..ea785dbaac7c 100644 --- a/arch/ppc/mm/4xx_mmu.c +++ b/arch/ppc/mm/4xx_mmu.c | |||
| @@ -99,13 +99,12 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 99 | 99 | ||
| 100 | v = KERNELBASE; | 100 | v = KERNELBASE; |
| 101 | p = PPC_MEMSTART; | 101 | p = PPC_MEMSTART; |
| 102 | s = 0; | 102 | s = total_lowmem; |
| 103 | 103 | ||
| 104 | if (__map_without_ltlbs) { | 104 | if (__map_without_ltlbs) |
| 105 | return s; | 105 | return 0; |
| 106 | } | ||
| 107 | 106 | ||
| 108 | while (s <= (total_lowmem - LARGE_PAGE_SIZE_16M)) { | 107 | while (s >= LARGE_PAGE_SIZE_16M) { |
| 109 | pmd_t *pmdp; | 108 | pmd_t *pmdp; |
| 110 | unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; | 109 | unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; |
| 111 | 110 | ||
| @@ -117,10 +116,10 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 117 | 116 | ||
| 118 | v += LARGE_PAGE_SIZE_16M; | 117 | v += LARGE_PAGE_SIZE_16M; |
| 119 | p += LARGE_PAGE_SIZE_16M; | 118 | p += LARGE_PAGE_SIZE_16M; |
| 120 | s += LARGE_PAGE_SIZE_16M; | 119 | s -= LARGE_PAGE_SIZE_16M; |
| 121 | } | 120 | } |
| 122 | 121 | ||
| 123 | while (s <= (total_lowmem - LARGE_PAGE_SIZE_4M)) { | 122 | while (s >= LARGE_PAGE_SIZE_4M) { |
| 124 | pmd_t *pmdp; | 123 | pmd_t *pmdp; |
| 125 | unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; | 124 | unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; |
| 126 | 125 | ||
| @@ -129,8 +128,8 @@ unsigned long __init mmu_mapin_ram(void) | |||
| 129 | 128 | ||
| 130 | v += LARGE_PAGE_SIZE_4M; | 129 | v += LARGE_PAGE_SIZE_4M; |
| 131 | p += LARGE_PAGE_SIZE_4M; | 130 | p += LARGE_PAGE_SIZE_4M; |
| 132 | s += LARGE_PAGE_SIZE_4M; | 131 | s -= LARGE_PAGE_SIZE_4M; |
| 133 | } | 132 | } |
| 134 | 133 | ||
| 135 | return s; | 134 | return total_lowmem - s; |
| 136 | } | 135 | } |
diff --git a/arch/ppc/mm/fault.c b/arch/ppc/mm/fault.c index 254c23b755e6..36c0e7529edb 100644 --- a/arch/ppc/mm/fault.c +++ b/arch/ppc/mm/fault.c | |||
| @@ -227,7 +227,7 @@ good_area: | |||
| 227 | set_bit(PG_arch_1, &page->flags); | 227 | set_bit(PG_arch_1, &page->flags); |
| 228 | } | 228 | } |
| 229 | pte_update(ptep, 0, _PAGE_HWEXEC); | 229 | pte_update(ptep, 0, _PAGE_HWEXEC); |
| 230 | _tlbie(address); | 230 | _tlbie(address, mm->context.id); |
| 231 | pte_unmap_unlock(ptep, ptl); | 231 | pte_unmap_unlock(ptep, ptl); |
| 232 | up_read(&mm->mmap_sem); | 232 | up_read(&mm->mmap_sem); |
| 233 | return 0; | 233 | return 0; |
diff --git a/arch/ppc/mm/mmu_decl.h b/arch/ppc/mm/mmu_decl.h index 540f3292b229..f1d4f2109a99 100644 --- a/arch/ppc/mm/mmu_decl.h +++ b/arch/ppc/mm/mmu_decl.h | |||
| @@ -54,12 +54,12 @@ extern unsigned int num_tlbcam_entries; | |||
| 54 | #define mmu_mapin_ram() (0UL) | 54 | #define mmu_mapin_ram() (0UL) |
| 55 | 55 | ||
| 56 | #elif defined(CONFIG_4xx) | 56 | #elif defined(CONFIG_4xx) |
| 57 | #define flush_HPTE(X, va, pg) _tlbie(va) | 57 | #define flush_HPTE(pid, va, pg) _tlbie(va, pid) |
| 58 | extern void MMU_init_hw(void); | 58 | extern void MMU_init_hw(void); |
| 59 | extern unsigned long mmu_mapin_ram(void); | 59 | extern unsigned long mmu_mapin_ram(void); |
| 60 | 60 | ||
| 61 | #elif defined(CONFIG_FSL_BOOKE) | 61 | #elif defined(CONFIG_FSL_BOOKE) |
| 62 | #define flush_HPTE(X, va, pg) _tlbie(va) | 62 | #define flush_HPTE(pid, va, pg) _tlbie(va, pid) |
| 63 | extern void MMU_init_hw(void); | 63 | extern void MMU_init_hw(void); |
| 64 | extern unsigned long mmu_mapin_ram(void); | 64 | extern unsigned long mmu_mapin_ram(void); |
| 65 | extern void adjust_total_lowmem(void); | 65 | extern void adjust_total_lowmem(void); |
diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index 05d7184d7e14..453643a0eeea 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c | |||
| @@ -236,7 +236,7 @@ ebony_early_serial_map(void) | |||
| 236 | gen550_init(0, &port); | 236 | gen550_init(0, &port); |
| 237 | 237 | ||
| 238 | /* Purge TLB entry added in head_44x.S for early serial access */ | 238 | /* Purge TLB entry added in head_44x.S for early serial access */ |
| 239 | _tlbie(UART0_IO_BASE); | 239 | _tlbie(UART0_IO_BASE, 0); |
| 240 | #endif | 240 | #endif |
| 241 | 241 | ||
| 242 | port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); | 242 | port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); |
diff --git a/arch/ppc/platforms/4xx/luan.c b/arch/ppc/platforms/4xx/luan.c index 4b169610f154..b79ebb8a3e6c 100644 --- a/arch/ppc/platforms/4xx/luan.c +++ b/arch/ppc/platforms/4xx/luan.c | |||
| @@ -230,9 +230,14 @@ luan_setup_hoses(void) | |||
| 230 | 230 | ||
| 231 | /* Allocate hoses for PCIX1 and PCIX2 */ | 231 | /* Allocate hoses for PCIX1 and PCIX2 */ |
| 232 | hose1 = pcibios_alloc_controller(); | 232 | hose1 = pcibios_alloc_controller(); |
| 233 | if (!hose1) | ||
| 234 | return; | ||
| 235 | |||
| 233 | hose2 = pcibios_alloc_controller(); | 236 | hose2 = pcibios_alloc_controller(); |
| 234 | if (!hose1 || !hose2) | 237 | if (!hose2) { |
| 238 | pcibios_free_controller(hose1); | ||
| 235 | return; | 239 | return; |
| 240 | } | ||
| 236 | 241 | ||
| 237 | /* Setup PCIX1 */ | 242 | /* Setup PCIX1 */ |
| 238 | hose1->first_busno = 0; | 243 | hose1->first_busno = 0; |
diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c index fd0f971881d6..28a712cd4800 100644 --- a/arch/ppc/platforms/4xx/ocotea.c +++ b/arch/ppc/platforms/4xx/ocotea.c | |||
| @@ -259,7 +259,7 @@ ocotea_early_serial_map(void) | |||
| 259 | gen550_init(0, &port); | 259 | gen550_init(0, &port); |
| 260 | 260 | ||
| 261 | /* Purge TLB entry added in head_44x.S for early serial access */ | 261 | /* Purge TLB entry added in head_44x.S for early serial access */ |
| 262 | _tlbie(UART0_IO_BASE); | 262 | _tlbie(UART0_IO_BASE, 0); |
| 263 | #endif | 263 | #endif |
| 264 | 264 | ||
| 265 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); | 265 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); |
diff --git a/arch/ppc/platforms/4xx/taishan.c b/arch/ppc/platforms/4xx/taishan.c index 888c492b4a45..f6a0c6650f33 100644 --- a/arch/ppc/platforms/4xx/taishan.c +++ b/arch/ppc/platforms/4xx/taishan.c | |||
| @@ -316,7 +316,7 @@ taishan_early_serial_map(void) | |||
| 316 | gen550_init(0, &port); | 316 | gen550_init(0, &port); |
| 317 | 317 | ||
| 318 | /* Purge TLB entry added in head_44x.S for early serial access */ | 318 | /* Purge TLB entry added in head_44x.S for early serial access */ |
| 319 | _tlbie(UART0_IO_BASE); | 319 | _tlbie(UART0_IO_BASE, 0); |
| 320 | #endif | 320 | #endif |
| 321 | 321 | ||
| 322 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); | 322 | port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); |
diff --git a/arch/ppc/syslib/i8259.c b/arch/ppc/syslib/i8259.c index 1e5a00a4b5f5..559f27c6aefe 100644 --- a/arch/ppc/syslib/i8259.c +++ b/arch/ppc/syslib/i8259.c | |||
| @@ -127,6 +127,7 @@ static void i8259_unmask_irq(unsigned int irq_nr) | |||
| 127 | static struct irq_chip i8259_pic = { | 127 | static struct irq_chip i8259_pic = { |
| 128 | .typename = " i8259 ", | 128 | .typename = " i8259 ", |
| 129 | .mask = i8259_mask_irq, | 129 | .mask = i8259_mask_irq, |
| 130 | .disable = i8259_mask_irq, | ||
| 130 | .unmask = i8259_unmask_irq, | 131 | .unmask = i8259_unmask_irq, |
| 131 | .mask_ack = i8259_mask_and_ack_irq, | 132 | .mask_ack = i8259_mask_and_ack_irq, |
| 132 | }; | 133 | }; |
diff --git a/arch/ppc/syslib/m8260_setup.c b/arch/ppc/syslib/m8260_setup.c index 15f0d7323535..46588fa94381 100644 --- a/arch/ppc/syslib/m8260_setup.c +++ b/arch/ppc/syslib/m8260_setup.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <asm/machdep.h> | 25 | #include <asm/machdep.h> |
| 26 | #include <asm/bootinfo.h> | 26 | #include <asm/bootinfo.h> |
| 27 | #include <asm/time.h> | 27 | #include <asm/time.h> |
| 28 | #include <asm/ppc_sys.h> | ||
| 28 | 29 | ||
| 29 | #include "cpm2_pic.h" | 30 | #include "cpm2_pic.h" |
| 30 | 31 | ||
| @@ -61,7 +62,7 @@ m8260_setup_arch(void) | |||
| 61 | #endif | 62 | #endif |
| 62 | 63 | ||
| 63 | identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME, | 64 | identify_ppc_sys_by_name_and_id(BOARD_CHIP_NAME, |
| 64 | in_be32(CPM_MAP_ADDR + CPM_IMMR_OFFSET)); | 65 | in_be32((void *)CPM_MAP_ADDR + CPM_IMMR_OFFSET)); |
| 65 | 66 | ||
| 66 | m82xx_board_setup(); | 67 | m82xx_board_setup(); |
| 67 | } | 68 | } |
| @@ -147,12 +148,12 @@ m8260_show_cpuinfo(struct seq_file *m) | |||
| 147 | seq_printf(m, "vendor\t\t: %s\n" | 148 | seq_printf(m, "vendor\t\t: %s\n" |
| 148 | "machine\t\t: %s\n" | 149 | "machine\t\t: %s\n" |
| 149 | "\n" | 150 | "\n" |
| 150 | "mem size\t\t: 0x%08x\n" | 151 | "mem size\t\t: 0x%08lx\n" |
| 151 | "console baud\t\t: %d\n" | 152 | "console baud\t\t: %ld\n" |
| 152 | "\n" | 153 | "\n" |
| 153 | "core clock\t: %u MHz\n" | 154 | "core clock\t: %lu MHz\n" |
| 154 | "CPM clock\t: %u MHz\n" | 155 | "CPM clock\t: %lu MHz\n" |
| 155 | "bus clock\t: %u MHz\n", | 156 | "bus clock\t: %lu MHz\n", |
| 156 | CPUINFO_VENDOR, CPUINFO_MACHINE, bp->bi_memsize, | 157 | CPUINFO_VENDOR, CPUINFO_MACHINE, bp->bi_memsize, |
| 157 | bp->bi_baudrate, bp->bi_intfreq / 1000000, | 158 | bp->bi_baudrate, bp->bi_intfreq / 1000000, |
| 158 | bp->bi_cpmfreq / 1000000, bp->bi_busfreq / 1000000); | 159 | bp->bi_cpmfreq / 1000000, bp->bi_busfreq / 1000000); |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index a963fe81359e..22b800ce2126 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
| @@ -145,12 +145,8 @@ void account_ticks(u64 time) | |||
| 145 | do_timer(ticks); | 145 | do_timer(ticks); |
| 146 | #endif | 146 | #endif |
| 147 | 147 | ||
| 148 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 149 | account_tick_vtime(current); | ||
| 150 | #else | ||
| 151 | while (ticks--) | 148 | while (ticks--) |
| 152 | update_process_times(user_mode(get_irq_regs())); | 149 | update_process_times(user_mode(get_irq_regs())); |
| 153 | #endif | ||
| 154 | 150 | ||
| 155 | s390_do_profile(); | 151 | s390_do_profile(); |
| 156 | } | 152 | } |
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 84ff78de6bac..c5f05b3fb2c3 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
| @@ -32,7 +32,7 @@ static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); | |||
| 32 | * Update process times based on virtual cpu times stored by entry.S | 32 | * Update process times based on virtual cpu times stored by entry.S |
| 33 | * to the lowcore fields user_timer, system_timer & steal_clock. | 33 | * to the lowcore fields user_timer, system_timer & steal_clock. |
| 34 | */ | 34 | */ |
| 35 | void account_tick_vtime(struct task_struct *tsk) | 35 | void account_process_tick(struct task_struct *tsk, int user_tick) |
| 36 | { | 36 | { |
| 37 | cputime_t cputime; | 37 | cputime_t cputime; |
| 38 | __u64 timer, clock; | 38 | __u64 timer, clock; |
| @@ -64,12 +64,6 @@ void account_tick_vtime(struct task_struct *tsk) | |||
| 64 | S390_lowcore.steal_clock -= cputime << 12; | 64 | S390_lowcore.steal_clock -= cputime << 12; |
| 65 | account_steal_time(tsk, cputime); | 65 | account_steal_time(tsk, cputime); |
| 66 | } | 66 | } |
| 67 | |||
| 68 | run_local_timers(); | ||
| 69 | if (rcu_pending(smp_processor_id())) | ||
| 70 | rcu_check_callbacks(smp_processor_id(), rcu_user_flag); | ||
| 71 | scheduler_tick(); | ||
| 72 | run_posix_cpu_timers(tsk); | ||
| 73 | } | 67 | } |
| 74 | 68 | ||
| 75 | /* | 69 | /* |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 22a3eb38438b..496d635f89b2 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -211,10 +211,12 @@ config SH_SOLUTION_ENGINE | |||
| 211 | bool "SolutionEngine" | 211 | bool "SolutionEngine" |
| 212 | select SOLUTION_ENGINE | 212 | select SOLUTION_ENGINE |
| 213 | select CPU_HAS_IPR_IRQ | 213 | select CPU_HAS_IPR_IRQ |
| 214 | depends on CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7750 | 214 | depends on CPU_SUBTYPE_SH7705 || CPU_SUBTYPE_SH7709 || CPU_SUBTYPE_SH7710 || \ |
| 215 | CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \ | ||
| 216 | CPU_SUBTYPE_SH7750R | ||
| 215 | help | 217 | help |
| 216 | Select SolutionEngine if configuring for a Hitachi SH7709 | 218 | Select SolutionEngine if configuring for a Hitachi SH7705, SH7709, |
| 217 | or SH7750 evaluation board. | 219 | SH7710, SH7712, SH7750, SH7750S or SH7750R evaluation board. |
| 218 | 220 | ||
| 219 | config SH_7206_SOLUTION_ENGINE | 221 | config SH_7206_SOLUTION_ENGINE |
| 220 | bool "SolutionEngine7206" | 222 | bool "SolutionEngine7206" |
| @@ -603,7 +605,7 @@ config BOOT_LINK_OFFSET | |||
| 603 | 605 | ||
| 604 | config UBC_WAKEUP | 606 | config UBC_WAKEUP |
| 605 | bool "Wakeup UBC on startup" | 607 | bool "Wakeup UBC on startup" |
| 606 | depends on CPU_SH4 | 608 | depends on CPU_SH4 && !CPU_SH4A |
| 607 | help | 609 | help |
| 608 | Selecting this option will wakeup the User Break Controller (UBC) on | 610 | Selecting this option will wakeup the User Break Controller (UBC) on |
| 609 | startup. Although the UBC is left in an awake state when the processor | 611 | startup. Although the UBC is left in an awake state when the processor |
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index ab2f9f3c354c..722da6851f56 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
| @@ -124,12 +124,13 @@ config KGDB_NMI | |||
| 124 | 124 | ||
| 125 | config SH_KGDB_CONSOLE | 125 | config SH_KGDB_CONSOLE |
| 126 | bool "Console messages through GDB" | 126 | bool "Console messages through GDB" |
| 127 | depends on !SERIAL_SH_SCI_CONSOLE | 127 | depends on !SERIAL_SH_SCI_CONSOLE && SERIAL_SH_SCI=y |
| 128 | select SERIAL_CORE_CONSOLE | 128 | select SERIAL_CORE_CONSOLE |
| 129 | default n | 129 | default n |
| 130 | 130 | ||
| 131 | config KGDB_SYSRQ | 131 | config KGDB_SYSRQ |
| 132 | bool "Allow SysRq 'G' to enter KGDB" | 132 | bool "Allow SysRq 'G' to enter KGDB" |
| 133 | depends on MAGIC_SYSRQ | ||
| 133 | default y | 134 | default y |
| 134 | 135 | ||
| 135 | comment "Serial port setup" | 136 | comment "Serial port setup" |
diff --git a/arch/sh/boards/renesas/hs7751rvoip/irq.c b/arch/sh/boards/renesas/hs7751rvoip/irq.c index 943f93aa6052..e55c6686b21f 100644 --- a/arch/sh/boards/renesas/hs7751rvoip/irq.c +++ b/arch/sh/boards/renesas/hs7751rvoip/irq.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
| 14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
| 15 | #include <linux/interrupt.h> | ||
| 15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
| 16 | #include <asm/irq.h> | 17 | #include <asm/irq.h> |
| 17 | #include <asm/hs7751rvoip.h> | 18 | #include <asm/hs7751rvoip.h> |
diff --git a/arch/sh/boards/renesas/hs7751rvoip/setup.c b/arch/sh/boards/renesas/hs7751rvoip/setup.c index fa5fa3920222..c05625975f2c 100644 --- a/arch/sh/boards/renesas/hs7751rvoip/setup.c +++ b/arch/sh/boards/renesas/hs7751rvoip/setup.c | |||
| @@ -15,20 +15,6 @@ | |||
| 15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
| 16 | #include <asm/machvec.h> | 16 | #include <asm/machvec.h> |
| 17 | 17 | ||
| 18 | static struct ipr_data hs77501rvoip_ipr_map[] = { | ||
| 19 | #if defined(CONFIG_HS7751RVOIP_CODEC) | ||
| 20 | { DMTE0_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
| 21 | { DMTE1_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY }, | ||
| 22 | #endif | ||
| 23 | }; | ||
| 24 | |||
| 25 | static void __init hs7751rvoip_init_irq(void) | ||
| 26 | { | ||
| 27 | make_ipr_irq(hs77501rvoip_ipr_map, ARRAY_SIZE(hs77501rvoip_ipr_map)); | ||
| 28 | |||
| 29 | init_hs7751rvoip_IRQ(); | ||
| 30 | } | ||
| 31 | |||
| 32 | static void hs7751rvoip_power_off(void) | 18 | static void hs7751rvoip_power_off(void) |
| 33 | { | 19 | { |
| 34 | ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR); | 20 | ctrl_outw(ctrl_inw(PA_OUTPORTR) & 0xffdf, PA_OUTPORTR); |
| @@ -75,14 +61,13 @@ static int __init hs7751rvoip_cf_init(void) | |||
| 75 | 61 | ||
| 76 | return 0; | 62 | return 0; |
| 77 | } | 63 | } |
| 64 | device_initcall(hs7751rvoip_cf_init); | ||
| 78 | 65 | ||
| 79 | /* | 66 | /* |
| 80 | * Initialize the board | 67 | * Initialize the board |
| 81 | */ | 68 | */ |
| 82 | static void __init hs7751rvoip_setup(char **cmdline_p) | 69 | static void __init hs7751rvoip_setup(char **cmdline_p) |
| 83 | { | 70 | { |
| 84 | device_initcall(hs7751rvoip_cf_init); | ||
| 85 | |||
| 86 | ctrl_outb(0xf0, PA_OUTPORTR); | 71 | ctrl_outb(0xf0, PA_OUTPORTR); |
| 87 | pm_power_off = hs7751rvoip_power_off; | 72 | pm_power_off = hs7751rvoip_power_off; |
| 88 | 73 | ||
| @@ -115,6 +100,6 @@ static struct sh_machine_vector mv_hs7751rvoip __initmv = { | |||
| 115 | .mv_outsw = hs7751rvoip_outsw, | 100 | .mv_outsw = hs7751rvoip_outsw, |
| 116 | .mv_outsl = hs7751rvoip_outsl, | 101 | .mv_outsl = hs7751rvoip_outsl, |
| 117 | 102 | ||
| 118 | .mv_init_irq = hs7751rvoip_init_irq, | 103 | .mv_init_irq = init_hs7751rvoip_IRQ, |
| 119 | .mv_ioport_map = hs7751rvoip_ioport_map, | 104 | .mv_ioport_map = hs7751rvoip_ioport_map, |
| 120 | }; | 105 | }; |
diff --git a/arch/sh/boards/renesas/sh7710voipgw/setup.c b/arch/sh/boards/renesas/sh7710voipgw/setup.c index 2dce8bd97f90..0d56fd83bcba 100644 --- a/arch/sh/boards/renesas/sh7710voipgw/setup.c +++ b/arch/sh/boards/renesas/sh7710voipgw/setup.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <asm/machvec.h> | 11 | #include <asm/machvec.h> |
| 12 | #include <asm/irq.h> | 12 | #include <asm/irq.h> |
| 13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
| 14 | #include <asm/irq.h> | ||
| 15 | 14 | ||
| 16 | static struct ipr_data sh7710voipgw_ipr_map[] = { | 15 | static struct ipr_data sh7710voipgw_ipr_map[] = { |
| 17 | { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY }, | 16 | { TIMER2_IRQ, TIMER2_IPR_ADDR, TIMER2_IPR_POS, TIMER2_PRIORITY }, |
diff --git a/arch/sh/boards/se/7206/irq.c b/arch/sh/boards/se/7206/irq.c index 27da88486f73..9d5bfc77d0de 100644 --- a/arch/sh/boards/se/7206/irq.c +++ b/arch/sh/boards/se/7206/irq.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 10 | #include <linux/irq.h> | 10 | #include <linux/irq.h> |
| 11 | #include <linux/io.h> | 11 | #include <linux/io.h> |
| 12 | #include <linux/irq.h> | ||
| 13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 14 | #include <asm/se7206.h> | 13 | #include <asm/se7206.h> |
| 15 | 14 | ||
diff --git a/arch/sh/boards/se/770x/setup.c b/arch/sh/boards/se/770x/setup.c index d07a3368f546..318bc8a3969c 100644 --- a/arch/sh/boards/se/770x/setup.c +++ b/arch/sh/boards/se/770x/setup.c | |||
| @@ -94,6 +94,7 @@ static unsigned char heartbeat_bit_pos[] = { 8, 9, 10, 11, 12, 13, 14, 15 }; | |||
| 94 | static struct heartbeat_data heartbeat_data = { | 94 | static struct heartbeat_data heartbeat_data = { |
| 95 | .bit_pos = heartbeat_bit_pos, | 95 | .bit_pos = heartbeat_bit_pos, |
| 96 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), | 96 | .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), |
| 97 | .regsize = 16, | ||
| 97 | }; | 98 | }; |
| 98 | 99 | ||
| 99 | static struct resource heartbeat_resources[] = { | 100 | static struct resource heartbeat_resources[] = { |
diff --git a/arch/sh/boards/se/7722/setup.c b/arch/sh/boards/se/7722/setup.c index 20f064083cc2..eb97dca5b736 100644 --- a/arch/sh/boards/se/7722/setup.c +++ b/arch/sh/boards/se/7722/setup.c | |||
| @@ -16,8 +16,13 @@ | |||
| 16 | #include <asm/machvec.h> | 16 | #include <asm/machvec.h> |
| 17 | #include <asm/se7722.h> | 17 | #include <asm/se7722.h> |
| 18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
| 19 | #include <asm/heartbeat.h> | ||
| 19 | 20 | ||
| 20 | /* Heartbeat */ | 21 | /* Heartbeat */ |
| 22 | static struct heartbeat_data heartbeat_data = { | ||
| 23 | .regsize = 16, | ||
| 24 | }; | ||
| 25 | |||
| 21 | static struct resource heartbeat_resources[] = { | 26 | static struct resource heartbeat_resources[] = { |
| 22 | [0] = { | 27 | [0] = { |
| 23 | .start = PA_LED, | 28 | .start = PA_LED, |
| @@ -29,6 +34,9 @@ static struct resource heartbeat_resources[] = { | |||
| 29 | static struct platform_device heartbeat_device = { | 34 | static struct platform_device heartbeat_device = { |
| 30 | .name = "heartbeat", | 35 | .name = "heartbeat", |
| 31 | .id = -1, | 36 | .id = -1, |
| 37 | .dev = { | ||
| 38 | .platform_data = &heartbeat_data, | ||
| 39 | }, | ||
| 32 | .num_resources = ARRAY_SIZE(heartbeat_resources), | 40 | .num_resources = ARRAY_SIZE(heartbeat_resources), |
| 33 | .resource = heartbeat_resources, | 41 | .resource = heartbeat_resources, |
| 34 | }; | 42 | }; |
diff --git a/arch/sh/boards/se/7780/setup.c b/arch/sh/boards/se/7780/setup.c index 76e53b26a808..0f08ab3b2bec 100644 --- a/arch/sh/boards/se/7780/setup.c +++ b/arch/sh/boards/se/7780/setup.c | |||
| @@ -14,8 +14,13 @@ | |||
| 14 | #include <asm/machvec.h> | 14 | #include <asm/machvec.h> |
| 15 | #include <asm/se7780.h> | 15 | #include <asm/se7780.h> |
| 16 | #include <asm/io.h> | 16 | #include <asm/io.h> |
| 17 | #include <asm/heartbeat.h> | ||
| 17 | 18 | ||
| 18 | /* Heartbeat */ | 19 | /* Heartbeat */ |
| 20 | static struct heartbeat_data heartbeat_data = { | ||
| 21 | .regsize = 16, | ||
| 22 | }; | ||
| 23 | |||
| 19 | static struct resource heartbeat_resources[] = { | 24 | static struct resource heartbeat_resources[] = { |
| 20 | [0] = { | 25 | [0] = { |
| 21 | .start = PA_LED, | 26 | .start = PA_LED, |
| @@ -27,6 +32,9 @@ static struct resource heartbeat_resources[] = { | |||
| 27 | static struct platform_device heartbeat_device = { | 32 | static struct platform_device heartbeat_device = { |
| 28 | .name = "heartbeat", | 33 | .name = "heartbeat", |
| 29 | .id = -1, | 34 | .id = -1, |
| 35 | .dev = { | ||
| 36 | .platform_data = &heartbeat_data, | ||
| 37 | }, | ||
| 30 | .num_resources = ARRAY_SIZE(heartbeat_resources), | 38 | .num_resources = ARRAY_SIZE(heartbeat_resources), |
| 31 | .resource = heartbeat_resources, | 39 | .resource = heartbeat_resources, |
| 32 | }; | 40 | }; |
diff --git a/arch/sh/boards/snapgear/Makefile b/arch/sh/boards/snapgear/Makefile index 59fc976bfc2f..d2d2f4b6a502 100644 --- a/arch/sh/boards/snapgear/Makefile +++ b/arch/sh/boards/snapgear/Makefile | |||
| @@ -2,5 +2,4 @@ | |||
| 2 | # Makefile for the SnapGear specific parts of the kernel | 2 | # Makefile for the SnapGear specific parts of the kernel |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := setup.o io.o rtc.o | 5 | obj-y := setup.o io.o |
| 6 | |||
diff --git a/arch/sh/boards/snapgear/rtc.c b/arch/sh/boards/snapgear/rtc.c deleted file mode 100644 index edb3dd936cbb..000000000000 --- a/arch/sh/boards/snapgear/rtc.c +++ /dev/null | |||
| @@ -1,309 +0,0 @@ | |||
| 1 | /****************************************************************************/ | ||
| 2 | /* | ||
| 3 | * linux/arch/sh/boards/snapgear/rtc.c -- Secureedge5410 RTC code | ||
| 4 | * | ||
| 5 | * Copyright (C) 2002 David McCullough <davidm@snapgear.com> | ||
| 6 | * Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org> | ||
| 7 | * | ||
| 8 | * The SecureEdge5410 can have one of 2 real time clocks, the SH | ||
| 9 | * built in version or the preferred external DS1302. Here we work out | ||
| 10 | * each to see what we have and then run with it. | ||
| 11 | */ | ||
| 12 | /****************************************************************************/ | ||
| 13 | |||
| 14 | #include <linux/init.h> | ||
| 15 | #include <linux/kernel.h> | ||
| 16 | #include <linux/sched.h> | ||
| 17 | #include <linux/time.h> | ||
| 18 | #include <linux/rtc.h> | ||
| 19 | #include <linux/mc146818rtc.h> | ||
| 20 | #include <asm/io.h> | ||
| 21 | |||
| 22 | static int use_ds1302; | ||
| 23 | |||
| 24 | /****************************************************************************/ | ||
| 25 | /* | ||
| 26 | * we need to implement a DS1302 driver here that can operate in | ||
| 27 | * conjunction with the builtin rtc driver which is already quite friendly | ||
| 28 | */ | ||
| 29 | /*****************************************************************************/ | ||
| 30 | |||
| 31 | #define RTC_CMD_READ 0x81 /* Read command */ | ||
| 32 | #define RTC_CMD_WRITE 0x80 /* Write command */ | ||
| 33 | |||
| 34 | #define RTC_ADDR_YEAR 0x06 /* Address of year register */ | ||
| 35 | #define RTC_ADDR_DAY 0x05 /* Address of day of week register */ | ||
| 36 | #define RTC_ADDR_MON 0x04 /* Address of month register */ | ||
| 37 | #define RTC_ADDR_DATE 0x03 /* Address of day of month register */ | ||
| 38 | #define RTC_ADDR_HOUR 0x02 /* Address of hour register */ | ||
| 39 | #define RTC_ADDR_MIN 0x01 /* Address of minute register */ | ||
| 40 | #define RTC_ADDR_SEC 0x00 /* Address of second register */ | ||
| 41 | |||
| 42 | #define RTC_RESET 0x1000 | ||
| 43 | #define RTC_IODATA 0x0800 | ||
| 44 | #define RTC_SCLK 0x0400 | ||
| 45 | |||
| 46 | #define set_dirp(x) | ||
| 47 | #define get_dirp(x) 0 | ||
| 48 | #define set_dp(x) SECUREEDGE_WRITE_IOPORT(x, 0x1c00) | ||
| 49 | #define get_dp(x) SECUREEDGE_READ_IOPORT() | ||
| 50 | |||
| 51 | static void ds1302_sendbits(unsigned int val) | ||
| 52 | { | ||
| 53 | int i; | ||
| 54 | |||
| 55 | for (i = 8; (i); i--, val >>= 1) { | ||
| 56 | set_dp((get_dp() & ~RTC_IODATA) | ((val & 0x1) ? RTC_IODATA : 0)); | ||
| 57 | set_dp(get_dp() | RTC_SCLK); // clock high | ||
| 58 | set_dp(get_dp() & ~RTC_SCLK); // clock low | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | static unsigned int ds1302_recvbits(void) | ||
| 63 | { | ||
| 64 | unsigned int val; | ||
| 65 | int i; | ||
| 66 | |||
| 67 | for (i = 0, val = 0; (i < 8); i++) { | ||
| 68 | val |= (((get_dp() & RTC_IODATA) ? 1 : 0) << i); | ||
| 69 | set_dp(get_dp() | RTC_SCLK); // clock high | ||
| 70 | set_dp(get_dp() & ~RTC_SCLK); // clock low | ||
| 71 | } | ||
| 72 | return(val); | ||
| 73 | } | ||
| 74 | |||
| 75 | static unsigned int ds1302_readbyte(unsigned int addr) | ||
| 76 | { | ||
| 77 | unsigned int val; | ||
| 78 | unsigned long flags; | ||
| 79 | |||
| 80 | local_irq_save(flags); | ||
| 81 | set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK); | ||
| 82 | set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK)); | ||
| 83 | |||
| 84 | set_dp(get_dp() | RTC_RESET); | ||
| 85 | ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_READ); | ||
| 86 | set_dirp(get_dirp() & ~RTC_IODATA); | ||
| 87 | val = ds1302_recvbits(); | ||
| 88 | set_dp(get_dp() & ~RTC_RESET); | ||
| 89 | local_irq_restore(flags); | ||
| 90 | |||
| 91 | return(val); | ||
| 92 | } | ||
| 93 | |||
| 94 | static void ds1302_writebyte(unsigned int addr, unsigned int val) | ||
| 95 | { | ||
| 96 | unsigned long flags; | ||
| 97 | |||
| 98 | local_irq_save(flags); | ||
| 99 | set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK); | ||
| 100 | set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK)); | ||
| 101 | set_dp(get_dp() | RTC_RESET); | ||
| 102 | ds1302_sendbits(((addr & 0x3f) << 1) | RTC_CMD_WRITE); | ||
| 103 | ds1302_sendbits(val); | ||
| 104 | set_dp(get_dp() & ~RTC_RESET); | ||
| 105 | local_irq_restore(flags); | ||
| 106 | } | ||
| 107 | |||
| 108 | static void ds1302_reset(void) | ||
| 109 | { | ||
| 110 | unsigned long flags; | ||
| 111 | /* Hardware dependent reset/init */ | ||
| 112 | local_irq_save(flags); | ||
| 113 | set_dirp(get_dirp() | RTC_RESET | RTC_IODATA | RTC_SCLK); | ||
| 114 | set_dp(get_dp() & ~(RTC_RESET | RTC_IODATA | RTC_SCLK)); | ||
| 115 | local_irq_restore(flags); | ||
| 116 | } | ||
| 117 | |||
| 118 | /*****************************************************************************/ | ||
| 119 | |||
| 120 | static inline int bcd2int(int val) | ||
| 121 | { | ||
| 122 | return((((val & 0xf0) >> 4) * 10) + (val & 0xf)); | ||
| 123 | } | ||
| 124 | |||
| 125 | static inline int int2bcd(int val) | ||
| 126 | { | ||
| 127 | return(((val / 10) << 4) + (val % 10)); | ||
| 128 | } | ||
| 129 | |||
| 130 | /*****************************************************************************/ | ||
| 131 | /* | ||
| 132 | * Write and Read some RAM in the DS1302, if it works assume it's there | ||
| 133 | * Otherwise use the SH4 internal RTC | ||
| 134 | */ | ||
| 135 | |||
| 136 | void snapgear_rtc_gettimeofday(struct timespec *); | ||
| 137 | int snapgear_rtc_settimeofday(const time_t); | ||
| 138 | |||
| 139 | void __init secureedge5410_rtc_init(void) | ||
| 140 | { | ||
| 141 | unsigned char *test = "snapgear"; | ||
| 142 | int i; | ||
| 143 | |||
| 144 | ds1302_reset(); | ||
| 145 | |||
| 146 | use_ds1302 = 1; | ||
| 147 | |||
| 148 | for (i = 0; test[i]; i++) | ||
| 149 | ds1302_writebyte(32 + i, test[i]); | ||
| 150 | |||
| 151 | for (i = 0; test[i]; i++) | ||
| 152 | if (ds1302_readbyte(32 + i) != test[i]) { | ||
| 153 | use_ds1302 = 0; | ||
| 154 | break; | ||
| 155 | } | ||
| 156 | |||
| 157 | if (use_ds1302) { | ||
| 158 | rtc_sh_get_time = snapgear_rtc_gettimeofday; | ||
| 159 | rtc_sh_set_time = snapgear_rtc_settimeofday; | ||
| 160 | } | ||
| 161 | |||
| 162 | printk("SnapGear RTC: using %s rtc.\n", use_ds1302 ? "ds1302" : "internal"); | ||
| 163 | } | ||
| 164 | |||
| 165 | /****************************************************************************/ | ||
| 166 | /* | ||
| 167 | * our generic interface that chooses the correct code to use | ||
| 168 | */ | ||
| 169 | |||
| 170 | void snapgear_rtc_gettimeofday(struct timespec *ts) | ||
| 171 | { | ||
| 172 | unsigned int sec, min, hr, day, mon, yr; | ||
| 173 | |||
| 174 | if (!use_ds1302) | ||
| 175 | return; | ||
| 176 | |||
| 177 | sec = bcd2int(ds1302_readbyte(RTC_ADDR_SEC)); | ||
| 178 | min = bcd2int(ds1302_readbyte(RTC_ADDR_MIN)); | ||
| 179 | hr = bcd2int(ds1302_readbyte(RTC_ADDR_HOUR)); | ||
| 180 | day = bcd2int(ds1302_readbyte(RTC_ADDR_DATE)); | ||
| 181 | mon = bcd2int(ds1302_readbyte(RTC_ADDR_MON)); | ||
| 182 | yr = bcd2int(ds1302_readbyte(RTC_ADDR_YEAR)); | ||
| 183 | |||
| 184 | bad_time: | ||
| 185 | if (yr > 99 || mon < 1 || mon > 12 || day > 31 || day < 1 || | ||
| 186 | hr > 23 || min > 59 || sec > 59) { | ||
| 187 | printk(KERN_ERR | ||
| 188 | "SnapGear RTC: invalid value, resetting to 1 Jan 2000\n"); | ||
| 189 | ds1302_writebyte(RTC_ADDR_MIN, min = 0); | ||
| 190 | ds1302_writebyte(RTC_ADDR_HOUR, hr = 0); | ||
| 191 | ds1302_writebyte(RTC_ADDR_DAY, 7); | ||
| 192 | ds1302_writebyte(RTC_ADDR_DATE, day = 1); | ||
| 193 | ds1302_writebyte(RTC_ADDR_MON, mon = 1); | ||
| 194 | ds1302_writebyte(RTC_ADDR_YEAR, yr = 0); | ||
| 195 | ds1302_writebyte(RTC_ADDR_SEC, sec = 0); | ||
| 196 | } | ||
| 197 | |||
| 198 | ts->tv_sec = mktime(2000 + yr, mon, day, hr, min, sec); | ||
| 199 | if (ts->tv_sec < 0) { | ||
| 200 | #if 0 | ||
| 201 | printk("BAD TIME %d %d %d %d %d %d\n", yr, mon, day, hr, min, sec); | ||
| 202 | #endif | ||
| 203 | yr = 100; | ||
| 204 | goto bad_time; | ||
| 205 | } | ||
| 206 | ts->tv_nsec = 0; | ||
| 207 | } | ||
| 208 | |||
| 209 | int snapgear_rtc_settimeofday(const time_t secs) | ||
| 210 | { | ||
| 211 | int retval = 0; | ||
| 212 | int real_seconds, real_minutes, cmos_minutes; | ||
| 213 | unsigned long nowtime; | ||
| 214 | |||
| 215 | if (!use_ds1302) | ||
| 216 | return 0; | ||
| 217 | |||
| 218 | /* | ||
| 219 | * This is called direct from the kernel timer handling code. | ||
| 220 | * It is supposed to synchronize the kernel clock to the RTC. | ||
| 221 | */ | ||
| 222 | |||
| 223 | nowtime = secs; | ||
| 224 | |||
| 225 | /* STOP RTC */ | ||
| 226 | ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) | 0x80); | ||
| 227 | |||
| 228 | cmos_minutes = bcd2int(ds1302_readbyte(RTC_ADDR_MIN)); | ||
| 229 | |||
| 230 | /* | ||
| 231 | * since we're only adjusting minutes and seconds, | ||
| 232 | * don't interfere with hour overflow. This avoids | ||
| 233 | * messing with unknown time zones but requires your | ||
| 234 | * RTC not to be off by more than 15 minutes | ||
| 235 | */ | ||
| 236 | real_seconds = nowtime % 60; | ||
| 237 | real_minutes = nowtime / 60; | ||
| 238 | if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) | ||
| 239 | real_minutes += 30; /* correct for half hour time zone */ | ||
| 240 | real_minutes %= 60; | ||
| 241 | |||
| 242 | if (abs(real_minutes - cmos_minutes) < 30) { | ||
| 243 | ds1302_writebyte(RTC_ADDR_MIN, int2bcd(real_minutes)); | ||
| 244 | ds1302_writebyte(RTC_ADDR_SEC, int2bcd(real_seconds)); | ||
| 245 | } else { | ||
| 246 | printk(KERN_WARNING | ||
| 247 | "SnapGear RTC: can't update from %d to %d\n", | ||
| 248 | cmos_minutes, real_minutes); | ||
| 249 | retval = -1; | ||
| 250 | } | ||
| 251 | |||
| 252 | /* START RTC */ | ||
| 253 | ds1302_writebyte(RTC_ADDR_SEC, ds1302_readbyte(RTC_ADDR_SEC) & ~0x80); | ||
| 254 | return(0); | ||
| 255 | } | ||
| 256 | |||
| 257 | unsigned char secureedge5410_cmos_read(int addr) | ||
| 258 | { | ||
| 259 | unsigned char val = 0; | ||
| 260 | |||
| 261 | if (!use_ds1302) | ||
| 262 | return(__CMOS_READ(addr, w)); | ||
| 263 | |||
| 264 | switch(addr) { | ||
| 265 | case RTC_SECONDS: val = ds1302_readbyte(RTC_ADDR_SEC); break; | ||
| 266 | case RTC_SECONDS_ALARM: break; | ||
| 267 | case RTC_MINUTES: val = ds1302_readbyte(RTC_ADDR_MIN); break; | ||
| 268 | case RTC_MINUTES_ALARM: break; | ||
| 269 | case RTC_HOURS: val = ds1302_readbyte(RTC_ADDR_HOUR); break; | ||
| 270 | case RTC_HOURS_ALARM: break; | ||
| 271 | case RTC_DAY_OF_WEEK: val = ds1302_readbyte(RTC_ADDR_DAY); break; | ||
| 272 | case RTC_DAY_OF_MONTH: val = ds1302_readbyte(RTC_ADDR_DATE); break; | ||
| 273 | case RTC_MONTH: val = ds1302_readbyte(RTC_ADDR_MON); break; | ||
| 274 | case RTC_YEAR: val = ds1302_readbyte(RTC_ADDR_YEAR); break; | ||
| 275 | case RTC_REG_A: /* RTC_FREQ_SELECT */ break; | ||
| 276 | case RTC_REG_B: /* RTC_CONTROL */ break; | ||
| 277 | case RTC_REG_C: /* RTC_INTR_FLAGS */ break; | ||
| 278 | case RTC_REG_D: val = RTC_VRT /* RTC_VALID */; break; | ||
| 279 | default: break; | ||
| 280 | } | ||
| 281 | |||
| 282 | return(val); | ||
| 283 | } | ||
| 284 | |||
| 285 | void secureedge5410_cmos_write(unsigned char val, int addr) | ||
| 286 | { | ||
| 287 | if (!use_ds1302) { | ||
| 288 | __CMOS_WRITE(val, addr, w); | ||
| 289 | return; | ||
| 290 | } | ||
| 291 | |||
| 292 | switch(addr) { | ||
| 293 | case RTC_SECONDS: ds1302_writebyte(RTC_ADDR_SEC, val); break; | ||
| 294 | case RTC_SECONDS_ALARM: break; | ||
| 295 | case RTC_MINUTES: ds1302_writebyte(RTC_ADDR_MIN, val); break; | ||
| 296 | case RTC_MINUTES_ALARM: break; | ||
| 297 | case RTC_HOURS: ds1302_writebyte(RTC_ADDR_HOUR, val); break; | ||
| 298 | case RTC_HOURS_ALARM: break; | ||
| 299 | case RTC_DAY_OF_WEEK: ds1302_writebyte(RTC_ADDR_DAY, val); break; | ||
| 300 | case RTC_DAY_OF_MONTH: ds1302_writebyte(RTC_ADDR_DATE, val); break; | ||
| 301 | case RTC_MONTH: ds1302_writebyte(RTC_ADDR_MON, val); break; | ||
| 302 | case RTC_YEAR: ds1302_writebyte(RTC_ADDR_YEAR, val); break; | ||
| 303 | case RTC_REG_A: /* RTC_FREQ_SELECT */ break; | ||
| 304 | case RTC_REG_B: /* RTC_CONTROL */ break; | ||
| 305 | case RTC_REG_C: /* RTC_INTR_FLAGS */ break; | ||
| 306 | case RTC_REG_D: /* RTC_VALID */ break; | ||
| 307 | default: break; | ||
| 308 | } | ||
| 309 | } | ||
diff --git a/arch/sh/boards/snapgear/setup.c b/arch/sh/boards/snapgear/setup.c index 2b594f600002..7022483f98e8 100644 --- a/arch/sh/boards/snapgear/setup.c +++ b/arch/sh/boards/snapgear/setup.c | |||
| @@ -22,20 +22,15 @@ | |||
| 22 | #include <asm/snapgear.h> | 22 | #include <asm/snapgear.h> |
| 23 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
| 24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
| 25 | #include <asm/rtc.h> | ||
| 26 | #include <asm/cpu/timer.h> | 25 | #include <asm/cpu/timer.h> |
| 27 | 26 | ||
| 28 | extern void secureedge5410_rtc_init(void); | ||
| 29 | extern void pcibios_init(void); | ||
| 30 | |||
| 31 | /****************************************************************************/ | ||
| 32 | /* | 27 | /* |
| 33 | * EraseConfig handling functions | 28 | * EraseConfig handling functions |
| 34 | */ | 29 | */ |
| 35 | 30 | ||
| 36 | static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) | 31 | static irqreturn_t eraseconfig_interrupt(int irq, void *dev_id) |
| 37 | { | 32 | { |
| 38 | volatile char dummy __attribute__((unused)) = * (volatile char *) 0xb8000000; | 33 | (void)ctrl_inb(0xb8000000); /* dummy read */ |
| 39 | 34 | ||
| 40 | printk("SnapGear: erase switch interrupt!\n"); | 35 | printk("SnapGear: erase switch interrupt!\n"); |
| 41 | 36 | ||
| @@ -76,19 +71,10 @@ static void __init init_snapgear_IRQ(void) | |||
| 76 | } | 71 | } |
| 77 | 72 | ||
| 78 | /* | 73 | /* |
| 79 | * Initialize the board | ||
| 80 | */ | ||
| 81 | static void __init snapgear_setup(char **cmdline_p) | ||
| 82 | { | ||
| 83 | board_time_init = secureedge5410_rtc_init; | ||
| 84 | } | ||
| 85 | |||
| 86 | /* | ||
| 87 | * The Machine Vector | 74 | * The Machine Vector |
| 88 | */ | 75 | */ |
| 89 | static struct sh_machine_vector mv_snapgear __initmv = { | 76 | static struct sh_machine_vector mv_snapgear __initmv = { |
| 90 | .mv_name = "SnapGear SecureEdge5410", | 77 | .mv_name = "SnapGear SecureEdge5410", |
| 91 | .mv_setup = snapgear_setup, | ||
| 92 | .mv_nr_irqs = 72, | 78 | .mv_nr_irqs = 72, |
| 93 | 79 | ||
| 94 | .mv_inb = snapgear_inb, | 80 | .mv_inb = snapgear_inb, |
diff --git a/arch/sh/boot/Makefile b/arch/sh/boot/Makefile index 4c5ffdcd55b6..1b0f5be01d10 100644 --- a/arch/sh/boot/Makefile +++ b/arch/sh/boot/Makefile | |||
| @@ -39,7 +39,7 @@ KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \ | |||
| 39 | 39 | ||
| 40 | quiet_cmd_uimage = UIMAGE $@ | 40 | quiet_cmd_uimage = UIMAGE $@ |
| 41 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ | 41 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ |
| 42 | -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \ | 42 | -C none -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \ |
| 43 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ | 43 | -n 'Linux-$(KERNELRELEASE)' -d $< $@ |
| 44 | 44 | ||
| 45 | $(obj)/uImage: $(obj)/zImage FORCE | 45 | $(obj)/uImage: $(obj)/zImage FORCE |
diff --git a/arch/sh/cchips/hd6446x/Makefile b/arch/sh/cchips/hd6446x/Makefile index a106dd9db986..f7de4076e242 100644 --- a/arch/sh/cchips/hd6446x/Makefile +++ b/arch/sh/cchips/hd6446x/Makefile | |||
| @@ -1,2 +1,4 @@ | |||
| 1 | obj-$(CONFIG_HD64461) += hd64461.o | 1 | obj-$(CONFIG_HD64461) += hd64461.o |
| 2 | obj-$(CONFIG_HD64465) += hd64465/ | 2 | obj-$(CONFIG_HD64465) += hd64465/ |
| 3 | |||
| 4 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/cchips/voyagergx/Makefile b/arch/sh/cchips/voyagergx/Makefile index 085de72fd327..f73963cb3744 100644 --- a/arch/sh/cchips/voyagergx/Makefile +++ b/arch/sh/cchips/voyagergx/Makefile | |||
| @@ -6,3 +6,4 @@ obj-y := irq.o setup.o | |||
| 6 | 6 | ||
| 7 | obj-$(CONFIG_USB_OHCI_HCD) += consistent.o | 7 | obj-$(CONFIG_USB_OHCI_HCD) += consistent.o |
| 8 | 8 | ||
| 9 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/drivers/pci/Makefile b/arch/sh/drivers/pci/Makefile index 2f65ac72f48a..fba6b5ba0b3a 100644 --- a/arch/sh/drivers/pci/Makefile +++ b/arch/sh/drivers/pci/Makefile | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | obj-y += pci.o | 5 | obj-y += pci.o |
| 6 | obj-$(CONFIG_PCI_AUTO) += pci-auto.o | 6 | obj-$(CONFIG_PCI_AUTO) += pci-auto.o |
| 7 | 7 | ||
| 8 | obj-$(CONFIG_CPU_SUBTYPE_ST40STB1) += pci-st40.o | ||
| 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o | 8 | obj-$(CONFIG_CPU_SUBTYPE_SH7751) += pci-sh7751.o ops-sh4.o |
| 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o | 9 | obj-$(CONFIG_CPU_SUBTYPE_SH7751R) += pci-sh7751.o ops-sh4.o |
| 11 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o | 10 | obj-$(CONFIG_CPU_SUBTYPE_SH7780) += pci-sh7780.o ops-sh4.o |
diff --git a/arch/sh/drivers/pci/pci-st40.c b/arch/sh/drivers/pci/pci-st40.c deleted file mode 100644 index 0814a5afe9b7..000000000000 --- a/arch/sh/drivers/pci/pci-st40.c +++ /dev/null | |||
| @@ -1,488 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
| 3 | * | ||
| 4 | * May be copied or modified under the terms of the GNU General Public | ||
| 5 | * License. See linux/COPYING for more information. | ||
| 6 | * | ||
| 7 | * Support functions for the ST40 PCI hardware. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/smp.h> | ||
| 12 | #include <linux/init.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/pci.h> | ||
| 15 | #include <linux/delay.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <asm/pci.h> | ||
| 18 | #include <linux/irq.h> | ||
| 19 | #include <linux/interrupt.h> /* irqreturn_t */ | ||
| 20 | |||
| 21 | #include "pci-st40.h" | ||
| 22 | |||
| 23 | /* This is in P2 of course */ | ||
| 24 | #define ST40PCI_BASE_ADDRESS (0xb0000000) | ||
| 25 | #define ST40PCI_MEM_ADDRESS (ST40PCI_BASE_ADDRESS+0x0) | ||
| 26 | #define ST40PCI_IO_ADDRESS (ST40PCI_BASE_ADDRESS+0x06000000) | ||
| 27 | #define ST40PCI_REG_ADDRESS (ST40PCI_BASE_ADDRESS+0x07000000) | ||
| 28 | |||
| 29 | #define ST40PCI_REG(x) (ST40PCI_REG_ADDRESS+(ST40PCI_##x)) | ||
| 30 | #define ST40PCI_REG_INDEXED(reg, index) \ | ||
| 31 | (ST40PCI_REG(reg##0) + \ | ||
| 32 | ((ST40PCI_REG(reg##1) - ST40PCI_REG(reg##0))*index)) | ||
| 33 | |||
| 34 | #define ST40PCI_WRITE(reg,val) writel((val),ST40PCI_REG(reg)) | ||
| 35 | #define ST40PCI_WRITE_SHORT(reg,val) writew((val),ST40PCI_REG(reg)) | ||
| 36 | #define ST40PCI_WRITE_BYTE(reg,val) writeb((val),ST40PCI_REG(reg)) | ||
| 37 | #define ST40PCI_WRITE_INDEXED(reg, index, val) \ | ||
| 38 | writel((val), ST40PCI_REG_INDEXED(reg, index)); | ||
| 39 | |||
| 40 | #define ST40PCI_READ(reg) readl(ST40PCI_REG(reg)) | ||
| 41 | #define ST40PCI_READ_SHORT(reg) readw(ST40PCI_REG(reg)) | ||
| 42 | #define ST40PCI_READ_BYTE(reg) readb(ST40PCI_REG(reg)) | ||
| 43 | |||
| 44 | #define ST40PCI_SERR_IRQ 64 | ||
| 45 | #define ST40PCI_ERR_IRQ 65 | ||
| 46 | |||
| 47 | |||
| 48 | /* Macros to extract PLL params */ | ||
| 49 | #define PLL_MDIV(reg) ( ((unsigned)reg) & 0xff ) | ||
| 50 | #define PLL_NDIV(reg) ( (((unsigned)reg)>>8) & 0xff ) | ||
| 51 | #define PLL_PDIV(reg) ( (((unsigned)reg)>>16) & 0x3 ) | ||
| 52 | #define PLL_SETUP(reg) ( (((unsigned)reg)>>19) & 0x1ff ) | ||
| 53 | |||
| 54 | /* Build up the appropriate settings */ | ||
| 55 | #define PLL_SET(mdiv,ndiv,pdiv,setup) \ | ||
| 56 | ( ((mdiv)&0xff) | (((ndiv)&0xff)<<8) | (((pdiv)&3)<<16)| (((setup)&0x1ff)<<19)) | ||
| 57 | |||
| 58 | #define PLLPCICR (0xbb040000+0x10) | ||
| 59 | |||
| 60 | #define PLLPCICR_POWERON (1<<28) | ||
| 61 | #define PLLPCICR_OUT_EN (1<<29) | ||
| 62 | #define PLLPCICR_LOCKSELECT (1<<30) | ||
| 63 | #define PLLPCICR_LOCK (1<<31) | ||
| 64 | |||
| 65 | |||
| 66 | #define PLL_25MHZ 0x793c8512 | ||
| 67 | #define PLL_33MHZ PLL_SET(18,88,3,295) | ||
| 68 | |||
| 69 | static void pci_set_rbar_region(unsigned int region, unsigned long localAddr, | ||
| 70 | unsigned long pciOffset, unsigned long regionSize); | ||
| 71 | |||
| 72 | static __init void SetPCIPLL(void) | ||
| 73 | { | ||
| 74 | { | ||
| 75 | /* Lets play with the PLL values */ | ||
| 76 | unsigned long pll1cr1; | ||
| 77 | unsigned long mdiv, ndiv, pdiv; | ||
| 78 | unsigned long muxcr; | ||
| 79 | unsigned int muxcr_ratios[4] = { 8, 16, 21, 1 }; | ||
| 80 | unsigned int freq; | ||
| 81 | |||
| 82 | #define CLKGENA 0xbb040000 | ||
| 83 | #define CLKGENA_PLL2_MUXCR CLKGENA + 0x48 | ||
| 84 | pll1cr1 = ctrl_inl(PLLPCICR); | ||
| 85 | printk("PLL1CR1 %08lx\n", pll1cr1); | ||
| 86 | mdiv = PLL_MDIV(pll1cr1); | ||
| 87 | ndiv = PLL_NDIV(pll1cr1); | ||
| 88 | pdiv = PLL_PDIV(pll1cr1); | ||
| 89 | printk("mdiv %02lx ndiv %02lx pdiv %02lx\n", mdiv, ndiv, pdiv); | ||
| 90 | freq = ((2*27*ndiv)/mdiv) / (1 << pdiv); | ||
| 91 | printk("PLL freq %dMHz\n", freq); | ||
| 92 | muxcr = ctrl_inl(CLKGENA_PLL2_MUXCR); | ||
| 93 | printk("PCI freq %dMhz\n", freq / muxcr_ratios[muxcr & 3]); | ||
| 94 | } | ||
| 95 | } | ||
| 96 | |||
| 97 | |||
| 98 | struct pci_err { | ||
| 99 | unsigned mask; | ||
| 100 | const char *error_string; | ||
| 101 | }; | ||
| 102 | |||
| 103 | static struct pci_err int_error[]={ | ||
| 104 | { INT_MNLTDIM,"MNLTDIM: Master non-lock transfer"}, | ||
| 105 | { INT_TTADI, "TTADI: Illegal byte enable in I/O transfer"}, | ||
| 106 | { INT_TMTO, "TMTO: Target memory read/write timeout"}, | ||
| 107 | { INT_MDEI, "MDEI: Master function disable error"}, | ||
| 108 | { INT_APEDI, "APEDI: Address parity error"}, | ||
| 109 | { INT_SDI, "SDI: SERR detected"}, | ||
| 110 | { INT_DPEITW, "DPEITW: Data parity error target write"}, | ||
| 111 | { INT_PEDITR, "PEDITR: PERR detected"}, | ||
| 112 | { INT_TADIM, "TADIM: Target abort detected"}, | ||
| 113 | { INT_MADIM, "MADIM: Master abort detected"}, | ||
| 114 | { INT_MWPDI, "MWPDI: PERR from target at data write"}, | ||
| 115 | { INT_MRDPEI, "MRDPEI: Master read data parity error"} | ||
| 116 | }; | ||
| 117 | #define NUM_PCI_INT_ERRS ARRAY_SIZE(int_error) | ||
| 118 | |||
| 119 | static struct pci_err aint_error[]={ | ||
| 120 | { AINT_MBI, "MBI: Master broken"}, | ||
| 121 | { AINT_TBTOI, "TBTOI: Target bus timeout"}, | ||
| 122 | { AINT_MBTOI, "MBTOI: Master bus timeout"}, | ||
| 123 | { AINT_TAI, "TAI: Target abort"}, | ||
| 124 | { AINT_MAI, "MAI: Master abort"}, | ||
| 125 | { AINT_RDPEI, "RDPEI: Read data parity"}, | ||
| 126 | { AINT_WDPE, "WDPE: Write data parity"} | ||
| 127 | }; | ||
| 128 | |||
| 129 | #define NUM_PCI_AINT_ERRS ARRAY_SIZE(aint_error) | ||
| 130 | |||
| 131 | static void print_pci_errors(unsigned reg,struct pci_err *error,int num_errors) | ||
| 132 | { | ||
| 133 | int i; | ||
| 134 | |||
| 135 | for(i=0;i<num_errors;i++) { | ||
| 136 | if(reg & error[i].mask) { | ||
| 137 | printk("%s\n",error[i].error_string); | ||
| 138 | } | ||
| 139 | } | ||
| 140 | |||
| 141 | } | ||
| 142 | |||
| 143 | |||
| 144 | static char * pci_commands[16]={ | ||
| 145 | "Int Ack", | ||
| 146 | "Special Cycle", | ||
| 147 | "I/O Read", | ||
| 148 | "I/O Write", | ||
| 149 | "Reserved", | ||
| 150 | "Reserved", | ||
| 151 | "Memory Read", | ||
| 152 | "Memory Write", | ||
| 153 | "Reserved", | ||
| 154 | "Reserved", | ||
| 155 | "Configuration Read", | ||
| 156 | "Configuration Write", | ||
| 157 | "Memory Read Multiple", | ||
| 158 | "Dual Address Cycle", | ||
| 159 | "Memory Read Line", | ||
| 160 | "Memory Write-and-Invalidate" | ||
| 161 | }; | ||
| 162 | |||
| 163 | static irqreturn_t st40_pci_irq(int irq, void *dev_instance) | ||
| 164 | { | ||
| 165 | unsigned pci_int, pci_air, pci_cir, pci_aint; | ||
| 166 | static int count=0; | ||
| 167 | |||
| 168 | |||
| 169 | pci_int = ST40PCI_READ(INT);pci_aint = ST40PCI_READ(AINT); | ||
| 170 | pci_cir = ST40PCI_READ(CIR);pci_air = ST40PCI_READ(AIR); | ||
| 171 | |||
| 172 | /* Reset state to stop multiple interrupts */ | ||
| 173 | ST40PCI_WRITE(INT, ~0); ST40PCI_WRITE(AINT, ~0); | ||
| 174 | |||
| 175 | |||
| 176 | if(++count>1) return IRQ_HANDLED; | ||
| 177 | |||
| 178 | printk("** PCI ERROR **\n"); | ||
| 179 | |||
| 180 | if(pci_int) { | ||
| 181 | printk("** INT register status\n"); | ||
| 182 | print_pci_errors(pci_int,int_error,NUM_PCI_INT_ERRS); | ||
| 183 | } | ||
| 184 | |||
| 185 | if(pci_aint) { | ||
| 186 | printk("** AINT register status\n"); | ||
| 187 | print_pci_errors(pci_aint,aint_error,NUM_PCI_AINT_ERRS); | ||
| 188 | } | ||
| 189 | |||
| 190 | printk("** Address and command info\n"); | ||
| 191 | |||
| 192 | printk("** Command %s : Address 0x%x\n", | ||
| 193 | pci_commands[pci_cir&0xf],pci_air); | ||
| 194 | |||
| 195 | if(pci_cir&CIR_PIOTEM) { | ||
| 196 | printk("CIR_PIOTEM:PIO transfer error for master\n"); | ||
| 197 | } | ||
| 198 | if(pci_cir&CIR_RWTET) { | ||
| 199 | printk("CIR_RWTET:Read/Write transfer error for target\n"); | ||
| 200 | } | ||
| 201 | |||
| 202 | return IRQ_HANDLED; | ||
| 203 | } | ||
| 204 | |||
| 205 | |||
| 206 | /* Rounds a number UP to the nearest power of two. Used for | ||
| 207 | * sizing the PCI window. | ||
| 208 | */ | ||
| 209 | static u32 r2p2(u32 num) | ||
| 210 | { | ||
| 211 | int i = 31; | ||
| 212 | u32 tmp = num; | ||
| 213 | |||
| 214 | if (num == 0) | ||
| 215 | return 0; | ||
| 216 | |||
| 217 | do { | ||
| 218 | if (tmp & (1 << 31)) | ||
| 219 | break; | ||
| 220 | i--; | ||
| 221 | tmp <<= 1; | ||
| 222 | } while (i >= 0); | ||
| 223 | |||
| 224 | tmp = 1 << i; | ||
| 225 | /* If the original number isn't a power of 2, round it up */ | ||
| 226 | if (tmp != num) | ||
| 227 | tmp <<= 1; | ||
| 228 | |||
| 229 | return tmp; | ||
| 230 | } | ||
| 231 | |||
| 232 | static void __init pci_fixup_ide_bases(struct pci_dev *d) | ||
| 233 | { | ||
| 234 | int i; | ||
| 235 | |||
| 236 | /* | ||
| 237 | * PCI IDE controllers use non-standard I/O port decoding, respect it. | ||
| 238 | */ | ||
| 239 | if ((d->class >> 8) != PCI_CLASS_STORAGE_IDE) | ||
| 240 | return; | ||
| 241 | printk("PCI: IDE base address fixup for %s\n", pci_name(d)); | ||
| 242 | for(i=0; i<4; i++) { | ||
| 243 | struct resource *r = &d->resource[i]; | ||
| 244 | if ((r->start & ~0x80) == 0x374) { | ||
| 245 | r->start |= 2; | ||
| 246 | r->end = r->start; | ||
| 247 | } | ||
| 248 | } | ||
| 249 | } | ||
| 250 | DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases); | ||
| 251 | |||
| 252 | int __init st40pci_init(unsigned memStart, unsigned memSize) | ||
| 253 | { | ||
| 254 | u32 lsr0; | ||
| 255 | |||
| 256 | SetPCIPLL(); | ||
| 257 | |||
| 258 | /* Initialises the ST40 pci subsystem, performing a reset, then programming | ||
| 259 | * up the address space decoders appropriately | ||
| 260 | */ | ||
| 261 | |||
| 262 | /* Should reset core here as well methink */ | ||
| 263 | |||
| 264 | ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_SOFT_RESET); | ||
| 265 | |||
| 266 | /* Loop while core resets */ | ||
| 267 | while (ST40PCI_READ(CR) & CR_SOFT_RESET); | ||
| 268 | |||
| 269 | /* Switch off interrupts */ | ||
| 270 | ST40PCI_WRITE(INTM, 0); | ||
| 271 | ST40PCI_WRITE(AINT, 0); | ||
| 272 | |||
| 273 | /* Now, lets reset all the cards on the bus with extreme prejudice */ | ||
| 274 | ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_RSTCTL); | ||
| 275 | udelay(250); | ||
| 276 | |||
| 277 | /* Set bus active, take it out of reset */ | ||
| 278 | ST40PCI_WRITE(CR, CR_LOCK_MASK | CR_BMAM | CR_CFINT | CR_PFCS | CR_PFE); | ||
| 279 | |||
| 280 | /* The PCI spec says that no access must be made to the bus until 1 second | ||
| 281 | * after reset. This seem ludicrously long, but some delay is needed here | ||
| 282 | */ | ||
| 283 | mdelay(1000); | ||
| 284 | |||
| 285 | /* Switch off interrupts */ | ||
| 286 | ST40PCI_WRITE(INTM, 0); | ||
| 287 | ST40PCI_WRITE(AINT, 0); | ||
| 288 | |||
| 289 | /* Allow it to be a master */ | ||
| 290 | |||
| 291 | ST40PCI_WRITE_SHORT(CSR_CMD, | ||
| 292 | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | | ||
| 293 | PCI_COMMAND_IO); | ||
| 294 | |||
| 295 | /* Access to the 0xb0000000 -> 0xb6000000 area will go through to 0x10000000 -> 0x16000000 | ||
| 296 | * on the PCI bus. This allows a nice 1-1 bus to phys mapping. | ||
| 297 | */ | ||
| 298 | |||
| 299 | |||
| 300 | ST40PCI_WRITE(MBR, 0x10000000); | ||
| 301 | /* Always set the max size 128M (actually, it is only 96MB wide) */ | ||
| 302 | ST40PCI_WRITE(MBMR, 0x07ff0000); | ||
| 303 | |||
| 304 | /* I/O addresses are mapped at 0xb6000000 -> 0xb7000000. These are changed to 0, to | ||
| 305 | * allow cards that have legacy io such as vga to function correctly. This gives a | ||
| 306 | * maximum of 64K of io/space as only the bottom 16 bits of the address are copied | ||
| 307 | * over to the bus when the transaction is made. 64K of io space is more than enough | ||
| 308 | */ | ||
| 309 | ST40PCI_WRITE(IOBR, 0x0); | ||
| 310 | /* Set up the 64K window */ | ||
| 311 | ST40PCI_WRITE(IOBMR, 0x0); | ||
| 312 | |||
| 313 | /* Now we set up the mbars so the PCI bus can see the local memory */ | ||
| 314 | /* Expose a 256M window starting at PCI address 0... */ | ||
| 315 | ST40PCI_WRITE(CSR_MBAR0, 0); | ||
| 316 | ST40PCI_WRITE(LSR0, 0x0fff0001); | ||
| 317 | |||
| 318 | /* ... and set up the initial incoming window to expose all of RAM */ | ||
| 319 | pci_set_rbar_region(7, memStart, memStart, memSize); | ||
| 320 | |||
| 321 | /* Maximise timeout values */ | ||
| 322 | ST40PCI_WRITE_BYTE(CSR_TRDY, 0xff); | ||
| 323 | ST40PCI_WRITE_BYTE(CSR_RETRY, 0xff); | ||
| 324 | ST40PCI_WRITE_BYTE(CSR_MIT, 0xff); | ||
| 325 | |||
| 326 | ST40PCI_WRITE_BYTE(PERF,PERF_MASTER_WRITE_POSTING); | ||
| 327 | |||
| 328 | return 1; | ||
| 329 | } | ||
| 330 | |||
| 331 | char * __devinit pcibios_setup(char *str) | ||
| 332 | { | ||
| 333 | return str; | ||
| 334 | } | ||
| 335 | |||
| 336 | |||
| 337 | #define SET_CONFIG_BITS(bus,devfn,where)\ | ||
| 338 | (((bus) << 16) | ((devfn) << 8) | ((where) & ~3) | (bus!=0)) | ||
| 339 | |||
| 340 | #define CONFIG_CMD(bus, devfn, where) SET_CONFIG_BITS(bus->number,devfn,where) | ||
| 341 | |||
| 342 | |||
| 343 | static int CheckForMasterAbort(void) | ||
| 344 | { | ||
| 345 | if (ST40PCI_READ(INT) & INT_MADIM) { | ||
| 346 | /* Should we clear config space version as well ??? */ | ||
| 347 | ST40PCI_WRITE(INT, INT_MADIM); | ||
| 348 | ST40PCI_WRITE_SHORT(CSR_STATUS, 0); | ||
| 349 | return 1; | ||
| 350 | } | ||
| 351 | |||
| 352 | return 0; | ||
| 353 | } | ||
| 354 | |||
| 355 | /* Write to config register */ | ||
| 356 | static int st40pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 * val) | ||
| 357 | { | ||
| 358 | ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
| 359 | switch (size) { | ||
| 360 | case 1: | ||
| 361 | *val = (u8)ST40PCI_READ_BYTE(PDR + (where & 3)); | ||
| 362 | break; | ||
| 363 | case 2: | ||
| 364 | *val = (u16)ST40PCI_READ_SHORT(PDR + (where & 2)); | ||
| 365 | break; | ||
| 366 | case 4: | ||
| 367 | *val = ST40PCI_READ(PDR); | ||
| 368 | break; | ||
| 369 | } | ||
| 370 | |||
| 371 | if (CheckForMasterAbort()){ | ||
| 372 | switch (size) { | ||
| 373 | case 1: | ||
| 374 | *val = (u8)0xff; | ||
| 375 | break; | ||
| 376 | case 2: | ||
| 377 | *val = (u16)0xffff; | ||
| 378 | break; | ||
| 379 | case 4: | ||
| 380 | *val = 0xffffffff; | ||
| 381 | break; | ||
| 382 | } | ||
| 383 | } | ||
| 384 | |||
| 385 | return PCIBIOS_SUCCESSFUL; | ||
| 386 | } | ||
| 387 | |||
| 388 | static int st40pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) | ||
| 389 | { | ||
| 390 | ST40PCI_WRITE(PAR, CONFIG_CMD(bus, devfn, where)); | ||
| 391 | |||
| 392 | switch (size) { | ||
| 393 | case 1: | ||
| 394 | ST40PCI_WRITE_BYTE(PDR + (where & 3), (u8)val); | ||
| 395 | break; | ||
| 396 | case 2: | ||
| 397 | ST40PCI_WRITE_SHORT(PDR + (where & 2), (u16)val); | ||
| 398 | break; | ||
| 399 | case 4: | ||
| 400 | ST40PCI_WRITE(PDR, val); | ||
| 401 | break; | ||
| 402 | } | ||
| 403 | |||
| 404 | CheckForMasterAbort(); | ||
| 405 | |||
| 406 | return PCIBIOS_SUCCESSFUL; | ||
| 407 | } | ||
| 408 | |||
| 409 | struct pci_ops st40pci_config_ops = { | ||
| 410 | .read = st40pci_read, | ||
| 411 | .write = st40pci_write, | ||
| 412 | }; | ||
| 413 | |||
| 414 | |||
| 415 | /* Everything hangs off this */ | ||
| 416 | static struct pci_bus *pci_root_bus; | ||
| 417 | |||
| 418 | static int __init pcibios_init(void) | ||
| 419 | { | ||
| 420 | extern unsigned long memory_start, memory_end; | ||
| 421 | |||
| 422 | printk(KERN_ALERT "pci-st40.c: pcibios_init\n"); | ||
| 423 | |||
| 424 | if (sh_mv.mv_init_pci != NULL) { | ||
| 425 | sh_mv.mv_init_pci(); | ||
| 426 | } | ||
| 427 | |||
| 428 | /* The pci subsytem needs to know where memory is and how much | ||
| 429 | * of it there is. I've simply made these globals. A better mechanism | ||
| 430 | * is probably needed. | ||
| 431 | */ | ||
| 432 | st40pci_init(PHYSADDR(memory_start), | ||
| 433 | PHYSADDR(memory_end) - PHYSADDR(memory_start)); | ||
| 434 | |||
| 435 | if (request_irq(ST40PCI_ERR_IRQ, st40_pci_irq, | ||
| 436 | IRQF_DISABLED, "st40pci", NULL)) { | ||
| 437 | printk(KERN_ERR "st40pci: Cannot hook interrupt\n"); | ||
| 438 | return -EIO; | ||
| 439 | } | ||
| 440 | |||
| 441 | /* Enable the PCI interrupts on the device */ | ||
| 442 | ST40PCI_WRITE(INTM, ~0); | ||
| 443 | ST40PCI_WRITE(AINT, ~0); | ||
| 444 | |||
| 445 | /* Map the io address apprioately */ | ||
| 446 | #ifdef CONFIG_HD64465 | ||
| 447 | hd64465_port_map(PCIBIOS_MIN_IO, (64 * 1024) - PCIBIOS_MIN_IO + 1, | ||
| 448 | ST40_IO_ADDR + PCIBIOS_MIN_IO, 0); | ||
| 449 | #endif | ||
| 450 | |||
| 451 | /* ok, do the scan man */ | ||
| 452 | pci_root_bus = pci_scan_bus(0, &st40pci_config_ops, NULL); | ||
| 453 | pci_assign_unassigned_resources(); | ||
| 454 | |||
| 455 | return 0; | ||
| 456 | } | ||
| 457 | subsys_initcall(pcibios_init); | ||
| 458 | |||
| 459 | /* | ||
| 460 | * Publish a region of local address space over the PCI bus | ||
| 461 | * to other devices. | ||
| 462 | */ | ||
| 463 | static void pci_set_rbar_region(unsigned int region, unsigned long localAddr, | ||
| 464 | unsigned long pciOffset, unsigned long regionSize) | ||
| 465 | { | ||
| 466 | unsigned long mask; | ||
| 467 | |||
| 468 | if (region > 7) | ||
| 469 | return; | ||
| 470 | |||
| 471 | if (regionSize > (512 * 1024 * 1024)) | ||
| 472 | return; | ||
| 473 | |||
| 474 | mask = r2p2(regionSize) - 0x10000; | ||
| 475 | |||
| 476 | /* Disable the region (in case currently in use, should never happen) */ | ||
| 477 | ST40PCI_WRITE_INDEXED(RSR, region, 0); | ||
| 478 | |||
| 479 | /* Start of local address space to publish */ | ||
| 480 | ST40PCI_WRITE_INDEXED(RLAR, region, PHYSADDR(localAddr) ); | ||
| 481 | |||
| 482 | /* Start of region in PCI address space as an offset from MBAR0 */ | ||
| 483 | ST40PCI_WRITE_INDEXED(RBAR, region, pciOffset); | ||
| 484 | |||
| 485 | /* Size of region */ | ||
| 486 | ST40PCI_WRITE_INDEXED(RSR, region, mask | 1); | ||
| 487 | } | ||
| 488 | |||
diff --git a/arch/sh/drivers/pci/pci-st40.h b/arch/sh/drivers/pci/pci-st40.h deleted file mode 100644 index cf0d35bd135c..000000000000 --- a/arch/sh/drivers/pci/pci-st40.h +++ /dev/null | |||
| @@ -1,136 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) | ||
| 3 | * | ||
| 4 | * May be copied or modified under the terms of the GNU General Public | ||
| 5 | * License. See linux/COPYING for more information. | ||
| 6 | * | ||
| 7 | * Definitions for the ST40 PCI hardware. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __PCI_ST40_H__ | ||
| 11 | #define __PCI_ST40_H__ | ||
| 12 | |||
| 13 | #define ST40PCI_VCR_STATUS 0x00 | ||
| 14 | |||
| 15 | #define ST40PCI_VCR_VERSION 0x08 | ||
| 16 | |||
| 17 | #define ST40PCI_CR 0x10 | ||
| 18 | |||
| 19 | #define CR_SOFT_RESET (1<<12) | ||
| 20 | #define CR_PFCS (1<<11) | ||
| 21 | #define CR_PFE (1<<9) | ||
| 22 | #define CR_BMAM (1<<6) | ||
| 23 | #define CR_HOST (1<<5) | ||
| 24 | #define CR_CLKEN (1<<4) | ||
| 25 | #define CR_SOCS (1<<3) | ||
| 26 | #define CR_IOCS (1<<2) | ||
| 27 | #define CR_RSTCTL (1<<1) | ||
| 28 | #define CR_CFINT (1<<0) | ||
| 29 | #define CR_LOCK_MASK 0x5a000000 | ||
| 30 | |||
| 31 | |||
| 32 | #define ST40PCI_LSR0 0X14 | ||
| 33 | #define ST40PCI_LAR0 0x1c | ||
| 34 | |||
| 35 | #define ST40PCI_INT 0x24 | ||
| 36 | #define INT_MNLTDIM (1<<15) | ||
| 37 | #define INT_TTADI (1<<14) | ||
| 38 | #define INT_TMTO (1<<9) | ||
| 39 | #define INT_MDEI (1<<8) | ||
| 40 | #define INT_APEDI (1<<7) | ||
| 41 | #define INT_SDI (1<<6) | ||
| 42 | #define INT_DPEITW (1<<5) | ||
| 43 | #define INT_PEDITR (1<<4) | ||
| 44 | #define INT_TADIM (1<<3) | ||
| 45 | #define INT_MADIM (1<<2) | ||
| 46 | #define INT_MWPDI (1<<1) | ||
| 47 | #define INT_MRDPEI (1<<0) | ||
| 48 | |||
| 49 | |||
| 50 | #define ST40PCI_INTM 0x28 | ||
| 51 | #define ST40PCI_AIR 0x2c | ||
| 52 | |||
| 53 | #define ST40PCI_CIR 0x30 | ||
| 54 | #define CIR_PIOTEM (1<<31) | ||
| 55 | #define CIR_RWTET (1<<26) | ||
| 56 | |||
| 57 | #define ST40PCI_AINT 0x40 | ||
| 58 | #define AINT_MBI (1<<13) | ||
| 59 | #define AINT_TBTOI (1<<12) | ||
| 60 | #define AINT_MBTOI (1<<11) | ||
| 61 | #define AINT_TAI (1<<3) | ||
| 62 | #define AINT_MAI (1<<2) | ||
| 63 | #define AINT_RDPEI (1<<1) | ||
| 64 | #define AINT_WDPE (1<<0) | ||
| 65 | |||
| 66 | #define ST40PCI_AINTM 0x44 | ||
| 67 | #define ST40PCI_BMIR 0x48 | ||
| 68 | #define ST40PCI_PAR 0x4c | ||
| 69 | #define ST40PCI_MBR 0x50 | ||
| 70 | #define ST40PCI_IOBR 0x54 | ||
| 71 | #define ST40PCI_PINT 0x58 | ||
| 72 | #define ST40PCI_PINTM 0x5c | ||
| 73 | #define ST40PCI_MBMR 0x70 | ||
| 74 | #define ST40PCI_IOBMR 0x74 | ||
| 75 | #define ST40PCI_PDR 0x78 | ||
| 76 | |||
| 77 | /* H8 specific registers start here */ | ||
| 78 | #define ST40PCI_WCBAR 0x7c | ||
| 79 | #define ST40PCI_LOCCFG_UNLOCK 0x34 | ||
| 80 | |||
| 81 | #define ST40PCI_RBAR0 0x100 | ||
| 82 | #define ST40PCI_RSR0 0x104 | ||
| 83 | #define ST40PCI_RLAR0 0x108 | ||
| 84 | |||
| 85 | #define ST40PCI_RBAR1 0x110 | ||
| 86 | #define ST40PCI_RSR1 0x114 | ||
| 87 | #define ST40PCI_RLAR1 0x118 | ||
| 88 | |||
| 89 | |||
| 90 | #define ST40PCI_RBAR2 0x120 | ||
| 91 | #define ST40PCI_RSR2 0x124 | ||
| 92 | #define ST40PCI_RLAR2 0x128 | ||
| 93 | |||
| 94 | #define ST40PCI_RBAR3 0x130 | ||
| 95 | #define ST40PCI_RSR3 0x134 | ||
| 96 | #define ST40PCI_RLAR3 0x138 | ||
| 97 | |||
| 98 | #define ST40PCI_RBAR4 0x140 | ||
| 99 | #define ST40PCI_RSR4 0x144 | ||
| 100 | #define ST40PCI_RLAR4 0x148 | ||
| 101 | |||
| 102 | #define ST40PCI_RBAR5 0x150 | ||
| 103 | #define ST40PCI_RSR5 0x154 | ||
| 104 | #define ST40PCI_RLAR5 0x158 | ||
| 105 | |||
| 106 | #define ST40PCI_RBAR6 0x160 | ||
| 107 | #define ST40PCI_RSR6 0x164 | ||
| 108 | #define ST40PCI_RLAR6 0x168 | ||
| 109 | |||
| 110 | #define ST40PCI_RBAR7 0x170 | ||
| 111 | #define ST40PCI_RSR7 0x174 | ||
| 112 | #define ST40PCI_RLAR7 0x178 | ||
| 113 | |||
| 114 | |||
| 115 | #define ST40PCI_RBAR(n) (0x100+(0x10*(n))) | ||
| 116 | #define ST40PCI_RSR(n) (0x104+(0x10*(n))) | ||
| 117 | #define ST40PCI_RLAR(n) (0x108+(0x10*(n))) | ||
| 118 | |||
| 119 | #define ST40PCI_PERF 0x80 | ||
| 120 | #define PERF_MASTER_WRITE_POSTING (1<<4) | ||
| 121 | /* H8 specific registers end here */ | ||
| 122 | |||
| 123 | |||
| 124 | /* These are configs space registers */ | ||
| 125 | #define ST40PCI_CSR_VID 0x10000 | ||
| 126 | #define ST40PCI_CSR_DID 0x10002 | ||
| 127 | #define ST40PCI_CSR_CMD 0x10004 | ||
| 128 | #define ST40PCI_CSR_STATUS 0x10006 | ||
| 129 | #define ST40PCI_CSR_MBAR0 0x10010 | ||
| 130 | #define ST40PCI_CSR_TRDY 0x10040 | ||
| 131 | #define ST40PCI_CSR_RETRY 0x10041 | ||
| 132 | #define ST40PCI_CSR_MIT 0x1000d | ||
| 133 | |||
| 134 | #define ST40_IO_ADDR 0xb6000000 | ||
| 135 | |||
| 136 | #endif /* __PCI_ST40_H__ */ | ||
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index 1f141a8ba17c..4b81d9c47b00 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile | |||
| @@ -10,7 +10,6 @@ obj-y := debugtraps.o io.o io_generic.o irq.o machvec.o process.o ptrace.o \ | |||
| 10 | 10 | ||
| 11 | obj-y += cpu/ timers/ | 11 | obj-y += cpu/ timers/ |
| 12 | obj-$(CONFIG_VSYSCALL) += vsyscall/ | 12 | obj-$(CONFIG_VSYSCALL) += vsyscall/ |
| 13 | |||
| 14 | obj-$(CONFIG_SMP) += smp.o | 13 | obj-$(CONFIG_SMP) += smp.o |
| 15 | obj-$(CONFIG_CF_ENABLER) += cf-enabler.o | 14 | obj-$(CONFIG_CF_ENABLER) += cf-enabler.o |
| 16 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | 15 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o |
| @@ -22,3 +21,5 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | |||
| 22 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 21 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
| 23 | obj-$(CONFIG_PM) += pm.o | 22 | obj-$(CONFIG_PM) += pm.o |
| 24 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 23 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| 24 | |||
| 25 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/kernel/cpu/sh3/ex.S b/arch/sh/kernel/cpu/sh3/ex.S index 2b2a9e02fb75..b6abf38d3a8d 100644 --- a/arch/sh/kernel/cpu/sh3/ex.S +++ b/arch/sh/kernel/cpu/sh3/ex.S | |||
| @@ -46,7 +46,7 @@ ENTRY(exception_handling_table) | |||
| 46 | .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ | 46 | .long exception_error ! illegal_slot_instruction (filled by trap_init) /*1A0*/ |
| 47 | ENTRY(nmi_slot) | 47 | ENTRY(nmi_slot) |
| 48 | #if defined (CONFIG_KGDB_NMI) | 48 | #if defined (CONFIG_KGDB_NMI) |
| 49 | .long debug_enter /* 1C0 */ ! Allow trap to debugger | 49 | .long kgdb_handle_exception /* 1C0 */ ! Allow trap to debugger |
| 50 | #else | 50 | #else |
| 51 | .long exception_none /* 1C0 */ ! Not implemented yet | 51 | .long exception_none /* 1C0 */ ! Not implemented yet |
| 52 | #endif | 52 | #endif |
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 21375d777e99..bc9c28a69bf1 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
| @@ -139,14 +139,6 @@ int __init detect_cpu_and_cache_system(void) | |||
| 139 | boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER | | 139 | boot_cpu_data.flags |= CPU_HAS_FPU | CPU_HAS_PERF_COUNTER | |
| 140 | CPU_HAS_LLSC; | 140 | CPU_HAS_LLSC; |
| 141 | break; | 141 | break; |
| 142 | case 0x8000: | ||
| 143 | boot_cpu_data.type = CPU_ST40RA; | ||
| 144 | boot_cpu_data.flags |= CPU_HAS_FPU; | ||
| 145 | break; | ||
| 146 | case 0x8100: | ||
| 147 | boot_cpu_data.type = CPU_ST40GX1; | ||
| 148 | boot_cpu_data.flags |= CPU_HAS_FPU; | ||
| 149 | break; | ||
| 150 | case 0x700: | 142 | case 0x700: |
| 151 | boot_cpu_data.type = CPU_SH4_501; | 143 | boot_cpu_data.type = CPU_SH4_501; |
| 152 | boot_cpu_data.icache.ways = 2; | 144 | boot_cpu_data.icache.ways = 2; |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 348da194ec99..0586bc62ad96 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
| 12 | #include <linux/kernel_stat.h> | 12 | #include <linux/kernel_stat.h> |
| 13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
| 14 | #include <linux/irq.h> | ||
| 15 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
| 16 | #include <asm/machvec.h> | 15 | #include <asm/machvec.h> |
| 17 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
diff --git a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c index 2fdc700dfd6e..d453c3a1c79f 100644 --- a/arch/sh/kernel/kgdb_stub.c +++ b/arch/sh/kernel/kgdb_stub.c | |||
| @@ -102,6 +102,7 @@ | |||
| 102 | #include <linux/init.h> | 102 | #include <linux/init.h> |
| 103 | #include <linux/console.h> | 103 | #include <linux/console.h> |
| 104 | #include <linux/sysrq.h> | 104 | #include <linux/sysrq.h> |
| 105 | #include <linux/module.h> | ||
| 105 | #include <asm/system.h> | 106 | #include <asm/system.h> |
| 106 | #include <asm/cacheflush.h> | 107 | #include <asm/cacheflush.h> |
| 107 | #include <asm/current.h> | 108 | #include <asm/current.h> |
| @@ -116,7 +117,9 @@ kgdb_debug_hook_t *kgdb_debug_hook; | |||
| 116 | kgdb_bus_error_hook_t *kgdb_bus_err_hook; | 117 | kgdb_bus_error_hook_t *kgdb_bus_err_hook; |
| 117 | 118 | ||
| 118 | int (*kgdb_getchar)(void); | 119 | int (*kgdb_getchar)(void); |
| 120 | EXPORT_SYMBOL_GPL(kgdb_getchar); | ||
| 119 | void (*kgdb_putchar)(int); | 121 | void (*kgdb_putchar)(int); |
| 122 | EXPORT_SYMBOL_GPL(kgdb_putchar); | ||
| 120 | 123 | ||
| 121 | static void put_debug_char(int c) | 124 | static void put_debug_char(int c) |
| 122 | { | 125 | { |
| @@ -136,7 +139,7 @@ static int get_debug_char(void) | |||
| 136 | #define NUMREGBYTES (MAXREG*4) | 139 | #define NUMREGBYTES (MAXREG*4) |
| 137 | #define OUTBUFMAX (NUMREGBYTES*2+512) | 140 | #define OUTBUFMAX (NUMREGBYTES*2+512) |
| 138 | 141 | ||
| 139 | enum regs { | 142 | enum { |
| 140 | R0 = 0, R1, R2, R3, R4, R5, R6, R7, | 143 | R0 = 0, R1, R2, R3, R4, R5, R6, R7, |
| 141 | R8, R9, R10, R11, R12, R13, R14, R15, | 144 | R8, R9, R10, R11, R12, R13, R14, R15, |
| 142 | PC, PR, GBR, VBR, MACH, MACL, SR, | 145 | PC, PR, GBR, VBR, MACH, MACL, SR, |
| @@ -176,9 +179,13 @@ int kgdb_nofault; /* Boolean to ignore bus errs (i.e. in GDB) */ | |||
| 176 | 179 | ||
| 177 | /* SCI/UART settings, used in kgdb_console_setup() */ | 180 | /* SCI/UART settings, used in kgdb_console_setup() */ |
| 178 | int kgdb_portnum = CONFIG_KGDB_DEFPORT; | 181 | int kgdb_portnum = CONFIG_KGDB_DEFPORT; |
| 182 | EXPORT_SYMBOL_GPL(kgdb_portnum); | ||
| 179 | int kgdb_baud = CONFIG_KGDB_DEFBAUD; | 183 | int kgdb_baud = CONFIG_KGDB_DEFBAUD; |
| 184 | EXPORT_SYMBOL_GPL(kgdb_baud); | ||
| 180 | char kgdb_parity = CONFIG_KGDB_DEFPARITY; | 185 | char kgdb_parity = CONFIG_KGDB_DEFPARITY; |
| 186 | EXPORT_SYMBOL_GPL(kgdb_parity); | ||
| 181 | char kgdb_bits = CONFIG_KGDB_DEFBITS; | 187 | char kgdb_bits = CONFIG_KGDB_DEFBITS; |
| 188 | EXPORT_SYMBOL_GPL(kgdb_bits); | ||
| 182 | 189 | ||
| 183 | /* Jump buffer for setjmp/longjmp */ | 190 | /* Jump buffer for setjmp/longjmp */ |
| 184 | static jmp_buf rem_com_env; | 191 | static jmp_buf rem_com_env; |
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 0b8c45d53a47..4156aac8c27d 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
| @@ -303,7 +303,6 @@ static const char *cpu_name[] = { | |||
| 303 | [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", | 303 | [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", |
| 304 | [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", | 304 | [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", |
| 305 | [CPU_SH7760] = "SH7760", | 305 | [CPU_SH7760] = "SH7760", |
| 306 | [CPU_ST40RA] = "ST40RA", [CPU_ST40GX1] = "ST40GX1", | ||
| 307 | [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", | 306 | [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", |
| 308 | [CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780", | 307 | [CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780", |
| 309 | [CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343", | 308 | [CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343", |
diff --git a/arch/sh/kernel/sh_ksyms.c b/arch/sh/kernel/sh_ksyms.c index 548e4285b375..e1a6de9088b5 100644 --- a/arch/sh/kernel/sh_ksyms.c +++ b/arch/sh/kernel/sh_ksyms.c | |||
| @@ -106,7 +106,6 @@ DECLARE_EXPORT(__movmem); | |||
| 106 | DECLARE_EXPORT(__movstr); | 106 | DECLARE_EXPORT(__movstr); |
| 107 | #endif | 107 | #endif |
| 108 | 108 | ||
| 109 | #ifdef CONFIG_CPU_SH4 | ||
| 110 | #if __GNUC__ == 4 | 109 | #if __GNUC__ == 4 |
| 111 | DECLARE_EXPORT(__movmem_i4_even); | 110 | DECLARE_EXPORT(__movmem_i4_even); |
| 112 | DECLARE_EXPORT(__movmem_i4_odd); | 111 | DECLARE_EXPORT(__movmem_i4_odd); |
| @@ -126,7 +125,6 @@ DECLARE_EXPORT(__movstr_i4_even); | |||
| 126 | DECLARE_EXPORT(__movstr_i4_odd); | 125 | DECLARE_EXPORT(__movstr_i4_odd); |
| 127 | DECLARE_EXPORT(__movstrSI12_i4); | 126 | DECLARE_EXPORT(__movstrSI12_i4); |
| 128 | #endif /* __GNUC__ == 4 */ | 127 | #endif /* __GNUC__ == 4 */ |
| 129 | #endif | ||
| 130 | 128 | ||
| 131 | #if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \ | 129 | #if !defined(CONFIG_CACHE_OFF) && (defined(CONFIG_CPU_SH4) || \ |
| 132 | defined(CONFIG_SH7705_CACHE_32KB)) | 130 | defined(CONFIG_SH7705_CACHE_32KB)) |
diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile index e23dd1a3fccd..9dc7b6985052 100644 --- a/arch/sh/lib/Makefile +++ b/arch/sh/lib/Makefile | |||
| @@ -9,3 +9,5 @@ memcpy-y := memcpy.o | |||
| 9 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o | 9 | memcpy-$(CONFIG_CPU_SH4) := memcpy-sh4.o |
| 10 | 10 | ||
| 11 | lib-y += $(memcpy-y) | 11 | lib-y += $(memcpy-y) |
| 12 | |||
| 13 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index cf446bbab5b0..1265f204f7d1 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
| @@ -17,7 +17,7 @@ config CPU_SH4 | |||
| 17 | bool | 17 | bool |
| 18 | select CPU_HAS_INTEVT | 18 | select CPU_HAS_INTEVT |
| 19 | select CPU_HAS_SR_RB | 19 | select CPU_HAS_SR_RB |
| 20 | select CPU_HAS_PTEA if (!CPU_SUBTYPE_ST40 && !CPU_SH4A) || CPU_SHX2 | 20 | select CPU_HAS_PTEA if !CPU_SH4A || CPU_SHX2 |
| 21 | select CPU_HAS_FPU if !CPU_SH4AL_DSP | 21 | select CPU_HAS_FPU if !CPU_SH4AL_DSP |
| 22 | 22 | ||
| 23 | config CPU_SH4A | 23 | config CPU_SH4A |
| @@ -29,10 +29,6 @@ config CPU_SH4AL_DSP | |||
| 29 | select CPU_SH4A | 29 | select CPU_SH4A |
| 30 | select CPU_HAS_DSP | 30 | select CPU_HAS_DSP |
| 31 | 31 | ||
| 32 | config CPU_SUBTYPE_ST40 | ||
| 33 | bool | ||
| 34 | select CPU_SH4 | ||
| 35 | |||
| 36 | config CPU_SHX2 | 32 | config CPU_SHX2 |
| 37 | bool | 33 | bool |
| 38 | 34 | ||
| @@ -152,21 +148,6 @@ config CPU_SUBTYPE_SH4_202 | |||
| 152 | bool "Support SH4-202 processor" | 148 | bool "Support SH4-202 processor" |
| 153 | select CPU_SH4 | 149 | select CPU_SH4 |
| 154 | 150 | ||
| 155 | # ST40 Processor Support | ||
| 156 | |||
| 157 | config CPU_SUBTYPE_ST40STB1 | ||
| 158 | bool "Support ST40STB1/ST40RA processors" | ||
| 159 | select CPU_SUBTYPE_ST40 | ||
| 160 | help | ||
| 161 | Select ST40STB1 if you have a ST40RA CPU. | ||
| 162 | This was previously called the ST40STB1, hence the option name. | ||
| 163 | |||
| 164 | config CPU_SUBTYPE_ST40GX1 | ||
| 165 | bool "Support ST40GX1 processor" | ||
| 166 | select CPU_SUBTYPE_ST40 | ||
| 167 | help | ||
| 168 | Select ST40GX1 if you have a ST40GX1 CPU. | ||
| 169 | |||
| 170 | # SH-4A Processor Support | 151 | # SH-4A Processor Support |
| 171 | 152 | ||
| 172 | config CPU_SUBTYPE_SH7770 | 153 | config CPU_SUBTYPE_SH7770 |
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile index ee30fb44dfe1..aa44607f072d 100644 --- a/arch/sh/mm/Makefile +++ b/arch/sh/mm/Makefile | |||
| @@ -33,3 +33,5 @@ endif | |||
| 33 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | 33 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o |
| 34 | obj-$(CONFIG_32BIT) += pmb.o | 34 | obj-$(CONFIG_32BIT) += pmb.o |
| 35 | obj-$(CONFIG_NUMA) += numa.o | 35 | obj-$(CONFIG_NUMA) += numa.o |
| 36 | |||
| 37 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh/mm/clear_page.S b/arch/sh/mm/clear_page.S index 8a706131e521..7a7c81ee3f01 100644 --- a/arch/sh/mm/clear_page.S +++ b/arch/sh/mm/clear_page.S | |||
| @@ -150,48 +150,3 @@ ENTRY(__clear_user) | |||
| 150 | .long 8b, .Lbad_clear_user | 150 | .long 8b, .Lbad_clear_user |
| 151 | .long 9b, .Lbad_clear_user | 151 | .long 9b, .Lbad_clear_user |
| 152 | .previous | 152 | .previous |
| 153 | |||
| 154 | #if defined(CONFIG_CPU_SH4) | ||
| 155 | /* | ||
| 156 | * __clear_user_page | ||
| 157 | * @to: P3 address (with same color) | ||
| 158 | * @orig_to: P1 address | ||
| 159 | * | ||
| 160 | * void __clear_user_page(void *to, void *orig_to) | ||
| 161 | */ | ||
| 162 | |||
| 163 | /* | ||
| 164 | * r0 --- scratch | ||
| 165 | * r4 --- to | ||
| 166 | * r5 --- orig_to | ||
| 167 | * r6 --- to + PAGE_SIZE | ||
| 168 | */ | ||
| 169 | ENTRY(__clear_user_page) | ||
| 170 | mov.l .Lpsz,r0 | ||
| 171 | mov r4,r6 | ||
| 172 | add r0,r6 | ||
| 173 | mov #0,r0 | ||
| 174 | ! | ||
| 175 | 1: ocbi @r5 | ||
| 176 | add #32,r5 | ||
| 177 | movca.l r0,@r4 | ||
| 178 | mov r4,r1 | ||
| 179 | add #32,r4 | ||
| 180 | mov.l r0,@-r4 | ||
| 181 | mov.l r0,@-r4 | ||
| 182 | mov.l r0,@-r4 | ||
| 183 | mov.l r0,@-r4 | ||
| 184 | mov.l r0,@-r4 | ||
| 185 | mov.l r0,@-r4 | ||
| 186 | mov.l r0,@-r4 | ||
| 187 | add #28,r4 | ||
| 188 | cmp/eq r6,r4 | ||
| 189 | bf/s 1b | ||
| 190 | ocbwb @r1 | ||
| 191 | ! | ||
| 192 | rts | ||
| 193 | nop | ||
| 194 | .Lpsz: .long PAGE_SIZE | ||
| 195 | |||
| 196 | #endif | ||
| 197 | |||
diff --git a/arch/sh/mm/copy_page.S b/arch/sh/mm/copy_page.S index 3d8409daa4be..40685018b952 100644 --- a/arch/sh/mm/copy_page.S +++ b/arch/sh/mm/copy_page.S | |||
| @@ -68,67 +68,6 @@ ENTRY(copy_page_slow) | |||
| 68 | rts | 68 | rts |
| 69 | nop | 69 | nop |
| 70 | 70 | ||
| 71 | #if defined(CONFIG_CPU_SH4) | ||
| 72 | /* | ||
| 73 | * __copy_user_page | ||
| 74 | * @to: P1 address (with same color) | ||
| 75 | * @from: P1 address | ||
| 76 | * @orig_to: P1 address | ||
| 77 | * | ||
| 78 | * void __copy_user_page(void *to, void *from, void *orig_to) | ||
| 79 | */ | ||
| 80 | |||
| 81 | /* | ||
| 82 | * r0, r1, r2, r3, r4, r5, r6, r7 --- scratch | ||
| 83 | * r8 --- from + PAGE_SIZE | ||
| 84 | * r9 --- orig_to | ||
| 85 | * r10 --- to | ||
| 86 | * r11 --- from | ||
| 87 | */ | ||
| 88 | ENTRY(__copy_user_page) | ||
| 89 | mov.l r8,@-r15 | ||
| 90 | mov.l r9,@-r15 | ||
| 91 | mov.l r10,@-r15 | ||
| 92 | mov.l r11,@-r15 | ||
| 93 | mov r4,r10 | ||
| 94 | mov r5,r11 | ||
| 95 | mov r6,r9 | ||
| 96 | mov r5,r8 | ||
| 97 | mov.l .Lpsz,r0 | ||
| 98 | add r0,r8 | ||
| 99 | ! | ||
| 100 | 1: ocbi @r9 | ||
| 101 | add #32,r9 | ||
| 102 | mov.l @r11+,r0 | ||
| 103 | mov.l @r11+,r1 | ||
| 104 | mov.l @r11+,r2 | ||
| 105 | mov.l @r11+,r3 | ||
| 106 | mov.l @r11+,r4 | ||
| 107 | mov.l @r11+,r5 | ||
| 108 | mov.l @r11+,r6 | ||
| 109 | mov.l @r11+,r7 | ||
| 110 | movca.l r0,@r10 | ||
| 111 | mov r10,r0 | ||
| 112 | add #32,r10 | ||
| 113 | mov.l r7,@-r10 | ||
| 114 | mov.l r6,@-r10 | ||
| 115 | mov.l r5,@-r10 | ||
| 116 | mov.l r4,@-r10 | ||
| 117 | mov.l r3,@-r10 | ||
| 118 | mov.l r2,@-r10 | ||
| 119 | mov.l r1,@-r10 | ||
| 120 | ocbwb @r0 | ||
| 121 | cmp/eq r11,r8 | ||
| 122 | bf/s 1b | ||
| 123 | add #28,r10 | ||
| 124 | ! | ||
| 125 | mov.l @r15+,r11 | ||
| 126 | mov.l @r15+,r10 | ||
| 127 | mov.l @r15+,r9 | ||
| 128 | mov.l @r15+,r8 | ||
| 129 | rts | ||
| 130 | nop | ||
| 131 | #endif | ||
| 132 | .align 2 | 71 | .align 2 |
| 133 | .Lpsz: .long PAGE_SIZE | 72 | .Lpsz: .long PAGE_SIZE |
| 134 | /* | 73 | /* |
diff --git a/arch/sh/mm/pg-sh4.c b/arch/sh/mm/pg-sh4.c index 25f5c6f6821d..8c7a9ca79879 100644 --- a/arch/sh/mm/pg-sh4.c +++ b/arch/sh/mm/pg-sh4.c | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
| 10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
| 11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
| 12 | #include <linux/highmem.h> | ||
| 13 | #include <linux/module.h> | ||
| 12 | #include <asm/mmu_context.h> | 14 | #include <asm/mmu_context.h> |
| 13 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
| 14 | 16 | ||
| @@ -50,34 +52,61 @@ static inline void kunmap_coherent(struct page *page) | |||
| 50 | void clear_user_page(void *to, unsigned long address, struct page *page) | 52 | void clear_user_page(void *to, unsigned long address, struct page *page) |
| 51 | { | 53 | { |
| 52 | __set_bit(PG_mapped, &page->flags); | 54 | __set_bit(PG_mapped, &page->flags); |
| 53 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 55 | |
| 54 | clear_page(to); | 56 | clear_page(to); |
| 55 | else { | 57 | if ((((address & PAGE_MASK) ^ (unsigned long)to) & CACHE_ALIAS)) |
| 56 | void *vto = kmap_coherent(page, address); | 58 | __flush_wback_region(to, PAGE_SIZE); |
| 57 | __clear_user_page(vto, to); | ||
| 58 | kunmap_coherent(vto); | ||
| 59 | } | ||
| 60 | } | 59 | } |
| 61 | 60 | ||
| 62 | /* | 61 | void copy_to_user_page(struct vm_area_struct *vma, struct page *page, |
| 63 | * copy_user_page | 62 | unsigned long vaddr, void *dst, const void *src, |
| 64 | * @to: P1 address | 63 | unsigned long len) |
| 65 | * @from: P1 address | ||
| 66 | * @address: U0 address to be mapped | ||
| 67 | * @page: page (virt_to_page(to)) | ||
| 68 | */ | ||
| 69 | void copy_user_page(void *to, void *from, unsigned long address, | ||
| 70 | struct page *page) | ||
| 71 | { | 64 | { |
| 65 | void *vto; | ||
| 66 | |||
| 72 | __set_bit(PG_mapped, &page->flags); | 67 | __set_bit(PG_mapped, &page->flags); |
| 73 | if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) | 68 | |
| 74 | copy_page(to, from); | 69 | vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
| 75 | else { | 70 | memcpy(vto, src, len); |
| 76 | void *vfrom = kmap_coherent(page, address); | 71 | kunmap_coherent(vto); |
| 77 | __copy_user_page(vfrom, from, to); | 72 | |
| 78 | kunmap_coherent(vfrom); | 73 | if (vma->vm_flags & VM_EXEC) |
| 79 | } | 74 | flush_cache_page(vma, vaddr, page_to_pfn(page)); |
| 75 | } | ||
| 76 | |||
| 77 | void copy_from_user_page(struct vm_area_struct *vma, struct page *page, | ||
| 78 | unsigned long vaddr, void *dst, const void *src, | ||
| 79 | unsigned long len) | ||
| 80 | { | ||
| 81 | void *vfrom; | ||
| 82 | |||
| 83 | __set_bit(PG_mapped, &page->flags); | ||
| 84 | |||
| 85 | vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | ||
| 86 | memcpy(dst, vfrom, len); | ||
| 87 | kunmap_coherent(vfrom); | ||
| 88 | } | ||
| 89 | |||
| 90 | void copy_user_highpage(struct page *to, struct page *from, | ||
| 91 | unsigned long vaddr, struct vm_area_struct *vma) | ||
| 92 | { | ||
| 93 | void *vfrom, *vto; | ||
| 94 | |||
| 95 | __set_bit(PG_mapped, &to->flags); | ||
| 96 | |||
| 97 | vto = kmap_atomic(to, KM_USER1); | ||
| 98 | vfrom = kmap_coherent(from, vaddr); | ||
| 99 | copy_page(vto, vfrom); | ||
| 100 | kunmap_coherent(vfrom); | ||
| 101 | |||
| 102 | if (((vaddr ^ (unsigned long)vto) & CACHE_ALIAS)) | ||
| 103 | __flush_wback_region(vto, PAGE_SIZE); | ||
| 104 | |||
| 105 | kunmap_atomic(vto, KM_USER1); | ||
| 106 | /* Make sure this page is cleared on other CPU's too before using it */ | ||
| 107 | smp_wmb(); | ||
| 80 | } | 108 | } |
| 109 | EXPORT_SYMBOL(copy_user_highpage); | ||
| 81 | 110 | ||
| 82 | /* | 111 | /* |
| 83 | * For SH-4, we have our own implementation for ptep_get_and_clear | 112 | * For SH-4, we have our own implementation for ptep_get_and_clear |
diff --git a/arch/sh/oprofile/Makefile b/arch/sh/oprofile/Makefile index 1f25d9bb7538..2efc2e79fd29 100644 --- a/arch/sh/oprofile/Makefile +++ b/arch/sh/oprofile/Makefile | |||
| @@ -15,3 +15,4 @@ profdrvr-$(CONFIG_CPU_SUBTYPE_SH7091) := op_model_sh7750.o | |||
| 15 | 15 | ||
| 16 | oprofile-y := $(DRIVER_OBJS) $(profdrvr-y) | 16 | oprofile-y := $(DRIVER_OBJS) $(profdrvr-y) |
| 17 | 17 | ||
| 18 | EXTRA_CFLAGS += -Werror | ||
diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c index ceb9458abda4..0761af4d2a42 100644 --- a/arch/sh64/kernel/process.c +++ b/arch/sh64/kernel/process.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/reboot.h> | 26 | #include <linux/reboot.h> |
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/proc_fs.h> | ||
| 29 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
| 30 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
| 31 | 32 | ||
| @@ -656,9 +657,6 @@ unsigned long get_wchan(struct task_struct *p) | |||
| 656 | */ | 657 | */ |
| 657 | 658 | ||
| 658 | #if defined(CONFIG_SH64_PROC_ASIDS) | 659 | #if defined(CONFIG_SH64_PROC_ASIDS) |
| 659 | #include <linux/init.h> | ||
| 660 | #include <linux/proc_fs.h> | ||
| 661 | |||
| 662 | static int | 660 | static int |
| 663 | asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data) | 661 | asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data) |
| 664 | { | 662 | { |
| @@ -686,10 +684,8 @@ asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void | |||
| 686 | 684 | ||
| 687 | static int __init register_proc_asids(void) | 685 | static int __init register_proc_asids(void) |
| 688 | { | 686 | { |
| 689 | create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL); | 687 | create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL); |
| 690 | return 0; | 688 | return 0; |
| 691 | } | 689 | } |
| 692 | |||
| 693 | __initcall(register_proc_asids); | 690 | __initcall(register_proc_asids); |
| 694 | #endif | 691 | #endif |
| 695 | |||
diff --git a/arch/sh64/kernel/traps.c b/arch/sh64/kernel/traps.c index c03101fab467..f32df3831f45 100644 --- a/arch/sh64/kernel/traps.c +++ b/arch/sh64/kernel/traps.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
| 31 | #include <linux/sysctl.h> | 31 | #include <linux/sysctl.h> |
| 32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
| 33 | |||
| 34 | #include <asm/system.h> | 33 | #include <asm/system.h> |
| 35 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
| 36 | #include <asm/io.h> | 35 | #include <asm/io.h> |
| @@ -242,9 +241,6 @@ DO_ERROR(12, SIGILL, "reserved instruction", reserved_inst, current) | |||
| 242 | 241 | ||
| 243 | #endif /* CONFIG_SH64_ID2815_WORKAROUND */ | 242 | #endif /* CONFIG_SH64_ID2815_WORKAROUND */ |
| 244 | 243 | ||
| 245 | |||
| 246 | #include <asm/system.h> | ||
| 247 | |||
| 248 | /* Called with interrupts disabled */ | 244 | /* Called with interrupts disabled */ |
| 249 | asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) | 245 | asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) |
| 250 | { | 246 | { |
| @@ -984,4 +980,3 @@ asmlinkage void do_debug_interrupt(unsigned long code, struct pt_regs *regs) | |||
| 984 | /* Clear all DEBUGINT causes */ | 980 | /* Clear all DEBUGINT causes */ |
| 985 | poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0); | 981 | poke_real_address_q(DM_EXP_CAUSE_PHY, 0x0); |
| 986 | } | 982 | } |
| 987 | |||
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index e1e24f31aa54..01a6756ba371 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/linkage.h> | 18 | #include <linux/linkage.h> |
| 19 | #include <linux/kernel_stat.h> | 19 | #include <linux/kernel_stat.h> |
| 20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
| 21 | #include <linux/sched.h> | ||
| 22 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
| 23 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
| 24 | #include <linux/random.h> | 23 | #include <linux/random.h> |
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c index 9f472a79d37e..eeb5a2fc788d 100644 --- a/arch/sparc64/kernel/ds.c +++ b/arch/sparc64/kernel/ds.c | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/module.h> | ||
| 10 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 11 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
| 12 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
diff --git a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c index 579871527699..158484bf5999 100644 --- a/arch/sparc64/kernel/module.c +++ b/arch/sparc64/kernel/module.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
| 12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
| 13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
| 14 | #include <linux/vmalloc.h> | ||
| 15 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 16 | 15 | ||
| 17 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index 78caff926737..98c468803ce3 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c | |||
| @@ -51,7 +51,6 @@ | |||
| 51 | #include <linux/vfs.h> | 51 | #include <linux/vfs.h> |
| 52 | #include <linux/netfilter_ipv4/ip_tables.h> | 52 | #include <linux/netfilter_ipv4/ip_tables.h> |
| 53 | #include <linux/ptrace.h> | 53 | #include <linux/ptrace.h> |
| 54 | #include <linux/highuid.h> | ||
| 55 | 54 | ||
| 56 | #include <asm/types.h> | 55 | #include <asm/types.h> |
| 57 | #include <asm/uaccess.h> | 56 | #include <asm/uaccess.h> |
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 170d6ca8de6f..cfc22d3fe54c 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c | |||
| @@ -57,7 +57,6 @@ | |||
| 57 | #include <linux/personality.h> | 57 | #include <linux/personality.h> |
| 58 | 58 | ||
| 59 | /* For SOCKET_I */ | 59 | /* For SOCKET_I */ |
| 60 | #include <linux/socket.h> | ||
| 61 | #include <net/sock.h> | 60 | #include <net/sock.h> |
| 62 | #include <net/compat.h> | 61 | #include <net/compat.h> |
| 63 | 62 | ||
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index a2cf955294c1..4352ee4d8dac 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/jiffies.h> | 28 | #include <linux/jiffies.h> |
| 29 | #include <linux/cpufreq.h> | 29 | #include <linux/cpufreq.h> |
| 30 | #include <linux/percpu.h> | 30 | #include <linux/percpu.h> |
| 31 | #include <linux/profile.h> | ||
| 32 | #include <linux/miscdevice.h> | 31 | #include <linux/miscdevice.h> |
| 33 | #include <linux/rtc.h> | 32 | #include <linux/rtc.h> |
| 34 | #include <linux/kernel_stat.h> | 33 | #include <linux/kernel_stat.h> |
| @@ -47,7 +46,6 @@ | |||
| 47 | #include <asm/sections.h> | 46 | #include <asm/sections.h> |
| 48 | #include <asm/cpudata.h> | 47 | #include <asm/cpudata.h> |
| 49 | #include <asm/uaccess.h> | 48 | #include <asm/uaccess.h> |
| 50 | #include <asm/prom.h> | ||
| 51 | #include <asm/irq_regs.h> | 49 | #include <asm/irq_regs.h> |
| 52 | 50 | ||
| 53 | DEFINE_SPINLOCK(mostek_lock); | 51 | DEFINE_SPINLOCK(mostek_lock); |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 18b231810908..df588f0f76e1 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
| @@ -159,20 +159,16 @@ sysenter_do_call: | |||
| 159 | 159 | ||
| 160 | sysenter_tracesys: | 160 | sysenter_tracesys: |
| 161 | CFI_RESTORE_STATE | 161 | CFI_RESTORE_STATE |
| 162 | xchgl %r9d,%ebp | ||
| 162 | SAVE_REST | 163 | SAVE_REST |
| 163 | CLEAR_RREGS | 164 | CLEAR_RREGS |
| 165 | movq %r9,R9(%rsp) | ||
| 164 | movq $-ENOSYS,RAX(%rsp) /* really needed? */ | 166 | movq $-ENOSYS,RAX(%rsp) /* really needed? */ |
| 165 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | 167 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 166 | call syscall_trace_enter | 168 | call syscall_trace_enter |
| 167 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | 169 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ |
| 168 | RESTORE_REST | 170 | RESTORE_REST |
| 169 | movl %ebp, %ebp | 171 | xchgl %ebp,%r9d |
| 170 | /* no need to do an access_ok check here because rbp has been | ||
| 171 | 32bit zero extended */ | ||
| 172 | 1: movl (%rbp),%r9d | ||
| 173 | .section __ex_table,"a" | ||
| 174 | .quad 1b,ia32_badarg | ||
| 175 | .previous | ||
| 176 | jmp sysenter_do_call | 172 | jmp sysenter_do_call |
| 177 | CFI_ENDPROC | 173 | CFI_ENDPROC |
| 178 | ENDPROC(ia32_sysenter_target) | 174 | ENDPROC(ia32_sysenter_target) |
| @@ -262,20 +258,17 @@ cstar_do_call: | |||
| 262 | 258 | ||
| 263 | cstar_tracesys: | 259 | cstar_tracesys: |
| 264 | CFI_RESTORE_STATE | 260 | CFI_RESTORE_STATE |
| 261 | xchgl %r9d,%ebp | ||
| 265 | SAVE_REST | 262 | SAVE_REST |
| 266 | CLEAR_RREGS | 263 | CLEAR_RREGS |
| 264 | movq %r9,R9(%rsp) | ||
| 267 | movq $-ENOSYS,RAX(%rsp) /* really needed? */ | 265 | movq $-ENOSYS,RAX(%rsp) /* really needed? */ |
| 268 | movq %rsp,%rdi /* &pt_regs -> arg1 */ | 266 | movq %rsp,%rdi /* &pt_regs -> arg1 */ |
| 269 | call syscall_trace_enter | 267 | call syscall_trace_enter |
| 270 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ | 268 | LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */ |
| 271 | RESTORE_REST | 269 | RESTORE_REST |
| 270 | xchgl %ebp,%r9d | ||
| 272 | movl RSP-ARGOFFSET(%rsp), %r8d | 271 | movl RSP-ARGOFFSET(%rsp), %r8d |
| 273 | /* no need to do an access_ok check here because r8 has been | ||
| 274 | 32bit zero extended */ | ||
| 275 | 1: movl (%r8),%r9d | ||
| 276 | .section __ex_table,"a" | ||
| 277 | .quad 1b,ia32_badarg | ||
| 278 | .previous | ||
| 279 | jmp cstar_do_call | 272 | jmp cstar_do_call |
| 280 | END(ia32_cstar_target) | 273 | END(ia32_cstar_target) |
| 281 | 274 | ||
diff --git a/arch/x86/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c index f52770ef0ee3..4a233ad6269c 100644 --- a/arch/x86/ia32/ptrace32.c +++ b/arch/x86/ia32/ptrace32.c | |||
| @@ -228,8 +228,6 @@ static long ptrace32_siginfo(unsigned request, u32 pid, u32 addr, u32 data) | |||
| 228 | return ret; | 228 | return ret; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | #define COMPAT_GDT_ENTRY_TLS_MIN 6 | ||
| 232 | |||
| 233 | asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | 231 | asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) |
| 234 | { | 232 | { |
| 235 | struct task_struct *child; | 233 | struct task_struct *child; |
| @@ -248,6 +246,8 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | |||
| 248 | case PTRACE_SYSCALL: | 246 | case PTRACE_SYSCALL: |
| 249 | case PTRACE_OLDSETOPTIONS: | 247 | case PTRACE_OLDSETOPTIONS: |
| 250 | case PTRACE_SETOPTIONS: | 248 | case PTRACE_SETOPTIONS: |
| 249 | case PTRACE_SET_THREAD_AREA: | ||
| 250 | case PTRACE_GET_THREAD_AREA: | ||
| 251 | return sys_ptrace(request, pid, addr, data); | 251 | return sys_ptrace(request, pid, addr, data); |
| 252 | 252 | ||
| 253 | default: | 253 | default: |
| @@ -271,12 +271,6 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | |||
| 271 | case PTRACE_SETSIGINFO: | 271 | case PTRACE_SETSIGINFO: |
| 272 | case PTRACE_GETSIGINFO: | 272 | case PTRACE_GETSIGINFO: |
| 273 | return ptrace32_siginfo(request, pid, addr, data); | 273 | return ptrace32_siginfo(request, pid, addr, data); |
| 274 | |||
| 275 | case PTRACE_SET_THREAD_AREA: | ||
| 276 | case PTRACE_GET_THREAD_AREA: | ||
| 277 | return sys_ptrace(request, pid, | ||
| 278 | addr + GDT_ENTRY_TLS_MIN - COMPAT_GDT_ENTRY_TLS_MIN, | ||
| 279 | data); | ||
| 280 | } | 274 | } |
| 281 | 275 | ||
| 282 | child = ptrace_get_task_struct(pid); | 276 | child = ptrace_get_task_struct(pid); |
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 9abbdf7562c5..3b20613325dc 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
| @@ -139,13 +139,12 @@ struct set_mtrr_data { | |||
| 139 | mtrr_type smp_type; | 139 | mtrr_type smp_type; |
| 140 | }; | 140 | }; |
| 141 | 141 | ||
| 142 | #ifdef CONFIG_SMP | ||
| 143 | |||
| 144 | static void ipi_handler(void *info) | 142 | static void ipi_handler(void *info) |
| 145 | /* [SUMMARY] Synchronisation handler. Executed by "other" CPUs. | 143 | /* [SUMMARY] Synchronisation handler. Executed by "other" CPUs. |
| 146 | [RETURNS] Nothing. | 144 | [RETURNS] Nothing. |
| 147 | */ | 145 | */ |
| 148 | { | 146 | { |
| 147 | #ifdef CONFIG_SMP | ||
| 149 | struct set_mtrr_data *data = info; | 148 | struct set_mtrr_data *data = info; |
| 150 | unsigned long flags; | 149 | unsigned long flags; |
| 151 | 150 | ||
| @@ -168,9 +167,8 @@ static void ipi_handler(void *info) | |||
| 168 | 167 | ||
| 169 | atomic_dec(&data->count); | 168 | atomic_dec(&data->count); |
| 170 | local_irq_restore(flags); | 169 | local_irq_restore(flags); |
| 171 | } | ||
| 172 | |||
| 173 | #endif | 170 | #endif |
| 171 | } | ||
| 174 | 172 | ||
| 175 | static inline int types_compatible(mtrr_type type1, mtrr_type type2) { | 173 | static inline int types_compatible(mtrr_type type1, mtrr_type type2) { |
| 176 | return type1 == MTRR_TYPE_UNCACHABLE || | 174 | return type1 == MTRR_TYPE_UNCACHABLE || |
diff --git a/arch/x86/kernel/i387_64.c b/arch/x86/kernel/i387_64.c index 56c1f1147109..bfaff28fb134 100644 --- a/arch/x86/kernel/i387_64.c +++ b/arch/x86/kernel/i387_64.c | |||
| @@ -92,13 +92,14 @@ int save_i387(struct _fpstate __user *buf) | |||
| 92 | if (task_thread_info(tsk)->status & TS_USEDFPU) { | 92 | if (task_thread_info(tsk)->status & TS_USEDFPU) { |
| 93 | err = save_i387_checking((struct i387_fxsave_struct __user *)buf); | 93 | err = save_i387_checking((struct i387_fxsave_struct __user *)buf); |
| 94 | if (err) return err; | 94 | if (err) return err; |
| 95 | task_thread_info(tsk)->status &= ~TS_USEDFPU; | ||
| 95 | stts(); | 96 | stts(); |
| 96 | } else { | 97 | } else { |
| 97 | if (__copy_to_user(buf, &tsk->thread.i387.fxsave, | 98 | if (__copy_to_user(buf, &tsk->thread.i387.fxsave, |
| 98 | sizeof(struct i387_fxsave_struct))) | 99 | sizeof(struct i387_fxsave_struct))) |
| 99 | return -1; | 100 | return -1; |
| 100 | } | 101 | } |
| 101 | return 1; | 102 | return 1; |
| 102 | } | 103 | } |
| 103 | 104 | ||
| 104 | /* | 105 | /* |
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c index f803ed0ed1c4..600fd404e440 100644 --- a/arch/x86/kernel/nmi_32.c +++ b/arch/x86/kernel/nmi_32.c | |||
| @@ -51,13 +51,13 @@ static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu); | |||
| 51 | 51 | ||
| 52 | static int endflag __initdata = 0; | 52 | static int endflag __initdata = 0; |
| 53 | 53 | ||
| 54 | #ifdef CONFIG_SMP | ||
| 55 | /* The performance counters used by NMI_LOCAL_APIC don't trigger when | 54 | /* The performance counters used by NMI_LOCAL_APIC don't trigger when |
| 56 | * the CPU is idle. To make sure the NMI watchdog really ticks on all | 55 | * the CPU is idle. To make sure the NMI watchdog really ticks on all |
| 57 | * CPUs during the test make them busy. | 56 | * CPUs during the test make them busy. |
| 58 | */ | 57 | */ |
| 59 | static __init void nmi_cpu_busy(void *data) | 58 | static __init void nmi_cpu_busy(void *data) |
| 60 | { | 59 | { |
| 60 | #ifdef CONFIG_SMP | ||
| 61 | local_irq_enable_in_hardirq(); | 61 | local_irq_enable_in_hardirq(); |
| 62 | /* Intentionally don't use cpu_relax here. This is | 62 | /* Intentionally don't use cpu_relax here. This is |
| 63 | to make sure that the performance counter really ticks, | 63 | to make sure that the performance counter really ticks, |
| @@ -67,8 +67,8 @@ static __init void nmi_cpu_busy(void *data) | |||
| 67 | care if they get somewhat less cycles. */ | 67 | care if they get somewhat less cycles. */ |
| 68 | while (endflag == 0) | 68 | while (endflag == 0) |
| 69 | mb(); | 69 | mb(); |
| 70 | } | ||
| 71 | #endif | 70 | #endif |
| 71 | } | ||
| 72 | 72 | ||
| 73 | static int __init check_nmi_watchdog(void) | 73 | static int __init check_nmi_watchdog(void) |
| 74 | { | 74 | { |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index e47a9309eb48..0b4a47905575 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
| @@ -789,6 +789,20 @@ static inline void cfq_slice_expired(struct cfq_data *cfqd, int timed_out) | |||
| 789 | __cfq_slice_expired(cfqd, cfqq, timed_out); | 789 | __cfq_slice_expired(cfqd, cfqq, timed_out); |
| 790 | } | 790 | } |
| 791 | 791 | ||
| 792 | static int start_idle_class_timer(struct cfq_data *cfqd) | ||
| 793 | { | ||
| 794 | unsigned long end = cfqd->last_end_request + CFQ_IDLE_GRACE; | ||
| 795 | unsigned long now = jiffies; | ||
| 796 | |||
| 797 | if (time_before(now, end) && | ||
| 798 | time_after_eq(now, cfqd->last_end_request)) { | ||
| 799 | mod_timer(&cfqd->idle_class_timer, end); | ||
| 800 | return 1; | ||
| 801 | } | ||
| 802 | |||
| 803 | return 0; | ||
| 804 | } | ||
| 805 | |||
| 792 | /* | 806 | /* |
| 793 | * Get next queue for service. Unless we have a queue preemption, | 807 | * Get next queue for service. Unless we have a queue preemption, |
| 794 | * we'll simply select the first cfqq in the service tree. | 808 | * we'll simply select the first cfqq in the service tree. |
| @@ -805,19 +819,14 @@ static struct cfq_queue *cfq_get_next_queue(struct cfq_data *cfqd) | |||
| 805 | cfqq = rb_entry(n, struct cfq_queue, rb_node); | 819 | cfqq = rb_entry(n, struct cfq_queue, rb_node); |
| 806 | 820 | ||
| 807 | if (cfq_class_idle(cfqq)) { | 821 | if (cfq_class_idle(cfqq)) { |
| 808 | unsigned long end; | ||
| 809 | |||
| 810 | /* | 822 | /* |
| 811 | * if we have idle queues and no rt or be queues had | 823 | * if we have idle queues and no rt or be queues had |
| 812 | * pending requests, either allow immediate service if | 824 | * pending requests, either allow immediate service if |
| 813 | * the grace period has passed or arm the idle grace | 825 | * the grace period has passed or arm the idle grace |
| 814 | * timer | 826 | * timer |
| 815 | */ | 827 | */ |
| 816 | end = cfqd->last_end_request + CFQ_IDLE_GRACE; | 828 | if (start_idle_class_timer(cfqd)) |
| 817 | if (time_before(jiffies, end)) { | ||
| 818 | mod_timer(&cfqd->idle_class_timer, end); | ||
| 819 | cfqq = NULL; | 829 | cfqq = NULL; |
| 820 | } | ||
| 821 | } | 830 | } |
| 822 | 831 | ||
| 823 | return cfqq; | 832 | return cfqq; |
| @@ -2036,17 +2045,14 @@ out_cont: | |||
| 2036 | static void cfq_idle_class_timer(unsigned long data) | 2045 | static void cfq_idle_class_timer(unsigned long data) |
| 2037 | { | 2046 | { |
| 2038 | struct cfq_data *cfqd = (struct cfq_data *) data; | 2047 | struct cfq_data *cfqd = (struct cfq_data *) data; |
| 2039 | unsigned long flags, end; | 2048 | unsigned long flags; |
| 2040 | 2049 | ||
| 2041 | spin_lock_irqsave(cfqd->queue->queue_lock, flags); | 2050 | spin_lock_irqsave(cfqd->queue->queue_lock, flags); |
| 2042 | 2051 | ||
| 2043 | /* | 2052 | /* |
| 2044 | * race with a non-idle queue, reset timer | 2053 | * race with a non-idle queue, reset timer |
| 2045 | */ | 2054 | */ |
| 2046 | end = cfqd->last_end_request + CFQ_IDLE_GRACE; | 2055 | if (!start_idle_class_timer(cfqd)) |
| 2047 | if (!time_after_eq(jiffies, end)) | ||
| 2048 | mod_timer(&cfqd->idle_class_timer, end); | ||
| 2049 | else | ||
| 2050 | cfq_schedule_dispatch(cfqd); | 2056 | cfq_schedule_dispatch(cfqd); |
| 2051 | 2057 | ||
| 2052 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); | 2058 | spin_unlock_irqrestore(cfqd->queue->queue_lock, flags); |
| @@ -2068,9 +2074,10 @@ static void cfq_put_async_queues(struct cfq_data *cfqd) | |||
| 2068 | cfq_put_queue(cfqd->async_cfqq[0][i]); | 2074 | cfq_put_queue(cfqd->async_cfqq[0][i]); |
| 2069 | if (cfqd->async_cfqq[1][i]) | 2075 | if (cfqd->async_cfqq[1][i]) |
| 2070 | cfq_put_queue(cfqd->async_cfqq[1][i]); | 2076 | cfq_put_queue(cfqd->async_cfqq[1][i]); |
| 2071 | if (cfqd->async_idle_cfqq) | ||
| 2072 | cfq_put_queue(cfqd->async_idle_cfqq); | ||
| 2073 | } | 2077 | } |
| 2078 | |||
| 2079 | if (cfqd->async_idle_cfqq) | ||
| 2080 | cfq_put_queue(cfqd->async_idle_cfqq); | ||
| 2074 | } | 2081 | } |
| 2075 | 2082 | ||
| 2076 | static void cfq_exit_queue(elevator_t *e) | 2083 | static void cfq_exit_queue(elevator_t *e) |
| @@ -2125,6 +2132,7 @@ static void *cfq_init_queue(struct request_queue *q) | |||
| 2125 | 2132 | ||
| 2126 | INIT_WORK(&cfqd->unplug_work, cfq_kick_queue); | 2133 | INIT_WORK(&cfqd->unplug_work, cfq_kick_queue); |
| 2127 | 2134 | ||
| 2135 | cfqd->last_end_request = jiffies; | ||
| 2128 | cfqd->cfq_quantum = cfq_quantum; | 2136 | cfqd->cfq_quantum = cfq_quantum; |
| 2129 | cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0]; | 2137 | cfqd->cfq_fifo_expire[0] = cfq_fifo_expire[0]; |
| 2130 | cfqd->cfq_fifo_expire[1] = cfq_fifo_expire[1]; | 2138 | cfqd->cfq_fifo_expire[1] = cfq_fifo_expire[1]; |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 75c98d58f4dd..3b927be03850 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
| @@ -1143,22 +1143,9 @@ EXPORT_SYMBOL(blk_queue_start_tag); | |||
| 1143 | void blk_queue_invalidate_tags(struct request_queue *q) | 1143 | void blk_queue_invalidate_tags(struct request_queue *q) |
| 1144 | { | 1144 | { |
| 1145 | struct list_head *tmp, *n; | 1145 | struct list_head *tmp, *n; |
| 1146 | struct request *rq; | ||
| 1147 | |||
| 1148 | list_for_each_safe(tmp, n, &q->tag_busy_list) { | ||
| 1149 | rq = list_entry_rq(tmp); | ||
| 1150 | 1146 | ||
| 1151 | if (rq->tag == -1) { | 1147 | list_for_each_safe(tmp, n, &q->tag_busy_list) |
| 1152 | printk(KERN_ERR | 1148 | blk_requeue_request(q, list_entry_rq(tmp)); |
| 1153 | "%s: bad tag found on list\n", __FUNCTION__); | ||
| 1154 | list_del_init(&rq->queuelist); | ||
| 1155 | rq->cmd_flags &= ~REQ_QUEUED; | ||
| 1156 | } else | ||
| 1157 | blk_queue_end_tag(q, rq); | ||
| 1158 | |||
| 1159 | rq->cmd_flags &= ~REQ_STARTED; | ||
| 1160 | __elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 0); | ||
| 1161 | } | ||
| 1162 | } | 1149 | } |
| 1163 | 1150 | ||
| 1164 | EXPORT_SYMBOL(blk_queue_invalidate_tags); | 1151 | EXPORT_SYMBOL(blk_queue_invalidate_tags); |
| @@ -1634,15 +1621,7 @@ static void blk_backing_dev_unplug(struct backing_dev_info *bdi, | |||
| 1634 | { | 1621 | { |
| 1635 | struct request_queue *q = bdi->unplug_io_data; | 1622 | struct request_queue *q = bdi->unplug_io_data; |
| 1636 | 1623 | ||
| 1637 | /* | 1624 | blk_unplug(q); |
| 1638 | * devices don't necessarily have an ->unplug_fn defined | ||
| 1639 | */ | ||
| 1640 | if (q->unplug_fn) { | ||
| 1641 | blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL, | ||
| 1642 | q->rq.count[READ] + q->rq.count[WRITE]); | ||
| 1643 | |||
| 1644 | q->unplug_fn(q); | ||
| 1645 | } | ||
| 1646 | } | 1625 | } |
| 1647 | 1626 | ||
| 1648 | static void blk_unplug_work(struct work_struct *work) | 1627 | static void blk_unplug_work(struct work_struct *work) |
| @@ -1666,6 +1645,20 @@ static void blk_unplug_timeout(unsigned long data) | |||
| 1666 | kblockd_schedule_work(&q->unplug_work); | 1645 | kblockd_schedule_work(&q->unplug_work); |
| 1667 | } | 1646 | } |
| 1668 | 1647 | ||
| 1648 | void blk_unplug(struct request_queue *q) | ||
| 1649 | { | ||
| 1650 | /* | ||
| 1651 | * devices don't necessarily have an ->unplug_fn defined | ||
| 1652 | */ | ||
| 1653 | if (q->unplug_fn) { | ||
| 1654 | blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL, | ||
| 1655 | q->rq.count[READ] + q->rq.count[WRITE]); | ||
| 1656 | |||
| 1657 | q->unplug_fn(q); | ||
| 1658 | } | ||
| 1659 | } | ||
| 1660 | EXPORT_SYMBOL(blk_unplug); | ||
| 1661 | |||
| 1669 | /** | 1662 | /** |
| 1670 | * blk_start_queue - restart a previously stopped queue | 1663 | * blk_start_queue - restart a previously stopped queue |
| 1671 | * @q: The &struct request_queue in question | 1664 | * @q: The &struct request_queue in question |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index da3a08fa9e4f..ce9dead0f499 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -60,6 +60,7 @@ config ACPI_PROCFS | |||
| 60 | /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) | 60 | /proc/acpi/info (/sys/modules/acpi/parameters/acpica_version) |
| 61 | /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) | 61 | /proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT) |
| 62 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) | 62 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) |
| 63 | /proc/acpi/battery (/sys/class/power_supply) | ||
| 63 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) | 64 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) |
| 64 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) | 65 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) |
| 65 | 66 | ||
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index f08cca21702c..328ce8a08426 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
| @@ -960,6 +960,13 @@ static int piix_broken_suspend(void) | |||
| 960 | }, | 960 | }, |
| 961 | }, | 961 | }, |
| 962 | { | 962 | { |
| 963 | .ident = "Satellite Pro U200", | ||
| 964 | .matches = { | ||
| 965 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
| 966 | DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE PRO U200"), | ||
| 967 | }, | ||
| 968 | }, | ||
| 969 | { | ||
| 963 | .ident = "Satellite U205", | 970 | .ident = "Satellite U205", |
| 964 | .matches = { | 971 | .matches = { |
| 965 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | 972 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index 08a52dd45fb6..545ea865ceb5 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
| @@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm); | |||
| 312 | * | 312 | * |
| 313 | * RETURNS: | 313 | * RETURNS: |
| 314 | * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't | 314 | * Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't |
| 315 | * contain valid data. -errno on other errors. | 315 | * contain valid data. |
| 316 | */ | 316 | */ |
| 317 | static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | 317 | static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, |
| 318 | void **ptr_to_free) | 318 | void **ptr_to_free) |
| @@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
| 339 | ata_dev_printk(dev, KERN_WARNING, | 339 | ata_dev_printk(dev, KERN_WARNING, |
| 340 | "_GTF evaluation failed (AE 0x%x)\n", | 340 | "_GTF evaluation failed (AE 0x%x)\n", |
| 341 | status); | 341 | status); |
| 342 | rc = -EIO; | ||
| 343 | } | 342 | } |
| 344 | goto out_free; | 343 | goto out_free; |
| 345 | } | 344 | } |
| @@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
| 359 | ata_dev_printk(dev, KERN_WARNING, | 358 | ata_dev_printk(dev, KERN_WARNING, |
| 360 | "_GTF unexpected object type 0x%x\n", | 359 | "_GTF unexpected object type 0x%x\n", |
| 361 | out_obj->type); | 360 | out_obj->type); |
| 362 | rc = -EINVAL; | ||
| 363 | goto out_free; | 361 | goto out_free; |
| 364 | } | 362 | } |
| 365 | 363 | ||
| @@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, | |||
| 367 | ata_dev_printk(dev, KERN_WARNING, | 365 | ata_dev_printk(dev, KERN_WARNING, |
| 368 | "unexpected _GTF length (%d)\n", | 366 | "unexpected _GTF length (%d)\n", |
| 369 | out_obj->buffer.length); | 367 | out_obj->buffer.length); |
| 370 | rc = -EINVAL; | ||
| 371 | goto out_free; | 368 | goto out_free; |
| 372 | } | 369 | } |
| 373 | 370 | ||
| @@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev) | |||
| 511 | int gtf_count, i, rc; | 508 | int gtf_count, i, rc; |
| 512 | 509 | ||
| 513 | /* get taskfiles */ | 510 | /* get taskfiles */ |
| 514 | rc = ata_dev_get_GTF(dev, >f, &ptr_to_free); | 511 | gtf_count = ata_dev_get_GTF(dev, >f, &ptr_to_free); |
| 515 | if (rc < 0) | ||
| 516 | return rc; | ||
| 517 | gtf_count = rc; | ||
| 518 | 512 | ||
| 519 | /* execute them */ | 513 | /* execute them */ |
| 520 | for (i = 0, rc = 0; i < gtf_count; i++) { | 514 | for (i = 0, rc = 0; i < gtf_count; i++) { |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index ec3ce120a517..81898036dbca 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -3373,14 +3373,20 @@ void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline) | |||
| 3373 | * to clear 0xff after reset. For example, HHD424020F7SV00 | 3373 | * to clear 0xff after reset. For example, HHD424020F7SV00 |
| 3374 | * iVDR needs >= 800ms while. Quantum GoVault needs even more | 3374 | * iVDR needs >= 800ms while. Quantum GoVault needs even more |
| 3375 | * than that. | 3375 | * than that. |
| 3376 | * | ||
| 3377 | * Note that some PATA controllers (pata_ali) explode if | ||
| 3378 | * status register is read more than once when there's no | ||
| 3379 | * device attached. | ||
| 3376 | */ | 3380 | */ |
| 3377 | while (1) { | 3381 | if (ap->flags & ATA_FLAG_SATA) { |
| 3378 | u8 status = ata_chk_status(ap); | 3382 | while (1) { |
| 3383 | u8 status = ata_chk_status(ap); | ||
| 3379 | 3384 | ||
| 3380 | if (status != 0xff || time_after(jiffies, deadline)) | 3385 | if (status != 0xff || time_after(jiffies, deadline)) |
| 3381 | return; | 3386 | return; |
| 3382 | 3387 | ||
| 3383 | msleep(50); | 3388 | msleep(50); |
| 3389 | } | ||
| 3384 | } | 3390 | } |
| 3385 | } | 3391 | } |
| 3386 | 3392 | ||
| @@ -6821,19 +6827,6 @@ static void ata_host_release(struct device *gendev, void *res) | |||
| 6821 | if (!ap) | 6827 | if (!ap) |
| 6822 | continue; | 6828 | continue; |
| 6823 | 6829 | ||
| 6824 | if ((host->flags & ATA_HOST_STARTED) && ap->ops->port_stop) | ||
| 6825 | ap->ops->port_stop(ap); | ||
| 6826 | } | ||
| 6827 | |||
| 6828 | if ((host->flags & ATA_HOST_STARTED) && host->ops->host_stop) | ||
| 6829 | host->ops->host_stop(host); | ||
| 6830 | |||
| 6831 | for (i = 0; i < host->n_ports; i++) { | ||
| 6832 | struct ata_port *ap = host->ports[i]; | ||
| 6833 | |||
| 6834 | if (!ap) | ||
| 6835 | continue; | ||
| 6836 | |||
| 6837 | if (ap->scsi_host) | 6830 | if (ap->scsi_host) |
| 6838 | scsi_host_put(ap->scsi_host); | 6831 | scsi_host_put(ap->scsi_host); |
| 6839 | 6832 | ||
| @@ -6960,6 +6953,24 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, | |||
| 6960 | return host; | 6953 | return host; |
| 6961 | } | 6954 | } |
| 6962 | 6955 | ||
| 6956 | static void ata_host_stop(struct device *gendev, void *res) | ||
| 6957 | { | ||
| 6958 | struct ata_host *host = dev_get_drvdata(gendev); | ||
| 6959 | int i; | ||
| 6960 | |||
| 6961 | WARN_ON(!(host->flags & ATA_HOST_STARTED)); | ||
| 6962 | |||
| 6963 | for (i = 0; i < host->n_ports; i++) { | ||
| 6964 | struct ata_port *ap = host->ports[i]; | ||
| 6965 | |||
| 6966 | if (ap->ops->port_stop) | ||
| 6967 | ap->ops->port_stop(ap); | ||
| 6968 | } | ||
| 6969 | |||
| 6970 | if (host->ops->host_stop) | ||
| 6971 | host->ops->host_stop(host); | ||
| 6972 | } | ||
| 6973 | |||
| 6963 | /** | 6974 | /** |
| 6964 | * ata_host_start - start and freeze ports of an ATA host | 6975 | * ata_host_start - start and freeze ports of an ATA host |
| 6965 | * @host: ATA host to start ports for | 6976 | * @host: ATA host to start ports for |
| @@ -6978,6 +6989,8 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev, | |||
| 6978 | */ | 6989 | */ |
| 6979 | int ata_host_start(struct ata_host *host) | 6990 | int ata_host_start(struct ata_host *host) |
| 6980 | { | 6991 | { |
| 6992 | int have_stop = 0; | ||
| 6993 | void *start_dr = NULL; | ||
| 6981 | int i, rc; | 6994 | int i, rc; |
| 6982 | 6995 | ||
| 6983 | if (host->flags & ATA_HOST_STARTED) | 6996 | if (host->flags & ATA_HOST_STARTED) |
| @@ -6989,6 +7002,22 @@ int ata_host_start(struct ata_host *host) | |||
| 6989 | if (!host->ops && !ata_port_is_dummy(ap)) | 7002 | if (!host->ops && !ata_port_is_dummy(ap)) |
| 6990 | host->ops = ap->ops; | 7003 | host->ops = ap->ops; |
| 6991 | 7004 | ||
| 7005 | if (ap->ops->port_stop) | ||
| 7006 | have_stop = 1; | ||
| 7007 | } | ||
| 7008 | |||
| 7009 | if (host->ops->host_stop) | ||
| 7010 | have_stop = 1; | ||
| 7011 | |||
| 7012 | if (have_stop) { | ||
| 7013 | start_dr = devres_alloc(ata_host_stop, 0, GFP_KERNEL); | ||
| 7014 | if (!start_dr) | ||
| 7015 | return -ENOMEM; | ||
| 7016 | } | ||
| 7017 | |||
| 7018 | for (i = 0; i < host->n_ports; i++) { | ||
| 7019 | struct ata_port *ap = host->ports[i]; | ||
| 7020 | |||
| 6992 | if (ap->ops->port_start) { | 7021 | if (ap->ops->port_start) { |
| 6993 | rc = ap->ops->port_start(ap); | 7022 | rc = ap->ops->port_start(ap); |
| 6994 | if (rc) { | 7023 | if (rc) { |
| @@ -7001,6 +7030,8 @@ int ata_host_start(struct ata_host *host) | |||
| 7001 | ata_eh_freeze_port(ap); | 7030 | ata_eh_freeze_port(ap); |
| 7002 | } | 7031 | } |
| 7003 | 7032 | ||
| 7033 | if (start_dr) | ||
| 7034 | devres_add(host->dev, start_dr); | ||
| 7004 | host->flags |= ATA_HOST_STARTED; | 7035 | host->flags |= ATA_HOST_STARTED; |
| 7005 | return 0; | 7036 | return 0; |
| 7006 | 7037 | ||
| @@ -7011,6 +7042,7 @@ int ata_host_start(struct ata_host *host) | |||
| 7011 | if (ap->ops->port_stop) | 7042 | if (ap->ops->port_stop) |
| 7012 | ap->ops->port_stop(ap); | 7043 | ap->ops->port_stop(ap); |
| 7013 | } | 7044 | } |
| 7045 | devres_free(start_dr); | ||
| 7014 | return rc; | 7046 | return rc; |
| 7015 | } | 7047 | } |
| 7016 | 7048 | ||
| @@ -7178,6 +7210,10 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht) | |||
| 7178 | * request IRQ and register it. This helper takes necessasry | 7210 | * request IRQ and register it. This helper takes necessasry |
| 7179 | * arguments and performs the three steps in one go. | 7211 | * arguments and performs the three steps in one go. |
| 7180 | * | 7212 | * |
| 7213 | * An invalid IRQ skips the IRQ registration and expects the host to | ||
| 7214 | * have set polling mode on the port. In this case, @irq_handler | ||
| 7215 | * should be NULL. | ||
| 7216 | * | ||
| 7181 | * LOCKING: | 7217 | * LOCKING: |
| 7182 | * Inherited from calling layer (may sleep). | 7218 | * Inherited from calling layer (may sleep). |
| 7183 | * | 7219 | * |
| @@ -7194,6 +7230,12 @@ int ata_host_activate(struct ata_host *host, int irq, | |||
| 7194 | if (rc) | 7230 | if (rc) |
| 7195 | return rc; | 7231 | return rc; |
| 7196 | 7232 | ||
| 7233 | /* Special case for polling mode */ | ||
| 7234 | if (!irq) { | ||
| 7235 | WARN_ON(irq_handler); | ||
| 7236 | return ata_host_register(host, sht); | ||
| 7237 | } | ||
| 7238 | |||
| 7197 | rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags, | 7239 | rc = devm_request_irq(host->dev, irq, irq_handler, irq_flags, |
| 7198 | dev_driver_string(host->dev), host); | 7240 | dev_driver_string(host->dev), host); |
| 7199 | if (rc) | 7241 | if (rc) |
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c index fc72a965643d..ac03a90a6168 100644 --- a/drivers/ata/pata_platform.c +++ b/drivers/ata/pata_platform.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Generic platform device PATA driver | 2 | * Generic platform device PATA driver |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2006 Paul Mundt | 4 | * Copyright (C) 2006 - 2007 Paul Mundt |
| 5 | * | 5 | * |
| 6 | * Based on pata_pcmcia: | 6 | * Based on pata_pcmcia: |
| 7 | * | 7 | * |
| @@ -22,7 +22,7 @@ | |||
| 22 | #include <linux/pata_platform.h> | 22 | #include <linux/pata_platform.h> |
| 23 | 23 | ||
| 24 | #define DRV_NAME "pata_platform" | 24 | #define DRV_NAME "pata_platform" |
| 25 | #define DRV_VERSION "1.1" | 25 | #define DRV_VERSION "1.2" |
| 26 | 26 | ||
| 27 | static int pio_mask = 1; | 27 | static int pio_mask = 1; |
| 28 | 28 | ||
| @@ -120,15 +120,20 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr, | |||
| 120 | * Register a platform bus IDE interface. Such interfaces are PIO and we | 120 | * Register a platform bus IDE interface. Such interfaces are PIO and we |
| 121 | * assume do not support IRQ sharing. | 121 | * assume do not support IRQ sharing. |
| 122 | * | 122 | * |
| 123 | * Platform devices are expected to contain 3 resources per port: | 123 | * Platform devices are expected to contain at least 2 resources per port: |
| 124 | * | 124 | * |
| 125 | * - I/O Base (IORESOURCE_IO or IORESOURCE_MEM) | 125 | * - I/O Base (IORESOURCE_IO or IORESOURCE_MEM) |
| 126 | * - CTL Base (IORESOURCE_IO or IORESOURCE_MEM) | 126 | * - CTL Base (IORESOURCE_IO or IORESOURCE_MEM) |
| 127 | * | ||
| 128 | * and optionally: | ||
| 129 | * | ||
| 127 | * - IRQ (IORESOURCE_IRQ) | 130 | * - IRQ (IORESOURCE_IRQ) |
| 128 | * | 131 | * |
| 129 | * If the base resources are both mem types, the ioremap() is handled | 132 | * If the base resources are both mem types, the ioremap() is handled |
| 130 | * here. For IORESOURCE_IO, it's assumed that there's no remapping | 133 | * here. For IORESOURCE_IO, it's assumed that there's no remapping |
| 131 | * necessary. | 134 | * necessary. |
| 135 | * | ||
| 136 | * If no IRQ resource is present, PIO polling mode is used instead. | ||
| 132 | */ | 137 | */ |
| 133 | static int __devinit pata_platform_probe(struct platform_device *pdev) | 138 | static int __devinit pata_platform_probe(struct platform_device *pdev) |
| 134 | { | 139 | { |
| @@ -137,11 +142,12 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
| 137 | struct ata_port *ap; | 142 | struct ata_port *ap; |
| 138 | struct pata_platform_info *pp_info; | 143 | struct pata_platform_info *pp_info; |
| 139 | unsigned int mmio; | 144 | unsigned int mmio; |
| 145 | int irq; | ||
| 140 | 146 | ||
| 141 | /* | 147 | /* |
| 142 | * Simple resource validation .. | 148 | * Simple resource validation .. |
| 143 | */ | 149 | */ |
| 144 | if (unlikely(pdev->num_resources != 3)) { | 150 | if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) { |
| 145 | dev_err(&pdev->dev, "invalid number of resources\n"); | 151 | dev_err(&pdev->dev, "invalid number of resources\n"); |
| 146 | return -EINVAL; | 152 | return -EINVAL; |
| 147 | } | 153 | } |
| @@ -173,6 +179,13 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
| 173 | (ctl_res->flags == IORESOURCE_MEM)); | 179 | (ctl_res->flags == IORESOURCE_MEM)); |
| 174 | 180 | ||
| 175 | /* | 181 | /* |
| 182 | * And the IRQ | ||
| 183 | */ | ||
| 184 | irq = platform_get_irq(pdev, 0); | ||
| 185 | if (irq < 0) | ||
| 186 | irq = 0; /* no irq */ | ||
| 187 | |||
| 188 | /* | ||
| 176 | * Now that that's out of the way, wire up the port.. | 189 | * Now that that's out of the way, wire up the port.. |
| 177 | */ | 190 | */ |
| 178 | host = ata_host_alloc(&pdev->dev, 1); | 191 | host = ata_host_alloc(&pdev->dev, 1); |
| @@ -185,6 +198,14 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
| 185 | ap->flags |= ATA_FLAG_SLAVE_POSS; | 198 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
| 186 | 199 | ||
| 187 | /* | 200 | /* |
| 201 | * Use polling mode if there's no IRQ | ||
| 202 | */ | ||
| 203 | if (!irq) { | ||
| 204 | ap->flags |= ATA_FLAG_PIO_POLLING; | ||
| 205 | ata_port_desc(ap, "no IRQ, using PIO polling"); | ||
| 206 | } | ||
| 207 | |||
| 208 | /* | ||
| 188 | * Handle the MMIO case | 209 | * Handle the MMIO case |
| 189 | */ | 210 | */ |
| 190 | if (mmio) { | 211 | if (mmio) { |
| @@ -213,9 +234,9 @@ static int __devinit pata_platform_probe(struct platform_device *pdev) | |||
| 213 | (unsigned long long)ctl_res->start); | 234 | (unsigned long long)ctl_res->start); |
| 214 | 235 | ||
| 215 | /* activate */ | 236 | /* activate */ |
| 216 | return ata_host_activate(host, platform_get_irq(pdev, 0), | 237 | return ata_host_activate(host, irq, irq ? ata_interrupt : NULL, |
| 217 | ata_interrupt, pp_info ? pp_info->irq_flags | 238 | pp_info ? pp_info->irq_flags : 0, |
| 218 | : 0, &pata_platform_sht); | 239 | &pata_platform_sht); |
| 219 | } | 240 | } |
| 220 | 241 | ||
| 221 | /** | 242 | /** |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 35b2df297527..44f9e5d9e362 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
| @@ -1629,7 +1629,7 @@ static int nv_hardreset(struct ata_link *link, unsigned int *class, | |||
| 1629 | 1629 | ||
| 1630 | /* SATA hardreset fails to retrieve proper device signature on | 1630 | /* SATA hardreset fails to retrieve proper device signature on |
| 1631 | * some controllers. Don't classify on hardreset. For more | 1631 | * some controllers. Don't classify on hardreset. For more |
| 1632 | * info, see http://bugme.osdl.org/show_bug.cgi?id=3352 | 1632 | * info, see http://bugzilla.kernel.org/show_bug.cgi?id=3352 |
| 1633 | */ | 1633 | */ |
| 1634 | return sata_std_hardreset(link, &dummy, deadline); | 1634 | return sata_std_hardreset(link, &dummy, deadline); |
| 1635 | } | 1635 | } |
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c index 6d43ba79e154..2f1de6ec044c 100644 --- a/drivers/ata/sata_qstor.c +++ b/drivers/ata/sata_qstor.c | |||
| @@ -103,7 +103,7 @@ enum { | |||
| 103 | QS_DMA_BOUNDARY = ~0UL | 103 | QS_DMA_BOUNDARY = ~0UL |
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t; | 106 | typedef enum { qs_state_mmio, qs_state_pkt } qs_state_t; |
| 107 | 107 | ||
| 108 | struct qs_port_priv { | 108 | struct qs_port_priv { |
| 109 | u8 *pkt; | 109 | u8 *pkt; |
| @@ -116,14 +116,15 @@ static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val); | |||
| 116 | static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 116 | static int qs_ata_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
| 117 | static int qs_port_start(struct ata_port *ap); | 117 | static int qs_port_start(struct ata_port *ap); |
| 118 | static void qs_host_stop(struct ata_host *host); | 118 | static void qs_host_stop(struct ata_host *host); |
| 119 | static void qs_phy_reset(struct ata_port *ap); | ||
| 120 | static void qs_qc_prep(struct ata_queued_cmd *qc); | 119 | static void qs_qc_prep(struct ata_queued_cmd *qc); |
| 121 | static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); | 120 | static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); |
| 122 | static int qs_check_atapi_dma(struct ata_queued_cmd *qc); | 121 | static int qs_check_atapi_dma(struct ata_queued_cmd *qc); |
| 123 | static void qs_bmdma_stop(struct ata_queued_cmd *qc); | 122 | static void qs_bmdma_stop(struct ata_queued_cmd *qc); |
| 124 | static u8 qs_bmdma_status(struct ata_port *ap); | 123 | static u8 qs_bmdma_status(struct ata_port *ap); |
| 125 | static void qs_irq_clear(struct ata_port *ap); | 124 | static void qs_irq_clear(struct ata_port *ap); |
| 126 | static void qs_eng_timeout(struct ata_port *ap); | 125 | static void qs_freeze(struct ata_port *ap); |
| 126 | static void qs_thaw(struct ata_port *ap); | ||
| 127 | static void qs_error_handler(struct ata_port *ap); | ||
| 127 | 128 | ||
| 128 | static struct scsi_host_template qs_ata_sht = { | 129 | static struct scsi_host_template qs_ata_sht = { |
| 129 | .module = THIS_MODULE, | 130 | .module = THIS_MODULE, |
| @@ -150,11 +151,12 @@ static const struct ata_port_operations qs_ata_ops = { | |||
| 150 | .check_atapi_dma = qs_check_atapi_dma, | 151 | .check_atapi_dma = qs_check_atapi_dma, |
| 151 | .exec_command = ata_exec_command, | 152 | .exec_command = ata_exec_command, |
| 152 | .dev_select = ata_std_dev_select, | 153 | .dev_select = ata_std_dev_select, |
| 153 | .phy_reset = qs_phy_reset, | ||
| 154 | .qc_prep = qs_qc_prep, | 154 | .qc_prep = qs_qc_prep, |
| 155 | .qc_issue = qs_qc_issue, | 155 | .qc_issue = qs_qc_issue, |
| 156 | .data_xfer = ata_data_xfer, | 156 | .data_xfer = ata_data_xfer, |
| 157 | .eng_timeout = qs_eng_timeout, | 157 | .freeze = qs_freeze, |
| 158 | .thaw = qs_thaw, | ||
| 159 | .error_handler = qs_error_handler, | ||
| 158 | .irq_clear = qs_irq_clear, | 160 | .irq_clear = qs_irq_clear, |
| 159 | .irq_on = ata_irq_on, | 161 | .irq_on = ata_irq_on, |
| 160 | .scr_read = qs_scr_read, | 162 | .scr_read = qs_scr_read, |
| @@ -169,8 +171,6 @@ static const struct ata_port_info qs_port_info[] = { | |||
| 169 | /* board_2068_idx */ | 171 | /* board_2068_idx */ |
| 170 | { | 172 | { |
| 171 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | | 173 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | |
| 172 | ATA_FLAG_SATA_RESET | | ||
| 173 | //FIXME ATA_FLAG_SRST | | ||
| 174 | ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING, | 174 | ATA_FLAG_MMIO | ATA_FLAG_PIO_POLLING, |
| 175 | .pio_mask = 0x10, /* pio4 */ | 175 | .pio_mask = 0x10, /* pio4 */ |
| 176 | .udma_mask = ATA_UDMA6, | 176 | .udma_mask = ATA_UDMA6, |
| @@ -219,7 +219,9 @@ static void qs_irq_clear(struct ata_port *ap) | |||
| 219 | static inline void qs_enter_reg_mode(struct ata_port *ap) | 219 | static inline void qs_enter_reg_mode(struct ata_port *ap) |
| 220 | { | 220 | { |
| 221 | u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000); | 221 | u8 __iomem *chan = qs_mmio_base(ap->host) + (ap->port_no * 0x4000); |
| 222 | struct qs_port_priv *pp = ap->private_data; | ||
| 222 | 223 | ||
| 224 | pp->state = qs_state_mmio; | ||
| 223 | writeb(QS_CTR0_REG, chan + QS_CCT_CTR0); | 225 | writeb(QS_CTR0_REG, chan + QS_CCT_CTR0); |
| 224 | readb(chan + QS_CCT_CTR0); /* flush */ | 226 | readb(chan + QS_CCT_CTR0); /* flush */ |
| 225 | } | 227 | } |
| @@ -233,23 +235,28 @@ static inline void qs_reset_channel_logic(struct ata_port *ap) | |||
| 233 | qs_enter_reg_mode(ap); | 235 | qs_enter_reg_mode(ap); |
| 234 | } | 236 | } |
| 235 | 237 | ||
| 236 | static void qs_phy_reset(struct ata_port *ap) | 238 | static void qs_freeze(struct ata_port *ap) |
| 237 | { | 239 | { |
| 238 | struct qs_port_priv *pp = ap->private_data; | 240 | u8 __iomem *mmio_base = qs_mmio_base(ap->host); |
| 239 | 241 | ||
| 240 | pp->state = qs_state_idle; | 242 | writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */ |
| 241 | qs_reset_channel_logic(ap); | 243 | qs_enter_reg_mode(ap); |
| 242 | sata_phy_reset(ap); | ||
| 243 | } | 244 | } |
| 244 | 245 | ||
| 245 | static void qs_eng_timeout(struct ata_port *ap) | 246 | static void qs_thaw(struct ata_port *ap) |
| 246 | { | 247 | { |
| 247 | struct qs_port_priv *pp = ap->private_data; | 248 | u8 __iomem *mmio_base = qs_mmio_base(ap->host); |
| 249 | |||
| 250 | qs_enter_reg_mode(ap); | ||
| 251 | writeb(1, mmio_base + QS_HCT_CTRL); /* enable host interrupts */ | ||
| 252 | } | ||
| 253 | |||
| 254 | static int qs_prereset(struct ata_link *link, unsigned long deadline) | ||
| 255 | { | ||
| 256 | struct ata_port *ap = link->ap; | ||
| 248 | 257 | ||
| 249 | if (pp->state != qs_state_idle) /* healthy paranoia */ | ||
| 250 | pp->state = qs_state_mmio; | ||
| 251 | qs_reset_channel_logic(ap); | 258 | qs_reset_channel_logic(ap); |
| 252 | ata_eng_timeout(ap); | 259 | return ata_std_prereset(link, deadline); |
| 253 | } | 260 | } |
| 254 | 261 | ||
| 255 | static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | 262 | static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) |
| @@ -260,6 +267,13 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val) | |||
| 260 | return 0; | 267 | return 0; |
| 261 | } | 268 | } |
| 262 | 269 | ||
| 270 | static void qs_error_handler(struct ata_port *ap) | ||
| 271 | { | ||
| 272 | qs_enter_reg_mode(ap); | ||
| 273 | ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL, | ||
| 274 | ata_std_postreset); | ||
| 275 | } | ||
| 276 | |||
| 263 | static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) | 277 | static int qs_scr_write(struct ata_port *ap, unsigned int sc_reg, u32 val) |
| 264 | { | 278 | { |
| 265 | if (sc_reg > SCR_CONTROL) | 279 | if (sc_reg > SCR_CONTROL) |
| @@ -358,7 +372,6 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc) | |||
| 358 | 372 | ||
| 359 | switch (qc->tf.protocol) { | 373 | switch (qc->tf.protocol) { |
| 360 | case ATA_PROT_DMA: | 374 | case ATA_PROT_DMA: |
| 361 | |||
| 362 | pp->state = qs_state_pkt; | 375 | pp->state = qs_state_pkt; |
| 363 | qs_packet_start(qc); | 376 | qs_packet_start(qc); |
| 364 | return 0; | 377 | return 0; |
| @@ -375,6 +388,26 @@ static unsigned int qs_qc_issue(struct ata_queued_cmd *qc) | |||
| 375 | return ata_qc_issue_prot(qc); | 388 | return ata_qc_issue_prot(qc); |
| 376 | } | 389 | } |
| 377 | 390 | ||
| 391 | static void qs_do_or_die(struct ata_queued_cmd *qc, u8 status) | ||
| 392 | { | ||
| 393 | qc->err_mask |= ac_err_mask(status); | ||
| 394 | |||
| 395 | if (!qc->err_mask) { | ||
| 396 | ata_qc_complete(qc); | ||
| 397 | } else { | ||
| 398 | struct ata_port *ap = qc->ap; | ||
| 399 | struct ata_eh_info *ehi = &ap->link.eh_info; | ||
| 400 | |||
| 401 | ata_ehi_clear_desc(ehi); | ||
| 402 | ata_ehi_push_desc(ehi, "status 0x%02X", status); | ||
| 403 | |||
| 404 | if (qc->err_mask == AC_ERR_DEV) | ||
| 405 | ata_port_abort(ap); | ||
| 406 | else | ||
| 407 | ata_port_freeze(ap); | ||
| 408 | } | ||
| 409 | } | ||
| 410 | |||
| 378 | static inline unsigned int qs_intr_pkt(struct ata_host *host) | 411 | static inline unsigned int qs_intr_pkt(struct ata_host *host) |
| 379 | { | 412 | { |
| 380 | unsigned int handled = 0; | 413 | unsigned int handled = 0; |
| @@ -406,10 +439,8 @@ static inline unsigned int qs_intr_pkt(struct ata_host *host) | |||
| 406 | switch (sHST) { | 439 | switch (sHST) { |
| 407 | case 0: /* successful CPB */ | 440 | case 0: /* successful CPB */ |
| 408 | case 3: /* device error */ | 441 | case 3: /* device error */ |
| 409 | pp->state = qs_state_idle; | ||
| 410 | qs_enter_reg_mode(qc->ap); | 442 | qs_enter_reg_mode(qc->ap); |
| 411 | qc->err_mask |= ac_err_mask(sDST); | 443 | qs_do_or_die(qc, sDST); |
| 412 | ata_qc_complete(qc); | ||
| 413 | break; | 444 | break; |
| 414 | default: | 445 | default: |
| 415 | break; | 446 | break; |
| @@ -431,25 +462,27 @@ static inline unsigned int qs_intr_mmio(struct ata_host *host) | |||
| 431 | if (ap && | 462 | if (ap && |
| 432 | !(ap->flags & ATA_FLAG_DISABLED)) { | 463 | !(ap->flags & ATA_FLAG_DISABLED)) { |
| 433 | struct ata_queued_cmd *qc; | 464 | struct ata_queued_cmd *qc; |
| 434 | struct qs_port_priv *pp = ap->private_data; | 465 | struct qs_port_priv *pp; |
| 435 | if (!pp || pp->state != qs_state_mmio) | ||
| 436 | continue; | ||
| 437 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 466 | qc = ata_qc_from_tag(ap, ap->link.active_tag); |
| 438 | if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { | 467 | if (!qc || !(qc->flags & ATA_QCFLAG_ACTIVE)) { |
| 439 | 468 | /* | |
| 440 | /* check main status, clearing INTRQ */ | 469 | * The qstor hardware generates spurious |
| 441 | u8 status = ata_check_status(ap); | 470 | * interrupts from time to time when switching |
| 442 | if ((status & ATA_BUSY)) | 471 | * in and out of packet mode. |
| 443 | continue; | 472 | * There's no obvious way to know if we're |
| 444 | DPRINTK("ata%u: protocol %d (dev_stat 0x%X)\n", | 473 | * here now due to that, so just ack the irq |
| 445 | ap->print_id, qc->tf.protocol, status); | 474 | * and pretend we knew it was ours.. (ugh). |
| 446 | 475 | * This does not affect packet mode. | |
| 447 | /* complete taskfile transaction */ | 476 | */ |
| 448 | pp->state = qs_state_idle; | 477 | ata_check_status(ap); |
| 449 | qc->err_mask |= ac_err_mask(status); | ||
| 450 | ata_qc_complete(qc); | ||
| 451 | handled = 1; | 478 | handled = 1; |
| 479 | continue; | ||
| 452 | } | 480 | } |
| 481 | pp = ap->private_data; | ||
| 482 | if (!pp || pp->state != qs_state_mmio) | ||
| 483 | continue; | ||
| 484 | if (!(qc->tf.flags & ATA_TFLAG_POLLING)) | ||
| 485 | handled |= ata_host_intr(ap, qc); | ||
| 453 | } | 486 | } |
| 454 | } | 487 | } |
| 455 | return handled; | 488 | return handled; |
| @@ -459,12 +492,13 @@ static irqreturn_t qs_intr(int irq, void *dev_instance) | |||
| 459 | { | 492 | { |
| 460 | struct ata_host *host = dev_instance; | 493 | struct ata_host *host = dev_instance; |
| 461 | unsigned int handled = 0; | 494 | unsigned int handled = 0; |
| 495 | unsigned long flags; | ||
| 462 | 496 | ||
| 463 | VPRINTK("ENTER\n"); | 497 | VPRINTK("ENTER\n"); |
| 464 | 498 | ||
| 465 | spin_lock(&host->lock); | 499 | spin_lock_irqsave(&host->lock, flags); |
| 466 | handled = qs_intr_pkt(host) | qs_intr_mmio(host); | 500 | handled = qs_intr_pkt(host) | qs_intr_mmio(host); |
| 467 | spin_unlock(&host->lock); | 501 | spin_unlock_irqrestore(&host->lock, flags); |
| 468 | 502 | ||
| 469 | VPRINTK("EXIT\n"); | 503 | VPRINTK("EXIT\n"); |
| 470 | 504 | ||
| @@ -501,7 +535,6 @@ static int qs_port_start(struct ata_port *ap) | |||
| 501 | rc = ata_port_start(ap); | 535 | rc = ata_port_start(ap); |
| 502 | if (rc) | 536 | if (rc) |
| 503 | return rc; | 537 | return rc; |
| 504 | qs_enter_reg_mode(ap); | ||
| 505 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); | 538 | pp = devm_kzalloc(dev, sizeof(*pp), GFP_KERNEL); |
| 506 | if (!pp) | 539 | if (!pp) |
| 507 | return -ENOMEM; | 540 | return -ENOMEM; |
| @@ -512,6 +545,7 @@ static int qs_port_start(struct ata_port *ap) | |||
| 512 | memset(pp->pkt, 0, QS_PKT_BYTES); | 545 | memset(pp->pkt, 0, QS_PKT_BYTES); |
| 513 | ap->private_data = pp; | 546 | ap->private_data = pp; |
| 514 | 547 | ||
| 548 | qs_enter_reg_mode(ap); | ||
| 515 | addr = (u64)pp->pkt_dma; | 549 | addr = (u64)pp->pkt_dma; |
| 516 | writel((u32) addr, chan + QS_CCF_CPBA); | 550 | writel((u32) addr, chan + QS_CCF_CPBA); |
| 517 | writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4); | 551 | writel((u32)(addr >> 32), chan + QS_CCF_CPBA + 4); |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index a8130a4ad6d4..a5ee21319d37 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
| @@ -358,10 +358,19 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf, | |||
| 358 | size_t count) | 358 | size_t count) |
| 359 | { | 359 | { |
| 360 | unsigned int major, minor; | 360 | unsigned int major, minor; |
| 361 | |||
| 361 | if (sscanf(buf, "%u:%u", &major, &minor) == 2) { | 362 | if (sscanf(buf, "%u:%u", &major, &minor) == 2) { |
| 363 | /* pkt_setup_dev() expects caller to hold reference to self */ | ||
| 364 | if (!try_module_get(THIS_MODULE)) | ||
| 365 | return -ENODEV; | ||
| 366 | |||
| 362 | pkt_setup_dev(MKDEV(major, minor), NULL); | 367 | pkt_setup_dev(MKDEV(major, minor), NULL); |
| 368 | |||
| 369 | module_put(THIS_MODULE); | ||
| 370 | |||
| 363 | return count; | 371 | return count; |
| 364 | } | 372 | } |
| 373 | |||
| 365 | return -EINVAL; | 374 | return -EINVAL; |
| 366 | } | 375 | } |
| 367 | 376 | ||
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 7a003504c265..1bdd2bf4f37d 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
| @@ -730,13 +730,23 @@ static int send_prio_char(struct tty_struct *tty, char ch) | |||
| 730 | return 0; | 730 | return 0; |
| 731 | } | 731 | } |
| 732 | 732 | ||
| 733 | int n_tty_ioctl(struct tty_struct * tty, struct file * file, | 733 | /** |
| 734 | unsigned int cmd, unsigned long arg) | 734 | * tty_mode_ioctl - mode related ioctls |
| 735 | * @tty: tty for the ioctl | ||
| 736 | * @file: file pointer for the tty | ||
| 737 | * @cmd: command | ||
| 738 | * @arg: ioctl argument | ||
| 739 | * | ||
| 740 | * Perform non line discipline specific mode control ioctls. This | ||
| 741 | * is designed to be called by line disciplines to ensure they provide | ||
| 742 | * consistent mode setting. | ||
| 743 | */ | ||
| 744 | |||
| 745 | int tty_mode_ioctl(struct tty_struct * tty, struct file *file, | ||
| 746 | unsigned int cmd, unsigned long arg) | ||
| 735 | { | 747 | { |
| 736 | struct tty_struct * real_tty; | 748 | struct tty_struct * real_tty; |
| 737 | void __user *p = (void __user *)arg; | 749 | void __user *p = (void __user *)arg; |
| 738 | int retval; | ||
| 739 | struct tty_ldisc *ld; | ||
| 740 | 750 | ||
| 741 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && | 751 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && |
| 742 | tty->driver->subtype == PTY_TYPE_MASTER) | 752 | tty->driver->subtype == PTY_TYPE_MASTER) |
| @@ -799,6 +809,93 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, | |||
| 799 | return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO); | 809 | return set_termios(real_tty, p, TERMIOS_WAIT | TERMIOS_TERMIO); |
| 800 | case TCSETA: | 810 | case TCSETA: |
| 801 | return set_termios(real_tty, p, TERMIOS_TERMIO); | 811 | return set_termios(real_tty, p, TERMIOS_TERMIO); |
| 812 | #ifndef TCGETS2 | ||
| 813 | case TIOCGLCKTRMIOS: | ||
| 814 | if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) | ||
| 815 | return -EFAULT; | ||
| 816 | return 0; | ||
| 817 | |||
| 818 | case TIOCSLCKTRMIOS: | ||
| 819 | if (!capable(CAP_SYS_ADMIN)) | ||
| 820 | return -EPERM; | ||
| 821 | if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) | ||
| 822 | return -EFAULT; | ||
| 823 | return 0; | ||
| 824 | #else | ||
| 825 | case TIOCGLCKTRMIOS: | ||
| 826 | if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) | ||
| 827 | return -EFAULT; | ||
| 828 | return 0; | ||
| 829 | |||
| 830 | case TIOCSLCKTRMIOS: | ||
| 831 | if (!capable(CAP_SYS_ADMIN)) | ||
| 832 | return -EPERM; | ||
| 833 | if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) | ||
| 834 | return -EFAULT; | ||
| 835 | return 0; | ||
| 836 | #endif | ||
| 837 | case TIOCGSOFTCAR: | ||
| 838 | return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg); | ||
| 839 | case TIOCSSOFTCAR: | ||
| 840 | if (get_user(arg, (unsigned int __user *) arg)) | ||
| 841 | return -EFAULT; | ||
| 842 | mutex_lock(&tty->termios_mutex); | ||
| 843 | tty->termios->c_cflag = | ||
| 844 | ((tty->termios->c_cflag & ~CLOCAL) | | ||
| 845 | (arg ? CLOCAL : 0)); | ||
| 846 | mutex_unlock(&tty->termios_mutex); | ||
| 847 | return 0; | ||
| 848 | default: | ||
| 849 | return -ENOIOCTLCMD; | ||
| 850 | } | ||
| 851 | } | ||
| 852 | |||
| 853 | EXPORT_SYMBOL_GPL(tty_mode_ioctl); | ||
| 854 | |||
| 855 | int tty_perform_flush(struct tty_struct *tty, unsigned long arg) | ||
| 856 | { | ||
| 857 | struct tty_ldisc *ld; | ||
| 858 | int retval = tty_check_change(tty); | ||
| 859 | if (retval) | ||
| 860 | return retval; | ||
| 861 | |||
| 862 | ld = tty_ldisc_ref(tty); | ||
| 863 | switch (arg) { | ||
| 864 | case TCIFLUSH: | ||
| 865 | if (ld && ld->flush_buffer) | ||
| 866 | ld->flush_buffer(tty); | ||
| 867 | break; | ||
| 868 | case TCIOFLUSH: | ||
| 869 | if (ld && ld->flush_buffer) | ||
| 870 | ld->flush_buffer(tty); | ||
| 871 | /* fall through */ | ||
| 872 | case TCOFLUSH: | ||
| 873 | if (tty->driver->flush_buffer) | ||
| 874 | tty->driver->flush_buffer(tty); | ||
| 875 | break; | ||
| 876 | default: | ||
| 877 | tty_ldisc_deref(ld); | ||
| 878 | return -EINVAL; | ||
| 879 | } | ||
| 880 | tty_ldisc_deref(ld); | ||
| 881 | return 0; | ||
| 882 | } | ||
| 883 | |||
| 884 | EXPORT_SYMBOL_GPL(tty_perform_flush); | ||
| 885 | |||
| 886 | int n_tty_ioctl(struct tty_struct * tty, struct file * file, | ||
| 887 | unsigned int cmd, unsigned long arg) | ||
| 888 | { | ||
| 889 | struct tty_struct * real_tty; | ||
| 890 | int retval; | ||
| 891 | |||
| 892 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && | ||
| 893 | tty->driver->subtype == PTY_TYPE_MASTER) | ||
| 894 | real_tty = tty->link; | ||
| 895 | else | ||
| 896 | real_tty = tty; | ||
| 897 | |||
| 898 | switch (cmd) { | ||
| 802 | case TCXONC: | 899 | case TCXONC: |
| 803 | retval = tty_check_change(tty); | 900 | retval = tty_check_change(tty); |
| 804 | if (retval) | 901 | if (retval) |
| @@ -829,30 +926,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, | |||
| 829 | } | 926 | } |
| 830 | return 0; | 927 | return 0; |
| 831 | case TCFLSH: | 928 | case TCFLSH: |
| 832 | retval = tty_check_change(tty); | 929 | return tty_perform_flush(tty, arg); |
| 833 | if (retval) | ||
| 834 | return retval; | ||
| 835 | |||
| 836 | ld = tty_ldisc_ref(tty); | ||
| 837 | switch (arg) { | ||
| 838 | case TCIFLUSH: | ||
| 839 | if (ld && ld->flush_buffer) | ||
| 840 | ld->flush_buffer(tty); | ||
| 841 | break; | ||
| 842 | case TCIOFLUSH: | ||
| 843 | if (ld && ld->flush_buffer) | ||
| 844 | ld->flush_buffer(tty); | ||
| 845 | /* fall through */ | ||
| 846 | case TCOFLUSH: | ||
| 847 | if (tty->driver->flush_buffer) | ||
| 848 | tty->driver->flush_buffer(tty); | ||
| 849 | break; | ||
| 850 | default: | ||
| 851 | tty_ldisc_deref(ld); | ||
| 852 | return -EINVAL; | ||
| 853 | } | ||
| 854 | tty_ldisc_deref(ld); | ||
| 855 | return 0; | ||
| 856 | case TIOCOUTQ: | 930 | case TIOCOUTQ: |
| 857 | return put_user(tty->driver->chars_in_buffer ? | 931 | return put_user(tty->driver->chars_in_buffer ? |
| 858 | tty->driver->chars_in_buffer(tty) : 0, | 932 | tty->driver->chars_in_buffer(tty) : 0, |
| @@ -862,32 +936,6 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, | |||
| 862 | if (L_ICANON(tty)) | 936 | if (L_ICANON(tty)) |
| 863 | retval = inq_canon(tty); | 937 | retval = inq_canon(tty); |
| 864 | return put_user(retval, (unsigned int __user *) arg); | 938 | return put_user(retval, (unsigned int __user *) arg); |
| 865 | #ifndef TCGETS2 | ||
| 866 | case TIOCGLCKTRMIOS: | ||
| 867 | if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) | ||
| 868 | return -EFAULT; | ||
| 869 | return 0; | ||
| 870 | |||
| 871 | case TIOCSLCKTRMIOS: | ||
| 872 | if (!capable(CAP_SYS_ADMIN)) | ||
| 873 | return -EPERM; | ||
| 874 | if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) | ||
| 875 | return -EFAULT; | ||
| 876 | return 0; | ||
| 877 | #else | ||
| 878 | case TIOCGLCKTRMIOS: | ||
| 879 | if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) | ||
| 880 | return -EFAULT; | ||
| 881 | return 0; | ||
| 882 | |||
| 883 | case TIOCSLCKTRMIOS: | ||
| 884 | if (!capable(CAP_SYS_ADMIN)) | ||
| 885 | return -EPERM; | ||
| 886 | if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) | ||
| 887 | return -EFAULT; | ||
| 888 | return 0; | ||
| 889 | #endif | ||
| 890 | |||
| 891 | case TIOCPKT: | 939 | case TIOCPKT: |
| 892 | { | 940 | { |
| 893 | int pktmode; | 941 | int pktmode; |
| @@ -906,19 +954,9 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, | |||
| 906 | tty->packet = 0; | 954 | tty->packet = 0; |
| 907 | return 0; | 955 | return 0; |
| 908 | } | 956 | } |
| 909 | case TIOCGSOFTCAR: | ||
| 910 | return put_user(C_CLOCAL(tty) ? 1 : 0, (int __user *)arg); | ||
| 911 | case TIOCSSOFTCAR: | ||
| 912 | if (get_user(arg, (unsigned int __user *) arg)) | ||
| 913 | return -EFAULT; | ||
| 914 | mutex_lock(&tty->termios_mutex); | ||
| 915 | tty->termios->c_cflag = | ||
| 916 | ((tty->termios->c_cflag & ~CLOCAL) | | ||
| 917 | (arg ? CLOCAL : 0)); | ||
| 918 | mutex_unlock(&tty->termios_mutex); | ||
| 919 | return 0; | ||
| 920 | default: | 957 | default: |
| 921 | return -ENOIOCTLCMD; | 958 | /* Try the mode commands */ |
| 959 | return tty_mode_ioctl(tty, file, cmd, arg); | ||
| 922 | } | 960 | } |
| 923 | } | 961 | } |
| 924 | 962 | ||
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index 5596df65c8ed..624ff3e082f6 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
| @@ -650,13 +650,14 @@ static void sbp2_login(struct work_struct *work) | |||
| 650 | if (sbp2_send_management_orb(lu, node_id, generation, | 650 | if (sbp2_send_management_orb(lu, node_id, generation, |
| 651 | SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) { | 651 | SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) { |
| 652 | if (lu->retries++ < 5) { | 652 | if (lu->retries++ < 5) { |
| 653 | queue_delayed_work(sbp2_wq, &lu->work, | 653 | if (queue_delayed_work(sbp2_wq, &lu->work, |
| 654 | DIV_ROUND_UP(HZ, 5)); | 654 | DIV_ROUND_UP(HZ, 5))) |
| 655 | kref_get(&lu->tgt->kref); | ||
| 655 | } else { | 656 | } else { |
| 656 | fw_error("failed to login to %s LUN %04x\n", | 657 | fw_error("failed to login to %s LUN %04x\n", |
| 657 | unit->device.bus_id, lu->lun); | 658 | unit->device.bus_id, lu->lun); |
| 658 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
| 659 | } | 659 | } |
| 660 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
| 660 | return; | 661 | return; |
| 661 | } | 662 | } |
| 662 | 663 | ||
| @@ -914,7 +915,9 @@ static void sbp2_reconnect(struct work_struct *work) | |||
| 914 | lu->retries = 0; | 915 | lu->retries = 0; |
| 915 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); | 916 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); |
| 916 | } | 917 | } |
| 917 | queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5)); | 918 | if (queue_delayed_work(sbp2_wq, &lu->work, DIV_ROUND_UP(HZ, 5))) |
| 919 | kref_get(&lu->tgt->kref); | ||
| 920 | kref_put(&lu->tgt->kref, sbp2_release_target); | ||
| 918 | return; | 921 | return; |
| 919 | } | 922 | } |
| 920 | 923 | ||
diff --git a/drivers/lguest/lguest_device.c b/drivers/lguest/lguest_device.c index 8904f72f97c6..66f38722253a 100644 --- a/drivers/lguest/lguest_device.c +++ b/drivers/lguest/lguest_device.c | |||
| @@ -200,7 +200,8 @@ static struct virtqueue *lg_find_vq(struct virtio_device *vdev, | |||
| 200 | 200 | ||
| 201 | /* Figure out how many pages the ring will take, and map that memory */ | 201 | /* Figure out how many pages the ring will take, and map that memory */ |
| 202 | lvq->pages = lguest_map((unsigned long)lvq->config.pfn << PAGE_SHIFT, | 202 | lvq->pages = lguest_map((unsigned long)lvq->config.pfn << PAGE_SHIFT, |
| 203 | DIV_ROUND_UP(vring_size(lvq->config.num), | 203 | DIV_ROUND_UP(vring_size(lvq->config.num, |
| 204 | PAGE_SIZE), | ||
| 204 | PAGE_SIZE)); | 205 | PAGE_SIZE)); |
| 205 | if (!lvq->pages) { | 206 | if (!lvq->pages) { |
| 206 | err = -ENOMEM; | 207 | err = -ENOMEM; |
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index 516d943227e2..075b4d99e354 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c | |||
| @@ -94,7 +94,9 @@ static int wf_thread_func(void *data) | |||
| 94 | DBG("wf: thread started\n"); | 94 | DBG("wf: thread started\n"); |
| 95 | 95 | ||
| 96 | set_freezable(); | 96 | set_freezable(); |
| 97 | while(!kthread_should_stop()) { | 97 | while (!kthread_should_stop()) { |
| 98 | try_to_freeze(); | ||
| 99 | |||
| 98 | if (time_after_eq(jiffies, next)) { | 100 | if (time_after_eq(jiffies, next)) { |
| 99 | wf_notify(WF_EVENT_TICK, NULL); | 101 | wf_notify(WF_EVENT_TICK, NULL); |
| 100 | if (wf_overtemp) { | 102 | if (wf_overtemp) { |
| @@ -116,12 +118,6 @@ static int wf_thread_func(void *data) | |||
| 116 | delay = next - jiffies; | 118 | delay = next - jiffies; |
| 117 | if (delay <= HZ) | 119 | if (delay <= HZ) |
| 118 | schedule_timeout_interruptible(delay); | 120 | schedule_timeout_interruptible(delay); |
| 119 | |||
| 120 | /* there should be no non-suspend signal, but oh well */ | ||
| 121 | if (signal_pending(current) && !try_to_freeze()) { | ||
| 122 | printk(KERN_WARNING "windfarm: thread got sigl !\n"); | ||
| 123 | break; | ||
| 124 | } | ||
| 125 | } | 121 | } |
| 126 | 122 | ||
| 127 | DBG("wf: thread stopped\n"); | 123 | DBG("wf: thread stopped\n"); |
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 7c426d07a555..1b1ef3130e6e 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
| @@ -1207,8 +1207,7 @@ int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sect | |||
| 1207 | prepare_to_wait(&bitmap->overflow_wait, &__wait, | 1207 | prepare_to_wait(&bitmap->overflow_wait, &__wait, |
| 1208 | TASK_UNINTERRUPTIBLE); | 1208 | TASK_UNINTERRUPTIBLE); |
| 1209 | spin_unlock_irq(&bitmap->lock); | 1209 | spin_unlock_irq(&bitmap->lock); |
| 1210 | bitmap->mddev->queue | 1210 | blk_unplug(bitmap->mddev->queue); |
| 1211 | ->unplug_fn(bitmap->mddev->queue); | ||
| 1212 | schedule(); | 1211 | schedule(); |
| 1213 | finish_wait(&bitmap->overflow_wait, &__wait); | 1212 | finish_wait(&bitmap->overflow_wait, &__wait); |
| 1214 | continue; | 1213 | continue; |
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 5a7eb650181e..e298d8d11f24 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
| @@ -1000,8 +1000,7 @@ void dm_table_unplug_all(struct dm_table *t) | |||
| 1000 | struct dm_dev *dd = list_entry(d, struct dm_dev, list); | 1000 | struct dm_dev *dd = list_entry(d, struct dm_dev, list); |
| 1001 | struct request_queue *q = bdev_get_queue(dd->bdev); | 1001 | struct request_queue *q = bdev_get_queue(dd->bdev); |
| 1002 | 1002 | ||
| 1003 | if (q->unplug_fn) | 1003 | blk_unplug(q); |
| 1004 | q->unplug_fn(q); | ||
| 1005 | } | 1004 | } |
| 1006 | } | 1005 | } |
| 1007 | 1006 | ||
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 56a11f6c127b..3dac1cfb8189 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
| @@ -87,8 +87,7 @@ static void linear_unplug(struct request_queue *q) | |||
| 87 | 87 | ||
| 88 | for (i=0; i < mddev->raid_disks; i++) { | 88 | for (i=0; i < mddev->raid_disks; i++) { |
| 89 | struct request_queue *r_queue = bdev_get_queue(conf->disks[i].rdev->bdev); | 89 | struct request_queue *r_queue = bdev_get_queue(conf->disks[i].rdev->bdev); |
| 90 | if (r_queue->unplug_fn) | 90 | blk_unplug(r_queue); |
| 91 | r_queue->unplug_fn(r_queue); | ||
| 92 | } | 91 | } |
| 93 | } | 92 | } |
| 94 | 93 | ||
diff --git a/drivers/md/md.c b/drivers/md/md.c index 808cd9549456..cef9ebd5a046 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -5445,7 +5445,7 @@ void md_do_sync(mddev_t *mddev) | |||
| 5445 | * about not overloading the IO subsystem. (things like an | 5445 | * about not overloading the IO subsystem. (things like an |
| 5446 | * e2fsck being done on the RAID array should execute fast) | 5446 | * e2fsck being done on the RAID array should execute fast) |
| 5447 | */ | 5447 | */ |
| 5448 | mddev->queue->unplug_fn(mddev->queue); | 5448 | blk_unplug(mddev->queue); |
| 5449 | cond_resched(); | 5449 | cond_resched(); |
| 5450 | 5450 | ||
| 5451 | currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2 | 5451 | currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2 |
| @@ -5464,7 +5464,7 @@ void md_do_sync(mddev_t *mddev) | |||
| 5464 | * this also signals 'finished resyncing' to md_stop | 5464 | * this also signals 'finished resyncing' to md_stop |
| 5465 | */ | 5465 | */ |
| 5466 | out: | 5466 | out: |
| 5467 | mddev->queue->unplug_fn(mddev->queue); | 5467 | blk_unplug(mddev->queue); |
| 5468 | 5468 | ||
| 5469 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); | 5469 | wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active)); |
| 5470 | 5470 | ||
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index b35731cceac6..eb631ebed686 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
| @@ -125,8 +125,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
| 125 | atomic_inc(&rdev->nr_pending); | 125 | atomic_inc(&rdev->nr_pending); |
| 126 | rcu_read_unlock(); | 126 | rcu_read_unlock(); |
| 127 | 127 | ||
| 128 | if (r_queue->unplug_fn) | 128 | blk_unplug(r_queue); |
| 129 | r_queue->unplug_fn(r_queue); | ||
| 130 | 129 | ||
| 131 | rdev_dec_pending(rdev, mddev); | 130 | rdev_dec_pending(rdev, mddev); |
| 132 | rcu_read_lock(); | 131 | rcu_read_lock(); |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index c111105fc2dc..f8e591708d1f 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
| @@ -35,8 +35,7 @@ static void raid0_unplug(struct request_queue *q) | |||
| 35 | for (i=0; i<mddev->raid_disks; i++) { | 35 | for (i=0; i<mddev->raid_disks; i++) { |
| 36 | struct request_queue *r_queue = bdev_get_queue(devlist[i]->bdev); | 36 | struct request_queue *r_queue = bdev_get_queue(devlist[i]->bdev); |
| 37 | 37 | ||
| 38 | if (r_queue->unplug_fn) | 38 | blk_unplug(r_queue); |
| 39 | r_queue->unplug_fn(r_queue); | ||
| 40 | } | 39 | } |
| 41 | } | 40 | } |
| 42 | 41 | ||
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 85478d6a9c1a..4a69c416e045 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
| @@ -549,8 +549,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
| 549 | atomic_inc(&rdev->nr_pending); | 549 | atomic_inc(&rdev->nr_pending); |
| 550 | rcu_read_unlock(); | 550 | rcu_read_unlock(); |
| 551 | 551 | ||
| 552 | if (r_queue->unplug_fn) | 552 | blk_unplug(r_queue); |
| 553 | r_queue->unplug_fn(r_queue); | ||
| 554 | 553 | ||
| 555 | rdev_dec_pending(rdev, mddev); | 554 | rdev_dec_pending(rdev, mddev); |
| 556 | rcu_read_lock(); | 555 | rcu_read_lock(); |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index fc6607acb6e4..5cdcc9386200 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
| @@ -593,8 +593,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
| 593 | atomic_inc(&rdev->nr_pending); | 593 | atomic_inc(&rdev->nr_pending); |
| 594 | rcu_read_unlock(); | 594 | rcu_read_unlock(); |
| 595 | 595 | ||
| 596 | if (r_queue->unplug_fn) | 596 | blk_unplug(r_queue); |
| 597 | r_queue->unplug_fn(r_queue); | ||
| 598 | 597 | ||
| 599 | rdev_dec_pending(rdev, mddev); | 598 | rdev_dec_pending(rdev, mddev); |
| 600 | rcu_read_lock(); | 599 | rcu_read_lock(); |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 82af3465a900..1cfc984cc7b7 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
| @@ -3186,8 +3186,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
| 3186 | atomic_inc(&rdev->nr_pending); | 3186 | atomic_inc(&rdev->nr_pending); |
| 3187 | rcu_read_unlock(); | 3187 | rcu_read_unlock(); |
| 3188 | 3188 | ||
| 3189 | if (r_queue->unplug_fn) | 3189 | blk_unplug(r_queue); |
| 3190 | r_queue->unplug_fn(r_queue); | ||
| 3191 | 3190 | ||
| 3192 | rdev_dec_pending(rdev, mddev); | 3191 | rdev_dec_pending(rdev, mddev); |
| 3193 | rcu_read_lock(); | 3192 | rcu_read_lock(); |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 9203a0b221b3..1b9c9b6da5b7 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
| @@ -310,7 +310,7 @@ static void copy_sg(struct scatterlist *dst, unsigned int dst_len, | |||
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | if (src_size == 0) { | 312 | if (src_size == 0) { |
| 313 | src_buf = sg_virt(dst); | 313 | src_buf = sg_virt(src); |
| 314 | src_size = src->length; | 314 | src_size = src->length; |
| 315 | } | 315 | } |
| 316 | 316 | ||
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6b80bf77a4ef..ff59d2e0475b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
| @@ -1301,7 +1301,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
| 1301 | 1301 | ||
| 1302 | if ((chip->quirks & SDHCI_QUIRK_BROKEN_DMA) && | 1302 | if ((chip->quirks & SDHCI_QUIRK_BROKEN_DMA) && |
| 1303 | (host->flags & SDHCI_USE_DMA)) { | 1303 | (host->flags & SDHCI_USE_DMA)) { |
| 1304 | DBG("Disabling DMA as it is marked broken"); | 1304 | DBG("Disabling DMA as it is marked broken\n"); |
| 1305 | host->flags &= ~SDHCI_USE_DMA; | 1305 | host->flags &= ~SDHCI_USE_DMA; |
| 1306 | } | 1306 | } |
| 1307 | 1307 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 5f800a6dd978..bf8890ebbc4c 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
| @@ -136,10 +136,11 @@ config TUN | |||
| 136 | If you don't know what to use this for, you don't need it. | 136 | If you don't know what to use this for, you don't need it. |
| 137 | 137 | ||
| 138 | config VETH | 138 | config VETH |
| 139 | tristate "Virtual ethernet device" | 139 | tristate "Virtual ethernet pair device" |
| 140 | ---help--- | 140 | ---help--- |
| 141 | The device is an ethernet tunnel. Devices are created in pairs. When | 141 | This device is a local ethernet tunnel. Devices are created in pairs. |
| 142 | one end receives the packet it appears on its pair and vice versa. | 142 | When one end receives the packet it appears on its pair and vice |
| 143 | versa. | ||
| 143 | 144 | ||
| 144 | config NET_SB1000 | 145 | config NET_SB1000 |
| 145 | tristate "General Instruments Surfboard 1000" | 146 | tristate "General Instruments Surfboard 1000" |
| @@ -234,7 +235,7 @@ source "drivers/net/arm/Kconfig" | |||
| 234 | 235 | ||
| 235 | config AX88796 | 236 | config AX88796 |
| 236 | tristate "ASIX AX88796 NE2000 clone support" | 237 | tristate "ASIX AX88796 NE2000 clone support" |
| 237 | depends on ARM || MIPS | 238 | depends on ARM || MIPS || SUPERH |
| 238 | select CRC32 | 239 | select CRC32 |
| 239 | select MII | 240 | select MII |
| 240 | help | 241 | help |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 6937ef0e7275..a198404a3e36 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -4405,6 +4405,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
| 4405 | bond_dev->set_multicast_list = bond_set_multicast_list; | 4405 | bond_dev->set_multicast_list = bond_set_multicast_list; |
| 4406 | bond_dev->change_mtu = bond_change_mtu; | 4406 | bond_dev->change_mtu = bond_change_mtu; |
| 4407 | bond_dev->set_mac_address = bond_set_mac_address; | 4407 | bond_dev->set_mac_address = bond_set_mac_address; |
| 4408 | bond_dev->validate_addr = NULL; | ||
| 4408 | 4409 | ||
| 4409 | bond_set_mode_ops(bond, bond->params.mode); | 4410 | bond_set_mode_ops(bond, bond->params.mode); |
| 4410 | 4411 | ||
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 7a06ade85b02..b29330d8e309 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
| @@ -1193,8 +1193,6 @@ static ssize_t bonding_show_active_slave(struct device *d, | |||
| 1193 | struct bonding *bond = to_bond(d); | 1193 | struct bonding *bond = to_bond(d); |
| 1194 | int count; | 1194 | int count; |
| 1195 | 1195 | ||
| 1196 | rtnl_lock(); | ||
| 1197 | |||
| 1198 | read_lock(&bond->curr_slave_lock); | 1196 | read_lock(&bond->curr_slave_lock); |
| 1199 | curr = bond->curr_active_slave; | 1197 | curr = bond->curr_active_slave; |
| 1200 | read_unlock(&bond->curr_slave_lock); | 1198 | read_unlock(&bond->curr_slave_lock); |
| @@ -1216,7 +1214,9 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
| 1216 | struct slave *new_active = NULL; | 1214 | struct slave *new_active = NULL; |
| 1217 | struct bonding *bond = to_bond(d); | 1215 | struct bonding *bond = to_bond(d); |
| 1218 | 1216 | ||
| 1217 | rtnl_lock(); | ||
| 1219 | write_lock_bh(&bond->lock); | 1218 | write_lock_bh(&bond->lock); |
| 1219 | |||
| 1220 | if (!USES_PRIMARY(bond->params.mode)) { | 1220 | if (!USES_PRIMARY(bond->params.mode)) { |
| 1221 | printk(KERN_INFO DRV_NAME | 1221 | printk(KERN_INFO DRV_NAME |
| 1222 | ": %s: Unable to change active slave; %s is in mode %d\n", | 1222 | ": %s: Unable to change active slave; %s is in mode %d\n", |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index e0119f6a3319..580cb4ab2af1 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
| @@ -762,26 +762,20 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, | |||
| 762 | 762 | ||
| 763 | if (copy_from_user(&addr, | 763 | if (copy_from_user(&addr, |
| 764 | (void __user *) arg, AX25_ADDR_LEN)) { | 764 | (void __user *) arg, AX25_ADDR_LEN)) { |
| 765 | err = -EFAULT; | 765 | err = -EFAULT; |
| 766 | break; | 766 | break; |
| 767 | } | 767 | } |
| 768 | 768 | ||
| 769 | netif_tx_lock_bh(dev); | 769 | netif_tx_lock_bh(dev); |
| 770 | memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN); | 770 | memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN); |
| 771 | netif_tx_unlock_bh(dev); | 771 | netif_tx_unlock_bh(dev); |
| 772 | 772 | ||
| 773 | err = 0; | 773 | err = 0; |
| 774 | break; | 774 | break; |
| 775 | } | 775 | } |
| 776 | |||
| 777 | /* Allow stty to read, but not set, the serial port */ | ||
| 778 | case TCGETS: | ||
| 779 | case TCGETA: | ||
| 780 | err = n_tty_ioctl(tty, (struct file *) file, cmd, arg); | ||
| 781 | break; | ||
| 782 | 776 | ||
| 783 | default: | 777 | default: |
| 784 | err = -ENOIOCTLCMD; | 778 | err = tty_mode_ioctl(tty, file, cmd, arg); |
| 785 | } | 779 | } |
| 786 | 780 | ||
| 787 | sp_put(sp); | 781 | sp_put(sp); |
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c index 2c6f7be36e8a..fc753d7f674e 100644 --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c | |||
| @@ -434,11 +434,6 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c | |||
| 434 | IRDA_ASSERT(dev != NULL, return -1;); | 434 | IRDA_ASSERT(dev != NULL, return -1;); |
| 435 | 435 | ||
| 436 | switch (cmd) { | 436 | switch (cmd) { |
| 437 | case TCGETS: | ||
| 438 | case TCGETA: | ||
| 439 | err = n_tty_ioctl(tty, file, cmd, arg); | ||
| 440 | break; | ||
| 441 | |||
| 442 | case IRTTY_IOCTDONGLE: | 437 | case IRTTY_IOCTDONGLE: |
| 443 | /* this call blocks for completion */ | 438 | /* this call blocks for completion */ |
| 444 | err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg); | 439 | err = sirdev_set_dongle(dev, (IRDA_DONGLE) arg); |
| @@ -454,7 +449,7 @@ static int irtty_ioctl(struct tty_struct *tty, struct file *file, unsigned int c | |||
| 454 | err = -EFAULT; | 449 | err = -EFAULT; |
| 455 | break; | 450 | break; |
| 456 | default: | 451 | default: |
| 457 | err = -ENOIOCTLCMD; | 452 | err = tty_mode_ioctl(tty, file, cmd, arg); |
| 458 | break; | 453 | break; |
| 459 | } | 454 | } |
| 460 | return err; | 455 | return err; |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index ab4d309a858f..09b4fde8d924 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
| @@ -580,6 +580,16 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
| 580 | 580 | ||
| 581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; | 581 | len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S; |
| 582 | 582 | ||
| 583 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
| 584 | |||
| 585 | if (macrx & XCT_MACRX_CRC) { | ||
| 586 | /* CRC error flagged */ | ||
| 587 | mac->netdev->stats.rx_errors++; | ||
| 588 | mac->netdev->stats.rx_crc_errors++; | ||
| 589 | dev_kfree_skb_irq(skb); | ||
| 590 | goto next; | ||
| 591 | } | ||
| 592 | |||
| 583 | if (len < 256) { | 593 | if (len < 256) { |
| 584 | struct sk_buff *new_skb; | 594 | struct sk_buff *new_skb; |
| 585 | 595 | ||
| @@ -595,11 +605,10 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
| 595 | } else | 605 | } else |
| 596 | info->skb = NULL; | 606 | info->skb = NULL; |
| 597 | 607 | ||
| 598 | pci_unmap_single(mac->dma_pdev, dma, len, PCI_DMA_FROMDEVICE); | ||
| 599 | |||
| 600 | info->dma = 0; | 608 | info->dma = 0; |
| 601 | 609 | ||
| 602 | skb_put(skb, len); | 610 | /* Don't include CRC */ |
| 611 | skb_put(skb, len-4); | ||
| 603 | 612 | ||
| 604 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { | 613 | if (likely((macrx & XCT_MACRX_HTY_M) == XCT_MACRX_HTY_IPV4_OK)) { |
| 605 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 614 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
| @@ -614,6 +623,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
| 614 | skb->protocol = eth_type_trans(skb, mac->netdev); | 623 | skb->protocol = eth_type_trans(skb, mac->netdev); |
| 615 | netif_receive_skb(skb); | 624 | netif_receive_skb(skb); |
| 616 | 625 | ||
| 626 | next: | ||
| 617 | RX_RING(mac, n) = 0; | 627 | RX_RING(mac, n) = 0; |
| 618 | RX_RING(mac, n+1) = 0; | 628 | RX_RING(mac, n+1) = 0; |
| 619 | 629 | ||
| @@ -1126,7 +1136,7 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 1126 | unsigned long flags; | 1136 | unsigned long flags; |
| 1127 | int i, nfrags; | 1137 | int i, nfrags; |
| 1128 | 1138 | ||
| 1129 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD; | 1139 | dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_CRC_PAD; |
| 1130 | 1140 | ||
| 1131 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1141 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
| 1132 | const unsigned char *nh = skb_network_header(skb); | 1142 | const unsigned char *nh = skb_network_header(skb); |
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 27f5b904f48e..8d278c87ba48 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
| @@ -309,16 +309,11 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file, | |||
| 309 | err = 0; | 309 | err = 0; |
| 310 | break; | 310 | break; |
| 311 | 311 | ||
| 312 | case TCGETS: | ||
| 313 | case TCGETA: | ||
| 314 | err = n_tty_ioctl(tty, file, cmd, arg); | ||
| 315 | break; | ||
| 316 | |||
| 317 | case TCFLSH: | 312 | case TCFLSH: |
| 318 | /* flush our buffers and the serial port's buffer */ | 313 | /* flush our buffers and the serial port's buffer */ |
| 319 | if (arg == TCIOFLUSH || arg == TCOFLUSH) | 314 | if (arg == TCIOFLUSH || arg == TCOFLUSH) |
| 320 | ppp_async_flush_output(ap); | 315 | ppp_async_flush_output(ap); |
| 321 | err = n_tty_ioctl(tty, file, cmd, arg); | 316 | err = tty_perform_flush(tty, arg); |
| 322 | break; | 317 | break; |
| 323 | 318 | ||
| 324 | case FIONREAD: | 319 | case FIONREAD: |
| @@ -329,7 +324,8 @@ ppp_asynctty_ioctl(struct tty_struct *tty, struct file *file, | |||
| 329 | break; | 324 | break; |
| 330 | 325 | ||
| 331 | default: | 326 | default: |
| 332 | err = -ENOIOCTLCMD; | 327 | /* Try the various mode ioctls */ |
| 328 | err = tty_mode_ioctl(tty, file, cmd, arg); | ||
| 333 | } | 329 | } |
| 334 | 330 | ||
| 335 | ap_put(ap); | 331 | ap_put(ap); |
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c index ce64032a465a..00e2fb48b4ae 100644 --- a/drivers/net/ppp_synctty.c +++ b/drivers/net/ppp_synctty.c | |||
| @@ -349,16 +349,11 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, | |||
| 349 | err = 0; | 349 | err = 0; |
| 350 | break; | 350 | break; |
| 351 | 351 | ||
| 352 | case TCGETS: | ||
| 353 | case TCGETA: | ||
| 354 | err = n_tty_ioctl(tty, file, cmd, arg); | ||
| 355 | break; | ||
| 356 | |||
| 357 | case TCFLSH: | 352 | case TCFLSH: |
| 358 | /* flush our buffers and the serial port's buffer */ | 353 | /* flush our buffers and the serial port's buffer */ |
| 359 | if (arg == TCIOFLUSH || arg == TCOFLUSH) | 354 | if (arg == TCIOFLUSH || arg == TCOFLUSH) |
| 360 | ppp_sync_flush_output(ap); | 355 | ppp_sync_flush_output(ap); |
| 361 | err = n_tty_ioctl(tty, file, cmd, arg); | 356 | err = tty_perform_flush(tty, arg); |
| 362 | break; | 357 | break; |
| 363 | 358 | ||
| 364 | case FIONREAD: | 359 | case FIONREAD: |
| @@ -369,7 +364,8 @@ ppp_synctty_ioctl(struct tty_struct *tty, struct file *file, | |||
| 369 | break; | 364 | break; |
| 370 | 365 | ||
| 371 | default: | 366 | default: |
| 372 | err = -ENOIOCTLCMD; | 367 | err = tty_mode_ioctl(tty, file, cmd, arg); |
| 368 | break; | ||
| 373 | } | 369 | } |
| 374 | 370 | ||
| 375 | sp_put(ap); | 371 | sp_put(ap); |
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c index f8904fd92369..a7556cd2df79 100644 --- a/drivers/net/pppol2tp.c +++ b/drivers/net/pppol2tp.c | |||
| @@ -488,7 +488,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb) | |||
| 488 | { | 488 | { |
| 489 | struct pppol2tp_session *session = NULL; | 489 | struct pppol2tp_session *session = NULL; |
| 490 | struct pppol2tp_tunnel *tunnel; | 490 | struct pppol2tp_tunnel *tunnel; |
| 491 | unsigned char *ptr; | 491 | unsigned char *ptr, *optr; |
| 492 | u16 hdrflags; | 492 | u16 hdrflags; |
| 493 | u16 tunnel_id, session_id; | 493 | u16 tunnel_id, session_id; |
| 494 | int length; | 494 | int length; |
| @@ -496,7 +496,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb) | |||
| 496 | 496 | ||
| 497 | tunnel = pppol2tp_sock_to_tunnel(sock); | 497 | tunnel = pppol2tp_sock_to_tunnel(sock); |
| 498 | if (tunnel == NULL) | 498 | if (tunnel == NULL) |
| 499 | goto error; | 499 | goto no_tunnel; |
| 500 | 500 | ||
| 501 | /* UDP always verifies the packet length. */ | 501 | /* UDP always verifies the packet length. */ |
| 502 | __skb_pull(skb, sizeof(struct udphdr)); | 502 | __skb_pull(skb, sizeof(struct udphdr)); |
| @@ -509,7 +509,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb) | |||
| 509 | } | 509 | } |
| 510 | 510 | ||
| 511 | /* Point to L2TP header */ | 511 | /* Point to L2TP header */ |
| 512 | ptr = skb->data; | 512 | optr = ptr = skb->data; |
| 513 | 513 | ||
| 514 | /* Get L2TP header flags */ | 514 | /* Get L2TP header flags */ |
| 515 | hdrflags = ntohs(*(__be16*)ptr); | 515 | hdrflags = ntohs(*(__be16*)ptr); |
| @@ -637,12 +637,14 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb) | |||
| 637 | /* If offset bit set, skip it. */ | 637 | /* If offset bit set, skip it. */ |
| 638 | if (hdrflags & L2TP_HDRFLAG_O) { | 638 | if (hdrflags & L2TP_HDRFLAG_O) { |
| 639 | offset = ntohs(*(__be16 *)ptr); | 639 | offset = ntohs(*(__be16 *)ptr); |
| 640 | skb->transport_header += 2 + offset; | 640 | ptr += 2 + offset; |
| 641 | if (!pskb_may_pull(skb, skb_transport_offset(skb) + 2)) | ||
| 642 | goto discard; | ||
| 643 | } | 641 | } |
| 644 | 642 | ||
| 645 | __skb_pull(skb, skb_transport_offset(skb)); | 643 | offset = ptr - optr; |
| 644 | if (!pskb_may_pull(skb, offset)) | ||
| 645 | goto discard; | ||
| 646 | |||
| 647 | __skb_pull(skb, offset); | ||
| 646 | 648 | ||
| 647 | /* Skip PPP header, if present. In testing, Microsoft L2TP clients | 649 | /* Skip PPP header, if present. In testing, Microsoft L2TP clients |
| 648 | * don't send the PPP header (PPP header compression enabled), but | 650 | * don't send the PPP header (PPP header compression enabled), but |
| @@ -652,6 +654,9 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb) | |||
| 652 | * Note that skb->data[] isn't dereferenced from a u16 ptr here since | 654 | * Note that skb->data[] isn't dereferenced from a u16 ptr here since |
| 653 | * the field may be unaligned. | 655 | * the field may be unaligned. |
| 654 | */ | 656 | */ |
| 657 | if (!pskb_may_pull(skb, 2)) | ||
| 658 | goto discard; | ||
| 659 | |||
| 655 | if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03)) | 660 | if ((skb->data[0] == 0xff) && (skb->data[1] == 0x03)) |
| 656 | skb_pull(skb, 2); | 661 | skb_pull(skb, 2); |
| 657 | 662 | ||
| @@ -709,6 +714,10 @@ discard: | |||
| 709 | return 0; | 714 | return 0; |
| 710 | 715 | ||
| 711 | error: | 716 | error: |
| 717 | /* Put UDP header back */ | ||
| 718 | __skb_push(skb, sizeof(struct udphdr)); | ||
| 719 | |||
| 720 | no_tunnel: | ||
| 712 | return 1; | 721 | return 1; |
| 713 | } | 722 | } |
| 714 | 723 | ||
| @@ -1050,6 +1059,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1050 | /* Get routing info from the tunnel socket */ | 1059 | /* Get routing info from the tunnel socket */ |
| 1051 | dst_release(skb->dst); | 1060 | dst_release(skb->dst); |
| 1052 | skb->dst = sk_dst_get(sk_tun); | 1061 | skb->dst = sk_dst_get(sk_tun); |
| 1062 | skb_orphan(skb); | ||
| 1063 | skb->sk = sk_tun; | ||
| 1053 | 1064 | ||
| 1054 | /* Queue the packet to IP for output */ | 1065 | /* Queue the packet to IP for output */ |
| 1055 | len = skb->len; | 1066 | len = skb->len; |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 30adf726743c..a5791114b7bd 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
| @@ -1456,16 +1456,11 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev) | |||
| 1456 | PHYAddr[qdev->mac_index]); | 1456 | PHYAddr[qdev->mac_index]); |
| 1457 | reg &= ~PHY_GIG_ALL_PARAMS; | 1457 | reg &= ~PHY_GIG_ALL_PARAMS; |
| 1458 | 1458 | ||
| 1459 | if(portConfiguration & | 1459 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { |
| 1460 | PORT_CONFIG_FULL_DUPLEX_ENABLED & | 1460 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) |
| 1461 | PORT_CONFIG_1000MB_SPEED) { | 1461 | reg |= PHY_GIG_ADV_1000F; |
| 1462 | reg |= PHY_GIG_ADV_1000F; | 1462 | else |
| 1463 | } | 1463 | reg |= PHY_GIG_ADV_1000H; |
| 1464 | |||
| 1465 | if(portConfiguration & | ||
| 1466 | PORT_CONFIG_HALF_DUPLEX_ENABLED & | ||
| 1467 | PORT_CONFIG_1000MB_SPEED) { | ||
| 1468 | reg |= PHY_GIG_ADV_1000H; | ||
| 1469 | } | 1464 | } |
| 1470 | 1465 | ||
| 1471 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, | 1466 | ql_mii_write_reg_ex(qdev, PHY_GIG_CONTROL, reg, |
| @@ -1645,8 +1640,11 @@ static int ql_finish_auto_neg(struct ql3_adapter *qdev) | |||
| 1645 | return 0; | 1640 | return 0; |
| 1646 | } | 1641 | } |
| 1647 | 1642 | ||
| 1648 | static void ql_link_state_machine(struct ql3_adapter *qdev) | 1643 | static void ql_link_state_machine_work(struct work_struct *work) |
| 1649 | { | 1644 | { |
| 1645 | struct ql3_adapter *qdev = | ||
| 1646 | container_of(work, struct ql3_adapter, link_state_work.work); | ||
| 1647 | |||
| 1650 | u32 curr_link_state; | 1648 | u32 curr_link_state; |
| 1651 | unsigned long hw_flags; | 1649 | unsigned long hw_flags; |
| 1652 | 1650 | ||
| @@ -1661,6 +1659,10 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
| 1661 | "state.\n", qdev->ndev->name); | 1659 | "state.\n", qdev->ndev->name); |
| 1662 | 1660 | ||
| 1663 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1661 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
| 1662 | |||
| 1663 | /* Restart timer on 2 second interval. */ | ||
| 1664 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1);\ | ||
| 1665 | |||
| 1664 | return; | 1666 | return; |
| 1665 | } | 1667 | } |
| 1666 | 1668 | ||
| @@ -1705,6 +1707,9 @@ static void ql_link_state_machine(struct ql3_adapter *qdev) | |||
| 1705 | break; | 1707 | break; |
| 1706 | } | 1708 | } |
| 1707 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); | 1709 | spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); |
| 1710 | |||
| 1711 | /* Restart timer on 2 second interval. */ | ||
| 1712 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
| 1708 | } | 1713 | } |
| 1709 | 1714 | ||
| 1710 | /* | 1715 | /* |
| @@ -3941,19 +3946,7 @@ static void ql_get_board_info(struct ql3_adapter *qdev) | |||
| 3941 | static void ql3xxx_timer(unsigned long ptr) | 3946 | static void ql3xxx_timer(unsigned long ptr) |
| 3942 | { | 3947 | { |
| 3943 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; | 3948 | struct ql3_adapter *qdev = (struct ql3_adapter *)ptr; |
| 3944 | 3949 | queue_delayed_work(qdev->workqueue, &qdev->link_state_work, 0); | |
| 3945 | if (test_bit(QL_RESET_ACTIVE,&qdev->flags)) { | ||
| 3946 | printk(KERN_DEBUG PFX | ||
| 3947 | "%s: Reset in progress.\n", | ||
| 3948 | qdev->ndev->name); | ||
| 3949 | goto end; | ||
| 3950 | } | ||
| 3951 | |||
| 3952 | ql_link_state_machine(qdev); | ||
| 3953 | |||
| 3954 | /* Restart timer on 2 second interval. */ | ||
| 3955 | end: | ||
| 3956 | mod_timer(&qdev->adapter_timer, jiffies + HZ * 1); | ||
| 3957 | } | 3950 | } |
| 3958 | 3951 | ||
| 3959 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, | 3952 | static int __devinit ql3xxx_probe(struct pci_dev *pdev, |
| @@ -4103,6 +4096,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev, | |||
| 4103 | qdev->workqueue = create_singlethread_workqueue(ndev->name); | 4096 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
| 4104 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); | 4097 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
| 4105 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); | 4098 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
| 4099 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); | ||
| 4106 | 4100 | ||
| 4107 | init_timer(&qdev->adapter_timer); | 4101 | init_timer(&qdev->adapter_timer); |
| 4108 | qdev->adapter_timer.function = ql3xxx_timer; | 4102 | qdev->adapter_timer.function = ql3xxx_timer; |
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index fbcb0b949639..d0ffb30ef371 100644 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h | |||
| @@ -1286,6 +1286,7 @@ struct ql3_adapter { | |||
| 1286 | struct workqueue_struct *workqueue; | 1286 | struct workqueue_struct *workqueue; |
| 1287 | struct delayed_work reset_work; | 1287 | struct delayed_work reset_work; |
| 1288 | struct delayed_work tx_timeout_work; | 1288 | struct delayed_work tx_timeout_work; |
| 1289 | struct delayed_work link_state_work; | ||
| 1289 | u32 max_frame_size; | 1290 | u32 max_frame_size; |
| 1290 | u32 device_id; | 1291 | u32 device_id; |
| 1291 | u16 phyType; | 1292 | u16 phyType; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b94fa7ef1955..1f647b9ce352 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -171,6 +171,8 @@ static struct pci_device_id rtl8169_pci_tbl[] = { | |||
| 171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, | 171 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, |
| 172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, | 172 | { PCI_VENDOR_ID_LINKSYS, 0x1032, |
| 173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, | 173 | PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 }, |
| 174 | { 0x0001, 0x8168, | ||
| 175 | PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 }, | ||
| 174 | {0,}, | 176 | {0,}, |
| 175 | }; | 177 | }; |
| 176 | 178 | ||
| @@ -468,7 +470,7 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value) | |||
| 468 | { | 470 | { |
| 469 | int i; | 471 | int i; |
| 470 | 472 | ||
| 471 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0xFF) << 16 | value); | 473 | RTL_W32(PHYAR, 0x80000000 | (reg_addr & 0x1f) << 16 | (value & 0xffff)); |
| 472 | 474 | ||
| 473 | for (i = 20; i > 0; i--) { | 475 | for (i = 20; i > 0; i--) { |
| 474 | /* | 476 | /* |
| @@ -485,7 +487,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
| 485 | { | 487 | { |
| 486 | int i, value = -1; | 488 | int i, value = -1; |
| 487 | 489 | ||
| 488 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0xFF) << 16); | 490 | RTL_W32(PHYAR, 0x0 | (reg_addr & 0x1f) << 16); |
| 489 | 491 | ||
| 490 | for (i = 20; i > 0; i--) { | 492 | for (i = 20; i > 0; i--) { |
| 491 | /* | 493 | /* |
| @@ -493,7 +495,7 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr) | |||
| 493 | * the specified MII register. | 495 | * the specified MII register. |
| 494 | */ | 496 | */ |
| 495 | if (RTL_R32(PHYAR) & 0x80000000) { | 497 | if (RTL_R32(PHYAR) & 0x80000000) { |
| 496 | value = (int) (RTL_R32(PHYAR) & 0xFFFF); | 498 | value = RTL_R32(PHYAR) & 0xffff; |
| 497 | break; | 499 | break; |
| 498 | } | 500 | } |
| 499 | udelay(25); | 501 | udelay(25); |
| @@ -1245,16 +1247,6 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr) | |||
| 1245 | 1247 | ||
| 1246 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | 1248 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); |
| 1247 | } | 1249 | } |
| 1248 | static void rtl8168b_hw_phy_config(void __iomem *ioaddr) | ||
| 1249 | { | ||
| 1250 | struct phy_reg phy_reg_init[] = { | ||
| 1251 | { 0x1f, 0x0000 }, | ||
| 1252 | { 0x10, 0xf41b }, | ||
| 1253 | { 0x1f, 0x0000 } | ||
| 1254 | }; | ||
| 1255 | |||
| 1256 | rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init)); | ||
| 1257 | } | ||
| 1258 | 1250 | ||
| 1259 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) | 1251 | static void rtl8168cp_hw_phy_config(void __iomem *ioaddr) |
| 1260 | { | 1252 | { |
| @@ -1324,11 +1316,6 @@ static void rtl_hw_phy_config(struct net_device *dev) | |||
| 1324 | case RTL_GIGA_MAC_VER_04: | 1316 | case RTL_GIGA_MAC_VER_04: |
| 1325 | rtl8169sb_hw_phy_config(ioaddr); | 1317 | rtl8169sb_hw_phy_config(ioaddr); |
| 1326 | break; | 1318 | break; |
| 1327 | case RTL_GIGA_MAC_VER_11: | ||
| 1328 | case RTL_GIGA_MAC_VER_12: | ||
| 1329 | case RTL_GIGA_MAC_VER_17: | ||
| 1330 | rtl8168b_hw_phy_config(ioaddr); | ||
| 1331 | break; | ||
| 1332 | case RTL_GIGA_MAC_VER_18: | 1319 | case RTL_GIGA_MAC_VER_18: |
| 1333 | rtl8168cp_hw_phy_config(ioaddr); | 1320 | rtl8168cp_hw_phy_config(ioaddr); |
| 1334 | break; | 1321 | break; |
| @@ -1739,7 +1726,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 1739 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); | 1726 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); |
| 1740 | RTL_W8(Cfg9346, Cfg9346_Lock); | 1727 | RTL_W8(Cfg9346, Cfg9346_Lock); |
| 1741 | 1728 | ||
| 1742 | if (RTL_R8(PHYstatus) & TBI_Enable) { | 1729 | if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) && |
| 1730 | (RTL_R8(PHYstatus) & TBI_Enable)) { | ||
| 1743 | tp->set_speed = rtl8169_set_speed_tbi; | 1731 | tp->set_speed = rtl8169_set_speed_tbi; |
| 1744 | tp->get_settings = rtl8169_gset_tbi; | 1732 | tp->get_settings = rtl8169_gset_tbi; |
| 1745 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; | 1733 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; |
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c index b822859c8de3..73a7e6529ee0 100644 --- a/drivers/net/rrunner.c +++ b/drivers/net/rrunner.c | |||
| @@ -78,12 +78,6 @@ static char version[] __devinitdata = "rrunner.c: v0.50 11/11/2002 Jes Sorensen | |||
| 78 | * stack will need to know about I/O vectors or something similar. | 78 | * stack will need to know about I/O vectors or something similar. |
| 79 | */ | 79 | */ |
| 80 | 80 | ||
| 81 | /* | ||
| 82 | * sysctl_[wr]mem_max are checked at init time to see if they are at | ||
| 83 | * least 256KB and increased to 256KB if they are not. This is done to | ||
| 84 | * avoid ending up with socket buffers smaller than the MTU size, | ||
| 85 | */ | ||
| 86 | |||
| 87 | static int __devinit rr_init_one(struct pci_dev *pdev, | 81 | static int __devinit rr_init_one(struct pci_dev *pdev, |
| 88 | const struct pci_device_id *ent) | 82 | const struct pci_device_id *ent) |
| 89 | { | 83 | { |
| @@ -561,18 +555,6 @@ static int __devinit rr_init(struct net_device *dev) | |||
| 561 | sram_size = rr_read_eeprom_word(rrpriv, (void *)8); | 555 | sram_size = rr_read_eeprom_word(rrpriv, (void *)8); |
| 562 | printk(" SRAM size 0x%06x\n", sram_size); | 556 | printk(" SRAM size 0x%06x\n", sram_size); |
| 563 | 557 | ||
| 564 | if (sysctl_rmem_max < 262144){ | ||
| 565 | printk(" Receive socket buffer limit too low (%i), " | ||
| 566 | "setting to 262144\n", sysctl_rmem_max); | ||
| 567 | sysctl_rmem_max = 262144; | ||
| 568 | } | ||
| 569 | |||
| 570 | if (sysctl_wmem_max < 262144){ | ||
| 571 | printk(" Transmit socket buffer limit too low (%i), " | ||
| 572 | "setting to 262144\n", sysctl_wmem_max); | ||
| 573 | sysctl_wmem_max = 262144; | ||
| 574 | } | ||
| 575 | |||
| 576 | return 0; | 558 | return 0; |
| 577 | } | 559 | } |
| 578 | 560 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c27c7d63b6a5..a2070db725c9 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | #include "sky2.h" | 52 | #include "sky2.h" |
| 53 | 53 | ||
| 54 | #define DRV_NAME "sky2" | 54 | #define DRV_NAME "sky2" |
| 55 | #define DRV_VERSION "1.19" | 55 | #define DRV_VERSION "1.20" |
| 56 | #define PFX DRV_NAME " " | 56 | #define PFX DRV_NAME " " |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| @@ -121,6 +121,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
| 121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ | 121 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ |
| 122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ | 122 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ |
| 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ | 123 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ |
| 124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ | ||
| 124 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ | 125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ |
| 125 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ | 126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) }, /* 88E8052 */ |
| 126 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ | 127 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) }, /* 88E8050 */ |
| @@ -134,6 +135,7 @@ static const struct pci_device_id sky2_id_table[] = { | |||
| 134 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ | 135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */ |
| 135 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ | 136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */ |
| 136 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ | 137 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */ |
| 138 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436C) }, /* 88E8072 */ | ||
| 137 | { 0 } | 139 | { 0 } |
| 138 | }; | 140 | }; |
| 139 | 141 | ||
| @@ -156,7 +158,7 @@ static const char *yukon2_name[] = { | |||
| 156 | 158 | ||
| 157 | static void sky2_set_multicast(struct net_device *dev); | 159 | static void sky2_set_multicast(struct net_device *dev); |
| 158 | 160 | ||
| 159 | /* Access to external PHY */ | 161 | /* Access to PHY via serial interconnect */ |
| 160 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | 162 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) |
| 161 | { | 163 | { |
| 162 | int i; | 164 | int i; |
| @@ -166,13 +168,22 @@ static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | |||
| 166 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); | 168 | GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg)); |
| 167 | 169 | ||
| 168 | for (i = 0; i < PHY_RETRIES; i++) { | 170 | for (i = 0; i < PHY_RETRIES; i++) { |
| 169 | if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) | 171 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
| 172 | if (ctrl == 0xffff) | ||
| 173 | goto io_error; | ||
| 174 | |||
| 175 | if (!(ctrl & GM_SMI_CT_BUSY)) | ||
| 170 | return 0; | 176 | return 0; |
| 171 | udelay(1); | 177 | |
| 178 | udelay(10); | ||
| 172 | } | 179 | } |
| 173 | 180 | ||
| 174 | printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name); | 181 | dev_warn(&hw->pdev->dev,"%s: phy write timeout\n", hw->dev[port]->name); |
| 175 | return -ETIMEDOUT; | 182 | return -ETIMEDOUT; |
| 183 | |||
| 184 | io_error: | ||
| 185 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
| 186 | return -EIO; | ||
| 176 | } | 187 | } |
| 177 | 188 | ||
| 178 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | 189 | static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) |
| @@ -183,23 +194,29 @@ static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val) | |||
| 183 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); | 194 | | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); |
| 184 | 195 | ||
| 185 | for (i = 0; i < PHY_RETRIES; i++) { | 196 | for (i = 0; i < PHY_RETRIES; i++) { |
| 186 | if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) { | 197 | u16 ctrl = gma_read16(hw, port, GM_SMI_CTRL); |
| 198 | if (ctrl == 0xffff) | ||
| 199 | goto io_error; | ||
| 200 | |||
| 201 | if (ctrl & GM_SMI_CT_RD_VAL) { | ||
| 187 | *val = gma_read16(hw, port, GM_SMI_DATA); | 202 | *val = gma_read16(hw, port, GM_SMI_DATA); |
| 188 | return 0; | 203 | return 0; |
| 189 | } | 204 | } |
| 190 | 205 | ||
| 191 | udelay(1); | 206 | udelay(10); |
| 192 | } | 207 | } |
| 193 | 208 | ||
| 209 | dev_warn(&hw->pdev->dev, "%s: phy read timeout\n", hw->dev[port]->name); | ||
| 194 | return -ETIMEDOUT; | 210 | return -ETIMEDOUT; |
| 211 | io_error: | ||
| 212 | dev_err(&hw->pdev->dev, "%s: phy I/O error\n", hw->dev[port]->name); | ||
| 213 | return -EIO; | ||
| 195 | } | 214 | } |
| 196 | 215 | ||
| 197 | static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) | 216 | static inline u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg) |
| 198 | { | 217 | { |
| 199 | u16 v; | 218 | u16 v; |
| 200 | 219 | __gm_phy_read(hw, port, reg, &v); | |
| 201 | if (__gm_phy_read(hw, port, reg, &v) != 0) | ||
| 202 | printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name); | ||
| 203 | return v; | 220 | return v; |
| 204 | } | 221 | } |
| 205 | 222 | ||
| @@ -273,8 +290,6 @@ static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port) | |||
| 273 | 290 | ||
| 274 | /* disable all GMAC IRQ's */ | 291 | /* disable all GMAC IRQ's */ |
| 275 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); | 292 | sky2_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); |
| 276 | /* disable PHY IRQs */ | ||
| 277 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); | ||
| 278 | 293 | ||
| 279 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ | 294 | gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ |
| 280 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); | 295 | gma_write16(hw, port, GM_MC_ADDR_H2, 0); |
| @@ -1805,29 +1820,6 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
| 1805 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 1820 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
| 1806 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 1821 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
| 1807 | 1822 | ||
| 1808 | if (hw->flags & SKY2_HW_NEWER_PHY) { | ||
| 1809 | u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); | ||
| 1810 | u16 led = PHY_M_LEDC_LOS_CTRL(1); /* link active */ | ||
| 1811 | |||
| 1812 | switch(sky2->speed) { | ||
| 1813 | case SPEED_10: | ||
| 1814 | led |= PHY_M_LEDC_INIT_CTRL(7); | ||
| 1815 | break; | ||
| 1816 | |||
| 1817 | case SPEED_100: | ||
| 1818 | led |= PHY_M_LEDC_STA1_CTRL(7); | ||
| 1819 | break; | ||
| 1820 | |||
| 1821 | case SPEED_1000: | ||
| 1822 | led |= PHY_M_LEDC_STA0_CTRL(7); | ||
| 1823 | break; | ||
| 1824 | } | ||
| 1825 | |||
| 1826 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | ||
| 1827 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led); | ||
| 1828 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | ||
| 1829 | } | ||
| 1830 | |||
| 1831 | if (netif_msg_link(sky2)) | 1823 | if (netif_msg_link(sky2)) |
| 1832 | printk(KERN_INFO PFX | 1824 | printk(KERN_INFO PFX |
| 1833 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", | 1825 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", |
| @@ -2247,20 +2239,26 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
| 2247 | do { | 2239 | do { |
| 2248 | struct sky2_port *sky2; | 2240 | struct sky2_port *sky2; |
| 2249 | struct sky2_status_le *le = hw->st_le + hw->st_idx; | 2241 | struct sky2_status_le *le = hw->st_le + hw->st_idx; |
| 2250 | unsigned port = le->css & CSS_LINK_BIT; | 2242 | unsigned port; |
| 2251 | struct net_device *dev; | 2243 | struct net_device *dev; |
| 2252 | struct sk_buff *skb; | 2244 | struct sk_buff *skb; |
| 2253 | u32 status; | 2245 | u32 status; |
| 2254 | u16 length; | 2246 | u16 length; |
| 2247 | u8 opcode = le->opcode; | ||
| 2248 | |||
| 2249 | if (!(opcode & HW_OWNER)) | ||
| 2250 | break; | ||
| 2255 | 2251 | ||
| 2256 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); | 2252 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); |
| 2257 | 2253 | ||
| 2254 | port = le->css & CSS_LINK_BIT; | ||
| 2258 | dev = hw->dev[port]; | 2255 | dev = hw->dev[port]; |
| 2259 | sky2 = netdev_priv(dev); | 2256 | sky2 = netdev_priv(dev); |
| 2260 | length = le16_to_cpu(le->length); | 2257 | length = le16_to_cpu(le->length); |
| 2261 | status = le32_to_cpu(le->status); | 2258 | status = le32_to_cpu(le->status); |
| 2262 | 2259 | ||
| 2263 | switch (le->opcode & ~HW_OWNER) { | 2260 | le->opcode = 0; |
| 2261 | switch (opcode & ~HW_OWNER) { | ||
| 2264 | case OP_RXSTAT: | 2262 | case OP_RXSTAT: |
| 2265 | ++rx[port]; | 2263 | ++rx[port]; |
| 2266 | skb = sky2_receive(dev, length, status); | 2264 | skb = sky2_receive(dev, length, status); |
| @@ -2353,7 +2351,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) | |||
| 2353 | default: | 2351 | default: |
| 2354 | if (net_ratelimit()) | 2352 | if (net_ratelimit()) |
| 2355 | printk(KERN_WARNING PFX | 2353 | printk(KERN_WARNING PFX |
| 2356 | "unknown status opcode 0x%x\n", le->opcode); | 2354 | "unknown status opcode 0x%x\n", opcode); |
| 2357 | } | 2355 | } |
| 2358 | } while (hw->st_idx != idx); | 2356 | } while (hw->st_idx != idx); |
| 2359 | 2357 | ||
| @@ -2439,13 +2437,26 @@ static void sky2_hw_intr(struct sky2_hw *hw) | |||
| 2439 | 2437 | ||
| 2440 | if (status & Y2_IS_PCI_EXP) { | 2438 | if (status & Y2_IS_PCI_EXP) { |
| 2441 | /* PCI-Express uncorrectable Error occurred */ | 2439 | /* PCI-Express uncorrectable Error occurred */ |
| 2442 | int pos = pci_find_aer_capability(hw->pdev); | 2440 | int aer = pci_find_aer_capability(hw->pdev); |
| 2443 | u32 err; | 2441 | u32 err; |
| 2444 | 2442 | ||
| 2445 | pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_STATUS, &err); | 2443 | if (aer) { |
| 2444 | pci_read_config_dword(pdev, aer + PCI_ERR_UNCOR_STATUS, | ||
| 2445 | &err); | ||
| 2446 | pci_cleanup_aer_uncorrect_error_status(pdev); | ||
| 2447 | } else { | ||
| 2448 | /* Either AER not configured, or not working | ||
| 2449 | * because of bad MMCONFIG, so just do recover | ||
| 2450 | * manually. | ||
| 2451 | */ | ||
| 2452 | err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS); | ||
| 2453 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
| 2454 | 0xfffffffful); | ||
| 2455 | } | ||
| 2456 | |||
| 2446 | if (net_ratelimit()) | 2457 | if (net_ratelimit()) |
| 2447 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); | 2458 | dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err); |
| 2448 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2459 | |
| 2449 | } | 2460 | } |
| 2450 | 2461 | ||
| 2451 | if (status & Y2_HWE_L1_MASK) | 2462 | if (status & Y2_HWE_L1_MASK) |
| @@ -2791,6 +2802,9 @@ static void sky2_reset(struct sky2_hw *hw) | |||
| 2791 | sky2_write8(hw, B0_CTST, CS_RST_SET); | 2802 | sky2_write8(hw, B0_CTST, CS_RST_SET); |
| 2792 | sky2_write8(hw, B0_CTST, CS_RST_CLR); | 2803 | sky2_write8(hw, B0_CTST, CS_RST_CLR); |
| 2793 | 2804 | ||
| 2805 | /* allow writes to PCI config */ | ||
| 2806 | sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); | ||
| 2807 | |||
| 2794 | /* clear PCI errors, if any */ | 2808 | /* clear PCI errors, if any */ |
| 2795 | pci_read_config_word(pdev, PCI_STATUS, &status); | 2809 | pci_read_config_word(pdev, PCI_STATUS, &status); |
| 2796 | status |= PCI_STATUS_ERROR_BITS; | 2810 | status |= PCI_STATUS_ERROR_BITS; |
| @@ -2800,9 +2814,18 @@ static void sky2_reset(struct sky2_hw *hw) | |||
| 2800 | 2814 | ||
| 2801 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 2815 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); |
| 2802 | if (cap) { | 2816 | if (cap) { |
| 2803 | /* Check for advanced error reporting */ | 2817 | if (pci_find_aer_capability(pdev)) { |
| 2804 | pci_cleanup_aer_uncorrect_error_status(pdev); | 2818 | /* Check for advanced error reporting */ |
| 2805 | pci_cleanup_aer_correct_error_status(pdev); | 2819 | pci_cleanup_aer_uncorrect_error_status(pdev); |
| 2820 | pci_cleanup_aer_correct_error_status(pdev); | ||
| 2821 | } else { | ||
| 2822 | dev_warn(&pdev->dev, | ||
| 2823 | "PCI Express Advanced Error Reporting" | ||
| 2824 | " not configured or MMCONFIG problem?\n"); | ||
| 2825 | |||
| 2826 | sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS, | ||
| 2827 | 0xfffffffful); | ||
| 2828 | } | ||
| 2806 | 2829 | ||
| 2807 | /* If error bit is stuck on ignore it */ | 2830 | /* If error bit is stuck on ignore it */ |
| 2808 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) | 2831 | if (sky2_read32(hw, B0_HWE_ISRC) & Y2_IS_PCI_EXP) |
| @@ -3974,7 +3997,8 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, | |||
| 3974 | dev->tx_timeout = sky2_tx_timeout; | 3997 | dev->tx_timeout = sky2_tx_timeout; |
| 3975 | dev->watchdog_timeo = TX_WATCHDOG; | 3998 | dev->watchdog_timeo = TX_WATCHDOG; |
| 3976 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3999 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 3977 | dev->poll_controller = sky2_netpoll; | 4000 | if (port == 0) |
| 4001 | dev->poll_controller = sky2_netpoll; | ||
| 3978 | #endif | 4002 | #endif |
| 3979 | 4003 | ||
| 3980 | sky2 = netdev_priv(dev); | 4004 | sky2 = netdev_priv(dev); |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 49ee264064ab..69525fd7908d 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
| @@ -247,7 +247,8 @@ enum csr_regs { | |||
| 247 | B3_PA_CTRL = 0x01f0, | 247 | B3_PA_CTRL = 0x01f0, |
| 248 | B3_PA_TEST = 0x01f2, | 248 | B3_PA_TEST = 0x01f2, |
| 249 | 249 | ||
| 250 | Y2_CFG_SPC = 0x1c00, | 250 | Y2_CFG_SPC = 0x1c00, /* PCI config space region */ |
| 251 | Y2_CFG_AER = 0x1d00, /* PCI Advanced Error Report region */ | ||
| 251 | }; | 252 | }; |
| 252 | 253 | ||
| 253 | /* B0_CTST 16 bit Control/Status register */ | 254 | /* B0_CTST 16 bit Control/Status register */ |
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 335b7cc80eba..251a3ce376ac 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
| @@ -1218,14 +1218,8 @@ static int slip_ioctl(struct tty_struct *tty, struct file *file, unsigned int cm | |||
| 1218 | return 0; | 1218 | return 0; |
| 1219 | /* VSV changes end */ | 1219 | /* VSV changes end */ |
| 1220 | #endif | 1220 | #endif |
| 1221 | |||
| 1222 | /* Allow stty to read, but not set, the serial port */ | ||
| 1223 | case TCGETS: | ||
| 1224 | case TCGETA: | ||
| 1225 | return n_tty_ioctl(tty, file, cmd, arg); | ||
| 1226 | |||
| 1227 | default: | 1221 | default: |
| 1228 | return -ENOIOCTLCMD; | 1222 | return tty_mode_ioctl(tty, file, cmd, arg); |
| 1229 | } | 1223 | } |
| 1230 | } | 1224 | } |
| 1231 | 1225 | ||
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h index 729fd28c08b5..db34e1eb67e9 100644 --- a/drivers/net/smc91x.h +++ b/drivers/net/smc91x.h | |||
| @@ -224,6 +224,21 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg) | |||
| 224 | } | 224 | } |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | #elif defined(CONFIG_MACH_ZYLONITE) | ||
| 228 | |||
| 229 | #define SMC_CAN_USE_8BIT 1 | ||
| 230 | #define SMC_CAN_USE_16BIT 1 | ||
| 231 | #define SMC_CAN_USE_32BIT 0 | ||
| 232 | #define SMC_IO_SHIFT 0 | ||
| 233 | #define SMC_NOWAIT 1 | ||
| 234 | #define SMC_USE_PXA_DMA 1 | ||
| 235 | #define SMC_inb(a, r) readb((a) + (r)) | ||
| 236 | #define SMC_inw(a, r) readw((a) + (r)) | ||
| 237 | #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) | ||
| 238 | #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) | ||
| 239 | #define SMC_outb(v, a, r) writeb(v, (a) + (r)) | ||
| 240 | #define SMC_outw(v, a, r) writew(v, (a) + (r)) | ||
| 241 | |||
| 227 | #elif defined(CONFIG_ARCH_OMAP) | 242 | #elif defined(CONFIG_ARCH_OMAP) |
| 228 | 243 | ||
| 229 | /* We can only do 16-bit reads and writes in the static memory space. */ | 244 | /* We can only do 16-bit reads and writes in the static memory space. */ |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 5a96d74e4ce8..a12c9c41b217 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
| @@ -93,13 +93,9 @@ config USB_RTL8150 | |||
| 93 | To compile this driver as a module, choose M here: the | 93 | To compile this driver as a module, choose M here: the |
| 94 | module will be called rtl8150. | 94 | module will be called rtl8150. |
| 95 | 95 | ||
| 96 | config USB_USBNET_MII | ||
| 97 | tristate | ||
| 98 | default n | ||
| 99 | |||
| 100 | config USB_USBNET | 96 | config USB_USBNET |
| 101 | tristate "Multi-purpose USB Networking Framework" | 97 | tristate "Multi-purpose USB Networking Framework" |
| 102 | select MII if USB_USBNET_MII != n | 98 | select MII |
| 103 | ---help--- | 99 | ---help--- |
| 104 | This driver supports several kinds of network links over USB, | 100 | This driver supports several kinds of network links over USB, |
| 105 | with "minidrivers" built around a common network driver core | 101 | with "minidrivers" built around a common network driver core |
| @@ -135,7 +131,6 @@ config USB_NET_AX8817X | |||
| 135 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" | 131 | tristate "ASIX AX88xxx Based USB 2.0 Ethernet Adapters" |
| 136 | depends on USB_USBNET && NET_ETHERNET | 132 | depends on USB_USBNET && NET_ETHERNET |
| 137 | select CRC32 | 133 | select CRC32 |
| 138 | select USB_USBNET_MII | ||
| 139 | default y | 134 | default y |
| 140 | help | 135 | help |
| 141 | This option adds support for ASIX AX88xxx based USB 2.0 | 136 | This option adds support for ASIX AX88xxx based USB 2.0 |
| @@ -190,7 +185,6 @@ config USB_NET_DM9601 | |||
| 190 | tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices" | 185 | tristate "Davicom DM9601 based USB 1.1 10/100 ethernet devices" |
| 191 | depends on USB_USBNET | 186 | depends on USB_USBNET |
| 192 | select CRC32 | 187 | select CRC32 |
| 193 | select USB_USBNET_MII | ||
| 194 | help | 188 | help |
| 195 | This option adds support for Davicom DM9601 based USB 1.1 | 189 | This option adds support for Davicom DM9601 based USB 1.1 |
| 196 | 10/100 Ethernet adapters. | 190 | 10/100 Ethernet adapters. |
| @@ -225,7 +219,6 @@ config USB_NET_PLUSB | |||
| 225 | config USB_NET_MCS7830 | 219 | config USB_NET_MCS7830 |
| 226 | tristate "MosChip MCS7830 based Ethernet adapters" | 220 | tristate "MosChip MCS7830 based Ethernet adapters" |
| 227 | depends on USB_USBNET | 221 | depends on USB_USBNET |
| 228 | select USB_USBNET_MII | ||
| 229 | help | 222 | help |
| 230 | Choose this option if you're using a 10/100 Ethernet USB2 | 223 | Choose this option if you're using a 10/100 Ethernet USB2 |
| 231 | adapter based on the MosChip 7830 controller. This includes | 224 | adapter based on the MosChip 7830 controller. This includes |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index acd5f1c0e63a..8ed1fc5cbc70 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -683,9 +683,6 @@ done_nopm: | |||
| 683 | * they'll probably want to use this base set. | 683 | * they'll probably want to use this base set. |
| 684 | */ | 684 | */ |
| 685 | 685 | ||
| 686 | #if defined(CONFIG_MII) || defined(CONFIG_MII_MODULE) | ||
| 687 | #define HAVE_MII | ||
| 688 | |||
| 689 | int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd) | 686 | int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd) |
| 690 | { | 687 | { |
| 691 | struct usbnet *dev = netdev_priv(net); | 688 | struct usbnet *dev = netdev_priv(net); |
| @@ -744,8 +741,6 @@ int usbnet_nway_reset(struct net_device *net) | |||
| 744 | } | 741 | } |
| 745 | EXPORT_SYMBOL_GPL(usbnet_nway_reset); | 742 | EXPORT_SYMBOL_GPL(usbnet_nway_reset); |
| 746 | 743 | ||
| 747 | #endif /* HAVE_MII */ | ||
| 748 | |||
| 749 | void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info) | 744 | void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info) |
| 750 | { | 745 | { |
| 751 | struct usbnet *dev = netdev_priv(net); | 746 | struct usbnet *dev = netdev_priv(net); |
| @@ -776,12 +771,10 @@ EXPORT_SYMBOL_GPL(usbnet_set_msglevel); | |||
| 776 | 771 | ||
| 777 | /* drivers may override default ethtool_ops in their bind() routine */ | 772 | /* drivers may override default ethtool_ops in their bind() routine */ |
| 778 | static struct ethtool_ops usbnet_ethtool_ops = { | 773 | static struct ethtool_ops usbnet_ethtool_ops = { |
| 779 | #ifdef HAVE_MII | ||
| 780 | .get_settings = usbnet_get_settings, | 774 | .get_settings = usbnet_get_settings, |
| 781 | .set_settings = usbnet_set_settings, | 775 | .set_settings = usbnet_set_settings, |
| 782 | .get_link = usbnet_get_link, | 776 | .get_link = usbnet_get_link, |
| 783 | .nway_reset = usbnet_nway_reset, | 777 | .nway_reset = usbnet_nway_reset, |
| 784 | #endif | ||
| 785 | .get_drvinfo = usbnet_get_drvinfo, | 778 | .get_drvinfo = usbnet_get_drvinfo, |
| 786 | .get_msglevel = usbnet_get_msglevel, | 779 | .get_msglevel = usbnet_get_msglevel, |
| 787 | .set_msglevel = usbnet_set_msglevel, | 780 | .set_msglevel = usbnet_set_msglevel, |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index e396c9d2af8d..a75be57fb209 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
| @@ -146,6 +146,7 @@ static void try_fill_recv(struct virtnet_info *vi) | |||
| 146 | struct scatterlist sg[1+MAX_SKB_FRAGS]; | 146 | struct scatterlist sg[1+MAX_SKB_FRAGS]; |
| 147 | int num, err; | 147 | int num, err; |
| 148 | 148 | ||
| 149 | sg_init_table(sg, 1+MAX_SKB_FRAGS); | ||
| 149 | for (;;) { | 150 | for (;;) { |
| 150 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); | 151 | skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); |
| 151 | if (unlikely(!skb)) | 152 | if (unlikely(!skb)) |
| @@ -231,6 +232,8 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 231 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; | 232 | const unsigned char *dest = ((struct ethhdr *)skb->data)->h_dest; |
| 232 | DECLARE_MAC_BUF(mac); | 233 | DECLARE_MAC_BUF(mac); |
| 233 | 234 | ||
| 235 | sg_init_table(sg, 1+MAX_SKB_FRAGS); | ||
| 236 | |||
| 234 | pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); | 237 | pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest)); |
| 235 | 238 | ||
| 236 | free_old_xmit_skbs(vi); | 239 | free_old_xmit_skbs(vi); |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index c48b1cc63fd5..1e89d4de1bb7 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
| @@ -719,12 +719,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file, | |||
| 719 | return 0; | 719 | return 0; |
| 720 | case SIOCSIFHWADDR: | 720 | case SIOCSIFHWADDR: |
| 721 | return -EINVAL; | 721 | return -EINVAL; |
| 722 | /* Allow stty to read, but not set, the serial port */ | ||
| 723 | case TCGETS: | ||
| 724 | case TCGETA: | ||
| 725 | return n_tty_ioctl(tty, file, cmd, arg); | ||
| 726 | default: | 722 | default: |
| 727 | return -ENOIOCTLCMD; | 723 | return tty_mode_ioctl(tty, file, cmd, arg); |
| 728 | } | 724 | } |
| 729 | } | 725 | } |
| 730 | 726 | ||
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index dae5c8d5a318..2b733c582915 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
| @@ -325,7 +325,7 @@ config HERMES | |||
| 325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, | 325 | Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, |
| 326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear | 326 | IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear |
| 327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel | 327 | MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel |
| 328 | PRO/Wireless, and Symbol Spectrum24 High Rate amongst others. | 328 | IPW2011, and Symbol Spectrum24 High Rate amongst others. |
| 329 | 329 | ||
| 330 | This option includes the guts of the driver, but in order to | 330 | This option includes the guts of the driver, but in order to |
| 331 | actually use a card you will also need to enable support for PCMCIA | 331 | actually use a card you will also need to enable support for PCMCIA |
diff --git a/drivers/net/wireless/b43/Kconfig b/drivers/net/wireless/b43/Kconfig index e3c573e56b63..fdbc351ac333 100644 --- a/drivers/net/wireless/b43/Kconfig +++ b/drivers/net/wireless/b43/Kconfig | |||
| @@ -61,16 +61,18 @@ config B43_PCMCIA | |||
| 61 | 61 | ||
| 62 | If unsure, say N. | 62 | If unsure, say N. |
| 63 | 63 | ||
| 64 | # LED support | 64 | # This config option automatically enables b43 LEDS support, |
| 65 | # if it's possible. | ||
| 65 | config B43_LEDS | 66 | config B43_LEDS |
| 66 | bool | 67 | bool |
| 67 | depends on B43 && MAC80211_LEDS | 68 | depends on B43 && MAC80211_LEDS && (LEDS_CLASS = y || LEDS_CLASS = B43) |
| 68 | default y | 69 | default y |
| 69 | 70 | ||
| 70 | # RFKILL support | 71 | # This config option automatically enables b43 RFKILL support, |
| 72 | # if it's possible. | ||
| 71 | config B43_RFKILL | 73 | config B43_RFKILL |
| 72 | bool | 74 | bool |
| 73 | depends on B43 && RFKILL && RFKILL_INPUT && INPUT_POLLDEV | 75 | depends on B43 && (RFKILL = y || RFKILL = B43) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43) |
| 74 | default y | 76 | default y |
| 75 | 77 | ||
| 76 | config B43_DEBUG | 78 | config B43_DEBUG |
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c index 734e70e1a06d..ef0075d9f9cb 100644 --- a/drivers/net/wireless/b43/debugfs.c +++ b/drivers/net/wireless/b43/debugfs.c | |||
| @@ -128,7 +128,7 @@ static ssize_t shm_read_file(struct b43_wldev *dev, | |||
| 128 | __le16 *le16buf = (__le16 *)buf; | 128 | __le16 *le16buf = (__le16 *)buf; |
| 129 | 129 | ||
| 130 | for (i = 0; i < 0x1000; i++) { | 130 | for (i = 0; i < 0x1000; i++) { |
| 131 | if (bufsize <= 0) | 131 | if (bufsize < sizeof(tmp)) |
| 132 | break; | 132 | break; |
| 133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); | 133 | tmp = b43_shm_read16(dev, B43_SHM_SHARED, 2 * i); |
| 134 | le16buf[i] = cpu_to_le16(tmp); | 134 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 5058e60e5703..2b17c1dc46f1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
| @@ -2985,6 +2985,16 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
| 2985 | 2985 | ||
| 2986 | if (b43_status(dev) < B43_STAT_STARTED) | 2986 | if (b43_status(dev) < B43_STAT_STARTED) |
| 2987 | return; | 2987 | return; |
| 2988 | |||
| 2989 | /* Disable and sync interrupts. We must do this before than | ||
| 2990 | * setting the status to INITIALIZED, as the interrupt handler | ||
| 2991 | * won't care about IRQs then. */ | ||
| 2992 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
| 2993 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
| 2994 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
| 2995 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
| 2996 | b43_synchronize_irq(dev); | ||
| 2997 | |||
| 2988 | b43_set_status(dev, B43_STAT_INITIALIZED); | 2998 | b43_set_status(dev, B43_STAT_INITIALIZED); |
| 2989 | 2999 | ||
| 2990 | mutex_unlock(&wl->mutex); | 3000 | mutex_unlock(&wl->mutex); |
| @@ -2995,13 +3005,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) | |||
| 2995 | 3005 | ||
| 2996 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. | 3006 | ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. |
| 2997 | 3007 | ||
| 2998 | /* Disable and sync interrupts. */ | ||
| 2999 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
| 3000 | dev->irq_savedstate = b43_interrupt_disable(dev, B43_IRQ_ALL); | ||
| 3001 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* flush */ | ||
| 3002 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
| 3003 | b43_synchronize_irq(dev); | ||
| 3004 | |||
| 3005 | b43_mac_suspend(dev); | 3008 | b43_mac_suspend(dev); |
| 3006 | free_irq(dev->dev->irq, dev); | 3009 | free_irq(dev->dev->irq, dev); |
| 3007 | b43dbg(wl, "Wireless interface stopped\n"); | 3010 | b43dbg(wl, "Wireless interface stopped\n"); |
| @@ -3661,7 +3664,6 @@ static int b43_setup_modes(struct b43_wldev *dev, | |||
| 3661 | 3664 | ||
| 3662 | static void b43_wireless_core_detach(struct b43_wldev *dev) | 3665 | static void b43_wireless_core_detach(struct b43_wldev *dev) |
| 3663 | { | 3666 | { |
| 3664 | b43_rfkill_free(dev); | ||
| 3665 | /* We release firmware that late to not be required to re-request | 3667 | /* We release firmware that late to not be required to re-request |
| 3666 | * is all the time when we reinit the core. */ | 3668 | * is all the time when we reinit the core. */ |
| 3667 | b43_release_firmware(dev); | 3669 | b43_release_firmware(dev); |
| @@ -3747,7 +3749,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev) | |||
| 3747 | if (!wl->current_dev) | 3749 | if (!wl->current_dev) |
| 3748 | wl->current_dev = dev; | 3750 | wl->current_dev = dev; |
| 3749 | INIT_WORK(&dev->restart_work, b43_chip_reset); | 3751 | INIT_WORK(&dev->restart_work, b43_chip_reset); |
| 3750 | b43_rfkill_alloc(dev); | ||
| 3751 | 3752 | ||
| 3752 | b43_radio_turn_off(dev, 1); | 3753 | b43_radio_turn_off(dev, 1); |
| 3753 | b43_switch_analog(dev, 0); | 3754 | b43_switch_analog(dev, 0); |
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index b242a9a90dd2..b79a6bd5396d 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
| @@ -65,12 +65,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
| 65 | tuple_t tuple; | 65 | tuple_t tuple; |
| 66 | cisparse_t parse; | 66 | cisparse_t parse; |
| 67 | int err = -ENOMEM; | 67 | int err = -ENOMEM; |
| 68 | int res; | 68 | int res = 0; |
| 69 | unsigned char buf[64]; | 69 | unsigned char buf[64]; |
| 70 | 70 | ||
| 71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); | 71 | ssb = kzalloc(sizeof(*ssb), GFP_KERNEL); |
| 72 | if (!ssb) | 72 | if (!ssb) |
| 73 | goto out; | 73 | goto out_error; |
| 74 | 74 | ||
| 75 | err = -ENODEV; | 75 | err = -ENODEV; |
| 76 | tuple.DesiredTuple = CISTPL_CONFIG; | 76 | tuple.DesiredTuple = CISTPL_CONFIG; |
| @@ -96,10 +96,12 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
| 96 | dev->io.NumPorts2 = 0; | 96 | dev->io.NumPorts2 = 0; |
| 97 | dev->io.Attributes2 = 0; | 97 | dev->io.Attributes2 = 0; |
| 98 | 98 | ||
| 99 | win.Attributes = WIN_MEMORY_TYPE_CM | WIN_ENABLE | WIN_USE_WAIT; | 99 | win.Attributes = WIN_ADDR_SPACE_MEM | WIN_MEMORY_TYPE_CM | |
| 100 | WIN_ENABLE | WIN_DATA_WIDTH_16 | | ||
| 101 | WIN_USE_WAIT; | ||
| 100 | win.Base = 0; | 102 | win.Base = 0; |
| 101 | win.Size = SSB_CORE_SIZE; | 103 | win.Size = SSB_CORE_SIZE; |
| 102 | win.AccessSpeed = 1000; | 104 | win.AccessSpeed = 250; |
| 103 | res = pcmcia_request_window(&dev, &win, &dev->win); | 105 | res = pcmcia_request_window(&dev, &win, &dev->win); |
| 104 | if (res != CS_SUCCESS) | 106 | if (res != CS_SUCCESS) |
| 105 | goto err_kfree_ssb; | 107 | goto err_kfree_ssb; |
| @@ -108,21 +110,34 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) | |||
| 108 | mem.Page = 0; | 110 | mem.Page = 0; |
| 109 | res = pcmcia_map_mem_page(dev->win, &mem); | 111 | res = pcmcia_map_mem_page(dev->win, &mem); |
| 110 | if (res != CS_SUCCESS) | 112 | if (res != CS_SUCCESS) |
| 111 | goto err_kfree_ssb; | 113 | goto err_disable; |
| 114 | |||
| 115 | dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FIRST_SHARED; | ||
| 116 | dev->irq.IRQInfo1 = IRQ_LEVEL_ID | IRQ_SHARE_ID; | ||
| 117 | dev->irq.Handler = NULL; /* The handler is registered later. */ | ||
| 118 | dev->irq.Instance = NULL; | ||
| 119 | res = pcmcia_request_irq(dev, &dev->irq); | ||
| 120 | if (res != CS_SUCCESS) | ||
| 121 | goto err_disable; | ||
| 112 | 122 | ||
| 113 | res = pcmcia_request_configuration(dev, &dev->conf); | 123 | res = pcmcia_request_configuration(dev, &dev->conf); |
| 114 | if (res != CS_SUCCESS) | 124 | if (res != CS_SUCCESS) |
| 115 | goto err_disable; | 125 | goto err_disable; |
| 116 | 126 | ||
| 117 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); | 127 | err = ssb_bus_pcmciabus_register(ssb, dev, win.Base); |
| 128 | if (err) | ||
| 129 | goto err_disable; | ||
| 118 | dev->priv = ssb; | 130 | dev->priv = ssb; |
| 119 | 131 | ||
| 120 | out: | 132 | return 0; |
| 121 | return err; | 133 | |
| 122 | err_disable: | 134 | err_disable: |
| 123 | pcmcia_disable_device(dev); | 135 | pcmcia_disable_device(dev); |
| 124 | err_kfree_ssb: | 136 | err_kfree_ssb: |
| 125 | kfree(ssb); | 137 | kfree(ssb); |
| 138 | out_error: | ||
| 139 | printk(KERN_ERR "b43-pcmcia: Initialization failed (%d, %d)\n", | ||
| 140 | res, err); | ||
| 126 | return err; | 141 | return err; |
| 127 | } | 142 | } |
| 128 | 143 | ||
| @@ -131,22 +146,21 @@ static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev) | |||
| 131 | struct ssb_bus *ssb = dev->priv; | 146 | struct ssb_bus *ssb = dev->priv; |
| 132 | 147 | ||
| 133 | ssb_bus_unregister(ssb); | 148 | ssb_bus_unregister(ssb); |
| 134 | pcmcia_release_window(dev->win); | ||
| 135 | pcmcia_disable_device(dev); | 149 | pcmcia_disable_device(dev); |
| 136 | kfree(ssb); | 150 | kfree(ssb); |
| 137 | dev->priv = NULL; | 151 | dev->priv = NULL; |
| 138 | } | 152 | } |
| 139 | 153 | ||
| 140 | static struct pcmcia_driver b43_pcmcia_driver = { | 154 | static struct pcmcia_driver b43_pcmcia_driver = { |
| 141 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
| 142 | .drv = { | 156 | .drv = { |
| 143 | .name = "b43-pcmcia", | 157 | .name = "b43-pcmcia", |
| 144 | }, | 158 | }, |
| 145 | .id_table = b43_pcmcia_tbl, | 159 | .id_table = b43_pcmcia_tbl, |
| 146 | .probe = b43_pcmcia_probe, | 160 | .probe = b43_pcmcia_probe, |
| 147 | .remove = b43_pcmcia_remove, | 161 | .remove = __devexit_p(b43_pcmcia_remove), |
| 148 | .suspend = b43_pcmcia_suspend, | 162 | .suspend = b43_pcmcia_suspend, |
| 149 | .resume = b43_pcmcia_resume, | 163 | .resume = b43_pcmcia_resume, |
| 150 | }; | 164 | }; |
| 151 | 165 | ||
| 152 | int b43_pcmcia_init(void) | 166 | int b43_pcmcia_init(void) |
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c index 800e0a61a7f5..9b1f905ffbf4 100644 --- a/drivers/net/wireless/b43/rfkill.c +++ b/drivers/net/wireless/b43/rfkill.c | |||
| @@ -47,32 +47,35 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev) | |||
| 47 | struct b43_wldev *dev = poll_dev->private; | 47 | struct b43_wldev *dev = poll_dev->private; |
| 48 | struct b43_wl *wl = dev->wl; | 48 | struct b43_wl *wl = dev->wl; |
| 49 | bool enabled; | 49 | bool enabled; |
| 50 | bool report_change = 0; | ||
| 50 | 51 | ||
| 51 | mutex_lock(&wl->mutex); | 52 | mutex_lock(&wl->mutex); |
| 52 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | 53 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); |
| 53 | enabled = b43_is_hw_radio_enabled(dev); | 54 | enabled = b43_is_hw_radio_enabled(dev); |
| 54 | if (unlikely(enabled != dev->radio_hw_enable)) { | 55 | if (unlikely(enabled != dev->radio_hw_enable)) { |
| 55 | dev->radio_hw_enable = enabled; | 56 | dev->radio_hw_enable = enabled; |
| 57 | report_change = 1; | ||
| 56 | b43info(wl, "Radio hardware status changed to %s\n", | 58 | b43info(wl, "Radio hardware status changed to %s\n", |
| 57 | enabled ? "ENABLED" : "DISABLED"); | 59 | enabled ? "ENABLED" : "DISABLED"); |
| 58 | mutex_unlock(&wl->mutex); | 60 | } |
| 61 | mutex_unlock(&wl->mutex); | ||
| 62 | |||
| 63 | if (unlikely(report_change)) | ||
| 59 | input_report_key(poll_dev->input, KEY_WLAN, enabled); | 64 | input_report_key(poll_dev->input, KEY_WLAN, enabled); |
| 60 | } else | ||
| 61 | mutex_unlock(&wl->mutex); | ||
| 62 | } | 65 | } |
| 63 | 66 | ||
| 64 | /* Called when the RFKILL toggled in software. | 67 | /* Called when the RFKILL toggled in software. */ |
| 65 | * This is called without locking. */ | ||
| 66 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | 68 | static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) |
| 67 | { | 69 | { |
| 68 | struct b43_wldev *dev = data; | 70 | struct b43_wldev *dev = data; |
| 69 | struct b43_wl *wl = dev->wl; | 71 | struct b43_wl *wl = dev->wl; |
| 70 | int err = 0; | 72 | int err = 0; |
| 71 | 73 | ||
| 72 | mutex_lock(&wl->mutex); | 74 | if (!wl->rfkill.registered) |
| 73 | if (b43_status(dev) < B43_STAT_INITIALIZED) | 75 | return 0; |
| 74 | goto out_unlock; | ||
| 75 | 76 | ||
| 77 | mutex_lock(&wl->mutex); | ||
| 78 | B43_WARN_ON(b43_status(dev) < B43_STAT_INITIALIZED); | ||
| 76 | switch (state) { | 79 | switch (state) { |
| 77 | case RFKILL_STATE_ON: | 80 | case RFKILL_STATE_ON: |
| 78 | if (!dev->radio_hw_enable) { | 81 | if (!dev->radio_hw_enable) { |
| @@ -89,7 +92,6 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state) | |||
| 89 | b43_radio_turn_off(dev, 0); | 92 | b43_radio_turn_off(dev, 0); |
| 90 | break; | 93 | break; |
| 91 | } | 94 | } |
| 92 | |||
| 93 | out_unlock: | 95 | out_unlock: |
| 94 | mutex_unlock(&wl->mutex); | 96 | mutex_unlock(&wl->mutex); |
| 95 | 97 | ||
| @@ -98,11 +100,11 @@ out_unlock: | |||
| 98 | 100 | ||
| 99 | char * b43_rfkill_led_name(struct b43_wldev *dev) | 101 | char * b43_rfkill_led_name(struct b43_wldev *dev) |
| 100 | { | 102 | { |
| 101 | struct b43_wl *wl = dev->wl; | 103 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
| 102 | 104 | ||
| 103 | if (!wl->rfkill.rfkill) | 105 | if (!rfk->registered) |
| 104 | return NULL; | 106 | return NULL; |
| 105 | return rfkill_get_led_name(wl->rfkill.rfkill); | 107 | return rfkill_get_led_name(rfk->rfkill); |
| 106 | } | 108 | } |
| 107 | 109 | ||
| 108 | void b43_rfkill_init(struct b43_wldev *dev) | 110 | void b43_rfkill_init(struct b43_wldev *dev) |
| @@ -111,53 +113,13 @@ void b43_rfkill_init(struct b43_wldev *dev) | |||
| 111 | struct b43_rfkill *rfk = &(wl->rfkill); | 113 | struct b43_rfkill *rfk = &(wl->rfkill); |
| 112 | int err; | 114 | int err; |
| 113 | 115 | ||
| 114 | if (rfk->rfkill) { | 116 | rfk->registered = 0; |
| 115 | err = rfkill_register(rfk->rfkill); | ||
| 116 | if (err) { | ||
| 117 | b43warn(wl, "Failed to register RF-kill button\n"); | ||
| 118 | goto err_free_rfk; | ||
| 119 | } | ||
| 120 | } | ||
| 121 | if (rfk->poll_dev) { | ||
| 122 | err = input_register_polled_device(rfk->poll_dev); | ||
| 123 | if (err) { | ||
| 124 | b43warn(wl, "Failed to register RF-kill polldev\n"); | ||
| 125 | goto err_free_polldev; | ||
| 126 | } | ||
| 127 | } | ||
| 128 | |||
| 129 | return; | ||
| 130 | err_free_rfk: | ||
| 131 | rfkill_free(rfk->rfkill); | ||
| 132 | rfk->rfkill = NULL; | ||
| 133 | err_free_polldev: | ||
| 134 | input_free_polled_device(rfk->poll_dev); | ||
| 135 | rfk->poll_dev = NULL; | ||
| 136 | } | ||
| 137 | |||
| 138 | void b43_rfkill_exit(struct b43_wldev *dev) | ||
| 139 | { | ||
| 140 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | ||
| 141 | |||
| 142 | if (rfk->poll_dev) | ||
| 143 | input_unregister_polled_device(rfk->poll_dev); | ||
| 144 | if (rfk->rfkill) | ||
| 145 | rfkill_unregister(rfk->rfkill); | ||
| 146 | } | ||
| 147 | |||
| 148 | void b43_rfkill_alloc(struct b43_wldev *dev) | ||
| 149 | { | ||
| 150 | struct b43_wl *wl = dev->wl; | ||
| 151 | struct b43_rfkill *rfk = &(wl->rfkill); | ||
| 152 | 117 | ||
| 118 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
| 119 | if (!rfk->rfkill) | ||
| 120 | goto out_error; | ||
| 153 | snprintf(rfk->name, sizeof(rfk->name), | 121 | snprintf(rfk->name, sizeof(rfk->name), |
| 154 | "b43-%s", wiphy_name(wl->hw->wiphy)); | 122 | "b43-%s", wiphy_name(wl->hw->wiphy)); |
| 155 | |||
| 156 | rfk->rfkill = rfkill_allocate(dev->dev->dev, RFKILL_TYPE_WLAN); | ||
| 157 | if (!rfk->rfkill) { | ||
| 158 | b43warn(wl, "Failed to allocate RF-kill button\n"); | ||
| 159 | return; | ||
| 160 | } | ||
| 161 | rfk->rfkill->name = rfk->name; | 123 | rfk->rfkill->name = rfk->name; |
| 162 | rfk->rfkill->state = RFKILL_STATE_ON; | 124 | rfk->rfkill->state = RFKILL_STATE_ON; |
| 163 | rfk->rfkill->data = dev; | 125 | rfk->rfkill->data = dev; |
| @@ -165,18 +127,45 @@ void b43_rfkill_alloc(struct b43_wldev *dev) | |||
| 165 | rfk->rfkill->user_claim_unsupported = 1; | 127 | rfk->rfkill->user_claim_unsupported = 1; |
| 166 | 128 | ||
| 167 | rfk->poll_dev = input_allocate_polled_device(); | 129 | rfk->poll_dev = input_allocate_polled_device(); |
| 168 | if (rfk->poll_dev) { | 130 | if (!rfk->poll_dev) |
| 169 | rfk->poll_dev->private = dev; | 131 | goto err_free_rfk; |
| 170 | rfk->poll_dev->poll = b43_rfkill_poll; | 132 | rfk->poll_dev->private = dev; |
| 171 | rfk->poll_dev->poll_interval = 1000; /* msecs */ | 133 | rfk->poll_dev->poll = b43_rfkill_poll; |
| 172 | } else | 134 | rfk->poll_dev->poll_interval = 1000; /* msecs */ |
| 173 | b43warn(wl, "Failed to allocate RF-kill polldev\n"); | 135 | |
| 136 | err = rfkill_register(rfk->rfkill); | ||
| 137 | if (err) | ||
| 138 | goto err_free_polldev; | ||
| 139 | err = input_register_polled_device(rfk->poll_dev); | ||
| 140 | if (err) | ||
| 141 | goto err_unreg_rfk; | ||
| 142 | |||
| 143 | rfk->registered = 1; | ||
| 144 | |||
| 145 | return; | ||
| 146 | err_unreg_rfk: | ||
| 147 | rfkill_unregister(rfk->rfkill); | ||
| 148 | err_free_polldev: | ||
| 149 | input_free_polled_device(rfk->poll_dev); | ||
| 150 | rfk->poll_dev = NULL; | ||
| 151 | err_free_rfk: | ||
| 152 | rfkill_free(rfk->rfkill); | ||
| 153 | rfk->rfkill = NULL; | ||
| 154 | out_error: | ||
| 155 | rfk->registered = 0; | ||
| 156 | b43warn(wl, "RF-kill button init failed\n"); | ||
| 174 | } | 157 | } |
| 175 | 158 | ||
| 176 | void b43_rfkill_free(struct b43_wldev *dev) | 159 | void b43_rfkill_exit(struct b43_wldev *dev) |
| 177 | { | 160 | { |
| 178 | struct b43_rfkill *rfk = &(dev->wl->rfkill); | 161 | struct b43_rfkill *rfk = &(dev->wl->rfkill); |
| 179 | 162 | ||
| 163 | if (!rfk->registered) | ||
| 164 | return; | ||
| 165 | rfk->registered = 0; | ||
| 166 | |||
| 167 | input_unregister_polled_device(rfk->poll_dev); | ||
| 168 | rfkill_unregister(rfk->rfkill); | ||
| 180 | input_free_polled_device(rfk->poll_dev); | 169 | input_free_polled_device(rfk->poll_dev); |
| 181 | rfk->poll_dev = NULL; | 170 | rfk->poll_dev = NULL; |
| 182 | rfkill_free(rfk->rfkill); | 171 | rfkill_free(rfk->rfkill); |
diff --git a/drivers/net/wireless/b43/rfkill.h b/drivers/net/wireless/b43/rfkill.h index 29544e8c9e5f..adacf936d815 100644 --- a/drivers/net/wireless/b43/rfkill.h +++ b/drivers/net/wireless/b43/rfkill.h | |||
| @@ -15,14 +15,14 @@ struct b43_rfkill { | |||
| 15 | struct rfkill *rfkill; | 15 | struct rfkill *rfkill; |
| 16 | /* The poll device for the RFKILL input button */ | 16 | /* The poll device for the RFKILL input button */ |
| 17 | struct input_polled_dev *poll_dev; | 17 | struct input_polled_dev *poll_dev; |
| 18 | /* Did initialization succeed? Used for freeing. */ | ||
| 19 | bool registered; | ||
| 18 | /* The unique name of this rfkill switch */ | 20 | /* The unique name of this rfkill switch */ |
| 19 | char name[32]; | 21 | char name[sizeof("b43-phy4294967295")]; |
| 20 | }; | 22 | }; |
| 21 | 23 | ||
| 22 | /* All the init functions return void, because we are not interested | 24 | /* The init function returns void, because we are not interested |
| 23 | * in failing the b43 init process when rfkill init failed. */ | 25 | * in failing the b43 init process when rfkill init failed. */ |
| 24 | void b43_rfkill_alloc(struct b43_wldev *dev); | ||
| 25 | void b43_rfkill_free(struct b43_wldev *dev); | ||
| 26 | void b43_rfkill_init(struct b43_wldev *dev); | 26 | void b43_rfkill_init(struct b43_wldev *dev); |
| 27 | void b43_rfkill_exit(struct b43_wldev *dev); | 27 | void b43_rfkill_exit(struct b43_wldev *dev); |
| 28 | 28 | ||
| @@ -36,12 +36,6 @@ struct b43_rfkill { | |||
| 36 | /* empty */ | 36 | /* empty */ |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | static inline void b43_rfkill_alloc(struct b43_wldev *dev) | ||
| 40 | { | ||
| 41 | } | ||
| 42 | static inline void b43_rfkill_free(struct b43_wldev *dev) | ||
| 43 | { | ||
| 44 | } | ||
| 45 | static inline void b43_rfkill_init(struct b43_wldev *dev) | 39 | static inline void b43_rfkill_init(struct b43_wldev *dev) |
| 46 | { | 40 | { |
| 47 | } | 41 | } |
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c index eefa6fb79685..619b4534ef09 100644 --- a/drivers/net/wireless/b43legacy/debugfs.c +++ b/drivers/net/wireless/b43legacy/debugfs.c | |||
| @@ -124,7 +124,7 @@ static ssize_t shm_read_file(struct b43legacy_wldev *dev, char *buf, size_t bufs | |||
| 124 | __le16 *le16buf = (__le16 *)buf; | 124 | __le16 *le16buf = (__le16 *)buf; |
| 125 | 125 | ||
| 126 | for (i = 0; i < 0x1000; i++) { | 126 | for (i = 0; i < 0x1000; i++) { |
| 127 | if (bufsize <= 0) | 127 | if (bufsize < sizeof(tmp)) |
| 128 | break; | 128 | break; |
| 129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); | 129 | tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 2 * i); |
| 130 | le16buf[i] = cpu_to_le16(tmp); | 130 | le16buf[i] = cpu_to_le16(tmp); |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index f0e56dfc9ecf..3bde1e9ab428 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
| @@ -2781,6 +2781,17 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
| 2781 | 2781 | ||
| 2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) | 2782 | if (b43legacy_status(dev) < B43legacy_STAT_STARTED) |
| 2783 | return; | 2783 | return; |
| 2784 | |||
| 2785 | /* Disable and sync interrupts. We must do this before than | ||
| 2786 | * setting the status to INITIALIZED, as the interrupt handler | ||
| 2787 | * won't care about IRQs then. */ | ||
| 2788 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
| 2789 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
| 2790 | B43legacy_IRQ_ALL); | ||
| 2791 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
| 2792 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
| 2793 | b43legacy_synchronize_irq(dev); | ||
| 2794 | |||
| 2784 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); | 2795 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); |
| 2785 | 2796 | ||
| 2786 | mutex_unlock(&wl->mutex); | 2797 | mutex_unlock(&wl->mutex); |
| @@ -2791,14 +2802,6 @@ static void b43legacy_wireless_core_stop(struct b43legacy_wldev *dev) | |||
| 2791 | 2802 | ||
| 2792 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ | 2803 | ieee80211_stop_queues(wl->hw); /* FIXME this could cause a deadlock */ |
| 2793 | 2804 | ||
| 2794 | /* Disable and sync interrupts. */ | ||
| 2795 | spin_lock_irqsave(&wl->irq_lock, flags); | ||
| 2796 | dev->irq_savedstate = b43legacy_interrupt_disable(dev, | ||
| 2797 | B43legacy_IRQ_ALL); | ||
| 2798 | b43legacy_read32(dev, B43legacy_MMIO_GEN_IRQ_MASK); /* flush */ | ||
| 2799 | spin_unlock_irqrestore(&wl->irq_lock, flags); | ||
| 2800 | b43legacy_synchronize_irq(dev); | ||
| 2801 | |||
| 2802 | b43legacy_mac_suspend(dev); | 2805 | b43legacy_mac_suspend(dev); |
| 2803 | free_irq(dev->dev->irq, dev); | 2806 | free_irq(dev->dev->irq, dev); |
| 2804 | b43legacydbg(wl, "Wireless interface stopped\n"); | 2807 | b43legacydbg(wl, "Wireless interface stopped\n"); |
| @@ -3332,7 +3335,7 @@ out_mutex_unlock: | |||
| 3332 | return err; | 3335 | return err; |
| 3333 | } | 3336 | } |
| 3334 | 3337 | ||
| 3335 | void b43legacy_stop(struct ieee80211_hw *hw) | 3338 | static void b43legacy_stop(struct ieee80211_hw *hw) |
| 3336 | { | 3339 | { |
| 3337 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); | 3340 | struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); |
| 3338 | struct b43legacy_wldev *dev = wl->current_dev; | 3341 | struct b43legacy_wldev *dev = wl->current_dev; |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index 7da3664b8515..fc876ba18572 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
| @@ -444,7 +444,7 @@ static int prism2_pci_resume(struct pci_dev *pdev) | |||
| 444 | 444 | ||
| 445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); | 445 | MODULE_DEVICE_TABLE(pci, prism2_pci_id_table); |
| 446 | 446 | ||
| 447 | static struct pci_driver prism2_pci_drv_id = { | 447 | static struct pci_driver prism2_pci_driver = { |
| 448 | .name = "hostap_pci", | 448 | .name = "hostap_pci", |
| 449 | .id_table = prism2_pci_id_table, | 449 | .id_table = prism2_pci_id_table, |
| 450 | .probe = prism2_pci_probe, | 450 | .probe = prism2_pci_probe, |
| @@ -458,13 +458,13 @@ static struct pci_driver prism2_pci_drv_id = { | |||
| 458 | 458 | ||
| 459 | static int __init init_prism2_pci(void) | 459 | static int __init init_prism2_pci(void) |
| 460 | { | 460 | { |
| 461 | return pci_register_driver(&prism2_pci_drv_id); | 461 | return pci_register_driver(&prism2_pci_driver); |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | 464 | ||
| 465 | static void __exit exit_prism2_pci(void) | 465 | static void __exit exit_prism2_pci(void) |
| 466 | { | 466 | { |
| 467 | pci_unregister_driver(&prism2_pci_drv_id); | 467 | pci_unregister_driver(&prism2_pci_driver); |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | 470 | ||
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index 8d53d08b9691..fc6cdd8086c1 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
| @@ -1267,7 +1267,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv) | |||
| 1267 | IPW2100_INTA_FATAL_ERROR | | 1267 | IPW2100_INTA_FATAL_ERROR | |
| 1268 | IPW2100_INTA_PARITY_ERROR); | 1268 | IPW2100_INTA_PARITY_ERROR); |
| 1269 | } | 1269 | } |
| 1270 | } while (i--); | 1270 | } while (--i); |
| 1271 | 1271 | ||
| 1272 | /* Clear out any pending INTAs since we aren't supposed to have | 1272 | /* Clear out any pending INTAs since we aren't supposed to have |
| 1273 | * interrupts enabled at this point... */ | 1273 | * interrupts enabled at this point... */ |
| @@ -1339,7 +1339,7 @@ static int ipw2100_power_cycle_adapter(struct ipw2100_priv *priv) | |||
| 1339 | 1339 | ||
| 1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) | 1340 | if (reg & IPW_AUX_HOST_RESET_REG_MASTER_DISABLED) |
| 1341 | break; | 1341 | break; |
| 1342 | } while (i--); | 1342 | } while (--i); |
| 1343 | 1343 | ||
| 1344 | priv->status &= ~STATUS_RESET_PENDING; | 1344 | priv->status &= ~STATUS_RESET_PENDING; |
| 1345 | 1345 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 4f22a7174caf..be7c9f42a340 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
| @@ -8354,6 +8354,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 8354 | } | 8354 | } |
| 8355 | SET_IEEE80211_DEV(hw, &pdev->dev); | 8355 | SET_IEEE80211_DEV(hw, &pdev->dev); |
| 8356 | 8356 | ||
| 8357 | hw->rate_control_algorithm = "iwl-3945-rs"; | ||
| 8358 | |||
| 8357 | IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); | 8359 | IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); |
| 8358 | priv = hw->priv; | 8360 | priv = hw->priv; |
| 8359 | priv->hw = hw; | 8361 | priv->hw = hw; |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index d60adcb9bd4a..6757c6c1b25a 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
| @@ -8955,6 +8955,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 8955 | } | 8955 | } |
| 8956 | SET_IEEE80211_DEV(hw, &pdev->dev); | 8956 | SET_IEEE80211_DEV(hw, &pdev->dev); |
| 8957 | 8957 | ||
| 8958 | hw->rate_control_algorithm = "iwl-4965-rs"; | ||
| 8959 | |||
| 8958 | IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); | 8960 | IWL_DEBUG_INFO("*** LOAD DRIVER ***\n"); |
| 8959 | priv = hw->priv; | 8961 | priv = hw->priv; |
| 8960 | priv->hw = hw; | 8962 | priv->hw = hw; |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 1cbbd96fdbde..be5cfd8402c7 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
| @@ -912,6 +912,10 @@ static int wlan_cmd_set_boot2_ver(wlan_private * priv, | |||
| 912 | return 0; | 912 | return 0; |
| 913 | } | 913 | } |
| 914 | 914 | ||
| 915 | /* | ||
| 916 | * Note: NEVER use libertas_queue_cmd() with addtail==0 other than for | ||
| 917 | * the command timer, because it does not account for queued commands. | ||
| 918 | */ | ||
| 915 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) | 919 | void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u8 addtail) |
| 916 | { | 920 | { |
| 917 | unsigned long flags; | 921 | unsigned long flags; |
| @@ -941,10 +945,11 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u | |||
| 941 | 945 | ||
| 942 | spin_lock_irqsave(&adapter->driver_lock, flags); | 946 | spin_lock_irqsave(&adapter->driver_lock, flags); |
| 943 | 947 | ||
| 944 | if (addtail) | 948 | if (addtail) { |
| 945 | list_add_tail((struct list_head *)cmdnode, | 949 | list_add_tail((struct list_head *)cmdnode, |
| 946 | &adapter->cmdpendingq); | 950 | &adapter->cmdpendingq); |
| 947 | else | 951 | adapter->nr_cmd_pending++; |
| 952 | } else | ||
| 948 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); | 953 | list_add((struct list_head *)cmdnode, &adapter->cmdpendingq); |
| 949 | 954 | ||
| 950 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 955 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
| @@ -1412,7 +1417,6 @@ int libertas_prepare_and_send_command(wlan_private * priv, | |||
| 1412 | cmdnode->cmdwaitqwoken = 0; | 1417 | cmdnode->cmdwaitqwoken = 0; |
| 1413 | 1418 | ||
| 1414 | libertas_queue_cmd(adapter, cmdnode, 1); | 1419 | libertas_queue_cmd(adapter, cmdnode, 1); |
| 1415 | adapter->nr_cmd_pending++; | ||
| 1416 | wake_up_interruptible(&priv->waitq); | 1420 | wake_up_interruptible(&priv->waitq); |
| 1417 | 1421 | ||
| 1418 | if (wait_option & CMD_OPTION_WAITFORRSP) { | 1422 | if (wait_option & CMD_OPTION_WAITFORRSP) { |
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 0360cad363a8..ec89dabc412c 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
| @@ -148,11 +148,11 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r | |||
| 148 | { | 148 | { |
| 149 | int i; | 149 | int i; |
| 150 | 150 | ||
| 151 | for (i = 0; i < 500; i++) { | 151 | for (i = 0; i < 1000; i++) { |
| 152 | u8 val = if_cs_read8(card, addr); | 152 | u8 val = if_cs_read8(card, addr); |
| 153 | if (val == reg) | 153 | if (val == reg) |
| 154 | return i; | 154 | return i; |
| 155 | udelay(100); | 155 | udelay(500); |
| 156 | } | 156 | } |
| 157 | return -ETIME; | 157 | return -ETIME; |
| 158 | } | 158 | } |
| @@ -878,6 +878,9 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
| 878 | goto out3; | 878 | goto out3; |
| 879 | } | 879 | } |
| 880 | 880 | ||
| 881 | /* Clear any interrupt cause that happend while sending | ||
| 882 | * firmware/initializing card */ | ||
| 883 | if_cs_write16(card, IF_CS_C_INT_CAUSE, IF_CS_C_IC_MASK); | ||
| 881 | if_cs_enable_ints(card); | 884 | if_cs_enable_ints(card); |
| 882 | 885 | ||
| 883 | /* And finally bring the card up */ | 886 | /* And finally bring the card up */ |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index a8e17076e7de..b24425f74883 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
| @@ -182,12 +182,14 @@ static int if_sdio_handle_data(struct if_sdio_card *card, | |||
| 182 | goto out; | 182 | goto out; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE); | 185 | skb = dev_alloc_skb(MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + NET_IP_ALIGN); |
| 186 | if (!skb) { | 186 | if (!skb) { |
| 187 | ret = -ENOMEM; | 187 | ret = -ENOMEM; |
| 188 | goto out; | 188 | goto out; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | skb_reserve(skb, NET_IP_ALIGN); | ||
| 192 | |||
| 191 | data = skb_put(skb, size); | 193 | data = skb_put(skb, size); |
| 192 | 194 | ||
| 193 | memcpy(data, buffer, size); | 195 | memcpy(data, buffer, size); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 4a6a0bd01ff1..85ea8a8e658e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
| @@ -196,6 +196,14 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, | |||
| 196 | struct rt2x00_dev *rt2x00dev = hw->priv; | 196 | struct rt2x00_dev *rt2x00dev = hw->priv; |
| 197 | struct interface *intf = &rt2x00dev->interface; | 197 | struct interface *intf = &rt2x00dev->interface; |
| 198 | 198 | ||
| 199 | /* FIXME: Beaconing is broken in rt2x00. */ | ||
| 200 | if (conf->type == IEEE80211_IF_TYPE_IBSS || | ||
| 201 | conf->type == IEEE80211_IF_TYPE_AP) { | ||
| 202 | ERROR(rt2x00dev, | ||
| 203 | "rt2x00 does not support Adhoc or Master mode"); | ||
| 204 | return -EOPNOTSUPP; | ||
| 205 | } | ||
| 206 | |||
| 199 | /* | 207 | /* |
| 200 | * Don't allow interfaces to be added while | 208 | * Don't allow interfaces to be added while |
| 201 | * either the device has disappeared or when | 209 | * either the device has disappeared or when |
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index 4bd14b331862..88efe1bae58f 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
| @@ -2735,16 +2735,8 @@ static int strip_ioctl(struct tty_struct *tty, struct file *file, | |||
| 2735 | return -EFAULT; | 2735 | return -EFAULT; |
| 2736 | return set_mac_address(strip_info, &addr); | 2736 | return set_mac_address(strip_info, &addr); |
| 2737 | } | 2737 | } |
| 2738 | /* | ||
| 2739 | * Allow stty to read, but not set, the serial port | ||
| 2740 | */ | ||
| 2741 | |||
| 2742 | case TCGETS: | ||
| 2743 | case TCGETA: | ||
| 2744 | return n_tty_ioctl(tty, file, cmd, arg); | ||
| 2745 | break; | ||
| 2746 | default: | 2738 | default: |
| 2747 | return -ENOIOCTLCMD; | 2739 | return tty_mode_ioctl(tty, file, cmd, arg); |
| 2748 | break; | 2740 | break; |
| 2749 | } | 2741 | } |
| 2750 | return 0; | 2742 | return 0; |
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 78277a118b67..8e8c8b8e81ee 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c | |||
| @@ -351,8 +351,10 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
| 351 | tm->tm_sec, tm->tm_min, tm->tm_hour, | 351 | tm->tm_sec, tm->tm_min, tm->tm_hour, |
| 352 | tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday); | 352 | tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday); |
| 353 | 353 | ||
| 354 | if (rtc_valid_tm(tm) < 0) | 354 | if (rtc_valid_tm(tm) < 0) { |
| 355 | dev_err(dev, "invalid date\n"); | 355 | dev_err(dev, "invalid date\n"); |
| 356 | rtc_time_to_tm(0, tm); | ||
| 357 | } | ||
| 356 | 358 | ||
| 357 | return 0; | 359 | return 0; |
| 358 | } | 360 | } |
| @@ -588,7 +590,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev) | |||
| 588 | 590 | ||
| 589 | rtc->rtc_dev = rtc_device_register("sh", &pdev->dev, | 591 | rtc->rtc_dev = rtc_device_register("sh", &pdev->dev, |
| 590 | &sh_rtc_ops, THIS_MODULE); | 592 | &sh_rtc_ops, THIS_MODULE); |
| 591 | if (IS_ERR(rtc)) { | 593 | if (IS_ERR(rtc->rtc_dev)) { |
| 592 | ret = PTR_ERR(rtc->rtc_dev); | 594 | ret = PTR_ERR(rtc->rtc_dev); |
| 593 | goto err_badmap; | 595 | goto err_badmap; |
| 594 | } | 596 | } |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index e89ae29645d6..d24621ce799a 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
| @@ -77,7 +77,6 @@ | |||
| 77 | # define SCIF_ONLY | 77 | # define SCIF_ONLY |
| 78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
| 79 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ | 79 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ |
| 80 | # define SCI_NPORTS 2 | ||
| 81 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 80 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
| 82 | # define PACR 0xa4050100 | 81 | # define PACR 0xa4050100 |
| 83 | # define PBCR 0xa4050102 | 82 | # define PBCR 0xa4050102 |
| @@ -102,12 +101,6 @@ | |||
| 102 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 101 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
| 103 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 102 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
| 104 | # define SCIF_ONLY | 103 | # define SCIF_ONLY |
| 105 | #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) | ||
| 106 | # define SCSPTR1 0xffe00020 /* 16 bit SCIF */ | ||
| 107 | # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ | ||
| 108 | # define SCIF_ORER 0x0001 /* overrun error bit */ | ||
| 109 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | ||
| 110 | # define SCIF_ONLY | ||
| 111 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) | 104 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) |
| 112 | # include <asm/hardware.h> | 105 | # include <asm/hardware.h> |
| 113 | # define SCIF_BASE_ADDR 0x01030000 | 106 | # define SCIF_BASE_ADDR 0x01030000 |
| @@ -116,8 +109,7 @@ | |||
| 116 | # define SCIF_LSR2_OFFS 0x0000024 | 109 | # define SCIF_LSR2_OFFS 0x0000024 |
| 117 | # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ | 110 | # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ |
| 118 | # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ | 111 | # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ |
| 119 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, | 112 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */ |
| 120 | TE=1,RE=1,REIE=1 */ | ||
| 121 | # define SCIF_ONLY | 113 | # define SCIF_ONLY |
| 122 | #elif defined(CONFIG_H83007) || defined(CONFIG_H83068) | 114 | #elif defined(CONFIG_H83007) || defined(CONFIG_H83068) |
| 123 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 115 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
| @@ -577,15 +569,6 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
| 577 | return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */ | 569 | return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */ |
| 578 | return 1; | 570 | return 1; |
| 579 | } | 571 | } |
| 580 | #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) | ||
| 581 | static inline int sci_rxd_in(struct uart_port *port) | ||
| 582 | { | ||
| 583 | if (port->mapbase == 0xffe00000) | ||
| 584 | return ctrl_inw(SCSPTR1)&0x0001 ? 1 : 0; /* SCIF */ | ||
| 585 | else | ||
| 586 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ | ||
| 587 | |||
| 588 | } | ||
| 589 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) | 572 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) |
| 590 | static inline int sci_rxd_in(struct uart_port *port) | 573 | static inline int sci_rxd_in(struct uart_port *port) |
| 591 | { | 574 | { |
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index dfef83f14960..a85f2d31a686 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
| @@ -329,12 +329,14 @@ static struct uart_ops ulite_ops = { | |||
| 329 | static void ulite_console_wait_tx(struct uart_port *port) | 329 | static void ulite_console_wait_tx(struct uart_port *port) |
| 330 | { | 330 | { |
| 331 | int i; | 331 | int i; |
| 332 | u8 val; | ||
| 332 | 333 | ||
| 333 | /* wait up to 10ms for the character(s) to be sent */ | 334 | /* Spin waiting for TX fifo to have space available */ |
| 334 | for (i = 0; i < 10000; i++) { | 335 | for (i = 0; i < 100000; i++) { |
| 335 | if (readb(port->membase + ULITE_STATUS) & ULITE_STATUS_TXEMPTY) | 336 | val = readb(port->membase + ULITE_STATUS); |
| 337 | if ((val & ULITE_STATUS_TXFULL) == 0) | ||
| 336 | break; | 338 | break; |
| 337 | udelay(1); | 339 | cpu_relax(); |
| 338 | } | 340 | } |
| 339 | } | 341 | } |
| 340 | 342 | ||
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c index 7d873b3b0513..4d0282b821b5 100644 --- a/drivers/sh/superhyway/superhyway.c +++ b/drivers/sh/superhyway/superhyway.c | |||
| @@ -107,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus, | |||
| 107 | static int __init superhyway_init(void) | 107 | static int __init superhyway_init(void) |
| 108 | { | 108 | { |
| 109 | struct superhyway_bus *bus; | 109 | struct superhyway_bus *bus; |
| 110 | int ret = 0; | 110 | int ret; |
| 111 | 111 | ||
| 112 | device_register(&superhyway_bus_device); | 112 | ret = device_register(&superhyway_bus_device); |
| 113 | if (unlikely(ret)) | ||
| 114 | return ret; | ||
| 113 | 115 | ||
| 114 | for (bus = superhyway_channels; bus->ops; bus++) | 116 | for (bus = superhyway_channels; bus->ops; bus++) |
| 115 | ret |= superhyway_scan_bus(bus); | 117 | ret |= superhyway_scan_bus(bus); |
| 116 | 118 | ||
| 117 | return ret; | 119 | return ret; |
| 118 | } | 120 | } |
| 119 | |||
| 120 | postcore_initcall(superhyway_init); | 121 | postcore_initcall(superhyway_init); |
| 121 | 122 | ||
| 122 | static const struct superhyway_device_id * | 123 | static const struct superhyway_device_id * |
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index c12a741b5574..85a20546e827 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
| @@ -440,6 +440,7 @@ static int ssb_devices_register(struct ssb_bus *bus) | |||
| 440 | break; | 440 | break; |
| 441 | case SSB_BUSTYPE_PCMCIA: | 441 | case SSB_BUSTYPE_PCMCIA: |
| 442 | #ifdef CONFIG_SSB_PCMCIAHOST | 442 | #ifdef CONFIG_SSB_PCMCIAHOST |
| 443 | sdev->irq = bus->host_pcmcia->irq.AssignedIRQ; | ||
| 443 | dev->parent = &bus->host_pcmcia->dev; | 444 | dev->parent = &bus->host_pcmcia->dev; |
| 444 | #endif | 445 | #endif |
| 445 | break; | 446 | break; |
| @@ -1147,7 +1148,10 @@ static int __init ssb_modinit(void) | |||
| 1147 | 1148 | ||
| 1148 | return err; | 1149 | return err; |
| 1149 | } | 1150 | } |
| 1150 | subsys_initcall(ssb_modinit); | 1151 | /* ssb must be initialized after PCI but before the ssb drivers. |
| 1152 | * That means we must use some initcall between subsys_initcall | ||
| 1153 | * and device_initcall. */ | ||
| 1154 | fs_initcall(ssb_modinit); | ||
| 1151 | 1155 | ||
| 1152 | static void __exit ssb_modexit(void) | 1156 | static void __exit ssb_modexit(void) |
| 1153 | { | 1157 | { |
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c index b6abee846f02..bb44a76b3eb5 100644 --- a/drivers/ssb/pcmcia.c +++ b/drivers/ssb/pcmcia.c | |||
| @@ -63,17 +63,17 @@ int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus, | |||
| 63 | err = pcmcia_access_configuration_register(pdev, ®); | 63 | err = pcmcia_access_configuration_register(pdev, ®); |
| 64 | if (err != CS_SUCCESS) | 64 | if (err != CS_SUCCESS) |
| 65 | goto error; | 65 | goto error; |
| 66 | read_addr |= (reg.Value & 0xF) << 12; | 66 | read_addr |= ((u32)(reg.Value & 0x0F)) << 12; |
| 67 | reg.Offset = 0x30; | 67 | reg.Offset = 0x30; |
| 68 | err = pcmcia_access_configuration_register(pdev, ®); | 68 | err = pcmcia_access_configuration_register(pdev, ®); |
| 69 | if (err != CS_SUCCESS) | 69 | if (err != CS_SUCCESS) |
| 70 | goto error; | 70 | goto error; |
| 71 | read_addr |= reg.Value << 16; | 71 | read_addr |= ((u32)reg.Value) << 16; |
| 72 | reg.Offset = 0x32; | 72 | reg.Offset = 0x32; |
| 73 | err = pcmcia_access_configuration_register(pdev, ®); | 73 | err = pcmcia_access_configuration_register(pdev, ®); |
| 74 | if (err != CS_SUCCESS) | 74 | if (err != CS_SUCCESS) |
| 75 | goto error; | 75 | goto error; |
| 76 | read_addr |= reg.Value << 24; | 76 | read_addr |= ((u32)reg.Value) << 24; |
| 77 | 77 | ||
| 78 | cur_core = (read_addr - SSB_ENUM_BASE) / SSB_CORE_SIZE; | 78 | cur_core = (read_addr - SSB_ENUM_BASE) / SSB_CORE_SIZE; |
| 79 | if (cur_core == coreidx) | 79 | if (cur_core == coreidx) |
| @@ -152,28 +152,29 @@ error: | |||
| 152 | goto out_unlock; | 152 | goto out_unlock; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | /* These are the main device register access functions. | 155 | static int select_core_and_segment(struct ssb_device *dev, |
| 156 | * do_select_core is inline to have the likely hotpath inline. | 156 | u16 *offset) |
| 157 | * All unlikely codepaths are out-of-line. */ | ||
| 158 | static inline int do_select_core(struct ssb_bus *bus, | ||
| 159 | struct ssb_device *dev, | ||
| 160 | u16 *offset) | ||
| 161 | { | 157 | { |
| 158 | struct ssb_bus *bus = dev->bus; | ||
| 162 | int err; | 159 | int err; |
| 163 | u8 need_seg = (*offset >= 0x800) ? 1 : 0; | 160 | u8 need_segment; |
| 161 | |||
| 162 | if (*offset >= 0x800) { | ||
| 163 | *offset -= 0x800; | ||
| 164 | need_segment = 1; | ||
| 165 | } else | ||
| 166 | need_segment = 0; | ||
| 164 | 167 | ||
| 165 | if (unlikely(dev != bus->mapped_device)) { | 168 | if (unlikely(dev != bus->mapped_device)) { |
| 166 | err = ssb_pcmcia_switch_core(bus, dev); | 169 | err = ssb_pcmcia_switch_core(bus, dev); |
| 167 | if (unlikely(err)) | 170 | if (unlikely(err)) |
| 168 | return err; | 171 | return err; |
| 169 | } | 172 | } |
| 170 | if (unlikely(need_seg != bus->mapped_pcmcia_seg)) { | 173 | if (unlikely(need_segment != bus->mapped_pcmcia_seg)) { |
| 171 | err = ssb_pcmcia_switch_segment(bus, need_seg); | 174 | err = ssb_pcmcia_switch_segment(bus, need_segment); |
| 172 | if (unlikely(err)) | 175 | if (unlikely(err)) |
| 173 | return err; | 176 | return err; |
| 174 | } | 177 | } |
| 175 | if (need_seg == 1) | ||
| 176 | *offset -= 0x800; | ||
| 177 | 178 | ||
| 178 | return 0; | 179 | return 0; |
| 179 | } | 180 | } |
| @@ -181,32 +182,31 @@ static inline int do_select_core(struct ssb_bus *bus, | |||
| 181 | static u16 ssb_pcmcia_read16(struct ssb_device *dev, u16 offset) | 182 | static u16 ssb_pcmcia_read16(struct ssb_device *dev, u16 offset) |
| 182 | { | 183 | { |
| 183 | struct ssb_bus *bus = dev->bus; | 184 | struct ssb_bus *bus = dev->bus; |
| 184 | u16 x; | ||
| 185 | 185 | ||
| 186 | if (unlikely(do_select_core(bus, dev, &offset))) | 186 | if (unlikely(select_core_and_segment(dev, &offset))) |
| 187 | return 0xFFFF; | 187 | return 0xFFFF; |
| 188 | x = readw(bus->mmio + offset); | ||
| 189 | 188 | ||
| 190 | return x; | 189 | return readw(bus->mmio + offset); |
| 191 | } | 190 | } |
| 192 | 191 | ||
| 193 | static u32 ssb_pcmcia_read32(struct ssb_device *dev, u16 offset) | 192 | static u32 ssb_pcmcia_read32(struct ssb_device *dev, u16 offset) |
| 194 | { | 193 | { |
| 195 | struct ssb_bus *bus = dev->bus; | 194 | struct ssb_bus *bus = dev->bus; |
| 196 | u32 x; | 195 | u32 lo, hi; |
| 197 | 196 | ||
| 198 | if (unlikely(do_select_core(bus, dev, &offset))) | 197 | if (unlikely(select_core_and_segment(dev, &offset))) |
| 199 | return 0xFFFFFFFF; | 198 | return 0xFFFFFFFF; |
| 200 | x = readl(bus->mmio + offset); | 199 | lo = readw(bus->mmio + offset); |
| 200 | hi = readw(bus->mmio + offset + 2); | ||
| 201 | 201 | ||
| 202 | return x; | 202 | return (lo | (hi << 16)); |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | static void ssb_pcmcia_write16(struct ssb_device *dev, u16 offset, u16 value) | 205 | static void ssb_pcmcia_write16(struct ssb_device *dev, u16 offset, u16 value) |
| 206 | { | 206 | { |
| 207 | struct ssb_bus *bus = dev->bus; | 207 | struct ssb_bus *bus = dev->bus; |
| 208 | 208 | ||
| 209 | if (unlikely(do_select_core(bus, dev, &offset))) | 209 | if (unlikely(select_core_and_segment(dev, &offset))) |
| 210 | return; | 210 | return; |
| 211 | writew(value, bus->mmio + offset); | 211 | writew(value, bus->mmio + offset); |
| 212 | } | 212 | } |
| @@ -215,12 +215,12 @@ static void ssb_pcmcia_write32(struct ssb_device *dev, u16 offset, u32 value) | |||
| 215 | { | 215 | { |
| 216 | struct ssb_bus *bus = dev->bus; | 216 | struct ssb_bus *bus = dev->bus; |
| 217 | 217 | ||
| 218 | if (unlikely(do_select_core(bus, dev, &offset))) | 218 | if (unlikely(select_core_and_segment(dev, &offset))) |
| 219 | return; | 219 | return; |
| 220 | readw(bus->mmio + offset); | 220 | writeb((value & 0xFF000000) >> 24, bus->mmio + offset + 3); |
| 221 | writew(value >> 16, bus->mmio + offset + 2); | 221 | writeb((value & 0x00FF0000) >> 16, bus->mmio + offset + 2); |
| 222 | readw(bus->mmio + offset); | 222 | writeb((value & 0x0000FF00) >> 8, bus->mmio + offset + 1); |
| 223 | writew(value, bus->mmio + offset); | 223 | writeb((value & 0x000000FF) >> 0, bus->mmio + offset + 0); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | /* Not "static", as it's used in main.c */ | 226 | /* Not "static", as it's used in main.c */ |
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 5fb8675e0d6b..d0e4cb618269 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c | |||
| @@ -874,6 +874,8 @@ static int cyber2000fb_set_par(struct fb_info *info) | |||
| 874 | default: | 874 | default: |
| 875 | BUG(); | 875 | BUG(); |
| 876 | } | 876 | } |
| 877 | break; | ||
| 878 | |||
| 877 | case 24:/* TRUECOLOUR, 16m */ | 879 | case 24:/* TRUECOLOUR, 16m */ |
| 878 | hw.co_pixfmt = CO_PIXFMT_24BPP; | 880 | hw.co_pixfmt = CO_PIXFMT_24BPP; |
| 879 | hw.width *= 3; | 881 | hw.width *= 3; |
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 0e4baca21b8f..1dc04b6684e6 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
| @@ -53,7 +53,7 @@ struct vring_virtqueue | |||
| 53 | unsigned int num_added; | 53 | unsigned int num_added; |
| 54 | 54 | ||
| 55 | /* Last used index we've seen. */ | 55 | /* Last used index we've seen. */ |
| 56 | unsigned int last_used_idx; | 56 | u16 last_used_idx; |
| 57 | 57 | ||
| 58 | /* How to notify other side. FIXME: commonalize hcalls! */ | 58 | /* How to notify other side. FIXME: commonalize hcalls! */ |
| 59 | void (*notify)(struct virtqueue *vq); | 59 | void (*notify)(struct virtqueue *vq); |
| @@ -277,11 +277,17 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
| 277 | struct vring_virtqueue *vq; | 277 | struct vring_virtqueue *vq; |
| 278 | unsigned int i; | 278 | unsigned int i; |
| 279 | 279 | ||
| 280 | /* We assume num is a power of 2. */ | ||
| 281 | if (num & (num - 1)) { | ||
| 282 | dev_warn(&vdev->dev, "Bad virtqueue length %u\n", num); | ||
| 283 | return NULL; | ||
| 284 | } | ||
| 285 | |||
| 280 | vq = kmalloc(sizeof(*vq) + sizeof(void *)*num, GFP_KERNEL); | 286 | vq = kmalloc(sizeof(*vq) + sizeof(void *)*num, GFP_KERNEL); |
| 281 | if (!vq) | 287 | if (!vq) |
| 282 | return NULL; | 288 | return NULL; |
| 283 | 289 | ||
| 284 | vring_init(&vq->vring, num, pages); | 290 | vring_init(&vq->vring, num, pages, PAGE_SIZE); |
| 285 | vq->vq.callback = callback; | 291 | vq->vq.callback = callback; |
| 286 | vq->vq.vdev = vdev; | 292 | vq->vq.vdev = vdev; |
| 287 | vq->vq.vq_ops = &vring_vq_ops; | 293 | vq->vq.vq_ops = &vring_vq_ops; |
diff --git a/fs/Kconfig b/fs/Kconfig index c75c95406497..429a00228507 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
| @@ -2007,7 +2007,7 @@ config CIFS_EXPERIMENTAL | |||
| 2007 | config CIFS_UPCALL | 2007 | config CIFS_UPCALL |
| 2008 | bool "Kerberos/SPNEGO advanced session setup (EXPERIMENTAL)" | 2008 | bool "Kerberos/SPNEGO advanced session setup (EXPERIMENTAL)" |
| 2009 | depends on CIFS_EXPERIMENTAL | 2009 | depends on CIFS_EXPERIMENTAL |
| 2010 | depends on CONNECTOR | 2010 | depends on KEYS |
| 2011 | help | 2011 | help |
| 2012 | Enables an upcall mechanism for CIFS which will be used to contact | 2012 | Enables an upcall mechanism for CIFS which will be used to contact |
| 2013 | userspace helper utilities to provide SPNEGO packaged Kerberos | 2013 | userspace helper utilities to provide SPNEGO packaged Kerberos |
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES index 3d419163c3d3..64dd22239b21 100644 --- a/fs/cifs/CHANGES +++ b/fs/cifs/CHANGES | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | Version 1.52 | ||
| 2 | ------------ | ||
| 3 | Fix oops on second mount to server when null auth is used. | ||
| 4 | |||
| 1 | Version 1.51 | 5 | Version 1.51 |
| 2 | ------------ | 6 | ------------ |
| 3 | Fix memory leak in statfs when mounted to very old servers (e.g. | 7 | Fix memory leak in statfs when mounted to very old servers (e.g. |
| @@ -12,7 +16,12 @@ leak that causes cifsd not to stop and rmmod to fail to cleanup | |||
| 12 | cifs_request_buffers pool. Fix problem with POSIX Open/Mkdir on | 16 | cifs_request_buffers pool. Fix problem with POSIX Open/Mkdir on |
| 13 | bigendian architectures. Fix possible memory corruption when | 17 | bigendian architectures. Fix possible memory corruption when |
| 14 | EAGAIN returned on kern_recvmsg. Return better error if server | 18 | EAGAIN returned on kern_recvmsg. Return better error if server |
| 15 | requires packet signing but client has disabled it. | 19 | requires packet signing but client has disabled it. When mounted |
| 20 | with cifsacl mount option - mode bits are approximated based | ||
| 21 | on the contents of the ACL of the file or directory. When cifs | ||
| 22 | mount helper is missing convert make sure that UNC name | ||
| 23 | has backslash (not forward slash) between ip address of server | ||
| 24 | and the share name. | ||
| 16 | 25 | ||
| 17 | Version 1.50 | 26 | Version 1.50 |
| 18 | ------------ | 27 | ------------ |
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile index ff6ba8d823f0..45e42fb97c19 100644 --- a/fs/cifs/Makefile +++ b/fs/cifs/Makefile | |||
| @@ -3,4 +3,9 @@ | |||
| 3 | # | 3 | # |
| 4 | obj-$(CONFIG_CIFS) += cifs.o | 4 | obj-$(CONFIG_CIFS) += cifs.o |
| 5 | 5 | ||
| 6 | cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o cifsacl.o | 6 | cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ |
| 7 | link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \ | ||
| 8 | md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o \ | ||
| 9 | readdir.o ioctl.o sess.o export.o cifsacl.o | ||
| 10 | |||
| 11 | cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o | ||
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c index 2a01f3ef96a0..bcda2c6b6a04 100644 --- a/fs/cifs/asn1.c +++ b/fs/cifs/asn1.c | |||
| @@ -77,8 +77,12 @@ | |||
| 77 | 77 | ||
| 78 | #define SPNEGO_OID_LEN 7 | 78 | #define SPNEGO_OID_LEN 7 |
| 79 | #define NTLMSSP_OID_LEN 10 | 79 | #define NTLMSSP_OID_LEN 10 |
| 80 | #define KRB5_OID_LEN 7 | ||
| 81 | #define MSKRB5_OID_LEN 7 | ||
| 80 | static unsigned long SPNEGO_OID[7] = { 1, 3, 6, 1, 5, 5, 2 }; | 82 | static unsigned long SPNEGO_OID[7] = { 1, 3, 6, 1, 5, 5, 2 }; |
| 81 | static unsigned long NTLMSSP_OID[10] = { 1, 3, 6, 1, 4, 1, 311, 2, 2, 10 }; | 83 | static unsigned long NTLMSSP_OID[10] = { 1, 3, 6, 1, 4, 1, 311, 2, 2, 10 }; |
| 84 | static unsigned long KRB5_OID[7] = { 1, 2, 840, 113554, 1, 2, 2 }; | ||
| 85 | static unsigned long MSKRB5_OID[7] = { 1, 2, 840, 48018, 1, 2, 2 }; | ||
| 82 | 86 | ||
| 83 | /* | 87 | /* |
| 84 | * ASN.1 context. | 88 | * ASN.1 context. |
| @@ -457,6 +461,7 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
| 457 | unsigned long *oid = NULL; | 461 | unsigned long *oid = NULL; |
| 458 | unsigned int cls, con, tag, oidlen, rc; | 462 | unsigned int cls, con, tag, oidlen, rc; |
| 459 | int use_ntlmssp = FALSE; | 463 | int use_ntlmssp = FALSE; |
| 464 | int use_kerberos = FALSE; | ||
| 460 | 465 | ||
| 461 | *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/ | 466 | *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/ |
| 462 | 467 | ||
| @@ -545,18 +550,28 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
| 545 | return 0; | 550 | return 0; |
| 546 | } | 551 | } |
| 547 | if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { | 552 | if ((tag == ASN1_OJI) && (con == ASN1_PRI)) { |
| 548 | rc = asn1_oid_decode(&ctx, end, &oid, &oidlen); | 553 | if (asn1_oid_decode(&ctx, end, &oid, &oidlen)) { |
| 549 | if (rc) { | 554 | |
| 550 | cFYI(1, | 555 | cFYI(1, |
| 551 | ("OID len = %d oid = 0x%lx 0x%lx " | 556 | ("OID len = %d oid = 0x%lx 0x%lx " |
| 552 | "0x%lx 0x%lx", | 557 | "0x%lx 0x%lx", |
| 553 | oidlen, *oid, *(oid + 1), | 558 | oidlen, *oid, *(oid + 1), |
| 554 | *(oid + 2), *(oid + 3))); | 559 | *(oid + 2), *(oid + 3))); |
| 555 | rc = compare_oid(oid, oidlen, | 560 | |
| 556 | NTLMSSP_OID, NTLMSSP_OID_LEN); | 561 | if (compare_oid(oid, oidlen, |
| 557 | kfree(oid); | 562 | MSKRB5_OID, |
| 558 | if (rc) | 563 | MSKRB5_OID_LEN)) |
| 564 | use_kerberos = TRUE; | ||
| 565 | else if (compare_oid(oid, oidlen, | ||
| 566 | KRB5_OID, | ||
| 567 | KRB5_OID_LEN)) | ||
| 568 | use_kerberos = TRUE; | ||
| 569 | else if (compare_oid(oid, oidlen, | ||
| 570 | NTLMSSP_OID, | ||
| 571 | NTLMSSP_OID_LEN)) | ||
| 559 | use_ntlmssp = TRUE; | 572 | use_ntlmssp = TRUE; |
| 573 | |||
| 574 | kfree(oid); | ||
| 560 | } | 575 | } |
| 561 | } else { | 576 | } else { |
| 562 | cFYI(1, ("Should be an oid what is going on?")); | 577 | cFYI(1, ("Should be an oid what is going on?")); |
| @@ -609,12 +624,10 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
| 609 | ctx.pointer)); /* is this UTF-8 or ASCII? */ | 624 | ctx.pointer)); /* is this UTF-8 or ASCII? */ |
| 610 | } | 625 | } |
| 611 | 626 | ||
| 612 | /* if (use_kerberos) | 627 | if (use_kerberos) |
| 613 | *secType = Kerberos | 628 | *secType = Kerberos; |
| 614 | else */ | 629 | else if (use_ntlmssp) |
| 615 | if (use_ntlmssp) { | ||
| 616 | *secType = NTLMSSP; | 630 | *secType = NTLMSSP; |
| 617 | } | ||
| 618 | 631 | ||
| 619 | return 1; | 632 | return 1; |
| 620 | } | 633 | } |
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c new file mode 100644 index 000000000000..ad54a3a6e434 --- /dev/null +++ b/fs/cifs/cifs_spnego.c | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | /* | ||
| 2 | * fs/cifs/cifs_spnego.c -- SPNEGO upcall management for CIFS | ||
| 3 | * | ||
| 4 | * Copyright (c) 2007 Red Hat, Inc. | ||
| 5 | * Author(s): Jeff Layton (jlayton@redhat.com) | ||
| 6 | * | ||
| 7 | * This library is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU Lesser General Public License as published | ||
| 9 | * by the Free Software Foundation; either version 2.1 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This library is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
| 15 | * the GNU Lesser General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU Lesser General Public License | ||
| 18 | * along with this library; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/list.h> | ||
| 23 | #include <linux/string.h> | ||
| 24 | #include <keys/user-type.h> | ||
| 25 | #include <linux/key-type.h> | ||
| 26 | #include "cifsglob.h" | ||
| 27 | #include "cifs_spnego.h" | ||
| 28 | #include "cifs_debug.h" | ||
| 29 | |||
| 30 | /* create a new cifs key */ | ||
| 31 | static int | ||
| 32 | cifs_spnego_key_instantiate(struct key *key, const void *data, size_t datalen) | ||
| 33 | { | ||
| 34 | char *payload; | ||
| 35 | int ret; | ||
| 36 | |||
| 37 | ret = -ENOMEM; | ||
| 38 | payload = kmalloc(datalen, GFP_KERNEL); | ||
| 39 | if (!payload) | ||
| 40 | goto error; | ||
| 41 | |||
| 42 | /* attach the data */ | ||
| 43 | memcpy(payload, data, datalen); | ||
| 44 | rcu_assign_pointer(key->payload.data, payload); | ||
| 45 | ret = 0; | ||
| 46 | |||
| 47 | error: | ||
| 48 | return ret; | ||
| 49 | } | ||
| 50 | |||
| 51 | static void | ||
| 52 | cifs_spnego_key_destroy(struct key *key) | ||
| 53 | { | ||
| 54 | kfree(key->payload.data); | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | /* | ||
| 59 | * keytype for CIFS spnego keys | ||
| 60 | */ | ||
| 61 | struct key_type cifs_spnego_key_type = { | ||
| 62 | .name = "cifs.spnego", | ||
| 63 | .instantiate = cifs_spnego_key_instantiate, | ||
| 64 | .match = user_match, | ||
| 65 | .destroy = cifs_spnego_key_destroy, | ||
| 66 | .describe = user_describe, | ||
| 67 | }; | ||
| 68 | |||
| 69 | /* get a key struct with a SPNEGO security blob, suitable for session setup */ | ||
| 70 | struct key * | ||
| 71 | cifs_get_spnego_key(struct cifsSesInfo *sesInfo, const char *hostname) | ||
| 72 | { | ||
| 73 | struct TCP_Server_Info *server = sesInfo->server; | ||
| 74 | char *description, *dp; | ||
| 75 | size_t desc_len; | ||
| 76 | struct key *spnego_key; | ||
| 77 | |||
| 78 | |||
| 79 | /* version + ;ip{4|6}= + address + ;host=hostname + | ||
| 80 | ;sec= + ;uid= + NULL */ | ||
| 81 | desc_len = 4 + 5 + 32 + 1 + 5 + strlen(hostname) + | ||
| 82 | strlen(";sec=krb5") + 7 + sizeof(uid_t)*2 + 1; | ||
| 83 | spnego_key = ERR_PTR(-ENOMEM); | ||
| 84 | description = kzalloc(desc_len, GFP_KERNEL); | ||
| 85 | if (description == NULL) | ||
| 86 | goto out; | ||
| 87 | |||
| 88 | dp = description; | ||
| 89 | /* start with version and hostname portion of UNC string */ | ||
| 90 | spnego_key = ERR_PTR(-EINVAL); | ||
| 91 | sprintf(dp, "0x%2.2x;host=%s;", CIFS_SPNEGO_UPCALL_VERSION, | ||
| 92 | hostname); | ||
| 93 | dp = description + strlen(description); | ||
| 94 | |||
| 95 | /* add the server address */ | ||
| 96 | if (server->addr.sockAddr.sin_family == AF_INET) | ||
| 97 | sprintf(dp, "ip4=" NIPQUAD_FMT, | ||
| 98 | NIPQUAD(server->addr.sockAddr.sin_addr)); | ||
| 99 | else if (server->addr.sockAddr.sin_family == AF_INET6) | ||
| 100 | sprintf(dp, "ip6=" NIP6_SEQFMT, | ||
| 101 | NIP6(server->addr.sockAddr6.sin6_addr)); | ||
| 102 | else | ||
| 103 | goto out; | ||
| 104 | |||
| 105 | dp = description + strlen(description); | ||
| 106 | |||
| 107 | /* for now, only sec=krb5 is valid */ | ||
| 108 | if (server->secType == Kerberos) | ||
| 109 | sprintf(dp, ";sec=krb5"); | ||
| 110 | else | ||
| 111 | goto out; | ||
| 112 | |||
| 113 | dp = description + strlen(description); | ||
| 114 | sprintf(dp, ";uid=0x%x", sesInfo->linux_uid); | ||
| 115 | |||
| 116 | cFYI(1, ("key description = %s", description)); | ||
| 117 | spnego_key = request_key(&cifs_spnego_key_type, description, ""); | ||
| 118 | |||
| 119 | if (cifsFYI && !IS_ERR(spnego_key)) { | ||
| 120 | struct cifs_spnego_msg *msg = spnego_key->payload.data; | ||
| 121 | cifs_dump_mem("SPNEGO reply blob:", msg->data, | ||
| 122 | msg->secblob_len + msg->sesskey_len); | ||
| 123 | } | ||
| 124 | |||
| 125 | out: | ||
| 126 | kfree(description); | ||
| 127 | return spnego_key; | ||
| 128 | } | ||
diff --git a/fs/cifs/cifs_spnego.h b/fs/cifs/cifs_spnego.h new file mode 100644 index 000000000000..f443f3b35134 --- /dev/null +++ b/fs/cifs/cifs_spnego.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * fs/cifs/cifs_spnego.h -- SPNEGO upcall management for CIFS | ||
| 3 | * | ||
| 4 | * Copyright (c) 2007 Red Hat, Inc. | ||
| 5 | * Author(s): Jeff Layton (jlayton@redhat.com) | ||
| 6 | * Steve French (sfrench@us.ibm.com) | ||
| 7 | * | ||
| 8 | * This library is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU Lesser General Public License as published | ||
| 10 | * by the Free Software Foundation; either version 2.1 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This library is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
| 16 | * the GNU Lesser General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU Lesser General Public License | ||
| 19 | * along with this library; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _CIFS_SPNEGO_H | ||
| 24 | #define _CIFS_SPNEGO_H | ||
| 25 | |||
| 26 | #define CIFS_SPNEGO_UPCALL_VERSION 1 | ||
| 27 | |||
| 28 | /* | ||
| 29 | * The version field should always be set to CIFS_SPNEGO_UPCALL_VERSION. | ||
| 30 | * The flags field is for future use. The request-key callout should set | ||
| 31 | * sesskey_len and secblob_len, and then concatenate the SessKey+SecBlob | ||
| 32 | * and stuff it in the data field. | ||
| 33 | */ | ||
| 34 | struct cifs_spnego_msg { | ||
| 35 | uint32_t version; | ||
| 36 | uint32_t flags; | ||
| 37 | uint32_t sesskey_len; | ||
| 38 | uint32_t secblob_len; | ||
| 39 | uint8_t data[1]; | ||
| 40 | }; | ||
| 41 | |||
| 42 | #ifdef __KERNEL__ | ||
| 43 | extern struct key_type cifs_spnego_key_type; | ||
| 44 | #endif /* KERNEL */ | ||
| 45 | |||
| 46 | #endif /* _CIFS_SPNEGO_H */ | ||
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index e8e56353f5a1..dabbce00712b 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
| @@ -38,13 +38,13 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { | |||
| 38 | {{1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(18), 0, 0, 0, 0} }, "sys"}, | 38 | {{1, 1, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(18), 0, 0, 0, 0} }, "sys"}, |
| 39 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(544), 0, 0, 0} }, "root"}, | 39 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(544), 0, 0, 0} }, "root"}, |
| 40 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(545), 0, 0, 0} }, "users"}, | 40 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(545), 0, 0, 0} }, "users"}, |
| 41 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(546), 0, 0, 0} }, "guest"} | 41 | {{1, 2, {0, 0, 0, 0, 0, 5}, {cpu_to_le32(32), cpu_to_le32(546), 0, 0, 0} }, "guest"} } |
| 42 | }; | 42 | ; |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | /* security id for everyone */ | 45 | /* security id for everyone */ |
| 46 | static const struct cifs_sid sid_everyone = | 46 | static const struct cifs_sid sid_everyone = { |
| 47 | {1, 1, {0, 0, 0, 0, 0, 0}, {} }; | 47 | 1, 1, {0, 0, 0, 0, 0, 1}, {0} }; |
| 48 | /* group users */ | 48 | /* group users */ |
| 49 | static const struct cifs_sid sid_user = | 49 | static const struct cifs_sid sid_user = |
| 50 | {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; | 50 | {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; |
| @@ -97,7 +97,7 @@ int match_sid(struct cifs_sid *ctsid) | |||
| 97 | 97 | ||
| 98 | /* if the two SIDs (roughly equivalent to a UUID for a user or group) are | 98 | /* if the two SIDs (roughly equivalent to a UUID for a user or group) are |
| 99 | the same returns 1, if they do not match returns 0 */ | 99 | the same returns 1, if they do not match returns 0 */ |
| 100 | int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid) | 100 | int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) |
| 101 | { | 101 | { |
| 102 | int i; | 102 | int i; |
| 103 | int num_subauth, num_sat, num_saw; | 103 | int num_subauth, num_sat, num_saw; |
| @@ -129,66 +129,142 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid) | |||
| 129 | return (1); /* sids compare/match */ | 129 | return (1); /* sids compare/match */ |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | /* | ||
| 133 | change posix mode to reflect permissions | ||
| 134 | pmode is the existing mode (we only want to overwrite part of this | ||
| 135 | bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007 | ||
| 136 | */ | ||
| 137 | static void access_flags_to_mode(__u32 ace_flags, int type, umode_t *pmode, | ||
| 138 | umode_t *pbits_to_set) | ||
| 139 | { | ||
| 140 | /* the order of ACEs is important. The canonical order is to begin with | ||
| 141 | DENY entries followed by ALLOW, otherwise an allow entry could be | ||
| 142 | encountered first, making the subsequent deny entry like "dead code" | ||
| 143 | which would be superflous since Windows stops when a match is made | ||
| 144 | for the operation you are trying to perform for your user */ | ||
| 145 | |||
| 146 | /* For deny ACEs we change the mask so that subsequent allow access | ||
| 147 | control entries do not turn on the bits we are denying */ | ||
| 148 | if (type == ACCESS_DENIED) { | ||
| 149 | if (ace_flags & GENERIC_ALL) { | ||
| 150 | *pbits_to_set &= ~S_IRWXUGO; | ||
| 151 | } | ||
| 152 | if ((ace_flags & GENERIC_WRITE) || | ||
| 153 | ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) | ||
| 154 | *pbits_to_set &= ~S_IWUGO; | ||
| 155 | if ((ace_flags & GENERIC_READ) || | ||
| 156 | ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) | ||
| 157 | *pbits_to_set &= ~S_IRUGO; | ||
| 158 | if ((ace_flags & GENERIC_EXECUTE) || | ||
| 159 | ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) | ||
| 160 | *pbits_to_set &= ~S_IXUGO; | ||
| 161 | return; | ||
| 162 | } else if (type != ACCESS_ALLOWED) { | ||
| 163 | cERROR(1, ("unknown access control type %d", type)); | ||
| 164 | return; | ||
| 165 | } | ||
| 166 | /* else ACCESS_ALLOWED type */ | ||
| 167 | |||
| 168 | if (ace_flags & GENERIC_ALL) { | ||
| 169 | *pmode |= (S_IRWXUGO & (*pbits_to_set)); | ||
| 170 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 171 | cFYI(1, ("all perms")); | ||
| 172 | #endif | ||
| 173 | return; | ||
| 174 | } | ||
| 175 | if ((ace_flags & GENERIC_WRITE) || | ||
| 176 | ((ace_flags & FILE_WRITE_RIGHTS) == FILE_WRITE_RIGHTS)) | ||
| 177 | *pmode |= (S_IWUGO & (*pbits_to_set)); | ||
| 178 | if ((ace_flags & GENERIC_READ) || | ||
| 179 | ((ace_flags & FILE_READ_RIGHTS) == FILE_READ_RIGHTS)) | ||
| 180 | *pmode |= (S_IRUGO & (*pbits_to_set)); | ||
| 181 | if ((ace_flags & GENERIC_EXECUTE) || | ||
| 182 | ((ace_flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS)) | ||
| 183 | *pmode |= (S_IXUGO & (*pbits_to_set)); | ||
| 184 | |||
| 185 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 186 | cFYI(1, ("access flags 0x%x mode now 0x%x", ace_flags, *pmode)); | ||
| 187 | #endif | ||
| 188 | return; | ||
| 189 | } | ||
| 190 | |||
| 191 | /* | ||
| 192 | Generate access flags to reflect permissions mode is the existing mode. | ||
| 193 | This function is called for every ACE in the DACL whose SID matches | ||
| 194 | with either owner or group or everyone. | ||
| 195 | */ | ||
| 196 | |||
| 197 | static void mode_to_access_flags(umode_t mode, umode_t bits_to_use, | ||
| 198 | __u32 *pace_flags) | ||
| 199 | { | ||
| 200 | /* reset access mask */ | ||
| 201 | *pace_flags = 0x0; | ||
| 202 | |||
| 203 | /* bits to use are either S_IRWXU or S_IRWXG or S_IRWXO */ | ||
| 204 | mode &= bits_to_use; | ||
| 205 | |||
| 206 | /* check for R/W/X UGO since we do not know whose flags | ||
| 207 | is this but we have cleared all the bits sans RWX for | ||
| 208 | either user or group or other as per bits_to_use */ | ||
| 209 | if (mode & S_IRUGO) | ||
| 210 | *pace_flags |= SET_FILE_READ_RIGHTS; | ||
| 211 | if (mode & S_IWUGO) | ||
| 212 | *pace_flags |= SET_FILE_WRITE_RIGHTS; | ||
| 213 | if (mode & S_IXUGO) | ||
| 214 | *pace_flags |= SET_FILE_EXEC_RIGHTS; | ||
| 215 | |||
| 216 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 217 | cFYI(1, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags)); | ||
| 218 | #endif | ||
| 219 | return; | ||
| 220 | } | ||
| 221 | |||
| 132 | 222 | ||
| 133 | static void parse_ace(struct cifs_ace *pace, char *end_of_acl) | 223 | #ifdef CONFIG_CIFS_DEBUG2 |
| 224 | static void dump_ace(struct cifs_ace *pace, char *end_of_acl) | ||
| 134 | { | 225 | { |
| 135 | int num_subauth; | 226 | int num_subauth; |
| 136 | 227 | ||
| 137 | /* validate that we do not go past end of acl */ | 228 | /* validate that we do not go past end of acl */ |
| 138 | 229 | ||
| 139 | /* XXX this if statement can be removed | 230 | if (le16_to_cpu(pace->size) < 16) { |
| 140 | if (end_of_acl < (char *)pace + sizeof(struct cifs_ace)) { | 231 | cERROR(1, ("ACE too small, %d", le16_to_cpu(pace->size))); |
| 232 | return; | ||
| 233 | } | ||
| 234 | |||
| 235 | if (end_of_acl < (char *)pace + le16_to_cpu(pace->size)) { | ||
| 141 | cERROR(1, ("ACL too small to parse ACE")); | 236 | cERROR(1, ("ACL too small to parse ACE")); |
| 142 | return; | 237 | return; |
| 143 | } */ | 238 | } |
| 144 | 239 | ||
| 145 | num_subauth = pace->num_subauth; | 240 | num_subauth = pace->sid.num_subauth; |
| 146 | if (num_subauth) { | 241 | if (num_subauth) { |
| 147 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 148 | int i; | 242 | int i; |
| 149 | cFYI(1, ("ACE revision %d num_subauth %d", | 243 | cFYI(1, ("ACE revision %d num_auth %d type %d flags %d size %d", |
| 150 | pace->revision, pace->num_subauth)); | 244 | pace->sid.revision, pace->sid.num_subauth, pace->type, |
| 245 | pace->flags, pace->size)); | ||
| 151 | for (i = 0; i < num_subauth; ++i) { | 246 | for (i = 0; i < num_subauth; ++i) { |
| 152 | cFYI(1, ("ACE sub_auth[%d]: 0x%x", i, | 247 | cFYI(1, ("ACE sub_auth[%d]: 0x%x", i, |
| 153 | le32_to_cpu(pace->sub_auth[i]))); | 248 | le32_to_cpu(pace->sid.sub_auth[i]))); |
| 154 | } | 249 | } |
| 155 | 250 | ||
| 156 | /* BB add length check to make sure that we do not have huge | 251 | /* BB add length check to make sure that we do not have huge |
| 157 | num auths and therefore go off the end */ | 252 | num auths and therefore go off the end */ |
| 158 | |||
| 159 | cFYI(1, ("RID %d", le32_to_cpu(pace->sub_auth[num_subauth-1]))); | ||
| 160 | #endif | ||
| 161 | } | 253 | } |
| 162 | 254 | ||
| 163 | return; | 255 | return; |
| 164 | } | 256 | } |
| 165 | |||
| 166 | static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl) | ||
| 167 | { | ||
| 168 | /* validate that we do not go past end of acl */ | ||
| 169 | if (end_of_acl < (char *)pntace + sizeof(struct cifs_ntace)) { | ||
| 170 | cERROR(1, ("ACL too small to parse NT ACE")); | ||
| 171 | return; | ||
| 172 | } | ||
| 173 | |||
| 174 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 175 | cFYI(1, ("NTACE type %d flags 0x%x size %d, access Req 0x%x", | ||
| 176 | pntace->type, pntace->flags, pntace->size, | ||
| 177 | pntace->access_req)); | ||
| 178 | #endif | 257 | #endif |
| 179 | return; | ||
| 180 | } | ||
| 181 | |||
| 182 | 258 | ||
| 183 | 259 | ||
| 184 | static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | 260 | static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, |
| 185 | struct cifs_sid *pownersid, struct cifs_sid *pgrpsid) | 261 | struct cifs_sid *pownersid, struct cifs_sid *pgrpsid, |
| 262 | struct inode *inode) | ||
| 186 | { | 263 | { |
| 187 | int i; | 264 | int i; |
| 188 | int num_aces = 0; | 265 | int num_aces = 0; |
| 189 | int acl_size; | 266 | int acl_size; |
| 190 | char *acl_base; | 267 | char *acl_base; |
| 191 | struct cifs_ntace **ppntace; | ||
| 192 | struct cifs_ace **ppace; | 268 | struct cifs_ace **ppace; |
| 193 | 269 | ||
| 194 | /* BB need to add parm so we can store the SID BB */ | 270 | /* BB need to add parm so we can store the SID BB */ |
| @@ -205,50 +281,63 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | |||
| 205 | le32_to_cpu(pdacl->num_aces))); | 281 | le32_to_cpu(pdacl->num_aces))); |
| 206 | #endif | 282 | #endif |
| 207 | 283 | ||
| 284 | /* reset rwx permissions for user/group/other. | ||
| 285 | Also, if num_aces is 0 i.e. DACL has no ACEs, | ||
| 286 | user/group/other have no permissions */ | ||
| 287 | inode->i_mode &= ~(S_IRWXUGO); | ||
| 288 | |||
| 289 | if (!pdacl) { | ||
| 290 | /* no DACL in the security descriptor, set | ||
| 291 | all the permissions for user/group/other */ | ||
| 292 | inode->i_mode |= S_IRWXUGO; | ||
| 293 | return; | ||
| 294 | } | ||
| 208 | acl_base = (char *)pdacl; | 295 | acl_base = (char *)pdacl; |
| 209 | acl_size = sizeof(struct cifs_acl); | 296 | acl_size = sizeof(struct cifs_acl); |
| 210 | 297 | ||
| 211 | num_aces = le32_to_cpu(pdacl->num_aces); | 298 | num_aces = le32_to_cpu(pdacl->num_aces); |
| 212 | if (num_aces > 0) { | 299 | if (num_aces > 0) { |
| 213 | ppntace = kmalloc(num_aces * sizeof(struct cifs_ntace *), | 300 | umode_t user_mask = S_IRWXU; |
| 214 | GFP_KERNEL); | 301 | umode_t group_mask = S_IRWXG; |
| 302 | umode_t other_mask = S_IRWXO; | ||
| 303 | |||
| 215 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), | 304 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), |
| 216 | GFP_KERNEL); | 305 | GFP_KERNEL); |
| 217 | 306 | ||
| 218 | /* cifscred->cecount = pdacl->num_aces; | 307 | /* cifscred->cecount = pdacl->num_aces; |
| 219 | cifscred->ntaces = kmalloc(num_aces * | ||
| 220 | sizeof(struct cifs_ntace *), GFP_KERNEL); | ||
| 221 | cifscred->aces = kmalloc(num_aces * | 308 | cifscred->aces = kmalloc(num_aces * |
| 222 | sizeof(struct cifs_ace *), GFP_KERNEL);*/ | 309 | sizeof(struct cifs_ace *), GFP_KERNEL);*/ |
| 223 | 310 | ||
| 224 | for (i = 0; i < num_aces; ++i) { | 311 | for (i = 0; i < num_aces; ++i) { |
| 225 | ppntace[i] = (struct cifs_ntace *) | 312 | ppace[i] = (struct cifs_ace *) (acl_base + acl_size); |
| 226 | (acl_base + acl_size); | 313 | #ifdef CONFIG_CIFS_DEBUG2 |
| 227 | ppace[i] = (struct cifs_ace *) ((char *)ppntace[i] + | 314 | dump_ace(ppace[i], end_of_acl); |
| 228 | sizeof(struct cifs_ntace)); | 315 | #endif |
| 229 | 316 | if (compare_sids(&(ppace[i]->sid), pownersid)) | |
| 230 | parse_ntace(ppntace[i], end_of_acl); | 317 | access_flags_to_mode(ppace[i]->access_req, |
| 231 | if (end_of_acl < ((char *)ppace[i] + | 318 | ppace[i]->type, |
| 232 | (le16_to_cpu(ppntace[i]->size) - | 319 | &(inode->i_mode), |
| 233 | sizeof(struct cifs_ntace)))) { | 320 | &user_mask); |
| 234 | cERROR(1, ("ACL too small to parse ACE")); | 321 | if (compare_sids(&(ppace[i]->sid), pgrpsid)) |
| 235 | break; | 322 | access_flags_to_mode(ppace[i]->access_req, |
| 236 | } else | 323 | ppace[i]->type, |
| 237 | parse_ace(ppace[i], end_of_acl); | 324 | &(inode->i_mode), |
| 238 | 325 | &group_mask); | |
| 239 | /* memcpy((void *)(&(cifscred->ntaces[i])), | 326 | if (compare_sids(&(ppace[i]->sid), &sid_everyone)) |
| 240 | (void *)ppntace[i], | 327 | access_flags_to_mode(ppace[i]->access_req, |
| 241 | sizeof(struct cifs_ntace)); | 328 | ppace[i]->type, |
| 242 | memcpy((void *)(&(cifscred->aces[i])), | 329 | &(inode->i_mode), |
| 330 | &other_mask); | ||
| 331 | |||
| 332 | /* memcpy((void *)(&(cifscred->aces[i])), | ||
| 243 | (void *)ppace[i], | 333 | (void *)ppace[i], |
| 244 | sizeof(struct cifs_ace)); */ | 334 | sizeof(struct cifs_ace)); */ |
| 245 | 335 | ||
| 246 | acl_base = (char *)ppntace[i]; | 336 | acl_base = (char *)ppace[i]; |
| 247 | acl_size = le16_to_cpu(ppntace[i]->size); | 337 | acl_size = le16_to_cpu(ppace[i]->size); |
| 248 | } | 338 | } |
| 249 | 339 | ||
| 250 | kfree(ppace); | 340 | kfree(ppace); |
| 251 | kfree(ppntace); | ||
| 252 | } | 341 | } |
| 253 | 342 | ||
| 254 | return; | 343 | return; |
| @@ -257,20 +346,20 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | |||
| 257 | 346 | ||
| 258 | static int parse_sid(struct cifs_sid *psid, char *end_of_acl) | 347 | static int parse_sid(struct cifs_sid *psid, char *end_of_acl) |
| 259 | { | 348 | { |
| 260 | |||
| 261 | /* BB need to add parm so we can store the SID BB */ | 349 | /* BB need to add parm so we can store the SID BB */ |
| 262 | 350 | ||
| 263 | /* validate that we do not go past end of acl */ | 351 | /* validate that we do not go past end of ACL - sid must be at least 8 |
| 264 | if (end_of_acl < (char *)psid + sizeof(struct cifs_sid)) { | 352 | bytes long (assuming no sub-auths - e.g. the null SID */ |
| 265 | cERROR(1, ("ACL too small to parse SID")); | 353 | if (end_of_acl < (char *)psid + 8) { |
| 354 | cERROR(1, ("ACL too small to parse SID %p", psid)); | ||
| 266 | return -EINVAL; | 355 | return -EINVAL; |
| 267 | } | 356 | } |
| 268 | 357 | ||
| 269 | if (psid->num_subauth) { | 358 | if (psid->num_subauth) { |
| 270 | #ifdef CONFIG_CIFS_DEBUG2 | 359 | #ifdef CONFIG_CIFS_DEBUG2 |
| 271 | int i; | 360 | int i; |
| 272 | cFYI(1, ("SID revision %d num_auth %d First subauth 0x%x", | 361 | cFYI(1, ("SID revision %d num_auth %d", |
| 273 | psid->revision, psid->num_subauth, psid->sub_auth[0])); | 362 | psid->revision, psid->num_subauth)); |
| 274 | 363 | ||
| 275 | for (i = 0; i < psid->num_subauth; i++) { | 364 | for (i = 0; i < psid->num_subauth; i++) { |
| 276 | cFYI(1, ("SID sub_auth[%d]: 0x%x ", i, | 365 | cFYI(1, ("SID sub_auth[%d]: 0x%x ", i, |
| @@ -289,27 +378,32 @@ static int parse_sid(struct cifs_sid *psid, char *end_of_acl) | |||
| 289 | 378 | ||
| 290 | 379 | ||
| 291 | /* Convert CIFS ACL to POSIX form */ | 380 | /* Convert CIFS ACL to POSIX form */ |
| 292 | int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len) | 381 | static int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len, |
| 382 | struct inode *inode) | ||
| 293 | { | 383 | { |
| 294 | int rc; | 384 | int rc; |
| 295 | struct cifs_sid *owner_sid_ptr, *group_sid_ptr; | 385 | struct cifs_sid *owner_sid_ptr, *group_sid_ptr; |
| 296 | struct cifs_acl *dacl_ptr; /* no need for SACL ptr */ | 386 | struct cifs_acl *dacl_ptr; /* no need for SACL ptr */ |
| 297 | char *end_of_acl = ((char *)pntsd) + acl_len; | 387 | char *end_of_acl = ((char *)pntsd) + acl_len; |
| 388 | __u32 dacloffset; | ||
| 389 | |||
| 390 | if ((inode == NULL) || (pntsd == NULL)) | ||
| 391 | return -EIO; | ||
| 298 | 392 | ||
| 299 | owner_sid_ptr = (struct cifs_sid *)((char *)pntsd + | 393 | owner_sid_ptr = (struct cifs_sid *)((char *)pntsd + |
| 300 | le32_to_cpu(pntsd->osidoffset)); | 394 | le32_to_cpu(pntsd->osidoffset)); |
| 301 | group_sid_ptr = (struct cifs_sid *)((char *)pntsd + | 395 | group_sid_ptr = (struct cifs_sid *)((char *)pntsd + |
| 302 | le32_to_cpu(pntsd->gsidoffset)); | 396 | le32_to_cpu(pntsd->gsidoffset)); |
| 303 | dacl_ptr = (struct cifs_acl *)((char *)pntsd + | 397 | dacloffset = le32_to_cpu(pntsd->dacloffset); |
| 304 | le32_to_cpu(pntsd->dacloffset)); | 398 | dacl_ptr = (struct cifs_acl *)((char *)pntsd + dacloffset); |
| 305 | #ifdef CONFIG_CIFS_DEBUG2 | 399 | #ifdef CONFIG_CIFS_DEBUG2 |
| 306 | cFYI(1, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x " | 400 | cFYI(1, ("revision %d type 0x%x ooffset 0x%x goffset 0x%x " |
| 307 | "sacloffset 0x%x dacloffset 0x%x", | 401 | "sacloffset 0x%x dacloffset 0x%x", |
| 308 | pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset), | 402 | pntsd->revision, pntsd->type, le32_to_cpu(pntsd->osidoffset), |
| 309 | le32_to_cpu(pntsd->gsidoffset), | 403 | le32_to_cpu(pntsd->gsidoffset), |
| 310 | le32_to_cpu(pntsd->sacloffset), | 404 | le32_to_cpu(pntsd->sacloffset), dacloffset)); |
| 311 | le32_to_cpu(pntsd->dacloffset))); | ||
| 312 | #endif | 405 | #endif |
| 406 | /* cifs_dump_mem("owner_sid: ", owner_sid_ptr, 64); */ | ||
| 313 | rc = parse_sid(owner_sid_ptr, end_of_acl); | 407 | rc = parse_sid(owner_sid_ptr, end_of_acl); |
| 314 | if (rc) | 408 | if (rc) |
| 315 | return rc; | 409 | return rc; |
| @@ -318,16 +412,120 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len) | |||
| 318 | if (rc) | 412 | if (rc) |
| 319 | return rc; | 413 | return rc; |
| 320 | 414 | ||
| 321 | parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, group_sid_ptr); | 415 | if (dacloffset) |
| 416 | parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, | ||
| 417 | group_sid_ptr, inode); | ||
| 418 | else | ||
| 419 | cFYI(1, ("no ACL")); /* BB grant all or default perms? */ | ||
| 322 | 420 | ||
| 323 | /* cifscred->uid = owner_sid_ptr->rid; | 421 | /* cifscred->uid = owner_sid_ptr->rid; |
| 324 | cifscred->gid = group_sid_ptr->rid; | 422 | cifscred->gid = group_sid_ptr->rid; |
| 325 | memcpy((void *)(&(cifscred->osid)), (void *)owner_sid_ptr, | 423 | memcpy((void *)(&(cifscred->osid)), (void *)owner_sid_ptr, |
| 326 | sizeof (struct cifs_sid)); | 424 | sizeof(struct cifs_sid)); |
| 327 | memcpy((void *)(&(cifscred->gsid)), (void *)group_sid_ptr, | 425 | memcpy((void *)(&(cifscred->gsid)), (void *)group_sid_ptr, |
| 328 | sizeof (struct cifs_sid)); */ | 426 | sizeof(struct cifs_sid)); */ |
| 329 | 427 | ||
| 330 | 428 | ||
| 331 | return (0); | 429 | return (0); |
| 332 | } | 430 | } |
| 431 | |||
| 432 | |||
| 433 | /* Retrieve an ACL from the server */ | ||
| 434 | static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode, | ||
| 435 | const char *path) | ||
| 436 | { | ||
| 437 | struct cifsFileInfo *open_file; | ||
| 438 | int unlock_file = FALSE; | ||
| 439 | int xid; | ||
| 440 | int rc = -EIO; | ||
| 441 | __u16 fid; | ||
| 442 | struct super_block *sb; | ||
| 443 | struct cifs_sb_info *cifs_sb; | ||
| 444 | struct cifs_ntsd *pntsd = NULL; | ||
| 445 | |||
| 446 | cFYI(1, ("get mode from ACL for %s", path)); | ||
| 447 | |||
| 448 | if (inode == NULL) | ||
| 449 | return NULL; | ||
| 450 | |||
| 451 | xid = GetXid(); | ||
| 452 | open_file = find_readable_file(CIFS_I(inode)); | ||
| 453 | sb = inode->i_sb; | ||
| 454 | if (sb == NULL) { | ||
| 455 | FreeXid(xid); | ||
| 456 | return NULL; | ||
| 457 | } | ||
| 458 | cifs_sb = CIFS_SB(sb); | ||
| 459 | |||
| 460 | if (open_file) { | ||
| 461 | unlock_file = TRUE; | ||
| 462 | fid = open_file->netfid; | ||
| 463 | } else { | ||
| 464 | int oplock = FALSE; | ||
| 465 | /* open file */ | ||
| 466 | rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, | ||
| 467 | READ_CONTROL, 0, &fid, &oplock, NULL, | ||
| 468 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | ||
| 469 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
| 470 | if (rc != 0) { | ||
| 471 | cERROR(1, ("Unable to open file to get ACL")); | ||
| 472 | FreeXid(xid); | ||
| 473 | return NULL; | ||
| 474 | } | ||
| 475 | } | ||
| 476 | |||
| 477 | rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); | ||
| 478 | cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); | ||
| 479 | if (unlock_file == TRUE) | ||
| 480 | atomic_dec(&open_file->wrtPending); | ||
| 481 | else | ||
| 482 | CIFSSMBClose(xid, cifs_sb->tcon, fid); | ||
| 483 | |||
| 484 | FreeXid(xid); | ||
| 485 | return pntsd; | ||
| 486 | } | ||
| 487 | |||
| 488 | /* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ | ||
| 489 | void acl_to_uid_mode(struct inode *inode, const char *path) | ||
| 490 | { | ||
| 491 | struct cifs_ntsd *pntsd = NULL; | ||
| 492 | u32 acllen = 0; | ||
| 493 | int rc = 0; | ||
| 494 | |||
| 495 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 496 | cFYI(1, ("converting ACL to mode for %s", path)); | ||
| 497 | #endif | ||
| 498 | pntsd = get_cifs_acl(&acllen, inode, path); | ||
| 499 | |||
| 500 | /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ | ||
| 501 | if (pntsd) | ||
| 502 | rc = parse_sec_desc(pntsd, acllen, inode); | ||
| 503 | if (rc) | ||
| 504 | cFYI(1, ("parse sec desc failed rc = %d", rc)); | ||
| 505 | |||
| 506 | kfree(pntsd); | ||
| 507 | return; | ||
| 508 | } | ||
| 509 | |||
| 510 | /* Convert mode bits to an ACL so we can update the ACL on the server */ | ||
| 511 | int mode_to_acl(struct inode *inode, const char *path) | ||
| 512 | { | ||
| 513 | int rc = 0; | ||
| 514 | __u32 acllen = 0; | ||
| 515 | struct cifs_ntsd *pntsd = NULL; | ||
| 516 | |||
| 517 | cFYI(1, ("set ACL from mode for %s", path)); | ||
| 518 | |||
| 519 | /* Get the security descriptor */ | ||
| 520 | pntsd = get_cifs_acl(&acllen, inode, path); | ||
| 521 | |||
| 522 | /* Add/Modify the three ACEs for owner, group, everyone | ||
| 523 | while retaining the other ACEs */ | ||
| 524 | |||
| 525 | /* Set the security descriptor */ | ||
| 526 | |||
| 527 | |||
| 528 | kfree(pntsd); | ||
| 529 | return rc; | ||
| 530 | } | ||
| 333 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 531 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index 420f87813647..93a7c3462ea2 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h | |||
| @@ -35,6 +35,9 @@ | |||
| 35 | #define UBITSHIFT 6 | 35 | #define UBITSHIFT 6 |
| 36 | #define GBITSHIFT 3 | 36 | #define GBITSHIFT 3 |
| 37 | 37 | ||
| 38 | #define ACCESS_ALLOWED 0 | ||
| 39 | #define ACCESS_DENIED 1 | ||
| 40 | |||
| 38 | struct cifs_ntsd { | 41 | struct cifs_ntsd { |
| 39 | __le16 revision; /* revision level */ | 42 | __le16 revision; /* revision level */ |
| 40 | __le16 type; | 43 | __le16 type; |
| @@ -48,7 +51,7 @@ struct cifs_sid { | |||
| 48 | __u8 revision; /* revision level */ | 51 | __u8 revision; /* revision level */ |
| 49 | __u8 num_subauth; | 52 | __u8 num_subauth; |
| 50 | __u8 authority[6]; | 53 | __u8 authority[6]; |
| 51 | __le32 sub_auth[5]; /* sub_auth[num_subauth] */ /* BB FIXME endianness BB */ | 54 | __le32 sub_auth[5]; /* sub_auth[num_subauth] */ |
| 52 | } __attribute__((packed)); | 55 | } __attribute__((packed)); |
| 53 | 56 | ||
| 54 | struct cifs_acl { | 57 | struct cifs_acl { |
| @@ -57,18 +60,12 @@ struct cifs_acl { | |||
| 57 | __le32 num_aces; | 60 | __le32 num_aces; |
| 58 | } __attribute__((packed)); | 61 | } __attribute__((packed)); |
| 59 | 62 | ||
| 60 | struct cifs_ntace { /* first part of ACE which contains perms */ | 63 | struct cifs_ace { |
| 61 | __u8 type; | 64 | __u8 type; |
| 62 | __u8 flags; | 65 | __u8 flags; |
| 63 | __le16 size; | 66 | __le16 size; |
| 64 | __le32 access_req; | 67 | __le32 access_req; |
| 65 | } __attribute__((packed)); | 68 | struct cifs_sid sid; /* ie UUID of user or group who gets these perms */ |
| 66 | |||
| 67 | struct cifs_ace { /* last part of ACE which includes user info */ | ||
| 68 | __u8 revision; /* revision level */ | ||
| 69 | __u8 num_subauth; | ||
| 70 | __u8 authority[6]; | ||
| 71 | __le32 sub_auth[5]; | ||
| 72 | } __attribute__((packed)); | 69 | } __attribute__((packed)); |
| 73 | 70 | ||
| 74 | struct cifs_wksid { | 71 | struct cifs_wksid { |
| @@ -79,7 +76,7 @@ struct cifs_wksid { | |||
| 79 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 76 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
| 80 | 77 | ||
| 81 | extern int match_sid(struct cifs_sid *); | 78 | extern int match_sid(struct cifs_sid *); |
| 82 | extern int compare_sids(struct cifs_sid *, struct cifs_sid *); | 79 | extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *); |
| 83 | 80 | ||
| 84 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 81 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
| 85 | 82 | ||
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 632070b4275d..4ff8939c6cc7 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c | |||
| @@ -99,15 +99,16 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec, | |||
| 99 | MD5Init(&context); | 99 | MD5Init(&context); |
| 100 | MD5Update(&context, (char *)&key->data, key->len); | 100 | MD5Update(&context, (char *)&key->data, key->len); |
| 101 | for (i = 0; i < n_vec; i++) { | 101 | for (i = 0; i < n_vec; i++) { |
| 102 | if (iov[i].iov_len == 0) | ||
| 103 | continue; | ||
| 102 | if (iov[i].iov_base == NULL) { | 104 | if (iov[i].iov_base == NULL) { |
| 103 | cERROR(1, ("null iovec entry")); | 105 | cERROR(1, ("null iovec entry")); |
| 104 | return -EIO; | 106 | return -EIO; |
| 105 | } else if (iov[i].iov_len == 0) | 107 | } |
| 106 | break; /* bail out if we are sent nothing to sign */ | ||
| 107 | /* The first entry includes a length field (which does not get | 108 | /* The first entry includes a length field (which does not get |
| 108 | signed that occupies the first 4 bytes before the header */ | 109 | signed that occupies the first 4 bytes before the header */ |
| 109 | if (i == 0) { | 110 | if (i == 0) { |
| 110 | if (iov[0].iov_len <= 8 ) /* cmd field at offset 9 */ | 111 | if (iov[0].iov_len <= 8) /* cmd field at offset 9 */ |
| 111 | break; /* nothing to sign or corrupt header */ | 112 | break; /* nothing to sign or corrupt header */ |
| 112 | MD5Update(&context, iov[0].iov_base+4, | 113 | MD5Update(&context, iov[0].iov_base+4, |
| 113 | iov[0].iov_len-4); | 114 | iov[0].iov_len-4); |
| @@ -122,7 +123,7 @@ static int cifs_calc_signature2(const struct kvec *iov, int n_vec, | |||
| 122 | 123 | ||
| 123 | 124 | ||
| 124 | int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *server, | 125 | int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *server, |
| 125 | __u32 * pexpected_response_sequence_number) | 126 | __u32 *pexpected_response_sequence_number) |
| 126 | { | 127 | { |
| 127 | int rc = 0; | 128 | int rc = 0; |
| 128 | char smb_signature[20]; | 129 | char smb_signature[20]; |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a6fbea57c4b1..416dc9fe8961 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
| @@ -43,6 +43,8 @@ | |||
| 43 | #include "cifs_debug.h" | 43 | #include "cifs_debug.h" |
| 44 | #include "cifs_fs_sb.h" | 44 | #include "cifs_fs_sb.h" |
| 45 | #include <linux/mm.h> | 45 | #include <linux/mm.h> |
| 46 | #include <linux/key-type.h> | ||
| 47 | #include "cifs_spnego.h" | ||
| 46 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ | 48 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ |
| 47 | 49 | ||
| 48 | #ifdef CONFIG_CIFS_QUOTA | 50 | #ifdef CONFIG_CIFS_QUOTA |
| @@ -1005,12 +1007,16 @@ init_cifs(void) | |||
| 1005 | rc = register_filesystem(&cifs_fs_type); | 1007 | rc = register_filesystem(&cifs_fs_type); |
| 1006 | if (rc) | 1008 | if (rc) |
| 1007 | goto out_destroy_request_bufs; | 1009 | goto out_destroy_request_bufs; |
| 1008 | 1010 | #ifdef CONFIG_CIFS_UPCALL | |
| 1011 | rc = register_key_type(&cifs_spnego_key_type); | ||
| 1012 | if (rc) | ||
| 1013 | goto out_unregister_filesystem; | ||
| 1014 | #endif | ||
| 1009 | oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); | 1015 | oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); |
| 1010 | if (IS_ERR(oplockThread)) { | 1016 | if (IS_ERR(oplockThread)) { |
| 1011 | rc = PTR_ERR(oplockThread); | 1017 | rc = PTR_ERR(oplockThread); |
| 1012 | cERROR(1, ("error %d create oplock thread", rc)); | 1018 | cERROR(1, ("error %d create oplock thread", rc)); |
| 1013 | goto out_unregister_filesystem; | 1019 | goto out_unregister_key_type; |
| 1014 | } | 1020 | } |
| 1015 | 1021 | ||
| 1016 | dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); | 1022 | dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); |
| @@ -1024,7 +1030,11 @@ init_cifs(void) | |||
| 1024 | 1030 | ||
| 1025 | out_stop_oplock_thread: | 1031 | out_stop_oplock_thread: |
| 1026 | kthread_stop(oplockThread); | 1032 | kthread_stop(oplockThread); |
| 1033 | out_unregister_key_type: | ||
| 1034 | #ifdef CONFIG_CIFS_UPCALL | ||
| 1035 | unregister_key_type(&cifs_spnego_key_type); | ||
| 1027 | out_unregister_filesystem: | 1036 | out_unregister_filesystem: |
| 1037 | #endif | ||
| 1028 | unregister_filesystem(&cifs_fs_type); | 1038 | unregister_filesystem(&cifs_fs_type); |
| 1029 | out_destroy_request_bufs: | 1039 | out_destroy_request_bufs: |
| 1030 | cifs_destroy_request_bufs(); | 1040 | cifs_destroy_request_bufs(); |
| @@ -1046,6 +1056,9 @@ exit_cifs(void) | |||
| 1046 | #ifdef CONFIG_PROC_FS | 1056 | #ifdef CONFIG_PROC_FS |
| 1047 | cifs_proc_clean(); | 1057 | cifs_proc_clean(); |
| 1048 | #endif | 1058 | #endif |
| 1059 | #ifdef CONFIG_CIFS_UPCALL | ||
| 1060 | unregister_key_type(&cifs_spnego_key_type); | ||
| 1061 | #endif | ||
| 1049 | unregister_filesystem(&cifs_fs_type); | 1062 | unregister_filesystem(&cifs_fs_type); |
| 1050 | cifs_destroy_inodecache(); | 1063 | cifs_destroy_inodecache(); |
| 1051 | cifs_destroy_mids(); | 1064 | cifs_destroy_mids(); |
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 5574ba3ab1f9..2a21dc66f0de 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h | |||
| @@ -106,5 +106,5 @@ extern int cifs_ioctl(struct inode *inode, struct file *filep, | |||
| 106 | extern const struct export_operations cifs_export_ops; | 106 | extern const struct export_operations cifs_export_ops; |
| 107 | #endif /* EXPERIMENTAL */ | 107 | #endif /* EXPERIMENTAL */ |
| 108 | 108 | ||
| 109 | #define CIFS_VERSION "1.51" | 109 | #define CIFS_VERSION "1.52" |
| 110 | #endif /* _CIFSFS_H */ | 110 | #endif /* _CIFSFS_H */ |
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index c41ff74e9128..dbe6b846f37f 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
| @@ -220,6 +220,23 @@ | |||
| 220 | | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES) | 220 | | FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES) |
| 221 | #define FILE_EXEC_RIGHTS (FILE_EXECUTE) | 221 | #define FILE_EXEC_RIGHTS (FILE_EXECUTE) |
| 222 | 222 | ||
| 223 | #define SET_FILE_READ_RIGHTS (FILE_READ_DATA | FILE_READ_EA | FILE_WRITE_EA \ | ||
| 224 | | FILE_READ_ATTRIBUTES \ | ||
| 225 | | FILE_WRITE_ATTRIBUTES \ | ||
| 226 | | DELETE | READ_CONTROL | WRITE_DAC \ | ||
| 227 | | WRITE_OWNER | SYNCHRONIZE) | ||
| 228 | #define SET_FILE_WRITE_RIGHTS (FILE_WRITE_DATA | FILE_APPEND_DATA \ | ||
| 229 | | FILE_READ_EA | FILE_WRITE_EA \ | ||
| 230 | | FILE_DELETE_CHILD | FILE_READ_ATTRIBUTES \ | ||
| 231 | | FILE_WRITE_ATTRIBUTES \ | ||
| 232 | | DELETE | READ_CONTROL | WRITE_DAC \ | ||
| 233 | | WRITE_OWNER | SYNCHRONIZE) | ||
| 234 | #define SET_FILE_EXEC_RIGHTS (FILE_READ_EA | FILE_WRITE_EA | FILE_EXECUTE \ | ||
| 235 | | FILE_READ_ATTRIBUTES \ | ||
| 236 | | FILE_WRITE_ATTRIBUTES \ | ||
| 237 | | DELETE | READ_CONTROL | WRITE_DAC \ | ||
| 238 | | WRITE_OWNER | SYNCHRONIZE) | ||
| 239 | |||
| 223 | 240 | ||
| 224 | /* | 241 | /* |
| 225 | * Invalid readdir handle | 242 | * Invalid readdir handle |
| @@ -1211,6 +1228,29 @@ typedef struct smb_com_transaction_qsec_req { | |||
| 1211 | __le32 AclFlags; | 1228 | __le32 AclFlags; |
| 1212 | } __attribute__((packed)) QUERY_SEC_DESC_REQ; | 1229 | } __attribute__((packed)) QUERY_SEC_DESC_REQ; |
| 1213 | 1230 | ||
| 1231 | |||
| 1232 | typedef struct smb_com_transaction_ssec_req { | ||
| 1233 | struct smb_hdr hdr; /* wct = 19 */ | ||
| 1234 | __u8 MaxSetupCount; | ||
| 1235 | __u16 Reserved; | ||
| 1236 | __le32 TotalParameterCount; | ||
| 1237 | __le32 TotalDataCount; | ||
| 1238 | __le32 MaxParameterCount; | ||
| 1239 | __le32 MaxDataCount; | ||
| 1240 | __le32 ParameterCount; | ||
| 1241 | __le32 ParameterOffset; | ||
| 1242 | __le32 DataCount; | ||
| 1243 | __le32 DataOffset; | ||
| 1244 | __u8 SetupCount; /* no setup words follow subcommand */ | ||
| 1245 | /* SNIA spec incorrectly included spurious pad here */ | ||
| 1246 | __le16 SubCommand; /* 3 = SET_SECURITY_DESC */ | ||
| 1247 | __le16 ByteCount; /* bcc = 3 + 8 */ | ||
| 1248 | __u8 Pad[3]; | ||
| 1249 | __u16 Fid; | ||
| 1250 | __u16 Reserved2; | ||
| 1251 | __le32 AclFlags; | ||
| 1252 | } __attribute__((packed)) SET_SEC_DESC_REQ; | ||
| 1253 | |||
| 1214 | typedef struct smb_com_transaction_change_notify_req { | 1254 | typedef struct smb_com_transaction_change_notify_req { |
| 1215 | struct smb_hdr hdr; /* wct = 23 */ | 1255 | struct smb_hdr hdr; /* wct = 23 */ |
| 1216 | __u8 MaxSetupCount; | 1256 | __u8 MaxSetupCount; |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 1a883663b22d..dd1d7c200ee6 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
| @@ -61,6 +61,9 @@ extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length); | |||
| 61 | extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *); | 61 | extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *); |
| 62 | extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); | 62 | extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); |
| 63 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *); | 63 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *); |
| 64 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 65 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *); | ||
| 66 | #endif | ||
| 64 | extern unsigned int smbCalcSize(struct smb_hdr *ptr); | 67 | extern unsigned int smbCalcSize(struct smb_hdr *ptr); |
| 65 | extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); | 68 | extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); |
| 66 | extern int decode_negTokenInit(unsigned char *security_blob, int length, | 69 | extern int decode_negTokenInit(unsigned char *security_blob, int length, |
| @@ -73,6 +76,8 @@ extern void header_assemble(struct smb_hdr *, char /* command */ , | |||
| 73 | extern int small_smb_init_no_tc(const int smb_cmd, const int wct, | 76 | extern int small_smb_init_no_tc(const int smb_cmd, const int wct, |
| 74 | struct cifsSesInfo *ses, | 77 | struct cifsSesInfo *ses, |
| 75 | void **request_buf); | 78 | void **request_buf); |
| 79 | extern struct key *cifs_get_spnego_key(struct cifsSesInfo *sesInfo, | ||
| 80 | const char *hostname); | ||
| 76 | extern int CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, | 81 | extern int CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, |
| 77 | const int stage, | 82 | const int stage, |
| 78 | const struct nls_table *nls_cp); | 83 | const struct nls_table *nls_cp); |
| @@ -92,6 +97,8 @@ extern int cifs_get_inode_info(struct inode **pinode, | |||
| 92 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 97 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
| 93 | const unsigned char *search_path, | 98 | const unsigned char *search_path, |
| 94 | struct super_block *sb, int xid); | 99 | struct super_block *sb, int xid); |
| 100 | extern void acl_to_uid_mode(struct inode *inode, const char *search_path); | ||
| 101 | extern int mode_to_acl(struct inode *inode, const char *path); | ||
| 95 | 102 | ||
| 96 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, | 103 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, |
| 97 | const char *); | 104 | const char *); |
| @@ -311,7 +318,6 @@ extern void setup_ntlmv2_rsp(struct cifsSesInfo *, char *, | |||
| 311 | #ifdef CONFIG_CIFS_WEAK_PW_HASH | 318 | #ifdef CONFIG_CIFS_WEAK_PW_HASH |
| 312 | extern void calc_lanman_hash(struct cifsSesInfo *ses, char *lnm_session_key); | 319 | extern void calc_lanman_hash(struct cifsSesInfo *ses, char *lnm_session_key); |
| 313 | #endif /* CIFS_WEAK_PW_HASH */ | 320 | #endif /* CIFS_WEAK_PW_HASH */ |
| 314 | extern int parse_sec_desc(struct cifs_ntsd *, int); | ||
| 315 | extern int CIFSSMBCopy(int xid, | 321 | extern int CIFSSMBCopy(int xid, |
| 316 | struct cifsTconInfo *source_tcon, | 322 | struct cifsTconInfo *source_tcon, |
| 317 | const char *fromName, | 323 | const char *fromName, |
| @@ -336,8 +342,7 @@ extern int CIFSSMBSetEA(const int xid, struct cifsTconInfo *tcon, | |||
| 336 | const void *ea_value, const __u16 ea_value_len, | 342 | const void *ea_value, const __u16 ea_value_len, |
| 337 | const struct nls_table *nls_codepage, int remap_special_chars); | 343 | const struct nls_table *nls_codepage, int remap_special_chars); |
| 338 | extern int CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, | 344 | extern int CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, |
| 339 | __u16 fid, char *acl_inf, const int buflen, | 345 | __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen); |
| 340 | const int acl_type /* ACCESS vs. DEFAULT */); | ||
| 341 | extern int CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon, | 346 | extern int CIFSSMBGetPosixACL(const int xid, struct cifsTconInfo *tcon, |
| 342 | const unsigned char *searchName, | 347 | const unsigned char *searchName, |
| 343 | char *acl_inf, const int buflen, const int acl_type, | 348 | char *acl_inf, const int buflen, const int acl_type, |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index f0d9a485d095..59d7b7c037ad 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -647,8 +647,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifsSesInfo *ses) | |||
| 647 | count - 16, | 647 | count - 16, |
| 648 | &server->secType); | 648 | &server->secType); |
| 649 | if (rc == 1) { | 649 | if (rc == 1) { |
| 650 | /* BB Need to fill struct for sessetup here */ | 650 | rc = 0; |
| 651 | rc = -EOPNOTSUPP; | ||
| 652 | } else { | 651 | } else { |
| 653 | rc = -EINVAL; | 652 | rc = -EINVAL; |
| 654 | } | 653 | } |
| @@ -2486,6 +2485,7 @@ querySymLinkRetry: | |||
| 2486 | return rc; | 2485 | return rc; |
| 2487 | } | 2486 | } |
| 2488 | 2487 | ||
| 2488 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 2489 | /* Initialize NT TRANSACT SMB into small smb request buffer. | 2489 | /* Initialize NT TRANSACT SMB into small smb request buffer. |
| 2490 | This assumes that all NT TRANSACTS that we init here have | 2490 | This assumes that all NT TRANSACTS that we init here have |
| 2491 | total parm and data under about 400 bytes (to fit in small cifs | 2491 | total parm and data under about 400 bytes (to fit in small cifs |
| @@ -2494,7 +2494,7 @@ querySymLinkRetry: | |||
| 2494 | MaxSetupCount (size of returned setup area) and | 2494 | MaxSetupCount (size of returned setup area) and |
| 2495 | MaxParameterCount (returned parms size) must be set by caller */ | 2495 | MaxParameterCount (returned parms size) must be set by caller */ |
| 2496 | static int | 2496 | static int |
| 2497 | smb_init_ntransact(const __u16 sub_command, const int setup_count, | 2497 | smb_init_nttransact(const __u16 sub_command, const int setup_count, |
| 2498 | const int parm_len, struct cifsTconInfo *tcon, | 2498 | const int parm_len, struct cifsTconInfo *tcon, |
| 2499 | void **ret_buf) | 2499 | void **ret_buf) |
| 2500 | { | 2500 | { |
| @@ -2525,12 +2525,15 @@ smb_init_ntransact(const __u16 sub_command, const int setup_count, | |||
| 2525 | 2525 | ||
| 2526 | static int | 2526 | static int |
| 2527 | validate_ntransact(char *buf, char **ppparm, char **ppdata, | 2527 | validate_ntransact(char *buf, char **ppparm, char **ppdata, |
| 2528 | int *pdatalen, int *pparmlen) | 2528 | __u32 *pparmlen, __u32 *pdatalen) |
| 2529 | { | 2529 | { |
| 2530 | char *end_of_smb; | 2530 | char *end_of_smb; |
| 2531 | __u32 data_count, data_offset, parm_count, parm_offset; | 2531 | __u32 data_count, data_offset, parm_count, parm_offset; |
| 2532 | struct smb_com_ntransact_rsp *pSMBr; | 2532 | struct smb_com_ntransact_rsp *pSMBr; |
| 2533 | 2533 | ||
| 2534 | *pdatalen = 0; | ||
| 2535 | *pparmlen = 0; | ||
| 2536 | |||
| 2534 | if (buf == NULL) | 2537 | if (buf == NULL) |
| 2535 | return -EINVAL; | 2538 | return -EINVAL; |
| 2536 | 2539 | ||
| @@ -2567,8 +2570,11 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata, | |||
| 2567 | cFYI(1, ("parm count and data count larger than SMB")); | 2570 | cFYI(1, ("parm count and data count larger than SMB")); |
| 2568 | return -EINVAL; | 2571 | return -EINVAL; |
| 2569 | } | 2572 | } |
| 2573 | *pdatalen = data_count; | ||
| 2574 | *pparmlen = parm_count; | ||
| 2570 | return 0; | 2575 | return 0; |
| 2571 | } | 2576 | } |
| 2577 | #endif /* CIFS_EXPERIMENTAL */ | ||
| 2572 | 2578 | ||
| 2573 | int | 2579 | int |
| 2574 | CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | 2580 | CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, |
| @@ -3067,8 +3073,7 @@ GetExtAttrOut: | |||
| 3067 | /* Get Security Descriptor (by handle) from remote server for a file or dir */ | 3073 | /* Get Security Descriptor (by handle) from remote server for a file or dir */ |
| 3068 | int | 3074 | int |
| 3069 | CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | 3075 | CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, |
| 3070 | /* BB fix up return info */ char *acl_inf, const int buflen, | 3076 | struct cifs_ntsd **acl_inf, __u32 *pbuflen) |
| 3071 | const int acl_type) | ||
| 3072 | { | 3077 | { |
| 3073 | int rc = 0; | 3078 | int rc = 0; |
| 3074 | int buf_type = 0; | 3079 | int buf_type = 0; |
| @@ -3077,7 +3082,10 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
| 3077 | 3082 | ||
| 3078 | cFYI(1, ("GetCifsACL")); | 3083 | cFYI(1, ("GetCifsACL")); |
| 3079 | 3084 | ||
| 3080 | rc = smb_init_ntransact(NT_TRANSACT_QUERY_SECURITY_DESC, 0, | 3085 | *pbuflen = 0; |
| 3086 | *acl_inf = NULL; | ||
| 3087 | |||
| 3088 | rc = smb_init_nttransact(NT_TRANSACT_QUERY_SECURITY_DESC, 0, | ||
| 3081 | 8 /* parm len */, tcon, (void **) &pSMB); | 3089 | 8 /* parm len */, tcon, (void **) &pSMB); |
| 3082 | if (rc) | 3090 | if (rc) |
| 3083 | return rc; | 3091 | return rc; |
| @@ -3099,34 +3107,52 @@ CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | |||
| 3099 | if (rc) { | 3107 | if (rc) { |
| 3100 | cFYI(1, ("Send error in QuerySecDesc = %d", rc)); | 3108 | cFYI(1, ("Send error in QuerySecDesc = %d", rc)); |
| 3101 | } else { /* decode response */ | 3109 | } else { /* decode response */ |
| 3102 | struct cifs_ntsd *psec_desc; | ||
| 3103 | __le32 * parm; | 3110 | __le32 * parm; |
| 3104 | int parm_len; | 3111 | __u32 parm_len; |
| 3105 | int data_len; | 3112 | __u32 acl_len; |
| 3106 | int acl_len; | ||
| 3107 | struct smb_com_ntransact_rsp *pSMBr; | 3113 | struct smb_com_ntransact_rsp *pSMBr; |
| 3114 | char *pdata; | ||
| 3108 | 3115 | ||
| 3109 | /* validate_nttransact */ | 3116 | /* validate_nttransact */ |
| 3110 | rc = validate_ntransact(iov[0].iov_base, (char **)&parm, | 3117 | rc = validate_ntransact(iov[0].iov_base, (char **)&parm, |
| 3111 | (char **)&psec_desc, | 3118 | &pdata, &parm_len, pbuflen); |
| 3112 | &parm_len, &data_len); | ||
| 3113 | if (rc) | 3119 | if (rc) |
| 3114 | goto qsec_out; | 3120 | goto qsec_out; |
| 3115 | pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; | 3121 | pSMBr = (struct smb_com_ntransact_rsp *)iov[0].iov_base; |
| 3116 | 3122 | ||
| 3117 | cFYI(1, ("smb %p parm %p data %p", pSMBr, parm, psec_desc)); | 3123 | cFYI(1, ("smb %p parm %p data %p", pSMBr, parm, *acl_inf)); |
| 3118 | 3124 | ||
| 3119 | if (le32_to_cpu(pSMBr->ParameterCount) != 4) { | 3125 | if (le32_to_cpu(pSMBr->ParameterCount) != 4) { |
| 3120 | rc = -EIO; /* bad smb */ | 3126 | rc = -EIO; /* bad smb */ |
| 3127 | *pbuflen = 0; | ||
| 3121 | goto qsec_out; | 3128 | goto qsec_out; |
| 3122 | } | 3129 | } |
| 3123 | 3130 | ||
| 3124 | /* BB check that data area is minimum length and as big as acl_len */ | 3131 | /* BB check that data area is minimum length and as big as acl_len */ |
| 3125 | 3132 | ||
| 3126 | acl_len = le32_to_cpu(*parm); | 3133 | acl_len = le32_to_cpu(*parm); |
| 3127 | /* BB check if (acl_len > bufsize) */ | 3134 | if (acl_len != *pbuflen) { |
| 3135 | cERROR(1, ("acl length %d does not match %d", | ||
| 3136 | acl_len, *pbuflen)); | ||
| 3137 | if (*pbuflen > acl_len) | ||
| 3138 | *pbuflen = acl_len; | ||
| 3139 | } | ||
| 3128 | 3140 | ||
| 3129 | parse_sec_desc(psec_desc, acl_len); | 3141 | /* check if buffer is big enough for the acl |
| 3142 | header followed by the smallest SID */ | ||
| 3143 | if ((*pbuflen < sizeof(struct cifs_ntsd) + 8) || | ||
| 3144 | (*pbuflen >= 64 * 1024)) { | ||
| 3145 | cERROR(1, ("bad acl length %d", *pbuflen)); | ||
| 3146 | rc = -EINVAL; | ||
| 3147 | *pbuflen = 0; | ||
| 3148 | } else { | ||
| 3149 | *acl_inf = kmalloc(*pbuflen, GFP_KERNEL); | ||
| 3150 | if (*acl_inf == NULL) { | ||
| 3151 | *pbuflen = 0; | ||
| 3152 | rc = -ENOMEM; | ||
| 3153 | } | ||
| 3154 | memcpy(*acl_inf, pdata, *pbuflen); | ||
| 3155 | } | ||
| 3130 | } | 3156 | } |
| 3131 | qsec_out: | 3157 | qsec_out: |
| 3132 | if (buf_type == CIFS_SMALL_BUFFER) | 3158 | if (buf_type == CIFS_SMALL_BUFFER) |
| @@ -3381,7 +3407,7 @@ UnixQPathInfoRetry: | |||
| 3381 | memcpy((char *) pFindData, | 3407 | memcpy((char *) pFindData, |
| 3382 | (char *) &pSMBr->hdr.Protocol + | 3408 | (char *) &pSMBr->hdr.Protocol + |
| 3383 | data_offset, | 3409 | data_offset, |
| 3384 | sizeof (FILE_UNIX_BASIC_INFO)); | 3410 | sizeof(FILE_UNIX_BASIC_INFO)); |
| 3385 | } | 3411 | } |
| 3386 | } | 3412 | } |
| 3387 | cifs_buf_release(pSMB); | 3413 | cifs_buf_release(pSMB); |
| @@ -3649,7 +3675,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
| 3649 | pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_NEXT); | 3675 | pSMB->SubCommand = cpu_to_le16(TRANS2_FIND_NEXT); |
| 3650 | pSMB->SearchHandle = searchHandle; /* always kept as le */ | 3676 | pSMB->SearchHandle = searchHandle; /* always kept as le */ |
| 3651 | pSMB->SearchCount = | 3677 | pSMB->SearchCount = |
| 3652 | cpu_to_le16(CIFSMaxBufSize / sizeof (FILE_UNIX_INFO)); | 3678 | cpu_to_le16(CIFSMaxBufSize / sizeof(FILE_UNIX_INFO)); |
| 3653 | pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); | 3679 | pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); |
| 3654 | pSMB->ResumeKey = psrch_inf->resume_key; | 3680 | pSMB->ResumeKey = psrch_inf->resume_key; |
| 3655 | pSMB->SearchFlags = | 3681 | pSMB->SearchFlags = |
| @@ -4331,7 +4357,7 @@ QFSDeviceRetry: | |||
| 4331 | } else { /* decode response */ | 4357 | } else { /* decode response */ |
| 4332 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 4358 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
| 4333 | 4359 | ||
| 4334 | if (rc || (pSMBr->ByteCount < sizeof (FILE_SYSTEM_DEVICE_INFO))) | 4360 | if (rc || (pSMBr->ByteCount < sizeof(FILE_SYSTEM_DEVICE_INFO))) |
| 4335 | rc = -EIO; /* bad smb */ | 4361 | rc = -EIO; /* bad smb */ |
| 4336 | else { | 4362 | else { |
| 4337 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); | 4363 | __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 19ee11f7f35a..1102160f6661 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -793,7 +793,7 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
| 793 | vol->linux_gid = current->gid; | 793 | vol->linux_gid = current->gid; |
| 794 | vol->dir_mode = S_IRWXUGO; | 794 | vol->dir_mode = S_IRWXUGO; |
| 795 | /* 2767 perms indicate mandatory locking support */ | 795 | /* 2767 perms indicate mandatory locking support */ |
| 796 | vol->file_mode = S_IALLUGO & ~(S_ISUID | S_IXGRP); | 796 | vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); |
| 797 | 797 | ||
| 798 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ | 798 | /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ |
| 799 | vol->rw = TRUE; | 799 | vol->rw = TRUE; |
| @@ -1790,7 +1790,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
| 1790 | 1790 | ||
| 1791 | if (volume_info.nullauth) { | 1791 | if (volume_info.nullauth) { |
| 1792 | cFYI(1, ("null user")); | 1792 | cFYI(1, ("null user")); |
| 1793 | volume_info.username = NULL; | 1793 | volume_info.username = ""; |
| 1794 | } else if (volume_info.username) { | 1794 | } else if (volume_info.username) { |
| 1795 | /* BB fixme parse for domain name here */ | 1795 | /* BB fixme parse for domain name here */ |
| 1796 | cFYI(1, ("Username: %s", volume_info.username)); | 1796 | cFYI(1, ("Username: %s", volume_info.username)); |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 793404b10925..37dc97af1487 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
| @@ -593,7 +593,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a, | |||
| 593 | * case take precedence. If a is not a negative dentry, this | 593 | * case take precedence. If a is not a negative dentry, this |
| 594 | * should have no side effects | 594 | * should have no side effects |
| 595 | */ | 595 | */ |
| 596 | memcpy((unsigned char *)a->name, b->name, a->len); | 596 | memcpy(a->name, b->name, a->len); |
| 597 | return 0; | 597 | return 0; |
| 598 | } | 598 | } |
| 599 | return 1; | 599 | return 1; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 1e7e4c06d9e3..68ad4ca0cfa3 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
| @@ -1026,6 +1026,37 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
| 1026 | return total_written; | 1026 | return total_written; |
| 1027 | } | 1027 | } |
| 1028 | 1028 | ||
| 1029 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 1030 | struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode) | ||
| 1031 | { | ||
| 1032 | struct cifsFileInfo *open_file = NULL; | ||
| 1033 | |||
| 1034 | read_lock(&GlobalSMBSeslock); | ||
| 1035 | /* we could simply get the first_list_entry since write-only entries | ||
| 1036 | are always at the end of the list but since the first entry might | ||
| 1037 | have a close pending, we go through the whole list */ | ||
| 1038 | list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { | ||
| 1039 | if (open_file->closePend) | ||
| 1040 | continue; | ||
| 1041 | if (open_file->pfile && ((open_file->pfile->f_flags & O_RDWR) || | ||
| 1042 | (open_file->pfile->f_flags & O_RDONLY))) { | ||
| 1043 | if (!open_file->invalidHandle) { | ||
| 1044 | /* found a good file */ | ||
| 1045 | /* lock it so it will not be closed on us */ | ||
| 1046 | atomic_inc(&open_file->wrtPending); | ||
| 1047 | read_unlock(&GlobalSMBSeslock); | ||
| 1048 | return open_file; | ||
| 1049 | } /* else might as well continue, and look for | ||
| 1050 | another, or simply have the caller reopen it | ||
| 1051 | again rather than trying to fix this handle */ | ||
| 1052 | } else /* write only file */ | ||
| 1053 | break; /* write only files are last so must be done */ | ||
| 1054 | } | ||
| 1055 | read_unlock(&GlobalSMBSeslock); | ||
| 1056 | return NULL; | ||
| 1057 | } | ||
| 1058 | #endif | ||
| 1059 | |||
| 1029 | struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode) | 1060 | struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode) |
| 1030 | { | 1061 | { |
| 1031 | struct cifsFileInfo *open_file; | 1062 | struct cifsFileInfo *open_file; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 5e8b388be3b6..7d907e84e032 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
| @@ -289,7 +289,7 @@ static int decode_sfu_inode(struct inode *inode, __u64 size, | |||
| 289 | 289 | ||
| 290 | #define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ | 290 | #define SFBITS_MASK (S_ISVTX | S_ISGID | S_ISUID) /* SETFILEBITS valid bits */ |
| 291 | 291 | ||
| 292 | static int get_sfu_uid_mode(struct inode *inode, | 292 | static int get_sfu_mode(struct inode *inode, |
| 293 | const unsigned char *path, | 293 | const unsigned char *path, |
| 294 | struct cifs_sb_info *cifs_sb, int xid) | 294 | struct cifs_sb_info *cifs_sb, int xid) |
| 295 | { | 295 | { |
| @@ -527,11 +527,16 @@ int cifs_get_inode_info(struct inode **pinode, | |||
| 527 | 527 | ||
| 528 | /* BB fill in uid and gid here? with help from winbind? | 528 | /* BB fill in uid and gid here? with help from winbind? |
| 529 | or retrieve from NTFS stream extended attribute */ | 529 | or retrieve from NTFS stream extended attribute */ |
| 530 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 531 | /* fill in 0777 bits from ACL */ | ||
| 532 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | ||
| 533 | cFYI(1, ("Getting mode bits from ACL")); | ||
| 534 | acl_to_uid_mode(inode, search_path); | ||
| 535 | } | ||
| 536 | #endif | ||
| 530 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { | 537 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) { |
| 531 | /* fill in uid, gid, mode from server ACL */ | 538 | /* fill in remaining high mode bits e.g. SUID, VTX */ |
| 532 | /* BB FIXME this should also take into account the | 539 | get_sfu_mode(inode, search_path, cifs_sb, xid); |
| 533 | * default uid specified on mount if present */ | ||
| 534 | get_sfu_uid_mode(inode, search_path, cifs_sb, xid); | ||
| 535 | } else if (atomic_read(&cifsInfo->inUse) == 0) { | 540 | } else if (atomic_read(&cifsInfo->inUse) == 0) { |
| 536 | inode->i_uid = cifs_sb->mnt_uid; | 541 | inode->i_uid = cifs_sb->mnt_uid; |
| 537 | inode->i_gid = cifs_sb->mnt_gid; | 542 | inode->i_gid = cifs_sb->mnt_gid; |
diff --git a/fs/cifs/md5.c b/fs/cifs/md5.c index e5c3e1212697..f13f96d42fcf 100644 --- a/fs/cifs/md5.c +++ b/fs/cifs/md5.c | |||
| @@ -276,8 +276,8 @@ hmac_md5_init_rfc2104(unsigned char *key, int key_len, | |||
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | /* start out by storing key in pads */ | 278 | /* start out by storing key in pads */ |
| 279 | memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad)); | 279 | memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad)); |
| 280 | memset(ctx->k_opad, 0, sizeof (ctx->k_opad)); | 280 | memset(ctx->k_opad, 0, sizeof(ctx->k_opad)); |
| 281 | memcpy(ctx->k_ipad, key, key_len); | 281 | memcpy(ctx->k_ipad, key, key_len); |
| 282 | memcpy(ctx->k_opad, key, key_len); | 282 | memcpy(ctx->k_opad, key, key_len); |
| 283 | 283 | ||
| @@ -307,8 +307,8 @@ hmac_md5_init_limK_to_64(const unsigned char *key, int key_len, | |||
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | /* start out by storing key in pads */ | 309 | /* start out by storing key in pads */ |
| 310 | memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad)); | 310 | memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad)); |
| 311 | memset(ctx->k_opad, 0, sizeof (ctx->k_opad)); | 311 | memset(ctx->k_opad, 0, sizeof(ctx->k_opad)); |
| 312 | memcpy(ctx->k_ipad, key, key_len); | 312 | memcpy(ctx->k_ipad, key, key_len); |
| 313 | memcpy(ctx->k_opad, key, key_len); | 313 | memcpy(ctx->k_opad, key, key_len); |
| 314 | 314 | ||
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 51ec681fe74a..15546c2354c5 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c | |||
| @@ -73,7 +73,7 @@ sesInfoAlloc(void) | |||
| 73 | { | 73 | { |
| 74 | struct cifsSesInfo *ret_buf; | 74 | struct cifsSesInfo *ret_buf; |
| 75 | 75 | ||
| 76 | ret_buf = kzalloc(sizeof (struct cifsSesInfo), GFP_KERNEL); | 76 | ret_buf = kzalloc(sizeof(struct cifsSesInfo), GFP_KERNEL); |
| 77 | if (ret_buf) { | 77 | if (ret_buf) { |
| 78 | write_lock(&GlobalSMBSeslock); | 78 | write_lock(&GlobalSMBSeslock); |
| 79 | atomic_inc(&sesInfoAllocCount); | 79 | atomic_inc(&sesInfoAllocCount); |
| @@ -109,7 +109,7 @@ struct cifsTconInfo * | |||
| 109 | tconInfoAlloc(void) | 109 | tconInfoAlloc(void) |
| 110 | { | 110 | { |
| 111 | struct cifsTconInfo *ret_buf; | 111 | struct cifsTconInfo *ret_buf; |
| 112 | ret_buf = kzalloc(sizeof (struct cifsTconInfo), GFP_KERNEL); | 112 | ret_buf = kzalloc(sizeof(struct cifsTconInfo), GFP_KERNEL); |
| 113 | if (ret_buf) { | 113 | if (ret_buf) { |
| 114 | write_lock(&GlobalSMBSeslock); | 114 | write_lock(&GlobalSMBSeslock); |
| 115 | atomic_inc(&tconInfoAllocCount); | 115 | atomic_inc(&tconInfoAllocCount); |
| @@ -298,7 +298,7 @@ header_assemble(struct smb_hdr *buffer, char smb_command /* command */ , | |||
| 298 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ | 298 | memset(temp, 0, 256); /* bigger than MAX_CIFS_HDR_SIZE */ |
| 299 | 299 | ||
| 300 | buffer->smb_buf_length = | 300 | buffer->smb_buf_length = |
| 301 | (2 * word_count) + sizeof (struct smb_hdr) - | 301 | (2 * word_count) + sizeof(struct smb_hdr) - |
| 302 | 4 /* RFC 1001 length field does not count */ + | 302 | 4 /* RFC 1001 length field does not count */ + |
| 303 | 2 /* for bcc field itself */ ; | 303 | 2 /* for bcc field itself */ ; |
| 304 | /* Note that this is the only network field that has to be converted | 304 | /* Note that this is the only network field that has to be converted |
| @@ -422,8 +422,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length) | |||
| 422 | __u32 clc_len; /* calculated length */ | 422 | __u32 clc_len; /* calculated length */ |
| 423 | cFYI(0, ("checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len)); | 423 | cFYI(0, ("checkSMB Length: 0x%x, smb_buf_length: 0x%x", length, len)); |
| 424 | 424 | ||
| 425 | if (length < 2 + sizeof (struct smb_hdr)) { | 425 | if (length < 2 + sizeof(struct smb_hdr)) { |
| 426 | if ((length >= sizeof (struct smb_hdr) - 1) | 426 | if ((length >= sizeof(struct smb_hdr) - 1) |
| 427 | && (smb->Status.CifsError != 0)) { | 427 | && (smb->Status.CifsError != 0)) { |
| 428 | smb->WordCount = 0; | 428 | smb->WordCount = 0; |
| 429 | /* some error cases do not return wct and bcc */ | 429 | /* some error cases do not return wct and bcc */ |
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index f06359cb22ee..646e1f06941b 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
| @@ -132,6 +132,34 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = { | |||
| 132 | {0, 0} | 132 | {0, 0} |
| 133 | }; | 133 | }; |
| 134 | 134 | ||
| 135 | |||
| 136 | /* if the mount helper is missing we need to reverse the 1st slash | ||
| 137 | from '/' to backslash in order to format the UNC properly for | ||
| 138 | ip address parsing and for tree connect (unless the user | ||
| 139 | remembered to put the UNC name in properly). Fortunately we do | ||
| 140 | not have to call this twice (we check for IPv4 addresses | ||
| 141 | first, so it is already converted by the time we | ||
| 142 | try IPv6 addresses */ | ||
| 143 | static int canonicalize_unc(char *cp) | ||
| 144 | { | ||
| 145 | int i; | ||
| 146 | |||
| 147 | for (i = 0; i <= 46 /* INET6_ADDRSTRLEN */ ; i++) { | ||
| 148 | if (cp[i] == 0) | ||
| 149 | break; | ||
| 150 | if (cp[i] == '\\') | ||
| 151 | break; | ||
| 152 | if (cp[i] == '/') { | ||
| 153 | #ifdef CONFIG_CIFS_DEBUG2 | ||
| 154 | cFYI(1, ("change slash to backslash in malformed UNC")); | ||
| 155 | #endif | ||
| 156 | cp[i] = '\\'; | ||
| 157 | return 1; | ||
| 158 | } | ||
| 159 | } | ||
| 160 | return 0; | ||
| 161 | } | ||
| 162 | |||
| 135 | /* Convert string containing dotted ip address to binary form */ | 163 | /* Convert string containing dotted ip address to binary form */ |
| 136 | /* returns 0 if invalid address */ | 164 | /* returns 0 if invalid address */ |
| 137 | 165 | ||
| @@ -141,11 +169,13 @@ cifs_inet_pton(int address_family, char *cp, void *dst) | |||
| 141 | int ret = 0; | 169 | int ret = 0; |
| 142 | 170 | ||
| 143 | /* calculate length by finding first slash or NULL */ | 171 | /* calculate length by finding first slash or NULL */ |
| 144 | /* BB Should we convert '/' slash to '\' here since it seems already | 172 | if (address_family == AF_INET) { |
| 145 | * done before this */ | 173 | ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL); |
| 146 | if ( address_family == AF_INET ) { | 174 | if (ret == 0) { |
| 147 | ret = in4_pton(cp, -1 /* len */, dst , '\\', NULL); | 175 | if (canonicalize_unc(cp)) |
| 148 | } else if ( address_family == AF_INET6 ) { | 176 | ret = in4_pton(cp, -1, dst, '\\', NULL); |
| 177 | } | ||
| 178 | } else if (address_family == AF_INET6) { | ||
| 149 | ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); | 179 | ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); |
| 150 | } | 180 | } |
| 151 | #ifdef CONFIG_CIFS_DEBUG2 | 181 | #ifdef CONFIG_CIFS_DEBUG2 |
| @@ -740,7 +770,7 @@ cifs_print_status(__u32 status_code) | |||
| 740 | 770 | ||
| 741 | 771 | ||
| 742 | static void | 772 | static void |
| 743 | ntstatus_to_dos(__u32 ntstatus, __u8 * eclass, __u16 * ecode) | 773 | ntstatus_to_dos(__u32 ntstatus, __u8 *eclass, __u16 *ecode) |
| 744 | { | 774 | { |
| 745 | int i; | 775 | int i; |
| 746 | if (ntstatus == 0) { | 776 | if (ntstatus == 0) { |
| @@ -793,8 +823,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr) | |||
| 793 | if (smberrclass == ERRDOS) { /* 1 byte field no need to byte reverse */ | 823 | if (smberrclass == ERRDOS) { /* 1 byte field no need to byte reverse */ |
| 794 | for (i = 0; | 824 | for (i = 0; |
| 795 | i < | 825 | i < |
| 796 | sizeof (mapping_table_ERRDOS) / | 826 | sizeof(mapping_table_ERRDOS) / |
| 797 | sizeof (struct smb_to_posix_error); i++) { | 827 | sizeof(struct smb_to_posix_error); i++) { |
| 798 | if (mapping_table_ERRDOS[i].smb_err == 0) | 828 | if (mapping_table_ERRDOS[i].smb_err == 0) |
| 799 | break; | 829 | break; |
| 800 | else if (mapping_table_ERRDOS[i].smb_err == | 830 | else if (mapping_table_ERRDOS[i].smb_err == |
| @@ -807,8 +837,8 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr) | |||
| 807 | } else if (smberrclass == ERRSRV) { /* server class of error codes */ | 837 | } else if (smberrclass == ERRSRV) { /* server class of error codes */ |
| 808 | for (i = 0; | 838 | for (i = 0; |
| 809 | i < | 839 | i < |
| 810 | sizeof (mapping_table_ERRSRV) / | 840 | sizeof(mapping_table_ERRSRV) / |
| 811 | sizeof (struct smb_to_posix_error); i++) { | 841 | sizeof(struct smb_to_posix_error); i++) { |
| 812 | if (mapping_table_ERRSRV[i].smb_err == 0) | 842 | if (mapping_table_ERRSRV[i].smb_err == 0) |
| 813 | break; | 843 | break; |
| 814 | else if (mapping_table_ERRSRV[i].smb_err == | 844 | else if (mapping_table_ERRSRV[i].smb_err == |
| @@ -837,14 +867,14 @@ map_smb_to_linux_error(struct smb_hdr *smb, int logErr) | |||
| 837 | unsigned int | 867 | unsigned int |
| 838 | smbCalcSize(struct smb_hdr *ptr) | 868 | smbCalcSize(struct smb_hdr *ptr) |
| 839 | { | 869 | { |
| 840 | return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) + | 870 | return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) + |
| 841 | 2 /* size of the bcc field */ + BCC(ptr)); | 871 | 2 /* size of the bcc field */ + BCC(ptr)); |
| 842 | } | 872 | } |
| 843 | 873 | ||
| 844 | unsigned int | 874 | unsigned int |
| 845 | smbCalcSize_LE(struct smb_hdr *ptr) | 875 | smbCalcSize_LE(struct smb_hdr *ptr) |
| 846 | { | 876 | { |
| 847 | return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) + | 877 | return (sizeof(struct smb_hdr) + (2 * ptr->WordCount) + |
| 848 | 2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr))); | 878 | 2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr))); |
| 849 | } | 879 | } |
| 850 | 880 | ||
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 3746580e9701..0f22def4bdff 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
| @@ -171,7 +171,13 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, | |||
| 171 | /* Linux can not store file creation time unfortunately so ignore it */ | 171 | /* Linux can not store file creation time unfortunately so ignore it */ |
| 172 | 172 | ||
| 173 | cifsInfo->cifsAttrs = attr; | 173 | cifsInfo->cifsAttrs = attr; |
| 174 | cifsInfo->time = jiffies; | 174 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
| 175 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | ||
| 176 | /* get more accurate mode via ACL - so force inode refresh */ | ||
| 177 | cifsInfo->time = 0; | ||
| 178 | } else | ||
| 179 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | ||
| 180 | cifsInfo->time = jiffies; | ||
| 175 | 181 | ||
| 176 | /* treat dos attribute of read-only as read-only mode bit e.g. 555? */ | 182 | /* treat dos attribute of read-only as read-only mode bit e.g. 555? */ |
| 177 | /* 2767 perms - indicate mandatory locking */ | 183 | /* 2767 perms - indicate mandatory locking */ |
| @@ -495,7 +501,7 @@ ffirst_retry: | |||
| 495 | static int cifs_unicode_bytelen(char *str) | 501 | static int cifs_unicode_bytelen(char *str) |
| 496 | { | 502 | { |
| 497 | int len; | 503 | int len; |
| 498 | __le16 * ustr = (__le16 *)str; | 504 | __le16 *ustr = (__le16 *)str; |
| 499 | 505 | ||
| 500 | for (len = 0; len <= PATH_MAX; len++) { | 506 | for (len = 0; len <= PATH_MAX; len++) { |
| 501 | if (ustr[len] == 0) | 507 | if (ustr[len] == 0) |
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c index 90542a39be17..58bbfd992cc0 100644 --- a/fs/cifs/smbencrypt.c +++ b/fs/cifs/smbencrypt.c | |||
| @@ -80,7 +80,7 @@ SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24) | |||
| 80 | 80 | ||
| 81 | /* Routines for Windows NT MD4 Hash functions. */ | 81 | /* Routines for Windows NT MD4 Hash functions. */ |
| 82 | static int | 82 | static int |
| 83 | _my_wcslen(__u16 * str) | 83 | _my_wcslen(__u16 *str) |
| 84 | { | 84 | { |
| 85 | int len = 0; | 85 | int len = 0; |
| 86 | while (*str++ != 0) | 86 | while (*str++ != 0) |
| @@ -96,7 +96,7 @@ _my_wcslen(__u16 * str) | |||
| 96 | */ | 96 | */ |
| 97 | 97 | ||
| 98 | static int | 98 | static int |
| 99 | _my_mbstowcs(__u16 * dst, const unsigned char *src, int len) | 99 | _my_mbstowcs(__u16 *dst, const unsigned char *src, int len) |
| 100 | { /* BB not a very good conversion routine - change/fix */ | 100 | { /* BB not a very good conversion routine - change/fix */ |
| 101 | int i; | 101 | int i; |
| 102 | __u16 val; | 102 | __u16 val; |
| @@ -125,9 +125,9 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16) | |||
| 125 | /* Password cannot be longer than 128 characters */ | 125 | /* Password cannot be longer than 128 characters */ |
| 126 | if (passwd) { | 126 | if (passwd) { |
| 127 | len = strlen((char *) passwd); | 127 | len = strlen((char *) passwd); |
| 128 | if (len > 128) { | 128 | if (len > 128) |
| 129 | len = 128; | 129 | len = 128; |
| 130 | } | 130 | |
| 131 | /* Password must be converted to NT unicode */ | 131 | /* Password must be converted to NT unicode */ |
| 132 | _my_mbstowcs(wpwd, passwd, len); | 132 | _my_mbstowcs(wpwd, passwd, len); |
| 133 | } else | 133 | } else |
| @@ -135,7 +135,7 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16) | |||
| 135 | 135 | ||
| 136 | wpwd[len] = 0; /* Ensure string is null terminated */ | 136 | wpwd[len] = 0; /* Ensure string is null terminated */ |
| 137 | /* Calculate length in bytes */ | 137 | /* Calculate length in bytes */ |
| 138 | len = _my_wcslen(wpwd) * sizeof (__u16); | 138 | len = _my_wcslen(wpwd) * sizeof(__u16); |
| 139 | 139 | ||
| 140 | mdfour(p16, (unsigned char *) wpwd, len); | 140 | mdfour(p16, (unsigned char *) wpwd, len); |
| 141 | memset(wpwd, 0, 129 * 2); | 141 | memset(wpwd, 0, 129 * 2); |
| @@ -167,7 +167,7 @@ nt_lm_owf_gen(char *pwd, unsigned char nt_p16[16], unsigned char p16[16]) | |||
| 167 | E_P16((unsigned char *) passwd, (unsigned char *) p16); | 167 | E_P16((unsigned char *) passwd, (unsigned char *) p16); |
| 168 | 168 | ||
| 169 | /* clear out local copy of user's password (just being paranoid). */ | 169 | /* clear out local copy of user's password (just being paranoid). */ |
| 170 | memset(passwd, '\0', sizeof (passwd)); | 170 | memset(passwd, '\0', sizeof(passwd)); |
| 171 | } | 171 | } |
| 172 | #endif | 172 | #endif |
| 173 | 173 | ||
| @@ -189,8 +189,10 @@ ntv2_owf_gen(const unsigned char owf[16], const char *user_n, | |||
| 189 | return; | 189 | return; |
| 190 | dom_u = user_u + 1024; | 190 | dom_u = user_u + 1024; |
| 191 | 191 | ||
| 192 | /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); | 192 | /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2, |
| 193 | push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */ | 193 | STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); |
| 194 | push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2, | ||
| 195 | STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */ | ||
| 194 | 196 | ||
| 195 | /* BB user and domain may need to be uppercased */ | 197 | /* BB user and domain may need to be uppercased */ |
| 196 | user_l = cifs_strtoUCS(user_u, user_n, 511, nls_codepage); | 198 | user_l = cifs_strtoUCS(user_u, user_n, 511, nls_codepage); |
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index 369e838bebd3..54e8ef96cb79 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
| @@ -265,7 +265,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
| 265 | else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 265 | else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
| 266 | __u16 fid; | 266 | __u16 fid; |
| 267 | int oplock = FALSE; | 267 | int oplock = FALSE; |
| 268 | if (experimEnabled) | 268 | struct cifs_ntsd *pacl = NULL; |
| 269 | __u32 buflen = 0; | ||
| 270 | if (experimEnabled) | ||
| 269 | rc = CIFSSMBOpen(xid, pTcon, full_path, | 271 | rc = CIFSSMBOpen(xid, pTcon, full_path, |
| 270 | FILE_OPEN, GENERIC_READ, 0, &fid, | 272 | FILE_OPEN, GENERIC_READ, 0, &fid, |
| 271 | &oplock, NULL, cifs_sb->local_nls, | 273 | &oplock, NULL, cifs_sb->local_nls, |
| @@ -273,10 +275,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
| 273 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 275 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
| 274 | /* else rc is EOPNOTSUPP from above */ | 276 | /* else rc is EOPNOTSUPP from above */ |
| 275 | 277 | ||
| 276 | if(rc == 0) { | 278 | if (rc == 0) { |
| 277 | rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, | 279 | rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, &pacl, |
| 278 | ea_value, buf_size, | 280 | &buflen); |
| 279 | ACL_TYPE_ACCESS); | ||
| 280 | CIFSSMBClose(xid, pTcon, fid); | 281 | CIFSSMBClose(xid, pTcon, fid); |
| 281 | } | 282 | } |
| 282 | } | 283 | } |
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 58bf3f5cdbe2..e9923ca9c2d9 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c | |||
| @@ -1062,7 +1062,7 @@ static int sctp_listen_for_all(void) | |||
| 1062 | subscribe.sctp_shutdown_event = 1; | 1062 | subscribe.sctp_shutdown_event = 1; |
| 1063 | subscribe.sctp_partial_delivery_event = 1; | 1063 | subscribe.sctp_partial_delivery_event = 1; |
| 1064 | 1064 | ||
| 1065 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUF, | 1065 | result = kernel_setsockopt(sock, SOL_SOCKET, SO_RCVBUFFORCE, |
| 1066 | (char *)&bufsize, sizeof(bufsize)); | 1066 | (char *)&bufsize, sizeof(bufsize)); |
| 1067 | if (result) | 1067 | if (result) |
| 1068 | log_print("Error increasing buffer space on socket %d", result); | 1068 | log_print("Error increasing buffer space on socket %d", result); |
| @@ -1454,10 +1454,6 @@ int dlm_lowcomms_start(void) | |||
| 1454 | if (!con_cache) | 1454 | if (!con_cache) |
| 1455 | goto out; | 1455 | goto out; |
| 1456 | 1456 | ||
| 1457 | /* Set some sysctl minima */ | ||
| 1458 | if (sysctl_rmem_max < NEEDED_RMEM) | ||
| 1459 | sysctl_rmem_max = NEEDED_RMEM; | ||
| 1460 | |||
| 1461 | /* Start listening */ | 1457 | /* Start listening */ |
| 1462 | if (dlm_config.ci_protocol == 0) | 1458 | if (dlm_config.ci_protocol == 0) |
| 1463 | error = tcp_listen_for_all(); | 1459 | error = tcp_listen_for_all(); |
| @@ -1692,7 +1692,10 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
| 1692 | if (!binfmt || !binfmt->core_dump) | 1692 | if (!binfmt || !binfmt->core_dump) |
| 1693 | goto fail; | 1693 | goto fail; |
| 1694 | down_write(&mm->mmap_sem); | 1694 | down_write(&mm->mmap_sem); |
| 1695 | if (!get_dumpable(mm)) { | 1695 | /* |
| 1696 | * If another thread got here first, or we are not dumpable, bail out. | ||
| 1697 | */ | ||
| 1698 | if (mm->core_waiters || !get_dumpable(mm)) { | ||
| 1696 | up_write(&mm->mmap_sem); | 1699 | up_write(&mm->mmap_sem); |
| 1697 | goto fail; | 1700 | goto fail; |
| 1698 | } | 1701 | } |
| @@ -1706,7 +1709,6 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
| 1706 | flag = O_EXCL; /* Stop rewrite attacks */ | 1709 | flag = O_EXCL; /* Stop rewrite attacks */ |
| 1707 | current->fsuid = 0; /* Dump root private */ | 1710 | current->fsuid = 0; /* Dump root private */ |
| 1708 | } | 1711 | } |
| 1709 | set_dumpable(mm, 0); | ||
| 1710 | 1712 | ||
| 1711 | retval = coredump_wait(exit_code); | 1713 | retval = coredump_wait(exit_code); |
| 1712 | if (retval < 0) | 1714 | if (retval < 0) |
diff --git a/fs/ioprio.c b/fs/ioprio.c index d6ff77e8e7ec..e4e01bc7f338 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
| @@ -78,6 +78,10 @@ asmlinkage long sys_ioprio_set(int which, int who, int ioprio) | |||
| 78 | if (!capable(CAP_SYS_ADMIN)) | 78 | if (!capable(CAP_SYS_ADMIN)) |
| 79 | return -EPERM; | 79 | return -EPERM; |
| 80 | break; | 80 | break; |
| 81 | case IOPRIO_CLASS_NONE: | ||
| 82 | if (data) | ||
| 83 | return -EINVAL; | ||
| 84 | break; | ||
| 81 | default: | 85 | default: |
| 82 | return -EINVAL; | 86 | return -EINVAL; |
| 83 | } | 87 | } |
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 4ba7f0bdc248..ce62c152823d 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
| @@ -3946,7 +3946,7 @@ static int __ocfs2_mark_extent_written(struct inode *inode, | |||
| 3946 | struct ocfs2_merge_ctxt ctxt; | 3946 | struct ocfs2_merge_ctxt ctxt; |
| 3947 | struct ocfs2_extent_list *rightmost_el; | 3947 | struct ocfs2_extent_list *rightmost_el; |
| 3948 | 3948 | ||
| 3949 | if (!rec->e_flags & OCFS2_EXT_UNWRITTEN) { | 3949 | if (!(rec->e_flags & OCFS2_EXT_UNWRITTEN)) { |
| 3950 | ret = -EIO; | 3950 | ret = -EIO; |
| 3951 | mlog_errno(ret); | 3951 | mlog_errno(ret); |
| 3952 | goto out; | 3952 | goto out; |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index c69c1b300155..556e34ccb005 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
| @@ -729,6 +729,27 @@ static void ocfs2_clear_page_regions(struct page *page, | |||
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | /* | 731 | /* |
| 732 | * Nonsparse file systems fully allocate before we get to the write | ||
| 733 | * code. This prevents ocfs2_write() from tagging the write as an | ||
| 734 | * allocating one, which means ocfs2_map_page_blocks() might try to | ||
| 735 | * read-in the blocks at the tail of our file. Avoid reading them by | ||
| 736 | * testing i_size against each block offset. | ||
| 737 | */ | ||
| 738 | static int ocfs2_should_read_blk(struct inode *inode, struct page *page, | ||
| 739 | unsigned int block_start) | ||
| 740 | { | ||
| 741 | u64 offset = page_offset(page) + block_start; | ||
| 742 | |||
| 743 | if (ocfs2_sparse_alloc(OCFS2_SB(inode->i_sb))) | ||
| 744 | return 1; | ||
| 745 | |||
| 746 | if (i_size_read(inode) > offset) | ||
| 747 | return 1; | ||
| 748 | |||
| 749 | return 0; | ||
| 750 | } | ||
| 751 | |||
| 752 | /* | ||
| 732 | * Some of this taken from block_prepare_write(). We already have our | 753 | * Some of this taken from block_prepare_write(). We already have our |
| 733 | * mapping by now though, and the entire write will be allocating or | 754 | * mapping by now though, and the entire write will be allocating or |
| 734 | * it won't, so not much need to use BH_New. | 755 | * it won't, so not much need to use BH_New. |
| @@ -781,6 +802,7 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno, | |||
| 781 | set_buffer_uptodate(bh); | 802 | set_buffer_uptodate(bh); |
| 782 | } else if (!buffer_uptodate(bh) && !buffer_delay(bh) && | 803 | } else if (!buffer_uptodate(bh) && !buffer_delay(bh) && |
| 783 | !buffer_new(bh) && | 804 | !buffer_new(bh) && |
| 805 | ocfs2_should_read_blk(inode, page, block_start) && | ||
| 784 | (block_start < from || block_end > to)) { | 806 | (block_start < from || block_end > to)) { |
| 785 | ll_rw_block(READ, 1, &bh); | 807 | ll_rw_block(READ, 1, &bh); |
| 786 | *wait_bh++=bh; | 808 | *wait_bh++=bh; |
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 9cc7c0418b70..f02ccb34604d 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
| @@ -267,7 +267,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, | |||
| 267 | current_page = cs / spp; | 267 | current_page = cs / spp; |
| 268 | page = reg->hr_slot_data[current_page]; | 268 | page = reg->hr_slot_data[current_page]; |
| 269 | 269 | ||
| 270 | vec_len = min(PAGE_CACHE_SIZE, | 270 | vec_len = min(PAGE_CACHE_SIZE - vec_start, |
| 271 | (max_slots-cs) * (PAGE_CACHE_SIZE/spp) ); | 271 | (max_slots-cs) * (PAGE_CACHE_SIZE/spp) ); |
| 272 | 272 | ||
| 273 | mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n", | 273 | mlog(ML_HB_BIO, "page %d, vec_len = %u, vec_start = %u\n", |
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index 3094ddb7a254..1957a5ed219e 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c | |||
| @@ -318,9 +318,9 @@ out_attach: | |||
| 318 | static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb, | 318 | static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb, |
| 319 | struct ocfs2_dentry_lock *dl) | 319 | struct ocfs2_dentry_lock *dl) |
| 320 | { | 320 | { |
| 321 | iput(dl->dl_inode); | ||
| 321 | ocfs2_simple_drop_lockres(osb, &dl->dl_lockres); | 322 | ocfs2_simple_drop_lockres(osb, &dl->dl_lockres); |
| 322 | ocfs2_lock_res_free(&dl->dl_lockres); | 323 | ocfs2_lock_res_free(&dl->dl_lockres); |
| 323 | iput(dl->dl_inode); | ||
| 324 | kfree(dl); | 324 | kfree(dl); |
| 325 | } | 325 | } |
| 326 | 326 | ||
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 6a2f143e269c..63b28fdceb4a 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
| @@ -208,9 +208,9 @@ out: | |||
| 208 | return NULL; | 208 | return NULL; |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, | 211 | static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, |
| 212 | struct inode *dir, | 212 | struct inode *dir, |
| 213 | struct ocfs2_dir_entry **res_dir) | 213 | struct ocfs2_dir_entry **res_dir) |
| 214 | { | 214 | { |
| 215 | struct super_block *sb; | 215 | struct super_block *sb; |
| 216 | struct buffer_head *bh_use[NAMEI_RA_SIZE]; | 216 | struct buffer_head *bh_use[NAMEI_RA_SIZE]; |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 41c76ff2fcfb..4e97dcceaf8f 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
| @@ -670,7 +670,7 @@ static inline void ocfs2_generic_handle_attach_action(struct ocfs2_lock_res *loc | |||
| 670 | { | 670 | { |
| 671 | mlog_entry_void(); | 671 | mlog_entry_void(); |
| 672 | 672 | ||
| 673 | BUG_ON((!lockres->l_flags & OCFS2_LOCK_BUSY)); | 673 | BUG_ON((!(lockres->l_flags & OCFS2_LOCK_BUSY))); |
| 674 | BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED); | 674 | BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED); |
| 675 | 675 | ||
| 676 | if (lockres->l_requested > LKM_NLMODE && | 676 | if (lockres->l_requested > LKM_NLMODE && |
| @@ -980,18 +980,6 @@ again: | |||
| 980 | goto unlock; | 980 | goto unlock; |
| 981 | } | 981 | } |
| 982 | 982 | ||
| 983 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { | ||
| 984 | /* lock has not been created yet. */ | ||
| 985 | spin_unlock_irqrestore(&lockres->l_lock, flags); | ||
| 986 | |||
| 987 | ret = ocfs2_lock_create(osb, lockres, LKM_NLMODE, 0); | ||
| 988 | if (ret < 0) { | ||
| 989 | mlog_errno(ret); | ||
| 990 | goto out; | ||
| 991 | } | ||
| 992 | goto again; | ||
| 993 | } | ||
| 994 | |||
| 995 | if (lockres->l_flags & OCFS2_LOCK_BLOCKED && | 983 | if (lockres->l_flags & OCFS2_LOCK_BLOCKED && |
| 996 | !ocfs2_may_continue_on_blocked_lock(lockres, level)) { | 984 | !ocfs2_may_continue_on_blocked_lock(lockres, level)) { |
| 997 | /* is the lock is currently blocked on behalf of | 985 | /* is the lock is currently blocked on behalf of |
| @@ -1006,7 +994,14 @@ again: | |||
| 1006 | mlog(ML_ERROR, "lockres %s has action %u pending\n", | 994 | mlog(ML_ERROR, "lockres %s has action %u pending\n", |
| 1007 | lockres->l_name, lockres->l_action); | 995 | lockres->l_name, lockres->l_action); |
| 1008 | 996 | ||
| 1009 | lockres->l_action = OCFS2_AST_CONVERT; | 997 | if (!(lockres->l_flags & OCFS2_LOCK_ATTACHED)) { |
| 998 | lockres->l_action = OCFS2_AST_ATTACH; | ||
| 999 | lkm_flags &= ~LKM_CONVERT; | ||
| 1000 | } else { | ||
| 1001 | lockres->l_action = OCFS2_AST_CONVERT; | ||
| 1002 | lkm_flags |= LKM_CONVERT; | ||
| 1003 | } | ||
| 1004 | |||
| 1010 | lockres->l_requested = level; | 1005 | lockres->l_requested = level; |
| 1011 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); | 1006 | lockres_or_flags(lockres, OCFS2_LOCK_BUSY); |
| 1012 | spin_unlock_irqrestore(&lockres->l_lock, flags); | 1007 | spin_unlock_irqrestore(&lockres->l_lock, flags); |
| @@ -1021,7 +1016,7 @@ again: | |||
| 1021 | status = dlmlock(osb->dlm, | 1016 | status = dlmlock(osb->dlm, |
| 1022 | level, | 1017 | level, |
| 1023 | &lockres->l_lksb, | 1018 | &lockres->l_lksb, |
| 1024 | lkm_flags|LKM_CONVERT, | 1019 | lkm_flags, |
| 1025 | lockres->l_name, | 1020 | lockres->l_name, |
| 1026 | OCFS2_LOCK_ID_MAX_LEN - 1, | 1021 | OCFS2_LOCK_ID_MAX_LEN - 1, |
| 1027 | ocfs2_locking_ast, | 1022 | ocfs2_locking_ast, |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index f92fe91ff260..bbac7cd33e0b 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
| @@ -1891,9 +1891,11 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, | |||
| 1891 | ssize_t written = 0; | 1891 | ssize_t written = 0; |
| 1892 | size_t ocount; /* original count */ | 1892 | size_t ocount; /* original count */ |
| 1893 | size_t count; /* after file limit checks */ | 1893 | size_t count; /* after file limit checks */ |
| 1894 | loff_t *ppos = &iocb->ki_pos; | 1894 | loff_t old_size, *ppos = &iocb->ki_pos; |
| 1895 | u32 old_clusters; | ||
| 1895 | struct file *file = iocb->ki_filp; | 1896 | struct file *file = iocb->ki_filp; |
| 1896 | struct inode *inode = file->f_path.dentry->d_inode; | 1897 | struct inode *inode = file->f_path.dentry->d_inode; |
| 1898 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | ||
| 1897 | 1899 | ||
| 1898 | mlog_entry("(0x%p, %u, '%.*s')\n", file, | 1900 | mlog_entry("(0x%p, %u, '%.*s')\n", file, |
| 1899 | (unsigned int)nr_segs, | 1901 | (unsigned int)nr_segs, |
| @@ -1949,6 +1951,13 @@ relock: | |||
| 1949 | goto relock; | 1951 | goto relock; |
| 1950 | } | 1952 | } |
| 1951 | 1953 | ||
| 1954 | /* | ||
| 1955 | * To later detect whether a journal commit for sync writes is | ||
| 1956 | * necessary, we sample i_size, and cluster count here. | ||
| 1957 | */ | ||
| 1958 | old_size = i_size_read(inode); | ||
| 1959 | old_clusters = OCFS2_I(inode)->ip_clusters; | ||
| 1960 | |||
| 1952 | /* communicate with ocfs2_dio_end_io */ | 1961 | /* communicate with ocfs2_dio_end_io */ |
| 1953 | ocfs2_iocb_set_rw_locked(iocb, rw_level); | 1962 | ocfs2_iocb_set_rw_locked(iocb, rw_level); |
| 1954 | 1963 | ||
| @@ -1978,6 +1987,21 @@ out_dio: | |||
| 1978 | /* buffered aio wouldn't have proper lock coverage today */ | 1987 | /* buffered aio wouldn't have proper lock coverage today */ |
| 1979 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); | 1988 | BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT)); |
| 1980 | 1989 | ||
| 1990 | if ((file->f_flags & O_SYNC && !direct_io) || IS_SYNC(inode)) { | ||
| 1991 | /* | ||
| 1992 | * The generic write paths have handled getting data | ||
| 1993 | * to disk, but since we don't make use of the dirty | ||
| 1994 | * inode list, a manual journal commit is necessary | ||
| 1995 | * here. | ||
| 1996 | */ | ||
| 1997 | if (old_size != i_size_read(inode) || | ||
| 1998 | old_clusters != OCFS2_I(inode)->ip_clusters) { | ||
| 1999 | ret = journal_force_commit(osb->journal->j_journal); | ||
| 2000 | if (ret < 0) | ||
| 2001 | written = ret; | ||
| 2002 | } | ||
| 2003 | } | ||
| 2004 | |||
| 1981 | /* | 2005 | /* |
| 1982 | * deep in g_f_a_w_n()->ocfs2_direct_IO we pass in a ocfs2_dio_end_io | 2006 | * deep in g_f_a_w_n()->ocfs2_direct_IO we pass in a ocfs2_dio_end_io |
| 1983 | * function pointer which is called when o_direct io completes so that | 2007 | * function pointer which is called when o_direct io completes so that |
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 729259016c18..989ac2718587 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
| @@ -1105,9 +1105,16 @@ static int ocfs2_rename(struct inode *old_dir, | |||
| 1105 | goto bail; | 1105 | goto bail; |
| 1106 | } | 1106 | } |
| 1107 | 1107 | ||
| 1108 | if (!new_de && new_inode) | 1108 | if (!new_de && new_inode) { |
| 1109 | mlog(ML_ERROR, "inode %lu does not exist in it's parent " | 1109 | /* |
| 1110 | "directory!", new_inode->i_ino); | 1110 | * Target was unlinked by another node while we were |
| 1111 | * waiting to get to ocfs2_rename(). There isn't | ||
| 1112 | * anything we can do here to help the situation, so | ||
| 1113 | * bubble up the appropriate error. | ||
| 1114 | */ | ||
| 1115 | status = -ENOENT; | ||
| 1116 | goto bail; | ||
| 1117 | } | ||
| 1111 | 1118 | ||
| 1112 | /* In case we need to overwrite an existing file, we blow it | 1119 | /* In case we need to overwrite an existing file, we blow it |
| 1113 | * away first */ | 1120 | * away first */ |
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index 749def054a34..153554cf5575 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c | |||
| @@ -26,13 +26,6 @@ | |||
| 26 | #include "internal.h" | 26 | #include "internal.h" |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | struct proc_dir_entry *proc_net_create(struct net *net, | ||
| 30 | const char *name, mode_t mode, get_info_t *get_info) | ||
| 31 | { | ||
| 32 | return create_proc_info_entry(name,mode, net->proc_net, get_info); | ||
| 33 | } | ||
| 34 | EXPORT_SYMBOL_GPL(proc_net_create); | ||
| 35 | |||
| 36 | struct proc_dir_entry *proc_net_fops_create(struct net *net, | 29 | struct proc_dir_entry *proc_net_fops_create(struct net *net, |
| 37 | const char *name, mode_t mode, const struct file_operations *fops) | 30 | const char *name, mode_t mode, const struct file_operations *fops) |
| 38 | { | 31 | { |
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index fb90b421f31c..ede377ec9147 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h | |||
| @@ -231,7 +231,7 @@ extern int init_atu; | |||
| 231 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | 231 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) |
| 232 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ | 232 | #define IOP3XX_PCI_UPPER_IO_VA (IOP3XX_PCI_LOWER_IO_VA +\ |
| 233 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) | 233 | IOP3XX_PCI_IO_WINDOW_SIZE - 1) |
| 234 | #define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) addr -\ | 234 | #define IOP3XX_PCI_IO_PHYS_TO_VIRT(addr) (((u32) (addr) -\ |
| 235 | IOP3XX_PCI_LOWER_IO_PA) +\ | 235 | IOP3XX_PCI_LOWER_IO_PA) +\ |
| 236 | IOP3XX_PCI_LOWER_IO_VA) | 236 | IOP3XX_PCI_LOWER_IO_VA) |
| 237 | 237 | ||
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index d2e8171d1d4e..5e0182485d8c 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
| @@ -249,7 +249,7 @@ extern struct page *empty_zero_page; | |||
| 249 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) | 249 | #define set_pte_ext(ptep,pte,ext) cpu_set_pte_ext(ptep,pte,ext) |
| 250 | 250 | ||
| 251 | #define set_pte_at(mm,addr,ptep,pteval) do { \ | 251 | #define set_pte_at(mm,addr,ptep,pteval) do { \ |
| 252 | set_pte_ext(ptep, pteval, (addr) >= PAGE_OFFSET ? 0 : PTE_EXT_NG); \ | 252 | set_pte_ext(ptep, pteval, (addr) >= TASK_SIZE ? 0 : PTE_EXT_NG); \ |
| 253 | } while (0) | 253 | } while (0) |
| 254 | 254 | ||
| 255 | /* | 255 | /* |
diff --git a/include/asm-frv/irq.h b/include/asm-frv/irq.h index 8fefd6b827aa..3a66ebd754bd 100644 --- a/include/asm-frv/irq.h +++ b/include/asm-frv/irq.h | |||
| @@ -12,9 +12,6 @@ | |||
| 12 | #ifndef _ASM_IRQ_H_ | 12 | #ifndef _ASM_IRQ_H_ |
| 13 | #define _ASM_IRQ_H_ | 13 | #define _ASM_IRQ_H_ |
| 14 | 14 | ||
| 15 | /* this number is used when no interrupt has been assigned */ | ||
| 16 | #define NO_IRQ (-1) | ||
| 17 | |||
| 18 | #define NR_IRQS 48 | 15 | #define NR_IRQS 48 |
| 19 | #define IRQ_BASE_CPU (0 * 16) | 16 | #define IRQ_BASE_CPU (0 * 16) |
| 20 | #define IRQ_BASE_FPGA (1 * 16) | 17 | #define IRQ_BASE_FPGA (1 * 16) |
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index abfcb3a2588f..8a695d3407d2 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h | |||
| @@ -1379,10 +1379,11 @@ struct pal_features_s; | |||
| 1379 | static inline s64 | 1379 | static inline s64 |
| 1380 | ia64_pal_proc_get_features (u64 *features_avail, | 1380 | ia64_pal_proc_get_features (u64 *features_avail, |
| 1381 | u64 *features_status, | 1381 | u64 *features_status, |
| 1382 | u64 *features_control) | 1382 | u64 *features_control, |
| 1383 | u64 features_set) | ||
| 1383 | { | 1384 | { |
| 1384 | struct ia64_pal_retval iprv; | 1385 | struct ia64_pal_retval iprv; |
| 1385 | PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, 0, 0); | 1386 | PAL_CALL_PHYS(iprv, PAL_PROC_GET_FEATURES, 0, features_set, 0); |
| 1386 | if (iprv.status == 0) { | 1387 | if (iprv.status == 0) { |
| 1387 | *features_avail = iprv.v0; | 1388 | *features_avail = iprv.v0; |
| 1388 | *features_status = iprv.v1; | 1389 | *features_status = iprv.v1; |
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h index 86a54a4a8a2a..fea2d8ff1e73 100644 --- a/include/asm-powerpc/pgtable-ppc32.h +++ b/include/asm-powerpc/pgtable-ppc32.h | |||
| @@ -11,6 +11,11 @@ | |||
| 11 | extern unsigned long va_to_phys(unsigned long address); | 11 | extern unsigned long va_to_phys(unsigned long address); |
| 12 | extern pte_t *va_to_pte(unsigned long address); | 12 | extern pte_t *va_to_pte(unsigned long address); |
| 13 | extern unsigned long ioremap_bot, ioremap_base; | 13 | extern unsigned long ioremap_bot, ioremap_base; |
| 14 | |||
| 15 | #ifdef CONFIG_44x | ||
| 16 | extern int icache_44x_need_flush; | ||
| 17 | #endif | ||
| 18 | |||
| 14 | #endif /* __ASSEMBLY__ */ | 19 | #endif /* __ASSEMBLY__ */ |
| 15 | 20 | ||
| 16 | /* | 21 | /* |
| @@ -562,6 +567,10 @@ static inline unsigned long pte_update(pte_t *p, unsigned long clr, | |||
| 562 | : "=&r" (old), "=&r" (tmp), "=m" (*p) | 567 | : "=&r" (old), "=&r" (tmp), "=m" (*p) |
| 563 | : "r" (p), "r" (clr), "r" (set), "m" (*p) | 568 | : "r" (p), "r" (clr), "r" (set), "m" (*p) |
| 564 | : "cc" ); | 569 | : "cc" ); |
| 570 | #ifdef CONFIG_44x | ||
| 571 | if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC)) | ||
| 572 | icache_44x_need_flush = 1; | ||
| 573 | #endif | ||
| 565 | return old; | 574 | return old; |
| 566 | } | 575 | } |
| 567 | #else | 576 | #else |
| @@ -582,6 +591,10 @@ static inline unsigned long long pte_update(pte_t *p, unsigned long clr, | |||
| 582 | : "=&r" (old), "=&r" (tmp), "=m" (*p) | 591 | : "=&r" (old), "=&r" (tmp), "=m" (*p) |
| 583 | : "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p) | 592 | : "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p) |
| 584 | : "cc" ); | 593 | : "cc" ); |
| 594 | #ifdef CONFIG_44x | ||
| 595 | if ((old & _PAGE_USER) && (old & _PAGE_HWEXEC)) | ||
| 596 | icache_44x_need_flush = 1; | ||
| 597 | #endif | ||
| 585 | return old; | 598 | return old; |
| 586 | } | 599 | } |
| 587 | #endif | 600 | #endif |
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h index cc6d87228258..11d5383b2f09 100644 --- a/include/asm-powerpc/systbl.h +++ b/include/asm-powerpc/systbl.h | |||
| @@ -308,8 +308,8 @@ COMPAT_SYS_SPU(move_pages) | |||
| 308 | SYSCALL_SPU(getcpu) | 308 | SYSCALL_SPU(getcpu) |
| 309 | COMPAT_SYS(epoll_pwait) | 309 | COMPAT_SYS(epoll_pwait) |
| 310 | COMPAT_SYS_SPU(utimensat) | 310 | COMPAT_SYS_SPU(utimensat) |
| 311 | COMPAT_SYS(fallocate) | ||
| 312 | COMPAT_SYS_SPU(signalfd) | 311 | COMPAT_SYS_SPU(signalfd) |
| 313 | COMPAT_SYS_SPU(timerfd) | 312 | COMPAT_SYS_SPU(timerfd) |
| 314 | SYSCALL_SPU(eventfd) | 313 | SYSCALL_SPU(eventfd) |
| 315 | COMPAT_SYS_SPU(sync_file_range2) | 314 | COMPAT_SYS_SPU(sync_file_range2) |
| 315 | COMPAT_SYS(fallocate) | ||
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index f05895522f7f..780f82642756 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
| @@ -176,25 +176,31 @@ static inline unsigned int get_dec(void) | |||
| 176 | #endif | 176 | #endif |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | /* | ||
| 180 | * Note: Book E and 4xx processors differ from other PowerPC processors | ||
| 181 | * in when the decrementer generates its interrupt: on the 1 to 0 | ||
| 182 | * transition for Book E/4xx, but on the 0 to -1 transition for others. | ||
| 183 | */ | ||
| 179 | static inline void set_dec(int val) | 184 | static inline void set_dec(int val) |
| 180 | { | 185 | { |
| 181 | #if defined(CONFIG_40x) | 186 | #if defined(CONFIG_40x) |
| 182 | mtspr(SPRN_PIT, val); | 187 | mtspr(SPRN_PIT, val); |
| 183 | #elif defined(CONFIG_8xx_CPU6) | 188 | #elif defined(CONFIG_8xx_CPU6) |
| 184 | set_dec_cpu6(val); | 189 | set_dec_cpu6(val - 1); |
| 185 | #else | 190 | #else |
| 191 | #ifndef CONFIG_BOOKE | ||
| 192 | --val; | ||
| 193 | #endif | ||
| 186 | #ifdef CONFIG_PPC_ISERIES | 194 | #ifdef CONFIG_PPC_ISERIES |
| 187 | int cur_dec; | ||
| 188 | |||
| 189 | if (firmware_has_feature(FW_FEATURE_ISERIES) && | 195 | if (firmware_has_feature(FW_FEATURE_ISERIES) && |
| 190 | get_lppaca()->shared_proc) { | 196 | get_lppaca()->shared_proc) { |
| 191 | get_lppaca()->virtual_decr = val; | 197 | get_lppaca()->virtual_decr = val; |
| 192 | cur_dec = get_dec(); | 198 | if (get_dec() > val) |
| 193 | if (cur_dec > val) | ||
| 194 | HvCall_setVirtualDecr(); | 199 | HvCall_setVirtualDecr(); |
| 195 | } else | 200 | return; |
| 201 | } | ||
| 196 | #endif | 202 | #endif |
| 197 | mtspr(SPRN_DEC, val); | 203 | mtspr(SPRN_DEC, val); |
| 198 | #endif /* not 40x or 8xx_CPU6 */ | 204 | #endif /* not 40x or 8xx_CPU6 */ |
| 199 | } | 205 | } |
| 200 | 206 | ||
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h index b6b036ccee34..e7b4c0d298ae 100644 --- a/include/asm-powerpc/tlbflush.h +++ b/include/asm-powerpc/tlbflush.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #ifndef _ASM_POWERPC_TLBFLUSH_H | 1 | #ifndef _ASM_POWERPC_TLBFLUSH_H |
| 2 | #define _ASM_POWERPC_TLBFLUSH_H | 2 | #define _ASM_POWERPC_TLBFLUSH_H |
| 3 | |||
| 3 | /* | 4 | /* |
| 4 | * TLB flushing: | 5 | * TLB flushing: |
| 5 | * | 6 | * |
| @@ -16,9 +17,6 @@ | |||
| 16 | */ | 17 | */ |
| 17 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
| 18 | 19 | ||
| 19 | struct mm_struct; | ||
| 20 | struct vm_area_struct; | ||
| 21 | |||
| 22 | #if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE) | 20 | #if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE) |
| 23 | /* | 21 | /* |
| 24 | * TLB flushing for software loaded TLB chips | 22 | * TLB flushing for software loaded TLB chips |
| @@ -28,7 +26,9 @@ struct vm_area_struct; | |||
| 28 | * specific tlbie's | 26 | * specific tlbie's |
| 29 | */ | 27 | */ |
| 30 | 28 | ||
| 31 | extern void _tlbie(unsigned long address); | 29 | #include <linux/mm.h> |
| 30 | |||
| 31 | extern void _tlbie(unsigned long address, unsigned int pid); | ||
| 32 | 32 | ||
| 33 | #if defined(CONFIG_40x) || defined(CONFIG_8xx) | 33 | #if defined(CONFIG_40x) || defined(CONFIG_8xx) |
| 34 | #define _tlbia() asm volatile ("tlbia; sync" : : : "memory") | 34 | #define _tlbia() asm volatile ("tlbia; sync" : : : "memory") |
| @@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm) | |||
| 44 | static inline void flush_tlb_page(struct vm_area_struct *vma, | 44 | static inline void flush_tlb_page(struct vm_area_struct *vma, |
| 45 | unsigned long vmaddr) | 45 | unsigned long vmaddr) |
| 46 | { | 46 | { |
| 47 | _tlbie(vmaddr); | 47 | _tlbie(vmaddr, vma->vm_mm->context.id); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, | 50 | static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, |
| 51 | unsigned long vmaddr) | 51 | unsigned long vmaddr) |
| 52 | { | 52 | { |
| 53 | _tlbie(vmaddr); | 53 | _tlbie(vmaddr, vma->vm_mm->context.id); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | static inline void flush_tlb_range(struct vm_area_struct *vma, | 56 | static inline void flush_tlb_range(struct vm_area_struct *vma, |
diff --git a/include/asm-sh/cacheflush.h b/include/asm-sh/cacheflush.h index aa558da08471..b91246153b7e 100644 --- a/include/asm-sh/cacheflush.h +++ b/include/asm-sh/cacheflush.h | |||
| @@ -43,21 +43,31 @@ extern void __flush_purge_region(void *start, int size); | |||
| 43 | extern void __flush_invalidate_region(void *start, int size); | 43 | extern void __flush_invalidate_region(void *start, int size); |
| 44 | #endif | 44 | #endif |
| 45 | 45 | ||
| 46 | #define flush_cache_vmap(start, end) flush_cache_all() | 46 | #ifdef CONFIG_CPU_SH4 |
| 47 | #define flush_cache_vunmap(start, end) flush_cache_all() | 47 | extern void copy_to_user_page(struct vm_area_struct *vma, |
| 48 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
| 49 | unsigned long len); | ||
| 48 | 50 | ||
| 49 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | 51 | extern void copy_from_user_page(struct vm_area_struct *vma, |
| 52 | struct page *page, unsigned long vaddr, void *dst, const void *src, | ||
| 53 | unsigned long len); | ||
| 54 | #else | ||
| 55 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
| 50 | do { \ | 56 | do { \ |
| 51 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | 57 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ |
| 52 | memcpy(dst, src, len); \ | 58 | memcpy(dst, src, len); \ |
| 53 | flush_icache_user_range(vma, page, vaddr, len); \ | 59 | flush_icache_user_range(vma, page, vaddr, len); \ |
| 54 | } while (0) | 60 | } while (0) |
| 55 | 61 | ||
| 56 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | 62 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ |
| 57 | do { \ | 63 | do { \ |
| 58 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ | 64 | flush_cache_page(vma, vaddr, page_to_pfn(page));\ |
| 59 | memcpy(dst, src, len); \ | 65 | memcpy(dst, src, len); \ |
| 60 | } while (0) | 66 | } while (0) |
| 67 | #endif | ||
| 68 | |||
| 69 | #define flush_cache_vmap(start, end) flush_cache_all() | ||
| 70 | #define flush_cache_vunmap(start, end) flush_cache_all() | ||
| 61 | 71 | ||
| 62 | #define HAVE_ARCH_UNMAPPED_AREA | 72 | #define HAVE_ARCH_UNMAPPED_AREA |
| 63 | 73 | ||
diff --git a/include/asm-sh/cpu-sh3/timer.h b/include/asm-sh/cpu-sh3/timer.h index 3880ce047fe0..7b795ac5477c 100644 --- a/include/asm-sh/cpu-sh3/timer.h +++ b/include/asm-sh/cpu-sh3/timer.h | |||
| @@ -23,8 +23,7 @@ | |||
| 23 | * --------------------------------------------------------------------------- | 23 | * --------------------------------------------------------------------------- |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ | 26 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) |
| 27 | !defined(CONFIG_CPU_SUBTYPE_SH7727) | ||
| 28 | #define TMU_TOCR 0xfffffe90 /* Byte access */ | 27 | #define TMU_TOCR 0xfffffe90 /* Byte access */ |
| 29 | #endif | 28 | #endif |
| 30 | 29 | ||
| @@ -58,8 +57,7 @@ | |||
| 58 | #define TMU2_TCOR 0xfffffeac /* Long access */ | 57 | #define TMU2_TCOR 0xfffffeac /* Long access */ |
| 59 | #define TMU2_TCNT 0xfffffeb0 /* Long access */ | 58 | #define TMU2_TCNT 0xfffffeb0 /* Long access */ |
| 60 | #define TMU2_TCR 0xfffffeb4 /* Word access */ | 59 | #define TMU2_TCR 0xfffffeb4 /* Word access */ |
| 61 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) && \ | 60 | #if !defined(CONFIG_CPU_SUBTYPE_SH7720) |
| 62 | !defined(CONFIG_CPU_SUBTYPE_SH7727) | ||
| 63 | #define TMU2_TCPR2 0xfffffeb8 /* Long access */ | 61 | #define TMU2_TCPR2 0xfffffeb8 /* Long access */ |
| 64 | #endif | 62 | #endif |
| 65 | #endif | 63 | #endif |
diff --git a/include/asm-sh/page.h b/include/asm-sh/page.h index 3aa8b07da47d..d00a8fde7c7f 100644 --- a/include/asm-sh/page.h +++ b/include/asm-sh/page.h | |||
| @@ -73,10 +73,13 @@ extern void copy_page_nommu(void *to, void *from); | |||
| 73 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ | 73 | #if !defined(CONFIG_CACHE_OFF) && defined(CONFIG_MMU) && \ |
| 74 | (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) | 74 | (defined(CONFIG_CPU_SH4) || defined(CONFIG_SH7705_CACHE_32KB)) |
| 75 | struct page; | 75 | struct page; |
| 76 | extern void clear_user_page(void *to, unsigned long address, struct page *pg); | 76 | struct vm_area_struct; |
| 77 | extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); | 77 | extern void clear_user_page(void *to, unsigned long address, struct page *page); |
| 78 | extern void __clear_user_page(void *to, void *orig_to); | 78 | #ifdef CONFIG_CPU_SH4 |
| 79 | extern void __copy_user_page(void *to, void *from, void *orig_to); | 79 | extern void copy_user_highpage(struct page *to, struct page *from, |
| 80 | unsigned long vaddr, struct vm_area_struct *vma); | ||
| 81 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | ||
| 82 | #endif | ||
| 80 | #else | 83 | #else |
| 81 | #define clear_user_page(page, vaddr, pg) clear_page(page) | 84 | #define clear_user_page(page, vaddr, pg) clear_page(page) |
| 82 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) | 85 | #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) |
diff --git a/include/asm-sh/pgtable.h b/include/asm-sh/pgtable.h index 0b1d7c665659..8f1e8be8d15d 100644 --- a/include/asm-sh/pgtable.h +++ b/include/asm-sh/pgtable.h | |||
| @@ -322,7 +322,9 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]; | |||
| 322 | #define PAGE_KERNEL __pgprot(0) | 322 | #define PAGE_KERNEL __pgprot(0) |
| 323 | #define PAGE_KERNEL_NOCACHE __pgprot(0) | 323 | #define PAGE_KERNEL_NOCACHE __pgprot(0) |
| 324 | #define PAGE_KERNEL_RO __pgprot(0) | 324 | #define PAGE_KERNEL_RO __pgprot(0) |
| 325 | #define PAGE_KERNEL_PCC __pgprot(0) | 325 | |
| 326 | #define PAGE_KERNEL_PCC(slot, type) \ | ||
| 327 | __pgprot(0) | ||
| 326 | #endif | 328 | #endif |
| 327 | 329 | ||
| 328 | #endif /* __ASSEMBLY__ */ | 330 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index ab0028db645a..fda68480f377 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h | |||
| @@ -49,7 +49,7 @@ enum cpu_type { | |||
| 49 | 49 | ||
| 50 | /* SH-4 types */ | 50 | /* SH-4 types */ |
| 51 | CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, | 51 | CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, |
| 52 | CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, | 52 | CPU_SH7760, CPU_SH4_202, CPU_SH4_501, |
| 53 | 53 | ||
| 54 | /* SH-4A types */ | 54 | /* SH-4A types */ |
| 55 | CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, | 55 | CPU_SH7770, CPU_SH7780, CPU_SH7781, CPU_SH7785, CPU_SHX3, |
diff --git a/include/asm-sh/ptrace.h b/include/asm-sh/ptrace.h index ed358a376e6e..b9789c8b4d15 100644 --- a/include/asm-sh/ptrace.h +++ b/include/asm-sh/ptrace.h | |||
| @@ -42,9 +42,6 @@ | |||
| 42 | #define REG_FPSCR 55 | 42 | #define REG_FPSCR 55 |
| 43 | #define REG_FPUL 56 | 43 | #define REG_FPUL 56 |
| 44 | 44 | ||
| 45 | /* options set using PTRACE_SETOPTIONS */ | ||
| 46 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | ||
| 47 | |||
| 48 | /* | 45 | /* |
| 49 | * This struct defines the way the registers are stored on the | 46 | * This struct defines the way the registers are stored on the |
| 50 | * kernel stack during a system call or other kernel entry. | 47 | * kernel stack during a system call or other kernel entry. |
diff --git a/include/asm-sh/vga.h b/include/asm-sh/vga.h new file mode 100644 index 000000000000..06a5de8ace1a --- /dev/null +++ b/include/asm-sh/vga.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef __ASM_SH_VGA_H | ||
| 2 | #define __ASM_SH_VGA_H | ||
| 3 | |||
| 4 | /* Stupid drivers. */ | ||
| 5 | |||
| 6 | #endif /* __ASM_SH_VGA_H */ | ||
diff --git a/include/asm-sh64/ptrace.h b/include/asm-sh64/ptrace.h index a6d4da519db6..c424f80e3ae0 100644 --- a/include/asm-sh64/ptrace.h +++ b/include/asm-sh64/ptrace.h | |||
| @@ -32,6 +32,4 @@ struct pt_regs { | |||
| 32 | extern void show_regs(struct pt_regs *); | 32 | extern void show_regs(struct pt_regs *); |
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
| 35 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | ||
| 36 | |||
| 37 | #endif /* __ASM_SH64_PTRACE_H */ | 35 | #endif /* __ASM_SH64_PTRACE_H */ |
diff --git a/include/asm-sparc64/vio.h b/include/asm-sparc64/vio.h index f7417e91b170..d4de32f0f8af 100644 --- a/include/asm-sparc64/vio.h +++ b/include/asm-sparc64/vio.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/spinlock.h> | 8 | #include <linux/spinlock.h> |
| 9 | #include <linux/completion.h> | 9 | #include <linux/completion.h> |
| 10 | #include <linux/list.h> | 10 | #include <linux/list.h> |
| 11 | #include <linux/log2.h> | ||
| 11 | 12 | ||
| 12 | #include <asm/ldc.h> | 13 | #include <asm/ldc.h> |
| 13 | #include <asm/mdesc.h> | 14 | #include <asm/mdesc.h> |
| @@ -257,8 +258,7 @@ static inline void *vio_dring_entry(struct vio_dring_state *dr, | |||
| 257 | static inline u32 vio_dring_avail(struct vio_dring_state *dr, | 258 | static inline u32 vio_dring_avail(struct vio_dring_state *dr, |
| 258 | unsigned int ring_size) | 259 | unsigned int ring_size) |
| 259 | { | 260 | { |
| 260 | /* Ensure build-time power-of-2. */ | 261 | BUILD_BUG_ON(!is_power_of_2(ring_size)); |
| 261 | BUILD_BUG_ON(ring_size & (ring_size - 1)); | ||
| 262 | 262 | ||
| 263 | return (dr->pending - | 263 | return (dr->pending - |
| 264 | ((dr->prod - dr->cons) & (ring_size - 1))); | 264 | ((dr->prod - dr->cons) & (ring_size - 1))); |
diff --git a/include/asm-x86/i387_64.h b/include/asm-x86/i387_64.h index 0217b74cc9fc..3a4ffba3d6bc 100644 --- a/include/asm-x86/i387_64.h +++ b/include/asm-x86/i387_64.h | |||
| @@ -203,6 +203,11 @@ static inline void save_init_fpu(struct task_struct *tsk) | |||
| 203 | */ | 203 | */ |
| 204 | static inline int restore_i387(struct _fpstate __user *buf) | 204 | static inline int restore_i387(struct _fpstate __user *buf) |
| 205 | { | 205 | { |
| 206 | set_used_math(); | ||
| 207 | if (!(task_thread_info(current)->status & TS_USEDFPU)) { | ||
| 208 | clts(); | ||
| 209 | task_thread_info(current)->status |= TS_USEDFPU; | ||
| 210 | } | ||
| 206 | return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); | 211 | return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); |
| 207 | } | 212 | } |
| 208 | 213 | ||
diff --git a/include/asm-x86/mach-voyager/setup_arch.h b/include/asm-x86/mach-voyager/setup_arch.h index 84d01ad33459..1710ae10eb67 100644 --- a/include/asm-x86/mach-voyager/setup_arch.h +++ b/include/asm-x86/mach-voyager/setup_arch.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #include <asm/voyager.h> | 1 | #include <asm/voyager.h> |
| 2 | #define VOYAGER_BIOS_INFO ((struct voyager_bios_info *)(PARAM+0x40)) | 2 | #include <asm/setup_32.h> |
| 3 | #define VOYAGER_BIOS_INFO ((struct voyager_bios_info *) \ | ||
| 4 | (&boot_params.apm_bios_info)) | ||
| 3 | 5 | ||
| 4 | /* Hook to call BIOS initialisation function */ | 6 | /* Hook to call BIOS initialisation function */ |
| 5 | 7 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8396db24d019..d18ee67b40f8 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -697,6 +697,7 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *, | |||
| 697 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 697 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
| 698 | struct request *, int, rq_end_io_fn *); | 698 | struct request *, int, rq_end_io_fn *); |
| 699 | extern int blk_verify_command(unsigned char *, int); | 699 | extern int blk_verify_command(unsigned char *, int); |
| 700 | extern void blk_unplug(struct request_queue *q); | ||
| 700 | 701 | ||
| 701 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | 702 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) |
| 702 | { | 703 | { |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 7da2cee8e132..35a8277ec1bd 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
| @@ -128,6 +128,18 @@ struct igmpmsg | |||
| 128 | #ifdef __KERNEL__ | 128 | #ifdef __KERNEL__ |
| 129 | #include <net/sock.h> | 129 | #include <net/sock.h> |
| 130 | 130 | ||
| 131 | #ifdef CONFIG_IP_MROUTE | ||
| 132 | static inline int ip_mroute_opt(int opt) | ||
| 133 | { | ||
| 134 | return (opt >= MRT_BASE) && (opt <= MRT_BASE + 10); | ||
| 135 | } | ||
| 136 | #else | ||
| 137 | static inline int ip_mroute_opt(int opt) | ||
| 138 | { | ||
| 139 | return 0; | ||
| 140 | } | ||
| 141 | #endif | ||
| 142 | |||
| 131 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); | 143 | extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); |
| 132 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | 144 | extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); |
| 133 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); | 145 | extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index f2eaea2234ec..b87e83a5e070 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -4,25 +4,28 @@ header-y += nfnetlink_conntrack.h | |||
| 4 | header-y += nfnetlink_log.h | 4 | header-y += nfnetlink_log.h |
| 5 | header-y += nfnetlink_queue.h | 5 | header-y += nfnetlink_queue.h |
| 6 | header-y += xt_CLASSIFY.h | 6 | header-y += xt_CLASSIFY.h |
| 7 | header-y += xt_CONNMARK.h | ||
| 8 | header-y += xt_CONNSECMARK.h | ||
| 9 | header-y += xt_DSCP.h | ||
| 10 | header-y += xt_MARK.h | ||
| 11 | header-y += xt_NFLOG.h | ||
| 12 | header-y += xt_NFQUEUE.h | ||
| 13 | header-y += xt_SECMARK.h | ||
| 14 | header-y += xt_TCPMSS.h | ||
| 7 | header-y += xt_comment.h | 15 | header-y += xt_comment.h |
| 8 | header-y += xt_connbytes.h | 16 | header-y += xt_connbytes.h |
| 9 | header-y += xt_connmark.h | 17 | header-y += xt_connmark.h |
| 10 | header-y += xt_CONNMARK.h | ||
| 11 | header-y += xt_conntrack.h | 18 | header-y += xt_conntrack.h |
| 12 | header-y += xt_dccp.h | 19 | header-y += xt_dccp.h |
| 13 | header-y += xt_dscp.h | 20 | header-y += xt_dscp.h |
| 14 | header-y += xt_DSCP.h | ||
| 15 | header-y += xt_esp.h | 21 | header-y += xt_esp.h |
| 16 | header-y += xt_helper.h | ||
| 17 | header-y += xt_hashlimit.h | 22 | header-y += xt_hashlimit.h |
| 23 | header-y += xt_helper.h | ||
| 18 | header-y += xt_length.h | 24 | header-y += xt_length.h |
| 19 | header-y += xt_limit.h | 25 | header-y += xt_limit.h |
| 20 | header-y += xt_mac.h | 26 | header-y += xt_mac.h |
| 21 | header-y += xt_mark.h | 27 | header-y += xt_mark.h |
| 22 | header-y += xt_MARK.h | ||
| 23 | header-y += xt_multiport.h | 28 | header-y += xt_multiport.h |
| 24 | header-y += xt_NFQUEUE.h | ||
| 25 | header-y += xt_NFLOG.h | ||
| 26 | header-y += xt_pkttype.h | 29 | header-y += xt_pkttype.h |
| 27 | header-y += xt_policy.h | 30 | header-y += xt_policy.h |
| 28 | header-y += xt_realm.h | 31 | header-y += xt_realm.h |
| @@ -32,9 +35,6 @@ header-y += xt_statistic.h | |||
| 32 | header-y += xt_string.h | 35 | header-y += xt_string.h |
| 33 | header-y += xt_tcpmss.h | 36 | header-y += xt_tcpmss.h |
| 34 | header-y += xt_tcpudp.h | 37 | header-y += xt_tcpudp.h |
| 35 | header-y += xt_SECMARK.h | ||
| 36 | header-y += xt_CONNSECMARK.h | ||
| 37 | header-y += xt_TCPMSS.h | ||
| 38 | 38 | ||
| 39 | unifdef-y += nf_conntrack_common.h | 39 | unifdef-y += nf_conntrack_common.h |
| 40 | unifdef-y += nf_conntrack_ftp.h | 40 | unifdef-y += nf_conntrack_ftp.h |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 7185792b900f..3a7105bb8f33 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
| @@ -1,47 +1,47 @@ | |||
| 1 | header-y += ipt_addrtype.h | ||
| 2 | header-y += ipt_ah.h | ||
| 3 | header-y += ipt_CLASSIFY.h | 1 | header-y += ipt_CLASSIFY.h |
| 4 | header-y += ipt_CLUSTERIP.h | 2 | header-y += ipt_CLUSTERIP.h |
| 3 | header-y += ipt_CONNMARK.h | ||
| 4 | header-y += ipt_DSCP.h | ||
| 5 | header-y += ipt_ECN.h | ||
| 6 | header-y += ipt_LOG.h | ||
| 7 | header-y += ipt_MARK.h | ||
| 8 | header-y += ipt_NFQUEUE.h | ||
| 9 | header-y += ipt_REJECT.h | ||
| 10 | header-y += ipt_SAME.h | ||
| 11 | header-y += ipt_TCPMSS.h | ||
| 12 | header-y += ipt_TOS.h | ||
| 13 | header-y += ipt_TTL.h | ||
| 14 | header-y += ipt_ULOG.h | ||
| 15 | header-y += ipt_addrtype.h | ||
| 16 | header-y += ipt_ah.h | ||
| 5 | header-y += ipt_comment.h | 17 | header-y += ipt_comment.h |
| 6 | header-y += ipt_connbytes.h | 18 | header-y += ipt_connbytes.h |
| 7 | header-y += ipt_connmark.h | 19 | header-y += ipt_connmark.h |
| 8 | header-y += ipt_CONNMARK.h | ||
| 9 | header-y += ipt_conntrack.h | 20 | header-y += ipt_conntrack.h |
| 10 | header-y += ipt_dccp.h | 21 | header-y += ipt_dccp.h |
| 11 | header-y += ipt_dscp.h | 22 | header-y += ipt_dscp.h |
| 12 | header-y += ipt_DSCP.h | ||
| 13 | header-y += ipt_ecn.h | 23 | header-y += ipt_ecn.h |
| 14 | header-y += ipt_ECN.h | ||
| 15 | header-y += ipt_esp.h | 24 | header-y += ipt_esp.h |
| 16 | header-y += ipt_hashlimit.h | 25 | header-y += ipt_hashlimit.h |
| 17 | header-y += ipt_helper.h | 26 | header-y += ipt_helper.h |
| 18 | header-y += ipt_iprange.h | 27 | header-y += ipt_iprange.h |
| 19 | header-y += ipt_length.h | 28 | header-y += ipt_length.h |
| 20 | header-y += ipt_limit.h | 29 | header-y += ipt_limit.h |
| 21 | header-y += ipt_LOG.h | ||
| 22 | header-y += ipt_mac.h | 30 | header-y += ipt_mac.h |
| 23 | header-y += ipt_mark.h | 31 | header-y += ipt_mark.h |
| 24 | header-y += ipt_MARK.h | ||
| 25 | header-y += ipt_multiport.h | 32 | header-y += ipt_multiport.h |
| 26 | header-y += ipt_NFQUEUE.h | ||
| 27 | header-y += ipt_owner.h | 33 | header-y += ipt_owner.h |
| 28 | header-y += ipt_physdev.h | 34 | header-y += ipt_physdev.h |
| 29 | header-y += ipt_pkttype.h | 35 | header-y += ipt_pkttype.h |
| 30 | header-y += ipt_policy.h | 36 | header-y += ipt_policy.h |
| 31 | header-y += ipt_realm.h | 37 | header-y += ipt_realm.h |
| 32 | header-y += ipt_recent.h | 38 | header-y += ipt_recent.h |
| 33 | header-y += ipt_REJECT.h | ||
| 34 | header-y += ipt_SAME.h | ||
| 35 | header-y += ipt_sctp.h | 39 | header-y += ipt_sctp.h |
| 36 | header-y += ipt_state.h | 40 | header-y += ipt_state.h |
| 37 | header-y += ipt_string.h | 41 | header-y += ipt_string.h |
| 38 | header-y += ipt_tcpmss.h | 42 | header-y += ipt_tcpmss.h |
| 39 | header-y += ipt_TCPMSS.h | ||
| 40 | header-y += ipt_tos.h | 43 | header-y += ipt_tos.h |
| 41 | header-y += ipt_TOS.h | ||
| 42 | header-y += ipt_ttl.h | 44 | header-y += ipt_ttl.h |
| 43 | header-y += ipt_TTL.h | ||
| 44 | header-y += ipt_ULOG.h | ||
| 45 | 45 | ||
| 46 | unifdef-y += ip_queue.h | 46 | unifdef-y += ip_queue.h |
| 47 | unifdef-y += ip_tables.h | 47 | unifdef-y += ip_tables.h |
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild index 9dd978d149ff..8887a5fcd1d0 100644 --- a/include/linux/netfilter_ipv6/Kbuild +++ b/include/linux/netfilter_ipv6/Kbuild | |||
| @@ -14,8 +14,8 @@ header-y += ip6t_mark.h | |||
| 14 | header-y += ip6t_multiport.h | 14 | header-y += ip6t_multiport.h |
| 15 | header-y += ip6t_opts.h | 15 | header-y += ip6t_opts.h |
| 16 | header-y += ip6t_owner.h | 16 | header-y += ip6t_owner.h |
| 17 | header-y += ip6t_policy.h | ||
| 18 | header-y += ip6t_physdev.h | 17 | header-y += ip6t_physdev.h |
| 18 | header-y += ip6t_policy.h | ||
| 19 | header-y += ip6t_rt.h | 19 | header-y += ip6t_rt.h |
| 20 | 20 | ||
| 21 | unifdef-y += ip6_tables.h | 21 | unifdef-y += ip6_tables.h |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 7c1f3b1d2ee5..d5bfaba595c7 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -192,7 +192,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb); | |||
| 192 | /* finegrained unicast helpers: */ | 192 | /* finegrained unicast helpers: */ |
| 193 | struct sock *netlink_getsockbyfilp(struct file *filp); | 193 | struct sock *netlink_getsockbyfilp(struct file *filp); |
| 194 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | 194 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, |
| 195 | long timeo, struct sock *ssk); | 195 | long *timeo, struct sock *ssk); |
| 196 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); | 196 | void netlink_detachskb(struct sock *sk, struct sk_buff *skb); |
| 197 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | 197 | int netlink_sendskb(struct sock *sk, struct sk_buff *skb); |
| 198 | 198 | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 1ff461672060..1273c6ec535c 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
| @@ -196,8 +196,6 @@ static inline struct proc_dir_entry *create_proc_info_entry(const char *name, | |||
| 196 | return res; | 196 | return res; |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | extern struct proc_dir_entry *proc_net_create(struct net *net, | ||
| 200 | const char *name, mode_t mode, get_info_t *get_info); | ||
| 201 | extern struct proc_dir_entry *proc_net_fops_create(struct net *net, | 199 | extern struct proc_dir_entry *proc_net_fops_create(struct net *net, |
| 202 | const char *name, mode_t mode, const struct file_operations *fops); | 200 | const char *name, mode_t mode, const struct file_operations *fops); |
| 203 | extern void proc_net_remove(struct net *net, const char *name); | 201 | extern void proc_net_remove(struct net *net, const char *name); |
| @@ -208,7 +206,6 @@ extern void proc_net_remove(struct net *net, const char *name); | |||
| 208 | #define proc_bus NULL | 206 | #define proc_bus NULL |
| 209 | 207 | ||
| 210 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) | 208 | #define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) |
| 211 | #define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; }) | ||
| 212 | static inline void proc_net_remove(struct net *net, const char *name) {} | 209 | static inline void proc_net_remove(struct net *net, const char *name) {} |
| 213 | 210 | ||
| 214 | static inline void proc_flush_task(struct task_struct *task) | 211 | static inline void proc_flush_task(struct task_struct *task) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 155d7438f7ad..ee800e7a70de 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -254,6 +254,7 @@ long io_schedule_timeout(long timeout); | |||
| 254 | 254 | ||
| 255 | extern void cpu_init (void); | 255 | extern void cpu_init (void); |
| 256 | extern void trap_init(void); | 256 | extern void trap_init(void); |
| 257 | extern void account_process_tick(struct task_struct *task, int user); | ||
| 257 | extern void update_process_times(int user); | 258 | extern void update_process_times(int user); |
| 258 | extern void scheduler_tick(void); | 259 | extern void scheduler_tick(void); |
| 259 | 260 | ||
| @@ -862,7 +863,6 @@ struct sched_entity { | |||
| 862 | struct load_weight load; /* for load-balancing */ | 863 | struct load_weight load; /* for load-balancing */ |
| 863 | struct rb_node run_node; | 864 | struct rb_node run_node; |
| 864 | unsigned int on_rq; | 865 | unsigned int on_rq; |
| 865 | int peer_preempt; | ||
| 866 | 866 | ||
| 867 | u64 exec_start; | 867 | u64 exec_start; |
| 868 | u64 sum_exec_runtime; | 868 | u64 sum_exec_runtime; |
| @@ -1460,12 +1460,17 @@ extern void sched_idle_next(void); | |||
| 1460 | 1460 | ||
| 1461 | #ifdef CONFIG_SCHED_DEBUG | 1461 | #ifdef CONFIG_SCHED_DEBUG |
| 1462 | extern unsigned int sysctl_sched_latency; | 1462 | extern unsigned int sysctl_sched_latency; |
| 1463 | extern unsigned int sysctl_sched_nr_latency; | 1463 | extern unsigned int sysctl_sched_min_granularity; |
| 1464 | extern unsigned int sysctl_sched_wakeup_granularity; | 1464 | extern unsigned int sysctl_sched_wakeup_granularity; |
| 1465 | extern unsigned int sysctl_sched_batch_wakeup_granularity; | 1465 | extern unsigned int sysctl_sched_batch_wakeup_granularity; |
| 1466 | extern unsigned int sysctl_sched_child_runs_first; | 1466 | extern unsigned int sysctl_sched_child_runs_first; |
| 1467 | extern unsigned int sysctl_sched_features; | 1467 | extern unsigned int sysctl_sched_features; |
| 1468 | extern unsigned int sysctl_sched_migration_cost; | 1468 | extern unsigned int sysctl_sched_migration_cost; |
| 1469 | extern unsigned int sysctl_sched_nr_migrate; | ||
| 1470 | |||
| 1471 | int sched_nr_latency_handler(struct ctl_table *table, int write, | ||
| 1472 | struct file *file, void __user *buffer, size_t *length, | ||
| 1473 | loff_t *ppos); | ||
| 1469 | #endif | 1474 | #endif |
| 1470 | 1475 | ||
| 1471 | extern unsigned int sysctl_sched_compat_yield; | 1476 | extern unsigned int sysctl_sched_compat_yield; |
| @@ -1983,6 +1988,14 @@ static inline void inc_syscw(struct task_struct *tsk) | |||
| 1983 | } | 1988 | } |
| 1984 | #endif | 1989 | #endif |
| 1985 | 1990 | ||
| 1991 | #ifdef CONFIG_SMP | ||
| 1992 | void migration_init(void); | ||
| 1993 | #else | ||
| 1994 | static inline void migration_init(void) | ||
| 1995 | { | ||
| 1996 | } | ||
| 1997 | #endif | ||
| 1998 | |||
| 1986 | #endif /* __KERNEL__ */ | 1999 | #endif /* __KERNEL__ */ |
| 1987 | 2000 | ||
| 1988 | #endif | 2001 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 94e49915a8c0..91140fe8c119 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -387,7 +387,9 @@ extern void skb_truesize_bug(struct sk_buff *skb); | |||
| 387 | 387 | ||
| 388 | static inline void skb_truesize_check(struct sk_buff *skb) | 388 | static inline void skb_truesize_check(struct sk_buff *skb) |
| 389 | { | 389 | { |
| 390 | if (unlikely((int)skb->truesize < sizeof(struct sk_buff) + skb->len)) | 390 | int len = sizeof(struct sk_buff) + skb->len; |
| 391 | |||
| 392 | if (unlikely((int)skb->truesize < len)) | ||
| 391 | skb_truesize_bug(skb); | 393 | skb_truesize_bug(skb); |
| 392 | } | 394 | } |
| 393 | 395 | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 259a13c3bd98..c25e66bcecf3 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
| @@ -84,11 +84,12 @@ void smp_prepare_boot_cpu(void); | |||
| 84 | * These macros fold the SMP functionality into a single CPU system | 84 | * These macros fold the SMP functionality into a single CPU system |
| 85 | */ | 85 | */ |
| 86 | #define raw_smp_processor_id() 0 | 86 | #define raw_smp_processor_id() 0 |
| 87 | static inline int up_smp_call_function(void) | 87 | static inline int up_smp_call_function(void (*func)(void *), void *info) |
| 88 | { | 88 | { |
| 89 | return 0; | 89 | return 0; |
| 90 | } | 90 | } |
| 91 | #define smp_call_function(func,info,retry,wait) (up_smp_call_function()) | 91 | #define smp_call_function(func, info, retry, wait) \ |
| 92 | (up_smp_call_function(func, info)) | ||
| 92 | #define on_each_cpu(func,info,retry,wait) \ | 93 | #define on_each_cpu(func,info,retry,wait) \ |
| 93 | ({ \ | 94 | ({ \ |
| 94 | local_irq_disable(); \ | 95 | local_irq_disable(); \ |
| @@ -107,6 +108,8 @@ static inline void smp_send_reschedule(int cpu) { } | |||
| 107 | local_irq_enable(); \ | 108 | local_irq_enable(); \ |
| 108 | 0; \ | 109 | 0; \ |
| 109 | }) | 110 | }) |
| 111 | #define smp_call_function_mask(mask, func, info, wait) \ | ||
| 112 | (up_smp_call_function(func, info)) | ||
| 110 | 113 | ||
| 111 | #endif /* !SMP */ | 114 | #endif /* !SMP */ |
| 112 | 115 | ||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 56164d7ba0ad..c555f5442bd7 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -332,7 +332,9 @@ extern void tty_ldisc_flush(struct tty_struct *tty); | |||
| 332 | 332 | ||
| 333 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | 333 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, |
| 334 | unsigned long arg); | 334 | unsigned long arg); |
| 335 | 335 | extern int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | |
| 336 | unsigned int cmd, unsigned long arg); | ||
| 337 | extern int tty_perform_flush(struct tty_struct *tty, unsigned long arg); | ||
| 336 | extern dev_t tty_devnum(struct tty_struct *tty); | 338 | extern dev_t tty_devnum(struct tty_struct *tty); |
| 337 | extern void proc_clear_tty(struct task_struct *p); | 339 | extern void proc_clear_tty(struct task_struct *p); |
| 338 | extern struct tty_struct *get_current_tty(void); | 340 | extern struct tty_struct *get_current_tty(void); |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index ac69e7bb5a14..1a4ed49f6478 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
| @@ -67,7 +67,7 @@ struct vring { | |||
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | /* The standard layout for the ring is a continuous chunk of memory which looks | 69 | /* The standard layout for the ring is a continuous chunk of memory which looks |
| 70 | * like this. The used fields will be aligned to a "num+1" boundary. | 70 | * like this. We assume num is a power of 2. |
| 71 | * | 71 | * |
| 72 | * struct vring | 72 | * struct vring |
| 73 | * { | 73 | * { |
| @@ -79,8 +79,8 @@ struct vring { | |||
| 79 | * __u16 avail_idx; | 79 | * __u16 avail_idx; |
| 80 | * __u16 available[num]; | 80 | * __u16 available[num]; |
| 81 | * | 81 | * |
| 82 | * // Padding so a correctly-chosen num value will cache-align used_idx. | 82 | * // Padding to the next page boundary. |
| 83 | * char pad[sizeof(struct vring_desc) - sizeof(avail_flags)]; | 83 | * char pad[]; |
| 84 | * | 84 | * |
| 85 | * // A ring of used descriptor heads with free-running index. | 85 | * // A ring of used descriptor heads with free-running index. |
| 86 | * __u16 used_flags; | 86 | * __u16 used_flags; |
| @@ -88,18 +88,21 @@ struct vring { | |||
| 88 | * struct vring_used_elem used[num]; | 88 | * struct vring_used_elem used[num]; |
| 89 | * }; | 89 | * }; |
| 90 | */ | 90 | */ |
| 91 | static inline void vring_init(struct vring *vr, unsigned int num, void *p) | 91 | static inline void vring_init(struct vring *vr, unsigned int num, void *p, |
| 92 | unsigned int pagesize) | ||
| 92 | { | 93 | { |
| 93 | vr->num = num; | 94 | vr->num = num; |
| 94 | vr->desc = p; | 95 | vr->desc = p; |
| 95 | vr->avail = p + num*sizeof(struct vring); | 96 | vr->avail = p + num*sizeof(struct vring_desc); |
| 96 | vr->used = p + (num+1)*(sizeof(struct vring) + sizeof(__u16)); | 97 | vr->used = (void *)(((unsigned long)&vr->avail->ring[num] + pagesize-1) |
| 98 | & ~(pagesize - 1)); | ||
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | static inline unsigned vring_size(unsigned int num) | 101 | static inline unsigned vring_size(unsigned int num, unsigned int pagesize) |
| 100 | { | 102 | { |
| 101 | return (num + 1) * (sizeof(struct vring_desc) + sizeof(__u16)) | 103 | return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) |
| 102 | + sizeof(__u32) + num * sizeof(struct vring_used_elem); | 104 | + pagesize - 1) & ~(pagesize - 1)) |
| 105 | + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; | ||
| 103 | } | 106 | } |
| 104 | 107 | ||
| 105 | #ifdef __KERNEL__ | 108 | #ifdef __KERNEL__ |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 0864a775de24..a1c805d7f488 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -12,7 +12,7 @@ extern void unix_gc(void); | |||
| 12 | 12 | ||
| 13 | #define UNIX_HASH_SIZE 256 | 13 | #define UNIX_HASH_SIZE 256 |
| 14 | 14 | ||
| 15 | extern atomic_t unix_tot_inflight; | 15 | extern unsigned int unix_tot_inflight; |
| 16 | 16 | ||
| 17 | struct unix_address { | 17 | struct unix_address { |
| 18 | atomic_t refcnt; | 18 | atomic_t refcnt; |
diff --git a/include/net/dst.h b/include/net/dst.h index e9ff4a4caef9..2f65e894b829 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -143,6 +143,13 @@ static inline void dst_hold(struct dst_entry * dst) | |||
| 143 | atomic_inc(&dst->__refcnt); | 143 | atomic_inc(&dst->__refcnt); |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static inline void dst_use(struct dst_entry *dst, unsigned long time) | ||
| 147 | { | ||
| 148 | dst_hold(dst); | ||
| 149 | dst->__use++; | ||
| 150 | dst->lastuse = time; | ||
| 151 | } | ||
| 152 | |||
| 146 | static inline | 153 | static inline |
| 147 | struct dst_entry * dst_clone(struct dst_entry * dst) | 154 | struct dst_entry * dst_clone(struct dst_entry * dst) |
| 148 | { | 155 | { |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 017aebd90683..41a301e38643 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -107,4 +107,7 @@ extern int fib_rules_unregister(struct fib_rules_ops *); | |||
| 107 | extern int fib_rules_lookup(struct fib_rules_ops *, | 107 | extern int fib_rules_lookup(struct fib_rules_ops *, |
| 108 | struct flowi *, int flags, | 108 | struct flowi *, int flags, |
| 109 | struct fib_lookup_arg *); | 109 | struct fib_lookup_arg *); |
| 110 | extern int fib_default_rule_add(struct fib_rules_ops *, | ||
| 111 | u32 pref, u32 table, | ||
| 112 | u32 flags); | ||
| 110 | #endif | 113 | #endif |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 4427dcd1e53a..469216d93663 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| 24 | #include <linux/types.h> | 24 | #include <linux/types.h> |
| 25 | #include <linux/wait.h> | 25 | #include <linux/wait.h> |
| 26 | #include <linux/vmalloc.h> | ||
| 26 | 27 | ||
| 27 | #include <net/inet_connection_sock.h> | 28 | #include <net/inet_connection_sock.h> |
| 28 | #include <net/inet_sock.h> | 29 | #include <net/inet_sock.h> |
| @@ -37,7 +38,6 @@ | |||
| 37 | * I'll experiment with dynamic table growth later. | 38 | * I'll experiment with dynamic table growth later. |
| 38 | */ | 39 | */ |
| 39 | struct inet_ehash_bucket { | 40 | struct inet_ehash_bucket { |
| 40 | rwlock_t lock; | ||
| 41 | struct hlist_head chain; | 41 | struct hlist_head chain; |
| 42 | struct hlist_head twchain; | 42 | struct hlist_head twchain; |
| 43 | }; | 43 | }; |
| @@ -100,6 +100,9 @@ struct inet_hashinfo { | |||
| 100 | * TIME_WAIT sockets use a separate chain (twchain). | 100 | * TIME_WAIT sockets use a separate chain (twchain). |
| 101 | */ | 101 | */ |
| 102 | struct inet_ehash_bucket *ehash; | 102 | struct inet_ehash_bucket *ehash; |
| 103 | rwlock_t *ehash_locks; | ||
| 104 | unsigned int ehash_size; | ||
| 105 | unsigned int ehash_locks_mask; | ||
| 103 | 106 | ||
| 104 | /* Ok, let's try this, I give up, we do need a local binding | 107 | /* Ok, let's try this, I give up, we do need a local binding |
| 105 | * TCP hash as well as the others for fast bind/connect. | 108 | * TCP hash as well as the others for fast bind/connect. |
| @@ -107,7 +110,7 @@ struct inet_hashinfo { | |||
| 107 | struct inet_bind_hashbucket *bhash; | 110 | struct inet_bind_hashbucket *bhash; |
| 108 | 111 | ||
| 109 | unsigned int bhash_size; | 112 | unsigned int bhash_size; |
| 110 | unsigned int ehash_size; | 113 | /* Note : 4 bytes padding on 64 bit arches */ |
| 111 | 114 | ||
| 112 | /* All sockets in TCP_LISTEN state will be in here. This is the only | 115 | /* All sockets in TCP_LISTEN state will be in here. This is the only |
| 113 | * table where wildcard'd TCP sockets can exist. Hash function here | 116 | * table where wildcard'd TCP sockets can exist. Hash function here |
| @@ -134,6 +137,62 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket( | |||
| 134 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; | 137 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; |
| 135 | } | 138 | } |
| 136 | 139 | ||
| 140 | static inline rwlock_t *inet_ehash_lockp( | ||
| 141 | struct inet_hashinfo *hashinfo, | ||
| 142 | unsigned int hash) | ||
| 143 | { | ||
| 144 | return &hashinfo->ehash_locks[hash & hashinfo->ehash_locks_mask]; | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo) | ||
| 148 | { | ||
| 149 | unsigned int i, size = 256; | ||
| 150 | #if defined(CONFIG_PROVE_LOCKING) | ||
| 151 | unsigned int nr_pcpus = 2; | ||
| 152 | #else | ||
| 153 | unsigned int nr_pcpus = num_possible_cpus(); | ||
| 154 | #endif | ||
| 155 | if (nr_pcpus >= 4) | ||
| 156 | size = 512; | ||
| 157 | if (nr_pcpus >= 8) | ||
| 158 | size = 1024; | ||
| 159 | if (nr_pcpus >= 16) | ||
| 160 | size = 2048; | ||
| 161 | if (nr_pcpus >= 32) | ||
| 162 | size = 4096; | ||
| 163 | if (sizeof(rwlock_t) != 0) { | ||
| 164 | #ifdef CONFIG_NUMA | ||
| 165 | if (size * sizeof(rwlock_t) > PAGE_SIZE) | ||
| 166 | hashinfo->ehash_locks = vmalloc(size * sizeof(rwlock_t)); | ||
| 167 | else | ||
| 168 | #endif | ||
| 169 | hashinfo->ehash_locks = kmalloc(size * sizeof(rwlock_t), | ||
| 170 | GFP_KERNEL); | ||
| 171 | if (!hashinfo->ehash_locks) | ||
| 172 | return ENOMEM; | ||
| 173 | for (i = 0; i < size; i++) | ||
| 174 | rwlock_init(&hashinfo->ehash_locks[i]); | ||
| 175 | } | ||
| 176 | hashinfo->ehash_locks_mask = size - 1; | ||
| 177 | return 0; | ||
| 178 | } | ||
| 179 | |||
| 180 | static inline void inet_ehash_locks_free(struct inet_hashinfo *hashinfo) | ||
| 181 | { | ||
| 182 | if (hashinfo->ehash_locks) { | ||
| 183 | #ifdef CONFIG_NUMA | ||
| 184 | unsigned int size = (hashinfo->ehash_locks_mask + 1) * | ||
| 185 | sizeof(rwlock_t); | ||
| 186 | if (size > PAGE_SIZE) | ||
| 187 | vfree(hashinfo->ehash_locks); | ||
| 188 | else | ||
| 189 | #else | ||
| 190 | kfree(hashinfo->ehash_locks); | ||
| 191 | #endif | ||
| 192 | hashinfo->ehash_locks = NULL; | ||
| 193 | } | ||
| 194 | } | ||
| 195 | |||
| 137 | extern struct inet_bind_bucket * | 196 | extern struct inet_bind_bucket * |
| 138 | inet_bind_bucket_create(struct kmem_cache *cachep, | 197 | inet_bind_bucket_create(struct kmem_cache *cachep, |
| 139 | struct inet_bind_hashbucket *head, | 198 | struct inet_bind_hashbucket *head, |
| @@ -222,7 +281,7 @@ static inline void __inet_hash(struct inet_hashinfo *hashinfo, | |||
| 222 | sk->sk_hash = inet_sk_ehashfn(sk); | 281 | sk->sk_hash = inet_sk_ehashfn(sk); |
| 223 | head = inet_ehash_bucket(hashinfo, sk->sk_hash); | 282 | head = inet_ehash_bucket(hashinfo, sk->sk_hash); |
| 224 | list = &head->chain; | 283 | list = &head->chain; |
| 225 | lock = &head->lock; | 284 | lock = inet_ehash_lockp(hashinfo, sk->sk_hash); |
| 226 | write_lock(lock); | 285 | write_lock(lock); |
| 227 | } | 286 | } |
| 228 | __sk_add_node(sk, list); | 287 | __sk_add_node(sk, list); |
| @@ -253,7 +312,7 @@ static inline void inet_unhash(struct inet_hashinfo *hashinfo, struct sock *sk) | |||
| 253 | inet_listen_wlock(hashinfo); | 312 | inet_listen_wlock(hashinfo); |
| 254 | lock = &hashinfo->lhash_lock; | 313 | lock = &hashinfo->lhash_lock; |
| 255 | } else { | 314 | } else { |
| 256 | lock = &inet_ehash_bucket(hashinfo, sk->sk_hash)->lock; | 315 | lock = inet_ehash_lockp(hashinfo, sk->sk_hash); |
| 257 | write_lock_bh(lock); | 316 | write_lock_bh(lock); |
| 258 | } | 317 | } |
| 259 | 318 | ||
| @@ -354,9 +413,10 @@ static inline struct sock * | |||
| 354 | */ | 413 | */ |
| 355 | unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); | 414 | unsigned int hash = inet_ehashfn(daddr, hnum, saddr, sport); |
| 356 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); | 415 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); |
| 416 | rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); | ||
| 357 | 417 | ||
| 358 | prefetch(head->chain.first); | 418 | prefetch(head->chain.first); |
| 359 | read_lock(&head->lock); | 419 | read_lock(lock); |
| 360 | sk_for_each(sk, node, &head->chain) { | 420 | sk_for_each(sk, node, &head->chain) { |
| 361 | if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) | 421 | if (INET_MATCH(sk, hash, acookie, saddr, daddr, ports, dif)) |
| 362 | goto hit; /* You sunk my battleship! */ | 422 | goto hit; /* You sunk my battleship! */ |
| @@ -369,7 +429,7 @@ static inline struct sock * | |||
| 369 | } | 429 | } |
| 370 | sk = NULL; | 430 | sk = NULL; |
| 371 | out: | 431 | out: |
| 372 | read_unlock(&head->lock); | 432 | read_unlock(lock); |
| 373 | return sk; | 433 | return sk; |
| 374 | hit: | 434 | hit: |
| 375 | sock_hold(sk); | 435 | sock_hold(sk); |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 8cadc77c7df4..ed514bfb61ba 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -185,6 +185,12 @@ static inline void fib_select_default(const struct flowi *flp, struct fib_result | |||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | #else /* CONFIG_IP_MULTIPLE_TABLES */ | 187 | #else /* CONFIG_IP_MULTIPLE_TABLES */ |
| 188 | extern void __init fib4_rules_init(void); | ||
| 189 | |||
| 190 | #ifdef CONFIG_NET_CLS_ROUTE | ||
| 191 | extern u32 fib_rules_tclass(struct fib_result *res); | ||
| 192 | #endif | ||
| 193 | |||
| 188 | #define ip_fib_local_table fib_get_table(RT_TABLE_LOCAL) | 194 | #define ip_fib_local_table fib_get_table(RT_TABLE_LOCAL) |
| 189 | #define ip_fib_main_table fib_get_table(RT_TABLE_MAIN) | 195 | #define ip_fib_main_table fib_get_table(RT_TABLE_MAIN) |
| 190 | 196 | ||
| @@ -214,15 +220,6 @@ extern __be32 __fib_res_prefsrc(struct fib_result *res); | |||
| 214 | /* Exported by fib_hash.c */ | 220 | /* Exported by fib_hash.c */ |
| 215 | extern struct fib_table *fib_hash_init(u32 id); | 221 | extern struct fib_table *fib_hash_init(u32 id); |
| 216 | 222 | ||
| 217 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
| 218 | extern void __init fib4_rules_init(void); | ||
| 219 | |||
| 220 | #ifdef CONFIG_NET_CLS_ROUTE | ||
| 221 | extern u32 fib_rules_tclass(struct fib_result *res); | ||
| 222 | #endif | ||
| 223 | |||
| 224 | #endif | ||
| 225 | |||
| 226 | static inline void fib_combine_itag(u32 *itag, struct fib_result *res) | 223 | static inline void fib_combine_itag(u32 *itag, struct fib_result *res) |
| 227 | { | 224 | { |
| 228 | #ifdef CONFIG_NET_CLS_ROUTE | 225 | #ifdef CONFIG_NET_CLS_ROUTE |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 41870564df8e..67ea2c0c0ab7 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -520,6 +520,10 @@ struct ip_vs_conn { | |||
| 520 | spinlock_t lock; /* lock for state transition */ | 520 | spinlock_t lock; /* lock for state transition */ |
| 521 | volatile __u16 flags; /* status flags */ | 521 | volatile __u16 flags; /* status flags */ |
| 522 | volatile __u16 state; /* state info */ | 522 | volatile __u16 state; /* state info */ |
| 523 | volatile __u16 old_state; /* old state, to be used for | ||
| 524 | * state transition triggerd | ||
| 525 | * synchronization | ||
| 526 | */ | ||
| 523 | 527 | ||
| 524 | /* Control members */ | 528 | /* Control members */ |
| 525 | struct ip_vs_conn *control; /* Master control connection */ | 529 | struct ip_vs_conn *control; /* Master control connection */ |
| @@ -901,6 +905,10 @@ extern int ip_vs_use_count_inc(void); | |||
| 901 | extern void ip_vs_use_count_dec(void); | 905 | extern void ip_vs_use_count_dec(void); |
| 902 | extern int ip_vs_control_init(void); | 906 | extern int ip_vs_control_init(void); |
| 903 | extern void ip_vs_control_cleanup(void); | 907 | extern void ip_vs_control_cleanup(void); |
| 908 | extern struct ip_vs_dest * | ||
| 909 | ip_vs_find_dest(__be32 daddr, __be16 dport, | ||
| 910 | __be32 vaddr, __be16 vport, __u16 protocol); | ||
| 911 | extern struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp); | ||
| 904 | 912 | ||
| 905 | 913 | ||
| 906 | /* | 914 | /* |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5fcc4c104340..17b60391fcd6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -706,11 +706,16 @@ enum ieee80211_hw_flags { | |||
| 706 | * | 706 | * |
| 707 | * @queues: number of available hardware transmit queues for | 707 | * @queues: number of available hardware transmit queues for |
| 708 | * data packets. WMM/QoS requires at least four. | 708 | * data packets. WMM/QoS requires at least four. |
| 709 | * | ||
| 710 | * @rate_control_algorithm: rate control algorithm for this hardware. | ||
| 711 | * If unset (NULL), the default algorithm will be used. Must be | ||
| 712 | * set before calling ieee80211_register_hw(). | ||
| 709 | */ | 713 | */ |
| 710 | struct ieee80211_hw { | 714 | struct ieee80211_hw { |
| 711 | struct ieee80211_conf conf; | 715 | struct ieee80211_conf conf; |
| 712 | struct wiphy *wiphy; | 716 | struct wiphy *wiphy; |
| 713 | struct workqueue_struct *workqueue; | 717 | struct workqueue_struct *workqueue; |
| 718 | const char *rate_control_algorithm; | ||
| 714 | void *priv; | 719 | void *priv; |
| 715 | u32 flags; | 720 | u32 flags; |
| 716 | unsigned int extra_tx_headroom; | 721 | unsigned int extra_tx_headroom; |
| @@ -936,27 +941,11 @@ enum ieee80211_erp_change_flags { | |||
| 936 | * and remove_interface calls, i.e. while the interface with the | 941 | * and remove_interface calls, i.e. while the interface with the |
| 937 | * given local_address is enabled. | 942 | * given local_address is enabled. |
| 938 | * | 943 | * |
| 939 | * @set_ieee8021x: Enable/disable IEEE 802.1X. This item requests wlan card | ||
| 940 | * to pass unencrypted EAPOL-Key frames even when encryption is | ||
| 941 | * configured. If the wlan card does not require such a configuration, | ||
| 942 | * this function pointer can be set to NULL. | ||
| 943 | * | ||
| 944 | * @set_port_auth: Set port authorization state (IEEE 802.1X PAE) to be | ||
| 945 | * authorized (@authorized=1) or unauthorized (=0). This function can be | ||
| 946 | * used if the wlan hardware or low-level driver implements PAE. | ||
| 947 | * mac80211 will filter frames based on authorization state in any case, | ||
| 948 | * so this function pointer can be NULL if low-level driver does not | ||
| 949 | * require event notification about port state changes. | ||
| 950 | * | ||
| 951 | * @hw_scan: Ask the hardware to service the scan request, no need to start | 944 | * @hw_scan: Ask the hardware to service the scan request, no need to start |
| 952 | * the scan state machine in stack. | 945 | * the scan state machine in stack. |
| 953 | * | 946 | * |
| 954 | * @get_stats: return low-level statistics | 947 | * @get_stats: return low-level statistics |
| 955 | * | 948 | * |
| 956 | * @set_privacy_invoked: For devices that generate their own beacons and probe | ||
| 957 | * response or association responses this updates the state of privacy_invoked | ||
| 958 | * returns 0 for success or an error number. | ||
| 959 | * | ||
| 960 | * @get_sequence_counter: For devices that have internal sequence counters this | 949 | * @get_sequence_counter: For devices that have internal sequence counters this |
| 961 | * callback allows mac80211 to access the current value of a counter. | 950 | * callback allows mac80211 to access the current value of a counter. |
| 962 | * This callback seems not well-defined, tell us if you need it. | 951 | * This callback seems not well-defined, tell us if you need it. |
| @@ -1029,14 +1018,9 @@ struct ieee80211_ops { | |||
| 1029 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1018 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
| 1030 | const u8 *local_address, const u8 *address, | 1019 | const u8 *local_address, const u8 *address, |
| 1031 | struct ieee80211_key_conf *key); | 1020 | struct ieee80211_key_conf *key); |
| 1032 | int (*set_ieee8021x)(struct ieee80211_hw *hw, int use_ieee8021x); | ||
| 1033 | int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr, | ||
| 1034 | int authorized); | ||
| 1035 | int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); | 1021 | int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); |
| 1036 | int (*get_stats)(struct ieee80211_hw *hw, | 1022 | int (*get_stats)(struct ieee80211_hw *hw, |
| 1037 | struct ieee80211_low_level_stats *stats); | 1023 | struct ieee80211_low_level_stats *stats); |
| 1038 | int (*set_privacy_invoked)(struct ieee80211_hw *hw, | ||
| 1039 | int privacy_invoked); | ||
| 1040 | int (*get_sequence_counter)(struct ieee80211_hw *hw, | 1024 | int (*get_sequence_counter)(struct ieee80211_hw *hw, |
| 1041 | u8* addr, u8 keyidx, u8 txrx, | 1025 | u8* addr, u8 keyidx, u8 txrx, |
| 1042 | u32* iv32, u16* iv16); | 1026 | u32* iv32, u16* iv16); |
diff --git a/include/net/sock.h b/include/net/sock.h index 20de3fa7ae40..5504fb9fa88a 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -560,6 +560,14 @@ struct proto { | |||
| 560 | void (*unhash)(struct sock *sk); | 560 | void (*unhash)(struct sock *sk); |
| 561 | int (*get_port)(struct sock *sk, unsigned short snum); | 561 | int (*get_port)(struct sock *sk, unsigned short snum); |
| 562 | 562 | ||
| 563 | #ifdef CONFIG_SMP | ||
| 564 | /* Keeping track of sockets in use */ | ||
| 565 | void (*inuse_add)(struct proto *prot, int inc); | ||
| 566 | int (*inuse_getval)(const struct proto *prot); | ||
| 567 | int *inuse_ptr; | ||
| 568 | #else | ||
| 569 | int inuse; | ||
| 570 | #endif | ||
| 563 | /* Memory pressure */ | 571 | /* Memory pressure */ |
| 564 | void (*enter_memory_pressure)(void); | 572 | void (*enter_memory_pressure)(void); |
| 565 | atomic_t *memory_allocated; /* Current allocated memory. */ | 573 | atomic_t *memory_allocated; /* Current allocated memory. */ |
| @@ -592,12 +600,38 @@ struct proto { | |||
| 592 | #ifdef SOCK_REFCNT_DEBUG | 600 | #ifdef SOCK_REFCNT_DEBUG |
| 593 | atomic_t socks; | 601 | atomic_t socks; |
| 594 | #endif | 602 | #endif |
| 595 | struct { | ||
| 596 | int inuse; | ||
| 597 | u8 __pad[SMP_CACHE_BYTES - sizeof(int)]; | ||
| 598 | } stats[NR_CPUS]; | ||
| 599 | }; | 603 | }; |
| 600 | 604 | ||
| 605 | /* | ||
| 606 | * Special macros to let protos use a fast version of inuse{get|add} | ||
| 607 | * using a static percpu variable per proto instead of an allocated one, | ||
| 608 | * saving one dereference. | ||
| 609 | * This might be changed if/when dynamic percpu vars become fast. | ||
| 610 | */ | ||
| 611 | #ifdef CONFIG_SMP | ||
| 612 | # define DEFINE_PROTO_INUSE(NAME) \ | ||
| 613 | static DEFINE_PER_CPU(int, NAME##_inuse); \ | ||
| 614 | static void NAME##_inuse_add(struct proto *prot, int inc) \ | ||
| 615 | { \ | ||
| 616 | __get_cpu_var(NAME##_inuse) += inc; \ | ||
| 617 | } \ | ||
| 618 | \ | ||
| 619 | static int NAME##_inuse_getval(const struct proto *prot)\ | ||
| 620 | { \ | ||
| 621 | int res = 0, cpu; \ | ||
| 622 | \ | ||
| 623 | for_each_possible_cpu(cpu) \ | ||
| 624 | res += per_cpu(NAME##_inuse, cpu); \ | ||
| 625 | return res; \ | ||
| 626 | } | ||
| 627 | # define REF_PROTO_INUSE(NAME) \ | ||
| 628 | .inuse_add = NAME##_inuse_add, \ | ||
| 629 | .inuse_getval = NAME##_inuse_getval, | ||
| 630 | #else | ||
| 631 | # define DEFINE_PROTO_INUSE(NAME) | ||
| 632 | # define REF_PROTO_INUSE(NAME) | ||
| 633 | #endif | ||
| 634 | |||
| 601 | extern int proto_register(struct proto *prot, int alloc_slab); | 635 | extern int proto_register(struct proto *prot, int alloc_slab); |
| 602 | extern void proto_unregister(struct proto *prot); | 636 | extern void proto_unregister(struct proto *prot); |
| 603 | 637 | ||
| @@ -629,12 +663,29 @@ static inline void sk_refcnt_debug_release(const struct sock *sk) | |||
| 629 | /* Called with local bh disabled */ | 663 | /* Called with local bh disabled */ |
| 630 | static __inline__ void sock_prot_inc_use(struct proto *prot) | 664 | static __inline__ void sock_prot_inc_use(struct proto *prot) |
| 631 | { | 665 | { |
| 632 | prot->stats[smp_processor_id()].inuse++; | 666 | #ifdef CONFIG_SMP |
| 667 | prot->inuse_add(prot, 1); | ||
| 668 | #else | ||
| 669 | prot->inuse++; | ||
| 670 | #endif | ||
| 633 | } | 671 | } |
| 634 | 672 | ||
| 635 | static __inline__ void sock_prot_dec_use(struct proto *prot) | 673 | static __inline__ void sock_prot_dec_use(struct proto *prot) |
| 636 | { | 674 | { |
| 637 | prot->stats[smp_processor_id()].inuse--; | 675 | #ifdef CONFIG_SMP |
| 676 | prot->inuse_add(prot, -1); | ||
| 677 | #else | ||
| 678 | prot->inuse--; | ||
| 679 | #endif | ||
| 680 | } | ||
| 681 | |||
| 682 | static __inline__ int sock_prot_inuse(struct proto *proto) | ||
| 683 | { | ||
| 684 | #ifdef CONFIG_SMP | ||
| 685 | return proto->inuse_getval(proto); | ||
| 686 | #else | ||
| 687 | return proto->inuse; | ||
| 688 | #endif | ||
| 638 | } | 689 | } |
| 639 | 690 | ||
| 640 | /* With per-bucket locks this operation is not-atomic, so that | 691 | /* With per-bucket locks this operation is not-atomic, so that |
diff --git a/init/main.c b/init/main.c index f605a969ea61..80b04b6c5157 100644 --- a/init/main.c +++ b/init/main.c | |||
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <linux/pid_namespace.h> | 56 | #include <linux/pid_namespace.h> |
| 57 | #include <linux/device.h> | 57 | #include <linux/device.h> |
| 58 | #include <linux/kthread.h> | 58 | #include <linux/kthread.h> |
| 59 | #include <linux/sched.h> | ||
| 59 | 60 | ||
| 60 | #include <asm/io.h> | 61 | #include <asm/io.h> |
| 61 | #include <asm/bugs.h> | 62 | #include <asm/bugs.h> |
| @@ -747,11 +748,8 @@ __setup("nosoftlockup", nosoftlockup_setup); | |||
| 747 | static void __init do_pre_smp_initcalls(void) | 748 | static void __init do_pre_smp_initcalls(void) |
| 748 | { | 749 | { |
| 749 | extern int spawn_ksoftirqd(void); | 750 | extern int spawn_ksoftirqd(void); |
| 750 | #ifdef CONFIG_SMP | ||
| 751 | extern int migration_init(void); | ||
| 752 | 751 | ||
| 753 | migration_init(); | 752 | migration_init(); |
| 754 | #endif | ||
| 755 | spawn_ksoftirqd(); | 753 | spawn_ksoftirqd(); |
| 756 | if (!nosoftlockup) | 754 | if (!nosoftlockup) |
| 757 | spawn_softlockup_task(); | 755 | spawn_softlockup_task(); |
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index bfa274ba9ed4..1e04cd464af9 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
| @@ -1010,6 +1010,8 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, | |||
| 1010 | return -EINVAL; | 1010 | return -EINVAL; |
| 1011 | } | 1011 | } |
| 1012 | if (notification.sigev_notify == SIGEV_THREAD) { | 1012 | if (notification.sigev_notify == SIGEV_THREAD) { |
| 1013 | long timeo; | ||
| 1014 | |||
| 1013 | /* create the notify skb */ | 1015 | /* create the notify skb */ |
| 1014 | nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); | 1016 | nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); |
| 1015 | ret = -ENOMEM; | 1017 | ret = -ENOMEM; |
| @@ -1038,8 +1040,8 @@ retry: | |||
| 1038 | goto out; | 1040 | goto out; |
| 1039 | } | 1041 | } |
| 1040 | 1042 | ||
| 1041 | ret = netlink_attachskb(sock, nc, 0, | 1043 | timeo = MAX_SCHEDULE_TIMEOUT; |
| 1042 | MAX_SCHEDULE_TIMEOUT, NULL); | 1044 | ret = netlink_attachskb(sock, nc, 0, &timeo, NULL); |
| 1043 | if (ret == 1) | 1045 | if (ret == 1) |
| 1044 | goto retry; | 1046 | goto retry; |
| 1045 | if (ret) { | 1047 | if (ret) { |
diff --git a/kernel/fork.c b/kernel/fork.c index 28a740151988..8ca1a14cdc8c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -1123,6 +1123,9 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
| 1123 | p->blocked_on = NULL; /* not blocked yet */ | 1123 | p->blocked_on = NULL; /* not blocked yet */ |
| 1124 | #endif | 1124 | #endif |
| 1125 | 1125 | ||
| 1126 | /* Perform scheduler related setup. Assign this task to a CPU. */ | ||
| 1127 | sched_fork(p, clone_flags); | ||
| 1128 | |||
| 1126 | if ((retval = security_task_alloc(p))) | 1129 | if ((retval = security_task_alloc(p))) |
| 1127 | goto bad_fork_cleanup_policy; | 1130 | goto bad_fork_cleanup_policy; |
| 1128 | if ((retval = audit_alloc(p))) | 1131 | if ((retval = audit_alloc(p))) |
| @@ -1212,9 +1215,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
| 1212 | INIT_LIST_HEAD(&p->ptrace_children); | 1215 | INIT_LIST_HEAD(&p->ptrace_children); |
| 1213 | INIT_LIST_HEAD(&p->ptrace_list); | 1216 | INIT_LIST_HEAD(&p->ptrace_list); |
| 1214 | 1217 | ||
| 1215 | /* Perform scheduler related setup. Assign this task to a CPU. */ | ||
| 1216 | sched_fork(p, clone_flags); | ||
| 1217 | |||
| 1218 | /* Now that the task is set up, run cgroup callbacks if | 1218 | /* Now that the task is set up, run cgroup callbacks if |
| 1219 | * necessary. We need to run them before the task is visible | 1219 | * necessary. We need to run them before the task is visible |
| 1220 | * on the tasklist. */ | 1220 | * on the tasklist. */ |
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 00b572666cc7..0a43def6fee7 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c | |||
| @@ -30,6 +30,15 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, | |||
| 30 | return 0; | 30 | return 0; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | static void __user *futex_uaddr(struct robust_list *entry, | ||
| 34 | compat_long_t futex_offset) | ||
| 35 | { | ||
| 36 | compat_uptr_t base = ptr_to_compat(entry); | ||
| 37 | void __user *uaddr = compat_ptr(base + futex_offset); | ||
| 38 | |||
| 39 | return uaddr; | ||
| 40 | } | ||
| 41 | |||
| 33 | /* | 42 | /* |
| 34 | * Walk curr->robust_list (very carefully, it's a userspace list!) | 43 | * Walk curr->robust_list (very carefully, it's a userspace list!) |
| 35 | * and mark any locks found there dead, and notify any waiters. | 44 | * and mark any locks found there dead, and notify any waiters. |
| @@ -76,11 +85,12 @@ void compat_exit_robust_list(struct task_struct *curr) | |||
| 76 | * A pending lock might already be on the list, so | 85 | * A pending lock might already be on the list, so |
| 77 | * dont process it twice: | 86 | * dont process it twice: |
| 78 | */ | 87 | */ |
| 79 | if (entry != pending) | 88 | if (entry != pending) { |
| 80 | if (handle_futex_death((void __user *)entry + futex_offset, | 89 | void __user *uaddr = futex_uaddr(entry, futex_offset); |
| 81 | curr, pi)) | ||
| 82 | return; | ||
| 83 | 90 | ||
| 91 | if (handle_futex_death(uaddr, curr, pi)) | ||
| 92 | return; | ||
| 93 | } | ||
| 84 | if (rc) | 94 | if (rc) |
| 85 | return; | 95 | return; |
| 86 | uentry = next_uentry; | 96 | uentry = next_uentry; |
| @@ -94,9 +104,11 @@ void compat_exit_robust_list(struct task_struct *curr) | |||
| 94 | 104 | ||
| 95 | cond_resched(); | 105 | cond_resched(); |
| 96 | } | 106 | } |
| 97 | if (pending) | 107 | if (pending) { |
| 98 | handle_futex_death((void __user *)pending + futex_offset, | 108 | void __user *uaddr = futex_uaddr(pending, futex_offset); |
| 99 | curr, pip); | 109 | |
| 110 | handle_futex_death(uaddr, curr, pip); | ||
| 111 | } | ||
| 100 | } | 112 | } |
| 101 | 113 | ||
| 102 | asmlinkage long | 114 | asmlinkage long |
diff --git a/kernel/sched.c b/kernel/sched.c index 3f6bd1112900..b18f231a4875 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -75,7 +75,7 @@ | |||
| 75 | */ | 75 | */ |
| 76 | unsigned long long __attribute__((weak)) sched_clock(void) | 76 | unsigned long long __attribute__((weak)) sched_clock(void) |
| 77 | { | 77 | { |
| 78 | return (unsigned long long)jiffies * (1000000000 / HZ); | 78 | return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /* | 81 | /* |
| @@ -99,8 +99,8 @@ unsigned long long __attribute__((weak)) sched_clock(void) | |||
| 99 | /* | 99 | /* |
| 100 | * Some helpers for converting nanosecond timing to jiffy resolution | 100 | * Some helpers for converting nanosecond timing to jiffy resolution |
| 101 | */ | 101 | */ |
| 102 | #define NS_TO_JIFFIES(TIME) ((unsigned long)(TIME) / (1000000000 / HZ)) | 102 | #define NS_TO_JIFFIES(TIME) ((unsigned long)(TIME) / (NSEC_PER_SEC / HZ)) |
| 103 | #define JIFFIES_TO_NS(TIME) ((TIME) * (1000000000 / HZ)) | 103 | #define JIFFIES_TO_NS(TIME) ((TIME) * (NSEC_PER_SEC / HZ)) |
| 104 | 104 | ||
| 105 | #define NICE_0_LOAD SCHED_LOAD_SCALE | 105 | #define NICE_0_LOAD SCHED_LOAD_SCALE |
| 106 | #define NICE_0_SHIFT SCHED_LOAD_SHIFT | 106 | #define NICE_0_SHIFT SCHED_LOAD_SHIFT |
| @@ -460,7 +460,6 @@ enum { | |||
| 460 | SCHED_FEAT_TREE_AVG = 4, | 460 | SCHED_FEAT_TREE_AVG = 4, |
| 461 | SCHED_FEAT_APPROX_AVG = 8, | 461 | SCHED_FEAT_APPROX_AVG = 8, |
| 462 | SCHED_FEAT_WAKEUP_PREEMPT = 16, | 462 | SCHED_FEAT_WAKEUP_PREEMPT = 16, |
| 463 | SCHED_FEAT_PREEMPT_RESTRICT = 32, | ||
| 464 | }; | 463 | }; |
| 465 | 464 | ||
| 466 | const_debug unsigned int sysctl_sched_features = | 465 | const_debug unsigned int sysctl_sched_features = |
| @@ -468,12 +467,17 @@ const_debug unsigned int sysctl_sched_features = | |||
| 468 | SCHED_FEAT_START_DEBIT * 1 | | 467 | SCHED_FEAT_START_DEBIT * 1 | |
| 469 | SCHED_FEAT_TREE_AVG * 0 | | 468 | SCHED_FEAT_TREE_AVG * 0 | |
| 470 | SCHED_FEAT_APPROX_AVG * 0 | | 469 | SCHED_FEAT_APPROX_AVG * 0 | |
| 471 | SCHED_FEAT_WAKEUP_PREEMPT * 1 | | 470 | SCHED_FEAT_WAKEUP_PREEMPT * 1; |
| 472 | SCHED_FEAT_PREEMPT_RESTRICT * 1; | ||
| 473 | 471 | ||
| 474 | #define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x) | 472 | #define sched_feat(x) (sysctl_sched_features & SCHED_FEAT_##x) |
| 475 | 473 | ||
| 476 | /* | 474 | /* |
| 475 | * Number of tasks to iterate in a single balance run. | ||
| 476 | * Limited because this is done with IRQs disabled. | ||
| 477 | */ | ||
| 478 | const_debug unsigned int sysctl_sched_nr_migrate = 32; | ||
| 479 | |||
| 480 | /* | ||
| 477 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu | 481 | * For kernel-internal use: high-speed (but slightly incorrect) per-cpu |
| 478 | * clock constructed from sched_clock(): | 482 | * clock constructed from sched_clock(): |
| 479 | */ | 483 | */ |
| @@ -2237,7 +2241,7 @@ balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
| 2237 | enum cpu_idle_type idle, int *all_pinned, | 2241 | enum cpu_idle_type idle, int *all_pinned, |
| 2238 | int *this_best_prio, struct rq_iterator *iterator) | 2242 | int *this_best_prio, struct rq_iterator *iterator) |
| 2239 | { | 2243 | { |
| 2240 | int pulled = 0, pinned = 0, skip_for_load; | 2244 | int loops = 0, pulled = 0, pinned = 0, skip_for_load; |
| 2241 | struct task_struct *p; | 2245 | struct task_struct *p; |
| 2242 | long rem_load_move = max_load_move; | 2246 | long rem_load_move = max_load_move; |
| 2243 | 2247 | ||
| @@ -2251,10 +2255,10 @@ balance_tasks(struct rq *this_rq, int this_cpu, struct rq *busiest, | |||
| 2251 | */ | 2255 | */ |
| 2252 | p = iterator->start(iterator->arg); | 2256 | p = iterator->start(iterator->arg); |
| 2253 | next: | 2257 | next: |
| 2254 | if (!p) | 2258 | if (!p || loops++ > sysctl_sched_nr_migrate) |
| 2255 | goto out; | 2259 | goto out; |
| 2256 | /* | 2260 | /* |
| 2257 | * To help distribute high priority tasks accross CPUs we don't | 2261 | * To help distribute high priority tasks across CPUs we don't |
| 2258 | * skip a task if it will be the highest priority task (i.e. smallest | 2262 | * skip a task if it will be the highest priority task (i.e. smallest |
| 2259 | * prio value) on its new queue regardless of its load weight | 2263 | * prio value) on its new queue regardless of its load weight |
| 2260 | */ | 2264 | */ |
| @@ -2271,8 +2275,7 @@ next: | |||
| 2271 | rem_load_move -= p->se.load.weight; | 2275 | rem_load_move -= p->se.load.weight; |
| 2272 | 2276 | ||
| 2273 | /* | 2277 | /* |
| 2274 | * We only want to steal up to the prescribed number of tasks | 2278 | * We only want to steal up to the prescribed amount of weighted load. |
| 2275 | * and the prescribed amount of weighted load. | ||
| 2276 | */ | 2279 | */ |
| 2277 | if (rem_load_move > 0) { | 2280 | if (rem_load_move > 0) { |
| 2278 | if (p->prio < *this_best_prio) | 2281 | if (p->prio < *this_best_prio) |
| @@ -4992,6 +4995,32 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu) | |||
| 4992 | */ | 4995 | */ |
| 4993 | cpumask_t nohz_cpu_mask = CPU_MASK_NONE; | 4996 | cpumask_t nohz_cpu_mask = CPU_MASK_NONE; |
| 4994 | 4997 | ||
| 4998 | /* | ||
| 4999 | * Increase the granularity value when there are more CPUs, | ||
| 5000 | * because with more CPUs the 'effective latency' as visible | ||
| 5001 | * to users decreases. But the relationship is not linear, | ||
| 5002 | * so pick a second-best guess by going with the log2 of the | ||
| 5003 | * number of CPUs. | ||
| 5004 | * | ||
| 5005 | * This idea comes from the SD scheduler of Con Kolivas: | ||
| 5006 | */ | ||
| 5007 | static inline void sched_init_granularity(void) | ||
| 5008 | { | ||
| 5009 | unsigned int factor = 1 + ilog2(num_online_cpus()); | ||
| 5010 | const unsigned long limit = 200000000; | ||
| 5011 | |||
| 5012 | sysctl_sched_min_granularity *= factor; | ||
| 5013 | if (sysctl_sched_min_granularity > limit) | ||
| 5014 | sysctl_sched_min_granularity = limit; | ||
| 5015 | |||
| 5016 | sysctl_sched_latency *= factor; | ||
| 5017 | if (sysctl_sched_latency > limit) | ||
| 5018 | sysctl_sched_latency = limit; | ||
| 5019 | |||
| 5020 | sysctl_sched_wakeup_granularity *= factor; | ||
| 5021 | sysctl_sched_batch_wakeup_granularity *= factor; | ||
| 5022 | } | ||
| 5023 | |||
| 4995 | #ifdef CONFIG_SMP | 5024 | #ifdef CONFIG_SMP |
| 4996 | /* | 5025 | /* |
| 4997 | * This is how migration works: | 5026 | * This is how migration works: |
| @@ -5621,7 +5650,7 @@ static struct notifier_block __cpuinitdata migration_notifier = { | |||
| 5621 | .priority = 10 | 5650 | .priority = 10 |
| 5622 | }; | 5651 | }; |
| 5623 | 5652 | ||
| 5624 | int __init migration_init(void) | 5653 | void __init migration_init(void) |
| 5625 | { | 5654 | { |
| 5626 | void *cpu = (void *)(long)smp_processor_id(); | 5655 | void *cpu = (void *)(long)smp_processor_id(); |
| 5627 | int err; | 5656 | int err; |
| @@ -5631,8 +5660,6 @@ int __init migration_init(void) | |||
| 5631 | BUG_ON(err == NOTIFY_BAD); | 5660 | BUG_ON(err == NOTIFY_BAD); |
| 5632 | migration_call(&migration_notifier, CPU_ONLINE, cpu); | 5661 | migration_call(&migration_notifier, CPU_ONLINE, cpu); |
| 5633 | register_cpu_notifier(&migration_notifier); | 5662 | register_cpu_notifier(&migration_notifier); |
| 5634 | |||
| 5635 | return 0; | ||
| 5636 | } | 5663 | } |
| 5637 | #endif | 5664 | #endif |
| 5638 | 5665 | ||
| @@ -6688,10 +6715,12 @@ void __init sched_init_smp(void) | |||
| 6688 | /* Move init over to a non-isolated CPU */ | 6715 | /* Move init over to a non-isolated CPU */ |
| 6689 | if (set_cpus_allowed(current, non_isolated_cpus) < 0) | 6716 | if (set_cpus_allowed(current, non_isolated_cpus) < 0) |
| 6690 | BUG(); | 6717 | BUG(); |
| 6718 | sched_init_granularity(); | ||
| 6691 | } | 6719 | } |
| 6692 | #else | 6720 | #else |
| 6693 | void __init sched_init_smp(void) | 6721 | void __init sched_init_smp(void) |
| 6694 | { | 6722 | { |
| 6723 | sched_init_granularity(); | ||
| 6695 | } | 6724 | } |
| 6696 | #endif /* CONFIG_SMP */ | 6725 | #endif /* CONFIG_SMP */ |
| 6697 | 6726 | ||
| @@ -7228,7 +7257,7 @@ static u64 cpu_usage_read(struct cgroup *cgrp, struct cftype *cft) | |||
| 7228 | spin_unlock_irqrestore(&cpu_rq(i)->lock, flags); | 7257 | spin_unlock_irqrestore(&cpu_rq(i)->lock, flags); |
| 7229 | } | 7258 | } |
| 7230 | /* Convert from ns to ms */ | 7259 | /* Convert from ns to ms */ |
| 7231 | do_div(res, 1000000); | 7260 | do_div(res, NSEC_PER_MSEC); |
| 7232 | 7261 | ||
| 7233 | return res; | 7262 | return res; |
| 7234 | } | 7263 | } |
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index 415e5c385542..ca198a797bfa 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
| @@ -211,7 +211,7 @@ static int sched_debug_show(struct seq_file *m, void *v) | |||
| 211 | #define PN(x) \ | 211 | #define PN(x) \ |
| 212 | SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x)) | 212 | SEQ_printf(m, " .%-40s: %Ld.%06ld\n", #x, SPLIT_NS(x)) |
| 213 | PN(sysctl_sched_latency); | 213 | PN(sysctl_sched_latency); |
| 214 | PN(sysctl_sched_nr_latency); | 214 | PN(sysctl_sched_min_granularity); |
| 215 | PN(sysctl_sched_wakeup_granularity); | 215 | PN(sysctl_sched_wakeup_granularity); |
| 216 | PN(sysctl_sched_batch_wakeup_granularity); | 216 | PN(sysctl_sched_batch_wakeup_granularity); |
| 217 | PN(sysctl_sched_child_runs_first); | 217 | PN(sysctl_sched_child_runs_first); |
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 01859f662ab7..d3c03070872d 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * Targeted preemption latency for CPU-bound tasks: | 24 | * Targeted preemption latency for CPU-bound tasks: |
| 25 | * (default: 20ms, units: nanoseconds) | 25 | * (default: 20ms * ilog(ncpus), units: nanoseconds) |
| 26 | * | 26 | * |
| 27 | * NOTE: this latency value is not the same as the concept of | 27 | * NOTE: this latency value is not the same as the concept of |
| 28 | * 'timeslice length' - timeslices in CFS are of variable length | 28 | * 'timeslice length' - timeslices in CFS are of variable length |
| @@ -32,19 +32,24 @@ | |||
| 32 | * (to see the precise effective timeslice length of your workload, | 32 | * (to see the precise effective timeslice length of your workload, |
| 33 | * run vmstat and monitor the context-switches (cs) field) | 33 | * run vmstat and monitor the context-switches (cs) field) |
| 34 | */ | 34 | */ |
| 35 | const_debug unsigned int sysctl_sched_latency = 20000000ULL; | 35 | unsigned int sysctl_sched_latency = 20000000ULL; |
| 36 | 36 | ||
| 37 | /* | 37 | /* |
| 38 | * After fork, child runs first. (default) If set to 0 then | 38 | * Minimal preemption granularity for CPU-bound tasks: |
| 39 | * parent will (try to) run first. | 39 | * (default: 1 msec * ilog(ncpus), units: nanoseconds) |
| 40 | */ | 40 | */ |
| 41 | const_debug unsigned int sysctl_sched_child_runs_first = 1; | 41 | unsigned int sysctl_sched_min_granularity = 1000000ULL; |
| 42 | 42 | ||
| 43 | /* | 43 | /* |
| 44 | * Minimal preemption granularity for CPU-bound tasks: | 44 | * is kept at sysctl_sched_latency / sysctl_sched_min_granularity |
| 45 | * (default: 2 msec, units: nanoseconds) | 45 | */ |
| 46 | unsigned int sched_nr_latency = 20; | ||
| 47 | |||
| 48 | /* | ||
| 49 | * After fork, child runs first. (default) If set to 0 then | ||
| 50 | * parent will (try to) run first. | ||
| 46 | */ | 51 | */ |
| 47 | const_debug unsigned int sysctl_sched_nr_latency = 20; | 52 | const_debug unsigned int sysctl_sched_child_runs_first = 1; |
| 48 | 53 | ||
| 49 | /* | 54 | /* |
| 50 | * sys_sched_yield() compat mode | 55 | * sys_sched_yield() compat mode |
| @@ -56,23 +61,23 @@ unsigned int __read_mostly sysctl_sched_compat_yield; | |||
| 56 | 61 | ||
| 57 | /* | 62 | /* |
| 58 | * SCHED_BATCH wake-up granularity. | 63 | * SCHED_BATCH wake-up granularity. |
| 59 | * (default: 10 msec, units: nanoseconds) | 64 | * (default: 10 msec * ilog(ncpus), units: nanoseconds) |
| 60 | * | 65 | * |
| 61 | * This option delays the preemption effects of decoupled workloads | 66 | * This option delays the preemption effects of decoupled workloads |
| 62 | * and reduces their over-scheduling. Synchronous workloads will still | 67 | * and reduces their over-scheduling. Synchronous workloads will still |
| 63 | * have immediate wakeup/sleep latencies. | 68 | * have immediate wakeup/sleep latencies. |
| 64 | */ | 69 | */ |
| 65 | const_debug unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL; | 70 | unsigned int sysctl_sched_batch_wakeup_granularity = 10000000UL; |
| 66 | 71 | ||
| 67 | /* | 72 | /* |
| 68 | * SCHED_OTHER wake-up granularity. | 73 | * SCHED_OTHER wake-up granularity. |
| 69 | * (default: 10 msec, units: nanoseconds) | 74 | * (default: 10 msec * ilog(ncpus), units: nanoseconds) |
| 70 | * | 75 | * |
| 71 | * This option delays the preemption effects of decoupled workloads | 76 | * This option delays the preemption effects of decoupled workloads |
| 72 | * and reduces their over-scheduling. Synchronous workloads will still | 77 | * and reduces their over-scheduling. Synchronous workloads will still |
| 73 | * have immediate wakeup/sleep latencies. | 78 | * have immediate wakeup/sleep latencies. |
| 74 | */ | 79 | */ |
| 75 | const_debug unsigned int sysctl_sched_wakeup_granularity = 10000000UL; | 80 | unsigned int sysctl_sched_wakeup_granularity = 10000000UL; |
| 76 | 81 | ||
| 77 | const_debug unsigned int sysctl_sched_migration_cost = 500000UL; | 82 | const_debug unsigned int sysctl_sched_migration_cost = 500000UL; |
| 78 | 83 | ||
| @@ -212,6 +217,22 @@ static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq) | |||
| 212 | * Scheduling class statistics methods: | 217 | * Scheduling class statistics methods: |
| 213 | */ | 218 | */ |
| 214 | 219 | ||
| 220 | #ifdef CONFIG_SCHED_DEBUG | ||
| 221 | int sched_nr_latency_handler(struct ctl_table *table, int write, | ||
| 222 | struct file *filp, void __user *buffer, size_t *lenp, | ||
| 223 | loff_t *ppos) | ||
| 224 | { | ||
| 225 | int ret = proc_dointvec_minmax(table, write, filp, buffer, lenp, ppos); | ||
| 226 | |||
| 227 | if (ret || !write) | ||
| 228 | return ret; | ||
| 229 | |||
| 230 | sched_nr_latency = DIV_ROUND_UP(sysctl_sched_latency, | ||
| 231 | sysctl_sched_min_granularity); | ||
| 232 | |||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | #endif | ||
| 215 | 236 | ||
| 216 | /* | 237 | /* |
| 217 | * The idea is to set a period in which each task runs once. | 238 | * The idea is to set a period in which each task runs once. |
| @@ -224,7 +245,7 @@ static inline struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq) | |||
| 224 | static u64 __sched_period(unsigned long nr_running) | 245 | static u64 __sched_period(unsigned long nr_running) |
| 225 | { | 246 | { |
| 226 | u64 period = sysctl_sched_latency; | 247 | u64 period = sysctl_sched_latency; |
| 227 | unsigned long nr_latency = sysctl_sched_nr_latency; | 248 | unsigned long nr_latency = sched_nr_latency; |
| 228 | 249 | ||
| 229 | if (unlikely(nr_running > nr_latency)) { | 250 | if (unlikely(nr_running > nr_latency)) { |
| 230 | period *= nr_running; | 251 | period *= nr_running; |
| @@ -259,6 +280,7 @@ static u64 __sched_vslice(unsigned long rq_weight, unsigned long nr_running) | |||
| 259 | { | 280 | { |
| 260 | u64 vslice = __sched_period(nr_running); | 281 | u64 vslice = __sched_period(nr_running); |
| 261 | 282 | ||
| 283 | vslice *= NICE_0_LOAD; | ||
| 262 | do_div(vslice, rq_weight); | 284 | do_div(vslice, rq_weight); |
| 263 | 285 | ||
| 264 | return vslice; | 286 | return vslice; |
| @@ -472,19 +494,26 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) | |||
| 472 | } else if (sched_feat(APPROX_AVG) && cfs_rq->nr_running) | 494 | } else if (sched_feat(APPROX_AVG) && cfs_rq->nr_running) |
| 473 | vruntime += sched_vslice(cfs_rq)/2; | 495 | vruntime += sched_vslice(cfs_rq)/2; |
| 474 | 496 | ||
| 497 | /* | ||
| 498 | * The 'current' period is already promised to the current tasks, | ||
| 499 | * however the extra weight of the new task will slow them down a | ||
| 500 | * little, place the new task so that it fits in the slot that | ||
| 501 | * stays open at the end. | ||
| 502 | */ | ||
| 475 | if (initial && sched_feat(START_DEBIT)) | 503 | if (initial && sched_feat(START_DEBIT)) |
| 476 | vruntime += sched_vslice_add(cfs_rq, se); | 504 | vruntime += sched_vslice_add(cfs_rq, se); |
| 477 | 505 | ||
| 478 | if (!initial) { | 506 | if (!initial) { |
| 507 | /* sleeps upto a single latency don't count. */ | ||
| 479 | if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) && | 508 | if (sched_feat(NEW_FAIR_SLEEPERS) && entity_is_task(se) && |
| 480 | task_of(se)->policy != SCHED_BATCH) | 509 | task_of(se)->policy != SCHED_BATCH) |
| 481 | vruntime -= sysctl_sched_latency; | 510 | vruntime -= sysctl_sched_latency; |
| 482 | 511 | ||
| 483 | vruntime = max_t(s64, vruntime, se->vruntime); | 512 | /* ensure we never gain time by being placed backwards. */ |
| 513 | vruntime = max_vruntime(se->vruntime, vruntime); | ||
| 484 | } | 514 | } |
| 485 | 515 | ||
| 486 | se->vruntime = vruntime; | 516 | se->vruntime = vruntime; |
| 487 | |||
| 488 | } | 517 | } |
| 489 | 518 | ||
| 490 | static void | 519 | static void |
| @@ -517,7 +546,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) | |||
| 517 | 546 | ||
| 518 | update_stats_dequeue(cfs_rq, se); | 547 | update_stats_dequeue(cfs_rq, se); |
| 519 | if (sleep) { | 548 | if (sleep) { |
| 520 | se->peer_preempt = 0; | ||
| 521 | #ifdef CONFIG_SCHEDSTATS | 549 | #ifdef CONFIG_SCHEDSTATS |
| 522 | if (entity_is_task(se)) { | 550 | if (entity_is_task(se)) { |
| 523 | struct task_struct *tsk = task_of(se); | 551 | struct task_struct *tsk = task_of(se); |
| @@ -545,10 +573,8 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) | |||
| 545 | 573 | ||
| 546 | ideal_runtime = sched_slice(cfs_rq, curr); | 574 | ideal_runtime = sched_slice(cfs_rq, curr); |
| 547 | delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; | 575 | delta_exec = curr->sum_exec_runtime - curr->prev_sum_exec_runtime; |
| 548 | if (delta_exec > ideal_runtime || | 576 | if (delta_exec > ideal_runtime) |
| 549 | (sched_feat(PREEMPT_RESTRICT) && curr->peer_preempt)) | ||
| 550 | resched_task(rq_of(cfs_rq)->curr); | 577 | resched_task(rq_of(cfs_rq)->curr); |
| 551 | curr->peer_preempt = 0; | ||
| 552 | } | 578 | } |
| 553 | 579 | ||
| 554 | static void | 580 | static void |
| @@ -811,7 +837,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
| 811 | struct task_struct *curr = rq->curr; | 837 | struct task_struct *curr = rq->curr; |
| 812 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); | 838 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); |
| 813 | struct sched_entity *se = &curr->se, *pse = &p->se; | 839 | struct sched_entity *se = &curr->se, *pse = &p->se; |
| 814 | s64 delta, gran; | 840 | unsigned long gran; |
| 815 | 841 | ||
| 816 | if (unlikely(rt_prio(p->prio))) { | 842 | if (unlikely(rt_prio(p->prio))) { |
| 817 | update_rq_clock(rq); | 843 | update_rq_clock(rq); |
| @@ -826,24 +852,20 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) | |||
| 826 | if (unlikely(p->policy == SCHED_BATCH)) | 852 | if (unlikely(p->policy == SCHED_BATCH)) |
| 827 | return; | 853 | return; |
| 828 | 854 | ||
| 829 | if (sched_feat(WAKEUP_PREEMPT)) { | 855 | if (!sched_feat(WAKEUP_PREEMPT)) |
| 830 | while (!is_same_group(se, pse)) { | 856 | return; |
| 831 | se = parent_entity(se); | ||
| 832 | pse = parent_entity(pse); | ||
| 833 | } | ||
| 834 | 857 | ||
| 835 | delta = se->vruntime - pse->vruntime; | 858 | while (!is_same_group(se, pse)) { |
| 836 | gran = sysctl_sched_wakeup_granularity; | 859 | se = parent_entity(se); |
| 837 | if (unlikely(se->load.weight != NICE_0_LOAD)) | 860 | pse = parent_entity(pse); |
| 838 | gran = calc_delta_fair(gran, &se->load); | 861 | } |
| 839 | 862 | ||
| 840 | if (delta > gran) { | 863 | gran = sysctl_sched_wakeup_granularity; |
| 841 | int now = !sched_feat(PREEMPT_RESTRICT); | 864 | if (unlikely(se->load.weight != NICE_0_LOAD)) |
| 865 | gran = calc_delta_fair(gran, &se->load); | ||
| 842 | 866 | ||
| 843 | if (now || p->prio < curr->prio || !se->peer_preempt++) | 867 | if (pse->vruntime + gran < se->vruntime) |
| 844 | resched_task(curr); | 868 | resched_task(curr); |
| 845 | } | ||
| 846 | } | ||
| 847 | } | 869 | } |
| 848 | 870 | ||
| 849 | static struct task_struct *pick_next_task_fair(struct rq *rq) | 871 | static struct task_struct *pick_next_task_fair(struct rq *rq) |
| @@ -1045,8 +1067,9 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) | |||
| 1045 | update_curr(cfs_rq); | 1067 | update_curr(cfs_rq); |
| 1046 | place_entity(cfs_rq, se, 1); | 1068 | place_entity(cfs_rq, se, 1); |
| 1047 | 1069 | ||
| 1070 | /* 'curr' will be NULL if the child belongs to a different group */ | ||
| 1048 | if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && | 1071 | if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && |
| 1049 | curr->vruntime < se->vruntime) { | 1072 | curr && curr->vruntime < se->vruntime) { |
| 1050 | /* | 1073 | /* |
| 1051 | * Upon rescheduling, sched_class::put_prev_task() will place | 1074 | * Upon rescheduling, sched_class::put_prev_task() will place |
| 1052 | * 'current' within the tree based on its new key value. | 1075 | * 'current' within the tree based on its new key value. |
| @@ -1054,7 +1077,6 @@ static void task_new_fair(struct rq *rq, struct task_struct *p) | |||
| 1054 | swap(curr->vruntime, se->vruntime); | 1077 | swap(curr->vruntime, se->vruntime); |
| 1055 | } | 1078 | } |
| 1056 | 1079 | ||
| 1057 | se->peer_preempt = 0; | ||
| 1058 | enqueue_task_fair(rq, p, 0); | 1080 | enqueue_task_fair(rq, p, 0); |
| 1059 | resched_task(rq->curr); | 1081 | resched_task(rq->curr); |
| 1060 | } | 1082 | } |
diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h index ef1a7df80ea2..630178e53bb6 100644 --- a/kernel/sched_stats.h +++ b/kernel/sched_stats.h | |||
| @@ -127,7 +127,7 @@ rq_sched_info_depart(struct rq *rq, unsigned long long delta) | |||
| 127 | # define schedstat_set(var, val) do { } while (0) | 127 | # define schedstat_set(var, val) do { } while (0) |
| 128 | #endif | 128 | #endif |
| 129 | 129 | ||
| 130 | #ifdef CONFIG_SCHEDSTATS | 130 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
| 131 | /* | 131 | /* |
| 132 | * Called when a process is dequeued from the active array and given | 132 | * Called when a process is dequeued from the active array and given |
| 133 | * the cpu. We should note that with the exception of interactive | 133 | * the cpu. We should note that with the exception of interactive |
| @@ -155,7 +155,7 @@ static inline void sched_info_dequeued(struct task_struct *t) | |||
| 155 | */ | 155 | */ |
| 156 | static void sched_info_arrive(struct task_struct *t) | 156 | static void sched_info_arrive(struct task_struct *t) |
| 157 | { | 157 | { |
| 158 | unsigned long long now = sched_clock(), delta = 0; | 158 | unsigned long long now = task_rq(t)->clock, delta = 0; |
| 159 | 159 | ||
| 160 | if (t->sched_info.last_queued) | 160 | if (t->sched_info.last_queued) |
| 161 | delta = now - t->sched_info.last_queued; | 161 | delta = now - t->sched_info.last_queued; |
| @@ -186,7 +186,7 @@ static inline void sched_info_queued(struct task_struct *t) | |||
| 186 | { | 186 | { |
| 187 | if (unlikely(sched_info_on())) | 187 | if (unlikely(sched_info_on())) |
| 188 | if (!t->sched_info.last_queued) | 188 | if (!t->sched_info.last_queued) |
| 189 | t->sched_info.last_queued = sched_clock(); | 189 | t->sched_info.last_queued = task_rq(t)->clock; |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | /* | 192 | /* |
| @@ -195,7 +195,8 @@ static inline void sched_info_queued(struct task_struct *t) | |||
| 195 | */ | 195 | */ |
| 196 | static inline void sched_info_depart(struct task_struct *t) | 196 | static inline void sched_info_depart(struct task_struct *t) |
| 197 | { | 197 | { |
| 198 | unsigned long long delta = sched_clock() - t->sched_info.last_arrival; | 198 | unsigned long long delta = task_rq(t)->clock - |
| 199 | t->sched_info.last_arrival; | ||
| 199 | 200 | ||
| 200 | t->sched_info.cpu_time += delta; | 201 | t->sched_info.cpu_time += delta; |
| 201 | rq_sched_info_depart(task_rq(t), delta); | 202 | rq_sched_info_depart(task_rq(t), delta); |
| @@ -231,5 +232,5 @@ sched_info_switch(struct task_struct *prev, struct task_struct *next) | |||
| 231 | #else | 232 | #else |
| 232 | #define sched_info_queued(t) do { } while (0) | 233 | #define sched_info_queued(t) do { } while (0) |
| 233 | #define sched_info_switch(t, next) do { } while (0) | 234 | #define sched_info_switch(t, next) do { } while (0) |
| 234 | #endif /* CONFIG_SCHEDSTATS */ | 235 | #endif /* CONFIG_SCHEDSTATS || CONFIG_TASK_DELAY_ACCT */ |
| 235 | 236 | ||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 3b4efbe26445..3a1744fed2b6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -226,20 +226,23 @@ static struct ctl_table root_table[] = { | |||
| 226 | 226 | ||
| 227 | #ifdef CONFIG_SCHED_DEBUG | 227 | #ifdef CONFIG_SCHED_DEBUG |
| 228 | static unsigned long min_sched_granularity_ns = 100000; /* 100 usecs */ | 228 | static unsigned long min_sched_granularity_ns = 100000; /* 100 usecs */ |
| 229 | static unsigned long max_sched_granularity_ns = 1000000000; /* 1 second */ | 229 | static unsigned long max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
| 230 | static unsigned long min_wakeup_granularity_ns; /* 0 usecs */ | 230 | static unsigned long min_wakeup_granularity_ns; /* 0 usecs */ |
| 231 | static unsigned long max_wakeup_granularity_ns = 1000000000; /* 1 second */ | 231 | static unsigned long max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ |
| 232 | #endif | 232 | #endif |
| 233 | 233 | ||
| 234 | static struct ctl_table kern_table[] = { | 234 | static struct ctl_table kern_table[] = { |
| 235 | #ifdef CONFIG_SCHED_DEBUG | 235 | #ifdef CONFIG_SCHED_DEBUG |
| 236 | { | 236 | { |
| 237 | .ctl_name = CTL_UNNUMBERED, | 237 | .ctl_name = CTL_UNNUMBERED, |
| 238 | .procname = "sched_nr_latency", | 238 | .procname = "sched_min_granularity_ns", |
| 239 | .data = &sysctl_sched_nr_latency, | 239 | .data = &sysctl_sched_min_granularity, |
| 240 | .maxlen = sizeof(unsigned int), | 240 | .maxlen = sizeof(unsigned int), |
| 241 | .mode = 0644, | 241 | .mode = 0644, |
| 242 | .proc_handler = &proc_dointvec, | 242 | .proc_handler = &sched_nr_latency_handler, |
| 243 | .strategy = &sysctl_intvec, | ||
| 244 | .extra1 = &min_sched_granularity_ns, | ||
| 245 | .extra2 = &max_sched_granularity_ns, | ||
| 243 | }, | 246 | }, |
| 244 | { | 247 | { |
| 245 | .ctl_name = CTL_UNNUMBERED, | 248 | .ctl_name = CTL_UNNUMBERED, |
| @@ -247,7 +250,7 @@ static struct ctl_table kern_table[] = { | |||
| 247 | .data = &sysctl_sched_latency, | 250 | .data = &sysctl_sched_latency, |
| 248 | .maxlen = sizeof(unsigned int), | 251 | .maxlen = sizeof(unsigned int), |
| 249 | .mode = 0644, | 252 | .mode = 0644, |
| 250 | .proc_handler = &proc_dointvec_minmax, | 253 | .proc_handler = &sched_nr_latency_handler, |
| 251 | .strategy = &sysctl_intvec, | 254 | .strategy = &sysctl_intvec, |
| 252 | .extra1 = &min_sched_granularity_ns, | 255 | .extra1 = &min_sched_granularity_ns, |
| 253 | .extra2 = &max_sched_granularity_ns, | 256 | .extra2 = &max_sched_granularity_ns, |
| @@ -298,6 +301,14 @@ static struct ctl_table kern_table[] = { | |||
| 298 | .mode = 0644, | 301 | .mode = 0644, |
| 299 | .proc_handler = &proc_dointvec, | 302 | .proc_handler = &proc_dointvec, |
| 300 | }, | 303 | }, |
| 304 | { | ||
| 305 | .ctl_name = CTL_UNNUMBERED, | ||
| 306 | .procname = "sched_nr_migrate", | ||
| 307 | .data = &sysctl_sched_nr_migrate, | ||
| 308 | .maxlen = sizeof(unsigned int), | ||
| 309 | .mode = 644, | ||
| 310 | .proc_handler = &proc_dointvec, | ||
| 311 | }, | ||
| 301 | #endif | 312 | #endif |
| 302 | { | 313 | { |
| 303 | .ctl_name = CTL_UNNUMBERED, | 314 | .ctl_name = CTL_UNNUMBERED, |
diff --git a/kernel/timer.c b/kernel/timer.c index 00e44e2afd67..a05817c021d6 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
| @@ -817,6 +817,19 @@ unsigned long next_timer_interrupt(void) | |||
| 817 | 817 | ||
| 818 | #endif | 818 | #endif |
| 819 | 819 | ||
| 820 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 821 | void account_process_tick(struct task_struct *p, int user_tick) | ||
| 822 | { | ||
| 823 | if (user_tick) { | ||
| 824 | account_user_time(p, jiffies_to_cputime(1)); | ||
| 825 | account_user_time_scaled(p, jiffies_to_cputime(1)); | ||
| 826 | } else { | ||
| 827 | account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1)); | ||
| 828 | account_system_time_scaled(p, jiffies_to_cputime(1)); | ||
| 829 | } | ||
| 830 | } | ||
| 831 | #endif | ||
| 832 | |||
| 820 | /* | 833 | /* |
| 821 | * Called from the timer interrupt handler to charge one tick to the current | 834 | * Called from the timer interrupt handler to charge one tick to the current |
| 822 | * process. user_tick is 1 if the tick is user time, 0 for system. | 835 | * process. user_tick is 1 if the tick is user time, 0 for system. |
| @@ -827,13 +840,7 @@ void update_process_times(int user_tick) | |||
| 827 | int cpu = smp_processor_id(); | 840 | int cpu = smp_processor_id(); |
| 828 | 841 | ||
| 829 | /* Note: this timer irq context must be accounted for as well. */ | 842 | /* Note: this timer irq context must be accounted for as well. */ |
| 830 | if (user_tick) { | 843 | account_process_tick(p, user_tick); |
| 831 | account_user_time(p, jiffies_to_cputime(1)); | ||
| 832 | account_user_time_scaled(p, jiffies_to_cputime(1)); | ||
| 833 | } else { | ||
| 834 | account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1)); | ||
| 835 | account_system_time_scaled(p, jiffies_to_cputime(1)); | ||
| 836 | } | ||
| 837 | run_local_timers(); | 844 | run_local_timers(); |
| 838 | if (rcu_pending(cpu)) | 845 | if (rcu_pending(cpu)) |
| 839 | rcu_check_callbacks(cpu, user_tick); | 846 | rcu_check_callbacks(cpu, user_tick); |
diff --git a/lib/libcrc32c.c b/lib/libcrc32c.c index 802f11f0bf5b..b5c3287d8ea4 100644 --- a/lib/libcrc32c.c +++ b/lib/libcrc32c.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/crc32c.h> | 33 | #include <linux/crc32c.h> |
| 34 | #include <linux/compiler.h> | 34 | #include <linux/compiler.h> |
| 35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
| 36 | #include <asm/byteorder.h> | ||
| 37 | 36 | ||
| 38 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); | 37 | MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); |
| 39 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); | 38 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations"); |
| @@ -161,15 +160,13 @@ static const u32 crc32c_table[256] = { | |||
| 161 | */ | 160 | */ |
| 162 | 161 | ||
| 163 | u32 __pure | 162 | u32 __pure |
| 164 | crc32c_le(u32 seed, unsigned char const *data, size_t length) | 163 | crc32c_le(u32 crc, unsigned char const *data, size_t length) |
| 165 | { | 164 | { |
| 166 | u32 crc = __cpu_to_le32(seed); | ||
| 167 | |||
| 168 | while (length--) | 165 | while (length--) |
| 169 | crc = | 166 | crc = |
| 170 | crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); | 167 | crc32c_table[(crc ^ *data++) & 0xFFL] ^ (crc >> 8); |
| 171 | 168 | ||
| 172 | return __le32_to_cpu(crc); | 169 | return crc; |
| 173 | } | 170 | } |
| 174 | 171 | ||
| 175 | #endif /* CRC_LE_BITS == 8 */ | 172 | #endif /* CRC_LE_BITS == 8 */ |
| @@ -1080,7 +1080,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) | |||
| 1080 | struct page *page; | 1080 | struct page *page; |
| 1081 | struct kmem_cache_node *n; | 1081 | struct kmem_cache_node *n; |
| 1082 | void *start; | 1082 | void *start; |
| 1083 | void *end; | ||
| 1084 | void *last; | 1083 | void *last; |
| 1085 | void *p; | 1084 | void *p; |
| 1086 | 1085 | ||
| @@ -1101,7 +1100,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) | |||
| 1101 | SetSlabDebug(page); | 1100 | SetSlabDebug(page); |
| 1102 | 1101 | ||
| 1103 | start = page_address(page); | 1102 | start = page_address(page); |
| 1104 | end = start + s->objects * s->size; | ||
| 1105 | 1103 | ||
| 1106 | if (unlikely(s->flags & SLAB_POISON)) | 1104 | if (unlikely(s->flags & SLAB_POISON)) |
| 1107 | memset(start, POISON_INUSE, PAGE_SIZE << s->order); | 1105 | memset(start, POISON_INUSE, PAGE_SIZE << s->order); |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 3fe4fc86055f..6567213959cb 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -376,6 +376,7 @@ void vlan_setup(struct net_device *new_dev) | |||
| 376 | new_dev->init = vlan_dev_init; | 376 | new_dev->init = vlan_dev_init; |
| 377 | new_dev->open = vlan_dev_open; | 377 | new_dev->open = vlan_dev_open; |
| 378 | new_dev->stop = vlan_dev_stop; | 378 | new_dev->stop = vlan_dev_stop; |
| 379 | new_dev->set_mac_address = vlan_set_mac_address; | ||
| 379 | new_dev->set_multicast_list = vlan_dev_set_multicast_list; | 380 | new_dev->set_multicast_list = vlan_dev_set_multicast_list; |
| 380 | new_dev->change_rx_flags = vlan_change_rx_flags; | 381 | new_dev->change_rx_flags = vlan_change_rx_flags; |
| 381 | new_dev->destructor = free_netdev; | 382 | new_dev->destructor = free_netdev; |
| @@ -636,6 +637,10 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
| 636 | if (!vlandev) | 637 | if (!vlandev) |
| 637 | continue; | 638 | continue; |
| 638 | 639 | ||
| 640 | flgs = vlandev->flags; | ||
| 641 | if (!(flgs & IFF_UP)) | ||
| 642 | continue; | ||
| 643 | |||
| 639 | vlan_sync_address(dev, vlandev); | 644 | vlan_sync_address(dev, vlandev); |
| 640 | } | 645 | } |
| 641 | break; | 646 | break; |
| @@ -747,6 +752,7 @@ static int vlan_ioctl_handler(struct net *net, void __user *arg) | |||
| 747 | vlan_dev_set_ingress_priority(dev, | 752 | vlan_dev_set_ingress_priority(dev, |
| 748 | args.u.skb_priority, | 753 | args.u.skb_priority, |
| 749 | args.vlan_qos); | 754 | args.vlan_qos); |
| 755 | err = 0; | ||
| 750 | break; | 756 | break; |
| 751 | 757 | ||
| 752 | case SET_VLAN_EGRESS_PRIORITY_CMD: | 758 | case SET_VLAN_EGRESS_PRIORITY_CMD: |
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index cf4a80d06b35..2cd1393073ec 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h | |||
| @@ -60,6 +60,7 @@ int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev | |||
| 60 | int vlan_dev_change_mtu(struct net_device *dev, int new_mtu); | 60 | int vlan_dev_change_mtu(struct net_device *dev, int new_mtu); |
| 61 | int vlan_dev_open(struct net_device* dev); | 61 | int vlan_dev_open(struct net_device* dev); |
| 62 | int vlan_dev_stop(struct net_device* dev); | 62 | int vlan_dev_stop(struct net_device* dev); |
| 63 | int vlan_set_mac_address(struct net_device *dev, void *p); | ||
| 63 | int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd); | 64 | int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd); |
| 64 | void vlan_dev_set_ingress_priority(const struct net_device *dev, | 65 | void vlan_dev_set_ingress_priority(const struct net_device *dev, |
| 65 | u32 skb_prio, short vlan_prio); | 66 | u32 skb_prio, short vlan_prio); |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 1a1740aa9a8b..7a36878241da 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
| @@ -665,6 +665,32 @@ int vlan_dev_stop(struct net_device *dev) | |||
| 665 | return 0; | 665 | return 0; |
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | int vlan_set_mac_address(struct net_device *dev, void *p) | ||
| 669 | { | ||
| 670 | struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev; | ||
| 671 | struct sockaddr *addr = p; | ||
| 672 | int err; | ||
| 673 | |||
| 674 | if (!is_valid_ether_addr(addr->sa_data)) | ||
| 675 | return -EADDRNOTAVAIL; | ||
| 676 | |||
| 677 | if (!(dev->flags & IFF_UP)) | ||
| 678 | goto out; | ||
| 679 | |||
| 680 | if (compare_ether_addr(addr->sa_data, real_dev->dev_addr)) { | ||
| 681 | err = dev_unicast_add(real_dev, addr->sa_data, ETH_ALEN); | ||
| 682 | if (err < 0) | ||
| 683 | return err; | ||
| 684 | } | ||
| 685 | |||
| 686 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) | ||
| 687 | dev_unicast_delete(real_dev, dev->dev_addr, ETH_ALEN); | ||
| 688 | |||
| 689 | out: | ||
| 690 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | ||
| 691 | return 0; | ||
| 692 | } | ||
| 693 | |||
| 668 | int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | 694 | int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) |
| 669 | { | 695 | { |
| 670 | struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev; | 696 | struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev; |
diff --git a/net/bridge/netfilter/ebt_arp.c b/net/bridge/netfilter/ebt_arp.c index 1a46952a56d9..18141392a9b4 100644 --- a/net/bridge/netfilter/ebt_arp.c +++ b/net/bridge/netfilter/ebt_arp.c | |||
| @@ -34,7 +34,7 @@ static int ebt_filter_arp(const struct sk_buff *skb, const struct net_device *in | |||
| 34 | ah->ar_pro, EBT_ARP_PTYPE)) | 34 | ah->ar_pro, EBT_ARP_PTYPE)) |
| 35 | return EBT_NOMATCH; | 35 | return EBT_NOMATCH; |
| 36 | 36 | ||
| 37 | if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP)) { | 37 | if (info->bitmask & (EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_GRAT)) { |
| 38 | __be32 saddr, daddr, *sap, *dap; | 38 | __be32 saddr, daddr, *sap, *dap; |
| 39 | 39 | ||
| 40 | if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP)) | 40 | if (ah->ar_pln != sizeof(__be32) || ah->ar_pro != htons(ETH_P_IP)) |
diff --git a/net/core/dev.c b/net/core/dev.c index be6cedab5aa8..dd7e30754cbc 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -4330,7 +4330,6 @@ static struct hlist_head *netdev_create_hash(void) | |||
| 4330 | static int __net_init netdev_init(struct net *net) | 4330 | static int __net_init netdev_init(struct net *net) |
| 4331 | { | 4331 | { |
| 4332 | INIT_LIST_HEAD(&net->dev_base_head); | 4332 | INIT_LIST_HEAD(&net->dev_base_head); |
| 4333 | rwlock_init(&dev_base_lock); | ||
| 4334 | 4333 | ||
| 4335 | net->dev_name_head = netdev_create_hash(); | 4334 | net->dev_name_head = netdev_create_hash(); |
| 4336 | if (net->dev_name_head == NULL) | 4335 | if (net->dev_name_head == NULL) |
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index ae354057d84c..647973daca2b 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
| @@ -168,13 +168,13 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from) | |||
| 168 | da = from->mc_list; | 168 | da = from->mc_list; |
| 169 | while (da != NULL) { | 169 | while (da != NULL) { |
| 170 | next = da->next; | 170 | next = da->next; |
| 171 | if (!da->da_synced) | 171 | if (da->da_synced) { |
| 172 | continue; | 172 | __dev_addr_delete(&to->mc_list, &to->mc_count, |
| 173 | __dev_addr_delete(&to->mc_list, &to->mc_count, | 173 | da->da_addr, da->da_addrlen, 0); |
| 174 | da->da_addr, da->da_addrlen, 0); | 174 | da->da_synced = 0; |
| 175 | da->da_synced = 0; | 175 | __dev_addr_delete(&from->mc_list, &from->mc_count, |
| 176 | __dev_addr_delete(&from->mc_list, &from->mc_count, | 176 | da->da_addr, da->da_addrlen, 0); |
| 177 | da->da_addr, da->da_addrlen, 0); | 177 | } |
| 178 | da = next; | 178 | da = next; |
| 179 | } | 179 | } |
| 180 | __dev_set_rx_mode(to); | 180 | __dev_set_rx_mode(to); |
diff --git a/net/core/dst.c b/net/core/dst.c index 16958e64e577..03daead3592a 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
| 19 | #include <net/net_namespace.h> | 19 | #include <net/net_namespace.h> |
| 20 | 20 | ||
| 21 | #include <net/net_namespace.h> | ||
| 22 | #include <net/dst.h> | 21 | #include <net/dst.h> |
| 23 | 22 | ||
| 24 | /* | 23 | /* |
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 13de6f53f098..848132b6cb73 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
| @@ -18,6 +18,28 @@ | |||
| 18 | static LIST_HEAD(rules_ops); | 18 | static LIST_HEAD(rules_ops); |
| 19 | static DEFINE_SPINLOCK(rules_mod_lock); | 19 | static DEFINE_SPINLOCK(rules_mod_lock); |
| 20 | 20 | ||
| 21 | int fib_default_rule_add(struct fib_rules_ops *ops, | ||
| 22 | u32 pref, u32 table, u32 flags) | ||
| 23 | { | ||
| 24 | struct fib_rule *r; | ||
| 25 | |||
| 26 | r = kzalloc(ops->rule_size, GFP_KERNEL); | ||
| 27 | if (r == NULL) | ||
| 28 | return -ENOMEM; | ||
| 29 | |||
| 30 | atomic_set(&r->refcnt, 1); | ||
| 31 | r->action = FR_ACT_TO_TBL; | ||
| 32 | r->pref = pref; | ||
| 33 | r->table = table; | ||
| 34 | r->flags = flags; | ||
| 35 | |||
| 36 | /* The lock is not required here, the list in unreacheable | ||
| 37 | * at the moment this function is called */ | ||
| 38 | list_add_tail(&r->list, &ops->rules_list); | ||
| 39 | return 0; | ||
| 40 | } | ||
| 41 | EXPORT_SYMBOL(fib_default_rule_add); | ||
| 42 | |||
| 21 | static void notify_rule_change(int event, struct fib_rule *rule, | 43 | static void notify_rule_change(int event, struct fib_rule *rule, |
| 22 | struct fib_rules_ops *ops, struct nlmsghdr *nlh, | 44 | struct fib_rules_ops *ops, struct nlmsghdr *nlh, |
| 23 | u32 pid); | 45 | u32 pid); |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 05979e356963..29b8ee4e35d6 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
| @@ -1435,6 +1435,8 @@ int neigh_table_clear(struct neigh_table *tbl) | |||
| 1435 | kfree(tbl->phash_buckets); | 1435 | kfree(tbl->phash_buckets); |
| 1436 | tbl->phash_buckets = NULL; | 1436 | tbl->phash_buckets = NULL; |
| 1437 | 1437 | ||
| 1438 | remove_proc_entry(tbl->id, init_net.proc_net_stat); | ||
| 1439 | |||
| 1438 | free_percpu(tbl->stats); | 1440 | free_percpu(tbl->stats); |
| 1439 | tbl->stats = NULL; | 1441 | tbl->stats = NULL; |
| 1440 | 1442 | ||
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index e9f0964ce70b..3f6d37deac45 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
| @@ -64,6 +64,20 @@ static struct net *net_alloc(void) | |||
| 64 | return kmem_cache_zalloc(net_cachep, GFP_KERNEL); | 64 | return kmem_cache_zalloc(net_cachep, GFP_KERNEL); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static void net_free(struct net *net) | ||
| 68 | { | ||
| 69 | if (!net) | ||
| 70 | return; | ||
| 71 | |||
| 72 | if (unlikely(atomic_read(&net->use_count) != 0)) { | ||
| 73 | printk(KERN_EMERG "network namespace not free! Usage: %d\n", | ||
| 74 | atomic_read(&net->use_count)); | ||
| 75 | return; | ||
| 76 | } | ||
| 77 | |||
| 78 | kmem_cache_free(net_cachep, net); | ||
| 79 | } | ||
| 80 | |||
| 67 | struct net *copy_net_ns(unsigned long flags, struct net *old_net) | 81 | struct net *copy_net_ns(unsigned long flags, struct net *old_net) |
| 68 | { | 82 | { |
| 69 | struct net *new_net = NULL; | 83 | struct net *new_net = NULL; |
| @@ -100,20 +114,6 @@ out: | |||
| 100 | return new_net; | 114 | return new_net; |
| 101 | } | 115 | } |
| 102 | 116 | ||
| 103 | static void net_free(struct net *net) | ||
| 104 | { | ||
| 105 | if (!net) | ||
| 106 | return; | ||
| 107 | |||
| 108 | if (unlikely(atomic_read(&net->use_count) != 0)) { | ||
| 109 | printk(KERN_EMERG "network namespace not free! Usage: %d\n", | ||
| 110 | atomic_read(&net->use_count)); | ||
| 111 | return; | ||
| 112 | } | ||
| 113 | |||
| 114 | kmem_cache_free(net_cachep, net); | ||
| 115 | } | ||
| 116 | |||
| 117 | static void cleanup_net(struct work_struct *work) | 117 | static void cleanup_net(struct work_struct *work) |
| 118 | { | 118 | { |
| 119 | struct pernet_operations *ops; | 119 | struct pernet_operations *ops; |
diff --git a/net/core/sock.c b/net/core/sock.c index 12ad2067a988..8fc2f84209e4 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -1801,11 +1801,65 @@ EXPORT_SYMBOL(sk_common_release); | |||
| 1801 | static DEFINE_RWLOCK(proto_list_lock); | 1801 | static DEFINE_RWLOCK(proto_list_lock); |
| 1802 | static LIST_HEAD(proto_list); | 1802 | static LIST_HEAD(proto_list); |
| 1803 | 1803 | ||
| 1804 | #ifdef CONFIG_SMP | ||
| 1805 | /* | ||
| 1806 | * Define default functions to keep track of inuse sockets per protocol | ||
| 1807 | * Note that often used protocols use dedicated functions to get a speed increase. | ||
| 1808 | * (see DEFINE_PROTO_INUSE/REF_PROTO_INUSE) | ||
| 1809 | */ | ||
| 1810 | static void inuse_add(struct proto *prot, int inc) | ||
| 1811 | { | ||
| 1812 | per_cpu_ptr(prot->inuse_ptr, smp_processor_id())[0] += inc; | ||
| 1813 | } | ||
| 1814 | |||
| 1815 | static int inuse_get(const struct proto *prot) | ||
| 1816 | { | ||
| 1817 | int res = 0, cpu; | ||
| 1818 | for_each_possible_cpu(cpu) | ||
| 1819 | res += per_cpu_ptr(prot->inuse_ptr, cpu)[0]; | ||
| 1820 | return res; | ||
| 1821 | } | ||
| 1822 | |||
| 1823 | static int inuse_init(struct proto *prot) | ||
| 1824 | { | ||
| 1825 | if (!prot->inuse_getval || !prot->inuse_add) { | ||
| 1826 | prot->inuse_ptr = alloc_percpu(int); | ||
| 1827 | if (prot->inuse_ptr == NULL) | ||
| 1828 | return -ENOBUFS; | ||
| 1829 | |||
| 1830 | prot->inuse_getval = inuse_get; | ||
| 1831 | prot->inuse_add = inuse_add; | ||
| 1832 | } | ||
| 1833 | return 0; | ||
| 1834 | } | ||
| 1835 | |||
| 1836 | static void inuse_fini(struct proto *prot) | ||
| 1837 | { | ||
| 1838 | if (prot->inuse_ptr != NULL) { | ||
| 1839 | free_percpu(prot->inuse_ptr); | ||
| 1840 | prot->inuse_ptr = NULL; | ||
| 1841 | prot->inuse_getval = NULL; | ||
| 1842 | prot->inuse_add = NULL; | ||
| 1843 | } | ||
| 1844 | } | ||
| 1845 | #else | ||
| 1846 | static inline int inuse_init(struct proto *prot) | ||
| 1847 | { | ||
| 1848 | return 0; | ||
| 1849 | } | ||
| 1850 | |||
| 1851 | static inline void inuse_fini(struct proto *prot) | ||
| 1852 | { | ||
| 1853 | } | ||
| 1854 | #endif | ||
| 1855 | |||
| 1804 | int proto_register(struct proto *prot, int alloc_slab) | 1856 | int proto_register(struct proto *prot, int alloc_slab) |
| 1805 | { | 1857 | { |
| 1806 | char *request_sock_slab_name = NULL; | 1858 | char *request_sock_slab_name = NULL; |
| 1807 | char *timewait_sock_slab_name; | 1859 | char *timewait_sock_slab_name; |
| 1808 | int rc = -ENOBUFS; | 1860 | |
| 1861 | if (inuse_init(prot)) | ||
| 1862 | goto out; | ||
| 1809 | 1863 | ||
| 1810 | if (alloc_slab) { | 1864 | if (alloc_slab) { |
| 1811 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, | 1865 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, |
| @@ -1814,7 +1868,7 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
| 1814 | if (prot->slab == NULL) { | 1868 | if (prot->slab == NULL) { |
| 1815 | printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", | 1869 | printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", |
| 1816 | prot->name); | 1870 | prot->name); |
| 1817 | goto out; | 1871 | goto out_free_inuse; |
| 1818 | } | 1872 | } |
| 1819 | 1873 | ||
| 1820 | if (prot->rsk_prot != NULL) { | 1874 | if (prot->rsk_prot != NULL) { |
| @@ -1858,9 +1912,8 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
| 1858 | write_lock(&proto_list_lock); | 1912 | write_lock(&proto_list_lock); |
| 1859 | list_add(&prot->node, &proto_list); | 1913 | list_add(&prot->node, &proto_list); |
| 1860 | write_unlock(&proto_list_lock); | 1914 | write_unlock(&proto_list_lock); |
| 1861 | rc = 0; | 1915 | return 0; |
| 1862 | out: | 1916 | |
| 1863 | return rc; | ||
| 1864 | out_free_timewait_sock_slab_name: | 1917 | out_free_timewait_sock_slab_name: |
| 1865 | kfree(timewait_sock_slab_name); | 1918 | kfree(timewait_sock_slab_name); |
| 1866 | out_free_request_sock_slab: | 1919 | out_free_request_sock_slab: |
| @@ -1873,7 +1926,10 @@ out_free_request_sock_slab_name: | |||
| 1873 | out_free_sock_slab: | 1926 | out_free_sock_slab: |
| 1874 | kmem_cache_destroy(prot->slab); | 1927 | kmem_cache_destroy(prot->slab); |
| 1875 | prot->slab = NULL; | 1928 | prot->slab = NULL; |
| 1876 | goto out; | 1929 | out_free_inuse: |
| 1930 | inuse_fini(prot); | ||
| 1931 | out: | ||
| 1932 | return -ENOBUFS; | ||
| 1877 | } | 1933 | } |
| 1878 | 1934 | ||
| 1879 | EXPORT_SYMBOL(proto_register); | 1935 | EXPORT_SYMBOL(proto_register); |
| @@ -1884,6 +1940,7 @@ void proto_unregister(struct proto *prot) | |||
| 1884 | list_del(&prot->node); | 1940 | list_del(&prot->node); |
| 1885 | write_unlock(&proto_list_lock); | 1941 | write_unlock(&proto_list_lock); |
| 1886 | 1942 | ||
| 1943 | inuse_fini(prot); | ||
| 1887 | if (prot->slab != NULL) { | 1944 | if (prot->slab != NULL) { |
| 1888 | kmem_cache_destroy(prot->slab); | 1945 | kmem_cache_destroy(prot->slab); |
| 1889 | prot->slab = NULL; | 1946 | prot->slab = NULL; |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index 01a6a808bdb7..db17b83e8d3e 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -922,6 +922,8 @@ static struct timewait_sock_ops dccp_timewait_sock_ops = { | |||
| 922 | .twsk_obj_size = sizeof(struct inet_timewait_sock), | 922 | .twsk_obj_size = sizeof(struct inet_timewait_sock), |
| 923 | }; | 923 | }; |
| 924 | 924 | ||
| 925 | DEFINE_PROTO_INUSE(dccp_v4) | ||
| 926 | |||
| 925 | static struct proto dccp_v4_prot = { | 927 | static struct proto dccp_v4_prot = { |
| 926 | .name = "DCCP", | 928 | .name = "DCCP", |
| 927 | .owner = THIS_MODULE, | 929 | .owner = THIS_MODULE, |
| @@ -950,6 +952,7 @@ static struct proto dccp_v4_prot = { | |||
| 950 | .compat_setsockopt = compat_dccp_setsockopt, | 952 | .compat_setsockopt = compat_dccp_setsockopt, |
| 951 | .compat_getsockopt = compat_dccp_getsockopt, | 953 | .compat_getsockopt = compat_dccp_getsockopt, |
| 952 | #endif | 954 | #endif |
| 955 | REF_PROTO_INUSE(dccp_v4) | ||
| 953 | }; | 956 | }; |
| 954 | 957 | ||
| 955 | static struct net_protocol dccp_v4_protocol = { | 958 | static struct net_protocol dccp_v4_protocol = { |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 62428ff137dd..87c98fb86fa8 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -1107,6 +1107,8 @@ static struct timewait_sock_ops dccp6_timewait_sock_ops = { | |||
| 1107 | .twsk_obj_size = sizeof(struct dccp6_timewait_sock), | 1107 | .twsk_obj_size = sizeof(struct dccp6_timewait_sock), |
| 1108 | }; | 1108 | }; |
| 1109 | 1109 | ||
| 1110 | DEFINE_PROTO_INUSE(dccp_v6) | ||
| 1111 | |||
| 1110 | static struct proto dccp_v6_prot = { | 1112 | static struct proto dccp_v6_prot = { |
| 1111 | .name = "DCCPv6", | 1113 | .name = "DCCPv6", |
| 1112 | .owner = THIS_MODULE, | 1114 | .owner = THIS_MODULE, |
| @@ -1135,6 +1137,7 @@ static struct proto dccp_v6_prot = { | |||
| 1135 | .compat_setsockopt = compat_dccp_setsockopt, | 1137 | .compat_setsockopt = compat_dccp_setsockopt, |
| 1136 | .compat_getsockopt = compat_dccp_getsockopt, | 1138 | .compat_getsockopt = compat_dccp_getsockopt, |
| 1137 | #endif | 1139 | #endif |
| 1140 | REF_PROTO_INUSE(dccp_v6) | ||
| 1138 | }; | 1141 | }; |
| 1139 | 1142 | ||
| 1140 | static struct inet6_protocol dccp_v6_protocol = { | 1143 | static struct inet6_protocol dccp_v6_protocol = { |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index d84973928033..7a3bea9c28c1 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -1072,11 +1072,13 @@ static int __init dccp_init(void) | |||
| 1072 | } | 1072 | } |
| 1073 | 1073 | ||
| 1074 | for (i = 0; i < dccp_hashinfo.ehash_size; i++) { | 1074 | for (i = 0; i < dccp_hashinfo.ehash_size; i++) { |
| 1075 | rwlock_init(&dccp_hashinfo.ehash[i].lock); | ||
| 1076 | INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].chain); | 1075 | INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].chain); |
| 1077 | INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].twchain); | 1076 | INIT_HLIST_HEAD(&dccp_hashinfo.ehash[i].twchain); |
| 1078 | } | 1077 | } |
| 1079 | 1078 | ||
| 1079 | if (inet_ehash_locks_alloc(&dccp_hashinfo)) | ||
| 1080 | goto out_free_dccp_ehash; | ||
| 1081 | |||
| 1080 | bhash_order = ehash_order; | 1082 | bhash_order = ehash_order; |
| 1081 | 1083 | ||
| 1082 | do { | 1084 | do { |
| @@ -1091,7 +1093,7 @@ static int __init dccp_init(void) | |||
| 1091 | 1093 | ||
| 1092 | if (!dccp_hashinfo.bhash) { | 1094 | if (!dccp_hashinfo.bhash) { |
| 1093 | DCCP_CRIT("Failed to allocate DCCP bind hash table"); | 1095 | DCCP_CRIT("Failed to allocate DCCP bind hash table"); |
| 1094 | goto out_free_dccp_ehash; | 1096 | goto out_free_dccp_locks; |
| 1095 | } | 1097 | } |
| 1096 | 1098 | ||
| 1097 | for (i = 0; i < dccp_hashinfo.bhash_size; i++) { | 1099 | for (i = 0; i < dccp_hashinfo.bhash_size; i++) { |
| @@ -1121,6 +1123,8 @@ out_free_dccp_mib: | |||
| 1121 | out_free_dccp_bhash: | 1123 | out_free_dccp_bhash: |
| 1122 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); | 1124 | free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order); |
| 1123 | dccp_hashinfo.bhash = NULL; | 1125 | dccp_hashinfo.bhash = NULL; |
| 1126 | out_free_dccp_locks: | ||
| 1127 | inet_ehash_locks_free(&dccp_hashinfo); | ||
| 1124 | out_free_dccp_ehash: | 1128 | out_free_dccp_ehash: |
| 1125 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); | 1129 | free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order); |
| 1126 | dccp_hashinfo.ehash = NULL; | 1130 | dccp_hashinfo.ehash = NULL; |
| @@ -1139,6 +1143,7 @@ static void __exit dccp_fini(void) | |||
| 1139 | free_pages((unsigned long)dccp_hashinfo.ehash, | 1143 | free_pages((unsigned long)dccp_hashinfo.ehash, |
| 1140 | get_order(dccp_hashinfo.ehash_size * | 1144 | get_order(dccp_hashinfo.ehash_size * |
| 1141 | sizeof(struct inet_ehash_bucket))); | 1145 | sizeof(struct inet_ehash_bucket))); |
| 1146 | inet_ehash_locks_free(&dccp_hashinfo); | ||
| 1142 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); | 1147 | kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); |
| 1143 | dccp_ackvec_exit(); | 1148 | dccp_ackvec_exit(); |
| 1144 | dccp_sysctl_exit(); | 1149 | dccp_sysctl_exit(); |
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index 26130afd8029..66e266fb5908 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
| @@ -1439,7 +1439,7 @@ static const struct file_operations dn_dev_seq_fops = { | |||
| 1439 | 1439 | ||
| 1440 | #endif /* CONFIG_PROC_FS */ | 1440 | #endif /* CONFIG_PROC_FS */ |
| 1441 | 1441 | ||
| 1442 | static int __initdata addr[2]; | 1442 | static int addr[2]; |
| 1443 | module_param_array(addr, int, NULL, 0444); | 1443 | module_param_array(addr, int, NULL, 0444); |
| 1444 | MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node"); | 1444 | MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node"); |
| 1445 | 1445 | ||
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 97eee5e8fbbe..66663e5d7acd 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
| @@ -293,9 +293,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route * | |||
| 293 | dn_rt_hash_table[hash].chain); | 293 | dn_rt_hash_table[hash].chain); |
| 294 | rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth); | 294 | rcu_assign_pointer(dn_rt_hash_table[hash].chain, rth); |
| 295 | 295 | ||
| 296 | rth->u.dst.__use++; | 296 | dst_use(&rth->u.dst, now); |
| 297 | dst_hold(&rth->u.dst); | ||
| 298 | rth->u.dst.lastuse = now; | ||
| 299 | spin_unlock_bh(&dn_rt_hash_table[hash].lock); | 297 | spin_unlock_bh(&dn_rt_hash_table[hash].lock); |
| 300 | 298 | ||
| 301 | dnrt_drop(rt); | 299 | dnrt_drop(rt); |
| @@ -308,9 +306,7 @@ static int dn_insert_route(struct dn_route *rt, unsigned hash, struct dn_route * | |||
| 308 | rcu_assign_pointer(rt->u.dst.dn_next, dn_rt_hash_table[hash].chain); | 306 | rcu_assign_pointer(rt->u.dst.dn_next, dn_rt_hash_table[hash].chain); |
| 309 | rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt); | 307 | rcu_assign_pointer(dn_rt_hash_table[hash].chain, rt); |
| 310 | 308 | ||
| 311 | dst_hold(&rt->u.dst); | 309 | dst_use(&rt->u.dst, now); |
| 312 | rt->u.dst.__use++; | ||
| 313 | rt->u.dst.lastuse = now; | ||
| 314 | spin_unlock_bh(&dn_rt_hash_table[hash].lock); | 310 | spin_unlock_bh(&dn_rt_hash_table[hash].lock); |
| 315 | *rp = rt; | 311 | *rp = rt; |
| 316 | return 0; | 312 | return 0; |
| @@ -1182,9 +1178,7 @@ static int __dn_route_output_key(struct dst_entry **pprt, const struct flowi *fl | |||
| 1182 | (flp->mark == rt->fl.mark) && | 1178 | (flp->mark == rt->fl.mark) && |
| 1183 | (rt->fl.iif == 0) && | 1179 | (rt->fl.iif == 0) && |
| 1184 | (rt->fl.oif == flp->oif)) { | 1180 | (rt->fl.oif == flp->oif)) { |
| 1185 | rt->u.dst.lastuse = jiffies; | 1181 | dst_use(&rt->u.dst, jiffies); |
| 1186 | dst_hold(&rt->u.dst); | ||
| 1187 | rt->u.dst.__use++; | ||
| 1188 | rcu_read_unlock_bh(); | 1182 | rcu_read_unlock_bh(); |
| 1189 | *pprt = &rt->u.dst; | 1183 | *pprt = &rt->u.dst; |
| 1190 | return 0; | 1184 | return 0; |
| @@ -1456,9 +1450,7 @@ int dn_route_input(struct sk_buff *skb) | |||
| 1456 | (rt->fl.oif == 0) && | 1450 | (rt->fl.oif == 0) && |
| 1457 | (rt->fl.mark == skb->mark) && | 1451 | (rt->fl.mark == skb->mark) && |
| 1458 | (rt->fl.iif == cb->iif)) { | 1452 | (rt->fl.iif == cb->iif)) { |
| 1459 | rt->u.dst.lastuse = jiffies; | 1453 | dst_use(&rt->u.dst, jiffies); |
| 1460 | dst_hold(&rt->u.dst); | ||
| 1461 | rt->u.dst.__use++; | ||
| 1462 | rcu_read_unlock(); | 1454 | rcu_read_unlock(); |
| 1463 | skb->dst = (struct dst_entry *)rt; | 1455 | skb->dst = (struct dst_entry *)rt; |
| 1464 | return 0; | 1456 | return 0; |
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c index ddd3f04f0919..ffebea04cc99 100644 --- a/net/decnet/dn_rules.c +++ b/net/decnet/dn_rules.c | |||
| @@ -48,15 +48,6 @@ struct dn_fib_rule | |||
| 48 | u8 flags; | 48 | u8 flags; |
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | static struct dn_fib_rule default_rule = { | ||
| 52 | .common = { | ||
| 53 | .refcnt = ATOMIC_INIT(2), | ||
| 54 | .pref = 0x7fff, | ||
| 55 | .table = RT_TABLE_MAIN, | ||
| 56 | .action = FR_ACT_TO_TBL, | ||
| 57 | }, | ||
| 58 | }; | ||
| 59 | |||
| 60 | 51 | ||
| 61 | int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res) | 52 | int dn_fib_lookup(struct flowi *flp, struct dn_fib_res *res) |
| 62 | { | 53 | { |
| @@ -262,8 +253,8 @@ static struct fib_rules_ops dn_fib_rules_ops = { | |||
| 262 | 253 | ||
| 263 | void __init dn_fib_rules_init(void) | 254 | void __init dn_fib_rules_init(void) |
| 264 | { | 255 | { |
| 265 | list_add_tail(&default_rule.common.list, | 256 | BUG_ON(fib_default_rule_add(&dn_fib_rules_ops, 0x7fff, |
| 266 | &dn_fib_rules_ops.rules_list); | 257 | RT_TABLE_MAIN, 0)); |
| 267 | fib_rules_register(&dn_fib_rules_ops); | 258 | fib_rules_register(&dn_fib_rules_ops); |
| 268 | } | 259 | } |
| 269 | 260 | ||
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c index 4cce3534e408..58b22619ab15 100644 --- a/net/ieee80211/ieee80211_crypt_tkip.c +++ b/net/ieee80211/ieee80211_crypt_tkip.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #include <net/ieee80211.h> | 25 | #include <net/ieee80211.h> |
| 26 | 26 | ||
| 27 | #include <linux/crypto.h> | 27 | #include <linux/crypto.h> |
| 28 | #include <linux/scatterlist.h> | ||
| 29 | #include <linux/crc32.h> | 28 | #include <linux/crc32.h> |
| 30 | 29 | ||
| 31 | MODULE_AUTHOR("Jouni Malinen"); | 30 | MODULE_AUTHOR("Jouni Malinen"); |
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index 866fc04c44f9..3fa30c40779f 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <net/ieee80211.h> | 22 | #include <net/ieee80211.h> |
| 23 | 23 | ||
| 24 | #include <linux/crypto.h> | 24 | #include <linux/crypto.h> |
| 25 | #include <linux/scatterlist.h> | ||
| 26 | #include <linux/crc32.h> | 25 | #include <linux/crc32.h> |
| 27 | 26 | ||
| 28 | MODULE_AUTHOR("Jouni Malinen"); | 27 | MODULE_AUTHOR("Jouni Malinen"); |
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index ac36767b56e8..e01b59aedc54 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c | |||
| @@ -470,7 +470,7 @@ ieee80211softmac_wx_set_mlme(struct net_device *dev, | |||
| 470 | { | 470 | { |
| 471 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 471 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
| 472 | struct iw_mlme *mlme = (struct iw_mlme *)extra; | 472 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
| 473 | u16 reason = cpu_to_le16(mlme->reason_code); | 473 | u16 reason = mlme->reason_code; |
| 474 | struct ieee80211softmac_network *net; | 474 | struct ieee80211softmac_network *net; |
| 475 | int err = -EINVAL; | 475 | int err = -EINVAL; |
| 476 | 476 | ||
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 60123905dbbf..732d8f088b13 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
| @@ -59,6 +59,13 @@ struct fib_table *ip_fib_main_table; | |||
| 59 | #define FIB_TABLE_HASHSZ 1 | 59 | #define FIB_TABLE_HASHSZ 1 |
| 60 | static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; | 60 | static struct hlist_head fib_table_hash[FIB_TABLE_HASHSZ]; |
| 61 | 61 | ||
| 62 | static void __init fib4_rules_init(void) | ||
| 63 | { | ||
| 64 | ip_fib_local_table = fib_hash_init(RT_TABLE_LOCAL); | ||
| 65 | hlist_add_head_rcu(&ip_fib_local_table->tb_hlist, &fib_table_hash[0]); | ||
| 66 | ip_fib_main_table = fib_hash_init(RT_TABLE_MAIN); | ||
| 67 | hlist_add_head_rcu(&ip_fib_main_table->tb_hlist, &fib_table_hash[0]); | ||
| 68 | } | ||
| 62 | #else | 69 | #else |
| 63 | 70 | ||
| 64 | #define FIB_TABLE_HASHSZ 256 | 71 | #define FIB_TABLE_HASHSZ 256 |
| @@ -905,14 +912,8 @@ void __init ip_fib_init(void) | |||
| 905 | 912 | ||
| 906 | for (i = 0; i < FIB_TABLE_HASHSZ; i++) | 913 | for (i = 0; i < FIB_TABLE_HASHSZ; i++) |
| 907 | INIT_HLIST_HEAD(&fib_table_hash[i]); | 914 | INIT_HLIST_HEAD(&fib_table_hash[i]); |
| 908 | #ifndef CONFIG_IP_MULTIPLE_TABLES | 915 | |
| 909 | ip_fib_local_table = fib_hash_init(RT_TABLE_LOCAL); | ||
| 910 | hlist_add_head_rcu(&ip_fib_local_table->tb_hlist, &fib_table_hash[0]); | ||
| 911 | ip_fib_main_table = fib_hash_init(RT_TABLE_MAIN); | ||
| 912 | hlist_add_head_rcu(&ip_fib_main_table->tb_hlist, &fib_table_hash[0]); | ||
| 913 | #else | ||
| 914 | fib4_rules_init(); | 916 | fib4_rules_init(); |
| 915 | #endif | ||
| 916 | 917 | ||
| 917 | register_netdevice_notifier(&fib_netdev_notifier); | 918 | register_netdevice_notifier(&fib_netdev_notifier); |
| 918 | register_inetaddr_notifier(&fib_inetaddr_notifier); | 919 | register_inetaddr_notifier(&fib_inetaddr_notifier); |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index f16839c6a721..a0ada3a8d8dd 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
| @@ -49,33 +49,6 @@ struct fib4_rule | |||
| 49 | #endif | 49 | #endif |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | static struct fib4_rule default_rule = { | ||
| 53 | .common = { | ||
| 54 | .refcnt = ATOMIC_INIT(2), | ||
| 55 | .pref = 0x7FFF, | ||
| 56 | .table = RT_TABLE_DEFAULT, | ||
| 57 | .action = FR_ACT_TO_TBL, | ||
| 58 | }, | ||
| 59 | }; | ||
| 60 | |||
| 61 | static struct fib4_rule main_rule = { | ||
| 62 | .common = { | ||
| 63 | .refcnt = ATOMIC_INIT(2), | ||
| 64 | .pref = 0x7FFE, | ||
| 65 | .table = RT_TABLE_MAIN, | ||
| 66 | .action = FR_ACT_TO_TBL, | ||
| 67 | }, | ||
| 68 | }; | ||
| 69 | |||
| 70 | static struct fib4_rule local_rule = { | ||
| 71 | .common = { | ||
| 72 | .refcnt = ATOMIC_INIT(2), | ||
| 73 | .table = RT_TABLE_LOCAL, | ||
| 74 | .action = FR_ACT_TO_TBL, | ||
| 75 | .flags = FIB_RULE_PERMANENT, | ||
| 76 | }, | ||
| 77 | }; | ||
| 78 | |||
| 79 | #ifdef CONFIG_NET_CLS_ROUTE | 52 | #ifdef CONFIG_NET_CLS_ROUTE |
| 80 | u32 fib_rules_tclass(struct fib_result *res) | 53 | u32 fib_rules_tclass(struct fib_result *res) |
| 81 | { | 54 | { |
| @@ -319,11 +292,27 @@ static struct fib_rules_ops fib4_rules_ops = { | |||
| 319 | .owner = THIS_MODULE, | 292 | .owner = THIS_MODULE, |
| 320 | }; | 293 | }; |
| 321 | 294 | ||
| 322 | void __init fib4_rules_init(void) | 295 | static int __init fib_default_rules_init(void) |
| 323 | { | 296 | { |
| 324 | list_add_tail(&local_rule.common.list, &fib4_rules_ops.rules_list); | 297 | int err; |
| 325 | list_add_tail(&main_rule.common.list, &fib4_rules_ops.rules_list); | 298 | |
| 326 | list_add_tail(&default_rule.common.list, &fib4_rules_ops.rules_list); | 299 | err = fib_default_rule_add(&fib4_rules_ops, 0, |
| 300 | RT_TABLE_LOCAL, FIB_RULE_PERMANENT); | ||
| 301 | if (err < 0) | ||
| 302 | return err; | ||
| 303 | err = fib_default_rule_add(&fib4_rules_ops, 0x7FFE, | ||
| 304 | RT_TABLE_MAIN, 0); | ||
| 305 | if (err < 0) | ||
| 306 | return err; | ||
| 307 | err = fib_default_rule_add(&fib4_rules_ops, 0x7FFF, | ||
| 308 | RT_TABLE_DEFAULT, 0); | ||
| 309 | if (err < 0) | ||
| 310 | return err; | ||
| 311 | return 0; | ||
| 312 | } | ||
| 327 | 313 | ||
| 314 | void __init fib4_rules_init(void) | ||
| 315 | { | ||
| 316 | BUG_ON(fib_default_rules_init()); | ||
| 328 | fib_rules_register(&fib4_rules_ops); | 317 | fib_rules_register(&fib4_rules_ops); |
| 329 | } | 318 | } |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index dc429b6b0ba6..b0170732b5e9 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
| @@ -747,13 +747,14 @@ skip_listen_ht: | |||
| 747 | 747 | ||
| 748 | for (i = s_i; i < hashinfo->ehash_size; i++) { | 748 | for (i = s_i; i < hashinfo->ehash_size; i++) { |
| 749 | struct inet_ehash_bucket *head = &hashinfo->ehash[i]; | 749 | struct inet_ehash_bucket *head = &hashinfo->ehash[i]; |
| 750 | rwlock_t *lock = inet_ehash_lockp(hashinfo, i); | ||
| 750 | struct sock *sk; | 751 | struct sock *sk; |
| 751 | struct hlist_node *node; | 752 | struct hlist_node *node; |
| 752 | 753 | ||
| 753 | if (i > s_i) | 754 | if (i > s_i) |
| 754 | s_num = 0; | 755 | s_num = 0; |
| 755 | 756 | ||
| 756 | read_lock_bh(&head->lock); | 757 | read_lock_bh(lock); |
| 757 | num = 0; | 758 | num = 0; |
| 758 | sk_for_each(sk, node, &head->chain) { | 759 | sk_for_each(sk, node, &head->chain) { |
| 759 | struct inet_sock *inet = inet_sk(sk); | 760 | struct inet_sock *inet = inet_sk(sk); |
| @@ -769,7 +770,7 @@ skip_listen_ht: | |||
| 769 | r->id.idiag_dport) | 770 | r->id.idiag_dport) |
| 770 | goto next_normal; | 771 | goto next_normal; |
| 771 | if (inet_csk_diag_dump(sk, skb, cb) < 0) { | 772 | if (inet_csk_diag_dump(sk, skb, cb) < 0) { |
| 772 | read_unlock_bh(&head->lock); | 773 | read_unlock_bh(lock); |
| 773 | goto done; | 774 | goto done; |
| 774 | } | 775 | } |
| 775 | next_normal: | 776 | next_normal: |
| @@ -791,14 +792,14 @@ next_normal: | |||
| 791 | r->id.idiag_dport) | 792 | r->id.idiag_dport) |
| 792 | goto next_dying; | 793 | goto next_dying; |
| 793 | if (inet_twsk_diag_dump(tw, skb, cb) < 0) { | 794 | if (inet_twsk_diag_dump(tw, skb, cb) < 0) { |
| 794 | read_unlock_bh(&head->lock); | 795 | read_unlock_bh(lock); |
| 795 | goto done; | 796 | goto done; |
| 796 | } | 797 | } |
| 797 | next_dying: | 798 | next_dying: |
| 798 | ++num; | 799 | ++num; |
| 799 | } | 800 | } |
| 800 | } | 801 | } |
| 801 | read_unlock_bh(&head->lock); | 802 | read_unlock_bh(lock); |
| 802 | } | 803 | } |
| 803 | 804 | ||
| 804 | done: | 805 | done: |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 16eecc7046a3..67704da04fc4 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
| @@ -204,12 +204,13 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, | |||
| 204 | const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); | 204 | const __portpair ports = INET_COMBINED_PORTS(inet->dport, lport); |
| 205 | unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); | 205 | unsigned int hash = inet_ehashfn(daddr, lport, saddr, inet->dport); |
| 206 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); | 206 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); |
| 207 | rwlock_t *lock = inet_ehash_lockp(hinfo, hash); | ||
| 207 | struct sock *sk2; | 208 | struct sock *sk2; |
| 208 | const struct hlist_node *node; | 209 | const struct hlist_node *node; |
| 209 | struct inet_timewait_sock *tw; | 210 | struct inet_timewait_sock *tw; |
| 210 | 211 | ||
| 211 | prefetch(head->chain.first); | 212 | prefetch(head->chain.first); |
| 212 | write_lock(&head->lock); | 213 | write_lock(lock); |
| 213 | 214 | ||
| 214 | /* Check TIME-WAIT sockets first. */ | 215 | /* Check TIME-WAIT sockets first. */ |
| 215 | sk_for_each(sk2, node, &head->twchain) { | 216 | sk_for_each(sk2, node, &head->twchain) { |
| @@ -239,7 +240,7 @@ unique: | |||
| 239 | BUG_TRAP(sk_unhashed(sk)); | 240 | BUG_TRAP(sk_unhashed(sk)); |
| 240 | __sk_add_node(sk, &head->chain); | 241 | __sk_add_node(sk, &head->chain); |
| 241 | sock_prot_inc_use(sk->sk_prot); | 242 | sock_prot_inc_use(sk->sk_prot); |
| 242 | write_unlock(&head->lock); | 243 | write_unlock(lock); |
| 243 | 244 | ||
| 244 | if (twp) { | 245 | if (twp) { |
| 245 | *twp = tw; | 246 | *twp = tw; |
| @@ -255,7 +256,7 @@ unique: | |||
| 255 | return 0; | 256 | return 0; |
| 256 | 257 | ||
| 257 | not_unique: | 258 | not_unique: |
| 258 | write_unlock(&head->lock); | 259 | write_unlock(lock); |
| 259 | return -EADDRNOTAVAIL; | 260 | return -EADDRNOTAVAIL; |
| 260 | } | 261 | } |
| 261 | 262 | ||
diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 4e189e28f306..a60b99e0ebdc 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c | |||
| @@ -20,16 +20,16 @@ static void __inet_twsk_kill(struct inet_timewait_sock *tw, | |||
| 20 | struct inet_bind_hashbucket *bhead; | 20 | struct inet_bind_hashbucket *bhead; |
| 21 | struct inet_bind_bucket *tb; | 21 | struct inet_bind_bucket *tb; |
| 22 | /* Unlink from established hashes. */ | 22 | /* Unlink from established hashes. */ |
| 23 | struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, tw->tw_hash); | 23 | rwlock_t *lock = inet_ehash_lockp(hashinfo, tw->tw_hash); |
| 24 | 24 | ||
| 25 | write_lock(&ehead->lock); | 25 | write_lock(lock); |
| 26 | if (hlist_unhashed(&tw->tw_node)) { | 26 | if (hlist_unhashed(&tw->tw_node)) { |
| 27 | write_unlock(&ehead->lock); | 27 | write_unlock(lock); |
| 28 | return; | 28 | return; |
| 29 | } | 29 | } |
| 30 | __hlist_del(&tw->tw_node); | 30 | __hlist_del(&tw->tw_node); |
| 31 | sk_node_init(&tw->tw_node); | 31 | sk_node_init(&tw->tw_node); |
| 32 | write_unlock(&ehead->lock); | 32 | write_unlock(lock); |
| 33 | 33 | ||
| 34 | /* Disassociate with bind bucket. */ | 34 | /* Disassociate with bind bucket. */ |
| 35 | bhead = &hashinfo->bhash[inet_bhashfn(tw->tw_num, hashinfo->bhash_size)]; | 35 | bhead = &hashinfo->bhash[inet_bhashfn(tw->tw_num, hashinfo->bhash_size)]; |
| @@ -59,6 +59,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, | |||
| 59 | const struct inet_sock *inet = inet_sk(sk); | 59 | const struct inet_sock *inet = inet_sk(sk); |
| 60 | const struct inet_connection_sock *icsk = inet_csk(sk); | 60 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 61 | struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, sk->sk_hash); | 61 | struct inet_ehash_bucket *ehead = inet_ehash_bucket(hashinfo, sk->sk_hash); |
| 62 | rwlock_t *lock = inet_ehash_lockp(hashinfo, sk->sk_hash); | ||
| 62 | struct inet_bind_hashbucket *bhead; | 63 | struct inet_bind_hashbucket *bhead; |
| 63 | /* Step 1: Put TW into bind hash. Original socket stays there too. | 64 | /* Step 1: Put TW into bind hash. Original socket stays there too. |
| 64 | Note, that any socket with inet->num != 0 MUST be bound in | 65 | Note, that any socket with inet->num != 0 MUST be bound in |
| @@ -71,7 +72,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, | |||
| 71 | inet_twsk_add_bind_node(tw, &tw->tw_tb->owners); | 72 | inet_twsk_add_bind_node(tw, &tw->tw_tb->owners); |
| 72 | spin_unlock(&bhead->lock); | 73 | spin_unlock(&bhead->lock); |
| 73 | 74 | ||
| 74 | write_lock(&ehead->lock); | 75 | write_lock(lock); |
| 75 | 76 | ||
| 76 | /* Step 2: Remove SK from established hash. */ | 77 | /* Step 2: Remove SK from established hash. */ |
| 77 | if (__sk_del_node_init(sk)) | 78 | if (__sk_del_node_init(sk)) |
| @@ -81,7 +82,7 @@ void __inet_twsk_hashdance(struct inet_timewait_sock *tw, struct sock *sk, | |||
| 81 | inet_twsk_add_node(tw, &ehead->twchain); | 82 | inet_twsk_add_node(tw, &ehead->twchain); |
| 82 | atomic_inc(&tw->tw_refcnt); | 83 | atomic_inc(&tw->tw_refcnt); |
| 83 | 84 | ||
| 84 | write_unlock(&ehead->lock); | 85 | write_unlock(lock); |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); | 88 | EXPORT_SYMBOL_GPL(__inet_twsk_hashdance); |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index e5f7dc2de303..fd99fbd685ea 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
| @@ -1183,6 +1183,17 @@ error: | |||
| 1183 | return err; | 1183 | return err; |
| 1184 | } | 1184 | } |
| 1185 | 1185 | ||
| 1186 | static void ip_cork_release(struct inet_sock *inet) | ||
| 1187 | { | ||
| 1188 | inet->cork.flags &= ~IPCORK_OPT; | ||
| 1189 | kfree(inet->cork.opt); | ||
| 1190 | inet->cork.opt = NULL; | ||
| 1191 | if (inet->cork.rt) { | ||
| 1192 | ip_rt_put(inet->cork.rt); | ||
| 1193 | inet->cork.rt = NULL; | ||
| 1194 | } | ||
| 1195 | } | ||
| 1196 | |||
| 1186 | /* | 1197 | /* |
| 1187 | * Combined all pending IP fragments on the socket as one IP datagram | 1198 | * Combined all pending IP fragments on the socket as one IP datagram |
| 1188 | * and push them out. | 1199 | * and push them out. |
| @@ -1276,13 +1287,7 @@ int ip_push_pending_frames(struct sock *sk) | |||
| 1276 | } | 1287 | } |
| 1277 | 1288 | ||
| 1278 | out: | 1289 | out: |
| 1279 | inet->cork.flags &= ~IPCORK_OPT; | 1290 | ip_cork_release(inet); |
| 1280 | kfree(inet->cork.opt); | ||
| 1281 | inet->cork.opt = NULL; | ||
| 1282 | if (inet->cork.rt) { | ||
| 1283 | ip_rt_put(inet->cork.rt); | ||
| 1284 | inet->cork.rt = NULL; | ||
| 1285 | } | ||
| 1286 | return err; | 1291 | return err; |
| 1287 | 1292 | ||
| 1288 | error: | 1293 | error: |
| @@ -1295,19 +1300,12 @@ error: | |||
| 1295 | */ | 1300 | */ |
| 1296 | void ip_flush_pending_frames(struct sock *sk) | 1301 | void ip_flush_pending_frames(struct sock *sk) |
| 1297 | { | 1302 | { |
| 1298 | struct inet_sock *inet = inet_sk(sk); | ||
| 1299 | struct sk_buff *skb; | 1303 | struct sk_buff *skb; |
| 1300 | 1304 | ||
| 1301 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) | 1305 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) |
| 1302 | kfree_skb(skb); | 1306 | kfree_skb(skb); |
| 1303 | 1307 | ||
| 1304 | inet->cork.flags &= ~IPCORK_OPT; | 1308 | ip_cork_release(inet_sk(sk)); |
| 1305 | kfree(inet->cork.opt); | ||
| 1306 | inet->cork.opt = NULL; | ||
| 1307 | if (inet->cork.rt) { | ||
| 1308 | ip_rt_put(inet->cork.rt); | ||
| 1309 | inet->cork.rt = NULL; | ||
| 1310 | } | ||
| 1311 | } | 1309 | } |
| 1312 | 1310 | ||
| 1313 | 1311 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index f51f20e487c8..82817e554363 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
| @@ -437,10 +437,8 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
| 437 | 437 | ||
| 438 | /* If optlen==0, it is equivalent to val == 0 */ | 438 | /* If optlen==0, it is equivalent to val == 0 */ |
| 439 | 439 | ||
| 440 | #ifdef CONFIG_IP_MROUTE | 440 | if (ip_mroute_opt(optname)) |
| 441 | if (optname >= MRT_BASE && optname <= (MRT_BASE + 10)) | ||
| 442 | return ip_mroute_setsockopt(sk,optname,optval,optlen); | 441 | return ip_mroute_setsockopt(sk,optname,optval,optlen); |
| 443 | #endif | ||
| 444 | 442 | ||
| 445 | err = 0; | 443 | err = 0; |
| 446 | lock_sock(sk); | 444 | lock_sock(sk); |
| @@ -909,11 +907,9 @@ int ip_setsockopt(struct sock *sk, int level, | |||
| 909 | #ifdef CONFIG_NETFILTER | 907 | #ifdef CONFIG_NETFILTER |
| 910 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 908 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 911 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && | 909 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && |
| 912 | optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY | 910 | optname != IP_IPSEC_POLICY && |
| 913 | #ifdef CONFIG_IP_MROUTE | 911 | optname != IP_XFRM_POLICY && |
| 914 | && (optname < MRT_BASE || optname > (MRT_BASE + 10)) | 912 | !ip_mroute_opt(optname)) { |
| 915 | #endif | ||
| 916 | ) { | ||
| 917 | lock_sock(sk); | 913 | lock_sock(sk); |
| 918 | err = nf_setsockopt(sk, PF_INET, optname, optval, optlen); | 914 | err = nf_setsockopt(sk, PF_INET, optname, optval, optlen); |
| 919 | release_sock(sk); | 915 | release_sock(sk); |
| @@ -935,11 +931,9 @@ int compat_ip_setsockopt(struct sock *sk, int level, int optname, | |||
| 935 | #ifdef CONFIG_NETFILTER | 931 | #ifdef CONFIG_NETFILTER |
| 936 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 932 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 937 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && | 933 | if (err == -ENOPROTOOPT && optname != IP_HDRINCL && |
| 938 | optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY | 934 | optname != IP_IPSEC_POLICY && |
| 939 | #ifdef CONFIG_IP_MROUTE | 935 | optname != IP_XFRM_POLICY && |
| 940 | && (optname < MRT_BASE || optname > (MRT_BASE + 10)) | 936 | !ip_mroute_opt(optname)) { |
| 941 | #endif | ||
| 942 | ) { | ||
| 943 | lock_sock(sk); | 937 | lock_sock(sk); |
| 944 | err = compat_nf_setsockopt(sk, PF_INET, optname, | 938 | err = compat_nf_setsockopt(sk, PF_INET, optname, |
| 945 | optval, optlen); | 939 | optval, optlen); |
| @@ -967,11 +961,8 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 967 | if (level != SOL_IP) | 961 | if (level != SOL_IP) |
| 968 | return -EOPNOTSUPP; | 962 | return -EOPNOTSUPP; |
| 969 | 963 | ||
| 970 | #ifdef CONFIG_IP_MROUTE | 964 | if (ip_mroute_opt(optname)) |
| 971 | if (optname >= MRT_BASE && optname <= MRT_BASE+10) { | ||
| 972 | return ip_mroute_getsockopt(sk,optname,optval,optlen); | 965 | return ip_mroute_getsockopt(sk,optname,optval,optlen); |
| 973 | } | ||
| 974 | #endif | ||
| 975 | 966 | ||
| 976 | if (get_user(len,optlen)) | 967 | if (get_user(len,optlen)) |
| 977 | return -EFAULT; | 968 | return -EFAULT; |
| @@ -1171,11 +1162,8 @@ int ip_getsockopt(struct sock *sk, int level, | |||
| 1171 | err = do_ip_getsockopt(sk, level, optname, optval, optlen); | 1162 | err = do_ip_getsockopt(sk, level, optname, optval, optlen); |
| 1172 | #ifdef CONFIG_NETFILTER | 1163 | #ifdef CONFIG_NETFILTER |
| 1173 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1164 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1174 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS | 1165 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && |
| 1175 | #ifdef CONFIG_IP_MROUTE | 1166 | !ip_mroute_opt(optname)) { |
| 1176 | && (optname < MRT_BASE || optname > MRT_BASE+10) | ||
| 1177 | #endif | ||
| 1178 | ) { | ||
| 1179 | int len; | 1167 | int len; |
| 1180 | 1168 | ||
| 1181 | if (get_user(len,optlen)) | 1169 | if (get_user(len,optlen)) |
| @@ -1200,11 +1188,8 @@ int compat_ip_getsockopt(struct sock *sk, int level, int optname, | |||
| 1200 | int err = do_ip_getsockopt(sk, level, optname, optval, optlen); | 1188 | int err = do_ip_getsockopt(sk, level, optname, optval, optlen); |
| 1201 | #ifdef CONFIG_NETFILTER | 1189 | #ifdef CONFIG_NETFILTER |
| 1202 | /* we need to exclude all possible ENOPROTOOPTs except default case */ | 1190 | /* we need to exclude all possible ENOPROTOOPTs except default case */ |
| 1203 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS | 1191 | if (err == -ENOPROTOOPT && optname != IP_PKTOPTIONS && |
| 1204 | #ifdef CONFIG_IP_MROUTE | 1192 | !ip_mroute_opt(optname)) { |
| 1205 | && (optname < MRT_BASE || optname > MRT_BASE+10) | ||
| 1206 | #endif | ||
| 1207 | ) { | ||
| 1208 | int len; | 1193 | int len; |
| 1209 | 1194 | ||
| 1210 | if (get_user(len, optlen)) | 1195 | if (get_user(len, optlen)) |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index ca1b5fdb8d31..2c44a94c2135 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 17 | #include <asm/semaphore.h> | 17 | #include <asm/semaphore.h> |
| 18 | #include <linux/crypto.h> | 18 | #include <linux/crypto.h> |
| 19 | #include <linux/err.h> | ||
| 19 | #include <linux/pfkeyv2.h> | 20 | #include <linux/pfkeyv2.h> |
| 20 | #include <linux/percpu.h> | 21 | #include <linux/percpu.h> |
| 21 | #include <linux/smp.h> | 22 | #include <linux/smp.h> |
| @@ -344,7 +345,7 @@ static struct crypto_comp **ipcomp_alloc_tfms(const char *alg_name) | |||
| 344 | for_each_possible_cpu(cpu) { | 345 | for_each_possible_cpu(cpu) { |
| 345 | struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0, | 346 | struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0, |
| 346 | CRYPTO_ALG_ASYNC); | 347 | CRYPTO_ALG_ASYNC); |
| 347 | if (!tfm) | 348 | if (IS_ERR(tfm)) |
| 348 | goto error; | 349 | goto error; |
| 349 | *per_cpu_ptr(tfms, cpu) = tfm; | 350 | *per_cpu_ptr(tfms, cpu) = tfm; |
| 350 | } | 351 | } |
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 4b702f708d30..b7eeae622d9b 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
| @@ -426,6 +426,25 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest) | |||
| 426 | 426 | ||
| 427 | 427 | ||
| 428 | /* | 428 | /* |
| 429 | * Check if there is a destination for the connection, if so | ||
| 430 | * bind the connection to the destination. | ||
| 431 | */ | ||
| 432 | struct ip_vs_dest *ip_vs_try_bind_dest(struct ip_vs_conn *cp) | ||
| 433 | { | ||
| 434 | struct ip_vs_dest *dest; | ||
| 435 | |||
| 436 | if ((cp) && (!cp->dest)) { | ||
| 437 | dest = ip_vs_find_dest(cp->daddr, cp->dport, | ||
| 438 | cp->vaddr, cp->vport, cp->protocol); | ||
| 439 | ip_vs_bind_dest(cp, dest); | ||
| 440 | return dest; | ||
| 441 | } else | ||
| 442 | return NULL; | ||
| 443 | } | ||
| 444 | EXPORT_SYMBOL(ip_vs_try_bind_dest); | ||
| 445 | |||
| 446 | |||
| 447 | /* | ||
| 429 | * Unbind a connection entry with its VS destination | 448 | * Unbind a connection entry with its VS destination |
| 430 | * Called by the ip_vs_conn_expire function. | 449 | * Called by the ip_vs_conn_expire function. |
| 431 | */ | 450 | */ |
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c index c6ed7654e839..20c884a57721 100644 --- a/net/ipv4/ipvs/ip_vs_core.c +++ b/net/ipv4/ipvs/ip_vs_core.c | |||
| @@ -979,15 +979,23 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, | |||
| 979 | ret = NF_ACCEPT; | 979 | ret = NF_ACCEPT; |
| 980 | } | 980 | } |
| 981 | 981 | ||
| 982 | /* increase its packet counter and check if it is needed | 982 | /* Increase its packet counter and check if it is needed |
| 983 | to be synchronized */ | 983 | * to be synchronized |
| 984 | * | ||
| 985 | * Sync connection if it is about to close to | ||
| 986 | * encorage the standby servers to update the connections timeout | ||
| 987 | */ | ||
| 984 | atomic_inc(&cp->in_pkts); | 988 | atomic_inc(&cp->in_pkts); |
| 985 | if ((ip_vs_sync_state & IP_VS_STATE_MASTER) && | 989 | if ((ip_vs_sync_state & IP_VS_STATE_MASTER) && |
| 986 | (cp->protocol != IPPROTO_TCP || | 990 | (((cp->protocol != IPPROTO_TCP || |
| 987 | cp->state == IP_VS_TCP_S_ESTABLISHED) && | 991 | cp->state == IP_VS_TCP_S_ESTABLISHED) && |
| 988 | (atomic_read(&cp->in_pkts) % sysctl_ip_vs_sync_threshold[1] | 992 | (atomic_read(&cp->in_pkts) % sysctl_ip_vs_sync_threshold[1] |
| 989 | == sysctl_ip_vs_sync_threshold[0])) | 993 | == sysctl_ip_vs_sync_threshold[0])) || |
| 994 | ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) && | ||
| 995 | ((cp->state == IP_VS_TCP_S_FIN_WAIT) || | ||
| 996 | (cp->state == IP_VS_TCP_S_CLOSE))))) | ||
| 990 | ip_vs_sync_conn(cp); | 997 | ip_vs_sync_conn(cp); |
| 998 | cp->old_state = cp->state; | ||
| 991 | 999 | ||
| 992 | ip_vs_conn_put(cp); | 1000 | ip_vs_conn_put(cp); |
| 993 | return ret; | 1001 | return ret; |
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 7345fc252a23..3c4d22a468ec 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
| @@ -579,6 +579,32 @@ ip_vs_lookup_dest(struct ip_vs_service *svc, __be32 daddr, __be16 dport) | |||
| 579 | return NULL; | 579 | return NULL; |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | /* | ||
| 583 | * Find destination by {daddr,dport,vaddr,protocol} | ||
| 584 | * Cretaed to be used in ip_vs_process_message() in | ||
| 585 | * the backup synchronization daemon. It finds the | ||
| 586 | * destination to be bound to the received connection | ||
| 587 | * on the backup. | ||
| 588 | * | ||
| 589 | * ip_vs_lookup_real_service() looked promissing, but | ||
| 590 | * seems not working as expected. | ||
| 591 | */ | ||
| 592 | struct ip_vs_dest *ip_vs_find_dest(__be32 daddr, __be16 dport, | ||
| 593 | __be32 vaddr, __be16 vport, __u16 protocol) | ||
| 594 | { | ||
| 595 | struct ip_vs_dest *dest; | ||
| 596 | struct ip_vs_service *svc; | ||
| 597 | |||
| 598 | svc = ip_vs_service_get(0, protocol, vaddr, vport); | ||
| 599 | if (!svc) | ||
| 600 | return NULL; | ||
| 601 | dest = ip_vs_lookup_dest(svc, daddr, dport); | ||
| 602 | if (dest) | ||
| 603 | atomic_inc(&dest->refcnt); | ||
| 604 | ip_vs_service_put(svc); | ||
| 605 | return dest; | ||
| 606 | } | ||
| 607 | EXPORT_SYMBOL(ip_vs_find_dest); | ||
| 582 | 608 | ||
| 583 | /* | 609 | /* |
| 584 | * Lookup dest by {svc,addr,port} in the destination trash. | 610 | * Lookup dest by {svc,addr,port} in the destination trash. |
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 0d4d9721cbd4..bd930efc18da 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c | |||
| @@ -284,6 +284,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) | |||
| 284 | struct ip_vs_sync_conn_options *opt; | 284 | struct ip_vs_sync_conn_options *opt; |
| 285 | struct ip_vs_conn *cp; | 285 | struct ip_vs_conn *cp; |
| 286 | struct ip_vs_protocol *pp; | 286 | struct ip_vs_protocol *pp; |
| 287 | struct ip_vs_dest *dest; | ||
| 287 | char *p; | 288 | char *p; |
| 288 | int i; | 289 | int i; |
| 289 | 290 | ||
| @@ -317,20 +318,34 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) | |||
| 317 | s->caddr, s->cport, | 318 | s->caddr, s->cport, |
| 318 | s->vaddr, s->vport); | 319 | s->vaddr, s->vport); |
| 319 | if (!cp) { | 320 | if (!cp) { |
| 321 | /* | ||
| 322 | * Find the appropriate destination for the connection. | ||
| 323 | * If it is not found the connection will remain unbound | ||
| 324 | * but still handled. | ||
| 325 | */ | ||
| 326 | dest = ip_vs_find_dest(s->daddr, s->dport, | ||
| 327 | s->vaddr, s->vport, | ||
| 328 | s->protocol); | ||
| 320 | cp = ip_vs_conn_new(s->protocol, | 329 | cp = ip_vs_conn_new(s->protocol, |
| 321 | s->caddr, s->cport, | 330 | s->caddr, s->cport, |
| 322 | s->vaddr, s->vport, | 331 | s->vaddr, s->vport, |
| 323 | s->daddr, s->dport, | 332 | s->daddr, s->dport, |
| 324 | flags, NULL); | 333 | flags, dest); |
| 334 | if (dest) | ||
| 335 | atomic_dec(&dest->refcnt); | ||
| 325 | if (!cp) { | 336 | if (!cp) { |
| 326 | IP_VS_ERR("ip_vs_conn_new failed\n"); | 337 | IP_VS_ERR("ip_vs_conn_new failed\n"); |
| 327 | return; | 338 | return; |
| 328 | } | 339 | } |
| 329 | cp->state = ntohs(s->state); | 340 | cp->state = ntohs(s->state); |
| 330 | } else if (!cp->dest) { | 341 | } else if (!cp->dest) { |
| 331 | /* it is an entry created by the synchronization */ | 342 | dest = ip_vs_try_bind_dest(cp); |
| 332 | cp->state = ntohs(s->state); | 343 | if (!dest) { |
| 333 | cp->flags = flags | IP_VS_CONN_F_HASHED; | 344 | /* it is an unbound entry created by |
| 345 | * synchronization */ | ||
| 346 | cp->flags = flags | IP_VS_CONN_F_HASHED; | ||
| 347 | } else | ||
| 348 | atomic_dec(&dest->refcnt); | ||
| 334 | } /* Note that we don't touch its state and flags | 349 | } /* Note that we don't touch its state and flags |
| 335 | if it is a normal entry. */ | 350 | if it is a normal entry. */ |
| 336 | 351 | ||
| @@ -342,6 +357,7 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) | |||
| 342 | p += SIMPLE_CONN_SIZE; | 357 | p += SIMPLE_CONN_SIZE; |
| 343 | 358 | ||
| 344 | atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]); | 359 | atomic_set(&cp->in_pkts, sysctl_ip_vs_sync_threshold[0]); |
| 360 | cp->state = ntohs(s->state); | ||
| 345 | pp = ip_vs_proto_get(s->protocol); | 361 | pp = ip_vs_proto_get(s->protocol); |
| 346 | cp->timeout = pp->timeout_table[cp->state]; | 362 | cp->timeout = pp->timeout_table[cp->state]; |
| 347 | ip_vs_conn_put(cp); | 363 | ip_vs_conn_put(cp); |
diff --git a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile index 409d273f6f82..7456833d6ade 100644 --- a/net/ipv4/netfilter/Makefile +++ b/net/ipv4/netfilter/Makefile | |||
| @@ -41,27 +41,27 @@ obj-$(CONFIG_NF_NAT) += iptable_nat.o | |||
| 41 | obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o | 41 | obj-$(CONFIG_IP_NF_RAW) += iptable_raw.o |
| 42 | 42 | ||
| 43 | # matches | 43 | # matches |
| 44 | obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o | ||
| 45 | obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o | ||
| 46 | obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o | ||
| 44 | obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o | 47 | obj-$(CONFIG_IP_NF_MATCH_IPRANGE) += ipt_iprange.o |
| 45 | obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o | 48 | obj-$(CONFIG_IP_NF_MATCH_OWNER) += ipt_owner.o |
| 46 | obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o | ||
| 47 | obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o | 49 | obj-$(CONFIG_IP_NF_MATCH_RECENT) += ipt_recent.o |
| 48 | obj-$(CONFIG_IP_NF_MATCH_ECN) += ipt_ecn.o | 50 | obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o |
| 49 | obj-$(CONFIG_IP_NF_MATCH_AH) += ipt_ah.o | ||
| 50 | obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o | 51 | obj-$(CONFIG_IP_NF_MATCH_TTL) += ipt_ttl.o |
| 51 | obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o | ||
| 52 | 52 | ||
| 53 | # targets | 53 | # targets |
| 54 | obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o | 54 | obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o |
| 55 | obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o | ||
| 56 | obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o | 55 | obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o |
| 56 | obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o | ||
| 57 | obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o | 57 | obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o |
| 58 | obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o | ||
| 59 | obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o | 58 | obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o |
| 59 | obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o | ||
| 60 | obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o | ||
| 60 | obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o | 61 | obj-$(CONFIG_IP_NF_TARGET_SAME) += ipt_SAME.o |
| 61 | obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o | 62 | obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o |
| 62 | obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o | ||
| 63 | obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o | ||
| 64 | obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o | 63 | obj-$(CONFIG_IP_NF_TARGET_TTL) += ipt_TTL.o |
| 64 | obj-$(CONFIG_IP_NF_TARGET_ULOG) += ipt_ULOG.o | ||
| 65 | 65 | ||
| 66 | # generic ARP tables | 66 | # generic ARP tables |
| 67 | obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o | 67 | obj-$(CONFIG_IP_NF_ARPTABLES) += arp_tables.o |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 10a2ce09fd8e..14d64a383db1 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
| 23 | #include <linux/sysctl.h> | 23 | #include <linux/sysctl.h> |
| 24 | #include <linux/proc_fs.h> | 24 | #include <linux/proc_fs.h> |
| 25 | #include <linux/seq_file.h> | ||
| 25 | #include <linux/security.h> | 26 | #include <linux/security.h> |
| 26 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 27 | #include <net/net_namespace.h> | 28 | #include <net/net_namespace.h> |
| @@ -607,15 +608,11 @@ static ctl_table ipq_root_table[] = { | |||
| 607 | { .ctl_name = 0 } | 608 | { .ctl_name = 0 } |
| 608 | }; | 609 | }; |
| 609 | 610 | ||
| 610 | #ifdef CONFIG_PROC_FS | 611 | static int ip_queue_show(struct seq_file *m, void *v) |
| 611 | static int | ||
| 612 | ipq_get_info(char *buffer, char **start, off_t offset, int length) | ||
| 613 | { | 612 | { |
| 614 | int len; | ||
| 615 | |||
| 616 | read_lock_bh(&queue_lock); | 613 | read_lock_bh(&queue_lock); |
| 617 | 614 | ||
| 618 | len = sprintf(buffer, | 615 | seq_printf(m, |
| 619 | "Peer PID : %d\n" | 616 | "Peer PID : %d\n" |
| 620 | "Copy mode : %hu\n" | 617 | "Copy mode : %hu\n" |
| 621 | "Copy range : %u\n" | 618 | "Copy range : %u\n" |
| @@ -632,16 +629,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length) | |||
| 632 | queue_user_dropped); | 629 | queue_user_dropped); |
| 633 | 630 | ||
| 634 | read_unlock_bh(&queue_lock); | 631 | read_unlock_bh(&queue_lock); |
| 632 | return 0; | ||
| 633 | } | ||
| 635 | 634 | ||
| 636 | *start = buffer + offset; | 635 | static int ip_queue_open(struct inode *inode, struct file *file) |
| 637 | len -= offset; | 636 | { |
| 638 | if (len > length) | 637 | return single_open(file, ip_queue_show, NULL); |
| 639 | len = length; | ||
| 640 | else if (len < 0) | ||
| 641 | len = 0; | ||
| 642 | return len; | ||
| 643 | } | 638 | } |
| 644 | #endif /* CONFIG_PROC_FS */ | 639 | |
| 640 | static const struct file_operations ip_queue_proc_fops = { | ||
| 641 | .open = ip_queue_open, | ||
| 642 | .read = seq_read, | ||
| 643 | .llseek = seq_lseek, | ||
| 644 | .release = single_release, | ||
| 645 | .owner = THIS_MODULE, | ||
| 646 | }; | ||
| 645 | 647 | ||
| 646 | static struct nf_queue_handler nfqh = { | 648 | static struct nf_queue_handler nfqh = { |
| 647 | .name = "ip_queue", | 649 | .name = "ip_queue", |
| @@ -661,10 +663,11 @@ static int __init ip_queue_init(void) | |||
| 661 | goto cleanup_netlink_notifier; | 663 | goto cleanup_netlink_notifier; |
| 662 | } | 664 | } |
| 663 | 665 | ||
| 664 | proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info); | 666 | proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net); |
| 665 | if (proc) | 667 | if (proc) { |
| 666 | proc->owner = THIS_MODULE; | 668 | proc->owner = THIS_MODULE; |
| 667 | else { | 669 | proc->proc_fops = &ip_queue_proc_fops; |
| 670 | } else { | ||
| 668 | printk(KERN_ERR "ip_queue: failed to create proc entry\n"); | 671 | printk(KERN_ERR "ip_queue: failed to create proc entry\n"); |
| 669 | goto cleanup_ipqnl; | 672 | goto cleanup_ipqnl; |
| 670 | } | 673 | } |
diff --git a/net/ipv4/netfilter/nf_nat_amanda.c b/net/ipv4/netfilter/nf_nat_amanda.c index 35a5aa69cd92..c31b87668250 100644 --- a/net/ipv4/netfilter/nf_nat_amanda.c +++ b/net/ipv4/netfilter/nf_nat_amanda.c | |||
| @@ -69,7 +69,7 @@ static void __exit nf_nat_amanda_fini(void) | |||
| 69 | 69 | ||
| 70 | static int __init nf_nat_amanda_init(void) | 70 | static int __init nf_nat_amanda_init(void) |
| 71 | { | 71 | { |
| 72 | BUG_ON(rcu_dereference(nf_nat_amanda_hook)); | 72 | BUG_ON(nf_nat_amanda_hook != NULL); |
| 73 | rcu_assign_pointer(nf_nat_amanda_hook, help); | 73 | rcu_assign_pointer(nf_nat_amanda_hook, help); |
| 74 | return 0; | 74 | return 0; |
| 75 | } | 75 | } |
diff --git a/net/ipv4/netfilter/nf_nat_ftp.c b/net/ipv4/netfilter/nf_nat_ftp.c index e1a16d3ea4cb..a1d5d58a58bf 100644 --- a/net/ipv4/netfilter/nf_nat_ftp.c +++ b/net/ipv4/netfilter/nf_nat_ftp.c | |||
| @@ -147,7 +147,7 @@ static void __exit nf_nat_ftp_fini(void) | |||
| 147 | 147 | ||
| 148 | static int __init nf_nat_ftp_init(void) | 148 | static int __init nf_nat_ftp_init(void) |
| 149 | { | 149 | { |
| 150 | BUG_ON(rcu_dereference(nf_nat_ftp_hook)); | 150 | BUG_ON(nf_nat_ftp_hook != NULL); |
| 151 | rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp); | 151 | rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp); |
| 152 | return 0; | 152 | return 0; |
| 153 | } | 153 | } |
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c index a868c8c41328..93e18ef114f2 100644 --- a/net/ipv4/netfilter/nf_nat_h323.c +++ b/net/ipv4/netfilter/nf_nat_h323.c | |||
| @@ -544,15 +544,15 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct, | |||
| 544 | /****************************************************************************/ | 544 | /****************************************************************************/ |
| 545 | static int __init init(void) | 545 | static int __init init(void) |
| 546 | { | 546 | { |
| 547 | BUG_ON(rcu_dereference(set_h245_addr_hook) != NULL); | 547 | BUG_ON(set_h245_addr_hook != NULL); |
| 548 | BUG_ON(rcu_dereference(set_h225_addr_hook) != NULL); | 548 | BUG_ON(set_h225_addr_hook != NULL); |
| 549 | BUG_ON(rcu_dereference(set_sig_addr_hook) != NULL); | 549 | BUG_ON(set_sig_addr_hook != NULL); |
| 550 | BUG_ON(rcu_dereference(set_ras_addr_hook) != NULL); | 550 | BUG_ON(set_ras_addr_hook != NULL); |
| 551 | BUG_ON(rcu_dereference(nat_rtp_rtcp_hook) != NULL); | 551 | BUG_ON(nat_rtp_rtcp_hook != NULL); |
| 552 | BUG_ON(rcu_dereference(nat_t120_hook) != NULL); | 552 | BUG_ON(nat_t120_hook != NULL); |
| 553 | BUG_ON(rcu_dereference(nat_h245_hook) != NULL); | 553 | BUG_ON(nat_h245_hook != NULL); |
| 554 | BUG_ON(rcu_dereference(nat_callforwarding_hook) != NULL); | 554 | BUG_ON(nat_callforwarding_hook != NULL); |
| 555 | BUG_ON(rcu_dereference(nat_q931_hook) != NULL); | 555 | BUG_ON(nat_q931_hook != NULL); |
| 556 | 556 | ||
| 557 | rcu_assign_pointer(set_h245_addr_hook, set_h245_addr); | 557 | rcu_assign_pointer(set_h245_addr_hook, set_h245_addr); |
| 558 | rcu_assign_pointer(set_h225_addr_hook, set_h225_addr); | 558 | rcu_assign_pointer(set_h225_addr_hook, set_h225_addr); |
diff --git a/net/ipv4/netfilter/nf_nat_irc.c b/net/ipv4/netfilter/nf_nat_irc.c index 766e2c16c6b9..fe6f9cef6c85 100644 --- a/net/ipv4/netfilter/nf_nat_irc.c +++ b/net/ipv4/netfilter/nf_nat_irc.c | |||
| @@ -74,7 +74,7 @@ static void __exit nf_nat_irc_fini(void) | |||
| 74 | 74 | ||
| 75 | static int __init nf_nat_irc_init(void) | 75 | static int __init nf_nat_irc_init(void) |
| 76 | { | 76 | { |
| 77 | BUG_ON(rcu_dereference(nf_nat_irc_hook)); | 77 | BUG_ON(nf_nat_irc_hook != NULL); |
| 78 | rcu_assign_pointer(nf_nat_irc_hook, help); | 78 | rcu_assign_pointer(nf_nat_irc_hook, help); |
| 79 | return 0; | 79 | return 0; |
| 80 | } | 80 | } |
diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c index e1385a099079..6817e7995f35 100644 --- a/net/ipv4/netfilter/nf_nat_pptp.c +++ b/net/ipv4/netfilter/nf_nat_pptp.c | |||
| @@ -281,16 +281,16 @@ static int __init nf_nat_helper_pptp_init(void) | |||
| 281 | { | 281 | { |
| 282 | nf_nat_need_gre(); | 282 | nf_nat_need_gre(); |
| 283 | 283 | ||
| 284 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_outbound)); | 284 | BUG_ON(nf_nat_pptp_hook_outbound != NULL); |
| 285 | rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); | 285 | rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); |
| 286 | 286 | ||
| 287 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_inbound)); | 287 | BUG_ON(nf_nat_pptp_hook_inbound != NULL); |
| 288 | rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); | 288 | rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); |
| 289 | 289 | ||
| 290 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_exp_gre)); | 290 | BUG_ON(nf_nat_pptp_hook_exp_gre != NULL); |
| 291 | rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); | 291 | rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); |
| 292 | 292 | ||
| 293 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_expectfn)); | 293 | BUG_ON(nf_nat_pptp_hook_expectfn != NULL); |
| 294 | rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected); | 294 | rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected); |
| 295 | return 0; | 295 | return 0; |
| 296 | } | 296 | } |
diff --git a/net/ipv4/netfilter/nf_nat_sip.c b/net/ipv4/netfilter/nf_nat_sip.c index ce9edbcc01e3..3ca98971a1e9 100644 --- a/net/ipv4/netfilter/nf_nat_sip.c +++ b/net/ipv4/netfilter/nf_nat_sip.c | |||
| @@ -293,8 +293,8 @@ static void __exit nf_nat_sip_fini(void) | |||
| 293 | 293 | ||
| 294 | static int __init nf_nat_sip_init(void) | 294 | static int __init nf_nat_sip_init(void) |
| 295 | { | 295 | { |
| 296 | BUG_ON(rcu_dereference(nf_nat_sip_hook)); | 296 | BUG_ON(nf_nat_sip_hook != NULL); |
| 297 | BUG_ON(rcu_dereference(nf_nat_sdp_hook)); | 297 | BUG_ON(nf_nat_sdp_hook != NULL); |
| 298 | rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip); | 298 | rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip); |
| 299 | rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp); | 299 | rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp); |
| 300 | return 0; | 300 | return 0; |
diff --git a/net/ipv4/netfilter/nf_nat_tftp.c b/net/ipv4/netfilter/nf_nat_tftp.c index 0ecec701cb44..1360a94766dd 100644 --- a/net/ipv4/netfilter/nf_nat_tftp.c +++ b/net/ipv4/netfilter/nf_nat_tftp.c | |||
| @@ -43,7 +43,7 @@ static void __exit nf_nat_tftp_fini(void) | |||
| 43 | 43 | ||
| 44 | static int __init nf_nat_tftp_init(void) | 44 | static int __init nf_nat_tftp_init(void) |
| 45 | { | 45 | { |
| 46 | BUG_ON(rcu_dereference(nf_nat_tftp_hook)); | 46 | BUG_ON(nf_nat_tftp_hook != NULL); |
| 47 | rcu_assign_pointer(nf_nat_tftp_hook, help); | 47 | rcu_assign_pointer(nf_nat_tftp_hook, help); |
| 48 | return 0; | 48 | return 0; |
| 49 | } | 49 | } |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index ffdccc0972e0..ce34b281803f 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
| @@ -46,17 +46,6 @@ | |||
| 46 | #include <net/sock.h> | 46 | #include <net/sock.h> |
| 47 | #include <net/raw.h> | 47 | #include <net/raw.h> |
| 48 | 48 | ||
| 49 | static int fold_prot_inuse(struct proto *proto) | ||
| 50 | { | ||
| 51 | int res = 0; | ||
| 52 | int cpu; | ||
| 53 | |||
| 54 | for_each_possible_cpu(cpu) | ||
| 55 | res += proto->stats[cpu].inuse; | ||
| 56 | |||
| 57 | return res; | ||
| 58 | } | ||
| 59 | |||
| 60 | /* | 49 | /* |
| 61 | * Report socket allocation statistics [mea@utu.fi] | 50 | * Report socket allocation statistics [mea@utu.fi] |
| 62 | */ | 51 | */ |
| @@ -64,12 +53,12 @@ static int sockstat_seq_show(struct seq_file *seq, void *v) | |||
| 64 | { | 53 | { |
| 65 | socket_seq_show(seq); | 54 | socket_seq_show(seq); |
| 66 | seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n", | 55 | seq_printf(seq, "TCP: inuse %d orphan %d tw %d alloc %d mem %d\n", |
| 67 | fold_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count), | 56 | sock_prot_inuse(&tcp_prot), atomic_read(&tcp_orphan_count), |
| 68 | tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated), | 57 | tcp_death_row.tw_count, atomic_read(&tcp_sockets_allocated), |
| 69 | atomic_read(&tcp_memory_allocated)); | 58 | atomic_read(&tcp_memory_allocated)); |
| 70 | seq_printf(seq, "UDP: inuse %d\n", fold_prot_inuse(&udp_prot)); | 59 | seq_printf(seq, "UDP: inuse %d\n", sock_prot_inuse(&udp_prot)); |
| 71 | seq_printf(seq, "UDPLITE: inuse %d\n", fold_prot_inuse(&udplite_prot)); | 60 | seq_printf(seq, "UDPLITE: inuse %d\n", sock_prot_inuse(&udplite_prot)); |
| 72 | seq_printf(seq, "RAW: inuse %d\n", fold_prot_inuse(&raw_prot)); | 61 | seq_printf(seq, "RAW: inuse %d\n", sock_prot_inuse(&raw_prot)); |
| 73 | seq_printf(seq, "FRAG: inuse %d memory %d\n", | 62 | seq_printf(seq, "FRAG: inuse %d memory %d\n", |
| 74 | ip_frag_nqueues(), ip_frag_mem()); | 63 | ip_frag_nqueues(), ip_frag_mem()); |
| 75 | return 0; | 64 | return 0; |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 3916faca3afe..66b42f547bf9 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
| @@ -760,6 +760,8 @@ static int raw_ioctl(struct sock *sk, int cmd, unsigned long arg) | |||
| 760 | } | 760 | } |
| 761 | } | 761 | } |
| 762 | 762 | ||
| 763 | DEFINE_PROTO_INUSE(raw) | ||
| 764 | |||
| 763 | struct proto raw_prot = { | 765 | struct proto raw_prot = { |
| 764 | .name = "RAW", | 766 | .name = "RAW", |
| 765 | .owner = THIS_MODULE, | 767 | .owner = THIS_MODULE, |
| @@ -781,6 +783,7 @@ struct proto raw_prot = { | |||
| 781 | .compat_setsockopt = compat_raw_setsockopt, | 783 | .compat_setsockopt = compat_raw_setsockopt, |
| 782 | .compat_getsockopt = compat_raw_getsockopt, | 784 | .compat_getsockopt = compat_raw_getsockopt, |
| 783 | #endif | 785 | #endif |
| 786 | REF_PROTO_INUSE(raw) | ||
| 784 | }; | 787 | }; |
| 785 | 788 | ||
| 786 | #ifdef CONFIG_PROC_FS | 789 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 21b12de9e653..45651834e1e2 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -851,9 +851,7 @@ restart: | |||
| 851 | */ | 851 | */ |
| 852 | rcu_assign_pointer(rt_hash_table[hash].chain, rth); | 852 | rcu_assign_pointer(rt_hash_table[hash].chain, rth); |
| 853 | 853 | ||
| 854 | rth->u.dst.__use++; | 854 | dst_use(&rth->u.dst, now); |
| 855 | dst_hold(&rth->u.dst); | ||
| 856 | rth->u.dst.lastuse = now; | ||
| 857 | spin_unlock_bh(rt_hash_lock_addr(hash)); | 855 | spin_unlock_bh(rt_hash_lock_addr(hash)); |
| 858 | 856 | ||
| 859 | rt_drop(rt); | 857 | rt_drop(rt); |
| @@ -1813,11 +1811,6 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 1813 | goto martian_destination; | 1811 | goto martian_destination; |
| 1814 | 1812 | ||
| 1815 | err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos); | 1813 | err = ip_mkroute_input(skb, &res, &fl, in_dev, daddr, saddr, tos); |
| 1816 | if (err == -ENOBUFS) | ||
| 1817 | goto e_nobufs; | ||
| 1818 | if (err == -EINVAL) | ||
| 1819 | goto e_inval; | ||
| 1820 | |||
| 1821 | done: | 1814 | done: |
| 1822 | in_dev_put(in_dev); | 1815 | in_dev_put(in_dev); |
| 1823 | if (free_res) | 1816 | if (free_res) |
| @@ -1935,9 +1928,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 1935 | rth->fl.oif == 0 && | 1928 | rth->fl.oif == 0 && |
| 1936 | rth->fl.mark == skb->mark && | 1929 | rth->fl.mark == skb->mark && |
| 1937 | rth->fl.fl4_tos == tos) { | 1930 | rth->fl.fl4_tos == tos) { |
| 1938 | rth->u.dst.lastuse = jiffies; | 1931 | dst_use(&rth->u.dst, jiffies); |
| 1939 | dst_hold(&rth->u.dst); | ||
| 1940 | rth->u.dst.__use++; | ||
| 1941 | RT_CACHE_STAT_INC(in_hit); | 1932 | RT_CACHE_STAT_INC(in_hit); |
| 1942 | rcu_read_unlock(); | 1933 | rcu_read_unlock(); |
| 1943 | skb->dst = (struct dst_entry*)rth; | 1934 | skb->dst = (struct dst_entry*)rth; |
| @@ -2331,9 +2322,7 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp) | |||
| 2331 | rth->fl.mark == flp->mark && | 2322 | rth->fl.mark == flp->mark && |
| 2332 | !((rth->fl.fl4_tos ^ flp->fl4_tos) & | 2323 | !((rth->fl.fl4_tos ^ flp->fl4_tos) & |
| 2333 | (IPTOS_RT_MASK | RTO_ONLINK))) { | 2324 | (IPTOS_RT_MASK | RTO_ONLINK))) { |
| 2334 | rth->u.dst.lastuse = jiffies; | 2325 | dst_use(&rth->u.dst, jiffies); |
| 2335 | dst_hold(&rth->u.dst); | ||
| 2336 | rth->u.dst.__use++; | ||
| 2337 | RT_CACHE_STAT_INC(out_hit); | 2326 | RT_CACHE_STAT_INC(out_hit); |
| 2338 | rcu_read_unlock_bh(); | 2327 | rcu_read_unlock_bh(); |
| 2339 | *rp = rth; | 2328 | *rp = rth; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index c64072bb504b..8e65182f7af1 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -2456,11 +2456,11 @@ void __init tcp_init(void) | |||
| 2456 | thash_entries ? 0 : 512 * 1024); | 2456 | thash_entries ? 0 : 512 * 1024); |
| 2457 | tcp_hashinfo.ehash_size = 1 << tcp_hashinfo.ehash_size; | 2457 | tcp_hashinfo.ehash_size = 1 << tcp_hashinfo.ehash_size; |
| 2458 | for (i = 0; i < tcp_hashinfo.ehash_size; i++) { | 2458 | for (i = 0; i < tcp_hashinfo.ehash_size; i++) { |
| 2459 | rwlock_init(&tcp_hashinfo.ehash[i].lock); | ||
| 2460 | INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].chain); | 2459 | INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].chain); |
| 2461 | INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].twchain); | 2460 | INIT_HLIST_HEAD(&tcp_hashinfo.ehash[i].twchain); |
| 2462 | } | 2461 | } |
| 2463 | 2462 | if (inet_ehash_locks_alloc(&tcp_hashinfo)) | |
| 2463 | panic("TCP: failed to alloc ehash_locks"); | ||
| 2464 | tcp_hashinfo.bhash = | 2464 | tcp_hashinfo.bhash = |
| 2465 | alloc_large_system_hash("TCP bind", | 2465 | alloc_large_system_hash("TCP bind", |
| 2466 | sizeof(struct inet_bind_hashbucket), | 2466 | sizeof(struct inet_bind_hashbucket), |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index ca9590f4f520..20c9440ab85e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -1400,11 +1400,9 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1400 | /* DSACK info lost if out-of-mem, try SACK still */ | 1400 | /* DSACK info lost if out-of-mem, try SACK still */ |
| 1401 | if (in_sack <= 0) | 1401 | if (in_sack <= 0) |
| 1402 | in_sack = tcp_match_skb_to_sack(sk, skb, start_seq, end_seq); | 1402 | in_sack = tcp_match_skb_to_sack(sk, skb, start_seq, end_seq); |
| 1403 | if (in_sack < 0) | 1403 | if (unlikely(in_sack < 0)) |
| 1404 | break; | 1404 | break; |
| 1405 | 1405 | ||
| 1406 | fack_count += tcp_skb_pcount(skb); | ||
| 1407 | |||
| 1408 | sacked = TCP_SKB_CB(skb)->sacked; | 1406 | sacked = TCP_SKB_CB(skb)->sacked; |
| 1409 | 1407 | ||
| 1410 | /* Account D-SACK for retransmitted packet. */ | 1408 | /* Account D-SACK for retransmitted packet. */ |
| @@ -1419,19 +1417,17 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1419 | if ((dup_sack && in_sack) && | 1417 | if ((dup_sack && in_sack) && |
| 1420 | (sacked&TCPCB_SACKED_ACKED)) | 1418 | (sacked&TCPCB_SACKED_ACKED)) |
| 1421 | reord = min(fack_count, reord); | 1419 | reord = min(fack_count, reord); |
| 1422 | } else { | ||
| 1423 | /* If it was in a hole, we detected reordering. */ | ||
| 1424 | if (fack_count < prior_fackets && | ||
| 1425 | !(sacked&TCPCB_SACKED_ACKED)) | ||
| 1426 | reord = min(fack_count, reord); | ||
| 1427 | } | 1420 | } |
| 1428 | 1421 | ||
| 1429 | /* Nothing to do; acked frame is about to be dropped. */ | 1422 | /* Nothing to do; acked frame is about to be dropped. */ |
| 1423 | fack_count += tcp_skb_pcount(skb); | ||
| 1430 | continue; | 1424 | continue; |
| 1431 | } | 1425 | } |
| 1432 | 1426 | ||
| 1433 | if (!in_sack) | 1427 | if (!in_sack) { |
| 1428 | fack_count += tcp_skb_pcount(skb); | ||
| 1434 | continue; | 1429 | continue; |
| 1430 | } | ||
| 1435 | 1431 | ||
| 1436 | if (!(sacked&TCPCB_SACKED_ACKED)) { | 1432 | if (!(sacked&TCPCB_SACKED_ACKED)) { |
| 1437 | if (sacked & TCPCB_SACKED_RETRANS) { | 1433 | if (sacked & TCPCB_SACKED_RETRANS) { |
| @@ -1448,12 +1444,17 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1448 | tp->retransmit_skb_hint = NULL; | 1444 | tp->retransmit_skb_hint = NULL; |
| 1449 | } | 1445 | } |
| 1450 | } else { | 1446 | } else { |
| 1451 | /* New sack for not retransmitted frame, | 1447 | if (!(sacked & TCPCB_RETRANS)) { |
| 1452 | * which was in hole. It is reordering. | 1448 | /* New sack for not retransmitted frame, |
| 1453 | */ | 1449 | * which was in hole. It is reordering. |
| 1454 | if (!(sacked & TCPCB_RETRANS) && | 1450 | */ |
| 1455 | fack_count < prior_fackets) | 1451 | if (fack_count < prior_fackets) |
| 1456 | reord = min(fack_count, reord); | 1452 | reord = min(fack_count, reord); |
| 1453 | |||
| 1454 | /* SACK enhanced F-RTO (RFC4138; Appendix B) */ | ||
| 1455 | if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) | ||
| 1456 | flag |= FLAG_ONLY_ORIG_SACKED; | ||
| 1457 | } | ||
| 1457 | 1458 | ||
| 1458 | if (sacked & TCPCB_LOST) { | 1459 | if (sacked & TCPCB_LOST) { |
| 1459 | TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST; | 1460 | TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST; |
| @@ -1462,24 +1463,13 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1462 | /* clear lost hint */ | 1463 | /* clear lost hint */ |
| 1463 | tp->retransmit_skb_hint = NULL; | 1464 | tp->retransmit_skb_hint = NULL; |
| 1464 | } | 1465 | } |
| 1465 | /* SACK enhanced F-RTO detection. | ||
| 1466 | * Set flag if and only if non-rexmitted | ||
| 1467 | * segments below frto_highmark are | ||
| 1468 | * SACKed (RFC4138; Appendix B). | ||
| 1469 | * Clearing correct due to in-order walk | ||
| 1470 | */ | ||
| 1471 | if (after(end_seq, tp->frto_highmark)) { | ||
| 1472 | flag &= ~FLAG_ONLY_ORIG_SACKED; | ||
| 1473 | } else { | ||
| 1474 | if (!(sacked & TCPCB_RETRANS)) | ||
| 1475 | flag |= FLAG_ONLY_ORIG_SACKED; | ||
| 1476 | } | ||
| 1477 | } | 1466 | } |
| 1478 | 1467 | ||
| 1479 | TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED; | 1468 | TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED; |
| 1480 | flag |= FLAG_DATA_SACKED; | 1469 | flag |= FLAG_DATA_SACKED; |
| 1481 | tp->sacked_out += tcp_skb_pcount(skb); | 1470 | tp->sacked_out += tcp_skb_pcount(skb); |
| 1482 | 1471 | ||
| 1472 | fack_count += tcp_skb_pcount(skb); | ||
| 1483 | if (fack_count > tp->fackets_out) | 1473 | if (fack_count > tp->fackets_out) |
| 1484 | tp->fackets_out = fack_count; | 1474 | tp->fackets_out = fack_count; |
| 1485 | 1475 | ||
| @@ -1490,6 +1480,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1490 | } else { | 1480 | } else { |
| 1491 | if (dup_sack && (sacked&TCPCB_RETRANS)) | 1481 | if (dup_sack && (sacked&TCPCB_RETRANS)) |
| 1492 | reord = min(fack_count, reord); | 1482 | reord = min(fack_count, reord); |
| 1483 | |||
| 1484 | fack_count += tcp_skb_pcount(skb); | ||
| 1493 | } | 1485 | } |
| 1494 | 1486 | ||
| 1495 | /* D-SACK. We can detect redundant retransmission | 1487 | /* D-SACK. We can detect redundant retransmission |
| @@ -1504,6 +1496,12 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1504 | tp->retransmit_skb_hint = NULL; | 1496 | tp->retransmit_skb_hint = NULL; |
| 1505 | } | 1497 | } |
| 1506 | } | 1498 | } |
| 1499 | |||
| 1500 | /* SACK enhanced FRTO (RFC4138, Appendix B): Clearing correct | ||
| 1501 | * due to in-order walk | ||
| 1502 | */ | ||
| 1503 | if (after(end_seq, tp->frto_highmark)) | ||
| 1504 | flag &= ~FLAG_ONLY_ORIG_SACKED; | ||
| 1507 | } | 1505 | } |
| 1508 | 1506 | ||
| 1509 | if (tp->retrans_out && | 1507 | if (tp->retrans_out && |
| @@ -1515,7 +1513,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
| 1515 | 1513 | ||
| 1516 | if ((reord < tp->fackets_out) && icsk->icsk_ca_state != TCP_CA_Loss && | 1514 | if ((reord < tp->fackets_out) && icsk->icsk_ca_state != TCP_CA_Loss && |
| 1517 | (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark))) | 1515 | (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark))) |
| 1518 | tcp_update_reordering(sk, ((tp->fackets_out + 1) - reord), 0); | 1516 | tcp_update_reordering(sk, tp->fackets_out - reord, 0); |
| 1519 | 1517 | ||
| 1520 | #if FASTRETRANS_DEBUG > 0 | 1518 | #if FASTRETRANS_DEBUG > 0 |
| 1521 | BUG_TRAP((int)tp->sacked_out >= 0); | 1519 | BUG_TRAP((int)tp->sacked_out >= 0); |
| @@ -2630,7 +2628,8 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb) | |||
| 2630 | * is before the ack sequence we can discard it as it's confirmed to have | 2628 | * is before the ack sequence we can discard it as it's confirmed to have |
| 2631 | * arrived at the other end. | 2629 | * arrived at the other end. |
| 2632 | */ | 2630 | */ |
| 2633 | static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p) | 2631 | static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p, |
| 2632 | int prior_fackets) | ||
| 2634 | { | 2633 | { |
| 2635 | struct tcp_sock *tp = tcp_sk(sk); | 2634 | struct tcp_sock *tp = tcp_sk(sk); |
| 2636 | const struct inet_connection_sock *icsk = inet_csk(sk); | 2635 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| @@ -2639,6 +2638,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p) | |||
| 2639 | int fully_acked = 1; | 2638 | int fully_acked = 1; |
| 2640 | int flag = 0; | 2639 | int flag = 0; |
| 2641 | int prior_packets = tp->packets_out; | 2640 | int prior_packets = tp->packets_out; |
| 2641 | u32 cnt = 0; | ||
| 2642 | u32 reord = tp->packets_out; | ||
| 2642 | s32 seq_rtt = -1; | 2643 | s32 seq_rtt = -1; |
| 2643 | ktime_t last_ackt = net_invalid_timestamp(); | 2644 | ktime_t last_ackt = net_invalid_timestamp(); |
| 2644 | 2645 | ||
| @@ -2679,10 +2680,14 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p) | |||
| 2679 | if ((flag & FLAG_DATA_ACKED) || | 2680 | if ((flag & FLAG_DATA_ACKED) || |
| 2680 | (packets_acked > 1)) | 2681 | (packets_acked > 1)) |
| 2681 | flag |= FLAG_NONHEAD_RETRANS_ACKED; | 2682 | flag |= FLAG_NONHEAD_RETRANS_ACKED; |
| 2682 | } else if (seq_rtt < 0) { | 2683 | } else { |
| 2683 | seq_rtt = now - scb->when; | 2684 | if (seq_rtt < 0) { |
| 2684 | if (fully_acked) | 2685 | seq_rtt = now - scb->when; |
| 2685 | last_ackt = skb->tstamp; | 2686 | if (fully_acked) |
| 2687 | last_ackt = skb->tstamp; | ||
| 2688 | } | ||
| 2689 | if (!(sacked & TCPCB_SACKED_ACKED)) | ||
| 2690 | reord = min(cnt, reord); | ||
| 2686 | } | 2691 | } |
| 2687 | 2692 | ||
| 2688 | if (sacked & TCPCB_SACKED_ACKED) | 2693 | if (sacked & TCPCB_SACKED_ACKED) |
| @@ -2693,12 +2698,16 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p) | |||
| 2693 | if ((sacked & TCPCB_URG) && tp->urg_mode && | 2698 | if ((sacked & TCPCB_URG) && tp->urg_mode && |
| 2694 | !before(end_seq, tp->snd_up)) | 2699 | !before(end_seq, tp->snd_up)) |
| 2695 | tp->urg_mode = 0; | 2700 | tp->urg_mode = 0; |
| 2696 | } else if (seq_rtt < 0) { | 2701 | } else { |
| 2697 | seq_rtt = now - scb->when; | 2702 | if (seq_rtt < 0) { |
| 2698 | if (fully_acked) | 2703 | seq_rtt = now - scb->when; |
| 2699 | last_ackt = skb->tstamp; | 2704 | if (fully_acked) |
| 2705 | last_ackt = skb->tstamp; | ||
| 2706 | } | ||
| 2707 | reord = min(cnt, reord); | ||
| 2700 | } | 2708 | } |
| 2701 | tp->packets_out -= packets_acked; | 2709 | tp->packets_out -= packets_acked; |
| 2710 | cnt += packets_acked; | ||
| 2702 | 2711 | ||
| 2703 | /* Initial outgoing SYN's get put onto the write_queue | 2712 | /* Initial outgoing SYN's get put onto the write_queue |
| 2704 | * just like anything else we transmit. It is not | 2713 | * just like anything else we transmit. It is not |
| @@ -2730,13 +2739,18 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p) | |||
| 2730 | tcp_ack_update_rtt(sk, flag, seq_rtt); | 2739 | tcp_ack_update_rtt(sk, flag, seq_rtt); |
| 2731 | tcp_rearm_rto(sk); | 2740 | tcp_rearm_rto(sk); |
| 2732 | 2741 | ||
| 2742 | if (tcp_is_reno(tp)) { | ||
| 2743 | tcp_remove_reno_sacks(sk, pkts_acked); | ||
| 2744 | } else { | ||
| 2745 | /* Non-retransmitted hole got filled? That's reordering */ | ||
| 2746 | if (reord < prior_fackets) | ||
| 2747 | tcp_update_reordering(sk, tp->fackets_out - reord, 0); | ||
| 2748 | } | ||
| 2749 | |||
| 2733 | tp->fackets_out -= min(pkts_acked, tp->fackets_out); | 2750 | tp->fackets_out -= min(pkts_acked, tp->fackets_out); |
| 2734 | /* hint's skb might be NULL but we don't need to care */ | 2751 | /* hint's skb might be NULL but we don't need to care */ |
| 2735 | tp->fastpath_cnt_hint -= min_t(u32, pkts_acked, | 2752 | tp->fastpath_cnt_hint -= min_t(u32, pkts_acked, |
| 2736 | tp->fastpath_cnt_hint); | 2753 | tp->fastpath_cnt_hint); |
| 2737 | if (tcp_is_reno(tp)) | ||
| 2738 | tcp_remove_reno_sacks(sk, pkts_acked); | ||
| 2739 | |||
| 2740 | if (ca_ops->pkts_acked) { | 2754 | if (ca_ops->pkts_acked) { |
| 2741 | s32 rtt_us = -1; | 2755 | s32 rtt_us = -1; |
| 2742 | 2756 | ||
| @@ -3019,6 +3033,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 3019 | u32 ack_seq = TCP_SKB_CB(skb)->seq; | 3033 | u32 ack_seq = TCP_SKB_CB(skb)->seq; |
| 3020 | u32 ack = TCP_SKB_CB(skb)->ack_seq; | 3034 | u32 ack = TCP_SKB_CB(skb)->ack_seq; |
| 3021 | u32 prior_in_flight; | 3035 | u32 prior_in_flight; |
| 3036 | u32 prior_fackets; | ||
| 3022 | s32 seq_rtt; | 3037 | s32 seq_rtt; |
| 3023 | int prior_packets; | 3038 | int prior_packets; |
| 3024 | int frto_cwnd = 0; | 3039 | int frto_cwnd = 0; |
| @@ -3043,6 +3058,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 3043 | tp->bytes_acked += min(ack - prior_snd_una, tp->mss_cache); | 3058 | tp->bytes_acked += min(ack - prior_snd_una, tp->mss_cache); |
| 3044 | } | 3059 | } |
| 3045 | 3060 | ||
| 3061 | prior_fackets = tp->fackets_out; | ||
| 3062 | |||
| 3046 | if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) { | 3063 | if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) { |
| 3047 | /* Window is constant, pure forward advance. | 3064 | /* Window is constant, pure forward advance. |
| 3048 | * No more checks are required. | 3065 | * No more checks are required. |
| @@ -3084,7 +3101,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
| 3084 | prior_in_flight = tcp_packets_in_flight(tp); | 3101 | prior_in_flight = tcp_packets_in_flight(tp); |
| 3085 | 3102 | ||
| 3086 | /* See if we can take anything off of the retransmit queue. */ | 3103 | /* See if we can take anything off of the retransmit queue. */ |
| 3087 | flag |= tcp_clean_rtx_queue(sk, &seq_rtt); | 3104 | flag |= tcp_clean_rtx_queue(sk, &seq_rtt, prior_fackets); |
| 3088 | 3105 | ||
| 3089 | /* Guarantee sacktag reordering detection against wrap-arounds */ | 3106 | /* Guarantee sacktag reordering detection against wrap-arounds */ |
| 3090 | if (before(tp->frto_highmark, tp->snd_una)) | 3107 | if (before(tp->frto_highmark, tp->snd_una)) |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index d438dfb0c8f3..e566f3c67677 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
| @@ -2049,8 +2049,9 @@ static void *established_get_first(struct seq_file *seq) | |||
| 2049 | struct sock *sk; | 2049 | struct sock *sk; |
| 2050 | struct hlist_node *node; | 2050 | struct hlist_node *node; |
| 2051 | struct inet_timewait_sock *tw; | 2051 | struct inet_timewait_sock *tw; |
| 2052 | rwlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, st->bucket); | ||
| 2052 | 2053 | ||
| 2053 | read_lock_bh(&tcp_hashinfo.ehash[st->bucket].lock); | 2054 | read_lock_bh(lock); |
| 2054 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { | 2055 | sk_for_each(sk, node, &tcp_hashinfo.ehash[st->bucket].chain) { |
| 2055 | if (sk->sk_family != st->family) { | 2056 | if (sk->sk_family != st->family) { |
| 2056 | continue; | 2057 | continue; |
| @@ -2067,7 +2068,7 @@ static void *established_get_first(struct seq_file *seq) | |||
| 2067 | rc = tw; | 2068 | rc = tw; |
| 2068 | goto out; | 2069 | goto out; |
| 2069 | } | 2070 | } |
| 2070 | read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock); | 2071 | read_unlock_bh(lock); |
| 2071 | st->state = TCP_SEQ_STATE_ESTABLISHED; | 2072 | st->state = TCP_SEQ_STATE_ESTABLISHED; |
| 2072 | } | 2073 | } |
| 2073 | out: | 2074 | out: |
| @@ -2094,11 +2095,11 @@ get_tw: | |||
| 2094 | cur = tw; | 2095 | cur = tw; |
| 2095 | goto out; | 2096 | goto out; |
| 2096 | } | 2097 | } |
| 2097 | read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock); | 2098 | read_unlock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket)); |
| 2098 | st->state = TCP_SEQ_STATE_ESTABLISHED; | 2099 | st->state = TCP_SEQ_STATE_ESTABLISHED; |
| 2099 | 2100 | ||
| 2100 | if (++st->bucket < tcp_hashinfo.ehash_size) { | 2101 | if (++st->bucket < tcp_hashinfo.ehash_size) { |
| 2101 | read_lock_bh(&tcp_hashinfo.ehash[st->bucket].lock); | 2102 | read_lock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket)); |
| 2102 | sk = sk_head(&tcp_hashinfo.ehash[st->bucket].chain); | 2103 | sk = sk_head(&tcp_hashinfo.ehash[st->bucket].chain); |
| 2103 | } else { | 2104 | } else { |
| 2104 | cur = NULL; | 2105 | cur = NULL; |
| @@ -2206,7 +2207,7 @@ static void tcp_seq_stop(struct seq_file *seq, void *v) | |||
| 2206 | case TCP_SEQ_STATE_TIME_WAIT: | 2207 | case TCP_SEQ_STATE_TIME_WAIT: |
| 2207 | case TCP_SEQ_STATE_ESTABLISHED: | 2208 | case TCP_SEQ_STATE_ESTABLISHED: |
| 2208 | if (v) | 2209 | if (v) |
| 2209 | read_unlock_bh(&tcp_hashinfo.ehash[st->bucket].lock); | 2210 | read_unlock_bh(inet_ehash_lockp(&tcp_hashinfo, st->bucket)); |
| 2210 | break; | 2211 | break; |
| 2211 | } | 2212 | } |
| 2212 | } | 2213 | } |
| @@ -2417,6 +2418,8 @@ void tcp4_proc_exit(void) | |||
| 2417 | } | 2418 | } |
| 2418 | #endif /* CONFIG_PROC_FS */ | 2419 | #endif /* CONFIG_PROC_FS */ |
| 2419 | 2420 | ||
| 2421 | DEFINE_PROTO_INUSE(tcp) | ||
| 2422 | |||
| 2420 | struct proto tcp_prot = { | 2423 | struct proto tcp_prot = { |
| 2421 | .name = "TCP", | 2424 | .name = "TCP", |
| 2422 | .owner = THIS_MODULE, | 2425 | .owner = THIS_MODULE, |
| @@ -2451,6 +2454,7 @@ struct proto tcp_prot = { | |||
| 2451 | .compat_setsockopt = compat_tcp_setsockopt, | 2454 | .compat_setsockopt = compat_tcp_setsockopt, |
| 2452 | .compat_getsockopt = compat_tcp_getsockopt, | 2455 | .compat_getsockopt = compat_tcp_getsockopt, |
| 2453 | #endif | 2456 | #endif |
| 2457 | REF_PROTO_INUSE(tcp) | ||
| 2454 | }; | 2458 | }; |
| 2455 | 2459 | ||
| 2456 | void __init tcp_v4_init(struct net_proto_family *ops) | 2460 | void __init tcp_v4_init(struct net_proto_family *ops) |
diff --git a/net/ipv4/tunnel4.c b/net/ipv4/tunnel4.c index a794a8ca8b4f..978b3fd61e65 100644 --- a/net/ipv4/tunnel4.c +++ b/net/ipv4/tunnel4.c | |||
| @@ -17,6 +17,11 @@ static struct xfrm_tunnel *tunnel4_handlers; | |||
| 17 | static struct xfrm_tunnel *tunnel64_handlers; | 17 | static struct xfrm_tunnel *tunnel64_handlers; |
| 18 | static DEFINE_MUTEX(tunnel4_mutex); | 18 | static DEFINE_MUTEX(tunnel4_mutex); |
| 19 | 19 | ||
| 20 | static inline struct xfrm_tunnel **fam_handlers(unsigned short family) | ||
| 21 | { | ||
| 22 | return (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers; | ||
| 23 | } | ||
| 24 | |||
| 20 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family) | 25 | int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family) |
| 21 | { | 26 | { |
| 22 | struct xfrm_tunnel **pprev; | 27 | struct xfrm_tunnel **pprev; |
| @@ -25,8 +30,7 @@ int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family) | |||
| 25 | 30 | ||
| 26 | mutex_lock(&tunnel4_mutex); | 31 | mutex_lock(&tunnel4_mutex); |
| 27 | 32 | ||
| 28 | for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers; | 33 | for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) { |
| 29 | *pprev; pprev = &(*pprev)->next) { | ||
| 30 | if ((*pprev)->priority > priority) | 34 | if ((*pprev)->priority > priority) |
| 31 | break; | 35 | break; |
| 32 | if ((*pprev)->priority == priority) | 36 | if ((*pprev)->priority == priority) |
| @@ -53,8 +57,7 @@ int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family) | |||
| 53 | 57 | ||
| 54 | mutex_lock(&tunnel4_mutex); | 58 | mutex_lock(&tunnel4_mutex); |
| 55 | 59 | ||
| 56 | for (pprev = (family == AF_INET) ? &tunnel4_handlers : &tunnel64_handlers; | 60 | for (pprev = fam_handlers(family); *pprev; pprev = &(*pprev)->next) { |
| 57 | *pprev; pprev = &(*pprev)->next) { | ||
| 58 | if (*pprev == handler) { | 61 | if (*pprev == handler) { |
| 59 | *pprev = handler->next; | 62 | *pprev = handler->next; |
| 60 | ret = 0; | 63 | ret = 0; |
| @@ -118,6 +121,17 @@ static void tunnel4_err(struct sk_buff *skb, u32 info) | |||
| 118 | break; | 121 | break; |
| 119 | } | 122 | } |
| 120 | 123 | ||
| 124 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 125 | static void tunnel64_err(struct sk_buff *skb, u32 info) | ||
| 126 | { | ||
| 127 | struct xfrm_tunnel *handler; | ||
| 128 | |||
| 129 | for (handler = tunnel64_handlers; handler; handler = handler->next) | ||
| 130 | if (!handler->err_handler(skb, info)) | ||
| 131 | break; | ||
| 132 | } | ||
| 133 | #endif | ||
| 134 | |||
| 121 | static struct net_protocol tunnel4_protocol = { | 135 | static struct net_protocol tunnel4_protocol = { |
| 122 | .handler = tunnel4_rcv, | 136 | .handler = tunnel4_rcv, |
| 123 | .err_handler = tunnel4_err, | 137 | .err_handler = tunnel4_err, |
| @@ -127,7 +141,7 @@ static struct net_protocol tunnel4_protocol = { | |||
| 127 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 141 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 128 | static struct net_protocol tunnel64_protocol = { | 142 | static struct net_protocol tunnel64_protocol = { |
| 129 | .handler = tunnel64_rcv, | 143 | .handler = tunnel64_rcv, |
| 130 | .err_handler = tunnel4_err, | 144 | .err_handler = tunnel64_err, |
| 131 | .no_policy = 1, | 145 | .no_policy = 1, |
| 132 | }; | 146 | }; |
| 133 | #endif | 147 | #endif |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 4bc25b46f33f..03c400ca14c5 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
| @@ -1430,6 +1430,8 @@ unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
| 1430 | 1430 | ||
| 1431 | } | 1431 | } |
| 1432 | 1432 | ||
| 1433 | DEFINE_PROTO_INUSE(udp) | ||
| 1434 | |||
| 1433 | struct proto udp_prot = { | 1435 | struct proto udp_prot = { |
| 1434 | .name = "UDP", | 1436 | .name = "UDP", |
| 1435 | .owner = THIS_MODULE, | 1437 | .owner = THIS_MODULE, |
| @@ -1452,6 +1454,7 @@ struct proto udp_prot = { | |||
| 1452 | .compat_setsockopt = compat_udp_setsockopt, | 1454 | .compat_setsockopt = compat_udp_setsockopt, |
| 1453 | .compat_getsockopt = compat_udp_getsockopt, | 1455 | .compat_getsockopt = compat_udp_getsockopt, |
| 1454 | #endif | 1456 | #endif |
| 1457 | REF_PROTO_INUSE(udp) | ||
| 1455 | }; | 1458 | }; |
| 1456 | 1459 | ||
| 1457 | /* ------------------------------------------------------------------------ */ | 1460 | /* ------------------------------------------------------------------------ */ |
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index 94977205abb4..f5baeb3e8b85 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
| @@ -44,6 +44,8 @@ static struct net_protocol udplite_protocol = { | |||
| 44 | .no_policy = 1, | 44 | .no_policy = 1, |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | DEFINE_PROTO_INUSE(udplite) | ||
| 48 | |||
| 47 | struct proto udplite_prot = { | 49 | struct proto udplite_prot = { |
| 48 | .name = "UDP-Lite", | 50 | .name = "UDP-Lite", |
| 49 | .owner = THIS_MODULE, | 51 | .owner = THIS_MODULE, |
| @@ -67,6 +69,7 @@ struct proto udplite_prot = { | |||
| 67 | .compat_setsockopt = compat_udp_setsockopt, | 69 | .compat_setsockopt = compat_udp_setsockopt, |
| 68 | .compat_getsockopt = compat_udp_getsockopt, | 70 | .compat_getsockopt = compat_udp_getsockopt, |
| 69 | #endif | 71 | #endif |
| 72 | REF_PROTO_INUSE(udplite) | ||
| 70 | }; | 73 | }; |
| 71 | 74 | ||
| 72 | static struct inet_protosw udplite4_protosw = { | 75 | static struct inet_protosw udplite4_protosw = { |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 706622af206f..428c6b0e26d8 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
| @@ -31,25 +31,6 @@ struct fib6_rule | |||
| 31 | 31 | ||
| 32 | static struct fib_rules_ops fib6_rules_ops; | 32 | static struct fib_rules_ops fib6_rules_ops; |
| 33 | 33 | ||
| 34 | static struct fib6_rule main_rule = { | ||
| 35 | .common = { | ||
| 36 | .refcnt = ATOMIC_INIT(2), | ||
| 37 | .pref = 0x7FFE, | ||
| 38 | .action = FR_ACT_TO_TBL, | ||
| 39 | .table = RT6_TABLE_MAIN, | ||
| 40 | }, | ||
| 41 | }; | ||
| 42 | |||
| 43 | static struct fib6_rule local_rule = { | ||
| 44 | .common = { | ||
| 45 | .refcnt = ATOMIC_INIT(2), | ||
| 46 | .pref = 0, | ||
| 47 | .action = FR_ACT_TO_TBL, | ||
| 48 | .table = RT6_TABLE_LOCAL, | ||
| 49 | .flags = FIB_RULE_PERMANENT, | ||
| 50 | }, | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags, | 34 | struct dst_entry *fib6_rule_lookup(struct flowi *fl, int flags, |
| 54 | pol_lookup_t lookup) | 35 | pol_lookup_t lookup) |
| 55 | { | 36 | { |
| @@ -270,11 +251,23 @@ static struct fib_rules_ops fib6_rules_ops = { | |||
| 270 | .owner = THIS_MODULE, | 251 | .owner = THIS_MODULE, |
| 271 | }; | 252 | }; |
| 272 | 253 | ||
| 273 | void __init fib6_rules_init(void) | 254 | static int __init fib6_default_rules_init(void) |
| 274 | { | 255 | { |
| 275 | list_add_tail(&local_rule.common.list, &fib6_rules_ops.rules_list); | 256 | int err; |
| 276 | list_add_tail(&main_rule.common.list, &fib6_rules_ops.rules_list); | 257 | |
| 258 | err = fib_default_rule_add(&fib6_rules_ops, 0, | ||
| 259 | RT6_TABLE_LOCAL, FIB_RULE_PERMANENT); | ||
| 260 | if (err < 0) | ||
| 261 | return err; | ||
| 262 | err = fib_default_rule_add(&fib6_rules_ops, 0x7FFE, RT6_TABLE_MAIN, 0); | ||
| 263 | if (err < 0) | ||
| 264 | return err; | ||
| 265 | return 0; | ||
| 266 | } | ||
| 277 | 267 | ||
| 268 | void __init fib6_rules_init(void) | ||
| 269 | { | ||
| 270 | BUG_ON(fib6_default_rules_init()); | ||
| 278 | fib_rules_register(&fib6_rules_ops); | 271 | fib_rules_register(&fib6_rules_ops); |
| 279 | } | 272 | } |
| 280 | 273 | ||
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index d6f1026f1943..adc73adadfae 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c | |||
| @@ -37,9 +37,8 @@ void __inet6_hash(struct inet_hashinfo *hashinfo, | |||
| 37 | } else { | 37 | } else { |
| 38 | unsigned int hash; | 38 | unsigned int hash; |
| 39 | sk->sk_hash = hash = inet6_sk_ehashfn(sk); | 39 | sk->sk_hash = hash = inet6_sk_ehashfn(sk); |
| 40 | hash &= (hashinfo->ehash_size - 1); | 40 | list = &inet_ehash_bucket(hashinfo, hash)->chain; |
| 41 | list = &hashinfo->ehash[hash].chain; | 41 | lock = inet_ehash_lockp(hashinfo, hash); |
| 42 | lock = &hashinfo->ehash[hash].lock; | ||
| 43 | write_lock(lock); | 42 | write_lock(lock); |
| 44 | } | 43 | } |
| 45 | 44 | ||
| @@ -70,9 +69,10 @@ struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, | |||
| 70 | */ | 69 | */ |
| 71 | unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); | 70 | unsigned int hash = inet6_ehashfn(daddr, hnum, saddr, sport); |
| 72 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); | 71 | struct inet_ehash_bucket *head = inet_ehash_bucket(hashinfo, hash); |
| 72 | rwlock_t *lock = inet_ehash_lockp(hashinfo, hash); | ||
| 73 | 73 | ||
| 74 | prefetch(head->chain.first); | 74 | prefetch(head->chain.first); |
| 75 | read_lock(&head->lock); | 75 | read_lock(lock); |
| 76 | sk_for_each(sk, node, &head->chain) { | 76 | sk_for_each(sk, node, &head->chain) { |
| 77 | /* For IPV6 do the cheaper port and family tests first. */ | 77 | /* For IPV6 do the cheaper port and family tests first. */ |
| 78 | if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) | 78 | if (INET6_MATCH(sk, hash, saddr, daddr, ports, dif)) |
| @@ -92,12 +92,12 @@ struct sock *__inet6_lookup_established(struct inet_hashinfo *hashinfo, | |||
| 92 | goto hit; | 92 | goto hit; |
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | read_unlock(&head->lock); | 95 | read_unlock(lock); |
| 96 | return NULL; | 96 | return NULL; |
| 97 | 97 | ||
| 98 | hit: | 98 | hit: |
| 99 | sock_hold(sk); | 99 | sock_hold(sk); |
| 100 | read_unlock(&head->lock); | 100 | read_unlock(lock); |
| 101 | return sk; | 101 | return sk; |
| 102 | } | 102 | } |
| 103 | EXPORT_SYMBOL(__inet6_lookup_established); | 103 | EXPORT_SYMBOL(__inet6_lookup_established); |
| @@ -175,12 +175,13 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row, | |||
| 175 | const unsigned int hash = inet6_ehashfn(daddr, lport, saddr, | 175 | const unsigned int hash = inet6_ehashfn(daddr, lport, saddr, |
| 176 | inet->dport); | 176 | inet->dport); |
| 177 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); | 177 | struct inet_ehash_bucket *head = inet_ehash_bucket(hinfo, hash); |
| 178 | rwlock_t *lock = inet_ehash_lockp(hinfo, hash); | ||
| 178 | struct sock *sk2; | 179 | struct sock *sk2; |
| 179 | const struct hlist_node *node; | 180 | const struct hlist_node *node; |
| 180 | struct inet_timewait_sock *tw; | 181 | struct inet_timewait_sock *tw; |
| 181 | 182 | ||
| 182 | prefetch(head->chain.first); | 183 | prefetch(head->chain.first); |
| 183 | write_lock(&head->lock); | 184 | write_lock(lock); |
| 184 | 185 | ||
| 185 | /* Check TIME-WAIT sockets first. */ | 186 | /* Check TIME-WAIT sockets first. */ |
| 186 | sk_for_each(sk2, node, &head->twchain) { | 187 | sk_for_each(sk2, node, &head->twchain) { |
| @@ -216,7 +217,7 @@ unique: | |||
| 216 | __sk_add_node(sk, &head->chain); | 217 | __sk_add_node(sk, &head->chain); |
| 217 | sk->sk_hash = hash; | 218 | sk->sk_hash = hash; |
| 218 | sock_prot_inc_use(sk->sk_prot); | 219 | sock_prot_inc_use(sk->sk_prot); |
| 219 | write_unlock(&head->lock); | 220 | write_unlock(lock); |
| 220 | 221 | ||
| 221 | if (twp != NULL) { | 222 | if (twp != NULL) { |
| 222 | *twp = tw; | 223 | *twp = tw; |
| @@ -231,7 +232,7 @@ unique: | |||
| 231 | return 0; | 232 | return 0; |
| 232 | 233 | ||
| 233 | not_unique: | 234 | not_unique: |
| 234 | write_unlock(&head->lock); | 235 | write_unlock(lock); |
| 235 | return -EADDRNOTAVAIL; | 236 | return -EADDRNOTAVAIL; |
| 236 | } | 237 | } |
| 237 | 238 | ||
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 653fc0a8235b..86e1835ce4e4 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
| @@ -1339,6 +1339,19 @@ error: | |||
| 1339 | return err; | 1339 | return err; |
| 1340 | } | 1340 | } |
| 1341 | 1341 | ||
| 1342 | static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np) | ||
| 1343 | { | ||
| 1344 | inet->cork.flags &= ~IPCORK_OPT; | ||
| 1345 | kfree(np->cork.opt); | ||
| 1346 | np->cork.opt = NULL; | ||
| 1347 | if (np->cork.rt) { | ||
| 1348 | dst_release(&np->cork.rt->u.dst); | ||
| 1349 | np->cork.rt = NULL; | ||
| 1350 | inet->cork.flags &= ~IPCORK_ALLFRAG; | ||
| 1351 | } | ||
| 1352 | memset(&inet->cork.fl, 0, sizeof(inet->cork.fl)); | ||
| 1353 | } | ||
| 1354 | |||
| 1342 | int ip6_push_pending_frames(struct sock *sk) | 1355 | int ip6_push_pending_frames(struct sock *sk) |
| 1343 | { | 1356 | { |
| 1344 | struct sk_buff *skb, *tmp_skb; | 1357 | struct sk_buff *skb, *tmp_skb; |
| @@ -1415,15 +1428,7 @@ int ip6_push_pending_frames(struct sock *sk) | |||
| 1415 | } | 1428 | } |
| 1416 | 1429 | ||
| 1417 | out: | 1430 | out: |
| 1418 | inet->cork.flags &= ~IPCORK_OPT; | 1431 | ip6_cork_release(inet, np); |
| 1419 | kfree(np->cork.opt); | ||
| 1420 | np->cork.opt = NULL; | ||
| 1421 | if (np->cork.rt) { | ||
| 1422 | dst_release(&np->cork.rt->u.dst); | ||
| 1423 | np->cork.rt = NULL; | ||
| 1424 | inet->cork.flags &= ~IPCORK_ALLFRAG; | ||
| 1425 | } | ||
| 1426 | memset(&inet->cork.fl, 0, sizeof(inet->cork.fl)); | ||
| 1427 | return err; | 1432 | return err; |
| 1428 | error: | 1433 | error: |
| 1429 | goto out; | 1434 | goto out; |
| @@ -1431,8 +1436,6 @@ error: | |||
| 1431 | 1436 | ||
| 1432 | void ip6_flush_pending_frames(struct sock *sk) | 1437 | void ip6_flush_pending_frames(struct sock *sk) |
| 1433 | { | 1438 | { |
| 1434 | struct inet_sock *inet = inet_sk(sk); | ||
| 1435 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
| 1436 | struct sk_buff *skb; | 1439 | struct sk_buff *skb; |
| 1437 | 1440 | ||
| 1438 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { | 1441 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { |
| @@ -1442,14 +1445,5 @@ void ip6_flush_pending_frames(struct sock *sk) | |||
| 1442 | kfree_skb(skb); | 1445 | kfree_skb(skb); |
| 1443 | } | 1446 | } |
| 1444 | 1447 | ||
| 1445 | inet->cork.flags &= ~IPCORK_OPT; | 1448 | ip6_cork_release(inet_sk(sk), inet6_sk(sk)); |
| 1446 | |||
| 1447 | kfree(np->cork.opt); | ||
| 1448 | np->cork.opt = NULL; | ||
| 1449 | if (np->cork.rt) { | ||
| 1450 | dst_release(&np->cork.rt->u.dst); | ||
| 1451 | np->cork.rt = NULL; | ||
| 1452 | inet->cork.flags &= ~IPCORK_ALLFRAG; | ||
| 1453 | } | ||
| 1454 | memset(&inet->cork.fl, 0, sizeof(inet->cork.fl)); | ||
| 1455 | } | 1449 | } |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 85eb4798d8d2..0cd4056f9127 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <net/ipcomp.h> | 36 | #include <net/ipcomp.h> |
| 37 | #include <asm/semaphore.h> | 37 | #include <asm/semaphore.h> |
| 38 | #include <linux/crypto.h> | 38 | #include <linux/crypto.h> |
| 39 | #include <linux/err.h> | ||
| 39 | #include <linux/pfkeyv2.h> | 40 | #include <linux/pfkeyv2.h> |
| 40 | #include <linux/random.h> | 41 | #include <linux/random.h> |
| 41 | #include <linux/percpu.h> | 42 | #include <linux/percpu.h> |
| @@ -358,7 +359,7 @@ static struct crypto_comp **ipcomp6_alloc_tfms(const char *alg_name) | |||
| 358 | for_each_possible_cpu(cpu) { | 359 | for_each_possible_cpu(cpu) { |
| 359 | struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0, | 360 | struct crypto_comp *tfm = crypto_alloc_comp(alg_name, 0, |
| 360 | CRYPTO_ALG_ASYNC); | 361 | CRYPTO_ALG_ASYNC); |
| 361 | if (!tfm) | 362 | if (IS_ERR(tfm)) |
| 362 | goto error; | 363 | goto error; |
| 363 | *per_cpu_ptr(tfms, cpu) = tfm; | 364 | *per_cpu_ptr(tfms, cpu) = tfm; |
| 364 | } | 365 | } |
diff --git a/net/ipv6/netfilter/Makefile b/net/ipv6/netfilter/Makefile index 4513eab77397..e789ec44d23b 100644 --- a/net/ipv6/netfilter/Makefile +++ b/net/ipv6/netfilter/Makefile | |||
| @@ -4,25 +4,29 @@ | |||
| 4 | 4 | ||
| 5 | # Link order matters here. | 5 | # Link order matters here. |
| 6 | obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o | 6 | obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o |
| 7 | obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o | ||
| 8 | obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o | ||
| 9 | obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o | ||
| 10 | obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o | ||
| 11 | obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o | ||
| 12 | obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o | ||
| 13 | obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o | ||
| 14 | obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o | 7 | obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o |
| 15 | obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o | 8 | obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o |
| 16 | obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o | ||
| 17 | obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o | 9 | obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o |
| 18 | obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o | ||
| 19 | obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o | 10 | obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o |
| 20 | obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o | ||
| 21 | obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o | ||
| 22 | obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o | ||
| 23 | 11 | ||
| 24 | # objects for l3 independent conntrack | 12 | # objects for l3 independent conntrack |
| 25 | nf_conntrack_ipv6-objs := nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o | 13 | nf_conntrack_ipv6-objs := nf_conntrack_l3proto_ipv6.o nf_conntrack_proto_icmpv6.o nf_conntrack_reasm.o |
| 26 | 14 | ||
| 27 | # l3 independent conntrack | 15 | # l3 independent conntrack |
| 28 | obj-$(CONFIG_NF_CONNTRACK_IPV6) += nf_conntrack_ipv6.o | 16 | obj-$(CONFIG_NF_CONNTRACK_IPV6) += nf_conntrack_ipv6.o |
| 17 | |||
| 18 | # matches | ||
| 19 | obj-$(CONFIG_IP6_NF_MATCH_AH) += ip6t_ah.o | ||
| 20 | obj-$(CONFIG_IP6_NF_MATCH_EUI64) += ip6t_eui64.o | ||
| 21 | obj-$(CONFIG_IP6_NF_MATCH_FRAG) += ip6t_frag.o | ||
| 22 | obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o | ||
| 23 | obj-$(CONFIG_IP6_NF_MATCH_IPV6HEADER) += ip6t_ipv6header.o | ||
| 24 | obj-$(CONFIG_IP6_NF_MATCH_MH) += ip6t_mh.o | ||
| 25 | obj-$(CONFIG_IP6_NF_MATCH_OPTS) += ip6t_hbh.o | ||
| 26 | obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o | ||
| 27 | obj-$(CONFIG_IP6_NF_MATCH_RT) += ip6t_rt.o | ||
| 28 | |||
| 29 | # targets | ||
| 30 | obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o | ||
| 31 | obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o | ||
| 32 | obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o | ||
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index 6413a30d9f68..e273605eef85 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| 24 | #include <linux/sysctl.h> | 24 | #include <linux/sysctl.h> |
| 25 | #include <linux/proc_fs.h> | 25 | #include <linux/proc_fs.h> |
| 26 | #include <linux/seq_file.h> | ||
| 26 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 27 | #include <net/net_namespace.h> | 28 | #include <net/net_namespace.h> |
| 28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| @@ -596,15 +597,11 @@ static ctl_table ipq_root_table[] = { | |||
| 596 | { .ctl_name = 0 } | 597 | { .ctl_name = 0 } |
| 597 | }; | 598 | }; |
| 598 | 599 | ||
| 599 | #ifdef CONFIG_PROC_FS | 600 | static int ip6_queue_show(struct seq_file *m, void *v) |
| 600 | static int | ||
| 601 | ipq_get_info(char *buffer, char **start, off_t offset, int length) | ||
| 602 | { | 601 | { |
| 603 | int len; | ||
| 604 | |||
| 605 | read_lock_bh(&queue_lock); | 602 | read_lock_bh(&queue_lock); |
| 606 | 603 | ||
| 607 | len = sprintf(buffer, | 604 | seq_printf(m, |
| 608 | "Peer PID : %d\n" | 605 | "Peer PID : %d\n" |
| 609 | "Copy mode : %hu\n" | 606 | "Copy mode : %hu\n" |
| 610 | "Copy range : %u\n" | 607 | "Copy range : %u\n" |
| @@ -621,16 +618,21 @@ ipq_get_info(char *buffer, char **start, off_t offset, int length) | |||
| 621 | queue_user_dropped); | 618 | queue_user_dropped); |
| 622 | 619 | ||
| 623 | read_unlock_bh(&queue_lock); | 620 | read_unlock_bh(&queue_lock); |
| 621 | return 0; | ||
| 622 | } | ||
| 624 | 623 | ||
| 625 | *start = buffer + offset; | 624 | static int ip6_queue_open(struct inode *inode, struct file *file) |
| 626 | len -= offset; | 625 | { |
| 627 | if (len > length) | 626 | return single_open(file, ip6_queue_show, NULL); |
| 628 | len = length; | ||
| 629 | else if (len < 0) | ||
| 630 | len = 0; | ||
| 631 | return len; | ||
| 632 | } | 627 | } |
| 633 | #endif /* CONFIG_PROC_FS */ | 628 | |
| 629 | static const struct file_operations ip6_queue_proc_fops = { | ||
| 630 | .open = ip6_queue_open, | ||
| 631 | .read = seq_read, | ||
| 632 | .llseek = seq_lseek, | ||
| 633 | .release = single_release, | ||
| 634 | .owner = THIS_MODULE, | ||
| 635 | }; | ||
| 634 | 636 | ||
| 635 | static struct nf_queue_handler nfqh = { | 637 | static struct nf_queue_handler nfqh = { |
| 636 | .name = "ip6_queue", | 638 | .name = "ip6_queue", |
| @@ -650,10 +652,11 @@ static int __init ip6_queue_init(void) | |||
| 650 | goto cleanup_netlink_notifier; | 652 | goto cleanup_netlink_notifier; |
| 651 | } | 653 | } |
| 652 | 654 | ||
| 653 | proc = proc_net_create(&init_net, IPQ_PROC_FS_NAME, 0, ipq_get_info); | 655 | proc = create_proc_entry(IPQ_PROC_FS_NAME, 0, init_net.proc_net); |
| 654 | if (proc) | 656 | if (proc) { |
| 655 | proc->owner = THIS_MODULE; | 657 | proc->owner = THIS_MODULE; |
| 656 | else { | 658 | proc->proc_fops = &ip6_queue_proc_fops; |
| 659 | } else { | ||
| 657 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); | 660 | printk(KERN_ERR "ip6_queue: failed to create proc entry\n"); |
| 658 | goto cleanup_ipqnl; | 661 | goto cleanup_ipqnl; |
| 659 | } | 662 | } |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index be526ad92543..8631ed7fe8a9 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
| @@ -32,27 +32,16 @@ | |||
| 32 | 32 | ||
| 33 | static struct proc_dir_entry *proc_net_devsnmp6; | 33 | static struct proc_dir_entry *proc_net_devsnmp6; |
| 34 | 34 | ||
| 35 | static int fold_prot_inuse(struct proto *proto) | ||
| 36 | { | ||
| 37 | int res = 0; | ||
| 38 | int cpu; | ||
| 39 | |||
| 40 | for_each_possible_cpu(cpu) | ||
| 41 | res += proto->stats[cpu].inuse; | ||
| 42 | |||
| 43 | return res; | ||
| 44 | } | ||
| 45 | |||
| 46 | static int sockstat6_seq_show(struct seq_file *seq, void *v) | 35 | static int sockstat6_seq_show(struct seq_file *seq, void *v) |
| 47 | { | 36 | { |
| 48 | seq_printf(seq, "TCP6: inuse %d\n", | 37 | seq_printf(seq, "TCP6: inuse %d\n", |
| 49 | fold_prot_inuse(&tcpv6_prot)); | 38 | sock_prot_inuse(&tcpv6_prot)); |
| 50 | seq_printf(seq, "UDP6: inuse %d\n", | 39 | seq_printf(seq, "UDP6: inuse %d\n", |
| 51 | fold_prot_inuse(&udpv6_prot)); | 40 | sock_prot_inuse(&udpv6_prot)); |
| 52 | seq_printf(seq, "UDPLITE6: inuse %d\n", | 41 | seq_printf(seq, "UDPLITE6: inuse %d\n", |
| 53 | fold_prot_inuse(&udplitev6_prot)); | 42 | sock_prot_inuse(&udplitev6_prot)); |
| 54 | seq_printf(seq, "RAW6: inuse %d\n", | 43 | seq_printf(seq, "RAW6: inuse %d\n", |
| 55 | fold_prot_inuse(&rawv6_prot)); | 44 | sock_prot_inuse(&rawv6_prot)); |
| 56 | seq_printf(seq, "FRAG6: inuse %d memory %d\n", | 45 | seq_printf(seq, "FRAG6: inuse %d memory %d\n", |
| 57 | ip6_frag_nqueues(), ip6_frag_mem()); | 46 | ip6_frag_nqueues(), ip6_frag_mem()); |
| 58 | return 0; | 47 | return 0; |
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index ca24ef19cd8f..807260d03586 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
| @@ -1144,6 +1144,8 @@ static int rawv6_init_sk(struct sock *sk) | |||
| 1144 | return(0); | 1144 | return(0); |
| 1145 | } | 1145 | } |
| 1146 | 1146 | ||
| 1147 | DEFINE_PROTO_INUSE(rawv6) | ||
| 1148 | |||
| 1147 | struct proto rawv6_prot = { | 1149 | struct proto rawv6_prot = { |
| 1148 | .name = "RAWv6", | 1150 | .name = "RAWv6", |
| 1149 | .owner = THIS_MODULE, | 1151 | .owner = THIS_MODULE, |
| @@ -1166,6 +1168,7 @@ struct proto rawv6_prot = { | |||
| 1166 | .compat_setsockopt = compat_rawv6_setsockopt, | 1168 | .compat_setsockopt = compat_rawv6_setsockopt, |
| 1167 | .compat_getsockopt = compat_rawv6_getsockopt, | 1169 | .compat_getsockopt = compat_rawv6_getsockopt, |
| 1168 | #endif | 1170 | #endif |
| 1171 | REF_PROTO_INUSE(rawv6) | ||
| 1169 | }; | 1172 | }; |
| 1170 | 1173 | ||
| 1171 | #ifdef CONFIG_PROC_FS | 1174 | #ifdef CONFIG_PROC_FS |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 95f8e4a62f68..6ecb5e6fae2e 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -38,12 +38,8 @@ | |||
| 38 | #include <linux/in6.h> | 38 | #include <linux/in6.h> |
| 39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
| 40 | #include <linux/if_arp.h> | 40 | #include <linux/if_arp.h> |
| 41 | |||
| 42 | #ifdef CONFIG_PROC_FS | ||
| 43 | #include <linux/proc_fs.h> | 41 | #include <linux/proc_fs.h> |
| 44 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
| 45 | #endif | ||
| 46 | |||
| 47 | #include <net/net_namespace.h> | 43 | #include <net/net_namespace.h> |
| 48 | #include <net/snmp.h> | 44 | #include <net/snmp.h> |
| 49 | #include <net/ipv6.h> | 45 | #include <net/ipv6.h> |
| @@ -548,12 +544,8 @@ restart: | |||
| 548 | rt = rt6_device_match(rt, fl->oif, flags); | 544 | rt = rt6_device_match(rt, fl->oif, flags); |
| 549 | BACKTRACK(&fl->fl6_src); | 545 | BACKTRACK(&fl->fl6_src); |
| 550 | out: | 546 | out: |
| 551 | dst_hold(&rt->u.dst); | 547 | dst_use(&rt->u.dst, jiffies); |
| 552 | read_unlock_bh(&table->tb6_lock); | 548 | read_unlock_bh(&table->tb6_lock); |
| 553 | |||
| 554 | rt->u.dst.lastuse = jiffies; | ||
| 555 | rt->u.dst.__use++; | ||
| 556 | |||
| 557 | return rt; | 549 | return rt; |
| 558 | 550 | ||
| 559 | } | 551 | } |
| @@ -2288,71 +2280,50 @@ struct rt6_proc_arg | |||
| 2288 | 2280 | ||
| 2289 | static int rt6_info_route(struct rt6_info *rt, void *p_arg) | 2281 | static int rt6_info_route(struct rt6_info *rt, void *p_arg) |
| 2290 | { | 2282 | { |
| 2291 | struct rt6_proc_arg *arg = (struct rt6_proc_arg *) p_arg; | 2283 | struct seq_file *m = p_arg; |
| 2292 | |||
| 2293 | if (arg->skip < arg->offset / RT6_INFO_LEN) { | ||
| 2294 | arg->skip++; | ||
| 2295 | return 0; | ||
| 2296 | } | ||
| 2297 | |||
| 2298 | if (arg->len >= arg->length) | ||
| 2299 | return 0; | ||
| 2300 | 2284 | ||
| 2301 | arg->len += sprintf(arg->buffer + arg->len, | 2285 | seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_dst.addr), |
| 2302 | NIP6_SEQFMT " %02x ", | 2286 | rt->rt6i_dst.plen); |
| 2303 | NIP6(rt->rt6i_dst.addr), | ||
| 2304 | rt->rt6i_dst.plen); | ||
| 2305 | 2287 | ||
| 2306 | #ifdef CONFIG_IPV6_SUBTREES | 2288 | #ifdef CONFIG_IPV6_SUBTREES |
| 2307 | arg->len += sprintf(arg->buffer + arg->len, | 2289 | seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_src.addr), |
| 2308 | NIP6_SEQFMT " %02x ", | 2290 | rt->rt6i_src.plen); |
| 2309 | NIP6(rt->rt6i_src.addr), | ||
| 2310 | rt->rt6i_src.plen); | ||
| 2311 | #else | 2291 | #else |
| 2312 | arg->len += sprintf(arg->buffer + arg->len, | 2292 | seq_puts(m, "00000000000000000000000000000000 00 "); |
| 2313 | "00000000000000000000000000000000 00 "); | ||
| 2314 | #endif | 2293 | #endif |
| 2315 | 2294 | ||
| 2316 | if (rt->rt6i_nexthop) { | 2295 | if (rt->rt6i_nexthop) { |
| 2317 | arg->len += sprintf(arg->buffer + arg->len, | 2296 | seq_printf(m, NIP6_SEQFMT, |
| 2318 | NIP6_SEQFMT, | 2297 | NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key))); |
| 2319 | NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key))); | ||
| 2320 | } else { | 2298 | } else { |
| 2321 | arg->len += sprintf(arg->buffer + arg->len, | 2299 | seq_puts(m, "00000000000000000000000000000000"); |
| 2322 | "00000000000000000000000000000000"); | ||
| 2323 | } | 2300 | } |
| 2324 | arg->len += sprintf(arg->buffer + arg->len, | 2301 | seq_printf(m, " %08x %08x %08x %08x %8s\n", |
| 2325 | " %08x %08x %08x %08x %8s\n", | 2302 | rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt), |
| 2326 | rt->rt6i_metric, atomic_read(&rt->u.dst.__refcnt), | 2303 | rt->u.dst.__use, rt->rt6i_flags, |
| 2327 | rt->u.dst.__use, rt->rt6i_flags, | 2304 | rt->rt6i_dev ? rt->rt6i_dev->name : ""); |
| 2328 | rt->rt6i_dev ? rt->rt6i_dev->name : ""); | ||
| 2329 | return 0; | 2305 | return 0; |
| 2330 | } | 2306 | } |
| 2331 | 2307 | ||
| 2332 | static int rt6_proc_info(char *buffer, char **start, off_t offset, int length) | 2308 | static int ipv6_route_show(struct seq_file *m, void *v) |
| 2333 | { | 2309 | { |
| 2334 | struct rt6_proc_arg arg = { | 2310 | fib6_clean_all(rt6_info_route, 0, m); |
| 2335 | .buffer = buffer, | 2311 | return 0; |
| 2336 | .offset = offset, | 2312 | } |
| 2337 | .length = length, | ||
| 2338 | }; | ||
| 2339 | |||
| 2340 | fib6_clean_all(rt6_info_route, 0, &arg); | ||
| 2341 | |||
| 2342 | *start = buffer; | ||
| 2343 | if (offset) | ||
| 2344 | *start += offset % RT6_INFO_LEN; | ||
| 2345 | |||
| 2346 | arg.len -= offset % RT6_INFO_LEN; | ||
| 2347 | |||
| 2348 | if (arg.len > length) | ||
| 2349 | arg.len = length; | ||
| 2350 | if (arg.len < 0) | ||
| 2351 | arg.len = 0; | ||
| 2352 | 2313 | ||
| 2353 | return arg.len; | 2314 | static int ipv6_route_open(struct inode *inode, struct file *file) |
| 2315 | { | ||
| 2316 | return single_open(file, ipv6_route_show, NULL); | ||
| 2354 | } | 2317 | } |
| 2355 | 2318 | ||
| 2319 | static const struct file_operations ipv6_route_proc_fops = { | ||
| 2320 | .owner = THIS_MODULE, | ||
| 2321 | .open = ipv6_route_open, | ||
| 2322 | .read = seq_read, | ||
| 2323 | .llseek = seq_lseek, | ||
| 2324 | .release = single_release, | ||
| 2325 | }; | ||
| 2326 | |||
| 2356 | static int rt6_stats_seq_show(struct seq_file *seq, void *v) | 2327 | static int rt6_stats_seq_show(struct seq_file *seq, void *v) |
| 2357 | { | 2328 | { |
| 2358 | seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n", | 2329 | seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n", |
| @@ -2489,22 +2460,14 @@ ctl_table ipv6_route_table[] = { | |||
| 2489 | 2460 | ||
| 2490 | void __init ip6_route_init(void) | 2461 | void __init ip6_route_init(void) |
| 2491 | { | 2462 | { |
| 2492 | #ifdef CONFIG_PROC_FS | ||
| 2493 | struct proc_dir_entry *p; | ||
| 2494 | #endif | ||
| 2495 | ip6_dst_ops.kmem_cachep = | 2463 | ip6_dst_ops.kmem_cachep = |
| 2496 | kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0, | 2464 | kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0, |
| 2497 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); | 2465 | SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); |
| 2498 | ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops.kmem_cachep; | 2466 | ip6_dst_blackhole_ops.kmem_cachep = ip6_dst_ops.kmem_cachep; |
| 2499 | 2467 | ||
| 2500 | fib6_init(); | 2468 | fib6_init(); |
| 2501 | #ifdef CONFIG_PROC_FS | 2469 | proc_net_fops_create(&init_net, "ipv6_route", 0, &ipv6_route_proc_fops); |
| 2502 | p = proc_net_create(&init_net, "ipv6_route", 0, rt6_proc_info); | ||
| 2503 | if (p) | ||
| 2504 | p->owner = THIS_MODULE; | ||
| 2505 | |||
| 2506 | proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); | 2470 | proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops); |
| 2507 | #endif | ||
| 2508 | #ifdef CONFIG_XFRM | 2471 | #ifdef CONFIG_XFRM |
| 2509 | xfrm6_init(); | 2472 | xfrm6_init(); |
| 2510 | #endif | 2473 | #endif |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 06be2a1f2730..3aad861975a0 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
| @@ -2107,6 +2107,8 @@ void tcp6_proc_exit(void) | |||
| 2107 | } | 2107 | } |
| 2108 | #endif | 2108 | #endif |
| 2109 | 2109 | ||
| 2110 | DEFINE_PROTO_INUSE(tcpv6) | ||
| 2111 | |||
| 2110 | struct proto tcpv6_prot = { | 2112 | struct proto tcpv6_prot = { |
| 2111 | .name = "TCPv6", | 2113 | .name = "TCPv6", |
| 2112 | .owner = THIS_MODULE, | 2114 | .owner = THIS_MODULE, |
| @@ -2141,6 +2143,7 @@ struct proto tcpv6_prot = { | |||
| 2141 | .compat_setsockopt = compat_tcp_setsockopt, | 2143 | .compat_setsockopt = compat_tcp_setsockopt, |
| 2142 | .compat_getsockopt = compat_tcp_getsockopt, | 2144 | .compat_getsockopt = compat_tcp_getsockopt, |
| 2143 | #endif | 2145 | #endif |
| 2146 | REF_PROTO_INUSE(tcpv6) | ||
| 2144 | }; | 2147 | }; |
| 2145 | 2148 | ||
| 2146 | static struct inet6_protocol tcpv6_protocol = { | 2149 | static struct inet6_protocol tcpv6_protocol = { |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index caebad6ee510..ee1cc3f8599f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
| @@ -205,12 +205,11 @@ out: | |||
| 205 | return err; | 205 | return err; |
| 206 | 206 | ||
| 207 | csum_copy_err: | 207 | csum_copy_err: |
| 208 | UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite); | ||
| 208 | skb_kill_datagram(sk, skb, flags); | 209 | skb_kill_datagram(sk, skb, flags); |
| 209 | 210 | ||
| 210 | if (flags & MSG_DONTWAIT) { | 211 | if (flags & MSG_DONTWAIT) |
| 211 | UDP6_INC_STATS_USER(UDP_MIB_INERRORS, is_udplite); | ||
| 212 | return -EAGAIN; | 212 | return -EAGAIN; |
| 213 | } | ||
| 214 | goto try_again; | 213 | goto try_again; |
| 215 | } | 214 | } |
| 216 | 215 | ||
| @@ -971,6 +970,8 @@ void udp6_proc_exit(void) { | |||
| 971 | 970 | ||
| 972 | /* ------------------------------------------------------------------------ */ | 971 | /* ------------------------------------------------------------------------ */ |
| 973 | 972 | ||
| 973 | DEFINE_PROTO_INUSE(udpv6) | ||
| 974 | |||
| 974 | struct proto udpv6_prot = { | 975 | struct proto udpv6_prot = { |
| 975 | .name = "UDPv6", | 976 | .name = "UDPv6", |
| 976 | .owner = THIS_MODULE, | 977 | .owner = THIS_MODULE, |
| @@ -992,6 +993,7 @@ struct proto udpv6_prot = { | |||
| 992 | .compat_setsockopt = compat_udpv6_setsockopt, | 993 | .compat_setsockopt = compat_udpv6_setsockopt, |
| 993 | .compat_getsockopt = compat_udpv6_getsockopt, | 994 | .compat_getsockopt = compat_udpv6_getsockopt, |
| 994 | #endif | 995 | #endif |
| 996 | REF_PROTO_INUSE(udpv6) | ||
| 995 | }; | 997 | }; |
| 996 | 998 | ||
| 997 | static struct inet_protosw udpv6_protosw = { | 999 | static struct inet_protosw udpv6_protosw = { |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 766566f7de47..5a0379f71415 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
| @@ -40,6 +40,8 @@ static int udplite_v6_get_port(struct sock *sk, unsigned short snum) | |||
| 40 | return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal); | 40 | return udplite_get_port(sk, snum, ipv6_rcv_saddr_equal); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | DEFINE_PROTO_INUSE(udplitev6) | ||
| 44 | |||
| 43 | struct proto udplitev6_prot = { | 45 | struct proto udplitev6_prot = { |
| 44 | .name = "UDPLITEv6", | 46 | .name = "UDPLITEv6", |
| 45 | .owner = THIS_MODULE, | 47 | .owner = THIS_MODULE, |
| @@ -62,6 +64,7 @@ struct proto udplitev6_prot = { | |||
| 62 | .compat_setsockopt = compat_udpv6_setsockopt, | 64 | .compat_setsockopt = compat_udpv6_setsockopt, |
| 63 | .compat_getsockopt = compat_udpv6_getsockopt, | 65 | .compat_getsockopt = compat_udpv6_getsockopt, |
| 64 | #endif | 66 | #endif |
| 67 | REF_PROTO_INUSE(udplitev6) | ||
| 65 | }; | 68 | }; |
| 66 | 69 | ||
| 67 | static struct inet_protosw udplite6_protosw = { | 70 | static struct inet_protosw udplite6_protosw = { |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index a195a66e0cc7..c76a9523091b 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
| @@ -92,11 +92,6 @@ extern int ipxrtr_route_skb(struct sk_buff *skb); | |||
| 92 | extern struct ipx_route *ipxrtr_lookup(__be32 net); | 92 | extern struct ipx_route *ipxrtr_lookup(__be32 net); |
| 93 | extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg); | 93 | extern int ipxrtr_ioctl(unsigned int cmd, void __user *arg); |
| 94 | 94 | ||
| 95 | #undef IPX_REFCNT_DEBUG | ||
| 96 | #ifdef IPX_REFCNT_DEBUG | ||
| 97 | atomic_t ipx_sock_nr; | ||
| 98 | #endif | ||
| 99 | |||
| 100 | struct ipx_interface *ipx_interfaces_head(void) | 95 | struct ipx_interface *ipx_interfaces_head(void) |
| 101 | { | 96 | { |
| 102 | struct ipx_interface *rc = NULL; | 97 | struct ipx_interface *rc = NULL; |
| @@ -151,14 +146,7 @@ static void ipx_destroy_socket(struct sock *sk) | |||
| 151 | { | 146 | { |
| 152 | ipx_remove_socket(sk); | 147 | ipx_remove_socket(sk); |
| 153 | skb_queue_purge(&sk->sk_receive_queue); | 148 | skb_queue_purge(&sk->sk_receive_queue); |
| 154 | #ifdef IPX_REFCNT_DEBUG | 149 | sk_refcnt_debug_dec(sk); |
| 155 | atomic_dec(&ipx_sock_nr); | ||
| 156 | printk(KERN_DEBUG "IPX socket %p released, %d are still alive\n", sk, | ||
| 157 | atomic_read(&ipx_sock_nr)); | ||
| 158 | if (atomic_read(&sk->sk_refcnt) != 1) | ||
| 159 | printk(KERN_DEBUG "Destruction sock ipx %p delayed, cnt=%d\n", | ||
| 160 | sk, atomic_read(&sk->sk_refcnt)); | ||
| 161 | #endif | ||
| 162 | sock_put(sk); | 150 | sock_put(sk); |
| 163 | } | 151 | } |
| 164 | 152 | ||
| @@ -1384,11 +1372,8 @@ static int ipx_create(struct net *net, struct socket *sock, int protocol) | |||
| 1384 | sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto); | 1372 | sk = sk_alloc(net, PF_IPX, GFP_KERNEL, &ipx_proto); |
| 1385 | if (!sk) | 1373 | if (!sk) |
| 1386 | goto out; | 1374 | goto out; |
| 1387 | #ifdef IPX_REFCNT_DEBUG | 1375 | |
| 1388 | atomic_inc(&ipx_sock_nr); | 1376 | sk_refcnt_debug_inc(sk); |
| 1389 | printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk, | ||
| 1390 | atomic_read(&ipx_sock_nr)); | ||
| 1391 | #endif | ||
| 1392 | sock_init_data(sock, sk); | 1377 | sock_init_data(sock, sk); |
| 1393 | sk->sk_no_check = 1; /* Checksum off by default */ | 1378 | sk->sk_no_check = 1; /* Checksum off by default */ |
| 1394 | sock->ops = &ipx_dgram_ops; | 1379 | sock->ops = &ipx_dgram_ops; |
| @@ -1409,6 +1394,7 @@ static int ipx_release(struct socket *sock) | |||
| 1409 | 1394 | ||
| 1410 | sock_set_flag(sk, SOCK_DEAD); | 1395 | sock_set_flag(sk, SOCK_DEAD); |
| 1411 | sock->sk = NULL; | 1396 | sock->sk = NULL; |
| 1397 | sk_refcnt_debug_release(sk); | ||
| 1412 | ipx_destroy_socket(sk); | 1398 | ipx_destroy_socket(sk); |
| 1413 | out: | 1399 | out: |
| 1414 | return 0; | 1400 | return 0; |
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 6fffb3845ab6..ce176e691afe 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
| @@ -13,6 +13,18 @@ config MAC80211 | |||
| 13 | This option enables the hardware independent IEEE 802.11 | 13 | This option enables the hardware independent IEEE 802.11 |
| 14 | networking stack. | 14 | networking stack. |
| 15 | 15 | ||
| 16 | config MAC80211_RCSIMPLE | ||
| 17 | bool "'simple' rate control algorithm" if EMBEDDED | ||
| 18 | default y | ||
| 19 | depends on MAC80211 | ||
| 20 | help | ||
| 21 | This option allows you to turn off the 'simple' rate | ||
| 22 | control algorithm in mac80211. If you do turn it off, | ||
| 23 | you absolutely need another rate control algorithm. | ||
| 24 | |||
| 25 | Say Y unless you know you will have another algorithm | ||
| 26 | available. | ||
| 27 | |||
| 16 | config MAC80211_LEDS | 28 | config MAC80211_LEDS |
| 17 | bool "Enable LED triggers" | 29 | bool "Enable LED triggers" |
| 18 | depends on MAC80211 && LEDS_TRIGGERS | 30 | depends on MAC80211 && LEDS_TRIGGERS |
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile index 219cd9f9341f..1e6237b34846 100644 --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | obj-$(CONFIG_MAC80211) += mac80211.o rc80211_simple.o | 1 | obj-$(CONFIG_MAC80211) += mac80211.o |
| 2 | 2 | ||
| 3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o | 3 | mac80211-objs-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o |
| 4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o | 4 | mac80211-objs-$(CONFIG_MAC80211_DEBUGFS) += debugfs.o debugfs_sta.o debugfs_netdev.o debugfs_key.o |
| 5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o | 5 | mac80211-objs-$(CONFIG_NET_SCHED) += wme.o |
| 6 | mac80211-objs-$(CONFIG_MAC80211_RCSIMPLE) += rc80211_simple.o | ||
| 6 | 7 | ||
| 7 | mac80211-objs := \ | 8 | mac80211-objs := \ |
| 8 | ieee80211.o \ | 9 | ieee80211.o \ |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index f484ca7ade9c..e0ee65a969bc 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
| @@ -1072,7 +1072,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
| 1072 | ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev)); | 1072 | ieee80211_debugfs_add_netdev(IEEE80211_DEV_TO_SUB_IF(local->mdev)); |
| 1073 | ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP); | 1073 | ieee80211_if_set_type(local->mdev, IEEE80211_IF_TYPE_AP); |
| 1074 | 1074 | ||
| 1075 | result = ieee80211_init_rate_ctrl_alg(local, NULL); | 1075 | result = ieee80211_init_rate_ctrl_alg(local, |
| 1076 | hw->rate_control_algorithm); | ||
| 1076 | if (result < 0) { | 1077 | if (result < 0) { |
| 1077 | printk(KERN_DEBUG "%s: Failed to initialize rate control " | 1078 | printk(KERN_DEBUG "%s: Failed to initialize rate control " |
| 1078 | "algorithm\n", wiphy_name(local->hw.wiphy)); | 1079 | "algorithm\n", wiphy_name(local->hw.wiphy)); |
| @@ -1233,8 +1234,17 @@ static int __init ieee80211_init(void) | |||
| 1233 | 1234 | ||
| 1234 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); | 1235 | BUILD_BUG_ON(sizeof(struct ieee80211_tx_packet_data) > sizeof(skb->cb)); |
| 1235 | 1236 | ||
| 1237 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
| 1238 | ret = ieee80211_rate_control_register(&mac80211_rcsimple); | ||
| 1239 | if (ret) | ||
| 1240 | return ret; | ||
| 1241 | #endif | ||
| 1242 | |||
| 1236 | ret = ieee80211_wme_register(); | 1243 | ret = ieee80211_wme_register(); |
| 1237 | if (ret) { | 1244 | if (ret) { |
| 1245 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
| 1246 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | ||
| 1247 | #endif | ||
| 1238 | printk(KERN_DEBUG "ieee80211_init: failed to " | 1248 | printk(KERN_DEBUG "ieee80211_init: failed to " |
| 1239 | "initialize WME (err=%d)\n", ret); | 1249 | "initialize WME (err=%d)\n", ret); |
| 1240 | return ret; | 1250 | return ret; |
| @@ -1248,6 +1258,10 @@ static int __init ieee80211_init(void) | |||
| 1248 | 1258 | ||
| 1249 | static void __exit ieee80211_exit(void) | 1259 | static void __exit ieee80211_exit(void) |
| 1250 | { | 1260 | { |
| 1261 | #ifdef CONFIG_MAC80211_RCSIMPLE | ||
| 1262 | ieee80211_rate_control_unregister(&mac80211_rcsimple); | ||
| 1263 | #endif | ||
| 1264 | |||
| 1251 | ieee80211_wme_unregister(); | 1265 | ieee80211_wme_unregister(); |
| 1252 | ieee80211_debugfs_netdev_exit(); | 1266 | ieee80211_debugfs_netdev_exit(); |
| 1253 | } | 1267 | } |
diff --git a/net/mac80211/ieee80211_common.h b/net/mac80211/ieee80211_common.h deleted file mode 100644 index c15295d43d87..000000000000 --- a/net/mac80211/ieee80211_common.h +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * IEEE 802.11 driver (80211.o) -- hostapd interface | ||
| 3 | * Copyright 2002-2004, Instant802 Networks, Inc. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef IEEE80211_COMMON_H | ||
| 11 | #define IEEE80211_COMMON_H | ||
| 12 | |||
| 13 | #include <linux/types.h> | ||
| 14 | |||
| 15 | /* | ||
| 16 | * This is common header information with user space. It is used on all | ||
| 17 | * frames sent to wlan#ap interface. | ||
| 18 | */ | ||
| 19 | |||
| 20 | #define IEEE80211_FI_VERSION 0x80211001 | ||
| 21 | |||
| 22 | struct ieee80211_frame_info { | ||
| 23 | __be32 version; | ||
| 24 | __be32 length; | ||
| 25 | __be64 mactime; | ||
| 26 | __be64 hosttime; | ||
| 27 | __be32 phytype; | ||
| 28 | __be32 channel; | ||
| 29 | __be32 datarate; | ||
| 30 | __be32 antenna; | ||
| 31 | __be32 priority; | ||
| 32 | __be32 ssi_type; | ||
| 33 | __be32 ssi_signal; | ||
| 34 | __be32 ssi_noise; | ||
| 35 | __be32 preamble; | ||
| 36 | __be32 encoding; | ||
| 37 | |||
| 38 | /* Note: this structure is otherwise identical to capture format used | ||
| 39 | * in linux-wlan-ng, but this additional field is used to provide meta | ||
| 40 | * data about the frame to hostapd. This was the easiest method for | ||
| 41 | * providing this information, but this might change in the future. */ | ||
| 42 | __be32 msg_type; | ||
| 43 | } __attribute__ ((packed)); | ||
| 44 | |||
| 45 | |||
| 46 | enum ieee80211_msg_type { | ||
| 47 | ieee80211_msg_normal = 0, | ||
| 48 | ieee80211_msg_tx_callback_ack = 1, | ||
| 49 | ieee80211_msg_tx_callback_fail = 2, | ||
| 50 | /* hole at 3, was ieee80211_msg_passive_scan but unused */ | ||
| 51 | /* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */ | ||
| 52 | ieee80211_msg_michael_mic_failure = 5, | ||
| 53 | /* hole at 6, was monitor but never sent to userspace */ | ||
| 54 | ieee80211_msg_sta_not_assoc = 7, | ||
| 55 | /* 8 was ieee80211_msg_set_aid_for_sta */ | ||
| 56 | /* 9 was ieee80211_msg_key_threshold_notification */ | ||
| 57 | /* 11 was ieee80211_msg_radar */ | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct ieee80211_msg_key_notification { | ||
| 61 | int tx_rx_count; | ||
| 62 | char ifname[IFNAMSIZ]; | ||
| 63 | u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */ | ||
| 64 | }; | ||
| 65 | |||
| 66 | |||
| 67 | enum ieee80211_phytype { | ||
| 68 | ieee80211_phytype_fhss_dot11_97 = 1, | ||
| 69 | ieee80211_phytype_dsss_dot11_97 = 2, | ||
| 70 | ieee80211_phytype_irbaseband = 3, | ||
| 71 | ieee80211_phytype_dsss_dot11_b = 4, | ||
| 72 | ieee80211_phytype_pbcc_dot11_b = 5, | ||
| 73 | ieee80211_phytype_ofdm_dot11_g = 6, | ||
| 74 | ieee80211_phytype_pbcc_dot11_g = 7, | ||
| 75 | ieee80211_phytype_ofdm_dot11_a = 8, | ||
| 76 | }; | ||
| 77 | |||
| 78 | enum ieee80211_ssi_type { | ||
| 79 | ieee80211_ssi_none = 0, | ||
| 80 | ieee80211_ssi_norm = 1, /* normalized, 0-1000 */ | ||
| 81 | ieee80211_ssi_dbm = 2, | ||
| 82 | ieee80211_ssi_raw = 3, /* raw SSI */ | ||
| 83 | }; | ||
| 84 | |||
| 85 | struct ieee80211_radar_info { | ||
| 86 | int channel; | ||
| 87 | int radar; | ||
| 88 | int radar_type; | ||
| 89 | }; | ||
| 90 | |||
| 91 | #endif /* IEEE80211_COMMON_H */ | ||
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 4b4ed2a5803c..b4e32ab3664d 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
| @@ -230,6 +230,7 @@ struct ieee80211_if_vlan { | |||
| 230 | #define IEEE80211_STA_AUTO_SSID_SEL BIT(10) | 230 | #define IEEE80211_STA_AUTO_SSID_SEL BIT(10) |
| 231 | #define IEEE80211_STA_AUTO_BSSID_SEL BIT(11) | 231 | #define IEEE80211_STA_AUTO_BSSID_SEL BIT(11) |
| 232 | #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) | 232 | #define IEEE80211_STA_AUTO_CHANNEL_SEL BIT(12) |
| 233 | #define IEEE80211_STA_PRIVACY_INVOKED BIT(13) | ||
| 233 | struct ieee80211_if_sta { | 234 | struct ieee80211_if_sta { |
| 234 | enum { | 235 | enum { |
| 235 | IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, | 236 | IEEE80211_DISABLED, IEEE80211_AUTHENTICATE, |
| @@ -259,7 +260,6 @@ struct ieee80211_if_sta { | |||
| 259 | unsigned long request; | 260 | unsigned long request; |
| 260 | struct sk_buff_head skb_queue; | 261 | struct sk_buff_head skb_queue; |
| 261 | 262 | ||
| 262 | int key_management_enabled; | ||
| 263 | unsigned long last_probe; | 263 | unsigned long last_probe; |
| 264 | 264 | ||
| 265 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) | 265 | #define IEEE80211_AUTH_ALG_OPEN BIT(0) |
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 6caa3ec2cff7..7027eed4d4ae 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
| @@ -917,7 +917,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
| 917 | struct iw_request_info *info, | 917 | struct iw_request_info *info, |
| 918 | struct iw_param *data, char *extra) | 918 | struct iw_param *data, char *extra) |
| 919 | { | 919 | { |
| 920 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
| 921 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 920 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
| 922 | int ret = 0; | 921 | int ret = 0; |
| 923 | 922 | ||
| @@ -927,18 +926,21 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
| 927 | case IW_AUTH_CIPHER_GROUP: | 926 | case IW_AUTH_CIPHER_GROUP: |
| 928 | case IW_AUTH_WPA_ENABLED: | 927 | case IW_AUTH_WPA_ENABLED: |
| 929 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: | 928 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: |
| 930 | break; | ||
| 931 | case IW_AUTH_KEY_MGMT: | 929 | case IW_AUTH_KEY_MGMT: |
| 930 | break; | ||
| 931 | case IW_AUTH_PRIVACY_INVOKED: | ||
| 932 | if (sdata->type != IEEE80211_IF_TYPE_STA) | 932 | if (sdata->type != IEEE80211_IF_TYPE_STA) |
| 933 | ret = -EINVAL; | 933 | ret = -EINVAL; |
| 934 | else { | 934 | else { |
| 935 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; | ||
| 935 | /* | 936 | /* |
| 936 | * Key management was set by wpa_supplicant, | 937 | * Privacy invoked by wpa_supplicant, store the |
| 937 | * we only need this to associate to a network | 938 | * value and allow associating to a protected |
| 938 | * that has privacy enabled regardless of not | 939 | * network without having a key up front. |
| 939 | * having a key. | ||
| 940 | */ | 940 | */ |
| 941 | sdata->u.sta.key_management_enabled = !!data->value; | 941 | if (data->value) |
| 942 | sdata->u.sta.flags |= | ||
| 943 | IEEE80211_STA_PRIVACY_INVOKED; | ||
| 942 | } | 944 | } |
| 943 | break; | 945 | break; |
| 944 | case IW_AUTH_80211_AUTH_ALG: | 946 | case IW_AUTH_80211_AUTH_ALG: |
| @@ -948,11 +950,6 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
| 948 | else | 950 | else |
| 949 | ret = -EOPNOTSUPP; | 951 | ret = -EOPNOTSUPP; |
| 950 | break; | 952 | break; |
| 951 | case IW_AUTH_PRIVACY_INVOKED: | ||
| 952 | if (local->ops->set_privacy_invoked) | ||
| 953 | ret = local->ops->set_privacy_invoked( | ||
| 954 | local_to_hw(local), data->value); | ||
| 955 | break; | ||
| 956 | default: | 953 | default: |
| 957 | ret = -EOPNOTSUPP; | 954 | ret = -EOPNOTSUPP; |
| 958 | break; | 955 | break; |
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index 93abb8fff141..7254bd609839 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
| @@ -25,13 +25,25 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops) | |||
| 25 | { | 25 | { |
| 26 | struct rate_control_alg *alg; | 26 | struct rate_control_alg *alg; |
| 27 | 27 | ||
| 28 | if (!ops->name) | ||
| 29 | return -EINVAL; | ||
| 30 | |||
| 31 | mutex_lock(&rate_ctrl_mutex); | ||
| 32 | list_for_each_entry(alg, &rate_ctrl_algs, list) { | ||
| 33 | if (!strcmp(alg->ops->name, ops->name)) { | ||
| 34 | /* don't register an algorithm twice */ | ||
| 35 | WARN_ON(1); | ||
| 36 | return -EALREADY; | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 28 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); | 40 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); |
| 29 | if (alg == NULL) { | 41 | if (alg == NULL) { |
| 42 | mutex_unlock(&rate_ctrl_mutex); | ||
| 30 | return -ENOMEM; | 43 | return -ENOMEM; |
| 31 | } | 44 | } |
| 32 | alg->ops = ops; | 45 | alg->ops = ops; |
| 33 | 46 | ||
| 34 | mutex_lock(&rate_ctrl_mutex); | ||
| 35 | list_add_tail(&alg->list, &rate_ctrl_algs); | 47 | list_add_tail(&alg->list, &rate_ctrl_algs); |
| 36 | mutex_unlock(&rate_ctrl_mutex); | 48 | mutex_unlock(&rate_ctrl_mutex); |
| 37 | 49 | ||
| @@ -61,9 +73,12 @@ ieee80211_try_rate_control_ops_get(const char *name) | |||
| 61 | struct rate_control_alg *alg; | 73 | struct rate_control_alg *alg; |
| 62 | struct rate_control_ops *ops = NULL; | 74 | struct rate_control_ops *ops = NULL; |
| 63 | 75 | ||
| 76 | if (!name) | ||
| 77 | return NULL; | ||
| 78 | |||
| 64 | mutex_lock(&rate_ctrl_mutex); | 79 | mutex_lock(&rate_ctrl_mutex); |
| 65 | list_for_each_entry(alg, &rate_ctrl_algs, list) { | 80 | list_for_each_entry(alg, &rate_ctrl_algs, list) { |
| 66 | if (!name || !strcmp(alg->ops->name, name)) | 81 | if (!strcmp(alg->ops->name, name)) |
| 67 | if (try_module_get(alg->ops->module)) { | 82 | if (try_module_get(alg->ops->module)) { |
| 68 | ops = alg->ops; | 83 | ops = alg->ops; |
| 69 | break; | 84 | break; |
| @@ -80,9 +95,12 @@ ieee80211_rate_control_ops_get(const char *name) | |||
| 80 | { | 95 | { |
| 81 | struct rate_control_ops *ops; | 96 | struct rate_control_ops *ops; |
| 82 | 97 | ||
| 98 | if (!name) | ||
| 99 | name = "simple"; | ||
| 100 | |||
| 83 | ops = ieee80211_try_rate_control_ops_get(name); | 101 | ops = ieee80211_try_rate_control_ops_get(name); |
| 84 | if (!ops) { | 102 | if (!ops) { |
| 85 | request_module("rc80211_%s", name ? name : "default"); | 103 | request_module("rc80211_%s", name); |
| 86 | ops = ieee80211_try_rate_control_ops_get(name); | 104 | ops = ieee80211_try_rate_control_ops_get(name); |
| 87 | } | 105 | } |
| 88 | return ops; | 106 | return ops; |
diff --git a/net/mac80211/ieee80211_rate.h b/net/mac80211/ieee80211_rate.h index 7cd1ebab4f83..23688139ffb3 100644 --- a/net/mac80211/ieee80211_rate.h +++ b/net/mac80211/ieee80211_rate.h | |||
| @@ -65,6 +65,9 @@ struct rate_control_ref { | |||
| 65 | struct kref kref; | 65 | struct kref kref; |
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | /* default 'simple' algorithm */ | ||
| 69 | extern struct rate_control_ops mac80211_rcsimple; | ||
| 70 | |||
| 68 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 71 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
| 69 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 72 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
| 70 | 73 | ||
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index fda0e06453e8..2079e988fc56 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
| @@ -704,10 +704,11 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
| 704 | { | 704 | { |
| 705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 705 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
| 706 | struct ieee80211_sta_bss *bss; | 706 | struct ieee80211_sta_bss *bss; |
| 707 | int res = 0; | 707 | int bss_privacy; |
| 708 | int wep_privacy; | ||
| 709 | int privacy_invoked; | ||
| 708 | 710 | ||
| 709 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL) || | 711 | if (!ifsta || (ifsta->flags & IEEE80211_STA_MIXED_CELL)) |
| 710 | ifsta->key_management_enabled) | ||
| 711 | return 0; | 712 | return 0; |
| 712 | 713 | ||
| 713 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, | 714 | bss = ieee80211_rx_bss_get(dev, ifsta->bssid, local->hw.conf.channel, |
| @@ -715,13 +716,16 @@ static int ieee80211_privacy_mismatch(struct net_device *dev, | |||
| 715 | if (!bss) | 716 | if (!bss) |
| 716 | return 0; | 717 | return 0; |
| 717 | 718 | ||
| 718 | if (ieee80211_sta_wep_configured(dev) != | 719 | bss_privacy = !!(bss->capability & WLAN_CAPABILITY_PRIVACY); |
| 719 | !!(bss->capability & WLAN_CAPABILITY_PRIVACY)) | 720 | wep_privacy = !!ieee80211_sta_wep_configured(dev); |
| 720 | res = 1; | 721 | privacy_invoked = !!(ifsta->flags & IEEE80211_STA_PRIVACY_INVOKED); |
| 721 | 722 | ||
| 722 | ieee80211_rx_bss_put(dev, bss); | 723 | ieee80211_rx_bss_put(dev, bss); |
| 723 | 724 | ||
| 724 | return res; | 725 | if ((bss_privacy == wep_privacy) || (bss_privacy == privacy_invoked)) |
| 726 | return 0; | ||
| 727 | |||
| 728 | return 1; | ||
| 725 | } | 729 | } |
| 726 | 730 | ||
| 727 | 731 | ||
diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c index 314b8de88862..da72737364e4 100644 --- a/net/mac80211/rc80211_simple.c +++ b/net/mac80211/rc80211_simple.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/module.h> | ||
| 11 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 12 | #include <linux/netdevice.h> | 11 | #include <linux/netdevice.h> |
| 13 | #include <linux/types.h> | 12 | #include <linux/types.h> |
| @@ -29,8 +28,6 @@ | |||
| 29 | #define RATE_CONTROL_INTERVAL (HZ / 20) | 28 | #define RATE_CONTROL_INTERVAL (HZ / 20) |
| 30 | #define RATE_CONTROL_MIN_TX 10 | 29 | #define RATE_CONTROL_MIN_TX 10 |
| 31 | 30 | ||
| 32 | MODULE_ALIAS("rc80211_default"); | ||
| 33 | |||
| 34 | static void rate_control_rate_inc(struct ieee80211_local *local, | 31 | static void rate_control_rate_inc(struct ieee80211_local *local, |
| 35 | struct sta_info *sta) | 32 | struct sta_info *sta) |
| 36 | { | 33 | { |
| @@ -394,8 +391,7 @@ static void rate_control_simple_remove_sta_debugfs(void *priv, void *priv_sta) | |||
| 394 | } | 391 | } |
| 395 | #endif | 392 | #endif |
| 396 | 393 | ||
| 397 | static struct rate_control_ops rate_control_simple = { | 394 | struct rate_control_ops mac80211_rcsimple = { |
| 398 | .module = THIS_MODULE, | ||
| 399 | .name = "simple", | 395 | .name = "simple", |
| 400 | .tx_status = rate_control_simple_tx_status, | 396 | .tx_status = rate_control_simple_tx_status, |
| 401 | .get_rate = rate_control_simple_get_rate, | 397 | .get_rate = rate_control_simple_get_rate, |
| @@ -410,22 +406,3 @@ static struct rate_control_ops rate_control_simple = { | |||
| 410 | .remove_sta_debugfs = rate_control_simple_remove_sta_debugfs, | 406 | .remove_sta_debugfs = rate_control_simple_remove_sta_debugfs, |
| 411 | #endif | 407 | #endif |
| 412 | }; | 408 | }; |
| 413 | |||
| 414 | |||
| 415 | static int __init rate_control_simple_init(void) | ||
| 416 | { | ||
| 417 | return ieee80211_rate_control_register(&rate_control_simple); | ||
| 418 | } | ||
| 419 | |||
| 420 | |||
| 421 | static void __exit rate_control_simple_exit(void) | ||
| 422 | { | ||
| 423 | ieee80211_rate_control_unregister(&rate_control_simple); | ||
| 424 | } | ||
| 425 | |||
| 426 | |||
| 427 | subsys_initcall(rate_control_simple_init); | ||
| 428 | module_exit(rate_control_simple_exit); | ||
| 429 | |||
| 430 | MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211"); | ||
| 431 | MODULE_LICENSE("GPL"); | ||
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index ece77766ea2b..428a9fcf57d6 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
| @@ -509,9 +509,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_txrx_data *rx) | |||
| 509 | rx->key->tx_rx_count++; | 509 | rx->key->tx_rx_count++; |
| 510 | /* TODO: add threshold stuff again */ | 510 | /* TODO: add threshold stuff again */ |
| 511 | } else { | 511 | } else { |
| 512 | #ifdef CONFIG_MAC80211_DEBUG | ||
| 512 | if (net_ratelimit()) | 513 | if (net_ratelimit()) |
| 513 | printk(KERN_DEBUG "%s: RX protected frame," | 514 | printk(KERN_DEBUG "%s: RX protected frame," |
| 514 | " but have no key\n", rx->dev->name); | 515 | " but have no key\n", rx->dev->name); |
| 516 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
| 515 | return TXRX_DROP; | 517 | return TXRX_DROP; |
| 516 | } | 518 | } |
| 517 | 519 | ||
diff --git a/net/mac80211/wep.c b/net/mac80211/wep.c index a84a23310ff4..9bf0e1cc530a 100644 --- a/net/mac80211/wep.c +++ b/net/mac80211/wep.c | |||
| @@ -314,9 +314,11 @@ ieee80211_crypto_wep_decrypt(struct ieee80211_txrx_data *rx) | |||
| 314 | 314 | ||
| 315 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { | 315 | if (!(rx->u.rx.status->flag & RX_FLAG_DECRYPTED)) { |
| 316 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { | 316 | if (ieee80211_wep_decrypt(rx->local, rx->skb, rx->key)) { |
| 317 | #ifdef CONFIG_MAC80211_DEBUG | ||
| 317 | if (net_ratelimit()) | 318 | if (net_ratelimit()) |
| 318 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " | 319 | printk(KERN_DEBUG "%s: RX WEP frame, decrypt " |
| 319 | "failed\n", rx->dev->name); | 320 | "failed\n", rx->dev->name); |
| 321 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
| 320 | return TXRX_DROP; | 322 | return TXRX_DROP; |
| 321 | } | 323 | } |
| 322 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { | 324 | } else if (!(rx->u.rx.status->flag & RX_FLAG_IV_STRIPPED)) { |
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c index 6695efba57ec..20cec1cb956f 100644 --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c | |||
| @@ -323,9 +323,12 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_txrx_data *rx) | |||
| 323 | &rx->u.rx.tkip_iv32, | 323 | &rx->u.rx.tkip_iv32, |
| 324 | &rx->u.rx.tkip_iv16); | 324 | &rx->u.rx.tkip_iv16); |
| 325 | if (res != TKIP_DECRYPT_OK || wpa_test) { | 325 | if (res != TKIP_DECRYPT_OK || wpa_test) { |
| 326 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX frame from " | 326 | #ifdef CONFIG_MAC80211_DEBUG |
| 327 | "%s (res=%d)\n", | 327 | if (net_ratelimit()) |
| 328 | rx->dev->name, print_mac(mac, rx->sta->addr), res); | 328 | printk(KERN_DEBUG "%s: TKIP decrypt failed for RX " |
| 329 | "frame from %s (res=%d)\n", rx->dev->name, | ||
| 330 | print_mac(mac, rx->sta->addr), res); | ||
| 331 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
| 329 | return TXRX_DROP; | 332 | return TXRX_DROP; |
| 330 | } | 333 | } |
| 331 | 334 | ||
| @@ -594,9 +597,12 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_txrx_data *rx) | |||
| 594 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, | 597 | skb->data + hdrlen + CCMP_HDR_LEN, data_len, |
| 595 | skb->data + skb->len - CCMP_MIC_LEN, | 598 | skb->data + skb->len - CCMP_MIC_LEN, |
| 596 | skb->data + hdrlen + CCMP_HDR_LEN)) { | 599 | skb->data + hdrlen + CCMP_HDR_LEN)) { |
| 597 | printk(KERN_DEBUG "%s: CCMP decrypt failed for RX " | 600 | #ifdef CONFIG_MAC80211_DEBUG |
| 598 | "frame from %s\n", rx->dev->name, | 601 | if (net_ratelimit()) |
| 599 | print_mac(mac, rx->sta->addr)); | 602 | printk(KERN_DEBUG "%s: CCMP decrypt failed " |
| 603 | "for RX frame from %s\n", rx->dev->name, | ||
| 604 | print_mac(mac, rx->sta->addr)); | ||
| 605 | #endif /* CONFIG_MAC80211_DEBUG */ | ||
| 600 | return TXRX_DROP; | 606 | return TXRX_DROP; |
| 601 | } | 607 | } |
| 602 | } | 608 | } |
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile index 93c58f973831..ad0e36ebea3d 100644 --- a/net/netfilter/Makefile +++ b/net/netfilter/Makefile | |||
| @@ -40,15 +40,15 @@ obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o | |||
| 40 | # targets | 40 | # targets |
| 41 | obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o | 41 | obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o |
| 42 | obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o | 42 | obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o |
| 43 | obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o | ||
| 43 | obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o | 44 | obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o |
| 44 | obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o | 45 | obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o |
| 45 | obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o | ||
| 46 | obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o | 46 | obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o |
| 47 | obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o | ||
| 47 | obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o | 48 | obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o |
| 48 | obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o | ||
| 49 | obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o | 49 | obj-$(CONFIG_NETFILTER_XT_TARGET_SECMARK) += xt_SECMARK.o |
| 50 | obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o | 50 | obj-$(CONFIG_NETFILTER_XT_TARGET_TCPMSS) += xt_TCPMSS.o |
| 51 | obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o | 51 | obj-$(CONFIG_NETFILTER_XT_TARGET_TRACE) += xt_TRACE.o |
| 52 | 52 | ||
| 53 | # matches | 53 | # matches |
| 54 | obj-$(CONFIG_NETFILTER_XT_MATCH_COMMENT) += xt_comment.o | 54 | obj-$(CONFIG_NETFILTER_XT_MATCH_COMMENT) += xt_comment.o |
| @@ -59,22 +59,22 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_CONNTRACK) += xt_conntrack.o | |||
| 59 | obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o | 59 | obj-$(CONFIG_NETFILTER_XT_MATCH_DCCP) += xt_dccp.o |
| 60 | obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o | 60 | obj-$(CONFIG_NETFILTER_XT_MATCH_DSCP) += xt_dscp.o |
| 61 | obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o | 61 | obj-$(CONFIG_NETFILTER_XT_MATCH_ESP) += xt_esp.o |
| 62 | obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o | ||
| 62 | obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o | 63 | obj-$(CONFIG_NETFILTER_XT_MATCH_HELPER) += xt_helper.o |
| 63 | obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o | 64 | obj-$(CONFIG_NETFILTER_XT_MATCH_LENGTH) += xt_length.o |
| 64 | obj-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += xt_limit.o | 65 | obj-$(CONFIG_NETFILTER_XT_MATCH_LIMIT) += xt_limit.o |
| 65 | obj-$(CONFIG_NETFILTER_XT_MATCH_MAC) += xt_mac.o | 66 | obj-$(CONFIG_NETFILTER_XT_MATCH_MAC) += xt_mac.o |
| 66 | obj-$(CONFIG_NETFILTER_XT_MATCH_MARK) += xt_mark.o | 67 | obj-$(CONFIG_NETFILTER_XT_MATCH_MARK) += xt_mark.o |
| 67 | obj-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += xt_multiport.o | 68 | obj-$(CONFIG_NETFILTER_XT_MATCH_MULTIPORT) += xt_multiport.o |
| 68 | obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o | 69 | obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o |
| 69 | obj-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += xt_pkttype.o | 70 | obj-$(CONFIG_NETFILTER_XT_MATCH_PKTTYPE) += xt_pkttype.o |
| 71 | obj-$(CONFIG_NETFILTER_XT_MATCH_POLICY) += xt_policy.o | ||
| 70 | obj-$(CONFIG_NETFILTER_XT_MATCH_QUOTA) += xt_quota.o | 72 | obj-$(CONFIG_NETFILTER_XT_MATCH_QUOTA) += xt_quota.o |
| 71 | obj-$(CONFIG_NETFILTER_XT_MATCH_REALM) += xt_realm.o | 73 | obj-$(CONFIG_NETFILTER_XT_MATCH_REALM) += xt_realm.o |
| 72 | obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o | 74 | obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o |
| 73 | obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o | 75 | obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o |
| 74 | obj-$(CONFIG_NETFILTER_XT_MATCH_STATISTIC) += xt_statistic.o | 76 | obj-$(CONFIG_NETFILTER_XT_MATCH_STATISTIC) += xt_statistic.o |
| 75 | obj-$(CONFIG_NETFILTER_XT_MATCH_STRING) += xt_string.o | 77 | obj-$(CONFIG_NETFILTER_XT_MATCH_STRING) += xt_string.o |
| 76 | obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o | ||
| 77 | obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o | 78 | obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o |
| 78 | obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o | 79 | obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o |
| 79 | obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o | 80 | obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o |
| 80 | obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o | ||
diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c index aa2831587b82..2dfac3253569 100644 --- a/net/netfilter/nf_sockopt.c +++ b/net/netfilter/nf_sockopt.c | |||
| @@ -23,14 +23,13 @@ static inline int overlap(int min1, int max1, int min2, int max2) | |||
| 23 | /* Functions to register sockopt ranges (exclusive). */ | 23 | /* Functions to register sockopt ranges (exclusive). */ |
| 24 | int nf_register_sockopt(struct nf_sockopt_ops *reg) | 24 | int nf_register_sockopt(struct nf_sockopt_ops *reg) |
| 25 | { | 25 | { |
| 26 | struct list_head *i; | 26 | struct nf_sockopt_ops *ops; |
| 27 | int ret = 0; | 27 | int ret = 0; |
| 28 | 28 | ||
| 29 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) | 29 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) |
| 30 | return -EINTR; | 30 | return -EINTR; |
| 31 | 31 | ||
| 32 | list_for_each(i, &nf_sockopts) { | 32 | list_for_each_entry(ops, &nf_sockopts, list) { |
| 33 | struct nf_sockopt_ops *ops = (struct nf_sockopt_ops *)i; | ||
| 34 | if (ops->pf == reg->pf | 33 | if (ops->pf == reg->pf |
| 35 | && (overlap(ops->set_optmin, ops->set_optmax, | 34 | && (overlap(ops->set_optmin, ops->set_optmax, |
| 36 | reg->set_optmin, reg->set_optmax) | 35 | reg->set_optmin, reg->set_optmax) |
| @@ -65,7 +64,6 @@ EXPORT_SYMBOL(nf_unregister_sockopt); | |||
| 65 | static int nf_sockopt(struct sock *sk, int pf, int val, | 64 | static int nf_sockopt(struct sock *sk, int pf, int val, |
| 66 | char __user *opt, int *len, int get) | 65 | char __user *opt, int *len, int get) |
| 67 | { | 66 | { |
| 68 | struct list_head *i; | ||
| 69 | struct nf_sockopt_ops *ops; | 67 | struct nf_sockopt_ops *ops; |
| 70 | int ret; | 68 | int ret; |
| 71 | 69 | ||
| @@ -75,8 +73,7 @@ static int nf_sockopt(struct sock *sk, int pf, int val, | |||
| 75 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) | 73 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) |
| 76 | return -EINTR; | 74 | return -EINTR; |
| 77 | 75 | ||
| 78 | list_for_each(i, &nf_sockopts) { | 76 | list_for_each_entry(ops, &nf_sockopts, list) { |
| 79 | ops = (struct nf_sockopt_ops *)i; | ||
| 80 | if (ops->pf == pf) { | 77 | if (ops->pf == pf) { |
| 81 | if (!try_module_get(ops->owner)) | 78 | if (!try_module_get(ops->owner)) |
| 82 | goto out_nosup; | 79 | goto out_nosup; |
| @@ -124,7 +121,6 @@ EXPORT_SYMBOL(nf_getsockopt); | |||
| 124 | static int compat_nf_sockopt(struct sock *sk, int pf, int val, | 121 | static int compat_nf_sockopt(struct sock *sk, int pf, int val, |
| 125 | char __user *opt, int *len, int get) | 122 | char __user *opt, int *len, int get) |
| 126 | { | 123 | { |
| 127 | struct list_head *i; | ||
| 128 | struct nf_sockopt_ops *ops; | 124 | struct nf_sockopt_ops *ops; |
| 129 | int ret; | 125 | int ret; |
| 130 | 126 | ||
| @@ -135,8 +131,7 @@ static int compat_nf_sockopt(struct sock *sk, int pf, int val, | |||
| 135 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) | 131 | if (mutex_lock_interruptible(&nf_sockopt_mutex) != 0) |
| 136 | return -EINTR; | 132 | return -EINTR; |
| 137 | 133 | ||
| 138 | list_for_each(i, &nf_sockopts) { | 134 | list_for_each_entry(ops, &nf_sockopts, list) { |
| 139 | ops = (struct nf_sockopt_ops *)i; | ||
| 140 | if (ops->pf == pf) { | 135 | if (ops->pf == pf) { |
| 141 | if (!try_module_get(ops->owner)) | 136 | if (!try_module_get(ops->owner)) |
| 142 | goto out_nosup; | 137 | goto out_nosup; |
diff --git a/net/netfilter/xt_connlimit.c b/net/netfilter/xt_connlimit.c index 06cff1d13690..d7becf08a93a 100644 --- a/net/netfilter/xt_connlimit.c +++ b/net/netfilter/xt_connlimit.c | |||
| @@ -4,7 +4,8 @@ | |||
| 4 | * (c) 2000 Gerd Knorr <kraxel@bytesex.org> | 4 | * (c) 2000 Gerd Knorr <kraxel@bytesex.org> |
| 5 | * Nov 2002: Martin Bene <martin.bene@icomedias.com>: | 5 | * Nov 2002: Martin Bene <martin.bene@icomedias.com>: |
| 6 | * only ignore TIME_WAIT or gone connections | 6 | * only ignore TIME_WAIT or gone connections |
| 7 | * Copyright © Jan Engelhardt <jengelh@gmx.de>, 2007 | 7 | * (C) CC Computer Consultants GmbH, 2007 |
| 8 | * Contact: <jengelh@computergmbh.de> | ||
| 8 | * | 9 | * |
| 9 | * based on ... | 10 | * based on ... |
| 10 | * | 11 | * |
| @@ -306,7 +307,7 @@ static void __exit xt_connlimit_exit(void) | |||
| 306 | 307 | ||
| 307 | module_init(xt_connlimit_init); | 308 | module_init(xt_connlimit_init); |
| 308 | module_exit(xt_connlimit_exit); | 309 | module_exit(xt_connlimit_exit); |
| 309 | MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>"); | 310 | MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>"); |
| 310 | MODULE_DESCRIPTION("netfilter xt_connlimit match module"); | 311 | MODULE_DESCRIPTION("netfilter xt_connlimit match module"); |
| 311 | MODULE_LICENSE("GPL"); | 312 | MODULE_LICENSE("GPL"); |
| 312 | MODULE_ALIAS("ipt_connlimit"); | 313 | MODULE_ALIAS("ipt_connlimit"); |
diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c index ef48bbd93573..ff44f86c24ce 100644 --- a/net/netfilter/xt_time.c +++ b/net/netfilter/xt_time.c | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * xt_time | 2 | * xt_time |
| 3 | * Copyright © Jan Engelhardt <jengelh@computergmbh.de>, 2007 | 3 | * Copyright © CC Computer Consultants GmbH, 2007 |
| 4 | * Contact: <jengelh@computergmbh.de> | ||
| 4 | * | 5 | * |
| 5 | * based on ipt_time by Fabrice MARIE <fabrice@netfilter.org> | 6 | * based on ipt_time by Fabrice MARIE <fabrice@netfilter.org> |
| 6 | * This is a module which is used for time matching | 7 | * This is a module which is used for time matching |
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c index bec427915b30..af75b8c3f20b 100644 --- a/net/netfilter/xt_u32.c +++ b/net/netfilter/xt_u32.c | |||
| @@ -2,7 +2,8 @@ | |||
| 2 | * xt_u32 - kernel module to match u32 packet content | 2 | * xt_u32 - kernel module to match u32 packet content |
| 3 | * | 3 | * |
| 4 | * Original author: Don Cohen <don@isis.cs3-inc.com> | 4 | * Original author: Don Cohen <don@isis.cs3-inc.com> |
| 5 | * © Jan Engelhardt <jengelh@gmx.de>, 2007 | 5 | * (C) CC Computer Consultants GmbH, 2007 |
| 6 | * Contact: <jengelh@computergmbh.de> | ||
| 6 | */ | 7 | */ |
| 7 | 8 | ||
| 8 | #include <linux/module.h> | 9 | #include <linux/module.h> |
| @@ -129,7 +130,7 @@ static void __exit xt_u32_exit(void) | |||
| 129 | 130 | ||
| 130 | module_init(xt_u32_init); | 131 | module_init(xt_u32_init); |
| 131 | module_exit(xt_u32_exit); | 132 | module_exit(xt_u32_exit); |
| 132 | MODULE_AUTHOR("Jan Engelhardt <jengelh@gmx.de>"); | 133 | MODULE_AUTHOR("Jan Engelhardt <jengelh@computergmbh.de>"); |
| 133 | MODULE_DESCRIPTION("netfilter u32 match module"); | 134 | MODULE_DESCRIPTION("netfilter u32 match module"); |
| 134 | MODULE_LICENSE("GPL"); | 135 | MODULE_LICENSE("GPL"); |
| 135 | MODULE_ALIAS("ipt_u32"); | 136 | MODULE_ALIAS("ipt_u32"); |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 260171255576..415c97236f63 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
| @@ -752,7 +752,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp) | |||
| 752 | * 1: repeat lookup - reference dropped while waiting for socket memory. | 752 | * 1: repeat lookup - reference dropped while waiting for socket memory. |
| 753 | */ | 753 | */ |
| 754 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | 754 | int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, |
| 755 | long timeo, struct sock *ssk) | 755 | long *timeo, struct sock *ssk) |
| 756 | { | 756 | { |
| 757 | struct netlink_sock *nlk; | 757 | struct netlink_sock *nlk; |
| 758 | 758 | ||
| @@ -761,7 +761,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | |||
| 761 | if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || | 761 | if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || |
| 762 | test_bit(0, &nlk->state)) { | 762 | test_bit(0, &nlk->state)) { |
| 763 | DECLARE_WAITQUEUE(wait, current); | 763 | DECLARE_WAITQUEUE(wait, current); |
| 764 | if (!timeo) { | 764 | if (!*timeo) { |
| 765 | if (!ssk || netlink_is_kernel(ssk)) | 765 | if (!ssk || netlink_is_kernel(ssk)) |
| 766 | netlink_overrun(sk); | 766 | netlink_overrun(sk); |
| 767 | sock_put(sk); | 767 | sock_put(sk); |
| @@ -775,7 +775,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | |||
| 775 | if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || | 775 | if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || |
| 776 | test_bit(0, &nlk->state)) && | 776 | test_bit(0, &nlk->state)) && |
| 777 | !sock_flag(sk, SOCK_DEAD)) | 777 | !sock_flag(sk, SOCK_DEAD)) |
| 778 | timeo = schedule_timeout(timeo); | 778 | *timeo = schedule_timeout(*timeo); |
| 779 | 779 | ||
| 780 | __set_current_state(TASK_RUNNING); | 780 | __set_current_state(TASK_RUNNING); |
| 781 | remove_wait_queue(&nlk->wait, &wait); | 781 | remove_wait_queue(&nlk->wait, &wait); |
| @@ -783,7 +783,7 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, | |||
| 783 | 783 | ||
| 784 | if (signal_pending(current)) { | 784 | if (signal_pending(current)) { |
| 785 | kfree_skb(skb); | 785 | kfree_skb(skb); |
| 786 | return sock_intr_errno(timeo); | 786 | return sock_intr_errno(*timeo); |
| 787 | } | 787 | } |
| 788 | return 1; | 788 | return 1; |
| 789 | } | 789 | } |
| @@ -877,7 +877,7 @@ retry: | |||
| 877 | if (netlink_is_kernel(sk)) | 877 | if (netlink_is_kernel(sk)) |
| 878 | return netlink_unicast_kernel(sk, skb); | 878 | return netlink_unicast_kernel(sk, skb); |
| 879 | 879 | ||
| 880 | err = netlink_attachskb(sk, skb, nonblock, timeo, ssk); | 880 | err = netlink_attachskb(sk, skb, nonblock, &timeo, ssk); |
| 881 | if (err == 1) | 881 | if (err == 1) |
| 882 | goto retry; | 882 | goto retry; |
| 883 | if (err) | 883 | if (err) |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 4cb2dfba0993..eb6be5030c70 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -139,9 +139,6 @@ dev->hard_header == NULL (ll header is added by device, we cannot control it) | |||
| 139 | static HLIST_HEAD(packet_sklist); | 139 | static HLIST_HEAD(packet_sklist); |
| 140 | static DEFINE_RWLOCK(packet_sklist_lock); | 140 | static DEFINE_RWLOCK(packet_sklist_lock); |
| 141 | 141 | ||
| 142 | static atomic_t packet_socks_nr; | ||
| 143 | |||
| 144 | |||
| 145 | /* Private packet socket structures. */ | 142 | /* Private packet socket structures. */ |
| 146 | 143 | ||
| 147 | struct packet_mclist | 144 | struct packet_mclist |
| @@ -236,10 +233,7 @@ static void packet_sock_destruct(struct sock *sk) | |||
| 236 | return; | 233 | return; |
| 237 | } | 234 | } |
| 238 | 235 | ||
| 239 | atomic_dec(&packet_socks_nr); | 236 | sk_refcnt_debug_dec(sk); |
| 240 | #ifdef PACKET_REFCNT_DEBUG | ||
| 241 | printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr)); | ||
| 242 | #endif | ||
| 243 | } | 237 | } |
| 244 | 238 | ||
| 245 | 239 | ||
| @@ -515,7 +509,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet | |||
| 515 | sll->sll_hatype = dev->type; | 509 | sll->sll_hatype = dev->type; |
| 516 | sll->sll_protocol = skb->protocol; | 510 | sll->sll_protocol = skb->protocol; |
| 517 | sll->sll_pkttype = skb->pkt_type; | 511 | sll->sll_pkttype = skb->pkt_type; |
| 518 | if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST) | 512 | if (unlikely(po->origdev)) |
| 519 | sll->sll_ifindex = orig_dev->ifindex; | 513 | sll->sll_ifindex = orig_dev->ifindex; |
| 520 | else | 514 | else |
| 521 | sll->sll_ifindex = dev->ifindex; | 515 | sll->sll_ifindex = dev->ifindex; |
| @@ -661,7 +655,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
| 661 | sll->sll_hatype = dev->type; | 655 | sll->sll_hatype = dev->type; |
| 662 | sll->sll_protocol = skb->protocol; | 656 | sll->sll_protocol = skb->protocol; |
| 663 | sll->sll_pkttype = skb->pkt_type; | 657 | sll->sll_pkttype = skb->pkt_type; |
| 664 | if (unlikely(po->origdev) && skb->pkt_type == PACKET_HOST) | 658 | if (unlikely(po->origdev)) |
| 665 | sll->sll_ifindex = orig_dev->ifindex; | 659 | sll->sll_ifindex = orig_dev->ifindex; |
| 666 | else | 660 | else |
| 667 | sll->sll_ifindex = dev->ifindex; | 661 | sll->sll_ifindex = dev->ifindex; |
| @@ -849,6 +843,7 @@ static int packet_release(struct socket *sock) | |||
| 849 | /* Purge queues */ | 843 | /* Purge queues */ |
| 850 | 844 | ||
| 851 | skb_queue_purge(&sk->sk_receive_queue); | 845 | skb_queue_purge(&sk->sk_receive_queue); |
| 846 | sk_refcnt_debug_release(sk); | ||
| 852 | 847 | ||
| 853 | sock_put(sk); | 848 | sock_put(sk); |
| 854 | return 0; | 849 | return 0; |
| @@ -1010,7 +1005,7 @@ static int packet_create(struct net *net, struct socket *sock, int protocol) | |||
| 1010 | po->num = proto; | 1005 | po->num = proto; |
| 1011 | 1006 | ||
| 1012 | sk->sk_destruct = packet_sock_destruct; | 1007 | sk->sk_destruct = packet_sock_destruct; |
| 1013 | atomic_inc(&packet_socks_nr); | 1008 | sk_refcnt_debug_inc(sk); |
| 1014 | 1009 | ||
| 1015 | /* | 1010 | /* |
| 1016 | * Attach a protocol block | 1011 | * Attach a protocol block |
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index 51d151c0e962..73d60a307129 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
| @@ -27,6 +27,10 @@ | |||
| 27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
| 28 | #include <linux/rfkill.h> | 28 | #include <linux/rfkill.h> |
| 29 | 29 | ||
| 30 | /* Get declaration of rfkill_switch_all() to shut up sparse. */ | ||
| 31 | #include "rfkill-input.h" | ||
| 32 | |||
| 33 | |||
| 30 | MODULE_AUTHOR("Ivo van Doorn <IvDoorn@gmail.com>"); | 34 | MODULE_AUTHOR("Ivo van Doorn <IvDoorn@gmail.com>"); |
| 31 | MODULE_VERSION("1.0"); | 35 | MODULE_VERSION("1.0"); |
| 32 | MODULE_DESCRIPTION("RF switch support"); | 36 | MODULE_DESCRIPTION("RF switch support"); |
| @@ -276,21 +280,17 @@ static struct class rfkill_class = { | |||
| 276 | 280 | ||
| 277 | static int rfkill_add_switch(struct rfkill *rfkill) | 281 | static int rfkill_add_switch(struct rfkill *rfkill) |
| 278 | { | 282 | { |
| 279 | int retval; | 283 | int error; |
| 280 | |||
| 281 | retval = mutex_lock_interruptible(&rfkill_mutex); | ||
| 282 | if (retval) | ||
| 283 | return retval; | ||
| 284 | 284 | ||
| 285 | retval = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]); | 285 | mutex_lock(&rfkill_mutex); |
| 286 | if (retval) | ||
| 287 | goto out; | ||
| 288 | 286 | ||
| 289 | list_add_tail(&rfkill->node, &rfkill_list); | 287 | error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type]); |
| 288 | if (!error) | ||
| 289 | list_add_tail(&rfkill->node, &rfkill_list); | ||
| 290 | 290 | ||
| 291 | out: | ||
| 292 | mutex_unlock(&rfkill_mutex); | 291 | mutex_unlock(&rfkill_mutex); |
| 293 | return retval; | 292 | |
| 293 | return error; | ||
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | static void rfkill_remove_switch(struct rfkill *rfkill) | 296 | static void rfkill_remove_switch(struct rfkill *rfkill) |
| @@ -387,20 +387,23 @@ int rfkill_register(struct rfkill *rfkill) | |||
| 387 | 387 | ||
| 388 | if (!rfkill->toggle_radio) | 388 | if (!rfkill->toggle_radio) |
| 389 | return -EINVAL; | 389 | return -EINVAL; |
| 390 | if (rfkill->type >= RFKILL_TYPE_MAX) | ||
| 391 | return -EINVAL; | ||
| 392 | |||
| 393 | snprintf(dev->bus_id, sizeof(dev->bus_id), | ||
| 394 | "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1); | ||
| 395 | |||
| 396 | rfkill_led_trigger_register(rfkill); | ||
| 390 | 397 | ||
| 391 | error = rfkill_add_switch(rfkill); | 398 | error = rfkill_add_switch(rfkill); |
| 392 | if (error) | 399 | if (error) |
| 393 | return error; | 400 | return error; |
| 394 | 401 | ||
| 395 | snprintf(dev->bus_id, sizeof(dev->bus_id), | ||
| 396 | "rfkill%ld", (long)atomic_inc_return(&rfkill_no) - 1); | ||
| 397 | |||
| 398 | error = device_add(dev); | 402 | error = device_add(dev); |
| 399 | if (error) { | 403 | if (error) { |
| 400 | rfkill_remove_switch(rfkill); | 404 | rfkill_remove_switch(rfkill); |
| 401 | return error; | 405 | return error; |
| 402 | } | 406 | } |
| 403 | rfkill_led_trigger_register(rfkill); | ||
| 404 | 407 | ||
| 405 | return 0; | 408 | return 0; |
| 406 | } | 409 | } |
| @@ -416,9 +419,9 @@ EXPORT_SYMBOL(rfkill_register); | |||
| 416 | */ | 419 | */ |
| 417 | void rfkill_unregister(struct rfkill *rfkill) | 420 | void rfkill_unregister(struct rfkill *rfkill) |
| 418 | { | 421 | { |
| 419 | rfkill_led_trigger_unregister(rfkill); | ||
| 420 | device_del(&rfkill->dev); | 422 | device_del(&rfkill->dev); |
| 421 | rfkill_remove_switch(rfkill); | 423 | rfkill_remove_switch(rfkill); |
| 424 | rfkill_led_trigger_unregister(rfkill); | ||
| 422 | put_device(&rfkill->dev); | 425 | put_device(&rfkill->dev); |
| 423 | } | 426 | } |
| 424 | EXPORT_SYMBOL(rfkill_unregister); | 427 | EXPORT_SYMBOL(rfkill_unregister); |
| @@ -448,5 +451,5 @@ static void __exit rfkill_exit(void) | |||
| 448 | class_unregister(&rfkill_class); | 451 | class_unregister(&rfkill_class); |
| 449 | } | 452 | } |
| 450 | 453 | ||
| 451 | module_init(rfkill_init); | 454 | subsys_initcall(rfkill_init); |
| 452 | module_exit(rfkill_exit); | 455 | module_exit(rfkill_exit); |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 9e98c6e567dd..c39008209164 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -91,7 +91,7 @@ static struct tc_u_common *u32_list; | |||
| 91 | 91 | ||
| 92 | static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift) | 92 | static __inline__ unsigned u32_hash_fold(u32 key, struct tc_u32_sel *sel, u8 fshift) |
| 93 | { | 93 | { |
| 94 | unsigned h = (key & sel->hmask)>>fshift; | 94 | unsigned h = ntohl(key & sel->hmask)>>fshift; |
| 95 | 95 | ||
| 96 | return h; | 96 | return h; |
| 97 | } | 97 | } |
| @@ -613,17 +613,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle, | |||
| 613 | memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)); | 613 | memcpy(&n->sel, s, sizeof(*s) + s->nkeys*sizeof(struct tc_u32_key)); |
| 614 | n->ht_up = ht; | 614 | n->ht_up = ht; |
| 615 | n->handle = handle; | 615 | n->handle = handle; |
| 616 | { | 616 | n->fshift = s->hmask ? ffs(ntohl(s->hmask)) - 1 : 0; |
| 617 | u8 i = 0; | ||
| 618 | u32 mask = s->hmask; | ||
| 619 | if (mask) { | ||
| 620 | while (!(mask & 1)) { | ||
| 621 | i++; | ||
| 622 | mask>>=1; | ||
| 623 | } | ||
| 624 | } | ||
| 625 | n->fshift = i; | ||
| 626 | } | ||
| 627 | 617 | ||
| 628 | #ifdef CONFIG_CLS_U32_MARK | 618 | #ifdef CONFIG_CLS_U32_MARK |
| 629 | if (tb[TCA_U32_MARK-1]) { | 619 | if (tb[TCA_U32_MARK-1]) { |
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c index 421281d9dd1d..c0ed06d4a504 100644 --- a/net/sched/sch_teql.c +++ b/net/sched/sch_teql.c | |||
| @@ -252,6 +252,9 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device * | |||
| 252 | static inline int teql_resolve(struct sk_buff *skb, | 252 | static inline int teql_resolve(struct sk_buff *skb, |
| 253 | struct sk_buff *skb_res, struct net_device *dev) | 253 | struct sk_buff *skb_res, struct net_device *dev) |
| 254 | { | 254 | { |
| 255 | if (dev->qdisc == &noop_qdisc) | ||
| 256 | return -ENODEV; | ||
| 257 | |||
| 255 | if (dev->header_ops == NULL || | 258 | if (dev->header_ops == NULL || |
| 256 | skb->dst == NULL || | 259 | skb->dst == NULL || |
| 257 | skb->dst->neighbour == NULL) | 260 | skb->dst->neighbour == NULL) |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index bd6f42a15a4b..a7ecf3159e53 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
| @@ -6455,6 +6455,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
| 6455 | } | 6455 | } |
| 6456 | 6456 | ||
| 6457 | 6457 | ||
| 6458 | DEFINE_PROTO_INUSE(sctp) | ||
| 6459 | |||
| 6458 | /* This proto struct describes the ULP interface for SCTP. */ | 6460 | /* This proto struct describes the ULP interface for SCTP. */ |
| 6459 | struct proto sctp_prot = { | 6461 | struct proto sctp_prot = { |
| 6460 | .name = "SCTP", | 6462 | .name = "SCTP", |
| @@ -6483,9 +6485,12 @@ struct proto sctp_prot = { | |||
| 6483 | .memory_pressure = &sctp_memory_pressure, | 6485 | .memory_pressure = &sctp_memory_pressure, |
| 6484 | .enter_memory_pressure = sctp_enter_memory_pressure, | 6486 | .enter_memory_pressure = sctp_enter_memory_pressure, |
| 6485 | .memory_allocated = &sctp_memory_allocated, | 6487 | .memory_allocated = &sctp_memory_allocated, |
| 6488 | REF_PROTO_INUSE(sctp) | ||
| 6486 | }; | 6489 | }; |
| 6487 | 6490 | ||
| 6488 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 6491 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
| 6492 | DEFINE_PROTO_INUSE(sctpv6) | ||
| 6493 | |||
| 6489 | struct proto sctpv6_prot = { | 6494 | struct proto sctpv6_prot = { |
| 6490 | .name = "SCTPv6", | 6495 | .name = "SCTPv6", |
| 6491 | .owner = THIS_MODULE, | 6496 | .owner = THIS_MODULE, |
| @@ -6513,5 +6518,6 @@ struct proto sctpv6_prot = { | |||
| 6513 | .memory_pressure = &sctp_memory_pressure, | 6518 | .memory_pressure = &sctp_memory_pressure, |
| 6514 | .enter_memory_pressure = sctp_enter_memory_pressure, | 6519 | .enter_memory_pressure = sctp_enter_memory_pressure, |
| 6515 | .memory_allocated = &sctp_memory_allocated, | 6520 | .memory_allocated = &sctp_memory_allocated, |
| 6521 | REF_PROTO_INUSE(sctpv6) | ||
| 6516 | }; | 6522 | }; |
| 6517 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 6523 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 515e7a692f9b..e835da8fc091 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
| @@ -457,7 +457,7 @@ static int unix_release_sock (struct sock *sk, int embrion) | |||
| 457 | * What the above comment does talk about? --ANK(980817) | 457 | * What the above comment does talk about? --ANK(980817) |
| 458 | */ | 458 | */ |
| 459 | 459 | ||
| 460 | if (atomic_read(&unix_tot_inflight)) | 460 | if (unix_tot_inflight) |
| 461 | unix_gc(); /* Garbage collect fds */ | 461 | unix_gc(); /* Garbage collect fds */ |
| 462 | 462 | ||
| 463 | return 0; | 463 | return 0; |
| @@ -599,15 +599,14 @@ static struct sock * unix_create1(struct net *net, struct socket *sock) | |||
| 599 | struct sock *sk = NULL; | 599 | struct sock *sk = NULL; |
| 600 | struct unix_sock *u; | 600 | struct unix_sock *u; |
| 601 | 601 | ||
| 602 | if (atomic_read(&unix_nr_socks) >= 2*get_max_files()) | 602 | atomic_inc(&unix_nr_socks); |
| 603 | if (atomic_read(&unix_nr_socks) > 2 * get_max_files()) | ||
| 603 | goto out; | 604 | goto out; |
| 604 | 605 | ||
| 605 | sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto); | 606 | sk = sk_alloc(net, PF_UNIX, GFP_KERNEL, &unix_proto); |
| 606 | if (!sk) | 607 | if (!sk) |
| 607 | goto out; | 608 | goto out; |
| 608 | 609 | ||
| 609 | atomic_inc(&unix_nr_socks); | ||
| 610 | |||
| 611 | sock_init_data(sock,sk); | 610 | sock_init_data(sock,sk); |
| 612 | lockdep_set_class(&sk->sk_receive_queue.lock, | 611 | lockdep_set_class(&sk->sk_receive_queue.lock, |
| 613 | &af_unix_sk_receive_queue_lock_key); | 612 | &af_unix_sk_receive_queue_lock_key); |
| @@ -625,6 +624,8 @@ static struct sock * unix_create1(struct net *net, struct socket *sock) | |||
| 625 | init_waitqueue_head(&u->peer_wait); | 624 | init_waitqueue_head(&u->peer_wait); |
| 626 | unix_insert_socket(unix_sockets_unbound, sk); | 625 | unix_insert_socket(unix_sockets_unbound, sk); |
| 627 | out: | 626 | out: |
| 627 | if (sk == NULL) | ||
| 628 | atomic_dec(&unix_nr_socks); | ||
| 628 | return sk; | 629 | return sk; |
| 629 | } | 630 | } |
| 630 | 631 | ||
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index 406b6433e467..ebdff3d877a1 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
| @@ -92,7 +92,7 @@ static LIST_HEAD(gc_inflight_list); | |||
| 92 | static LIST_HEAD(gc_candidates); | 92 | static LIST_HEAD(gc_candidates); |
| 93 | static DEFINE_SPINLOCK(unix_gc_lock); | 93 | static DEFINE_SPINLOCK(unix_gc_lock); |
| 94 | 94 | ||
| 95 | atomic_t unix_tot_inflight = ATOMIC_INIT(0); | 95 | unsigned int unix_tot_inflight; |
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | static struct sock *unix_get_socket(struct file *filp) | 98 | static struct sock *unix_get_socket(struct file *filp) |
| @@ -133,7 +133,7 @@ void unix_inflight(struct file *fp) | |||
| 133 | } else { | 133 | } else { |
| 134 | BUG_ON(list_empty(&u->link)); | 134 | BUG_ON(list_empty(&u->link)); |
| 135 | } | 135 | } |
| 136 | atomic_inc(&unix_tot_inflight); | 136 | unix_tot_inflight++; |
| 137 | spin_unlock(&unix_gc_lock); | 137 | spin_unlock(&unix_gc_lock); |
| 138 | } | 138 | } |
| 139 | } | 139 | } |
| @@ -147,7 +147,7 @@ void unix_notinflight(struct file *fp) | |||
| 147 | BUG_ON(list_empty(&u->link)); | 147 | BUG_ON(list_empty(&u->link)); |
| 148 | if (atomic_dec_and_test(&u->inflight)) | 148 | if (atomic_dec_and_test(&u->inflight)) |
| 149 | list_del_init(&u->link); | 149 | list_del_init(&u->link); |
| 150 | atomic_dec(&unix_tot_inflight); | 150 | unix_tot_inflight--; |
| 151 | spin_unlock(&unix_gc_lock); | 151 | spin_unlock(&unix_gc_lock); |
| 152 | } | 152 | } |
| 153 | } | 153 | } |
| @@ -161,7 +161,7 @@ static inline struct sk_buff *sock_queue_head(struct sock *sk) | |||
| 161 | for (skb = sock_queue_head(sk)->next, next = skb->next; \ | 161 | for (skb = sock_queue_head(sk)->next, next = skb->next; \ |
| 162 | skb != sock_queue_head(sk); skb = next, next = skb->next) | 162 | skb != sock_queue_head(sk); skb = next, next = skb->next) |
| 163 | 163 | ||
| 164 | static void scan_inflight(struct sock *x, void (*func)(struct sock *), | 164 | static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *), |
| 165 | struct sk_buff_head *hitlist) | 165 | struct sk_buff_head *hitlist) |
| 166 | { | 166 | { |
| 167 | struct sk_buff *skb; | 167 | struct sk_buff *skb; |
| @@ -185,9 +185,9 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *), | |||
| 185 | * if it indeed does so | 185 | * if it indeed does so |
| 186 | */ | 186 | */ |
| 187 | struct sock *sk = unix_get_socket(*fp++); | 187 | struct sock *sk = unix_get_socket(*fp++); |
| 188 | if(sk) { | 188 | if (sk) { |
| 189 | hit = true; | 189 | hit = true; |
| 190 | func(sk); | 190 | func(unix_sk(sk)); |
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| 193 | if (hit && hitlist != NULL) { | 193 | if (hit && hitlist != NULL) { |
| @@ -199,7 +199,7 @@ static void scan_inflight(struct sock *x, void (*func)(struct sock *), | |||
| 199 | spin_unlock(&x->sk_receive_queue.lock); | 199 | spin_unlock(&x->sk_receive_queue.lock); |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | static void scan_children(struct sock *x, void (*func)(struct sock *), | 202 | static void scan_children(struct sock *x, void (*func)(struct unix_sock *), |
| 203 | struct sk_buff_head *hitlist) | 203 | struct sk_buff_head *hitlist) |
| 204 | { | 204 | { |
| 205 | if (x->sk_state != TCP_LISTEN) | 205 | if (x->sk_state != TCP_LISTEN) |
| @@ -235,20 +235,18 @@ static void scan_children(struct sock *x, void (*func)(struct sock *), | |||
| 235 | } | 235 | } |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | static void dec_inflight(struct sock *sk) | 238 | static void dec_inflight(struct unix_sock *usk) |
| 239 | { | 239 | { |
| 240 | atomic_dec(&unix_sk(sk)->inflight); | 240 | atomic_dec(&usk->inflight); |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | static void inc_inflight(struct sock *sk) | 243 | static void inc_inflight(struct unix_sock *usk) |
| 244 | { | 244 | { |
| 245 | atomic_inc(&unix_sk(sk)->inflight); | 245 | atomic_inc(&usk->inflight); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static void inc_inflight_move_tail(struct sock *sk) | 248 | static void inc_inflight_move_tail(struct unix_sock *u) |
| 249 | { | 249 | { |
| 250 | struct unix_sock *u = unix_sk(sk); | ||
| 251 | |||
| 252 | atomic_inc(&u->inflight); | 250 | atomic_inc(&u->inflight); |
| 253 | /* | 251 | /* |
| 254 | * If this is still a candidate, move it to the end of the | 252 | * If this is still a candidate, move it to the end of the |
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c index 7551af1f7899..9e70a160d7da 100644 --- a/security/selinux/ss/avtab.c +++ b/security/selinux/ss/avtab.c | |||
| @@ -325,7 +325,7 @@ static uint16_t spec_order[] = { | |||
| 325 | AVTAB_MEMBER | 325 | AVTAB_MEMBER |
| 326 | }; | 326 | }; |
| 327 | 327 | ||
| 328 | int avtab_read_item(void *fp, u32 vers, struct avtab *a, | 328 | int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, |
| 329 | int (*insertf)(struct avtab *a, struct avtab_key *k, | 329 | int (*insertf)(struct avtab *a, struct avtab_key *k, |
| 330 | struct avtab_datum *d, void *p), | 330 | struct avtab_datum *d, void *p), |
| 331 | void *p) | 331 | void *p) |
| @@ -333,10 +333,11 @@ int avtab_read_item(void *fp, u32 vers, struct avtab *a, | |||
| 333 | __le16 buf16[4]; | 333 | __le16 buf16[4]; |
| 334 | u16 enabled; | 334 | u16 enabled; |
| 335 | __le32 buf32[7]; | 335 | __le32 buf32[7]; |
| 336 | u32 items, items2, val; | 336 | u32 items, items2, val, vers = pol->policyvers; |
| 337 | struct avtab_key key; | 337 | struct avtab_key key; |
| 338 | struct avtab_datum datum; | 338 | struct avtab_datum datum; |
| 339 | int i, rc; | 339 | int i, rc; |
| 340 | unsigned set; | ||
| 340 | 341 | ||
| 341 | memset(&key, 0, sizeof(struct avtab_key)); | 342 | memset(&key, 0, sizeof(struct avtab_key)); |
| 342 | memset(&datum, 0, sizeof(struct avtab_datum)); | 343 | memset(&datum, 0, sizeof(struct avtab_datum)); |
| @@ -420,12 +421,35 @@ int avtab_read_item(void *fp, u32 vers, struct avtab *a, | |||
| 420 | key.target_class = le16_to_cpu(buf16[items++]); | 421 | key.target_class = le16_to_cpu(buf16[items++]); |
| 421 | key.specified = le16_to_cpu(buf16[items++]); | 422 | key.specified = le16_to_cpu(buf16[items++]); |
| 422 | 423 | ||
| 424 | if (!policydb_type_isvalid(pol, key.source_type) || | ||
| 425 | !policydb_type_isvalid(pol, key.target_type) || | ||
| 426 | !policydb_class_isvalid(pol, key.target_class)) { | ||
| 427 | printk(KERN_WARNING "security: avtab: invalid type or class\n"); | ||
| 428 | return -1; | ||
| 429 | } | ||
| 430 | |||
| 431 | set = 0; | ||
| 432 | for (i = 0; i < ARRAY_SIZE(spec_order); i++) { | ||
| 433 | if (key.specified & spec_order[i]) | ||
| 434 | set++; | ||
| 435 | } | ||
| 436 | if (!set || set > 1) { | ||
| 437 | printk(KERN_WARNING | ||
| 438 | "security: avtab: more than one specifier\n"); | ||
| 439 | return -1; | ||
| 440 | } | ||
| 441 | |||
| 423 | rc = next_entry(buf32, fp, sizeof(u32)); | 442 | rc = next_entry(buf32, fp, sizeof(u32)); |
| 424 | if (rc < 0) { | 443 | if (rc < 0) { |
| 425 | printk("security: avtab: truncated entry\n"); | 444 | printk("security: avtab: truncated entry\n"); |
| 426 | return -1; | 445 | return -1; |
| 427 | } | 446 | } |
| 428 | datum.data = le32_to_cpu(*buf32); | 447 | datum.data = le32_to_cpu(*buf32); |
| 448 | if ((key.specified & AVTAB_TYPE) && | ||
| 449 | !policydb_type_isvalid(pol, datum.data)) { | ||
| 450 | printk(KERN_WARNING "security: avtab: invalid type\n"); | ||
| 451 | return -1; | ||
| 452 | } | ||
| 429 | return insertf(a, &key, &datum, p); | 453 | return insertf(a, &key, &datum, p); |
| 430 | } | 454 | } |
| 431 | 455 | ||
| @@ -435,7 +459,7 @@ static int avtab_insertf(struct avtab *a, struct avtab_key *k, | |||
| 435 | return avtab_insert(a, k, d); | 459 | return avtab_insert(a, k, d); |
| 436 | } | 460 | } |
| 437 | 461 | ||
| 438 | int avtab_read(struct avtab *a, void *fp, u32 vers) | 462 | int avtab_read(struct avtab *a, void *fp, struct policydb *pol) |
| 439 | { | 463 | { |
| 440 | int rc; | 464 | int rc; |
| 441 | __le32 buf[1]; | 465 | __le32 buf[1]; |
| @@ -459,7 +483,7 @@ int avtab_read(struct avtab *a, void *fp, u32 vers) | |||
| 459 | goto bad; | 483 | goto bad; |
| 460 | 484 | ||
| 461 | for (i = 0; i < nel; i++) { | 485 | for (i = 0; i < nel; i++) { |
| 462 | rc = avtab_read_item(fp,vers, a, avtab_insertf, NULL); | 486 | rc = avtab_read_item(a, fp, pol, avtab_insertf, NULL); |
| 463 | if (rc) { | 487 | if (rc) { |
| 464 | if (rc == -ENOMEM) | 488 | if (rc == -ENOMEM) |
| 465 | printk(KERN_ERR "security: avtab: out of memory\n"); | 489 | printk(KERN_ERR "security: avtab: out of memory\n"); |
diff --git a/security/selinux/ss/avtab.h b/security/selinux/ss/avtab.h index d8edf8ca56d1..8da6a8428086 100644 --- a/security/selinux/ss/avtab.h +++ b/security/selinux/ss/avtab.h | |||
| @@ -64,12 +64,13 @@ struct avtab_datum *avtab_search(struct avtab *h, struct avtab_key *k); | |||
| 64 | void avtab_destroy(struct avtab *h); | 64 | void avtab_destroy(struct avtab *h); |
| 65 | void avtab_hash_eval(struct avtab *h, char *tag); | 65 | void avtab_hash_eval(struct avtab *h, char *tag); |
| 66 | 66 | ||
| 67 | int avtab_read_item(void *fp, uint32_t vers, struct avtab *a, | 67 | struct policydb; |
| 68 | int avtab_read_item(struct avtab *a, void *fp, struct policydb *pol, | ||
| 68 | int (*insert)(struct avtab *a, struct avtab_key *k, | 69 | int (*insert)(struct avtab *a, struct avtab_key *k, |
| 69 | struct avtab_datum *d, void *p), | 70 | struct avtab_datum *d, void *p), |
| 70 | void *p); | 71 | void *p); |
| 71 | 72 | ||
| 72 | int avtab_read(struct avtab *a, void *fp, u32 vers); | 73 | int avtab_read(struct avtab *a, void *fp, struct policydb *pol); |
| 73 | 74 | ||
| 74 | struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, | 75 | struct avtab_node *avtab_insert_nonunique(struct avtab *h, struct avtab_key *key, |
| 75 | struct avtab_datum *datum); | 76 | struct avtab_datum *datum); |
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index 45b93a827c80..50ad85d4b77c 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c | |||
| @@ -362,7 +362,8 @@ static int cond_read_av_list(struct policydb *p, void *fp, struct cond_av_list * | |||
| 362 | data.head = NULL; | 362 | data.head = NULL; |
| 363 | data.tail = NULL; | 363 | data.tail = NULL; |
| 364 | for (i = 0; i < len; i++) { | 364 | for (i = 0; i < len; i++) { |
| 365 | rc = avtab_read_item(fp, p->policyvers, &p->te_cond_avtab, cond_insertf, &data); | 365 | rc = avtab_read_item(&p->te_cond_avtab, fp, p, cond_insertf, |
| 366 | &data); | ||
| 366 | if (rc) | 367 | if (rc) |
| 367 | return rc; | 368 | return rc; |
| 368 | 369 | ||
diff --git a/security/selinux/ss/ebitmap.c b/security/selinux/ss/ebitmap.c index c1a6b22d48d9..920b5e36a1af 100644 --- a/security/selinux/ss/ebitmap.c +++ b/security/selinux/ss/ebitmap.c | |||
| @@ -129,8 +129,8 @@ int ebitmap_netlbl_export(struct ebitmap *ebmap, | |||
| 129 | cmap_sft = delta % NETLBL_CATMAP_MAPSIZE; | 129 | cmap_sft = delta % NETLBL_CATMAP_MAPSIZE; |
| 130 | c_iter->bitmap[cmap_idx] | 130 | c_iter->bitmap[cmap_idx] |
| 131 | |= e_iter->maps[cmap_idx] << cmap_sft; | 131 | |= e_iter->maps[cmap_idx] << cmap_sft; |
| 132 | e_iter = e_iter->next; | ||
| 133 | } | 132 | } |
| 133 | e_iter = e_iter->next; | ||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | return 0; | 136 | return 0; |
diff --git a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c index 9a11deaaa9e7..fb5d70a6628d 100644 --- a/security/selinux/ss/mls.c +++ b/security/selinux/ss/mls.c | |||
| @@ -157,49 +157,55 @@ void mls_sid_to_context(struct context *context, | |||
| 157 | return; | 157 | return; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | int mls_level_isvalid(struct policydb *p, struct mls_level *l) | ||
| 161 | { | ||
| 162 | struct level_datum *levdatum; | ||
| 163 | struct ebitmap_node *node; | ||
| 164 | int i; | ||
| 165 | |||
| 166 | if (!l->sens || l->sens > p->p_levels.nprim) | ||
| 167 | return 0; | ||
| 168 | levdatum = hashtab_search(p->p_levels.table, | ||
| 169 | p->p_sens_val_to_name[l->sens - 1]); | ||
| 170 | if (!levdatum) | ||
| 171 | return 0; | ||
| 172 | |||
| 173 | ebitmap_for_each_positive_bit(&l->cat, node, i) { | ||
| 174 | if (i > p->p_cats.nprim) | ||
| 175 | return 0; | ||
| 176 | if (!ebitmap_get_bit(&levdatum->level->cat, i)) { | ||
| 177 | /* | ||
| 178 | * Category may not be associated with | ||
| 179 | * sensitivity. | ||
| 180 | */ | ||
| 181 | return 0; | ||
| 182 | } | ||
| 183 | } | ||
| 184 | |||
| 185 | return 1; | ||
| 186 | } | ||
| 187 | |||
| 188 | int mls_range_isvalid(struct policydb *p, struct mls_range *r) | ||
| 189 | { | ||
| 190 | return (mls_level_isvalid(p, &r->level[0]) && | ||
| 191 | mls_level_isvalid(p, &r->level[1]) && | ||
| 192 | mls_level_dom(&r->level[1], &r->level[0])); | ||
| 193 | } | ||
| 194 | |||
| 160 | /* | 195 | /* |
| 161 | * Return 1 if the MLS fields in the security context | 196 | * Return 1 if the MLS fields in the security context |
| 162 | * structure `c' are valid. Return 0 otherwise. | 197 | * structure `c' are valid. Return 0 otherwise. |
| 163 | */ | 198 | */ |
| 164 | int mls_context_isvalid(struct policydb *p, struct context *c) | 199 | int mls_context_isvalid(struct policydb *p, struct context *c) |
| 165 | { | 200 | { |
| 166 | struct level_datum *levdatum; | ||
| 167 | struct user_datum *usrdatum; | 201 | struct user_datum *usrdatum; |
| 168 | struct ebitmap_node *node; | ||
| 169 | int i, l; | ||
| 170 | 202 | ||
| 171 | if (!selinux_mls_enabled) | 203 | if (!selinux_mls_enabled) |
| 172 | return 1; | 204 | return 1; |
| 173 | 205 | ||
| 174 | /* | 206 | if (!mls_range_isvalid(p, &c->range)) |
| 175 | * MLS range validity checks: high must dominate low, low level must | ||
| 176 | * be valid (category set <-> sensitivity check), and high level must | ||
| 177 | * be valid (category set <-> sensitivity check) | ||
| 178 | */ | ||
| 179 | if (!mls_level_dom(&c->range.level[1], &c->range.level[0])) | ||
| 180 | /* High does not dominate low. */ | ||
| 181 | return 0; | 207 | return 0; |
| 182 | 208 | ||
| 183 | for (l = 0; l < 2; l++) { | ||
| 184 | if (!c->range.level[l].sens || c->range.level[l].sens > p->p_levels.nprim) | ||
| 185 | return 0; | ||
| 186 | levdatum = hashtab_search(p->p_levels.table, | ||
| 187 | p->p_sens_val_to_name[c->range.level[l].sens - 1]); | ||
| 188 | if (!levdatum) | ||
| 189 | return 0; | ||
| 190 | |||
| 191 | ebitmap_for_each_positive_bit(&c->range.level[l].cat, node, i) { | ||
| 192 | if (i > p->p_cats.nprim) | ||
| 193 | return 0; | ||
| 194 | if (!ebitmap_get_bit(&levdatum->level->cat, i)) | ||
| 195 | /* | ||
| 196 | * Category may not be associated with | ||
| 197 | * sensitivity in low level. | ||
| 198 | */ | ||
| 199 | return 0; | ||
| 200 | } | ||
| 201 | } | ||
| 202 | |||
| 203 | if (c->role == OBJECT_R_VAL) | 209 | if (c->role == OBJECT_R_VAL) |
| 204 | return 1; | 210 | return 1; |
| 205 | 211 | ||
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h index 096d1b4ef7fb..ab53663d9f5f 100644 --- a/security/selinux/ss/mls.h +++ b/security/selinux/ss/mls.h | |||
| @@ -27,6 +27,8 @@ | |||
| 27 | int mls_compute_context_len(struct context *context); | 27 | int mls_compute_context_len(struct context *context); |
| 28 | void mls_sid_to_context(struct context *context, char **scontext); | 28 | void mls_sid_to_context(struct context *context, char **scontext); |
| 29 | int mls_context_isvalid(struct policydb *p, struct context *c); | 29 | int mls_context_isvalid(struct policydb *p, struct context *c); |
| 30 | int mls_range_isvalid(struct policydb *p, struct mls_range *r); | ||
| 31 | int mls_level_isvalid(struct policydb *p, struct mls_level *l); | ||
| 30 | 32 | ||
| 31 | int mls_context_to_sid(char oldc, | 33 | int mls_context_to_sid(char oldc, |
| 32 | char **scontext, | 34 | char **scontext, |
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 539828b229b2..b582aae3c62c 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
| @@ -713,6 +713,27 @@ out: | |||
| 713 | return rc; | 713 | return rc; |
| 714 | } | 714 | } |
| 715 | 715 | ||
| 716 | int policydb_class_isvalid(struct policydb *p, unsigned int class) | ||
| 717 | { | ||
| 718 | if (!class || class > p->p_classes.nprim) | ||
| 719 | return 0; | ||
| 720 | return 1; | ||
| 721 | } | ||
| 722 | |||
| 723 | int policydb_role_isvalid(struct policydb *p, unsigned int role) | ||
| 724 | { | ||
| 725 | if (!role || role > p->p_roles.nprim) | ||
| 726 | return 0; | ||
| 727 | return 1; | ||
| 728 | } | ||
| 729 | |||
| 730 | int policydb_type_isvalid(struct policydb *p, unsigned int type) | ||
| 731 | { | ||
| 732 | if (!type || type > p->p_types.nprim) | ||
| 733 | return 0; | ||
| 734 | return 1; | ||
| 735 | } | ||
| 736 | |||
| 716 | /* | 737 | /* |
| 717 | * Return 1 if the fields in the security context | 738 | * Return 1 if the fields in the security context |
| 718 | * structure `c' are valid. Return 0 otherwise. | 739 | * structure `c' are valid. Return 0 otherwise. |
| @@ -1260,6 +1281,7 @@ static int mls_read_level(struct mls_level *lp, void *fp) | |||
| 1260 | "categories\n"); | 1281 | "categories\n"); |
| 1261 | goto bad; | 1282 | goto bad; |
| 1262 | } | 1283 | } |
| 1284 | |||
| 1263 | return 0; | 1285 | return 0; |
| 1264 | 1286 | ||
| 1265 | bad: | 1287 | bad: |
| @@ -1563,7 +1585,7 @@ int policydb_read(struct policydb *p, void *fp) | |||
| 1563 | p->symtab[i].nprim = nprim; | 1585 | p->symtab[i].nprim = nprim; |
| 1564 | } | 1586 | } |
| 1565 | 1587 | ||
| 1566 | rc = avtab_read(&p->te_avtab, fp, p->policyvers); | 1588 | rc = avtab_read(&p->te_avtab, fp, p); |
| 1567 | if (rc) | 1589 | if (rc) |
| 1568 | goto bad; | 1590 | goto bad; |
| 1569 | 1591 | ||
| @@ -1595,6 +1617,12 @@ int policydb_read(struct policydb *p, void *fp) | |||
| 1595 | tr->role = le32_to_cpu(buf[0]); | 1617 | tr->role = le32_to_cpu(buf[0]); |
| 1596 | tr->type = le32_to_cpu(buf[1]); | 1618 | tr->type = le32_to_cpu(buf[1]); |
| 1597 | tr->new_role = le32_to_cpu(buf[2]); | 1619 | tr->new_role = le32_to_cpu(buf[2]); |
| 1620 | if (!policydb_role_isvalid(p, tr->role) || | ||
| 1621 | !policydb_type_isvalid(p, tr->type) || | ||
| 1622 | !policydb_role_isvalid(p, tr->new_role)) { | ||
| 1623 | rc = -EINVAL; | ||
| 1624 | goto bad; | ||
| 1625 | } | ||
| 1598 | ltr = tr; | 1626 | ltr = tr; |
| 1599 | } | 1627 | } |
| 1600 | 1628 | ||
| @@ -1619,6 +1647,11 @@ int policydb_read(struct policydb *p, void *fp) | |||
| 1619 | goto bad; | 1647 | goto bad; |
| 1620 | ra->role = le32_to_cpu(buf[0]); | 1648 | ra->role = le32_to_cpu(buf[0]); |
| 1621 | ra->new_role = le32_to_cpu(buf[1]); | 1649 | ra->new_role = le32_to_cpu(buf[1]); |
| 1650 | if (!policydb_role_isvalid(p, ra->role) || | ||
| 1651 | !policydb_role_isvalid(p, ra->new_role)) { | ||
| 1652 | rc = -EINVAL; | ||
| 1653 | goto bad; | ||
| 1654 | } | ||
| 1622 | lra = ra; | 1655 | lra = ra; |
| 1623 | } | 1656 | } |
| 1624 | 1657 | ||
| @@ -1872,9 +1905,19 @@ int policydb_read(struct policydb *p, void *fp) | |||
| 1872 | rt->target_class = le32_to_cpu(buf[0]); | 1905 | rt->target_class = le32_to_cpu(buf[0]); |
| 1873 | } else | 1906 | } else |
| 1874 | rt->target_class = SECCLASS_PROCESS; | 1907 | rt->target_class = SECCLASS_PROCESS; |
| 1908 | if (!policydb_type_isvalid(p, rt->source_type) || | ||
| 1909 | !policydb_type_isvalid(p, rt->target_type) || | ||
| 1910 | !policydb_class_isvalid(p, rt->target_class)) { | ||
| 1911 | rc = -EINVAL; | ||
| 1912 | goto bad; | ||
| 1913 | } | ||
| 1875 | rc = mls_read_range_helper(&rt->target_range, fp); | 1914 | rc = mls_read_range_helper(&rt->target_range, fp); |
| 1876 | if (rc) | 1915 | if (rc) |
| 1877 | goto bad; | 1916 | goto bad; |
| 1917 | if (!mls_range_isvalid(p, &rt->target_range)) { | ||
| 1918 | printk(KERN_WARNING "security: rangetrans: invalid range\n"); | ||
| 1919 | goto bad; | ||
| 1920 | } | ||
| 1878 | lrt = rt; | 1921 | lrt = rt; |
| 1879 | } | 1922 | } |
| 1880 | } | 1923 | } |
diff --git a/security/selinux/ss/policydb.h b/security/selinux/ss/policydb.h index 844d310f4f1b..ed6fc687c66f 100644 --- a/security/selinux/ss/policydb.h +++ b/security/selinux/ss/policydb.h | |||
| @@ -251,6 +251,9 @@ struct policydb { | |||
| 251 | extern void policydb_destroy(struct policydb *p); | 251 | extern void policydb_destroy(struct policydb *p); |
| 252 | extern int policydb_load_isids(struct policydb *p, struct sidtab *s); | 252 | extern int policydb_load_isids(struct policydb *p, struct sidtab *s); |
| 253 | extern int policydb_context_isvalid(struct policydb *p, struct context *c); | 253 | extern int policydb_context_isvalid(struct policydb *p, struct context *c); |
| 254 | extern int policydb_class_isvalid(struct policydb *p, unsigned int class); | ||
| 255 | extern int policydb_type_isvalid(struct policydb *p, unsigned int type); | ||
| 256 | extern int policydb_role_isvalid(struct policydb *p, unsigned int role); | ||
| 254 | extern int policydb_read(struct policydb *p, void *fp); | 257 | extern int policydb_read(struct policydb *p, void *fp); |
| 255 | 258 | ||
| 256 | #define PERM_SYMTAB_SIZE 32 | 259 | #define PERM_SYMTAB_SIZE 32 |
diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index 36a191e7004e..e07603969033 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c | |||
| @@ -211,26 +211,27 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, | |||
| 211 | if (uctx->ctx_doi != XFRM_SC_ALG_SELINUX) | 211 | if (uctx->ctx_doi != XFRM_SC_ALG_SELINUX) |
| 212 | return -EINVAL; | 212 | return -EINVAL; |
| 213 | 213 | ||
| 214 | if (uctx->ctx_len >= PAGE_SIZE) | 214 | str_len = uctx->ctx_len; |
| 215 | if (str_len >= PAGE_SIZE) | ||
| 215 | return -ENOMEM; | 216 | return -ENOMEM; |
| 216 | 217 | ||
| 217 | *ctxp = ctx = kmalloc(sizeof(*ctx) + | 218 | *ctxp = ctx = kmalloc(sizeof(*ctx) + |
| 218 | uctx->ctx_len + 1, | 219 | str_len + 1, |
| 219 | GFP_KERNEL); | 220 | GFP_KERNEL); |
| 220 | 221 | ||
| 221 | if (!ctx) | 222 | if (!ctx) |
| 222 | return -ENOMEM; | 223 | return -ENOMEM; |
| 223 | 224 | ||
| 224 | ctx->ctx_doi = uctx->ctx_doi; | 225 | ctx->ctx_doi = uctx->ctx_doi; |
| 225 | ctx->ctx_len = uctx->ctx_len; | 226 | ctx->ctx_len = str_len; |
| 226 | ctx->ctx_alg = uctx->ctx_alg; | 227 | ctx->ctx_alg = uctx->ctx_alg; |
| 227 | 228 | ||
| 228 | memcpy(ctx->ctx_str, | 229 | memcpy(ctx->ctx_str, |
| 229 | uctx+1, | 230 | uctx+1, |
| 230 | ctx->ctx_len); | 231 | str_len); |
| 231 | ctx->ctx_str[ctx->ctx_len] = 0; | 232 | ctx->ctx_str[str_len] = 0; |
| 232 | rc = security_context_to_sid(ctx->ctx_str, | 233 | rc = security_context_to_sid(ctx->ctx_str, |
| 233 | ctx->ctx_len, | 234 | str_len, |
| 234 | &ctx->ctx_sid); | 235 | &ctx->ctx_sid); |
| 235 | 236 | ||
| 236 | if (rc) | 237 | if (rc) |
