Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master'

authored by

David Teigland and committed by
Steven Whitehouse
d26046bb e7f5c01c

+3834 -1690
+5
Documentation/filesystems/sysfs.txt
··· 246 246 devices/ 247 247 firmware/ 248 248 net/ 249 + fs/ 249 250 250 251 devices/ contains a filesystem representation of the device tree. It maps 251 252 directly to the internal kernel device tree, which is a hierarchy of ··· 264 263 drivers/ contains a directory for each device driver that is loaded 265 264 for devices on that particular bus (this assumes that drivers do not 266 265 span multiple bus types). 266 + 267 + fs/ contains a directory for some filesystems. Currently each 268 + filesystem wanting to export attributes must create its own hierarchy 269 + below fs/ (see ./fuse.txt for an example). 267 270 268 271 269 272 More information can driver-model specific features can be found in
+12
MAINTAINERS
··· 421 421 W: http://www.baycom.org/~tom/ham/ham.html 422 422 S: Maintained 423 423 424 + BCM43XX WIRELESS DRIVER 425 + P: Michael Buesch 426 + M: mb@bu3sch.de 427 + P: Stefano Brivio 428 + M: st3@riseup.net 429 + W: http://bcm43xx.berlios.de/ 430 + S: Maintained 431 + 424 432 BEFS FILE SYSTEM 425 433 P: Sergey S. Kostyliov 426 434 M: rathamahata@php4.ru ··· 2073 2065 M: matthew@wil.cx 2074 2066 P: Grant Grundler 2075 2067 M: grundler@parisc-linux.org 2068 + P: Kyle McMartin 2069 + M: kyle@parisc-linux.org 2076 2070 L: parisc-linux@parisc-linux.org 2077 2071 W: http://www.parisc-linux.org/ 2072 + T: git kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6.git 2073 + T: cvs cvs.parisc-linux.org:/var/cvs/linux-2.6 2078 2074 S: Maintained 2079 2075 2080 2076 PCI ERROR RECOVERY
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 17 4 - EXTRAVERSION =-rc2 4 + EXTRAVERSION =-rc3 5 5 NAME=Sliding Snow Leopard 6 6 7 7 # *DOCUMENTATION*
+4 -4
arch/alpha/lib/strncpy.S
··· 43 43 44 44 .align 4 45 45 $multiword: 46 - subq $24, 1, $2 # clear the final bits in the prev word 47 - or $2, $24, $2 46 + subq $27, 1, $2 # clear the final bits in the prev word 47 + or $2, $27, $2 48 48 zapnot $1, $2, $1 49 49 subq $18, 1, $18 50 50 ··· 70 70 bne $18, 0b 71 71 72 72 1: ldq_u $1, 0($16) # clear the leading bits in the final word 73 - subq $27, 1, $2 74 - or $2, $27, $2 73 + subq $24, 1, $2 74 + or $2, $24, $2 75 75 76 76 zap $1, $2, $1 77 77 stq_u $1, 0($16)
+1 -1
arch/arm/Makefile
··· 66 66 tune-$(CONFIG_CPU_V6) :=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) 67 67 68 68 ifeq ($(CONFIG_AEABI),y) 69 - CFLAGS_ABI :=-mabi=aapcs -mno-thumb-interwork 69 + CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork 70 70 else 71 71 CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) 72 72 endif
+1 -1
arch/arm/kernel/Makefile
··· 29 29 obj-y += io.o 30 30 endif 31 31 32 - head-y := head.o 32 + head-y := head$(MMUEXT).o 33 33 obj-$(CONFIG_DEBUG_LL) += debug.o 34 34 35 35 extra-y := $(head-y) init_task.o vmlinux.lds
+3 -1
arch/arm/kernel/head-nommu.S
··· 20 20 #include <asm/mach-types.h> 21 21 #include <asm/procinfo.h> 22 22 #include <asm/ptrace.h> 23 - #include <asm/constants.h> 23 + #include <asm/thread_info.h> 24 24 #include <asm/system.h> 25 25 26 26 #define PROCINFO_INITFUNC 12 27 + #define MACHINFO_TYPE 0 27 28 28 29 /* 29 30 * Kernel startup entry point. ··· 80 79 81 80 mov pc, r13 @ clear the BSS and jump 82 81 @ to start_kernel 82 + .ltorg 83 83 84 84 #include "head-common.S"
+1 -1
arch/arm/vfp/vfpdouble.c
··· 197 197 dd, d, exceptions); 198 198 vfp_put_double(dd, d); 199 199 } 200 - return exceptions & ~VFP_NAN_FLAG; 200 + return exceptions; 201 201 } 202 202 203 203 /*
+1 -1
arch/arm/vfp/vfpmodule.c
··· 180 180 * emulate it. 181 181 */ 182 182 } 183 - return exceptions; 183 + return exceptions & ~VFP_NAN_FLAG; 184 184 } 185 185 186 186 /*
+1 -1
arch/arm/vfp/vfpsingle.c
··· 203 203 vfp_put_float(sd, d); 204 204 } 205 205 206 - return exceptions & ~VFP_NAN_FLAG; 206 + return exceptions; 207 207 } 208 208 209 209 /*
+1 -1
arch/i386/kernel/cpu/intel_cacheinfo.c
··· 642 642 return; 643 643 } 644 644 645 - static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, 645 + static int cacheinfo_cpu_callback(struct notifier_block *nfb, 646 646 unsigned long action, void *hcpu) 647 647 { 648 648 unsigned int cpu = (unsigned long)hcpu;
+1
arch/ia64/kernel/entry.S
··· 1610 1610 data8 sys_get_robust_list 1611 1611 data8 sys_sync_file_range // 1300 1612 1612 data8 sys_tee 1613 + data8 sys_vmsplice 1613 1614 1614 1615 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
+1 -1
arch/ia64/kernel/palinfo.c
··· 959 959 } 960 960 } 961 961 962 - static int __devinit palinfo_cpu_callback(struct notifier_block *nfb, 962 + static int palinfo_cpu_callback(struct notifier_block *nfb, 963 963 unsigned long action, 964 964 void *hcpu) 965 965 {
+1 -1
arch/ia64/kernel/salinfo.c
··· 572 572 }; 573 573 574 574 #ifdef CONFIG_HOTPLUG_CPU 575 - static int __devinit 575 + static int 576 576 salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 577 577 { 578 578 unsigned int i, cpu = (unsigned long)hcpu;
+1 -1
arch/ia64/kernel/topology.c
··· 429 429 * When a cpu is hot-plugged, do a check and initiate 430 430 * cache kobject if necessary 431 431 */ 432 - static int __cpuinit cache_cpu_callback(struct notifier_block *nfb, 432 + static int cache_cpu_callback(struct notifier_block *nfb, 433 433 unsigned long action, void *hcpu) 434 434 { 435 435 unsigned int cpu = (unsigned long)hcpu;
+2 -62
arch/mips/kernel/linux32.c
··· 356 356 asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, 357 357 size_t count, u32 unused, u64 a4, u64 a5) 358 358 { 359 - ssize_t ret; 360 - struct file * file; 361 - ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); 362 - loff_t pos; 363 - 364 - ret = -EBADF; 365 - file = fget(fd); 366 - if (!file) 367 - goto bad_file; 368 - if (!(file->f_mode & FMODE_READ)) 369 - goto out; 370 - pos = merge_64(a4, a5); 371 - ret = rw_verify_area(READ, file, &pos, count); 372 - if (ret < 0) 373 - goto out; 374 - ret = -EINVAL; 375 - if (!file->f_op || !(read = file->f_op->read)) 376 - goto out; 377 - if (pos < 0) 378 - goto out; 379 - ret = -ESPIPE; 380 - if (!(file->f_mode & FMODE_PREAD)) 381 - goto out; 382 - ret = read(file, buf, count, &pos); 383 - if (ret > 0) 384 - dnotify_parent(file->f_dentry, DN_ACCESS); 385 - out: 386 - fput(file); 387 - bad_file: 388 - return ret; 359 + return sys_pread64(fd, buf, count, merge_64(a4, a5)); 389 360 } 390 361 391 362 asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, 392 363 size_t count, u32 unused, u64 a4, u64 a5) 393 364 { 394 - ssize_t ret; 395 - struct file * file; 396 - ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); 397 - loff_t pos; 398 - 399 - ret = -EBADF; 400 - file = fget(fd); 401 - if (!file) 402 - goto bad_file; 403 - if (!(file->f_mode & FMODE_WRITE)) 404 - goto out; 405 - pos = merge_64(a4, a5); 406 - ret = rw_verify_area(WRITE, file, &pos, count); 407 - if (ret < 0) 408 - goto out; 409 - ret = -EINVAL; 410 - if (!file->f_op || !(write = file->f_op->write)) 411 - goto out; 412 - if (pos < 0) 413 - goto out; 414 - 415 - ret = -ESPIPE; 416 - if (!(file->f_mode & FMODE_PWRITE)) 417 - goto out; 418 - 419 - ret = write(file, buf, count, &pos); 420 - if (ret > 0) 421 - dnotify_parent(file->f_dentry, DN_MODIFY); 422 - out: 423 - fput(file); 424 - bad_file: 425 - return ret; 365 + return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); 426 366 } 427 367 428 368 asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
+31
arch/parisc/Kconfig
··· 138 138 enable this option otherwise. The 64bit kernel is significantly bigger 139 139 and slower than the 32bit one. 140 140 141 + choice 142 + prompt "Kernel page size" 143 + default PARISC_PAGE_SIZE_4KB if !64BIT 144 + default PARISC_PAGE_SIZE_4KB if 64BIT 145 + # default PARISC_PAGE_SIZE_16KB if 64BIT 146 + 147 + config PARISC_PAGE_SIZE_4KB 148 + bool "4KB" 149 + help 150 + This lets you select the page size of the kernel. For best 151 + performance, a page size of 16KB is recommended. For best 152 + compatibility with 32bit applications, a page size of 4KB should be 153 + selected (the vast majority of 32bit binaries work perfectly fine 154 + with a larger page size). 155 + 156 + 4KB For best 32bit compatibility 157 + 16KB For best performance 158 + 64KB For best performance, might give more overhead. 159 + 160 + If you don't know what to do, choose 4KB. 161 + 162 + config PARISC_PAGE_SIZE_16KB 163 + bool "16KB (EXPERIMENTAL)" 164 + depends on PA8X00 && EXPERIMENTAL 165 + 166 + config PARISC_PAGE_SIZE_64KB 167 + bool "64KB (EXPERIMENTAL)" 168 + depends on PA8X00 && EXPERIMENTAL 169 + 170 + endchoice 171 + 141 172 config SMP 142 173 bool "Symmetric multi-processing support" 143 174 ---help---
+315 -179
arch/parisc/defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.16-pa6 4 - # Sun Mar 26 19:50:07 2006 3 + # Linux kernel version: 2.6.16-pa10 4 + # Sun Apr 2 15:26:38 2006 5 5 # 6 6 CONFIG_PARISC=y 7 7 CONFIG_MMU=y ··· 25 25 # CONFIG_LOCALVERSION_AUTO is not set 26 26 CONFIG_SWAP=y 27 27 CONFIG_SYSVIPC=y 28 - # CONFIG_POSIX_MQUEUE is not set 28 + CONFIG_POSIX_MQUEUE=y 29 29 # CONFIG_BSD_PROCESS_ACCT is not set 30 30 CONFIG_SYSCTL=y 31 31 # CONFIG_AUDIT is not set ··· 35 35 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 36 36 # CONFIG_EMBEDDED is not set 37 37 CONFIG_KALLSYMS=y 38 - # CONFIG_KALLSYMS_ALL is not set 38 + CONFIG_KALLSYMS_ALL=y 39 39 # CONFIG_KALLSYMS_EXTRA_PASS is not set 40 40 CONFIG_HOTPLUG=y 41 41 CONFIG_PRINTK=y ··· 57 57 # 58 58 # Loadable module support 59 59 # 60 - # CONFIG_MODULES is not set 60 + CONFIG_MODULES=y 61 + CONFIG_MODULE_UNLOAD=y 62 + CONFIG_MODULE_FORCE_UNLOAD=y 63 + CONFIG_OBSOLETE_MODPARM=y 64 + # CONFIG_MODVERSIONS is not set 65 + # CONFIG_MODULE_SRCVERSION_ALL is not set 66 + CONFIG_KMOD=y 61 67 62 68 # 63 69 # Block layer ··· 85 79 # 86 80 # Processor type and features 87 81 # 88 - CONFIG_PA7000=y 89 - # CONFIG_PA7100LC is not set 82 + # CONFIG_PA7000 is not set 83 + CONFIG_PA7100LC=y 90 84 # CONFIG_PA7200 is not set 91 85 # CONFIG_PA7300LC is not set 92 86 # CONFIG_PA8X00 is not set 93 87 CONFIG_PA11=y 88 + CONFIG_PARISC_PAGE_SIZE_4KB=y 89 + # CONFIG_PARISC_PAGE_SIZE_16KB is not set 90 + # CONFIG_PARISC_PAGE_SIZE_64KB is not set 94 91 # CONFIG_SMP is not set 95 92 CONFIG_ARCH_FLATMEM_ENABLE=y 96 - CONFIG_PREEMPT_NONE=y 97 - # CONFIG_PREEMPT_VOLUNTARY is not set 93 + # CONFIG_PREEMPT_NONE is not set 94 + CONFIG_PREEMPT_VOLUNTARY=y 98 95 # CONFIG_PREEMPT is not set 99 96 # CONFIG_HZ_100 is not set 100 97 CONFIG_HZ_250=y ··· 117 108 # Bus options (PCI, PCMCIA, EISA, GSC, ISA) 118 109 # 119 110 CONFIG_GSC=y 120 - CONFIG_HPPB=y 111 + # CONFIG_HPPB is not set 121 112 CONFIG_IOMMU_CCIO=y 122 113 CONFIG_GSC_LASI=y 123 114 CONFIG_GSC_WAX=y ··· 135 126 # 136 127 # PCCARD (PCMCIA/CardBus) support 137 128 # 138 - # CONFIG_PCCARD is not set 129 + CONFIG_PCCARD=y 130 + # CONFIG_PCMCIA_DEBUG is not set 131 + CONFIG_PCMCIA=y 132 + CONFIG_PCMCIA_LOAD_CIS=y 133 + CONFIG_PCMCIA_IOCTL=y 134 + CONFIG_CARDBUS=y 135 + 136 + # 137 + # PC-card bridges 138 + # 139 + CONFIG_YENTA=y 140 + CONFIG_YENTA_O2=y 141 + CONFIG_YENTA_RICOH=y 142 + CONFIG_YENTA_TI=y 143 + CONFIG_YENTA_ENE_TUNE=y 144 + CONFIG_YENTA_TOSHIBA=y 145 + CONFIG_PD6729=y 146 + CONFIG_I82092=y 147 + CONFIG_PCCARD_NONSTATIC=y 139 148 140 149 # 141 150 # PCI Hotplug Support ··· 172 145 # Executable file formats 173 146 # 174 147 CONFIG_BINFMT_ELF=y 175 - # CONFIG_BINFMT_MISC is not set 148 + CONFIG_BINFMT_MISC=m 176 149 177 150 # 178 151 # Networking ··· 186 159 CONFIG_PACKET=y 187 160 CONFIG_PACKET_MMAP=y 188 161 CONFIG_UNIX=y 189 - # CONFIG_NET_KEY is not set 162 + CONFIG_XFRM=y 163 + CONFIG_XFRM_USER=m 164 + CONFIG_NET_KEY=m 190 165 CONFIG_INET=y 191 166 CONFIG_IP_MULTICAST=y 192 167 # CONFIG_IP_ADVANCED_ROUTER is not set 193 168 CONFIG_IP_FIB_HASH=y 194 169 CONFIG_IP_PNP=y 195 - # CONFIG_IP_PNP_DHCP is not set 170 + CONFIG_IP_PNP_DHCP=y 196 171 CONFIG_IP_PNP_BOOTP=y 197 172 # CONFIG_IP_PNP_RARP is not set 198 173 # CONFIG_NET_IPIP is not set ··· 202 173 # CONFIG_IP_MROUTE is not set 203 174 # CONFIG_ARPD is not set 204 175 # CONFIG_SYN_COOKIES is not set 205 - # CONFIG_INET_AH is not set 206 - # CONFIG_INET_ESP is not set 176 + CONFIG_INET_AH=m 177 + CONFIG_INET_ESP=m 207 178 # CONFIG_INET_IPCOMP is not set 208 - # CONFIG_INET_TUNNEL is not set 209 - # CONFIG_INET_DIAG is not set 179 + CONFIG_INET_TUNNEL=m 180 + CONFIG_INET_DIAG=m 181 + CONFIG_INET_TCP_DIAG=m 210 182 # CONFIG_TCP_CONG_ADVANCED is not set 211 183 CONFIG_TCP_CONG_BIC=y 212 184 CONFIG_IPV6=y 213 185 # CONFIG_IPV6_PRIVACY is not set 214 - # CONFIG_INET6_AH is not set 215 - # CONFIG_INET6_ESP is not set 216 - # CONFIG_INET6_IPCOMP is not set 217 - # CONFIG_INET6_TUNNEL is not set 186 + CONFIG_INET6_AH=y 187 + CONFIG_INET6_ESP=y 188 + CONFIG_INET6_IPCOMP=y 189 + CONFIG_INET6_TUNNEL=y 218 190 # CONFIG_IPV6_TUNNEL is not set 219 191 # CONFIG_NETFILTER is not set 220 192 ··· 237 207 # CONFIG_BRIDGE is not set 238 208 # CONFIG_VLAN_8021Q is not set 239 209 # CONFIG_DECNET is not set 240 - # CONFIG_LLC2 is not set 210 + CONFIG_LLC=m 211 + CONFIG_LLC2=m 241 212 # CONFIG_IPX is not set 242 213 # CONFIG_ATALK is not set 243 214 # CONFIG_X25 is not set ··· 268 237 # 269 238 # Generic Driver Options 270 239 # 271 - CONFIG_STANDALONE=y 272 - CONFIG_PREVENT_FIRMWARE_BUILD=y 273 - # CONFIG_FW_LOADER is not set 240 + # CONFIG_STANDALONE is not set 241 + # CONFIG_PREVENT_FIRMWARE_BUILD is not set 242 + CONFIG_FW_LOADER=y 274 243 # CONFIG_DEBUG_DRIVER is not set 275 244 276 245 # ··· 287 256 # Parallel port support 288 257 # 289 258 CONFIG_PARPORT=y 290 - CONFIG_PARPORT_PC=y 259 + CONFIG_PARPORT_PC=m 291 260 # CONFIG_PARPORT_SERIAL is not set 292 261 # CONFIG_PARPORT_PC_FIFO is not set 293 262 # CONFIG_PARPORT_PC_SUPERIO is not set 263 + CONFIG_PARPORT_PC_PCMCIA=m 294 264 CONFIG_PARPORT_NOT_PC=y 295 265 CONFIG_PARPORT_GSC=y 296 - # CONFIG_PARPORT_1284 is not set 266 + CONFIG_PARPORT_1284=y 297 267 298 268 # 299 269 # Plug and Play support ··· 316 284 # CONFIG_BLK_DEV_UB is not set 317 285 CONFIG_BLK_DEV_RAM=y 318 286 CONFIG_BLK_DEV_RAM_COUNT=16 319 - CONFIG_BLK_DEV_RAM_SIZE=4096 287 + CONFIG_BLK_DEV_RAM_SIZE=6144 320 288 CONFIG_BLK_DEV_INITRD=y 321 289 # CONFIG_CDROM_PKTCDVD is not set 322 290 # CONFIG_ATA_OVER_ETH is not set ··· 324 292 # 325 293 # ATA/ATAPI/MFM/RLL support 326 294 # 327 - # CONFIG_IDE is not set 295 + CONFIG_IDE=y 296 + CONFIG_BLK_DEV_IDE=y 297 + 298 + # 299 + # Please see Documentation/ide.txt for help/info on IDE drives 300 + # 301 + # CONFIG_BLK_DEV_IDE_SATA is not set 302 + CONFIG_BLK_DEV_IDEDISK=y 303 + CONFIG_IDEDISK_MULTI_MODE=y 304 + CONFIG_BLK_DEV_IDECS=y 305 + CONFIG_BLK_DEV_IDECD=y 306 + # CONFIG_BLK_DEV_IDETAPE is not set 307 + # CONFIG_BLK_DEV_IDEFLOPPY is not set 308 + CONFIG_BLK_DEV_IDESCSI=y 309 + # CONFIG_IDE_TASK_IOCTL is not set 310 + 311 + # 312 + # IDE chipset support/bugfixes 313 + # 314 + CONFIG_IDE_GENERIC=y 315 + CONFIG_BLK_DEV_IDEPCI=y 316 + CONFIG_IDEPCI_SHARE_IRQ=y 317 + # CONFIG_BLK_DEV_OFFBOARD is not set 318 + CONFIG_BLK_DEV_GENERIC=y 319 + # CONFIG_BLK_DEV_OPTI621 is not set 320 + CONFIG_BLK_DEV_IDEDMA_PCI=y 321 + # CONFIG_BLK_DEV_IDEDMA_FORCED is not set 322 + # CONFIG_IDEDMA_PCI_AUTO is not set 323 + # CONFIG_BLK_DEV_AEC62XX is not set 324 + # CONFIG_BLK_DEV_ALI15X3 is not set 325 + # CONFIG_BLK_DEV_AMD74XX is not set 326 + # CONFIG_BLK_DEV_CMD64X is not set 327 + # CONFIG_BLK_DEV_TRIFLEX is not set 328 + # CONFIG_BLK_DEV_CY82C693 is not set 329 + # CONFIG_BLK_DEV_CS5520 is not set 330 + # CONFIG_BLK_DEV_CS5530 is not set 331 + # CONFIG_BLK_DEV_HPT34X is not set 332 + # CONFIG_BLK_DEV_HPT366 is not set 333 + # CONFIG_BLK_DEV_SC1200 is not set 334 + # CONFIG_BLK_DEV_PIIX is not set 335 + # CONFIG_BLK_DEV_IT821X is not set 336 + CONFIG_BLK_DEV_NS87415=y 337 + # CONFIG_BLK_DEV_PDC202XX_OLD is not set 338 + # CONFIG_BLK_DEV_PDC202XX_NEW is not set 339 + # CONFIG_BLK_DEV_SVWKS is not set 340 + # CONFIG_BLK_DEV_SIIMAGE is not set 341 + # CONFIG_BLK_DEV_SLC90E66 is not set 342 + # CONFIG_BLK_DEV_TRM290 is not set 343 + # CONFIG_BLK_DEV_VIA82CXXX is not set 344 + # CONFIG_IDE_ARM is not set 345 + CONFIG_BLK_DEV_IDEDMA=y 346 + # CONFIG_IDEDMA_IVB is not set 347 + # CONFIG_IDEDMA_AUTO is not set 348 + # CONFIG_BLK_DEV_HD is not set 328 349 329 350 # 330 351 # SCSI device support ··· 460 375 # CONFIG_SCSI_DEBUG is not set 461 376 462 377 # 378 + # PCMCIA SCSI adapter support 379 + # 380 + # CONFIG_PCMCIA_AHA152X is not set 381 + # CONFIG_PCMCIA_FDOMAIN is not set 382 + # CONFIG_PCMCIA_NINJA_SCSI is not set 383 + # CONFIG_PCMCIA_QLOGIC is not set 384 + # CONFIG_PCMCIA_SYM53C500 is not set 385 + 386 + # 463 387 # Multi-device support (RAID and LVM) 464 388 # 465 389 CONFIG_MD=y ··· 476 382 CONFIG_MD_LINEAR=y 477 383 CONFIG_MD_RAID0=y 478 384 CONFIG_MD_RAID1=y 479 - # CONFIG_MD_RAID10 is not set 385 + CONFIG_MD_RAID10=y 480 386 CONFIG_MD_RAID5=y 481 - # CONFIG_MD_RAID6 is not set 387 + CONFIG_MD_RAID6=y 482 388 # CONFIG_MD_MULTIPATH is not set 483 389 # CONFIG_MD_FAULTY is not set 484 - # CONFIG_BLK_DEV_DM is not set 390 + CONFIG_BLK_DEV_DM=y 391 + # CONFIG_DM_CRYPT is not set 392 + # CONFIG_DM_SNAPSHOT is not set 393 + # CONFIG_DM_MIRROR is not set 394 + # CONFIG_DM_ZERO is not set 395 + # CONFIG_DM_MULTIPATH is not set 485 396 486 397 # 487 398 # Fusion MPT device support ··· 510 411 # Network device support 511 412 # 512 413 CONFIG_NETDEVICES=y 513 - # CONFIG_DUMMY is not set 514 - # CONFIG_BONDING is not set 414 + CONFIG_DUMMY=m 415 + CONFIG_BONDING=m 515 416 # CONFIG_EQUALIZER is not set 516 - # CONFIG_TUN is not set 417 + CONFIG_TUN=m 517 418 518 419 # 519 420 # ARCnet devices ··· 529 430 # Ethernet (10 or 100Mbit) 530 431 # 531 432 CONFIG_NET_ETHERNET=y 532 - # CONFIG_MII is not set 433 + CONFIG_MII=m 533 434 CONFIG_LASI_82596=y 534 435 # CONFIG_HAPPYMEAL is not set 535 436 # CONFIG_SUNGEM is not set ··· 550 451 # CONFIG_WINBOND_840 is not set 551 452 # CONFIG_DM9102 is not set 552 453 # CONFIG_ULI526X is not set 454 + # CONFIG_PCMCIA_XIRCOM is not set 455 + # CONFIG_PCMCIA_XIRTULIP is not set 553 456 # CONFIG_DEPCA is not set 554 457 # CONFIG_HP100 is not set 555 458 CONFIG_NET_PCI=y ··· 619 518 # Obsolete Wireless cards support (pre-802.11) 620 519 # 621 520 # CONFIG_STRIP is not set 521 + # CONFIG_PCMCIA_WAVELAN is not set 522 + # CONFIG_PCMCIA_NETWAVE is not set 523 + 524 + # 525 + # Wireless 802.11 Frequency Hopping cards support 526 + # 527 + # CONFIG_PCMCIA_RAYCS is not set 622 528 623 529 # 624 530 # Wireless 802.11b ISA/PCI cards support 625 531 # 626 - # CONFIG_HERMES is not set 532 + CONFIG_HERMES=y 533 + # CONFIG_PLX_HERMES is not set 534 + # CONFIG_TMD_HERMES is not set 535 + # CONFIG_NORTEL_HERMES is not set 536 + # CONFIG_PCI_HERMES is not set 627 537 # CONFIG_ATMEL is not set 538 + 539 + # 540 + # Wireless 802.11b Pcmcia/Cardbus cards support 541 + # 542 + CONFIG_PCMCIA_HERMES=y 543 + CONFIG_PCMCIA_SPECTRUM=y 544 + # CONFIG_AIRO_CS is not set 545 + # CONFIG_PCMCIA_WL3501 is not set 628 546 629 547 # 630 548 # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support ··· 653 533 CONFIG_NET_WIRELESS=y 654 534 655 535 # 536 + # PCMCIA network device support 537 + # 538 + CONFIG_NET_PCMCIA=y 539 + # CONFIG_PCMCIA_3C589 is not set 540 + # CONFIG_PCMCIA_3C574 is not set 541 + # CONFIG_PCMCIA_FMVJ18X is not set 542 + # CONFIG_PCMCIA_PCNET is not set 543 + # CONFIG_PCMCIA_NMCLAN is not set 544 + # CONFIG_PCMCIA_SMC91C92 is not set 545 + # CONFIG_PCMCIA_XIRC2PS is not set 546 + # CONFIG_PCMCIA_AXNET is not set 547 + 548 + # 656 549 # Wan interfaces 657 550 # 658 551 # CONFIG_WAN is not set 659 552 # CONFIG_FDDI is not set 660 553 # CONFIG_HIPPI is not set 661 554 # CONFIG_PLIP is not set 662 - # CONFIG_PPP is not set 555 + CONFIG_PPP=m 556 + # CONFIG_PPP_MULTILINK is not set 557 + # CONFIG_PPP_FILTER is not set 558 + CONFIG_PPP_ASYNC=m 559 + CONFIG_PPP_SYNC_TTY=m 560 + CONFIG_PPP_DEFLATE=m 561 + CONFIG_PPP_BSDCOMP=m 562 + # CONFIG_PPP_MPPE is not set 563 + CONFIG_PPPOE=m 663 564 # CONFIG_SLIP is not set 664 565 # CONFIG_NET_FC is not set 665 566 # CONFIG_SHAPER is not set ··· 712 571 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 713 572 # CONFIG_INPUT_JOYDEV is not set 714 573 # CONFIG_INPUT_TSDEV is not set 715 - CONFIG_INPUT_EVDEV=y 574 + # CONFIG_INPUT_EVDEV is not set 716 575 # CONFIG_INPUT_EVBUG is not set 717 576 718 577 # 719 578 # Input Device Drivers 720 579 # 721 580 CONFIG_INPUT_KEYBOARD=y 722 - # CONFIG_KEYBOARD_ATKBD is not set 581 + CONFIG_KEYBOARD_ATKBD=y 582 + CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y 583 + # CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set 723 584 # CONFIG_KEYBOARD_SUNKBD is not set 724 585 # CONFIG_KEYBOARD_LKKBD is not set 725 586 # CONFIG_KEYBOARD_XTKBD is not set ··· 729 586 # CONFIG_KEYBOARD_HIL_OLD is not set 730 587 CONFIG_KEYBOARD_HIL=y 731 588 CONFIG_INPUT_MOUSE=y 732 - # CONFIG_MOUSE_PS2 is not set 733 - # CONFIG_MOUSE_SERIAL is not set 589 + CONFIG_MOUSE_PS2=y 590 + CONFIG_MOUSE_SERIAL=y 734 591 # CONFIG_MOUSE_VSXXXAA is not set 735 592 CONFIG_MOUSE_HIL=y 736 - CONFIG_INPUT_JOYSTICK=y 737 - # CONFIG_JOYSTICK_ANALOG is not set 738 - # CONFIG_JOYSTICK_A3D is not set 739 - # CONFIG_JOYSTICK_ADI is not set 740 - # CONFIG_JOYSTICK_COBRA is not set 741 - # CONFIG_JOYSTICK_GF2K is not set 742 - # CONFIG_JOYSTICK_GRIP is not set 743 - # CONFIG_JOYSTICK_GRIP_MP is not set 744 - # CONFIG_JOYSTICK_GUILLEMOT is not set 745 - # CONFIG_JOYSTICK_INTERACT is not set 746 - # CONFIG_JOYSTICK_SIDEWINDER is not set 747 - # CONFIG_JOYSTICK_TMDC is not set 748 - # CONFIG_JOYSTICK_IFORCE is not set 749 - # CONFIG_JOYSTICK_WARRIOR is not set 750 - # CONFIG_JOYSTICK_MAGELLAN is not set 751 - # CONFIG_JOYSTICK_SPACEORB is not set 752 - # CONFIG_JOYSTICK_SPACEBALL is not set 753 - # CONFIG_JOYSTICK_STINGER is not set 754 - # CONFIG_JOYSTICK_TWIDJOY is not set 755 - # CONFIG_JOYSTICK_DB9 is not set 756 - # CONFIG_JOYSTICK_GAMECON is not set 757 - # CONFIG_JOYSTICK_TURBOGRAFX is not set 758 - # CONFIG_JOYSTICK_JOYDUMP is not set 759 - CONFIG_INPUT_TOUCHSCREEN=y 760 - # CONFIG_TOUCHSCREEN_GUNZE is not set 761 - # CONFIG_TOUCHSCREEN_ELO is not set 762 - # CONFIG_TOUCHSCREEN_MTOUCH is not set 763 - # CONFIG_TOUCHSCREEN_MK712 is not set 764 - CONFIG_INPUT_MISC=y 765 - # CONFIG_INPUT_UINPUT is not set 766 - CONFIG_HP_SDC_RTC=y 593 + # CONFIG_INPUT_JOYSTICK is not set 594 + # CONFIG_INPUT_TOUCHSCREEN is not set 595 + # CONFIG_INPUT_MISC is not set 767 596 768 597 # 769 598 # Hardware I/O ports 770 599 # 771 600 CONFIG_SERIO=y 772 - # CONFIG_SERIO_SERPORT is not set 601 + CONFIG_SERIO_SERPORT=y 773 602 # CONFIG_SERIO_PARKBD is not set 774 603 CONFIG_SERIO_GSCPS2=y 775 604 CONFIG_HP_SDC=y 776 605 CONFIG_HIL_MLC=y 777 606 # CONFIG_SERIO_PCIPS2 is not set 607 + CONFIG_SERIO_LIBPS2=y 778 608 # CONFIG_SERIO_RAW is not set 779 609 # CONFIG_GAMEPORT is not set 780 610 ··· 764 648 # 765 649 CONFIG_SERIAL_8250=y 766 650 CONFIG_SERIAL_8250_CONSOLE=y 767 - CONFIG_SERIAL_8250_NR_UARTS=13 651 + CONFIG_SERIAL_8250_CS=y 652 + CONFIG_SERIAL_8250_NR_UARTS=17 768 653 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 769 654 CONFIG_SERIAL_8250_EXTENDED=y 770 655 CONFIG_SERIAL_8250_MANY_PORTS=y ··· 783 666 # CONFIG_SERIAL_JSM is not set 784 667 CONFIG_UNIX98_PTYS=y 785 668 CONFIG_LEGACY_PTYS=y 786 - CONFIG_LEGACY_PTY_COUNT=256 787 - CONFIG_PRINTER=y 669 + CONFIG_LEGACY_PTY_COUNT=64 670 + CONFIG_PRINTER=m 788 671 # CONFIG_LP_CONSOLE is not set 789 - # CONFIG_PPDEV is not set 672 + CONFIG_PPDEV=m 790 673 # CONFIG_TIPAR is not set 791 674 792 675 # ··· 799 682 # 800 683 # CONFIG_WATCHDOG is not set 801 684 CONFIG_GEN_RTC=y 802 - # CONFIG_GEN_RTC_X is not set 685 + CONFIG_GEN_RTC_X=y 803 686 # CONFIG_DTLK is not set 804 687 # CONFIG_R3964 is not set 805 688 # CONFIG_APPLICOM is not set ··· 808 691 # Ftape, the floppy tape device driver 809 692 # 810 693 # CONFIG_DRM is not set 694 + 695 + # 696 + # PCMCIA character devices 697 + # 698 + # CONFIG_SYNCLINK_CS is not set 699 + # CONFIG_CARDMAN_4000 is not set 700 + # CONFIG_CARDMAN_4040 is not set 811 701 # CONFIG_RAW_DRIVER is not set 812 702 813 703 # ··· 842 718 # 843 719 # Hardware Monitoring support 844 720 # 845 - CONFIG_HWMON=y 721 + # CONFIG_HWMON is not set 846 722 # CONFIG_HWMON_VID is not set 847 - # CONFIG_SENSORS_F71805F is not set 848 - # CONFIG_HWMON_DEBUG_CHIP is not set 849 723 850 724 # 851 725 # Misc devices ··· 871 749 CONFIG_FB_CFB_COPYAREA=y 872 750 CONFIG_FB_CFB_IMAGEBLIT=y 873 751 # CONFIG_FB_MACMODES is not set 874 - # CONFIG_FB_MODE_HELPERS is not set 875 - # CONFIG_FB_TILEBLITTING is not set 752 + CONFIG_FB_MODE_HELPERS=y 753 + CONFIG_FB_TILEBLITTING=y 876 754 # CONFIG_FB_CIRRUS is not set 877 755 # CONFIG_FB_PM2 is not set 878 756 # CONFIG_FB_CYBER2000 is not set ··· 900 778 # Console display driver support 901 779 # 902 780 CONFIG_DUMMY_CONSOLE=y 903 - CONFIG_DUMMY_CONSOLE_COLUMNS=160 904 - CONFIG_DUMMY_CONSOLE_ROWS=64 781 + CONFIG_DUMMY_CONSOLE_COLUMNS=128 782 + CONFIG_DUMMY_CONSOLE_ROWS=48 905 783 CONFIG_FRAMEBUFFER_CONSOLE=y 906 784 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 907 785 CONFIG_STI_CONSOLE=y ··· 938 816 CONFIG_SND=y 939 817 CONFIG_SND_TIMER=y 940 818 CONFIG_SND_PCM=y 819 + CONFIG_SND_HWDEP=y 941 820 CONFIG_SND_SEQUENCER=y 942 821 # CONFIG_SND_SEQ_DUMMY is not set 943 822 CONFIG_SND_OSSEMUL=y 944 823 CONFIG_SND_MIXER_OSS=y 945 824 CONFIG_SND_PCM_OSS=y 946 825 CONFIG_SND_SEQUENCER_OSS=y 947 - # CONFIG_SND_DYNAMIC_MINORS is not set 826 + CONFIG_SND_DYNAMIC_MINORS=y 948 827 CONFIG_SND_SUPPORT_OLD_API=y 949 828 # CONFIG_SND_VERBOSE_PRINTK is not set 950 829 # CONFIG_SND_DEBUG is not set ··· 953 830 # 954 831 # Generic devices 955 832 # 833 + CONFIG_SND_OPL3_LIB=y 956 834 CONFIG_SND_AC97_CODEC=y 957 835 CONFIG_SND_AC97_BUS=y 958 836 # CONFIG_SND_DUMMY is not set ··· 966 842 # PCI devices 967 843 # 968 844 CONFIG_SND_AD1889=y 969 - # CONFIG_SND_AD1889_OPL3 is not set 845 + CONFIG_SND_AD1889_OPL3=y 970 846 # CONFIG_SND_ALI5451 is not set 971 847 # CONFIG_SND_ATIIXP is not set 972 848 # CONFIG_SND_ATIIXP_MODEM is not set ··· 1014 890 # CONFIG_SND_USB_AUDIO is not set 1015 891 1016 892 # 893 + # PCMCIA devices 894 + # 895 + 896 + # 1017 897 # GSC devices 1018 898 # 1019 899 CONFIG_SND_HARMONY=y ··· 1033 905 CONFIG_USB_ARCH_HAS_HCD=y 1034 906 CONFIG_USB_ARCH_HAS_OHCI=y 1035 907 CONFIG_USB=y 1036 - CONFIG_USB_DEBUG=y 908 + # CONFIG_USB_DEBUG is not set 1037 909 1038 910 # 1039 911 # Miscellaneous USB options 1040 912 # 1041 - # CONFIG_USB_DEVICEFS is not set 913 + CONFIG_USB_DEVICEFS=y 1042 914 # CONFIG_USB_BANDWIDTH is not set 1043 915 # CONFIG_USB_DYNAMIC_MINORS is not set 1044 916 # CONFIG_USB_OTG is not set ··· 1046 918 # 1047 919 # USB Host Controller Drivers 1048 920 # 1049 - CONFIG_USB_EHCI_HCD=y 1050 - # CONFIG_USB_EHCI_SPLIT_ISO is not set 1051 - # CONFIG_USB_EHCI_ROOT_HUB_TT is not set 921 + # CONFIG_USB_EHCI_HCD is not set 1052 922 # CONFIG_USB_ISP116X_HCD is not set 1053 923 CONFIG_USB_OHCI_HCD=y 1054 924 # CONFIG_USB_OHCI_BIG_ENDIAN is not set 1055 925 CONFIG_USB_OHCI_LITTLE_ENDIAN=y 1056 - # CONFIG_USB_UHCI_HCD is not set 926 + CONFIG_USB_UHCI_HCD=y 1057 927 # CONFIG_USB_SL811_HCD is not set 1058 928 1059 929 # ··· 1074 948 # 1075 949 # USB Input Devices 1076 950 # 1077 - # CONFIG_USB_HID is not set 1078 - 1079 - # 1080 - # USB HID Boot Protocol drivers 1081 - # 1082 - # CONFIG_USB_KBD is not set 1083 - # CONFIG_USB_MOUSE is not set 951 + CONFIG_USB_HID=y 952 + CONFIG_USB_HIDINPUT=y 953 + # CONFIG_USB_HIDINPUT_POWERBOOK is not set 954 + # CONFIG_HID_FF is not set 955 + # CONFIG_USB_HIDDEV is not set 1084 956 # CONFIG_USB_AIPTEK is not set 1085 957 # CONFIG_USB_WACOM is not set 1086 958 # CONFIG_USB_ACECAD is not set ··· 1144 1020 # CONFIG_USB_PHIDGETKIT is not set 1145 1021 # CONFIG_USB_PHIDGETSERVO is not set 1146 1022 # CONFIG_USB_IDMOUSE is not set 1147 - # CONFIG_USB_SISUSBVGA is not set 1148 1023 # CONFIG_USB_LD is not set 1024 + # CONFIG_USB_TEST is not set 1149 1025 1150 1026 # 1151 1027 # USB DSL modem support ··· 1182 1058 # CONFIG_JBD_DEBUG is not set 1183 1059 # CONFIG_REISERFS_FS is not set 1184 1060 # CONFIG_JFS_FS is not set 1185 - # CONFIG_FS_POSIX_ACL is not set 1061 + CONFIG_FS_POSIX_ACL=y 1186 1062 # CONFIG_XFS_FS is not set 1187 1063 # CONFIG_OCFS2_FS is not set 1188 1064 # CONFIG_MINIX_FS is not set ··· 1190 1066 CONFIG_INOTIFY=y 1191 1067 # CONFIG_QUOTA is not set 1192 1068 CONFIG_DNOTIFY=y 1193 - # CONFIG_AUTOFS_FS is not set 1069 + CONFIG_AUTOFS_FS=y 1194 1070 # CONFIG_AUTOFS4_FS is not set 1195 1071 # CONFIG_FUSE_FS is not set 1196 1072 ··· 1205 1081 # 1206 1082 # DOS/FAT/NT Filesystems 1207 1083 # 1084 + CONFIG_FAT_FS=y 1208 1085 # CONFIG_MSDOS_FS is not set 1209 - # CONFIG_VFAT_FS is not set 1086 + CONFIG_VFAT_FS=y 1087 + CONFIG_FAT_DEFAULT_CODEPAGE=437 1088 + CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1210 1089 # CONFIG_NTFS_FS is not set 1211 1090 1212 1091 # ··· 1252 1125 CONFIG_NFSD=y 1253 1126 CONFIG_NFSD_V3=y 1254 1127 # CONFIG_NFSD_V3_ACL is not set 1255 - # CONFIG_NFSD_V4 is not set 1128 + CONFIG_NFSD_V4=y 1256 1129 CONFIG_NFSD_TCP=y 1257 1130 CONFIG_ROOT_NFS=y 1258 1131 CONFIG_LOCKD=y ··· 1260 1133 CONFIG_EXPORTFS=y 1261 1134 CONFIG_NFS_COMMON=y 1262 1135 CONFIG_SUNRPC=y 1263 - # CONFIG_RPCSEC_GSS_KRB5 is not set 1264 - # CONFIG_RPCSEC_GSS_SPKM3 is not set 1265 - # CONFIG_SMB_FS is not set 1266 - # CONFIG_CIFS is not set 1136 + CONFIG_SUNRPC_GSS=y 1137 + CONFIG_RPCSEC_GSS_KRB5=y 1138 + CONFIG_RPCSEC_GSS_SPKM3=m 1139 + CONFIG_SMB_FS=m 1140 + CONFIG_SMB_NLS_DEFAULT=y 1141 + CONFIG_SMB_NLS_REMOTE="cp437" 1142 + CONFIG_CIFS=m 1143 + # CONFIG_CIFS_STATS is not set 1144 + # CONFIG_CIFS_XATTR is not set 1145 + # CONFIG_CIFS_EXPERIMENTAL is not set 1267 1146 # CONFIG_NCP_FS is not set 1268 1147 # CONFIG_CODA_FS is not set 1269 1148 # CONFIG_AFS_FS is not set ··· 1286 1153 # 1287 1154 CONFIG_NLS=y 1288 1155 CONFIG_NLS_DEFAULT="iso8859-1" 1289 - # CONFIG_NLS_CODEPAGE_437 is not set 1290 - # CONFIG_NLS_CODEPAGE_737 is not set 1291 - # CONFIG_NLS_CODEPAGE_775 is not set 1292 - # CONFIG_NLS_CODEPAGE_850 is not set 1293 - # CONFIG_NLS_CODEPAGE_852 is not set 1294 - # CONFIG_NLS_CODEPAGE_855 is not set 1295 - # CONFIG_NLS_CODEPAGE_857 is not set 1296 - # CONFIG_NLS_CODEPAGE_860 is not set 1297 - # CONFIG_NLS_CODEPAGE_861 is not set 1298 - # CONFIG_NLS_CODEPAGE_862 is not set 1299 - # CONFIG_NLS_CODEPAGE_863 is not set 1300 - # CONFIG_NLS_CODEPAGE_864 is not set 1301 - # CONFIG_NLS_CODEPAGE_865 is not set 1302 - # CONFIG_NLS_CODEPAGE_866 is not set 1303 - # CONFIG_NLS_CODEPAGE_869 is not set 1304 - # CONFIG_NLS_CODEPAGE_936 is not set 1305 - # CONFIG_NLS_CODEPAGE_950 is not set 1306 - # CONFIG_NLS_CODEPAGE_932 is not set 1307 - # CONFIG_NLS_CODEPAGE_949 is not set 1308 - # CONFIG_NLS_CODEPAGE_874 is not set 1309 - # CONFIG_NLS_ISO8859_8 is not set 1310 - # CONFIG_NLS_CODEPAGE_1250 is not set 1311 - # CONFIG_NLS_CODEPAGE_1251 is not set 1312 - # CONFIG_NLS_ASCII is not set 1313 - # CONFIG_NLS_ISO8859_1 is not set 1314 - # CONFIG_NLS_ISO8859_2 is not set 1315 - # CONFIG_NLS_ISO8859_3 is not set 1316 - # CONFIG_NLS_ISO8859_4 is not set 1317 - # CONFIG_NLS_ISO8859_5 is not set 1318 - # CONFIG_NLS_ISO8859_6 is not set 1319 - # CONFIG_NLS_ISO8859_7 is not set 1320 - # CONFIG_NLS_ISO8859_9 is not set 1321 - # CONFIG_NLS_ISO8859_13 is not set 1322 - # CONFIG_NLS_ISO8859_14 is not set 1323 - # CONFIG_NLS_ISO8859_15 is not set 1324 - # CONFIG_NLS_KOI8_R is not set 1325 - # CONFIG_NLS_KOI8_U is not set 1326 - # CONFIG_NLS_UTF8 is not set 1156 + CONFIG_NLS_CODEPAGE_437=y 1157 + CONFIG_NLS_CODEPAGE_737=m 1158 + CONFIG_NLS_CODEPAGE_775=m 1159 + CONFIG_NLS_CODEPAGE_850=m 1160 + CONFIG_NLS_CODEPAGE_852=m 1161 + CONFIG_NLS_CODEPAGE_855=m 1162 + CONFIG_NLS_CODEPAGE_857=m 1163 + CONFIG_NLS_CODEPAGE_860=m 1164 + CONFIG_NLS_CODEPAGE_861=m 1165 + CONFIG_NLS_CODEPAGE_862=m 1166 + CONFIG_NLS_CODEPAGE_863=m 1167 + CONFIG_NLS_CODEPAGE_864=m 1168 + CONFIG_NLS_CODEPAGE_865=m 1169 + CONFIG_NLS_CODEPAGE_866=m 1170 + CONFIG_NLS_CODEPAGE_869=m 1171 + CONFIG_NLS_CODEPAGE_936=m 1172 + CONFIG_NLS_CODEPAGE_950=m 1173 + CONFIG_NLS_CODEPAGE_932=m 1174 + CONFIG_NLS_CODEPAGE_949=m 1175 + CONFIG_NLS_CODEPAGE_874=m 1176 + CONFIG_NLS_ISO8859_8=m 1177 + CONFIG_NLS_CODEPAGE_1250=y 1178 + CONFIG_NLS_CODEPAGE_1251=m 1179 + CONFIG_NLS_ASCII=m 1180 + CONFIG_NLS_ISO8859_1=y 1181 + CONFIG_NLS_ISO8859_2=m 1182 + CONFIG_NLS_ISO8859_3=m 1183 + CONFIG_NLS_ISO8859_4=m 1184 + CONFIG_NLS_ISO8859_5=m 1185 + CONFIG_NLS_ISO8859_6=m 1186 + CONFIG_NLS_ISO8859_7=m 1187 + CONFIG_NLS_ISO8859_9=m 1188 + CONFIG_NLS_ISO8859_13=m 1189 + CONFIG_NLS_ISO8859_14=m 1190 + CONFIG_NLS_ISO8859_15=m 1191 + CONFIG_NLS_KOI8_R=m 1192 + CONFIG_NLS_KOI8_U=m 1193 + CONFIG_NLS_UTF8=y 1327 1194 1328 1195 # 1329 1196 # Profiling support 1330 1197 # 1331 1198 CONFIG_PROFILING=y 1332 - CONFIG_OPROFILE=y 1199 + CONFIG_OPROFILE=m 1333 1200 1334 1201 # 1335 1202 # Kernel hacking ··· 1337 1204 # CONFIG_PRINTK_TIME is not set 1338 1205 CONFIG_MAGIC_SYSRQ=y 1339 1206 CONFIG_DEBUG_KERNEL=y 1340 - CONFIG_LOG_BUF_SHIFT=15 1207 + CONFIG_LOG_BUF_SHIFT=16 1341 1208 CONFIG_DETECT_SOFTLOCKUP=y 1342 1209 # CONFIG_SCHEDSTATS is not set 1343 1210 # CONFIG_DEBUG_SLAB is not set ··· 1350 1217 # CONFIG_DEBUG_VM is not set 1351 1218 CONFIG_FORCED_INLINING=y 1352 1219 # CONFIG_RCU_TORTURE_TEST is not set 1353 - CONFIG_DEBUG_RODATA=y 1220 + # CONFIG_DEBUG_RODATA is not set 1354 1221 1355 1222 # 1356 1223 # Security options 1357 1224 # 1358 - # CONFIG_KEYS is not set 1225 + CONFIG_KEYS=y 1226 + CONFIG_KEYS_DEBUG_PROC_KEYS=y 1359 1227 # CONFIG_SECURITY is not set 1360 1228 1361 1229 # 1362 1230 # Cryptographic options 1363 1231 # 1364 1232 CONFIG_CRYPTO=y 1365 - # CONFIG_CRYPTO_HMAC is not set 1366 - # CONFIG_CRYPTO_NULL is not set 1367 - # CONFIG_CRYPTO_MD4 is not set 1368 - # CONFIG_CRYPTO_MD5 is not set 1369 - # CONFIG_CRYPTO_SHA1 is not set 1370 - # CONFIG_CRYPTO_SHA256 is not set 1371 - # CONFIG_CRYPTO_SHA512 is not set 1372 - # CONFIG_CRYPTO_WP512 is not set 1373 - # CONFIG_CRYPTO_TGR192 is not set 1374 - # CONFIG_CRYPTO_DES is not set 1375 - # CONFIG_CRYPTO_BLOWFISH is not set 1376 - # CONFIG_CRYPTO_TWOFISH is not set 1377 - # CONFIG_CRYPTO_SERPENT is not set 1378 - # CONFIG_CRYPTO_AES is not set 1379 - # CONFIG_CRYPTO_CAST5 is not set 1380 - # CONFIG_CRYPTO_CAST6 is not set 1381 - # CONFIG_CRYPTO_TEA is not set 1382 - # CONFIG_CRYPTO_ARC4 is not set 1383 - # CONFIG_CRYPTO_KHAZAD is not set 1384 - # CONFIG_CRYPTO_ANUBIS is not set 1385 - # CONFIG_CRYPTO_DEFLATE is not set 1386 - # CONFIG_CRYPTO_MICHAEL_MIC is not set 1387 - # CONFIG_CRYPTO_CRC32C is not set 1388 - # CONFIG_CRYPTO_TEST is not set 1233 + CONFIG_CRYPTO_HMAC=y 1234 + CONFIG_CRYPTO_NULL=m 1235 + CONFIG_CRYPTO_MD4=m 1236 + CONFIG_CRYPTO_MD5=y 1237 + CONFIG_CRYPTO_SHA1=y 1238 + CONFIG_CRYPTO_SHA256=m 1239 + CONFIG_CRYPTO_SHA512=m 1240 + CONFIG_CRYPTO_WP512=m 1241 + CONFIG_CRYPTO_TGR192=m 1242 + CONFIG_CRYPTO_DES=y 1243 + CONFIG_CRYPTO_BLOWFISH=m 1244 + CONFIG_CRYPTO_TWOFISH=m 1245 + CONFIG_CRYPTO_SERPENT=m 1246 + CONFIG_CRYPTO_AES=m 1247 + CONFIG_CRYPTO_CAST5=m 1248 + CONFIG_CRYPTO_CAST6=m 1249 + CONFIG_CRYPTO_TEA=m 1250 + CONFIG_CRYPTO_ARC4=m 1251 + CONFIG_CRYPTO_KHAZAD=m 1252 + CONFIG_CRYPTO_ANUBIS=m 1253 + CONFIG_CRYPTO_DEFLATE=y 1254 + CONFIG_CRYPTO_MICHAEL_MIC=m 1255 + CONFIG_CRYPTO_CRC32C=m 1256 + CONFIG_CRYPTO_TEST=m 1389 1257 1390 1258 # 1391 1259 # Hardware crypto devices ··· 1395 1261 # 1396 1262 # Library routines 1397 1263 # 1398 - # CONFIG_CRC_CCITT is not set 1264 + CONFIG_CRC_CCITT=m 1399 1265 # CONFIG_CRC16 is not set 1400 1266 CONFIG_CRC32=y 1401 - # CONFIG_LIBCRC32C is not set 1267 + CONFIG_LIBCRC32C=m 1268 + CONFIG_ZLIB_INFLATE=y 1269 + CONFIG_ZLIB_DEFLATE=y
+3
arch/parisc/kernel/asm-offsets.c
··· 288 288 DEFINE(ASM_PGD_ENTRY_SIZE, PGD_ENTRY_SIZE); 289 289 DEFINE(ASM_PMD_ENTRY_SIZE, PMD_ENTRY_SIZE); 290 290 DEFINE(ASM_PTE_ENTRY_SIZE, PTE_ENTRY_SIZE); 291 + DEFINE(ASM_PFN_PTE_SHIFT, PFN_PTE_SHIFT); 291 292 DEFINE(ASM_PT_INITIAL, PT_INITIAL); 292 293 DEFINE(ASM_PAGE_SIZE, PAGE_SIZE); 294 + DEFINE(ASM_PAGE_SIZE_DIV64, PAGE_SIZE/64); 295 + DEFINE(ASM_PAGE_SIZE_DIV128, PAGE_SIZE/128); 293 296 BLANK(); 294 297 DEFINE(EXCDATA_IP, offsetof(struct exception_data, fault_ip)); 295 298 DEFINE(EXCDATA_SPACE, offsetof(struct exception_data, fault_space));
+2 -2
arch/parisc/kernel/cache.c
··· 4 4 * License. See the file "COPYING" in the main directory of this archive 5 5 * for more details. 6 6 * 7 - * Copyright (C) 1999 Helge Deller (07-13-1999) 7 + * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999) 8 8 * Copyright (C) 1999 SuSE GmbH Nuernberg 9 9 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org) 10 10 * ··· 358 358 if (!parisc_cache_flush_threshold) 359 359 parisc_cache_flush_threshold = FLUSH_THRESHOLD; 360 360 361 - printk("Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus()); 361 + printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus()); 362 362 }
+22 -14
arch/parisc/kernel/entry.S
··· 502 502 * all ILP32 processes and all the kernel for machines with 503 503 * under 4GB of memory) */ 504 504 .macro L3_ptep pgd,pte,index,va,fault 505 + #if PT_NLEVELS == 3 /* we might have a 2-Level scheme, e.g. with 16kb page size */ 505 506 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index 506 507 copy %r0,\pte 507 - extrd,u,*= \va,31,32,%r0 508 + extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0 508 509 ldw,s \index(\pgd),\pgd 509 - extrd,u,*= \va,31,32,%r0 510 + extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0 510 511 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault 511 - extrd,u,*= \va,31,32,%r0 512 + extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0 512 513 shld \pgd,PxD_VALUE_SHIFT,\index 513 - extrd,u,*= \va,31,32,%r0 514 + extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0 514 515 copy \index,\pgd 515 - extrd,u,*<> \va,31,32,%r0 516 + extrd,u,*<> \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0 516 517 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd 518 + #endif 517 519 L2_ptep \pgd,\pte,\index,\va,\fault 518 520 .endm 519 521 ··· 565 563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0 566 564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */ 567 565 568 - /* Get rid of prot bits and convert to page addr for iitlbt and idtlbt */ 566 + /* Enforce uncacheable pages. 567 + * This should ONLY be use for MMIO on PA 2.0 machines. 568 + * Memory/DMA is cache coherent on all PA2.0 machines we support 569 + * (that means T-class is NOT supported) and the memory controllers 570 + * on most of those machines only handles cache transactions. 571 + */ 572 + extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0 573 + depi 1,12,1,\prot 569 574 570 - depd %r0,63,PAGE_SHIFT,\pte 571 - extrd,s \pte,(63-PAGE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 575 + /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ 576 + extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 577 + depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte 572 578 .endm 573 579 574 580 /* Identical macro to make_insert_tlb above, except it ··· 594 584 595 585 /* Get rid of prot bits and convert to page addr for iitlba */ 596 586 597 - depi 0,31,PAGE_SHIFT,\pte 587 + depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte 598 588 extru \pte,24,25,\pte 599 - 600 589 .endm 601 590 602 591 /* This is for ILP32 PA2.0 only. The TLB insertion needs ··· 1210 1201 */ 1211 1202 1212 1203 /* adjust isr/ior. */ 1213 - 1214 - extrd,u %r16,63,7,%r1 /* get high bits from isr for ior */ 1215 - depd %r1,31,7,%r17 /* deposit them into ior */ 1216 - depdi 0,63,7,%r16 /* clear them from isr */ 1204 + extrd,u %r16,63,SPACEID_SHIFT,%r1 /* get high bits from isr for ior */ 1205 + depd %r1,31,SPACEID_SHIFT,%r17 /* deposit them into ior */ 1206 + depdi 0,63,SPACEID_SHIFT,%r16 /* clear them from isr */ 1217 1207 #endif 1218 1208 STREG %r16, PT_ISR(%r29) 1219 1209 STREG %r17, PT_IOR(%r29)
+8 -7
arch/parisc/kernel/head.S
··· 76 76 mtctl %r4,%cr24 /* Initialize kernel root pointer */ 77 77 mtctl %r4,%cr25 /* Initialize user root pointer */ 78 78 79 - #ifdef CONFIG_64BIT 79 + #if PT_NLEVELS == 3 80 80 /* Set pmd in pgd */ 81 81 load32 PA(pmd0),%r5 82 82 shrd %r5,PxD_VALUE_SHIFT,%r3 83 - ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 83 + ldo (PxD_FLAG_PRESENT+PxD_FLAG_VALID)(%r3),%r3 84 84 stw %r3,ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4) 85 85 ldo ASM_PMD_ENTRY*ASM_PMD_ENTRY_SIZE(%r5),%r4 86 86 #else 87 87 /* 2-level page table, so pmd == pgd */ 88 - ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 88 + ldo ASM_PGD_ENTRY*ASM_PGD_ENTRY_SIZE(%r4),%r4 89 89 #endif 90 90 91 91 /* Fill in pmd with enough pte directories */ ··· 99 99 stw %r3,0(%r4) 100 100 ldo (ASM_PAGE_SIZE >> PxD_VALUE_SHIFT)(%r3),%r3 101 101 addib,> -1,%r1,1b 102 - #ifdef CONFIG_64BIT 102 + #if PT_NLEVELS == 3 103 103 ldo ASM_PMD_ENTRY_SIZE(%r4),%r4 104 104 #else 105 105 ldo ASM_PGD_ENTRY_SIZE(%r4),%r4 ··· 107 107 108 108 109 109 /* Now initialize the PTEs themselves */ 110 - ldo _PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ 110 + ldo 0+_PAGE_KERNEL(%r0),%r3 /* Hardwired 0 phys addr start */ 111 + ldi (1<<(KERNEL_INITIAL_ORDER-PAGE_SHIFT)),%r11 /* PFN count */ 111 112 load32 PA(pg0),%r1 112 113 113 114 $pgt_fill_loop: 114 115 STREGM %r3,ASM_PTE_ENTRY_SIZE(%r1) 115 - ldo ASM_PAGE_SIZE(%r3),%r3 116 - bb,>= %r3,31-KERNEL_INITIAL_ORDER,$pgt_fill_loop 116 + ldo (1<<PFN_PTE_SHIFT)(%r3),%r3 /* add one PFN */ 117 + addib,> -1,%r11,$pgt_fill_loop 117 118 nop 118 119 119 120 /* Load the return address...er...crash 'n burn */
+5 -5
arch/parisc/kernel/init_task.c
··· 53 53 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) = 54 54 { INIT_THREAD_INFO(init_task) }; 55 55 56 - #ifdef __LP64__ 56 + #if PT_NLEVELS == 3 57 57 /* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout 58 58 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually 59 59 * guarantee that global objects will be laid out in memory in the same order 60 60 * as the order of declaration, so put these in different sections and use 61 61 * the linker script to order them. */ 62 - pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pmd"))) = { {0}, }; 63 - 62 + pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE))); 64 63 #endif 65 - pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pgd"))) = { {0}, }; 66 - pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pte"))) = { {0}, }; 64 + 65 + pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE))); 66 + pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE))); 67 67 68 68 /* 69 69 * Initial task structure.
+12 -13
arch/parisc/kernel/pacache.S
··· 65 65 */ 66 66 67 67 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */ 68 - rsm PSW_SM_I, %r19 /* save I-bit state */ 68 + rsm PSW_SM_I, %r19 /* save I-bit state */ 69 69 load32 PA(1f), %r1 70 70 nop 71 71 nop ··· 84 84 rfi 85 85 nop 86 86 87 - 1: ldil L%PA(cache_info), %r1 88 - ldo R%PA(cache_info)(%r1), %r1 87 + 1: load32 PA(cache_info), %r1 89 88 90 89 /* Flush Instruction Tlb */ 91 90 ··· 211 212 .entry 212 213 213 214 mtsp %r0, %sr1 214 - ldil L%cache_info, %r1 215 - ldo R%cache_info(%r1), %r1 215 + load32 cache_info, %r1 216 216 217 217 /* Flush Instruction Cache */ 218 218 ··· 252 254 .entry 253 255 254 256 mtsp %r0, %sr1 255 - ldil L%cache_info, %r1 256 - ldo R%cache_info(%r1), %r1 257 + load32 cache_info, %r1 257 258 258 259 /* Flush Data Cache */ 259 260 ··· 300 303 */ 301 304 302 305 ldd 0(%r25), %r19 303 - ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 306 + ldi ASM_PAGE_SIZE_DIV128, %r1 307 + 304 308 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */ 305 309 ldw 128(%r25), %r0 /* prefetch 2 */ 306 310 ··· 366 368 * use ldd/std on a 32 bit kernel. 367 369 */ 368 370 ldw 0(%r25), %r19 369 - ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 371 + ldi ASM_PAGE_SIZE_DIV64, %r1 370 372 371 373 1: 372 374 ldw 4(%r25), %r20 ··· 459 461 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */ 460 462 461 463 ldil L%(TMPALIAS_MAP_START), %r28 464 + /* FIXME for different page sizes != 4k */ 462 465 #ifdef CONFIG_64BIT 463 466 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */ 464 467 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */ ··· 550 551 #ifdef CONFIG_64BIT 551 552 #if (TMPALIAS_MAP_START >= 0x80000000) 552 553 depdi 0, 31,32, %r28 /* clear any sign extension */ 554 + /* FIXME: page size dependend */ 553 555 #endif 554 556 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */ 555 557 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */ ··· 566 566 pdtlb 0(%r28) 567 567 568 568 #ifdef CONFIG_64BIT 569 - ldi 32, %r1 /* PAGE_SIZE/128 == 32 */ 569 + ldi ASM_PAGE_SIZE_DIV128, %r1 570 570 571 571 /* PREFETCH (Write) has not (yet) been proven to help here */ 572 - /* #define PREFETCHW_OP ldd 256(%0), %r0 */ 572 + /* #define PREFETCHW_OP ldd 256(%0), %r0 */ 573 573 574 574 1: std %r0, 0(%r28) 575 575 std %r0, 8(%r28) ··· 591 591 ldo 128(%r28), %r28 592 592 593 593 #else /* ! CONFIG_64BIT */ 594 - 595 - ldi 64, %r1 /* PAGE_SIZE/64 == 64 */ 594 + ldi ASM_PAGE_SIZE_DIV64, %r1 596 595 597 596 1: 598 597 stw %r0, 0(%r28)
+8
arch/parisc/kernel/sys_parisc.c
··· 231 231 (loff_t)high_len << 32 | low_len, advice); 232 232 } 233 233 234 + asmlinkage long parisc_sync_file_range(int fd, 235 + u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes, 236 + unsigned int flags) 237 + { 238 + return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off, 239 + (loff_t)hi_nbytes << 32 | lo_nbytes, flags); 240 + } 241 + 234 242 asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag) 235 243 { 236 244 return -ENOMEM;
+5 -5
arch/parisc/kernel/syscall.S
··· 55 55 * pointers. 56 56 */ 57 57 58 - .align 4096 58 + .align ASM_PAGE_SIZE 59 59 linux_gateway_page: 60 60 61 61 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */ ··· 632 632 end_compare_and_swap: 633 633 634 634 /* Make sure nothing else is placed on this page */ 635 - .align 4096 635 + .align ASM_PAGE_SIZE 636 636 .export end_linux_gateway_page 637 637 end_linux_gateway_page: 638 638 ··· 652 652 653 653 .section .rodata,"a" 654 654 655 - .align 4096 655 + .align ASM_PAGE_SIZE 656 656 /* Light-weight-syscall table */ 657 657 /* Start of lws table. */ 658 658 .export lws_table ··· 662 662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */ 663 663 /* End of lws table */ 664 664 665 - .align 4096 665 + .align ASM_PAGE_SIZE 666 666 .export sys_call_table 667 667 .Lsys_call_table: 668 668 sys_call_table: 669 669 #include "syscall_table.S" 670 670 671 671 #ifdef CONFIG_64BIT 672 - .align 4096 672 + .align ASM_PAGE_SIZE 673 673 .export sys_call_table64 674 674 .Lsys_call_table64: 675 675 sys_call_table64:
+7 -1
arch/parisc/kernel/syscall_table.S
··· 13 13 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org> 14 14 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org> 15 15 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 16 - * 16 + * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org> 17 17 * 18 18 * This program is free software; you can redistribute it and/or modify 19 19 * it under the terms of the GNU General Public License as published by ··· 393 393 ENTRY_SAME(readlinkat) /* 285 */ 394 394 ENTRY_SAME(fchmodat) 395 395 ENTRY_SAME(faccessat) 396 + ENTRY_SAME(unshare) 397 + ENTRY_COMP(set_robust_list) 398 + ENTRY_COMP(get_robust_list) /* 290 */ 399 + ENTRY_SAME(splice) 400 + ENTRY_OURS(sync_file_range) 401 + ENTRY_SAME(tee) 396 402 /* Nothing yet */ 397 403
+32 -22
arch/parisc/kernel/vmlinux.lds.S
··· 6 6 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org> 7 7 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 8 8 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org> 9 + * Copyright (C) 2006 Helge Deller <deller@gmx.de> 9 10 * 10 11 * 11 12 * This program is free software; you can redistribute it and/or modify ··· 28 27 /* needed for the processor specific cache alignment size */ 29 28 #include <asm/cache.h> 30 29 #include <asm/page.h> 30 + #include <asm/asm-offsets.h> 31 31 32 32 /* ld script to make hppa Linux kernel */ 33 33 #ifndef CONFIG_64BIT ··· 70 68 RODATA 71 69 72 70 /* writeable */ 73 - . = ALIGN(4096); /* Make sure this is page aligned so 71 + . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so 74 72 that we can properly leave these 75 73 as writable */ 76 74 data_start = .; ··· 83 81 __start___unwind = .; /* unwind info */ 84 82 .PARISC.unwind : { *(.PARISC.unwind) } 85 83 __stop___unwind = .; 86 - 84 + 85 + /* rarely changed data like cpu maps */ 86 + . = ALIGN(16); 87 + .data.read_mostly : { *(.data.read_mostly) } 88 + 89 + . = ALIGN(L1_CACHE_BYTES); 87 90 .data : { /* Data */ 88 91 *(.data) 89 - *(.data.vm0.pmd) 90 - *(.data.vm0.pgd) 91 - *(.data.vm0.pte) 92 92 CONSTRUCTORS 93 93 } 94 - 95 - . = ALIGN(4096); 96 - /* nosave data is really only used for software suspend...it's here 97 - * just in case we ever implement it */ 98 - __nosave_begin = .; 99 - .data_nosave : { *(.data.nosave) } 100 - . = ALIGN(4096); 101 - __nosave_end = .; 102 94 103 95 . = ALIGN(L1_CACHE_BYTES); 104 96 .data.cacheline_aligned : { *(.data.cacheline_aligned) } ··· 101 105 . = ALIGN(16); 102 106 .data.lock_aligned : { *(.data.lock_aligned) } 103 107 104 - /* rarely changed data like cpu maps */ 105 - . = ALIGN(16); 106 - .data.read_mostly : { *(.data.read_mostly) } 108 + . = ALIGN(ASM_PAGE_SIZE); 109 + /* nosave data is really only used for software suspend...it's here 110 + * just in case we ever implement it */ 111 + __nosave_begin = .; 112 + .data_nosave : { *(.data.nosave) } 113 + . = ALIGN(ASM_PAGE_SIZE); 114 + __nosave_end = .; 107 115 108 116 _edata = .; /* End of data section */ 109 117 118 + __bss_start = .; /* BSS */ 119 + /* page table entries need to be PAGE_SIZE aligned */ 120 + . = ALIGN(ASM_PAGE_SIZE); 121 + .data.vmpages : { 122 + *(.data.vm0.pmd) 123 + *(.data.vm0.pgd) 124 + *(.data.vm0.pte) 125 + } 126 + .bss : { *(.bss) *(COMMON) } 127 + __bss_stop = .; 128 + 129 + 130 + /* assembler code expects init_task to be 16k aligned */ 110 131 . = ALIGN(16384); /* init_task */ 111 132 .data.init_task : { *(.data.init_task) } 112 133 ··· 139 126 .dlt : { *(.dlt) } 140 127 #endif 141 128 129 + /* reserve space for interrupt stack by aligning __init* to 16k */ 142 130 . = ALIGN(16384); 143 131 __init_begin = .; 144 132 .init.text : { ··· 180 166 from .altinstructions and .eh_frame */ 181 167 .exit.text : { *(.exit.text) } 182 168 .exit.data : { *(.exit.data) } 183 - . = ALIGN(4096); 169 + . = ALIGN(ASM_PAGE_SIZE); 184 170 __initramfs_start = .; 185 171 .init.ramfs : { *(.init.ramfs) } 186 172 __initramfs_end = .; ··· 188 174 __per_cpu_start = .; 189 175 .data.percpu : { *(.data.percpu) } 190 176 __per_cpu_end = .; 191 - . = ALIGN(4096); 177 + . = ALIGN(ASM_PAGE_SIZE); 192 178 __init_end = .; 193 179 /* freed after init ends here */ 194 180 195 - __bss_start = .; /* BSS */ 196 - .bss : { *(.bss) *(COMMON) } 197 - __bss_stop = .; 198 - 199 181 _end = . ; 200 182 201 183 /* Sections to be discarded */
+1 -1
arch/parisc/mm/fault.c
··· 186 186 break; 187 187 case VM_FAULT_SIGBUS: 188 188 /* 189 - * We hit a hared mapping outside of the file, or some 189 + * We hit a shared mapping outside of the file, or some 190 190 * other thing happened to us that made us unable to 191 191 * handle the page fault gracefully. 192 192 */
+15 -13
arch/parisc/mm/init.c
··· 6 6 * changed by Philipp Rumpf 7 7 * Copyright 1999 Philipp Rumpf (prumpf@tux.org) 8 8 * Copyright 2004 Randolph Chung (tausq@debian.org) 9 + * Copyright 2006 Helge Deller (deller@gmx.de) 9 10 * 10 11 */ 11 12 ··· 372 371 373 372 void free_initmem(void) 374 373 { 375 - unsigned long addr; 376 - 374 + unsigned long addr, init_begin, init_end; 375 + 377 376 printk(KERN_INFO "Freeing unused kernel memory: "); 378 377 379 378 #ifdef CONFIG_DEBUG_KERNEL ··· 396 395 local_irq_enable(); 397 396 #endif 398 397 399 - addr = (unsigned long)(&__init_begin); 400 - for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { 398 + /* align __init_begin and __init_end to page size, 399 + ignoring linker script where we might have tried to save RAM */ 400 + init_begin = PAGE_ALIGN((unsigned long)(&__init_begin)); 401 + init_end = PAGE_ALIGN((unsigned long)(&__init_end)); 402 + for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { 401 403 ClearPageReserved(virt_to_page(addr)); 402 404 init_page_count(virt_to_page(addr)); 403 405 free_page(addr); ··· 411 407 /* set up a new led state on systems shipped LED State panel */ 412 408 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); 413 409 414 - printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10); 410 + printk("%luk freed\n", (init_end - init_begin) >> 10); 415 411 } 416 412 417 413 ··· 643 639 * Map the fault vector writable so we can 644 640 * write the HPMC checksum. 645 641 */ 642 + #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) 646 643 if (address >= ro_start && address < ro_end 647 644 && address != fv_addr 648 645 && address != gw_addr) 649 646 pte = __mk_pte(address, PAGE_KERNEL_RO); 650 647 else 648 + #endif 651 649 pte = __mk_pte(address, pgprot); 652 650 653 651 if (address >= end_paddr) ··· 880 874 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */ 881 875 spin_lock(&sid_lock); 882 876 } 883 - if (free_space_ids == 0) 884 - BUG(); 877 + BUG_ON(free_space_ids == 0); 885 878 } 886 879 887 880 free_space_ids--; ··· 904 899 905 900 spin_lock(&sid_lock); 906 901 907 - if (*dirty_space_offset & (1L << index)) 908 - BUG(); /* attempt to free space id twice */ 902 + BUG_ON(*dirty_space_offset & (1L << index)); /* attempt to free space id twice */ 909 903 910 904 *dirty_space_offset |= (1L << index); 911 905 dirty_space_ids++; ··· 979 975 980 976 static unsigned long recycle_ndirty; 981 977 static unsigned long recycle_dirty_array[SID_ARRAY_SIZE]; 982 - static unsigned int recycle_inuse = 0; 978 + static unsigned int recycle_inuse; 983 979 984 980 void flush_tlb_all(void) 985 981 { ··· 988 984 do_recycle = 0; 989 985 spin_lock(&sid_lock); 990 986 if (dirty_space_ids > RECYCLE_THRESHOLD) { 991 - if (recycle_inuse) { 992 - BUG(); /* FIXME: Use a semaphore/wait queue here */ 993 - } 987 + BUG_ON(recycle_inuse); /* FIXME: Use a semaphore/wait queue here */ 994 988 get_dirty_sids(&recycle_ndirty,recycle_dirty_array); 995 989 recycle_inuse++; 996 990 do_recycle++;
+2 -1
arch/parisc/mm/ioremap.c
··· 2 2 * arch/parisc/mm/ioremap.c 3 3 * 4 4 * (C) Copyright 1995 1996 Linus Torvalds 5 - * (C) Copyright 2001 Helge Deller <deller@gmx.de> 5 + * (C) Copyright 2001-2006 Helge Deller <deller@gmx.de> 6 6 * (C) Copyright 2005 Kyle McMartin <kyle@parisc-linux.org> 7 7 */ 8 8 ··· 138 138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) || 139 139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) { 140 140 phys_addr |= F_EXTEND(0xfc000000); 141 + flags |= _PAGE_NO_CACHE; 141 142 } 142 143 #endif 143 144
+28 -30
arch/powerpc/configs/g5_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.16-rc2 4 - # Fri Feb 10 17:33:08 2006 3 + # Linux kernel version: 2.6.17-rc1 4 + # Wed Apr 19 13:24:37 2006 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 9 9 CONFIG_MMU=y 10 10 CONFIG_GENERIC_HARDIRQS=y 11 11 CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12 + CONFIG_GENERIC_HWEIGHT=y 12 13 CONFIG_GENERIC_CALIBRATE_DELAY=y 13 14 CONFIG_PPC=y 14 15 CONFIG_EARLY_PRINTK=y ··· 30 29 CONFIG_PPC_FPU=y 31 30 CONFIG_ALTIVEC=y 32 31 CONFIG_PPC_STD_MMU=y 32 + CONFIG_VIRT_CPU_ACCOUNTING=y 33 33 CONFIG_SMP=y 34 34 CONFIG_NR_CPUS=4 35 35 ··· 55 53 CONFIG_IKCONFIG=y 56 54 CONFIG_IKCONFIG_PROC=y 57 55 # CONFIG_CPUSETS is not set 56 + # CONFIG_RELAY is not set 58 57 CONFIG_INITRAMFS_SOURCE="" 59 58 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 60 59 # CONFIG_EMBEDDED is not set ··· 70 67 CONFIG_FUTEX=y 71 68 CONFIG_EPOLL=y 72 69 CONFIG_SHMEM=y 73 - CONFIG_CC_ALIGN_FUNCTIONS=0 74 - CONFIG_CC_ALIGN_LABELS=0 75 - CONFIG_CC_ALIGN_LOOPS=0 76 - CONFIG_CC_ALIGN_JUMPS=0 77 70 CONFIG_SLAB=y 78 71 # CONFIG_TINY_SHMEM is not set 79 72 CONFIG_BASE_SMALL=0 ··· 81 82 CONFIG_MODULES=y 82 83 CONFIG_MODULE_UNLOAD=y 83 84 # CONFIG_MODULE_FORCE_UNLOAD is not set 84 - CONFIG_OBSOLETE_MODPARM=y 85 85 CONFIG_MODVERSIONS=y 86 86 CONFIG_MODULE_SRCVERSION_ALL=y 87 87 CONFIG_KMOD=y ··· 89 91 # 90 92 # Block layer 91 93 # 94 + # CONFIG_BLK_DEV_IO_TRACE is not set 92 95 93 96 # 94 97 # IO Schedulers ··· 184 185 # CONFIG_PPC_INDIRECT_PCI is not set 185 186 CONFIG_PCI=y 186 187 CONFIG_PCI_DOMAINS=y 187 - CONFIG_PCI_LEGACY_PROC=y 188 188 # CONFIG_PCI_DEBUG is not set 189 189 190 190 # ··· 225 227 CONFIG_INET_AH=m 226 228 CONFIG_INET_ESP=m 227 229 CONFIG_INET_IPCOMP=m 230 + CONFIG_INET_XFRM_TUNNEL=m 228 231 CONFIG_INET_TUNNEL=y 229 232 CONFIG_INET_DIAG=y 230 233 CONFIG_INET_TCP_DIAG=y ··· 237 238 # 238 239 # CONFIG_IP_VS is not set 239 240 # CONFIG_IPV6 is not set 241 + # CONFIG_INET6_XFRM_TUNNEL is not set 242 + # CONFIG_INET6_TUNNEL is not set 240 243 CONFIG_NETFILTER=y 241 244 # CONFIG_NETFILTER_DEBUG is not set 242 245 ··· 262 261 CONFIG_IP_NF_TFTP=m 263 262 CONFIG_IP_NF_AMANDA=m 264 263 # CONFIG_IP_NF_PPTP is not set 264 + # CONFIG_IP_NF_H323 is not set 265 265 CONFIG_IP_NF_QUEUE=m 266 266 267 267 # ··· 515 513 CONFIG_MD_RAID1=y 516 514 CONFIG_MD_RAID10=m 517 515 CONFIG_MD_RAID5=y 516 + # CONFIG_MD_RAID5_RESHAPE is not set 518 517 CONFIG_MD_RAID6=m 519 518 CONFIG_MD_MULTIPATH=m 520 519 CONFIG_MD_FAULTY=m ··· 764 761 # Watchdog Cards 765 762 # 766 763 # CONFIG_WATCHDOG is not set 767 - # CONFIG_RTC is not set 768 764 CONFIG_GEN_RTC=y 769 765 # CONFIG_GEN_RTC_X is not set 770 766 # CONFIG_DTLK is not set ··· 774 772 # Ftape, the floppy tape device driver 775 773 # 776 774 CONFIG_AGP=m 775 + # CONFIG_AGP_VIA is not set 777 776 CONFIG_AGP_UNINORTH=m 778 777 # CONFIG_DRM is not set 779 778 CONFIG_RAW_DRIVER=y ··· 816 813 # CONFIG_I2C_PARPORT_LIGHT is not set 817 814 # CONFIG_I2C_PROSAVAGE is not set 818 815 # CONFIG_I2C_SAVAGE4 is not set 819 - # CONFIG_SCx200_ACB is not set 820 816 # CONFIG_I2C_SIS5595 is not set 821 817 # CONFIG_I2C_SIS630 is not set 822 818 # CONFIG_I2C_SIS96X is not set ··· 834 832 # CONFIG_SENSORS_PCF8574 is not set 835 833 # CONFIG_SENSORS_PCA9539 is not set 836 834 # CONFIG_SENSORS_PCF8591 is not set 837 - # CONFIG_SENSORS_RTC8564 is not set 838 835 # CONFIG_SENSORS_MAX6875 is not set 839 - # CONFIG_RTC_X1205_I2C is not set 840 836 # CONFIG_I2C_DEBUG_CORE is not set 841 837 # CONFIG_I2C_DEBUG_ALGO is not set 842 838 # CONFIG_I2C_DEBUG_BUS is not set ··· 862 862 # 863 863 864 864 # 865 - # Multimedia Capabilities Port drivers 866 - # 867 - 868 - # 869 865 # Multimedia devices 870 866 # 871 867 # CONFIG_VIDEO_DEV is not set ··· 870 874 # Digital Video Broadcasting Devices 871 875 # 872 876 # CONFIG_DVB is not set 877 + # CONFIG_USB_DABUSB is not set 873 878 874 879 # 875 880 # Graphics support ··· 880 883 CONFIG_FB_CFB_COPYAREA=y 881 884 CONFIG_FB_CFB_IMAGEBLIT=y 882 885 CONFIG_FB_MACMODES=y 886 + CONFIG_FB_FIRMWARE_EDID=y 883 887 CONFIG_FB_MODE_HELPERS=y 884 888 CONFIG_FB_TILEBLITTING=y 885 889 # CONFIG_FB_CIRRUS is not set ··· 899 901 CONFIG_FB_NVIDIA_I2C=y 900 902 # CONFIG_FB_RIVA is not set 901 903 # CONFIG_FB_MATROX is not set 902 - # CONFIG_FB_RADEON_OLD is not set 903 904 CONFIG_FB_RADEON=y 904 905 CONFIG_FB_RADEON_I2C=y 905 906 # CONFIG_FB_RADEON_DEBUG is not set ··· 955 958 CONFIG_SND_OSSEMUL=y 956 959 CONFIG_SND_MIXER_OSS=m 957 960 CONFIG_SND_PCM_OSS=m 961 + CONFIG_SND_PCM_OSS_PLUGINS=y 958 962 CONFIG_SND_SEQUENCER_OSS=y 959 963 # CONFIG_SND_DYNAMIC_MINORS is not set 960 964 CONFIG_SND_SUPPORT_OLD_API=y 965 + CONFIG_SND_VERBOSE_PROCFS=y 961 966 # CONFIG_SND_VERBOSE_PRINTK is not set 962 967 # CONFIG_SND_DEBUG is not set 963 968 ··· 976 977 # PCI devices 977 978 # 978 979 # CONFIG_SND_AD1889 is not set 980 + # CONFIG_SND_ALS300 is not set 979 981 # CONFIG_SND_ALS4000 is not set 980 982 # CONFIG_SND_ALI5451 is not set 981 983 # CONFIG_SND_ATIIXP is not set ··· 1009 1009 # CONFIG_SND_MIXART is not set 1010 1010 # CONFIG_SND_NM256 is not set 1011 1011 # CONFIG_SND_PCXHR is not set 1012 + # CONFIG_SND_RIPTIDE is not set 1012 1013 # CONFIG_SND_RME32 is not set 1013 1014 # CONFIG_SND_RME96 is not set 1014 1015 # CONFIG_SND_RME9652 is not set ··· 1042 1041 # 1043 1042 CONFIG_USB_ARCH_HAS_HCD=y 1044 1043 CONFIG_USB_ARCH_HAS_OHCI=y 1044 + CONFIG_USB_ARCH_HAS_EHCI=y 1045 1045 CONFIG_USB=y 1046 1046 # CONFIG_USB_DEBUG is not set 1047 1047 ··· 1070 1068 # 1071 1069 # USB Device Class drivers 1072 1070 # 1073 - # CONFIG_OBSOLETE_OSS_USB_DRIVER is not set 1074 1071 CONFIG_USB_ACM=m 1075 1072 CONFIG_USB_PRINTER=y 1076 1073 ··· 1125 1124 # 1126 1125 # CONFIG_USB_MDC800 is not set 1127 1126 # CONFIG_USB_MICROTEK is not set 1128 - 1129 - # 1130 - # USB Multimedia devices 1131 - # 1132 - # CONFIG_USB_DABUSB is not set 1133 - 1134 - # 1135 - # Video4Linux support is needed for USB Multimedia device support 1136 - # 1137 1127 1138 1128 # 1139 1129 # USB Network Adapters ··· 1186 1194 CONFIG_USB_SERIAL_KLSI=m 1187 1195 CONFIG_USB_SERIAL_KOBIL_SCT=m 1188 1196 CONFIG_USB_SERIAL_MCT_U232=m 1197 + # CONFIG_USB_SERIAL_NAVMAN is not set 1189 1198 CONFIG_USB_SERIAL_PL2303=m 1190 1199 # CONFIG_USB_SERIAL_HP4X is not set 1191 1200 CONFIG_USB_SERIAL_SAFE=m ··· 1230 1237 # CONFIG_MMC is not set 1231 1238 1232 1239 # 1240 + # LED devices 1241 + # 1242 + # CONFIG_NEW_LEDS is not set 1243 + 1244 + # 1233 1245 # InfiniBand support 1234 1246 # 1235 1247 # CONFIG_INFINIBAND is not set 1236 1248 1237 1249 # 1238 - # SN Devices 1250 + # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1239 1251 # 1240 1252 1241 1253 # 1242 - # EDAC - error detection and reporting (RAS) 1254 + # Real Time Clock 1243 1255 # 1256 + # CONFIG_RTC_CLASS is not set 1244 1257 1245 1258 # 1246 1259 # File systems ··· 1318 1319 CONFIG_HUGETLBFS=y 1319 1320 CONFIG_HUGETLB_PAGE=y 1320 1321 CONFIG_RAMFS=y 1321 - # CONFIG_RELAYFS_FS is not set 1322 1322 # CONFIG_CONFIGFS_FS is not set 1323 1323 1324 1324 #
+26 -17
arch/powerpc/configs/iseries_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.16-rc6 4 - # Wed Mar 15 16:19:52 2006 3 + # Linux kernel version: 2.6.17-rc1 4 + # Wed Apr 19 11:46:44 2006 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 9 9 CONFIG_MMU=y 10 10 CONFIG_GENERIC_HARDIRQS=y 11 11 CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12 + CONFIG_GENERIC_HWEIGHT=y 12 13 CONFIG_GENERIC_CALIBRATE_DELAY=y 13 14 CONFIG_PPC=y 14 15 CONFIG_EARLY_PRINTK=y ··· 31 30 CONFIG_PPC_FPU=y 32 31 # CONFIG_ALTIVEC is not set 33 32 CONFIG_PPC_STD_MMU=y 33 + CONFIG_VIRT_CPU_ACCOUNTING=y 34 34 CONFIG_SMP=y 35 35 CONFIG_NR_CPUS=32 36 36 ··· 57 55 CONFIG_IKCONFIG=y 58 56 CONFIG_IKCONFIG_PROC=y 59 57 # CONFIG_CPUSETS is not set 58 + # CONFIG_RELAY is not set 60 59 CONFIG_INITRAMFS_SOURCE="" 61 60 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62 61 # CONFIG_EMBEDDED is not set ··· 72 69 CONFIG_FUTEX=y 73 70 CONFIG_EPOLL=y 74 71 CONFIG_SHMEM=y 75 - CONFIG_CC_ALIGN_FUNCTIONS=0 76 - CONFIG_CC_ALIGN_LABELS=0 77 - CONFIG_CC_ALIGN_LOOPS=0 78 - CONFIG_CC_ALIGN_JUMPS=0 79 72 CONFIG_SLAB=y 80 73 # CONFIG_TINY_SHMEM is not set 81 74 CONFIG_BASE_SMALL=0 ··· 83 84 CONFIG_MODULES=y 84 85 CONFIG_MODULE_UNLOAD=y 85 86 # CONFIG_MODULE_FORCE_UNLOAD is not set 86 - CONFIG_OBSOLETE_MODPARM=y 87 87 CONFIG_MODVERSIONS=y 88 88 CONFIG_MODULE_SRCVERSION_ALL=y 89 89 CONFIG_KMOD=y ··· 91 93 # 92 94 # Block layer 93 95 # 96 + # CONFIG_BLK_DEV_IO_TRACE is not set 94 97 95 98 # 96 99 # IO Schedulers ··· 164 165 # CONFIG_PPC_INDIRECT_PCI is not set 165 166 CONFIG_PCI=y 166 167 CONFIG_PCI_DOMAINS=y 167 - CONFIG_PCI_LEGACY_PROC=y 168 168 # CONFIG_PCI_DEBUG is not set 169 169 170 170 # ··· 205 207 CONFIG_INET_AH=m 206 208 CONFIG_INET_ESP=m 207 209 CONFIG_INET_IPCOMP=m 210 + CONFIG_INET_XFRM_TUNNEL=m 208 211 CONFIG_INET_TUNNEL=y 209 212 CONFIG_INET_DIAG=y 210 213 CONFIG_INET_TCP_DIAG=y ··· 217 218 # 218 219 # CONFIG_IP_VS is not set 219 220 # CONFIG_IPV6 is not set 221 + # CONFIG_INET6_XFRM_TUNNEL is not set 222 + # CONFIG_INET6_TUNNEL is not set 220 223 CONFIG_NETFILTER=y 221 224 # CONFIG_NETFILTER_DEBUG is not set 222 225 ··· 237 236 CONFIG_NETFILTER_XT_MATCH_CONNMARK=m 238 237 CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m 239 238 # CONFIG_NETFILTER_XT_MATCH_DCCP is not set 239 + # CONFIG_NETFILTER_XT_MATCH_ESP is not set 240 240 CONFIG_NETFILTER_XT_MATCH_HELPER=m 241 241 CONFIG_NETFILTER_XT_MATCH_LENGTH=m 242 242 CONFIG_NETFILTER_XT_MATCH_LIMIT=m 243 243 CONFIG_NETFILTER_XT_MATCH_MAC=m 244 244 CONFIG_NETFILTER_XT_MATCH_MARK=m 245 + # CONFIG_NETFILTER_XT_MATCH_POLICY is not set 246 + # CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set 245 247 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m 246 248 CONFIG_NETFILTER_XT_MATCH_REALM=m 247 249 CONFIG_NETFILTER_XT_MATCH_SCTP=m ··· 266 262 CONFIG_IP_NF_TFTP=m 267 263 CONFIG_IP_NF_AMANDA=m 268 264 # CONFIG_IP_NF_PPTP is not set 265 + # CONFIG_IP_NF_H323 is not set 269 266 CONFIG_IP_NF_QUEUE=m 270 267 CONFIG_IP_NF_IPTABLES=m 271 268 CONFIG_IP_NF_MATCH_IPRANGE=m 272 - CONFIG_IP_NF_MATCH_MULTIPORT=m 273 269 CONFIG_IP_NF_MATCH_TOS=m 274 270 CONFIG_IP_NF_MATCH_RECENT=m 275 271 CONFIG_IP_NF_MATCH_ECN=m 276 272 CONFIG_IP_NF_MATCH_DSCP=m 277 - CONFIG_IP_NF_MATCH_AH_ESP=m 273 + # CONFIG_IP_NF_MATCH_AH is not set 278 274 CONFIG_IP_NF_MATCH_TTL=m 279 275 CONFIG_IP_NF_MATCH_OWNER=m 280 276 CONFIG_IP_NF_MATCH_ADDRTYPE=m 281 277 CONFIG_IP_NF_MATCH_HASHLIMIT=m 282 - CONFIG_IP_NF_MATCH_POLICY=m 283 278 CONFIG_IP_NF_FILTER=m 284 279 CONFIG_IP_NF_TARGET_REJECT=m 285 280 CONFIG_IP_NF_TARGET_LOG=m ··· 482 479 CONFIG_MD_RAID1=y 483 480 CONFIG_MD_RAID10=m 484 481 CONFIG_MD_RAID5=y 482 + # CONFIG_MD_RAID5_RESHAPE is not set 485 483 CONFIG_MD_RAID6=m 486 484 CONFIG_MD_MULTIPATH=m 487 485 CONFIG_MD_FAULTY=m ··· 706 702 # Watchdog Cards 707 703 # 708 704 # CONFIG_WATCHDOG is not set 709 - # CONFIG_RTC is not set 710 705 CONFIG_GEN_RTC=y 711 706 # CONFIG_GEN_RTC_X is not set 712 707 # CONFIG_DTLK is not set ··· 754 751 # 755 752 756 753 # 757 - # Multimedia Capabilities Port drivers 758 - # 759 - 760 - # 761 754 # Multimedia devices 762 755 # 763 756 # CONFIG_VIDEO_DEV is not set ··· 778 779 # 779 780 CONFIG_USB_ARCH_HAS_HCD=y 780 781 CONFIG_USB_ARCH_HAS_OHCI=y 782 + CONFIG_USB_ARCH_HAS_EHCI=y 781 783 # CONFIG_USB is not set 782 784 783 785 # ··· 796 796 # CONFIG_MMC is not set 797 797 798 798 # 799 + # LED devices 800 + # 801 + # CONFIG_NEW_LEDS is not set 802 + 803 + # 799 804 # InfiniBand support 800 805 # 801 806 # CONFIG_INFINIBAND is not set ··· 808 803 # 809 804 # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 810 805 # 806 + 807 + # 808 + # Real Time Clock 809 + # 810 + # CONFIG_RTC_CLASS is not set 811 811 812 812 # 813 813 # File systems ··· 888 878 # CONFIG_HUGETLBFS is not set 889 879 # CONFIG_HUGETLB_PAGE is not set 890 880 CONFIG_RAMFS=y 891 - # CONFIG_RELAYFS_FS is not set 892 881 # CONFIG_CONFIGFS_FS is not set 893 882 894 883 #
+25 -29
arch/powerpc/configs/pseries_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.16-rc2 4 - # Fri Feb 10 17:33:32 2006 3 + # Linux kernel version: 2.6.17-rc1 4 + # Wed Apr 19 11:48:00 2006 5 5 # 6 6 CONFIG_PPC64=y 7 7 CONFIG_64BIT=y ··· 9 9 CONFIG_MMU=y 10 10 CONFIG_GENERIC_HARDIRQS=y 11 11 CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12 + CONFIG_GENERIC_HWEIGHT=y 12 13 CONFIG_GENERIC_CALIBRATE_DELAY=y 13 14 CONFIG_PPC=y 14 15 CONFIG_EARLY_PRINTK=y ··· 31 30 CONFIG_PPC_FPU=y 32 31 CONFIG_ALTIVEC=y 33 32 CONFIG_PPC_STD_MMU=y 33 + CONFIG_VIRT_CPU_ACCOUNTING=y 34 34 CONFIG_SMP=y 35 35 CONFIG_NR_CPUS=128 36 36 ··· 57 55 CONFIG_IKCONFIG=y 58 56 CONFIG_IKCONFIG_PROC=y 59 57 CONFIG_CPUSETS=y 58 + # CONFIG_RELAY is not set 60 59 CONFIG_INITRAMFS_SOURCE="" 61 60 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 62 61 # CONFIG_EMBEDDED is not set ··· 72 69 CONFIG_FUTEX=y 73 70 CONFIG_EPOLL=y 74 71 CONFIG_SHMEM=y 75 - CONFIG_CC_ALIGN_FUNCTIONS=0 76 - CONFIG_CC_ALIGN_LABELS=0 77 - CONFIG_CC_ALIGN_LOOPS=0 78 - CONFIG_CC_ALIGN_JUMPS=0 79 72 CONFIG_SLAB=y 80 73 # CONFIG_TINY_SHMEM is not set 81 74 CONFIG_BASE_SMALL=0 ··· 83 84 CONFIG_MODULES=y 84 85 CONFIG_MODULE_UNLOAD=y 85 86 # CONFIG_MODULE_FORCE_UNLOAD is not set 86 - CONFIG_OBSOLETE_MODPARM=y 87 87 CONFIG_MODVERSIONS=y 88 88 CONFIG_MODULE_SRCVERSION_ALL=y 89 89 CONFIG_KMOD=y ··· 91 93 # 92 94 # Block layer 93 95 # 96 + # CONFIG_BLK_DEV_IO_TRACE is not set 94 97 95 98 # 96 99 # IO Schedulers ··· 187 188 # CONFIG_PPC_INDIRECT_PCI is not set 188 189 CONFIG_PCI=y 189 190 CONFIG_PCI_DOMAINS=y 190 - CONFIG_PCI_LEGACY_PROC=y 191 191 # CONFIG_PCI_DEBUG is not set 192 192 193 193 # ··· 233 235 CONFIG_INET_AH=m 234 236 CONFIG_INET_ESP=m 235 237 CONFIG_INET_IPCOMP=m 238 + CONFIG_INET_XFRM_TUNNEL=m 236 239 CONFIG_INET_TUNNEL=y 237 240 CONFIG_INET_DIAG=y 238 241 CONFIG_INET_TCP_DIAG=y ··· 245 246 # 246 247 # CONFIG_IP_VS is not set 247 248 # CONFIG_IPV6 is not set 249 + # CONFIG_INET6_XFRM_TUNNEL is not set 250 + # CONFIG_INET6_TUNNEL is not set 248 251 CONFIG_NETFILTER=y 249 252 # CONFIG_NETFILTER_DEBUG is not set 250 253 ··· 273 272 CONFIG_IP_NF_TFTP=m 274 273 CONFIG_IP_NF_AMANDA=m 275 274 # CONFIG_IP_NF_PPTP is not set 275 + # CONFIG_IP_NF_H323 is not set 276 276 CONFIG_IP_NF_QUEUE=m 277 277 278 278 # ··· 521 519 CONFIG_MD_RAID1=y 522 520 CONFIG_MD_RAID10=m 523 521 CONFIG_MD_RAID5=y 522 + # CONFIG_MD_RAID5_RESHAPE is not set 524 523 CONFIG_MD_RAID6=m 525 524 CONFIG_MD_MULTIPATH=m 526 525 CONFIG_MD_FAULTY=m ··· 753 750 # 754 751 CONFIG_SERIAL_8250=y 755 752 CONFIG_SERIAL_8250_CONSOLE=y 753 + CONFIG_SERIAL_8250_PCI=y 756 754 CONFIG_SERIAL_8250_NR_UARTS=4 757 755 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 758 756 # CONFIG_SERIAL_8250_EXTENDED is not set ··· 771 767 # CONFIG_PRINTER is not set 772 768 # CONFIG_PPDEV is not set 773 769 # CONFIG_TIPAR is not set 770 + CONFIG_HVC_DRIVER=y 774 771 CONFIG_HVC_CONSOLE=y 772 + # CONFIG_HVC_RTAS is not set 775 773 CONFIG_HVCS=m 776 774 777 775 # ··· 785 779 # Watchdog Cards 786 780 # 787 781 # CONFIG_WATCHDOG is not set 788 - # CONFIG_RTC is not set 789 782 CONFIG_GEN_RTC=y 790 783 # CONFIG_GEN_RTC_X is not set 791 784 # CONFIG_DTLK is not set ··· 835 830 # CONFIG_I2C_PARPORT_LIGHT is not set 836 831 # CONFIG_I2C_PROSAVAGE is not set 837 832 # CONFIG_I2C_SAVAGE4 is not set 838 - # CONFIG_SCx200_ACB is not set 839 833 # CONFIG_I2C_SIS5595 is not set 840 834 # CONFIG_I2C_SIS630 is not set 841 835 # CONFIG_I2C_SIS96X is not set ··· 853 849 # CONFIG_SENSORS_PCF8574 is not set 854 850 # CONFIG_SENSORS_PCA9539 is not set 855 851 # CONFIG_SENSORS_PCF8591 is not set 856 - # CONFIG_SENSORS_RTC8564 is not set 857 852 # CONFIG_SENSORS_MAX6875 is not set 858 - # CONFIG_RTC_X1205_I2C is not set 859 853 # CONFIG_I2C_DEBUG_CORE is not set 860 854 # CONFIG_I2C_DEBUG_ALGO is not set 861 855 # CONFIG_I2C_DEBUG_BUS is not set ··· 881 879 # 882 880 883 881 # 884 - # Multimedia Capabilities Port drivers 885 - # 886 - 887 - # 888 882 # Multimedia devices 889 883 # 890 884 # CONFIG_VIDEO_DEV is not set ··· 889 891 # Digital Video Broadcasting Devices 890 892 # 891 893 # CONFIG_DVB is not set 894 + # CONFIG_USB_DABUSB is not set 892 895 893 896 # 894 897 # Graphics support ··· 899 900 CONFIG_FB_CFB_COPYAREA=y 900 901 CONFIG_FB_CFB_IMAGEBLIT=y 901 902 CONFIG_FB_MACMODES=y 903 + CONFIG_FB_FIRMWARE_EDID=y 902 904 CONFIG_FB_MODE_HELPERS=y 903 905 CONFIG_FB_TILEBLITTING=y 904 906 # CONFIG_FB_CIRRUS is not set ··· 919 919 CONFIG_FB_MATROX_G=y 920 920 # CONFIG_FB_MATROX_I2C is not set 921 921 CONFIG_FB_MATROX_MULTIHEAD=y 922 - # CONFIG_FB_RADEON_OLD is not set 923 922 CONFIG_FB_RADEON=y 924 923 CONFIG_FB_RADEON_I2C=y 925 924 # CONFIG_FB_RADEON_DEBUG is not set ··· 967 968 # 968 969 CONFIG_USB_ARCH_HAS_HCD=y 969 970 CONFIG_USB_ARCH_HAS_OHCI=y 971 + CONFIG_USB_ARCH_HAS_EHCI=y 970 972 CONFIG_USB=y 971 973 # CONFIG_USB_DEBUG is not set 972 974 ··· 1048 1048 # CONFIG_USB_MICROTEK is not set 1049 1049 1050 1050 # 1051 - # USB Multimedia devices 1052 - # 1053 - # CONFIG_USB_DABUSB is not set 1054 - 1055 - # 1056 - # Video4Linux support is needed for USB Multimedia device support 1057 - # 1058 - 1059 - # 1060 1051 # USB Network Adapters 1061 1052 # 1062 1053 # CONFIG_USB_CATC is not set ··· 1100 1109 # CONFIG_MMC is not set 1101 1110 1102 1111 # 1112 + # LED devices 1113 + # 1114 + # CONFIG_NEW_LEDS is not set 1115 + 1116 + # 1103 1117 # InfiniBand support 1104 1118 # 1105 1119 CONFIG_INFINIBAND=m ··· 1117 1121 # CONFIG_INFINIBAND_SRP is not set 1118 1122 1119 1123 # 1120 - # SN Devices 1124 + # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1121 1125 # 1122 1126 1123 1127 # 1124 - # EDAC - error detection and reporting (RAS) 1128 + # Real Time Clock 1125 1129 # 1130 + # CONFIG_RTC_CLASS is not set 1126 1131 1127 1132 # 1128 1133 # File systems ··· 1199 1202 CONFIG_HUGETLBFS=y 1200 1203 CONFIG_HUGETLB_PAGE=y 1201 1204 CONFIG_RAMFS=y 1202 - # CONFIG_RELAYFS_FS is not set 1203 1205 # CONFIG_CONFIGFS_FS is not set 1204 1206 1205 1207 #
+26 -10
arch/powerpc/kernel/iommu.c
··· 61 61 static unsigned long iommu_range_alloc(struct iommu_table *tbl, 62 62 unsigned long npages, 63 63 unsigned long *handle, 64 + unsigned long mask, 64 65 unsigned int align_order) 65 66 { 66 67 unsigned long n, end, i, start; ··· 98 97 */ 99 98 if (start >= limit) 100 99 start = largealloc ? tbl->it_largehint : tbl->it_hint; 101 - 100 + 102 101 again: 102 + 103 + if (limit + tbl->it_offset > mask) { 104 + limit = mask - tbl->it_offset + 1; 105 + /* If we're constrained on address range, first try 106 + * at the masked hint to avoid O(n) search complexity, 107 + * but on second pass, start at 0. 108 + */ 109 + if ((start & mask) >= limit || pass > 0) 110 + start = 0; 111 + else 112 + start &= mask; 113 + } 103 114 104 115 n = find_next_zero_bit(tbl->it_map, limit, start); 105 116 ··· 163 150 164 151 static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page, 165 152 unsigned int npages, enum dma_data_direction direction, 166 - unsigned int align_order) 153 + unsigned long mask, unsigned int align_order) 167 154 { 168 155 unsigned long entry, flags; 169 156 dma_addr_t ret = DMA_ERROR_CODE; 170 - 157 + 171 158 spin_lock_irqsave(&(tbl->it_lock), flags); 172 159 173 - entry = iommu_range_alloc(tbl, npages, NULL, align_order); 160 + entry = iommu_range_alloc(tbl, npages, NULL, mask, align_order); 174 161 175 162 if (unlikely(entry == DMA_ERROR_CODE)) { 176 163 spin_unlock_irqrestore(&(tbl->it_lock), flags); ··· 249 236 250 237 int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 251 238 struct scatterlist *sglist, int nelems, 252 - enum dma_data_direction direction) 239 + unsigned long mask, enum dma_data_direction direction) 253 240 { 254 241 dma_addr_t dma_next = 0, dma_addr; 255 242 unsigned long flags; ··· 287 274 vaddr = (unsigned long)page_address(s->page) + s->offset; 288 275 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK); 289 276 npages >>= PAGE_SHIFT; 290 - entry = iommu_range_alloc(tbl, npages, &handle, 0); 277 + entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0); 291 278 292 279 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); 293 280 ··· 492 479 * byte within the page as vaddr. 493 480 */ 494 481 dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 495 - size_t size, enum dma_data_direction direction) 482 + size_t size, unsigned long mask, 483 + enum dma_data_direction direction) 496 484 { 497 485 dma_addr_t dma_handle = DMA_ERROR_CODE; 498 486 unsigned long uaddr; ··· 506 492 npages >>= PAGE_SHIFT; 507 493 508 494 if (tbl) { 509 - dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 0); 495 + dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 496 + mask >> PAGE_SHIFT, 0); 510 497 if (dma_handle == DMA_ERROR_CODE) { 511 498 if (printk_ratelimit()) { 512 499 printk(KERN_INFO "iommu_alloc failed, " ··· 536 521 * to the dma address (mapping) of the first page. 537 522 */ 538 523 void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 539 - dma_addr_t *dma_handle, gfp_t flag) 524 + dma_addr_t *dma_handle, unsigned long mask, gfp_t flag) 540 525 { 541 526 void *ret = NULL; 542 527 dma_addr_t mapping; ··· 566 551 memset(ret, 0, size); 567 552 568 553 /* Set up tces to cover the allocated range */ 569 - mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, order); 554 + mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, 555 + mask >> PAGE_SHIFT, order); 570 556 if (mapping == DMA_ERROR_CODE) { 571 557 free_pages((unsigned long)ret, order); 572 558 ret = NULL;
+36 -4
arch/powerpc/kernel/pci_iommu.c
··· 59 59 } 60 60 61 61 62 + static inline unsigned long device_to_mask(struct device *hwdev) 63 + { 64 + struct pci_dev *pdev; 65 + 66 + if (!hwdev) { 67 + pdev = ppc64_isabridge_dev; 68 + if (!pdev) /* This is the best guess we can do */ 69 + return 0xfffffffful; 70 + } else 71 + pdev = to_pci_dev(hwdev); 72 + 73 + if (pdev->dma_mask) 74 + return pdev->dma_mask; 75 + 76 + /* Assume devices without mask can take 32 bit addresses */ 77 + return 0xfffffffful; 78 + } 79 + 80 + 62 81 /* Allocates a contiguous real buffer and creates mappings over it. 63 82 * Returns the virtual address of the buffer and sets dma_handle 64 83 * to the dma address (mapping) of the first page. ··· 86 67 dma_addr_t *dma_handle, gfp_t flag) 87 68 { 88 69 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle, 89 - flag); 70 + device_to_mask(hwdev), flag); 90 71 } 91 72 92 73 static void pci_iommu_free_coherent(struct device *hwdev, size_t size, ··· 104 85 static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr, 105 86 size_t size, enum dma_data_direction direction) 106 87 { 107 - return iommu_map_single(devnode_table(hwdev), vaddr, size, direction); 88 + return iommu_map_single(devnode_table(hwdev), vaddr, size, 89 + device_to_mask(hwdev), direction); 108 90 } 109 91 110 92 ··· 120 100 int nelems, enum dma_data_direction direction) 121 101 { 122 102 return iommu_map_sg(pdev, devnode_table(pdev), sglist, 123 - nelems, direction); 103 + nelems, device_to_mask(pdev), direction); 124 104 } 125 105 126 106 static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist, ··· 132 112 /* We support DMA to/from any memory page via the iommu */ 133 113 static int pci_iommu_dma_supported(struct device *dev, u64 mask) 134 114 { 135 - return 1; 115 + struct iommu_table *tbl = devnode_table(dev); 116 + 117 + if (!tbl || tbl->it_offset > mask) { 118 + printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n"); 119 + if (tbl) 120 + printk(KERN_INFO "mask: 0x%08lx, table offset: 0x%08lx\n", 121 + mask, tbl->it_offset); 122 + else 123 + printk(KERN_INFO "mask: 0x%08lx, table unavailable\n", 124 + mask); 125 + return 0; 126 + } else 127 + return 1; 136 128 } 137 129 138 130 void pci_iommu_init(void)
+1
arch/powerpc/kernel/ppc_ksyms.c
··· 81 81 EXPORT_SYMBOL(strlen); 82 82 EXPORT_SYMBOL(strcmp); 83 83 EXPORT_SYMBOL(strcasecmp); 84 + EXPORT_SYMBOL(strncasecmp); 84 85 85 86 EXPORT_SYMBOL(csum_partial); 86 87 EXPORT_SYMBOL(csum_partial_copy_generic);
+1 -1
arch/powerpc/kernel/prom.c
··· 62 62 static int __initdata dt_root_size_cells; 63 63 64 64 #ifdef CONFIG_PPC64 65 - static int __initdata iommu_is_off; 65 + int __initdata iommu_is_off; 66 66 int __initdata iommu_force_on; 67 67 unsigned long tce_alloc_start, tce_alloc_end; 68 68 #endif
+2 -2
arch/powerpc/kernel/sysfs.c
··· 279 279 } 280 280 #endif /* CONFIG_HOTPLUG_CPU */ 281 281 282 - static int __devinit sysfs_cpu_notify(struct notifier_block *self, 282 + static int sysfs_cpu_notify(struct notifier_block *self, 283 283 unsigned long action, void *hcpu) 284 284 { 285 285 unsigned int cpu = (unsigned int)(long)hcpu; ··· 297 297 return NOTIFY_OK; 298 298 } 299 299 300 - static struct notifier_block __devinitdata sysfs_cpu_nb = { 300 + static struct notifier_block sysfs_cpu_nb = { 301 301 .notifier_call = sysfs_cpu_notify, 302 302 }; 303 303
+6
arch/powerpc/kernel/systbl.S
··· 324 324 SYSCALL(unshare) 325 325 SYSCALL(splice) 326 326 SYSCALL(tee) 327 + SYSCALL(vmsplice) 328 + 329 + /* 330 + * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c 331 + * as well when appropriate. 332 + */
+3 -3
arch/powerpc/kernel/vio.c
··· 202 202 size_t size, enum dma_data_direction direction) 203 203 { 204 204 return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size, 205 - direction); 205 + ~0ul, direction); 206 206 } 207 207 208 208 static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle, ··· 216 216 int nelems, enum dma_data_direction direction) 217 217 { 218 218 return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist, 219 - nelems, direction); 219 + nelems, ~0ul, direction); 220 220 } 221 221 222 222 static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist, ··· 229 229 dma_addr_t *dma_handle, gfp_t flag) 230 230 { 231 231 return iommu_alloc_coherent(to_vio_dev(dev)->iommu_table, size, 232 - dma_handle, flag); 232 + dma_handle, ~0ul, flag); 233 233 } 234 234 235 235 static void vio_free_coherent(struct device *dev, size_t size,
+3 -3
arch/powerpc/platforms/cell/spu_callbacks.c
··· 317 317 [__NR_ppoll] sys_ni_syscall, /* sys_ppoll */ 318 318 [__NR_unshare] sys_unshare, 319 319 [__NR_splice] sys_splice, 320 + [__NR_tee] sys_tee, 321 + [__NR_vmsplice] sys_vmsplice, 320 322 }; 321 323 322 324 long spu_sys_callback(struct spu_syscall_block *s) 323 325 { 324 326 long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); 325 327 326 - BUILD_BUG_ON(ARRAY_SIZE(spu_syscall_table) != __NR_syscalls); 327 - 328 328 syscall = spu_syscall_table[s->nr_ret]; 329 329 330 - if (s->nr_ret >= __NR_syscalls) { 330 + if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { 331 331 pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); 332 332 return -ENOSYS; 333 333 }
+35 -43
arch/powerpc/platforms/powermac/low_i2c.c
··· 231 231 return isr; 232 232 } 233 233 234 + static void kw_i2c_do_stop(struct pmac_i2c_host_kw *host, int result) 235 + { 236 + kw_write_reg(reg_control, KW_I2C_CTL_STOP); 237 + host->state = state_stop; 238 + host->result = result; 239 + } 240 + 241 + 234 242 static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr) 235 243 { 236 244 u8 ack; ··· 254 246 } 255 247 256 248 if (isr == 0) { 249 + printk(KERN_WARNING "low_i2c: Timeout in i2c transfer" 250 + " on keywest !\n"); 257 251 if (host->state != state_stop) { 258 - DBG_LOW("KW: Timeout !\n"); 259 - host->result = -EIO; 260 - goto stop; 252 + kw_i2c_do_stop(host, -EIO); 253 + return; 261 254 } 262 - if (host->state == state_stop) { 263 - ack = kw_read_reg(reg_status); 264 - if (ack & KW_I2C_STAT_BUSY) 265 - kw_write_reg(reg_status, 0); 266 - host->state = state_idle; 267 - kw_write_reg(reg_ier, 0x00); 268 - if (!host->polled) 269 - complete(&host->complete); 270 - } 255 + ack = kw_read_reg(reg_status); 256 + if (ack & KW_I2C_STAT_BUSY) 257 + kw_write_reg(reg_status, 0); 258 + host->state = state_idle; 259 + kw_write_reg(reg_ier, 0x00); 260 + if (!host->polled) 261 + complete(&host->complete); 271 262 return; 272 263 } 273 264 274 265 if (isr & KW_I2C_IRQ_ADDR) { 275 266 ack = kw_read_reg(reg_status); 276 267 if (host->state != state_addr) { 277 - kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); 278 268 WRONG_STATE("KW_I2C_IRQ_ADDR"); 279 - host->result = -EIO; 280 - goto stop; 269 + kw_i2c_do_stop(host, -EIO); 281 270 } 282 271 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 283 - host->result = -ENODEV; 284 - DBG_LOW("KW: NAK on address\n"); 272 + host->result = -ENXIO; 285 273 host->state = state_stop; 286 - return; 274 + DBG_LOW("KW: NAK on address\n"); 287 275 } else { 288 - if (host->len == 0) { 289 - kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR); 290 - goto stop; 291 - } 292 - if (host->rw) { 276 + if (host->len == 0) 277 + kw_i2c_do_stop(host, 0); 278 + else if (host->rw) { 293 279 host->state = state_read; 294 280 if (host->len > 1) 295 281 kw_write_reg(reg_control, ··· 310 308 ack = kw_read_reg(reg_status); 311 309 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) { 312 310 DBG_LOW("KW: nack on data write\n"); 313 - host->result = -EIO; 314 - goto stop; 311 + host->result = -EFBIG; 312 + host->state = state_stop; 315 313 } else if (host->len) { 316 314 kw_write_reg(reg_data, *(host->data++)); 317 315 host->len--; 318 - } else { 319 - kw_write_reg(reg_control, KW_I2C_CTL_STOP); 320 - host->state = state_stop; 321 - host->result = 0; 322 - } 323 - kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); 316 + } else 317 + kw_i2c_do_stop(host, 0); 324 318 } else { 325 - kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); 326 319 WRONG_STATE("KW_I2C_IRQ_DATA"); 327 - if (host->state != state_stop) { 328 - host->result = -EIO; 329 - goto stop; 330 - } 320 + if (host->state != state_stop) 321 + kw_i2c_do_stop(host, -EIO); 331 322 } 323 + kw_write_reg(reg_isr, KW_I2C_IRQ_DATA); 332 324 } 333 325 334 326 if (isr & KW_I2C_IRQ_STOP) { ··· 336 340 complete(&host->complete); 337 341 } 338 342 343 + /* Below should only happen in manual mode which we don't use ... */ 339 344 if (isr & KW_I2C_IRQ_START) 340 345 kw_write_reg(reg_isr, KW_I2C_IRQ_START); 341 346 342 - return; 343 - stop: 344 - kw_write_reg(reg_control, KW_I2C_CTL_STOP); 345 - host->state = state_stop; 346 - return; 347 347 } 348 348 349 349 /* Interrupt handler */ ··· 536 544 return NULL; 537 545 } 538 546 539 - /* Make sure IRA is disabled */ 547 + /* Make sure IRQ is disabled */ 540 548 kw_write_reg(reg_ier, 0); 541 549 542 550 /* Request chip interrupt */ 543 - if (request_irq(host->irq, kw_i2c_irq, SA_SHIRQ, "keywest i2c", host)) 551 + if (request_irq(host->irq, kw_i2c_irq, 0, "keywest i2c", host)) 544 552 host->irq = NO_IRQ; 545 553 546 554 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
+10 -2
arch/powerpc/sysdev/dart_iommu.c
··· 49 49 50 50 #include "dart.h" 51 51 52 + extern int iommu_is_off; 52 53 extern int iommu_force_on; 53 54 54 55 /* Physical base address and size of the DART table */ ··· 330 329 331 330 void __init alloc_dart_table(void) 332 331 { 333 - /* Only reserve DART space if machine has more than 2GB of RAM 332 + /* Only reserve DART space if machine has more than 1GB of RAM 334 333 * or if requested with iommu=on on cmdline. 334 + * 335 + * 1GB of RAM is picked as limit because some default devices 336 + * (i.e. Airport Extreme) have 30 bit address range limits. 335 337 */ 336 - if (lmb_end_of_DRAM() <= 0x80000000ull && !iommu_force_on) 338 + 339 + if (iommu_is_off) 340 + return; 341 + 342 + if (!iommu_force_on && lmb_end_of_DRAM() <= 0x40000000ull) 337 343 return; 338 344 339 345 /* 512 pages (2MB) is max DART tablesize. */
+1
arch/ppc/kernel/asm-offsets.c
··· 134 134 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 135 135 DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); 136 136 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); 137 + DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags)); 137 138 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 138 139 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 139 140
+16 -17
arch/ppc/kernel/entry.S
··· 128 128 stw r12,4(r11) 129 129 #endif 130 130 b 3f 131 + 131 132 2: /* if from kernel, check interrupted DOZE/NAP mode and 132 133 * check for stack overflow 133 134 */ 135 + lwz r9,THREAD_INFO-THREAD(r12) 136 + cmplw r1,r9 /* if r1 <= current->thread_info */ 137 + ble- stack_ovf /* then the kernel stack overflowed */ 138 + 5: 134 139 #ifdef CONFIG_6xx 135 - mfspr r11,SPRN_HID0 136 - mtcr r11 137 - BEGIN_FTR_SECTION 138 - bt- 8,4f /* Check DOZE */ 139 - END_FTR_SECTION_IFSET(CPU_FTR_CAN_DOZE) 140 - BEGIN_FTR_SECTION 141 - bt- 9,4f /* Check NAP */ 142 - END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP) 140 + tophys(r9,r9) /* check local flags */ 141 + lwz r12,TI_LOCAL_FLAGS(r9) 142 + mtcrf 0x01,r12 143 + bt- 31-TLF_NAPPING,4f 143 144 #endif /* CONFIG_6xx */ 144 145 .globl transfer_to_handler_cont 145 146 transfer_to_handler_cont: 146 - lwz r11,THREAD_INFO-THREAD(r12) 147 - cmplw r1,r11 /* if r1 <= current->thread_info */ 148 - ble- stack_ovf /* then the kernel stack overflowed */ 149 147 3: 150 148 mflr r9 151 149 lwz r11,0(r9) /* virtual address of handler */ 152 150 lwz r9,4(r9) /* where to go when done */ 153 - FIX_SRR1(r10,r12) 154 151 mtspr SPRN_SRR0,r11 155 152 mtspr SPRN_SRR1,r10 156 153 mtlr r9 ··· 155 158 RFI /* jump to handler, enable MMU */ 156 159 157 160 #ifdef CONFIG_6xx 158 - 4: b power_save_6xx_restore 161 + 4: rlwinm r12,r12,0,~_TLF_NAPPING 162 + stw r12,TI_LOCAL_FLAGS(r9) 163 + b power_save_6xx_restore 159 164 #endif 160 165 161 166 /* ··· 166 167 */ 167 168 stack_ovf: 168 169 /* sometimes we use a statically-allocated stack, which is OK. */ 169 - lis r11,_end@h 170 - ori r11,r11,_end@l 171 - cmplw r1,r11 172 - ble 3b /* r1 <= &_end is OK */ 170 + lis r12,_end@h 171 + ori r12,r12,_end@l 172 + cmplw r1,r12 173 + ble 5b /* r1 <= &_end is OK */ 173 174 SAVE_NVGPRS(r11) 174 175 addi r3,r1,STACK_FRAME_OVERHEAD 175 176 lis r1,init_thread_union@ha
+1
arch/ppc/kernel/ppc_ksyms.c
··· 94 94 EXPORT_SYMBOL(strlen); 95 95 EXPORT_SYMBOL(strcmp); 96 96 EXPORT_SYMBOL(strcasecmp); 97 + EXPORT_SYMBOL(strncasecmp); 97 98 EXPORT_SYMBOL(__div64_32); 98 99 99 100 EXPORT_SYMBOL(csum_partial);
+1 -1
arch/s390/appldata/appldata_base.c
··· 652 652 return NOTIFY_OK; 653 653 } 654 654 655 - static struct notifier_block __devinitdata appldata_nb = { 655 + static struct notifier_block appldata_nb = { 656 656 .notifier_call = appldata_cpu_notify, 657 657 }; 658 658
+2 -2
arch/x86_64/ia32/Makefile
··· 27 27 $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE 28 28 $(call if_changed,syscall) 29 29 30 - AFLAGS_vsyscall-sysenter.o = -m32 31 - AFLAGS_vsyscall-syscall.o = -m32 30 + AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32 31 + AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32
+1 -1
arch/x86_64/kernel/mce.c
··· 629 629 #endif 630 630 631 631 /* Get notified when a cpu comes on/off. Be hotplug friendly. */ 632 - static __cpuinit int 632 + static int 633 633 mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 634 634 { 635 635 unsigned int cpu = (unsigned long)hcpu;
+1 -1
arch/x86_64/kernel/mce_amd.c
··· 482 482 #endif 483 483 484 484 /* get notified when a cpu comes on/off */ 485 - static __cpuinit int threshold_cpu_callback(struct notifier_block *nfb, 485 + static int threshold_cpu_callback(struct notifier_block *nfb, 486 486 unsigned long action, void *hcpu) 487 487 { 488 488 /* cpu was unsigned int to begin with */
-4
arch/x86_64/kernel/pci-gart.c
··· 112 112 static void free_iommu(unsigned long offset, int size) 113 113 { 114 114 unsigned long flags; 115 - if (size == 1) { 116 - clear_bit(offset, iommu_gart_bitmap); 117 - return; 118 - } 119 115 spin_lock_irqsave(&iommu_bitmap_lock, flags); 120 116 __clear_bit_string(iommu_gart_bitmap, offset, size); 121 117 spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
+2
arch/x86_64/mm/numa.c
··· 188 188 memory. */ 189 189 memmapsize = sizeof(struct page) * (end_pfn-start_pfn); 190 190 limit = end_pfn << PAGE_SHIFT; 191 + #ifdef CONFIG_FLAT_NODE_MEM_MAP 191 192 NODE_DATA(nodeid)->node_mem_map = 192 193 __alloc_bootmem_core(NODE_DATA(nodeid)->bdata, 193 194 memmapsize, SMP_CACHE_BYTES, 194 195 round_down(limit - memmapsize, PAGE_SIZE), 195 196 limit); 197 + #endif 196 198 197 199 size_zones(zones, holes, start_pfn, end_pfn); 198 200 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
+1 -1
block/ll_rw_blk.c
··· 3385 3385 } 3386 3386 3387 3387 3388 - static struct notifier_block __devinitdata blk_cpu_notifier = { 3388 + static struct notifier_block blk_cpu_notifier = { 3389 3389 .notifier_call = blk_cpu_notify, 3390 3390 }; 3391 3391
+1 -1
drivers/base/topology.c
··· 107 107 return 0; 108 108 } 109 109 110 - static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, 110 + static int topology_cpu_callback(struct notifier_block *nfb, 111 111 unsigned long action, void *hcpu) 112 112 { 113 113 unsigned int cpu = (unsigned long)hcpu;
-1
drivers/char/drm/drmP.h
··· 889 889 /* Buffer management support (drm_bufs.h) */ 890 890 extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request); 891 891 extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request); 892 - extern int drm_addbufs_fb(drm_device_t *dev, drm_buf_desc_t *request); 893 892 extern int drm_addmap(drm_device_t * dev, unsigned int offset, 894 893 unsigned int size, drm_map_type_t type, 895 894 drm_map_flags_t flags, drm_local_map_t ** map_ptr);
-2
drivers/char/drm/drm_agpsupport.c
··· 503 503 return agp_bind_memory(handle, start); 504 504 } 505 505 506 - EXPORT_SYMBOL(drm_agp_bind_memory); 507 - 508 506 /** Calls agp_unbind_memory() */ 509 507 int drm_agp_unbind_memory(DRM_AGP_MEM * handle) 510 508 {
+1 -4
drivers/char/drm/drm_bufs.c
··· 386 386 387 387 return 0; 388 388 } 389 - EXPORT_SYMBOL(drm_rmmap_locked); 390 389 391 390 int drm_rmmap(drm_device_t *dev, drm_local_map_t *map) 392 391 { ··· 397 398 398 399 return ret; 399 400 } 400 - EXPORT_SYMBOL(drm_rmmap); 401 401 402 402 /* The rmmap ioctl appears to be unnecessary. All mappings are torn down on 403 403 * the last close of the device, and this is necessary for cleanup when things ··· 1051 1053 return 0; 1052 1054 } 1053 1055 1054 - int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) 1056 + static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request) 1055 1057 { 1056 1058 drm_device_dma_t *dma = dev->dma; 1057 1059 drm_buf_entry_t *entry; ··· 1210 1212 atomic_dec(&dev->buf_alloc); 1211 1213 return 0; 1212 1214 } 1213 - EXPORT_SYMBOL(drm_addbufs_fb); 1214 1215 1215 1216 1216 1217 /**
-2
drivers/char/drm/drm_stub.c
··· 229 229 return ret; 230 230 } 231 231 232 - EXPORT_SYMBOL(drm_get_dev); 233 - 234 232 /** 235 233 * Put a device minor number. 236 234 *
+1 -1
drivers/char/drm/r300_cmdbuf.c
··· 723 723 724 724 dev_priv->scratch_ages[header.scratch.reg]++; 725 725 726 - ref_age_base = *(u32 **)cmdbuf->buf; 726 + ref_age_base = (u32 *)(unsigned long)*((uint64_t *)cmdbuf->buf); 727 727 728 728 cmdbuf->buf += sizeof(u64); 729 729 cmdbuf->bufsz -= sizeof(u64);
+14
drivers/char/mem.c
··· 27 27 #include <linux/crash_dump.h> 28 28 #include <linux/backing-dev.h> 29 29 #include <linux/bootmem.h> 30 + #include <linux/pipe_fs_i.h> 30 31 31 32 #include <asm/uaccess.h> 32 33 #include <asm/io.h> ··· 579 578 return count; 580 579 } 581 580 581 + static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf, 582 + struct splice_desc *sd) 583 + { 584 + return sd->len; 585 + } 586 + 587 + static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out, 588 + loff_t *ppos, size_t len, unsigned int flags) 589 + { 590 + return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null); 591 + } 592 + 582 593 #ifdef CONFIG_MMU 583 594 /* 584 595 * For fun, we are using the MMU for this. ··· 798 785 .llseek = null_lseek, 799 786 .read = read_null, 800 787 .write = write_null, 788 + .splice_write = splice_write_null, 801 789 }; 802 790 803 791 #if defined(CONFIG_ISA) || !defined(__mc68000__)
+2 -1
drivers/char/snsc.c
··· 390 390 format_module_id(devnamep, geo_module(geoid), 391 391 MODULE_FORMAT_BRIEF); 392 392 devnamep = devname + strlen(devname); 393 - sprintf(devnamep, "#%d", geo_slab(geoid)); 393 + sprintf(devnamep, "^%d#%d", geo_slot(geoid), 394 + geo_slab(geoid)); 394 395 395 396 /* allocate sysctl device data */ 396 397 scd = kzalloc(sizeof (struct sysctl_data_s),
+10 -1
drivers/char/tpm/Kconfig
··· 20 20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI 21 21 and CONFIG_PNPACPI. 22 22 23 + config TCG_TIS 24 + tristate "TPM Interface Specification 1.2 Interface" 25 + depends on TCG_TPM 26 + ---help--- 27 + If you have a TPM security chip that is compliant with the 28 + TCG TIS 1.2 TPM specification say Yes and it will be accessible 29 + from within Linux. To compile this driver as a module, choose 30 + M here; the module will be called tpm_tis. 31 + 23 32 config TCG_NSC 24 33 tristate "National Semiconductor TPM Interface" 25 - depends on TCG_TPM 34 + depends on TCG_TPM && PNPACPI 26 35 ---help--- 27 36 If you have a TPM security chip from National Semicondutor 28 37 say Yes and it will be accessible from within Linux. To
+1
drivers/char/tpm/Makefile
··· 5 5 ifdef CONFIG_ACPI 6 6 obj-$(CONFIG_TCG_TPM) += tpm_bios.o 7 7 endif 8 + obj-$(CONFIG_TCG_TIS) += tpm_tis.o 8 9 obj-$(CONFIG_TCG_NSC) += tpm_nsc.o 9 10 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o 10 11 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o
+675 -115
drivers/char/tpm/tpm.c
··· 32 32 TPM_MINOR = 224, /* officially assigned */ 33 33 TPM_BUFSIZE = 2048, 34 34 TPM_NUM_DEVICES = 256, 35 - TPM_NUM_MASK_ENTRIES = TPM_NUM_DEVICES / (8 * sizeof(int)) 36 35 }; 36 + 37 + enum tpm_duration { 38 + TPM_SHORT = 0, 39 + TPM_MEDIUM = 1, 40 + TPM_LONG = 2, 41 + TPM_UNDEFINED, 42 + }; 43 + 44 + #define TPM_MAX_ORDINAL 243 45 + #define TPM_MAX_PROTECTED_ORDINAL 12 46 + #define TPM_PROTECTED_ORDINAL_MASK 0xFF 37 47 38 48 static LIST_HEAD(tpm_chip_list); 39 49 static DEFINE_SPINLOCK(driver_lock); 40 - static int dev_mask[TPM_NUM_MASK_ENTRIES]; 50 + static DECLARE_BITMAP(dev_mask, TPM_NUM_DEVICES); 51 + 52 + /* 53 + * Array with one entry per ordinal defining the maximum amount 54 + * of time the chip could take to return the result. The ordinal 55 + * designation of short, medium or long is defined in a table in 56 + * TCG Specification TPM Main Part 2 TPM Structures Section 17. The 57 + * values of the SHORT, MEDIUM, and LONG durations are retrieved 58 + * from the chip during initialization with a call to tpm_get_timeouts. 59 + */ 60 + static const u8 tpm_protected_ordinal_duration[TPM_MAX_PROTECTED_ORDINAL] = { 61 + TPM_UNDEFINED, /* 0 */ 62 + TPM_UNDEFINED, 63 + TPM_UNDEFINED, 64 + TPM_UNDEFINED, 65 + TPM_UNDEFINED, 66 + TPM_UNDEFINED, /* 5 */ 67 + TPM_UNDEFINED, 68 + TPM_UNDEFINED, 69 + TPM_UNDEFINED, 70 + TPM_UNDEFINED, 71 + TPM_SHORT, /* 10 */ 72 + TPM_SHORT, 73 + }; 74 + 75 + static const u8 tpm_ordinal_duration[TPM_MAX_ORDINAL] = { 76 + TPM_UNDEFINED, /* 0 */ 77 + TPM_UNDEFINED, 78 + TPM_UNDEFINED, 79 + TPM_UNDEFINED, 80 + TPM_UNDEFINED, 81 + TPM_UNDEFINED, /* 5 */ 82 + TPM_UNDEFINED, 83 + TPM_UNDEFINED, 84 + TPM_UNDEFINED, 85 + TPM_UNDEFINED, 86 + TPM_SHORT, /* 10 */ 87 + TPM_SHORT, 88 + TPM_MEDIUM, 89 + TPM_LONG, 90 + TPM_LONG, 91 + TPM_MEDIUM, /* 15 */ 92 + TPM_SHORT, 93 + TPM_SHORT, 94 + TPM_MEDIUM, 95 + TPM_LONG, 96 + TPM_SHORT, /* 20 */ 97 + TPM_SHORT, 98 + TPM_MEDIUM, 99 + TPM_MEDIUM, 100 + TPM_MEDIUM, 101 + TPM_SHORT, /* 25 */ 102 + TPM_SHORT, 103 + TPM_MEDIUM, 104 + TPM_SHORT, 105 + TPM_SHORT, 106 + TPM_MEDIUM, /* 30 */ 107 + TPM_LONG, 108 + TPM_MEDIUM, 109 + TPM_SHORT, 110 + TPM_SHORT, 111 + TPM_SHORT, /* 35 */ 112 + TPM_MEDIUM, 113 + TPM_MEDIUM, 114 + TPM_UNDEFINED, 115 + TPM_UNDEFINED, 116 + TPM_MEDIUM, /* 40 */ 117 + TPM_LONG, 118 + TPM_MEDIUM, 119 + TPM_SHORT, 120 + TPM_SHORT, 121 + TPM_SHORT, /* 45 */ 122 + TPM_SHORT, 123 + TPM_SHORT, 124 + TPM_SHORT, 125 + TPM_LONG, 126 + TPM_MEDIUM, /* 50 */ 127 + TPM_MEDIUM, 128 + TPM_UNDEFINED, 129 + TPM_UNDEFINED, 130 + TPM_UNDEFINED, 131 + TPM_UNDEFINED, /* 55 */ 132 + TPM_UNDEFINED, 133 + TPM_UNDEFINED, 134 + TPM_UNDEFINED, 135 + TPM_UNDEFINED, 136 + TPM_MEDIUM, /* 60 */ 137 + TPM_MEDIUM, 138 + TPM_MEDIUM, 139 + TPM_SHORT, 140 + TPM_SHORT, 141 + TPM_MEDIUM, /* 65 */ 142 + TPM_UNDEFINED, 143 + TPM_UNDEFINED, 144 + TPM_UNDEFINED, 145 + TPM_UNDEFINED, 146 + TPM_SHORT, /* 70 */ 147 + TPM_SHORT, 148 + TPM_UNDEFINED, 149 + TPM_UNDEFINED, 150 + TPM_UNDEFINED, 151 + TPM_UNDEFINED, /* 75 */ 152 + TPM_UNDEFINED, 153 + TPM_UNDEFINED, 154 + TPM_UNDEFINED, 155 + TPM_UNDEFINED, 156 + TPM_LONG, /* 80 */ 157 + TPM_UNDEFINED, 158 + TPM_MEDIUM, 159 + TPM_LONG, 160 + TPM_SHORT, 161 + TPM_UNDEFINED, /* 85 */ 162 + TPM_UNDEFINED, 163 + TPM_UNDEFINED, 164 + TPM_UNDEFINED, 165 + TPM_UNDEFINED, 166 + TPM_SHORT, /* 90 */ 167 + TPM_SHORT, 168 + TPM_SHORT, 169 + TPM_SHORT, 170 + TPM_SHORT, 171 + TPM_UNDEFINED, /* 95 */ 172 + TPM_UNDEFINED, 173 + TPM_UNDEFINED, 174 + TPM_UNDEFINED, 175 + TPM_UNDEFINED, 176 + TPM_MEDIUM, /* 100 */ 177 + TPM_SHORT, 178 + TPM_SHORT, 179 + TPM_UNDEFINED, 180 + TPM_UNDEFINED, 181 + TPM_UNDEFINED, /* 105 */ 182 + TPM_UNDEFINED, 183 + TPM_UNDEFINED, 184 + TPM_UNDEFINED, 185 + TPM_UNDEFINED, 186 + TPM_SHORT, /* 110 */ 187 + TPM_SHORT, 188 + TPM_SHORT, 189 + TPM_SHORT, 190 + TPM_SHORT, 191 + TPM_SHORT, /* 115 */ 192 + TPM_SHORT, 193 + TPM_SHORT, 194 + TPM_UNDEFINED, 195 + TPM_UNDEFINED, 196 + TPM_LONG, /* 120 */ 197 + TPM_LONG, 198 + TPM_MEDIUM, 199 + TPM_UNDEFINED, 200 + TPM_SHORT, 201 + TPM_SHORT, /* 125 */ 202 + TPM_SHORT, 203 + TPM_LONG, 204 + TPM_SHORT, 205 + TPM_SHORT, 206 + TPM_SHORT, /* 130 */ 207 + TPM_MEDIUM, 208 + TPM_UNDEFINED, 209 + TPM_SHORT, 210 + TPM_MEDIUM, 211 + TPM_UNDEFINED, /* 135 */ 212 + TPM_UNDEFINED, 213 + TPM_UNDEFINED, 214 + TPM_UNDEFINED, 215 + TPM_UNDEFINED, 216 + TPM_SHORT, /* 140 */ 217 + TPM_SHORT, 218 + TPM_UNDEFINED, 219 + TPM_UNDEFINED, 220 + TPM_UNDEFINED, 221 + TPM_UNDEFINED, /* 145 */ 222 + TPM_UNDEFINED, 223 + TPM_UNDEFINED, 224 + TPM_UNDEFINED, 225 + TPM_UNDEFINED, 226 + TPM_SHORT, /* 150 */ 227 + TPM_MEDIUM, 228 + TPM_MEDIUM, 229 + TPM_SHORT, 230 + TPM_SHORT, 231 + TPM_UNDEFINED, /* 155 */ 232 + TPM_UNDEFINED, 233 + TPM_UNDEFINED, 234 + TPM_UNDEFINED, 235 + TPM_UNDEFINED, 236 + TPM_SHORT, /* 160 */ 237 + TPM_SHORT, 238 + TPM_SHORT, 239 + TPM_SHORT, 240 + TPM_UNDEFINED, 241 + TPM_UNDEFINED, /* 165 */ 242 + TPM_UNDEFINED, 243 + TPM_UNDEFINED, 244 + TPM_UNDEFINED, 245 + TPM_UNDEFINED, 246 + TPM_LONG, /* 170 */ 247 + TPM_UNDEFINED, 248 + TPM_UNDEFINED, 249 + TPM_UNDEFINED, 250 + TPM_UNDEFINED, 251 + TPM_UNDEFINED, /* 175 */ 252 + TPM_UNDEFINED, 253 + TPM_UNDEFINED, 254 + TPM_UNDEFINED, 255 + TPM_UNDEFINED, 256 + TPM_MEDIUM, /* 180 */ 257 + TPM_SHORT, 258 + TPM_MEDIUM, 259 + TPM_MEDIUM, 260 + TPM_MEDIUM, 261 + TPM_MEDIUM, /* 185 */ 262 + TPM_SHORT, 263 + TPM_UNDEFINED, 264 + TPM_UNDEFINED, 265 + TPM_UNDEFINED, 266 + TPM_UNDEFINED, /* 190 */ 267 + TPM_UNDEFINED, 268 + TPM_UNDEFINED, 269 + TPM_UNDEFINED, 270 + TPM_UNDEFINED, 271 + TPM_UNDEFINED, /* 195 */ 272 + TPM_UNDEFINED, 273 + TPM_UNDEFINED, 274 + TPM_UNDEFINED, 275 + TPM_UNDEFINED, 276 + TPM_SHORT, /* 200 */ 277 + TPM_UNDEFINED, 278 + TPM_UNDEFINED, 279 + TPM_UNDEFINED, 280 + TPM_SHORT, 281 + TPM_SHORT, /* 205 */ 282 + TPM_SHORT, 283 + TPM_SHORT, 284 + TPM_SHORT, 285 + TPM_SHORT, 286 + TPM_MEDIUM, /* 210 */ 287 + TPM_UNDEFINED, 288 + TPM_MEDIUM, 289 + TPM_MEDIUM, 290 + TPM_MEDIUM, 291 + TPM_UNDEFINED, /* 215 */ 292 + TPM_MEDIUM, 293 + TPM_UNDEFINED, 294 + TPM_UNDEFINED, 295 + TPM_SHORT, 296 + TPM_SHORT, /* 220 */ 297 + TPM_SHORT, 298 + TPM_SHORT, 299 + TPM_SHORT, 300 + TPM_SHORT, 301 + TPM_UNDEFINED, /* 225 */ 302 + TPM_UNDEFINED, 303 + TPM_UNDEFINED, 304 + TPM_UNDEFINED, 305 + TPM_UNDEFINED, 306 + TPM_SHORT, /* 230 */ 307 + TPM_LONG, 308 + TPM_MEDIUM, 309 + TPM_UNDEFINED, 310 + TPM_UNDEFINED, 311 + TPM_UNDEFINED, /* 235 */ 312 + TPM_UNDEFINED, 313 + TPM_UNDEFINED, 314 + TPM_UNDEFINED, 315 + TPM_UNDEFINED, 316 + TPM_SHORT, /* 240 */ 317 + TPM_UNDEFINED, 318 + TPM_MEDIUM, 319 + }; 41 320 42 321 static void user_reader_timeout(unsigned long ptr) 43 322 { ··· 325 46 schedule_work(&chip->work); 326 47 } 327 48 328 - static void timeout_work(void * ptr) 49 + static void timeout_work(void *ptr) 329 50 { 330 51 struct tpm_chip *chip = ptr; 331 52 ··· 336 57 } 337 58 338 59 /* 60 + * Returns max number of jiffies to wait 61 + */ 62 + unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, 63 + u32 ordinal) 64 + { 65 + int duration_idx = TPM_UNDEFINED; 66 + int duration = 0; 67 + 68 + if (ordinal < TPM_MAX_ORDINAL) 69 + duration_idx = tpm_ordinal_duration[ordinal]; 70 + else if ((ordinal & TPM_PROTECTED_ORDINAL_MASK) < 71 + TPM_MAX_PROTECTED_ORDINAL) 72 + duration_idx = 73 + tpm_protected_ordinal_duration[ordinal & 74 + TPM_PROTECTED_ORDINAL_MASK]; 75 + 76 + if (duration_idx != TPM_UNDEFINED) 77 + duration = chip->vendor.duration[duration_idx]; 78 + if (duration <= 0) 79 + return 2 * 60 * HZ; 80 + else 81 + return duration; 82 + } 83 + EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); 84 + 85 + /* 339 86 * Internal kernel interface to transmit TPM commands 340 87 */ 341 88 static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, 342 89 size_t bufsiz) 343 90 { 344 91 ssize_t rc; 345 - u32 count; 92 + u32 count, ordinal; 346 93 unsigned long stop; 347 94 348 95 count = be32_to_cpu(*((__be32 *) (buf + 2))); 349 - 96 + ordinal = be32_to_cpu(*((__be32 *) (buf + 6))); 350 97 if (count == 0) 351 98 return -ENODATA; 352 99 if (count > bufsiz) { ··· 383 78 384 79 down(&chip->tpm_mutex); 385 80 386 - if ((rc = chip->vendor->send(chip, (u8 *) buf, count)) < 0) { 81 + if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) { 387 82 dev_err(chip->dev, 388 83 "tpm_transmit: tpm_send: error %zd\n", rc); 389 84 goto out; 390 85 } 391 86 392 - stop = jiffies + 2 * 60 * HZ; 393 - do { 394 - u8 status = chip->vendor->status(chip); 395 - if ((status & chip->vendor->req_complete_mask) == 396 - chip->vendor->req_complete_val) { 397 - goto out_recv; 398 - } 87 + if (chip->vendor.irq) 88 + goto out_recv; 399 89 400 - if ((status == chip->vendor->req_canceled)) { 90 + stop = jiffies + tpm_calc_ordinal_duration(chip, ordinal); 91 + do { 92 + u8 status = chip->vendor.status(chip); 93 + if ((status & chip->vendor.req_complete_mask) == 94 + chip->vendor.req_complete_val) 95 + goto out_recv; 96 + 97 + if ((status == chip->vendor.req_canceled)) { 401 98 dev_err(chip->dev, "Operation Canceled\n"); 402 99 rc = -ECANCELED; 403 100 goto out; ··· 409 102 rmb(); 410 103 } while (time_before(jiffies, stop)); 411 104 412 - 413 - chip->vendor->cancel(chip); 105 + chip->vendor.cancel(chip); 414 106 dev_err(chip->dev, "Operation Timed out\n"); 415 107 rc = -ETIME; 416 108 goto out; 417 109 418 110 out_recv: 419 - rc = chip->vendor->recv(chip, (u8 *) buf, bufsiz); 111 + rc = chip->vendor.recv(chip, (u8 *) buf, bufsiz); 420 112 if (rc < 0) 421 113 dev_err(chip->dev, 422 114 "tpm_transmit: tpm_recv: error %zd\n", rc); ··· 425 119 } 426 120 427 121 #define TPM_DIGEST_SIZE 20 428 - #define CAP_PCR_RESULT_SIZE 18 429 - static const u8 cap_pcr[] = { 122 + #define TPM_ERROR_SIZE 10 123 + #define TPM_RET_CODE_IDX 6 124 + #define TPM_GET_CAP_RET_SIZE_IDX 10 125 + #define TPM_GET_CAP_RET_UINT32_1_IDX 14 126 + #define TPM_GET_CAP_RET_UINT32_2_IDX 18 127 + #define TPM_GET_CAP_RET_UINT32_3_IDX 22 128 + #define TPM_GET_CAP_RET_UINT32_4_IDX 26 129 + #define TPM_GET_CAP_PERM_DISABLE_IDX 16 130 + #define TPM_GET_CAP_PERM_INACTIVE_IDX 18 131 + #define TPM_GET_CAP_RET_BOOL_1_IDX 14 132 + #define TPM_GET_CAP_TEMP_INACTIVE_IDX 16 133 + 134 + #define TPM_CAP_IDX 13 135 + #define TPM_CAP_SUBCAP_IDX 21 136 + 137 + enum tpm_capabilities { 138 + TPM_CAP_FLAG = 4, 139 + TPM_CAP_PROP = 5, 140 + }; 141 + 142 + enum tpm_sub_capabilities { 143 + TPM_CAP_PROP_PCR = 0x1, 144 + TPM_CAP_PROP_MANUFACTURER = 0x3, 145 + TPM_CAP_FLAG_PERM = 0x8, 146 + TPM_CAP_FLAG_VOL = 0x9, 147 + TPM_CAP_PROP_OWNER = 0x11, 148 + TPM_CAP_PROP_TIS_TIMEOUT = 0x15, 149 + TPM_CAP_PROP_TIS_DURATION = 0x20, 150 + }; 151 + 152 + /* 153 + * This is a semi generic GetCapability command for use 154 + * with the capability type TPM_CAP_PROP or TPM_CAP_FLAG 155 + * and their associated sub_capabilities. 156 + */ 157 + 158 + static const u8 tpm_cap[] = { 430 159 0, 193, /* TPM_TAG_RQU_COMMAND */ 431 160 0, 0, 0, 22, /* length */ 432 161 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 433 - 0, 0, 0, 5, 434 - 0, 0, 0, 4, 435 - 0, 0, 1, 1 162 + 0, 0, 0, 0, /* TPM_CAP_<TYPE> */ 163 + 0, 0, 0, 4, /* TPM_CAP_SUB_<TYPE> size */ 164 + 0, 0, 1, 0 /* TPM_CAP_SUB_<TYPE> */ 436 165 }; 437 166 438 - #define READ_PCR_RESULT_SIZE 30 167 + static ssize_t transmit_cmd(struct tpm_chip *chip, u8 *data, int len, 168 + char *desc) 169 + { 170 + int err; 171 + 172 + len = tpm_transmit(chip, data, len); 173 + if (len < 0) 174 + return len; 175 + if (len == TPM_ERROR_SIZE) { 176 + err = be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX))); 177 + dev_dbg(chip->dev, "A TPM error (%d) occurred %s\n", err, desc); 178 + return err; 179 + } 180 + return 0; 181 + } 182 + 183 + void tpm_gen_interrupt(struct tpm_chip *chip) 184 + { 185 + u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)]; 186 + ssize_t rc; 187 + 188 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 189 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 190 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT; 191 + 192 + rc = transmit_cmd(chip, data, sizeof(data), 193 + "attempting to determine the timeouts"); 194 + } 195 + EXPORT_SYMBOL_GPL(tpm_gen_interrupt); 196 + 197 + void tpm_get_timeouts(struct tpm_chip *chip) 198 + { 199 + u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 30)]; 200 + ssize_t rc; 201 + u32 timeout; 202 + 203 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 204 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 205 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_TIMEOUT; 206 + 207 + rc = transmit_cmd(chip, data, sizeof(data), 208 + "attempting to determine the timeouts"); 209 + if (rc) 210 + goto duration; 211 + 212 + if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX))) 213 + != 4 * sizeof(u32)) 214 + goto duration; 215 + 216 + /* Don't overwrite default if value is 0 */ 217 + timeout = 218 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX))); 219 + if (timeout) 220 + chip->vendor.timeout_a = msecs_to_jiffies(timeout); 221 + timeout = 222 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_2_IDX))); 223 + if (timeout) 224 + chip->vendor.timeout_b = msecs_to_jiffies(timeout); 225 + timeout = 226 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_3_IDX))); 227 + if (timeout) 228 + chip->vendor.timeout_c = msecs_to_jiffies(timeout); 229 + timeout = 230 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_4_IDX))); 231 + if (timeout) 232 + chip->vendor.timeout_d = msecs_to_jiffies(timeout); 233 + 234 + duration: 235 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 236 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 237 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_TIS_DURATION; 238 + 239 + rc = transmit_cmd(chip, data, sizeof(data), 240 + "attempting to determine the durations"); 241 + if (rc) 242 + return; 243 + 244 + if (be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_SIZE_IDX))) 245 + != 3 * sizeof(u32)) 246 + return; 247 + 248 + chip->vendor.duration[TPM_SHORT] = 249 + msecs_to_jiffies(be32_to_cpu 250 + (*((__be32 *) (data + 251 + TPM_GET_CAP_RET_UINT32_1_IDX)))); 252 + chip->vendor.duration[TPM_MEDIUM] = 253 + msecs_to_jiffies(be32_to_cpu 254 + (*((__be32 *) (data + 255 + TPM_GET_CAP_RET_UINT32_2_IDX)))); 256 + chip->vendor.duration[TPM_LONG] = 257 + msecs_to_jiffies(be32_to_cpu 258 + (*((__be32 *) (data + 259 + TPM_GET_CAP_RET_UINT32_3_IDX)))); 260 + } 261 + EXPORT_SYMBOL_GPL(tpm_get_timeouts); 262 + 263 + void tpm_continue_selftest(struct tpm_chip *chip) 264 + { 265 + u8 data[] = { 266 + 0, 193, /* TPM_TAG_RQU_COMMAND */ 267 + 0, 0, 0, 10, /* length */ 268 + 0, 0, 0, 83, /* TPM_ORD_GetCapability */ 269 + }; 270 + 271 + tpm_transmit(chip, data, sizeof(data)); 272 + } 273 + EXPORT_SYMBOL_GPL(tpm_continue_selftest); 274 + 275 + ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, 276 + char *buf) 277 + { 278 + u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)]; 279 + ssize_t rc; 280 + 281 + struct tpm_chip *chip = dev_get_drvdata(dev); 282 + if (chip == NULL) 283 + return -ENODEV; 284 + 285 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 286 + data[TPM_CAP_IDX] = TPM_CAP_FLAG; 287 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM; 288 + 289 + rc = transmit_cmd(chip, data, sizeof(data), 290 + "attemtping to determine the permanent state"); 291 + if (rc) 292 + return 0; 293 + return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_DISABLE_IDX]); 294 + } 295 + EXPORT_SYMBOL_GPL(tpm_show_enabled); 296 + 297 + ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, 298 + char *buf) 299 + { 300 + u8 data[max_t(int, ARRAY_SIZE(tpm_cap), 35)]; 301 + ssize_t rc; 302 + 303 + struct tpm_chip *chip = dev_get_drvdata(dev); 304 + if (chip == NULL) 305 + return -ENODEV; 306 + 307 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 308 + data[TPM_CAP_IDX] = TPM_CAP_FLAG; 309 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_PERM; 310 + 311 + rc = transmit_cmd(chip, data, sizeof(data), 312 + "attemtping to determine the permanent state"); 313 + if (rc) 314 + return 0; 315 + return sprintf(buf, "%d\n", !data[TPM_GET_CAP_PERM_INACTIVE_IDX]); 316 + } 317 + EXPORT_SYMBOL_GPL(tpm_show_active); 318 + 319 + ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, 320 + char *buf) 321 + { 322 + u8 data[sizeof(tpm_cap)]; 323 + ssize_t rc; 324 + 325 + struct tpm_chip *chip = dev_get_drvdata(dev); 326 + if (chip == NULL) 327 + return -ENODEV; 328 + 329 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 330 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 331 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_OWNER; 332 + 333 + rc = transmit_cmd(chip, data, sizeof(data), 334 + "attempting to determine the owner state"); 335 + if (rc) 336 + return 0; 337 + return sprintf(buf, "%d\n", data[TPM_GET_CAP_RET_BOOL_1_IDX]); 338 + } 339 + EXPORT_SYMBOL_GPL(tpm_show_owned); 340 + 341 + ssize_t tpm_show_temp_deactivated(struct device * dev, 342 + struct device_attribute * attr, char *buf) 343 + { 344 + u8 data[sizeof(tpm_cap)]; 345 + ssize_t rc; 346 + 347 + struct tpm_chip *chip = dev_get_drvdata(dev); 348 + if (chip == NULL) 349 + return -ENODEV; 350 + 351 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 352 + data[TPM_CAP_IDX] = TPM_CAP_FLAG; 353 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_FLAG_VOL; 354 + 355 + rc = transmit_cmd(chip, data, sizeof(data), 356 + "attempting to determine the temporary state"); 357 + if (rc) 358 + return 0; 359 + return sprintf(buf, "%d\n", data[TPM_GET_CAP_TEMP_INACTIVE_IDX]); 360 + } 361 + EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated); 362 + 439 363 static const u8 pcrread[] = { 440 364 0, 193, /* TPM_TAG_RQU_COMMAND */ 441 365 0, 0, 0, 14, /* length */ ··· 676 140 ssize_t tpm_show_pcrs(struct device *dev, struct device_attribute *attr, 677 141 char *buf) 678 142 { 679 - u8 data[READ_PCR_RESULT_SIZE]; 680 - ssize_t len; 143 + u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(pcrread)), 30)]; 144 + ssize_t rc; 681 145 int i, j, num_pcrs; 682 146 __be32 index; 683 147 char *str = buf; ··· 686 150 if (chip == NULL) 687 151 return -ENODEV; 688 152 689 - memcpy(data, cap_pcr, sizeof(cap_pcr)); 690 - if ((len = tpm_transmit(chip, data, sizeof(data))) 691 - < CAP_PCR_RESULT_SIZE) { 692 - dev_dbg(chip->dev, "A TPM error (%d) occurred " 693 - "attempting to determine the number of PCRS\n", 694 - be32_to_cpu(*((__be32 *) (data + 6)))); 153 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 154 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 155 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_PCR; 156 + 157 + rc = transmit_cmd(chip, data, sizeof(data), 158 + "attempting to determine the number of PCRS"); 159 + if (rc) 695 160 return 0; 696 - } 697 161 698 162 num_pcrs = be32_to_cpu(*((__be32 *) (data + 14))); 699 - 700 163 for (i = 0; i < num_pcrs; i++) { 701 164 memcpy(data, pcrread, sizeof(pcrread)); 702 165 index = cpu_to_be32(i); 703 166 memcpy(data + 10, &index, 4); 704 - if ((len = tpm_transmit(chip, data, sizeof(data))) 705 - < READ_PCR_RESULT_SIZE){ 706 - dev_dbg(chip->dev, "A TPM error (%d) occurred" 707 - " attempting to read PCR %d of %d\n", 708 - be32_to_cpu(*((__be32 *) (data + 6))), 709 - i, num_pcrs); 167 + rc = transmit_cmd(chip, data, sizeof(data), 168 + "attempting to read a PCR"); 169 + if (rc) 710 170 goto out; 711 - } 712 171 str += sprintf(str, "PCR-%02d: ", i); 713 172 for (j = 0; j < TPM_DIGEST_SIZE; j++) 714 173 str += sprintf(str, "%02X ", *(data + 10 + j)); ··· 725 194 char *buf) 726 195 { 727 196 u8 *data; 728 - ssize_t len; 197 + ssize_t err; 729 198 int i, rc; 730 199 char *str = buf; 731 200 ··· 739 208 740 209 memcpy(data, readpubek, sizeof(readpubek)); 741 210 742 - if ((len = tpm_transmit(chip, data, READ_PUBEK_RESULT_SIZE)) < 743 - READ_PUBEK_RESULT_SIZE) { 744 - dev_dbg(chip->dev, "A TPM error (%d) occurred " 745 - "attempting to read the PUBEK\n", 746 - be32_to_cpu(*((__be32 *) (data + 6)))); 747 - rc = 0; 211 + err = transmit_cmd(chip, data, READ_PUBEK_RESULT_SIZE, 212 + "attempting to read the PUBEK"); 213 + if (err) 748 214 goto out; 749 - } 750 215 751 216 /* 752 217 ignore header 10 bytes ··· 772 245 if ((i + 1) % 16 == 0) 773 246 str += sprintf(str, "\n"); 774 247 } 775 - rc = str - buf; 776 248 out: 249 + rc = str - buf; 777 250 kfree(data); 778 251 return rc; 779 252 } 780 253 EXPORT_SYMBOL_GPL(tpm_show_pubek); 781 254 782 - #define CAP_VER_RESULT_SIZE 18 255 + #define CAP_VERSION_1_1 6 256 + #define CAP_VERSION_1_2 0x1A 257 + #define CAP_VERSION_IDX 13 783 258 static const u8 cap_version[] = { 784 259 0, 193, /* TPM_TAG_RQU_COMMAND */ 785 260 0, 0, 0, 18, /* length */ 786 261 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 787 - 0, 0, 0, 6, 262 + 0, 0, 0, 0, 788 263 0, 0, 0, 0 789 - }; 790 - 791 - #define CAP_MANUFACTURER_RESULT_SIZE 18 792 - static const u8 cap_manufacturer[] = { 793 - 0, 193, /* TPM_TAG_RQU_COMMAND */ 794 - 0, 0, 0, 22, /* length */ 795 - 0, 0, 0, 101, /* TPM_ORD_GetCapability */ 796 - 0, 0, 0, 5, 797 - 0, 0, 0, 4, 798 - 0, 0, 1, 3 799 264 }; 800 265 801 266 ssize_t tpm_show_caps(struct device *dev, struct device_attribute *attr, 802 267 char *buf) 803 268 { 804 - u8 data[sizeof(cap_manufacturer)]; 269 + u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)]; 270 + ssize_t rc; 271 + char *str = buf; 272 + 273 + struct tpm_chip *chip = dev_get_drvdata(dev); 274 + if (chip == NULL) 275 + return -ENODEV; 276 + 277 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 278 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 279 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER; 280 + 281 + rc = transmit_cmd(chip, data, sizeof(data), 282 + "attempting to determine the manufacturer"); 283 + if (rc) 284 + return 0; 285 + 286 + str += sprintf(str, "Manufacturer: 0x%x\n", 287 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)))); 288 + 289 + memcpy(data, cap_version, sizeof(cap_version)); 290 + data[CAP_VERSION_IDX] = CAP_VERSION_1_1; 291 + rc = transmit_cmd(chip, data, sizeof(data), 292 + "attempting to determine the 1.1 version"); 293 + if (rc) 294 + goto out; 295 + 296 + str += sprintf(str, 297 + "TCG version: %d.%d\nFirmware version: %d.%d\n", 298 + (int) data[14], (int) data[15], (int) data[16], 299 + (int) data[17]); 300 + 301 + out: 302 + return str - buf; 303 + } 304 + EXPORT_SYMBOL_GPL(tpm_show_caps); 305 + 306 + ssize_t tpm_show_caps_1_2(struct device * dev, 307 + struct device_attribute * attr, char *buf) 308 + { 309 + u8 data[max_t(int, max(ARRAY_SIZE(tpm_cap), ARRAY_SIZE(cap_version)), 30)]; 805 310 ssize_t len; 806 311 char *str = buf; 807 312 ··· 841 282 if (chip == NULL) 842 283 return -ENODEV; 843 284 844 - memcpy(data, cap_manufacturer, sizeof(cap_manufacturer)); 285 + memcpy(data, tpm_cap, sizeof(tpm_cap)); 286 + data[TPM_CAP_IDX] = TPM_CAP_PROP; 287 + data[TPM_CAP_SUBCAP_IDX] = TPM_CAP_PROP_MANUFACTURER; 845 288 846 - if ((len = tpm_transmit(chip, data, sizeof(data))) < 847 - CAP_MANUFACTURER_RESULT_SIZE) 848 - return len; 289 + if ((len = tpm_transmit(chip, data, sizeof(data))) <= 290 + TPM_ERROR_SIZE) { 291 + dev_dbg(chip->dev, "A TPM error (%d) occurred " 292 + "attempting to determine the manufacturer\n", 293 + be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)))); 294 + return 0; 295 + } 849 296 850 297 str += sprintf(str, "Manufacturer: 0x%x\n", 851 - be32_to_cpu(*((__be32 *) (data + 14)))); 298 + be32_to_cpu(*((__be32 *) (data + TPM_GET_CAP_RET_UINT32_1_IDX)))); 852 299 853 300 memcpy(data, cap_version, sizeof(cap_version)); 301 + data[CAP_VERSION_IDX] = CAP_VERSION_1_2; 854 302 855 - if ((len = tpm_transmit(chip, data, sizeof(data))) < 856 - CAP_VER_RESULT_SIZE) 857 - return len; 303 + if ((len = tpm_transmit(chip, data, sizeof(data))) <= 304 + TPM_ERROR_SIZE) { 305 + dev_err(chip->dev, "A TPM error (%d) occurred " 306 + "attempting to determine the 1.2 version\n", 307 + be32_to_cpu(*((__be32 *) (data + TPM_RET_CODE_IDX)))); 308 + goto out; 309 + } 310 + str += sprintf(str, 311 + "TCG version: %d.%d\nFirmware version: %d.%d\n", 312 + (int) data[16], (int) data[17], (int) data[18], 313 + (int) data[19]); 858 314 859 - str += 860 - sprintf(str, "TCG version: %d.%d\nFirmware version: %d.%d\n", 861 - (int) data[14], (int) data[15], (int) data[16], 862 - (int) data[17]); 863 - 315 + out: 864 316 return str - buf; 865 317 } 866 - EXPORT_SYMBOL_GPL(tpm_show_caps); 318 + EXPORT_SYMBOL_GPL(tpm_show_caps_1_2); 867 319 868 320 ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, 869 321 const char *buf, size_t count) ··· 883 313 if (chip == NULL) 884 314 return 0; 885 315 886 - chip->vendor->cancel(chip); 316 + chip->vendor.cancel(chip); 887 317 return count; 888 318 } 889 319 EXPORT_SYMBOL_GPL(tpm_store_cancel); ··· 899 329 spin_lock(&driver_lock); 900 330 901 331 list_for_each_entry(pos, &tpm_chip_list, list) { 902 - if (pos->vendor->miscdev.minor == minor) { 332 + if (pos->vendor.miscdev.minor == minor) { 903 333 chip = pos; 904 334 break; 905 335 } ··· 957 387 EXPORT_SYMBOL_GPL(tpm_release); 958 388 959 389 ssize_t tpm_write(struct file *file, const char __user *buf, 960 - size_t size, loff_t * off) 390 + size_t size, loff_t *off) 961 391 { 962 392 struct tpm_chip *chip = file->private_data; 963 393 int in_size = size, out_size; ··· 989 419 990 420 return in_size; 991 421 } 992 - 993 422 EXPORT_SYMBOL_GPL(tpm_write); 994 423 995 - ssize_t tpm_read(struct file * file, char __user *buf, 996 - size_t size, loff_t * off) 424 + ssize_t tpm_read(struct file *file, char __user *buf, 425 + size_t size, loff_t *off) 997 426 { 998 427 struct tpm_chip *chip = file->private_data; 999 428 int ret_size; ··· 1031 462 spin_unlock(&driver_lock); 1032 463 1033 464 dev_set_drvdata(dev, NULL); 1034 - misc_deregister(&chip->vendor->miscdev); 1035 - kfree(chip->vendor->miscdev.name); 465 + misc_deregister(&chip->vendor.miscdev); 466 + kfree(chip->vendor.miscdev.name); 1036 467 1037 - sysfs_remove_group(&dev->kobj, chip->vendor->attr_group); 468 + sysfs_remove_group(&dev->kobj, chip->vendor.attr_group); 1038 469 tpm_bios_log_teardown(chip->bios_dir); 1039 470 1040 - dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &= 1041 - ~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES)); 471 + clear_bit(chip->dev_num, dev_mask); 1042 472 1043 473 kfree(chip); 1044 474 ··· 1088 520 * upon errant exit from this function specific probe function should call 1089 521 * pci_disable_device 1090 522 */ 1091 - int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry) 523 + struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vendor_specific 524 + *entry) 1092 525 { 1093 526 #define DEVNAME_SIZE 7 1094 527 1095 528 char *devname; 1096 529 struct tpm_chip *chip; 1097 - int i, j; 1098 530 1099 531 /* Driver specific per-device data */ 1100 532 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1101 533 if (chip == NULL) 1102 - return -ENOMEM; 534 + return NULL; 1103 535 1104 536 init_MUTEX(&chip->buffer_mutex); 1105 537 init_MUTEX(&chip->tpm_mutex); ··· 1111 543 chip->user_read_timer.function = user_reader_timeout; 1112 544 chip->user_read_timer.data = (unsigned long) chip; 1113 545 1114 - chip->vendor = entry; 546 + memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific)); 1115 547 1116 - chip->dev_num = -1; 548 + chip->dev_num = find_first_zero_bit(dev_mask, TPM_NUM_DEVICES); 1117 549 1118 - for (i = 0; i < TPM_NUM_MASK_ENTRIES; i++) 1119 - for (j = 0; j < 8 * sizeof(int); j++) 1120 - if ((dev_mask[i] & (1 << j)) == 0) { 1121 - chip->dev_num = 1122 - i * TPM_NUM_MASK_ENTRIES + j; 1123 - dev_mask[i] |= 1 << j; 1124 - goto dev_num_search_complete; 1125 - } 1126 - 1127 - dev_num_search_complete: 1128 - if (chip->dev_num < 0) { 550 + if (chip->dev_num >= TPM_NUM_DEVICES) { 1129 551 dev_err(dev, "No available tpm device numbers\n"); 1130 552 kfree(chip); 1131 - return -ENODEV; 553 + return NULL; 1132 554 } else if (chip->dev_num == 0) 1133 - chip->vendor->miscdev.minor = TPM_MINOR; 555 + chip->vendor.miscdev.minor = TPM_MINOR; 1134 556 else 1135 - chip->vendor->miscdev.minor = MISC_DYNAMIC_MINOR; 557 + chip->vendor.miscdev.minor = MISC_DYNAMIC_MINOR; 558 + 559 + set_bit(chip->dev_num, dev_mask); 1136 560 1137 561 devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL); 1138 562 scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num); 1139 - chip->vendor->miscdev.name = devname; 563 + chip->vendor.miscdev.name = devname; 1140 564 1141 - chip->vendor->miscdev.dev = dev; 565 + chip->vendor.miscdev.dev = dev; 1142 566 chip->dev = get_device(dev); 1143 567 1144 - if (misc_register(&chip->vendor->miscdev)) { 568 + if (misc_register(&chip->vendor.miscdev)) { 1145 569 dev_err(chip->dev, 1146 570 "unable to misc_register %s, minor %d\n", 1147 - chip->vendor->miscdev.name, 1148 - chip->vendor->miscdev.minor); 571 + chip->vendor.miscdev.name, 572 + chip->vendor.miscdev.minor); 1149 573 put_device(dev); 574 + clear_bit(chip->dev_num, dev_mask); 1150 575 kfree(chip); 1151 - dev_mask[i] &= !(1 << j); 1152 - return -ENODEV; 576 + return NULL; 1153 577 } 1154 578 1155 579 spin_lock(&driver_lock); ··· 1152 592 1153 593 spin_unlock(&driver_lock); 1154 594 1155 - sysfs_create_group(&dev->kobj, chip->vendor->attr_group); 595 + sysfs_create_group(&dev->kobj, chip->vendor.attr_group); 1156 596 1157 597 chip->bios_dir = tpm_bios_log_setup(devname); 1158 598 1159 - return 0; 599 + return chip; 1160 600 } 1161 601 EXPORT_SYMBOL_GPL(tpm_register_hardware); 1162 602
+31 -6
drivers/char/tpm/tpm.h
··· 42 42 char *); 43 43 extern ssize_t tpm_show_caps(struct device *, struct device_attribute *attr, 44 44 char *); 45 + extern ssize_t tpm_show_caps_1_2(struct device *, struct device_attribute *attr, 46 + char *); 45 47 extern ssize_t tpm_store_cancel(struct device *, struct device_attribute *attr, 46 48 const char *, size_t); 49 + extern ssize_t tpm_show_enabled(struct device *, struct device_attribute *attr, 50 + char *); 51 + extern ssize_t tpm_show_active(struct device *, struct device_attribute *attr, 52 + char *); 53 + extern ssize_t tpm_show_owned(struct device *, struct device_attribute *attr, 54 + char *); 55 + extern ssize_t tpm_show_temp_deactivated(struct device *, 56 + struct device_attribute *attr, char *); 47 57 48 58 struct tpm_chip; 49 59 50 60 struct tpm_vendor_specific { 51 - u8 req_complete_mask; 52 - u8 req_complete_val; 53 - u8 req_canceled; 61 + const u8 req_complete_mask; 62 + const u8 req_complete_val; 63 + const u8 req_canceled; 54 64 void __iomem *iobase; /* ioremapped address */ 55 65 unsigned long base; /* TPM base address */ 66 + 67 + int irq; 56 68 57 69 int region_size; 58 70 int have_region; ··· 75 63 u8 (*status) (struct tpm_chip *); 76 64 struct miscdevice miscdev; 77 65 struct attribute_group *attr_group; 66 + struct list_head list; 67 + int locality; 68 + unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */ 69 + unsigned long duration[3]; /* jiffies */ 70 + 71 + wait_queue_head_t read_queue; 72 + wait_queue_head_t int_queue; 78 73 }; 79 74 80 75 struct tpm_chip { ··· 100 81 struct work_struct work; 101 82 struct semaphore tpm_mutex; /* tpm is processing */ 102 83 103 - struct tpm_vendor_specific *vendor; 84 + struct tpm_vendor_specific vendor; 104 85 105 86 struct dentry **bios_dir; 106 87 107 88 struct list_head list; 108 89 }; 90 + 91 + #define to_tpm_chip(n) container_of(n, struct tpm_chip, vendor) 109 92 110 93 static inline int tpm_read_index(int base, int index) 111 94 { ··· 121 100 outb(value & 0xFF, base+1); 122 101 } 123 102 124 - extern int tpm_register_hardware(struct device *, 125 - struct tpm_vendor_specific *); 103 + extern void tpm_get_timeouts(struct tpm_chip *); 104 + extern void tpm_gen_interrupt(struct tpm_chip *); 105 + extern void tpm_continue_selftest(struct tpm_chip *); 106 + extern unsigned long tpm_calc_ordinal_duration(struct tpm_chip *, u32); 107 + extern struct tpm_chip* tpm_register_hardware(struct device *, 108 + const struct tpm_vendor_specific *); 126 109 extern int tpm_open(struct inode *, struct file *); 127 110 extern int tpm_release(struct inode *, struct file *); 128 111 extern ssize_t tpm_write(struct file *, const char __user *, size_t,
+35 -23
drivers/char/tpm/tpm_atmel.c
··· 47 47 return -EIO; 48 48 49 49 for (i = 0; i < 6; i++) { 50 - status = ioread8(chip->vendor->iobase + 1); 50 + status = ioread8(chip->vendor.iobase + 1); 51 51 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 52 52 dev_err(chip->dev, "error reading header\n"); 53 53 return -EIO; 54 54 } 55 - *buf++ = ioread8(chip->vendor->iobase); 55 + *buf++ = ioread8(chip->vendor.iobase); 56 56 } 57 57 58 58 /* size of the data received */ ··· 63 63 dev_err(chip->dev, 64 64 "Recv size(%d) less than available space\n", size); 65 65 for (; i < size; i++) { /* clear the waiting data anyway */ 66 - status = ioread8(chip->vendor->iobase + 1); 66 + status = ioread8(chip->vendor.iobase + 1); 67 67 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 68 68 dev_err(chip->dev, "error reading data\n"); 69 69 return -EIO; ··· 74 74 75 75 /* read all the data available */ 76 76 for (; i < size; i++) { 77 - status = ioread8(chip->vendor->iobase + 1); 77 + status = ioread8(chip->vendor.iobase + 1); 78 78 if ((status & ATML_STATUS_DATA_AVAIL) == 0) { 79 79 dev_err(chip->dev, "error reading data\n"); 80 80 return -EIO; 81 81 } 82 - *buf++ = ioread8(chip->vendor->iobase); 82 + *buf++ = ioread8(chip->vendor.iobase); 83 83 } 84 84 85 85 /* make sure data available is gone */ 86 - status = ioread8(chip->vendor->iobase + 1); 86 + status = ioread8(chip->vendor.iobase + 1); 87 87 88 88 if (status & ATML_STATUS_DATA_AVAIL) { 89 89 dev_err(chip->dev, "data available is stuck\n"); ··· 100 100 dev_dbg(chip->dev, "tpm_atml_send:\n"); 101 101 for (i = 0; i < count; i++) { 102 102 dev_dbg(chip->dev, "%d 0x%x(%d)\n", i, buf[i], buf[i]); 103 - iowrite8(buf[i], chip->vendor->iobase); 103 + iowrite8(buf[i], chip->vendor.iobase); 104 104 } 105 105 106 106 return count; ··· 108 108 109 109 static void tpm_atml_cancel(struct tpm_chip *chip) 110 110 { 111 - iowrite8(ATML_STATUS_ABORT, chip->vendor->iobase + 1); 111 + iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1); 112 112 } 113 113 114 114 static u8 tpm_atml_status(struct tpm_chip *chip) 115 115 { 116 - return ioread8(chip->vendor->iobase + 1); 116 + return ioread8(chip->vendor.iobase + 1); 117 117 } 118 118 119 119 static struct file_operations atmel_ops = { ··· 140 140 141 141 static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs }; 142 142 143 - static struct tpm_vendor_specific tpm_atmel = { 143 + static const struct tpm_vendor_specific tpm_atmel = { 144 144 .recv = tpm_atml_recv, 145 145 .send = tpm_atml_send, 146 146 .cancel = tpm_atml_cancel, ··· 159 159 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); 160 160 161 161 if (chip) { 162 - if (chip->vendor->have_region) 163 - atmel_release_region(chip->vendor->base, 164 - chip->vendor->region_size); 165 - atmel_put_base_addr(chip->vendor); 162 + if (chip->vendor.have_region) 163 + atmel_release_region(chip->vendor.base, 164 + chip->vendor.region_size); 165 + atmel_put_base_addr(chip->vendor.iobase); 166 166 tpm_remove_hardware(chip->dev); 167 167 platform_device_unregister(pdev); 168 168 } ··· 179 179 static int __init init_atmel(void) 180 180 { 181 181 int rc = 0; 182 + void __iomem *iobase = NULL; 183 + int have_region, region_size; 184 + unsigned long base; 185 + struct tpm_chip *chip; 182 186 183 187 driver_register(&atml_drv); 184 188 185 - if ((tpm_atmel.iobase = atmel_get_base_addr(&tpm_atmel)) == NULL) { 189 + if ((iobase = atmel_get_base_addr(&base, &region_size)) == NULL) { 186 190 rc = -ENODEV; 187 191 goto err_unreg_drv; 188 192 } 189 193 190 - tpm_atmel.have_region = 194 + have_region = 191 195 (atmel_request_region 192 - (tpm_atmel.base, tpm_atmel.region_size, 193 - "tpm_atmel0") == NULL) ? 0 : 1; 196 + (tpm_atmel.base, region_size, "tpm_atmel0") == NULL) ? 0 : 1; 197 + 194 198 195 199 if (IS_ERR 196 200 (pdev = ··· 203 199 goto err_rel_reg; 204 200 } 205 201 206 - if ((rc = tpm_register_hardware(&pdev->dev, &tpm_atmel)) < 0) 202 + if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_atmel))) { 203 + rc = -ENODEV; 207 204 goto err_unreg_dev; 205 + } 206 + 207 + chip->vendor.iobase = iobase; 208 + chip->vendor.base = base; 209 + chip->vendor.have_region = have_region; 210 + chip->vendor.region_size = region_size; 211 + 208 212 return 0; 209 213 210 214 err_unreg_dev: 211 215 platform_device_unregister(pdev); 212 216 err_rel_reg: 213 - atmel_put_base_addr(&tpm_atmel); 214 - if (tpm_atmel.have_region) 215 - atmel_release_region(tpm_atmel.base, 216 - tpm_atmel.region_size); 217 + atmel_put_base_addr(iobase); 218 + if (have_region) 219 + atmel_release_region(base, 220 + region_size); 217 221 err_unreg_drv: 218 222 driver_unregister(&atml_drv); 219 223 return rc;
+11 -14
drivers/char/tpm/tpm_atmel.h
··· 28 28 #define atmel_request_region request_mem_region 29 29 #define atmel_release_region release_mem_region 30 30 31 - static inline void atmel_put_base_addr(struct tpm_vendor_specific 32 - *vendor) 31 + static inline void atmel_put_base_addr(void __iomem *iobase) 33 32 { 34 - iounmap(vendor->iobase); 33 + iounmap(iobase); 35 34 } 36 35 37 - static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor) 36 + static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size) 38 37 { 39 38 struct device_node *dn; 40 39 unsigned long address, size; ··· 70 71 else 71 72 size = reg[naddrc]; 72 73 73 - vendor->base = address; 74 - vendor->region_size = size; 75 - return ioremap(vendor->base, vendor->region_size); 74 + *base = address; 75 + *region_size = size; 76 + return ioremap(*base, *region_size); 76 77 } 77 78 #else 78 79 #define atmel_getb(chip, offset) inb(chip->vendor->base + offset) ··· 105 106 return 0; 106 107 } 107 108 108 - static inline void atmel_put_base_addr(struct tpm_vendor_specific 109 - *vendor) 109 + static inline void atmel_put_base_addr(void __iomem *iobase) 110 110 { 111 111 } 112 112 113 113 /* Determine where to talk to device */ 114 - static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific 115 - *vendor) 114 + static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size) 116 115 { 117 116 int lo, hi; 118 117 ··· 120 123 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); 121 124 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); 122 125 123 - vendor->base = (hi << 8) | lo; 124 - vendor->region_size = 2; 126 + *base = (hi << 8) | lo; 127 + *region_size = 2; 125 128 126 - return ioport_map(vendor->base, vendor->region_size); 129 + return ioport_map(*base, *region_size); 127 130 } 128 131 #endif
+40 -12
drivers/char/tpm/tpm_bios.c
··· 29 29 #define MAX_TEXT_EVENT 1000 /* Max event string length */ 30 30 #define ACPI_TCPA_SIG "TCPA" /* 0x41504354 /'TCPA' */ 31 31 32 + enum bios_platform_class { 33 + BIOS_CLIENT = 0x00, 34 + BIOS_SERVER = 0x01, 35 + }; 36 + 32 37 struct tpm_bios_log { 33 38 void *bios_event_log; 34 39 void *bios_event_log_end; ··· 41 36 42 37 struct acpi_tcpa { 43 38 struct acpi_table_header hdr; 44 - u16 reserved; 45 - u32 log_max_len __attribute__ ((packed)); 46 - u32 log_start_addr __attribute__ ((packed)); 39 + u16 platform_class; 40 + union { 41 + struct client_hdr { 42 + u32 log_max_len __attribute__ ((packed)); 43 + u64 log_start_addr __attribute__ ((packed)); 44 + } client; 45 + struct server_hdr { 46 + u16 reserved; 47 + u64 log_max_len __attribute__ ((packed)); 48 + u64 log_start_addr __attribute__ ((packed)); 49 + } server; 50 + }; 47 51 }; 48 52 49 53 struct tcpa_event { ··· 134 120 "S-CRTM Version", 135 121 "S-CRTM Contents", 136 122 "S-CRTM POST Contents", 123 + "POST Contents", 137 124 }; 138 125 139 126 /* returns pointer to start of pos. entry of tcg log */ ··· 321 306 /* 5th: delimiter */ 322 307 seq_putc(m, '\0'); 323 308 309 + kfree(eventname); 324 310 return 0; 325 311 } 326 312 ··· 369 353 /* 4th: eventname <= max + \'0' delimiter */ 370 354 seq_printf(m, " %s\n", eventname); 371 355 356 + kfree(eventname); 372 357 return 0; 373 358 } 374 359 ··· 393 376 struct acpi_tcpa *buff; 394 377 acpi_status status; 395 378 struct acpi_table_header *virt; 379 + u64 len, start; 396 380 397 381 if (log->bios_event_log != NULL) { 398 382 printk(KERN_ERR ··· 414 396 return -EIO; 415 397 } 416 398 417 - if (buff->log_max_len == 0) { 399 + switch(buff->platform_class) { 400 + case BIOS_SERVER: 401 + len = buff->server.log_max_len; 402 + start = buff->server.log_start_addr; 403 + break; 404 + case BIOS_CLIENT: 405 + default: 406 + len = buff->client.log_max_len; 407 + start = buff->client.log_start_addr; 408 + break; 409 + } 410 + if (!len) { 418 411 printk(KERN_ERR "%s: ERROR - TCPA log area empty\n", __func__); 419 412 return -EIO; 420 413 } 421 414 422 415 /* malloc EventLog space */ 423 - log->bios_event_log = kmalloc(buff->log_max_len, GFP_KERNEL); 416 + log->bios_event_log = kmalloc(len, GFP_KERNEL); 424 417 if (!log->bios_event_log) { 425 - printk 426 - ("%s: ERROR - Not enough Memory for BIOS measurements\n", 427 - __func__); 418 + printk("%s: ERROR - Not enough Memory for BIOS measurements\n", 419 + __func__); 428 420 return -ENOMEM; 429 421 } 430 422 431 - log->bios_event_log_end = log->bios_event_log + buff->log_max_len; 423 + log->bios_event_log_end = log->bios_event_log + len; 432 424 433 - acpi_os_map_memory(buff->log_start_addr, buff->log_max_len, (void *) &virt); 425 + acpi_os_map_memory(start, len, (void *) &virt); 434 426 435 - memcpy(log->bios_event_log, virt, buff->log_max_len); 427 + memcpy(log->bios_event_log, virt, len); 436 428 437 - acpi_os_unmap_memory(virt, buff->log_max_len); 429 + acpi_os_unmap_memory(virt, len); 438 430 return 0; 439 431 } 440 432
+31 -30
drivers/char/tpm/tpm_infineon.c
··· 15 15 * License. 16 16 */ 17 17 18 + #include <linux/init.h> 18 19 #include <linux/pnp.h> 19 20 #include "tpm.h" 20 21 ··· 105 104 106 105 if (clear_wrfifo) { 107 106 for (i = 0; i < 4096; i++) { 108 - status = inb(chip->vendor->base + WRFIFO); 107 + status = inb(chip->vendor.base + WRFIFO); 109 108 if (status == 0xff) { 110 109 if (check == 5) 111 110 break; ··· 125 124 */ 126 125 i = 0; 127 126 do { 128 - status = inb(chip->vendor->base + RDFIFO); 129 - status = inb(chip->vendor->base + STAT); 127 + status = inb(chip->vendor.base + RDFIFO); 128 + status = inb(chip->vendor.base + STAT); 130 129 i++; 131 130 if (i == TPM_MAX_TRIES) 132 131 return -EIO; ··· 139 138 int status; 140 139 int i; 141 140 for (i = 0; i < TPM_MAX_TRIES; i++) { 142 - status = inb(chip->vendor->base + STAT); 141 + status = inb(chip->vendor.base + STAT); 143 142 /* check the status-register if wait_for_bit is set */ 144 143 if (status & 1 << wait_for_bit) 145 144 break; ··· 158 157 static void wait_and_send(struct tpm_chip *chip, u8 sendbyte) 159 158 { 160 159 wait(chip, STAT_XFE); 161 - outb(sendbyte, chip->vendor->base + WRFIFO); 160 + outb(sendbyte, chip->vendor.base + WRFIFO); 162 161 } 163 162 164 163 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more ··· 205 204 ret = wait(chip, STAT_RDA); 206 205 if (ret) 207 206 return -EIO; 208 - buf[i] = inb(chip->vendor->base + RDFIFO); 207 + buf[i] = inb(chip->vendor.base + RDFIFO); 209 208 } 210 209 211 210 if (buf[0] != TPM_VL_VER) { ··· 220 219 221 220 for (i = 0; i < size; i++) { 222 221 wait(chip, STAT_RDA); 223 - buf[i] = inb(chip->vendor->base + RDFIFO); 222 + buf[i] = inb(chip->vendor.base + RDFIFO); 224 223 } 225 224 226 225 if ((size == 0x6D00) && (buf[1] == 0x80)) { ··· 269 268 u8 count_high, count_low, count_4, count_3, count_2, count_1; 270 269 271 270 /* Disabling Reset, LP and IRQC */ 272 - outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD); 271 + outb(RESET_LP_IRQC_DISABLE, chip->vendor.base + CMD); 273 272 274 273 ret = empty_fifo(chip, 1); 275 274 if (ret) { ··· 320 319 321 320 static u8 tpm_inf_status(struct tpm_chip *chip) 322 321 { 323 - return inb(chip->vendor->base + STAT); 322 + return inb(chip->vendor.base + STAT); 324 323 } 325 324 326 325 static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); ··· 347 346 .release = tpm_release, 348 347 }; 349 348 350 - static struct tpm_vendor_specific tpm_inf = { 349 + static const struct tpm_vendor_specific tpm_inf = { 351 350 .recv = tpm_inf_recv, 352 351 .send = tpm_inf_send, 353 352 .cancel = tpm_inf_cancel, ··· 376 375 int version[2]; 377 376 int productid[2]; 378 377 char chipname[20]; 378 + struct tpm_chip *chip; 379 379 380 380 /* read IO-ports through PnP */ 381 381 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) && ··· 397 395 goto err_last; 398 396 } 399 397 /* publish my base address and request region */ 400 - tpm_inf.base = TPM_INF_BASE; 401 398 if (request_region 402 - (tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) { 399 + (TPM_INF_BASE, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) { 403 400 rc = -EINVAL; 404 401 goto err_last; 405 402 } 406 - if (request_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN, 407 - "tpm_infineon0") == NULL) { 403 + if (request_region 404 + (TPM_INF_ADDR, TPM_INF_ADDR_LEN, "tpm_infineon0") == NULL) { 408 405 rc = -EINVAL; 409 406 goto err_last; 410 407 } ··· 443 442 444 443 /* configure TPM with IO-ports */ 445 444 outb(IOLIMH, TPM_INF_ADDR); 446 - outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); 445 + outb(((TPM_INF_BASE >> 8) & 0xff), TPM_INF_DATA); 447 446 outb(IOLIML, TPM_INF_ADDR); 448 - outb((tpm_inf.base & 0xff), TPM_INF_DATA); 447 + outb((TPM_INF_BASE & 0xff), TPM_INF_DATA); 449 448 450 449 /* control if IO-ports are set correctly */ 451 450 outb(IOLIMH, TPM_INF_ADDR); ··· 453 452 outb(IOLIML, TPM_INF_ADDR); 454 453 iol = inb(TPM_INF_DATA); 455 454 456 - if ((ioh << 8 | iol) != tpm_inf.base) { 455 + if ((ioh << 8 | iol) != TPM_INF_BASE) { 457 456 dev_err(&dev->dev, 458 - "Could not set IO-ports to 0x%lx\n", 459 - tpm_inf.base); 457 + "Could not set IO-ports to 0x%x\n", 458 + TPM_INF_BASE); 460 459 rc = -EIO; 461 460 goto err_release_region; 462 461 } ··· 467 466 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); 468 467 469 468 /* disable RESET, LP and IRQC */ 470 - outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); 469 + outb(RESET_LP_IRQC_DISABLE, TPM_INF_BASE + CMD); 471 470 472 471 /* Finally, we're done, print some infos */ 473 472 dev_info(&dev->dev, "TPM found: " 474 473 "config base 0x%x, " 475 474 "io base 0x%x, " 476 - "chip version %02x%02x, " 477 - "vendor id %x%x (Infineon), " 478 - "product id %02x%02x" 475 + "chip version 0x%02x%02x, " 476 + "vendor id 0x%x%x (Infineon), " 477 + "product id 0x%02x%02x" 479 478 "%s\n", 480 479 TPM_INF_ADDR, 481 480 TPM_INF_BASE, ··· 483 482 vendorid[0], vendorid[1], 484 483 productid[0], productid[1], chipname); 485 484 486 - rc = tpm_register_hardware(&dev->dev, &tpm_inf); 487 - if (rc < 0) { 488 - rc = -ENODEV; 485 + if (!(chip = tpm_register_hardware(&dev->dev, &tpm_inf))) { 489 486 goto err_release_region; 490 487 } 488 + chip->vendor.base = TPM_INF_BASE; 491 489 return 0; 492 490 } else { 493 491 rc = -ENODEV; ··· 494 494 } 495 495 496 496 err_release_region: 497 - release_region(tpm_inf.base, TPM_INF_PORT_LEN); 497 + release_region(TPM_INF_BASE, TPM_INF_PORT_LEN); 498 498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN); 499 499 500 500 err_last: ··· 506 506 struct tpm_chip *chip = pnp_get_drvdata(dev); 507 507 508 508 if (chip) { 509 - release_region(chip->vendor->base, TPM_INF_PORT_LEN); 509 + release_region(TPM_INF_BASE, TPM_INF_PORT_LEN); 510 + release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN); 510 511 tpm_remove_hardware(chip->dev); 511 512 } 512 513 } ··· 521 520 }, 522 521 .id_table = tpm_pnp_tbl, 523 522 .probe = tpm_inf_pnp_probe, 524 - .remove = tpm_inf_pnp_remove, 523 + .remove = __devexit_p(tpm_inf_pnp_remove), 525 524 }; 526 525 527 526 static int __init init_inf(void) ··· 539 538 540 539 MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); 541 540 MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); 542 - MODULE_VERSION("1.7"); 541 + MODULE_VERSION("1.8"); 543 542 MODULE_LICENSE("GPL");
+27 -22
drivers/char/tpm/tpm_nsc.c
··· 71 71 unsigned long stop; 72 72 73 73 /* status immediately available check */ 74 - *data = inb(chip->vendor->base + NSC_STATUS); 74 + *data = inb(chip->vendor.base + NSC_STATUS); 75 75 if ((*data & mask) == val) 76 76 return 0; 77 77 ··· 79 79 stop = jiffies + 10 * HZ; 80 80 do { 81 81 msleep(TPM_TIMEOUT); 82 - *data = inb(chip->vendor->base + 1); 82 + *data = inb(chip->vendor.base + 1); 83 83 if ((*data & mask) == val) 84 84 return 0; 85 85 } ··· 94 94 unsigned long stop; 95 95 96 96 /* status immediately available check */ 97 - status = inb(chip->vendor->base + NSC_STATUS); 97 + status = inb(chip->vendor.base + NSC_STATUS); 98 98 if (status & NSC_STATUS_OBF) 99 - status = inb(chip->vendor->base + NSC_DATA); 99 + status = inb(chip->vendor.base + NSC_DATA); 100 100 if (status & NSC_STATUS_RDY) 101 101 return 0; 102 102 ··· 104 104 stop = jiffies + 100; 105 105 do { 106 106 msleep(TPM_TIMEOUT); 107 - status = inb(chip->vendor->base + NSC_STATUS); 107 + status = inb(chip->vendor.base + NSC_STATUS); 108 108 if (status & NSC_STATUS_OBF) 109 - status = inb(chip->vendor->base + NSC_DATA); 109 + status = inb(chip->vendor.base + NSC_DATA); 110 110 if (status & NSC_STATUS_RDY) 111 111 return 0; 112 112 } ··· 132 132 return -EIO; 133 133 } 134 134 if ((data = 135 - inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_NORMAL) { 135 + inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_NORMAL) { 136 136 dev_err(chip->dev, "not in normal mode (0x%x)\n", 137 137 data); 138 138 return -EIO; ··· 148 148 } 149 149 if (data & NSC_STATUS_F0) 150 150 break; 151 - *p = inb(chip->vendor->base + NSC_DATA); 151 + *p = inb(chip->vendor.base + NSC_DATA); 152 152 } 153 153 154 154 if ((data & NSC_STATUS_F0) == 0 && ··· 156 156 dev_err(chip->dev, "F0 not set\n"); 157 157 return -EIO; 158 158 } 159 - if ((data = inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_EOC) { 159 + if ((data = inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_EOC) { 160 160 dev_err(chip->dev, 161 161 "expected end of command(0x%x)\n", data); 162 162 return -EIO; ··· 182 182 * fix it. Not sure why this is needed, we followed the flow 183 183 * chart in the manual to the letter. 184 184 */ 185 - outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 185 + outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND); 186 186 187 187 if (nsc_wait_for_ready(chip) != 0) 188 188 return -EIO; ··· 192 192 return -EIO; 193 193 } 194 194 195 - outb(NSC_COMMAND_NORMAL, chip->vendor->base + NSC_COMMAND); 195 + outb(NSC_COMMAND_NORMAL, chip->vendor.base + NSC_COMMAND); 196 196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) { 197 197 dev_err(chip->dev, "IBR timeout\n"); 198 198 return -EIO; ··· 204 204 "IBF timeout (while writing data)\n"); 205 205 return -EIO; 206 206 } 207 - outb(buf[i], chip->vendor->base + NSC_DATA); 207 + outb(buf[i], chip->vendor.base + NSC_DATA); 208 208 } 209 209 210 210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) { 211 211 dev_err(chip->dev, "IBF timeout\n"); 212 212 return -EIO; 213 213 } 214 - outb(NSC_COMMAND_EOC, chip->vendor->base + NSC_COMMAND); 214 + outb(NSC_COMMAND_EOC, chip->vendor.base + NSC_COMMAND); 215 215 216 216 return count; 217 217 } 218 218 219 219 static void tpm_nsc_cancel(struct tpm_chip *chip) 220 220 { 221 - outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND); 221 + outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND); 222 222 } 223 223 224 224 static u8 tpm_nsc_status(struct tpm_chip *chip) 225 225 { 226 - return inb(chip->vendor->base + NSC_STATUS); 226 + return inb(chip->vendor.base + NSC_STATUS); 227 227 } 228 228 229 229 static struct file_operations nsc_ops = { ··· 250 250 251 251 static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs }; 252 252 253 - static struct tpm_vendor_specific tpm_nsc = { 253 + static const struct tpm_vendor_specific tpm_nsc = { 254 254 .recv = tpm_nsc_recv, 255 255 .send = tpm_nsc_send, 256 256 .cancel = tpm_nsc_cancel, ··· 268 268 { 269 269 struct tpm_chip *chip = dev_get_drvdata(dev); 270 270 if ( chip ) { 271 - release_region(chip->vendor->base, 2); 271 + release_region(chip->vendor.base, 2); 272 272 tpm_remove_hardware(chip->dev); 273 273 } 274 274 } ··· 286 286 int rc = 0; 287 287 int lo, hi; 288 288 int nscAddrBase = TPM_ADDR; 289 - 289 + struct tpm_chip *chip; 290 + unsigned long base; 290 291 291 292 /* verify that it is a National part (SID) */ 292 293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) { ··· 301 300 302 301 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI); 303 302 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO); 304 - tpm_nsc.base = (hi<<8) | lo; 303 + base = (hi<<8) | lo; 305 304 306 305 /* enable the DPM module */ 307 306 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01); ··· 321 320 if ((rc = platform_device_register(pdev)) < 0) 322 321 goto err_free_dev; 323 322 324 - if (request_region(tpm_nsc.base, 2, "tpm_nsc0") == NULL ) { 323 + if (request_region(base, 2, "tpm_nsc0") == NULL ) { 325 324 rc = -EBUSY; 326 325 goto err_unreg_dev; 327 326 } 328 327 329 - if ((rc = tpm_register_hardware(&pdev->dev, &tpm_nsc)) < 0) 328 + if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) { 329 + rc = -ENODEV; 330 330 goto err_rel_reg; 331 + } 331 332 332 333 dev_dbg(&pdev->dev, "NSC TPM detected\n"); 333 334 dev_dbg(&pdev->dev, ··· 364 361 "NSC TPM revision %d\n", 365 362 tpm_read_index(nscAddrBase, 0x27) & 0x1F); 366 363 364 + chip->vendor.base = base; 365 + 367 366 return 0; 368 367 369 368 err_rel_reg: 370 - release_region(tpm_nsc.base, 2); 369 + release_region(base, 2); 371 370 err_unreg_dev: 372 371 platform_device_unregister(pdev); 373 372 err_free_dev:
+669
drivers/char/tpm/tpm_tis.c
··· 1 + /* 2 + * Copyright (C) 2005, 2006 IBM Corporation 3 + * 4 + * Authors: 5 + * Leendert van Doorn <leendert@watson.ibm.com> 6 + * Kylene Hall <kjhall@us.ibm.com> 7 + * 8 + * Device driver for TCG/TCPA TPM (trusted platform module). 9 + * Specifications at www.trustedcomputinggroup.org 10 + * 11 + * This device driver implements the TPM interface as defined in 12 + * the TCG TPM Interface Spec version 1.2, revision 1.0. 13 + * 14 + * This program is free software; you can redistribute it and/or 15 + * modify it under the terms of the GNU General Public License as 16 + * published by the Free Software Foundation, version 2 of the 17 + * License. 18 + */ 19 + #include <linux/init.h> 20 + #include <linux/module.h> 21 + #include <linux/moduleparam.h> 22 + #include <linux/pnp.h> 23 + #include <linux/interrupt.h> 24 + #include <linux/wait.h> 25 + #include "tpm.h" 26 + 27 + #define TPM_HEADER_SIZE 10 28 + 29 + enum tis_access { 30 + TPM_ACCESS_VALID = 0x80, 31 + TPM_ACCESS_ACTIVE_LOCALITY = 0x20, 32 + TPM_ACCESS_REQUEST_PENDING = 0x04, 33 + TPM_ACCESS_REQUEST_USE = 0x02, 34 + }; 35 + 36 + enum tis_status { 37 + TPM_STS_VALID = 0x80, 38 + TPM_STS_COMMAND_READY = 0x40, 39 + TPM_STS_GO = 0x20, 40 + TPM_STS_DATA_AVAIL = 0x10, 41 + TPM_STS_DATA_EXPECT = 0x08, 42 + }; 43 + 44 + enum tis_int_flags { 45 + TPM_GLOBAL_INT_ENABLE = 0x80000000, 46 + TPM_INTF_BURST_COUNT_STATIC = 0x100, 47 + TPM_INTF_CMD_READY_INT = 0x080, 48 + TPM_INTF_INT_EDGE_FALLING = 0x040, 49 + TPM_INTF_INT_EDGE_RISING = 0x020, 50 + TPM_INTF_INT_LEVEL_LOW = 0x010, 51 + TPM_INTF_INT_LEVEL_HIGH = 0x008, 52 + TPM_INTF_LOCALITY_CHANGE_INT = 0x004, 53 + TPM_INTF_STS_VALID_INT = 0x002, 54 + TPM_INTF_DATA_AVAIL_INT = 0x001, 55 + }; 56 + 57 + enum tis_defaults { 58 + TIS_MEM_BASE = 0xFED4000, 59 + TIS_MEM_LEN = 0x5000, 60 + TIS_SHORT_TIMEOUT = 750, /* ms */ 61 + TIS_LONG_TIMEOUT = 2000, /* 2 sec */ 62 + }; 63 + 64 + #define TPM_ACCESS(l) (0x0000 | ((l) << 12)) 65 + #define TPM_INT_ENABLE(l) (0x0008 | ((l) << 12)) 66 + #define TPM_INT_VECTOR(l) (0x000C | ((l) << 12)) 67 + #define TPM_INT_STATUS(l) (0x0010 | ((l) << 12)) 68 + #define TPM_INTF_CAPS(l) (0x0014 | ((l) << 12)) 69 + #define TPM_STS(l) (0x0018 | ((l) << 12)) 70 + #define TPM_DATA_FIFO(l) (0x0024 | ((l) << 12)) 71 + 72 + #define TPM_DID_VID(l) (0x0F00 | ((l) << 12)) 73 + #define TPM_RID(l) (0x0F04 | ((l) << 12)) 74 + 75 + static LIST_HEAD(tis_chips); 76 + static DEFINE_SPINLOCK(tis_lock); 77 + 78 + static int check_locality(struct tpm_chip *chip, int l) 79 + { 80 + if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & 81 + (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) == 82 + (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) 83 + return chip->vendor.locality = l; 84 + 85 + return -1; 86 + } 87 + 88 + static void release_locality(struct tpm_chip *chip, int l, int force) 89 + { 90 + if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & 91 + (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) == 92 + (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) 93 + iowrite8(TPM_ACCESS_ACTIVE_LOCALITY, 94 + chip->vendor.iobase + TPM_ACCESS(l)); 95 + } 96 + 97 + static int request_locality(struct tpm_chip *chip, int l) 98 + { 99 + unsigned long stop; 100 + long rc; 101 + 102 + if (check_locality(chip, l) >= 0) 103 + return l; 104 + 105 + iowrite8(TPM_ACCESS_REQUEST_USE, 106 + chip->vendor.iobase + TPM_ACCESS(l)); 107 + 108 + if (chip->vendor.irq) { 109 + rc = wait_event_interruptible_timeout(chip->vendor.int_queue, 110 + (check_locality 111 + (chip, l) >= 0), 112 + chip->vendor.timeout_a); 113 + if (rc > 0) 114 + return l; 115 + 116 + } else { 117 + /* wait for burstcount */ 118 + stop = jiffies + chip->vendor.timeout_a; 119 + do { 120 + if (check_locality(chip, l) >= 0) 121 + return l; 122 + msleep(TPM_TIMEOUT); 123 + } 124 + while (time_before(jiffies, stop)); 125 + } 126 + return -1; 127 + } 128 + 129 + static u8 tpm_tis_status(struct tpm_chip *chip) 130 + { 131 + return ioread8(chip->vendor.iobase + 132 + TPM_STS(chip->vendor.locality)); 133 + } 134 + 135 + static void tpm_tis_ready(struct tpm_chip *chip) 136 + { 137 + /* this causes the current command to be aborted */ 138 + iowrite8(TPM_STS_COMMAND_READY, 139 + chip->vendor.iobase + TPM_STS(chip->vendor.locality)); 140 + } 141 + 142 + static int get_burstcount(struct tpm_chip *chip) 143 + { 144 + unsigned long stop; 145 + int burstcnt; 146 + 147 + /* wait for burstcount */ 148 + /* which timeout value, spec has 2 answers (c & d) */ 149 + stop = jiffies + chip->vendor.timeout_d; 150 + do { 151 + burstcnt = ioread8(chip->vendor.iobase + 152 + TPM_STS(chip->vendor.locality) + 1); 153 + burstcnt += ioread8(chip->vendor.iobase + 154 + TPM_STS(chip->vendor.locality) + 155 + 2) << 8; 156 + if (burstcnt) 157 + return burstcnt; 158 + msleep(TPM_TIMEOUT); 159 + } while (time_before(jiffies, stop)); 160 + return -EBUSY; 161 + } 162 + 163 + static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout, 164 + wait_queue_head_t *queue) 165 + { 166 + unsigned long stop; 167 + long rc; 168 + u8 status; 169 + 170 + /* check current status */ 171 + status = tpm_tis_status(chip); 172 + if ((status & mask) == mask) 173 + return 0; 174 + 175 + if (chip->vendor.irq) { 176 + rc = wait_event_interruptible_timeout(*queue, 177 + ((tpm_tis_status 178 + (chip) & mask) == 179 + mask), timeout); 180 + if (rc > 0) 181 + return 0; 182 + } else { 183 + stop = jiffies + timeout; 184 + do { 185 + msleep(TPM_TIMEOUT); 186 + status = tpm_tis_status(chip); 187 + if ((status & mask) == mask) 188 + return 0; 189 + } while (time_before(jiffies, stop)); 190 + } 191 + return -ETIME; 192 + } 193 + 194 + static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count) 195 + { 196 + int size = 0, burstcnt; 197 + while (size < count && 198 + wait_for_stat(chip, 199 + TPM_STS_DATA_AVAIL | TPM_STS_VALID, 200 + chip->vendor.timeout_c, 201 + &chip->vendor.read_queue) 202 + == 0) { 203 + burstcnt = get_burstcount(chip); 204 + for (; burstcnt > 0 && size < count; burstcnt--) 205 + buf[size++] = ioread8(chip->vendor.iobase + 206 + TPM_DATA_FIFO(chip->vendor. 207 + locality)); 208 + } 209 + return size; 210 + } 211 + 212 + static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count) 213 + { 214 + int size = 0; 215 + int expected, status; 216 + 217 + if (count < TPM_HEADER_SIZE) { 218 + size = -EIO; 219 + goto out; 220 + } 221 + 222 + /* read first 10 bytes, including tag, paramsize, and result */ 223 + if ((size = 224 + recv_data(chip, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) { 225 + dev_err(chip->dev, "Unable to read header\n"); 226 + goto out; 227 + } 228 + 229 + expected = be32_to_cpu(*(__be32 *) (buf + 2)); 230 + if (expected > count) { 231 + size = -EIO; 232 + goto out; 233 + } 234 + 235 + if ((size += 236 + recv_data(chip, &buf[TPM_HEADER_SIZE], 237 + expected - TPM_HEADER_SIZE)) < expected) { 238 + dev_err(chip->dev, "Unable to read remainder of result\n"); 239 + size = -ETIME; 240 + goto out; 241 + } 242 + 243 + wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, 244 + &chip->vendor.int_queue); 245 + status = tpm_tis_status(chip); 246 + if (status & TPM_STS_DATA_AVAIL) { /* retry? */ 247 + dev_err(chip->dev, "Error left over data\n"); 248 + size = -EIO; 249 + goto out; 250 + } 251 + 252 + out: 253 + tpm_tis_ready(chip); 254 + release_locality(chip, chip->vendor.locality, 0); 255 + return size; 256 + } 257 + 258 + /* 259 + * If interrupts are used (signaled by an irq set in the vendor structure) 260 + * tpm.c can skip polling for the data to be available as the interrupt is 261 + * waited for here 262 + */ 263 + static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len) 264 + { 265 + int rc, status, burstcnt; 266 + size_t count = 0; 267 + u32 ordinal; 268 + 269 + if (request_locality(chip, 0) < 0) 270 + return -EBUSY; 271 + 272 + status = tpm_tis_status(chip); 273 + if ((status & TPM_STS_COMMAND_READY) == 0) { 274 + tpm_tis_ready(chip); 275 + if (wait_for_stat 276 + (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b, 277 + &chip->vendor.int_queue) < 0) { 278 + rc = -ETIME; 279 + goto out_err; 280 + } 281 + } 282 + 283 + while (count < len - 1) { 284 + burstcnt = get_burstcount(chip); 285 + for (; burstcnt > 0 && count < len - 1; burstcnt--) { 286 + iowrite8(buf[count], chip->vendor.iobase + 287 + TPM_DATA_FIFO(chip->vendor.locality)); 288 + count++; 289 + } 290 + 291 + wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, 292 + &chip->vendor.int_queue); 293 + status = tpm_tis_status(chip); 294 + if ((status & TPM_STS_DATA_EXPECT) == 0) { 295 + rc = -EIO; 296 + goto out_err; 297 + } 298 + } 299 + 300 + /* write last byte */ 301 + iowrite8(buf[count], 302 + chip->vendor.iobase + 303 + TPM_DATA_FIFO(chip->vendor.locality)); 304 + wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, 305 + &chip->vendor.int_queue); 306 + status = tpm_tis_status(chip); 307 + if ((status & TPM_STS_DATA_EXPECT) != 0) { 308 + rc = -EIO; 309 + goto out_err; 310 + } 311 + 312 + /* go and do it */ 313 + iowrite8(TPM_STS_GO, 314 + chip->vendor.iobase + TPM_STS(chip->vendor.locality)); 315 + 316 + if (chip->vendor.irq) { 317 + ordinal = be32_to_cpu(*((__be32 *) (buf + 6))); 318 + if (wait_for_stat 319 + (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID, 320 + tpm_calc_ordinal_duration(chip, ordinal), 321 + &chip->vendor.read_queue) < 0) { 322 + rc = -ETIME; 323 + goto out_err; 324 + } 325 + } 326 + return len; 327 + out_err: 328 + tpm_tis_ready(chip); 329 + release_locality(chip, chip->vendor.locality, 0); 330 + return rc; 331 + } 332 + 333 + static struct file_operations tis_ops = { 334 + .owner = THIS_MODULE, 335 + .llseek = no_llseek, 336 + .open = tpm_open, 337 + .read = tpm_read, 338 + .write = tpm_write, 339 + .release = tpm_release, 340 + }; 341 + 342 + static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); 343 + static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); 344 + static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL); 345 + static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL); 346 + static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL); 347 + static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, 348 + NULL); 349 + static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); 350 + static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); 351 + 352 + static struct attribute *tis_attrs[] = { 353 + &dev_attr_pubek.attr, 354 + &dev_attr_pcrs.attr, 355 + &dev_attr_enabled.attr, 356 + &dev_attr_active.attr, 357 + &dev_attr_owned.attr, 358 + &dev_attr_temp_deactivated.attr, 359 + &dev_attr_caps.attr, 360 + &dev_attr_cancel.attr, NULL, 361 + }; 362 + 363 + static struct attribute_group tis_attr_grp = { 364 + .attrs = tis_attrs 365 + }; 366 + 367 + static struct tpm_vendor_specific tpm_tis = { 368 + .status = tpm_tis_status, 369 + .recv = tpm_tis_recv, 370 + .send = tpm_tis_send, 371 + .cancel = tpm_tis_ready, 372 + .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID, 373 + .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID, 374 + .req_canceled = TPM_STS_COMMAND_READY, 375 + .attr_group = &tis_attr_grp, 376 + .miscdev = { 377 + .fops = &tis_ops,}, 378 + }; 379 + 380 + static irqreturn_t tis_int_probe(int irq, void *dev_id, struct pt_regs *regs) 381 + { 382 + struct tpm_chip *chip = (struct tpm_chip *) dev_id; 383 + u32 interrupt; 384 + 385 + interrupt = ioread32(chip->vendor.iobase + 386 + TPM_INT_STATUS(chip->vendor.locality)); 387 + 388 + if (interrupt == 0) 389 + return IRQ_NONE; 390 + 391 + chip->vendor.irq = irq; 392 + 393 + /* Clear interrupts handled with TPM_EOI */ 394 + iowrite32(interrupt, 395 + chip->vendor.iobase + 396 + TPM_INT_STATUS(chip->vendor.locality)); 397 + return IRQ_HANDLED; 398 + } 399 + 400 + static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs) 401 + { 402 + struct tpm_chip *chip = (struct tpm_chip *) dev_id; 403 + u32 interrupt; 404 + int i; 405 + 406 + interrupt = ioread32(chip->vendor.iobase + 407 + TPM_INT_STATUS(chip->vendor.locality)); 408 + 409 + if (interrupt == 0) 410 + return IRQ_NONE; 411 + 412 + if (interrupt & TPM_INTF_DATA_AVAIL_INT) 413 + wake_up_interruptible(&chip->vendor.read_queue); 414 + if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT) 415 + for (i = 0; i < 5; i++) 416 + if (check_locality(chip, i) >= 0) 417 + break; 418 + if (interrupt & 419 + (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT | 420 + TPM_INTF_CMD_READY_INT)) 421 + wake_up_interruptible(&chip->vendor.int_queue); 422 + 423 + /* Clear interrupts handled with TPM_EOI */ 424 + iowrite32(interrupt, 425 + chip->vendor.iobase + 426 + TPM_INT_STATUS(chip->vendor.locality)); 427 + return IRQ_HANDLED; 428 + } 429 + 430 + static int interrupts = 1; 431 + module_param(interrupts, bool, 0444); 432 + MODULE_PARM_DESC(interrupts, "Enable interrupts"); 433 + 434 + static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, 435 + const struct pnp_device_id *pnp_id) 436 + { 437 + u32 vendor, intfcaps, intmask; 438 + int rc, i; 439 + unsigned long start, len; 440 + struct tpm_chip *chip; 441 + 442 + start = pnp_mem_start(pnp_dev, 0); 443 + len = pnp_mem_len(pnp_dev, 0); 444 + 445 + if (!start) 446 + start = TIS_MEM_BASE; 447 + if (!len) 448 + len = TIS_MEM_LEN; 449 + 450 + if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis))) 451 + return -ENODEV; 452 + 453 + chip->vendor.iobase = ioremap(start, len); 454 + if (!chip->vendor.iobase) { 455 + rc = -EIO; 456 + goto out_err; 457 + } 458 + 459 + vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); 460 + if ((vendor & 0xFFFF) == 0xFFFF) { 461 + rc = -ENODEV; 462 + goto out_err; 463 + } 464 + 465 + /* Default timeouts */ 466 + chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); 467 + chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT); 468 + chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT); 469 + chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT); 470 + 471 + dev_info(&pnp_dev->dev, 472 + "1.2 TPM (device-id 0x%X, rev-id %d)\n", 473 + vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); 474 + 475 + /* Figure out the capabilities */ 476 + intfcaps = 477 + ioread32(chip->vendor.iobase + 478 + TPM_INTF_CAPS(chip->vendor.locality)); 479 + dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n", 480 + intfcaps); 481 + if (intfcaps & TPM_INTF_BURST_COUNT_STATIC) 482 + dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n"); 483 + if (intfcaps & TPM_INTF_CMD_READY_INT) 484 + dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n"); 485 + if (intfcaps & TPM_INTF_INT_EDGE_FALLING) 486 + dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n"); 487 + if (intfcaps & TPM_INTF_INT_EDGE_RISING) 488 + dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n"); 489 + if (intfcaps & TPM_INTF_INT_LEVEL_LOW) 490 + dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n"); 491 + if (intfcaps & TPM_INTF_INT_LEVEL_HIGH) 492 + dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n"); 493 + if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT) 494 + dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n"); 495 + if (intfcaps & TPM_INTF_STS_VALID_INT) 496 + dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n"); 497 + if (intfcaps & TPM_INTF_DATA_AVAIL_INT) 498 + dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n"); 499 + 500 + if (request_locality(chip, 0) != 0) { 501 + rc = -ENODEV; 502 + goto out_err; 503 + } 504 + 505 + /* INTERRUPT Setup */ 506 + init_waitqueue_head(&chip->vendor.read_queue); 507 + init_waitqueue_head(&chip->vendor.int_queue); 508 + 509 + intmask = 510 + ioread32(chip->vendor.iobase + 511 + TPM_INT_ENABLE(chip->vendor.locality)); 512 + 513 + intmask |= TPM_INTF_CMD_READY_INT 514 + | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT 515 + | TPM_INTF_STS_VALID_INT; 516 + 517 + iowrite32(intmask, 518 + chip->vendor.iobase + 519 + TPM_INT_ENABLE(chip->vendor.locality)); 520 + if (interrupts) { 521 + chip->vendor.irq = 522 + ioread8(chip->vendor.iobase + 523 + TPM_INT_VECTOR(chip->vendor.locality)); 524 + 525 + for (i = 3; i < 16 && chip->vendor.irq == 0; i++) { 526 + iowrite8(i, chip->vendor.iobase + 527 + TPM_INT_VECTOR(chip->vendor.locality)); 528 + if (request_irq 529 + (i, tis_int_probe, SA_SHIRQ, 530 + chip->vendor.miscdev.name, chip) != 0) { 531 + dev_info(chip->dev, 532 + "Unable to request irq: %d for probe\n", 533 + i); 534 + continue; 535 + } 536 + 537 + /* Clear all existing */ 538 + iowrite32(ioread32 539 + (chip->vendor.iobase + 540 + TPM_INT_STATUS(chip->vendor.locality)), 541 + chip->vendor.iobase + 542 + TPM_INT_STATUS(chip->vendor.locality)); 543 + 544 + /* Turn on */ 545 + iowrite32(intmask | TPM_GLOBAL_INT_ENABLE, 546 + chip->vendor.iobase + 547 + TPM_INT_ENABLE(chip->vendor.locality)); 548 + 549 + /* Generate Interrupts */ 550 + tpm_gen_interrupt(chip); 551 + 552 + /* Turn off */ 553 + iowrite32(intmask, 554 + chip->vendor.iobase + 555 + TPM_INT_ENABLE(chip->vendor.locality)); 556 + free_irq(i, chip); 557 + } 558 + } 559 + if (chip->vendor.irq) { 560 + iowrite8(chip->vendor.irq, 561 + chip->vendor.iobase + 562 + TPM_INT_VECTOR(chip->vendor.locality)); 563 + if (request_irq 564 + (chip->vendor.irq, tis_int_handler, SA_SHIRQ, 565 + chip->vendor.miscdev.name, chip) != 0) { 566 + dev_info(chip->dev, 567 + "Unable to request irq: %d for use\n", 568 + chip->vendor.irq); 569 + chip->vendor.irq = 0; 570 + } else { 571 + /* Clear all existing */ 572 + iowrite32(ioread32 573 + (chip->vendor.iobase + 574 + TPM_INT_STATUS(chip->vendor.locality)), 575 + chip->vendor.iobase + 576 + TPM_INT_STATUS(chip->vendor.locality)); 577 + 578 + /* Turn on */ 579 + iowrite32(intmask | TPM_GLOBAL_INT_ENABLE, 580 + chip->vendor.iobase + 581 + TPM_INT_ENABLE(chip->vendor.locality)); 582 + } 583 + } 584 + 585 + INIT_LIST_HEAD(&chip->vendor.list); 586 + spin_lock(&tis_lock); 587 + list_add(&chip->vendor.list, &tis_chips); 588 + spin_unlock(&tis_lock); 589 + 590 + tpm_get_timeouts(chip); 591 + tpm_continue_selftest(chip); 592 + 593 + return 0; 594 + out_err: 595 + if (chip->vendor.iobase) 596 + iounmap(chip->vendor.iobase); 597 + tpm_remove_hardware(chip->dev); 598 + return rc; 599 + } 600 + 601 + static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) 602 + { 603 + return tpm_pm_suspend(&dev->dev, msg); 604 + } 605 + 606 + static int tpm_tis_pnp_resume(struct pnp_dev *dev) 607 + { 608 + return tpm_pm_resume(&dev->dev); 609 + } 610 + 611 + static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = { 612 + {"PNP0C31", 0}, /* TPM */ 613 + {"ATM1200", 0}, /* Atmel */ 614 + {"IFX0102", 0}, /* Infineon */ 615 + {"BCM0101", 0}, /* Broadcom */ 616 + {"NSC1200", 0}, /* National */ 617 + /* Add new here */ 618 + {"", 0}, /* User Specified */ 619 + {"", 0} /* Terminator */ 620 + }; 621 + 622 + static struct pnp_driver tis_pnp_driver = { 623 + .name = "tpm_tis", 624 + .id_table = tpm_pnp_tbl, 625 + .probe = tpm_tis_pnp_init, 626 + .suspend = tpm_tis_pnp_suspend, 627 + .resume = tpm_tis_pnp_resume, 628 + }; 629 + 630 + #define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2 631 + module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, 632 + sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); 633 + MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); 634 + 635 + static int __init init_tis(void) 636 + { 637 + return pnp_register_driver(&tis_pnp_driver); 638 + } 639 + 640 + static void __exit cleanup_tis(void) 641 + { 642 + struct tpm_vendor_specific *i, *j; 643 + struct tpm_chip *chip; 644 + spin_lock(&tis_lock); 645 + list_for_each_entry_safe(i, j, &tis_chips, list) { 646 + chip = to_tpm_chip(i); 647 + iowrite32(~TPM_GLOBAL_INT_ENABLE & 648 + ioread32(chip->vendor.iobase + 649 + TPM_INT_ENABLE(chip->vendor. 650 + locality)), 651 + chip->vendor.iobase + 652 + TPM_INT_ENABLE(chip->vendor.locality)); 653 + release_locality(chip, chip->vendor.locality, 1); 654 + if (chip->vendor.irq) 655 + free_irq(chip->vendor.irq, chip); 656 + iounmap(i->iobase); 657 + list_del(&i->list); 658 + tpm_remove_hardware(chip->dev); 659 + } 660 + spin_unlock(&tis_lock); 661 + pnp_unregister_driver(&tis_pnp_driver); 662 + } 663 + 664 + module_init(init_tis); 665 + module_exit(cleanup_tis); 666 + MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)"); 667 + MODULE_DESCRIPTION("TPM Driver"); 668 + MODULE_VERSION("2.0"); 669 + MODULE_LICENSE("GPL");
+1 -1
drivers/cpufreq/cpufreq.c
··· 1497 1497 } 1498 1498 EXPORT_SYMBOL(cpufreq_update_policy); 1499 1499 1500 - static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, 1500 + static int cpufreq_cpu_callback(struct notifier_block *nfb, 1501 1501 unsigned long action, void *hcpu) 1502 1502 { 1503 1503 unsigned int cpu = (unsigned long)hcpu;
+1 -1
drivers/input/keyboard/hil_kbd.c
··· 350 350 return 0; 351 351 bail2: 352 352 serio_close(serio); 353 + serio_set_drvdata(serio, NULL); 353 354 bail1: 354 355 input_free_device(kbd->dev); 355 356 bail0: 356 357 kfree(kbd); 357 - serio_set_drvdata(serio, NULL); 358 358 return -EIO; 359 359 } 360 360
+327 -270
drivers/isdn/gigaset/bas-gigaset.c
··· 5 5 * Tilman Schmidt <tilman@imap.cc>, 6 6 * Stefan Eilers. 7 7 * 8 - * Based on usb-gigaset.c. 9 - * 10 8 * ===================================================================== 11 9 * This program is free software; you can redistribute it and/or 12 10 * modify it under the terms of the GNU General Public License as ··· 44 46 #define GIGASET_DEVFSNAME "gig/bas/" 45 47 #define GIGASET_DEVNAME "ttyGB" 46 48 47 - #define IF_WRITEBUF 256 //FIXME 49 + /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ 50 + #define IF_WRITEBUF 264 48 51 49 52 /* Values for the Gigaset 307x */ 50 53 #define USB_GIGA_VENDOR_ID 0x0681 51 - #define USB_GIGA_PRODUCT_ID 0x0001 52 - #define USB_4175_PRODUCT_ID 0x0002 54 + #define USB_3070_PRODUCT_ID 0x0001 55 + #define USB_3075_PRODUCT_ID 0x0002 53 56 #define USB_SX303_PRODUCT_ID 0x0021 54 57 #define USB_SX353_PRODUCT_ID 0x0022 55 58 56 59 /* table of devices that work with this driver */ 57 60 static struct usb_device_id gigaset_table [] = { 58 - { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_GIGA_PRODUCT_ID) }, 59 - { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_4175_PRODUCT_ID) }, 61 + { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3070_PRODUCT_ID) }, 62 + { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3075_PRODUCT_ID) }, 60 63 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) }, 61 64 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) }, 62 65 { } /* Terminating entry */ ··· 76 77 /* Function will be called if the device is unplugged */ 77 78 static void gigaset_disconnect(struct usb_interface *interface); 78 79 80 + static void read_ctrl_callback(struct urb *, struct pt_regs *); 81 + static void stopurbs(struct bas_bc_state *); 82 + static int atwrite_submit(struct cardstate *, unsigned char *, int); 83 + static int start_cbsend(struct cardstate *); 79 84 80 85 /*==============================================================================*/ 81 86 ··· 114 111 }; 115 112 116 113 /* status of direct USB connection to 307x base (bits in basstate) */ 117 - #define BS_ATOPEN 0x001 118 - #define BS_B1OPEN 0x002 119 - #define BS_B2OPEN 0x004 120 - #define BS_ATREADY 0x008 121 - #define BS_INIT 0x010 122 - #define BS_ATTIMER 0x020 114 + #define BS_ATOPEN 0x001 /* AT channel open */ 115 + #define BS_B1OPEN 0x002 /* B channel 1 open */ 116 + #define BS_B2OPEN 0x004 /* B channel 2 open */ 117 + #define BS_ATREADY 0x008 /* base ready for AT command */ 118 + #define BS_INIT 0x010 /* base has signalled INIT_OK */ 119 + #define BS_ATTIMER 0x020 /* waiting for HD_READY_SEND_ATDATA */ 120 + #define BS_ATRDPEND 0x040 /* urb_cmd_in in use */ 121 + #define BS_ATWRPEND 0x080 /* urb_cmd_out in use */ 123 122 124 123 125 124 static struct gigaset_driver *driver = NULL; ··· 135 130 .id_table = gigaset_table, 136 131 }; 137 132 133 + /* get message text for usb_submit_urb return code 134 + */ 135 + static char *get_usb_rcmsg(int rc) 136 + { 137 + static char unkmsg[28]; 138 + 139 + switch (rc) { 140 + case 0: 141 + return "success"; 142 + case -ENOMEM: 143 + return "out of memory"; 144 + case -ENODEV: 145 + return "device not present"; 146 + case -ENOENT: 147 + return "endpoint not present"; 148 + case -ENXIO: 149 + return "URB type not supported"; 150 + case -EINVAL: 151 + return "invalid argument"; 152 + case -EAGAIN: 153 + return "start frame too early or too much scheduled"; 154 + case -EFBIG: 155 + return "too many isochronous frames requested"; 156 + case -EPIPE: 157 + return "endpoint stalled"; 158 + case -EMSGSIZE: 159 + return "invalid packet size"; 160 + case -ENOSPC: 161 + return "would overcommit USB bandwidth"; 162 + case -ESHUTDOWN: 163 + return "device shut down"; 164 + case -EPERM: 165 + return "reject flag set"; 166 + case -EHOSTUNREACH: 167 + return "device suspended"; 168 + default: 169 + snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", rc); 170 + return unkmsg; 171 + } 172 + } 173 + 138 174 /* get message text for USB status code 139 175 */ 140 176 static char *get_usb_statmsg(int status) ··· 186 140 case 0: 187 141 return "success"; 188 142 case -ENOENT: 189 - return "canceled"; 190 - case -ECONNRESET: 191 - return "canceled (async)"; 143 + return "unlinked (sync)"; 192 144 case -EINPROGRESS: 193 145 return "pending"; 194 146 case -EPROTO: 195 - return "bit stuffing or unknown USB error"; 147 + return "bit stuffing error, timeout, or unknown USB error"; 196 148 case -EILSEQ: 197 - return "Illegal byte sequence (CRC mismatch)"; 198 - case -EPIPE: 199 - return "babble detect or endpoint stalled"; 200 - case -ENOSR: 201 - return "buffer error"; 149 + return "CRC mismatch, timeout, or unknown USB error"; 202 150 case -ETIMEDOUT: 203 151 return "timed out"; 204 - case -ENODEV: 205 - return "device not present"; 152 + case -EPIPE: 153 + return "endpoint stalled"; 154 + case -ECOMM: 155 + return "IN buffer overrun"; 156 + case -ENOSR: 157 + return "OUT buffer underrun"; 158 + case -EOVERFLOW: 159 + return "too much data"; 206 160 case -EREMOTEIO: 207 161 return "short packet detected"; 162 + case -ENODEV: 163 + return "device removed"; 208 164 case -EXDEV: 209 165 return "partial isochronous transfer"; 210 166 case -EINVAL: 211 167 return "invalid argument"; 212 - case -ENXIO: 213 - return "URB already queued"; 214 - case -EAGAIN: 215 - return "isochronous start frame too early or too much scheduled"; 216 - case -EFBIG: 217 - return "too many isochronous frames requested"; 218 - case -EMSGSIZE: 219 - return "endpoint message size zero"; 168 + case -ECONNRESET: 169 + return "unlinked (async)"; 220 170 case -ESHUTDOWN: 221 - return "endpoint shutdown"; 222 - case -EBUSY: 223 - return "another request pending"; 171 + return "device shut down"; 224 172 default: 225 - snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", status); 173 + snprintf(unkmsg, sizeof(unkmsg), "unknown status %d", status); 226 174 return unkmsg; 227 175 } 228 176 } ··· 317 277 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d", 318 278 __func__, bcs->channel); 319 279 320 - if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL)) { 321 - //FIXME what should we do? 322 - return; 323 - } 280 + if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL)) 281 + dev_err(cs->dev, "event queue full\n"); 324 282 325 283 gigaset_schedule_event(cs); 326 284 } 327 285 328 286 /* error_reset 329 287 * reset Gigaset device because of an unrecoverable error 330 - * This function may be called from any context and takes care of scheduling 331 - * the necessary actions for execution outside of interrupt context. 288 + * This function may be called from any context, and should take care of 289 + * scheduling the necessary actions for execution outside of interrupt context. 290 + * Right now, it just generates a kernel message calling for help. 332 291 * argument: 333 292 * controller state structure 334 293 */ ··· 403 364 { 404 365 struct cardstate *cs = (struct cardstate *) data; 405 366 struct bas_cardstate *ucs = cs->hw.bas; 406 - unsigned long flags; 407 367 408 - spin_lock_irqsave(&cs->lock, flags); 409 - if (unlikely(!cs->connected)) { 410 - gig_dbg(DEBUG_USBREQ, "%s: disconnected", __func__); 411 - spin_unlock_irqrestore(&cs->lock, flags); 412 - return; 413 - } 414 368 if (!ucs->rcvbuf_size) { 415 369 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__); 416 - spin_unlock_irqrestore(&cs->lock, flags); 417 370 return; 418 371 } 419 - spin_unlock_irqrestore(&cs->lock, flags); 420 372 421 373 dev_err(cs->dev, "timeout reading AT response\n"); 422 374 error_reset(cs); //FIXME retry? 423 375 } 424 376 377 + /* set/clear bits in base connection state, return previous state 378 + */ 379 + inline static int update_basstate(struct bas_cardstate *ucs, 380 + int set, int clear) 381 + { 382 + unsigned long flags; 383 + int state; 425 384 426 - static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs); 385 + spin_lock_irqsave(&ucs->lock, flags); 386 + state = atomic_read(&ucs->basstate); 387 + atomic_set(&ucs->basstate, (state & ~clear) | set); 388 + spin_unlock_irqrestore(&ucs->lock, flags); 389 + return state; 390 + } 427 391 428 392 /* atread_submit 429 - * submit an HD_READ_ATMESSAGE command URB 393 + * submit an HD_READ_ATMESSAGE command URB and optionally start a timeout 430 394 * parameters: 431 395 * cs controller state structure 432 396 * timeout timeout in 1/10 sec., 0: none 433 397 * return value: 434 398 * 0 on success 435 - * -EINVAL if a NULL pointer is encountered somewhere 436 399 * -EBUSY if another request is pending 437 400 * any URB submission error code 438 401 */ ··· 446 405 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)", 447 406 ucs->rcvbuf_size); 448 407 449 - if (ucs->urb_cmd_in->status == -EINPROGRESS) { 408 + if (update_basstate(ucs, BS_ATRDPEND, 0) & BS_ATRDPEND) { 450 409 dev_err(cs->dev, 451 410 "could not submit HD_READ_ATMESSAGE: URB busy\n"); 452 411 return -EBUSY; ··· 464 423 read_ctrl_callback, cs->inbuf); 465 424 466 425 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) { 426 + update_basstate(ucs, 0, BS_ATRDPEND); 467 427 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n", 468 428 get_usb_statmsg(ret)); 469 429 return ret; ··· 480 438 return 0; 481 439 } 482 440 483 - static void stopurbs(struct bas_bc_state *); 484 - static int start_cbsend(struct cardstate *); 485 - 486 - /* set/clear bits in base connection state 487 - */ 488 - inline static void update_basstate(struct bas_cardstate *ucs, 489 - int set, int clear) 490 - { 491 - unsigned long flags; 492 - int state; 493 - 494 - spin_lock_irqsave(&ucs->lock, flags); 495 - state = atomic_read(&ucs->basstate); 496 - state &= ~clear; 497 - state |= set; 498 - atomic_set(&ucs->basstate, state); 499 - spin_unlock_irqrestore(&ucs->lock, flags); 500 - } 501 - 502 - 503 441 /* read_int_callback 504 442 * USB completion handler for interrupt pipe input 505 443 * called by the USB subsystem in interrupt context ··· 493 471 struct bas_cardstate *ucs = cs->hw.bas; 494 472 struct bc_state *bcs; 495 473 unsigned long flags; 496 - int status; 474 + int rc; 497 475 unsigned l; 498 476 int channel; 499 477 500 478 switch (urb->status) { 501 479 case 0: /* success */ 502 480 break; 503 - case -ENOENT: /* canceled */ 504 - case -ECONNRESET: /* canceled (async) */ 481 + case -ENOENT: /* cancelled */ 482 + case -ECONNRESET: /* cancelled (async) */ 505 483 case -EINPROGRESS: /* pending */ 506 484 /* ignore silently */ 507 485 gig_dbg(DEBUG_USBREQ, "%s: %s", 508 486 __func__, get_usb_statmsg(urb->status)); 509 487 return; 488 + case -ENODEV: /* device removed */ 489 + case -ESHUTDOWN: /* device shut down */ 490 + //FIXME use this as disconnect indicator? 491 + gig_dbg(DEBUG_USBREQ, "%s: device disconnected", __func__); 492 + return; 510 493 default: /* severe trouble */ 511 494 dev_warn(cs->dev, "interrupt read: %s\n", 512 495 get_usb_statmsg(urb->status)); 513 496 //FIXME corrective action? resubmission always ok? 497 + goto resubmit; 498 + } 499 + 500 + /* drop incomplete packets even if the missing bytes wouldn't matter */ 501 + if (unlikely(urb->actual_length < 3)) { 502 + dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", 503 + urb->actual_length); 514 504 goto resubmit; 515 505 } 516 506 ··· 592 558 } 593 559 spin_lock_irqsave(&cs->lock, flags); 594 560 if (ucs->rcvbuf_size) { 595 - spin_unlock_irqrestore(&cs->lock, flags); 561 + /* throw away previous buffer - we have no queue */ 596 562 dev_err(cs->dev, 597 - "receive AT data overrun, %d bytes lost\n", l); 598 - error_reset(cs); //FIXME reschedule 599 - break; 563 + "receive AT data overrun, %d bytes lost\n", 564 + ucs->rcvbuf_size); 565 + kfree(ucs->rcvbuf); 566 + ucs->rcvbuf_size = 0; 600 567 } 601 568 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) { 602 569 spin_unlock_irqrestore(&cs->lock, flags); 603 - dev_err(cs->dev, "out of memory, %d bytes lost\n", l); 604 - error_reset(cs); //FIXME reschedule 570 + dev_err(cs->dev, "out of memory receiving AT data\n"); 571 + error_reset(cs); 605 572 break; 606 573 } 607 574 ucs->rcvbuf_size = l; 608 575 ucs->retry_cmd_in = 0; 609 - if ((status = atread_submit(cs, BAS_TIMEOUT)) < 0) { 576 + if ((rc = atread_submit(cs, BAS_TIMEOUT)) < 0) { 610 577 kfree(ucs->rcvbuf); 611 578 ucs->rcvbuf = NULL; 612 579 ucs->rcvbuf_size = 0; 613 - error_reset(cs); //FIXME reschedule 580 + if (rc != -ENODEV) 581 + //FIXME corrective action? 582 + error_reset(cs); 614 583 } 615 584 spin_unlock_irqrestore(&cs->lock, flags); 616 585 break; ··· 635 598 check_pending(ucs); 636 599 637 600 resubmit: 638 - spin_lock_irqsave(&cs->lock, flags); 639 - status = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 640 - spin_unlock_irqrestore(&cs->lock, flags); 641 - if (unlikely(status)) { 601 + rc = usb_submit_urb(urb, SLAB_ATOMIC); 602 + if (unlikely(rc != 0 && rc != -ENODEV)) { 642 603 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n", 643 - get_usb_statmsg(status)); 604 + get_usb_rcmsg(rc)); 644 605 error_reset(cs); 645 606 } 646 607 } ··· 657 622 struct bas_cardstate *ucs = cs->hw.bas; 658 623 int have_data = 0; 659 624 unsigned numbytes; 660 - unsigned long flags; 625 + int rc; 661 626 662 - spin_lock_irqsave(&cs->lock, flags); 663 - if (unlikely(!cs->connected)) { 664 - warn("%s: disconnected", __func__); 665 - spin_unlock_irqrestore(&cs->lock, flags); 666 - return; 667 - } 627 + update_basstate(ucs, 0, BS_ATRDPEND); 668 628 669 629 if (!ucs->rcvbuf_size) { 670 630 dev_warn(cs->dev, "%s: no receive in progress\n", __func__); 671 - spin_unlock_irqrestore(&cs->lock, flags); 672 631 return; 673 632 } 674 633 ··· 695 666 } 696 667 break; 697 668 698 - case -ENOENT: /* canceled */ 699 - case -ECONNRESET: /* canceled (async) */ 669 + case -ENOENT: /* cancelled */ 670 + case -ECONNRESET: /* cancelled (async) */ 700 671 case -EINPROGRESS: /* pending */ 672 + case -ENODEV: /* device removed */ 673 + case -ESHUTDOWN: /* device shut down */ 701 674 /* no action necessary */ 702 675 gig_dbg(DEBUG_USBREQ, "%s: %s", 703 676 __func__, get_usb_statmsg(urb->status)); ··· 712 681 if (ucs->retry_cmd_in++ < BAS_RETRY) { 713 682 dev_notice(cs->dev, "control read: retry %d\n", 714 683 ucs->retry_cmd_in); 715 - if (atread_submit(cs, BAS_TIMEOUT) >= 0) { 716 - /* resubmitted - bypass regular exit block */ 717 - spin_unlock_irqrestore(&cs->lock, flags); 684 + rc = atread_submit(cs, BAS_TIMEOUT); 685 + if (rc >= 0 || rc == -ENODEV) 686 + /* resubmitted or disconnected */ 687 + /* - bypass regular exit block */ 718 688 return; 719 - } 720 689 } else { 721 690 dev_err(cs->dev, 722 691 "control read: giving up after %d tries\n", ··· 728 697 kfree(ucs->rcvbuf); 729 698 ucs->rcvbuf = NULL; 730 699 ucs->rcvbuf_size = 0; 731 - spin_unlock_irqrestore(&cs->lock, flags); 732 700 if (have_data) { 733 701 gig_dbg(DEBUG_INTR, "%s-->BH", __func__); 734 702 gigaset_schedule_event(cs); ··· 749 719 int i, rc; 750 720 751 721 /* status codes not worth bothering the tasklet with */ 752 - if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 753 - urb->status == -EINPROGRESS)) { 722 + if (unlikely(urb->status == -ENOENT || 723 + urb->status == -ECONNRESET || 724 + urb->status == -EINPROGRESS || 725 + urb->status == -ENODEV || 726 + urb->status == -ESHUTDOWN)) { 754 727 gig_dbg(DEBUG_ISO, "%s: %s", 755 728 __func__, get_usb_statmsg(urb->status)); 756 729 return; ··· 773 740 for (i = 0; i < BAS_NUMFRAMES; i++) { 774 741 ubc->isoinlost += urb->iso_frame_desc[i].actual_length; 775 742 if (unlikely(urb->iso_frame_desc[i].status != 0 && 776 - urb->iso_frame_desc[i].status != -EINPROGRESS)) { 743 + urb->iso_frame_desc[i].status != 744 + -EINPROGRESS)) 777 745 ubc->loststatus = urb->iso_frame_desc[i].status; 778 - } 779 746 urb->iso_frame_desc[i].status = 0; 780 747 urb->iso_frame_desc[i].actual_length = 0; 781 748 } ··· 787 754 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit", 788 755 __func__); 789 756 rc = usb_submit_urb(urb, SLAB_ATOMIC); 790 - if (unlikely(rc != 0)) { 757 + if (unlikely(rc != 0 && rc != -ENODEV)) { 791 758 dev_err(bcs->cs->dev, 792 759 "could not resubmit isochronous read " 793 - "URB: %s\n", get_usb_statmsg(rc)); 760 + "URB: %s\n", get_usb_rcmsg(rc)); 794 761 dump_urb(DEBUG_ISO, "isoc read", urb); 795 762 error_hangup(bcs); 796 763 } ··· 813 780 unsigned long flags; 814 781 815 782 /* status codes not worth bothering the tasklet with */ 816 - if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET || 817 - urb->status == -EINPROGRESS)) { 783 + if (unlikely(urb->status == -ENOENT || 784 + urb->status == -ECONNRESET || 785 + urb->status == -EINPROGRESS || 786 + urb->status == -ENODEV || 787 + urb->status == -ESHUTDOWN)) { 818 788 gig_dbg(DEBUG_ISO, "%s: %s", 819 789 __func__, get_usb_statmsg(urb->status)); 820 790 return; ··· 858 822 for (k = 0; k < BAS_INURBS; k++) { 859 823 urb = ubc->isoinurbs[k]; 860 824 if (!urb) { 861 - dev_err(bcs->cs->dev, "isoinurbs[%d]==NULL\n", k); 862 825 rc = -EFAULT; 863 826 goto error; 864 827 } ··· 879 844 } 880 845 881 846 dump_urb(DEBUG_ISO, "Initial isoc read", urb); 882 - if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) { 883 - dev_err(bcs->cs->dev, 884 - "could not submit isochronous read URB %d: %s\n", 885 - k, get_usb_statmsg(rc)); 847 + if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) 886 848 goto error; 887 - } 888 849 } 889 850 890 851 /* initialize L2 transmission */ ··· 890 859 for (k = 0; k < BAS_OUTURBS; ++k) { 891 860 urb = ubc->isoouturbs[k].urb; 892 861 if (!urb) { 893 - dev_err(bcs->cs->dev, "isoouturbs[%d].urb==NULL\n", k); 894 862 rc = -EFAULT; 895 863 goto error; 896 864 } ··· 915 885 for (k = 0; k < 2; ++k) { 916 886 dump_urb(DEBUG_ISO, "Initial isoc write", urb); 917 887 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC); 918 - if (rc != 0) { 919 - dev_err(bcs->cs->dev, 920 - "could not submit isochronous write URB %d: %s\n", 921 - k, get_usb_statmsg(rc)); 888 + if (rc != 0) 922 889 goto error; 923 - } 924 890 } 925 891 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb); 926 892 ubc->isooutfree = &ubc->isoouturbs[2]; ··· 942 916 for (k = 0; k < BAS_INURBS; ++k) { 943 917 rc = usb_unlink_urb(ubc->isoinurbs[k]); 944 918 gig_dbg(DEBUG_ISO, 945 - "%s: isoc input URB %d unlinked, result = %d", 946 - __func__, k, rc); 919 + "%s: isoc input URB %d unlinked, result = %s", 920 + __func__, k, get_usb_rcmsg(rc)); 947 921 } 948 922 949 923 for (k = 0; k < BAS_OUTURBS; ++k) { 950 924 rc = usb_unlink_urb(ubc->isoouturbs[k].urb); 951 925 gig_dbg(DEBUG_ISO, 952 - "%s: isoc output URB %d unlinked, result = %d", 953 - __func__, k, rc); 926 + "%s: isoc output URB %d unlinked, result = %s", 927 + __func__, k, get_usb_rcmsg(rc)); 954 928 } 955 929 } 956 930 ··· 960 934 /* submit_iso_write_urb 961 935 * fill and submit the next isochronous write URB 962 936 * parameters: 963 - * bcs B channel state structure 937 + * ucx context structure containing URB 964 938 * return value: 965 939 * number of frames submitted in URB 966 940 * 0 if URB not submitted because no data available (isooutbuf busy) ··· 972 946 struct bas_bc_state *ubc = ucx->bcs->hw.bas; 973 947 struct usb_iso_packet_descriptor *ifd; 974 948 int corrbytes, nframe, rc; 975 - unsigned long flags; 976 949 977 950 /* urb->dev is clobbered by USB subsystem */ 978 951 urb->dev = ucx->bcs->cs->hw.bas->udev; ··· 1017 992 ifd->status = 0; 1018 993 ifd->actual_length = 0; 1019 994 } 1020 - if ((urb->number_of_packets = nframe) > 0) { 1021 - spin_lock_irqsave(&ucx->bcs->cs->lock, flags); 1022 - rc = ucx->bcs->cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1023 - spin_unlock_irqrestore(&ucx->bcs->cs->lock, flags); 995 + if (unlikely(nframe == 0)) 996 + return 0; /* no data to send */ 997 + urb->number_of_packets = nframe; 1024 998 1025 - if (rc) { 999 + rc = usb_submit_urb(urb, SLAB_ATOMIC); 1000 + if (unlikely(rc)) { 1001 + if (rc == -ENODEV) 1002 + /* device removed - give up silently */ 1003 + gig_dbg(DEBUG_ISO, "%s: disconnected", __func__); 1004 + else 1026 1005 dev_err(ucx->bcs->cs->dev, 1027 1006 "could not submit isochronous write URB: %s\n", 1028 - get_usb_statmsg(rc)); 1029 - dump_urb(DEBUG_ISO, "isoc write", urb); 1030 - return rc; 1031 - } 1032 - ++ubc->numsub; 1007 + get_usb_rcmsg(rc)); 1008 + return rc; 1033 1009 } 1010 + ++ubc->numsub; 1034 1011 return nframe; 1035 1012 } 1036 1013 ··· 1055 1028 int i; 1056 1029 struct sk_buff *skb; 1057 1030 int len; 1031 + int rc; 1058 1032 1059 1033 /* loop while completed URBs arrive in time */ 1060 1034 for (;;) { ··· 1085 1057 ubc->isooutfree = NULL; 1086 1058 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1087 1059 if (next) { 1088 - if (submit_iso_write_urb(next) <= 0) { 1060 + rc = submit_iso_write_urb(next); 1061 + if (unlikely(rc <= 0 && rc != -ENODEV)) { 1089 1062 /* could not submit URB, put it back */ 1090 1063 spin_lock_irqsave(&ubc->isooutlock, flags); 1091 1064 if (ubc->isooutfree == NULL) { ··· 1106 1077 /* process completed URB */ 1107 1078 urb = done->urb; 1108 1079 switch (urb->status) { 1080 + case -EXDEV: /* partial completion */ 1081 + gig_dbg(DEBUG_ISO, "%s: URB partially completed", 1082 + __func__); 1083 + /* fall through - what's the difference anyway? */ 1109 1084 case 0: /* normal completion */ 1110 - break; 1111 - case -EXDEV: /* inspect individual frames */ 1112 - /* assumptions (for lack of documentation): 1113 - * - actual_length bytes of the frame in error are 1085 + /* inspect individual frames 1086 + * assumptions (for lack of documentation): 1087 + * - actual_length bytes of first frame in error are 1114 1088 * successfully sent 1115 1089 * - all following frames are not sent at all 1116 1090 */ 1117 - gig_dbg(DEBUG_ISO, "%s: URB partially completed", 1118 - __func__); 1119 - offset = done->limit; /* just in case */ 1091 + offset = done->limit; /* default (no error) */ 1120 1092 for (i = 0; i < BAS_NUMFRAMES; i++) { 1121 1093 ifd = &urb->iso_frame_desc[i]; 1122 1094 if (ifd->status || ··· 1152 1122 } 1153 1123 #endif 1154 1124 break; 1155 - case -EPIPE: //FIXME is this the code for "underrun"? 1125 + case -EPIPE: /* stall - probably underrun */ 1156 1126 dev_err(cs->dev, "isochronous write stalled\n"); 1157 1127 error_hangup(bcs); 1158 1128 break; ··· 1172 1142 spin_unlock_irqrestore(&ubc->isooutlock, flags); 1173 1143 if (next) { 1174 1144 /* only one URB still active - resubmit one */ 1175 - if (submit_iso_write_urb(next) <= 0) { 1145 + rc = submit_iso_write_urb(next); 1146 + if (unlikely(rc <= 0 && rc != -ENODEV)) { 1176 1147 /* couldn't submit */ 1177 1148 error_hangup(bcs); 1178 1149 } ··· 1253 1222 break; 1254 1223 case -ENOENT: 1255 1224 case -ECONNRESET: 1256 - gig_dbg(DEBUG_ISO, "%s: URB canceled", __func__); 1257 - continue; /* -> skip */ 1258 - case -EINPROGRESS: /* huh? */ 1259 - gig_dbg(DEBUG_ISO, "%s: URB still pending", __func__); 1225 + case -EINPROGRESS: 1226 + gig_dbg(DEBUG_ISO, "%s: %s", 1227 + __func__, get_usb_statmsg(urb->status)); 1260 1228 continue; /* -> skip */ 1261 1229 case -EPIPE: 1262 1230 dev_err(cs->dev, "isochronous read stalled\n"); ··· 1320 1290 urb->dev = bcs->cs->hw.bas->udev; 1321 1291 urb->transfer_flags = URB_ISO_ASAP; 1322 1292 urb->number_of_packets = BAS_NUMFRAMES; 1323 - spin_lock_irqsave(&cs->lock, flags); 1324 - rc = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV; 1325 - spin_unlock_irqrestore(&cs->lock, flags); 1326 - if (rc) { 1293 + rc = usb_submit_urb(urb, SLAB_ATOMIC); 1294 + if (unlikely(rc != 0 && rc != -ENODEV)) { 1327 1295 dev_err(cs->dev, 1328 1296 "could not resubmit isochronous read URB: %s\n", 1329 - get_usb_statmsg(rc)); 1297 + get_usb_rcmsg(rc)); 1330 1298 dump_urb(DEBUG_ISO, "resubmit iso read", urb); 1331 1299 error_hangup(bcs); 1332 1300 } ··· 1425 1397 * timeout timeout in seconds (0: no timeout) 1426 1398 * return value: 1427 1399 * 0 on success 1428 - * -EINVAL if a NULL pointer is encountered somewhere 1429 1400 * -EBUSY if another request is pending 1430 1401 * any URB submission error code 1431 1402 */ ··· 1443 1416 "submission of request 0x%02x failed: " 1444 1417 "request 0x%02x still pending\n", 1445 1418 req, ucs->pending); 1446 - return -EBUSY; 1447 - } 1448 - if (ucs->urb_ctrl->status == -EINPROGRESS) { 1449 - spin_unlock_irqrestore(&ucs->lock, flags); 1450 - dev_err(bcs->cs->dev, 1451 - "could not submit request 0x%02x: URB busy\n", req); 1452 1419 return -EBUSY; 1453 1420 } 1454 1421 ··· 1486 1465 static int gigaset_init_bchannel(struct bc_state *bcs) 1487 1466 { 1488 1467 int req, ret; 1468 + unsigned long flags; 1469 + 1470 + spin_lock_irqsave(&bcs->cs->lock, flags); 1471 + if (unlikely(!bcs->cs->connected)) { 1472 + gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__); 1473 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1474 + return -ENODEV; 1475 + } 1489 1476 1490 1477 if ((ret = starturbs(bcs)) < 0) { 1491 1478 dev_err(bcs->cs->dev, 1492 - "could not start isochronous I/O for channel %d\n", 1493 - bcs->channel + 1); 1494 - error_hangup(bcs); 1479 + "could not start isochronous I/O for channel B%d: %s\n", 1480 + bcs->channel + 1, 1481 + ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret)); 1482 + if (ret != -ENODEV) 1483 + error_hangup(bcs); 1484 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1495 1485 return ret; 1496 1486 } 1497 1487 1498 1488 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL; 1499 1489 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) { 1500 - dev_err(bcs->cs->dev, "could not open channel %d: %s\n", 1501 - bcs->channel + 1, get_usb_statmsg(ret)); 1490 + dev_err(bcs->cs->dev, "could not open channel B%d\n", 1491 + bcs->channel + 1); 1502 1492 stopurbs(bcs->hw.bas); 1503 - error_hangup(bcs); 1493 + if (ret != -ENODEV) 1494 + error_hangup(bcs); 1504 1495 } 1496 + 1497 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1505 1498 return ret; 1506 1499 } 1507 1500 ··· 1532 1497 static int gigaset_close_bchannel(struct bc_state *bcs) 1533 1498 { 1534 1499 int req, ret; 1500 + unsigned long flags; 1501 + 1502 + spin_lock_irqsave(&bcs->cs->lock, flags); 1503 + if (unlikely(!bcs->cs->connected)) { 1504 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1505 + gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__); 1506 + return -ENODEV; 1507 + } 1535 1508 1536 1509 if (!(atomic_read(&bcs->cs->hw.bas->basstate) & 1537 1510 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) { 1538 1511 /* channel not running: just signal common.c */ 1512 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1539 1513 gigaset_bchannel_down(bcs); 1540 1514 return 0; 1541 1515 } 1542 1516 1517 + /* channel running: tell device to close it */ 1543 1518 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL; 1544 1519 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) 1545 - dev_err(bcs->cs->dev, 1546 - "could not submit HD_CLOSE_BxCHANNEL request: %s\n", 1547 - get_usb_statmsg(ret)); 1520 + dev_err(bcs->cs->dev, "closing channel B%d failed\n", 1521 + bcs->channel + 1); 1522 + 1523 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 1548 1524 return ret; 1549 1525 } 1550 1526 ··· 1591 1545 kfree(cb); 1592 1546 } 1593 1547 1594 - static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len); 1595 - 1596 1548 /* write_command_callback 1597 1549 * USB completion handler for AT command transmission 1598 1550 * called by the USB subsystem in interrupt context ··· 1604 1560 struct bas_cardstate *ucs = cs->hw.bas; 1605 1561 unsigned long flags; 1606 1562 1563 + update_basstate(ucs, 0, BS_ATWRPEND); 1564 + 1607 1565 /* check status */ 1608 1566 switch (urb->status) { 1609 1567 case 0: /* normal completion */ 1610 1568 break; 1611 - case -ENOENT: /* canceled */ 1612 - case -ECONNRESET: /* canceled (async) */ 1569 + case -ENOENT: /* cancelled */ 1570 + case -ECONNRESET: /* cancelled (async) */ 1613 1571 case -EINPROGRESS: /* pending */ 1572 + case -ENODEV: /* device removed */ 1573 + case -ESHUTDOWN: /* device shut down */ 1614 1574 /* ignore silently */ 1615 1575 gig_dbg(DEBUG_USBREQ, "%s: %s", 1616 1576 __func__, get_usb_statmsg(urb->status)); ··· 1675 1627 * len length of command to send 1676 1628 * return value: 1677 1629 * 0 on success 1678 - * -EFAULT if a NULL pointer is encountered somewhere 1679 1630 * -EBUSY if another request is pending 1680 1631 * any URB submission error code 1681 1632 */ 1682 1633 static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len) 1683 1634 { 1684 1635 struct bas_cardstate *ucs = cs->hw.bas; 1685 - unsigned long flags; 1686 - int ret; 1636 + int rc; 1687 1637 1688 1638 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len); 1689 1639 1690 - if (ucs->urb_cmd_out->status == -EINPROGRESS) { 1640 + if (update_basstate(ucs, BS_ATWRPEND, 0) & BS_ATWRPEND) { 1691 1641 dev_err(cs->dev, 1692 1642 "could not submit HD_WRITE_ATMESSAGE: URB busy\n"); 1693 1643 return -EBUSY; ··· 1700 1654 usb_sndctrlpipe(ucs->udev, 0), 1701 1655 (unsigned char*) &ucs->dr_cmd_out, buf, len, 1702 1656 write_command_callback, cs); 1703 - 1704 - spin_lock_irqsave(&cs->lock, flags); 1705 - ret = cs->connected ? usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC) : -ENODEV; 1706 - spin_unlock_irqrestore(&cs->lock, flags); 1707 - 1708 - if (ret) { 1657 + rc = usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC); 1658 + if (unlikely(rc)) { 1659 + update_basstate(ucs, 0, BS_ATWRPEND); 1709 1660 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n", 1710 - get_usb_statmsg(ret)); 1711 - return ret; 1661 + get_usb_rcmsg(rc)); 1662 + return rc; 1712 1663 } 1713 1664 1714 - /* submitted successfully */ 1715 - update_basstate(ucs, 0, BS_ATREADY); 1716 - 1717 - /* start timeout if necessary */ 1718 - if (!(atomic_read(&ucs->basstate) & BS_ATTIMER)) { 1665 + /* submitted successfully, start timeout if necessary */ 1666 + if (!(update_basstate(ucs, BS_ATTIMER, BS_ATREADY) & BS_ATTIMER)) { 1719 1667 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs", 1720 1668 ATRDY_TIMEOUT); 1721 1669 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10; 1722 1670 ucs->timer_atrdy.data = (unsigned long) cs; 1723 1671 ucs->timer_atrdy.function = atrdy_timeout; 1724 1672 add_timer(&ucs->timer_atrdy); 1725 - update_basstate(ucs, BS_ATTIMER, 0); 1726 1673 } 1727 1674 return 0; 1728 1675 } ··· 1741 1702 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open"); 1742 1703 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT); 1743 1704 if (rc < 0) { 1744 - dev_err(cs->dev, "could not open AT channel\n"); 1745 1705 /* flush command queue */ 1746 1706 spin_lock_irqsave(&cs->cmdlock, flags); 1747 1707 while (cs->cmdbuf != NULL) ··· 1824 1786 cs->lastcmdbuf = cb; 1825 1787 spin_unlock_irqrestore(&cs->cmdlock, flags); 1826 1788 1789 + spin_lock_irqsave(&cs->lock, flags); 1790 + if (unlikely(!cs->connected)) { 1791 + spin_unlock_irqrestore(&cs->lock, flags); 1792 + gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__); 1793 + return -ENODEV; 1794 + } 1827 1795 status = start_cbsend(cs); 1828 - 1796 + spin_unlock_irqrestore(&cs->lock, flags); 1829 1797 return status < 0 ? status : len; 1830 1798 } 1831 1799 ··· 1893 1849 */ 1894 1850 static int gigaset_freebcshw(struct bc_state *bcs) 1895 1851 { 1896 - if (!bcs->hw.bas) 1852 + struct bas_bc_state *ubc = bcs->hw.bas; 1853 + int i; 1854 + 1855 + if (!ubc) 1897 1856 return 0; 1898 1857 1899 - if (bcs->hw.bas->isooutbuf) 1900 - kfree(bcs->hw.bas->isooutbuf); 1901 - kfree(bcs->hw.bas); 1858 + /* kill URBs and tasklets before freeing - better safe than sorry */ 1859 + atomic_set(&ubc->running, 0); 1860 + for (i = 0; i < BAS_OUTURBS; ++i) 1861 + if (ubc->isoouturbs[i].urb) { 1862 + gig_dbg(DEBUG_INIT, "%s: killing iso out URB %d", 1863 + __func__, i); 1864 + usb_kill_urb(ubc->isoouturbs[i].urb); 1865 + usb_free_urb(ubc->isoouturbs[i].urb); 1866 + } 1867 + for (i = 0; i < BAS_INURBS; ++i) 1868 + if (ubc->isoinurbs[i]) { 1869 + gig_dbg(DEBUG_INIT, "%s: killing iso in URB %d", 1870 + __func__, i); 1871 + usb_kill_urb(ubc->isoinurbs[i]); 1872 + usb_free_urb(ubc->isoinurbs[i]); 1873 + } 1874 + tasklet_kill(&ubc->sent_tasklet); 1875 + tasklet_kill(&ubc->rcvd_tasklet); 1876 + kfree(ubc->isooutbuf); 1877 + kfree(ubc); 1902 1878 bcs->hw.bas = NULL; 1903 1879 return 1; 1904 1880 } ··· 1995 1931 1996 1932 static void gigaset_freecshw(struct cardstate *cs) 1997 1933 { 1998 - struct bas_cardstate *ucs = cs->hw.bas; 1999 - 2000 - del_timer(&ucs->timer_ctrl); 2001 - del_timer(&ucs->timer_atrdy); 2002 - del_timer(&ucs->timer_cmd_in); 2003 - 1934 + /* timers, URBs and rcvbuf are disposed of in disconnect */ 2004 1935 kfree(cs->hw.bas); 1936 + cs->hw.bas = NULL; 2005 1937 } 2006 1938 2007 1939 static int gigaset_initcshw(struct cardstate *cs) ··· 2101 2041 struct bas_bc_state *ubc; 2102 2042 struct usb_endpoint_descriptor *endpoint; 2103 2043 int i, j; 2104 - int ret; 2044 + int rc; 2105 2045 2106 2046 gig_dbg(DEBUG_ANY, 2107 2047 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)", 2108 2048 __func__, le16_to_cpu(udev->descriptor.idVendor), 2109 2049 le16_to_cpu(udev->descriptor.idProduct)); 2110 - 2111 - /* See if the device offered us matches what we can accept */ 2112 - if ((le16_to_cpu(udev->descriptor.idVendor) != USB_GIGA_VENDOR_ID) || 2113 - (le16_to_cpu(udev->descriptor.idProduct) != USB_GIGA_PRODUCT_ID && 2114 - le16_to_cpu(udev->descriptor.idProduct) != USB_4175_PRODUCT_ID && 2115 - le16_to_cpu(udev->descriptor.idProduct) != USB_SX303_PRODUCT_ID && 2116 - le16_to_cpu(udev->descriptor.idProduct) != USB_SX353_PRODUCT_ID)) { 2117 - gig_dbg(DEBUG_ANY, "%s: unmatched ID - exiting", __func__); 2118 - return -ENODEV; 2119 - } 2120 2050 2121 2051 /* set required alternate setting */ 2122 2052 hostif = interface->cur_altsetting; ··· 2155 2105 * - three for the different uses of the default control pipe 2156 2106 * - three for each isochronous pipe 2157 2107 */ 2158 - ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL); 2159 - if (!ucs->urb_int_in) { 2160 - dev_err(cs->dev, "no free urbs available\n"); 2161 - goto error; 2162 - } 2163 - ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL); 2164 - if (!ucs->urb_cmd_in) { 2165 - dev_err(cs->dev, "no free urbs available\n"); 2166 - goto error; 2167 - } 2168 - ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL); 2169 - if (!ucs->urb_cmd_out) { 2170 - dev_err(cs->dev, "no free urbs available\n"); 2171 - goto error; 2172 - } 2173 - ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL); 2174 - if (!ucs->urb_ctrl) { 2175 - dev_err(cs->dev, "no free urbs available\n"); 2176 - goto error; 2177 - } 2108 + if (!(ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL)) || 2109 + !(ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL)) || 2110 + !(ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL)) || 2111 + !(ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL))) 2112 + goto allocerr; 2178 2113 2179 2114 for (j = 0; j < 2; ++j) { 2180 2115 ubc = cs->bcs[j].hw.bas; 2181 - for (i = 0; i < BAS_OUTURBS; ++i) { 2182 - ubc->isoouturbs[i].urb = 2183 - usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL); 2184 - if (!ubc->isoouturbs[i].urb) { 2185 - dev_err(cs->dev, "no free urbs available\n"); 2186 - goto error; 2187 - } 2188 - } 2189 - for (i = 0; i < BAS_INURBS; ++i) { 2190 - ubc->isoinurbs[i] = 2191 - usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL); 2192 - if (!ubc->isoinurbs[i]) { 2193 - dev_err(cs->dev, "no free urbs available\n"); 2194 - goto error; 2195 - } 2196 - } 2116 + for (i = 0; i < BAS_OUTURBS; ++i) 2117 + if (!(ubc->isoouturbs[i].urb = 2118 + usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL))) 2119 + goto allocerr; 2120 + for (i = 0; i < BAS_INURBS; ++i) 2121 + if (!(ubc->isoinurbs[i] = 2122 + usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL))) 2123 + goto allocerr; 2197 2124 } 2198 2125 2199 2126 ucs->rcvbuf = NULL; ··· 2183 2156 (endpoint->bEndpointAddress) & 0x0f), 2184 2157 ucs->int_in_buf, 3, read_int_callback, cs, 2185 2158 endpoint->bInterval); 2186 - ret = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL); 2187 - if (ret) { 2159 + if ((rc = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL)) != 0) { 2188 2160 dev_err(cs->dev, "could not submit interrupt URB: %s\n", 2189 - get_usb_statmsg(ret)); 2161 + get_usb_rcmsg(rc)); 2190 2162 goto error; 2191 2163 } 2192 2164 2193 2165 /* tell the device that the driver is ready */ 2194 - if ((ret = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0) 2166 + if ((rc = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0) 2195 2167 goto error; 2196 2168 2197 2169 /* tell common part that the device is ready */ ··· 2205 2179 2206 2180 return 0; 2207 2181 2182 + allocerr: 2183 + dev_err(cs->dev, "could not allocate URBs\n"); 2208 2184 error: 2209 2185 freeurbs(cs); 2210 2186 usb_set_intfdata(interface, NULL); ··· 2221 2193 { 2222 2194 struct cardstate *cs; 2223 2195 struct bas_cardstate *ucs; 2196 + int j; 2224 2197 2225 2198 cs = usb_get_intfdata(interface); 2226 2199 2227 2200 ucs = cs->hw.bas; 2228 2201 2229 2202 dev_info(cs->dev, "disconnecting Gigaset base\n"); 2203 + 2204 + /* mark base as not ready, all channels disconnected */ 2205 + atomic_set(&ucs->basstate, 0); 2206 + 2207 + /* tell LL all channels are down */ 2208 + //FIXME shouldn't gigaset_stop() do this? 2209 + for (j = 0; j < 2; ++j) 2210 + gigaset_bchannel_down(cs->bcs + j); 2211 + 2212 + /* stop driver (common part) */ 2230 2213 gigaset_stop(cs); 2214 + 2215 + /* stop timers and URBs, free ressources */ 2216 + del_timer_sync(&ucs->timer_ctrl); 2217 + del_timer_sync(&ucs->timer_atrdy); 2218 + del_timer_sync(&ucs->timer_cmd_in); 2231 2219 freeurbs(cs); 2232 2220 usb_set_intfdata(interface, NULL); 2233 2221 kfree(ucs->rcvbuf); 2234 2222 ucs->rcvbuf = NULL; 2235 2223 ucs->rcvbuf_size = 0; 2236 - atomic_set(&ucs->basstate, 0); 2237 2224 usb_put_dev(ucs->udev); 2238 2225 ucs->interface = NULL; 2239 2226 ucs->udev = NULL; ··· 2320 2277 */ 2321 2278 static void __exit bas_gigaset_exit(void) 2322 2279 { 2280 + struct bas_cardstate *ucs = cardstate->hw.bas; 2281 + 2323 2282 gigaset_blockdriver(driver); /* => probe will fail 2324 2283 * => no gigaset_start any more 2325 2284 */ ··· 2329 2284 gigaset_shutdown(cardstate); 2330 2285 /* from now on, no isdn callback should be possible */ 2331 2286 2332 - if (atomic_read(&cardstate->hw.bas->basstate) & BS_ATOPEN) { 2333 - gig_dbg(DEBUG_ANY, "closing AT channel"); 2334 - if (req_submit(cardstate->bcs, 2335 - HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT) >= 0) { 2336 - /* successfully submitted */ 2337 - //FIXME wait for completion? 2338 - } 2287 + /* close all still open channels */ 2288 + if (atomic_read(&ucs->basstate) & BS_B1OPEN) { 2289 + gig_dbg(DEBUG_INIT, "closing B1 channel"); 2290 + usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2291 + HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0, 2292 + NULL, 0, BAS_TIMEOUT); 2339 2293 } 2294 + if (atomic_read(&ucs->basstate) & BS_B2OPEN) { 2295 + gig_dbg(DEBUG_INIT, "closing B2 channel"); 2296 + usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2297 + HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0, 2298 + NULL, 0, BAS_TIMEOUT); 2299 + } 2300 + if (atomic_read(&ucs->basstate) & BS_ATOPEN) { 2301 + gig_dbg(DEBUG_INIT, "closing AT channel"); 2302 + usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0), 2303 + HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0, 2304 + NULL, 0, BAS_TIMEOUT); 2305 + } 2306 + atomic_set(&ucs->basstate, 0); 2340 2307 2341 2308 /* deregister this driver with the USB subsystem */ 2342 2309 usb_deregister(&gigaset_usb_driver);
+1 -2
drivers/isdn/gigaset/common.c
··· 781 781 } 782 782 EXPORT_SYMBOL_GPL(gigaset_initcs); 783 783 784 - /* ReInitialize the b-channel structure */ 785 - /* e.g. called on hangup, disconnect */ 784 + /* ReInitialize the b-channel structure on hangup */ 786 785 void gigaset_bcs_reinit(struct bc_state *bcs) 787 786 { 788 787 struct sk_buff *skb;
+3
drivers/isdn/gigaset/ev-layer.c
··· 373 373 374 374 {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}}, 375 375 376 + /* B channel closed (general case) */ 377 + {EV_BC_CLOSED, -1, -1, -1, -1,-1, {ACT_NOTIFY_BC_DOWN}}, //FIXME 378 + 376 379 /* misc. */ 377 380 {EV_PROTO_L2, -1, -1, -1, -1,-1, {ACT_PROTO_L2}}, //FIXME 378 381
+3 -4
drivers/isdn/gigaset/gigaset.h
··· 75 75 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and 76 76 * DEBUG_INTR. 77 77 */ 78 - enum debuglevel { /* up to 24 bits (atomic_t) */ 78 + enum debuglevel { 79 79 DEBUG_REG = 0x0002, /* serial port I/O register operations */ 80 80 DEBUG_OPEN = 0x0004, /* open/close serial port */ 81 81 DEBUG_INTR = 0x0008, /* interrupt processing */ ··· 141 141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \ 142 142 ## arg); \ 143 143 } while (0) 144 - #define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) 144 + #define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ) 145 145 146 146 #else 147 147 ··· 627 627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */ 628 628 int (*freebcshw)(struct bc_state *bcs); 629 629 630 - /* Called by gigaset_stop() or gigaset_bchannel_down() for resetting 631 - bcs->hw.xxx */ 630 + /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */ 632 631 void (*reinitbcshw)(struct bc_state *bcs); 633 632 634 633 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
+1 -1
drivers/isdn/gigaset/i4l.c
··· 73 73 len, skblen, (unsigned) skb->head[0], (unsigned) skb->head[1]); 74 74 75 75 /* pass to device-specific module */ 76 - return cs->ops->send_skb(bcs, skb); //FIXME cs->ops->send_skb() must handle !cs->connected correctly 76 + return cs->ops->send_skb(bcs, skb); 77 77 } 78 78 79 79 void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb)
+7 -3
drivers/isdn/gigaset/isocdata.c
··· 992 992 int len = skb->len; 993 993 unsigned long flags; 994 994 995 + spin_lock_irqsave(&bcs->cs->lock, flags); 996 + if (!bcs->cs->connected) { 997 + spin_unlock_irqrestore(&bcs->cs->lock, flags); 998 + return -ENODEV; 999 + } 1000 + 995 1001 skb_queue_tail(&bcs->squeue, skb); 996 1002 gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d", 997 1003 __func__, skb_queue_len(&bcs->squeue)); 998 1004 999 1005 /* tasklet submits URB if necessary */ 1000 - spin_lock_irqsave(&bcs->cs->lock, flags); 1001 - if (bcs->cs->connected) 1002 - tasklet_schedule(&bcs->hw.bas->sent_tasklet); 1006 + tasklet_schedule(&bcs->hw.bas->sent_tasklet); 1003 1007 spin_unlock_irqrestore(&bcs->cs->lock, flags); 1004 1008 1005 1009 return len; /* ok so far */
+2 -2
drivers/macintosh/therm_adt746x.c
··· 627 627 if(therm_type == ADT7460) 628 628 device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed); 629 629 630 - #ifndef CONFIG_I2C_KEYWEST 631 - request_module("i2c-keywest"); 630 + #ifndef CONFIG_I2C_POWERMAC 631 + request_module("i2c-powermac"); 632 632 #endif 633 633 634 634 return i2c_add_driver(&thermostat_driver);
+4 -6
drivers/mmc/pxamci.c
··· 65 65 unsigned int dma_dir; 66 66 }; 67 67 68 - static inline unsigned int ns_to_clocks(unsigned int ns) 69 - { 70 - return (ns * (CLOCKRATE / 1000000) + 999) / 1000; 71 - } 72 - 73 68 static void pxamci_stop_clock(struct pxamci_host *host) 74 69 { 75 70 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) { ··· 108 113 static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) 109 114 { 110 115 unsigned int nob = data->blocks; 116 + unsigned long long clks; 111 117 unsigned int timeout; 112 118 u32 dcmd; 113 119 int i; ··· 121 125 writel(nob, host->base + MMC_NOB); 122 126 writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); 123 127 124 - timeout = ns_to_clocks(data->timeout_ns) + data->timeout_clks; 128 + clks = (unsigned long long)data->timeout_ns * CLOCKRATE; 129 + do_div(clks, 1000000000UL); 130 + timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt); 125 131 writel((timeout + 255) / 256, host->base + MMC_RDTO); 126 132 127 133 if (data->flags & MMC_DATA_READ) {
+1
drivers/net/e1000/e1000_main.c
··· 3768 3768 ps_page->ps_page[j] = NULL; 3769 3769 skb->len += length; 3770 3770 skb->data_len += length; 3771 + skb->truesize += length; 3771 3772 } 3772 3773 3773 3774 copydone:
+67 -12
drivers/net/forcedeth.c
··· 105 105 * 0.50: 20 Jan 2006: Add 8021pq tagging support. 106 106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings. 107 107 * 0.52: 20 Jan 2006: Add MSI/MSIX support. 108 + * 0.53: 19 Mar 2006: Fix init from low power mode and add hw reset. 108 109 * 109 110 * Known bugs: 110 111 * We suspect that on some hardware no TX done interrupts are generated. ··· 117 116 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 118 117 * superfluous timer interrupts from the nic. 119 118 */ 120 - #define FORCEDETH_VERSION "0.52" 119 + #define FORCEDETH_VERSION "0.53" 121 120 #define DRV_NAME "forcedeth" 122 121 123 122 #include <linux/module.h> ··· 161 160 #define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */ 162 161 #define DEV_HAS_MSI 0x0040 /* device supports MSI */ 163 162 #define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */ 163 + #define DEV_HAS_POWER_CNTRL 0x0100 /* device supports power savings */ 164 164 165 165 enum { 166 166 NvRegIrqStatus = 0x000, ··· 205 203 #define NVREG_MISC1_HD 0x02 206 204 #define NVREG_MISC1_FORCE 0x3b0f3c 207 205 206 + NvRegMacReset = 0x3c, 207 + #define NVREG_MAC_RESET_ASSERT 0x0F3 208 208 NvRegTransmitterControl = 0x084, 209 209 #define NVREG_XMITCTL_START 0x01 210 210 NvRegTransmitterStatus = 0x088, ··· 330 326 NvRegMSIXMap0 = 0x3e0, 331 327 NvRegMSIXMap1 = 0x3e4, 332 328 NvRegMSIXIrqStatus = 0x3f0, 329 + 330 + NvRegPowerState2 = 0x600, 331 + #define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11 332 + #define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001 333 333 }; 334 334 335 335 /* Big endian: should work, but is untested */ ··· 422 414 #define NV_RX3_VLAN_TAG_MASK (0x0000FFFF) 423 415 424 416 /* Miscelaneous hardware related defines: */ 425 - #define NV_PCI_REGSZ 0x270 417 + #define NV_PCI_REGSZ_VER1 0x270 418 + #define NV_PCI_REGSZ_VER2 0x604 426 419 427 420 /* various timeout delays: all in usec */ 428 421 #define NV_TXRX_RESET_DELAY 4 ··· 440 431 #define NV_MIIBUSY_DELAY 50 441 432 #define NV_MIIPHY_DELAY 10 442 433 #define NV_MIIPHY_DELAYMAX 10000 434 + #define NV_MAC_RESET_DELAY 64 443 435 444 436 #define NV_WAKEUPPATTERNS 5 445 437 #define NV_WAKEUPMASKENTRIES 4 ··· 562 552 u32 desc_ver; 563 553 u32 txrxctl_bits; 564 554 u32 vlanctl_bits; 555 + u32 driver_data; 556 + u32 register_size; 565 557 566 558 void __iomem *base; 567 559 ··· 927 915 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl); 928 916 pci_push(base); 929 917 udelay(NV_TXRX_RESET_DELAY); 918 + writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl); 919 + pci_push(base); 920 + } 921 + 922 + static void nv_mac_reset(struct net_device *dev) 923 + { 924 + struct fe_priv *np = netdev_priv(dev); 925 + u8 __iomem *base = get_hwbase(dev); 926 + 927 + dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name); 928 + writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl); 929 + pci_push(base); 930 + writel(NVREG_MAC_RESET_ASSERT, base + NvRegMacReset); 931 + pci_push(base); 932 + udelay(NV_MAC_RESET_DELAY); 933 + writel(0, base + NvRegMacReset); 934 + pci_push(base); 935 + udelay(NV_MAC_RESET_DELAY); 930 936 writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl); 931 937 pci_push(base); 932 938 } ··· 1361 1331 dev->name, (unsigned long)np->ring_addr, 1362 1332 np->next_tx, np->nic_tx); 1363 1333 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name); 1364 - for (i=0;i<0x400;i+= 32) { 1334 + for (i=0;i<=np->register_size;i+= 32) { 1365 1335 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n", 1366 1336 i, 1367 1337 readl(base + i + 0), readl(base + i + 4), ··· 2518 2488 } 2519 2489 2520 2490 #define FORCEDETH_REGS_VER 1 2521 - #define FORCEDETH_REGS_SIZE 0x400 /* 256 32-bit registers */ 2522 2491 2523 2492 static int nv_get_regs_len(struct net_device *dev) 2524 2493 { 2525 - return FORCEDETH_REGS_SIZE; 2494 + struct fe_priv *np = netdev_priv(dev); 2495 + return np->register_size; 2526 2496 } 2527 2497 2528 2498 static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf) ··· 2534 2504 2535 2505 regs->version = FORCEDETH_REGS_VER; 2536 2506 spin_lock_irq(&np->lock); 2537 - for (i=0;i<FORCEDETH_REGS_SIZE/sizeof(u32);i++) 2507 + for (i = 0;i <= np->register_size/sizeof(u32); i++) 2538 2508 rbuf[i] = readl(base + i*sizeof(u32)); 2539 2509 spin_unlock_irq(&np->lock); 2540 2510 } ··· 2638 2608 dprintk(KERN_DEBUG "nv_open: begin\n"); 2639 2609 2640 2610 /* 1) erase previous misconfiguration */ 2611 + if (np->driver_data & DEV_HAS_POWER_CNTRL) 2612 + nv_mac_reset(dev); 2641 2613 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */ 2642 2614 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA); 2643 2615 writel(0, base + NvRegMulticastAddrB); ··· 2910 2878 unsigned long addr; 2911 2879 u8 __iomem *base; 2912 2880 int err, i; 2881 + u32 powerstate; 2913 2882 2914 2883 dev = alloc_etherdev(sizeof(struct fe_priv)); 2915 2884 err = -ENOMEM; ··· 2943 2910 if (err < 0) 2944 2911 goto out_disable; 2945 2912 2913 + if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL)) 2914 + np->register_size = NV_PCI_REGSZ_VER2; 2915 + else 2916 + np->register_size = NV_PCI_REGSZ_VER1; 2917 + 2946 2918 err = -EINVAL; 2947 2919 addr = 0; 2948 2920 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { ··· 2956 2918 pci_resource_len(pci_dev, i), 2957 2919 pci_resource_flags(pci_dev, i)); 2958 2920 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM && 2959 - pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) { 2921 + pci_resource_len(pci_dev, i) >= np->register_size) { 2960 2922 addr = pci_resource_start(pci_dev, i); 2961 2923 break; 2962 2924 } ··· 2966 2928 pci_name(pci_dev)); 2967 2929 goto out_relreg; 2968 2930 } 2931 + 2932 + /* copy of driver data */ 2933 + np->driver_data = id->driver_data; 2969 2934 2970 2935 /* handle different descriptor versions */ 2971 2936 if (id->driver_data & DEV_HAS_HIGH_DMA) { ··· 3027 2986 } 3028 2987 3029 2988 err = -ENOMEM; 3030 - np->base = ioremap(addr, NV_PCI_REGSZ); 2989 + np->base = ioremap(addr, np->register_size); 3031 2990 if (!np->base) 3032 2991 goto out_relreg; 3033 2992 dev->base_addr = (unsigned long)np->base; ··· 3102 3061 /* disable WOL */ 3103 3062 writel(0, base + NvRegWakeUpFlags); 3104 3063 np->wolenabled = 0; 3064 + 3065 + if (id->driver_data & DEV_HAS_POWER_CNTRL) { 3066 + u8 revision_id; 3067 + pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id); 3068 + 3069 + /* take phy and nic out of low power mode */ 3070 + powerstate = readl(base + NvRegPowerState2); 3071 + powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK; 3072 + if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 || 3073 + id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) && 3074 + revision_id >= 0xA3) 3075 + powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3; 3076 + writel(powerstate, base + NvRegPowerState2); 3077 + } 3105 3078 3106 3079 if (np->desc_ver == DESC_VER_1) { 3107 3080 np->tx_flags = NV_TX_VALID; ··· 3278 3223 }, 3279 3224 { /* MCP51 Ethernet Controller */ 3280 3225 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12), 3281 - .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3226 + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL, 3282 3227 }, 3283 3228 { /* MCP51 Ethernet Controller */ 3284 3229 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13), 3285 - .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA, 3230 + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL, 3286 3231 }, 3287 3232 { /* MCP55 Ethernet Controller */ 3288 3233 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14), 3289 - .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3234 + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL, 3290 3235 }, 3291 3236 { /* MCP55 Ethernet Controller */ 3292 3237 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15), 3293 - .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X, 3238 + .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL, 3294 3239 }, 3295 3240 {0,}, 3296 3241 };
+28 -28
drivers/net/gianfar.c
··· 210 210 goto regs_fail; 211 211 } 212 212 213 - spin_lock_init(&priv->lock); 213 + spin_lock_init(&priv->txlock); 214 + spin_lock_init(&priv->rxlock); 214 215 215 216 platform_set_drvdata(pdev, dev); 216 217 ··· 516 515 phy_stop(priv->phydev); 517 516 518 517 /* Lock it down */ 519 - spin_lock_irqsave(&priv->lock, flags); 518 + spin_lock_irqsave(&priv->txlock, flags); 519 + spin_lock(&priv->rxlock); 520 520 521 521 gfar_halt(dev); 522 522 523 - spin_unlock_irqrestore(&priv->lock, flags); 523 + spin_unlock(&priv->rxlock); 524 + spin_unlock_irqrestore(&priv->txlock, flags); 524 525 525 526 /* Free the IRQs */ 526 527 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { ··· 608 605 tempval |= DMACTRL_INIT_SETTINGS; 609 606 gfar_write(&priv->regs->dmactrl, tempval); 610 607 611 - /* Clear THLT, so that the DMA starts polling now */ 612 - gfar_write(&regs->tstat, TSTAT_CLEAR_THALT); 613 - 614 608 /* Make sure we aren't stopped */ 615 609 tempval = gfar_read(&priv->regs->dmactrl); 616 610 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS); 617 611 gfar_write(&priv->regs->dmactrl, tempval); 612 + 613 + /* Clear THLT/RHLT, so that the DMA starts polling now */ 614 + gfar_write(&regs->tstat, TSTAT_CLEAR_THALT); 615 + gfar_write(&regs->rstat, RSTAT_CLEAR_RHALT); 618 616 619 617 /* Unmask the interrupts we look for */ 620 618 gfar_write(&regs->imask, IMASK_DEFAULT); ··· 932 928 struct txfcb *fcb = NULL; 933 929 struct txbd8 *txbdp; 934 930 u16 status; 931 + unsigned long flags; 935 932 936 933 /* Update transmit stats */ 937 934 priv->stats.tx_bytes += skb->len; 938 935 939 936 /* Lock priv now */ 940 - spin_lock_irq(&priv->lock); 937 + spin_lock_irqsave(&priv->txlock, flags); 941 938 942 939 /* Point at the first free tx descriptor */ 943 940 txbdp = priv->cur_tx; ··· 1009 1004 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT); 1010 1005 1011 1006 /* Unlock priv */ 1012 - spin_unlock_irq(&priv->lock); 1007 + spin_unlock_irqrestore(&priv->txlock, flags); 1013 1008 1014 1009 return 0; 1015 1010 } ··· 1054 1049 unsigned long flags; 1055 1050 u32 tempval; 1056 1051 1057 - spin_lock_irqsave(&priv->lock, flags); 1052 + spin_lock_irqsave(&priv->rxlock, flags); 1058 1053 1059 1054 priv->vlgrp = grp; 1060 1055 ··· 1081 1076 gfar_write(&priv->regs->rctrl, tempval); 1082 1077 } 1083 1078 1084 - spin_unlock_irqrestore(&priv->lock, flags); 1079 + spin_unlock_irqrestore(&priv->rxlock, flags); 1085 1080 } 1086 1081 1087 1082 ··· 1090 1085 struct gfar_private *priv = netdev_priv(dev); 1091 1086 unsigned long flags; 1092 1087 1093 - spin_lock_irqsave(&priv->lock, flags); 1088 + spin_lock_irqsave(&priv->rxlock, flags); 1094 1089 1095 1090 if (priv->vlgrp) 1096 1091 priv->vlgrp->vlan_devices[vid] = NULL; 1097 1092 1098 - spin_unlock_irqrestore(&priv->lock, flags); 1093 + spin_unlock_irqrestore(&priv->rxlock, flags); 1099 1094 } 1100 1095 1101 1096 ··· 1184 1179 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK); 1185 1180 1186 1181 /* Lock priv */ 1187 - spin_lock(&priv->lock); 1182 + spin_lock(&priv->txlock); 1188 1183 bdp = priv->dirty_tx; 1189 1184 while ((bdp->status & TXBD_READY) == 0) { 1190 1185 /* If dirty_tx and cur_tx are the same, then either the */ ··· 1229 1224 else 1230 1225 gfar_write(&priv->regs->txic, 0); 1231 1226 1232 - spin_unlock(&priv->lock); 1227 + spin_unlock(&priv->txlock); 1233 1228 1234 1229 return IRQ_HANDLED; 1235 1230 } ··· 1310 1305 { 1311 1306 struct net_device *dev = (struct net_device *) dev_id; 1312 1307 struct gfar_private *priv = netdev_priv(dev); 1313 - 1314 1308 #ifdef CONFIG_GFAR_NAPI 1315 1309 u32 tempval; 1310 + #else 1311 + unsigned long flags; 1316 1312 #endif 1317 1313 1318 1314 /* Clear IEVENT, so rx interrupt isn't called again ··· 1336 1330 } 1337 1331 #else 1338 1332 1339 - spin_lock(&priv->lock); 1333 + spin_lock_irqsave(&priv->rxlock, flags); 1340 1334 gfar_clean_rx_ring(dev, priv->rx_ring_size); 1341 1335 1342 1336 /* If we are coalescing interrupts, update the timer */ ··· 1347 1341 else 1348 1342 gfar_write(&priv->regs->rxic, 0); 1349 1343 1350 - spin_unlock(&priv->lock); 1344 + spin_unlock_irqrestore(&priv->rxlock, flags); 1351 1345 #endif 1352 1346 1353 1347 return IRQ_HANDLED; ··· 1496 1490 /* Update the current rxbd pointer to be the next one */ 1497 1491 priv->cur_rx = bdp; 1498 1492 1499 - /* If no packets have arrived since the 1500 - * last one we processed, clear the IEVENT RX and 1501 - * BSY bits so that another interrupt won't be 1502 - * generated when we set IMASK */ 1503 - if (bdp->status & RXBD_EMPTY) 1504 - gfar_write(&priv->regs->ievent, IEVENT_RX_MASK); 1505 - 1506 1493 return howmany; 1507 1494 } 1508 1495 ··· 1515 1516 rx_work_limit -= howmany; 1516 1517 *budget -= howmany; 1517 1518 1518 - if (rx_work_limit >= 0) { 1519 + if (rx_work_limit > 0) { 1519 1520 netif_rx_complete(dev); 1520 1521 1521 1522 /* Clear the halt bit in RSTAT */ ··· 1532 1533 gfar_write(&priv->regs->rxic, 0); 1533 1534 } 1534 1535 1535 - return (rx_work_limit < 0) ? 1 : 0; 1536 + /* Return 1 if there's more work to do */ 1537 + return (rx_work_limit > 0) ? 0 : 1; 1536 1538 } 1537 1539 #endif 1538 1540 ··· 1629 1629 struct phy_device *phydev = priv->phydev; 1630 1630 int new_state = 0; 1631 1631 1632 - spin_lock_irqsave(&priv->lock, flags); 1632 + spin_lock_irqsave(&priv->txlock, flags); 1633 1633 if (phydev->link) { 1634 1634 u32 tempval = gfar_read(&regs->maccfg2); 1635 1635 u32 ecntrl = gfar_read(&regs->ecntrl); ··· 1694 1694 if (new_state && netif_msg_link(priv)) 1695 1695 phy_print_status(phydev); 1696 1696 1697 - spin_unlock_irqrestore(&priv->lock, flags); 1697 + spin_unlock_irqrestore(&priv->txlock, flags); 1698 1698 } 1699 1699 1700 1700 /* Update the hash table based on the current list of multicast
+46 -21
drivers/net/gianfar.h
··· 656 656 * the buffer descriptor determines the actual condition. 657 657 */ 658 658 struct gfar_private { 659 - /* pointers to arrays of skbuffs for tx and rx */ 659 + /* Fields controlled by TX lock */ 660 + spinlock_t txlock; 661 + 662 + /* Pointer to the array of skbuffs */ 660 663 struct sk_buff ** tx_skbuff; 661 - struct sk_buff ** rx_skbuff; 662 664 663 - /* indices pointing to the next free sbk in skb arrays */ 665 + /* next free skb in the array */ 664 666 u16 skb_curtx; 665 - u16 skb_currx; 666 667 667 - /* index of the first skb which hasn't been transmitted 668 - * yet. */ 668 + /* First skb in line to be transmitted */ 669 669 u16 skb_dirtytx; 670 670 671 671 /* Configuration info for the coalescing features */ 672 672 unsigned char txcoalescing; 673 673 unsigned short txcount; 674 674 unsigned short txtime; 675 + 676 + /* Buffer descriptor pointers */ 677 + struct txbd8 *tx_bd_base; /* First tx buffer descriptor */ 678 + struct txbd8 *cur_tx; /* Next free ring entry */ 679 + struct txbd8 *dirty_tx; /* First buffer in line 680 + to be transmitted */ 681 + unsigned int tx_ring_size; 682 + 683 + /* RX Locked fields */ 684 + spinlock_t rxlock; 685 + 686 + /* skb array and index */ 687 + struct sk_buff ** rx_skbuff; 688 + u16 skb_currx; 689 + 690 + /* RX Coalescing values */ 675 691 unsigned char rxcoalescing; 676 692 unsigned short rxcount; 677 693 unsigned short rxtime; 678 694 679 - /* GFAR addresses */ 680 - struct rxbd8 *rx_bd_base; /* Base addresses of Rx and Tx Buffers */ 681 - struct txbd8 *tx_bd_base; 695 + struct rxbd8 *rx_bd_base; /* First Rx buffers */ 682 696 struct rxbd8 *cur_rx; /* Next free rx ring entry */ 683 - struct txbd8 *cur_tx; /* Next free ring entry */ 684 - struct txbd8 *dirty_tx; /* The Ring entry to be freed. */ 685 - struct gfar __iomem *regs; /* Pointer to the GFAR memory mapped Registers */ 686 - u32 __iomem *hash_regs[16]; 687 - int hash_width; 688 - struct net_device_stats stats; /* linux network statistics */ 689 - struct gfar_extra_stats extra_stats; 690 - spinlock_t lock; 697 + 698 + /* RX parameters */ 699 + unsigned int rx_ring_size; 691 700 unsigned int rx_buffer_size; 692 701 unsigned int rx_stash_size; 693 702 unsigned int rx_stash_index; 694 - unsigned int tx_ring_size; 695 - unsigned int rx_ring_size; 703 + 704 + struct vlan_group *vlgrp; 705 + 706 + /* Unprotected fields */ 707 + /* Pointer to the GFAR memory mapped Registers */ 708 + struct gfar __iomem *regs; 709 + 710 + /* Hash registers and their width */ 711 + u32 __iomem *hash_regs[16]; 712 + int hash_width; 713 + 714 + /* global parameters */ 696 715 unsigned int fifo_threshold; 697 716 unsigned int fifo_starve; 698 717 unsigned int fifo_starve_off; ··· 721 702 extended_hash:1, 722 703 bd_stash_en:1; 723 704 unsigned short padding; 724 - struct vlan_group *vlgrp; 725 - /* Info structure initialized by board setup code */ 705 + 726 706 unsigned int interruptTransmit; 727 707 unsigned int interruptReceive; 728 708 unsigned int interruptError; 709 + 710 + /* info structure initialized by platform code */ 729 711 struct gianfar_platform_data *einfo; 730 712 713 + /* PHY stuff */ 731 714 struct phy_device *phydev; 732 715 struct mii_bus *mii_bus; 733 716 int oldspeed; ··· 737 716 int oldlink; 738 717 739 718 uint32_t msg_enable; 719 + 720 + /* Network Statistics */ 721 + struct net_device_stats stats; 722 + struct gfar_extra_stats extra_stats; 740 723 }; 741 724 742 725 static inline u32 gfar_read(volatile unsigned __iomem *addr)
+14 -6
drivers/net/gianfar_ethtool.c
··· 455 455 456 456 /* Halt TX and RX, and process the frames which 457 457 * have already been received */ 458 - spin_lock_irqsave(&priv->lock, flags); 458 + spin_lock_irqsave(&priv->txlock, flags); 459 + spin_lock(&priv->rxlock); 460 + 459 461 gfar_halt(dev); 460 462 gfar_clean_rx_ring(dev, priv->rx_ring_size); 461 - spin_unlock_irqrestore(&priv->lock, flags); 463 + 464 + spin_unlock(&priv->rxlock); 465 + spin_unlock_irqrestore(&priv->txlock, flags); 462 466 463 467 /* Now we take down the rings to rebuild them */ 464 468 stop_gfar(dev); ··· 492 488 493 489 /* Halt TX and RX, and process the frames which 494 490 * have already been received */ 495 - spin_lock_irqsave(&priv->lock, flags); 491 + spin_lock_irqsave(&priv->txlock, flags); 492 + spin_lock(&priv->rxlock); 493 + 496 494 gfar_halt(dev); 497 495 gfar_clean_rx_ring(dev, priv->rx_ring_size); 498 - spin_unlock_irqrestore(&priv->lock, flags); 496 + 497 + spin_unlock(&priv->rxlock); 498 + spin_unlock_irqrestore(&priv->txlock, flags); 499 499 500 500 /* Now we take down the rings to rebuild them */ 501 501 stop_gfar(dev); ··· 531 523 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM)) 532 524 return -EOPNOTSUPP; 533 525 534 - spin_lock_irqsave(&priv->lock, flags); 526 + spin_lock_irqsave(&priv->txlock, flags); 535 527 gfar_halt(dev); 536 528 537 529 if (data) ··· 540 532 dev->features &= ~NETIF_F_IP_CSUM; 541 533 542 534 gfar_start(dev); 543 - spin_unlock_irqrestore(&priv->lock, flags); 535 + spin_unlock_irqrestore(&priv->txlock, flags); 544 536 545 537 return 0; 546 538 }
+12 -12
drivers/net/gianfar_sysfs.c
··· 82 82 else 83 83 return count; 84 84 85 - spin_lock_irqsave(&priv->lock, flags); 85 + spin_lock_irqsave(&priv->rxlock, flags); 86 86 87 87 /* Set the new stashing value */ 88 88 priv->bd_stash_en = new_setting; ··· 96 96 97 97 gfar_write(&priv->regs->attr, temp); 98 98 99 - spin_unlock_irqrestore(&priv->lock, flags); 99 + spin_unlock_irqrestore(&priv->rxlock, flags); 100 100 101 101 return count; 102 102 } ··· 118 118 u32 temp; 119 119 unsigned long flags; 120 120 121 - spin_lock_irqsave(&priv->lock, flags); 121 + spin_lock_irqsave(&priv->rxlock, flags); 122 122 if (length > priv->rx_buffer_size) 123 123 return count; 124 124 ··· 142 142 143 143 gfar_write(&priv->regs->attr, temp); 144 144 145 - spin_unlock_irqrestore(&priv->lock, flags); 145 + spin_unlock_irqrestore(&priv->rxlock, flags); 146 146 147 147 return count; 148 148 } ··· 166 166 u32 temp; 167 167 unsigned long flags; 168 168 169 - spin_lock_irqsave(&priv->lock, flags); 169 + spin_lock_irqsave(&priv->rxlock, flags); 170 170 if (index > priv->rx_stash_size) 171 171 return count; 172 172 ··· 180 180 temp |= ATTRELI_EI(index); 181 181 gfar_write(&priv->regs->attreli, flags); 182 182 183 - spin_unlock_irqrestore(&priv->lock, flags); 183 + spin_unlock_irqrestore(&priv->rxlock, flags); 184 184 185 185 return count; 186 186 } ··· 205 205 if (length > GFAR_MAX_FIFO_THRESHOLD) 206 206 return count; 207 207 208 - spin_lock_irqsave(&priv->lock, flags); 208 + spin_lock_irqsave(&priv->txlock, flags); 209 209 210 210 priv->fifo_threshold = length; 211 211 ··· 214 214 temp |= length; 215 215 gfar_write(&priv->regs->fifo_tx_thr, temp); 216 216 217 - spin_unlock_irqrestore(&priv->lock, flags); 217 + spin_unlock_irqrestore(&priv->txlock, flags); 218 218 219 219 return count; 220 220 } ··· 240 240 if (num > GFAR_MAX_FIFO_STARVE) 241 241 return count; 242 242 243 - spin_lock_irqsave(&priv->lock, flags); 243 + spin_lock_irqsave(&priv->txlock, flags); 244 244 245 245 priv->fifo_starve = num; 246 246 ··· 249 249 temp |= num; 250 250 gfar_write(&priv->regs->fifo_tx_starve, temp); 251 251 252 - spin_unlock_irqrestore(&priv->lock, flags); 252 + spin_unlock_irqrestore(&priv->txlock, flags); 253 253 254 254 return count; 255 255 } ··· 274 274 if (num > GFAR_MAX_FIFO_STARVE_OFF) 275 275 return count; 276 276 277 - spin_lock_irqsave(&priv->lock, flags); 277 + spin_lock_irqsave(&priv->txlock, flags); 278 278 279 279 priv->fifo_starve_off = num; 280 280 ··· 283 283 temp |= num; 284 284 gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp); 285 285 286 - spin_unlock_irqrestore(&priv->lock, flags); 286 + spin_unlock_irqrestore(&priv->txlock, flags); 287 287 288 288 return count; 289 289 }
+1
drivers/net/pcmcia/pcnet_cs.c
··· 1639 1639 PCMCIA_DEVICE_PROD_ID12("CONTEC", "C-NET(PC)C-10L", 0x21cab552, 0xf6f90722), 1640 1640 PCMCIA_DEVICE_PROD_ID12("corega", "FEther PCC-TXF", 0x0a21501a, 0xa51564a2), 1641 1641 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-T", 0x5261440f, 0xfa9d85bd), 1642 + PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), 1642 1643 PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), 1643 1644 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), 1644 1645 PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9),
+41 -11
drivers/net/sky2.c
··· 51 51 #include "sky2.h" 52 52 53 53 #define DRV_NAME "sky2" 54 - #define DRV_VERSION "1.1" 54 + #define DRV_VERSION "1.2" 55 55 #define PFX DRV_NAME " " 56 56 57 57 /* ··· 925 925 skb = alloc_skb(size + RX_SKB_ALIGN, gfp_mask); 926 926 if (likely(skb)) { 927 927 unsigned long p = (unsigned long) skb->data; 928 - skb_reserve(skb, 929 - ((p + RX_SKB_ALIGN - 1) & ~(RX_SKB_ALIGN - 1)) - p); 928 + skb_reserve(skb, ALIGN(p, RX_SKB_ALIGN) - p); 930 929 } 931 930 932 931 return skb; ··· 1685 1686 } 1686 1687 1687 1688 1688 - #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) 1689 1689 /* Want receive buffer size to be multiple of 64 bits 1690 1690 * and incl room for vlan and truncation 1691 1691 */ 1692 1692 static inline unsigned sky2_buf_size(int mtu) 1693 1693 { 1694 - return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; 1694 + return ALIGN(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; 1695 1695 } 1696 1696 1697 1697 static int sky2_change_mtu(struct net_device *dev, int new_mtu) ··· 2084 2086 } 2085 2087 } 2086 2088 2089 + /* If idle then force a fake soft NAPI poll once a second 2090 + * to work around cases where sharing an edge triggered interrupt. 2091 + */ 2092 + static void sky2_idle(unsigned long arg) 2093 + { 2094 + struct net_device *dev = (struct net_device *) arg; 2095 + 2096 + local_irq_disable(); 2097 + if (__netif_rx_schedule_prep(dev)) 2098 + __netif_rx_schedule(dev); 2099 + local_irq_enable(); 2100 + } 2101 + 2102 + 2087 2103 static int sky2_poll(struct net_device *dev0, int *budget) 2088 2104 { 2089 2105 struct sky2_hw *hw = ((struct sky2_port *) netdev_priv(dev0))->hw; ··· 2105 2093 int work_done = 0; 2106 2094 u32 status = sky2_read32(hw, B0_Y2_SP_EISR); 2107 2095 2096 + restart_poll: 2108 2097 if (unlikely(status & ~Y2_IS_STAT_BMU)) { 2109 2098 if (status & Y2_IS_HW_ERR) 2110 2099 sky2_hw_intr(hw); ··· 2136 2123 } 2137 2124 2138 2125 if (status & Y2_IS_STAT_BMU) { 2139 - work_done = sky2_status_intr(hw, work_limit); 2126 + work_done += sky2_status_intr(hw, work_limit - work_done); 2140 2127 *budget -= work_done; 2141 2128 dev0->quota -= work_done; 2142 2129 ··· 2146 2133 sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); 2147 2134 } 2148 2135 2149 - netif_rx_complete(dev0); 2136 + mod_timer(&hw->idle_timer, jiffies + HZ); 2137 + 2138 + local_irq_disable(); 2139 + __netif_rx_complete(dev0); 2150 2140 2151 2141 status = sky2_read32(hw, B0_Y2_SP_LISR); 2142 + 2143 + if (unlikely(status)) { 2144 + /* More work pending, try and keep going */ 2145 + if (__netif_rx_schedule_prep(dev0)) { 2146 + __netif_rx_reschedule(dev0, work_done); 2147 + status = sky2_read32(hw, B0_Y2_SP_EISR); 2148 + local_irq_enable(); 2149 + goto restart_poll; 2150 + } 2151 + } 2152 + 2153 + local_irq_enable(); 2152 2154 return 0; 2153 2155 } 2154 2156 ··· 2181 2153 prefetch(&hw->st_le[hw->st_idx]); 2182 2154 if (likely(__netif_rx_schedule_prep(dev0))) 2183 2155 __netif_rx_schedule(dev0); 2184 - else 2185 - printk(KERN_DEBUG PFX "irq race detected\n"); 2186 2156 2187 2157 return IRQ_HANDLED; 2188 2158 } ··· 2219 2193 } 2220 2194 2221 2195 2222 - static int sky2_reset(struct sky2_hw *hw) 2196 + static int __devinit sky2_reset(struct sky2_hw *hw) 2223 2197 { 2224 2198 u16 status; 2225 2199 u8 t8, pmd_type; ··· 3302 3276 3303 3277 sky2_write32(hw, B0_IMSK, Y2_IS_BASE); 3304 3278 3279 + setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev); 3280 + 3305 3281 pci_set_drvdata(pdev, hw); 3306 3282 3307 3283 return 0; ··· 3339 3311 if (!hw) 3340 3312 return; 3341 3313 3314 + del_timer_sync(&hw->idle_timer); 3315 + 3316 + sky2_write32(hw, B0_IMSK, 0); 3342 3317 dev0 = hw->dev[0]; 3343 3318 dev1 = hw->dev[1]; 3344 3319 if (dev1) 3345 3320 unregister_netdev(dev1); 3346 3321 unregister_netdev(dev0); 3347 3322 3348 - sky2_write32(hw, B0_IMSK, 0); 3349 3323 sky2_set_power_state(hw, PCI_D3hot); 3350 3324 sky2_write16(hw, B0_Y2LED, LED_STAT_OFF); 3351 3325 sky2_write8(hw, B0_CTST, CS_RST_SET);
+2
drivers/net/sky2.h
··· 1880 1880 struct sky2_status_le *st_le; 1881 1881 u32 st_idx; 1882 1882 dma_addr_t st_dma; 1883 + 1884 + struct timer_list idle_timer; 1883 1885 int msi_detected; 1884 1886 wait_queue_head_t msi_wait; 1885 1887 };
+8
drivers/net/wireless/bcm43xx/bcm43xx_dma.h
··· 213 213 void bcm43xx_dma_rx(struct bcm43xx_dmaring *ring) 214 214 { 215 215 } 216 + static inline 217 + void bcm43xx_dma_tx_suspend(struct bcm43xx_dmaring *ring) 218 + { 219 + } 220 + static inline 221 + void bcm43xx_dma_tx_resume(struct bcm43xx_dmaring *ring) 222 + { 223 + } 216 224 217 225 #endif /* CONFIG_BCM43XX_DMA */ 218 226 #endif /* BCM43xx_DMA_H_ */
+62 -30
drivers/net/wireless/bcm43xx/bcm43xx_pio.c
··· 27 27 #include "bcm43xx_pio.h" 28 28 #include "bcm43xx_main.h" 29 29 #include "bcm43xx_xmit.h" 30 + #include "bcm43xx_power.h" 30 31 31 32 #include <linux/delay.h> 32 33 ··· 45 44 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 46 45 octet); 47 46 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 48 - BCM43xx_PIO_TXCTL_WRITEHI); 47 + BCM43xx_PIO_TXCTL_WRITELO); 49 48 } else { 50 49 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 51 - BCM43xx_PIO_TXCTL_WRITEHI); 50 + BCM43xx_PIO_TXCTL_WRITELO); 52 51 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 53 52 octet); 54 53 } ··· 104 103 bcm43xx_pio_write(queue, BCM43xx_PIO_TXDATA, 105 104 skb->data[skb->len - 1]); 106 105 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 107 - BCM43xx_PIO_TXCTL_WRITEHI | 106 + BCM43xx_PIO_TXCTL_WRITELO | 108 107 BCM43xx_PIO_TXCTL_COMPLETE); 109 108 } else { 110 109 bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, ··· 113 112 } 114 113 115 114 static u16 generate_cookie(struct bcm43xx_pioqueue *queue, 116 - int packetindex) 115 + struct bcm43xx_pio_txpacket *packet) 117 116 { 118 117 u16 cookie = 0x0000; 118 + int packetindex; 119 119 120 120 /* We use the upper 4 bits for the PIO 121 121 * controller ID and the lower 12 bits ··· 137 135 default: 138 136 assert(0); 139 137 } 138 + packetindex = pio_txpacket_getindex(packet); 140 139 assert(((u16)packetindex & 0xF000) == 0x0000); 141 140 cookie |= (u16)packetindex; 142 141 ··· 187 184 bcm43xx_generate_txhdr(queue->bcm, 188 185 &txhdr, skb->data, skb->len, 189 186 (packet->xmitted_frags == 0), 190 - generate_cookie(queue, pio_txpacket_getindex(packet))); 187 + generate_cookie(queue, packet)); 191 188 192 189 tx_start(queue); 193 190 octets = skb->len + sizeof(txhdr); ··· 244 241 queue->tx_devq_packets++; 245 242 queue->tx_devq_used += octets; 246 243 247 - assert(packet->xmitted_frags <= packet->txb->nr_frags); 244 + assert(packet->xmitted_frags < packet->txb->nr_frags); 248 245 packet->xmitted_frags++; 249 246 packet->xmitted_octets += octets; 250 247 } ··· 260 257 unsigned long flags; 261 258 struct bcm43xx_pio_txpacket *packet, *tmp_packet; 262 259 int err; 260 + u16 txctl; 263 261 264 262 bcm43xx_lock_mmio(bcm, flags); 263 + 264 + txctl = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL); 265 + if (txctl & BCM43xx_PIO_TXCTL_SUSPEND) 266 + goto out_unlock; 267 + 265 268 list_for_each_entry_safe(packet, tmp_packet, &queue->txqueue, list) { 266 269 assert(packet->xmitted_frags < packet->txb->nr_frags); 267 270 if (packet->xmitted_frags == 0) { ··· 297 288 next_packet: 298 289 continue; 299 290 } 291 + out_unlock: 300 292 bcm43xx_unlock_mmio(bcm, flags); 301 293 } 302 294 ··· 340 330 (unsigned long)queue); 341 331 342 332 value = bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); 343 - value |= BCM43xx_SBF_XFER_REG_BYTESWAP; 333 + value &= ~BCM43xx_SBF_XFER_REG_BYTESWAP; 344 334 bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, value); 345 335 346 336 qsize = bcm43xx_read16(bcm, queue->mmio_base + BCM43xx_PIO_TXQBUFSIZE); 337 + if (qsize == 0) { 338 + printk(KERN_ERR PFX "ERROR: This card does not support PIO " 339 + "operation mode. Please use DMA mode " 340 + "(module parameter pio=0).\n"); 341 + goto err_freequeue; 342 + } 347 343 if (qsize <= BCM43xx_PIO_TXQADJUST) { 348 - printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n", qsize); 344 + printk(KERN_ERR PFX "PIO tx device-queue too small (%u)\n", 345 + qsize); 349 346 goto err_freequeue; 350 347 } 351 348 qsize -= BCM43xx_PIO_TXQADJUST; ··· 461 444 { 462 445 struct bcm43xx_pioqueue *queue = bcm43xx_current_pio(bcm)->queue1; 463 446 struct bcm43xx_pio_txpacket *packet; 464 - u16 tmp; 465 447 466 448 assert(!queue->tx_suspended); 467 449 assert(!list_empty(&queue->txfree)); 468 - 469 - tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL); 470 - if (tmp & BCM43xx_PIO_TXCTL_SUSPEND) 471 - return -EBUSY; 472 450 473 451 packet = list_entry(queue->txfree.next, struct bcm43xx_pio_txpacket, list); 474 452 packet->txb = txb; ··· 474 462 assert(queue->nr_txfree < BCM43xx_PIO_MAXTXPACKETS); 475 463 476 464 /* Suspend TX, if we are out of packets in the "free" queue. */ 477 - if (unlikely(list_empty(&queue->txfree))) { 465 + if (list_empty(&queue->txfree)) { 478 466 netif_stop_queue(queue->bcm->net_dev); 479 467 queue->tx_suspended = 1; 480 468 } ··· 492 480 493 481 queue = parse_cookie(bcm, status->cookie, &packet); 494 482 assert(queue); 495 - //TODO 496 - if (!queue) 497 - return; 483 + 498 484 free_txpacket(packet, 1); 499 - if (unlikely(queue->tx_suspended)) { 485 + if (queue->tx_suspended) { 500 486 queue->tx_suspended = 0; 501 487 netif_wake_queue(queue->bcm->net_dev); 502 488 } 503 - /* If there are packets on the txqueue, poke the tasklet. */ 489 + /* If there are packets on the txqueue, poke the tasklet 490 + * to transmit them. 491 + */ 504 492 if (!list_empty(&queue->txqueue)) 505 493 tasklet_schedule(&queue->txtask); 506 494 } ··· 531 519 int i, preamble_readwords; 532 520 struct sk_buff *skb; 533 521 534 - return; 535 522 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXCTL); 536 - if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE)) { 537 - dprintkl(KERN_ERR PFX "PIO RX: No data available\n");//TODO: remove this printk. 523 + if (!(tmp & BCM43xx_PIO_RXCTL_DATAAVAILABLE)) 538 524 return; 539 - } 540 525 bcm43xx_pio_write(queue, BCM43xx_PIO_RXCTL, 541 526 BCM43xx_PIO_RXCTL_DATAAVAILABLE); 542 527 ··· 547 538 return; 548 539 data_ready: 549 540 550 - //FIXME: endianess in this function. 551 - len = le16_to_cpu(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA)); 541 + len = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 552 542 if (unlikely(len > 0x700)) { 553 543 pio_rx_error(queue, 0, "len > 0x700"); 554 544 return; ··· 563 555 preamble_readwords = 18 / sizeof(u16); 564 556 for (i = 0; i < preamble_readwords; i++) { 565 557 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 566 - preamble[i + 1] = cpu_to_be16(tmp);//FIXME? 558 + preamble[i + 1] = cpu_to_le16(tmp); 567 559 } 568 560 rxhdr = (struct bcm43xx_rxhdr *)preamble; 569 561 rxflags2 = le16_to_cpu(rxhdr->flags2); ··· 599 591 } 600 592 skb_put(skb, len); 601 593 for (i = 0; i < len - 1; i += 2) { 602 - tmp = cpu_to_be16(bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA)); 603 - *((u16 *)(skb->data + i)) = tmp; 594 + tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 595 + *((u16 *)(skb->data + i)) = cpu_to_le16(tmp); 604 596 } 605 597 if (len % 2) { 606 598 tmp = bcm43xx_pio_read(queue, BCM43xx_PIO_RXDATA); 607 599 skb->data[len - 1] = (tmp & 0x00FF); 600 + /* The specs say the following is required, but 601 + * it is wrong and corrupts the PLCP. If we don't do 602 + * this, the PLCP seems to be correct. So ifdef it out for now. 603 + */ 604 + #if 0 608 605 if (rxflags2 & BCM43xx_RXHDR_FLAGS2_TYPE2FRAME) 609 - skb->data[0x20] = (tmp & 0xFF00) >> 8; 606 + skb->data[2] = (tmp & 0xFF00) >> 8; 610 607 else 611 - skb->data[0x1E] = (tmp & 0xFF00) >> 8; 608 + skb->data[0] = (tmp & 0xFF00) >> 8; 609 + #endif 612 610 } 611 + skb_trim(skb, len - IEEE80211_FCS_LEN); 613 612 bcm43xx_rx(queue->bcm, skb, rxhdr); 613 + } 614 + 615 + void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue) 616 + { 617 + bcm43xx_power_saving_ctl_bits(queue->bcm, -1, 1); 618 + bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 619 + bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL) 620 + | BCM43xx_PIO_TXCTL_SUSPEND); 621 + } 622 + 623 + void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue) 624 + { 625 + bcm43xx_pio_write(queue, BCM43xx_PIO_TXCTL, 626 + bcm43xx_pio_read(queue, BCM43xx_PIO_TXCTL) 627 + & ~BCM43xx_PIO_TXCTL_SUSPEND); 628 + bcm43xx_power_saving_ctl_bits(queue->bcm, -1, -1); 629 + tasklet_schedule(&queue->txtask); 614 630 }
+14 -2
drivers/net/wireless/bcm43xx/bcm43xx_pio.h
··· 14 14 #define BCM43xx_PIO_RXCTL 0x08 15 15 #define BCM43xx_PIO_RXDATA 0x0A 16 16 17 - #define BCM43xx_PIO_TXCTL_WRITEHI (1 << 0) 18 - #define BCM43xx_PIO_TXCTL_WRITELO (1 << 1) 17 + #define BCM43xx_PIO_TXCTL_WRITELO (1 << 0) 18 + #define BCM43xx_PIO_TXCTL_WRITEHI (1 << 1) 19 19 #define BCM43xx_PIO_TXCTL_COMPLETE (1 << 2) 20 20 #define BCM43xx_PIO_TXCTL_INIT (1 << 3) 21 21 #define BCM43xx_PIO_TXCTL_SUSPEND (1 << 7) ··· 95 95 u16 offset, u16 value) 96 96 { 97 97 bcm43xx_write16(queue->bcm, queue->mmio_base + offset, value); 98 + mmiowb(); 98 99 } 99 100 100 101 ··· 107 106 void bcm43xx_pio_handle_xmitstatus(struct bcm43xx_private *bcm, 108 107 struct bcm43xx_xmitstatus *status); 109 108 void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue); 109 + 110 + void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue); 111 + void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue); 110 112 111 113 #else /* CONFIG_BCM43XX_PIO */ 112 114 ··· 135 131 } 136 132 static inline 137 133 void bcm43xx_pio_rx(struct bcm43xx_pioqueue *queue) 134 + { 135 + } 136 + static inline 137 + void bcm43xx_pio_tx_suspend(struct bcm43xx_pioqueue *queue) 138 + { 139 + } 140 + static inline 141 + void bcm43xx_pio_tx_resume(struct bcm43xx_pioqueue *queue) 138 142 { 139 143 } 140 144
+2 -2
drivers/net/wireless/hostap/hostap_ioctl.c
··· 1860 1860 memset(&iwe, 0, sizeof(iwe)); 1861 1861 iwe.cmd = SIOCGIWFREQ; 1862 1862 if (scan) { 1863 - chan = scan->chid; 1863 + chan = le16_to_cpu(scan->chid); 1864 1864 } else if (bss) { 1865 1865 chan = bss->chan; 1866 1866 } else { ··· 1868 1868 } 1869 1869 1870 1870 if (chan > 0) { 1871 - iwe.u.freq.m = freq_list[le16_to_cpu(chan - 1)] * 100000; 1871 + iwe.u.freq.m = freq_list[chan - 1] * 100000; 1872 1872 iwe.u.freq.e = 1; 1873 1873 current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, 1874 1874 IW_EV_FREQ_LEN);
+1 -1
drivers/parisc/pdc_stable.c
··· 535 535 { 536 536 char *out = buf; 537 537 struct pdcspath_entry *pathentry; 538 - 538 + 539 539 if (!entry || !buf) 540 540 return -EINVAL; 541 541
+31 -12
drivers/parisc/sba_iommu.c
··· 178 178 #define ROPE6_CTL 0x230 179 179 #define ROPE7_CTL 0x238 180 180 181 + #define IOC_ROPE0_CFG 0x500 /* pluto only */ 182 + #define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */ 183 + 184 + 185 + 181 186 #define HF_ENABLE 0x40 182 187 183 188 ··· 1764 1759 1765 1760 sba_dev->num_ioc = num_ioc; 1766 1761 for (i = 0; i < num_ioc; i++) { 1767 - /* 1768 - ** Make sure the box crashes if we get any errors on a rope. 1769 - */ 1770 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE0_CTL); 1771 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE1_CTL); 1772 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE2_CTL); 1773 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE3_CTL); 1774 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE4_CTL); 1775 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE5_CTL); 1776 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE6_CTL); 1777 - WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1762 + unsigned long ioc_hpa = sba_dev->ioc[i].ioc_hpa; 1763 + unsigned int j; 1778 1764 1779 - /* flush out the writes */ 1765 + for (j=0; j < sizeof(u64) * ROPES_PER_IOC; j+=sizeof(u64)) { 1766 + 1767 + /* 1768 + * Clear ROPE(N)_CONFIG AO bit. 1769 + * Disables "NT Ordering" (~= !"Relaxed Ordering") 1770 + * Overrides bit 1 in DMA Hint Sets. 1771 + * Improves netperf UDP_STREAM by ~10% for bcm5701. 1772 + */ 1773 + if (IS_PLUTO(sba_dev->iodc)) { 1774 + unsigned long rope_cfg, cfg_val; 1775 + 1776 + rope_cfg = ioc_hpa + IOC_ROPE0_CFG + j; 1777 + cfg_val = READ_REG(rope_cfg); 1778 + cfg_val &= ~IOC_ROPE_AO; 1779 + WRITE_REG(cfg_val, rope_cfg); 1780 + } 1781 + 1782 + /* 1783 + ** Make sure the box crashes on rope errors. 1784 + */ 1785 + WRITE_REG(HF_ENABLE, ioc_hpa + ROPE0_CTL + j); 1786 + } 1787 + 1788 + /* flush out the last writes */ 1780 1789 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL); 1781 1790 1782 1791 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n",
+2 -2
drivers/parisc/superio.c
··· 155 155 struct pci_dev *pdev = sio->lio_pdev; 156 156 u16 word; 157 157 158 - if (sio->suckyio_irq_enabled) 158 + if (sio->suckyio_irq_enabled) 159 159 return; 160 160 161 161 BUG_ON(!pdev); ··· 194 194 request_region (sio->acpi_base, 0x1f, "acpi"); 195 195 196 196 /* Enable the legacy I/O function */ 197 - pci_read_config_word (pdev, PCI_COMMAND, &word); 197 + pci_read_config_word (pdev, PCI_COMMAND, &word); 198 198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO; 199 199 pci_write_config_word (pdev, PCI_COMMAND, word); 200 200
+1 -1
drivers/pcmcia/Kconfig
··· 250 250 251 251 config PCMCIA_VRC4171 252 252 tristate "NEC VRC4171 Card Controllers support" 253 - depends on VRC4171 && PCMCIA 253 + depends on CPU_VR41XX && ISA && PCMCIA 254 254 255 255 config PCMCIA_VRC4173 256 256 tristate "NEC VRC4173 CARDU support"
+7 -9
drivers/pcmcia/ds.c
··· 236 236 /** 237 237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken 238 238 * @dev - the pcmcia device which needs a CIS override 239 - * @filename - requested filename in /lib/firmware/cis/ 239 + * @filename - requested filename in /lib/firmware/ 240 240 * 241 241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if 242 242 * the one provided by the card is broken. The firmware files reside in 243 - * /lib/firmware/cis/ in userspace. 243 + * /lib/firmware/ in userspace. 244 244 */ 245 245 static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) 246 246 { ··· 298 298 * 299 299 * Registers a PCMCIA driver with the PCMCIA bus core. 300 300 */ 301 - static int pcmcia_device_probe(struct device *dev); 302 - static int pcmcia_device_remove(struct device * dev); 303 - 304 301 int pcmcia_register_driver(struct pcmcia_driver *driver) 305 302 { 306 303 if (!driver) ··· 397 400 * call which will then check whether there are two 398 401 * pseudo devices, and if not, add the second one. 399 402 */ 400 - did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 403 + did = p_dev->dev.driver_data; 401 404 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 402 405 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) 403 406 pcmcia_add_pseudo_device(p_dev->socket); ··· 445 448 return; 446 449 } 447 450 448 - 449 451 static int pcmcia_device_remove(struct device * dev) 450 452 { 451 453 struct pcmcia_device *p_dev; ··· 459 463 * pseudo multi-function card, we need to unbind 460 464 * all devices 461 465 */ 462 - did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 466 + did = p_dev->dev.driver_data; 463 467 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 464 468 (p_dev->socket->device_count != 0) && 465 469 (p_dev->device_no == 0)) ··· 471 475 472 476 if (p_drv->remove) 473 477 p_drv->remove(p_dev); 478 + 479 + p_dev->dev_node = NULL; 474 480 475 481 /* check for proper unloading */ 476 482 if (p_dev->_irq || p_dev->_io || p_dev->_locked) ··· 626 628 } 627 629 628 630 /* Add to the list in pcmcia_bus_socket */ 629 - list_add_tail(&p_dev->socket_device_list, &s->devices_list); 631 + list_add(&p_dev->socket_device_list, &s->devices_list); 630 632 631 633 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); 632 634
+11 -7
drivers/pcmcia/pcmcia_resource.c
··· 88 88 } 89 89 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) { 90 90 *base = s->io_offset | (*base & 0x0fff); 91 - s->io[0].res->flags = (s->io[0].res->flags & ~IORESOURCE_BITS) | (attr & IORESOURCE_BITS); 92 91 return 0; 93 92 } 94 93 /* Check for an already-allocated window that must conflict with ··· 208 209 if (!(s->state & SOCKET_PRESENT)) 209 210 return CS_NO_CARD; 210 211 211 - config->Function = p_dev->func; 212 212 213 213 #ifdef CONFIG_CARDBUS 214 214 if (s->state & SOCKET_CARDBUS) { ··· 221 223 config->AssignedIRQ = s->irq.AssignedIRQ; 222 224 if (config->AssignedIRQ) 223 225 config->Attributes |= CONF_ENABLE_IRQ; 224 - config->BasePort1 = s->io[0].res->start; 225 - config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; 226 + if (s->io[0].res) { 227 + config->BasePort1 = s->io[0].res->start; 228 + config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1; 229 + } 226 230 } 227 231 return CS_SUCCESS; 228 232 } 229 233 #endif 230 234 231 - c = (p_dev) ? p_dev->function_config : NULL; 235 + if (p_dev) { 236 + c = p_dev->function_config; 237 + config->Function = p_dev->func; 238 + } else { 239 + c = NULL; 240 + config->Function = 0; 241 + } 232 242 233 243 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) { 234 244 config->Attributes = 0; ··· 953 947 pcmcia_release_irq(p_dev, &p_dev->irq); 954 948 if (&p_dev->win) 955 949 pcmcia_release_window(p_dev->win); 956 - 957 - p_dev->dev_node = NULL; 958 950 } 959 951 EXPORT_SYMBOL(pcmcia_disable_device);
+1
drivers/usb/gadget/inode.c
··· 1614 1614 data, &ep_config_operations, 1615 1615 &data->dentry); 1616 1616 if (!data->inode) { 1617 + usb_ep_free_request(ep, data->req); 1617 1618 kfree (data); 1618 1619 goto enomem; 1619 1620 }
+5 -1
fs/cifs/CHANGES
··· 1 1 Version 1.42 2 2 ------------ 3 3 Fix slow oplock break when mounted to different servers at the same time and 4 - the tids match and we try to find matching fid on wrong server. 4 + the tids match and we try to find matching fid on wrong server. Fix read 5 + looping when signing required by server (2.6.16 kernel only). Fix readdir 6 + vs. rename race which could cause each to hang. Return . and .. even 7 + if server does not. Allow searches to skip first three entries and 8 + begin at any location. Fix oops in find_writeable_file. 5 9 6 10 Version 1.41 7 11 ------------
+8
fs/cifs/README
··· 511 511 support and want to map the uid and gid fields 512 512 to values supplied at mount (rather than the 513 513 actual values, then set this to zero. (default 1) 514 + Experimental When set to 1 used to enable certain experimental 515 + features (currently enables multipage writes 516 + when signing is enabled, the multipage write 517 + performance enhancement was disabled when 518 + signing turned on in case buffer was modified 519 + just before it was sent, also this flag will 520 + be used to use the new experimental sessionsetup 521 + code). 514 522 515 523 These experimental features and tracing can be enabled by changing flags in 516 524 /proc/fs/cifs (after the cifs module has been installed or built into the
+50 -49
fs/cifs/cifsfs.c
··· 33 33 #include <linux/vfs.h> 34 34 #include <linux/mempool.h> 35 35 #include <linux/delay.h> 36 + #include <linux/kthread.h> 36 37 #include "cifsfs.h" 37 38 #include "cifspdu.h" 38 39 #define DECLARE_GLOBALS_HERE ··· 75 74 unsigned int cifs_max_pending = CIFS_MAX_REQ; 76 75 module_param(cifs_max_pending, int, 0); 77 76 MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); 78 - 79 - static DECLARE_COMPLETION(cifs_oplock_exited); 80 - static DECLARE_COMPLETION(cifs_dnotify_exited); 81 77 82 78 extern mempool_t *cifs_sm_req_poolp; 83 79 extern mempool_t *cifs_req_poolp; ··· 839 841 __u16 netfid; 840 842 int rc; 841 843 842 - daemonize("cifsoplockd"); 843 - allow_signal(SIGTERM); 844 - 845 - oplockThread = current; 846 844 do { 847 845 if (try_to_freeze()) 848 846 continue; ··· 894 900 set_current_state(TASK_INTERRUPTIBLE); 895 901 schedule_timeout(1); /* yield in case q were corrupt */ 896 902 } 897 - } while(!signal_pending(current)); 898 - oplockThread = NULL; 899 - complete_and_exit (&cifs_oplock_exited, 0); 903 + } while (!kthread_should_stop()); 904 + 905 + return 0; 900 906 } 901 907 902 908 static int cifs_dnotify_thread(void * dummyarg) ··· 904 910 struct list_head *tmp; 905 911 struct cifsSesInfo *ses; 906 912 907 - daemonize("cifsdnotifyd"); 908 - allow_signal(SIGTERM); 909 - 910 - dnotifyThread = current; 911 913 do { 912 914 if(try_to_freeze()) 913 915 continue; ··· 921 931 wake_up_all(&ses->server->response_q); 922 932 } 923 933 read_unlock(&GlobalSMBSeslock); 924 - } while(!signal_pending(current)); 925 - complete_and_exit (&cifs_dnotify_exited, 0); 934 + } while (!kthread_should_stop()); 935 + 936 + return 0; 926 937 } 927 938 928 939 static int __init ··· 973 982 } 974 983 975 984 rc = cifs_init_inodecache(); 976 - if (!rc) { 977 - rc = cifs_init_mids(); 978 - if (!rc) { 979 - rc = cifs_init_request_bufs(); 980 - if (!rc) { 981 - rc = register_filesystem(&cifs_fs_type); 982 - if (!rc) { 983 - rc = (int)kernel_thread(cifs_oplock_thread, NULL, 984 - CLONE_FS | CLONE_FILES | CLONE_VM); 985 - if(rc > 0) { 986 - rc = (int)kernel_thread(cifs_dnotify_thread, NULL, 987 - CLONE_FS | CLONE_FILES | CLONE_VM); 988 - if(rc > 0) 989 - return 0; 990 - else 991 - cERROR(1,("error %d create dnotify thread", rc)); 992 - } else { 993 - cERROR(1,("error %d create oplock thread",rc)); 994 - } 995 - } 996 - cifs_destroy_request_bufs(); 997 - } 998 - cifs_destroy_mids(); 999 - } 1000 - cifs_destroy_inodecache(); 985 + if (rc) 986 + goto out_clean_proc; 987 + 988 + rc = cifs_init_mids(); 989 + if (rc) 990 + goto out_destroy_inodecache; 991 + 992 + rc = cifs_init_request_bufs(); 993 + if (rc) 994 + goto out_destroy_mids; 995 + 996 + rc = register_filesystem(&cifs_fs_type); 997 + if (rc) 998 + goto out_destroy_request_bufs; 999 + 1000 + oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); 1001 + if (IS_ERR(oplockThread)) { 1002 + rc = PTR_ERR(oplockThread); 1003 + cERROR(1,("error %d create oplock thread", rc)); 1004 + goto out_unregister_filesystem; 1001 1005 } 1006 + 1007 + dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); 1008 + if (IS_ERR(dnotifyThread)) { 1009 + rc = PTR_ERR(dnotifyThread); 1010 + cERROR(1,("error %d create dnotify thread", rc)); 1011 + goto out_stop_oplock_thread; 1012 + } 1013 + 1014 + return 0; 1015 + 1016 + out_stop_oplock_thread: 1017 + kthread_stop(oplockThread); 1018 + out_unregister_filesystem: 1019 + unregister_filesystem(&cifs_fs_type); 1020 + out_destroy_request_bufs: 1021 + cifs_destroy_request_bufs(); 1022 + out_destroy_mids: 1023 + cifs_destroy_mids(); 1024 + out_destroy_inodecache: 1025 + cifs_destroy_inodecache(); 1026 + out_clean_proc: 1002 1027 #ifdef CONFIG_PROC_FS 1003 1028 cifs_proc_clean(); 1004 1029 #endif ··· 1032 1025 cifs_destroy_inodecache(); 1033 1026 cifs_destroy_mids(); 1034 1027 cifs_destroy_request_bufs(); 1035 - if(oplockThread) { 1036 - send_sig(SIGTERM, oplockThread, 1); 1037 - wait_for_completion(&cifs_oplock_exited); 1038 - } 1039 - if(dnotifyThread) { 1040 - send_sig(SIGTERM, dnotifyThread, 1); 1041 - wait_for_completion(&cifs_dnotify_exited); 1042 - } 1028 + kthread_stop(oplockThread); 1029 + kthread_stop(dnotifyThread); 1043 1030 } 1044 1031 1045 1032 MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
+1 -1
fs/cifs/cifssmb.c
··· 3119 3119 psrch_inf->endOfSearch = FALSE; 3120 3120 3121 3121 psrch_inf->entries_in_buffer = le16_to_cpu(parms->SearchCount); 3122 - psrch_inf->index_of_last_entry = 3122 + psrch_inf->index_of_last_entry = 2 /* skip . and .. */ + 3123 3123 psrch_inf->entries_in_buffer; 3124 3124 *pnetfid = parms->SearchHandle; 3125 3125 } else {
+6
fs/cifs/connect.c
··· 3447 3447 pSesInfo->server->secMode, 3448 3448 pSesInfo->server->capabilities, 3449 3449 pSesInfo->server->timeZone)); 3450 + #ifdef CONFIG_CIFS_EXPERIMENTAL 3451 + if(experimEnabled > 1) 3452 + rc = CIFS_SessSetup(xid, pSesInfo, CIFS_NTLM /* type */, 3453 + &ntlmv2_flag, nls_info); 3454 + else 3455 + #endif 3450 3456 if (extended_security 3451 3457 && (pSesInfo->capabilities & CAP_EXTENDED_SECURITY) 3452 3458 && (pSesInfo->server->secType == NTLMSSP)) {
+14 -4
fs/cifs/dir.c
··· 139 139 cifs_sb = CIFS_SB(inode->i_sb); 140 140 pTcon = cifs_sb->tcon; 141 141 142 - mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); 143 142 full_path = build_path_from_dentry(direntry); 144 - mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); 145 143 if(full_path == NULL) { 146 144 FreeXid(xid); 147 145 return -ENOMEM; ··· 314 316 cifs_sb = CIFS_SB(inode->i_sb); 315 317 pTcon = cifs_sb->tcon; 316 318 317 - mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); 318 319 full_path = build_path_from_dentry(direntry); 319 - mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); 320 320 if(full_path == NULL) 321 321 rc = -ENOMEM; 322 322 else if (pTcon->ses->capabilities & CAP_UNIX) { ··· 435 439 436 440 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 437 441 pTcon = cifs_sb->tcon; 442 + 443 + /* 444 + * Don't allow the separator character in a path component. 445 + * The VFS will not allow "/", but "\" is allowed by posix. 446 + */ 447 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { 448 + int i; 449 + for (i = 0; i < direntry->d_name.len; i++) 450 + if (direntry->d_name.name[i] == '\\') { 451 + cFYI(1, ("Invalid file name")); 452 + FreeXid(xid); 453 + return ERR_PTR(-EINVAL); 454 + } 455 + } 438 456 439 457 /* can not grab the rename sem here since it would 440 458 deadlock in the cases (beginning of sys_rename itself)
-2
fs/cifs/fcntl.c
··· 86 86 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 87 87 pTcon = cifs_sb->tcon; 88 88 89 - mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex); 90 89 full_path = build_path_from_dentry(file->f_dentry); 91 - mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex); 92 90 93 91 if(full_path == NULL) { 94 92 rc = -ENOMEM;
+20 -14
fs/cifs/file.c
··· 203 203 } 204 204 } 205 205 206 - mutex_lock(&inode->i_sb->s_vfs_rename_mutex); 207 206 full_path = build_path_from_dentry(file->f_dentry); 208 - mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); 209 207 if (full_path == NULL) { 210 208 FreeXid(xid); 211 209 return -ENOMEM; ··· 904 906 if (rc != 0) 905 907 break; 906 908 } 907 - /* BB FIXME We can not sign across two buffers yet */ 908 - if((pTcon->ses->server->secMode & 909 + if(experimEnabled || (pTcon->ses->server->secMode & 909 910 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { 910 911 struct kvec iov[2]; 911 912 unsigned int len; ··· 920 923 *poffset, &bytes_written, 921 924 iov, 1, long_op); 922 925 } else 923 - /* BB FIXME fixup indentation of line below */ 924 - rc = CIFSSMBWrite(xid, pTcon, 925 - open_file->netfid, 926 - min_t(const int, cifs_sb->wsize, 927 - write_size - total_written), 928 - *poffset, &bytes_written, 929 - write_data + total_written, NULL, long_op); 926 + rc = CIFSSMBWrite(xid, pTcon, 927 + open_file->netfid, 928 + min_t(const int, cifs_sb->wsize, 929 + write_size - total_written), 930 + *poffset, &bytes_written, 931 + write_data + total_written, 932 + NULL, long_op); 930 933 } 931 934 if (rc || (bytes_written == 0)) { 932 935 if (total_written) ··· 964 967 { 965 968 struct cifsFileInfo *open_file; 966 969 int rc; 970 + 971 + /* Having a null inode here (because mapping->host was set to zero by 972 + the VFS or MM) should not happen but we had reports of on oops (due to 973 + it being zero) during stress testcases so we need to check for it */ 974 + 975 + if(cifs_inode == NULL) { 976 + cERROR(1,("Null inode passed to cifs_writeable_file")); 977 + dump_stack(); 978 + return NULL; 979 + } 967 980 968 981 read_lock(&GlobalSMBSeslock); 969 982 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { ··· 1100 1093 if (cifs_sb->wsize < PAGE_CACHE_SIZE) 1101 1094 return generic_writepages(mapping, wbc); 1102 1095 1103 - /* BB FIXME we do not have code to sign across multiple buffers yet, 1104 - so go to older writepage style write which we can sign if needed */ 1105 1096 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) 1106 1097 if(cifs_sb->tcon->ses->server->secMode & 1107 1098 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 1108 - return generic_writepages(mapping, wbc); 1099 + if(!experimEnabled) 1100 + return generic_writepages(mapping, wbc); 1109 1101 1110 1102 /* 1111 1103 * BB: Is this meaningful for a non-block-device file system?
-6
fs/cifs/inode.c
··· 722 722 cifs_sb = CIFS_SB(inode->i_sb); 723 723 pTcon = cifs_sb->tcon; 724 724 725 - mutex_lock(&inode->i_sb->s_vfs_rename_mutex); 726 725 full_path = build_path_from_dentry(direntry); 727 - mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); 728 726 if (full_path == NULL) { 729 727 FreeXid(xid); 730 728 return -ENOMEM; ··· 805 807 cifs_sb = CIFS_SB(inode->i_sb); 806 808 pTcon = cifs_sb->tcon; 807 809 808 - mutex_lock(&inode->i_sb->s_vfs_rename_mutex); 809 810 full_path = build_path_from_dentry(direntry); 810 - mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); 811 811 if (full_path == NULL) { 812 812 FreeXid(xid); 813 813 return -ENOMEM; ··· 1137 1141 rc = 0; 1138 1142 } 1139 1143 1140 - mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); 1141 1144 full_path = build_path_from_dentry(direntry); 1142 - mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); 1143 1145 if (full_path == NULL) { 1144 1146 FreeXid(xid); 1145 1147 return -ENOMEM;
-6
fs/cifs/link.c
··· 48 48 /* No need to check for cross device links since server will do that 49 49 BB note DFS case in future though (when we may have to check) */ 50 50 51 - mutex_lock(&inode->i_sb->s_vfs_rename_mutex); 52 51 fromName = build_path_from_dentry(old_file); 53 52 toName = build_path_from_dentry(direntry); 54 - mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); 55 53 if((fromName == NULL) || (toName == NULL)) { 56 54 rc = -ENOMEM; 57 55 goto cifs_hl_exit; ··· 101 103 102 104 xid = GetXid(); 103 105 104 - mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); 105 106 full_path = build_path_from_dentry(direntry); 106 - mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); 107 107 108 108 if (!full_path) 109 109 goto out_no_free; ··· 160 164 cifs_sb = CIFS_SB(inode->i_sb); 161 165 pTcon = cifs_sb->tcon; 162 166 163 - mutex_lock(&inode->i_sb->s_vfs_rename_mutex); 164 167 full_path = build_path_from_dentry(direntry); 165 - mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); 166 168 167 169 if(full_path == NULL) { 168 170 FreeXid(xid);
+14
fs/cifs/ntlmssp.c
··· 121 121 } 122 122 123 123 124 + /* copy session key */ 125 + 126 + /* if Unicode, align strings to two byte boundary */ 127 + 128 + /* copy user name */ /* BB Do we need to special case null user name? */ 129 + 130 + /* copy domain name */ 131 + 132 + /* copy Linux version */ 133 + 134 + /* copy network operating system name */ 135 + 136 + /* update bcc and smb buffer length */ 137 + 124 138 /* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */ 125 139 /* SMB request buf freed in SendReceive2 */ 126 140
+22 -23
fs/cifs/readdir.c
··· 404 404 if(pTcon == NULL) 405 405 return -EINVAL; 406 406 407 - mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex); 408 407 full_path = build_path_from_dentry(file->f_dentry); 409 - mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex); 410 408 411 409 if(full_path == NULL) { 412 410 return -ENOMEM; ··· 590 592 first_entry_in_buffer = 591 593 cifsFile->srch_inf.index_of_last_entry - 592 594 cifsFile->srch_inf.entries_in_buffer; 595 + 596 + /* if first entry in buf is zero then is first buffer 597 + in search response data which means it is likely . and .. 598 + will be in this buffer, although some servers do not return 599 + . and .. for the root of a drive and for those we need 600 + to start two entries earlier */ 601 + 593 602 /* dump_cifs_file_struct(file, "In fce ");*/ 594 603 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) && 595 604 is_dir_changed(file)) || ··· 639 634 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + 640 635 smbCalcSize((struct smb_hdr *) 641 636 cifsFile->srch_inf.ntwrk_buf_start); 637 + 638 + current_entry = cifsFile->srch_inf.srch_entries_start; 642 639 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry 643 640 - cifsFile->srch_inf.entries_in_buffer; 644 641 pos_in_buf = index_to_find - first_entry_in_buffer; 645 642 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); 646 - current_entry = cifsFile->srch_inf.srch_entries_start; 647 643 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { 648 644 /* go entry by entry figuring out which is first */ 649 - /* if( . or ..) 650 - skip */ 651 - rc = cifs_entry_is_dot(current_entry,cifsFile); 652 - if(rc == 1) /* is . or .. so skip */ { 653 - cFYI(1,("Entry is .")); /* BB removeme BB */ 654 - /* continue; */ 655 - } else if (rc == 2 ) { 656 - cFYI(1,("Entry is ..")); /* BB removeme BB */ 657 - /* continue; */ 658 - } 659 645 current_entry = nxt_dir_entry(current_entry,end_of_smb); 660 646 } 661 647 if((current_entry == NULL) && (i < pos_in_buf)) { ··· 765 769 766 770 if(file->f_dentry == NULL) 767 771 return -ENOENT; 772 + 773 + rc = cifs_entry_is_dot(pfindEntry,pCifsF); 774 + /* skip . and .. since we added them first */ 775 + if(rc != 0) 776 + return 0; 768 777 769 778 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 770 779 ··· 899 898 900 899 switch ((int) file->f_pos) { 901 900 case 0: 902 - /*if (filldir(direntry, ".", 1, file->f_pos, 901 + if (filldir(direntry, ".", 1, file->f_pos, 903 902 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) { 904 - cERROR(1, ("Filldir for current dir failed ")); 903 + cERROR(1, ("Filldir for current dir failed")); 905 904 rc = -ENOMEM; 906 905 break; 907 906 } 908 - file->f_pos++; */ 907 + file->f_pos++; 909 908 case 1: 910 - /* if (filldir(direntry, "..", 2, file->f_pos, 909 + if (filldir(direntry, "..", 2, file->f_pos, 911 910 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) { 912 911 cERROR(1, ("Filldir for parent dir failed ")); 913 912 rc = -ENOMEM; 914 913 break; 915 914 } 916 - file->f_pos++; */ 917 - case 2: 915 + file->f_pos++; 916 + default: 918 917 /* 1) If search is active, 919 918 is in current search buffer? 920 919 if it before then restart search ··· 928 927 return rc; 929 928 } 930 929 } 931 - default: 932 930 if(file->private_data == NULL) { 933 931 rc = -EINVAL; 934 932 FreeXid(xid); ··· 946 946 } 947 947 kfree(cifsFile->search_resume_name); 948 948 cifsFile->search_resume_name = NULL; */ 949 - 950 - /* BB account for . and .. in f_pos as special case */ 951 949 952 950 rc = find_cifs_entry(xid,pTcon, file, 953 951 &current_entry,&num_to_fill); ··· 975 977 num_to_fill, i)); 976 978 break; 977 979 } 978 - 980 + /* if buggy server returns . and .. late do 981 + we want to check for that here? */ 979 982 rc = cifs_filldir(current_entry, file, 980 983 filldir, direntry,tmp_buf); 981 984 file->f_pos++;
-8
fs/cifs/xattr.c
··· 62 62 cifs_sb = CIFS_SB(sb); 63 63 pTcon = cifs_sb->tcon; 64 64 65 - mutex_lock(&sb->s_vfs_rename_mutex); 66 65 full_path = build_path_from_dentry(direntry); 67 - mutex_unlock(&sb->s_vfs_rename_mutex); 68 66 if(full_path == NULL) { 69 67 FreeXid(xid); 70 68 return -ENOMEM; ··· 114 116 cifs_sb = CIFS_SB(sb); 115 117 pTcon = cifs_sb->tcon; 116 118 117 - mutex_lock(&sb->s_vfs_rename_mutex); 118 119 full_path = build_path_from_dentry(direntry); 119 - mutex_unlock(&sb->s_vfs_rename_mutex); 120 120 if(full_path == NULL) { 121 121 FreeXid(xid); 122 122 return -ENOMEM; ··· 219 223 cifs_sb = CIFS_SB(sb); 220 224 pTcon = cifs_sb->tcon; 221 225 222 - mutex_lock(&sb->s_vfs_rename_mutex); 223 226 full_path = build_path_from_dentry(direntry); 224 - mutex_unlock(&sb->s_vfs_rename_mutex); 225 227 if(full_path == NULL) { 226 228 FreeXid(xid); 227 229 return -ENOMEM; ··· 335 341 cifs_sb = CIFS_SB(sb); 336 342 pTcon = cifs_sb->tcon; 337 343 338 - mutex_lock(&sb->s_vfs_rename_mutex); 339 344 full_path = build_path_from_dentry(direntry); 340 - mutex_unlock(&sb->s_vfs_rename_mutex); 341 345 if(full_path == NULL) { 342 346 FreeXid(xid); 343 347 return -ENOMEM;
+4
fs/compat.c
··· 1217 1217 if (ret < 0) 1218 1218 goto out; 1219 1219 1220 + ret = security_file_permission(file, type == READ ? MAY_READ:MAY_WRITE); 1221 + if (ret) 1222 + goto out; 1223 + 1220 1224 fnv = NULL; 1221 1225 if (type == READ) { 1222 1226 fn = file->f_op->read;
+14 -4
fs/ext3/ioctl.c
··· 48 48 if (!S_ISDIR(inode->i_mode)) 49 49 flags &= ~EXT3_DIRSYNC_FL; 50 50 51 + mutex_lock(&inode->i_mutex); 51 52 oldflags = ei->i_flags; 52 53 53 54 /* The JOURNAL_DATA flag is modifiable only by root */ ··· 61 60 * This test looks nicer. Thanks to Pauline Middelink 62 61 */ 63 62 if ((flags ^ oldflags) & (EXT3_APPEND_FL | EXT3_IMMUTABLE_FL)) { 64 - if (!capable(CAP_LINUX_IMMUTABLE)) 63 + if (!capable(CAP_LINUX_IMMUTABLE)) { 64 + mutex_unlock(&inode->i_mutex); 65 65 return -EPERM; 66 + } 66 67 } 67 68 68 69 /* ··· 72 69 * the relevant capability. 73 70 */ 74 71 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) { 75 - if (!capable(CAP_SYS_RESOURCE)) 72 + if (!capable(CAP_SYS_RESOURCE)) { 73 + mutex_unlock(&inode->i_mutex); 76 74 return -EPERM; 75 + } 77 76 } 78 77 79 78 80 79 handle = ext3_journal_start(inode, 1); 81 - if (IS_ERR(handle)) 80 + if (IS_ERR(handle)) { 81 + mutex_unlock(&inode->i_mutex); 82 82 return PTR_ERR(handle); 83 + } 83 84 if (IS_SYNC(inode)) 84 85 handle->h_sync = 1; 85 86 err = ext3_reserve_inode_write(handle, inode, &iloc); ··· 100 93 err = ext3_mark_iloc_dirty(handle, inode, &iloc); 101 94 flags_err: 102 95 ext3_journal_stop(handle); 103 - if (err) 96 + if (err) { 97 + mutex_unlock(&inode->i_mutex); 104 98 return err; 99 + } 105 100 106 101 if ((jflag ^ oldflags) & (EXT3_JOURNAL_DATA_FL)) 107 102 err = ext3_change_inode_journal_flag(inode, jflag); 103 + mutex_unlock(&inode->i_mutex); 108 104 return err; 109 105 } 110 106 case EXT3_IOC_GETVERSION:
+1 -1
fs/ext3/resize.c
··· 213 213 goto exit_bh; 214 214 } 215 215 lock_buffer(bh); 216 - memcpy(gdb->b_data, sbi->s_group_desc[i], bh->b_size); 216 + memcpy(gdb->b_data, sbi->s_group_desc[i]->b_data, bh->b_size); 217 217 set_buffer_uptodate(gdb); 218 218 unlock_buffer(bh); 219 219 ext3_journal_dirty_metadata(handle, gdb);
+20 -15
fs/fuse/dev.c
··· 128 128 } 129 129 } 130 130 131 - void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req) 131 + /* 132 + * Called with sbput_sem held for read (request_end) or write 133 + * (fuse_put_super). By the time fuse_put_super() is finished, all 134 + * inodes belonging to background requests must be released, so the 135 + * iputs have to be done within the locked region. 136 + */ 137 + void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req) 132 138 { 133 - list_del_init(&req->bg_entry); 139 + iput(req->inode); 140 + iput(req->inode2); 141 + spin_lock(&fc->lock); 142 + list_del(&req->bg_entry); 134 143 if (fc->num_background == FUSE_MAX_BACKGROUND) { 135 144 fc->blocked = 0; 136 145 wake_up_all(&fc->blocked_waitq); 137 146 } 138 147 fc->num_background--; 148 + spin_unlock(&fc->lock); 139 149 } 140 150 141 151 /* ··· 175 165 wake_up(&req->waitq); 176 166 fuse_put_request(fc, req); 177 167 } else { 178 - struct inode *inode = req->inode; 179 - struct inode *inode2 = req->inode2; 180 - struct file *file = req->file; 181 168 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; 182 169 req->end = NULL; 183 - req->inode = NULL; 184 - req->inode2 = NULL; 185 - req->file = NULL; 186 - if (!list_empty(&req->bg_entry)) 187 - fuse_remove_background(fc, req); 188 170 spin_unlock(&fc->lock); 171 + down_read(&fc->sbput_sem); 172 + if (fc->mounted) 173 + fuse_release_background(fc, req); 174 + up_read(&fc->sbput_sem); 175 + 176 + /* fput must go outside sbput_sem, otherwise it can deadlock */ 177 + if (req->file) 178 + fput(req->file); 189 179 190 180 if (end) 191 181 end(fc, req); 192 182 else 193 183 fuse_put_request(fc, req); 194 - 195 - if (file) 196 - fput(file); 197 - iput(inode); 198 - iput(inode2); 199 184 } 200 185 } 201 186
+9 -3
fs/fuse/fuse_i.h
··· 258 258 /** waitq for blocked connection */ 259 259 wait_queue_head_t blocked_waitq; 260 260 261 + /** RW semaphore for exclusion with fuse_put_super() */ 262 + struct rw_semaphore sbput_sem; 263 + 261 264 /** The next unique request id */ 262 265 u64 reqctr; 266 + 267 + /** Mount is active */ 268 + unsigned mounted; 263 269 264 270 /** Connection established, cleared on umount, connection 265 271 abort and device release */ ··· 477 471 void request_send_background(struct fuse_conn *fc, struct fuse_req *req); 478 472 479 473 /** 480 - * Remove request from the the background list 474 + * Release inodes and file associated with background request 481 475 */ 482 - void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req); 476 + void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req); 483 477 484 - /** Abort all requests */ 478 + /* Abort all requests */ 485 479 void fuse_abort_conn(struct fuse_conn *fc); 486 480 487 481 /**
+18 -22
fs/fuse/inode.c
··· 204 204 { 205 205 struct fuse_conn *fc = get_fuse_conn_super(sb); 206 206 207 + down_write(&fc->sbput_sem); 208 + while (!list_empty(&fc->background)) 209 + fuse_release_background(fc, 210 + list_entry(fc->background.next, 211 + struct fuse_req, bg_entry)); 212 + 207 213 spin_lock(&fc->lock); 214 + fc->mounted = 0; 208 215 fc->connected = 0; 209 - while (!list_empty(&fc->background)) { 210 - struct fuse_req *req = list_entry(fc->background.next, 211 - struct fuse_req, bg_entry); 212 - struct inode *inode = req->inode; 213 - struct inode *inode2 = req->inode2; 214 - 215 - /* File would hold a reference to vfsmount */ 216 - BUG_ON(req->file); 217 - req->inode = NULL; 218 - req->inode2 = NULL; 219 - fuse_remove_background(fc, req); 220 - 221 - spin_unlock(&fc->lock); 222 - iput(inode); 223 - iput(inode2); 224 - spin_lock(&fc->lock); 225 - } 226 216 spin_unlock(&fc->lock); 217 + up_write(&fc->sbput_sem); 227 218 /* Flush all readers on this fs */ 228 219 kill_fasync(&fc->fasync, SIGIO, POLL_IN); 229 220 wake_up_all(&fc->waitq); ··· 386 395 INIT_LIST_HEAD(&fc->processing); 387 396 INIT_LIST_HEAD(&fc->io); 388 397 INIT_LIST_HEAD(&fc->background); 398 + init_rwsem(&fc->sbput_sem); 389 399 kobj_set_kset_s(fc, connections_subsys); 390 400 kobject_init(&fc->kobj); 391 401 atomic_set(&fc->num_waiting, 0); ··· 500 508 if (file->f_op != &fuse_dev_operations) 501 509 return -EINVAL; 502 510 503 - /* Setting file->private_data can't race with other mount() 504 - instances, since BKL is held for ->get_sb() */ 505 - if (file->private_data) 506 - return -EINVAL; 507 - 508 511 fc = new_conn(); 509 512 if (!fc) 510 513 return -ENOMEM; ··· 535 548 if (err) 536 549 goto err_free_req; 537 550 551 + /* Setting file->private_data can't race with other mount() 552 + instances, since BKL is held for ->get_sb() */ 553 + err = -EINVAL; 554 + if (file->private_data) 555 + goto err_kobject_del; 556 + 538 557 sb->s_root = root_dentry; 558 + fc->mounted = 1; 539 559 fc->connected = 1; 540 560 kobject_get(&fc->kobj); 541 561 file->private_data = fc; ··· 557 563 558 564 return 0; 559 565 566 + err_kobject_del: 567 + kobject_del(&fc->kobj); 560 568 err_free_req: 561 569 fuse_request_free(init_req); 562 570 err_put_root:
+3 -2
fs/reiserfs/xattr_acl.c
··· 408 408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT); 409 409 reiserfs_read_unlock_xattrs(inode->i_sb); 410 410 reiserfs_read_unlock_xattr_i(inode); 411 - ret = acl ? 1 : 0; 412 - posix_acl_release(acl); 411 + ret = (acl && !IS_ERR(acl)); 412 + if (ret) 413 + posix_acl_release(acl); 413 414 } 414 415 415 416 return ret;
+282 -73
fs/splice.c
··· 27 27 #include <linux/buffer_head.h> 28 28 #include <linux/module.h> 29 29 #include <linux/syscalls.h> 30 + #include <linux/uio.h> 31 + 32 + struct partial_page { 33 + unsigned int offset; 34 + unsigned int len; 35 + }; 30 36 31 37 /* 32 - * Passed to the actors 38 + * Passed to splice_to_pipe 33 39 */ 34 - struct splice_desc { 35 - unsigned int len, total_len; /* current and remaining length */ 40 + struct splice_pipe_desc { 41 + struct page **pages; /* page map */ 42 + struct partial_page *partial; /* pages[] may not be contig */ 43 + int nr_pages; /* number of pages in map */ 36 44 unsigned int flags; /* splice flags */ 37 - struct file *file; /* file to read/write */ 38 - loff_t pos; /* file position */ 45 + struct pipe_buf_operations *ops;/* ops associated with output pipe */ 39 46 }; 40 47 41 48 /* ··· 135 128 kunmap(buf->page); 136 129 } 137 130 131 + static void *user_page_pipe_buf_map(struct file *file, 132 + struct pipe_inode_info *pipe, 133 + struct pipe_buffer *buf) 134 + { 135 + return kmap(buf->page); 136 + } 137 + 138 + static void user_page_pipe_buf_unmap(struct pipe_inode_info *pipe, 139 + struct pipe_buffer *buf) 140 + { 141 + kunmap(buf->page); 142 + } 143 + 138 144 static void page_cache_pipe_buf_get(struct pipe_inode_info *info, 139 145 struct pipe_buffer *buf) 140 146 { ··· 163 143 .get = page_cache_pipe_buf_get, 164 144 }; 165 145 146 + static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe, 147 + struct pipe_buffer *buf) 148 + { 149 + return 1; 150 + } 151 + 152 + static struct pipe_buf_operations user_page_pipe_buf_ops = { 153 + .can_merge = 0, 154 + .map = user_page_pipe_buf_map, 155 + .unmap = user_page_pipe_buf_unmap, 156 + .release = page_cache_pipe_buf_release, 157 + .steal = user_page_pipe_buf_steal, 158 + .get = page_cache_pipe_buf_get, 159 + }; 160 + 166 161 /* 167 162 * Pipe output worker. This sets up our pipe format with the page cache 168 163 * pipe buffer operations. Otherwise very similar to the regular pipe_writev(). 169 164 */ 170 - static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages, 171 - int nr_pages, unsigned long len, 172 - unsigned int offset, unsigned int flags) 165 + static ssize_t splice_to_pipe(struct pipe_inode_info *pipe, 166 + struct splice_pipe_desc *spd) 173 167 { 174 - int ret, do_wakeup, i; 168 + int ret, do_wakeup, page_nr; 175 169 176 170 ret = 0; 177 171 do_wakeup = 0; 178 - i = 0; 172 + page_nr = 0; 179 173 180 174 if (pipe->inode) 181 175 mutex_lock(&pipe->inode->i_mutex); ··· 205 171 if (pipe->nrbufs < PIPE_BUFFERS) { 206 172 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1); 207 173 struct pipe_buffer *buf = pipe->bufs + newbuf; 208 - struct page *page = pages[i++]; 209 - unsigned long this_len; 210 174 211 - this_len = PAGE_CACHE_SIZE - offset; 212 - if (this_len > len) 213 - this_len = len; 214 - 215 - buf->page = page; 216 - buf->offset = offset; 217 - buf->len = this_len; 218 - buf->ops = &page_cache_pipe_buf_ops; 175 + buf->page = spd->pages[page_nr]; 176 + buf->offset = spd->partial[page_nr].offset; 177 + buf->len = spd->partial[page_nr].len; 178 + buf->ops = spd->ops; 219 179 pipe->nrbufs++; 180 + page_nr++; 181 + ret += buf->len; 182 + 220 183 if (pipe->inode) 221 184 do_wakeup = 1; 222 185 223 - ret += this_len; 224 - len -= this_len; 225 - offset = 0; 226 - if (!--nr_pages) 227 - break; 228 - if (!len) 186 + if (!--spd->nr_pages) 229 187 break; 230 188 if (pipe->nrbufs < PIPE_BUFFERS) 231 189 continue; ··· 225 199 break; 226 200 } 227 201 228 - if (flags & SPLICE_F_NONBLOCK) { 202 + if (spd->flags & SPLICE_F_NONBLOCK) { 229 203 if (!ret) 230 204 ret = -EAGAIN; 231 205 break; ··· 260 234 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 261 235 } 262 236 263 - while (i < nr_pages) 264 - page_cache_release(pages[i++]); 237 + while (page_nr < spd->nr_pages) 238 + page_cache_release(spd->pages[page_nr++]); 265 239 266 240 return ret; 267 241 } ··· 272 246 unsigned int flags) 273 247 { 274 248 struct address_space *mapping = in->f_mapping; 275 - unsigned int loff, offset, nr_pages; 249 + unsigned int loff, nr_pages; 276 250 struct page *pages[PIPE_BUFFERS]; 251 + struct partial_page partial[PIPE_BUFFERS]; 277 252 struct page *page; 278 253 pgoff_t index, end_index; 279 254 loff_t isize; 280 - size_t bytes; 281 - int i, error; 255 + size_t total_len; 256 + int error; 257 + struct splice_pipe_desc spd = { 258 + .pages = pages, 259 + .partial = partial, 260 + .flags = flags, 261 + .ops = &page_cache_pipe_buf_ops, 262 + }; 282 263 283 264 index = *ppos >> PAGE_CACHE_SHIFT; 284 - loff = offset = *ppos & ~PAGE_CACHE_MASK; 285 - nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 265 + loff = *ppos & ~PAGE_CACHE_MASK; 266 + nr_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 286 267 287 268 if (nr_pages > PIPE_BUFFERS) 288 269 nr_pages = PIPE_BUFFERS; ··· 299 266 * read-ahead if this is a non-zero offset (we are likely doing small 300 267 * chunk splice and the page is already there) for a single page. 301 268 */ 302 - if (!offset || nr_pages > 1) 303 - do_page_cache_readahead(mapping, in, index, nr_pages); 269 + if (!loff || spd.nr_pages > 1) 270 + do_page_cache_readahead(mapping, in, index, spd.nr_pages); 304 271 305 272 /* 306 273 * Now fill in the holes: 307 274 */ 308 275 error = 0; 309 - bytes = 0; 310 - for (i = 0; i < nr_pages; i++, index++) { 276 + total_len = 0; 277 + for (spd.nr_pages = 0; spd.nr_pages < nr_pages; spd.nr_pages++, index++) { 311 278 unsigned int this_len; 312 279 313 280 if (!len) ··· 316 283 /* 317 284 * this_len is the max we'll use from this page 318 285 */ 319 - this_len = min(len, PAGE_CACHE_SIZE - loff); 286 + this_len = min_t(unsigned long, len, PAGE_CACHE_SIZE - loff); 320 287 find_page: 321 288 /* 322 289 * lookup the page for this index ··· 400 367 */ 401 368 if (end_index == index) { 402 369 loff = PAGE_CACHE_SIZE - (isize & ~PAGE_CACHE_MASK); 403 - if (bytes + loff > isize) { 370 + if (total_len + loff > isize) { 404 371 page_cache_release(page); 405 372 break; 406 373 } 407 374 /* 408 375 * force quit after adding this page 409 376 */ 410 - nr_pages = i; 377 + nr_pages = spd.nr_pages; 411 378 this_len = min(this_len, loff); 379 + loff = 0; 412 380 } 413 381 } 414 382 fill_it: 415 - pages[i] = page; 416 - bytes += this_len; 383 + pages[spd.nr_pages] = page; 384 + partial[spd.nr_pages].offset = loff; 385 + partial[spd.nr_pages].len = this_len; 417 386 len -= this_len; 387 + total_len += this_len; 418 388 loff = 0; 419 389 } 420 390 421 - if (i) 422 - return move_to_pipe(pipe, pages, i, bytes, offset, flags); 391 + if (spd.nr_pages) 392 + return splice_to_pipe(pipe, &spd); 423 393 424 394 return error; 425 395 } ··· 475 439 476 440 /* 477 441 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos' 478 - * using sendpage(). 442 + * using sendpage(). Return the number of bytes sent. 479 443 */ 480 444 static int pipe_to_sendpage(struct pipe_inode_info *info, 481 445 struct pipe_buffer *buf, struct splice_desc *sd) 482 446 { 483 447 struct file *file = sd->file; 484 448 loff_t pos = sd->pos; 485 - unsigned int offset; 486 449 ssize_t ret; 487 450 void *ptr; 488 451 int more; ··· 496 461 if (IS_ERR(ptr)) 497 462 return PTR_ERR(ptr); 498 463 499 - offset = pos & ~PAGE_CACHE_MASK; 500 464 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; 501 465 502 - ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more); 466 + ret = file->f_op->sendpage(file, buf->page, buf->offset, sd->len, 467 + &pos, more); 503 468 504 469 buf->ops->unmap(info, buf); 505 - if (ret == sd->len) 506 - return 0; 507 - 508 - return -EIO; 470 + return ret; 509 471 } 510 472 511 473 /* ··· 531 499 struct file *file = sd->file; 532 500 struct address_space *mapping = file->f_mapping; 533 501 gfp_t gfp_mask = mapping_gfp_mask(mapping); 534 - unsigned int offset; 502 + unsigned int offset, this_len; 535 503 struct page *page; 536 504 pgoff_t index; 537 505 char *src; ··· 546 514 547 515 index = sd->pos >> PAGE_CACHE_SHIFT; 548 516 offset = sd->pos & ~PAGE_CACHE_MASK; 517 + 518 + this_len = sd->len; 519 + if (this_len + offset > PAGE_CACHE_SIZE) 520 + this_len = PAGE_CACHE_SIZE - offset; 549 521 550 522 /* 551 523 * Reuse buf page, if SPLICE_F_MOVE is set. ··· 594 558 * the full page. 595 559 */ 596 560 if (!PageUptodate(page)) { 597 - if (sd->len < PAGE_CACHE_SIZE) { 561 + if (this_len < PAGE_CACHE_SIZE) { 598 562 ret = mapping->a_ops->readpage(file, page); 599 563 if (unlikely(ret)) 600 564 goto out; ··· 618 582 } 619 583 } 620 584 621 - ret = mapping->a_ops->prepare_write(file, page, 0, sd->len); 585 + ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len); 622 586 if (ret == AOP_TRUNCATED_PAGE) { 623 587 page_cache_release(page); 624 588 goto find_page; ··· 628 592 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) { 629 593 char *dst = kmap_atomic(page, KM_USER0); 630 594 631 - memcpy(dst + offset, src + buf->offset, sd->len); 595 + memcpy(dst + offset, src + buf->offset, this_len); 632 596 flush_dcache_page(page); 633 597 kunmap_atomic(dst, KM_USER0); 634 598 } 635 599 636 - ret = mapping->a_ops->commit_write(file, page, 0, sd->len); 600 + ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len); 637 601 if (ret == AOP_TRUNCATED_PAGE) { 638 602 page_cache_release(page); 639 603 goto find_page; 640 604 } else if (ret) 641 605 goto out; 642 606 607 + /* 608 + * Return the number of bytes written. 609 + */ 610 + ret = this_len; 643 611 mark_page_accessed(page); 644 612 balance_dirty_pages_ratelimited(mapping); 645 613 out: ··· 656 616 return ret; 657 617 } 658 618 659 - typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, 660 - struct splice_desc *); 661 - 662 619 /* 663 620 * Pipe input worker. Most of this logic works like a regular pipe, the 664 621 * key here is the 'actor' worker passed in that actually moves the data 665 622 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above. 666 623 */ 667 - static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out, 668 - loff_t *ppos, size_t len, unsigned int flags, 669 - splice_actor *actor) 624 + ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out, 625 + loff_t *ppos, size_t len, unsigned int flags, 626 + splice_actor *actor) 670 627 { 671 628 int ret, do_wakeup, err; 672 629 struct splice_desc sd; ··· 689 652 sd.len = sd.total_len; 690 653 691 654 err = actor(pipe, buf, &sd); 692 - if (err) { 655 + if (err <= 0) { 693 656 if (!ret && err != -ENODATA) 694 657 ret = err; 695 658 696 659 break; 697 660 } 698 661 699 - ret += sd.len; 700 - buf->offset += sd.len; 701 - buf->len -= sd.len; 662 + ret += err; 663 + buf->offset += err; 664 + buf->len -= err; 665 + 666 + sd.len -= err; 667 + sd.pos += err; 668 + sd.total_len -= err; 669 + if (sd.len) 670 + continue; 702 671 703 672 if (!buf->len) { 704 673 buf->ops = NULL; ··· 715 672 do_wakeup = 1; 716 673 } 717 674 718 - sd.pos += sd.len; 719 - sd.total_len -= sd.len; 720 675 if (!sd.total_len) 721 676 break; 722 677 } ··· 782 741 struct address_space *mapping = out->f_mapping; 783 742 ssize_t ret; 784 743 785 - ret = move_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 744 + ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file); 786 745 if (ret > 0) { 787 746 struct inode *inode = mapping->host; 788 747 ··· 824 783 ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out, 825 784 loff_t *ppos, size_t len, unsigned int flags) 826 785 { 827 - return move_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage); 786 + return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage); 828 787 } 829 788 830 789 EXPORT_SYMBOL(generic_splice_sendpage); ··· 911 870 912 871 /* 913 872 * We don't have an immediate reader, but we'll read the stuff 914 - * out of the pipe right after the move_to_pipe(). So set 873 + * out of the pipe right after the splice_to_pipe(). So set 915 874 * PIPE_READERS appropriately. 916 875 */ 917 876 pipe->readers = 1; ··· 1049 1008 } 1050 1009 1051 1010 return -EINVAL; 1011 + } 1012 + 1013 + /* 1014 + * Map an iov into an array of pages and offset/length tupples. With the 1015 + * partial_page structure, we can map several non-contiguous ranges into 1016 + * our ones pages[] map instead of splitting that operation into pieces. 1017 + * Could easily be exported as a generic helper for other users, in which 1018 + * case one would probably want to add a 'max_nr_pages' parameter as well. 1019 + */ 1020 + static int get_iovec_page_array(const struct iovec __user *iov, 1021 + unsigned int nr_vecs, struct page **pages, 1022 + struct partial_page *partial) 1023 + { 1024 + int buffers = 0, error = 0; 1025 + 1026 + /* 1027 + * It's ok to take the mmap_sem for reading, even 1028 + * across a "get_user()". 1029 + */ 1030 + down_read(&current->mm->mmap_sem); 1031 + 1032 + while (nr_vecs) { 1033 + unsigned long off, npages; 1034 + void __user *base; 1035 + size_t len; 1036 + int i; 1037 + 1038 + /* 1039 + * Get user address base and length for this iovec. 1040 + */ 1041 + error = get_user(base, &iov->iov_base); 1042 + if (unlikely(error)) 1043 + break; 1044 + error = get_user(len, &iov->iov_len); 1045 + if (unlikely(error)) 1046 + break; 1047 + 1048 + /* 1049 + * Sanity check this iovec. 0 read succeeds. 1050 + */ 1051 + if (unlikely(!len)) 1052 + break; 1053 + error = -EFAULT; 1054 + if (unlikely(!base)) 1055 + break; 1056 + 1057 + /* 1058 + * Get this base offset and number of pages, then map 1059 + * in the user pages. 1060 + */ 1061 + off = (unsigned long) base & ~PAGE_MASK; 1062 + npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT; 1063 + if (npages > PIPE_BUFFERS - buffers) 1064 + npages = PIPE_BUFFERS - buffers; 1065 + 1066 + error = get_user_pages(current, current->mm, 1067 + (unsigned long) base, npages, 0, 0, 1068 + &pages[buffers], NULL); 1069 + 1070 + if (unlikely(error <= 0)) 1071 + break; 1072 + 1073 + /* 1074 + * Fill this contiguous range into the partial page map. 1075 + */ 1076 + for (i = 0; i < error; i++) { 1077 + const int plen = min_t(size_t, len, PAGE_SIZE) - off; 1078 + 1079 + partial[buffers].offset = off; 1080 + partial[buffers].len = plen; 1081 + 1082 + off = 0; 1083 + len -= plen; 1084 + buffers++; 1085 + } 1086 + 1087 + /* 1088 + * We didn't complete this iov, stop here since it probably 1089 + * means we have to move some of this into a pipe to 1090 + * be able to continue. 1091 + */ 1092 + if (len) 1093 + break; 1094 + 1095 + /* 1096 + * Don't continue if we mapped fewer pages than we asked for, 1097 + * or if we mapped the max number of pages that we have 1098 + * room for. 1099 + */ 1100 + if (error < npages || buffers == PIPE_BUFFERS) 1101 + break; 1102 + 1103 + nr_vecs--; 1104 + iov++; 1105 + } 1106 + 1107 + up_read(&current->mm->mmap_sem); 1108 + 1109 + if (buffers) 1110 + return buffers; 1111 + 1112 + return error; 1113 + } 1114 + 1115 + /* 1116 + * vmsplice splices a user address range into a pipe. It can be thought of 1117 + * as splice-from-memory, where the regular splice is splice-from-file (or 1118 + * to file). In both cases the output is a pipe, naturally. 1119 + * 1120 + * Note that vmsplice only supports splicing _from_ user memory to a pipe, 1121 + * not the other way around. Splicing from user memory is a simple operation 1122 + * that can be supported without any funky alignment restrictions or nasty 1123 + * vm tricks. We simply map in the user memory and fill them into a pipe. 1124 + * The reverse isn't quite as easy, though. There are two possible solutions 1125 + * for that: 1126 + * 1127 + * - memcpy() the data internally, at which point we might as well just 1128 + * do a regular read() on the buffer anyway. 1129 + * - Lots of nasty vm tricks, that are neither fast nor flexible (it 1130 + * has restriction limitations on both ends of the pipe). 1131 + * 1132 + * Alas, it isn't here. 1133 + * 1134 + */ 1135 + static long do_vmsplice(struct file *file, const struct iovec __user *iov, 1136 + unsigned long nr_segs, unsigned int flags) 1137 + { 1138 + struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe; 1139 + struct page *pages[PIPE_BUFFERS]; 1140 + struct partial_page partial[PIPE_BUFFERS]; 1141 + struct splice_pipe_desc spd = { 1142 + .pages = pages, 1143 + .partial = partial, 1144 + .flags = flags, 1145 + .ops = &user_page_pipe_buf_ops, 1146 + }; 1147 + 1148 + if (unlikely(!pipe)) 1149 + return -EBADF; 1150 + if (unlikely(nr_segs > UIO_MAXIOV)) 1151 + return -EINVAL; 1152 + else if (unlikely(!nr_segs)) 1153 + return 0; 1154 + 1155 + spd.nr_pages = get_iovec_page_array(iov, nr_segs, pages, partial); 1156 + if (spd.nr_pages <= 0) 1157 + return spd.nr_pages; 1158 + 1159 + return splice_to_pipe(pipe, &spd); 1160 + } 1161 + 1162 + asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, 1163 + unsigned long nr_segs, unsigned int flags) 1164 + { 1165 + struct file *file; 1166 + long error; 1167 + int fput; 1168 + 1169 + error = -EBADF; 1170 + file = fget_light(fd, &fput); 1171 + if (file) { 1172 + if (file->f_mode & FMODE_WRITE) 1173 + error = do_vmsplice(file, iov, nr_segs, flags); 1174 + 1175 + fput_light(file, fput); 1176 + } 1177 + 1178 + return error; 1052 1179 } 1053 1180 1054 1181 asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
+2 -1
include/asm-i386/unistd.h
··· 321 321 #define __NR_splice 313 322 322 #define __NR_sync_file_range 314 323 323 #define __NR_tee 315 324 + #define __NR_vmsplice 316 324 325 325 - #define NR_syscalls 316 326 + #define NR_syscalls 317 326 327 327 328 /* 328 329 * user-visible error numbers are in the range -1 - -128: see
+2 -1
include/asm-ia64/unistd.h
··· 290 290 #define __NR_get_robust_list 1299 291 291 #define __NR_sync_file_range 1300 292 292 #define __NR_tee 1301 293 + #define __NR_vmsplice 1302 293 294 294 295 #ifdef __KERNEL__ 295 296 296 297 #include <linux/config.h> 297 298 298 - #define NR_syscalls 278 /* length of syscall table */ 299 + #define NR_syscalls 279 /* length of syscall table */ 299 300 300 301 #define __ARCH_WANT_SYS_RT_SIGACTION 301 302
+5 -12
include/asm-parisc/io.h
··· 126 126 127 127 extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); 128 128 129 + /* Most machines react poorly to I/O-space being cacheable... Instead let's 130 + * define ioremap() in terms of ioremap_nocache(). 131 + */ 129 132 extern inline void __iomem * ioremap(unsigned long offset, unsigned long size) 130 133 { 131 - return __ioremap(offset, size, 0); 134 + return __ioremap(offset, size, _PAGE_NO_CACHE); 132 135 } 133 - 134 - /* 135 - * This one maps high address device memory and turns off caching for that area. 136 - * it's useful if some control registers are in such an area and write combining 137 - * or read caching is not desirable: 138 - */ 139 - extern inline void * ioremap_nocache(unsigned long offset, unsigned long size) 140 - { 141 - return __ioremap(offset, size, _PAGE_NO_CACHE /* _PAGE_PCD */); 142 - } 136 + #define ioremap_nocache(off, sz) ioremap((off), (sz)) 143 137 144 138 extern void iounmap(void __iomem *addr); 145 - 146 139 147 140 static inline unsigned char __raw_readb(const volatile void __iomem *addr) 148 141 {
+21 -4
include/asm-parisc/page.h
··· 1 1 #ifndef _PARISC_PAGE_H 2 2 #define _PARISC_PAGE_H 3 3 4 - /* PAGE_SHIFT determines the page size */ 5 - #define PAGE_SHIFT 12 6 - #define PAGE_SIZE (1UL << PAGE_SHIFT) 7 - #define PAGE_MASK (~(PAGE_SIZE-1)) 4 + #if !defined(__KERNEL__) 5 + /* this is for userspace applications (4k page size) */ 6 + # define PAGE_SHIFT 12 /* 4k */ 7 + # define PAGE_SIZE (1UL << PAGE_SHIFT) 8 + # define PAGE_MASK (~(PAGE_SIZE-1)) 9 + #endif 10 + 8 11 9 12 #ifdef __KERNEL__ 10 13 #include <linux/config.h> 14 + 15 + #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) 16 + # define PAGE_SHIFT 12 /* 4k */ 17 + #elif defined(CONFIG_PARISC_PAGE_SIZE_16KB) 18 + # define PAGE_SHIFT 14 /* 16k */ 19 + #elif defined(CONFIG_PARISC_PAGE_SIZE_64KB) 20 + # define PAGE_SHIFT 16 /* 64k */ 21 + #else 22 + # error "unknown default kernel page size" 23 + #endif 24 + #define PAGE_SIZE (1UL << PAGE_SHIFT) 25 + #define PAGE_MASK (~(PAGE_SIZE-1)) 26 + 27 + 11 28 #ifndef __ASSEMBLY__ 12 29 13 30 #include <asm/types.h>
+44 -19
include/asm-parisc/pgtable.h
··· 59 59 #define ISTACK_SIZE 32768 /* Interrupt Stack Size */ 60 60 #define ISTACK_ORDER 3 61 61 62 - /* This is the size of the initially mapped kernel memory (i.e. currently 63 - * 0 to 1<<23 == 8MB */ 62 + /* This is the size of the initially mapped kernel memory */ 64 63 #ifdef CONFIG_64BIT 65 - #define KERNEL_INITIAL_ORDER 24 64 + #define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ 66 65 #else 67 - #define KERNEL_INITIAL_ORDER 23 66 + #define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */ 68 67 #endif 69 68 #define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) 70 69 71 - #ifdef CONFIG_64BIT 70 + #if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) 72 71 #define PT_NLEVELS 3 73 72 #define PGD_ORDER 1 /* Number of pages per pgd */ 74 73 #define PMD_ORDER 1 /* Number of pages per pmd */ ··· 110 111 #define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) 111 112 #define MAX_ADDRESS (1UL << MAX_ADDRBITS) 112 113 113 - #define SPACEID_SHIFT (MAX_ADDRBITS - 32) 114 + #define SPACEID_SHIFT (MAX_ADDRBITS - 32) 114 115 115 116 /* This calculates the number of initial pages we need for the initial 116 117 * page tables */ 117 - #define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) 118 + #if (KERNEL_INITIAL_ORDER) >= (PMD_SHIFT) 119 + # define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT)) 120 + #else 121 + # define PT_INITIAL (1) /* all initial PTEs fit into one page */ 122 + #endif 118 123 119 124 /* 120 125 * pgd entries used up by user/kernel: ··· 163 160 * to zero */ 164 161 #define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT) 165 162 163 + /* PFN_PTE_SHIFT defines the shift of a PTE value to access the PFN field */ 164 + #define PFN_PTE_SHIFT 12 165 + 166 + 166 167 /* this is how many bits may be used by the file functions */ 167 168 #define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT) 168 169 ··· 195 188 /* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds 196 189 * are page-aligned, we don't care about the PAGE_OFFSET bits, except 197 190 * for a few meta-information bits, so we shift the address to be 198 - * able to effectively address 40-bits of physical address space. */ 191 + * able to effectively address 40/42/44-bits of physical address space 192 + * depending on 4k/16k/64k PAGE_SIZE */ 199 193 #define _PxD_PRESENT_BIT 31 200 194 #define _PxD_ATTACHED_BIT 30 201 195 #define _PxD_VALID_BIT 29 ··· 206 198 #define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT)) 207 199 #define PxD_FLAG_MASK (0xf) 208 200 #define PxD_FLAG_SHIFT (4) 209 - #define PxD_VALUE_SHIFT (8) 201 + #define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */ 210 202 211 203 #ifndef __ASSEMBLY__ 212 204 ··· 254 246 #define __S110 PAGE_RWX 255 247 #define __S111 PAGE_RWX 256 248 249 + 257 250 extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */ 258 251 259 252 /* initial page tables for 0-8MB for kernel */ ··· 281 272 #define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK) 282 273 #define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT) 283 274 284 - #ifdef CONFIG_64BIT 275 + #if PT_NLEVELS == 3 285 276 /* The first entry of the permanent pmd is not there if it contains 286 277 * the gateway marker */ 287 278 #define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED) ··· 291 282 #define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID)) 292 283 #define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT) 293 284 static inline void pmd_clear(pmd_t *pmd) { 294 - #ifdef CONFIG_64BIT 285 + #if PT_NLEVELS == 3 295 286 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 296 287 /* This is the entry pointing to the permanent pmd 297 288 * attached to the pgd; cannot clear it */ ··· 312 303 #define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID)) 313 304 #define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT) 314 305 static inline void pgd_clear(pgd_t *pgd) { 315 - #ifdef CONFIG_64BIT 306 + #if PT_NLEVELS == 3 316 307 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED) 317 308 /* This is the permanent pmd attached to the pgd; cannot 318 309 * free it */ ··· 360 351 ({ \ 361 352 pte_t __pte; \ 362 353 \ 363 - pte_val(__pte) = ((addr)+pgprot_val(pgprot)); \ 354 + pte_val(__pte) = ((((addr)>>PAGE_SHIFT)<<PFN_PTE_SHIFT) + pgprot_val(pgprot)); \ 364 355 \ 365 356 __pte; \ 366 357 }) ··· 370 361 static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) 371 362 { 372 363 pte_t pte; 373 - pte_val(pte) = (pfn << PAGE_SHIFT) | pgprot_val(pgprot); 364 + pte_val(pte) = (pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot); 374 365 return pte; 375 366 } 376 - 377 - /* This takes a physical page address that is used by the remapping functions */ 378 - #define mk_pte_phys(physpage, pgprot) \ 379 - ({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; }) 380 367 381 368 extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 382 369 { pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; } 383 370 384 371 /* Permanent address of a page. On parisc we don't have highmem. */ 385 372 386 - #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) 373 + #define pte_pfn(x) (pte_val(x) >> PFN_PTE_SHIFT) 387 374 388 375 #define pte_page(pte) (pfn_to_page(pte_pfn(pte))) 389 376 ··· 503 498 #define pte_same(A,B) (pte_val(A) == pte_val(B)) 504 499 505 500 #endif /* !__ASSEMBLY__ */ 501 + 502 + 503 + /* TLB page size encoding - see table 3-1 in parisc20.pdf */ 504 + #define _PAGE_SIZE_ENCODING_4K 0 505 + #define _PAGE_SIZE_ENCODING_16K 1 506 + #define _PAGE_SIZE_ENCODING_64K 2 507 + #define _PAGE_SIZE_ENCODING_256K 3 508 + #define _PAGE_SIZE_ENCODING_1M 4 509 + #define _PAGE_SIZE_ENCODING_4M 5 510 + #define _PAGE_SIZE_ENCODING_16M 6 511 + #define _PAGE_SIZE_ENCODING_64M 7 512 + 513 + #if defined(CONFIG_PARISC_PAGE_SIZE_4KB) 514 + # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K 515 + #elif defined(CONFIG_PARISC_PAGE_SIZE_16KB) 516 + # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K 517 + #elif defined(CONFIG_PARISC_PAGE_SIZE_64KB) 518 + # define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K 519 + #endif 520 + 506 521 507 522 #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ 508 523 remap_pfn_range(vma, vaddr, pfn, size, prot)
+7 -1
include/asm-parisc/unistd.h
··· 780 780 #define __NR_readlinkat (__NR_Linux + 285) 781 781 #define __NR_fchmodat (__NR_Linux + 286) 782 782 #define __NR_faccessat (__NR_Linux + 287) 783 + #define __NR_unshare (__NR_Linux + 288) 784 + #define __NR_set_robust_list (__NR_Linux + 289) 785 + #define __NR_get_robust_list (__NR_Linux + 290) 786 + #define __NR_splice (__NR_Linux + 291) 787 + #define __NR_sync_file_range (__NR_Linux + 292) 788 + #define __NR_tee (__NR_Linux + 293) 783 789 784 - #define __NR_Linux_syscalls 288 790 + #define __NR_Linux_syscalls 294 785 791 786 792 #define HPUX_GATEWAY_ADDR 0xC0000004 787 793 #define LINUX_GATEWAY_ADDR 0x100
+4 -3
include/asm-powerpc/iommu.h
··· 70 70 extern struct iommu_table *iommu_init_table(struct iommu_table * tbl); 71 71 72 72 extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl, 73 - struct scatterlist *sglist, int nelems, 73 + struct scatterlist *sglist, int nelems, unsigned long mask, 74 74 enum dma_data_direction direction); 75 75 extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, 76 76 int nelems, enum dma_data_direction direction); 77 77 78 78 extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 79 - dma_addr_t *dma_handle, gfp_t flag); 79 + dma_addr_t *dma_handle, unsigned long mask, gfp_t flag); 80 80 extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 81 81 void *vaddr, dma_addr_t dma_handle); 82 82 extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 83 - size_t size, enum dma_data_direction direction); 83 + size_t size, unsigned long mask, 84 + enum dma_data_direction direction); 84 85 extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 85 86 size_t size, enum dma_data_direction direction); 86 87
+5 -1
include/asm-powerpc/machdep.h
··· 253 253 254 254 #define __machine_desc __attribute__ ((__section__ (".machine.desc"))) 255 255 256 - #define define_machine(name) struct machdep_calls mach_##name __machine_desc = 256 + #define define_machine(name) \ 257 + extern struct machdep_calls mach_##name; \ 258 + EXPORT_SYMBOL(mach_##name); \ 259 + struct machdep_calls mach_##name __machine_desc = 260 + 257 261 #define machine_is(name) \ 258 262 ({ \ 259 263 extern struct machdep_calls mach_##name \
+2 -1
include/asm-powerpc/unistd.h
··· 303 303 #define __NR_unshare 282 304 304 #define __NR_splice 283 305 305 #define __NR_tee 284 306 + #define __NR_vmsplice 285 306 307 307 - #define __NR_syscalls 285 308 + #define __NR_syscalls 286 308 309 309 310 #ifdef __KERNEL__ 310 311 #define __NR__exit __NR_exit
+1 -1
include/asm-sparc/unistd.h
··· 271 271 #define __NR_getsid 252 272 272 #define __NR_fdatasync 253 273 273 #define __NR_nfsservctl 254 274 - #define __NR_sys_sync_file_range 255 274 + #define __NR_sync_file_range 255 275 275 #define __NR_clock_settime 256 276 276 #define __NR_clock_gettime 257 277 277 #define __NR_clock_getres 258
+1 -1
include/asm-sparc64/unistd.h
··· 273 273 #define __NR_getsid 252 274 274 #define __NR_fdatasync 253 275 275 #define __NR_nfsservctl 254 276 - #define __NR_sys_sync_file_range 255 276 + #define __NR_sync_file_range 255 277 277 #define __NR_clock_settime 256 278 278 #define __NR_clock_gettime 257 279 279 #define __NR_clock_getres 258
+3 -1
include/asm-x86_64/unistd.h
··· 615 615 __SYSCALL(__NR_tee, sys_tee) 616 616 #define __NR_sync_file_range 277 617 617 __SYSCALL(__NR_sync_file_range, sys_sync_file_range) 618 + #define __NR_vmsplice 278 619 + __SYSCALL(__NR_vmsplice, sys_vmsplice) 618 620 619 - #define __NR_syscall_max __NR_sync_file_range 621 + #define __NR_syscall_max __NR_vmsplice 620 622 621 623 #ifndef __NO_STUBS 622 624
+10 -8
include/linux/netdevice.h
··· 829 829 __netif_rx_schedule(dev); 830 830 } 831 831 832 - /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). 833 - * Do not inline this? 834 - */ 832 + 833 + static inline void __netif_rx_reschedule(struct net_device *dev, int undo) 834 + { 835 + dev->quota += undo; 836 + list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); 837 + __raise_softirq_irqoff(NET_RX_SOFTIRQ); 838 + } 839 + 840 + /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ 835 841 static inline int netif_rx_reschedule(struct net_device *dev, int undo) 836 842 { 837 843 if (netif_rx_schedule_prep(dev)) { 838 844 unsigned long flags; 839 - 840 - dev->quota += undo; 841 - 842 845 local_irq_save(flags); 843 - list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); 844 - __raise_softirq_irqoff(NET_RX_SOFTIRQ); 846 + __netif_rx_reschedule(dev, undo); 845 847 local_irq_restore(flags); 846 848 return 1; 847 849 }
+4
include/linux/netfilter/x_tables.h
··· 361 361 362 362 struct compat_xt_counters 363 363 { 364 + #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) 364 365 u_int32_t cnt[4]; 366 + #else 367 + u_int64_t cnt[2]; 368 + #endif 365 369 }; 366 370 367 371 struct compat_xt_counters_info
+17
include/linux/pipe_fs_i.h
··· 61 61 /* from/to, of course */ 62 62 #define SPLICE_F_MORE (0x04) /* expect more data */ 63 63 64 + /* 65 + * Passed to the actors 66 + */ 67 + struct splice_desc { 68 + unsigned int len, total_len; /* current and remaining length */ 69 + unsigned int flags; /* splice flags */ 70 + struct file *file; /* file to read/write */ 71 + loff_t pos; /* file position */ 72 + }; 73 + 74 + typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *, 75 + struct splice_desc *); 76 + 77 + extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, 78 + loff_t *, size_t, unsigned int, 79 + splice_actor *); 80 + 64 81 #endif
+3
include/linux/syscalls.h
··· 574 574 int fd_out, loff_t __user *off_out, 575 575 size_t len, unsigned int flags); 576 576 577 + asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov, 578 + unsigned long nr_segs, unsigned int flags); 579 + 577 580 asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); 578 581 579 582 asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
+4 -1
include/net/ieee80211softmac.h
··· 96 96 * 97 97 * bssvalid is true if we found a matching network 98 98 * and saved it's BSSID into the bssid above. 99 + * 100 + * bssfixed is used for SIOCSIWAP. 99 101 */ 100 102 u8 static_essid:1, 101 103 associating:1, 102 - bssvalid:1; 104 + bssvalid:1, 105 + bssfixed:1; 103 106 104 107 /* Scan retries remaining */ 105 108 int scan_retry;
+2 -2
kernel/hrtimer.c
··· 836 836 } 837 837 #endif /* CONFIG_HOTPLUG_CPU */ 838 838 839 - static int __devinit hrtimer_cpu_notify(struct notifier_block *self, 839 + static int hrtimer_cpu_notify(struct notifier_block *self, 840 840 unsigned long action, void *hcpu) 841 841 { 842 842 long cpu = (long)hcpu; ··· 860 860 return NOTIFY_OK; 861 861 } 862 862 863 - static struct notifier_block __devinitdata hrtimers_nb = { 863 + static struct notifier_block hrtimers_nb = { 864 864 .notifier_call = hrtimer_cpu_notify, 865 865 }; 866 866
+1 -1
kernel/profile.c
··· 299 299 } 300 300 301 301 #ifdef CONFIG_HOTPLUG_CPU 302 - static int __devinit profile_cpu_callback(struct notifier_block *info, 302 + static int profile_cpu_callback(struct notifier_block *info, 303 303 unsigned long action, void *__cpu) 304 304 { 305 305 int node, cpu = (unsigned long)__cpu;
+2 -2
kernel/rcupdate.c
··· 520 520 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL); 521 521 } 522 522 523 - static int __devinit rcu_cpu_notify(struct notifier_block *self, 523 + static int rcu_cpu_notify(struct notifier_block *self, 524 524 unsigned long action, void *hcpu) 525 525 { 526 526 long cpu = (long)hcpu; ··· 537 537 return NOTIFY_OK; 538 538 } 539 539 540 - static struct notifier_block __devinitdata rcu_nb = { 540 + static struct notifier_block rcu_nb = { 541 541 .notifier_call = rcu_cpu_notify, 542 542 }; 543 543
+1 -1
kernel/sched.c
··· 4814 4814 /* Register at highest priority so that task migration (migrate_all_tasks) 4815 4815 * happens before everything else. 4816 4816 */ 4817 - static struct notifier_block __devinitdata migration_notifier = { 4817 + static struct notifier_block migration_notifier = { 4818 4818 .notifier_call = migration_call, 4819 4819 .priority = 10 4820 4820 };
+2 -2
kernel/softirq.c
··· 446 446 } 447 447 #endif /* CONFIG_HOTPLUG_CPU */ 448 448 449 - static int __devinit cpu_callback(struct notifier_block *nfb, 449 + static int cpu_callback(struct notifier_block *nfb, 450 450 unsigned long action, 451 451 void *hcpu) 452 452 { ··· 484 484 return NOTIFY_OK; 485 485 } 486 486 487 - static struct notifier_block __devinitdata cpu_nfb = { 487 + static struct notifier_block cpu_nfb = { 488 488 .notifier_call = cpu_callback 489 489 }; 490 490
+2 -2
kernel/softlockup.c
··· 104 104 /* 105 105 * Create/destroy watchdog threads as CPUs come and go: 106 106 */ 107 - static int __devinit 107 + static int 108 108 cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 109 109 { 110 110 int hotcpu = (unsigned long)hcpu; ··· 140 140 return NOTIFY_OK; 141 141 } 142 142 143 - static struct notifier_block __devinitdata cpu_nfb = { 143 + static struct notifier_block cpu_nfb = { 144 144 .notifier_call = cpu_callback 145 145 }; 146 146
+2 -2
kernel/timer.c
··· 1314 1314 } 1315 1315 #endif /* CONFIG_HOTPLUG_CPU */ 1316 1316 1317 - static int __devinit timer_cpu_notify(struct notifier_block *self, 1317 + static int timer_cpu_notify(struct notifier_block *self, 1318 1318 unsigned long action, void *hcpu) 1319 1319 { 1320 1320 long cpu = (long)hcpu; ··· 1334 1334 return NOTIFY_OK; 1335 1335 } 1336 1336 1337 - static struct notifier_block __devinitdata timers_nb = { 1337 + static struct notifier_block timers_nb = { 1338 1338 .notifier_call = timer_cpu_notify, 1339 1339 }; 1340 1340
+1 -1
kernel/workqueue.c
··· 547 547 } 548 548 549 549 /* We're holding the cpucontrol mutex here */ 550 - static int __devinit workqueue_cpu_callback(struct notifier_block *nfb, 550 + static int workqueue_cpu_callback(struct notifier_block *nfb, 551 551 unsigned long action, 552 552 void *hcpu) 553 553 {
+1 -1
mm/page_alloc.c
··· 1962 1962 } 1963 1963 } 1964 1964 1965 - static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb, 1965 + static int pageset_cpuup_callback(struct notifier_block *nfb, 1966 1966 unsigned long action, 1967 1967 void *hcpu) 1968 1968 {
+3
mm/shmem.c
··· 46 46 #include <linux/mempolicy.h> 47 47 #include <linux/namei.h> 48 48 #include <linux/ctype.h> 49 + #include <linux/migrate.h> 50 + 49 51 #include <asm/uaccess.h> 50 52 #include <asm/div64.h> 51 53 #include <asm/pgtable.h> ··· 2175 2173 .prepare_write = shmem_prepare_write, 2176 2174 .commit_write = simple_commit_write, 2177 2175 #endif 2176 + .migratepage = migrate_page, 2178 2177 }; 2179 2178 2180 2179 static struct file_operations shmem_file_operations = {
+1 -1
mm/slab.c
··· 1036 1036 1037 1037 #endif 1038 1038 1039 - static int __devinit cpuup_callback(struct notifier_block *nfb, 1039 + static int cpuup_callback(struct notifier_block *nfb, 1040 1040 unsigned long action, void *hcpu) 1041 1041 { 1042 1042 long cpu = (long)hcpu;
+1 -1
mm/vmscan.c
··· 1328 1328 not required for correctness. So if the last cpu in a node goes 1329 1329 away, we get changed to run anywhere: as the first one comes back, 1330 1330 restore their cpu bindings. */ 1331 - static int __devinit cpu_callback(struct notifier_block *nfb, 1331 + static int cpu_callback(struct notifier_block *nfb, 1332 1332 unsigned long action, void *hcpu) 1333 1333 { 1334 1334 pg_data_t *pgdat;
+7 -1
net/bridge/br_forward.c
··· 16 16 #include <linux/kernel.h> 17 17 #include <linux/netdevice.h> 18 18 #include <linux/skbuff.h> 19 + #include <linux/if_vlan.h> 19 20 #include <linux/netfilter_bridge.h> 20 21 #include "br_private.h" 21 22 ··· 30 29 return 1; 31 30 } 32 31 32 + static inline unsigned packet_length(const struct sk_buff *skb) 33 + { 34 + return skb->len - (skb->protocol == htons(ETH_P_8021Q) ? VLAN_HLEN : 0); 35 + } 36 + 33 37 int br_dev_queue_push_xmit(struct sk_buff *skb) 34 38 { 35 39 /* drop mtu oversized packets except tso */ 36 - if (skb->len > skb->dev->mtu && !skb_shinfo(skb)->tso_size) 40 + if (packet_length(skb) > skb->dev->mtu && !skb_shinfo(skb)->tso_size) 37 41 kfree_skb(skb); 38 42 else { 39 43 #ifdef CONFIG_BRIDGE_NETFILTER
+16 -4
net/ieee80211/softmac/ieee80211softmac_assoc.c
··· 144 144 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len)) 145 145 return 0; 146 146 147 + /* assume that users know what they're doing ... 148 + * (note we don't let them select a net we're incompatible with) */ 149 + if (mac->associnfo.bssfixed) { 150 + return !memcmp(mac->associnfo.bssid, net->bssid, ETH_ALEN); 151 + } 152 + 147 153 /* if 'ANY' network requested, take any that doesn't have privacy enabled */ 148 154 if (mac->associnfo.req_essid.len == 0 149 155 && !(net->capability & WLAN_CAPABILITY_PRIVACY)) ··· 182 176 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT); 183 177 184 178 /* try to find the requested network in our list, if we found one already */ 185 - if (mac->associnfo.bssvalid) 179 + if (mac->associnfo.bssvalid || mac->associnfo.bssfixed) 186 180 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 187 181 188 182 /* Search the ieee80211 networks for this network if we didn't find it by bssid, ··· 247 241 if (ieee80211softmac_start_scan(mac)) 248 242 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); 249 243 return; 250 - } 251 - else { 244 + } else { 252 245 spin_lock_irqsave(&mac->lock, flags); 253 246 mac->associnfo.associating = 0; 254 247 mac->associated = 0; 255 248 spin_unlock_irqrestore(&mac->lock, flags); 256 249 257 250 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n"); 251 + /* reset the retry counter for the next user request since we 252 + * break out and don't reschedule ourselves after this point. */ 253 + mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; 258 254 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL); 259 255 return; 260 256 } 261 257 } 262 - 258 + 259 + /* reset the retry counter for the next user request since we 260 + * now found a net and will try to associate to it, but not 261 + * schedule this function again. */ 262 + mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; 263 263 mac->associnfo.bssvalid = 1; 264 264 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN); 265 265 /* copy the ESSID for displaying it */
+2
net/ieee80211/softmac/ieee80211softmac_module.c
··· 45 45 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc; 46 46 softmac->scaninfo = NULL; 47 47 48 + softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; 49 + 48 50 /* TODO: initialise all the other callbacks in the ieee struct 49 51 * (once they're written) 50 52 */
+17 -10
net/ieee80211/softmac/ieee80211softmac_wx.c
··· 27 27 #include "ieee80211softmac_priv.h" 28 28 29 29 #include <net/iw_handler.h> 30 - 30 + /* for is_broadcast_ether_addr and is_zero_ether_addr */ 31 + #include <linux/etherdevice.h> 31 32 32 33 int 33 34 ieee80211softmac_wx_trigger_scan(struct net_device *net_dev, ··· 84 83 sm->associnfo.static_essid = 1; 85 84 } 86 85 } 87 - sm->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT; 88 86 89 87 /* set our requested ESSID length. 90 88 * If applicable, we have already copied the data in */ ··· 310 310 char *extra) 311 311 { 312 312 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev); 313 - static const unsigned char any[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 314 - static const unsigned char off[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 315 313 unsigned long flags; 316 314 317 315 /* sanity check */ ··· 318 320 } 319 321 320 322 spin_lock_irqsave(&mac->lock, flags); 321 - if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) || 322 - !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) { 323 - schedule_work(&mac->associnfo.work); 324 - goto out; 323 + if (is_broadcast_ether_addr(data->ap_addr.sa_data)) { 324 + /* the bssid we have is not to be fixed any longer, 325 + * and we should reassociate to the best AP. */ 326 + mac->associnfo.bssfixed = 0; 327 + /* force reassociation */ 328 + mac->associnfo.bssvalid = 0; 329 + if (mac->associated) 330 + schedule_work(&mac->associnfo.work); 331 + } else if (is_zero_ether_addr(data->ap_addr.sa_data)) { 332 + /* the bssid we have is no longer fixed */ 333 + mac->associnfo.bssfixed = 0; 325 334 } else { 326 335 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) { 327 336 if (mac->associnfo.associating || mac->associated) { ··· 338 333 } else { 339 334 /* copy new value in data->ap_addr.sa_data to bssid */ 340 335 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN); 341 - } 336 + } 337 + /* tell the other code that this bssid should be used no matter what */ 338 + mac->associnfo.bssfixed = 1; 342 339 /* queue associate if new bssid or (old one again and not associated) */ 343 340 schedule_work(&mac->associnfo.work); 344 341 } 345 342 346 - out: 343 + out: 347 344 spin_unlock_irqrestore(&mac->lock, flags); 348 345 return 0; 349 346 }
+1 -1
net/ipv4/netfilter/Kconfig
··· 345 345 To compile it as a module, choose M here. If unsure, say N. 346 346 347 347 config IP_NF_TARGET_ULOG 348 - tristate "ULOG target support (OBSOLETE)" 348 + tristate "ULOG target support" 349 349 depends on IP_NF_IPTABLES 350 350 ---help--- 351 351
-13
net/ipv6/netfilter/ip6_tables.c
··· 288 288 table_base = (void *)private->entries[smp_processor_id()]; 289 289 e = get_entry(table_base, private->hook_entry[hook]); 290 290 291 - #ifdef CONFIG_NETFILTER_DEBUG 292 - /* Check noone else using our table */ 293 - if (((struct ip6t_entry *)table_base)->comefrom != 0xdead57ac 294 - && ((struct ip6t_entry *)table_base)->comefrom != 0xeeeeeeec) { 295 - printk("ASSERT: CPU #%u, %s comefrom(%p) = %X\n", 296 - smp_processor_id(), 297 - table->name, 298 - &((struct ip6t_entry *)table_base)->comefrom, 299 - ((struct ip6t_entry *)table_base)->comefrom); 300 - } 301 - ((struct ip6t_entry *)table_base)->comefrom = 0x57acc001; 302 - #endif 303 - 304 291 /* For return from builtin chain */ 305 292 back = get_entry(table_base, private->underflow[hook]); 306 293
+4 -11
net/netfilter/nf_conntrack_core.c
··· 178 178 /* allocated slab cache + modules which uses this slab cache */ 179 179 int use; 180 180 181 - /* Initialization */ 182 - int (*init_conntrack)(struct nf_conn *, u_int32_t); 183 - 184 181 } nf_ct_cache[NF_CT_F_NUM]; 185 182 186 183 /* protect members of nf_ct_cache except of "use" */ ··· 205 208 206 209 preempt_disable(); 207 210 p = __nf_ct_proto_find(l3proto, protocol); 208 - if (p) { 209 - if (!try_module_get(p->me)) 210 - p = &nf_conntrack_generic_protocol; 211 - } 211 + if (!try_module_get(p->me)) 212 + p = &nf_conntrack_generic_protocol; 212 213 preempt_enable(); 213 214 214 215 return p; ··· 224 229 225 230 preempt_disable(); 226 231 p = __nf_ct_l3proto_find(l3proto); 227 - if (p) { 228 - if (!try_module_get(p->me)) 229 - p = &nf_conntrack_generic_l3proto; 230 - } 232 + if (!try_module_get(p->me)) 233 + p = &nf_conntrack_generic_l3proto; 231 234 preempt_enable(); 232 235 233 236 return p;
-1
net/netfilter/nf_conntrack_l3proto_generic.c
··· 94 94 .print_conntrack = generic_print_conntrack, 95 95 .prepare = generic_prepare, 96 96 .get_features = generic_get_features, 97 - .me = THIS_MODULE, 98 97 };
+1 -1
net/netfilter/x_tables.c
··· 529 529 530 530 /* Simplifies replace_table code. */ 531 531 table->private = bootstrap; 532 + rwlock_init(&table->lock); 532 533 if (!xt_replace_table(table, 0, newinfo, &ret)) 533 534 goto unlock; 534 535 ··· 539 538 /* save number of initial entries */ 540 539 private->initial_entries = private->number; 541 540 542 - rwlock_init(&table->lock); 543 541 list_prepend(&xt[table->af].tables, table); 544 542 545 543 ret = 0;
+5
net/sched/act_ipt.c
··· 69 69 DPRINTK("ipt_init_target: found %s\n", target->name); 70 70 t->u.kernel.target = target; 71 71 72 + ret = xt_check_target(target, AF_INET, t->u.target_size - sizeof(*t), 73 + table, hook, 0, 0); 74 + if (ret) 75 + return ret; 76 + 72 77 if (t->u.kernel.target->checkentry 73 78 && !t->u.kernel.target->checkentry(table, NULL, 74 79 t->u.kernel.target, t->data,
+99 -99
sound/oss/ad1889.c
··· 75 75 76 76 DBG("Setting WAV rate to %d\n", rate); 77 77 dev->state[AD_WAV_STATE].dmabuf.rate = rate; 78 - AD1889_WRITEW(dev, AD_DSWAS, rate); 78 + AD1889_WRITEW(dev, AD_DS_WAS, rate); 79 79 80 80 /* Cycle the DAC to enable the new rate */ 81 81 ac97_codec->codec_write(dev->ac97_codec, AC97_POWER_CONTROL, 0x0200); ··· 89 89 90 90 DBG("Setting WAV format to 0x%x\n", fmt); 91 91 92 - tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 92 + tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); 93 93 if (fmt & AFMT_S16_LE) { 94 94 //tmp |= 0x0100; /* set WA16 */ 95 95 tmp |= 0x0300; /* set WA16 stereo */ 96 96 } else if (fmt & AFMT_U8) { 97 97 tmp &= ~0x0100; /* clear WA16 */ 98 98 } 99 - AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 99 + AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); 100 100 } 101 101 102 102 static inline void ad1889_set_adc_fmt(ad1889_dev_t *dev, int fmt) ··· 105 105 106 106 DBG("Setting ADC format to 0x%x\n", fmt); 107 107 108 - tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 108 + tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC); 109 109 if (fmt & AFMT_S16_LE) { 110 110 tmp |= 0x0100; /* set WA16 */ 111 111 } else if (fmt & AFMT_U8) { 112 112 tmp &= ~0x0100; /* clear WA16 */ 113 113 } 114 - AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 114 + AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp); 115 115 } 116 116 117 117 static void ad1889_start_wav(ad1889_state_t *state) ··· 145 145 dmabuf->rd_ptr, dmabuf->dma_len); 146 146 147 147 /* load up the current register set */ 148 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVCC, cnt); 149 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVICC, cnt); 150 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVCA, dmabuf->dma_handle); 148 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCC, cnt); 149 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVICC, cnt); 150 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVCA, dmabuf->dma_handle); 151 151 152 152 /* TODO: for now we load the base registers with the same thing */ 153 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVBC, cnt); 154 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVIBC, cnt); 155 - AD1889_WRITEL(ad1889_dev, AD_DMAWAVBA, dmabuf->dma_handle); 153 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBC, cnt); 154 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVIBC, cnt); 155 + AD1889_WRITEL(ad1889_dev, AD_DMA_WAVBA, dmabuf->dma_handle); 156 156 157 157 /* and we're off to the races... */ 158 - AD1889_WRITEL(ad1889_dev, AD_DMACHSS, 0x8); 159 - tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 158 + AD1889_WRITEL(ad1889_dev, AD_DMA_CHSS, 0x8); 159 + tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); 160 160 tmp |= 0x0400; /* set WAEN */ 161 - AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 162 - (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 161 + AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); 162 + (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */ 163 163 164 164 dmabuf->enable |= DAC_RUNNING; 165 165 ··· 179 179 u16 tmp; 180 180 unsigned long cnt = dmabuf->dma_len; 181 181 182 - tmp = AD1889_READW(ad1889_dev, AD_DSWSMC); 182 + tmp = AD1889_READW(ad1889_dev, AD_DS_WSMC); 183 183 tmp &= ~0x0400; /* clear WAEN */ 184 - AD1889_WRITEW(ad1889_dev, AD_DSWSMC, tmp); 185 - (void) AD1889_READW(ad1889_dev, AD_DSWSMC); /* flush posted PCI write */ 184 + AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, tmp); 185 + (void) AD1889_READW(ad1889_dev, AD_DS_WSMC); /* flush posted PCI write */ 186 186 pci_unmap_single(ad1889_dev->pci, dmabuf->dma_handle, 187 187 cnt, PCI_DMA_TODEVICE); 188 188 ··· 211 211 212 212 spin_lock_irqsave(&state->card->lock, flags); 213 213 214 - tmp = AD1889_READW(ad1889_dev, AD_DSRAMC); 214 + tmp = AD1889_READW(ad1889_dev, AD_DS_RAMC); 215 215 if (start) { 216 216 state->dmabuf.enable |= ADC_RUNNING; 217 217 tmp |= 0x0004; /* set ADEN */ ··· 219 219 state->dmabuf.enable &= ~ADC_RUNNING; 220 220 tmp &= ~0x0004; /* clear ADEN */ 221 221 } 222 - AD1889_WRITEW(ad1889_dev, AD_DSRAMC, tmp); 222 + AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, tmp); 223 223 224 224 spin_unlock_irqrestore(&state->card->lock, flags); 225 225 } ··· 301 301 int len, i; 302 302 ad1889_dev_t *dev = data; 303 303 ad1889_reg_t regs[] = { 304 - { "WSMC", AD_DSWSMC, 16 }, 305 - { "RAMC", AD_DSRAMC, 16 }, 306 - { "WADA", AD_DSWADA, 16 }, 307 - { "SYDA", AD_DSSYDA, 16 }, 308 - { "WAS", AD_DSWAS, 16 }, 309 - { "RES", AD_DSRES, 16 }, 310 - { "CCS", AD_DSCCS, 16 }, 311 - { "ADCBA", AD_DMAADCBA, 32 }, 312 - { "ADCCA", AD_DMAADCCA, 32 }, 313 - { "ADCBC", AD_DMAADCBC, 32 }, 314 - { "ADCCC", AD_DMAADCCC, 32 }, 315 - { "ADCIBC", AD_DMAADCIBC, 32 }, 316 - { "ADCICC", AD_DMAADCICC, 32 }, 317 - { "ADCCTRL", AD_DMAADCCTRL, 16 }, 318 - { "WAVBA", AD_DMAWAVBA, 32 }, 319 - { "WAVCA", AD_DMAWAVCA, 32 }, 320 - { "WAVBC", AD_DMAWAVBC, 32 }, 321 - { "WAVCC", AD_DMAWAVCC, 32 }, 322 - { "WAVIBC", AD_DMAWAVIBC, 32 }, 323 - { "WAVICC", AD_DMAWAVICC, 32 }, 324 - { "WAVCTRL", AD_DMAWAVCTRL, 16 }, 325 - { "DISR", AD_DMADISR, 32 }, 326 - { "CHSS", AD_DMACHSS, 32 }, 327 - { "IPC", AD_GPIOIPC, 16 }, 328 - { "OP", AD_GPIOOP, 16 }, 329 - { "IP", AD_GPIOIP, 16 }, 330 - { "ACIC", AD_ACIC, 16 }, 331 - { "AC97_RESET", 0x100 + AC97_RESET, 16 }, 332 - { "AC97_MASTER_VOL_STEREO", 0x100 + AC97_MASTER_VOL_STEREO, 16 }, 333 - { "AC97_HEADPHONE_VOL", 0x100 + AC97_HEADPHONE_VOL, 16 }, 334 - { "AC97_MASTER_VOL_MONO", 0x100 + AC97_MASTER_VOL_MONO, 16 }, 335 - { "AC97_MASTER_TONE", 0x100 + AC97_MASTER_TONE, 16 }, 336 - { "AC97_PCBEEP_VOL", 0x100 + AC97_PCBEEP_VOL, 16 }, 337 - { "AC97_PHONE_VOL", 0x100 + AC97_PHONE_VOL, 16 }, 338 - { "AC97_MIC_VOL", 0x100 + AC97_MIC_VOL, 16 }, 339 - { "AC97_LINEIN_VOL", 0x100 + AC97_LINEIN_VOL, 16 }, 340 - { "AC97_CD_VOL", 0x100 + AC97_CD_VOL, 16 }, 341 - { "AC97_VIDEO_VOL", 0x100 + AC97_VIDEO_VOL, 16 }, 342 - { "AC97_AUX_VOL", 0x100 + AC97_AUX_VOL, 16 }, 343 - { "AC97_PCMOUT_VOL", 0x100 + AC97_PCMOUT_VOL, 16 }, 344 - { "AC97_RECORD_SELECT", 0x100 + AC97_RECORD_SELECT, 16 }, 345 - { "AC97_RECORD_GAIN", 0x100 + AC97_RECORD_GAIN, 16 }, 346 - { "AC97_RECORD_GAIN_MIC", 0x100 + AC97_RECORD_GAIN_MIC, 16 }, 347 - { "AC97_GENERAL_PURPOSE", 0x100 + AC97_GENERAL_PURPOSE, 16 }, 348 - { "AC97_3D_CONTROL", 0x100 + AC97_3D_CONTROL, 16 }, 349 - { "AC97_MODEM_RATE", 0x100 + AC97_MODEM_RATE, 16 }, 350 - { "AC97_POWER_CONTROL", 0x100 + AC97_POWER_CONTROL, 16 }, 304 + { "WSMC", AD_DS_WSMC, 16 }, 305 + { "RAMC", AD_DS_RAMC, 16 }, 306 + { "WADA", AD_DS_WADA, 16 }, 307 + { "SYDA", AD_DS_SYDA, 16 }, 308 + { "WAS", AD_DS_WAS, 16 }, 309 + { "RES", AD_DS_RES, 16 }, 310 + { "CCS", AD_DS_CCS, 16 }, 311 + { "ADCBA", AD_DMA_ADCBA, 32 }, 312 + { "ADCCA", AD_DMA_ADCCA, 32 }, 313 + { "ADCBC", AD_DMA_ADCBC, 32 }, 314 + { "ADCCC", AD_DMA_ADCCC, 32 }, 315 + { "ADCIBC", AD_DMA_ADCIBC, 32 }, 316 + { "ADCICC", AD_DMA_ADCICC, 32 }, 317 + { "ADCCTRL", AD_DMA_ADCCTRL, 16 }, 318 + { "WAVBA", AD_DMA_WAVBA, 32 }, 319 + { "WAVCA", AD_DMA_WAVCA, 32 }, 320 + { "WAVBC", AD_DMA_WAVBC, 32 }, 321 + { "WAVCC", AD_DMA_WAVCC, 32 }, 322 + { "WAVIBC", AD_DMA_WAVIBC, 32 }, 323 + { "WAVICC", AD_DMA_WAVICC, 32 }, 324 + { "WAVCTRL", AD_DMA_WAVCTRL, 16 }, 325 + { "DISR", AD_DMA_DISR, 32 }, 326 + { "CHSS", AD_DMA_CHSS, 32 }, 327 + { "IPC", AD_GPIO_IPC, 16 }, 328 + { "OP", AD_GPIO_OP, 16 }, 329 + { "IP", AD_GPIO_IP, 16 }, 330 + { "ACIC", AD_AC97_ACIC, 16 }, 331 + { "AC97_RESET", AD_AC97_BASE + AC97_RESET, 16 }, 332 + { "AC97_MASTER_VOL_STEREO", AD_AC97_BASE + AC97_MASTER_VOL_STEREO, 16 }, 333 + { "AC97_HEADPHONE_VOL", AD_AC97_BASE + AC97_HEADPHONE_VOL, 16 }, 334 + { "AC97_MASTER_VOL_MONO", AD_AC97_BASE + AC97_MASTER_VOL_MONO, 16 }, 335 + { "AC97_MASTER_TONE", AD_AC97_BASE + AC97_MASTER_TONE, 16 }, 336 + { "AC97_PCBEEP_VOL", AD_AC97_BASE + AC97_PCBEEP_VOL, 16 }, 337 + { "AC97_PHONE_VOL", AD_AC97_BASE + AC97_PHONE_VOL, 16 }, 338 + { "AC97_MIC_VOL", AD_AC97_BASE + AC97_MIC_VOL, 16 }, 339 + { "AC97_LINEIN_VOL", AD_AC97_BASE + AC97_LINEIN_VOL, 16 }, 340 + { "AC97_CD_VOL", AD_AC97_BASE + AC97_CD_VOL, 16 }, 341 + { "AC97_VIDEO_VOL", AD_AC97_BASE + AC97_VIDEO_VOL, 16 }, 342 + { "AC97_AUX_VOL", AD_AC97_BASE + AC97_AUX_VOL, 16 }, 343 + { "AC97_PCMOUT_VOL", AD_AC97_BASE + AC97_PCMOUT_VOL, 16 }, 344 + { "AC97_RECORD_SELECT", AD_AC97_BASE + AC97_RECORD_SELECT, 16 }, 345 + { "AC97_RECORD_GAIN", AD_AC97_BASE + AC97_RECORD_GAIN, 16 }, 346 + { "AC97_RECORD_GAIN_MIC", AD_AC97_BASE + AC97_RECORD_GAIN_MIC, 16 }, 347 + { "AC97_GENERAL_PURPOSE", AD_AC97_BASE + AC97_GENERAL_PURPOSE, 16 }, 348 + { "AC97_3D_CONTROL", AD_AC97_BASE + AC97_3D_CONTROL, 16 }, 349 + { "AC97_MODEM_RATE", AD_AC97_BASE + AC97_MODEM_RATE, 16 }, 350 + { "AC97_POWER_CONTROL", AD_AC97_BASE + AC97_POWER_CONTROL, 16 }, 351 351 { NULL } 352 352 }; 353 353 ··· 400 400 } 401 401 402 402 if (dmabuf->enable & DAC_RUNNING) 403 - offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAWAVBA)); 403 + offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_WAVBA)); 404 404 else 405 - offset = le32_to_cpu(AD1889_READL(state->card, AD_DMAADCBA)); 405 + offset = le32_to_cpu(AD1889_READL(state->card, AD_DMA_ADCBA)); 406 406 407 407 return (unsigned long)bus_to_virt((unsigned long)offset) - (unsigned long)dmabuf->rawbuf; 408 408 } ··· 639 639 if (val > 5400 && val < 48000) 640 640 { 641 641 if (file->f_mode & FMODE_WRITE) 642 - AD1889_WRITEW(ad1889_dev, AD_DSWAS, val); 642 + AD1889_WRITEW(ad1889_dev, AD_DS_WAS, val); 643 643 if (file->f_mode & FMODE_READ) 644 - AD1889_WRITEW(ad1889_dev, AD_DSRES, val); 644 + AD1889_WRITEW(ad1889_dev, AD_DS_RES, val); 645 645 } 646 646 return 0; 647 647 ··· 649 649 if (get_user(val, p)) 650 650 return -EFAULT; 651 651 if (file->f_mode & FMODE_READ) { 652 - val = AD1889_READW(ad1889_dev, AD_DSWSMC); 652 + val = AD1889_READW(ad1889_dev, AD_DS_WSMC); 653 653 if (val) { 654 654 val |= 0x0200; /* set WAST */ 655 655 } else { 656 656 val &= ~0x0200; /* clear WAST */ 657 657 } 658 - AD1889_WRITEW(ad1889_dev, AD_DSWSMC, val); 658 + AD1889_WRITEW(ad1889_dev, AD_DS_WSMC, val); 659 659 } 660 660 if (file->f_mode & FMODE_WRITE) { 661 - val = AD1889_READW(ad1889_dev, AD_DSRAMC); 661 + val = AD1889_READW(ad1889_dev, AD_DS_RAMC); 662 662 if (val) { 663 663 val |= 0x0002; /* set ADST */ 664 664 } else { 665 665 val &= ~0x0002; /* clear ADST */ 666 666 } 667 - AD1889_WRITEW(ad1889_dev, AD_DSRAMC, val); 667 + AD1889_WRITEW(ad1889_dev, AD_DS_RAMC, val); 668 668 } 669 669 670 670 return 0; ··· 739 739 break; 740 740 741 741 case SOUND_PCM_READ_RATE: 742 - return put_user(AD1889_READW(ad1889_dev, AD_DSWAS), p); 742 + return put_user(AD1889_READW(ad1889_dev, AD_DS_WAS), p); 743 743 744 744 case SOUND_PCM_READ_CHANNELS: 745 745 case SOUND_PCM_READ_BITS: ··· 769 769 770 770 ad1889_set_wav_rate(ad1889_dev, 48000); 771 771 ad1889_set_wav_fmt(ad1889_dev, AFMT_S16_LE); 772 - AD1889_WRITEW(ad1889_dev, AD_DSWADA, 0x0404); /* attenuation */ 772 + AD1889_WRITEW(ad1889_dev, AD_DS_WADA, 0x0404); /* attenuation */ 773 773 return nonseekable_open(inode, file); 774 774 } 775 775 ··· 826 826 { 827 827 ad1889_dev_t *dev = ac97->private_data; 828 828 829 - //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + 0x100 + reg); 830 - AD1889_WRITEW(dev, 0x100 + reg, val); 829 + //DBG("Writing 0x%x to 0x%lx\n", val, dev->regbase + AD_AC97_BASE + reg); 830 + AD1889_WRITEW(dev, AD_AC97_BASE + reg, val); 831 831 } 832 832 833 833 static u16 ad1889_codec_read(struct ac97_codec *ac97, u8 reg) 834 834 { 835 835 ad1889_dev_t *dev = ac97->private_data; 836 - //DBG("Reading from 0x%lx\n", dev->regbase + 0x100 + reg); 837 - return AD1889_READW(dev, 0x100 + reg); 836 + //DBG("Reading from 0x%lx\n", dev->regbase + AD_AC97_BASE + reg); 837 + return AD1889_READW(dev, AD_AC97_BASE + reg); 838 838 } 839 839 840 840 static int ad1889_ac97_init(ad1889_dev_t *dev, int id) ··· 883 883 int retry = 200; 884 884 ad1889_dev_t *dev = pci_get_drvdata(pcidev); 885 885 886 - AD1889_WRITEW(dev, AD_DSCCS, 0x8000); /* turn on clock */ 887 - AD1889_READW(dev, AD_DSCCS); 886 + AD1889_WRITEW(dev, AD_DS_CCS, 0x8000); /* turn on clock */ 887 + AD1889_READW(dev, AD_DS_CCS); 888 888 889 889 WAIT_10MS(); 890 890 891 - stat = AD1889_READW(dev, AD_ACIC); 891 + stat = AD1889_READW(dev, AD_AC97_ACIC); 892 892 stat |= 0x0002; /* Reset Disable */ 893 - AD1889_WRITEW(dev, AD_ACIC, stat); 894 - (void) AD1889_READW(dev, AD_ACIC); /* flush posted write */ 893 + AD1889_WRITEW(dev, AD_AC97_ACIC, stat); 894 + (void) AD1889_READW(dev, AD_AC97_ACIC); /* flush posted write */ 895 895 896 896 udelay(10); 897 897 898 - stat = AD1889_READW(dev, AD_ACIC); 898 + stat = AD1889_READW(dev, AD_AC97_ACIC); 899 899 stat |= 0x0001; /* Interface Enable */ 900 - AD1889_WRITEW(dev, AD_ACIC, stat); 900 + AD1889_WRITEW(dev, AD_AC97_ACIC, stat); 901 901 902 902 do { 903 - if (AD1889_READW(dev, AD_ACIC) & 0x8000) /* Ready */ 903 + if (AD1889_READW(dev, AD_AC97_ACIC) & 0x8000) /* Ready */ 904 904 break; 905 905 WAIT_10MS(); 906 906 retry--; ··· 908 908 909 909 if (!retry) { 910 910 printk(KERN_ERR "ad1889_aclink_reset: codec is not ready [0x%x]\n", 911 - AD1889_READW(dev, AD_ACIC)); 911 + AD1889_READW(dev, AD_AC97_ACIC)); 912 912 return -EBUSY; 913 913 } 914 914 915 915 /* TODO reset AC97 codec */ 916 916 /* TODO set wave/adc pci ctrl status */ 917 917 918 - stat = AD1889_READW(dev, AD_ACIC); 918 + stat = AD1889_READW(dev, AD_AC97_ACIC); 919 919 stat |= 0x0004; /* Audio Stream Output Enable */ 920 - AD1889_WRITEW(dev, AD_ACIC, stat); 920 + AD1889_WRITEW(dev, AD_AC97_ACIC, stat); 921 921 return 0; 922 922 } 923 923 ··· 935 935 u32 stat; 936 936 ad1889_dev_t *dev = (ad1889_dev_t *)dev_id; 937 937 938 - stat = AD1889_READL(dev, AD_DMADISR); 938 + stat = AD1889_READL(dev, AD_DMA_DISR); 939 939 940 940 /* clear ISR */ 941 - AD1889_WRITEL(dev, AD_DMADISR, stat); 941 + AD1889_WRITEL(dev, AD_DMA_DISR, stat); 942 942 943 943 if (stat & 0x8) { /* WAVI */ 944 944 DBG("WAV interrupt\n"); ··· 964 964 u32 tmp32; 965 965 966 966 /* make sure the interrupt bits are setup the way we want */ 967 - tmp32 = AD1889_READL(dev, AD_DMAWAVCTRL); 967 + tmp32 = AD1889_READL(dev, AD_DMA_WAVCTRL); 968 968 tmp32 &= ~0xff; /* flat dma, no sg, mask out the intr bits */ 969 969 tmp32 |= 0x6; /* intr on count, loop */ 970 - AD1889_WRITEL(dev, AD_DMAWAVCTRL, tmp32); 970 + AD1889_WRITEL(dev, AD_DMA_WAVCTRL, tmp32); 971 971 972 972 /* unmute... */ 973 - tmp16 = AD1889_READW(dev, AD_DSWADA); 973 + tmp16 = AD1889_READW(dev, AD_DS_WADA); 974 974 tmp16 &= ~0x8080; 975 - AD1889_WRITEW(dev, AD_DSWADA, tmp16); 975 + AD1889_WRITEW(dev, AD_DS_WADA, tmp16); 976 976 } 977 977 978 978 static int __devinit ad1889_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) ··· 1005 1005 goto out1; 1006 1006 } 1007 1007 1008 - dev->regbase = ioremap_nocache(bar, AD_DSIOMEMSIZE); 1008 + dev->regbase = ioremap_nocache(bar, AD_DS_IOMEMSIZE); 1009 1009 if (!dev->regbase) { 1010 1010 printk(KERN_ERR DEVNAME ": unable to remap iomem\n"); 1011 1011 goto out2;
+49 -48
sound/oss/ad1889.h
··· 1 1 #ifndef _AD1889_H_ 2 2 #define _AD1889_H_ 3 3 4 - #define AD_DSWSMC 0x00 /* DMA input wave/syn mixer control */ 5 - #define AD_DSRAMC 0x02 /* DMA output resamp/ADC mixer control */ 6 - #define AD_DSWADA 0x04 /* DMA input wave attenuation */ 7 - #define AD_DSSYDA 0x06 /* DMA input syn attentuation */ 8 - #define AD_DSWAS 0x08 /* wave input sample rate */ 9 - #define AD_DSRES 0x0a /* resampler output sample rate */ 10 - #define AD_DSCCS 0x0c /* chip control/status */ 4 + #define AD_DS_WSMC 0x00 /* DMA input wave/syn mixer control */ 5 + #define AD_DS_RAMC 0x02 /* DMA output resamp/ADC mixer control */ 6 + #define AD_DS_WADA 0x04 /* DMA input wave attenuation */ 7 + #define AD_DS_SYDA 0x06 /* DMA input syn attentuation */ 8 + #define AD_DS_WAS 0x08 /* wave input sample rate */ 9 + #define AD_DS_RES 0x0a /* resampler output sample rate */ 10 + #define AD_DS_CCS 0x0c /* chip control/status */ 11 11 12 - #define AD_DMARESBA 0x40 /* RES base addr */ 13 - #define AD_DMARESCA 0x44 /* RES current addr */ 14 - #define AD_DMARESBC 0x48 /* RES base cnt */ 15 - #define AD_DMARESCC 0x4c /* RES current count */ 16 - #define AD_DMAADCBA 0x50 /* ADC */ 17 - #define AD_DMAADCCA 0x54 18 - #define AD_DMAADCBC 0x58 19 - #define AD_DMAADCCC 0x5c 20 - #define AD_DMASYNBA 0x60 /* SYN */ 21 - #define AD_DMASYNCA 0x64 22 - #define AD_DMASYNBC 0x68 23 - #define AD_DMASYNCC 0x6c 24 - #define AD_DMAWAVBA 0x70 /* WAV */ 25 - #define AD_DMAWAVCA 0x74 26 - #define AD_DMAWAVBC 0x78 27 - #define AD_DMAWAVCC 0x7c 28 - #define AD_DMARESICC 0x80 /* RES interrupt current count */ 29 - #define AD_DMARESIBC 0x84 /* RES interrupt base count */ 30 - #define AD_DMAADCICC 0x88 /* ADC interrupt current count */ 31 - #define AD_DMAADCIBC 0x8c /* ADC interrupt base count */ 32 - #define AD_DMASYNICC 0x90 /* SYN interrupt current count */ 33 - #define AD_DMASYNIBC 0x94 /* SYN interrupt base count */ 34 - #define AD_DMAWAVICC 0x98 /* WAV interrupt current count */ 35 - #define AD_DMAWAVIBC 0x9c /* WAV interrupt base count */ 36 - #define AD_DMARESCTRL 0xa0 /* RES PCI control/status */ 37 - #define AD_DMAADCCTRL 0xa8 /* ADC PCI control/status */ 38 - #define AD_DMASYNCTRL 0xb0 /* SYN PCI control/status */ 39 - #define AD_DMAWAVCTRL 0xb8 /* WAV PCI control/status */ 40 - #define AD_DMADISR 0xc0 /* PCI DMA intr status */ 41 - #define AD_DMACHSS 0xc4 /* PCI DMA channel stop status */ 12 + #define AD_DMA_RESBA 0x40 /* RES base addr */ 13 + #define AD_DMA_RESCA 0x44 /* RES current addr */ 14 + #define AD_DMA_RESBC 0x48 /* RES base cnt */ 15 + #define AD_DMA_RESCC 0x4c /* RES current count */ 16 + #define AD_DMA_ADCBA 0x50 /* ADC */ 17 + #define AD_DMA_ADCCA 0x54 18 + #define AD_DMA_ADCBC 0x58 19 + #define AD_DMA_ADCCC 0x5c 20 + #define AD_DMA_SYNBA 0x60 /* SYN */ 21 + #define AD_DMA_SYNCA 0x64 22 + #define AD_DMA_SYNBC 0x68 23 + #define AD_DMA_SYNCC 0x6c 24 + #define AD_DMA_WAVBA 0x70 /* WAV */ 25 + #define AD_DMA_WAVCA 0x74 26 + #define AD_DMA_WAVBC 0x78 27 + #define AD_DMA_WAVCC 0x7c 28 + #define AD_DMA_RESICC 0x80 /* RES interrupt current count */ 29 + #define AD_DMA_RESIBC 0x84 /* RES interrupt base count */ 30 + #define AD_DMA_ADCICC 0x88 /* ADC interrupt current count */ 31 + #define AD_DMA_ADCIBC 0x8c /* ADC interrupt base count */ 32 + #define AD_DMA_SYNICC 0x90 /* SYN interrupt current count */ 33 + #define AD_DMA_SYNIBC 0x94 /* SYN interrupt base count */ 34 + #define AD_DMA_WAVICC 0x98 /* WAV interrupt current count */ 35 + #define AD_DMA_WAVIBC 0x9c /* WAV interrupt base count */ 36 + #define AD_DMA_RESCTRL 0xa0 /* RES PCI control/status */ 37 + #define AD_DMA_ADCCTRL 0xa8 /* ADC PCI control/status */ 38 + #define AD_DMA_SYNCTRL 0xb0 /* SYN PCI control/status */ 39 + #define AD_DMA_WAVCTRL 0xb8 /* WAV PCI control/status */ 40 + #define AD_DMA_DISR 0xc0 /* PCI DMA intr status */ 41 + #define AD_DMA_CHSS 0xc4 /* PCI DMA channel stop status */ 42 42 43 - #define AD_GPIOIPC 0xc8 /* IO port ctrl */ 44 - #define AD_GPIOOP 0xca /* IO output status */ 45 - #define AD_GPIOIP 0xcc /* IO input status */ 43 + #define AD_GPIO_IPC 0xc8 /* IO port ctrl */ 44 + #define AD_GPIO_OP 0xca /* IO output status */ 45 + #define AD_GPIO_IP 0xcc /* IO input status */ 46 46 47 47 /* AC97 registers, 0x100 - 0x17f; see ac97.h */ 48 - #define AD_ACIC 0x180 /* AC Link interface ctrl */ 48 + #define AD_AC97_BASE 0x100 /* ac97 base register */ 49 + #define AD_AC97_ACIC 0x180 /* AC Link interface ctrl */ 49 50 50 51 /* OPL3; BAR1 */ 51 - #define AD_OPLM0AS 0x00 /* Music0 address/status */ 52 - #define AD_OPLM0DATA 0x01 /* Music0 data */ 53 - #define AD_OPLM1A 0x02 /* Music1 address */ 54 - #define AD_OPLM1DATA 0x03 /* Music1 data */ 52 + #define AD_OPL_M0AS 0x00 /* Music0 address/status */ 53 + #define AD_OPL_M0DATA 0x01 /* Music0 data */ 54 + #define AD_OPL_M1A 0x02 /* Music1 address */ 55 + #define AD_OPL_M1DATA 0x03 /* Music1 data */ 55 56 /* 0x04-0x0f reserved */ 56 57 57 58 /* MIDI; BAR2 */ ··· 60 59 #define AD_MISC 0x01 /* MIDI status/cmd */ 61 60 /* 0x02-0xff reserved */ 62 61 63 - #define AD_DSIOMEMSIZE 512 64 - #define AD_OPLMEMSIZE 16 65 - #define AD_MIDIMEMSIZE 16 62 + #define AD_DS_IOMEMSIZE 512 63 + #define AD_OPL_MEMSIZE 16 64 + #define AD_MIDI_MEMSIZE 16 66 65 67 66 #define AD_WAV_STATE 0 68 67 #define AD_ADC_STATE 1
+2 -2
sound/oss/dmasound/tas_common.c
··· 195 195 196 196 printk(KERN_INFO "tas driver [%s])\n", driver_name); 197 197 198 - #ifndef CONFIG_I2C_KEYWEST 199 - request_module("i2c-keywest"); 198 + #ifndef CONFIG_I2C_POWERMAC 199 + request_module("i2c-powermac"); 200 200 #endif 201 201 tas_node = find_devices("deq"); 202 202 if (tas_node == NULL)
+1 -1
sound/ppc/daca.c
··· 255 255 256 256 #ifdef CONFIG_KMOD 257 257 if (current->fs->root) 258 - request_module("i2c-keywest"); 258 + request_module("i2c-powermac"); 259 259 #endif /* CONFIG_KMOD */ 260 260 261 261 mix = kmalloc(sizeof(*mix), GFP_KERNEL);
+1 -1
sound/ppc/tumbler.c
··· 1313 1313 1314 1314 #ifdef CONFIG_KMOD 1315 1315 if (current->fs->root) 1316 - request_module("i2c-keywest"); 1316 + request_module("i2c-powermac"); 1317 1317 #endif /* CONFIG_KMOD */ 1318 1318 1319 1319 mix = kmalloc(sizeof(*mix), GFP_KERNEL);