···153153 that some governors won't load - they only154154 work on some specific architectures or155155 processors.156156-scaling_min_freq and 156156+scaling_min_freq and157157scaling_max_freq show the current "policy limits" (in158158 kHz). By echoing new values into these159159 files, you can change these limits.160160+ NOTE: when setting a policy you need to161161+ first set scaling_max_freq, then162162+ scaling_min_freq.160163161164162165If you have selected the "userspace" governor which allows you to
-2
Documentation/infiniband/ipoib.txt
···51515252References53535454- IETF IP over InfiniBand (ipoib) Working Group5555- http://ietf.org/html.charters/ipoib-charter.html5654 Transmission of IP over InfiniBand (IPoIB) (RFC 4391)5755 http://ietf.org/rfc/rfc4391.txt 5856 IP over InfiniBand (IPoIB) Architecture (RFC 4392)
+2-3
Documentation/sysctl/kernel.txt
···2112112122120: try to continue operation213213214214-1: delay a few seconds (to give klogd time to record the oops output) and215215- then panic. If the `panic' sysctl is also non-zero then the machine will216216- be rebooted.214214+1: panic immediatly. If the `panic' sysctl is also non-zero then the215215+ machine will be rebooted.217216218217==============================================================219218
+1-1
Documentation/usb/proc_usb_info.txt
···5959would issue more ioctls to the device to communicate to it using6060control, bulk, or other kinds of USB transfers. The IOCTLs are6161listed in the <linux/usbdevice_fs.h> file, and at this writing the6262-source code (linux/drivers/usb/devio.c) is the primary reference6262+source code (linux/drivers/usb/core/devio.c) is the primary reference6363for how to access devices through those files.64646565Note that since by default these BBB/DDD files are writable only by
+1-2
Documentation/usb/usb-help.txt
···55Documentation/usb/*, see the following:6677Linux-USB project: http://www.linux-usb.org88- mirrors at http://www.suse.cz/development/linux-usb/99- and http://usb.in.tum.de/linux-usb/88+ mirrors at http://usb.in.tum.de/linux-usb/109 and http://it.linux-usb.org1110Linux USB Guide: http://linux-usb.sourceforge.net1211Linux-USB device overview (working devices and drivers):
···96969797config X86_GX_SUSPMOD9898 tristate "Cyrix MediaGX/NatSemi Geode Suspend Modulation"9999+ depends on PCI99100 help100101 This add the CPUFreq driver for NatSemi Geode processors which101102 support suspend modulation.···203202config X86_LONGHAUL204203 tristate "VIA Cyrix III Longhaul"205204 select CPU_FREQ_TABLE206206- depends on BROKEN205205+ depends on ACPI_PROCESSOR207206 help208207 This adds the CPUFreq driver for VIA Samuel/CyrixIII,209208 VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T
+1-2
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
···384384 }385385386386 /* Do initialization in ACPI core */387387- acpi_processor_preregister_performance(acpi_perf_data);388388- return 0;387387+ return acpi_processor_preregister_performance(acpi_perf_data);389388}390389391390static int
+129-92
arch/i386/kernel/cpu/cpufreq/longhaul.c
···2929#include <linux/cpufreq.h>3030#include <linux/slab.h>3131#include <linux/string.h>3232-#include <linux/pci.h>33323433#include <asm/msr.h>3534#include <asm/timex.h>3635#include <asm/io.h>3636+#include <asm/acpi.h>3737+#include <linux/acpi.h>3838+#include <acpi/processor.h>37393840#include "longhaul.h"3941···5856static unsigned int minmult, maxmult;5957static int can_scale_voltage;6058static int vrmrev;5959+static struct acpi_processor *pr = NULL;6060+static struct acpi_processor_cx *cx = NULL;61616262/* Module parameters */6363static int dont_scale_voltage;···122118 return eblcr_table[invalue];123119}124120121121+/* For processor with BCR2 MSR */125122126126-static void do_powersaver(union msr_longhaul *longhaul,127127- unsigned int clock_ratio_index)123123+static void do_longhaul1(int cx_address, unsigned int clock_ratio_index)128124{129129- struct pci_dev *dev;130130- unsigned long flags;131131- unsigned int tmp_mask;132132- int version;133133- int i;134134- u16 pci_cmd;135135- u16 cmd_state[64];125125+ union msr_bcr2 bcr2;126126+ u32 t;136127137137- switch (cpu_model) {138138- case CPU_EZRA_T:139139- version = 3;140140- break;141141- case CPU_NEHEMIAH:142142- version = 0xf;143143- break;144144- default:145145- return;146146- }128128+ rdmsrl(MSR_VIA_BCR2, bcr2.val);129129+ /* Enable software clock multiplier */130130+ bcr2.bits.ESOFTBF = 1;131131+ bcr2.bits.CLOCKMUL = clock_ratio_index;147132148148- rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);149149- longhaul->bits.SoftBusRatio = clock_ratio_index & 0xf;150150- longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;151151- longhaul->bits.EnableSoftBusRatio = 1;152152- longhaul->bits.RevisionKey = 0;153153-154154- preempt_disable();155155- local_irq_save(flags);156156-157157- /*158158- * get current pci bus master state for all devices159159- * and clear bus master bit160160- */161161- dev = NULL;162162- i = 0;163163- do {164164- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);165165- if (dev != NULL) {166166- pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);167167- cmd_state[i++] = pci_cmd;168168- pci_cmd &= ~PCI_COMMAND_MASTER;169169- pci_write_config_word(dev, PCI_COMMAND, pci_cmd);170170- }171171- } while (dev != NULL);172172-173173- tmp_mask=inb(0x21); /* works on C3. save mask. */174174- outb(0xFE,0x21); /* TMR0 only */175175- outb(0xFF,0x80); /* delay */176176-133133+ /* Sync to timer tick */177134 safe_halt();178178- wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);179179- halt();135135+ ACPI_FLUSH_CPU_CACHE();136136+ /* Change frequency on next halt or sleep */137137+ wrmsrl(MSR_VIA_BCR2, bcr2.val);138138+ /* Invoke C3 */139139+ inb(cx_address);140140+ /* Dummy op - must do something useless after P_LVL3 read */141141+ t = inl(acpi_fadt.xpm_tmr_blk.address);180142143143+ /* Disable software clock multiplier */181144 local_irq_disable();145145+ rdmsrl(MSR_VIA_BCR2, bcr2.val);146146+ bcr2.bits.ESOFTBF = 0;147147+ wrmsrl(MSR_VIA_BCR2, bcr2.val);148148+}182149183183- outb(tmp_mask,0x21); /* restore mask */150150+/* For processor with Longhaul MSR */184151185185- /* restore pci bus master state for all devices */186186- dev = NULL;187187- i = 0;188188- do {189189- dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);190190- if (dev != NULL) {191191- pci_cmd = cmd_state[i++];192192- pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);193193- }194194- } while (dev != NULL);195195- local_irq_restore(flags);196196- preempt_enable();152152+static void do_powersaver(int cx_address, unsigned int clock_ratio_index)153153+{154154+ union msr_longhaul longhaul;155155+ u32 t;197156198198- /* disable bus ratio bit */199199- rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);200200- longhaul->bits.EnableSoftBusRatio = 0;201201- longhaul->bits.RevisionKey = version;202202- wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);157157+ rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);158158+ longhaul.bits.RevisionKey = longhaul.bits.RevisionID;159159+ longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;160160+ longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;161161+ longhaul.bits.EnableSoftBusRatio = 1;162162+163163+ /* Sync to timer tick */164164+ safe_halt();165165+ ACPI_FLUSH_CPU_CACHE();166166+ /* Change frequency on next halt or sleep */167167+ wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);168168+ /* Invoke C3 */169169+ inb(cx_address);170170+ /* Dummy op - must do something useless after P_LVL3 read */171171+ t = inl(acpi_fadt.xpm_tmr_blk.address);172172+173173+ /* Disable bus ratio bit */174174+ local_irq_disable();175175+ longhaul.bits.RevisionKey = longhaul.bits.RevisionID;176176+ longhaul.bits.EnableSoftBusRatio = 0;177177+ longhaul.bits.EnableSoftBSEL = 0;178178+ longhaul.bits.EnableSoftVID = 0;179179+ wrmsrl(MSR_VIA_LONGHAUL, longhaul.val);203180}204181205182/**···194209{195210 int speed, mult;196211 struct cpufreq_freqs freqs;197197- union msr_longhaul longhaul;198198- union msr_bcr2 bcr2;199212 static unsigned int old_ratio=-1;213213+ unsigned long flags;214214+ unsigned int pic1_mask, pic2_mask;200215201216 if (old_ratio == clock_ratio_index)202217 return;···219234 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",220235 fsb, mult/10, mult%10, print_speed(speed/1000));221236237237+ preempt_disable();238238+ local_irq_save(flags);239239+240240+ pic2_mask = inb(0xA1);241241+ pic1_mask = inb(0x21); /* works on C3. save mask. */242242+ outb(0xFF,0xA1); /* Overkill */243243+ outb(0xFE,0x21); /* TMR0 only */244244+245245+ /* Disable bus master arbitration */246246+ if (pr->flags.bm_check) {247247+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1,248248+ ACPI_MTX_DO_NOT_LOCK);249249+ }250250+222251 switch (longhaul_version) {223252224253 /*···244245 */245246 case TYPE_LONGHAUL_V1:246247 case TYPE_LONGHAUL_V2:247247- rdmsrl (MSR_VIA_BCR2, bcr2.val);248248- /* Enable software clock multiplier */249249- bcr2.bits.ESOFTBF = 1;250250- bcr2.bits.CLOCKMUL = clock_ratio_index;251251- local_irq_disable();252252- wrmsrl (MSR_VIA_BCR2, bcr2.val);253253- safe_halt();254254-255255- /* Disable software clock multiplier */256256- rdmsrl (MSR_VIA_BCR2, bcr2.val);257257- bcr2.bits.ESOFTBF = 0;258258- local_irq_disable();259259- wrmsrl (MSR_VIA_BCR2, bcr2.val);260260- local_irq_enable();248248+ do_longhaul1(cx->address, clock_ratio_index);261249 break;262250263251 /*···259273 * to work in practice.260274 */261275 case TYPE_POWERSAVER:262262- do_powersaver(&longhaul, clock_ratio_index);276276+ do_powersaver(cx->address, clock_ratio_index);263277 break;264278 }279279+280280+ /* Enable bus master arbitration */281281+ if (pr->flags.bm_check) {282282+ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0,283283+ ACPI_MTX_DO_NOT_LOCK);284284+ }285285+286286+ outb(pic2_mask,0xA1); /* restore mask */287287+ outb(pic1_mask,0x21);288288+289289+ local_irq_restore(flags);290290+ preempt_enable();265291266292 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);267293}···322324static int __init longhaul_get_ranges(void)323325{324326 unsigned long invalue;325325- unsigned int multipliers[32]= {326326- 50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65,327327- -1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 };327327+ unsigned int ezra_t_multipliers[32]= {328328+ 90, 30, 40, 100, 55, 35, 45, 95,329329+ 50, 70, 80, 60, 120, 75, 85, 65,330330+ -1, 110, 120, -1, 135, 115, 125, 105,331331+ 130, 150, 160, 140, -1, 155, -1, 145 };328332 unsigned int j, k = 0;329333 union msr_longhaul longhaul;330334 unsigned long lo, hi;···355355 invalue = longhaul.bits.MaxMHzBR;356356 if (longhaul.bits.MaxMHzBR4)357357 invalue += 16;358358- maxmult=multipliers[invalue];358358+ maxmult=ezra_t_multipliers[invalue];359359360360 invalue = longhaul.bits.MinMHzBR;361361 if (longhaul.bits.MinMHzBR4 == 1)362362 minmult = 30;363363 else364364- minmult = multipliers[invalue];364364+ minmult = ezra_t_multipliers[invalue];365365 fsb = eblcr_fsb_table_v2[longhaul.bits.MaxMHzFSB];366366 break;367367 }···527527 return calc_speed(longhaul_get_cpu_mult());528528}529529530530+static acpi_status longhaul_walk_callback(acpi_handle obj_handle,531531+ u32 nesting_level,532532+ void *context, void **return_value)533533+{534534+ struct acpi_device *d;535535+536536+ if ( acpi_bus_get_device(obj_handle, &d) ) {537537+ return 0;538538+ }539539+ *return_value = (void *)acpi_driver_data(d);540540+ return 1;541541+}530542531543static int __init longhaul_cpu_init(struct cpufreq_policy *policy)532544{···546534 char *cpuname=NULL;547535 int ret;548536537537+ /* Check ACPI support for C3 state */538538+ acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,539539+ &longhaul_walk_callback, NULL, (void *)&pr);540540+ if (pr == NULL) goto err_acpi;541541+542542+ cx = &pr->power.states[ACPI_STATE_C3];543543+ if (cx->address == 0 || cx->latency > 1000) goto err_acpi;544544+545545+ /* Now check what we have on this motherboard */549546 switch (c->x86_model) {550547 case 6:551548 cpu_model = CPU_SAMUEL;···655634 cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu);656635657636 return 0;637637+638638+err_acpi:639639+ printk(KERN_ERR PFX "No ACPI support for CPU frequency changes.\n");640640+ return -ENODEV;658641}659642660643static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy)···691666 if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6)692667 return -ENODEV;693668669669+#ifdef CONFIG_SMP670670+ if (num_online_cpus() > 1) {671671+ return -ENODEV;672672+ printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n");673673+ }674674+#endif675675+#ifdef CONFIG_X86_IO_APIC676676+ if (cpu_has_apic) {677677+ printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n");678678+ return -ENODEV;679679+ }680680+#endif694681 switch (c->x86_model) {695682 case 6 ... 9:696683 return cpufreq_register_driver(&longhaul_driver);···736699MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");737700MODULE_LICENSE ("GPL");738701739739-module_init(longhaul_init);702702+late_initcall(longhaul_init);740703module_exit(longhaul_exit);741704
···217217 .body218218 ;;219219 ld8 loc2 = [loc2] // loc2 <- entry point220220- mov out0 = in0 // first argument221221- mov out1 = in1 // copy arg2222222- mov out2 = in2 // copy arg3223223- mov out3 = in3 // copy arg3224224- ;;225225- mov loc3 = psr // save psr220220+ mov loc3 = psr // save psr226221 ;;227222 mov loc4=ar.rsc // save RSE configuration228223 dep.z loc2=loc2,0,61 // convert pal entry point to physical···231236 ;;232237 andcm r16=loc3,r16 // removes bits to clear from psr233238 br.call.sptk.many rp=ia64_switch_mode_phys234234-.ret6:239239+240240+ mov out0 = in0 // first argument241241+ mov out1 = in1 // copy arg2242242+ mov out2 = in2 // copy arg3243243+ mov out3 = in3 // copy arg3235244 mov loc5 = r19236245 mov loc6 = r20246246+237247 br.call.sptk.many rp=b7 // now make the call238238-.ret7:248248+239249 mov ar.rsc=0 // put RSE in enforced lazy, LE mode240250 mov r16=loc3 // r16= original psr241251 mov r19=loc5242252 mov r20=loc6243253 br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode244254245245-.ret8: mov psr.l = loc3 // restore init PSR255255+ mov psr.l = loc3 // restore init PSR246256 mov ar.pfs = loc1247257 mov rp = loc0248258 ;;
+14-20
arch/ia64/kernel/palinfo.c
···566566 pal_version_u_t min_ver, cur_ver;567567 char *p = page;568568569569- /* The PAL_VERSION call is advertised as being able to support570570- * both physical and virtual mode calls. This seems to be a documentation571571- * bug rather than firmware bug. In fact, it does only support physical mode.572572- * So now the code reflects this fact and the pal_version() has been updated573573- * accordingly.574574- */575575- if (ia64_pal_version(&min_ver, &cur_ver) != 0) return 0;569569+ if (ia64_pal_version(&min_ver, &cur_ver) != 0)570570+ return 0;576571577572 p += sprintf(p,578573 "PAL_vendor : 0x%02x (min=0x%02x)\n"579579- "PAL_A : %x.%x.%x (min=%x.%x.%x)\n"580580- "PAL_B : %x.%x.%x (min=%x.%x.%x)\n",581581- cur_ver.pal_version_s.pv_pal_vendor, min_ver.pal_version_s.pv_pal_vendor,582582-583583- cur_ver.pal_version_s.pv_pal_a_model>>4,584584- cur_ver.pal_version_s.pv_pal_a_model&0xf, cur_ver.pal_version_s.pv_pal_a_rev,585585- min_ver.pal_version_s.pv_pal_a_model>>4,586586- min_ver.pal_version_s.pv_pal_a_model&0xf, min_ver.pal_version_s.pv_pal_a_rev,587587-588588- cur_ver.pal_version_s.pv_pal_b_model>>4,589589- cur_ver.pal_version_s.pv_pal_b_model&0xf, cur_ver.pal_version_s.pv_pal_b_rev,590590- min_ver.pal_version_s.pv_pal_b_model>>4,591591- min_ver.pal_version_s.pv_pal_b_model&0xf, min_ver.pal_version_s.pv_pal_b_rev);574574+ "PAL_A : %02x.%02x (min=%02x.%02x)\n"575575+ "PAL_B : %02x.%02x (min=%02x.%02x)\n",576576+ cur_ver.pal_version_s.pv_pal_vendor,577577+ min_ver.pal_version_s.pv_pal_vendor,578578+ cur_ver.pal_version_s.pv_pal_a_model,579579+ cur_ver.pal_version_s.pv_pal_a_rev,580580+ min_ver.pal_version_s.pv_pal_a_model,581581+ min_ver.pal_version_s.pv_pal_a_rev,582582+ cur_ver.pal_version_s.pv_pal_b_model,583583+ cur_ver.pal_version_s.pv_pal_b_rev,584584+ min_ver.pal_version_s.pv_pal_b_model,585585+ min_ver.pal_version_s.pv_pal_b_rev);592586 return p - page;593587}594588
+57-29
arch/ia64/kernel/uncached.c
···32323333extern void __init efi_memmap_walk_uc(efi_freemem_callback_t, void *);34343535-#define MAX_UNCACHED_GRANULES 53636-static int allocated_granules;3535+struct uncached_pool {3636+ struct gen_pool *pool;3737+ struct mutex add_chunk_mutex; /* serialize adding a converted chunk */3838+ int nchunks_added; /* #of converted chunks added to pool */3939+ atomic_t status; /* smp called function's return status*/4040+};37413838-struct gen_pool *uncached_pool[MAX_NUMNODES];4242+#define MAX_CONVERTED_CHUNKS_PER_NODE 24343+4444+struct uncached_pool uncached_pools[MAX_NUMNODES];394540464147static void uncached_ipi_visibility(void *data)4248{4349 int status;5050+ struct uncached_pool *uc_pool = (struct uncached_pool *)data;44514552 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);4653 if ((status != PAL_VISIBILITY_OK) &&4754 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))4848- printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "4949- "CPU %i\n", status, raw_smp_processor_id());5555+ atomic_inc(&uc_pool->status);5056}515752585359static void uncached_ipi_mc_drain(void *data)5460{5561 int status;6262+ struct uncached_pool *uc_pool = (struct uncached_pool *)data;56635764 status = ia64_pal_mc_drain();5858- if (status)5959- printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "6060- "CPU %i\n", status, raw_smp_processor_id());6565+ if (status != PAL_STATUS_SUCCESS)6666+ atomic_inc(&uc_pool->status);6167}62686369···7670 * This is accomplished by first allocating a granule of cached memory pages7771 * and then converting them to uncached memory pages.7872 */7979-static int uncached_add_chunk(struct gen_pool *pool, int nid)7373+static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)8074{8175 struct page *page;8282- int status, i;7676+ int status, i, nchunks_added = uc_pool->nchunks_added;8377 unsigned long c_addr, uc_addr;84788585- if (allocated_granules >= MAX_UNCACHED_GRANULES)7979+ if (mutex_lock_interruptible(&uc_pool->add_chunk_mutex) != 0)8080+ return -1; /* interrupted by a signal */8181+8282+ if (uc_pool->nchunks_added > nchunks_added) {8383+ /* someone added a new chunk while we were waiting */8484+ mutex_unlock(&uc_pool->add_chunk_mutex);8585+ return 0;8686+ }8787+8888+ if (uc_pool->nchunks_added >= MAX_CONVERTED_CHUNKS_PER_NODE) {8989+ mutex_unlock(&uc_pool->add_chunk_mutex);8690 return -1;9191+ }87928893 /* attempt to allocate a granule's worth of cached memory pages */89949095 page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO,9196 IA64_GRANULE_SHIFT-PAGE_SHIFT);9292- if (!page)9797+ if (!page) {9898+ mutex_unlock(&uc_pool->add_chunk_mutex);9399 return -1;100100+ }9410195102 /* convert the memory pages from cached to uncached */96103···121102 flush_tlb_kernel_range(uc_addr, uc_adddr + IA64_GRANULE_SIZE);122103123104 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);124124- if (!status) {125125- status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);126126- if (status)105105+ if (status == PAL_VISIBILITY_OK_REMOTE_NEEDED) {106106+ atomic_set(&uc_pool->status, 0);107107+ status = smp_call_function(uncached_ipi_visibility, uc_pool,108108+ 0, 1);109109+ if (status || atomic_read(&uc_pool->status))127110 goto failed;128128- }111111+ } else if (status != PAL_VISIBILITY_OK)112112+ goto failed;129113130114 preempt_disable();131115···142120143121 preempt_enable();144122145145- ia64_pal_mc_drain();146146- status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);147147- if (status)123123+ status = ia64_pal_mc_drain();124124+ if (status != PAL_STATUS_SUCCESS)125125+ goto failed;126126+ atomic_set(&uc_pool->status, 0);127127+ status = smp_call_function(uncached_ipi_mc_drain, uc_pool, 0, 1);128128+ if (status || atomic_read(&uc_pool->status))148129 goto failed;149130150131 /*151132 * The chunk of memory pages has been converted to uncached so now we152133 * can add it to the pool.153134 */154154- status = gen_pool_add(pool, uc_addr, IA64_GRANULE_SIZE, nid);135135+ status = gen_pool_add(uc_pool->pool, uc_addr, IA64_GRANULE_SIZE, nid);155136 if (status)156137 goto failed;157138158158- allocated_granules++;139139+ uc_pool->nchunks_added++;140140+ mutex_unlock(&uc_pool->add_chunk_mutex);159141 return 0;160142161143 /* failed to convert or add the chunk so give it back to the kernel */···168142 ClearPageUncached(&page[i]);169143170144 free_pages(c_addr, IA64_GRANULE_SHIFT-PAGE_SHIFT);145145+ mutex_unlock(&uc_pool->add_chunk_mutex);171146 return -1;172147}173148···185158unsigned long uncached_alloc_page(int starting_nid)186159{187160 unsigned long uc_addr;188188- struct gen_pool *pool;161161+ struct uncached_pool *uc_pool;189162 int nid;190163191164 if (unlikely(starting_nid >= MAX_NUMNODES))···198171 do {199172 if (!node_online(nid))200173 continue;201201- pool = uncached_pool[nid];202202- if (pool == NULL)174174+ uc_pool = &uncached_pools[nid];175175+ if (uc_pool->pool == NULL)203176 continue;204177 do {205205- uc_addr = gen_pool_alloc(pool, PAGE_SIZE);178178+ uc_addr = gen_pool_alloc(uc_pool->pool, PAGE_SIZE);206179 if (uc_addr != 0)207180 return uc_addr;208208- } while (uncached_add_chunk(pool, nid) == 0);181181+ } while (uncached_add_chunk(uc_pool, nid) == 0);209182210183 } while ((nid = (nid + 1) % MAX_NUMNODES) != starting_nid);211184···224197void uncached_free_page(unsigned long uc_addr)225198{226199 int nid = paddr_to_nid(uc_addr - __IA64_UNCACHED_OFFSET);227227- struct gen_pool *pool = uncached_pool[nid];200200+ struct gen_pool *pool = uncached_pools[nid].pool;228201229202 if (unlikely(pool == NULL))230203 return;···251224 unsigned long uc_end, void *arg)252225{253226 int nid = paddr_to_nid(uc_start - __IA64_UNCACHED_OFFSET);254254- struct gen_pool *pool = uncached_pool[nid];227227+ struct gen_pool *pool = uncached_pools[nid].pool;255228 size_t size = uc_end - uc_start;256229257230 touch_softlockup_watchdog();···269242 int nid;270243271244 for_each_online_node(nid) {272272- uncached_pool[nid] = gen_pool_create(PAGE_SHIFT, nid);245245+ uncached_pools[nid].pool = gen_pool_create(PAGE_SHIFT, nid);246246+ mutex_init(&uncached_pools[nid].add_chunk_mutex);273247 }274248275249 efi_memmap_walk_uc(uncached_build_memmap, NULL);
···571571}572572EXPORT_SYMBOL(rtas_set_indicator);573573574574+/*575575+ * Ignoring RTAS extended delay576576+ */577577+int rtas_set_indicator_fast(int indicator, int index, int new_value)578578+{579579+ int rc;580580+ int token = rtas_token("set-indicator");581581+582582+ if (token == RTAS_UNKNOWN_SERVICE)583583+ return -ENOENT;584584+585585+ rc = rtas_call(token, 3, 1, NULL, indicator, index, new_value);586586+587587+ WARN_ON(rc == -2 || (rc >= 9900 && rc <= 9905));588588+589589+ if (rc < 0)590590+ return rtas_error_rc(rc);591591+592592+ return rc;593593+}594594+574595void rtas_restart(char *cmd)575596{576597 if (rtas_flash_term_hook)
-2
arch/powerpc/platforms/pseries/setup.c
···213213{214214 unsigned long set, reset;215215216216- power4_enable_pmcs();217217-218216 set = 1UL << 63;219217 reset = 0;220218 plpar_hcall_norets(H_PERFMON, set, reset);
+3-3
arch/powerpc/platforms/pseries/xics.c
···447447 *448448 * XXX: undo of teardown on kexec needs this too, as may hotplug449449 */450450- rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,450450+ rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,451451 (1UL << interrupt_server_size) - 1 - default_distrib_server, 1);452452}453453···776776 * so leave the master cpu in the group.777777 */778778 if (secondary)779779- rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,779779+ rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,780780 (1UL << interrupt_server_size) - 1 -781781 default_distrib_server, 0);782782}···793793 xics_set_cpu_priority(cpu, 0);794794795795 /* remove ourselves from the global interrupt queue */796796- status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE,796796+ status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,797797 (1UL << interrupt_server_size) - 1 - default_distrib_server, 0);798798 WARN_ON(status < 0);799799
+7-3
arch/sh/kernel/cpu/sh4/sq.c
···421421422422static int __init sq_api_init(void)423423{424424+ int ret;424425 printk(KERN_NOTICE "sq: Registering store queue API.\n");425426426426-#ifdef CONFIG_PROC_FS427427 create_proc_read_entry("sq_mapping", 0, 0, sq_mapping_read_proc, 0);428428-#endif429428430430- return misc_register(&sq_dev);429429+ ret = misc_register(&sq_dev);430430+ if (ret)431431+ remove_proc_entry("sq_mapping", NULL);432432+433433+ return ret;431434}432435433436static void __exit sq_api_exit(void)434437{435438 misc_deregister(&sq_dev);439439+ remove_proc_entry("sq_mapping", NULL);436440}437441438442module_init(sq_api_init);
+11-7
arch/x86_64/kernel/entry.S
···513513 swapgs 5145141: incl %gs:pda_irqcount # RED-PEN should check preempt count515515 cmoveq %gs:pda_irqstackptr,%rsp516516+ push %rbp # backlink for old unwinder516517 /*517518 * We entered an interrupt context - irqs are off:518519 */···11401139END(machine_check)11411140#endif1142114111421142+/* Call softirq on interrupt stack. Interrupts are off. */11431143ENTRY(call_softirq)11441144 CFI_STARTPROC11451145- movq %gs:pda_irqstackptr,%rax11461146- movq %rsp,%rdx11471147- CFI_DEF_CFA_REGISTER rdx11451145+ push %rbp11461146+ CFI_ADJUST_CFA_OFFSET 811471147+ CFI_REL_OFFSET rbp,011481148+ mov %rsp,%rbp11491149+ CFI_DEF_CFA_REGISTER rbp11481150 incl %gs:pda_irqcount11491149- cmove %rax,%rsp11501150- pushq %rdx11511151- /*todo CFI_DEF_CFA_EXPRESSION ...*/11511151+ cmove %gs:pda_irqstackptr,%rsp11521152+ push %rbp # backlink for old unwinder11521153 call __do_softirq11531153- popq %rsp11541154+ leaveq11541155 CFI_DEF_CFA_REGISTER rsp11561156+ CFI_ADJUST_CFA_OFFSET -811551157 decl %gs:pda_irqcount11561158 ret11571159 CFI_ENDPROC
+2
arch/x86_64/kernel/pci-nommu.c
···9292{9393 if (dma_ops)9494 return;9595+9696+ force_iommu = 0; /* no HW IOMMU */9597 dma_ops = &nommu_dma_ops;9698}
···129129 struct acpi_memory_info *info, *n;130130131131132132+ if (!list_empty(&mem_device->res_list))133133+ return 0;134134+132135 status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,133136 acpi_memory_get_resource, mem_device);134137 if (ACPI_FAILURE(status)) {135138 list_for_each_entry_safe(info, n, &mem_device->res_list, list)136139 kfree(info);140140+ INIT_LIST_HEAD(&mem_device->res_list);137141 return -EINVAL;138142 }139143···234230 * (i.e. memory-hot-remove function)235231 */236232 list_for_each_entry(info, &mem_device->res_list, list) {237237- u64 start_pfn, end_pfn;238238-239239- start_pfn = info->start_addr >> PAGE_SHIFT;240240- end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;241241-242242- if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {243243- /* already enabled. try next area */233233+ if (info->enabled) { /* just sanity check...*/244234 num_enabled++;245235 continue;246236 }247247-248237 result = add_memory(node, info->start_addr, info->length);249238 if (result)250239 continue;
+6-7
drivers/acpi/dock.c
···5858};59596060#define DOCK_DOCKING 0x000000016161-#define DOCK_EVENT KOBJ_DOCK6262-#define UNDOCK_EVENT KOBJ_UNDOCK6161+#define DOCK_EVENT 36262+#define UNDOCK_EVENT 263636464static struct dock_station *dock_station;6565···322322323323static void dock_event(struct dock_station *ds, u32 event, int num)324324{325325- struct acpi_device *device;326326-327327- device = dock_create_acpi_device(ds->handle);328328- if (device)329329- kobject_uevent(&device->kobj, num);325325+ /*326326+ * we don't do events until someone tells me that327327+ * they would like to have them.328328+ */330329}331330332331/**
+3-5
drivers/char/hvsi.c
···311311 /* CD went away; no more connection */312312 pr_debug("hvsi%i: CD dropped\n", hp->index);313313 hp->mctrl &= TIOCM_CD;314314- if (!(hp->tty->flags & CLOCAL))314314+ /* If userland hasn't done an open(2) yet, hp->tty is NULL. */315315+ if (hp->tty && !(hp->tty->flags & CLOCAL))315316 *to_hangup = hp->tty;316317 }317318 break;···987986 start_j = 0;988987#endif /* DEBUG */989988 wake_up_all(&hp->emptyq);990990- if (test_bit(TTY_DO_WRITE_WAKEUP, &hp->tty->flags)991991- && hp->tty->ldisc.write_wakeup)992992- hp->tty->ldisc.write_wakeup(hp->tty);993993- wake_up_interruptible(&hp->tty->write_wait);989989+ tty_wakeup(hp->tty);994990 }995991996992out:
+24-27
drivers/char/hw_random/omap-rng.c
···2525#include <linux/module.h>2626#include <linux/init.h>2727#include <linux/random.h>2828+#include <linux/clk.h>2829#include <linux/err.h>2929-#include <linux/device.h>3030+#include <linux/platform_device.h>3031#include <linux/hw_random.h>31323233#include <asm/io.h>3333-#include <asm/hardware/clock.h>34343535#define RNG_OUT_REG 0x00 /* Output register */3636#define RNG_STAT_REG 0x04 /* Status register···52525353static void __iomem *rng_base;5454static struct clk *rng_ick;5555-static struct device *rng_dev;5555+static struct platform_device *rng_dev;56565757static u32 omap_rng_read_reg(int reg)5858{···8383 .data_read = omap_rng_data_read,8484};85858686-static int __init omap_rng_probe(struct device *dev)8686+static int __init omap_rng_probe(struct platform_device *pdev)8787{8888- struct platform_device *pdev = to_platform_device(dev);8988 struct resource *res, *mem;9089 int ret;9190···9495 */9596 BUG_ON(rng_dev);96979797- if (cpu_is_omap24xx()) {9898+ if (cpu_is_omap24xx()) {9899 rng_ick = clk_get(NULL, "rng_ick");99100 if (IS_ERR(rng_ick)) {100100- dev_err(dev, "Could not get rng_ick\n");101101+ dev_err(&pdev->dev, "Could not get rng_ick\n");101102 ret = PTR_ERR(rng_ick);102103 return ret;103103- }104104- else {105105- clk_use(rng_ick);106106- }104104+ } else105105+ clk_enable(rng_ick);107106 }108107109108 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);···114117 if (mem == NULL)115118 return -EBUSY;116119117117- dev_set_drvdata(dev, mem);120120+ dev_set_drvdata(&pdev->dev, mem);118121 rng_base = (u32 __iomem *)io_p2v(res->start);119122120123 ret = hwrng_register(&omap_rng_ops);···124127 return ret;125128 }126129127127- dev_info(dev, "OMAP Random Number Generator ver. %02x\n",130130+ dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",128131 omap_rng_read_reg(RNG_REV_REG));129132 omap_rng_write_reg(RNG_MASK_REG, 0x1);130133131131- rng_dev = dev;134134+ rng_dev = pdev;132135133136 return 0;134137}135138136136-static int __exit omap_rng_remove(struct device *dev)139139+static int __exit omap_rng_remove(struct platform_device *pdev)137140{138138- struct resource *mem = dev_get_drvdata(dev);141141+ struct resource *mem = dev_get_drvdata(&pdev->dev);139142140143 hwrng_unregister(&omap_rng_ops);141144142145 omap_rng_write_reg(RNG_MASK_REG, 0x0);143146144147 if (cpu_is_omap24xx()) {145145- clk_unuse(rng_ick);148148+ clk_disable(rng_ick);146149 clk_put(rng_ick);147150 }148151···154157155158#ifdef CONFIG_PM156159157157-static int omap_rng_suspend(struct device *dev, pm_message_t message, u32 level)160160+static int omap_rng_suspend(struct platform_device *pdev, pm_message_t message)158161{159162 omap_rng_write_reg(RNG_MASK_REG, 0x0);160160-161163 return 0;162164}163165164164-static int omap_rng_resume(struct device *dev, pm_message_t message, u32 level)166166+static int omap_rng_resume(struct platform_device *pdev)165167{166168 omap_rng_write_reg(RNG_MASK_REG, 0x1);167167-168168- return 1;169169+ return 0;169170}170171171172#else···174179#endif175180176181177177-static struct device_driver omap_rng_driver = {178178- .name = "omap_rng",179179- .bus = &platform_bus_type,182182+static struct platform_driver omap_rng_driver = {183183+ .driver = {184184+ .name = "omap_rng",185185+ .owner = THIS_MODULE,186186+ },180187 .probe = omap_rng_probe,181188 .remove = __exit_p(omap_rng_remove),182189 .suspend = omap_rng_suspend,···190193 if (!cpu_is_omap16xx() && !cpu_is_omap24xx())191194 return -ENODEV;192195193193- return driver_register(&omap_rng_driver);196196+ return platform_driver_register(&omap_rng_driver);194197}195198196199static void __exit omap_rng_exit(void)197200{198198- driver_unregister(&omap_rng_driver);201201+ platform_driver_unregister(&omap_rng_driver);199202}200203201204module_init(omap_rng_init);
+78-61
drivers/char/keyboard.c
···107107108108struct kbd_struct kbd_table[MAX_NR_CONSOLES];109109static struct kbd_struct *kbd = kbd_table;110110-static struct kbd_struct kbd0;111110112111int spawnpid, spawnsig;113112···222223{223224 struct list_head *node;224225225225- list_for_each(node,&kbd_handler.h_list) {226226+ list_for_each(node, &kbd_handler.h_list) {226227 struct input_handle *handle = to_handle_h(node);227228 if (test_bit(EV_SND, handle->dev->evbit)) {228229 if (test_bit(SND_TONE, handle->dev->sndbit))229229- input_event(handle->dev, EV_SND, SND_TONE, 0);230230+ input_inject_event(handle, EV_SND, SND_TONE, 0);230231 if (test_bit(SND_BELL, handle->dev->sndbit))231231- input_event(handle->dev, EV_SND, SND_BELL, 0);232232+ input_inject_event(handle, EV_SND, SND_BELL, 0);232233 }233234 }234235}···246247 struct input_handle *handle = to_handle_h(node);247248 if (test_bit(EV_SND, handle->dev->evbit)) {248249 if (test_bit(SND_TONE, handle->dev->sndbit)) {249249- input_event(handle->dev, EV_SND, SND_TONE, hz);250250+ input_inject_event(handle, EV_SND, SND_TONE, hz);250251 break;251252 }252253 if (test_bit(SND_BELL, handle->dev->sndbit)) {253253- input_event(handle->dev, EV_SND, SND_BELL, 1);254254+ input_inject_event(handle, EV_SND, SND_BELL, 1);254255 break;255256 }256257 }···271272 unsigned int d = 0;272273 unsigned int p = 0;273274274274- list_for_each(node,&kbd_handler.h_list) {275275+ list_for_each(node, &kbd_handler.h_list) {275276 struct input_handle *handle = to_handle_h(node);276277 struct input_dev *dev = handle->dev;277278278279 if (test_bit(EV_REP, dev->evbit)) {279280 if (rep->delay > 0)280280- input_event(dev, EV_REP, REP_DELAY, rep->delay);281281+ input_inject_event(handle, EV_REP, REP_DELAY, rep->delay);281282 if (rep->period > 0)282282- input_event(dev, EV_REP, REP_PERIOD, rep->period);283283+ input_inject_event(handle, EV_REP, REP_PERIOD, rep->period);283284 d = dev->rep[REP_DELAY];284285 p = dev->rep[REP_PERIOD];285286 }···987988 * interrupt routines for this thing allows us to easily mask988989 * this when we don't want any of the above to happen.989990 * This allows for easy and efficient race-condition prevention990990- * for kbd_refresh_leds => input_event(dev, EV_LED, ...) => ...991991+ * for kbd_start => input_inject_event(dev, EV_LED, ...) => ...991992 */992993993994static void kbd_bh(unsigned long dummy)···997998998999 if (leds != ledstate) {9991000 list_for_each(node, &kbd_handler.h_list) {10001000- struct input_handle * handle = to_handle_h(node);10011001- input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));10021002- input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));10031003- input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));10041004- input_sync(handle->dev);10011001+ struct input_handle *handle = to_handle_h(node);10021002+ input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));10031003+ input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));10041004+ input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));10051005+ input_inject_event(handle, EV_SYN, SYN_REPORT, 0);10051006 }10061007 }10071008···10091010}1010101110111012DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);10121012-10131013-/*10141014- * This allows a newly plugged keyboard to pick the LED state.10151015- */10161016-static void kbd_refresh_leds(struct input_handle *handle)10171017-{10181018- unsigned char leds = ledstate;10191019-10201020- tasklet_disable(&keyboard_tasklet);10211021- if (leds != 0xff) {10221022- input_event(handle->dev, EV_LED, LED_SCROLLL, !!(leds & 0x01));10231023- input_event(handle->dev, EV_LED, LED_NUML, !!(leds & 0x02));10241024- input_event(handle->dev, EV_LED, LED_CAPSL, !!(leds & 0x04));10251025- input_sync(handle->dev);10261026- }10271027- tasklet_enable(&keyboard_tasklet);10281028-}1029101310301014#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) ||\10311015 defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) ||\···10251043 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,10261044 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,10271045 80, 81, 82, 83, 84,118, 86, 87, 88,115,120,119,121,112,123, 92,10281028- 284,285,309,298,312, 91,327,328,329,331,333,335,336,337,338,339,10461046+ 284,285,309, 0,312, 91,327,328,329,331,333,335,336,337,338,339,10291047 367,288,302,304,350, 89,334,326,267,126,268,269,125,347,348,349,10301048 360,261,262,263,268,376,100,101,321,316,373,286,289,102,351,355,10311049 103,104,105,275,287,279,306,106,274,107,294,364,358,363,362,361,···10471065static int emulate_raw(struct vc_data *vc, unsigned int keycode,10481066 unsigned char up_flag)10491067{10501050- if (keycode > 255 || !x86_keycodes[keycode])10511051- return -1;10681068+ int code;1052106910531070 switch (keycode) {10541071 case KEY_PAUSE:10551072 put_queue(vc, 0xe1);10561073 put_queue(vc, 0x1d | up_flag);10571074 put_queue(vc, 0x45 | up_flag);10581058- return 0;10751075+ break;10761076+10591077 case KEY_HANGEUL:10601078 if (!up_flag)10611079 put_queue(vc, 0xf2);10621062- return 0;10801080+ break;10811081+10631082 case KEY_HANJA:10641083 if (!up_flag)10651084 put_queue(vc, 0xf1);10661066- return 0;10671067- }10851085+ break;1068108610691069- if (keycode == KEY_SYSRQ && sysrq_alt) {10701070- put_queue(vc, 0x54 | up_flag);10711071- return 0;10721072- }10871087+ case KEY_SYSRQ:10881088+ /*10891089+ * Real AT keyboards (that's what we're trying10901090+ * to emulate here emit 0xe0 0x2a 0xe0 0x37 when10911091+ * pressing PrtSc/SysRq alone, but simply 0x5410921092+ * when pressing Alt+PrtSc/SysRq.10931093+ */10941094+ if (sysrq_alt) {10951095+ put_queue(vc, 0x54 | up_flag);10961096+ } else {10971097+ put_queue(vc, 0xe0);10981098+ put_queue(vc, 0x2a | up_flag);10991099+ put_queue(vc, 0xe0);11001100+ put_queue(vc, 0x37 | up_flag);11011101+ }11021102+ break;1073110310741074- if (x86_keycodes[keycode] & 0x100)10751075- put_queue(vc, 0xe0);11041104+ default:11051105+ if (keycode > 255)11061106+ return -1;1076110710771077- put_queue(vc, (x86_keycodes[keycode] & 0x7f) | up_flag);11081108+ code = x86_keycodes[keycode];11091109+ if (!code)11101110+ return -1;1078111110791079- if (keycode == KEY_SYSRQ) {10801080- put_queue(vc, 0xe0);10811081- put_queue(vc, 0x37 | up_flag);11121112+ if (code & 0x100)11131113+ put_queue(vc, 0xe0);11141114+ put_queue(vc, (code & 0x7f) | up_flag);11151115+11161116+ break;10821117 }1083111810841119 return 0;···12971298 if (i == BTN_MISC && !test_bit(EV_SND, dev->evbit))12981299 return NULL;1299130013001300- if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))13011301+ handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);13021302+ if (!handle)13011303 return NULL;13021302- memset(handle, 0, sizeof(struct input_handle));1303130413041305 handle->dev = dev;13051306 handle->handler = handler;13061307 handle->name = "kbd";1307130813081309 input_open_device(handle);13091309- kbd_refresh_leds(handle);1310131013111311 return handle;13121312}···13141316{13151317 input_close_device(handle);13161318 kfree(handle);13191319+}13201320+13211321+/*13221322+ * Start keyboard handler on the new keyboard by refreshing LED state to13231323+ * match the rest of the system.13241324+ */13251325+static void kbd_start(struct input_handle *handle)13261326+{13271327+ unsigned char leds = ledstate;13281328+13291329+ tasklet_disable(&keyboard_tasklet);13301330+ if (leds != 0xff) {13311331+ input_inject_event(handle, EV_LED, LED_SCROLLL, !!(leds & 0x01));13321332+ input_inject_event(handle, EV_LED, LED_NUML, !!(leds & 0x02));13331333+ input_inject_event(handle, EV_LED, LED_CAPSL, !!(leds & 0x04));13341334+ input_inject_event(handle, EV_SYN, SYN_REPORT, 0);13351335+ }13361336+ tasklet_enable(&keyboard_tasklet);13171337}1318133813191339static struct input_device_id kbd_ids[] = {···13541338 .event = kbd_event,13551339 .connect = kbd_connect,13561340 .disconnect = kbd_disconnect,13411341+ .start = kbd_start,13571342 .name = "kbd",13581343 .id_table = kbd_ids,13591344};···13631346{13641347 int i;1365134813661366- kbd0.ledflagstate = kbd0.default_ledflagstate = KBD_DEFLEDS;13671367- kbd0.ledmode = LED_SHOW_FLAGS;13681368- kbd0.lockstate = KBD_DEFLOCK;13691369- kbd0.slockstate = 0;13701370- kbd0.modeflags = KBD_DEFMODE;13711371- kbd0.kbdmode = VC_XLATE;13721372-13731373- for (i = 0 ; i < MAX_NR_CONSOLES ; i++)13741374- kbd_table[i] = kbd0;13491349+ for (i = 0; i < MAX_NR_CONSOLES; i++) {13501350+ kbd_table[i].ledflagstate = KBD_DEFLEDS;13511351+ kbd_table[i].default_ledflagstate = KBD_DEFLEDS;13521352+ kbd_table[i].ledmode = LED_SHOW_FLAGS;13531353+ kbd_table[i].lockstate = KBD_DEFLOCK;13541354+ kbd_table[i].slockstate = 0;13551355+ kbd_table[i].modeflags = KBD_DEFMODE;13561356+ kbd_table[i].kbdmode = VC_XLATE;13571357+ }1375135813761359 input_register_handler(&kbd_handler);13771360
···232232 unsigned long timeout;233233234234 timeout = jiffies + POLL_TIMEOUT;235235- while (time_before(jiffies, timeout)) {235235+ while (1) {236236 status = inb(ACBST);237237238238 /* Reset the status register to avoid the hang */···242242 scx200_acb_machine(iface, status);243243 return;244244 }245245- yield();245245+ if (time_after(jiffies, timeout))246246+ break;247247+ cpu_relax();248248+ cond_resched();246249 }247250248251 dev_err(&iface->adapter.dev, "timeout in state %s\n",
···975975976976 cm_id_priv->timewait_info = cm_create_timewait_info(cm_id_priv->977977 id.local_id);978978- if (IS_ERR(cm_id_priv->timewait_info))978978+ if (IS_ERR(cm_id_priv->timewait_info)) {979979+ ret = PTR_ERR(cm_id_priv->timewait_info);979980 goto out;981981+ }980982981983 ret = cm_init_av_by_path(param->primary_path, &cm_id_priv->av);982984 if (ret)
···108108 * serialize access to the array.109109 */110110111111+#define MTHCA_ARRAY_MASK (PAGE_SIZE / sizeof (void *) - 1)112112+111113void *mthca_array_get(struct mthca_array *array, int index)112114{113115 int p = (index * sizeof (void *)) >> PAGE_SHIFT;114116115115- if (array->page_list[p].page) {116116- int i = index & (PAGE_SIZE / sizeof (void *) - 1);117117- return array->page_list[p].page[i];118118- } else117117+ if (array->page_list[p].page)118118+ return array->page_list[p].page[index & MTHCA_ARRAY_MASK];119119+ else119120 return NULL;120121}121122···131130 if (!array->page_list[p].page)132131 return -ENOMEM;133132134134- array->page_list[p].page[index & (PAGE_SIZE / sizeof (void *) - 1)] =135135- value;133133+ array->page_list[p].page[index & MTHCA_ARRAY_MASK] = value;136134 ++array->page_list[p].used;137135138136 return 0;···144144 if (--array->page_list[p].used == 0) {145145 free_page((unsigned long) array->page_list[p].page);146146 array->page_list[p].page = NULL;147147- }147147+ } else148148+ array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;148149149150 if (array->page_list[p].used < 0)150151 pr_debug("Array %p index %d page %d with ref count %d < 0\n",
+1-2
drivers/infiniband/ulp/ipoib/Kconfig
···66 transports IP packets over InfiniBand so you can use your IB77 device as a fancy NIC.8899- The IPoIB protocol is defined by the IETF ipoib working1010- group: <http://www.ietf.org/html.charters/ipoib-charter.html>.99+ See Documentation/infiniband/ipoib.txt for more information11101211config INFINIBAND_IPOIB_DEBUG1312 bool "IP-over-InfiniBand debugging" if EMBEDDED
+17-2
drivers/infiniband/ulp/srp/ib_srp.c
···77777878static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad };79798080+static int mellanox_workarounds = 1;8181+8282+module_param(mellanox_workarounds, int, 0444);8383+MODULE_PARM_DESC(mellanox_workarounds,8484+ "Enable workarounds for Mellanox SRP target bugs if != 0");8585+8686+static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 };8787+8088static void srp_add_one(struct ib_device *device);8189static void srp_remove_one(struct ib_device *device);8290static void srp_completion(struct ib_cq *cq, void *target_ptr);···534526 while (ib_poll_cq(target->cq, 1, &wc) > 0)535527 ; /* nothing */536528529529+ spin_lock_irq(target->scsi_host->host_lock);537530 list_for_each_entry_safe(req, tmp, &target->req_queue, list)538531 srp_reset_req(target, req);532532+ spin_unlock_irq(target->scsi_host->host_lock);539533540534 target->rx_head = 0;541535 target->tx_head = 0;···577567 return ret;578568}579569580580-static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat,570570+static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat,581571 int sg_cnt, struct srp_request *req,582572 struct srp_direct_buf *buf)583573{···587577 int page_cnt;588578 int i, j;589579 int ret;580580+ struct srp_device *dev = target->srp_host->dev;590581591582 if (!dev->fmr_pool)592583 return -ENODEV;584584+585585+ if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) &&586586+ mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3))587587+ return -EINVAL;593588594589 len = page_cnt = 0;595590 for (i = 0; i < sg_cnt; ++i) {···698683 buf->va = cpu_to_be64(sg_dma_address(scat));699684 buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey);700685 buf->len = cpu_to_be32(sg_dma_len(scat));701701- } else if (srp_map_fmr(target->srp_host->dev, scat, count, req,686686+ } else if (srp_map_fmr(target, scat, count, req,702687 (void *) cmd->add_data)) {703688 /*704689 * FMR mapping failed, and the scatterlist has more
+3-7
drivers/input/evdev.c
···127127{128128 struct evdev_list *list;129129 int i = iminor(inode) - EVDEV_MINOR_BASE;130130- int accept_err;131130132131 if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist)133132 return -ENODEV;134134-135135- if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file)))136136- return accept_err;137133138134 if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL)))139135 return -ENOMEM;···256260257261 if (evdev_event_from_user(buffer + retval, &event))258262 return -EFAULT;259259- input_event(list->evdev->handle.dev, event.type, event.code, event.value);263263+ input_inject_event(&list->evdev->handle, event.type, event.code, event.value);260264 retval += evdev_event_size();261265 }262266···424428 if (get_user(v, ip + 1))425429 return -EFAULT;426430427427- input_event(dev, EV_REP, REP_DELAY, u);428428- input_event(dev, EV_REP, REP_PERIOD, v);431431+ input_inject_event(&evdev->handle, EV_REP, REP_DELAY, u);432432+ input_inject_event(&evdev->handle, EV_REP, REP_PERIOD, v);429433430434 return 0;431435
···35353636static struct input_handler *input_table[8];37373838+/**3939+ * input_event() - report new input event4040+ * @handle: device that generated the event4141+ * @type: type of the event4242+ * @code: event code4343+ * @value: value of the event4444+ *4545+ * This function should be used by drivers implementing various input devices4646+ * See also input_inject_event()4747+ */3848void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)3949{4050 struct input_handle *handle;···193183}194184EXPORT_SYMBOL(input_event);195185186186+/**187187+ * input_inject_event() - send input event from input handler188188+ * @handle: input handle to send event through189189+ * @type: type of the event190190+ * @code: event code191191+ * @value: value of the event192192+ *193193+ * Similar to input_event() but will ignore event if device is "grabbed" and handle194194+ * injecting event is not the one that owns the device.195195+ */196196+void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)197197+{198198+ if (!handle->dev->grab || handle->dev->grab == handle)199199+ input_event(handle->dev, type, code, value);200200+}201201+EXPORT_SYMBOL(input_inject_event);202202+196203static void input_repeat_key(unsigned long data)197204{198205 struct input_dev *dev = (void *) data;···224197 mod_timer(&dev->timer, jiffies + msecs_to_jiffies(dev->rep[REP_PERIOD]));225198}226199227227-int input_accept_process(struct input_handle *handle, struct file *file)228228-{229229- if (handle->dev->accept)230230- return handle->dev->accept(handle->dev, file);231231-232232- return 0;233233-}234234-EXPORT_SYMBOL(input_accept_process);235235-236200int input_grab_device(struct input_handle *handle)237201{238202 if (handle->dev->grab)···236218237219void input_release_device(struct input_handle *handle)238220{239239- if (handle->dev->grab == handle)240240- handle->dev->grab = NULL;221221+ struct input_dev *dev = handle->dev;222222+223223+ if (dev->grab == handle) {224224+ dev->grab = NULL;225225+226226+ list_for_each_entry(handle, &dev->h_list, d_node)227227+ if (handle->handler->start)228228+ handle->handler->start(handle);229229+ }241230}242231EXPORT_SYMBOL(input_release_device);243232···988963 list_for_each_entry(handler, &input_handler_list, node)989964 if (!handler->blacklist || !input_match_device(handler->blacklist, dev))990965 if ((id = input_match_device(handler->id_table, dev)))991991- if ((handle = handler->connect(handler, dev, id)))966966+ if ((handle = handler->connect(handler, dev, id))) {992967 input_link_handle(handle);968968+ if (handler->start)969969+ handler->start(handle);970970+ }993971994972 input_wakeup_procfs_readers();995973···10561028 list_for_each_entry(dev, &input_dev_list, node)10571029 if (!handler->blacklist || !input_match_device(handler->blacklist, dev))10581030 if ((id = input_match_device(handler->id_table, dev)))10591059- if ((handle = handler->connect(handler, dev, id)))10311031+ if ((handle = handler->connect(handler, dev, id))) {10601032 input_link_handle(handle);10331033+ if (handler->start)10341034+ handler->start(handle);10351035+ }1061103610621037 input_wakeup_procfs_readers();10631038}
+10-9
drivers/input/joystick/iforce/iforce-main.c
···7979 { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //?8080 { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //?8181 { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //?8282+ { 0x06d6, 0x29bc, "Trust Force Feedback Race Master", btn_wheel, abs_wheel, ff_iforce },8283 { 0x0000, 0x0000, "Unknown I-Force Device [%04x:%04x]", btn_joystick, abs_joystick, ff_iforce }8384};8485···223222 int err = 0;224223 struct iforce_core_effect* core_effect;225224226226- /* Check who is trying to erase this effect */227227- if (iforce->core_effects[effect_id].owner != current->pid) {228228- printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, iforce->core_effects[effect_id].owner);229229- return -EACCES;230230- }231231-232225 if (effect_id < 0 || effect_id >= FF_EFFECTS_MAX)233226 return -EINVAL;234227235235- core_effect = iforce->core_effects + effect_id;228228+ core_effect = &iforce->core_effects[effect_id];229229+230230+ /* Check who is trying to erase this effect */231231+ if (core_effect->owner != current->pid) {232232+ printk(KERN_WARNING "iforce-main.c: %d tried to erase an effect belonging to %d\n", current->pid, core_effect->owner);233233+ return -EACCES;234234+ }236235237236 if (test_bit(FF_MOD1_IS_USED, core_effect->flags))238238- err = release_resource(&(iforce->core_effects[effect_id].mod1_chunk));237237+ err = release_resource(&core_effect->mod1_chunk);239238240239 if (!err && test_bit(FF_MOD2_IS_USED, core_effect->flags))241241- err = release_resource(&(iforce->core_effects[effect_id].mod2_chunk));240240+ err = release_resource(&core_effect->mod2_chunk);242241243242 /*TODO: remember to change that if more FF_MOD* bits are added */244243 core_effect->flags[0] = 0;
···162162 goto out;163163 }164164165165- min_spacing = mddev->array_size;165165+ min_spacing = conf->array_size;166166 sector_div(min_spacing, PAGE_SIZE/sizeof(struct dev_info *));167167168168 /* min_spacing is the minimum spacing that will fit the hash···171171 * that is larger than min_spacing as use the size of that as172172 * the actual spacing173173 */174174- conf->hash_spacing = mddev->array_size;174174+ conf->hash_spacing = conf->array_size;175175 for (i=0; i < cnt-1 ; i++) {176176 sector_t sz = 0;177177 int j;···228228 curr_offset = 0;229229 i = 0;230230 for (curr_offset = 0;231231- curr_offset < mddev->array_size;231231+ curr_offset < conf->array_size;232232 curr_offset += conf->hash_spacing) {233233234234 while (i < mddev->raid_disks-1 &&
+9-6
drivers/media/dvb/dvb-core/dvb_frontend.c
···526526 fepriv->delay = 3*HZ;527527 fepriv->status = 0;528528 fepriv->wakeup = 0;529529- fepriv->reinitialise = 1;529529+ fepriv->reinitialise = 0;530530+531531+ dvb_frontend_init(fe);530532531533 while (1) {532534 up(&fepriv->sem); /* is locked when we enter the thread... */···10151013 return ret;1016101410171015 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {10161016+10171017+ /* normal tune mode when opened R/W */10181018+ fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;10191019+ fepriv->tone = -1;10201020+ fepriv->voltage = -1;10211021+10181022 ret = dvb_frontend_start (fe);10191023 if (ret)10201024 dvb_generic_release (inode, file);1021102510221026 /* empty event queue */10231027 fepriv->events.eventr = fepriv->events.eventw = 0;10241024-10251025- /* normal tune mode when opened R/W */10261026- fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;10271027- fepriv->tone = -1;10281028- fepriv->voltage = -1;10291028 }1030102910311030 return ret;
···5252 struct dmx_frontend hw_frontend;5353 struct dmx_frontend mem_frontend;54545555- int fe_synced;5656- struct mutex pid_mutex;5757-5855 int ci_present;5956 int video_port;6057···71747275 struct dvb_adapter dvb_adapter;7376 struct dvb_frontend *dvb_frontend;7777+ int (*read_fe_status)(struct dvb_frontend *fe, fe_status_t *status);7878+ int fe_synced;7979+7480 void *priv;7581};7682···106106extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,107107 struct saa7146_pci_extension_data *info,108108 struct module *owner);109109+extern void ttpci_budget_init_hooks(struct budget *budget);109110extern int ttpci_budget_deinit(struct budget *budget);110111extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);111112extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
+2-2
drivers/media/video/Kconfig
···145145146146config VIDEO_SAA5249147147 tristate "SAA5249 Teletext processor"148148- depends on VIDEO_DEV && I2C148148+ depends on VIDEO_DEV && I2C && VIDEO_V4L1149149 help150150 Support for I2C bus based teletext using the SAA5249 chip. At the151151 moment this is only useful on some European WinTV cards.···155155156156config TUNER_3036157157 tristate "SAB3036 tuner"158158- depends on VIDEO_DEV && I2C158158+ depends on VIDEO_DEV && I2C && VIDEO_V4L1159159 help160160 Say Y here to include support for Philips SAB3036 compatible tuners.161161 If in doubt, say N.
+1-1
drivers/media/video/bt8xx/Kconfig
···11config VIDEO_BT84822 tristate "BT848 Video For Linux"33- depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L233+ depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L144 select I2C_ALGOBIT55 select FW_LOADER66 select VIDEO_BTCX
···3131#include <asm/io.h>3232#include "bttvp.h"33333434-/* Offset from line sync pulse leading edge (0H) in 1 / sampling_rate:3535- bt8x8 /HRESET pulse starts at 0H and has length 64 / fCLKx1 (E|O_VTC3636- HSFMT = 0). VBI_HDELAY (always 0) is an offset from the trailing edge3737- of /HRESET in 1 / fCLKx1, and the sampling_rate tvnorm->Fsc is fCLKx2. */3838-#define VBI_OFFSET ((64 + 0) * 2)3434+/* Offset from line sync pulse leading edge (0H) to start of VBI capture,3535+ in fCLKx2 pixels. According to the datasheet, VBI capture starts3636+ VBI_HDELAY fCLKx1 pixels from the tailing edgeof /HRESET, and /HRESET3737+ is 64 fCLKx1 pixels wide. VBI_HDELAY is set to 0, so this should be3838+ (64 + 0) * 2 = 128 fCLKx2 pixels. But it's not! The datasheet is3939+ Just Plain Wrong. The real value appears to be different for4040+ different revisions of the bt8x8 chips, and to be affected by the4141+ horizontal scaling factor. Experimentally, the value is measured4242+ to be about 244. */4343+#define VBI_OFFSET 24439444045#define VBI_DEFLINES 164146#define VBI_MAXLINES 32
+24
drivers/media/video/compat_ioctl32.c
···490490 return 0;491491}492492493493+struct video_code32494494+{495495+ char loadwhat[16]; /* name or tag of file being passed */496496+ compat_int_t datasize;497497+ unsigned char *data;498498+};499499+500500+static inline int microcode32(struct video_code *kp, struct video_code32 __user *up)501501+{502502+ if(!access_ok(VERIFY_READ, up, sizeof(struct video_code32)) ||503503+ copy_from_user(kp->loadwhat, up->loadwhat, sizeof (up->loadwhat)) ||504504+ get_user(kp->datasize, &up->datasize) ||505505+ copy_from_user(kp->data, up->data, up->datasize))506506+ return -EFAULT;507507+ return 0;508508+}509509+493510#define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32)494511#define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32)495512#define VIDIOCGWIN32 _IOR('v',9, struct video_window32)···515498#define VIDIOCSFBUF32 _IOW('v',12, struct video_buffer32)516499#define VIDIOCGFREQ32 _IOR('v',14, u32)517500#define VIDIOCSFREQ32 _IOW('v',15, u32)501501+#define VIDIOCSMICROCODE32 _IOW('v',27, struct video_code32)518502519503/* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */520504#define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4)···608590 struct video_tuner vt;609591 struct video_buffer vb;610592 struct video_window vw;593593+ struct video_code vc;611594 struct v4l2_format v2f;612595 struct v4l2_buffer v2b;613596 struct v4l2_framebuffer v2fb;···647628 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break;648629 case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break;649630 case VIDIOC_TRY_FMT32: cmd = VIDIOC_TRY_FMT; break;631631+ case VIDIOCSMICROCODE32: cmd = VIDIOCSMICROCODE; break;650632 };651633652634 switch(cmd) {···723703 case VIDIOC_G_FBUF:724704 case VIDIOC_G_INPUT:725705 compatible_arg = 0;706706+ case VIDIOCSMICROCODE:707707+ err = microcode32(&karg.vc, up);708708+ compatible_arg = 0;709709+ break;726710 };727711728712 if(err)
+1-1
drivers/media/video/cpia2/Kconfig
···11config VIDEO_CPIA222 tristate "CPiA2 Video For Linux"33- depends on VIDEO_DEV && USB33+ depends on VIDEO_DEV && USB && VIDEO_V4L144 ---help---55 This is the video4linux driver for cameras based on Vision's CPiA266 (Colour Processor Interface ASIC), such as the Digital Blue QX5
+1-1
drivers/media/video/cx88/cx88-input.c
···89899090 auxgpio = cx_read(MO_GP1_IO);9191 /* Take out the parity part */9292- gpio+=(gpio & 0x7fd) + (auxgpio & 0xef);9292+ gpio=(gpio & 0x7fd) + (auxgpio & 0xef);9393 } else9494 auxgpio = gpio;9595
···362362}363363364364/* ------------------------------------------------------------------------ */365365-365365+#ifdef CONFIG_VIDEO_V4L1366366static int msp_mode_v4l2_to_v4l1(int rxsubchans, int audmode)367367{368368 if (rxsubchans == V4L2_TUNER_SUB_MONO)···384384 return V4L2_TUNER_MODE_LANG1;385385 return V4L2_TUNER_MODE_MONO;386386}387387+#endif387388388389static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl)389390{···510509 /* --- v4l ioctls --- */511510 /* take care: bttv does userspace copying, we'll get a512511 kernel pointer here... */512512+#ifdef CONFIG_VIDEO_V4L1513513 case VIDIOCGAUDIO:514514 {515515 struct video_audio *va = arg;···579577 }580578581579 case VIDIOCSFREQ:580580+ {581581+ /* new channel -- kick audio carrier scan */582582+ msp_wake_thread(client);583583+ break;584584+ }585585+#endif582586 case VIDIOC_S_FREQUENCY:583587 {584588 /* new channel -- kick audio carrier scan */
+6-2
drivers/media/video/pvrusb2/pvrusb2-hdw.c
···852852 return hdw->serial_number;853853}854854855855-856855int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)857856{858857 return hdw->unit_number;···23172318 }23182319}2319232023202320-23212321/* Return name for this driver instance */23222322const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)23232323{···25402542}254125432542254425452545+/* Issue a command and get a response from the device. This extended25462546+ version includes a probe flag (which if set means that device errors25472547+ should not be logged or treated as fatal) and a timeout in jiffies.25482548+ This can be used to non-lethally probe the health of endpoint 1. */25432549static int pvr2_send_request_ex(struct pvr2_hdw *hdw,25442550 unsigned int timeout,int probe_fl,25452551 void *write_data,unsigned int write_len,···29722970}297329712974297229732973+/* Stop / start video stream transport */29752974static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)29762975{29772976 int status;···30713068}307230693073307030713071+/* Find I2C address of eeprom */30743072static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)30753073{30763074 int result;
+6-3
drivers/media/video/pvrusb2/pvrusb2-io.c
···2626#include <linux/slab.h>2727#include <linux/mutex.h>28282929+static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);3030+2931#define BUFFER_SIG 0x4765327130323133// #define SANITY_CHECK_BUFFERS···517515}518516519517/* Query / set the nominal buffer count */518518+int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)519519+{520520+ return sp->buffer_target_count;521521+}520522521523int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)522524{···558552{559553 return sp->r_count;560554}561561-562555563556void pvr2_stream_kill(struct pvr2_stream *sp)564557{···612607 return ret;613608}614609615615-616610int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)617611{618612 int ret = 0;···649645{650646 return bp->status;651647}652652-653648654649int pvr2_buffer_get_id(struct pvr2_buffer *bp)655650{
+2
drivers/media/video/pvrusb2/pvrusb2-io.h
···4747 void *data);48484949/* Query / set the nominal buffer count */5050+int pvr2_stream_get_buffer_count(struct pvr2_stream *);5051int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);51525253/* Get a pointer to a buffer that is either idle, ready, or is specified···58575958/* Find out how many buffers are idle or ready */6059int pvr2_stream_get_ready_count(struct pvr2_stream *);6060+61616262/* Kill all pending buffers and throw away any ready buffers as well */6363void pvr2_stream_kill(struct pvr2_stream *);
+3-2
drivers/media/video/pvrusb2/pvrusb2-ioread.c
···213213 " pvr2_ioread_setup (tear-down) id=%p",cp);214214 pvr2_ioread_stop(cp);215215 pvr2_stream_kill(cp->stream);216216- pvr2_stream_set_buffer_count(cp->stream,0);216216+ if (pvr2_stream_get_buffer_count(cp->stream)) {217217+ pvr2_stream_set_buffer_count(cp->stream,0);218218+ }217219 cp->stream = NULL;218220 }219221 if (sp) {···252250 } while (0); mutex_unlock(&cp->mutex);253251 return ret;254252}255255-256253257254static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)258255{
···196196 i2c_master_send(c, buffer, 4);197197 default_tuner_init(c);198198 break;199199- case TUNER_LG_TDVS_H06XF:200200- /* Set the Auxiliary Byte. */201201- buffer[2] &= ~0x20;202202- buffer[2] |= 0x18;203203- buffer[3] = 0x20;204204- i2c_master_send(c, buffer, 4);205205- default_tuner_init(c);206206- break;207199 case TUNER_PHILIPS_TD1316:208200 buffer[0] = 0x0b;209201 buffer[1] = 0xdc;···590598 if (t->standby)591599 t->standby (client);592600 break;601601+#ifdef CONFIG_VIDEO_V4L1593602 case VIDIOCSAUDIO:594603 if (check_mode(t, "VIDIOCSAUDIO") == EINVAL)595604 return 0;···600607 /* Should be implemented, since bttv calls it */601608 tuner_dbg("VIDIOCSAUDIO not implemented.\n");602609 break;603603- case TDA9887_SET_CONFIG:604604- if (t->type == TUNER_TDA9887) {605605- int *i = arg;606606-607607- t->tda9887_config = *i;608608- set_freq(client, t->tv_freq);609609- }610610- break;611611- /* --- v4l ioctls --- */612612- /* take care: bttv does userspace copying, we'll get a613613- kernel pointer here... */614610 case VIDIOCSCHAN:615611 {616612 static const v4l2_std_id map[] = {···683701 ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;684702 return 0;685703 }704704+#endif705705+ case TDA9887_SET_CONFIG:706706+ if (t->type == TUNER_TDA9887) {707707+ int *i = arg;686708709709+ t->tda9887_config = *i;710710+ set_freq(client, t->tv_freq);711711+ }712712+ break;713713+ /* --- v4l ioctls --- */714714+ /* take care: bttv does userspace copying, we'll get a715715+ kernel pointer here... */687716 case VIDIOC_S_STD:688717 {689718 v4l2_std_id *id = arg;
+17-2
drivers/media/video/tuner-simple.c
···339339 if (4 != (rc = i2c_master_send(c,buffer,4)))340340 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);341341342342- if (t->type == TUNER_MICROTUNE_4042FI5) {342342+ switch (t->type) {343343+ case TUNER_LG_TDVS_H06XF:344344+ /* Set the Auxiliary Byte. */345345+ buffer[0] = buffer[2];346346+ buffer[0] &= ~0x20;347347+ buffer[0] |= 0x18;348348+ buffer[1] = 0x20;349349+ tuner_dbg("tv 0x%02x 0x%02x\n",buffer[0],buffer[1]);350350+351351+ if (2 != (rc = i2c_master_send(c,buffer,2)))352352+ tuner_warn("i2c i/o error: rc == %d (should be 2)\n",rc);353353+ break;354354+ case TUNER_MICROTUNE_4042FI5:355355+ {343356 // FIXME - this may also work for other tuners344357 unsigned long timeout = jiffies + msecs_to_jiffies(1);345358 u8 status_byte = 0;···377364 buffer[2] = config;378365 buffer[3] = cb;379366 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",380380- buffer[0],buffer[1],buffer[2],buffer[3]);367367+ buffer[0],buffer[1],buffer[2],buffer[3]);381368382369 if (4 != (rc = i2c_master_send(c,buffer,4)))383370 tuner_warn("i2c i/o error: rc == %d (should be 4)\n",rc);371371+ break;372372+ }384373 }385374}386375
+4-4
drivers/media/video/usbvideo/Kconfig
···3344config USB_VICAM55 tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)"66- depends on USB && VIDEO_V4L1 && EXPERIMENTAL66+ depends on USB && VIDEO_DEV && VIDEO_V4L1 && EXPERIMENTAL77 select VIDEO_USBVIDEO88 ---help---99 Say Y here if you have 3com homeconnect camera (vicam).···13131414config USB_IBMCAM1515 tristate "USB IBM (Xirlink) C-it Camera support"1616- depends on USB && VIDEO_V4L11616+ depends on USB && VIDEO_DEV && VIDEO_V4L11717 select VIDEO_USBVIDEO1818 ---help---1919 Say Y here if you want to connect a IBM "C-It" camera, also known as···28282929config USB_KONICAWC3030 tristate "USB Konica Webcam support"3131- depends on USB && VIDEO_V4L13131+ depends on USB && VIDEO_DEV && VIDEO_V4L13232 select VIDEO_USBVIDEO3333 ---help---3434 Say Y here if you want support for webcams based on a Konica···39394040config USB_QUICKCAM_MESSENGER4141 tristate "USB Logitech Quickcam Messenger"4242- depends on USB && VIDEO_DEV4242+ depends on USB && VIDEO_DEV && VIDEO_V4L14343 select VIDEO_USBVIDEO4444 ---help---4545 Say Y or M here to enable support for the USB Logitech Quickcam
+14-10
drivers/media/video/v4l2-common.c
···202202/* ------------------------------------------------------------------ */203203/* debug help functions */204204205205-#ifdef HAVE_V4L1205205+#ifdef CONFIG_V4L1_COMPAT206206static const char *v4l1_ioctls[] = {207207 [_IOC_NR(VIDIOCGCAP)] = "VIDIOCGCAP",208208 [_IOC_NR(VIDIOCGCHAN)] = "VIDIOCGCHAN",···301301#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)302302303303static const char *v4l2_int_ioctls[] = {304304-#ifdef HAVE_VIDEO_DECODER304304+#ifdef CONFIG_V4L1_COMPAT305305 [_IOC_NR(DECODER_GET_CAPABILITIES)] = "DECODER_GET_CAPABILITIES",306306 [_IOC_NR(DECODER_GET_STATUS)] = "DECODER_GET_STATUS",307307 [_IOC_NR(DECODER_SET_NORM)] = "DECODER_SET_NORM",···367367 (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ?368368 v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd);369369 break;370370-#ifdef HAVE_V4L1370370+#ifdef CONFIG_V4L1_COMPAT371371 case 'v':372372 printk("v4l1 ioctl %s, dir=%s (0x%08x)\n",373373 (_IOC_NR(cmd) < V4L1_IOCTLS) ?···414414 printk ("%s: tuner type=%d\n", s, *p);415415 break;416416 }417417+#ifdef CONFIG_VIDEO_V4L1_COMPAT417418 case DECODER_SET_VBI_BYPASS:418419 case DECODER_ENABLE_OUTPUT:419420 case DECODER_GET_STATUS:···425424 case VIDIOCCAPTURE:426425 case VIDIOCSYNC:427426 case VIDIOCSWRITEMODE:427427+#endif428428 case TUNER_SET_TYPE_ADDR:429429 case TUNER_SET_STANDBY:430430 case TDA9887_SET_CONFIG:···757755 p->afc);758756 break;759757 }758758+#ifdef CONFIG_VIDEO_V4L1_COMPAT760759 case VIDIOCGVBIFMT:761760 case VIDIOCSVBIFMT:762761 {···927924 p->clipcount);928925 break;929926 }927927+ case VIDIOCGFREQ:928928+ case VIDIOCSFREQ:929929+ {930930+ unsigned long *p=arg;931931+ printk ("%s: value=%lu\n", s, *p);932932+ break;933933+ }934934+#endif930935 case VIDIOC_INT_AUDIO_CLOCK_FREQ:931936 case VIDIOC_INT_I2S_CLOCK_FREQ:932937 case VIDIOC_INT_S_STANDBY:···942931 u32 *p=arg;943932944933 printk ("%s: value=%d\n", s, *p);945945- break;946946- }947947- case VIDIOCGFREQ:948948- case VIDIOCSFREQ:949949- {950950- unsigned long *p=arg;951951- printk ("%s: value=%lu\n", s, *p);952934 break;953935 }954936 case VIDIOC_G_STD:
+25-4
drivers/media/video/videodev.c
···760760 ret=vfd->vidioc_overlay(file, fh, *i);761761 break;762762 }763763-#ifdef HAVE_V4L1763763+#ifdef CONFIG_V4L1_COMPAT764764 /* --- streaming capture ------------------------------------- */765765 case VIDIOCGMBUF:766766 {···15121512 int i=0;15131513 int base;15141514 int end;15151515+ int ret;15151516 char *name_base;1516151715171518 switch(type)···15381537 name_base = "radio";15391538 break;15401539 default:15401540+ printk(KERN_ERR "%s called with unknown type: %d\n",15411541+ __FUNCTION__, type);15411542 return -1;15421543 }15431544···15741571 vfd->class_dev.class = &video_class;15751572 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);15761573 sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);15771577- class_device_register(&vfd->class_dev);15781578- class_device_create_file(&vfd->class_dev,15791579- &class_device_attr_name);15741574+ ret = class_device_register(&vfd->class_dev);15751575+ if (ret < 0) {15761576+ printk(KERN_ERR "%s: class_device_register failed\n",15771577+ __FUNCTION__);15781578+ goto fail_minor;15791579+ }15801580+ ret = class_device_create_file(&vfd->class_dev, &class_device_attr_name);15811581+ if (ret < 0) {15821582+ printk(KERN_ERR "%s: class_device_create_file 'name' failed\n",15831583+ __FUNCTION__);15841584+ goto fail_classdev;15851585+ }1580158615811587#if 115821588 /* needed until all drivers are fixed */···15951583 "http://lwn.net/Articles/36850/\n", vfd->name);15961584#endif15971585 return 0;15861586+15871587+fail_classdev:15881588+ class_device_unregister(&vfd->class_dev);15891589+fail_minor:15901590+ mutex_lock(&videodev_lock);15911591+ video_device[vfd->minor] = NULL;15921592+ vfd->minor = -1;15931593+ mutex_unlock(&videodev_lock);15941594+ return ret;15981595}1599159616001597/**
···2929 even politically correct people are allowed to say Y here.30303131config DEV_APPLETALK3232- bool "Appletalk interfaces support"3232+ tristate "Appletalk interfaces support"3333 depends on ATALK3434 help3535 AppleTalk is the protocol that Apple computers can use to communicate
+6-5
drivers/net/e1000/e1000_main.c
···31273127 break;31283128 }3129312931303130- /* NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN31303130+ /* NOTE: netdev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN31313131 * means we reserve 2 more, this pushes us to allocate from the next31323132 * larger slab size31333133 * i.e. RXBUFFER_2048 --> size-4096 slab */···37083708#define E1000_CB_LENGTH 25637093709 if (length < E1000_CB_LENGTH) {37103710 struct sk_buff *new_skb =37113711- dev_alloc_skb(length + NET_IP_ALIGN);37113711+ netdev_alloc_skb(netdev, length + NET_IP_ALIGN);37123712 if (new_skb) {37133713 skb_reserve(new_skb, NET_IP_ALIGN);37143714 new_skb->dev = netdev;···3979397939803980 while (cleaned_count--) {39813981 if (!(skb = buffer_info->skb))39823982- skb = dev_alloc_skb(bufsz);39823982+ skb = netdev_alloc_skb(netdev, bufsz);39833983 else {39843984 skb_trim(skb, 0);39853985 goto map_skb;···39973997 DPRINTK(RX_ERR, ERR, "skb align check failed: %u bytes "39983998 "at %p\n", bufsz, skb->data);39993999 /* Try again, without freeing the previous */40004000- skb = dev_alloc_skb(bufsz);40004000+ skb = netdev_alloc_skb(netdev, bufsz);40014001 /* Failed allocation, critical failure */40024002 if (!skb) {40034003 dev_kfree_skb(oldskb);···41214121 rx_desc->read.buffer_addr[j+1] = ~0;41224122 }4123412341244124- skb = dev_alloc_skb(adapter->rx_ps_bsize0 + NET_IP_ALIGN);41244124+ skb = netdev_alloc_skb(netdev,41254125+ adapter->rx_ps_bsize0 + NET_IP_ALIGN);4125412641264127 if (unlikely(!skb)) {41274128 adapter->alloc_rx_buff_failed++;
+11-13
drivers/net/myri10ge/myri10ge.c
···177177 struct work_struct watchdog_work;178178 struct timer_list watchdog_timer;179179 int watchdog_tx_done;180180+ int watchdog_tx_req;180181 int watchdog_resets;181182 int tx_linearized;182183 int pause;···449448 struct mcp_gen_header *hdr;450449 size_t hdr_offset;451450 int status;451451+ unsigned i;452452453453 if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {454454 dev_err(dev, "Unable to load %s firmware image via hotplug\n",···481479 goto abort_with_fw;482480483481 crc = crc32(~0, fw->data, fw->size);484484- if (mgp->tx.boundary == 2048) {485485- /* Avoid PCI burst on chipset with unaligned completions. */486486- int i;487487- __iomem u32 *ptr = (__iomem u32 *) (mgp->sram +488488- MYRI10GE_FW_OFFSET);489489- for (i = 0; i < fw->size / 4; i++) {490490- __raw_writel(((u32 *) fw->data)[i], ptr + i);491491- wmb();492492- }493493- } else {494494- myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data,495495- fw->size);482482+ for (i = 0; i < fw->size; i += 256) {483483+ myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i,484484+ fw->data + i,485485+ min(256U, (unsigned)(fw->size - i)));486486+ mb();487487+ readb(mgp->sram);496488 }497489 /* corruption checking is good for parity recovery and buggy chipset */498490 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);···2543254725442548 mgp = (struct myri10ge_priv *)arg;25452549 if (mgp->tx.req != mgp->tx.done &&25462546- mgp->tx.done == mgp->watchdog_tx_done)25502550+ mgp->tx.done == mgp->watchdog_tx_done &&25512551+ mgp->watchdog_tx_req != mgp->watchdog_tx_done)25472552 /* nic seems like it might be stuck.. */25482553 schedule_work(&mgp->watchdog_work);25492554 else···25532556 jiffies + myri10ge_watchdog_timeout * HZ);2554255725552558 mgp->watchdog_tx_done = mgp->tx.done;25592559+ mgp->watchdog_tx_req = mgp->tx.req;25562560}2557256125582562static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+2-6
drivers/net/phy/phy.c
···419419420420/* phy_stop_machine421421 *422422- * description: Stops the state machine timer, sets the state to423423- * UP (unless it wasn't up yet), and then frees the interrupt,424424- * if it is in use. This function must be called BEFORE422422+ * description: Stops the state machine timer, sets the state to UP423423+ * (unless it wasn't up yet). This function must be called BEFORE425424 * phy_detach.426425 */427426void phy_stop_machine(struct phy_device *phydev)···431432 if (phydev->state > PHY_UP)432433 phydev->state = PHY_UP;433434 spin_unlock(&phydev->lock);434434-435435- if (phydev->irq != PHY_POLL)436436- phy_stop_interrupts(phydev);437435438436 phydev->adjust_state = NULL;439437}
+173-213
drivers/net/s2io.c
···7676#include "s2io.h"7777#include "s2io-regs.h"78787979-#define DRV_VERSION "2.0.14.2"7979+#define DRV_VERSION "2.0.15.2"80808181/* S2io Driver name & version. */8282static char s2io_driver_name[] = "Neterion";···370370 END_SIGN371371};372372373373+MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");374374+MODULE_LICENSE("GPL");375375+MODULE_VERSION(DRV_VERSION);376376+377377+373378/* Module Loadable parameters. */374374-static unsigned int tx_fifo_num = 1;379379+S2IO_PARM_INT(tx_fifo_num, 1);380380+S2IO_PARM_INT(rx_ring_num, 1);381381+382382+383383+S2IO_PARM_INT(rx_ring_mode, 1);384384+S2IO_PARM_INT(use_continuous_tx_intrs, 1);385385+S2IO_PARM_INT(rmac_pause_time, 0x100);386386+S2IO_PARM_INT(mc_pause_threshold_q0q3, 187);387387+S2IO_PARM_INT(mc_pause_threshold_q4q7, 187);388388+S2IO_PARM_INT(shared_splits, 0);389389+S2IO_PARM_INT(tmac_util_period, 5);390390+S2IO_PARM_INT(rmac_util_period, 5);391391+S2IO_PARM_INT(bimodal, 0);392392+S2IO_PARM_INT(l3l4hdr_size, 128);393393+/* Frequency of Rx desc syncs expressed as power of 2 */394394+S2IO_PARM_INT(rxsync_frequency, 3);395395+/* Interrupt type. Values can be 0(INTA), 1(MSI), 2(MSI_X) */396396+S2IO_PARM_INT(intr_type, 0);397397+/* Large receive offload feature */398398+S2IO_PARM_INT(lro, 0);399399+/* Max pkts to be aggregated by LRO at one time. If not specified,400400+ * aggregation happens until we hit max IP pkt size(64K)401401+ */402402+S2IO_PARM_INT(lro_max_pkts, 0xFFFF);403403+#ifndef CONFIG_S2IO_NAPI404404+S2IO_PARM_INT(indicate_max_pkts, 0);405405+#endif406406+375407static unsigned int tx_fifo_len[MAX_TX_FIFOS] =376408 {DEFAULT_FIFO_0_LEN, [1 ...(MAX_TX_FIFOS - 1)] = DEFAULT_FIFO_1_7_LEN};377377-static unsigned int rx_ring_num = 1;378409static unsigned int rx_ring_sz[MAX_RX_RINGS] =379410 {[0 ...(MAX_RX_RINGS - 1)] = SMALL_BLK_CNT};380411static unsigned int rts_frm_len[MAX_RX_RINGS] =381412 {[0 ...(MAX_RX_RINGS - 1)] = 0 };382382-static unsigned int rx_ring_mode = 1;383383-static unsigned int use_continuous_tx_intrs = 1;384384-static unsigned int rmac_pause_time = 0x100;385385-static unsigned int mc_pause_threshold_q0q3 = 187;386386-static unsigned int mc_pause_threshold_q4q7 = 187;387387-static unsigned int shared_splits;388388-static unsigned int tmac_util_period = 5;389389-static unsigned int rmac_util_period = 5;390390-static unsigned int bimodal = 0;391391-static unsigned int l3l4hdr_size = 128;392392-#ifndef CONFIG_S2IO_NAPI393393-static unsigned int indicate_max_pkts;394394-#endif395395-/* Frequency of Rx desc syncs expressed as power of 2 */396396-static unsigned int rxsync_frequency = 3;397397-/* Interrupt type. Values can be 0(INTA), 1(MSI), 2(MSI_X) */398398-static unsigned int intr_type = 0;399399-/* Large receive offload feature */400400-static unsigned int lro = 0;401401-/* Max pkts to be aggregated by LRO at one time. If not specified,402402- * aggregation happens until we hit max IP pkt size(64K)403403- */404404-static unsigned int lro_max_pkts = 0xFFFF;413413+414414+module_param_array(tx_fifo_len, uint, NULL, 0);415415+module_param_array(rx_ring_sz, uint, NULL, 0);416416+module_param_array(rts_frm_len, uint, NULL, 0);405417406418/*407419 * S2IO device table.···476464 size += config->tx_cfg[i].fifo_len;477465 }478466 if (size > MAX_AVAILABLE_TXDS) {479479- DBG_PRINT(ERR_DBG, "%s: Requested TxDs too high, ",480480- __FUNCTION__);467467+ DBG_PRINT(ERR_DBG, "s2io: Requested TxDs too high, ");481468 DBG_PRINT(ERR_DBG, "Requested: %d, max supported: 8192\n", size);482482- return FAILURE;469469+ return -EINVAL;483470 }484471485472 lst_size = (sizeof(TxD_t) * config->max_txds);···558547 nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL);559548 if (!nic->ufo_in_band_v)560549 return -ENOMEM;550550+ memset(nic->ufo_in_band_v, 0, size);561551562552 /* Allocation and initialization of RXDs in Rings */563553 size = 0;···12251213 break;12261214 }1227121512281228- /* Enable Tx FIFO partition 0. */12161216+ /* Enable all configured Tx FIFO partitions */12291217 val64 = readq(&bar0->tx_fifo_partition_0);12301218 val64 |= (TX_FIFO_PARTITION_EN);12311219 writeq(val64, &bar0->tx_fifo_partition_0);···16621650 writeq(temp64, &bar0->general_int_mask);16631651 /*16641652 * If Hercules adapter enable GPIO otherwise16651665- * disabled all PCIX, Flash, MDIO, IIC and GPIO16531653+ * disable all PCIX, Flash, MDIO, IIC and GPIO16661654 * interrupts for now.16671655 * TODO16681656 */···21312119 frag->size, PCI_DMA_TODEVICE);21322120 }21332121 }21342134- txdlp->Host_Control = 0;21222122+ memset(txdlp,0, (sizeof(TxD_t) * fifo_data->max_txds));21352123 return(skb);21362124}21372125···23832371 skb->data = (void *) (unsigned long)tmp;23842372 skb->tail = (void *) (unsigned long)tmp;2385237323862386- ((RxD3_t*)rxdp)->Buffer0_ptr =23872387- pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,23742374+ if (!(((RxD3_t*)rxdp)->Buffer0_ptr))23752375+ ((RxD3_t*)rxdp)->Buffer0_ptr =23762376+ pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,23882377 PCI_DMA_FROMDEVICE);23782378+ else23792379+ pci_dma_sync_single_for_device(nic->pdev,23802380+ (dma_addr_t) ((RxD3_t*)rxdp)->Buffer0_ptr,23812381+ BUF0_LEN, PCI_DMA_FROMDEVICE);23892382 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN);23902383 if (nic->rxd_mode == RXD_MODE_3B) {23912384 /* Two buffer mode */···24032386 (nic->pdev, skb->data, dev->mtu + 4,24042387 PCI_DMA_FROMDEVICE);2405238824062406- /* Buffer-1 will be dummy buffer not used */24072407- ((RxD3_t*)rxdp)->Buffer1_ptr =24082408- pci_map_single(nic->pdev, ba->ba_1, BUF1_LEN,24092409- PCI_DMA_FROMDEVICE);23892389+ /* Buffer-1 will be dummy buffer. Not used */23902390+ if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) {23912391+ ((RxD3_t*)rxdp)->Buffer1_ptr =23922392+ pci_map_single(nic->pdev, 23932393+ ba->ba_1, BUF1_LEN,23942394+ PCI_DMA_FROMDEVICE);23952395+ }24102396 rxdp->Control_2 |= SET_BUFFER1_SIZE_3(1);24112397 rxdp->Control_2 |= SET_BUFFER2_SIZE_324122398 (dev->mtu + 4);···26342614}26352615#endif2636261626172617+#ifdef CONFIG_NET_POLL_CONTROLLER26372618/**26382638- * s2io_netpoll - Rx interrupt service handler for netpoll support26192619+ * s2io_netpoll - netpoll event handler entry point26392620 * @dev : pointer to the device structure.26402621 * Description:26412641- * Polling 'interrupt' - used by things like netconsole to send skbs26422642- * without having to re-enable interrupts. It's not called while26432643- * the interrupt routine is executing.26222622+ * This function will be called by upper layer to check for events on the26232623+ * interface in situations where interrupts are disabled. It is used for26242624+ * specific in-kernel networking tasks, such as remote consoles and kernel26252625+ * debugging over the network (example netdump in RedHat).26442626 */26452645-26462646-#ifdef CONFIG_NET_POLL_CONTROLLER26472627static void s2io_netpoll(struct net_device *dev)26482628{26492629 nic_t *nic = dev->priv;26502630 mac_info_t *mac_control;26512631 struct config_param *config;26522632 XENA_dev_config_t __iomem *bar0 = nic->bar0;26532653- u64 val64;26332633+ u64 val64 = 0xFFFFFFFFFFFFFFFFULL;26542634 int i;2655263526562636 disable_irq(dev->irq);···26592639 mac_control = &nic->mac_control;26602640 config = &nic->config;2661264126622662- val64 = readq(&bar0->rx_traffic_int);26632642 writeq(val64, &bar0->rx_traffic_int);26432643+ writeq(val64, &bar0->tx_traffic_int);2664264426452645+ /* we need to free up the transmitted skbufs or else netpoll will 26462646+ * run out of skbs and will fail and eventually netpoll application such26472647+ * as netdump will fail.26482648+ */26492649+ for (i = 0; i < config->tx_fifo_num; i++)26502650+ tx_intr_handler(&mac_control->fifos[i]);26512651+26522652+ /* check for received packet and indicate up to network */26652653 for (i = 0; i < config->rx_ring_num; i++)26662654 rx_intr_handler(&mac_control->rings[i]);26672655···27362708 /* If your are next to put index then it's FIFO full condition */27372709 if ((get_block == put_block) &&27382710 (get_info.offset + 1) == put_info.offset) {27392739- DBG_PRINT(ERR_DBG, "%s: Ring Full\n",dev->name);27112711+ DBG_PRINT(INTR_DBG, "%s: Ring Full\n",dev->name);27402712 break;27412713 }27422714 skb = (struct sk_buff *) ((unsigned long)rxdp->Host_Control);···27562728 HEADER_SNAP_SIZE,27572729 PCI_DMA_FROMDEVICE);27582730 } else if (nic->rxd_mode == RXD_MODE_3B) {27592759- pci_unmap_single(nic->pdev, (dma_addr_t)27312731+ pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)27602732 ((RxD3_t*)rxdp)->Buffer0_ptr,27612733 BUF0_LEN, PCI_DMA_FROMDEVICE);27622762- pci_unmap_single(nic->pdev, (dma_addr_t)27632763- ((RxD3_t*)rxdp)->Buffer1_ptr,27642764- BUF1_LEN, PCI_DMA_FROMDEVICE);27652734 pci_unmap_single(nic->pdev, (dma_addr_t)27662735 ((RxD3_t*)rxdp)->Buffer2_ptr,27672736 dev->mtu + 4,27682737 PCI_DMA_FROMDEVICE);27692738 } else {27702770- pci_unmap_single(nic->pdev, (dma_addr_t)27392739+ pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)27712740 ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN,27722741 PCI_DMA_FROMDEVICE);27732742 pci_unmap_single(nic->pdev, (dma_addr_t)···3352332733533328 /* Clear certain PCI/PCI-X fields after reset */33543329 if (sp->device_type == XFRAME_II_DEVICE) {33553355- /* Clear parity err detect bit */33303330+ /* Clear "detected parity error" bit */33563331 pci_write_config_word(sp->pdev, PCI_STATUS, 0x8000);3357333233583333 /* Clearing PCIX Ecc status register */···35533528 u64 val64;35543529 int i;3555353035563556- for (i=0; i< nic->avail_msix_vectors; i++) {35313531+ for (i=0; i < MAX_REQUESTED_MSI_X; i++) {35573532 writeq(nic->msix_info[i].addr, &bar0->xmsi_address);35583533 writeq(nic->msix_info[i].data, &bar0->xmsi_data);35593534 val64 = (BIT(7) | BIT(15) | vBIT(i, 26, 6));···35723547 int i;3573354835743549 /* Store and display */35753575- for (i=0; i< nic->avail_msix_vectors; i++) {35503550+ for (i=0; i < MAX_REQUESTED_MSI_X; i++) {35763551 val64 = (BIT(15) | vBIT(i, 26, 6));35773552 writeq(val64, &bar0->xmsi_access);35783553 if (wait_for_msix_trans(nic, i)) {···38333808 TxD_t *txdp;38343809 TxFIFO_element_t __iomem *tx_fifo;38353810 unsigned long flags;38363836-#ifdef NETIF_F_TSO38373837- int mss;38383838-#endif38393811 u16 vlan_tag = 0;38403812 int vlan_priority = 0;38413813 mac_info_t *mac_control;38423814 struct config_param *config;38153815+ int offload_type;3843381638443817 mac_control = &sp->mac_control;38453818 config = &sp->config;···38853862 return 0;38863863 }3887386438883888- txdp->Control_1 = 0;38893889- txdp->Control_2 = 0;38653865+ offload_type = s2io_offload_type(skb);38903866#ifdef NETIF_F_TSO38913891- mss = skb_shinfo(skb)->gso_size;38923892- if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {38673867+ if (offload_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) {38933868 txdp->Control_1 |= TXD_TCP_LSO_EN;38943894- txdp->Control_1 |= TXD_TCP_LSO_MSS(mss);38693869+ txdp->Control_1 |= TXD_TCP_LSO_MSS(s2io_tcp_mss(skb));38953870 }38963871#endif38973872 if (skb->ip_summed == CHECKSUM_HW) {···39073886 }3908388739093888 frg_len = skb->len - skb->data_len;39103910- if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP) {38893889+ if (offload_type == SKB_GSO_UDP) {39113890 int ufo_size;3912389139133913- ufo_size = skb_shinfo(skb)->gso_size;38923892+ ufo_size = s2io_udp_mss(skb);39143893 ufo_size &= ~7;39153894 txdp->Control_1 |= TXD_UFO_EN;39163895 txdp->Control_1 |= TXD_UFO_MSS(ufo_size);···39273906 sp->ufo_in_band_v,39283907 sizeof(u64), PCI_DMA_TODEVICE);39293908 txdp++;39303930- txdp->Control_1 = 0;39313931- txdp->Control_2 = 0;39323909 }3933391039343911 txdp->Buffer_Pointer = pci_map_single39353912 (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);39363913 txdp->Host_Control = (unsigned long) skb;39373914 txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);39383938-39393939- if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)39153915+ if (offload_type == SKB_GSO_UDP)39403916 txdp->Control_1 |= TXD_UFO_EN;3941391739423918 frg_cnt = skb_shinfo(skb)->nr_frags;···39483930 (sp->pdev, frag->page, frag->page_offset,39493931 frag->size, PCI_DMA_TODEVICE);39503932 txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size);39513951- if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)39333933+ if (offload_type == SKB_GSO_UDP)39523934 txdp->Control_1 |= TXD_UFO_EN;39533935 }39543936 txdp->Control_1 |= TXD_GATHER_CODE_LAST;3955393739563956- if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)39383938+ if (offload_type == SKB_GSO_UDP)39573939 frg_cnt++; /* as Txd0 was used for inband header */3958394039593941 tx_fifo = mac_control->tx_FIFO_start[queue];···3962394439633945 val64 = (TX_FIFO_LAST_TXD_NUM(frg_cnt) | TX_FIFO_FIRST_LIST |39643946 TX_FIFO_LAST_LIST);39473947+ if (offload_type)39483948+ val64 |= TX_FIFO_SPECIAL_FUNC;3965394939663966-#ifdef NETIF_F_TSO39673967- if (mss)39683968- val64 |= TX_FIFO_SPECIAL_FUNC;39693969-#endif39703970- if (skb_shinfo(skb)->gso_type == SKB_GSO_UDP)39713971- val64 |= TX_FIFO_SPECIAL_FUNC;39723950 writeq(val64, &tx_fifo->List_Control);3973395139743952 mmiowb();···39983984 mod_timer(&sp->alarm_timer, jiffies + HZ / 2);39993985}4000398639873987+static int s2io_chk_rx_buffers(nic_t *sp, int rng_n)39883988+{39893989+ int rxb_size, level;39903990+39913991+ if (!sp->lro) {39923992+ rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);39933993+ level = rx_buffer_level(sp, rxb_size, rng_n);39943994+39953995+ if ((level == PANIC) && (!TASKLET_IN_USE)) {39963996+ int ret;39973997+ DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);39983998+ DBG_PRINT(INTR_DBG, "PANIC levels\n");39993999+ if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {40004000+ DBG_PRINT(ERR_DBG, "Out of memory in %s",40014001+ __FUNCTION__);40024002+ clear_bit(0, (&sp->tasklet_status));40034003+ return -1;40044004+ }40054005+ clear_bit(0, (&sp->tasklet_status));40064006+ } else if (level == LOW)40074007+ tasklet_schedule(&sp->task);40084008+40094009+ } else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {40104010+ DBG_PRINT(ERR_DBG, "%s:Out of memory", sp->dev->name);40114011+ DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");40124012+ }40134013+ return 0;40144014+}40154015+40014016static irqreturn_t40024017s2io_msi_handle(int irq, void *dev_id, struct pt_regs *regs)40034018{40044019 struct net_device *dev = (struct net_device *) dev_id;40054020 nic_t *sp = dev->priv;40064021 int i;40074007- int ret;40084022 mac_info_t *mac_control;40094023 struct config_param *config;40104024···40544012 * reallocate the buffers from the interrupt handler itself,40554013 * else schedule a tasklet to reallocate the buffers.40564014 */40574057- for (i = 0; i < config->rx_ring_num; i++) {40584058- if (!sp->lro) {40594059- int rxb_size = atomic_read(&sp->rx_bufs_left[i]);40604060- int level = rx_buffer_level(sp, rxb_size, i);40614061-40624062- if ((level == PANIC) && (!TASKLET_IN_USE)) {40634063- DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", 40644064- dev->name);40654065- DBG_PRINT(INTR_DBG, "PANIC levels\n");40664066- if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {40674067- DBG_PRINT(ERR_DBG, "%s:Out of memory",40684068- dev->name);40694069- DBG_PRINT(ERR_DBG, " in ISR!!\n");40704070- clear_bit(0, (&sp->tasklet_status));40714071- atomic_dec(&sp->isr_cnt);40724072- return IRQ_HANDLED;40734073- }40744074- clear_bit(0, (&sp->tasklet_status));40754075- } else if (level == LOW) {40764076- tasklet_schedule(&sp->task);40774077- }40784078- }40794079- else if (fill_rx_buffers(sp, i) == -ENOMEM) {40804080- DBG_PRINT(ERR_DBG, "%s:Out of memory",40814081- dev->name);40824082- DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");40834083- break;40844084- }40854085- }40154015+ for (i = 0; i < config->rx_ring_num; i++)40164016+ s2io_chk_rx_buffers(sp, i);4086401740874018 atomic_dec(&sp->isr_cnt);40884019 return IRQ_HANDLED;···40664051{40674052 ring_info_t *ring = (ring_info_t *)dev_id;40684053 nic_t *sp = ring->nic;40694069- struct net_device *dev = (struct net_device *) dev_id;40704070- int rxb_size, level, rng_n;4071405440724055 atomic_inc(&sp->isr_cnt);40564056+40734057 rx_intr_handler(ring);40744074-40754075- rng_n = ring->ring_no;40764076- if (!sp->lro) {40774077- rxb_size = atomic_read(&sp->rx_bufs_left[rng_n]);40784078- level = rx_buffer_level(sp, rxb_size, rng_n);40794079-40804080- if ((level == PANIC) && (!TASKLET_IN_USE)) {40814081- int ret;40824082- DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", __FUNCTION__);40834083- DBG_PRINT(INTR_DBG, "PANIC levels\n");40844084- if ((ret = fill_rx_buffers(sp, rng_n)) == -ENOMEM) {40854085- DBG_PRINT(ERR_DBG, "Out of memory in %s",40864086- __FUNCTION__);40874087- clear_bit(0, (&sp->tasklet_status));40884088- return IRQ_HANDLED;40894089- }40904090- clear_bit(0, (&sp->tasklet_status));40914091- } else if (level == LOW) {40924092- tasklet_schedule(&sp->task);40934093- }40944094- }40954095- else if (fill_rx_buffers(sp, rng_n) == -ENOMEM) {40964096- DBG_PRINT(ERR_DBG, "%s:Out of memory", dev->name);40974097- DBG_PRINT(ERR_DBG, " in Rx Intr!!\n");40984098- }40584058+ s2io_chk_rx_buffers(sp, ring->ring_no);4099405941004060 atomic_dec(&sp->isr_cnt);41014101-41024061 return IRQ_HANDLED;41034062}41044063···42374248 * else schedule a tasklet to reallocate the buffers.42384249 */42394250#ifndef CONFIG_S2IO_NAPI42404240- for (i = 0; i < config->rx_ring_num; i++) {42414241- if (!sp->lro) {42424242- int ret;42434243- int rxb_size = atomic_read(&sp->rx_bufs_left[i]);42444244- int level = rx_buffer_level(sp, rxb_size, i);42454245-42464246- if ((level == PANIC) && (!TASKLET_IN_USE)) {42474247- DBG_PRINT(INTR_DBG, "%s: Rx BD hit ", 42484248- dev->name);42494249- DBG_PRINT(INTR_DBG, "PANIC levels\n");42504250- if ((ret = fill_rx_buffers(sp, i)) == -ENOMEM) {42514251- DBG_PRINT(ERR_DBG, "%s:Out of memory",42524252- dev->name);42534253- DBG_PRINT(ERR_DBG, " in ISR!!\n");42544254- clear_bit(0, (&sp->tasklet_status));42554255- atomic_dec(&sp->isr_cnt);42564256- writeq(org_mask, &bar0->general_int_mask);42574257- return IRQ_HANDLED;42584258- }42594259- clear_bit(0, (&sp->tasklet_status));42604260- } else if (level == LOW) {42614261- tasklet_schedule(&sp->task);42624262- }42634263- }42644264- else if (fill_rx_buffers(sp, i) == -ENOMEM) {42654265- DBG_PRINT(ERR_DBG, "%s:Out of memory",42664266- dev->name);42674267- DBG_PRINT(ERR_DBG, " in Rx intr!!\n");42684268- break;42694269- }42704270- }42514251+ for (i = 0; i < config->rx_ring_num; i++)42524252+ s2io_chk_rx_buffers(sp, i);42714253#endif42724254 writeq(org_mask, &bar0->general_int_mask);42734255 atomic_dec(&sp->isr_cnt);···42684308 if (cnt == 5)42694309 break; /* Updt failed */42704310 } while(1);43114311+ } else {43124312+ memset(sp->mac_control.stats_info, 0, sizeof(StatInfo_t));42714313 }42724314}42734315···49044942}49054943static void s2io_vpd_read(nic_t *nic)49064944{49074907- u8 vpd_data[256],data;49454945+ u8 *vpd_data;49464946+ u8 data;49084947 int i=0, cnt, fail = 0;49094948 int vpd_addr = 0x80;49104949···49174954 strcpy(nic->product_name, "Xframe I 10GbE network adapter");49184955 vpd_addr = 0x50;49194956 }49574957+49584958+ vpd_data = kmalloc(256, GFP_KERNEL);49594959+ if (!vpd_data)49604960+ return;4920496149214962 for (i = 0; i < 256; i +=4 ) {49224963 pci_write_config_byte(nic->pdev, (vpd_addr + 2), i);···49444977 memset(nic->product_name, 0, vpd_data[1]);49454978 memcpy(nic->product_name, &vpd_data[3], vpd_data[1]);49464979 }49804980+ kfree(vpd_data);49474981}4948498249494983/**···52635295 else52645296 *data = 0;5265529752665266- return 0;52985298+ return *data;52675299}5268530052695301/**···57215753 return 0;57225754}5723575557565756+static u32 s2io_ethtool_op_get_tso(struct net_device *dev)57575757+{57585758+ return (dev->features & NETIF_F_TSO) != 0;57595759+}57605760+static int s2io_ethtool_op_set_tso(struct net_device *dev, u32 data)57615761+{57625762+ if (data)57635763+ dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);57645764+ else57655765+ dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);57665766+57675767+ return 0;57685768+}5724576957255770static struct ethtool_ops netdev_ethtool_ops = {57265771 .get_settings = s2io_ethtool_gset,···57545773 .get_sg = ethtool_op_get_sg,57555774 .set_sg = ethtool_op_set_sg,57565775#ifdef NETIF_F_TSO57575757- .get_tso = ethtool_op_get_tso,57585758- .set_tso = ethtool_op_set_tso,57765776+ .get_tso = s2io_ethtool_op_get_tso,57775777+ .set_tso = s2io_ethtool_op_set_tso,57595778#endif57605779 .get_ufo = ethtool_op_get_ufo,57615780 .set_ufo = ethtool_op_set_ufo,···63186337 s2io_set_multicast(dev);6319633863206339 if (sp->lro) {63216321- /* Initialize max aggregatable pkts based on MTU */63406340+ /* Initialize max aggregatable pkts per session based on MTU */63226341 sp->lro_max_aggr_per_sess = ((1<<16) - 1) / dev->mtu;63236342 /* Check if we can use(if specified) user provided value */63246343 if (lro_max_pkts < sp->lro_max_aggr_per_sess)···64196438 * @cksum : FCS checksum of the frame.64206439 * @ring_no : the ring from which this RxD was extracted.64216440 * Description:64226422- * This function is called by the Tx interrupt serivce routine to perform64416441+ * This function is called by the Rx interrupt serivce routine to perform64236442 * some OS related operations on the SKB before passing it to the upper64246443 * layers. It mainly checks if the checksum is OK, if so adds it to the64256444 * SKBs cksum variable, increments the Rx packet count and passes the SKB···66796698 pci_read_config_word(sp->pdev, PCI_COMMAND, &pci_cmd);66806699}6681670066826682-MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");66836683-MODULE_LICENSE("GPL");66846684-MODULE_VERSION(DRV_VERSION);66856685-66866686-module_param(tx_fifo_num, int, 0);66876687-module_param(rx_ring_num, int, 0);66886688-module_param(rx_ring_mode, int, 0);66896689-module_param_array(tx_fifo_len, uint, NULL, 0);66906690-module_param_array(rx_ring_sz, uint, NULL, 0);66916691-module_param_array(rts_frm_len, uint, NULL, 0);66926692-module_param(use_continuous_tx_intrs, int, 1);66936693-module_param(rmac_pause_time, int, 0);66946694-module_param(mc_pause_threshold_q0q3, int, 0);66956695-module_param(mc_pause_threshold_q4q7, int, 0);66966696-module_param(shared_splits, int, 0);66976697-module_param(tmac_util_period, int, 0);66986698-module_param(rmac_util_period, int, 0);66996699-module_param(bimodal, bool, 0);67006700-module_param(l3l4hdr_size, int , 0);67016701-#ifndef CONFIG_S2IO_NAPI67026702-module_param(indicate_max_pkts, int, 0);67036703-#endif67046704-module_param(rxsync_frequency, int, 0);67056705-module_param(intr_type, int, 0);67066706-module_param(lro, int, 0);67076707-module_param(lro_max_pkts, int, 0);67086708-67096701static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)67106702{67116703 if ( tx_fifo_num > 8) {···67866832 }67876833 if (dev_intr_type != MSI_X) {67886834 if (pci_request_regions(pdev, s2io_driver_name)) {67896789- DBG_PRINT(ERR_DBG, "Request Regions failed\n"),67906790- pci_disable_device(pdev);68356835+ DBG_PRINT(ERR_DBG, "Request Regions failed\n");68366836+ pci_disable_device(pdev);67916837 return -ENODEV;67926838 }67936839 }···69116957 /* initialize the shared memory used by the NIC and the host */69126958 if (init_shared_mem(sp)) {69136959 DBG_PRINT(ERR_DBG, "%s: Memory allocation failed\n",69146914- __FUNCTION__);69606960+ dev->name);69156961 ret = -ENOMEM;69166962 goto mem_alloc_failed;69176963 }···70487094 dev->addr_len = ETH_ALEN;70497095 memcpy(dev->dev_addr, sp->def_mac_addr, ETH_ALEN);7050709670977097+ /* reset Nic and bring it to known state */70987098+ s2io_reset(sp);70997099+70517100 /*70527101 * Initialize the tasklet status and link state flags70537102 * and the card state parameter···70887131 goto register_failed;70897132 }70907133 s2io_vpd_read(sp);70917091- DBG_PRINT(ERR_DBG, "%s: Neterion %s",dev->name, sp->product_name);70927092- DBG_PRINT(ERR_DBG, "(rev %d), Driver version %s\n",70937093- get_xena_rev_id(sp->pdev),70947094- s2io_driver_version);70957134 DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2005 Neterion Inc.\n");71357135+ DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name,71367136+ sp->product_name, get_xena_rev_id(sp->pdev));71377137+ DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,71387138+ s2io_driver_version);70967139 DBG_PRINT(ERR_DBG, "%s: MAC ADDR: "70977140 "%02x:%02x:%02x:%02x:%02x:%02x\n", dev->name,70987141 sp->def_mac_addr[0].mac_addr[0],···73937436 if (ip->ihl != 5) /* IP has options */73947437 return -1;7395743874397439+ /* If we see CE codepoint in IP header, packet is not mergeable */74407440+ if (INET_ECN_is_ce(ipv4_get_dsfield(ip)))74417441+ return -1;74427442+74437443+ /* If we see ECE or CWR flags in TCP header, packet is not mergeable */73967444 if (tcp->urg || tcp->psh || tcp->rst || tcp->syn || tcp->fin ||73977397- !tcp->ack) {74457445+ tcp->ece || tcp->cwr || !tcp->ack) {73987446 /*73997447 * Currently recognize only the ack control word and74007448 * any other control field being set would result in···75537591static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb,75547592 u32 tcp_len)75557593{75567556- struct sk_buff *tmp, *first = lro->parent;75947594+ struct sk_buff *first = lro->parent;7557759575587596 first->len += tcp_len;75597597 first->data_len = lro->frags_len;75607598 skb_pull(skb, (skb->len - tcp_len));75617561- if ((tmp = skb_shinfo(first)->frag_list)) {75627562- while (tmp->next)75637563- tmp = tmp->next;75647564- tmp->next = skb;75657565- }75997599+ if (skb_shinfo(first)->frag_list)76007600+ lro->last_frag->next = skb;75667601 else75677602 skb_shinfo(first)->frag_list = skb;76037603+ lro->last_frag = skb;75687604 sp->mac_control.stats_info->sw_stat.clubbed_frms_cnt++;75697605 return;75707606}
···108108 if (r)109109 goto disable_int;110110111111- r = zd_set_encryption_type(chip, NO_WEP);111111+ /* We must inform the device that we are doing encryption/decryption in112112+ * software at the moment. */113113+ r = zd_set_encryption_type(chip, ENC_SNIFFER);112114 if (r)113115 goto disable_int;114116···138136{139137 struct ieee80211_device *ieee = zd_mac_to_ieee80211(mac);140138 struct zd_ioreq32 ioreqs[3] = {141141- { CR_RX_FILTER, RX_FILTER_BEACON|RX_FILTER_PROBE_RESPONSE|142142- RX_FILTER_AUTH|RX_FILTER_ASSOC_RESPONSE },139139+ { CR_RX_FILTER, STA_RX_FILTER },143140 { CR_SNIFFER_ON, 0U },144144- { CR_ENCRYPTION_TYPE, NO_WEP },145141 };146142147143 if (ieee->iw_mode == IW_MODE_MONITOR) {···713713struct zd_rt_hdr {714714 struct ieee80211_radiotap_header rt_hdr;715715 u8 rt_flags;716716+ u8 rt_rate;716717 u16 rt_channel;717718 u16 rt_chbitmask;718718- u16 rt_rate;719719-};719719+} __attribute__((packed));720720721721static void fill_rt_header(void *buffer, struct zd_mac *mac,722722 const struct ieee80211_rx_stats *stats,···735735 if (status->decryption_type & (ZD_RX_WEP64|ZD_RX_WEP128|ZD_RX_WEP256))736736 hdr->rt_flags |= IEEE80211_RADIOTAP_F_WEP;737737738738+ hdr->rt_rate = stats->rate / 5;739739+738740 /* FIXME: 802.11a */739741 hdr->rt_channel = cpu_to_le16(ieee80211chan2mhz(740742 _zd_chip_get_channel(&mac->chip)));741743 hdr->rt_chbitmask = cpu_to_le16(IEEE80211_CHAN_2GHZ |742744 ((status->frame_status & ZD_RX_FRAME_MODULATION_MASK) ==743745 ZD_RX_OFDM ? IEEE80211_CHAN_OFDM : IEEE80211_CHAN_CCK));744744-745745- hdr->rt_rate = stats->rate / 5;746746}747747748748/* Returns 1 if the data packet is for us and 0 otherwise. */
+3-4
drivers/net/wireless/zd1211rw/zd_usb.c
···323323{324324 struct zd_usb_interrupt *intr = &usb->intr;325325326326- ZD_ASSERT(in_interrupt());327326 spin_lock(&intr->lock);328327 intr->read_regs_enabled = 0;329328 spin_unlock(&intr->lock);···544545 * be padded. Unaligned access might also happen if the length_info545546 * structure is not present.546547 */547547- if (get_unaligned(&length_info->tag) == RX_LENGTH_INFO_TAG) {548548+ if (get_unaligned(&length_info->tag) == cpu_to_le16(RX_LENGTH_INFO_TAG))549549+ {548550 unsigned int l, k, n;549551 for (i = 0, l = 0;; i++) {550550- k = le16_to_cpu(get_unaligned(551551- &length_info->length[i]));552552+ k = le16_to_cpu(get_unaligned(&length_info->length[i]));552553 n = l+k;553554 if (n > length)554555 return;
+1-2
drivers/pci/hotplug/acpiphp_core.c
···2727 * along with this program; if not, write to the Free Software2828 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2929 *3030- * Send feedback to <gregkh@us.ibm.com>,3131- * <t-kochi@bq.jp.nec.com>3030+ * Send feedback to <kristen.c.accardi@intel.com>3231 *3332 */3433
+1-1
drivers/pci/hotplug/acpiphp_glue.c
···2626 * along with this program; if not, write to the Free Software2727 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.2828 *2929- * Send feedback to <t-kochi@bq.jp.nec.com>2929+ * Send feedback to <kristen.c.accardi@intel.com>3030 *3131 */3232
+20-18
drivers/pci/pcie/portdrv_pci.c
···3030/* global data */3131static const char device_name[] = "pcieport-driver";32323333-static int pcie_portdrv_save_config(struct pci_dev *dev)3434-{3535- return pci_save_state(dev);3636-}3737-3838-static int pcie_portdrv_restore_config(struct pci_dev *dev)3939-{4040- int retval;4141-4242- pci_restore_state(dev);4343- retval = pci_enable_device(dev);4444- if (retval)4545- return retval;4646- pci_set_master(dev);4747- return 0;4848-}4949-5033/*5134 * pcie_portdrv_probe - Probe PCI-Express port devices5235 * @dev: PCI-Express port device being probed···5673 "%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", 5774 __FUNCTION__, dev->device, dev->vendor);5875 }5959- if (pcie_port_device_register(dev)) 7676+ if (pcie_port_device_register(dev)) {7777+ pci_disable_device(dev);6078 return -ENOMEM;7979+ }61806281 return 0;6382}···7186}72877388#ifdef CONFIG_PM8989+static int pcie_portdrv_save_config(struct pci_dev *dev)9090+{9191+ return pci_save_state(dev);9292+}9393+9494+static int pcie_portdrv_restore_config(struct pci_dev *dev)9595+{9696+ int retval;9797+9898+ pci_restore_state(dev);9999+ retval = pci_enable_device(dev);100100+ if (retval)101101+ return retval;102102+ pci_set_master(dev);103103+ return 0;104104+}105105+74106static int pcie_portdrv_suspend (struct pci_dev *dev, pm_message_t state)75107{76108 int ret = pcie_port_device_suspend(dev, state);
···4141 * in the global list of PCI buses. If the bus is found, a pointer to its4242 * data structure is returned. If no bus is found, %NULL is returned.4343 */4444-struct pci_bus * __devinit pci_find_bus(int domain, int busnr)4444+struct pci_bus * pci_find_bus(int domain, int busnr)4545{4646 struct pci_bus *bus = NULL;4747 struct pci_bus *tmp_bus;
+6-6
drivers/pnp/interface.c
···265265 pnp_printf(buffer," disabled\n");266266 else267267 pnp_printf(buffer," 0x%llx-0x%llx\n",268268- pnp_port_start(dev, i),269269- pnp_port_end(dev, i));268268+ (unsigned long long)pnp_port_start(dev, i),269269+ (unsigned long long)pnp_port_end(dev, i));270270 }271271 }272272 for (i = 0; i < PNP_MAX_MEM; i++) {···276276 pnp_printf(buffer," disabled\n");277277 else278278 pnp_printf(buffer," 0x%llx-0x%llx\n",279279- pnp_mem_start(dev, i),280280- pnp_mem_end(dev, i));279279+ (unsigned long long)pnp_mem_start(dev, i),280280+ (unsigned long long)pnp_mem_end(dev, i));281281 }282282 }283283 for (i = 0; i < PNP_MAX_IRQ; i++) {···287287 pnp_printf(buffer," disabled\n");288288 else289289 pnp_printf(buffer," %lld\n",290290- pnp_irq(dev, i));290290+ (unsigned long long)pnp_irq(dev, i));291291 }292292 }293293 for (i = 0; i < PNP_MAX_DMA; i++) {···297297 pnp_printf(buffer," disabled\n");298298 else299299 pnp_printf(buffer," %lld\n",300300- pnp_dma(dev, i));300300+ (unsigned long long)pnp_dma(dev, i));301301 }302302 }303303 ret = (buffer->curr - buf);
+8
drivers/pnp/pnpacpi/rsparser.c
···173173 return;174174 }175175176176+ if (p->producer_consumer == ACPI_PRODUCER)177177+ return;178178+176179 if (p->resource_type == ACPI_MEMORY_RANGE)177180 pnpacpi_parse_allocated_memresource(res_table,178181 p->minimum, p->address_length);···255252 break;256253257254 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:255255+ if (res->data.ext_address64.producer_consumer == ACPI_PRODUCER)256256+ return AE_OK;258257 break;259258260259 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:260260+ if (res->data.extended_irq.producer_consumer == ACPI_PRODUCER)261261+ return AE_OK;262262+261263 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {262264 pnpacpi_parse_allocated_irqresource(res_table,263265 res->data.extended_irq.interrupts[i],
+2-8
drivers/scsi/ahci.c
···940940 return;941941942942 /* ignore interim PIO setup fis interrupts */943943- if (ata_tag_valid(ap->active_tag)) {944944- struct ata_queued_cmd *qc =945945- ata_qc_from_tag(ap, ap->active_tag);946946-947947- if (qc && qc->tf.protocol == ATA_PROT_PIO &&948948- (status & PORT_IRQ_PIOS_FIS))949949- return;950950- }943943+ if (ata_tag_valid(ap->active_tag) && (status & PORT_IRQ_PIOS_FIS)) 944944+ return;951945952946 if (ata_ratelimit())953947 ata_port_printk(ap, KERN_INFO, "spurious interrupt "
+2
drivers/scsi/aic7xxx/aicasm/Makefile
···1414clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)1515# Override default kernel CFLAGS. This is a userland app.1616AICASM_CFLAGS:= -I/usr/include -I.1717+LEX= flex1818+YACC= bison1719YFLAGS= -d18201921NOMAN= noman
+1-1
drivers/usb/Kconfig
···2424 default y if ARCH_S3C24102525 default y if PXA27x2626 default y if ARCH_EP93XX2727- default y if ARCH_AT91RM92002727+ default y if (ARCH_AT91RM9200 || ARCH_AT91SAM9261)2828 # PPC:2929 default y if STB03xxx3030 default y if PPC_MPC52xx
···207207208208config USB_GADGET_DUMMY_HCD209209 boolean "Dummy HCD (DEVELOPMENT)"210210- depends on USB && EXPERIMENTAL210210+ depends on (USB=y || (USB=m && USB_GADGET=m)) && EXPERIMENTAL211211 select USB_GADGET_DUALSPEED212212 help213213 This host controller driver emulates USB, looping all data transfer
+112-64
drivers/usb/gadget/at91_udc.c
···57575858/*5959 * This controller is simple and PIO-only. It's used in many AT91-series6060- * ARMv4T controllers, including the at91rm9200 (arm920T, with MMU),6161- * at91sam9261 (arm926ejs, with MMU), and several no-mmu versions.6060+ * full speed USB controllers, including the at91rm9200 (arm920T, with MMU),6161+ * at91sam926x (arm926ejs, with MMU), and several no-mmu versions.6262 *6363 * This driver expects the board has been wired with two GPIOs suppporting6464 * a VBUS sensing IRQ, and a D+ pullup. (They may be omitted, but the6565- * testing hasn't covered such cases.) The pullup is most important; it6565+ * testing hasn't covered such cases.)6666+ *6767+ * The pullup is most important (so it's integrated on sam926x parts). It6668 * provides software control over whether the host enumerates the device.6969+ *6770 * The VBUS sensing helps during enumeration, and allows both USB clocks6871 * (and the transceiver) to stay gated off until they're necessary, saving6969- * power. During USB suspend, the 48 MHz clock is gated off.7272+ * power. During USB suspend, the 48 MHz clock is gated off in hardware;7373+ * it may also be gated off by software during some Linux sleep states.7074 */71757272-#define DRIVER_VERSION "8 March 2005"7676+#define DRIVER_VERSION "3 May 2006"73777478static const char driver_name [] = "at91_udc";7579static const char ep0name[] = "ep0";···320316 *321317 * There are also state bits like FORCESTALL, EPEDS, DIR, and EPTYPE322318 * that shouldn't normally be changed.319319+ *320320+ * NOTE at91sam9260 docs mention synch between UDPCK and MCK clock domains,321321+ * implying a need to wait for one write to complete (test relevant bits)322322+ * before starting the next write. This shouldn't be an issue given how323323+ * infrequently we write, except maybe for write-then-read idioms.323324 */324325#define SET_FX (AT91_UDP_TXPKTRDY)325325-#define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP)326326+#define CLR_FX (RX_DATA_READY | AT91_UDP_RXSETUP \327327+ | AT91_UDP_STALLSENT | AT91_UDP_TXCOMP)326328327329/* pull OUT packet data from the endpoint's fifo */328330static int read_fifo (struct at91_ep *ep, struct at91_request *req)···482472483473/*-------------------------------------------------------------------------*/484474485485-static int at91_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)475475+static int at91_ep_enable(struct usb_ep *_ep,476476+ const struct usb_endpoint_descriptor *desc)486477{487478 struct at91_ep *ep = container_of(_ep, struct at91_ep, ep);488479 struct at91_udc *dev = ep->udc;···593582 * interesting for request or buffer allocation.594583 */595584596596-static struct usb_request *at91_ep_alloc_request (struct usb_ep *_ep, unsigned int gfp_flags)585585+static struct usb_request *586586+at91_ep_alloc_request(struct usb_ep *_ep, unsigned int gfp_flags)597587{598588 struct at91_request *req;599589600600- req = kcalloc(1, sizeof (struct at91_request), SLAB_KERNEL);590590+ req = kcalloc(1, sizeof (struct at91_request), gfp_flags);601591 if (!req)602592 return NULL;603593···874862 if (udc->gadget.speed == USB_SPEED_UNKNOWN)875863 driver = NULL;876864 udc->gadget.speed = USB_SPEED_UNKNOWN;865865+ udc->suspended = 0;877866878867 for (i = 0; i < NUM_ENDPOINTS; i++) {879868 struct at91_ep *ep = &udc->ep[i];···902889 return;903890 udc->clocked = 0;904891 udc->gadget.speed = USB_SPEED_UNKNOWN;905905- clk_disable(udc->iclk);906892 clk_disable(udc->fclk);893893+ clk_disable(udc->iclk);907894}908895909896/*···924911 at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);925912 at91_set_gpio_value(udc->board.pullup_pin, 0);926913 clk_off(udc);927927-928928- // REVISIT: with transceiver disabled, will D- float929929- // so that a host would falsely detect a device?930914 }931915}932916···13001290 if (udc->wait_for_addr_ack) {13011291 u32 tmp;1302129213031303- at91_udp_write(AT91_UDP_FADDR, AT91_UDP_FEN | udc->addr);12931293+ at91_udp_write(AT91_UDP_FADDR,12941294+ AT91_UDP_FEN | udc->addr);13041295 tmp = at91_udp_read(AT91_UDP_GLB_STAT);13051296 tmp &= ~AT91_UDP_FADDEN;13061297 if (udc->addr)···13721361 u32 rescans = 5;1373136213741363 while (rescans--) {13751375- u32 status = at91_udp_read(AT91_UDP_ISR);13641364+ u32 status;1376136513771377- status &= at91_udp_read(AT91_UDP_IMR);13661366+ status = at91_udp_read(AT91_UDP_ISR)13671367+ & at91_udp_read(AT91_UDP_IMR);13781368 if (!status)13791369 break;13801370···13911379 stop_activity(udc);1392138013931381 /* enable ep0 */13941394- at91_udp_write(AT91_UDP_CSR(0), AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL);13821382+ at91_udp_write(AT91_UDP_CSR(0),13831383+ AT91_UDP_EPEDS | AT91_UDP_EPTYPE_CTRL);13951384 udc->gadget.speed = USB_SPEED_FULL;13961385 udc->suspended = 0;13971386 at91_udp_write(AT91_UDP_IER, AT91_UDP_EP(0));1398138713991388 /*14001389 * NOTE: this driver keeps clocks off unless the14011401- * USB host is present. That saves power, and also14021402- * eliminates IRQs (reset, resume, suspend) that can14031403- * otherwise flood from the controller. If your14041404- * board doesn't support VBUS detection, suspend and14051405- * resume irq logic may need more attention...13901390+ * USB host is present. That saves power, but for13911391+ * boards that don't support VBUS detection, both13921392+ * clocks need to be active most of the time.14061393 */1407139414081395 /* host initiated suspend (3+ms bus idle) */···1463145214641453/*-------------------------------------------------------------------------*/1465145414551455+static void nop_release(struct device *dev)14561456+{14571457+ /* nothing to free */14581458+}14591459+14661460static struct at91_udc controller = {14671461 .gadget = {14681468- .ops = &at91_udc_ops,14691469- .ep0 = &controller.ep[0].ep,14701470- .name = driver_name,14711471- .dev = {14721472- .bus_id = "gadget"14621462+ .ops = &at91_udc_ops,14631463+ .ep0 = &controller.ep[0].ep,14641464+ .name = driver_name,14651465+ .dev = {14661466+ .bus_id = "gadget",14671467+ .release = nop_release,14731468 }14741469 },14751470 .ep[0] = {···14851468 },14861469 .udc = &controller,14871470 .maxpacket = 8,14881488- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(0)),14711471+ .creg = (void __iomem *)(AT91_VA_BASE_UDP14721472+ + AT91_UDP_CSR(0)),14891473 .int_mask = 1 << 0,14901474 },14911475 .ep[1] = {···14971479 .udc = &controller,14981480 .is_pingpong = 1,14991481 .maxpacket = 64,15001500- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(1)),14821482+ .creg = (void __iomem *)(AT91_VA_BASE_UDP14831483+ + AT91_UDP_CSR(1)),15011484 .int_mask = 1 << 1,15021485 },15031486 .ep[2] = {···15091490 .udc = &controller,15101491 .is_pingpong = 1,15111492 .maxpacket = 64,15121512- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(2)),14931493+ .creg = (void __iomem *)(AT91_VA_BASE_UDP14941494+ + AT91_UDP_CSR(2)),15131495 .int_mask = 1 << 2,15141496 },15151497 .ep[3] = {···15211501 },15221502 .udc = &controller,15231503 .maxpacket = 8,15241524- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(3)),15041504+ .creg = (void __iomem *)(AT91_VA_BASE_UDP15051505+ + AT91_UDP_CSR(3)),15251506 .int_mask = 1 << 3,15261507 },15271508 .ep[4] = {···15331512 .udc = &controller,15341513 .is_pingpong = 1,15351514 .maxpacket = 256,15361536- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(4)),15151515+ .creg = (void __iomem *)(AT91_VA_BASE_UDP15161516+ + AT91_UDP_CSR(4)),15371517 .int_mask = 1 << 4,15381518 },15391519 .ep[5] = {···15451523 .udc = &controller,15461524 .is_pingpong = 1,15471525 .maxpacket = 256,15481548- .creg = (void __iomem *)(AT91_VA_BASE_UDP + AT91_UDP_CSR(5)),15261526+ .creg = (void __iomem *)(AT91_VA_BASE_UDP15271527+ + AT91_UDP_CSR(5)),15491528 .int_mask = 1 << 5,15501529 },15511551- /* ep6 and ep7 are also reserved */15301530+ /* ep6 and ep7 are also reserved (custom silicon might use them) */15521531};1553153215541533static irqreturn_t at91_vbus_irq(int irq, void *_udc, struct pt_regs *r)···1616159316171594 local_irq_disable();16181595 udc->enabled = 0;15961596+ at91_udp_write(AT91_UDP_IDR, ~0);16191597 pullup(udc, 0);16201598 local_irq_enable();16211599···16481624 return -ENODEV;16491625 }1650162616271627+ if (pdev->num_resources != 2) {16281628+ DBG("invalid num_resources");16291629+ return -ENODEV;16301630+ }16311631+ if ((pdev->resource[0].flags != IORESOURCE_MEM)16321632+ || (pdev->resource[1].flags != IORESOURCE_IRQ)) {16331633+ DBG("invalid resource type");16341634+ return -ENODEV;16351635+ }16361636+16511637 if (!request_mem_region(AT91_BASE_UDP, SZ_16K, driver_name)) {16521638 DBG("someone's using UDC memory\n");16531639 return -EBUSY;···16831649 if (retval < 0)16841650 goto fail0;1685165116861686- /* disable everything until there's a gadget driver and vbus */16871687- pullup(udc, 0);16521652+ /* don't do anything until we have both gadget driver and VBUS */16531653+ clk_enable(udc->iclk);16541654+ at91_udp_write(AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS);16551655+ at91_udp_write(AT91_UDP_IDR, 0xffffffff);16561656+ clk_disable(udc->iclk);1688165716891658 /* request UDC and maybe VBUS irqs */16901690- if (request_irq(AT91_ID_UDP, at91_udc_irq, IRQF_DISABLED, driver_name, udc)) {16911691- DBG("request irq %d failed\n", AT91_ID_UDP);16591659+ udc->udp_irq = platform_get_irq(pdev, 0);16601660+ if (request_irq(udc->udp_irq, at91_udc_irq,16611661+ IRQF_DISABLED, driver_name, udc)) {16621662+ DBG("request irq %d failed\n", udc->udp_irq);16921663 retval = -EBUSY;16931664 goto fail1;16941665 }16951666 if (udc->board.vbus_pin > 0) {16961696- if (request_irq(udc->board.vbus_pin, at91_vbus_irq, IRQF_DISABLED, driver_name, udc)) {16971697- DBG("request vbus irq %d failed\n", udc->board.vbus_pin);16981698- free_irq(AT91_ID_UDP, udc);16671667+ if (request_irq(udc->board.vbus_pin, at91_vbus_irq,16681668+ IRQF_DISABLED, driver_name, udc)) {16691669+ DBG("request vbus irq %d failed\n",16701670+ udc->board.vbus_pin);16711671+ free_irq(udc->udp_irq, udc);16991672 retval = -EBUSY;17001673 goto fail1;17011674 }···17111670 udc->vbus = 1;17121671 }17131672 dev_set_drvdata(dev, udc);16731673+ device_init_wakeup(dev, 1);17141674 create_debug_file(udc);1715167517161676 INFO("%s version %s\n", driver_name, DRIVER_VERSION);···17201678fail1:17211679 device_unregister(&udc->gadget.dev);17221680fail0:17231723- release_mem_region(AT91_VA_BASE_UDP, SZ_16K);16811681+ release_mem_region(AT91_BASE_UDP, SZ_16K);17241682 DBG("%s probe failed, %d\n", driver_name, retval);17251683 return retval;17261684}1727168517281728-static int __devexit at91udc_remove(struct platform_device *dev)16861686+static int __devexit at91udc_remove(struct platform_device *pdev)17291687{17301730- struct at91_udc *udc = platform_get_drvdata(dev);16881688+ struct at91_udc *udc = platform_get_drvdata(pdev);1731168917321690 DBG("remove\n");17331691···17361694 if (udc->driver != 0)17371695 usb_gadget_unregister_driver(udc->driver);1738169616971697+ device_init_wakeup(&pdev->dev, 0);17391698 remove_debug_file(udc);17401699 if (udc->board.vbus_pin > 0)17411700 free_irq(udc->board.vbus_pin, udc);17421742- free_irq(AT91_ID_UDP, udc);17011701+ free_irq(udc->udp_irq, udc);17431702 device_unregister(&udc->gadget.dev);17441703 release_mem_region(AT91_BASE_UDP, SZ_16K);17451704···17511708}1752170917531710#ifdef CONFIG_PM17541754-static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg)17111711+static int at91udc_suspend(struct platform_device *pdev, pm_message_t mesg)17551712{17561756- struct at91_udc *udc = platform_get_drvdata(dev);17131713+ struct at91_udc *udc = platform_get_drvdata(pdev);17141714+ int wake = udc->driver && device_may_wakeup(&pdev->dev);1757171517581758- /*17591759- * The "safe" suspend transitions are opportunistic ... e.g. when17601760- * the USB link is suspended (48MHz clock autogated off), or when17611761- * it's disconnected (programmatically gated off, elsewhere).17621762- * Then we can suspend, and the chip can enter slow clock mode.17631763- *17641764- * The problem case is some component (user mode?) suspending this17651765- * device while it's active, with the 48 MHz clock in use. There17661766- * are two basic approaches: (a) veto suspend levels involving slow17671767- * clock mode, (b) disconnect, so 48 MHz will no longer be in use17681768- * and we can enter slow clock mode. This uses (b) for now, since17691769- * it's simplest until AT91 PM exists and supports the other option.17161716+ /* Unless we can act normally to the host (letting it wake us up17171717+ * whenever it has work for us) force disconnect. Wakeup requires17181718+ * PLLB for USB events (signaling for reset, wakeup, or incoming17191719+ * tokens) and VBUS irqs (on systems which support them).17701720 */17711771- if (udc->vbus && !udc->suspended)17211721+ if ((!udc->suspended && udc->addr)17221722+ || !wake17231723+ || at91_suspend_entering_slow_clock()) {17721724 pullup(udc, 0);17251725+ disable_irq_wake(udc->udp_irq);17261726+ } else17271727+ enable_irq_wake(udc->udp_irq);17281728+17291729+ if (udc->board.vbus_pin > 0) {17301730+ if (wake)17311731+ enable_irq_wake(udc->board.vbus_pin);17321732+ else17331733+ disable_irq_wake(udc->board.vbus_pin);17341734+ }17731735 return 0;17741736}1775173717761776-static int at91udc_resume(struct platform_device *dev)17381738+static int at91udc_resume(struct platform_device *pdev)17771739{17781778- struct at91_udc *udc = platform_get_drvdata(dev);17401740+ struct at91_udc *udc = platform_get_drvdata(pdev);1779174117801742 /* maybe reconnect to host; if so, clocks on */17811743 pullup(udc, 1);···17961748 .remove = __devexit_p(at91udc_remove),17971749 .shutdown = at91udc_shutdown,17981750 .suspend = at91udc_suspend,17991799- .resume = at91udc_resume,17511751+ .resume = at91udc_resume,18001752 .driver = {18011753 .name = (char *) driver_name,18021754 .owner = THIS_MODULE,···18151767}18161768module_exit(udc_exit_module);1817176918181818-MODULE_DESCRIPTION("AT91RM9200 udc driver");17701770+MODULE_DESCRIPTION("AT91 udc driver");18191771MODULE_AUTHOR("Thomas Rathbone, David Brownell");18201772MODULE_LICENSE("GPL");
···44 * Copyright (C) 2004 SAN People (Pty) Ltd.55 * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org>66 *77- * AT91RM9200 Bus Glue77+ * AT91 Bus Glue88 *99 * Based on fragments of 2.4 driver by Rick Bronson.1010 * Based on ohci-omap.c···1919#include <asm/hardware.h>2020#include <asm/arch/board.h>21212222-#ifndef CONFIG_ARCH_AT91RM92002323-#error "CONFIG_ARCH_AT91RM9200 must be defined."2222+#ifndef CONFIG_ARCH_AT912323+#error "CONFIG_ARCH_AT91 must be defined."2424#endif25252626/* interface and function clocks */2727static struct clk *iclk, *fclk;2828+static int clocked;28292930extern int usb_disabled(void);3031···3635 struct usb_hcd *hcd = platform_get_drvdata(pdev);3736 struct ohci_regs __iomem *regs = hcd->regs;38373939- dev_dbg(&pdev->dev, "starting AT91RM9200 OHCI USB Controller\n");3838+ dev_dbg(&pdev->dev, "start\n");40394140 /*4241 * Start the USB clocks.4342 */4443 clk_enable(iclk);4544 clk_enable(fclk);4545+ clocked = 1;46464747 /*4848 * The USB host controller must remain in reset.···5654 struct usb_hcd *hcd = platform_get_drvdata(pdev);5755 struct ohci_regs __iomem *regs = hcd->regs;58565959- dev_dbg(&pdev->dev, "stopping AT91RM9200 OHCI USB Controller\n");5757+ dev_dbg(&pdev->dev, "stop\n");60586159 /*6260 * Put the USB host controller into reset.···6866 */6967 clk_disable(fclk);7068 clk_disable(iclk);6969+ clocked = 0;7170}72717372···817882798380/**8484- * usb_hcd_at91_probe - initialize AT91RM9200-based HCDs8181+ * usb_hcd_at91_probe - initialize AT91-based HCDs8582 * Context: !in_interrupt()8683 *8784 * Allocates basic resources for this USB host controller, and8885 * then invokes the start() method for the HCD associated with it8986 * through the hotplug entry's driver_data.9087 */9191-int usb_hcd_at91_probe (const struct hc_driver *driver, struct platform_device *pdev)8888+static int usb_hcd_at91_probe(const struct hc_driver *driver,8989+ struct platform_device *pdev)9290{9391 int retval;9492 struct usb_hcd *hcd = NULL;···9995 return -ENODEV;10096 }10197102102- if ((pdev->resource[0].flags != IORESOURCE_MEM) || (pdev->resource[1].flags != IORESOURCE_IRQ)) {9898+ if ((pdev->resource[0].flags != IORESOURCE_MEM)9999+ || (pdev->resource[1].flags != IORESOURCE_IRQ)) {103100 pr_debug("hcd probe: invalid resource type\n");104101 return -ENODEV;105102 }106103107107- hcd = usb_create_hcd(driver, &pdev->dev, "at91rm9200");104104+ hcd = usb_create_hcd(driver, &pdev->dev, "at91");108105 if (!hcd)109106 return -ENOMEM;110107 hcd->rsrc_start = pdev->resource[0].start;···154149/* may be called with controller, bus, and devices active */155150156151/**157157- * usb_hcd_at91_remove - shutdown processing for AT91RM9200-based HCDs152152+ * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs158153 * @dev: USB Host Controller being removed159154 * Context: !in_interrupt()160155 *161156 * Reverses the effect of usb_hcd_at91_probe(), first invoking162157 * the HCD's stop() method. It is always called from a thread163163- * context, normally "rmmod", "apmd", or something similar.158158+ * context, "rmmod" or something similar.164159 *165160 */166166-static int usb_hcd_at91_remove (struct usb_hcd *hcd, struct platform_device *pdev)161161+static int usb_hcd_at91_remove(struct usb_hcd *hcd,162162+ struct platform_device *pdev)167163{168164 usb_remove_hcd(hcd);169165 at91_stop_hc(pdev);170166 iounmap(hcd->regs);171167 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);168168+ disable_irq_wake(hcd->irq);172169173170 clk_put(fclk);174171 clk_put(iclk);···185178static int __devinit186179ohci_at91_start (struct usb_hcd *hcd)187180{188188-// struct at91_ohci_data *board = hcd->self.controller->platform_data;181181+ struct at91_usbh_data *board = hcd->self.controller->platform_data;189182 struct ohci_hcd *ohci = hcd_to_ohci (hcd);183183+ struct usb_device *root = hcd->self.root_hub;190184 int ret;191185192186 if ((ret = ohci_init(ohci)) < 0)193187 return ret;188188+189189+ root->maxchild = board->ports;194190195191 if ((ret = ohci_run(ohci)) < 0) {196192 err("can't start %s", hcd->self.bus_name);197193 ohci_stop(hcd);198194 return ret;199195 }200200-// hcd->self.root_hub->maxchild = board->ports;201196 return 0;202197}203198···207198208199static const struct hc_driver ohci_at91_hc_driver = {209200 .description = hcd_name,210210- .product_desc = "AT91RM9200 OHCI",201201+ .product_desc = "AT91 OHCI",211202 .hcd_priv_size = sizeof(struct ohci_hcd),212203213204 /*···249240250241/*-------------------------------------------------------------------------*/251242252252-static int ohci_hcd_at91_drv_probe(struct platform_device *dev)243243+static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)253244{254254- return usb_hcd_at91_probe(&ohci_at91_hc_driver, dev);245245+ device_init_wakeup(&pdev->dev, 1);246246+ return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);255247}256248257257-static int ohci_hcd_at91_drv_remove(struct platform_device *dev)249249+static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)258250{259259- return usb_hcd_at91_remove(platform_get_drvdata(dev), dev);251251+ device_init_wakeup(&pdev->dev, 0);252252+ return usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev);260253}261254262255#ifdef CONFIG_PM263256264264-/* REVISIT suspend/resume look "too" simple here */265265-266257static int267267-ohci_hcd_at91_drv_suspend(struct platform_device *dev, pm_message_t mesg)258258+ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg)268259{269269- clk_disable(fclk);270270- clk_disable(iclk);260260+ struct usb_hcd *hcd = platform_get_drvdata(pdev);261261+ struct ohci_hcd *ohci = hcd_to_ohci(hcd);262262+263263+ if (device_may_wakeup(&pdev->dev))264264+ enable_irq_wake(hcd->irq);265265+ else266266+ disable_irq_wake(hcd->irq);267267+268268+ /*269269+ * The integrated transceivers seem unable to notice disconnect,270270+ * reconnect, or wakeup without the 48 MHz clock active. so for271271+ * correctness, always discard connection state (using reset).272272+ *273273+ * REVISIT: some boards will be able to turn VBUS off...274274+ */275275+ if (at91_suspend_entering_slow_clock()) {276276+ ohci_usb_reset (ohci);277277+ clk_disable(fclk);278278+ clk_disable(iclk);279279+ clocked = 0;280280+ }271281272282 return 0;273283}274284275275-static int ohci_hcd_at91_drv_resume(struct platform_device *dev)285285+static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)276286{277277- clk_enable(iclk);278278- clk_enable(fclk);287287+ if (!clocked) {288288+ clk_enable(iclk);289289+ clk_enable(fclk);290290+ }279291280292 return 0;281293}···305275#define ohci_hcd_at91_drv_resume NULL306276#endif307277308308-MODULE_ALIAS("at91rm9200-ohci");278278+MODULE_ALIAS("at91_ohci");309279310280static struct platform_driver ohci_hcd_at91_driver = {311281 .probe = ohci_hcd_at91_drv_probe,···313283 .suspend = ohci_hcd_at91_drv_suspend,314284 .resume = ohci_hcd_at91_drv_resume,315285 .driver = {316316- .name = "at91rm9200-ohci",286286+ .name = "at91_ohci",317287 .owner = THIS_MODULE,318288 },319289};
+2-1
drivers/usb/host/ohci-hcd.c
···913913#include "ohci-ppc-soc.c"914914#endif915915916916-#ifdef CONFIG_ARCH_AT91RM9200916916+#if defined(CONFIG_ARCH_AT91RM9200) || defined(CONFIG_ARCH_AT91SAM9261)917917#include "ohci-at91.c"918918#endif919919···927927 || defined (CONFIG_SOC_AU1X00) \928928 || defined (CONFIG_USB_OHCI_HCD_PPC_SOC) \929929 || defined (CONFIG_ARCH_AT91RM9200) \930930+ || defined (CONFIG_ARCH_AT91SAM9261) \930931 )931932#error "missing bus glue for ohci-hcd"932933#endif
+3-1
drivers/usb/host/uhci-q.c
···943943 /* We received a short packet */944944 if (urb->transfer_flags & URB_SHORT_NOT_OK)945945 ret = -EREMOTEIO;946946- else if (ctrlstat & TD_CTRL_SPD)946946+947947+ /* Fixup needed only if this isn't the URB's last TD */948948+ else if (&td->list != urbp->td_list.prev)947949 ret = 1;948950 }949951
+98-74
drivers/usb/input/ati_remote.c
···111111#define NAME_BUFSIZE 80 /* size of product name, path buffers */112112#define DATA_BUFSIZE 63 /* size of URB data buffers */113113114114+/*115115+ * Duplicate event filtering time.116116+ * Sequential, identical KIND_FILTERED inputs with less than117117+ * FILTER_TIME milliseconds between them are considered as repeat118118+ * events. The hardware generates 5 events for the first keypress119119+ * and we have to take this into account for an accurate repeat120120+ * behaviour.121121+ */122122+#define FILTER_TIME 60 /* msec */123123+114124static unsigned long channel_mask;115115-module_param(channel_mask, ulong, 0444);125125+module_param(channel_mask, ulong, 0644);116126MODULE_PARM_DESC(channel_mask, "Bitmask of remote control channels to ignore");117127118128static int debug;119119-module_param(debug, int, 0444);129129+module_param(debug, int, 0644);120130MODULE_PARM_DESC(debug, "Enable extra debug messages and information");131131+132132+static int repeat_filter = FILTER_TIME;133133+module_param(repeat_filter, int, 0644);134134+MODULE_PARM_DESC(repeat_filter, "Repeat filter time, default = 60 msec");121135122136#define dbginfo(dev, format, arg...) do { if (debug) dev_info(dev , format , ## arg); } while (0)123137#undef err···156142/* Device initialization strings */157143static char init1[] = { 0x01, 0x00, 0x20, 0x14 };158144static char init2[] = { 0x01, 0x00, 0x20, 0x14, 0x20, 0x20, 0x20 };159159-160160-/* Acceleration curve for directional control pad */161161-static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };162162-163163-/* Duplicate event filtering time.164164- * Sequential, identical KIND_FILTERED inputs with less than165165- * FILTER_TIME jiffies between them are considered as repeat166166- * events. The hardware generates 5 events for the first keypress167167- * and we have to take this into account for an accurate repeat168168- * behaviour.169169- * (HZ / 20) == 50 ms and works well for me.170170- */171171-#define FILTER_TIME (HZ / 20)172145173146struct ati_remote {174147 struct input_dev *idev;···414413}415414416415/*416416+ * ati_remote_compute_accel417417+ *418418+ * Implements acceleration curve for directional control pad419419+ * If elapsed time since last event is > 1/4 second, user "stopped",420420+ * so reset acceleration. Otherwise, user is probably holding the control421421+ * pad down, so we increase acceleration, ramping up over two seconds to422422+ * a maximum speed.423423+ */424424+static int ati_remote_compute_accel(struct ati_remote *ati_remote)425425+{426426+ static const char accel[] = { 1, 2, 4, 6, 9, 13, 20 };427427+ unsigned long now = jiffies;428428+ int acc;429429+430430+ if (time_after(now, ati_remote->old_jiffies + msecs_to_jiffies(250))) {431431+ acc = 1;432432+ ati_remote->acc_jiffies = now;433433+ }434434+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(125)))435435+ acc = accel[0];436436+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(250)))437437+ acc = accel[1];438438+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(500)))439439+ acc = accel[2];440440+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1000)))441441+ acc = accel[3];442442+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(1500)))443443+ acc = accel[4];444444+ else if (time_before(now, ati_remote->acc_jiffies + msecs_to_jiffies(2000)))445445+ acc = accel[5];446446+ else447447+ acc = accel[6];448448+449449+ return acc;450450+}451451+452452+/*417453 * ati_remote_report_input418454 */419455static void ati_remote_input_report(struct urb *urb, struct pt_regs *regs)···503465504466 if (ati_remote_tbl[index].kind == KIND_FILTERED) {505467 /* Filter duplicate events which happen "too close" together. */506506- if ((ati_remote->old_data[0] == data[1]) &&507507- (ati_remote->old_data[1] == data[2]) &&508508- time_before(jiffies, ati_remote->old_jiffies + FILTER_TIME)) {468468+ if (ati_remote->old_data[0] == data[1] &&469469+ ati_remote->old_data[1] == data[2] &&470470+ time_before(jiffies, ati_remote->old_jiffies + msecs_to_jiffies(repeat_filter))) {509471 ati_remote->repeat_count++;510472 } else {511473 ati_remote->repeat_count = 0;···515477 ati_remote->old_data[1] = data[2];516478 ati_remote->old_jiffies = jiffies;517479518518- if ((ati_remote->repeat_count > 0)519519- && (ati_remote->repeat_count < 5))480480+ if (ati_remote->repeat_count > 0 &&481481+ ati_remote->repeat_count < 5)520482 return;521483522484523485 input_regs(dev, regs);524486 input_event(dev, ati_remote_tbl[index].type,525487 ati_remote_tbl[index].code, 1);488488+ input_sync(dev);526489 input_event(dev, ati_remote_tbl[index].type,527490 ati_remote_tbl[index].code, 0);528491 input_sync(dev);529492530530- return;531531- }493493+ } else {532494533533- /*534534- * Other event kinds are from the directional control pad, and have an535535- * acceleration factor applied to them. Without this acceleration, the536536- * control pad is mostly unusable.537537- *538538- * If elapsed time since last event is > 1/4 second, user "stopped",539539- * so reset acceleration. Otherwise, user is probably holding the control540540- * pad down, so we increase acceleration, ramping up over two seconds to541541- * a maximum speed. The acceleration curve is #defined above.542542- */543543- if (time_after(jiffies, ati_remote->old_jiffies + (HZ >> 2))) {544544- acc = 1;545545- ati_remote->acc_jiffies = jiffies;546546- }547547- else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 3))) acc = accel[0];548548- else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 2))) acc = accel[1];549549- else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ >> 1))) acc = accel[2];550550- else if (time_before(jiffies, ati_remote->acc_jiffies + HZ)) acc = accel[3];551551- else if (time_before(jiffies, ati_remote->acc_jiffies + HZ+(HZ>>1))) acc = accel[4];552552- else if (time_before(jiffies, ati_remote->acc_jiffies + (HZ << 1))) acc = accel[5];553553- else acc = accel[6];495495+ /*496496+ * Other event kinds are from the directional control pad, and have an497497+ * acceleration factor applied to them. Without this acceleration, the498498+ * control pad is mostly unusable.499499+ */500500+ acc = ati_remote_compute_accel(ati_remote);554501555555- input_regs(dev, regs);556556- switch (ati_remote_tbl[index].kind) {557557- case KIND_ACCEL:558558- input_event(dev, ati_remote_tbl[index].type,559559- ati_remote_tbl[index].code,560560- ati_remote_tbl[index].value * acc);561561- break;562562- case KIND_LU:563563- input_report_rel(dev, REL_X, -acc);564564- input_report_rel(dev, REL_Y, -acc);565565- break;566566- case KIND_RU:567567- input_report_rel(dev, REL_X, acc);568568- input_report_rel(dev, REL_Y, -acc);569569- break;570570- case KIND_LD:571571- input_report_rel(dev, REL_X, -acc);572572- input_report_rel(dev, REL_Y, acc);573573- break;574574- case KIND_RD:575575- input_report_rel(dev, REL_X, acc);576576- input_report_rel(dev, REL_Y, acc);577577- break;578578- default:579579- dev_dbg(&ati_remote->interface->dev, "ati_remote kind=%d\n",580580- ati_remote_tbl[index].kind);581581- }582582- input_sync(dev);502502+ input_regs(dev, regs);503503+ switch (ati_remote_tbl[index].kind) {504504+ case KIND_ACCEL:505505+ input_event(dev, ati_remote_tbl[index].type,506506+ ati_remote_tbl[index].code,507507+ ati_remote_tbl[index].value * acc);508508+ break;509509+ case KIND_LU:510510+ input_report_rel(dev, REL_X, -acc);511511+ input_report_rel(dev, REL_Y, -acc);512512+ break;513513+ case KIND_RU:514514+ input_report_rel(dev, REL_X, acc);515515+ input_report_rel(dev, REL_Y, -acc);516516+ break;517517+ case KIND_LD:518518+ input_report_rel(dev, REL_X, -acc);519519+ input_report_rel(dev, REL_Y, acc);520520+ break;521521+ case KIND_RD:522522+ input_report_rel(dev, REL_X, acc);523523+ input_report_rel(dev, REL_Y, acc);524524+ break;525525+ default:526526+ dev_dbg(&ati_remote->interface->dev, "ati_remote kind=%d\n",527527+ ati_remote_tbl[index].kind);528528+ }529529+ input_sync(dev);583530584584- ati_remote->old_jiffies = jiffies;585585- ati_remote->old_data[0] = data[1];586586- ati_remote->old_data[1] = data[2];531531+ ati_remote->old_jiffies = jiffies;532532+ ati_remote->old_data[0] = data[1];533533+ ati_remote->old_data[1] = data[2];534534+ }587535}588536589537/*
+2-1
drivers/usb/input/hid-input.c
···607607608608 }609609610610- if (usage->hat_min < usage->hat_max || usage->hat_dir) {610610+ if (usage->type == EV_ABS &&611611+ (usage->hat_min < usage->hat_max || usage->hat_dir)) {611612 int i;612613 for (i = usage->code; i < usage->code + 2 && i <= max; i++) {613614 input_set_abs_params(input, i, -1, 1, 0, 0);
···1212* the single I/O ports of the device.1313*1414* Supported vendors: AK Modul-Bus Computer GmbH1515-* Supported devices: CY7C63001A-PC (to be continued...)1616-* Supported functions: Read/Write Ports (to be continued...)1515+* (Firmware "Port-Chip")1616+*1717+* Supported devices: CY7C63001A-PC1818+* CY7C63001C-PXC1919+* CY7C63001C-SXC2020+*2121+* Supported functions: Read/Write Ports1722*1823*1924* This program is free software; you can redistribute it and/or
···6262 To compile this driver as a module, choose M here: the6363 module will be called airprime.64646565-config USB_SERIAL_ANYDATA6666- tristate "USB AnyData CDMA Wireless Driver"6767- depends on USB_SERIAL6868- help6969- Say Y here if you want to use a AnyData CDMA device.7070-7171- To compile this driver as a module, choose M here: the7272- module will be called anydata.7373-7465config USB_SERIAL_ARK31167566 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)"7667 depends on USB_SERIAL && EXPERIMENTAL···493502 module will be called keyspan_pda.494503495504config USB_SERIAL_OPTION496496- tristate "USB driver for GSM modems"505505+ tristate "USB driver for GSM and CDMA modems"497506 depends on USB_SERIAL498507 help499499- Say Y here if you have an "Option" GSM PCMCIA card500500- (or an OEM version: branded Huawei, Audiovox, or Novatel).508508+ Say Y here if you have a GSM or CDMA modem that's connected to USB.501509502502- These cards feature a built-in OHCI-USB adapter and an503503- internally-connected GSM modem. The USB bus is not504504- accessible externally.510510+ This driver also supports several PCMCIA cards which have a511511+ built-in OHCI-USB adapter and an internally-connected GSM modem.512512+ The USB bus on these cards is not accessible externally.513513+514514+ Supported devices include (some of?) those made by:515515+ Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or516516+ Anydata.505517506518 To compile this driver as a module, choose M here: the507519 module will be called option.
···182182/* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */183183#define FTDI_USB_UIRT_PID 0xF850 /* Product Id */184184185185+/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */186186+187187+#define FTDI_TNC_X_PID 0xEBE0188188+185189/*186190 * ELV USB devices submitted by Christian Abt of ELV (www.elv.de).187191 * All of these devices use FTDI's vendor ID (0x0403).
+1
drivers/usb/serial/ipaq.c
···250250 { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */251251 { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */252252 { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */253253+ { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */253254 { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */254255 { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */255256 { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */
+7-69
drivers/usb/serial/option.c
···991010 Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>11111212- History:1313-1414- 2005-05-19 v0.1 Initial version, based on incomplete docs1515- and analysis of misbehavior with the standard driver1616- 2005-05-20 v0.2 Extended the input buffer to avoid losing1717- random 64-byte chunks of data1818- 2005-05-21 v0.3 implemented chars_in_buffer()1919- turned on low_latency2020- simplified the code somewhat2121- 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load2222- removed some dead code2323- added sponsor notice2424- coding style clean-up2525- 2005-06-20 v0.4.1 add missing braces :-/2626- killed end-of-line whitespace2727- 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION22828- 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard2929- 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes3030- wants to send >2000 bytes.3131- 2006-04-10 v0.5 fixed two array overrun errors :-/3232- 2006-04-21 v0.5.1 added support for Sierra Wireless MC87553333- 2006-05-15 v0.6 re-enable multi-port support3434- 2006-06-01 v0.6.1 add COBRA3535- 2006-06-01 v0.6.2 add backwards-compatibility stuff3636- 2006-06-01 v0.6.3 add Novatel Wireless3737- 2006-06-01 v0.7 Option => GSM3838- 2006-06-01 v0.7.1 add COBRA21212+ History: see the git log.39134014 Work sponsored by: Sigos GmbH, Germany <info@sigos.de>41154216 This driver exists because the "normal" serial driver doesn't work too well4317 with GSM modems. Issues:4418 - data loss -- one single Receive URB is not nearly enough4545- - nonstandard flow (Option devices) and multiplex (Sierra) control1919+ - nonstandard flow (Option devices) control4620 - controlling the baud rate doesn't make sense47214822 This driver is named "option" because the most common device it's···7096#define OPTION_VENDOR_ID 0x0AF07197#define HUAWEI_VENDOR_ID 0x12D17298#define AUDIOVOX_VENDOR_ID 0x0F3D7373-#define SIERRAWIRELESS_VENDOR_ID 0x11997499#define NOVATELWIRELESS_VENDOR_ID 0x1410100100+#define ANYDATA_VENDOR_ID 0x16d57510176102#define OPTION_PRODUCT_OLD 0x500077103#define OPTION_PRODUCT_FUSION 0x6000···80106#define OPTION_PRODUCT_COBRA2 0x660081107#define HUAWEI_PRODUCT_E600 0x100182108#define AUDIOVOX_PRODUCT_AIRCARD 0x01128383-#define SIERRAWIRELESS_PRODUCT_MC8755 0x680284109#define NOVATELWIRELESS_PRODUCT_U740 0x1400110110+#define ANYDATA_PRODUCT_ID 0x65018511186112static struct usb_device_id option_ids[] = {87113 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },···91117 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },92118 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },93119 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },9494- { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },95120 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },121121+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },96122 { } /* Terminating entry */97123};98124···105131 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },106132 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },107133 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },108108- { } /* Terminating entry */109109-};110110-static struct usb_device_id option_ids3[] = {111111- { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) },134134+ { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },112135 { } /* Terminating entry */113136};114137···122151/* The card has three separate interfaces, which the serial driver123152 * recognizes separately, thus num_port=1.124153 */125125-static struct usb_serial_driver option_3port_device = {126126- .driver = {127127- .owner = THIS_MODULE,128128- .name = "option",129129- },130130- .description = "GSM modem (3-port)",131131- .id_table = option_ids3,132132- .num_interrupt_in = NUM_DONT_CARE,133133- .num_bulk_in = NUM_DONT_CARE,134134- .num_bulk_out = NUM_DONT_CARE,135135- .num_ports = 3,136136- .open = option_open,137137- .close = option_close,138138- .write = option_write,139139- .write_room = option_write_room,140140- .chars_in_buffer = option_chars_in_buffer,141141- .throttle = option_rx_throttle,142142- .unthrottle = option_rx_unthrottle,143143- .set_termios = option_set_termios,144144- .break_ctl = option_break_ctl,145145- .tiocmget = option_tiocmget,146146- .tiocmset = option_tiocmset,147147- .attach = option_startup,148148- .shutdown = option_shutdown,149149- .read_int_callback = option_instat_callback,150150-};151154152155static struct usb_serial_driver option_1port_device = {153156 .driver = {154157 .owner = THIS_MODULE,155155- .name = "option",158158+ .name = "option1",156159 },157160 .description = "GSM modem (1-port)",158161 .id_table = option_ids1,···190245 retval = usb_serial_register(&option_1port_device);191246 if (retval)192247 goto failed_1port_device_register;193193- retval = usb_serial_register(&option_3port_device);194194- if (retval)195195- goto failed_3port_device_register;196248 retval = usb_register(&option_driver);197249 if (retval)198250 goto failed_driver_register;···199257 return 0;200258201259failed_driver_register:202202- usb_serial_deregister (&option_3port_device);203203-failed_3port_device_register:204260 usb_serial_deregister (&option_1port_device);205261failed_1port_device_register:206262 return retval;···207267static void __exit option_exit(void)208268{209269 usb_deregister (&option_driver);210210- usb_serial_deregister (&option_3port_device);211270 usb_serial_deregister (&option_1port_device);212271}213272···594655 struct option_port_private *portdata;595656596657 dbg("%s", __FUNCTION__);597597-598658599659 for (i = 0; i < serial->num_ports; i++) {600660 port = serial->port[i];
···145145 US_SC_DEVICE, US_PR_DEVICE, NULL,146146 US_FL_IGNORE_RESIDUE ),147147148148+/* Reported by Mario Rettig <mariorettig@web.de> */149149+UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,150150+ "Nokia",151151+ "Nokia 3250",152152+ US_SC_DEVICE, US_PR_DEVICE, NULL,153153+ US_FL_IGNORE_RESIDUE | US_FL_FIX_CAPACITY ),154154+148155/* Reported by Sumedha Swamy <sumedhaswamy@gmail.com> and149156 * Einar Th. Einarsson <einarthered@gmail.com> */150157UNUSUAL_DEV( 0x0421, 0x0444, 0x0100, 0x0100,···634627 "Digital Camera EX-20 DSC",635628 US_SC_8070, US_PR_DEVICE, NULL, 0 ),636629637637-/* The entry was here before I took over, and had US_SC_RBC. It turns638638- * out that isn't needed. Additionally, Torsten Eriksson639639- * <Torsten.Eriksson@bergianska.se> is able to use his device fine640640- * without this entry at all - but I don't suspect that will be true641641- * for all users (the protocol is likely needed), so is staying at642642- * this time. - Phil Dibowitz <phil@ipom.com>643643- */644644-UNUSUAL_DEV( 0x059f, 0xa601, 0x0200, 0x0200, 645645- "LaCie",646646- "USB Hard Disk",647647- US_SC_DEVICE, US_PR_CB, NULL, 0 ),648648-649630/* Submitted by Joel Bourquard <numlock@freesurf.ch>650631 * Some versions of this device need the SubClass and Protocol overrides651632 * while others don't.···11011106 "Optio S/S4",11021107 US_SC_DEVICE, US_PR_DEVICE, NULL,11031108 US_FL_FIX_INQUIRY ),11041104-11091109+11101110+/* This is a virtual windows driver CD, which the zd1211rw driver automatically11111111+ * converts into a WLAN device. */11121112+UNUSUAL_DEV( 0x0ace, 0x2011, 0x0101, 0x0101,11131113+ "ZyXEL",11141114+ "G-220F USB-WLAN Install",11151115+ US_SC_DEVICE, US_PR_DEVICE, NULL,11161116+ US_FL_IGNORE_DEVICE ),11171117+11051118#ifdef CONFIG_USB_STORAGE_ISD20011061119UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,11071120 "ATI",
+11-2
drivers/usb/storage/usb.c
···483483}484484485485/* Get the unusual_devs entries and the string descriptors */486486-static void get_device_info(struct us_data *us, const struct usb_device_id *id)486486+static int get_device_info(struct us_data *us, const struct usb_device_id *id)487487{488488 struct usb_device *dev = us->pusb_dev;489489 struct usb_interface_descriptor *idesc =···499499 idesc->bInterfaceProtocol :500500 unusual_dev->useTransport;501501 us->flags = USB_US_ORIG_FLAGS(id->driver_info);502502+503503+ if (us->flags & US_FL_IGNORE_DEVICE) {504504+ printk(KERN_INFO USB_STORAGE "device ignored\n");505505+ return -ENODEV;506506+ }502507503508 /*504509 * This flag is only needed when we're in high-speed, so let's···546541 msgs[msg],547542 UTS_RELEASE);548543 }544544+545545+ return 0;549546}550547551548/* Get the transport settings */···976969 * of the match from the usb_device_id table, so we can find the977970 * corresponding entry in the private table.978971 */979979- get_device_info(us, id);972972+ result = get_device_info(us, id);973973+ if (result)974974+ goto BadDevice;980975981976 /* Get the transport, protocol, and pipe settings */982977 result = get_transport(us);
+3-7
drivers/video/aty/aty128fb.c
···19131913 u8 chip_rev;19141914 u32 dac;1915191519161916- if (!par->vram_size) /* may have already been probed */19171917- par->vram_size = aty_ld_le32(CONFIG_MEMSIZE) & 0x03FFFFFF;19181918-19191916 /* Get the chip revision */19201917 chip_rev = (aty_ld_le32(CONFIG_CNTL) >> 16) & 0x1F;19211918···2025202820262029 aty128_init_engine(par);2027203020282028- if (register_framebuffer(info) < 0)20292029- return 0;20302030-20312031 par->pm_reg = pci_find_capability(pdev, PCI_CAP_ID_PM);20322032 par->pdev = pdev;20332033 par->asleep = 0;···20332039#ifdef CONFIG_FB_ATY128_BACKLIGHT20342040 aty128_bl_init(par);20352041#endif20422042+20432043+ if (register_framebuffer(info) < 0)20442044+ return 0;2036204520372046 printk(KERN_INFO "fb%d: %s frame buffer device on %s\n",20382047 info->node, info->fix.id, video_card);···20862089 par = info->par;2087209020882091 info->pseudo_palette = par->pseudo_palette;20892089- info->fix = aty128fb_fix;2090209220912093 /* Virtualize mmio region */20922094 info->fix.mmio_start = reg_addr;
···512512 wchar_t uni;513513 int unilen, utflen;514514 char *result;515515- int maxlen = in_len; /* The utf8->nls conversion can't make more chars */515515+ /* The utf8->nls conversion won't make the final nls string bigger516516+ * than the utf one, but if the string is pure ascii they'll have the517517+ * same width and an extra char is needed to save the additional \0518518+ */519519+ int maxlen = in_len + 1;516520517521 befs_debug(sb, "---> utf2nls()");518522···592588 wchar_t uni;593589 int unilen, utflen;594590 char *result;595595- int maxlen = 3 * in_len;591591+ /* There're nls characters that will translate to 3-chars-wide UTF-8592592+ * characters, a additional byte is needed to save the final \0593593+ * in special cases */594594+ int maxlen = (3 * in_len) + 1;596595597596 befs_debug(sb, "---> nls2utf()\n");598597
+3-9
fs/lockd/svclock.c
···638638 if (task->tk_status < 0) {639639 /* RPC error: Re-insert for retransmission */640640 timeout = 10 * HZ;641641- } else if (block->b_done) {642642- /* Block already removed, kill it for real */643643- timeout = 0;644641 } else {645642 /* Call was successful, now wait for client callback */646643 timeout = 60 * HZ;···706709 break;707710 if (time_after(block->b_when,jiffies))708711 break;709709- dprintk("nlmsvc_retry_blocked(%p, when=%ld, done=%d)\n",710710- block, block->b_when, block->b_done);712712+ dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",713713+ block, block->b_when);711714 kref_get(&block->b_count);712712- if (block->b_done)713713- nlmsvc_unlink_block(block);714714- else715715- nlmsvc_grant_blocked(block);715715+ nlmsvc_grant_blocked(block);716716 nlmsvc_release_block(block);717717 }718718
+5-3
fs/namei.c
···159159#ifdef CONFIG_AUDITSYSCALL160160void putname(const char *name)161161{162162- if (unlikely(current->audit_context))162162+ if (unlikely(!audit_dummy_context()))163163 audit_putname(name);164164 else165165 __putname(name);···11251125 retval = link_path_walk(name, nd);11261126out:11271127 if (likely(retval == 0)) {11281128- if (unlikely(current->audit_context && nd && nd->dentry &&11281128+ if (unlikely(!audit_dummy_context() && nd && nd->dentry &&11291129 nd->dentry->d_inode))11301130 audit_inode(name, nd->dentry->d_inode);11311131 }···13571357 return -ENOENT;1358135813591359 BUG_ON(victim->d_parent->d_inode != dir);13601360- audit_inode_child(victim->d_name.name, victim->d_inode, dir->i_ino);13601360+ audit_inode_child(victim->d_name.name, victim->d_inode, dir);1361136113621362 error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);13631363 if (error)···16591659 * It already exists.16601660 */16611661 mutex_unlock(&dir->d_inode->i_mutex);16621662+ audit_inode_update(path.dentry->d_inode);1662166316631664 error = -EEXIST;16641665 if (flag & O_EXCL)···16701669 if (flag & O_NOFOLLOW)16711670 goto exit_dput;16721671 }16721672+16731673 error = -ENOENT;16741674 if (!path.dentry->d_inode)16751675 goto exit_dput;
···4848 return 0;4949 }50505151- reiserfs_write_lock(inode->i_sb);5251 mutex_lock(&inode->i_mutex);5252+ reiserfs_write_lock(inode->i_sb);5353 /* freeing preallocation only involves relogging blocks that5454 * are already in the current transaction. preallocation gets5555 * freed at the end of each transaction, so it is impossible for
+14-12
fs/reiserfs/inode.c
···39394040 /* The = 0 happens when we abort creating a new inode for some reason like lack of space.. */4141 if (!(inode->i_state & I_NEW) && INODE_PKEY(inode)->k_objectid != 0) { /* also handles bad_inode case */4242- mutex_lock(&inode->i_mutex);4343-4442 reiserfs_delete_xattrs(inode);45434646- if (journal_begin(&th, inode->i_sb, jbegin_count)) {4747- mutex_unlock(&inode->i_mutex);4444+ if (journal_begin(&th, inode->i_sb, jbegin_count))4845 goto out;4949- }5046 reiserfs_update_inode_transaction(inode);51475248 err = reiserfs_delete_object(&th, inode);···5357 if (!err) 5458 DQUOT_FREE_INODE(inode);55595656- if (journal_end(&th, inode->i_sb, jbegin_count)) {5757- mutex_unlock(&inode->i_mutex);6060+ if (journal_end(&th, inode->i_sb, jbegin_count))5861 goto out;5959- }6060-6161- mutex_unlock(&inode->i_mutex);62626363 /* check return value from reiserfs_delete_object after6464 * ending the transaction···23402348 unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT;23412349 int error = 0;23422350 unsigned long block;23512351+ sector_t last_block;23432352 struct buffer_head *head, *bh;23442353 int partial = 0;23452354 int nr = 0;···23882395 }23892396 bh = head;23902397 block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits);23982398+ last_block = (i_size_read(inode) - 1) >> inode->i_blkbits;23912399 /* first map all the buffers, logging any direct items we find */23922400 do {23932393- if ((checked || buffer_dirty(bh)) && (!buffer_mapped(bh) ||23942394- (buffer_mapped(bh)24012401+ if (block > last_block) {24022402+ /*24032403+ * This can happen when the block size is less than24042404+ * the page size. The corresponding bytes in the page24052405+ * were zero filled above24062406+ */24072407+ clear_buffer_dirty(bh);24082408+ set_buffer_uptodate(bh);24092409+ } else if ((checked || buffer_dirty(bh)) &&24102410+ (!buffer_mapped(bh) || (buffer_mapped(bh)23952411 && bh->b_blocknr ==23962412 0))) {23972413 /* not mapped yet, or it points to a direct item, search
+1-1
fs/reiserfs/ioctl.c
···116116 if (REISERFS_I(inode)->i_flags & i_nopack_mask) {117117 return 0;118118 }119119- reiserfs_write_lock(inode->i_sb);120119121120 /* we need to make sure nobody is changing the file size beneath122121 ** us123122 */124123 mutex_lock(&inode->i_mutex);124124+ reiserfs_write_lock(inode->i_sb);125125126126 write_from = inode->i_size & (blocksize - 1);127127 /* if we are on a block boundary, we are already unpacked. */
···248248249249 if (likely(cur_index != index)) {250250 page = ufs_get_locked_page(mapping, index);251251- if (IS_ERR(page))251251+ if (!page || IS_ERR(page)) /* it was truncated or EIO */252252 continue;253253 } else254254 page = locked_page;
+9-8
fs/ufs/util.c
···251251{252252 struct page *page;253253254254-try_again:255254 page = find_lock_page(mapping, index);256255 if (!page) {257256 page = read_cache_page(mapping, index,258257 (filler_t*)mapping->a_ops->readpage,259258 NULL);259259+260260 if (IS_ERR(page)) {261261 printk(KERN_ERR "ufs_change_blocknr: "262262 "read_cache_page error: ino %lu, index: %lu\n",···265265 }266266267267 lock_page(page);268268+269269+ if (unlikely(page->mapping == NULL)) {270270+ /* Truncate got there first */271271+ unlock_page(page);272272+ page_cache_release(page);273273+ page = NULL;274274+ goto out;275275+ }268276269277 if (!PageUptodate(page) || PageError(page)) {270278 unlock_page(page);···283275 mapping->host->i_ino, index);284276285277 page = ERR_PTR(-EIO);286286- goto out;287278 }288288- }289289-290290- if (unlikely(!page->mapping || !page_has_buffers(page))) {291291- unlock_page(page);292292- page_cache_release(page);293293- goto try_again;/*we really need these buffers*/294279 }295280out:296281 return page;
-2
include/asm-arm/arch-omap/clock.h
···4848};49495050extern unsigned int mpurate;5151-extern struct list_head clocks;5252-extern spinlock_t clockfw_lock;53515452extern int clk_init(struct clk_functions * custom_clocks);5553extern int clk_register(struct clk *clk);
+6-1
include/asm-ia64/meminit.h
···5656 extern struct page *vmem_map;5757 extern int find_largest_hole (u64 start, u64 end, void *arg);5858 extern int create_mem_map_page_table (u64 start, u64 end, void *arg);5959+ extern int vmemmap_find_next_valid_pfn(int, int);6060+#else6161+static inline int vmemmap_find_next_valid_pfn(int node, int i)6262+{6363+ return i + 1;6464+}5965#endif6060-6166#endif /* meminit_h */
+6-1
include/asm-ia64/pal.h
···14331433} pal_version_u_t;143414341435143514361436-/* Return PAL version information */14361436+/*14371437+ * Return PAL version information. While the documentation states that14381438+ * PAL_VERSION can be called in either physical or virtual mode, some14391439+ * implementations only allow physical calls. We don't call it very often,14401440+ * so the overhead isn't worth eliminating.14411441+ */14371442static inline s6414381443ia64_pal_version (pal_version_u_t *pal_min_version, pal_version_u_t *pal_cur_version)14391444{
···170170extern int rtas_get_power_level(int powerdomain, int *level);171171extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);172172extern int rtas_set_indicator(int indicator, int index, int new_value);173173+extern int rtas_set_indicator_fast(int indicator, int index, int new_value);173174extern void rtas_progress(char *s, unsigned short hex);174175extern void rtas_initialize(void);175176
+29-14
include/linux/audit.h
···327327extern void audit_putname(const char *name);328328extern void __audit_inode(const char *name, const struct inode *inode);329329extern void __audit_inode_child(const char *dname, const struct inode *inode,330330- unsigned long pino);330330+ const struct inode *parent);331331+extern void __audit_inode_update(const struct inode *inode);332332+static inline int audit_dummy_context(void)333333+{334334+ void *p = current->audit_context;335335+ return !p || *(int *)p;336336+}331337static inline void audit_getname(const char *name)332338{333333- if (unlikely(current->audit_context))339339+ if (unlikely(!audit_dummy_context()))334340 __audit_getname(name);335341}336342static inline void audit_inode(const char *name, const struct inode *inode) {337337- if (unlikely(current->audit_context))343343+ if (unlikely(!audit_dummy_context()))338344 __audit_inode(name, inode);339345}340346static inline void audit_inode_child(const char *dname, 341341- const struct inode *inode, 342342- unsigned long pino) {343343- if (unlikely(current->audit_context))344344- __audit_inode_child(dname, inode, pino);347347+ const struct inode *inode,348348+ const struct inode *parent) {349349+ if (unlikely(!audit_dummy_context()))350350+ __audit_inode_child(dname, inode, parent);351351+}352352+static inline void audit_inode_update(const struct inode *inode) {353353+ if (unlikely(!audit_dummy_context()))354354+ __audit_inode_update(inode);345355}346356347357 /* Private API (for audit.c only) */···375365376366static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)377367{378378- if (unlikely(current->audit_context))368368+ if (unlikely(!audit_dummy_context()))379369 return __audit_ipc_obj(ipcp);380370 return 0;381371}382372static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)383373{384384- if (unlikely(current->audit_context))374374+ if (unlikely(!audit_dummy_context()))385375 return __audit_ipc_set_perm(qbytes, uid, gid, mode);386376 return 0;387377}388378static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)389379{390390- if (unlikely(current->audit_context))380380+ if (unlikely(!audit_dummy_context()))391381 return __audit_mq_open(oflag, mode, u_attr);392382 return 0;393383}394384static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)395385{396396- if (unlikely(current->audit_context))386386+ if (unlikely(!audit_dummy_context()))397387 return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);398388 return 0;399389}400390static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)401391{402402- if (unlikely(current->audit_context))392392+ if (unlikely(!audit_dummy_context()))403393 return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);404394 return 0;405395}406396static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)407397{408408- if (unlikely(current->audit_context))398398+ if (unlikely(!audit_dummy_context()))409399 return __audit_mq_notify(mqdes, u_notification);410400 return 0;411401}412402static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)413403{414414- if (unlikely(current->audit_context))404404+ if (unlikely(!audit_dummy_context()))415405 return __audit_mq_getsetattr(mqdes, mqstat);416406 return 0;417407}408408+extern int audit_n_rules;418409#else419410#define audit_alloc(t) ({ 0; })420411#define audit_free(t) do { ; } while (0)421412#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)422413#define audit_syscall_exit(f,r) do { ; } while (0)414414+#define audit_dummy_context() 1423415#define audit_getname(n) do { ; } while (0)424416#define audit_putname(n) do { ; } while (0)425417#define __audit_inode(n,i) do { ; } while (0)426418#define __audit_inode_child(d,i,p) do { ; } while (0)419419+#define __audit_inode_update(i) do { ; } while (0)427420#define audit_inode(n,i) do { ; } while (0)428421#define audit_inode_child(d,i,p) do { ; } while (0)422422+#define audit_inode_update(i) do { ; } while (0)429423#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)430424#define audit_get_loginuid(c) ({ -1; })431425#define audit_ipc_obj(i) ({ 0; })···444430#define audit_mq_timedreceive(d,l,p,t) ({ 0; })445431#define audit_mq_notify(d,n) ({ 0; })446432#define audit_mq_getsetattr(d,s) ({ 0; })433433+#define audit_n_rules 0447434#endif448435449436#ifdef CONFIG_AUDIT
+2
include/linux/debug_locks.h
···11#ifndef __LINUX_DEBUG_LOCKING_H22#define __LINUX_DEBUG_LOCKING_H3344+struct task_struct;55+46extern int debug_locks;57extern int debug_locks_silent;68
···893893894894 int (*open)(struct input_dev *dev);895895 void (*close)(struct input_dev *dev);896896- int (*accept)(struct input_dev *dev, struct file *file);897896 int (*flush)(struct input_dev *dev, struct file *file);898897 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);899898 int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect);···960961961962struct input_handle;962963964964+/**965965+ * struct input_handler - implements one of interfaces for input devices966966+ * @private: driver-specific data967967+ * @event: event handler968968+ * @connect: called when attaching a handler to an input device969969+ * @disconnect: disconnects a handler from input device970970+ * @start: starts handler for given handle. This function is called by971971+ * input core right after connect() method and also when a process972972+ * that "grabbed" a device releases it973973+ * @fops: file operations this driver implements974974+ * @minor: beginning of range of 32 minors for devices this driver975975+ * can provide976976+ * @name: name of the handler, to be shown in /proc/bus/input/handlers977977+ * @id_table: pointer to a table of input_device_ids this driver can978978+ * handle979979+ * @blacklist: prointer to a table of input_device_ids this driver should980980+ * ignore even if they match @id_table981981+ * @h_list: list of input handles associated with the handler982982+ * @node: for placing the driver onto input_handler_list983983+ */963984struct input_handler {964985965986 void *private;···987968 void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value);988969 struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id);989970 void (*disconnect)(struct input_handle *handle);971971+ void (*start)(struct input_handle *handle);990972991973 const struct file_operations *fops;992974 int minor;···10501030int input_open_device(struct input_handle *);10511031void input_close_device(struct input_handle *);1052103210531053-int input_accept_process(struct input_handle *handle, struct file *file);10541033int input_flush_device(struct input_handle* handle, struct file* file);1055103410561035void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);10361036+void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);1057103710581038static inline void input_report_key(struct input_dev *dev, unsigned int code, int value)10591039{
···15581558}1559155915601560/*15611561+ * Sometimes we may need to cancel the previous 'freeze' request15621562+ */15631563+static inline void do_not_freeze(struct task_struct *p)15641564+{15651565+ p->flags &= ~PF_FREEZE;15661566+}15671567+15681568+/*15611569 * Wake up a frozen process15621570 */15631571static inline int thaw_process(struct task_struct *p)
+34-6
include/linux/security.h
···11091109 * @name contains the name of the security module being unstacked.11101110 * @ops contains a pointer to the struct security_operations of the module to unstack.11111111 * 11121112+ * @secid_to_secctx:11131113+ * Convert secid to security context.11141114+ * @secid contains the security ID.11151115+ * @secdata contains the pointer that stores the converted security context.11161116+ *11171117+ * @release_secctx:11181118+ * Release the security context.11191119+ * @secdata contains the security context.11201120+ * @seclen contains the length of the security context.11211121+ *11121122 * This is the main security structure.11131123 */11141124struct security_operations {···1299128913001290 int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size);13011291 int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size);12921292+ int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen);12931293+ void (*release_secctx)(char *secdata, u32 seclen);1302129413031295#ifdef CONFIG_SECURITY_NETWORK13041296 int (*unix_stream_connect) (struct socket * sock,···13291317 int (*socket_shutdown) (struct socket * sock, int how);13301318 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);13311319 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);13321332- int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen);13201320+ int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid);13331321 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);13341322 void (*sk_free_security) (struct sock *sk);13351323 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);···20712059 return security_ops->netlink_recv(skb, cap);20722060}2073206120622062+static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)20632063+{20642064+ return security_ops->secid_to_secctx(secid, secdata, seclen);20652065+}20662066+20672067+static inline void security_release_secctx(char *secdata, u32 seclen)20682068+{20692069+ return security_ops->release_secctx(secdata, seclen);20702070+}20712071+20742072/* prototypes */20752073extern int security_init (void);20762074extern int register_security (struct security_operations *ops);···27472725{27482726}2749272727282728+static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)27292729+{27302730+ return -EOPNOTSUPP;27312731+}27322732+27332733+static inline void security_release_secctx(char *secdata, u32 seclen)27342734+{27352735+}27502736#endif /* CONFIG_SECURITY */2751273727522738#ifdef CONFIG_SECURITY_NETWORK···28702840 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);28712841}2872284228732873-static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,28742874- u32 *seclen)28432843+static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)28752844{28762876- return security_ops->socket_getpeersec_dgram(skb, secdata, seclen);28452845+ return security_ops->socket_getpeersec_dgram(sock, skb, secid);28772846}2878284728792848static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)···29972968 return -ENOPROTOOPT;29982969}2999297030003000-static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,30013001- u32 *seclen)29712971+static inline int security_socket_getpeersec_dgram(struct socket *sock, struct sk_buff *skb, u32 *secid)30022972{30032973 return -ENOPROTOOPT;30042974}
+30-3
include/linux/skbuff.h
···604604 return list_->qlen;605605}606606607607-extern struct lock_class_key skb_queue_lock_key;608608-607607+/*608608+ * This function creates a split out lock class for each invocation;609609+ * this is needed for now since a whole lot of users of the skb-queue610610+ * infrastructure in drivers have different locking usage (in hardirq)611611+ * than the networking core (in softirq only). In the long run either the612612+ * network layer or drivers should need annotation to consolidate the613613+ * main types of usage into 3 classes.614614+ */609615static inline void skb_queue_head_init(struct sk_buff_head *list)610616{611617 spin_lock_init(&list->lock);612612- lockdep_set_class(&list->lock, &skb_queue_lock_key);613618 list->prev = list->next = (struct sk_buff *)list;614619 list->qlen = 0;615620}···11071102static inline struct sk_buff *dev_alloc_skb(unsigned int length)11081103{11091104 return __dev_alloc_skb(length, GFP_ATOMIC);11051105+}11061106+11071107+extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev,11081108+ unsigned int length, gfp_t gfp_mask);11091109+11101110+/**11111111+ * netdev_alloc_skb - allocate an skbuff for rx on a specific device11121112+ * @dev: network device to receive on11131113+ * @length: length to allocate11141114+ *11151115+ * Allocate a new &sk_buff and assign it a usage count of one. The11161116+ * buffer has unspecified headroom built in. Users should allocate11171117+ * the headroom they think they need without accounting for the11181118+ * built in space. The built in space is used for optimisations.11191119+ *11201120+ * %NULL is returned if there is no free memory. Although this function11211121+ * allocates memory it can be called from an interrupt.11221122+ */11231123+static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,11241124+ unsigned int length)11251125+{11261126+ return __netdev_alloc_skb(dev, length, GFP_ATOMIC);11101127}1111112811121129/**
···103103 * @condition: binding state of the interface: not bound, binding104104 * (in probe()), bound to a driver, or unbinding (in disconnect())105105 * @dev: driver model's view of this device106106- * @usb_dev: if an interface is bound to the USB major, this will point107107- * to the sysfs representation for that device.106106+ * @class_dev: driver model's class view of this device.108107 *109108 * USB device drivers attach to interfaces on a physical device. Each110109 * interface encapsulates a single high level function, such as feeding···143144 * bound to */144145 enum usb_interface_condition condition; /* state of binding */145146 struct device dev; /* interface specific device info */146146- struct device *usb_dev; /* pointer to the usb class's device, if any */147147+ struct class_device *class_dev;147148};148149#define to_usb_interface(d) container_of(d, struct usb_interface, dev)149150#define interface_to_usbdev(intf) \···360361 char *serial; /* iSerialNumber string, if present */361362362363 struct list_head filelist;363363- struct device *usbfs_dev;364364+ struct class_device *class_dev;364365 struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */365366366367 /*
···948948 /* In the common case we don't take the spinlock, which is nice. */949949 retry:950950 lock_ptr = q->lock_ptr;951951+ barrier();951952 if (lock_ptr != 0) {952953 spin_lock(lock_ptr);953954 /*
+3-3
kernel/futex_compat.c
···3939{4040 struct compat_robust_list_head __user *head = curr->compat_robust_list;4141 struct robust_list __user *entry, *pending;4242- unsigned int limit = ROBUST_LIST_LIMIT, pi;4242+ unsigned int limit = ROBUST_LIST_LIMIT, pi, pip;4343 compat_uptr_t uentry, upending;4444 compat_long_t futex_offset;4545···5959 * if it exists:6060 */6161 if (fetch_robust_entry(&upending, &pending,6262- &head->list_op_pending, &pi))6262+ &head->list_op_pending, &pip))6363 return;6464 if (upending)6565- handle_futex_death((void *)pending + futex_offset, curr, pi);6565+ handle_futex_death((void *)pending + futex_offset, curr, pip);66666767 while (compat_ptr(uentry) != &head->list) {6868 /*
+18-8
kernel/power/process.c
···6666 }6767}68686969+static void cancel_freezing(struct task_struct *p)7070+{7171+ unsigned long flags;7272+7373+ if (freezing(p)) {7474+ pr_debug(" clean up: %s\n", p->comm);7575+ do_not_freeze(p);7676+ spin_lock_irqsave(&p->sighand->siglock, flags);7777+ recalc_sigpending_tsk(p);7878+ spin_unlock_irqrestore(&p->sighand->siglock, flags);7979+ }8080+}8181+6982/* 0 = success, else # of processes that we failed to stop */7083int freeze_processes(void)7184{7285 int todo, nr_user, user_frozen;7386 unsigned long start_time;7487 struct task_struct *g, *p;7575- unsigned long flags;76887789 printk( "Stopping tasks: " );7890 start_time = jiffies;···9785 continue;9886 if (frozen(p))9987 continue;8888+ if (p->state == TASK_TRACED && frozen(p->parent)) {8989+ cancel_freezing(p);9090+ continue;9191+ }10092 if (p->mm && !(p->flags & PF_BORROWED_MM)) {10193 /* The task is a user-space one.10294 * Freeze it unless there's a vfork completion···142126 do_each_thread(g, p) {143127 if (freezeable(p) && !frozen(p))144128 printk(KERN_ERR " %s\n", p->comm);145145- if (freezing(p)) {146146- pr_debug(" clean up: %s\n", p->comm);147147- p->flags &= ~PF_FREEZE;148148- spin_lock_irqsave(&p->sighand->siglock, flags);149149- recalc_sigpending_tsk(p);150150- spin_unlock_irqrestore(&p->sighand->siglock, flags);151151- }129129+ cancel_freezing(p);152130 } while_each_thread(g, p);153131 read_unlock(&tasklist_lock);154132 return todo;
···244244245245 start = res->start;246246 end = res->end;247247+ BUG_ON(start >= end);247248248249 read_lock(&resource_lock);249250 for (p = iomem_resource.child; p ; p = p->sibling) {···255254 p = NULL;256255 break;257256 }258258- if (p->start >= start)257257+ if ((p->end >= start) && (p->start < end))259258 break;260259 }261260 read_unlock(&resource_lock);262261 if (!p)263262 return -1;264263 /* copy data */265265- res->start = p->start;266266- res->end = p->end;264264+ if (res->start < p->start)265265+ res->start = p->start;266266+ if (res->end > p->end)267267+ res->end = p->end;267268 return 0;268269}269270#endif
+17-8
kernel/signal.c
···791791/*792792 * Force a signal that the process can't ignore: if necessary793793 * we unblock the signal and change any SIG_IGN to SIG_DFL.794794+ *795795+ * Note: If we unblock the signal, we always reset it to SIG_DFL,796796+ * since we do not want to have a signal handler that was blocked797797+ * be invoked when user space had explicitly blocked it.798798+ *799799+ * We don't want to have recursive SIGSEGV's etc, for example.794800 */795795-796801int797802force_sig_info(int sig, struct siginfo *info, struct task_struct *t)798803{799804 unsigned long int flags;800800- int ret;805805+ int ret, blocked, ignored;806806+ struct k_sigaction *action;801807802808 spin_lock_irqsave(&t->sighand->siglock, flags);803803- if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {804804- t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;809809+ action = &t->sighand->action[sig-1];810810+ ignored = action->sa.sa_handler == SIG_IGN;811811+ blocked = sigismember(&t->blocked, sig);812812+ if (blocked || ignored) {813813+ action->sa.sa_handler = SIG_DFL;814814+ if (blocked) {815815+ sigdelset(&t->blocked, sig);816816+ recalc_sigpending_tsk(t);817817+ }805818 }806806- if (sigismember(&t->blocked, sig)) {807807- sigdelset(&t->blocked, sig);808808- }809809- recalc_sigpending_tsk(t);810819 ret = specific_send_sig_info(sig, info, t);811820 spin_unlock_irqrestore(&t->sighand->siglock, flags);812821
-4
lib/kobject_uevent.c
···5050 return "offline";5151 case KOBJ_ONLINE:5252 return "online";5353- case KOBJ_DOCK:5454- return "dock";5555- case KOBJ_UNDOCK:5656- return "undock";5753 default:5854 return NULL;5955 }
+6-4
lib/spinlock_debug.c
···162162163163#define RWLOCK_BUG_ON(cond, lock, msg) if (unlikely(cond)) rwlock_bug(lock, msg)164164165165+#if 0 /* __write_lock_debug() can lock up - maybe this can too? */165166static void __read_lock_debug(rwlock_t *lock)166167{167168 int print_once = 1;···185184 }186185 }187186}187187+#endif188188189189void _raw_read_lock(rwlock_t *lock)190190{191191 RWLOCK_BUG_ON(lock->magic != RWLOCK_MAGIC, lock, "bad magic");192192- if (unlikely(!__raw_read_trylock(&lock->raw_lock)))193193- __read_lock_debug(lock);192192+ __raw_read_lock(&lock->raw_lock);194193}195194196195int _raw_read_trylock(rwlock_t *lock)···236235 lock->owner_cpu = -1;237236}238237238238+#if 0 /* This can cause lockups */239239static void __write_lock_debug(rwlock_t *lock)240240{241241 int print_once = 1;···259257 }260258 }261259}260260+#endif262261263262void _raw_write_lock(rwlock_t *lock)264263{265264 debug_write_lock_before(lock);266266- if (unlikely(!__raw_write_trylock(&lock->raw_lock)))267267- __write_lock_debug(lock);265265+ __raw_write_lock(&lock->raw_lock);268266 debug_write_lock_after(lock);269267}270268
+2-1
mm/fadvise.c
···7373 file->f_ra.ra_pages = bdi->ra_pages * 2;7474 break;7575 case POSIX_FADV_WILLNEED:7676- case POSIX_FADV_NOREUSE:7776 if (!mapping->a_ops->readpage) {7877 ret = -EINVAL;7978 break;···9293 max_sane_readahead(nrpages));9394 if (ret > 0)9495 ret = 0;9696+ break;9797+ case POSIX_FADV_NOREUSE:9598 break;9699 case POSIX_FADV_DONTNEED:97100 if (!bdi_write_congested(mapping->backing_dev_info))
+34-10
mm/memory_hotplug.c
···5252 int nr_pages = PAGES_PER_SECTION;5353 int ret;54545555+ if (pfn_valid(phys_start_pfn))5656+ return -EEXIST;5757+5558 ret = sparse_add_one_section(zone, phys_start_pfn, nr_pages);56595760 if (ret < 0)···7976{8077 unsigned long i;8178 int err = 0;7979+ int start_sec, end_sec;8080+ /* during initialize mem_map, align hot-added range to section */8181+ start_sec = pfn_to_section_nr(phys_start_pfn);8282+ end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1);82838383- for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) {8484- err = __add_section(zone, phys_start_pfn + i);8484+ for (i = start_sec; i <= end_sec; i++) {8585+ err = __add_section(zone, i << PFN_SECTION_SHIFT);85868686- /* We want to keep adding the rest of the8787- * sections if the first ones already exist8787+ /*8888+ * EEXIST is finally dealed with by ioresource collision8989+ * check. see add_memory() => register_memory_resource()9090+ * Warning will be printed if there is collision.8891 */8992 if (err && (err != -EEXIST))9093 break;9494+ err = 0;9195 }92969397 return err;···166156 res.flags = IORESOURCE_MEM; /* we just need system ram */167157 section_end = res.end;168158169169- while (find_next_system_ram(&res) >= 0) {159159+ while ((res.start < res.end) && (find_next_system_ram(&res) >= 0)) {170160 start_pfn = (unsigned long)(res.start >> PAGE_SHIFT);171161 nr_pages = (unsigned long)172162 ((res.end + 1 - res.start) >> PAGE_SHIFT);···223213}224214225215/* add this memory to iomem resource */226226-static void register_memory_resource(u64 start, u64 size)216216+static struct resource *register_memory_resource(u64 start, u64 size)227217{228218 struct resource *res;229229-230219 res = kzalloc(sizeof(struct resource), GFP_KERNEL);231220 BUG_ON(!res);232221···237228 printk("System RAM resource %llx - %llx cannot be added\n",238229 (unsigned long long)res->start, (unsigned long long)res->end);239230 kfree(res);231231+ res = NULL;240232 }233233+ return res;234234+}235235+236236+static void release_memory_resource(struct resource *res)237237+{238238+ if (!res)239239+ return;240240+ release_resource(res);241241+ kfree(res);242242+ return;241243}242244243245···257237{258238 pg_data_t *pgdat = NULL;259239 int new_pgdat = 0;240240+ struct resource *res;260241 int ret;242242+243243+ res = register_memory_resource(start, size);244244+ if (!res)245245+ return -EEXIST;261246262247 if (!node_online(nid)) {263248 pgdat = hotadd_new_pgdat(nid, start);···293268 BUG_ON(ret);294269 }295270296296- /* register this memory as resource */297297- register_memory_resource(start, size);298298-299271 return ret;300272error:301273 /* rollback pgdat allocation and others */302274 if (new_pgdat)303275 rollback_node_hotadd(nid, pgdat);276276+ if (res)277277+ release_memory_resource(res);304278305279 return ret;306280}
···11661166 goto out_set_summed;1167116711681168 if (unlikely(skb_shinfo(skb)->gso_size)) {11691169- static int warned;11701170-11711171- WARN_ON(!warned);11721172- warned = 1;11731173-11741169 /* Let GSO fix up the checksum. */11751170 goto out_set_summed;11761171 }···12151220 __skb_pull(skb, skb->mac_len);1216122112171222 if (unlikely(skb->ip_summed != CHECKSUM_HW)) {12181218- static int warned;12191219-12201220- WARN_ON(!warned);12211221- warned = 1;12221222-12231223 if (skb_header_cloned(skb) &&12241224 (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))12251225 return ERR_PTR(err);···34193429 unsigned int cpu, i, n;34203430 struct dma_chan *chan;3421343134223422- lock_cpu_hotplug();34233423-34243432 if (net_dma_count == 0) {34253433 for_each_online_cpu(cpu)34263426- rcu_assign_pointer(per_cpu(softnet_data.net_dma, cpu), NULL);34273427- unlock_cpu_hotplug();34343434+ rcu_assign_pointer(per_cpu(softnet_data, cpu).net_dma, NULL);34283435 return;34293436 }34303437···34343447 + (i < (num_online_cpus() % net_dma_count) ? 1 : 0));3435344834363449 while(n) {34373437- per_cpu(softnet_data.net_dma, cpu) = chan;34503450+ per_cpu(softnet_data, cpu).net_dma = chan;34383451 cpu = next_cpu(cpu, cpu_online_map);34393452 n--;34403453 }34413454 i++;34423455 }34433456 rcu_read_unlock();34443444-34453445- unlock_cpu_hotplug();34463457}3447345834483459/**
+8-6
net/core/neighbour.c
···2929#include <net/neighbour.h>3030#include <net/dst.h>3131#include <net/sock.h>3232+#include <net/netevent.h>3233#include <linux/rtnetlink.h>3334#include <linux/random.h>3435#include <linux/string.h>···755754 neigh->nud_state = NUD_STALE;756755 neigh->updated = jiffies;757756 neigh_suspect(neigh);757757+ notify = 1;758758 }759759 } else if (state & NUD_DELAY) {760760 if (time_before_eq(now, ···764762 neigh->nud_state = NUD_REACHABLE;765763 neigh->updated = jiffies;766764 neigh_connect(neigh);765765+ notify = 1;767766 next = neigh->confirmed + neigh->parms->reachable_time;768767 } else {769768 NEIGH_PRINTK2("neigh %p is probed.\n", neigh);···822819out:823820 write_unlock(&neigh->lock);824821 }822822+ if (notify)823823+ call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);825824826825#ifdef CONFIG_ARPD827826 if (notify && neigh->parms->app_probes)···931926{932927 u8 old;933928 int err;934934-#ifdef CONFIG_ARPD935929 int notify = 0;936936-#endif937930 struct net_device *dev;938931 int update_isrouter = 0;939932···951948 neigh_suspect(neigh);952949 neigh->nud_state = new;953950 err = 0;954954-#ifdef CONFIG_ARPD955951 notify = old & NUD_VALID;956956-#endif957952 goto out;958953 }959954···10231022 if (!(new & NUD_CONNECTED))10241023 neigh->confirmed = jiffies -10251024 (neigh->parms->base_reachable_time << 1);10261026-#ifdef CONFIG_ARPD10271025 notify = 1;10281028-#endif10291026 }10301027 if (new == old)10311028 goto out;···10551056 (neigh->flags & ~NTF_ROUTER);10561057 }10571058 write_unlock_bh(&neigh->lock);10591059+10601060+ if (notify)10611061+ call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh);10581062#ifdef CONFIG_ARPD10591063 if (notify && neigh->parms->app_probes)10601064 neigh_app_notify(neigh);
+69
net/core/netevent.c
···11+/*22+ * Network event notifiers33+ *44+ * Authors:55+ * Tom Tucker <tom@opengridcomputing.com>66+ * Steve Wise <swise@opengridcomputing.com>77+ *88+ * This program is free software; you can redistribute it and/or99+ * modify it under the terms of the GNU General Public License1010+ * as published by the Free Software Foundation; either version1111+ * 2 of the License, or (at your option) any later version.1212+ *1313+ * Fixes:1414+ */1515+1616+#include <linux/rtnetlink.h>1717+#include <linux/notifier.h>1818+1919+static ATOMIC_NOTIFIER_HEAD(netevent_notif_chain);2020+2121+/**2222+ * register_netevent_notifier - register a netevent notifier block2323+ * @nb: notifier2424+ *2525+ * Register a notifier to be called when a netevent occurs.2626+ * The notifier passed is linked into the kernel structures and must2727+ * not be reused until it has been unregistered. A negative errno code2828+ * is returned on a failure.2929+ */3030+int register_netevent_notifier(struct notifier_block *nb)3131+{3232+ int err;3333+3434+ err = atomic_notifier_chain_register(&netevent_notif_chain, nb);3535+ return err;3636+}3737+3838+/**3939+ * netevent_unregister_notifier - unregister a netevent notifier block4040+ * @nb: notifier4141+ *4242+ * Unregister a notifier previously registered by4343+ * register_neigh_notifier(). The notifier is unlinked into the4444+ * kernel structures and may then be reused. A negative errno code4545+ * is returned on a failure.4646+ */4747+4848+int unregister_netevent_notifier(struct notifier_block *nb)4949+{5050+ return atomic_notifier_chain_unregister(&netevent_notif_chain, nb);5151+}5252+5353+/**5454+ * call_netevent_notifiers - call all netevent notifier blocks5555+ * @val: value passed unmodified to notifier function5656+ * @v: pointer passed unmodified to notifier function5757+ *5858+ * Call all neighbour notifier blocks. Parameters and return value5959+ * are as for notifier_call_chain().6060+ */6161+6262+int call_netevent_notifiers(unsigned long val, void *v)6363+{6464+ return atomic_notifier_call_chain(&netevent_notif_chain, val, v);6565+}6666+6767+EXPORT_SYMBOL_GPL(register_netevent_notifier);6868+EXPORT_SYMBOL_GPL(unregister_netevent_notifier);6969+EXPORT_SYMBOL_GPL(call_netevent_notifiers);
+34-11
net/core/skbuff.c
···7171static kmem_cache_t *skbuff_fclone_cache __read_mostly;72727373/*7474- * lockdep: lock class key used by skb_queue_head_init():7575- */7676-struct lock_class_key skb_queue_lock_key;7777-7878-EXPORT_SYMBOL(skb_queue_lock_key);7979-8080-/*8174 * Keep out-of-line to prevent kernel bloat.8275 * __builtin_return_address is not used because it is not always8376 * reliable.···249256 goto out;250257}251258259259+/**260260+ * __netdev_alloc_skb - allocate an skbuff for rx on a specific device261261+ * @dev: network device to receive on262262+ * @length: length to allocate263263+ * @gfp_mask: get_free_pages mask, passed to alloc_skb264264+ *265265+ * Allocate a new &sk_buff and assign it a usage count of one. The266266+ * buffer has unspecified headroom built in. Users should allocate267267+ * the headroom they think they need without accounting for the268268+ * built in space. The built in space is used for optimisations.269269+ *270270+ * %NULL is returned if there is no free memory.271271+ */272272+struct sk_buff *__netdev_alloc_skb(struct net_device *dev,273273+ unsigned int length, gfp_t gfp_mask)274274+{275275+ struct sk_buff *skb;276276+277277+ skb = alloc_skb(length + NET_SKB_PAD, gfp_mask);278278+ if (likely(skb))279279+ skb_reserve(skb, NET_SKB_PAD);280280+ return skb;281281+}252282253283static void skb_drop_list(struct sk_buff **listp)254284{···862846 unlikely((err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC))))863847 return err;864848865865- for (i = 0; i < nfrags; i++) {849849+ i = 0;850850+ if (offset >= len)851851+ goto drop_pages;852852+853853+ for (; i < nfrags; i++) {866854 int end = offset + skb_shinfo(skb)->frags[i].size;867855868856 if (end < len) {···874854 continue;875855 }876856877877- if (len > offset)878878- skb_shinfo(skb)->frags[i++].size = len - offset;857857+ skb_shinfo(skb)->frags[i++].size = len - offset;879858859859+drop_pages:880860 skb_shinfo(skb)->nr_frags = i;881861882862 for (; i < nfrags; i++)···884864885865 if (skb_shinfo(skb)->frag_list)886866 skb_drop_fraglist(skb);887887- break;867867+ goto done;888868 }889869890870 for (fragp = &skb_shinfo(skb)->frag_list; (frag = *fragp);···899879 return -ENOMEM;900880901881 nfrag->next = frag->next;882882+ kfree_skb(frag);902883 frag = nfrag;903884 *fragp = frag;904885 }···918897 break;919898 }920899900900+done:921901 if (len > skb_headlen(skb)) {922902 skb->data_len -= skb->len - len;923903 skb->len = len;···20642042EXPORT_SYMBOL(kfree_skb);20652043EXPORT_SYMBOL(__pskb_pull_tail);20662044EXPORT_SYMBOL(__alloc_skb);20452045+EXPORT_SYMBOL(__netdev_alloc_skb);20672046EXPORT_SYMBOL(pskb_copy);20682047EXPORT_SYMBOL(pskb_expand_head);20692048EXPORT_SYMBOL(skb_checksum);
+2-2
net/dccp/ipv6.c
···230230 ipv6_addr_copy(&np->saddr, saddr);231231 inet->rcv_saddr = LOOPBACK4_IPV6;232232233233- ip6_dst_store(sk, dst, NULL);233233+ __ip6_dst_store(sk, dst, NULL);234234235235 icsk->icsk_ext_hdr_len = 0;236236 if (np->opt != NULL)···863863 * comment in that function for the gory details. -acme864864 */865865866866- ip6_dst_store(newsk, dst, NULL);866866+ __ip6_dst_store(newsk, dst, NULL);867867 newsk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM |868868 NETIF_F_TSO);869869 newdp6 = (struct dccp6_sock *)newsk;
+7-2
net/decnet/dn_route.c
···925925 for(dev_out = dev_base; dev_out; dev_out = dev_out->next) {926926 if (!dev_out->dn_ptr)927927 continue;928928- if (dn_dev_islocal(dev_out, oldflp->fld_src))929929- break;928928+ if (!dn_dev_islocal(dev_out, oldflp->fld_src))929929+ continue;930930+ if ((dev_out->flags & IFF_LOOPBACK) &&931931+ oldflp->fld_dst &&932932+ !dn_dev_islocal(dev_out, oldflp->fld_dst))933933+ continue;934934+ break;930935 }931936 read_unlock(&dev_base_lock);932937 if (dev_out == NULL)
+4-3
net/ipv4/ip_output.c
···526526527527 err = output(skb);528528529529+ if (!err)530530+ IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);529531 if (err || !frag)530532 break;531533···651649 /*652650 * Put this fragment into the sending queue.653651 */654654-655655- IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);656656-657652 iph->tot_len = htons(len + hlen);658653659654 ip_send_check(iph);···658659 err = output(skb2);659660 if (err)660661 goto fail;662662+663663+ IP_INC_STATS(IPSTATS_MIB_FRAGCREATES);661664 }662665 kfree_skb(skb);663666 IP_INC_STATS(IPSTATS_MIB_FRAGOKS);
···508508 if (!r->cfg.expire)509509 return 0;510510511511+ if (r->name[sizeof(r->name) - 1] != '\0')512512+ return 0;513513+511514 /* This is the best we've got: We cannot release and re-grab lock,512515 * since checkentry() is called before ip_tables.c grabs ipt_mutex. 513516 * We also cannot grab the hashtable spinlock, since htable_create will
···438438 It can f.e. if SYNs crossed.439439 */440440 if (!sock_owned_by_user(sk)) {441441- TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);442441 sk->sk_err = err;443442444443 sk->sk_error_report(sk);···873874drop_and_free:874875 reqsk_free(req);875876drop:876876- TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);877877 return 0;878878}879879
+3-1
net/ipv4/tcp_minisocks.c
···589589 /* RFC793: "second check the RST bit" and590590 * "fourth, check the SYN bit"591591 */592592- if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN))592592+ if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {593593+ TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);593594 goto embryonic_reset;595595+ }594596595597 /* ACK sequence verified above, just make sure ACK is596598 * set. If ACK not set, just silently drop the packet.
+1-1
net/ipv4/tcp_probe.c
···114114static ssize_t tcpprobe_read(struct file *file, char __user *buf,115115 size_t len, loff_t *ppos)116116{117117- int error = 0, cnt;117117+ int error = 0, cnt = 0;118118 unsigned char *tbuf;119119120120 if (!buf || len < 0)
···356356 skb->dev = dst->dev;357357 icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,358358 0, skb->dev);359359+ IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);359360360361 kfree_skb(skb);361362 return -ETIMEDOUT;···596595 }597596598597 err = output(skb);598598+ if(!err)599599+ IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);600600+599601 if (err || !frag)600602 break;601603···710706 /*711707 * Put this fragment into the sending queue.712708 */713713-714714- IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);715715-716709 err = output(frag);717710 if (err)718711 goto fail;712712+713713+ IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);719714 }720715 kfree_skb(skb);721716 IP6_INC_STATS(IPSTATS_MIB_FRAGOKS);···726723 return err;727724}728725729729-int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)726726+static struct dst_entry *ip6_sk_dst_check(struct sock *sk,727727+ struct dst_entry *dst,728728+ struct flowi *fl)730729{731731- int err = 0;730730+ struct ipv6_pinfo *np = inet6_sk(sk);731731+ struct rt6_info *rt = (struct rt6_info *)dst;732732733733- *dst = NULL;734734- if (sk) {735735- struct ipv6_pinfo *np = inet6_sk(sk);736736-737737- *dst = sk_dst_check(sk, np->dst_cookie);738738- if (*dst) {739739- struct rt6_info *rt = (struct rt6_info*)*dst;740740-741741- /* Yes, checking route validity in not connected742742- * case is not very simple. Take into account,743743- * that we do not support routing by source, TOS,744744- * and MSG_DONTROUTE --ANK (980726)745745- *746746- * 1. If route was host route, check that747747- * cached destination is current.748748- * If it is network route, we still may749749- * check its validity using saved pointer750750- * to the last used address: daddr_cache.751751- * We do not want to save whole address now,752752- * (because main consumer of this service753753- * is tcp, which has not this problem),754754- * so that the last trick works only on connected755755- * sockets.756756- * 2. oif also should be the same.757757- */758758- if (((rt->rt6i_dst.plen != 128 ||759759- !ipv6_addr_equal(&fl->fl6_dst,760760- &rt->rt6i_dst.addr))761761- && (np->daddr_cache == NULL ||762762- !ipv6_addr_equal(&fl->fl6_dst,763763- np->daddr_cache)))764764- || (fl->oif && fl->oif != (*dst)->dev->ifindex)) {765765- dst_release(*dst);766766- *dst = NULL;767767- }768768- }733733+ if (!dst)734734+ goto out;735735+736736+ /* Yes, checking route validity in not connected737737+ * case is not very simple. Take into account,738738+ * that we do not support routing by source, TOS,739739+ * and MSG_DONTROUTE --ANK (980726)740740+ *741741+ * 1. If route was host route, check that742742+ * cached destination is current.743743+ * If it is network route, we still may744744+ * check its validity using saved pointer745745+ * to the last used address: daddr_cache.746746+ * We do not want to save whole address now,747747+ * (because main consumer of this service748748+ * is tcp, which has not this problem),749749+ * so that the last trick works only on connected750750+ * sockets.751751+ * 2. oif also should be the same.752752+ */753753+ if (((rt->rt6i_dst.plen != 128 ||754754+ !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr))755755+ && (np->daddr_cache == NULL ||756756+ !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache)))757757+ || (fl->oif && fl->oif != dst->dev->ifindex)) {758758+ dst_release(dst);759759+ dst = NULL;769760 }761761+762762+out:763763+ return dst;764764+}765765+766766+static int ip6_dst_lookup_tail(struct sock *sk,767767+ struct dst_entry **dst, struct flowi *fl)768768+{769769+ int err;770770771771 if (*dst == NULL)772772 *dst = ip6_route_output(sk, fl);···779773780774 if (ipv6_addr_any(&fl->fl6_src)) {781775 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src);782782-783776 if (err)784777 goto out_err_release;785778 }···791786 return err;792787}793788789789+/**790790+ * ip6_dst_lookup - perform route lookup on flow791791+ * @sk: socket which provides route info792792+ * @dst: pointer to dst_entry * for result793793+ * @fl: flow to lookup794794+ *795795+ * This function performs a route lookup on the given flow.796796+ *797797+ * It returns zero on success, or a standard errno code on error.798798+ */799799+int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)800800+{801801+ *dst = NULL;802802+ return ip6_dst_lookup_tail(sk, dst, fl);803803+}794804EXPORT_SYMBOL_GPL(ip6_dst_lookup);805805+806806+/**807807+ * ip6_sk_dst_lookup - perform socket cached route lookup on flow808808+ * @sk: socket which provides the dst cache and route info809809+ * @dst: pointer to dst_entry * for result810810+ * @fl: flow to lookup811811+ *812812+ * This function performs a route lookup on the given flow with the813813+ * possibility of using the cached route in the socket if it is valid.814814+ * It will take the socket dst lock when operating on the dst cache.815815+ * As a result, this function can only be used in process context.816816+ *817817+ * It returns zero on success, or a standard errno code on error.818818+ */819819+int ip6_sk_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl)820820+{821821+ *dst = NULL;822822+ if (sk) {823823+ *dst = sk_dst_check(sk, inet6_sk(sk)->dst_cookie);824824+ *dst = ip6_sk_dst_check(sk, *dst, fl);825825+ }826826+827827+ return ip6_dst_lookup_tail(sk, dst, fl);828828+}829829+EXPORT_SYMBOL_GPL(ip6_sk_dst_lookup);795830796831static inline int ip6_ufo_append_data(struct sock *sk,797832 int getfrag(void *from, char *to, int offset, int len,
+7
net/ipv6/route.c
···5353#include <linux/rtnetlink.h>5454#include <net/dst.h>5555#include <net/xfrm.h>5656+#include <net/netevent.h>56575758#include <asm/uaccess.h>5859···743742 dst->metrics[RTAX_FEATURES-1] |= RTAX_FEATURE_ALLFRAG;744743 }745744 dst->metrics[RTAX_MTU-1] = mtu;745745+ call_netevent_notifiers(NETEVENT_PMTU_UPDATE, dst);746746 }747747}748748···11571155 struct rt6_info *rt, *nrt = NULL;11581156 int strict;11591157 struct fib6_node *fn;11581158+ struct netevent_redirect netevent;1160115911611160 /*11621161 * Get the "current" route for this destination and···1254125112551252 if (ip6_ins_rt(nrt, NULL, NULL, NULL))12561253 goto out;12541254+12551255+ netevent.old = &rt->u.dst;12561256+ netevent.new = &nrt->u.dst;12571257+ call_netevent_notifiers(NETEVENT_REDIRECT, &netevent);1257125812581259 if (rt->rt6i_flags&RTF_CACHE) {12591260 ip6_del_rt(rt, NULL, NULL, NULL);
+2-4
net/ipv6/tcp_ipv6.c
···270270 inet->rcv_saddr = LOOPBACK4_IPV6;271271272272 sk->sk_gso_type = SKB_GSO_TCPV6;273273- ip6_dst_store(sk, dst, NULL);273273+ __ip6_dst_store(sk, dst, NULL);274274275275 icsk->icsk_ext_hdr_len = 0;276276 if (np->opt)···427427 case TCP_SYN_RECV: /* Cannot happen.428428 It can, it SYNs are crossed. --ANK */ 429429 if (!sock_owned_by_user(sk)) {430430- TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);431430 sk->sk_err = err;432431 sk->sk_error_report(sk); /* Wake people up to see the error (see connect in sock.c) */433432···830831 if (req)831832 reqsk_free(req);832833833833- TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);834834 return 0; /* don't send reset */835835}836836···945947 */946948947949 sk->sk_gso_type = SKB_GSO_TCPV6;948948- ip6_dst_store(newsk, dst, NULL);950950+ __ip6_dst_store(newsk, dst, NULL);949951950952 newtcp6sk = (struct tcp6_sock *)newsk;951953 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
···784784 copied += used;785785 len -= used;786786787787- if (used + offset < skb->len)788788- continue;789789-790787 if (!(flags & MSG_PEEK)) {791788 sk_eat_skb(sk, skb, 0);792789 *seq = 0;793790 }791791+792792+ /* For non stream protcols we get one packet per recvmsg call */793793+ if (sk->sk_type != SOCK_STREAM)794794+ goto copy_uaddr;795795+796796+ /* Partial read */797797+ if (used + offset < skb->len)798798+ continue;794799 } while (len > 0);795800796796- /* 797797- * According to UNIX98, msg_name/msg_namelen are ignored798798- * on connected socket. -ANK799799- * But... af_llc still doesn't have separate sets of methods for800800- * SOCK_DGRAM and SOCK_STREAM :-( So we have to do this test, will801801- * eventually fix this tho :-) -acme802802- */803803- if (sk->sk_type == SOCK_DGRAM)804804- goto copy_uaddr;805801out:806802 release_sock(sk);807803 return copied;
+2-2
net/llc/llc_sap.c
···5151{5252 struct sockaddr_llc *addr;53535454- if (skb->sk->sk_type == SOCK_STREAM) /* See UNIX98 */5555- return;5654 /* save primitive for use by the user. */5755 addr = llc_ui_skb_cb(skb);5656+5757+ memset(addr, 0, sizeof(*addr));5858 addr->sllc_family = sk->sk_family;5959 addr->sllc_arphrd = skb->dev->type;6060 addr->sllc_test = prim == LLC_TEST_PRIM;
+2
net/netfilter/xt_SECMARK.c
···5757{5858 int err;5959 struct xt_secmark_target_selinux_info *sel = &info->u.sel;6060+6161+ sel->selctx[SECMARK_SELCTX_MAX - 1] = '\0';60626163 err = selinux_string_to_sid(sel->selctx, &sel->selsid);6264 if (err) {
+4-1
net/netfilter/xt_string.c
···5555 /* Damn, can't handle this case properly with iptables... */5656 if (conf->from_offset > conf->to_offset)5757 return 0;5858-5858+ if (conf->algo[XT_STRING_MAX_ALGO_NAME_SIZE - 1] != '\0')5959+ return 0;6060+ if (conf->patlen > XT_STRING_MAX_PATTERN_SIZE)6161+ return 0;5962 ts_conf = textsearch_prepare(conf->algo, conf->pattern, conf->patlen,6063 GFP_KERNEL, TS_AUTOLOAD);6164 if (IS_ERR(ts_conf))
···7171 new = detail->alloc();7272 if (!new)7373 return NULL;7474+ /* must fully initialise 'new', else7575+ * we might get lose if we need to7676+ * cache_put it soon.7777+ */7478 cache_init(new);7979+ detail->init(new, key);75807681 write_lock(&detail->hash_lock);7782···9085 return tmp;9186 }9287 }9393- detail->init(new, key);9488 new->next = *head;9589 *head = new;9690 detail->entries++;
+29-23
net/sunrpc/clnt.c
···921921 task->tk_status = xprt_prepare_transmit(task);922922 if (task->tk_status != 0)923923 return;924924+ task->tk_action = call_transmit_status;924925 /* Encode here so that rpcsec_gss can use correct sequence number. */925926 if (rpc_task_need_encode(task)) {926926- task->tk_rqstp->rq_bytes_sent = 0;927927+ BUG_ON(task->tk_rqstp->rq_bytes_sent != 0);927928 call_encode(task);928929 /* Did the encode result in an error condition? */929930 if (task->tk_status != 0)930930- goto out_nosend;931931+ return;931932 }932932- task->tk_action = call_transmit_status;933933 xprt_transmit(task);934934 if (task->tk_status < 0)935935 return;936936- if (!task->tk_msg.rpc_proc->p_decode) {937937- task->tk_action = rpc_exit_task;938938- rpc_wake_up_task(task);939939- }940940- return;941941-out_nosend:942942- /* release socket write lock before attempting to handle error */943943- xprt_abort_transmit(task);936936+ /*937937+ * On success, ensure that we call xprt_end_transmit() before sleeping938938+ * in order to allow access to the socket to other RPC requests.939939+ */940940+ call_transmit_status(task);941941+ if (task->tk_msg.rpc_proc->p_decode != NULL)942942+ return;943943+ task->tk_action = rpc_exit_task;944944+ rpc_wake_up_task(task);945945+}946946+947947+/*948948+ * 5a. Handle cleanup after a transmission949949+ */950950+static void951951+call_transmit_status(struct rpc_task *task)952952+{953953+ task->tk_action = call_status;954954+ /*955955+ * Special case: if we've been waiting on the socket's write_space()956956+ * callback, then don't call xprt_end_transmit().957957+ */958958+ if (task->tk_status == -EAGAIN)959959+ return;960960+ xprt_end_transmit(task);944961 rpc_task_force_reencode(task);945962}946963···1009992}10109931011994/*10121012- * 6a. Handle transmission errors.10131013- */10141014-static void10151015-call_transmit_status(struct rpc_task *task)10161016-{10171017- if (task->tk_status != -EAGAIN)10181018- rpc_task_force_reencode(task);10191019- call_status(task);10201020-}10211021-10221022-/*10231023- * 6b. Handle RPC timeout995995+ * 6a. Handle RPC timeout1024996 * We do not release the request slot, so we keep using the1025997 * same XID for all retransmits.1026998 */
···707707 return err;708708}709709710710-void711711-xprt_abort_transmit(struct rpc_task *task)710710+void xprt_end_transmit(struct rpc_task *task)712711{713713- struct rpc_xprt *xprt = task->tk_xprt;714714-715715- xprt_release_write(xprt, task);712712+ xprt_release_write(task->tk_xprt, task);716713}717714718715/**···758761 task->tk_status = -ENOTCONN;759762 else if (!req->rq_received)760763 rpc_sleep_on(&xprt->pending, task, NULL, xprt_timer);761761-762762- xprt->ops->release_xprt(xprt, task);763764 spin_unlock_bh(&xprt->transport_lock);764765 return;765766 }···767772 * schedq, and being picked up by a parallel run of rpciod().768773 */769774 task->tk_status = status;770770-771771- switch (status) {772772- case -ECONNREFUSED:775775+ if (status == -ECONNREFUSED)773776 rpc_sleep_on(&xprt->sending, task, NULL, NULL);774774- case -EAGAIN:775775- case -ENOTCONN:776776- return;777777- default:778778- break;779779- }780780- xprt_release_write(xprt, task);781781- return;782777}783778784779static inline void do_xprt_reserve(struct rpc_task *task)
+28-1
net/sunrpc/xprtsock.c
···414414}415415416416/**417417+ * xs_tcp_release_xprt - clean up after a tcp transmission418418+ * @xprt: transport419419+ * @task: rpc task420420+ *421421+ * This cleans up if an error causes us to abort the transmission of a request.422422+ * In this case, the socket may need to be reset in order to avoid confusing423423+ * the server.424424+ */425425+static void xs_tcp_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task)426426+{427427+ struct rpc_rqst *req;428428+429429+ if (task != xprt->snd_task)430430+ return;431431+ if (task == NULL)432432+ goto out_release;433433+ req = task->tk_rqstp;434434+ if (req->rq_bytes_sent == 0)435435+ goto out_release;436436+ if (req->rq_bytes_sent == req->rq_snd_buf.len)437437+ goto out_release;438438+ set_bit(XPRT_CLOSE_WAIT, &task->tk_xprt->state);439439+out_release:440440+ xprt_release_xprt(xprt, task);441441+}442442+443443+/**417444 * xs_close - close a socket418445 * @xprt: transport419446 *···1277125012781251static struct rpc_xprt_ops xs_tcp_ops = {12791252 .reserve_xprt = xprt_reserve_xprt,12801280- .release_xprt = xprt_release_xprt,12531253+ .release_xprt = xs_tcp_release_xprt,12811254 .set_port = xs_set_port,12821255 .connect = xs_connect,12831256 .buf_alloc = rpc_malloc,