···50500. History & News:5151 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)5252 2005-05-30 - added basic isochronous support to the dvb-usb-framework5353- added support for Conexant Hybrid reference design and Nebula DigiTV USB5353+ added support for Conexant Hybrid reference design and Nebula DigiTV USB5454 2005-04-17 - all dibusb devices ported to make use of the dvb-usb-framework5555 2005-04-02 - re-enabled and improved remote control code.5656 2005-03-31 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb.5757 2005-03-30 - first commit of the dvb-usb-module based on the dibusb-source. First device is a new driver for the5858- TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.5858+ TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.59596060 (change from dvb-dibusb to dvb-usb)6161 2005-03-28 - added support for the AVerMedia AverTV DVB-T USB2.0 device (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia)···6464 2005-02-02 - added support for the Hauppauge Win-TV Nova-T USB26565 2005-01-31 - distorted streaming is gone for USB1.1 devices6666 2005-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb6767- - first almost working version for HanfTek UMT-0106868- - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-0106767+ - first almost working version for HanfTek UMT-0106868+ - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-0106969 2005-01-10 - refactoring completed, now everything is very delightful7070- - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a7171- Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.7070+ - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a7171+ Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.7272 2004-12-29 - after several days of struggling around bug of no returning URBs fixed.7373 2004-12-26 - refactored the dibusb-driver, splitted into separate files7474- - i2c-probing enabled7474+ - i2c-probing enabled7575 2004-12-06 - possibility for demod i2c-address probing7676- - new usb IDs (Compro, Artec)7676+ - new usb IDs (Compro, Artec)7777 2004-11-23 - merged changes from DiB3000MC_ver2.17878- - revised the debugging7979- - possibility to deliver the complete TS for USB2.07878+ - revised the debugging7979+ - possibility to deliver the complete TS for USB2.08080 2004-11-21 - first working version of the dib3000mc/p frontend driver.8181 2004-11-12 - added additional remote control keys. Thanks to Uwe Hanke.8282 2004-11-07 - added remote control support. Thanks to David Matthews.8383 2004-11-05 - added support for a new devices (Grandtec/Avermedia/Artec)8484- - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD8585- - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems8686- better settled there (added xfer_ops-struct)8787- - created a common files for frontends (mc/p/mb)8484+ - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD8585+ - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems8686+ better settled there (added xfer_ops-struct)8787+ - created a common files for frontends (mc/p/mb)8888 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek)8989 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks9090- to Amaury Demol for reporting9191- - changed usb TS transfer method (several urbs, stopping transfer9292- before setting a new pid)9090+ to Amaury Demol for reporting9191+ - changed usb TS transfer method (several urbs, stopping transfer9292+ before setting a new pid)9393 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks9494- to Christian Motschke for reporting9494+ to Christian Motschke for reporting9595 2004-09-05 - released the dibusb device and dib3000mb-frontend driver96969797 (old news for vp7041.c)9898 2004-07-15 - found out, by accident, that the device has a TUA6010XS for9999- PLL9999+ PLL100100 2004-07-12 - figured out, that the driver should also work with the101101- CTS Portable (Chinese Television System)101101+ CTS Portable (Chinese Television System)102102 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working103103- properly with firmware extracted from 2.422104104- - #if for 2.6.4 (dvb), compile issue105105- - changed firmware handling, see vp7041.txt sec 1.1103103+ properly with firmware extracted from 2.422104104+ - #if for 2.6.4 (dvb), compile issue105105+ - changed firmware handling, see vp7041.txt sec 1.1106106 2004-07-02 - some tuner modifications, v0.1, cleanups, first public107107 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything108108- runs fine now108108+ runs fine now109109 2004-06-27 - able to watch and switching channels (pre-alpha)110110- - no section filtering yet110110+ - no section filtering yet111111 2004-06-06 - first TS received, but kernel oops :/112112 2004-05-14 - firmware loader is working113113 2004-05-11 - start writing the driver
+1-1
Documentation/dvb/README.flexcop
···174174Everything which is identical in the following table, can be put into a common175175flexcop-module.176176177177- PCI USB177177+ PCI USB178178-------------------------------------------------------------------------------179179Different:180180Register access: accessing IO memory USB control message
+1-1
Documentation/dvb/avermedia.txt
···1122HOWTO: Get An Avermedia DVB-T working under Linux33- ______________________________________________33+ ______________________________________________4455 Table of Contents66 Assumptions and Introduction
+4-4
Documentation/dvb/cards.txt
···1616 shielding, and the whole metal box has its own part number.171718181919-o Frontends drivers: 1919+o Frontends drivers:2020 - dvb_dummy_fe: for testing...2121 DVB-S:2222 - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993)···2424 - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL2525 - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL2626 - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL),2727- LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), 2727+ LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL),2828 Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB2929 DVB-C:3030 - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL)···3535 - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL3636 - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL)3737 - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL),3838- Comtech DVBT-6k07 (SP5730 PLL)3939- (NxtWave Communications NXT6000 demodulator)3838+ Comtech DVBT-6k07 (SP5730 PLL)3939+ (NxtWave Communications NXT6000 demodulator)4040 - sp887x : Microtune 7202D4141 - dib3000mb : DiBcom 3000-MB demodulator4242 DVB-S/C/T:
+2-2
Documentation/dvb/contributors.txt
···15151616Diego Picciani <d.picciani@novacomp.it>1717 for CyberLogin for Linux which allows logging onto EON1818- (in case you are wondering where CyberLogin is, EON changed its login 1818+ (in case you are wondering where CyberLogin is, EON changed its login1919 procedure and CyberLogin is no longer used.)20202121Martin Schaller <martin@smurf.franken.de>···5757Davor Emard <emard@softhome.net>5858 for his work on the budget drivers, the demux code,5959 the module unloading problems, ...6060-6060+6161Hans-Frieder Vogt <hfvogt@arcor.de>6262 for his work on calculating and checking the crc's for the6363 TechnoTrend/Hauppauge DEC driver firmware
+2-2
Documentation/dvb/readme.txt
···20202121What's inside this directory:22222323-"cards.txt" 2323+"cards.txt"2424contains a list of supported hardware.25252626"contributors.txt"···3737contains detailed informations about the3838TT DEC2000/DEC3000 USB DVB hardware.39394040-"bt8xx.txt" 4040+"bt8xx.txt"4141contains detailed installation instructions for the4242various bt8xx based "budget" DVB cards4343(Nebula, Pinnacle PCTV, Twinhan DST)
+11-11
Documentation/filesystems/ext3.txt
···5757 we'd like to get some feedback if it's the contrary for5858 you.59596060-user_xattr (*) Enables POSIX Extended Attributes. It's enabled by6161- default, however you need to confifure its support6262- (CONFIG_EXT3_FS_XATTR). This is neccesary if you want6363- to use POSIX Acces Control Lists support. You can visit6464- http://acl.bestbits.at to know more about POSIX Extended6565- attributes.6060+user_xattr Enables Extended User Attributes. Additionally, you need6161+ to have extended attribute support enabled in the kernel6262+ configuration (CONFIG_EXT3_FS_XATTR). See the attr(5)6363+ manual page and http://acl.bestbits.at to learn more6464+ about extended attributes.66656767-nouser_xattr Disables POSIX Extended Attributes.6666+nouser_xattr Disables Extended User Attributes.68676969-acl (*) Enables POSIX Access Control Lists support. This is7070- enabled by default, however you need to configure7171- its support (CONFIG_EXT3_FS_POSIX_ACL). If you want7272- to know more about ACLs visit http://acl.bestbits.at6868+acl Enables POSIX Access Control Lists support. Additionally,6969+ you need to have ACL support enabled in the kernel7070+ configuration (CONFIG_EXT3_FS_POSIX_ACL). See the acl(5)7171+ manual page and http://acl.bestbits.at for more7272+ information.73737474noacl This option disables POSIX Access Control List support.7575
+1-1
Makefile
···408408# of make so .config is not included in this case either (for *config).409409410410no-dot-config-targets := clean mrproper distclean \411411- cscope TAGS tags help %docs check% kernelrelease411411+ cscope TAGS tags help %docs check%412412413413config-targets := 0414414mixed-targets := 0
···650650651651 cpu = smp_processor_id();652652653653-#ifdef CONFIG_HOTPLUG_CPU654654- if (!cpu_online(cpu)) {655655- nmi_exit();656656- return;657657- }658658-#endif659659-660653 ++nmi_count(cpu);661654662655 if (!rcu_dereference(nmi_callback)(regs, cpu))
···227227 If you don't know what to do here, say N.228228229229config NR_CPUS230230- int "Maximum number of CPUs (2-32)"230230+ int "Maximum number of CPUs (2-128)"231231 range 2 128232232 depends on SMP233233 default "32" if PPC64
···102102dev_t boot_dev;103103u64 ppc64_pft_size;104104105105-struct ppc64_caches ppc64_caches;105105+/* Pick defaults since we might want to patch instructions106106+ * before we've read this from the device tree.107107+ */108108+struct ppc64_caches ppc64_caches = {109109+ .dline_size = 0x80,110110+ .log_dline_size = 7,111111+ .iline_size = 0x80,112112+ .log_iline_size = 7113113+};106114EXPORT_SYMBOL_GPL(ppc64_caches);107115108116/*
+1-1
arch/powerpc/mm/hash_utils_64.c
···601601 /* Handle hugepage regions */602602 if (unlikely(in_hugepage_area(mm->context, ea))) {603603 DBG_LOW(" -> huge page !\n");604604- return hash_huge_page(mm, access, ea, vsid, local);604604+ return hash_huge_page(mm, access, ea, vsid, local, trap);605605 }606606607607 /* Get PTE and page size from page tables */
+79-20
arch/powerpc/mm/hugetlbpage.c
···148148 return 0;149149}150150151151+struct slb_flush_info {152152+ struct mm_struct *mm;153153+ u16 newareas;154154+};155155+151156static void flush_low_segments(void *parm)152157{153153- u16 areas = (unsigned long) parm;158158+ struct slb_flush_info *fi = parm;154159 unsigned long i;155160161161+ BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_LOW_AREAS);162162+163163+ if (current->active_mm != fi->mm)164164+ return;165165+166166+ /* Only need to do anything if this CPU is working in the same167167+ * mm as the one which has changed */168168+169169+ /* update the paca copy of the context struct */170170+ get_paca()->context = current->active_mm->context;171171+156172 asm volatile("isync" : : : "memory");157157-158158- BUILD_BUG_ON((sizeof(areas)*8) != NUM_LOW_AREAS);159159-160173 for (i = 0; i < NUM_LOW_AREAS; i++) {161161- if (! (areas & (1U << i)))174174+ if (! (fi->newareas & (1U << i)))162175 continue;163176 asm volatile("slbie %0"164177 : : "r" ((i << SID_SHIFT) | SLBIE_C));165178 }166166-167179 asm volatile("isync" : : : "memory");168180}169181170182static void flush_high_segments(void *parm)171183{172172- u16 areas = (unsigned long) parm;184184+ struct slb_flush_info *fi = parm;173185 unsigned long i, j;174186187187+188188+ BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_HIGH_AREAS);189189+190190+ if (current->active_mm != fi->mm)191191+ return;192192+193193+ /* Only need to do anything if this CPU is working in the same194194+ * mm as the one which has changed */195195+196196+ /* update the paca copy of the context struct */197197+ get_paca()->context = current->active_mm->context;198198+175199 asm volatile("isync" : : : "memory");176176-177177- BUILD_BUG_ON((sizeof(areas)*8) != NUM_HIGH_AREAS);178178-179200 for (i = 0; i < NUM_HIGH_AREAS; i++) {180180- if (! (areas & (1U << i)))201201+ if (! (fi->newareas & (1U << i)))181202 continue;182203 for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++)183204 asm volatile("slbie %0"184205 :: "r" (((i << HTLB_AREA_SHIFT)185185- + (j << SID_SHIFT)) | SLBIE_C));206206+ + (j << SID_SHIFT)) | SLBIE_C));186207 }187187-188208 asm volatile("isync" : : : "memory");189209}190210···249229static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)250230{251231 unsigned long i;232232+ struct slb_flush_info fi;252233253234 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS);254235 BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS);···265244266245 mm->context.low_htlb_areas |= newareas;267246268268- /* update the paca copy of the context struct */269269- get_paca()->context = mm->context;270270-271247 /* the context change must make it to memory before the flush,272248 * so that further SLB misses do the right thing. */273249 mb();274274- on_each_cpu(flush_low_segments, (void *)(unsigned long)newareas, 0, 1);250250+251251+ fi.mm = mm;252252+ fi.newareas = newareas;253253+ on_each_cpu(flush_low_segments, &fi, 0, 1);275254276255 return 0;277256}278257279258static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)280259{260260+ struct slb_flush_info fi;281261 unsigned long i;282262283263 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS);···302280 /* the context change must make it to memory before the flush,303281 * so that further SLB misses do the right thing. */304282 mb();305305- on_each_cpu(flush_high_segments, (void *)(unsigned long)newareas, 0, 1);283283+284284+ fi.mm = mm;285285+ fi.newareas = newareas;286286+ on_each_cpu(flush_high_segments, &fi, 0, 1);306287307288 return 0;308289}···664639 return -ENOMEM;665640}666641642642+/*643643+ * Called by asm hashtable.S for doing lazy icache flush644644+ */645645+static unsigned int hash_huge_page_do_lazy_icache(unsigned long rflags,646646+ pte_t pte, int trap)647647+{648648+ struct page *page;649649+ int i;650650+651651+ if (!pfn_valid(pte_pfn(pte)))652652+ return rflags;653653+654654+ page = pte_page(pte);655655+656656+ /* page is dirty */657657+ if (!test_bit(PG_arch_1, &page->flags) && !PageReserved(page)) {658658+ if (trap == 0x400) {659659+ for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++)660660+ __flush_dcache_icache(page_address(page+i));661661+ set_bit(PG_arch_1, &page->flags);662662+ } else {663663+ rflags |= HPTE_R_N;664664+ }665665+ }666666+ return rflags;667667+}668668+667669int hash_huge_page(struct mm_struct *mm, unsigned long access,668668- unsigned long ea, unsigned long vsid, int local)670670+ unsigned long ea, unsigned long vsid, int local,671671+ unsigned long trap)669672{670673 pte_t *ptep;671674 unsigned long old_pte, new_pte;···744691 rflags = 0x2 | (!(new_pte & _PAGE_RW));745692 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */746693 rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N);694694+ if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))695695+ /* No CPU has hugepages but lacks no execute, so we696696+ * don't need to worry about that case */697697+ rflags = hash_huge_page_do_lazy_icache(rflags, __pte(old_pte),698698+ trap);747699748700 /* Check if pte already has an hpte (case 2) */749701 if (unlikely(old_pte & _PAGE_HASHPTE)) {···761703 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;762704 slot += (old_pte & _PAGE_F_GIX) >> 12;763705764764- if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)706706+ if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize,707707+ local) == -1)765708 old_pte &= ~_PAGE_HPTEFLAGS;766709 }767710
+1-1
arch/powerpc/mm/numa.c
···125125126126 /* We didnt find a matching region, return start/end as 0 */127127 if (*start_pfn == -1UL)128128- start_pfn = 0;128128+ *start_pfn = 0;129129}130130131131static inline void map_cpu_to_node(int cpu, int node)
···298298 if (!(vflags & HPTE_V_BOLTED))299299 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);300300301301-#if 1302302- {303303- int i;304304- for (i=0;i<8;i++) {305305- unsigned long w0, w1;306306- plpar_pte_read(0, hpte_group, &w0, &w1);307307- BUG_ON (HPTE_V_COMPARE(hpte_v, w0)308308- && (w0 & HPTE_V_VALID));309309- }310310- }311311-#endif312312-313301 /* Now fill in the actual HPTE */314302 /* Set CEC cookie to 0 */315303 /* Zero page = 0 */
+3-3
arch/ppc/Kconfig
···767767 on it (826x, 827x, 8560).768768769769config PPC_CHRP770770- bool " Common Hardware Reference Platform (CHRP) based machines"770770+ bool771771 depends on PPC_MULTIPLATFORM772772 select PPC_I8259773773 select PPC_INDIRECT_PCI774774 default y775775776776config PPC_PMAC777777- bool " Apple PowerMac based machines"777777+ bool778778 depends on PPC_MULTIPLATFORM779779 select PPC_INDIRECT_PCI780780 default y···785785 default y786786787787config PPC_PREP788788- bool " PowerPC Reference Platform (PReP) based machines"788788+ bool789789 depends on PPC_MULTIPLATFORM790790 select PPC_I8259791791 select PPC_INDIRECT_PCI
+4
arch/ppc/kernel/smp.c
···301301302302 /* Probe platform for CPUs: always linear. */303303 num_cpus = smp_ops->probe();304304+305305+ if (num_cpus < 2)306306+ smp_tb_synchronized = 1;307307+304308 for (i = 0; i < num_cpus; ++i)305309 cpu_set(i, cpu_possible_map);306310
···943943 Applications should simply open the device (eg /dev/hda1)944944 with the O_DIRECT flag.945945946946+config MAX_RAW_DEVS947947+ int "Maximum number of RAW devices to support (1-8192)"948948+ depends on RAW_DRIVER949949+ default "256"950950+ help951951+ The maximum number of RAW devices that are supported.952952+ Default is 256. Increase this number in case you need lots of953953+ raw devices.954954+946955config HPET947956 bool "HPET - High Precision Event Timer" if (X86 || IA64)948957 default n···982973 registers may also contain other things that shouldn't be983974 exposed to the user. If this applies to your hardware,984975 say N here.985985-986986-config MAX_RAW_DEVS987987- int "Maximum number of RAW devices to support (1-8192)"988988- depends on RAW_DRIVER989989- default "256"990990- help991991- The maximum number of RAW devices that are supported.992992- Default is 256. Increase this number in case you need lots of993993- raw devices.994976995977config HANGCHECK_TIMER996978 tristate "Hangcheck timer"
···320320 * this branch is our 'one mirror IO has finished' event handler:321321 */322322 r1_bio->bios[mirror] = NULL;323323- bio_put(bio);324323 if (!uptodate) {325324 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);326325 /* an I/O failed, we can't clear the bitmap */···376377 }377378 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {378379 /* free extra copy of the data pages */379379-/* FIXME bio has been freed!!! */380380 int i = bio->bi_vcnt;381381 while (i--)382382 __free_page(bio->bi_io_vec[i].bv_page);···388390 md_write_end(r1_bio->mddev);389391 raid_end_bio_io(r1_bio);390392 }393393+394394+ if (r1_bio->bios[mirror]==NULL)395395+ bio_put(bio);391396392397 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);393398 return 0;
···276276 int i = 0, count = 0;277277 u32* buffer = dev->d_i2c.cpu_addr;278278 int err = 0;279279- int address_err = 0;280280- int short_delay = 0;279279+ int address_err = 0;280280+ int short_delay = 0;281281282282 if (down_interruptible (&dev->i2c_lock))283283 return -ERESTARTSYS;···325325 if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {326326 goto out;327327 }328328- address_err++;328328+ address_err++;329329 }330330 DEB_I2C(("error while sending message(s). starting again.\n"));331331 break;···336336 break;337337 }338338339339- /* delay a bit before retrying */340340- msleep(10);339339+ /* delay a bit before retrying */340340+ msleep(10);341341342342 } while (err != num && retries--);343343344344- /* if every retry had an address error, exit right away */345345- if (address_err == retries) {346346- goto out;344344+ /* if every retry had an address error, exit right away */345345+ if (address_err == retries) {346346+ goto out;347347 }348348349349 /* if any things had to be read, get the results */
+2-2
drivers/media/common/saa7146_vbi.c
···66{77 struct saa7146_vv *vv = dev->vv_data;8899- u32 *cpu;1010- dma_addr_t dma_addr;99+ u32 *cpu;1010+ dma_addr_t dma_addr;11111212 int count = 0;1313 int i;
+23-23
drivers/media/common/saa7146_video.c
···150150 maxh = vv->standard->v_max_out;151151152152 if (V4L2_FIELD_ANY == field) {153153- field = (win->w.height > maxh/2)154154- ? V4L2_FIELD_INTERLACED155155- : V4L2_FIELD_TOP;156156- }157157- switch (field) {158158- case V4L2_FIELD_TOP:159159- case V4L2_FIELD_BOTTOM:160160- case V4L2_FIELD_ALTERNATE:161161- maxh = maxh / 2;162162- break;163163- case V4L2_FIELD_INTERLACED:164164- break;165165- default: {153153+ field = (win->w.height > maxh/2)154154+ ? V4L2_FIELD_INTERLACED155155+ : V4L2_FIELD_TOP;156156+ }157157+ switch (field) {158158+ case V4L2_FIELD_TOP:159159+ case V4L2_FIELD_BOTTOM:160160+ case V4L2_FIELD_ALTERNATE:161161+ maxh = maxh / 2;162162+ break;163163+ case V4L2_FIELD_INTERLACED:164164+ break;165165+ default: {166166 DEB_D(("no known field mode '%d'.\n",field));167167- return -EINVAL;167167+ return -EINVAL;168168 }169169- }169169+ }170170171171 win->field = field;172172 if (win->w.width > maxw)···887887888888 DEB_EE(("VIDIOC_QUERYCAP\n"));889889890890- strcpy(cap->driver, "saa7146 v4l2");890890+ strcpy(cap->driver, "saa7146 v4l2");891891 strlcpy(cap->card, dev->ext->name, sizeof(cap->card));892892 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));893893 cap->version = SAA7146_VERSION_CODE;···10111011 err = set_control(fh,arg);10121012 return err;10131013 }10141014- case VIDIOC_G_PARM:10151015- {10161016- struct v4l2_streamparm *parm = arg;10141014+ case VIDIOC_G_PARM:10151015+ {10161016+ struct v4l2_streamparm *parm = arg;10171017 if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) {10181018 return -EINVAL;10191019 }10201020- memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm));10201020+ memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm));10211021 parm->parm.capture.readbuffers = 1;10221022 // fixme: only for PAL!10231023 parm->parm.capture.timeperframe.numerator = 1;10241024 parm->parm.capture.timeperframe.denominator = 25;10251025- return 0;10261026- }10251025+ return 0;10261026+ }10271027 case VIDIOC_G_FMT:10281028 {10291029 struct v4l2_format *f = arg;···1383138313841384static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)13851385{13861386- INIT_LIST_HEAD(&vv->video_q.queue);13861386+ INIT_LIST_HEAD(&vv->video_q.queue);1387138713881388 init_timer(&vv->video_q.timeout);13891389 vv->video_q.timeout.function = saa7146_buffer_timeout;
···86868787enum dmx_ts_pes8888{ /* also send packets to decoder (if it exists) */8989- DMX_TS_PES_AUDIO0,8989+ DMX_TS_PES_AUDIO0,9090 DMX_TS_PES_VIDEO0,9191 DMX_TS_PES_TELETEXT0,9292 DMX_TS_PES_SUBTITLE0,9393 DMX_TS_PES_PCR0,94949595- DMX_TS_PES_AUDIO1,9595+ DMX_TS_PES_AUDIO1,9696 DMX_TS_PES_VIDEO1,9797 DMX_TS_PES_TELETEXT1,9898 DMX_TS_PES_SUBTITLE1,9999 DMX_TS_PES_PCR1,100100101101- DMX_TS_PES_AUDIO2,101101+ DMX_TS_PES_AUDIO2,102102 DMX_TS_PES_VIDEO2,103103 DMX_TS_PES_TELETEXT2,104104 DMX_TS_PES_SUBTITLE2,105105 DMX_TS_PES_PCR2,106106107107- DMX_TS_PES_AUDIO3,107107+ DMX_TS_PES_AUDIO3,108108 DMX_TS_PES_VIDEO3,109109 DMX_TS_PES_TELETEXT3,110110 DMX_TS_PES_SUBTITLE3,···121121122122123123struct dmx_ts_feed {124124- int is_filtering; /* Set to non-zero when filtering in progress */125125- struct dmx_demux *parent; /* Back-pointer */126126- void *priv; /* Pointer to private data of the API client */127127- int (*set) (struct dmx_ts_feed *feed,124124+ int is_filtering; /* Set to non-zero when filtering in progress */125125+ struct dmx_demux *parent; /* Back-pointer */126126+ void *priv; /* Pointer to private data of the API client */127127+ int (*set) (struct dmx_ts_feed *feed,128128 u16 pid,129129 int type,130130 enum dmx_ts_pes pes_type,131131 size_t circular_buffer_size,132132 struct timespec timeout);133133- int (*start_filtering) (struct dmx_ts_feed* feed);134134- int (*stop_filtering) (struct dmx_ts_feed* feed);133133+ int (*start_filtering) (struct dmx_ts_feed* feed);134134+ int (*stop_filtering) (struct dmx_ts_feed* feed);135135};136136137137/*--------------------------------------------------------------------------*/···139139/*--------------------------------------------------------------------------*/140140141141struct dmx_section_filter {142142- u8 filter_value [DMX_MAX_FILTER_SIZE];143143- u8 filter_mask [DMX_MAX_FILTER_SIZE];144144- u8 filter_mode [DMX_MAX_FILTER_SIZE];145145- struct dmx_section_feed* parent; /* Back-pointer */146146- void* priv; /* Pointer to private data of the API client */142142+ u8 filter_value [DMX_MAX_FILTER_SIZE];143143+ u8 filter_mask [DMX_MAX_FILTER_SIZE];144144+ u8 filter_mode [DMX_MAX_FILTER_SIZE];145145+ struct dmx_section_feed* parent; /* Back-pointer */146146+ void* priv; /* Pointer to private data of the API client */147147};148148149149struct dmx_section_feed {150150- int is_filtering; /* Set to non-zero when filtering in progress */151151- struct dmx_demux* parent; /* Back-pointer */152152- void* priv; /* Pointer to private data of the API client */150150+ int is_filtering; /* Set to non-zero when filtering in progress */151151+ struct dmx_demux* parent; /* Back-pointer */152152+ void* priv; /* Pointer to private data of the API client */153153154154- int check_crc;154154+ int check_crc;155155 u32 crc_val;156156157157- u8 *secbuf;158158- u8 secbuf_base[DMX_MAX_SECFEED_SIZE];159159- u16 secbufp, seclen, tsfeedp;157157+ u8 *secbuf;158158+ u8 secbuf_base[DMX_MAX_SECFEED_SIZE];159159+ u16 secbufp, seclen, tsfeedp;160160161161- int (*set) (struct dmx_section_feed* feed,161161+ int (*set) (struct dmx_section_feed* feed,162162 u16 pid,163163 size_t circular_buffer_size,164164 int check_crc);165165- int (*allocate_filter) (struct dmx_section_feed* feed,165165+ int (*allocate_filter) (struct dmx_section_feed* feed,166166 struct dmx_section_filter** filter);167167- int (*release_filter) (struct dmx_section_feed* feed,167167+ int (*release_filter) (struct dmx_section_feed* feed,168168 struct dmx_section_filter* filter);169169- int (*start_filtering) (struct dmx_section_feed* feed);170170- int (*stop_filtering) (struct dmx_section_feed* feed);169169+ int (*start_filtering) (struct dmx_section_feed* feed);170170+ int (*stop_filtering) (struct dmx_section_feed* feed);171171};172172173173/*--------------------------------------------------------------------------*/···205205};206206207207struct dmx_frontend {208208- struct list_head connectivity_list; /* List of front-ends that can208208+ struct list_head connectivity_list; /* List of front-ends that can209209 be connected to a particular210210 demux */211211- enum dmx_frontend_source source;211211+ enum dmx_frontend_source source;212212};213213214214/*--------------------------------------------------------------------------*/···240240#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list)241241242242struct dmx_demux {243243- u32 capabilities; /* Bitfield of capability flags */244244- struct dmx_frontend* frontend; /* Front-end connected to the demux */245245- void* priv; /* Pointer to private data of the API client */246246- int (*open) (struct dmx_demux* demux);247247- int (*close) (struct dmx_demux* demux);248248- int (*write) (struct dmx_demux* demux, const char* buf, size_t count);249249- int (*allocate_ts_feed) (struct dmx_demux* demux,243243+ u32 capabilities; /* Bitfield of capability flags */244244+ struct dmx_frontend* frontend; /* Front-end connected to the demux */245245+ void* priv; /* Pointer to private data of the API client */246246+ int (*open) (struct dmx_demux* demux);247247+ int (*close) (struct dmx_demux* demux);248248+ int (*write) (struct dmx_demux* demux, const char* buf, size_t count);249249+ int (*allocate_ts_feed) (struct dmx_demux* demux,250250 struct dmx_ts_feed** feed,251251 dmx_ts_cb callback);252252- int (*release_ts_feed) (struct dmx_demux* demux,252252+ int (*release_ts_feed) (struct dmx_demux* demux,253253 struct dmx_ts_feed* feed);254254- int (*allocate_section_feed) (struct dmx_demux* demux,254254+ int (*allocate_section_feed) (struct dmx_demux* demux,255255 struct dmx_section_feed** feed,256256 dmx_section_cb callback);257257- int (*release_section_feed) (struct dmx_demux* demux,257257+ int (*release_section_feed) (struct dmx_demux* demux,258258 struct dmx_section_feed* feed);259259- int (*add_frontend) (struct dmx_demux* demux,259259+ int (*add_frontend) (struct dmx_demux* demux,260260 struct dmx_frontend* frontend);261261- int (*remove_frontend) (struct dmx_demux* demux,261261+ int (*remove_frontend) (struct dmx_demux* demux,262262 struct dmx_frontend* frontend);263263- struct list_head* (*get_frontends) (struct dmx_demux* demux);264264- int (*connect_frontend) (struct dmx_demux* demux,263263+ struct list_head* (*get_frontends) (struct dmx_demux* demux);264264+ int (*connect_frontend) (struct dmx_demux* demux,265265 struct dmx_frontend* frontend);266266- int (*disconnect_frontend) (struct dmx_demux* demux);266266+ int (*disconnect_frontend) (struct dmx_demux* demux);267267268268- int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids);268268+ int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids);269269270270 int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps);271271272272 int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src);273273274274- int (*get_stc) (struct dmx_demux* demux, unsigned int num,274274+ int (*get_stc) (struct dmx_demux* demux, unsigned int num,275275 u64 *stc, unsigned int *base);276276};277277
+1-1
drivers/media/dvb/dvb-core/dmxdev.c
···947947948948 case DMX_GET_STC:949949 if (!dmxdev->demux->get_stc) {950950- ret=-EINVAL;950950+ ret=-EINVAL;951951 break;952952 }953953 ret = dmxdev->demux->get_stc(dmxdev->demux,
+32-32
drivers/media/dvb/dvb-core/dmxdev.h
···5353};54545555struct dmxdev_buffer {5656- u8 *data;5757- int size;5858- int pread;5959- int pwrite;5656+ u8 *data;5757+ int size;5858+ int pread;5959+ int pwrite;6060 wait_queue_head_t queue;6161- int error;6161+ int error;6262};63636464struct dmxdev_filter {6565 struct dvb_device *dvbdev;66666767- union {6868- struct dmx_section_filter *sec;6767+ union {6868+ struct dmx_section_filter *sec;6969 } filter;70707171- union {7272- struct dmx_ts_feed *ts;7373- struct dmx_section_feed *sec;7171+ union {7272+ struct dmx_ts_feed *ts;7373+ struct dmx_section_feed *sec;7474 } feed;75757676- union {7777- struct dmx_sct_filter_params sec;7878- struct dmx_pes_filter_params pes;7676+ union {7777+ struct dmx_sct_filter_params sec;7878+ struct dmx_pes_filter_params pes;7979 } params;80808181- int type;8282- enum dmxdev_state state;8383- struct dmxdev *dev;8484- struct dmxdev_buffer buffer;8181+ int type;8282+ enum dmxdev_state state;8383+ struct dmxdev *dev;8484+ struct dmxdev_buffer buffer;85858686 struct semaphore mutex;87878888- /* only for sections */8989- struct timer_list timer;9090- int todo;9191- u8 secheader[3];8888+ /* only for sections */8989+ struct timer_list timer;9090+ int todo;9191+ u8 secheader[3];92929393- u16 pid;9393+ u16 pid;9494};959596969797struct dmxdev_dvr {9898- int state;9999- struct dmxdev *dev;100100- struct dmxdev_buffer buffer;9898+ int state;9999+ struct dmxdev *dev;100100+ struct dmxdev_buffer buffer;101101};102102103103···105105 struct dvb_device *dvbdev;106106 struct dvb_device *dvr_dvbdev;107107108108- struct dmxdev_filter *filter;109109- struct dmxdev_dvr *dvr;110110- struct dmx_demux *demux;108108+ struct dmxdev_filter *filter;109109+ struct dmxdev_dvr *dvr;110110+ struct dmx_demux *demux;111111112112- int filternum;113113- int capabilities;112112+ int filternum;113113+ int capabilities;114114#define DMXDEV_CAP_DUPLEX 1115115- struct dmx_frontend *dvr_orig_fe;115115+ struct dmx_frontend *dvr_orig_fe;116116117117- struct dmxdev_buffer dvr_buffer;117117+ struct dmxdev_buffer dvr_buffer;118118#define DVR_BUFFER_SIZE (10*188*1024)119119120120 struct semaphore mutex;
+1-1
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
···498498 /* process the CFTABLE_ENTRY tuples, and any after those */499499 while ((!end_chain) && (address < 0x1000)) {500500 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType,501501- &tupleLength, tuple)) < 0)501501+ &tupleLength, tuple)) < 0)502502 return status;503503 switch (tupleType) {504504 case 0x1B: // CISTPL_CFTABLE_ENTRY
···4141#include "dvbdev.h"42424343struct dvb_frontend_tune_settings {4444- int min_delay_ms;4545- int step_size;4646- int max_drift;4747- struct dvb_frontend_parameters parameters;4444+ int min_delay_ms;4545+ int step_size;4646+ int max_drift;4747+ struct dvb_frontend_parameters parameters;4848};49495050struct dvb_frontend;
···3131#include <linux/wait.h>32323333struct dvb_ringbuffer {3434- u8 *data;3535- ssize_t size;3636- ssize_t pread;3737- ssize_t pwrite;3434+ u8 *data;3535+ ssize_t size;3636+ ssize_t pread;3737+ ssize_t pwrite;38383939- wait_queue_head_t queue;4040- spinlock_t lock;3939+ wait_queue_head_t queue;4040+ spinlock_t lock;4141};42424343#define DVB_RINGBUFFER_PKTHDRSIZE 3···106106** returns number of bytes transferred or -EFAULT107107*/108108extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,109109- size_t len, int usermem);109109+ size_t len, int usermem);110110111111112112/* write routines & macros */···121121** returns number of bytes transferred or -EFAULT122122*/123123extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,124124- size_t len);124124+ size_t len);125125126126127127/**···133133 * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.134134 */135135extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,136136- size_t len);136136+ size_t len);137137138138/**139139 * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this···149149 * returns Number of bytes read, or -EFAULT.150150 */151151extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,152152- int offset, u8* buf, size_t len, int usermem);152152+ int offset, u8* buf, size_t len, int usermem);153153154154/**155155 * Dispose of a packet in the ring buffer.
+66-66
drivers/media/dvb/dvb-core/dvbdev.c
···4747static DECLARE_MUTEX(dvbdev_register_lock);48484949static const char * const dnames[] = {5050- "video", "audio", "sec", "frontend", "demux", "dvr", "ca",5050+ "video", "audio", "sec", "frontend", "demux", "dvr", "ca",5151 "net", "osd"5252};5353···90909191 file->private_data = dvbdev;9292 old_fops = file->f_op;9393- file->f_op = fops_get(dvbdev->fops);9494- if(file->f_op->open)9595- err = file->f_op->open(inode,file);9696- if (err) {9797- fops_put(file->f_op);9898- file->f_op = fops_get(old_fops);9999- }100100- fops_put(old_fops);101101- return err;9393+ file->f_op = fops_get(dvbdev->fops);9494+ if(file->f_op->open)9595+ err = file->f_op->open(inode,file);9696+ if (err) {9797+ fops_put(file->f_op);9898+ file->f_op = fops_get(old_fops);9999+ }100100+ fops_put(old_fops);101101+ return err;102102 }103103 return -ENODEV;104104}···117117118118int dvb_generic_open(struct inode *inode, struct file *file)119119{120120- struct dvb_device *dvbdev = file->private_data;120120+ struct dvb_device *dvbdev = file->private_data;121121122122- if (!dvbdev)123123- return -ENODEV;122122+ if (!dvbdev)123123+ return -ENODEV;124124125125 if (!dvbdev->users)126126- return -EBUSY;126126+ return -EBUSY;127127128128 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {129129- if (!dvbdev->readers)130130- return -EBUSY;129129+ if (!dvbdev->readers)130130+ return -EBUSY;131131 dvbdev->readers--;132132 } else {133133- if (!dvbdev->writers)134134- return -EBUSY;133133+ if (!dvbdev->writers)134134+ return -EBUSY;135135 dvbdev->writers--;136136 }137137···143143144144int dvb_generic_release(struct inode *inode, struct file *file)145145{146146- struct dvb_device *dvbdev = file->private_data;146146+ struct dvb_device *dvbdev = file->private_data;147147148148 if (!dvbdev)149149- return -ENODEV;149149+ return -ENODEV;150150151151 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {152152 dvbdev->readers++;···163163int dvb_generic_ioctl(struct inode *inode, struct file *file,164164 unsigned int cmd, unsigned long arg)165165{166166- struct dvb_device *dvbdev = file->private_data;166166+ struct dvb_device *dvbdev = file->private_data;167167168168- if (!dvbdev)169169- return -ENODEV;168168+ if (!dvbdev)169169+ return -ENODEV;170170171171 if (!dvbdev->kernel_ioctl)172172 return -EINVAL;···334334 to the v4l "videodev.o" module, which is unnecessary for some335335 cards (ie. the budget dvb-cards don't need the v4l module...) */336336int dvb_usercopy(struct inode *inode, struct file *file,337337- unsigned int cmd, unsigned long arg,337337+ unsigned int cmd, unsigned long arg,338338 int (*func)(struct inode *inode, struct file *file,339339 unsigned int cmd, void *arg))340340{341341- char sbuf[128];342342- void *mbuf = NULL;343343- void *parg = NULL;344344- int err = -EINVAL;341341+ char sbuf[128];342342+ void *mbuf = NULL;343343+ void *parg = NULL;344344+ int err = -EINVAL;345345346346- /* Copy arguments into temp kernel buffer */347347- switch (_IOC_DIR(cmd)) {348348- case _IOC_NONE:346346+ /* Copy arguments into temp kernel buffer */347347+ switch (_IOC_DIR(cmd)) {348348+ case _IOC_NONE:349349 /*350350 * For this command, the pointer is actually an integer351351 * argument.352352 */353353 parg = (void *) arg;354354 break;355355- case _IOC_READ: /* some v4l ioctls are marked wrong ... */356356- case _IOC_WRITE:357357- case (_IOC_WRITE | _IOC_READ):358358- if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {359359- parg = sbuf;360360- } else {361361- /* too big to allocate from stack */362362- mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);363363- if (NULL == mbuf)364364- return -ENOMEM;365365- parg = mbuf;366366- }355355+ case _IOC_READ: /* some v4l ioctls are marked wrong ... */356356+ case _IOC_WRITE:357357+ case (_IOC_WRITE | _IOC_READ):358358+ if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {359359+ parg = sbuf;360360+ } else {361361+ /* too big to allocate from stack */362362+ mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);363363+ if (NULL == mbuf)364364+ return -ENOMEM;365365+ parg = mbuf;366366+ }367367368368- err = -EFAULT;369369- if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))370370- goto out;371371- break;372372- }368368+ err = -EFAULT;369369+ if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))370370+ goto out;371371+ break;372372+ }373373374374- /* call driver */375375- if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)376376- err = -EINVAL;374374+ /* call driver */375375+ if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)376376+ err = -EINVAL;377377378378- if (err < 0)379379- goto out;378378+ if (err < 0)379379+ goto out;380380381381- /* Copy results into user buffer */382382- switch (_IOC_DIR(cmd))383383- {384384- case _IOC_READ:385385- case (_IOC_WRITE | _IOC_READ):386386- if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))387387- err = -EFAULT;388388- break;389389- }381381+ /* Copy results into user buffer */382382+ switch (_IOC_DIR(cmd))383383+ {384384+ case _IOC_READ:385385+ case (_IOC_WRITE | _IOC_READ):386386+ if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))387387+ err = -EFAULT;388388+ break;389389+ }390390391391out:392392- kfree(mbuf);393393- return err;392392+ kfree(mbuf);393393+ return err;394394}395395396396static int __init init_dvbdev(void)···427427428428static void __exit exit_dvbdev(void)429429{430430- devfs_remove("dvb");430430+ devfs_remove("dvb");431431 class_destroy(dvb_class);432432 cdev_del(&dvb_device_cdev);433433- unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);433433+ unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);434434}435435436436module_init(init_dvbdev);
+3-3
drivers/media/dvb/dvb-core/dvbdev.h
···6868 int writers;6969 int users;70707171- /* don't really need those !? -- FIXME: use video_usercopy */7272- int (*kernel_ioctl)(struct inode *inode, struct file *file,7171+ /* don't really need those !? -- FIXME: use video_usercopy */7272+ int (*kernel_ioctl)(struct inode *inode, struct file *file,7373 unsigned int cmd, void *arg);74747575 void *priv;···9797generic_usercopy() someday... */98989999extern int dvb_usercopy(struct inode *inode, struct file *file,100100- unsigned int cmd, unsigned long arg,100100+ unsigned int cmd, unsigned long arg,101101 int (*func)(struct inode *inode, struct file *file,102102 unsigned int cmd, void *arg));103103
···5555 } while (0)56565757static struct {u8 reg; u8 data;} cx24110_regdata[]=5858- /* Comments beginning with @ denote this value should5959- be the default */6060- {{0x09,0x01}, /* SoftResetAll */6161- {0x09,0x00}, /* release reset */6262- {0x01,0xe8}, /* MSB of code rate 27.5MS/s */6363- {0x02,0x17}, /* middle byte " */6464- {0x03,0x29}, /* LSB " */6565- {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */6666- {0x06,0xa5}, /* @ PLL 60MHz */6767- {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */6868- {0x0a,0x00}, /* @ partial chip disables, do not set */6969- {0x0b,0x01}, /* set output clock in gapped mode, start signal low7070- active for first byte */7171- {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */7272- {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */7373- {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 17474- to avoid starting the BER counter. Reset the7575- CRC test bit. Finite counting selected */7676- {0x15,0xff}, /* @ size of the limited time window for RS BER7777- estimation. It is <value>*256 RS blocks, this7878- gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */7979- {0x16,0x00}, /* @ enable all RS output ports */8080- {0x17,0x04}, /* @ time window allowed for the RS to sync */8181- {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned8282- for automatically */8383- /* leave the current code rate and normalization8484- registers as they are after reset... */8585- {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting8686- only once */8787- {0x23,0x18}, /* @ size of the limited time window for Viterbi BER8888- estimation. It is <value>*65536 channel bits, i.e.8989- approx. 38ms at 27.5MS/s, rate 3/4 */9090- {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */9191- /* leave front-end AGC parameters at default values */9292- /* leave decimation AGC parameters at default values */9393- {0x35,0x40}, /* disable all interrupts. They are not connected anyway */9494- {0x36,0xff}, /* clear all interrupt pending flags */9595- {0x37,0x00}, /* @ fully enable AutoAcqq state machine */9696- {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */9797- /* leave the equalizer parameters on their default values */9898- /* leave the final AGC parameters on their default values */9999- {0x41,0x00}, /* @ MSB of front-end derotator frequency */100100- {0x42,0x00}, /* @ middle bytes " */101101- {0x43,0x00}, /* @ LSB " */102102- /* leave the carrier tracking loop parameters on default */103103- /* leave the bit timing loop parameters at gefault */104104- {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */105105- /* the cx24108 data sheet for symbol rates above 15MS/s */106106- {0x57,0x00}, /* @ Filter sigma delta enabled, positive */107107- {0x61,0x95}, /* GPIO pins 1-4 have special function */108108- {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */109109- {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */110110- {0x64,0x20}, /* GPIO 6 is input, all others are outputs */111111- {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */112112- {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */113113- {0x73,0x00}, /* @ disable several demod bypasses */114114- {0x74,0x00}, /* @ " */115115- {0x75,0x00} /* @ " */116116- /* the remaining registers are for SEC */5858+ /* Comments beginning with @ denote this value should5959+ be the default */6060+ {{0x09,0x01}, /* SoftResetAll */6161+ {0x09,0x00}, /* release reset */6262+ {0x01,0xe8}, /* MSB of code rate 27.5MS/s */6363+ {0x02,0x17}, /* middle byte " */6464+ {0x03,0x29}, /* LSB " */6565+ {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */6666+ {0x06,0xa5}, /* @ PLL 60MHz */6767+ {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */6868+ {0x0a,0x00}, /* @ partial chip disables, do not set */6969+ {0x0b,0x01}, /* set output clock in gapped mode, start signal low7070+ active for first byte */7171+ {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */7272+ {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */7373+ {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 17474+ to avoid starting the BER counter. Reset the7575+ CRC test bit. Finite counting selected */7676+ {0x15,0xff}, /* @ size of the limited time window for RS BER7777+ estimation. It is <value>*256 RS blocks, this7878+ gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */7979+ {0x16,0x00}, /* @ enable all RS output ports */8080+ {0x17,0x04}, /* @ time window allowed for the RS to sync */8181+ {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned8282+ for automatically */8383+ /* leave the current code rate and normalization8484+ registers as they are after reset... */8585+ {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting8686+ only once */8787+ {0x23,0x18}, /* @ size of the limited time window for Viterbi BER8888+ estimation. It is <value>*65536 channel bits, i.e.8989+ approx. 38ms at 27.5MS/s, rate 3/4 */9090+ {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */9191+ /* leave front-end AGC parameters at default values */9292+ /* leave decimation AGC parameters at default values */9393+ {0x35,0x40}, /* disable all interrupts. They are not connected anyway */9494+ {0x36,0xff}, /* clear all interrupt pending flags */9595+ {0x37,0x00}, /* @ fully enable AutoAcqq state machine */9696+ {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */9797+ /* leave the equalizer parameters on their default values */9898+ /* leave the final AGC parameters on their default values */9999+ {0x41,0x00}, /* @ MSB of front-end derotator frequency */100100+ {0x42,0x00}, /* @ middle bytes " */101101+ {0x43,0x00}, /* @ LSB " */102102+ /* leave the carrier tracking loop parameters on default */103103+ /* leave the bit timing loop parameters at gefault */104104+ {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */105105+ /* the cx24108 data sheet for symbol rates above 15MS/s */106106+ {0x57,0x00}, /* @ Filter sigma delta enabled, positive */107107+ {0x61,0x95}, /* GPIO pins 1-4 have special function */108108+ {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */109109+ {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */110110+ {0x64,0x20}, /* GPIO 6 is input, all others are outputs */111111+ {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */112112+ {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */113113+ {0x73,0x00}, /* @ disable several demod bypasses */114114+ {0x74,0x00}, /* @ " */115115+ {0x75,0x00} /* @ " */116116+ /* the remaining registers are for SEC */117117 };118118119119120120static int cx24110_writereg (struct cx24110_state* state, int reg, int data)121121{122122- u8 buf [] = { reg, data };122122+ u8 buf [] = { reg, data };123123 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };124124 int err;125125126126- if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {126126+ if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {127127 dprintk ("%s: writereg error (err == %i, reg == 0x%02x,"128128 " data == 0x%02x)\n", __FUNCTION__, err, reg, data);129129 return -EREMOTEIO;130130 }131131132132- return 0;132132+ return 0;133133}134134135135static int cx24110_readreg (struct cx24110_state* state, u8 reg)···153153154154 switch (inversion) {155155 case INVERSION_OFF:156156- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);157157- /* AcqSpectrInvDis on. No idea why someone should want this */158158- cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7);159159- /* Initial value 0 at start of acq */160160- cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef);161161- /* current value 0 */162162- /* The cx24110 manual tells us this reg is read-only.163163- But what the heck... set it ayways */164164- break;156156+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);157157+ /* AcqSpectrInvDis on. No idea why someone should want this */158158+ cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7);159159+ /* Initial value 0 at start of acq */160160+ cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef);161161+ /* current value 0 */162162+ /* The cx24110 manual tells us this reg is read-only.163163+ But what the heck... set it ayways */164164+ break;165165 case INVERSION_ON:166166- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);167167- /* AcqSpectrInvDis on. No idea why someone should want this */168168- cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08);169169- /* Initial value 1 at start of acq */170170- cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10);171171- /* current value 1 */172172- break;166166+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);167167+ /* AcqSpectrInvDis on. No idea why someone should want this */168168+ cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08);169169+ /* Initial value 1 at start of acq */170170+ cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10);171171+ /* current value 1 */172172+ break;173173 case INVERSION_AUTO:174174- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe);175175- /* AcqSpectrInvDis off. Leave initial & current states as is */176176- break;174174+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe);175175+ /* AcqSpectrInvDis off. Leave initial & current states as is */176176+ break;177177 default:178178 return -EINVAL;179179 }···185185{186186/* fixme (low): error handling */187187188188- static const int rate[]={-1,1,2,3,5,7,-1};189189- static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1};190190- static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1};188188+ static const int rate[]={-1,1,2,3,5,7,-1};189189+ static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1};190190+ static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1};191191192192- /* Well, the AutoAcq engine of the cx24106 and 24110 automatically193193- searches all enabled viterbi rates, and can handle non-standard194194- rates as well. */192192+ /* Well, the AutoAcq engine of the cx24106 and 24110 automatically193193+ searches all enabled viterbi rates, and can handle non-standard194194+ rates as well. */195195196196- if (fec>FEC_AUTO)197197- fec=FEC_AUTO;196196+ if (fec>FEC_AUTO)197197+ fec=FEC_AUTO;198198199199- if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */199199+ if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */200200 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xdf);201201 /* clear AcqVitDis bit */202202 cx24110_writereg(state,0x18,0xae);···208208 cx24110_writereg(state,0x1a,0x05); cx24110_writereg(state,0x1b,0x06);209209 /* set the puncture registers for code rate 3/4 */210210 return 0;211211- } else {211211+ } else {212212 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x20);213213 /* set AcqVitDis bit */214214 if(rate[fec]>0) {···219219 cx24110_writereg(state,0x1a,g1[fec]);220220 cx24110_writereg(state,0x1b,g2[fec]);221221 /* not sure if this is the right way: I always used AutoAcq mode */222222- } else222222+ } else223223 return -EOPNOTSUPP;224224/* fixme (low): which is the correct return code? */225225- };225225+ };226226 return 0;227227}228228···245245static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)246246{247247/* fixme (low): add error handling */248248- u32 ratio;249249- u32 tmp, fclk, BDRI;248248+ u32 ratio;249249+ u32 tmp, fclk, BDRI;250250251251- static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};252252- int i;251251+ static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};252252+ int i;253253254254dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate);255255- if (srate>90999000UL/2)256256- srate=90999000UL/2;257257- if (srate<500000)258258- srate=500000;255255+ if (srate>90999000UL/2)256256+ srate=90999000UL/2;257257+ if (srate<500000)258258+ srate=500000;259259260260- for(i=0;(i<sizeof(bands)/sizeof(bands[0]))&&(srate>bands[i]);i++)260260+ for(i=0;(i<sizeof(bands)/sizeof(bands[0]))&&(srate>bands[i]);i++)261261 ;262262- /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz,263263- and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult,264264- R06[3:0] PLLphaseDetGain */265265- tmp=cx24110_readreg(state,0x07)&0xfc;266266- if(srate<90999000UL/4) { /* sample rate 45MHz*/262262+ /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz,263263+ and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult,264264+ R06[3:0] PLLphaseDetGain */265265+ tmp=cx24110_readreg(state,0x07)&0xfc;266266+ if(srate<90999000UL/4) { /* sample rate 45MHz*/267267 cx24110_writereg(state,0x07,tmp);268268 cx24110_writereg(state,0x06,0x78);269269 fclk=90999000UL/2;270270- } else if(srate<60666000UL/2) { /* sample rate 60MHz */270270+ } else if(srate<60666000UL/2) { /* sample rate 60MHz */271271 cx24110_writereg(state,0x07,tmp|0x1);272272 cx24110_writereg(state,0x06,0xa5);273273 fclk=60666000UL;274274- } else if(srate<80888000UL/2) { /* sample rate 80MHz */274274+ } else if(srate<80888000UL/2) { /* sample rate 80MHz */275275 cx24110_writereg(state,0x07,tmp|0x2);276276 cx24110_writereg(state,0x06,0x87);277277 fclk=80888000UL;278278- } else { /* sample rate 90MHz */278278+ } else { /* sample rate 90MHz */279279 cx24110_writereg(state,0x07,tmp|0x3);280280 cx24110_writereg(state,0x06,0x78);281281 fclk=90999000UL;282282- };283283- dprintk("cx24110 debug: fclk %d Hz\n",fclk);284284- /* we need to divide two integers with approx. 27 bits in 32 bit285285- arithmetic giving a 25 bit result */286286- /* the maximum dividend is 90999000/2, 0x02b6446c, this number is287287- also the most complex divisor. Hence, the dividend has,288288- assuming 32bit unsigned arithmetic, 6 clear bits on top, the289289- divisor 2 unused bits at the bottom. Also, the quotient is290290- always less than 1/2. Borrowed from VES1893.c, of course */282282+ };283283+ dprintk("cx24110 debug: fclk %d Hz\n",fclk);284284+ /* we need to divide two integers with approx. 27 bits in 32 bit285285+ arithmetic giving a 25 bit result */286286+ /* the maximum dividend is 90999000/2, 0x02b6446c, this number is287287+ also the most complex divisor. Hence, the dividend has,288288+ assuming 32bit unsigned arithmetic, 6 clear bits on top, the289289+ divisor 2 unused bits at the bottom. Also, the quotient is290290+ always less than 1/2. Borrowed from VES1893.c, of course */291291292292- tmp=srate<<6;293293- BDRI=fclk>>2;294294- ratio=(tmp/BDRI);292292+ tmp=srate<<6;293293+ BDRI=fclk>>2;294294+ ratio=(tmp/BDRI);295295296296- tmp=(tmp%BDRI)<<8;297297- ratio=(ratio<<8)+(tmp/BDRI);296296+ tmp=(tmp%BDRI)<<8;297297+ ratio=(ratio<<8)+(tmp/BDRI);298298299299- tmp=(tmp%BDRI)<<8;300300- ratio=(ratio<<8)+(tmp/BDRI);299299+ tmp=(tmp%BDRI)<<8;300300+ ratio=(ratio<<8)+(tmp/BDRI);301301302302- tmp=(tmp%BDRI)<<1;303303- ratio=(ratio<<1)+(tmp/BDRI);302302+ tmp=(tmp%BDRI)<<1;303303+ ratio=(ratio<<1)+(tmp/BDRI);304304305305- dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]);306306- dprintk("fclk = %d\n", fclk);307307- dprintk("ratio= %08x\n", ratio);305305+ dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]);306306+ dprintk("fclk = %d\n", fclk);307307+ dprintk("ratio= %08x\n", ratio);308308309309- cx24110_writereg(state, 0x1, (ratio>>16)&0xff);310310- cx24110_writereg(state, 0x2, (ratio>>8)&0xff);311311- cx24110_writereg(state, 0x3, (ratio)&0xff);309309+ cx24110_writereg(state, 0x1, (ratio>>16)&0xff);310310+ cx24110_writereg(state, 0x2, (ratio>>8)&0xff);311311+ cx24110_writereg(state, 0x3, (ratio)&0xff);312312313313- return 0;313313+ return 0;314314315315}316316···324324325325 dprintk("cx24110 debug: cx24108_write(%8.8x)\n",data);326326327327- cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */328328- cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */327327+ cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */328328+ cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */329329330330- /* if the auto tuner writer is still busy, clear it out */331331- while (cx24110_readreg(state,0x6d)&0x80)330330+ /* if the auto tuner writer is still busy, clear it out */331331+ while (cx24110_readreg(state,0x6d)&0x80)332332 cx24110_writereg(state,0x72,0);333333334334- /* write the topmost 8 bits */335335- cx24110_writereg(state,0x72,(data>>24)&0xff);334334+ /* write the topmost 8 bits */335335+ cx24110_writereg(state,0x72,(data>>24)&0xff);336336337337- /* wait for the send to be completed */338338- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)337337+ /* wait for the send to be completed */338338+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)339339 ;340340341341- /* send another 8 bytes */342342- cx24110_writereg(state,0x72,(data>>16)&0xff);343343- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)341341+ /* send another 8 bytes */342342+ cx24110_writereg(state,0x72,(data>>16)&0xff);343343+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)344344 ;345345346346- /* and the topmost 5 bits of this byte */347347- cx24110_writereg(state,0x72,(data>>8)&0xff);348348- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)346346+ /* and the topmost 5 bits of this byte */347347+ cx24110_writereg(state,0x72,(data>>8)&0xff);348348+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)349349 ;350350351351- /* now strobe the enable line once */352352- cx24110_writereg(state,0x6d,0x32);353353- cx24110_writereg(state,0x6d,0x30);351351+ /* now strobe the enable line once */352352+ cx24110_writereg(state,0x6d,0x32);353353+ cx24110_writereg(state,0x6d,0x30);354354355355- return 0;355355+ return 0;356356}357357358358static int cx24110_initfe(struct dvb_frontend* fe)359359{360360 struct cx24110_state *state = fe->demodulator_priv;361361/* fixme (low): error handling */362362- int i;362362+ int i;363363364364 dprintk("%s: init chip\n", __FUNCTION__);365365366366- for(i=0;i<sizeof(cx24110_regdata)/sizeof(cx24110_regdata[0]);i++) {366366+ for(i=0;i<sizeof(cx24110_regdata)/sizeof(cx24110_regdata[0]);i++) {367367 cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data);368368- };368368+ };369369370370 if (state->config->pll_init) state->config->pll_init(fe);371371
+13-13
drivers/media/dvb/frontends/l64781.c
···22 driver for LSI L64781 COFDM demodulator3344 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH55- Marko Kohtala <marko.kohtala@luukku.com>55+ Marko Kohtala <marko.kohtala@luukku.com>6677 This program is free software; you can redistribute it and/or modify88 it under the terms of the GNU General Public License as published by···433433{434434 struct l64781_state* state = fe->demodulator_priv;435435436436- reset_and_configure (state);436436+ reset_and_configure (state);437437438438 /* Power up */439439 l64781_writereg (state, 0x3e, 0xa5);···456456 l64781_writereg (state, 0x0d, 0x8c);457457458458 /* With ppm=8000, it seems the DTR_SENSITIVITY will result in459459- value of 2 with all possible bandwidths and guard460460- intervals, which is the initial value anyway. */461461- /*l64781_writereg (state, 0x19, 0x92);*/459459+ value of 2 with all possible bandwidths and guard460460+ intervals, which is the initial value anyway. */461461+ /*l64781_writereg (state, 0x19, 0x92);*/462462463463 /* Everything is two's complement, soft bit and CSI_OUT too */464464 l64781_writereg (state, 0x1e, 0x09);···477477static int l64781_get_tune_settings(struct dvb_frontend* fe,478478 struct dvb_frontend_tune_settings* fesettings)479479{480480- fesettings->min_delay_ms = 4000;481481- fesettings->step_size = 0;482482- fesettings->max_drift = 0;483483- return 0;480480+ fesettings->min_delay_ms = 4000;481481+ fesettings->step_size = 0;482482+ fesettings->max_drift = 0;483483+ return 0;484484}485485486486static void l64781_release(struct dvb_frontend* fe)···522522523523 /* The chip always responds to reads */524524 if (i2c_transfer(state->i2c, msg, 2) != 2) {525525- dprintk("No response to read on I2C bus\n");525525+ dprintk("No response to read on I2C bus\n");526526 goto error;527527 }528528···531531532532 /* Reading the POWER_DOWN register always returns 0 */533533 if (reg0x3e != 0) {534534- dprintk("Device doesn't look like L64781\n");534534+ dprintk("Device doesn't look like L64781\n");535535 goto error;536536 }537537···540540541541 /* Responds to all reads with 0 */542542 if (l64781_readreg(state, 0x1a) != 0) {543543- dprintk("Read 1 returned unexpcted value\n");543543+ dprintk("Read 1 returned unexpcted value\n");544544 goto error;545545 }546546···549549550550 /* Responds with register default value */551551 if (l64781_readreg(state, 0x1a) != 0xa1) {552552- dprintk("Read 2 returned unexpcted value\n");552552+ dprintk("Read 2 returned unexpcted value\n");553553 goto error;554554 }555555
+1-1
drivers/media/dvb/frontends/l64781.h
···22 driver for LSI L64781 COFDM demodulator3344 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH55- Marko Kohtala <marko.kohtala@luukku.com>55+ Marko Kohtala <marko.kohtala@luukku.com>6677 This program is free software; you can redistribute it and/or modify88 it under the terms of the GNU General Public License as published by
···527527 else528528 snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) );529529530530- /* the value reported back from the frontend will be FFFF=32db 0000=0db */530530+ /* the value reported back from the frontend will be FFFF=32db 0000=0db */531531532532 *snr = snrdb * (0xFFFF/32000);533533···646646 memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops));647647 state->initialised = 0;648648649649- /* Check the first 5 registers to ensure this a revision we can handle */649649+ /* Check the first 5 registers to ensure this a revision we can handle */650650651651 i2c_readbytes(state, 0x00, buf, 5);652652 if (buf[0] != 0x04) goto error; /* device id */···672672 .type = FE_ATSC,673673 .frequency_min = 54000000,674674 .frequency_max = 860000000,675675- /* stepsize is just a guess */675675+ /* stepsize is just a guess */676676 .frequency_stepsize = 166666,677677 .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |678678 FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
+2-2
drivers/media/dvb/frontends/nxt200x.c
···339339 switch (state->demod_chip) {340340 case NXT2004:341341 if (i2c_writebytes(state, state->config->pll_address, data, 4))342342- printk(KERN_WARNING "nxt200x: error writing to tuner\n");342342+ printk(KERN_WARNING "nxt200x: error writing to tuner\n");343343 /* wait until we have a lock */344344 while (count < 20) {345345 i2c_readbytes(state, state->config->pll_address, &buf, 1);···497497498498 /* calculate firmware CRC */499499 for (position = 0; position < fw->size; position++) {500500- crc = nxt200x_crc(crc, fw->data[position]);500500+ crc = nxt200x_crc(crc, fw->data[position]);501501 }502502503503 buf[0] = rambase >> 8;
···503503 rcvr_stat = rec_buf[1];504504 usK = (rcvr_stat & 0x10) ? 3 : 0;505505506506- /* The value reported back from the frontend will be FFFF=100% 0000=0% */506506+ /* The value reported back from the frontend will be FFFF=100% 0000=0% */507507 signal_strength = (((8952 - i20Log10(snr_equ) - usK*100)/3+5)*65535)/1000;508508 if (signal_strength > 0xffff)509509 *strength = 0xffff;
···95959696int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data)9797{9898- struct stv0299_state* state = fe->demodulator_priv;9898+ struct stv0299_state* state = fe->demodulator_priv;9999100100 return stv0299_writeregI(state, reg, data);101101}···220220221221static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate)222222{223223- struct stv0299_state* state = fe->demodulator_priv;223223+ struct stv0299_state* state = fe->demodulator_priv;224224 u64 big = srate;225225 u32 ratio;226226···271271static int stv0299_send_diseqc_msg (struct dvb_frontend* fe,272272 struct dvb_diseqc_master_cmd *m)273273{274274- struct stv0299_state* state = fe->demodulator_priv;274274+ struct stv0299_state* state = fe->demodulator_priv;275275 u8 val;276276 int i;277277···301301302302static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)303303{304304- struct stv0299_state* state = fe->demodulator_priv;304304+ struct stv0299_state* state = fe->demodulator_priv;305305 u8 val;306306307307 dprintk ("%s\n", __FUNCTION__);···328328329329static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)330330{331331- struct stv0299_state* state = fe->demodulator_priv;331331+ struct stv0299_state* state = fe->demodulator_priv;332332 u8 val;333333334334 if (stv0299_wait_diseqc_idle (state, 100) < 0)···350350351351static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage)352352{353353- struct stv0299_state* state = fe->demodulator_priv;353353+ struct stv0299_state* state = fe->demodulator_priv;354354 u8 reg0x08;355355 u8 reg0x0c;356356···442442443443static int stv0299_init (struct dvb_frontend* fe)444444{445445- struct stv0299_state* state = fe->demodulator_priv;445445+ struct stv0299_state* state = fe->demodulator_priv;446446 int i;447447448448 dprintk("stv0299: init chip\n");···461461462462static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status)463463{464464- struct stv0299_state* state = fe->demodulator_priv;464464+ struct stv0299_state* state = fe->demodulator_priv;465465466466 u8 signal = 0xff - stv0299_readreg (state, 0x18);467467 u8 sync = stv0299_readreg (state, 0x1b);···489489490490static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)491491{492492- struct stv0299_state* state = fe->demodulator_priv;492492+ struct stv0299_state* state = fe->demodulator_priv;493493494494 if (state->errmode != STATUS_BER) return 0;495495 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···499499500500static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength)501501{502502- struct stv0299_state* state = fe->demodulator_priv;502502+ struct stv0299_state* state = fe->demodulator_priv;503503504504 s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8)505505 | stv0299_readreg (state, 0x19));···516516517517static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr)518518{519519- struct stv0299_state* state = fe->demodulator_priv;519519+ struct stv0299_state* state = fe->demodulator_priv;520520521521 s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8)522522 | stv0299_readreg (state, 0x25));···528528529529static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)530530{531531- struct stv0299_state* state = fe->demodulator_priv;531531+ struct stv0299_state* state = fe->demodulator_priv;532532533533 if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;534534 else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···538538539539static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)540540{541541- struct stv0299_state* state = fe->demodulator_priv;541541+ struct stv0299_state* state = fe->demodulator_priv;542542 int invval = 0;543543544544 dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__);···571571572572static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)573573{574574- struct stv0299_state* state = fe->demodulator_priv;574574+ struct stv0299_state* state = fe->demodulator_priv;575575 s32 derot_freq;576576 int invval;577577···596596597597static int stv0299_sleep(struct dvb_frontend* fe)598598{599599- struct stv0299_state* state = fe->demodulator_priv;599599+ struct stv0299_state* state = fe->demodulator_priv;600600601601 stv0299_writeregI(state, 0x02, 0x80);602602 state->initialised = 0;···606606607607static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)608608{609609- struct stv0299_state* state = fe->demodulator_priv;609609+ struct stv0299_state* state = fe->demodulator_priv;610610611611 fesettings->min_delay_ms = state->config->min_delay_ms;612612 if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) {···658658659659 /* create dvb_frontend */660660 state->frontend.ops = &state->ops;661661- state->frontend.demodulator_priv = state;661661+ state->frontend.demodulator_priv = state;662662 return &state->frontend;663663664664error:···714714715715MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver");716716MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, "717717- "Andreas Oberritter, Andrew de Quincey, Kenneth Aafl�y");717717+ "Andreas Oberritter, Andrew de Quincey, Kenneth Aafl�y");718718MODULE_LICENSE("GPL");719719720720EXPORT_SYMBOL(stv0299_writereg);
+5-5
drivers/media/dvb/frontends/tda10021.c
···11/*22 TDA10021 - Single Chip Cable Channel Receiver driver module33- used on the the Siemens DVB-C cards33+ used on the the Siemens DVB-C cards4455 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>66 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>77- Support for TDA1002177+ Support for TDA100218899 This program is free software; you can redistribute it and/or modify1010 it under the terms of the GNU General Public License as published by···76767777static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data)7878{7979- u8 buf[] = { reg, data };7979+ u8 buf[] = { reg, data };8080 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };8181- int ret;8181+ int ret;82828383 ret = i2c_transfer (state->i2c, &msg, 1);8484 if (ret != 1)···9595 u8 b0 [] = { reg };9696 u8 b1 [] = { 0 };9797 struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },9898- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };9898+ { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };9999 int ret;100100101101 ret = i2c_transfer (state->i2c, msg, 2);
+2-2
drivers/media/dvb/frontends/tda10021.h
···11/*22 TDA10021 - Single Chip Cable Channel Receiver driver module33- used on the the Siemens DVB-C cards33+ used on the the Siemens DVB-C cards4455 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>66 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>77- Support for TDA1002177+ Support for TDA100218899 This program is free software; you can redistribute it and/or modify1010 it under the terms of the GNU General Public License as published by
+1-1
drivers/media/dvb/frontends/tda1004x.c
···475475 ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);476476 if (ret) {477477 printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");478478- return ret;478478+ return ret;479479 }480480 tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST481481 ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
···12031203 input_dev->keycode = rc_keys;1204120412051205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++)12061206- set_bit(rc_keys[i], input_dev->keybit);12061206+ set_bit(rc_keys[i], input_dev->keybit);1207120712081208 input_register_device(input_dev);12091209···15291529 usb_free_urb(dec->irq_urb);1530153015311531 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,15321532- dec->irq_buffer, dec->irq_dma_handle);15321532+ dec->irq_buffer, dec->irq_dma_handle);1533153315341534 if (dec->rc_input_dev) {15351535 input_unregister_device(dec->rc_input_dev);
+7-7
drivers/media/video/Kconfig
···188188189189 To compile this driver as a module, choose M here: the190190 module will be called zr36067.191191-191191+192192config VIDEO_ZORAN_BUZ193193 tristate "Iomega Buz support"194194 depends on VIDEO_ZORAN···204204205205config VIDEO_ZORAN_DC30206206 tristate "Pinnacle/Miro DC30(+) support"207207- depends on VIDEO_ZORAN208208- help207207+ depends on VIDEO_ZORAN208208+ help209209 Support for the Pinnacle/Miro DC30(+) MJPEG capture/playback210210 card. This also supports really old DC10 cards based on the211211 zr36050 MJPEG codec and zr36016 VFE.···260260 ---help---261261 This is a video4linux driver for the 'Multimedia eXtension Board'262262 TV card by Siemens-Nixdorf.263263-263263+264264 To compile this driver as a module, choose M here: the265265 module will be called mxb.266266···274274 for SAA7146 bases boards, so if you have some unsupported275275 saa7146 based, analog video card, chances are good that it276276 will work with this skeleton driver.277277-277277+278278 To compile this driver as a module, choose M here: the279279 module will be called dpc7146.280280···285285 ---help---286286 This is a video4linux driver for the Hexium HV-PCI6 and287287 Orion frame grabber cards by Hexium.288288-288288+289289 To compile this driver as a module, choose M here: the290290 module will be called hexium_orion.291291···297297 This is a video4linux driver for the Hexium Gemini frame298298 grabber card by Hexium. Please note that the Gemini Dual299299 card is *not* fully supported.300300-300300+301301 To compile this driver as a module, choose M here: the302302 module will be called hexium_gemini.303303
···68686969#define DRV_MODULE_NAME "tg3"7070#define PFX DRV_MODULE_NAME ": "7171-#define DRV_MODULE_VERSION "3.43"7272-#define DRV_MODULE_RELDATE "Oct 24, 2005"7171+#define DRV_MODULE_VERSION "3.44"7272+#define DRV_MODULE_RELDATE "Dec 6, 2005"73737474#define TG3_DEF_MAC_MODE 07575#define TG3_DEF_RX_MODE 0···35653565 if (!spin_trylock(&tp->tx_lock))35663566 return NETDEV_TX_LOCKED; 3567356735683568- /* This is a hard error, log it. */35693568 if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) {35703570- netif_stop_queue(dev);35693569+ if (!netif_queue_stopped(dev)) {35703570+ netif_stop_queue(dev);35713571+35723572+ /* This is a hard error, log it. */35733573+ printk(KERN_ERR PFX "%s: BUG! Tx Ring full when "35743574+ "queue awake!\n", dev->name);35753575+ }35713576 spin_unlock(&tp->tx_lock);35723572- printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",35733573- dev->name);35743577 return NETDEV_TX_BUSY;35753578 }35763579
+8-1
drivers/scsi/scsi_lib.c
···542542543543void scsi_next_command(struct scsi_cmnd *cmd)544544{545545- struct request_queue *q = cmd->device->request_queue;545545+ struct scsi_device *sdev = cmd->device;546546+ struct request_queue *q = sdev->request_queue;547547+548548+ /* need to hold a reference on the device before we let go of the cmd */549549+ get_device(&sdev->sdev_gendev);546550547551 scsi_put_command(cmd);548552 scsi_run_queue(q);553553+554554+ /* ok to remove device now */555555+ put_device(&sdev->sdev_gendev);549556}550557551558void scsi_run_host_queues(struct Scsi_Host *shost)
+10-3
fs/inotify.c
···364364/*365365 * find_inode - resolve a user-given path to a specific inode and return a nd366366 */367367-static int find_inode(const char __user *dirname, struct nameidata *nd)367367+static int find_inode(const char __user *dirname, struct nameidata *nd,368368+ unsigned flags)368369{369370 int error;370371371371- error = __user_walk(dirname, LOOKUP_FOLLOW, nd);372372+ error = __user_walk(dirname, flags, nd);372373 if (error)373374 return error;374375 /* you can only watch an inode if you have read permissions on it */···934933 struct file *filp;935934 int ret, fput_needed;936935 int mask_add = 0;936936+ unsigned flags = 0;937937938938 filp = fget_light(fd, &fput_needed);939939 if (unlikely(!filp))···946944 goto fput_and_out;947945 }948946949949- ret = find_inode(path, &nd);947947+ if (!(mask & IN_DONT_FOLLOW))948948+ flags |= LOOKUP_FOLLOW;949949+ if (mask & IN_ONLYDIR)950950+ flags |= LOOKUP_DIRECTORY;951951+952952+ ret = find_inode(path, &nd, flags);950953 if (unlikely(ret))951954 goto fput_and_out;952955
···220220 unsigned int local);221221struct mm_struct;222222extern int hash_huge_page(struct mm_struct *mm, unsigned long access,223223- unsigned long ea, unsigned long vsid, int local);223223+ unsigned long ea, unsigned long vsid, int local,224224+ unsigned long trap);224225225226extern void htab_finish_init(void);226227extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
+2
include/linux/cn_proc.h
···2626#define CN_PROC_H27272828#include <linux/types.h>2929+#include <linux/time.h>2930#include <linux/connector.h>30313132/*···6665 PROC_EVENT_EXIT = 0x800000006766 } what;6867 __u32 cpu;6868+ struct timespec timestamp;6969 union { /* must be last field of proc_event struct */7070 struct {7171 __u32 err;
+14-14
include/linux/dvb/audio.h
···323233333434typedef enum {3535- AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */3535+ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */3636 AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */3737} audio_stream_source_t;383839394040typedef enum {4141 AUDIO_STOPPED, /* Device is stopped */4242- AUDIO_PLAYING, /* Device is currently playing */4242+ AUDIO_PLAYING, /* Device is currently playing */4343 AUDIO_PAUSED /* Device is paused */4444} audio_play_state_t;454546464747typedef enum {4848- AUDIO_STEREO,4949- AUDIO_MONO_LEFT,4848+ AUDIO_STEREO,4949+ AUDIO_MONO_LEFT,5050 AUDIO_MONO_RIGHT5151} audio_channel_select_t;525253535454typedef struct audio_mixer {5555- unsigned int volume_left;5656- unsigned int volume_right;5555+ unsigned int volume_left;5656+ unsigned int volume_right;5757 // what else do we need? bass, pass-through, ...5858} audio_mixer_t;595960606161typedef struct audio_status {6262- int AV_sync_state; /* sync audio and video? */6363- int mute_state; /* audio is muted */6464- audio_play_state_t play_state; /* current playback state */6565- audio_stream_source_t stream_source; /* current stream source */6666- audio_channel_select_t channel_select; /* currently selected channel */6767- int bypass_mode; /* pass on audio data to */6262+ int AV_sync_state; /* sync audio and video? */6363+ int mute_state; /* audio is muted */6464+ audio_play_state_t play_state; /* current playback state */6565+ audio_stream_source_t stream_source; /* current stream source */6666+ audio_channel_select_t channel_select; /* currently selected channel */6767+ int bypass_mode; /* pass on audio data to */6868 audio_mixer_t mixer_state; /* current mixer state */6969} audio_status_t; /* separate decoder hardware */7070···7474 int vocal1; /* into left and right t at 70% each */7575 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/7676 int melody; /* mixed into the left channel and */7777- /* Vocal2 into the right channel at 100% each. */7878- /* if Melody is non-zero, the melody channel gets mixed*/7777+ /* Vocal2 into the right channel at 100% each. */7878+ /* if Melody is non-zero, the melody channel gets mixed*/7979} audio_karaoke_t; /* into left and right */80808181
+18-18
include/linux/dvb/ca.h
···2727/* slot interface types and info */28282929typedef struct ca_slot_info {3030- int num; /* slot number */3030+ int num; /* slot number */31313232- int type; /* CA interface this slot supports */3232+ int type; /* CA interface this slot supports */3333#define CA_CI 1 /* CI high level interface */3434#define CA_CI_LINK 2 /* CI link layer level interface */3535#define CA_CI_PHYS 4 /* CI physical layer level interface */3636#define CA_DESCR 8 /* built-in descrambler */3737#define CA_SC 128 /* simple smart card interface */38383939- unsigned int flags;3939+ unsigned int flags;4040#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */4141#define CA_CI_MODULE_READY 24242} ca_slot_info_t;···4545/* descrambler types and info */46464747typedef struct ca_descr_info {4848- unsigned int num; /* number of available descramblers (keys) */4949- unsigned int type; /* type of supported scrambling system */4848+ unsigned int num; /* number of available descramblers (keys) */4949+ unsigned int type; /* type of supported scrambling system */5050#define CA_ECD 15151#define CA_NDS 25252#define CA_DSS 45353} ca_descr_info_t;54545555typedef struct ca_caps {5656- unsigned int slot_num; /* total number of CA card and module slots */5757- unsigned int slot_type; /* OR of all supported types */5858- unsigned int descr_num; /* total number of descrambler slots (keys) */5959- unsigned int descr_type; /* OR of all supported types */5656+ unsigned int slot_num; /* total number of CA card and module slots */5757+ unsigned int slot_type; /* OR of all supported types */5858+ unsigned int descr_num; /* total number of descrambler slots (keys) */5959+ unsigned int descr_type; /* OR of all supported types */6060} ca_caps_t;61616262/* a message to/from a CI-CAM */6363typedef struct ca_msg {6464- unsigned int index;6565- unsigned int type;6666- unsigned int length;6767- unsigned char msg[256];6464+ unsigned int index;6565+ unsigned int type;6666+ unsigned int length;6767+ unsigned char msg[256];6868} ca_msg_t;69697070typedef struct ca_descr {7171- unsigned int index;7272- unsigned int parity; /* 0 == even, 1 == odd */7373- unsigned char cw[8];7171+ unsigned int index;7272+ unsigned int parity; /* 0 == even, 1 == odd */7373+ unsigned char cw[8];7474} ca_descr_t;75757676typedef struct ca_pid {7777- unsigned int pid;7878- int index; /* -1 == disable*/7777+ unsigned int pid;7878+ int index; /* -1 == disable*/7979} ca_pid_t;80808181#define CA_RESET _IO('o', 128)
+10-10
include/linux/dvb/dmx.h
···11-/* 11+/*22 * dmx.h33 *44 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>···3838{3939 DMX_OUT_DECODER, /* Streaming directly to decoder. */4040 DMX_OUT_TAP, /* Output going to a memory buffer */4141- /* (to be retrieved via the read command).*/4141+ /* (to be retrieved via the read command).*/4242 DMX_OUT_TS_TAP /* Output multiplexed into a new TS */4343- /* (to be retrieved by reading from the */4444- /* logical DVR device). */4343+ /* (to be retrieved by reading from the */4444+ /* logical DVR device). */4545} dmx_output_t;46464747···54545555typedef enum5656{5757- DMX_PES_AUDIO0,5757+ DMX_PES_AUDIO0,5858 DMX_PES_VIDEO0,5959 DMX_PES_TELETEXT0,6060 DMX_PES_SUBTITLE0,6161 DMX_PES_PCR0,62626363- DMX_PES_AUDIO1,6363+ DMX_PES_AUDIO1,6464 DMX_PES_VIDEO1,6565 DMX_PES_TELETEXT1,6666 DMX_PES_SUBTITLE1,6767 DMX_PES_PCR1,68686969- DMX_PES_AUDIO2,6969+ DMX_PES_AUDIO2,7070 DMX_PES_VIDEO2,7171 DMX_PES_TELETEXT2,7272 DMX_PES_SUBTITLE2,7373 DMX_PES_PCR2,74747575- DMX_PES_AUDIO3,7575+ DMX_PES_AUDIO3,7676 DMX_PES_VIDEO3,7777 DMX_PES_TELETEXT3,7878 DMX_PES_SUBTITLE3,···90909191typedef enum9292{9393- DMX_SCRAMBLING_EV,9494- DMX_FRONTEND_EV9393+ DMX_SCRAMBLING_EV,9494+ DMX_FRONTEND_EV9595} dmx_event_t;96969797
+29-29
include/linux/dvb/osd.h
···9898} OSD_Command;9999100100typedef struct osd_cmd_s {101101- OSD_Command cmd;102102- int x0;103103- int y0;104104- int x1;105105- int y1;106106- int color;107107- void __user *data;101101+ OSD_Command cmd;102102+ int x0;103103+ int y0;104104+ int x1;105105+ int y1;106106+ int color;107107+ void __user *data;108108} osd_cmd_t;109109110110/* OSD_OpenRaw: set 'color' to desired window type */111111typedef enum {112112- OSD_BITMAP1, /* 1 bit bitmap */113113- OSD_BITMAP2, /* 2 bit bitmap */114114- OSD_BITMAP4, /* 4 bit bitmap */115115- OSD_BITMAP8, /* 8 bit bitmap */116116- OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */117117- OSD_BITMAP2HR, /* 2 bit bitmap half resolution */118118- OSD_BITMAP4HR, /* 4 bit bitmap half resolution */119119- OSD_BITMAP8HR, /* 8 bit bitmap half resolution */120120- OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */121121- OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */122122- OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */123123- OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */124124- OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */125125- OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */126126- OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */127127- OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */128128- OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/129129- OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */130130- OSD_VIDEONSIZE, /* Full Size MPEG Video Display */131131- OSD_CURSOR /* Cursor */112112+ OSD_BITMAP1, /* 1 bit bitmap */113113+ OSD_BITMAP2, /* 2 bit bitmap */114114+ OSD_BITMAP4, /* 4 bit bitmap */115115+ OSD_BITMAP8, /* 8 bit bitmap */116116+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */117117+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */118118+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */119119+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */120120+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */121121+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */122122+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */123123+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */124124+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */125125+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */126126+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */127127+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */128128+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/129129+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */130130+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */131131+ OSD_CURSOR /* Cursor */132132} osd_raw_window_t;133133134134typedef struct osd_cap_s {135135- int cmd;135135+ int cmd;136136#define OSD_CAP_MEMSIZE 1 /* memory size */137137- long val;137137+ long val;138138} osd_cap_t;139139140140
+22-22
include/linux/dvb/video.h
···36363737typedef enum {3838 VIDEO_FORMAT_4_3, /* Select 4:3 format */3939- VIDEO_FORMAT_16_9, /* Select 16:9 format. */3939+ VIDEO_FORMAT_16_9, /* Select 16:9 format. */4040 VIDEO_FORMAT_221_1 /* 2.21:1 */4141} video_format_t;4242···545455555656typedef enum {5757- VIDEO_PAN_SCAN, /* use pan and scan format */5757+ VIDEO_PAN_SCAN, /* use pan and scan format */5858 VIDEO_LETTER_BOX, /* use letterbox format */5959 VIDEO_CENTER_CUT_OUT /* use center cut out format */6060} video_displayformat_t;···6666} video_size_t;67676868typedef enum {6969- VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */6969+ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */7070 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream7171 comes from the user through the write7272 system call */···75757676typedef enum {7777 VIDEO_STOPPED, /* Video is stopped */7878- VIDEO_PLAYING, /* Video is currently playing */7878+ VIDEO_PLAYING, /* Video is currently playing */7979 VIDEO_FREEZED /* Video is freezed */8080} video_play_state_t;818182828383struct video_event {8484- int32_t type;8484+ int32_t type;8585#define VIDEO_EVENT_SIZE_CHANGED 18686#define VIDEO_EVENT_FRAME_RATE_CHANGED 28787- time_t timestamp;8787+ time_t timestamp;8888 union {8989- video_size_t size;8989+ video_size_t size;9090 unsigned int frame_rate; /* in frames per 1000sec */9191 } u;9292};939394949595struct video_status {9696- int video_blank; /* blank video on freeze? */9797- video_play_state_t play_state; /* current state of playback */9898- video_stream_source_t stream_source; /* current source (demux/memory) */9999- video_format_t video_format; /* current aspect ratio of stream*/100100- video_displayformat_t display_format;/* selected cropping mode */9696+ int video_blank; /* blank video on freeze? */9797+ video_play_state_t play_state; /* current state of playback */9898+ video_stream_source_t stream_source; /* current source (demux/memory) */9999+ video_format_t video_format; /* current aspect ratio of stream*/100100+ video_displayformat_t display_format;/* selected cropping mode */101101};102102103103104104struct video_still_picture {105105- char __user *iFrame; /* pointer to a single iframe in memory */106106- int32_t size;105105+ char __user *iFrame; /* pointer to a single iframe in memory */106106+ int32_t size;107107};108108109109···111111struct video_highlight {112112 int active; /* 1=show highlight, 0=hide highlight */113113 uint8_t contrast1; /* 7- 4 Pattern pixel contrast */114114- /* 3- 0 Background pixel contrast */114114+ /* 3- 0 Background pixel contrast */115115 uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */116116- /* 3- 0 Emphasis pixel-1 contrast */116116+ /* 3- 0 Emphasis pixel-1 contrast */117117 uint8_t color1; /* 7- 4 Pattern pixel color */118118- /* 3- 0 Background pixel color */118118+ /* 3- 0 Background pixel color */119119 uint8_t color2; /* 7- 4 Emphasis pixel-2 color */120120- /* 3- 0 Emphasis pixel-1 color */120120+ /* 3- 0 Emphasis pixel-1 color */121121 uint32_t ypos; /* 23-22 auto action mode */122122- /* 21-12 start y */123123- /* 9- 0 end y */122122+ /* 21-12 start y */123123+ /* 9- 0 end y */124124 uint32_t xpos; /* 23-22 button color number */125125- /* 21-12 start x */126126- /* 9- 0 end x */125125+ /* 21-12 start x */126126+ /* 9- 0 end x */127127} video_highlight_t;128128129129
+1-1
include/linux/i2c-id.h
···108108#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */109109#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */110110#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */111111-#define I2C_DRIVERID_I2C_IR 75 /* I2C InfraRed on Video boards */111111+#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */112112113113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */114114#define I2C_DRIVERID_EXP1 0xF1
+2
include/linux/inotify.h
···4747#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */48484949/* special flags */5050+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */5151+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */5052#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */5153#define IN_ISDIR 0x40000000 /* event occurred against dir */5254#define IN_ONESHOT 0x80000000 /* only send event once */
···202202 *203203 * The old entry will be replaced with the new entry atomically.204204 */205205-static inline void list_replace_rcu(struct list_head *old, struct list_head *new){205205+static inline void list_replace_rcu(struct list_head *old,206206+ struct list_head *new)207207+{206208 new->next = old->next;207209 new->prev = old->prev;208210 smp_wmb();209211 new->next->prev = new;210212 new->prev->next = new;213213+ old->prev = LIST_POISON2;211214}212215213216/**···579576 __hlist_del(n);580577 INIT_HLIST_NODE(n);581578 }579579+}580580+581581+/*582582+ * hlist_replace_rcu - replace old entry by new one583583+ * @old : the element to be replaced584584+ * @new : the new element to insert585585+ *586586+ * The old entry will be replaced with the new entry atomically.587587+ */588588+static inline void hlist_replace_rcu(struct hlist_node *old,589589+ struct hlist_node *new)590590+{591591+ struct hlist_node *next = old->next;592592+593593+ new->next = next;594594+ new->pprev = old->pprev;595595+ smp_wmb();596596+ if (next)597597+ new->next->pprev = &new->next;598598+ *new->pprev = new;599599+ old->pprev = LIST_POISON2;582600}583601584602static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-1
include/linux/mm.h
···163163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */164164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */165165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */166166-#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */167166168167#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */169168#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
···234234extern int decnet_dr_count;235235extern int decnet_no_fc_max_cwnd;236236237237+extern int sysctl_decnet_mem[3];238238+extern int sysctl_decnet_wmem[3];239239+extern int sysctl_decnet_rmem[3];240240+237241#endif /* _NET_DN_H */
+3-1
kernel/audit.c
···291291 set_current_state(TASK_INTERRUPTIBLE);292292 add_wait_queue(&kauditd_wait, &wait);293293294294- if (!skb_queue_len(&audit_skb_queue))294294+ if (!skb_queue_len(&audit_skb_queue)) {295295+ try_to_freeze();295296 schedule();297297+ }296298297299 __set_current_state(TASK_RUNNING);298300 remove_wait_queue(&kauditd_wait, &wait);
+30-6
kernel/kprobes.c
···246246 return ret;247247}248248249249+/* Walks the list and increments nmissed count for multiprobe case */250250+void __kprobes kprobes_inc_nmissed_count(struct kprobe *p)251251+{252252+ struct kprobe *kp;253253+ if (p->pre_handler != aggr_pre_handler) {254254+ p->nmissed++;255255+ } else {256256+ list_for_each_entry_rcu(kp, &p->list, list)257257+ kp->nmissed++;258258+ }259259+ return;260260+}261261+249262/* Called with kretprobe_lock held */250263struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp)251264{···412399 INIT_LIST_HEAD(&ap->list);413400 list_add_rcu(&p->list, &ap->list);414401415415- INIT_HLIST_NODE(&ap->hlist);416416- hlist_del_rcu(&p->hlist);417417- hlist_add_head_rcu(&ap->hlist,418418- &kprobe_table[hash_ptr(ap->addr, KPROBE_HASH_BITS)]);402402+ hlist_replace_rcu(&p->hlist, &ap->hlist);419403}420404421405/*···472462 int ret = 0;473463 unsigned long flags = 0;474464 struct kprobe *old_p;465465+ struct module *mod;475466476476- if ((ret = in_kprobes_functions((unsigned long) p->addr)) != 0)477477- return ret;467467+ if ((!kernel_text_address((unsigned long) p->addr)) ||468468+ in_kprobes_functions((unsigned long) p->addr))469469+ return -EINVAL;470470+471471+ if ((mod = module_text_address((unsigned long) p->addr)) &&472472+ (unlikely(!try_module_get(mod))))473473+ return -EINVAL;474474+478475 if ((ret = arch_prepare_kprobe(p)) != 0)479476 goto rm_kprobe;480477···505488rm_kprobe:506489 if (ret == -EEXIST)507490 arch_remove_kprobe(p);491491+ if (ret && mod)492492+ module_put(mod);508493 return ret;509494}510495···514495{515496 unsigned long flags;516497 struct kprobe *old_p;498498+ struct module *mod;517499518500 spin_lock_irqsave(&kprobe_lock, flags);519501 old_p = get_kprobe(p->addr);···526506 cleanup_kprobe(p, flags);527507528508 synchronize_sched();509509+510510+ if ((mod = module_text_address((unsigned long)p->addr)))511511+ module_put(mod);512512+529513 if (old_p->pre_handler == aggr_pre_handler &&530514 list_empty(&old_p->list))531515 kfree(old_p);
+54-5
kernel/rcupdate.c
···116116 local_irq_restore(flags);117117}118118119119+static atomic_t rcu_barrier_cpu_count;120120+static struct semaphore rcu_barrier_sema;121121+static struct completion rcu_barrier_completion;122122+119123/**120124 * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.121125 * @head: structure to be used for queueing the RCU updates.···165161{166162 return rcu_ctrlblk.completed;167163}164164+165165+static void rcu_barrier_callback(struct rcu_head *notused)166166+{167167+ if (atomic_dec_and_test(&rcu_barrier_cpu_count))168168+ complete(&rcu_barrier_completion);169169+}170170+171171+/*172172+ * Called with preemption disabled, and from cross-cpu IRQ context.173173+ */174174+static void rcu_barrier_func(void *notused)175175+{176176+ int cpu = smp_processor_id();177177+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);178178+ struct rcu_head *head;179179+180180+ head = &rdp->barrier;181181+ atomic_inc(&rcu_barrier_cpu_count);182182+ call_rcu(head, rcu_barrier_callback);183183+}184184+185185+/**186186+ * rcu_barrier - Wait until all the in-flight RCUs are complete.187187+ */188188+void rcu_barrier(void)189189+{190190+ BUG_ON(in_interrupt());191191+ /* Take cpucontrol semaphore to protect against CPU hotplug */192192+ down(&rcu_barrier_sema);193193+ init_completion(&rcu_barrier_completion);194194+ atomic_set(&rcu_barrier_cpu_count, 0);195195+ on_each_cpu(rcu_barrier_func, NULL, 0, 1);196196+ wait_for_completion(&rcu_barrier_completion);197197+ up(&rcu_barrier_sema);198198+}199199+EXPORT_SYMBOL_GPL(rcu_barrier);168200169201/*170202 * Invoke the completed RCU callbacks. They are expected to be in···257217258218 if (rcp->next_pending &&259219 rcp->completed == rcp->cur) {260260- /* Can't change, since spin lock held. */261261- cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask);262262-263220 rcp->next_pending = 0;264264- /* next_pending == 0 must be visible in __rcu_process_callbacks()265265- * before it can see new value of cur.221221+ /*222222+ * next_pending == 0 must be visible in223223+ * __rcu_process_callbacks() before it can see new value of cur.266224 */267225 smp_wmb();268226 rcp->cur++;227227+228228+ /*229229+ * Accessing nohz_cpu_mask before incrementing rcp->cur needs a230230+ * Barrier Otherwise it can cause tickless idle CPUs to be231231+ * included in rsp->cpumask, which will extend graceperiods232232+ * unnecessarily.233233+ */234234+ smp_mb();235235+ cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask);236236+269237 }270238}271239···505457 */506458void __init rcu_init(void)507459{460460+ sema_init(&rcu_barrier_sema, 1);508461 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE,509462 (void *)(long)smp_processor_id());510463 /* Register notifier for non-boot CPUs */
+1-2
kernel/rcutorture.c
···409409 stats_task = NULL;410410411411 /* Wait for all RCU callbacks to fire. */412412+ rcu_barrier();412413413413- for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)414414- synchronize_rcu();415414 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */416415 printk(KERN_ALERT TORTURE_FLAG417416 "--- End of test: %s\n",
+2-1
kernel/sys.c
···32323333#include <linux/compat.h>3434#include <linux/syscalls.h>3535+#include <linux/kprobes.h>35363637#include <asm/uaccess.h>3738#include <asm/io.h>···169168 * of the last notifier function called.170169 */171170172172-int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)171171+int __kprobes notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)173172{174173 int ret=NOTIFY_DONE;175174 struct notifier_block *nb = *n;
···204204 unsigned long j;205205 i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);206206 i = ALIGN(i, incr);207207+ if (i >= eidx)208208+ break;207209 if (test_bit(i, bdata->node_bootmem_map))208210 continue;209211 for (j = i + 1; j < i + areasize; ++j) {
+18-49
mm/memory.c
···349349 dump_stack();350350}351351352352+static inline int is_cow_mapping(unsigned int flags)353353+{354354+ return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;355355+}356356+352357/*353358 * This function gets the "struct page" associated with a pte.354359 *···381376 if (vma->vm_flags & VM_PFNMAP) {382377 unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;383378 if (pfn == vma->vm_pgoff + off)379379+ return NULL;380380+ if (!is_cow_mapping(vma->vm_flags))384381 return NULL;385382 }386383···444437 * If it's a COW mapping, write protect it both445438 * in the parent and the child446439 */447447- if ((vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE) {440440+ if (is_cow_mapping(vm_flags)) {448441 ptep_set_wrprotect(src_mm, addr, src_pte);449442 pte = *src_pte;450443 }···12331226EXPORT_SYMBOL(vm_insert_page);1234122712351228/*12361236- * Somebody does a pfn remapping that doesn't actually work as a vma.12371237- *12381238- * Do it as individual pages instead, and warn about it. It's bad form,12391239- * and very inefficient.12401240- */12411241-static int incomplete_pfn_remap(struct vm_area_struct *vma,12421242- unsigned long start, unsigned long end,12431243- unsigned long pfn, pgprot_t prot)12441244-{12451245- static int warn = 10;12461246- struct page *page;12471247- int retval;12481248-12491249- if (!(vma->vm_flags & VM_INCOMPLETE)) {12501250- if (warn) {12511251- warn--;12521252- printk("%s does an incomplete pfn remapping", current->comm);12531253- dump_stack();12541254- }12551255- }12561256- vma->vm_flags |= VM_INCOMPLETE | VM_IO | VM_RESERVED;12571257-12581258- if (start < vma->vm_start || end > vma->vm_end)12591259- return -EINVAL;12601260-12611261- if (!pfn_valid(pfn))12621262- return -EINVAL;12631263-12641264- page = pfn_to_page(pfn);12651265- if (!PageReserved(page))12661266- return -EINVAL;12671267-12681268- retval = 0;12691269- while (start < end) {12701270- retval = insert_page(vma->vm_mm, start, page, prot);12711271- if (retval < 0)12721272- break;12731273- start += PAGE_SIZE;12741274- page++;12751275- }12761276- return retval;12771277-}12781278-12791279-/*12801229 * maps a range of physical memory into the requested pages. the old12811230 * mappings are removed. any references to nonexistent pages results12821231 * in null mappings (currently treated as "copy-on-access")···13061343 struct mm_struct *mm = vma->vm_mm;13071344 int err;1308134513091309- if (addr != vma->vm_start || end != vma->vm_end)13101310- return incomplete_pfn_remap(vma, addr, end, pfn, prot);13111311-13121346 /*13131347 * Physically remapped pages are special. Tell the13141348 * rest of the world about it:···13191359 * VM_PFNMAP tells the core MM that the base pages are just13201360 * raw PFN mappings, and do not have a "struct page" associated13211361 * with them.13621362+ *13631363+ * There's a horrible special case to handle copy-on-write13641364+ * behaviour that some programs depend on. We mark the "original"13651365+ * un-COW'ed pages by matching them up with "vma->vm_pgoff".13221366 */13671367+ if (is_cow_mapping(vma->vm_flags)) {13681368+ if (addr != vma->vm_start || end != vma->vm_end)13691369+ return -EINVAL;13701370+ vma->vm_pgoff = pfn;13711371+ }13721372+13231373 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;13241324- vma->vm_pgoff = pfn;1325137413261375 BUG_ON(addr >= end);13271376 pfn -= addr >> PAGE_SHIFT;
···17251725 * of the skb if any page alloc fails user this procedure returns -ENOMEM17261726 */17271727int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,17281728- int getfrag(void *from, char *to, int offset,17281728+ int (*getfrag)(void *from, char *to, int offset,17291729 int len, int odd, struct sk_buff *skb),17301730 void *from, int length)17311731{
+22-3
net/decnet/af_decnet.c
···153153static DEFINE_RWLOCK(dn_hash_lock);154154static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE];155155static struct hlist_head dn_wild_sk;156156+static atomic_t decnet_memory_allocated;156157157158static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen, int flags);158159static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags);···447446 dst_release(xchg(&sk->sk_dst_cache, NULL));448447}449448449449+static int dn_memory_pressure;450450+451451+static void dn_enter_memory_pressure(void)452452+{453453+ if (!dn_memory_pressure) {454454+ dn_memory_pressure = 1;455455+ }456456+}457457+450458static struct proto dn_proto = {451451- .name = "DECNET",452452- .owner = THIS_MODULE,453453- .obj_size = sizeof(struct dn_sock),459459+ .name = "NSP",460460+ .owner = THIS_MODULE,461461+ .enter_memory_pressure = dn_enter_memory_pressure,462462+ .memory_pressure = &dn_memory_pressure,463463+ .memory_allocated = &decnet_memory_allocated,464464+ .sysctl_mem = sysctl_decnet_mem,465465+ .sysctl_wmem = sysctl_decnet_wmem,466466+ .sysctl_rmem = sysctl_decnet_rmem,467467+ .max_header = DN_MAX_NSP_DATA_HEADER + 64,468468+ .obj_size = sizeof(struct dn_sock),454469};455470456471static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp)···487470 sk->sk_family = PF_DECnet;488471 sk->sk_protocol = 0;489472 sk->sk_allocation = gfp;473473+ sk->sk_sndbuf = sysctl_decnet_wmem[1];474474+ sk->sk_rcvbuf = sysctl_decnet_rmem[1];490475491476 /* Initialization of DECnet Session Control Port */492477 scp = DN_SK(sk);
···5656 instead of the individual packets.57575858config IP_NF_CONNTRACK_EVENTS5959- bool "Connection tracking events"6060- depends on IP_NF_CONNTRACK5959+ bool "Connection tracking events (EXPERIMENTAL)"6060+ depends on EXPERIMENTAL && IP_NF_CONNTRACK6161 help6262 If this option is enabled, the connection tracking code will6363 provide a notifier chain that can be used by other kernel code···6666 IF unsure, say `N'.67676868config IP_NF_CONNTRACK_NETLINK6969- tristate 'Connection tracking netlink interface'7070- depends on IP_NF_CONNTRACK && NETFILTER_NETLINK6969+ tristate 'Connection tracking netlink interface (EXPERIMENTAL)'7070+ depends on EXPERIMENTAL && IP_NF_CONNTRACK && NETFILTER_NETLINK7171 depends on IP_NF_CONNTRACK!=y || NETFILTER_NETLINK!=m7272 help7373 This option enables support for a netlink-based userspace interface
+11-9
net/ipv4/netfilter/ip_conntrack_core.c
···13451345 return 1;13461346}1347134713481348+void ip_conntrack_flush(void)13491349+{13501350+ ip_ct_iterate_cleanup(kill_all, NULL);13511351+}13521352+13481353static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)13491354{13501355 if (vmalloced)···13591354 get_order(sizeof(struct list_head) * size));13601355}1361135613621362-void ip_conntrack_flush(void)13571357+/* Mishearing the voices in his head, our hero wonders how he's13581358+ supposed to kill the mall. */13591359+void ip_conntrack_cleanup(void)13631360{13611361+ ip_ct_attach = NULL;13621362+13641363 /* This makes sure all current packets have passed through13651364 netfilter framework. Roll on, two-stage module13661365 delete... */···1372136313731364 ip_ct_event_cache_flush();13741365 i_see_dead_people:13751375- ip_ct_iterate_cleanup(kill_all, NULL);13661366+ ip_conntrack_flush();13761367 if (atomic_read(&ip_conntrack_count) != 0) {13771368 schedule();13781369 goto i_see_dead_people;···13801371 /* wait until all references to ip_conntrack_untracked are dropped */13811372 while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)13821373 schedule();13831383-}1384137413851385-/* Mishearing the voices in his head, our hero wonders how he's13861386- supposed to kill the mall. */13871387-void ip_conntrack_cleanup(void)13881388-{13891389- ip_ct_attach = NULL;13901390- ip_conntrack_flush();13911375 kmem_cache_destroy(ip_conntrack_cachep);13921376 kmem_cache_destroy(ip_conntrack_expect_cachep);13931377 free_conntrack_hash(ip_conntrack_hash, ip_conntrack_vmalloc,
···262262 * We are working here with either a clone of the original263263 * SKB, or a fresh unique copy made by the retransmit engine.264264 */265265-static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)265265+static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, gfp_t gfp_mask)266266{267267- if (skb != NULL) {268268- const struct inet_connection_sock *icsk = inet_csk(sk);269269- struct inet_sock *inet = inet_sk(sk);270270- struct tcp_sock *tp = tcp_sk(sk);271271- struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);272272- int tcp_header_size = tp->tcp_header_len;273273- struct tcphdr *th;274274- int sysctl_flags;275275- int err;267267+ const struct inet_connection_sock *icsk = inet_csk(sk);268268+ struct inet_sock *inet;269269+ struct tcp_sock *tp;270270+ struct tcp_skb_cb *tcb;271271+ int tcp_header_size;272272+ struct tcphdr *th;273273+ int sysctl_flags;274274+ int err;276275277277- BUG_ON(!tcp_skb_pcount(skb));276276+ BUG_ON(!skb || !tcp_skb_pcount(skb));277277+278278+ /* If congestion control is doing timestamping, we must279279+ * take such a timestamp before we potentially clone/copy.280280+ */281281+ if (icsk->icsk_ca_ops->rtt_sample)282282+ __net_timestamp(skb);283283+284284+ if (likely(clone_it)) {285285+ if (unlikely(skb_cloned(skb)))286286+ skb = pskb_copy(skb, gfp_mask);287287+ else288288+ skb = skb_clone(skb, gfp_mask);289289+ if (unlikely(!skb))290290+ return -ENOBUFS;291291+ }292292+293293+ inet = inet_sk(sk);294294+ tp = tcp_sk(sk);295295+ tcb = TCP_SKB_CB(skb);296296+ tcp_header_size = tp->tcp_header_len;278297279298#define SYSCTL_FLAG_TSTAMPS 0x1280299#define SYSCTL_FLAG_WSCALE 0x2281300#define SYSCTL_FLAG_SACK 0x4282301283283- /* If congestion control is doing timestamping */284284- if (icsk->icsk_ca_ops->rtt_sample)285285- __net_timestamp(skb);286286-287287- sysctl_flags = 0;288288- if (tcb->flags & TCPCB_FLAG_SYN) {289289- tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS;290290- if(sysctl_tcp_timestamps) {291291- tcp_header_size += TCPOLEN_TSTAMP_ALIGNED;292292- sysctl_flags |= SYSCTL_FLAG_TSTAMPS;293293- }294294- if(sysctl_tcp_window_scaling) {295295- tcp_header_size += TCPOLEN_WSCALE_ALIGNED;296296- sysctl_flags |= SYSCTL_FLAG_WSCALE;297297- }298298- if(sysctl_tcp_sack) {299299- sysctl_flags |= SYSCTL_FLAG_SACK;300300- if(!(sysctl_flags & SYSCTL_FLAG_TSTAMPS))301301- tcp_header_size += TCPOLEN_SACKPERM_ALIGNED;302302- }303303- } else if (tp->rx_opt.eff_sacks) {304304- /* A SACK is 2 pad bytes, a 2 byte header, plus305305- * 2 32-bit sequence numbers for each SACK block.306306- */307307- tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +308308- (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK));302302+ sysctl_flags = 0;303303+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {304304+ tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS;305305+ if(sysctl_tcp_timestamps) {306306+ tcp_header_size += TCPOLEN_TSTAMP_ALIGNED;307307+ sysctl_flags |= SYSCTL_FLAG_TSTAMPS;309308 }310310-311311- if (tcp_packets_in_flight(tp) == 0)312312- tcp_ca_event(sk, CA_EVENT_TX_START);313313-314314- th = (struct tcphdr *) skb_push(skb, tcp_header_size);315315- skb->h.th = th;316316- skb_set_owner_w(skb, sk);317317-318318- /* Build TCP header and checksum it. */319319- th->source = inet->sport;320320- th->dest = inet->dport;321321- th->seq = htonl(tcb->seq);322322- th->ack_seq = htonl(tp->rcv_nxt);323323- *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | tcb->flags);324324- if (tcb->flags & TCPCB_FLAG_SYN) {325325- /* RFC1323: The window in SYN & SYN/ACK segments326326- * is never scaled.327327- */328328- th->window = htons(tp->rcv_wnd);329329- } else {330330- th->window = htons(tcp_select_window(sk));309309+ if (sysctl_tcp_window_scaling) {310310+ tcp_header_size += TCPOLEN_WSCALE_ALIGNED;311311+ sysctl_flags |= SYSCTL_FLAG_WSCALE;331312 }332332- th->check = 0;333333- th->urg_ptr = 0;334334-335335- if (tp->urg_mode &&336336- between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF)) {337337- th->urg_ptr = htons(tp->snd_up-tcb->seq);338338- th->urg = 1;313313+ if (sysctl_tcp_sack) {314314+ sysctl_flags |= SYSCTL_FLAG_SACK;315315+ if (!(sysctl_flags & SYSCTL_FLAG_TSTAMPS))316316+ tcp_header_size += TCPOLEN_SACKPERM_ALIGNED;339317 }340340-341341- if (tcb->flags & TCPCB_FLAG_SYN) {342342- tcp_syn_build_options((__u32 *)(th + 1),343343- tcp_advertise_mss(sk),344344- (sysctl_flags & SYSCTL_FLAG_TSTAMPS),345345- (sysctl_flags & SYSCTL_FLAG_SACK),346346- (sysctl_flags & SYSCTL_FLAG_WSCALE),347347- tp->rx_opt.rcv_wscale,348348- tcb->when,349349- tp->rx_opt.ts_recent);350350- } else {351351- tcp_build_and_update_options((__u32 *)(th + 1),352352- tp, tcb->when);353353-354354- TCP_ECN_send(sk, tp, skb, tcp_header_size);355355- }356356- tp->af_specific->send_check(sk, th, skb->len, skb);357357-358358- if (tcb->flags & TCPCB_FLAG_ACK)359359- tcp_event_ack_sent(sk, tcp_skb_pcount(skb));360360-361361- if (skb->len != tcp_header_size)362362- tcp_event_data_sent(tp, skb, sk);363363-364364- TCP_INC_STATS(TCP_MIB_OUTSEGS);365365-366366- err = tp->af_specific->queue_xmit(skb, 0);367367- if (err <= 0)368368- return err;369369-370370- tcp_enter_cwr(sk);371371-372372- /* NET_XMIT_CN is special. It does not guarantee,373373- * that this packet is lost. It tells that device374374- * is about to start to drop packets or already375375- * drops some packets of the same priority and376376- * invokes us to send less aggressively.318318+ } else if (unlikely(tp->rx_opt.eff_sacks)) {319319+ /* A SACK is 2 pad bytes, a 2 byte header, plus320320+ * 2 32-bit sequence numbers for each SACK block.377321 */378378- return err == NET_XMIT_CN ? 0 : err;322322+ tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +323323+ (tp->rx_opt.eff_sacks *324324+ TCPOLEN_SACK_PERBLOCK));379325 }380380- return -ENOBUFS;326326+327327+ if (tcp_packets_in_flight(tp) == 0)328328+ tcp_ca_event(sk, CA_EVENT_TX_START);329329+330330+ th = (struct tcphdr *) skb_push(skb, tcp_header_size);331331+ skb->h.th = th;332332+ skb_set_owner_w(skb, sk);333333+334334+ /* Build TCP header and checksum it. */335335+ th->source = inet->sport;336336+ th->dest = inet->dport;337337+ th->seq = htonl(tcb->seq);338338+ th->ack_seq = htonl(tp->rcv_nxt);339339+ *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) |340340+ tcb->flags);341341+342342+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {343343+ /* RFC1323: The window in SYN & SYN/ACK segments344344+ * is never scaled.345345+ */346346+ th->window = htons(tp->rcv_wnd);347347+ } else {348348+ th->window = htons(tcp_select_window(sk));349349+ }350350+ th->check = 0;351351+ th->urg_ptr = 0;352352+353353+ if (unlikely(tp->urg_mode &&354354+ between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF))) {355355+ th->urg_ptr = htons(tp->snd_up-tcb->seq);356356+ th->urg = 1;357357+ }358358+359359+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {360360+ tcp_syn_build_options((__u32 *)(th + 1),361361+ tcp_advertise_mss(sk),362362+ (sysctl_flags & SYSCTL_FLAG_TSTAMPS),363363+ (sysctl_flags & SYSCTL_FLAG_SACK),364364+ (sysctl_flags & SYSCTL_FLAG_WSCALE),365365+ tp->rx_opt.rcv_wscale,366366+ tcb->when,367367+ tp->rx_opt.ts_recent);368368+ } else {369369+ tcp_build_and_update_options((__u32 *)(th + 1),370370+ tp, tcb->when);371371+ TCP_ECN_send(sk, tp, skb, tcp_header_size);372372+ }373373+374374+ tp->af_specific->send_check(sk, th, skb->len, skb);375375+376376+ if (likely(tcb->flags & TCPCB_FLAG_ACK))377377+ tcp_event_ack_sent(sk, tcp_skb_pcount(skb));378378+379379+ if (skb->len != tcp_header_size)380380+ tcp_event_data_sent(tp, skb, sk);381381+382382+ TCP_INC_STATS(TCP_MIB_OUTSEGS);383383+384384+ err = tp->af_specific->queue_xmit(skb, 0);385385+ if (unlikely(err <= 0))386386+ return err;387387+388388+ tcp_enter_cwr(sk);389389+390390+ /* NET_XMIT_CN is special. It does not guarantee,391391+ * that this packet is lost. It tells that device392392+ * is about to start to drop packets or already393393+ * drops some packets of the same priority and394394+ * invokes us to send less aggressively.395395+ */396396+ return err == NET_XMIT_CN ? 0 : err;397397+381398#undef SYSCTL_FLAG_TSTAMPS382399#undef SYSCTL_FLAG_WSCALE383400#undef SYSCTL_FLAG_SACK···1053103610541037 TCP_SKB_CB(skb)->when = tcp_time_stamp;1055103810561056- if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC))))10391039+ if (unlikely(tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC)))10571040 break;1058104110591042 /* Advance the send_head. This one is sent out.···11261109 /* Send it out now. */11271110 TCP_SKB_CB(skb)->when = tcp_time_stamp;1128111111291129- if (likely(!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation)))) {11121112+ if (likely(!tcp_transmit_skb(sk, skb, 1, sk->sk_allocation))) {11301113 update_send_head(sk, tp, skb);11311114 tcp_cwnd_validate(sk, tp);11321115 return;···14461429 */14471430 TCP_SKB_CB(skb)->when = tcp_time_stamp;1448143114491449- err = tcp_transmit_skb(sk, (skb_cloned(skb) ?14501450- pskb_copy(skb, GFP_ATOMIC):14511451- skb_clone(skb, GFP_ATOMIC)));14321432+ err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);1452143314531434 if (err == 0) {14541435 /* Update global TCP statistics. */···16801665 TCP_SKB_CB(skb)->seq = tcp_acceptable_seq(sk, tp);16811666 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;16821667 TCP_SKB_CB(skb)->when = tcp_time_stamp;16831683- if (tcp_transmit_skb(sk, skb))16681668+ if (tcp_transmit_skb(sk, skb, 0, priority))16841669 NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);16851670}16861671···17151700 TCP_ECN_send_synack(tcp_sk(sk), skb);17161701 }17171702 TCP_SKB_CB(skb)->when = tcp_time_stamp;17181718- return tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));17031703+ return tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);17191704}1720170517211706/*···18761861 __skb_queue_tail(&sk->sk_write_queue, buff);18771862 sk_charge_skb(sk, buff);18781863 tp->packets_out += tcp_skb_pcount(buff);18791879- tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));18641864+ tcp_transmit_skb(sk, buff, 1, GFP_KERNEL);18801865 TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);1881186618821867 /* Timer for repeating the SYN until an answer. */···19721957 /* Send it off, this clears delayed acks for us. */19731958 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk, tp);19741959 TCP_SKB_CB(buff)->when = tcp_time_stamp;19751975- tcp_transmit_skb(sk, buff);19601960+ tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC);19761961 }19771962}19781963···20121997 TCP_SKB_CB(skb)->seq = urgent ? tp->snd_una : tp->snd_una - 1;20131998 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;20141999 TCP_SKB_CB(skb)->when = tcp_time_stamp;20152015- return tcp_transmit_skb(sk, skb);20002000+ return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC);20162001}2017200220182003int tcp_write_wakeup(struct sock *sk)···2045203020462031 TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;20472032 TCP_SKB_CB(skb)->when = tcp_time_stamp;20482048- err = tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));20332033+ err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);20492034 if (!err) {20502035 update_send_head(sk, tp, skb);20512036 }
+4-12
net/ipv4/tcp_vegas.c
···215215 vegas->beg_snd_nxt = tp->snd_nxt;216216 vegas->beg_snd_cwnd = tp->snd_cwnd;217217218218- /* Take into account the current RTT sample too, to219219- * decrease the impact of delayed acks. This double counts220220- * this sample since we count it for the next window as well,221221- * but that's not too awful, since we're taking the min,222222- * rather than averaging.223223- */224224- tcp_vegas_rtt_calc(sk, seq_rtt * 1000);225225-226218 /* We do the Vegas calculations only if we got enough RTT227219 * samples that we can be reasonably sure that we got228220 * at least one RTT sample that wasn't from a delayed ACK.···325333 else if (tp->snd_cwnd > tp->snd_cwnd_clamp)326334 tp->snd_cwnd = tp->snd_cwnd_clamp;327335 }328328- }329336330330- /* Wipe the slate clean for the next RTT. */331331- vegas->cntRTT = 0;332332- vegas->minRTT = 0x7fffffff;337337+ /* Wipe the slate clean for the next RTT. */338338+ vegas->cntRTT = 0;339339+ vegas->minRTT = 0x7fffffff;340340+ }333341}334342335343/* Extract info for Tcp socket info provided via netlink. */
+1-1
net/ipv6/esp6.c
···248248 if (esp->conf.padlen)249249 mtu = ALIGN(mtu, esp->conf.padlen);250250251251- return mtu + x->props.header_len + esp->auth.icv_full_len;251251+ return mtu + x->props.header_len + esp->auth.icv_trunc_len;252252}253253254254static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+6-6
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
···6868 [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +16969 };70707171- __u8 type = orig->dst.u.icmp.type - 128;7272- if (type >= sizeof(invmap) || !invmap[type])7171+ int type = orig->dst.u.icmp.type - 128;7272+ if (type < 0 || type >= sizeof(invmap) || !invmap[type])7373 return 0;74747575 tuple->src.u.icmp.id = orig->src.u.icmp.id;···129129 [ICMPV6_ECHO_REQUEST - 128] = 1,130130 [ICMPV6_NI_QUERY - 128] = 1131131 };132132+ int type = conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128;132133133133- if (conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128 >= sizeof(valid_new)134134- || !valid_new[conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128]) {134134+ if (type < 0 || type >= sizeof(valid_new) || !valid_new[type]) {135135 /* Can't create a new ICMPv6 `conn' with this. */136136- DEBUGP("icmp: can't create new conn with type %u\n",137137- conntrack->tuplehash[0].tuple.dst.u.icmp.type);136136+ DEBUGP("icmpv6: can't create new conn with type %u\n",137137+ type + 128);138138 NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple);139139 return 0;140140 }
+2-2
net/netfilter/Kconfig
···6161 instead of the individual packets.62626363config NF_CONNTRACK_EVENTS6464- bool "Connection tracking events"6565- depends on NF_CONNTRACK6464+ bool "Connection tracking events (EXPERIMENTAL)"6565+ depends on EXPERIMENTAL && NF_CONNTRACK6666 help6767 If this option is enabled, the connection tracking code will6868 provide a notifier chain that can be used by other kernel code
+3
net/netfilter/nf_conntrack_core.c
···13831383 schedule();13841384 goto i_see_dead_people;13851385 }13861386+ /* wait until all references to nf_conntrack_untracked are dropped */13871387+ while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1)13881388+ schedule();1386138913871390 for (i = 0; i < NF_CT_F_NUM; i++) {13881391 if (nf_ct_cache[i].use == 0)
+2-3
net/netfilter/nfnetlink.c
···162162 return -EINVAL;163163 }164164165165- min_len = NLMSG_ALIGN(sizeof(struct nfgenmsg));165165+ min_len = NLMSG_SPACE(sizeof(struct nfgenmsg));166166 if (unlikely(nlh->nlmsg_len < min_len))167167 return -EINVAL;168168···236236 }237237238238 /* All the messages must at least contain nfgenmsg */239239- if (nlh->nlmsg_len < 240240- NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) {239239+ if (nlh->nlmsg_len < NLMSG_SPACE(sizeof(struct nfgenmsg))) {241240 DEBUGP("received message was too short\n");242241 return 0;243242 }
+61-54
net/packet/af_packet.c
···15871587 return virt_to_page(one_pg_vec + (PAGE_SIZE << order) - 1);15881588}1589158915901590-static void free_pg_vec(char **pg_vec, unsigned order, unsigned len)15901590+static void free_pg_vec(char **pg_vec, unsigned int order, unsigned int len)15911591{15921592 int i;1593159315941594- for (i=0; i<len; i++) {15951595- if (pg_vec[i]) {15961596- struct page *page, *pend;15971597-15981598- pend = pg_vec_endpage(pg_vec[i], order);15991599- for (page = virt_to_page(pg_vec[i]); page <= pend; page++)16001600- ClearPageReserved(page);16011601- free_pages((unsigned long)pg_vec[i], order);16021602- }15941594+ for (i = 0; i < len; i++) {15951595+ if (likely(pg_vec[i]))15961596+ free_pages((unsigned long) pg_vec[i], order);16031597 }16041598 kfree(pg_vec);16051599}1606160016011601+static inline char *alloc_one_pg_vec_page(unsigned long order)16021602+{16031603+ return (char *) __get_free_pages(GFP_KERNEL | __GFP_COMP | __GFP_ZERO,16041604+ order);16051605+}16061606+16071607+static char **alloc_pg_vec(struct tpacket_req *req, int order)16081608+{16091609+ unsigned int block_nr = req->tp_block_nr;16101610+ char **pg_vec;16111611+ int i;16121612+16131613+ pg_vec = kzalloc(block_nr * sizeof(char *), GFP_KERNEL);16141614+ if (unlikely(!pg_vec))16151615+ goto out;16161616+16171617+ for (i = 0; i < block_nr; i++) {16181618+ pg_vec[i] = alloc_one_pg_vec_page(order);16191619+ if (unlikely(!pg_vec[i]))16201620+ goto out_free_pgvec;16211621+ }16221622+16231623+out:16241624+ return pg_vec;16251625+16261626+out_free_pgvec:16271627+ free_pg_vec(pg_vec, order, block_nr);16281628+ pg_vec = NULL;16291629+ goto out;16301630+}1607163116081632static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing)16091633{···1641161716421618 /* Sanity tests and some calculations */1643161916441644- if (po->pg_vec)16201620+ if (unlikely(po->pg_vec))16451621 return -EBUSY;1646162216471647- if ((int)req->tp_block_size <= 0)16231623+ if (unlikely((int)req->tp_block_size <= 0))16481624 return -EINVAL;16491649- if (req->tp_block_size&(PAGE_SIZE-1))16251625+ if (unlikely(req->tp_block_size & (PAGE_SIZE - 1)))16501626 return -EINVAL;16511651- if (req->tp_frame_size < TPACKET_HDRLEN)16271627+ if (unlikely(req->tp_frame_size < TPACKET_HDRLEN))16521628 return -EINVAL;16531653- if (req->tp_frame_size&(TPACKET_ALIGNMENT-1))16291629+ if (unlikely(req->tp_frame_size & (TPACKET_ALIGNMENT - 1)))16541630 return -EINVAL;1655163116561632 po->frames_per_block = req->tp_block_size/req->tp_frame_size;16571657- if (po->frames_per_block <= 0)16331633+ if (unlikely(po->frames_per_block <= 0))16581634 return -EINVAL;16591659- if (po->frames_per_block*req->tp_block_nr != req->tp_frame_nr)16351635+ if (unlikely((po->frames_per_block * req->tp_block_nr) !=16361636+ req->tp_frame_nr))16601637 return -EINVAL;16611661- /* OK! */16621662-16631663- /* Allocate page vector */16641664- while ((PAGE_SIZE<<order) < req->tp_block_size)16651665- order++;1666163816671639 err = -ENOMEM;16681668-16691669- pg_vec = kmalloc(req->tp_block_nr*sizeof(char *), GFP_KERNEL);16701670- if (pg_vec == NULL)16401640+ order = get_order(req->tp_block_size);16411641+ pg_vec = alloc_pg_vec(req, order);16421642+ if (unlikely(!pg_vec))16711643 goto out;16721672- memset(pg_vec, 0, req->tp_block_nr*sizeof(char **));16731673-16741674- for (i=0; i<req->tp_block_nr; i++) {16751675- struct page *page, *pend;16761676- pg_vec[i] = (char *)__get_free_pages(GFP_KERNEL, order);16771677- if (!pg_vec[i])16781678- goto out_free_pgvec;16791679-16801680- pend = pg_vec_endpage(pg_vec[i], order);16811681- for (page = virt_to_page(pg_vec[i]); page <= pend; page++)16821682- SetPageReserved(page);16831683- }16841684- /* Page vector is allocated */1685164416861645 l = 0;16871687- for (i=0; i<req->tp_block_nr; i++) {16461646+ for (i = 0; i < req->tp_block_nr; i++) {16881647 char *ptr = pg_vec[i];16891648 struct tpacket_hdr *header;16901649 int k;1691165016921692- for (k=0; k<po->frames_per_block; k++) {16931693-16941694- header = (struct tpacket_hdr*)ptr;16511651+ for (k = 0; k < po->frames_per_block; k++) {16521652+ header = (struct tpacket_hdr *) ptr;16951653 header->tp_status = TP_STATUS_KERNEL;16961654 ptr += req->tp_frame_size;16971655 }16981656 }16991657 /* Done */17001658 } else {17011701- if (req->tp_frame_nr)16591659+ if (unlikely(req->tp_frame_nr))17021660 return -EINVAL;17031661 }17041662···1707170117081702 spin_lock_bh(&sk->sk_receive_queue.lock);17091703 pg_vec = XC(po->pg_vec, pg_vec);17101710- po->frame_max = req->tp_frame_nr-1;17041704+ po->frame_max = (req->tp_frame_nr - 1);17111705 po->head = 0;17121706 po->frame_size = req->tp_frame_size;17131707 spin_unlock_bh(&sk->sk_receive_queue.lock);···1734172817351729 release_sock(sk);1736173017371737-out_free_pgvec:17381731 if (pg_vec)17391732 free_pg_vec(pg_vec, order, req->tp_block_nr);17401733out:···17601755 if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)17611756 goto out;1762175717631763- atomic_inc(&po->mapped);17641758 start = vma->vm_start;17651765- err = -EAGAIN;17661766- for (i=0; i<po->pg_vec_len; i++) {17671767- if (remap_pfn_range(vma, start,17681768- __pa(po->pg_vec[i]) >> PAGE_SHIFT,17691769- po->pg_vec_pages*PAGE_SIZE,17701770- vma->vm_page_prot))17711771- goto out;17721772- start += po->pg_vec_pages*PAGE_SIZE;17591759+ for (i = 0; i < po->pg_vec_len; i++) {17601760+ struct page *page = virt_to_page(po->pg_vec[i]);17611761+ int pg_num;17621762+17631763+ for (pg_num = 0; pg_num < po->pg_vec_pages; pg_num++, page++) {17641764+ err = vm_insert_page(vma, start, page);17651765+ if (unlikely(err))17661766+ goto out;17671767+ start += PAGE_SIZE;17681768+ }17731769 }17701770+ atomic_inc(&po->mapped);17741771 vma->vm_ops = &packet_mmap_ops;17751772 err = 0;17761773