···500. History & News:51 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)52 2005-05-30 - added basic isochronous support to the dvb-usb-framework53- added support for Conexant Hybrid reference design and Nebula DigiTV USB54 2005-04-17 - all dibusb devices ported to make use of the dvb-usb-framework55 2005-04-02 - re-enabled and improved remote control code.56 2005-03-31 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb.57 2005-03-30 - first commit of the dvb-usb-module based on the dibusb-source. First device is a new driver for the58- TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.5960 (change from dvb-dibusb to dvb-usb)61 2005-03-28 - added support for the AVerMedia AverTV DVB-T USB2.0 device (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia)···64 2005-02-02 - added support for the Hauppauge Win-TV Nova-T USB265 2005-01-31 - distorted streaming is gone for USB1.1 devices66 2005-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb67- - first almost working version for HanfTek UMT-01068- - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-01069 2005-01-10 - refactoring completed, now everything is very delightful70- - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a71- Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.72 2004-12-29 - after several days of struggling around bug of no returning URBs fixed.73 2004-12-26 - refactored the dibusb-driver, splitted into separate files74- - i2c-probing enabled75 2004-12-06 - possibility for demod i2c-address probing76- - new usb IDs (Compro, Artec)77 2004-11-23 - merged changes from DiB3000MC_ver2.178- - revised the debugging79- - possibility to deliver the complete TS for USB2.080 2004-11-21 - first working version of the dib3000mc/p frontend driver.81 2004-11-12 - added additional remote control keys. Thanks to Uwe Hanke.82 2004-11-07 - added remote control support. Thanks to David Matthews.83 2004-11-05 - added support for a new devices (Grandtec/Avermedia/Artec)84- - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD85- - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems86- better settled there (added xfer_ops-struct)87- - created a common files for frontends (mc/p/mb)88 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek)89 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks90- to Amaury Demol for reporting91- - changed usb TS transfer method (several urbs, stopping transfer92- before setting a new pid)93 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks94- to Christian Motschke for reporting95 2004-09-05 - released the dibusb device and dib3000mb-frontend driver9697 (old news for vp7041.c)98 2004-07-15 - found out, by accident, that the device has a TUA6010XS for99- PLL100 2004-07-12 - figured out, that the driver should also work with the101- CTS Portable (Chinese Television System)102 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working103- properly with firmware extracted from 2.422104- - #if for 2.6.4 (dvb), compile issue105- - changed firmware handling, see vp7041.txt sec 1.1106 2004-07-02 - some tuner modifications, v0.1, cleanups, first public107 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything108- runs fine now109 2004-06-27 - able to watch and switching channels (pre-alpha)110- - no section filtering yet111 2004-06-06 - first TS received, but kernel oops :/112 2004-05-14 - firmware loader is working113 2004-05-11 - start writing the driver
···500. History & News:51 2005-06-30 - added support for WideView WT-220U (Thanks to Steve Chang)52 2005-05-30 - added basic isochronous support to the dvb-usb-framework53+ added support for Conexant Hybrid reference design and Nebula DigiTV USB54 2005-04-17 - all dibusb devices ported to make use of the dvb-usb-framework55 2005-04-02 - re-enabled and improved remote control code.56 2005-03-31 - ported the Yakumo/Hama/Typhoon DVB-T USB2.0 device to dvb-usb.57 2005-03-30 - first commit of the dvb-usb-module based on the dibusb-source. First device is a new driver for the58+ TwinhanDTV Alpha / MagicBox II USB2.0-only DVB-T device.5960 (change from dvb-dibusb to dvb-usb)61 2005-03-28 - added support for the AVerMedia AverTV DVB-T USB2.0 device (Thanks to Glen Harris and Jiun-Kuei Jung, AVerMedia)···64 2005-02-02 - added support for the Hauppauge Win-TV Nova-T USB265 2005-01-31 - distorted streaming is gone for USB1.1 devices66 2005-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb67+ - first almost working version for HanfTek UMT-01068+ - found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek UMT-01069 2005-01-10 - refactoring completed, now everything is very delightful70+ - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a71+ Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich.72 2004-12-29 - after several days of struggling around bug of no returning URBs fixed.73 2004-12-26 - refactored the dibusb-driver, splitted into separate files74+ - i2c-probing enabled75 2004-12-06 - possibility for demod i2c-address probing76+ - new usb IDs (Compro, Artec)77 2004-11-23 - merged changes from DiB3000MC_ver2.178+ - revised the debugging79+ - possibility to deliver the complete TS for USB2.080 2004-11-21 - first working version of the dib3000mc/p frontend driver.81 2004-11-12 - added additional remote control keys. Thanks to Uwe Hanke.82 2004-11-07 - added remote control support. Thanks to David Matthews.83 2004-11-05 - added support for a new devices (Grandtec/Avermedia/Artec)84+ - merged my changes (for dib3000mb/dibusb) to the FE_REFACTORING, because it became HEAD85+ - moved transfer control (pid filter, fifo control) from usb driver to frontend, it seems86+ better settled there (added xfer_ops-struct)87+ - created a common files for frontends (mc/p/mb)88 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek)89 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks90+ to Amaury Demol for reporting91+ - changed usb TS transfer method (several urbs, stopping transfer92+ before setting a new pid)93 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks94+ to Christian Motschke for reporting95 2004-09-05 - released the dibusb device and dib3000mb-frontend driver9697 (old news for vp7041.c)98 2004-07-15 - found out, by accident, that the device has a TUA6010XS for99+ PLL100 2004-07-12 - figured out, that the driver should also work with the101+ CTS Portable (Chinese Television System)102 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working103+ properly with firmware extracted from 2.422104+ - #if for 2.6.4 (dvb), compile issue105+ - changed firmware handling, see vp7041.txt sec 1.1106 2004-07-02 - some tuner modifications, v0.1, cleanups, first public107 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything108+ runs fine now109 2004-06-27 - able to watch and switching channels (pre-alpha)110+ - no section filtering yet111 2004-06-06 - first TS received, but kernel oops :/112 2004-05-14 - firmware loader is working113 2004-05-11 - start writing the driver
+1-1
Documentation/dvb/README.flexcop
···174Everything which is identical in the following table, can be put into a common175flexcop-module.176177- PCI USB178-------------------------------------------------------------------------------179Different:180Register access: accessing IO memory USB control message
···174Everything which is identical in the following table, can be put into a common175flexcop-module.176177+ PCI USB178-------------------------------------------------------------------------------179Different:180Register access: accessing IO memory USB control message
+1-1
Documentation/dvb/avermedia.txt
···12HOWTO: Get An Avermedia DVB-T working under Linux3- ______________________________________________45 Table of Contents6 Assumptions and Introduction
···12HOWTO: Get An Avermedia DVB-T working under Linux3+ ______________________________________________45 Table of Contents6 Assumptions and Introduction
+4-4
Documentation/dvb/cards.txt
···16 shielding, and the whole metal box has its own part number.171819-o Frontends drivers: 20 - dvb_dummy_fe: for testing...21 DVB-S:22 - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993)···24 - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL25 - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL26 - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL),27- LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL), 28 Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB29 DVB-C:30 - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL)···35 - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL36 - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL)37 - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL),38- Comtech DVBT-6k07 (SP5730 PLL)39- (NxtWave Communications NXT6000 demodulator)40 - sp887x : Microtune 7202D41 - dib3000mb : DiBcom 3000-MB demodulator42 DVB-S/C/T:
···16 shielding, and the whole metal box has its own part number.171819+o Frontends drivers:20 - dvb_dummy_fe: for testing...21 DVB-S:22 - ves1x93 : Alps BSRV2 (ves1893 demodulator) and dbox2 (ves1993)···24 - grundig_29504-491 : Grundig 29504-491 (Philips TDA8083 demodulator), tsa5522 PLL25 - mt312 : Zarlink mt312 or Mitel vp310 demodulator, sl1935 or tsa5059 PLL26 - stv0299 : Alps BSRU6 (tsa5059 PLL), LG TDQB-S00x (tsa5059 PLL),27+ LG TDQF-S001F (sl1935 PLL), Philips SU1278 (tua6100 PLL),28 Philips SU1278SH (tsa5059 PLL), Samsung TBMU24112IMB29 DVB-C:30 - ves1820 : various (ves1820 demodulator, sp5659c or spXXXX PLL)···35 - grundig_29504-401 : Grundig 29504-401 (LSI L64781 demodulator), tsa5060 PLL36 - tda1004x : Philips tda10045h (td1344 or tdm1316l PLL)37 - nxt6000 : Alps TDME7 (MITEL SP5659 PLL), Alps TDED4 (TI ALP510 PLL),38+ Comtech DVBT-6k07 (SP5730 PLL)39+ (NxtWave Communications NXT6000 demodulator)40 - sp887x : Microtune 7202D41 - dib3000mb : DiBcom 3000-MB demodulator42 DVB-S/C/T:
+2-2
Documentation/dvb/contributors.txt
···1516Diego Picciani <d.picciani@novacomp.it>17 for CyberLogin for Linux which allows logging onto EON18- (in case you are wondering where CyberLogin is, EON changed its login 19 procedure and CyberLogin is no longer used.)2021Martin Schaller <martin@smurf.franken.de>···57Davor Emard <emard@softhome.net>58 for his work on the budget drivers, the demux code,59 the module unloading problems, ...60-61Hans-Frieder Vogt <hfvogt@arcor.de>62 for his work on calculating and checking the crc's for the63 TechnoTrend/Hauppauge DEC driver firmware
···1516Diego Picciani <d.picciani@novacomp.it>17 for CyberLogin for Linux which allows logging onto EON18+ (in case you are wondering where CyberLogin is, EON changed its login19 procedure and CyberLogin is no longer used.)2021Martin Schaller <martin@smurf.franken.de>···57Davor Emard <emard@softhome.net>58 for his work on the budget drivers, the demux code,59 the module unloading problems, ...60+61Hans-Frieder Vogt <hfvogt@arcor.de>62 for his work on calculating and checking the crc's for the63 TechnoTrend/Hauppauge DEC driver firmware
+2-2
Documentation/dvb/readme.txt
···2021What's inside this directory:2223-"cards.txt" 24contains a list of supported hardware.2526"contributors.txt"···37contains detailed informations about the38TT DEC2000/DEC3000 USB DVB hardware.3940-"bt8xx.txt" 41contains detailed installation instructions for the42various bt8xx based "budget" DVB cards43(Nebula, Pinnacle PCTV, Twinhan DST)
···2021What's inside this directory:2223+"cards.txt"24contains a list of supported hardware.2526"contributors.txt"···37contains detailed informations about the38TT DEC2000/DEC3000 USB DVB hardware.3940+"bt8xx.txt"41contains detailed installation instructions for the42various bt8xx based "budget" DVB cards43(Nebula, Pinnacle PCTV, Twinhan DST)
+11-11
Documentation/filesystems/ext3.txt
···57 we'd like to get some feedback if it's the contrary for58 you.5960-user_xattr (*) Enables POSIX Extended Attributes. It's enabled by61- default, however you need to confifure its support62- (CONFIG_EXT3_FS_XATTR). This is neccesary if you want63- to use POSIX Acces Control Lists support. You can visit64- http://acl.bestbits.at to know more about POSIX Extended65- attributes.6667-nouser_xattr Disables POSIX Extended Attributes.6869-acl (*) Enables POSIX Access Control Lists support. This is70- enabled by default, however you need to configure71- its support (CONFIG_EXT3_FS_POSIX_ACL). If you want72- to know more about ACLs visit http://acl.bestbits.at07374noacl This option disables POSIX Access Control List support.75
···57 we'd like to get some feedback if it's the contrary for58 you.5960+user_xattr Enables Extended User Attributes. Additionally, you need61+ to have extended attribute support enabled in the kernel62+ configuration (CONFIG_EXT3_FS_XATTR). See the attr(5)63+ manual page and http://acl.bestbits.at to learn more64+ about extended attributes.06566+nouser_xattr Disables Extended User Attributes.6768+acl Enables POSIX Access Control Lists support. Additionally,69+ you need to have ACL support enabled in the kernel70+ configuration (CONFIG_EXT3_FS_POSIX_ACL). See the acl(5)71+ manual page and http://acl.bestbits.at for more72+ information.7374noacl This option disables POSIX Access Control List support.75
+1-1
Makefile
···408# of make so .config is not included in this case either (for *config).409410no-dot-config-targets := clean mrproper distclean \411- cscope TAGS tags help %docs check% kernelrelease412413config-targets := 0414mixed-targets := 0
···408# of make so .config is not included in this case either (for *config).409410no-dot-config-targets := clean mrproper distclean \411+ cscope TAGS tags help %docs check%412413config-targets := 0414mixed-targets := 0
···650651 cpu = smp_processor_id();652653-#ifdef CONFIG_HOTPLUG_CPU654- if (!cpu_online(cpu)) {655- nmi_exit();656- return;657- }658-#endif659-660 ++nmi_count(cpu);661662 if (!rcu_dereference(nmi_callback)(regs, cpu))
···650651 cpu = smp_processor_id();6520000000653 ++nmi_count(cpu);654655 if (!rcu_dereference(nmi_callback)(regs, cpu))
···227 If you don't know what to do here, say N.228229config NR_CPUS230- int "Maximum number of CPUs (2-32)"231 range 2 128232 depends on SMP233 default "32" if PPC64
···227 If you don't know what to do here, say N.228229config NR_CPUS230+ int "Maximum number of CPUs (2-128)"231 range 2 128232 depends on SMP233 default "32" if PPC64
···102dev_t boot_dev;103u64 ppc64_pft_size;104105+/* Pick defaults since we might want to patch instructions106+ * before we've read this from the device tree.107+ */108+struct ppc64_caches ppc64_caches = {109+ .dline_size = 0x80,110+ .log_dline_size = 7,111+ .iline_size = 0x80,112+ .log_iline_size = 7113+};114EXPORT_SYMBOL_GPL(ppc64_caches);115116/*
+1-1
arch/powerpc/mm/hash_utils_64.c
···601 /* Handle hugepage regions */602 if (unlikely(in_hugepage_area(mm->context, ea))) {603 DBG_LOW(" -> huge page !\n");604- return hash_huge_page(mm, access, ea, vsid, local);605 }606607 /* Get PTE and page size from page tables */
···601 /* Handle hugepage regions */602 if (unlikely(in_hugepage_area(mm->context, ea))) {603 DBG_LOW(" -> huge page !\n");604+ return hash_huge_page(mm, access, ea, vsid, local, trap);605 }606607 /* Get PTE and page size from page tables */
+79-20
arch/powerpc/mm/hugetlbpage.c
···148 return 0;149}15000000151static void flush_low_segments(void *parm)152{153- u16 areas = (unsigned long) parm;154 unsigned long i;15500000000000156 asm volatile("isync" : : : "memory");157-158- BUILD_BUG_ON((sizeof(areas)*8) != NUM_LOW_AREAS);159-160 for (i = 0; i < NUM_LOW_AREAS; i++) {161- if (! (areas & (1U << i)))162 continue;163 asm volatile("slbie %0"164 : : "r" ((i << SID_SHIFT) | SLBIE_C));165 }166-167 asm volatile("isync" : : : "memory");168}169170static void flush_high_segments(void *parm)171{172- u16 areas = (unsigned long) parm;173 unsigned long i, j;174000000000000175 asm volatile("isync" : : : "memory");176-177- BUILD_BUG_ON((sizeof(areas)*8) != NUM_HIGH_AREAS);178-179 for (i = 0; i < NUM_HIGH_AREAS; i++) {180- if (! (areas & (1U << i)))181 continue;182 for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++)183 asm volatile("slbie %0"184 :: "r" (((i << HTLB_AREA_SHIFT)185- + (j << SID_SHIFT)) | SLBIE_C));186 }187-188 asm volatile("isync" : : : "memory");189}190···249static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)250{251 unsigned long i;0252253 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS);254 BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS);···265266 mm->context.low_htlb_areas |= newareas;267268- /* update the paca copy of the context struct */269- get_paca()->context = mm->context;270-271 /* the context change must make it to memory before the flush,272 * so that further SLB misses do the right thing. */273 mb();274- on_each_cpu(flush_low_segments, (void *)(unsigned long)newareas, 0, 1);000275276 return 0;277}278279static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)280{0281 unsigned long i;282283 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS);···302 /* the context change must make it to memory before the flush,303 * so that further SLB misses do the right thing. */304 mb();305- on_each_cpu(flush_high_segments, (void *)(unsigned long)newareas, 0, 1);000306307 return 0;308}···664 return -ENOMEM;665}666000000000000000000000000000667int hash_huge_page(struct mm_struct *mm, unsigned long access,668- unsigned long ea, unsigned long vsid, int local)0669{670 pte_t *ptep;671 unsigned long old_pte, new_pte;···744 rflags = 0x2 | (!(new_pte & _PAGE_RW));745 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */746 rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N);00000747748 /* Check if pte already has an hpte (case 2) */749 if (unlikely(old_pte & _PAGE_HASHPTE)) {···761 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;762 slot += (old_pte & _PAGE_F_GIX) >> 12;763764- if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)0765 old_pte &= ~_PAGE_HPTEFLAGS;766 }767
···148 return 0;149}150151+struct slb_flush_info {152+ struct mm_struct *mm;153+ u16 newareas;154+};155+156static void flush_low_segments(void *parm)157{158+ struct slb_flush_info *fi = parm;159 unsigned long i;160161+ BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_LOW_AREAS);162+163+ if (current->active_mm != fi->mm)164+ return;165+166+ /* Only need to do anything if this CPU is working in the same167+ * mm as the one which has changed */168+169+ /* update the paca copy of the context struct */170+ get_paca()->context = current->active_mm->context;171+172 asm volatile("isync" : : : "memory");000173 for (i = 0; i < NUM_LOW_AREAS; i++) {174+ if (! (fi->newareas & (1U << i)))175 continue;176 asm volatile("slbie %0"177 : : "r" ((i << SID_SHIFT) | SLBIE_C));178 }0179 asm volatile("isync" : : : "memory");180}181182static void flush_high_segments(void *parm)183{184+ struct slb_flush_info *fi = parm;185 unsigned long i, j;186187+188+ BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_HIGH_AREAS);189+190+ if (current->active_mm != fi->mm)191+ return;192+193+ /* Only need to do anything if this CPU is working in the same194+ * mm as the one which has changed */195+196+ /* update the paca copy of the context struct */197+ get_paca()->context = current->active_mm->context;198+199 asm volatile("isync" : : : "memory");000200 for (i = 0; i < NUM_HIGH_AREAS; i++) {201+ if (! (fi->newareas & (1U << i)))202 continue;203 for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++)204 asm volatile("slbie %0"205 :: "r" (((i << HTLB_AREA_SHIFT)206+ + (j << SID_SHIFT)) | SLBIE_C));207 }0208 asm volatile("isync" : : : "memory");209}210···229static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)230{231 unsigned long i;232+ struct slb_flush_info fi;233234 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS);235 BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS);···244245 mm->context.low_htlb_areas |= newareas;246000247 /* the context change must make it to memory before the flush,248 * so that further SLB misses do the right thing. */249 mb();250+251+ fi.mm = mm;252+ fi.newareas = newareas;253+ on_each_cpu(flush_low_segments, &fi, 0, 1);254255 return 0;256}257258static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)259{260+ struct slb_flush_info fi;261 unsigned long i;262263 BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS);···280 /* the context change must make it to memory before the flush,281 * so that further SLB misses do the right thing. */282 mb();283+284+ fi.mm = mm;285+ fi.newareas = newareas;286+ on_each_cpu(flush_high_segments, &fi, 0, 1);287288 return 0;289}···639 return -ENOMEM;640}641642+/*643+ * Called by asm hashtable.S for doing lazy icache flush644+ */645+static unsigned int hash_huge_page_do_lazy_icache(unsigned long rflags,646+ pte_t pte, int trap)647+{648+ struct page *page;649+ int i;650+651+ if (!pfn_valid(pte_pfn(pte)))652+ return rflags;653+654+ page = pte_page(pte);655+656+ /* page is dirty */657+ if (!test_bit(PG_arch_1, &page->flags) && !PageReserved(page)) {658+ if (trap == 0x400) {659+ for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++)660+ __flush_dcache_icache(page_address(page+i));661+ set_bit(PG_arch_1, &page->flags);662+ } else {663+ rflags |= HPTE_R_N;664+ }665+ }666+ return rflags;667+}668+669int hash_huge_page(struct mm_struct *mm, unsigned long access,670+ unsigned long ea, unsigned long vsid, int local,671+ unsigned long trap)672{673 pte_t *ptep;674 unsigned long old_pte, new_pte;···691 rflags = 0x2 | (!(new_pte & _PAGE_RW));692 /* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */693 rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N);694+ if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))695+ /* No CPU has hugepages but lacks no execute, so we696+ * don't need to worry about that case */697+ rflags = hash_huge_page_do_lazy_icache(rflags, __pte(old_pte),698+ trap);699700 /* Check if pte already has an hpte (case 2) */701 if (unlikely(old_pte & _PAGE_HASHPTE)) {···703 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;704 slot += (old_pte & _PAGE_F_GIX) >> 12;705706+ if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize,707+ local) == -1)708 old_pte &= ~_PAGE_HPTEFLAGS;709 }710
+1-1
arch/powerpc/mm/numa.c
···125126 /* We didnt find a matching region, return start/end as 0 */127 if (*start_pfn == -1UL)128- start_pfn = 0;129}130131static inline void map_cpu_to_node(int cpu, int node)
···125126 /* We didnt find a matching region, return start/end as 0 */127 if (*start_pfn == -1UL)128+ *start_pfn = 0;129}130131static inline void map_cpu_to_node(int cpu, int node)
···298 if (!(vflags & HPTE_V_BOLTED))299 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);300301-#if 1302- {303- int i;304- for (i=0;i<8;i++) {305- unsigned long w0, w1;306- plpar_pte_read(0, hpte_group, &w0, &w1);307- BUG_ON (HPTE_V_COMPARE(hpte_v, w0)308- && (w0 & HPTE_V_VALID));309- }310- }311-#endif312-313 /* Now fill in the actual HPTE */314 /* Set CEC cookie to 0 */315 /* Zero page = 0 */
···298 if (!(vflags & HPTE_V_BOLTED))299 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);300000000000000301 /* Now fill in the actual HPTE */302 /* Set CEC cookie to 0 */303 /* Zero page = 0 */
+3-3
arch/ppc/Kconfig
···767 on it (826x, 827x, 8560).768769config PPC_CHRP770- bool " Common Hardware Reference Platform (CHRP) based machines"771 depends on PPC_MULTIPLATFORM772 select PPC_I8259773 select PPC_INDIRECT_PCI774 default y775776config PPC_PMAC777- bool " Apple PowerMac based machines"778 depends on PPC_MULTIPLATFORM779 select PPC_INDIRECT_PCI780 default y···785 default y786787config PPC_PREP788- bool " PowerPC Reference Platform (PReP) based machines"789 depends on PPC_MULTIPLATFORM790 select PPC_I8259791 select PPC_INDIRECT_PCI
···767 on it (826x, 827x, 8560).768769config PPC_CHRP770+ bool771 depends on PPC_MULTIPLATFORM772 select PPC_I8259773 select PPC_INDIRECT_PCI774 default y775776config PPC_PMAC777+ bool778 depends on PPC_MULTIPLATFORM779 select PPC_INDIRECT_PCI780 default y···785 default y786787config PPC_PREP788+ bool789 depends on PPC_MULTIPLATFORM790 select PPC_I8259791 select PPC_INDIRECT_PCI
+4
arch/ppc/kernel/smp.c
···301302 /* Probe platform for CPUs: always linear. */303 num_cpus = smp_ops->probe();0000304 for (i = 0; i < num_cpus; ++i)305 cpu_set(i, cpu_possible_map);306
···301302 /* Probe platform for CPUs: always linear. */303 num_cpus = smp_ops->probe();304+305+ if (num_cpus < 2)306+ smp_tb_synchronized = 1;307+308 for (i = 0; i < num_cpus; ++i)309 cpu_set(i, cpu_possible_map);310
···943 Applications should simply open the device (eg /dev/hda1)944 with the O_DIRECT flag.945000000000946config HPET947 bool "HPET - High Precision Event Timer" if (X86 || IA64)948 default n···982 registers may also contain other things that shouldn't be983 exposed to the user. If this applies to your hardware,984 say N here.985-986-config MAX_RAW_DEVS987- int "Maximum number of RAW devices to support (1-8192)"988- depends on RAW_DRIVER989- default "256"990- help991- The maximum number of RAW devices that are supported.992- Default is 256. Increase this number in case you need lots of993- raw devices.994995config HANGCHECK_TIMER996 tristate "Hangcheck timer"
···943 Applications should simply open the device (eg /dev/hda1)944 with the O_DIRECT flag.945946+config MAX_RAW_DEVS947+ int "Maximum number of RAW devices to support (1-8192)"948+ depends on RAW_DRIVER949+ default "256"950+ help951+ The maximum number of RAW devices that are supported.952+ Default is 256. Increase this number in case you need lots of953+ raw devices.954+955config HPET956 bool "HPET - High Precision Event Timer" if (X86 || IA64)957 default n···973 registers may also contain other things that shouldn't be974 exposed to the user. If this applies to your hardware,975 say N here.000000000976977config HANGCHECK_TIMER978 tristate "Hangcheck timer"
···207 },208 /* Model ID 3 */209 {210- .model_id = 2,211 .itarget = 0x350000,212 .gd = 0x08e00000,213 .gp = 0x00566666,···219 },220 /* Model ID 5 */221 {222- .model_id = 2,223 .itarget = 0x3a0000,224 .gd = 0x15400000,225 .gp = 0x00233333,
···207 },208 /* Model ID 3 */209 {210+ .model_id = 3,211 .itarget = 0x350000,212 .gd = 0x08e00000,213 .gp = 0x00566666,···219 },220 /* Model ID 5 */221 {222+ .model_id = 5,223 .itarget = 0x3a0000,224 .gd = 0x15400000,225 .gp = 0x00233333,
+3-2
drivers/md/raid1.c
···320 * this branch is our 'one mirror IO has finished' event handler:321 */322 r1_bio->bios[mirror] = NULL;323- bio_put(bio);324 if (!uptodate) {325 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);326 /* an I/O failed, we can't clear the bitmap */···376 }377 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {378 /* free extra copy of the data pages */379-/* FIXME bio has been freed!!! */380 int i = bio->bi_vcnt;381 while (i--)382 __free_page(bio->bi_io_vec[i].bv_page);···388 md_write_end(r1_bio->mddev);389 raid_end_bio_io(r1_bio);390 }000391392 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);393 return 0;
···320 * this branch is our 'one mirror IO has finished' event handler:321 */322 r1_bio->bios[mirror] = NULL;0323 if (!uptodate) {324 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);325 /* an I/O failed, we can't clear the bitmap */···377 }378 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {379 /* free extra copy of the data pages */0380 int i = bio->bi_vcnt;381 while (i--)382 __free_page(bio->bi_io_vec[i].bv_page);···390 md_write_end(r1_bio->mddev);391 raid_end_bio_io(r1_bio);392 }393+394+ if (r1_bio->bios[mirror]==NULL)395+ bio_put(bio);396397 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);398 return 0;
···276 int i = 0, count = 0;277 u32* buffer = dev->d_i2c.cpu_addr;278 int err = 0;279- int address_err = 0;280- int short_delay = 0;281282 if (down_interruptible (&dev->i2c_lock))283 return -ERESTARTSYS;···325 if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {326 goto out;327 }328- address_err++;329 }330 DEB_I2C(("error while sending message(s). starting again.\n"));331 break;···336 break;337 }338339- /* delay a bit before retrying */340- msleep(10);341342 } while (err != num && retries--);343344- /* if every retry had an address error, exit right away */345- if (address_err == retries) {346- goto out;347 }348349 /* if any things had to be read, get the results */
···276 int i = 0, count = 0;277 u32* buffer = dev->d_i2c.cpu_addr;278 int err = 0;279+ int address_err = 0;280+ int short_delay = 0;281282 if (down_interruptible (&dev->i2c_lock))283 return -ERESTARTSYS;···325 if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) {326 goto out;327 }328+ address_err++;329 }330 DEB_I2C(("error while sending message(s). starting again.\n"));331 break;···336 break;337 }338339+ /* delay a bit before retrying */340+ msleep(10);341342 } while (err != num && retries--);343344+ /* if every retry had an address error, exit right away */345+ if (address_err == retries) {346+ goto out;347 }348349 /* if any things had to be read, get the results */
+2-2
drivers/media/common/saa7146_vbi.c
···6{7 struct saa7146_vv *vv = dev->vv_data;89- u32 *cpu;10- dma_addr_t dma_addr;1112 int count = 0;13 int i;
···6{7 struct saa7146_vv *vv = dev->vv_data;89+ u32 *cpu;10+ dma_addr_t dma_addr;1112 int count = 0;13 int i;
+23-23
drivers/media/common/saa7146_video.c
···150 maxh = vv->standard->v_max_out;151152 if (V4L2_FIELD_ANY == field) {153- field = (win->w.height > maxh/2)154- ? V4L2_FIELD_INTERLACED155- : V4L2_FIELD_TOP;156- }157- switch (field) {158- case V4L2_FIELD_TOP:159- case V4L2_FIELD_BOTTOM:160- case V4L2_FIELD_ALTERNATE:161- maxh = maxh / 2;162- break;163- case V4L2_FIELD_INTERLACED:164- break;165- default: {166 DEB_D(("no known field mode '%d'.\n",field));167- return -EINVAL;168 }169- }170171 win->field = field;172 if (win->w.width > maxw)···887888 DEB_EE(("VIDIOC_QUERYCAP\n"));889890- strcpy(cap->driver, "saa7146 v4l2");891 strlcpy(cap->card, dev->ext->name, sizeof(cap->card));892 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));893 cap->version = SAA7146_VERSION_CODE;···1011 err = set_control(fh,arg);1012 return err;1013 }1014- case VIDIOC_G_PARM:1015- {1016- struct v4l2_streamparm *parm = arg;1017 if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) {1018 return -EINVAL;1019 }1020- memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm));1021 parm->parm.capture.readbuffers = 1;1022 // fixme: only for PAL!1023 parm->parm.capture.timeperframe.numerator = 1;1024 parm->parm.capture.timeperframe.denominator = 25;1025- return 0;1026- }1027 case VIDIOC_G_FMT:1028 {1029 struct v4l2_format *f = arg;···13831384static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)1385{1386- INIT_LIST_HEAD(&vv->video_q.queue);13871388 init_timer(&vv->video_q.timeout);1389 vv->video_q.timeout.function = saa7146_buffer_timeout;
···150 maxh = vv->standard->v_max_out;151152 if (V4L2_FIELD_ANY == field) {153+ field = (win->w.height > maxh/2)154+ ? V4L2_FIELD_INTERLACED155+ : V4L2_FIELD_TOP;156+ }157+ switch (field) {158+ case V4L2_FIELD_TOP:159+ case V4L2_FIELD_BOTTOM:160+ case V4L2_FIELD_ALTERNATE:161+ maxh = maxh / 2;162+ break;163+ case V4L2_FIELD_INTERLACED:164+ break;165+ default: {166 DEB_D(("no known field mode '%d'.\n",field));167+ return -EINVAL;168 }169+ }170171 win->field = field;172 if (win->w.width > maxw)···887888 DEB_EE(("VIDIOC_QUERYCAP\n"));889890+ strcpy(cap->driver, "saa7146 v4l2");891 strlcpy(cap->card, dev->ext->name, sizeof(cap->card));892 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));893 cap->version = SAA7146_VERSION_CODE;···1011 err = set_control(fh,arg);1012 return err;1013 }1014+ case VIDIOC_G_PARM:1015+ {1016+ struct v4l2_streamparm *parm = arg;1017 if( parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ) {1018 return -EINVAL;1019 }1020+ memset(&parm->parm.capture,0,sizeof(struct v4l2_captureparm));1021 parm->parm.capture.readbuffers = 1;1022 // fixme: only for PAL!1023 parm->parm.capture.timeperframe.numerator = 1;1024 parm->parm.capture.timeperframe.denominator = 25;1025+ return 0;1026+ }1027 case VIDIOC_G_FMT:1028 {1029 struct v4l2_format *f = arg;···13831384static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)1385{1386+ INIT_LIST_HEAD(&vv->video_q.queue);13871388 init_timer(&vv->video_q.timeout);1389 vv->video_q.timeout.function = saa7146_buffer_timeout;
+1-1
drivers/media/dvb/b2c2/flexcop-common.h
···132 * I2C-channel of the flexcop.133 */134int flexcop_i2c_request(struct flexcop_device*, flexcop_access_op_t,135- flexcop_i2c_port_t, u8 chipaddr, u8 addr, u8 *buf, u16 len);136137/* from flexcop-sram.c */138int flexcop_sram_set_dest(struct flexcop_device *fc, flexcop_sram_dest_t dest, flexcop_sram_dest_target_t target);
···132 * I2C-channel of the flexcop.133 */134int flexcop_i2c_request(struct flexcop_device*, flexcop_access_op_t,135+ flexcop_i2c_port_t, u8 chipaddr, u8 addr, u8 *buf, u16 len);136137/* from flexcop-sram.c */138int flexcop_sram_set_dest(struct flexcop_device *fc, flexcop_sram_dest_t dest, flexcop_sram_dest_target_t target);
···8687enum dmx_ts_pes88{ /* also send packets to decoder (if it exists) */89- DMX_TS_PES_AUDIO0,90 DMX_TS_PES_VIDEO0,91 DMX_TS_PES_TELETEXT0,92 DMX_TS_PES_SUBTITLE0,93 DMX_TS_PES_PCR0,9495- DMX_TS_PES_AUDIO1,96 DMX_TS_PES_VIDEO1,97 DMX_TS_PES_TELETEXT1,98 DMX_TS_PES_SUBTITLE1,99 DMX_TS_PES_PCR1,100101- DMX_TS_PES_AUDIO2,102 DMX_TS_PES_VIDEO2,103 DMX_TS_PES_TELETEXT2,104 DMX_TS_PES_SUBTITLE2,105 DMX_TS_PES_PCR2,106107- DMX_TS_PES_AUDIO3,108 DMX_TS_PES_VIDEO3,109 DMX_TS_PES_TELETEXT3,110 DMX_TS_PES_SUBTITLE3,···121122123struct dmx_ts_feed {124- int is_filtering; /* Set to non-zero when filtering in progress */125- struct dmx_demux *parent; /* Back-pointer */126- void *priv; /* Pointer to private data of the API client */127- int (*set) (struct dmx_ts_feed *feed,128 u16 pid,129 int type,130 enum dmx_ts_pes pes_type,131 size_t circular_buffer_size,132 struct timespec timeout);133- int (*start_filtering) (struct dmx_ts_feed* feed);134- int (*stop_filtering) (struct dmx_ts_feed* feed);135};136137/*--------------------------------------------------------------------------*/···139/*--------------------------------------------------------------------------*/140141struct dmx_section_filter {142- u8 filter_value [DMX_MAX_FILTER_SIZE];143- u8 filter_mask [DMX_MAX_FILTER_SIZE];144- u8 filter_mode [DMX_MAX_FILTER_SIZE];145- struct dmx_section_feed* parent; /* Back-pointer */146- void* priv; /* Pointer to private data of the API client */147};148149struct dmx_section_feed {150- int is_filtering; /* Set to non-zero when filtering in progress */151- struct dmx_demux* parent; /* Back-pointer */152- void* priv; /* Pointer to private data of the API client */153154- int check_crc;155 u32 crc_val;156157- u8 *secbuf;158- u8 secbuf_base[DMX_MAX_SECFEED_SIZE];159- u16 secbufp, seclen, tsfeedp;160161- int (*set) (struct dmx_section_feed* feed,162 u16 pid,163 size_t circular_buffer_size,164 int check_crc);165- int (*allocate_filter) (struct dmx_section_feed* feed,166 struct dmx_section_filter** filter);167- int (*release_filter) (struct dmx_section_feed* feed,168 struct dmx_section_filter* filter);169- int (*start_filtering) (struct dmx_section_feed* feed);170- int (*stop_filtering) (struct dmx_section_feed* feed);171};172173/*--------------------------------------------------------------------------*/···205};206207struct dmx_frontend {208- struct list_head connectivity_list; /* List of front-ends that can209 be connected to a particular210 demux */211- enum dmx_frontend_source source;212};213214/*--------------------------------------------------------------------------*/···240#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list)241242struct dmx_demux {243- u32 capabilities; /* Bitfield of capability flags */244- struct dmx_frontend* frontend; /* Front-end connected to the demux */245- void* priv; /* Pointer to private data of the API client */246- int (*open) (struct dmx_demux* demux);247- int (*close) (struct dmx_demux* demux);248- int (*write) (struct dmx_demux* demux, const char* buf, size_t count);249- int (*allocate_ts_feed) (struct dmx_demux* demux,250 struct dmx_ts_feed** feed,251 dmx_ts_cb callback);252- int (*release_ts_feed) (struct dmx_demux* demux,253 struct dmx_ts_feed* feed);254- int (*allocate_section_feed) (struct dmx_demux* demux,255 struct dmx_section_feed** feed,256 dmx_section_cb callback);257- int (*release_section_feed) (struct dmx_demux* demux,258 struct dmx_section_feed* feed);259- int (*add_frontend) (struct dmx_demux* demux,260 struct dmx_frontend* frontend);261- int (*remove_frontend) (struct dmx_demux* demux,262 struct dmx_frontend* frontend);263- struct list_head* (*get_frontends) (struct dmx_demux* demux);264- int (*connect_frontend) (struct dmx_demux* demux,265 struct dmx_frontend* frontend);266- int (*disconnect_frontend) (struct dmx_demux* demux);267268- int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids);269270 int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps);271272 int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src);273274- int (*get_stc) (struct dmx_demux* demux, unsigned int num,275 u64 *stc, unsigned int *base);276};277
···8687enum dmx_ts_pes88{ /* also send packets to decoder (if it exists) */89+ DMX_TS_PES_AUDIO0,90 DMX_TS_PES_VIDEO0,91 DMX_TS_PES_TELETEXT0,92 DMX_TS_PES_SUBTITLE0,93 DMX_TS_PES_PCR0,9495+ DMX_TS_PES_AUDIO1,96 DMX_TS_PES_VIDEO1,97 DMX_TS_PES_TELETEXT1,98 DMX_TS_PES_SUBTITLE1,99 DMX_TS_PES_PCR1,100101+ DMX_TS_PES_AUDIO2,102 DMX_TS_PES_VIDEO2,103 DMX_TS_PES_TELETEXT2,104 DMX_TS_PES_SUBTITLE2,105 DMX_TS_PES_PCR2,106107+ DMX_TS_PES_AUDIO3,108 DMX_TS_PES_VIDEO3,109 DMX_TS_PES_TELETEXT3,110 DMX_TS_PES_SUBTITLE3,···121122123struct dmx_ts_feed {124+ int is_filtering; /* Set to non-zero when filtering in progress */125+ struct dmx_demux *parent; /* Back-pointer */126+ void *priv; /* Pointer to private data of the API client */127+ int (*set) (struct dmx_ts_feed *feed,128 u16 pid,129 int type,130 enum dmx_ts_pes pes_type,131 size_t circular_buffer_size,132 struct timespec timeout);133+ int (*start_filtering) (struct dmx_ts_feed* feed);134+ int (*stop_filtering) (struct dmx_ts_feed* feed);135};136137/*--------------------------------------------------------------------------*/···139/*--------------------------------------------------------------------------*/140141struct dmx_section_filter {142+ u8 filter_value [DMX_MAX_FILTER_SIZE];143+ u8 filter_mask [DMX_MAX_FILTER_SIZE];144+ u8 filter_mode [DMX_MAX_FILTER_SIZE];145+ struct dmx_section_feed* parent; /* Back-pointer */146+ void* priv; /* Pointer to private data of the API client */147};148149struct dmx_section_feed {150+ int is_filtering; /* Set to non-zero when filtering in progress */151+ struct dmx_demux* parent; /* Back-pointer */152+ void* priv; /* Pointer to private data of the API client */153154+ int check_crc;155 u32 crc_val;156157+ u8 *secbuf;158+ u8 secbuf_base[DMX_MAX_SECFEED_SIZE];159+ u16 secbufp, seclen, tsfeedp;160161+ int (*set) (struct dmx_section_feed* feed,162 u16 pid,163 size_t circular_buffer_size,164 int check_crc);165+ int (*allocate_filter) (struct dmx_section_feed* feed,166 struct dmx_section_filter** filter);167+ int (*release_filter) (struct dmx_section_feed* feed,168 struct dmx_section_filter* filter);169+ int (*start_filtering) (struct dmx_section_feed* feed);170+ int (*stop_filtering) (struct dmx_section_feed* feed);171};172173/*--------------------------------------------------------------------------*/···205};206207struct dmx_frontend {208+ struct list_head connectivity_list; /* List of front-ends that can209 be connected to a particular210 demux */211+ enum dmx_frontend_source source;212};213214/*--------------------------------------------------------------------------*/···240#define DMX_FE_ENTRY(list) list_entry(list, struct dmx_frontend, connectivity_list)241242struct dmx_demux {243+ u32 capabilities; /* Bitfield of capability flags */244+ struct dmx_frontend* frontend; /* Front-end connected to the demux */245+ void* priv; /* Pointer to private data of the API client */246+ int (*open) (struct dmx_demux* demux);247+ int (*close) (struct dmx_demux* demux);248+ int (*write) (struct dmx_demux* demux, const char* buf, size_t count);249+ int (*allocate_ts_feed) (struct dmx_demux* demux,250 struct dmx_ts_feed** feed,251 dmx_ts_cb callback);252+ int (*release_ts_feed) (struct dmx_demux* demux,253 struct dmx_ts_feed* feed);254+ int (*allocate_section_feed) (struct dmx_demux* demux,255 struct dmx_section_feed** feed,256 dmx_section_cb callback);257+ int (*release_section_feed) (struct dmx_demux* demux,258 struct dmx_section_feed* feed);259+ int (*add_frontend) (struct dmx_demux* demux,260 struct dmx_frontend* frontend);261+ int (*remove_frontend) (struct dmx_demux* demux,262 struct dmx_frontend* frontend);263+ struct list_head* (*get_frontends) (struct dmx_demux* demux);264+ int (*connect_frontend) (struct dmx_demux* demux,265 struct dmx_frontend* frontend);266+ int (*disconnect_frontend) (struct dmx_demux* demux);267268+ int (*get_pes_pids) (struct dmx_demux* demux, u16 *pids);269270 int (*get_caps) (struct dmx_demux* demux, struct dmx_caps *caps);271272 int (*set_source) (struct dmx_demux* demux, const dmx_source_t *src);273274+ int (*get_stc) (struct dmx_demux* demux, unsigned int num,275 u64 *stc, unsigned int *base);276};277
+1-1
drivers/media/dvb/dvb-core/dmxdev.c
···947948 case DMX_GET_STC:949 if (!dmxdev->demux->get_stc) {950- ret=-EINVAL;951 break;952 }953 ret = dmxdev->demux->get_stc(dmxdev->demux,
···947948 case DMX_GET_STC:949 if (!dmxdev->demux->get_stc) {950+ ret=-EINVAL;951 break;952 }953 ret = dmxdev->demux->get_stc(dmxdev->demux,
+32-32
drivers/media/dvb/dvb-core/dmxdev.h
···53};5455struct dmxdev_buffer {56- u8 *data;57- int size;58- int pread;59- int pwrite;60 wait_queue_head_t queue;61- int error;62};6364struct dmxdev_filter {65 struct dvb_device *dvbdev;6667- union {68- struct dmx_section_filter *sec;69 } filter;7071- union {72- struct dmx_ts_feed *ts;73- struct dmx_section_feed *sec;74 } feed;7576- union {77- struct dmx_sct_filter_params sec;78- struct dmx_pes_filter_params pes;79 } params;8081- int type;82- enum dmxdev_state state;83- struct dmxdev *dev;84- struct dmxdev_buffer buffer;8586 struct semaphore mutex;8788- /* only for sections */89- struct timer_list timer;90- int todo;91- u8 secheader[3];9293- u16 pid;94};959697struct dmxdev_dvr {98- int state;99- struct dmxdev *dev;100- struct dmxdev_buffer buffer;101};102103···105 struct dvb_device *dvbdev;106 struct dvb_device *dvr_dvbdev;107108- struct dmxdev_filter *filter;109- struct dmxdev_dvr *dvr;110- struct dmx_demux *demux;111112- int filternum;113- int capabilities;114#define DMXDEV_CAP_DUPLEX 1115- struct dmx_frontend *dvr_orig_fe;116117- struct dmxdev_buffer dvr_buffer;118#define DVR_BUFFER_SIZE (10*188*1024)119120 struct semaphore mutex;
···53};5455struct dmxdev_buffer {56+ u8 *data;57+ int size;58+ int pread;59+ int pwrite;60 wait_queue_head_t queue;61+ int error;62};6364struct dmxdev_filter {65 struct dvb_device *dvbdev;6667+ union {68+ struct dmx_section_filter *sec;69 } filter;7071+ union {72+ struct dmx_ts_feed *ts;73+ struct dmx_section_feed *sec;74 } feed;7576+ union {77+ struct dmx_sct_filter_params sec;78+ struct dmx_pes_filter_params pes;79 } params;8081+ int type;82+ enum dmxdev_state state;83+ struct dmxdev *dev;84+ struct dmxdev_buffer buffer;8586 struct semaphore mutex;8788+ /* only for sections */89+ struct timer_list timer;90+ int todo;91+ u8 secheader[3];9293+ u16 pid;94};959697struct dmxdev_dvr {98+ int state;99+ struct dmxdev *dev;100+ struct dmxdev_buffer buffer;101};102103···105 struct dvb_device *dvbdev;106 struct dvb_device *dvr_dvbdev;107108+ struct dmxdev_filter *filter;109+ struct dmxdev_dvr *dvr;110+ struct dmx_demux *demux;111112+ int filternum;113+ int capabilities;114#define DMXDEV_CAP_DUPLEX 1115+ struct dmx_frontend *dvr_orig_fe;116117+ struct dmxdev_buffer dvr_buffer;118#define DVR_BUFFER_SIZE (10*188*1024)119120 struct semaphore mutex;
+1-1
drivers/media/dvb/dvb-core/dvb_ca_en50221.c
···498 /* process the CFTABLE_ENTRY tuples, and any after those */499 while ((!end_chain) && (address < 0x1000)) {500 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType,501- &tupleLength, tuple)) < 0)502 return status;503 switch (tupleType) {504 case 0x1B: // CISTPL_CFTABLE_ENTRY
···498 /* process the CFTABLE_ENTRY tuples, and any after those */499 while ((!end_chain) && (address < 0x1000)) {500 if ((status = dvb_ca_en50221_read_tuple(ca, slot, &address, &tupleType,501+ &tupleLength, tuple)) < 0)502 return status;503 switch (tupleType) {504 case 0x1B: // CISTPL_CFTABLE_ENTRY
···41#include "dvbdev.h"4243struct dvb_frontend_tune_settings {44- int min_delay_ms;45- int step_size;46- int max_drift;47- struct dvb_frontend_parameters parameters;48};4950struct dvb_frontend;
···41#include "dvbdev.h"4243struct dvb_frontend_tune_settings {44+ int min_delay_ms;45+ int step_size;46+ int max_drift;47+ struct dvb_frontend_parameters parameters;48};4950struct dvb_frontend;
···31#include <linux/wait.h>3233struct dvb_ringbuffer {34- u8 *data;35- ssize_t size;36- ssize_t pread;37- ssize_t pwrite;3839- wait_queue_head_t queue;40- spinlock_t lock;41};4243#define DVB_RINGBUFFER_PKTHDRSIZE 3···106** returns number of bytes transferred or -EFAULT107*/108extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,109- size_t len, int usermem);110111112/* write routines & macros */···121** returns number of bytes transferred or -EFAULT122*/123extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,124- size_t len);125126127/**···133 * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.134 */135extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,136- size_t len);137138/**139 * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this···149 * returns Number of bytes read, or -EFAULT.150 */151extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,152- int offset, u8* buf, size_t len, int usermem);153154/**155 * Dispose of a packet in the ring buffer.
···31#include <linux/wait.h>3233struct dvb_ringbuffer {34+ u8 *data;35+ ssize_t size;36+ ssize_t pread;37+ ssize_t pwrite;3839+ wait_queue_head_t queue;40+ spinlock_t lock;41};4243#define DVB_RINGBUFFER_PKTHDRSIZE 3···106** returns number of bytes transferred or -EFAULT107*/108extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,109+ size_t len, int usermem);110111112/* write routines & macros */···121** returns number of bytes transferred or -EFAULT122*/123extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,124+ size_t len);125126127/**···133 * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.134 */135extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,136+ size_t len);137138/**139 * Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this···149 * returns Number of bytes read, or -EFAULT.150 */151extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,152+ int offset, u8* buf, size_t len, int usermem);153154/**155 * Dispose of a packet in the ring buffer.
+66-66
drivers/media/dvb/dvb-core/dvbdev.c
···47static DECLARE_MUTEX(dvbdev_register_lock);4849static const char * const dnames[] = {50- "video", "audio", "sec", "frontend", "demux", "dvr", "ca",51 "net", "osd"52};53···9091 file->private_data = dvbdev;92 old_fops = file->f_op;93- file->f_op = fops_get(dvbdev->fops);94- if(file->f_op->open)95- err = file->f_op->open(inode,file);96- if (err) {97- fops_put(file->f_op);98- file->f_op = fops_get(old_fops);99- }100- fops_put(old_fops);101- return err;102 }103 return -ENODEV;104}···117118int dvb_generic_open(struct inode *inode, struct file *file)119{120- struct dvb_device *dvbdev = file->private_data;121122- if (!dvbdev)123- return -ENODEV;124125 if (!dvbdev->users)126- return -EBUSY;127128 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {129- if (!dvbdev->readers)130- return -EBUSY;131 dvbdev->readers--;132 } else {133- if (!dvbdev->writers)134- return -EBUSY;135 dvbdev->writers--;136 }137···143144int dvb_generic_release(struct inode *inode, struct file *file)145{146- struct dvb_device *dvbdev = file->private_data;147148 if (!dvbdev)149- return -ENODEV;150151 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {152 dvbdev->readers++;···163int dvb_generic_ioctl(struct inode *inode, struct file *file,164 unsigned int cmd, unsigned long arg)165{166- struct dvb_device *dvbdev = file->private_data;167168- if (!dvbdev)169- return -ENODEV;170171 if (!dvbdev->kernel_ioctl)172 return -EINVAL;···334 to the v4l "videodev.o" module, which is unnecessary for some335 cards (ie. the budget dvb-cards don't need the v4l module...) */336int dvb_usercopy(struct inode *inode, struct file *file,337- unsigned int cmd, unsigned long arg,338 int (*func)(struct inode *inode, struct file *file,339 unsigned int cmd, void *arg))340{341- char sbuf[128];342- void *mbuf = NULL;343- void *parg = NULL;344- int err = -EINVAL;345346- /* Copy arguments into temp kernel buffer */347- switch (_IOC_DIR(cmd)) {348- case _IOC_NONE:349 /*350 * For this command, the pointer is actually an integer351 * argument.352 */353 parg = (void *) arg;354 break;355- case _IOC_READ: /* some v4l ioctls are marked wrong ... */356- case _IOC_WRITE:357- case (_IOC_WRITE | _IOC_READ):358- if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {359- parg = sbuf;360- } else {361- /* too big to allocate from stack */362- mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);363- if (NULL == mbuf)364- return -ENOMEM;365- parg = mbuf;366- }367368- err = -EFAULT;369- if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))370- goto out;371- break;372- }373374- /* call driver */375- if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)376- err = -EINVAL;377378- if (err < 0)379- goto out;380381- /* Copy results into user buffer */382- switch (_IOC_DIR(cmd))383- {384- case _IOC_READ:385- case (_IOC_WRITE | _IOC_READ):386- if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))387- err = -EFAULT;388- break;389- }390391out:392- kfree(mbuf);393- return err;394}395396static int __init init_dvbdev(void)···427428static void __exit exit_dvbdev(void)429{430- devfs_remove("dvb");431 class_destroy(dvb_class);432 cdev_del(&dvb_device_cdev);433- unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);434}435436module_init(init_dvbdev);
···47static DECLARE_MUTEX(dvbdev_register_lock);4849static const char * const dnames[] = {50+ "video", "audio", "sec", "frontend", "demux", "dvr", "ca",51 "net", "osd"52};53···9091 file->private_data = dvbdev;92 old_fops = file->f_op;93+ file->f_op = fops_get(dvbdev->fops);94+ if(file->f_op->open)95+ err = file->f_op->open(inode,file);96+ if (err) {97+ fops_put(file->f_op);98+ file->f_op = fops_get(old_fops);99+ }100+ fops_put(old_fops);101+ return err;102 }103 return -ENODEV;104}···117118int dvb_generic_open(struct inode *inode, struct file *file)119{120+ struct dvb_device *dvbdev = file->private_data;121122+ if (!dvbdev)123+ return -ENODEV;124125 if (!dvbdev->users)126+ return -EBUSY;127128 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {129+ if (!dvbdev->readers)130+ return -EBUSY;131 dvbdev->readers--;132 } else {133+ if (!dvbdev->writers)134+ return -EBUSY;135 dvbdev->writers--;136 }137···143144int dvb_generic_release(struct inode *inode, struct file *file)145{146+ struct dvb_device *dvbdev = file->private_data;147148 if (!dvbdev)149+ return -ENODEV;150151 if ((file->f_flags & O_ACCMODE) == O_RDONLY) {152 dvbdev->readers++;···163int dvb_generic_ioctl(struct inode *inode, struct file *file,164 unsigned int cmd, unsigned long arg)165{166+ struct dvb_device *dvbdev = file->private_data;167168+ if (!dvbdev)169+ return -ENODEV;170171 if (!dvbdev->kernel_ioctl)172 return -EINVAL;···334 to the v4l "videodev.o" module, which is unnecessary for some335 cards (ie. the budget dvb-cards don't need the v4l module...) */336int dvb_usercopy(struct inode *inode, struct file *file,337+ unsigned int cmd, unsigned long arg,338 int (*func)(struct inode *inode, struct file *file,339 unsigned int cmd, void *arg))340{341+ char sbuf[128];342+ void *mbuf = NULL;343+ void *parg = NULL;344+ int err = -EINVAL;345346+ /* Copy arguments into temp kernel buffer */347+ switch (_IOC_DIR(cmd)) {348+ case _IOC_NONE:349 /*350 * For this command, the pointer is actually an integer351 * argument.352 */353 parg = (void *) arg;354 break;355+ case _IOC_READ: /* some v4l ioctls are marked wrong ... */356+ case _IOC_WRITE:357+ case (_IOC_WRITE | _IOC_READ):358+ if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {359+ parg = sbuf;360+ } else {361+ /* too big to allocate from stack */362+ mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);363+ if (NULL == mbuf)364+ return -ENOMEM;365+ parg = mbuf;366+ }367368+ err = -EFAULT;369+ if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))370+ goto out;371+ break;372+ }373374+ /* call driver */375+ if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)376+ err = -EINVAL;377378+ if (err < 0)379+ goto out;380381+ /* Copy results into user buffer */382+ switch (_IOC_DIR(cmd))383+ {384+ case _IOC_READ:385+ case (_IOC_WRITE | _IOC_READ):386+ if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))387+ err = -EFAULT;388+ break;389+ }390391out:392+ kfree(mbuf);393+ return err;394}395396static int __init init_dvbdev(void)···427428static void __exit exit_dvbdev(void)429{430+ devfs_remove("dvb");431 class_destroy(dvb_class);432 cdev_del(&dvb_device_cdev);433+ unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);434}435436module_init(init_dvbdev);
+3-3
drivers/media/dvb/dvb-core/dvbdev.h
···68 int writers;69 int users;7071- /* don't really need those !? -- FIXME: use video_usercopy */72- int (*kernel_ioctl)(struct inode *inode, struct file *file,73 unsigned int cmd, void *arg);7475 void *priv;···97generic_usercopy() someday... */9899extern int dvb_usercopy(struct inode *inode, struct file *file,100- unsigned int cmd, unsigned long arg,101 int (*func)(struct inode *inode, struct file *file,102 unsigned int cmd, void *arg));103
···68 int writers;69 int users;7071+ /* don't really need those !? -- FIXME: use video_usercopy */72+ int (*kernel_ioctl)(struct inode *inode, struct file *file,73 unsigned int cmd, void *arg);7475 void *priv;···97generic_usercopy() someday... */9899extern int dvb_usercopy(struct inode *inode, struct file *file,100+ unsigned int cmd, unsigned long arg,101 int (*func)(struct inode *inode, struct file *file,102 unsigned int cmd, void *arg));103
···55 } while (0)5657static struct {u8 reg; u8 data;} cx24110_regdata[]=58- /* Comments beginning with @ denote this value should59- be the default */60- {{0x09,0x01}, /* SoftResetAll */61- {0x09,0x00}, /* release reset */62- {0x01,0xe8}, /* MSB of code rate 27.5MS/s */63- {0x02,0x17}, /* middle byte " */64- {0x03,0x29}, /* LSB " */65- {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */66- {0x06,0xa5}, /* @ PLL 60MHz */67- {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */68- {0x0a,0x00}, /* @ partial chip disables, do not set */69- {0x0b,0x01}, /* set output clock in gapped mode, start signal low70- active for first byte */71- {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */72- {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */73- {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 174- to avoid starting the BER counter. Reset the75- CRC test bit. Finite counting selected */76- {0x15,0xff}, /* @ size of the limited time window for RS BER77- estimation. It is <value>*256 RS blocks, this78- gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */79- {0x16,0x00}, /* @ enable all RS output ports */80- {0x17,0x04}, /* @ time window allowed for the RS to sync */81- {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned82- for automatically */83- /* leave the current code rate and normalization84- registers as they are after reset... */85- {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting86- only once */87- {0x23,0x18}, /* @ size of the limited time window for Viterbi BER88- estimation. It is <value>*65536 channel bits, i.e.89- approx. 38ms at 27.5MS/s, rate 3/4 */90- {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */91- /* leave front-end AGC parameters at default values */92- /* leave decimation AGC parameters at default values */93- {0x35,0x40}, /* disable all interrupts. They are not connected anyway */94- {0x36,0xff}, /* clear all interrupt pending flags */95- {0x37,0x00}, /* @ fully enable AutoAcqq state machine */96- {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */97- /* leave the equalizer parameters on their default values */98- /* leave the final AGC parameters on their default values */99- {0x41,0x00}, /* @ MSB of front-end derotator frequency */100- {0x42,0x00}, /* @ middle bytes " */101- {0x43,0x00}, /* @ LSB " */102- /* leave the carrier tracking loop parameters on default */103- /* leave the bit timing loop parameters at gefault */104- {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */105- /* the cx24108 data sheet for symbol rates above 15MS/s */106- {0x57,0x00}, /* @ Filter sigma delta enabled, positive */107- {0x61,0x95}, /* GPIO pins 1-4 have special function */108- {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */109- {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */110- {0x64,0x20}, /* GPIO 6 is input, all others are outputs */111- {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */112- {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */113- {0x73,0x00}, /* @ disable several demod bypasses */114- {0x74,0x00}, /* @ " */115- {0x75,0x00} /* @ " */116- /* the remaining registers are for SEC */117 };118119120static int cx24110_writereg (struct cx24110_state* state, int reg, int data)121{122- u8 buf [] = { reg, data };123 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };124 int err;125126- if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {127 dprintk ("%s: writereg error (err == %i, reg == 0x%02x,"128 " data == 0x%02x)\n", __FUNCTION__, err, reg, data);129 return -EREMOTEIO;130 }131132- return 0;133}134135static int cx24110_readreg (struct cx24110_state* state, u8 reg)···153154 switch (inversion) {155 case INVERSION_OFF:156- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);157- /* AcqSpectrInvDis on. No idea why someone should want this */158- cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7);159- /* Initial value 0 at start of acq */160- cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef);161- /* current value 0 */162- /* The cx24110 manual tells us this reg is read-only.163- But what the heck... set it ayways */164- break;165 case INVERSION_ON:166- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);167- /* AcqSpectrInvDis on. No idea why someone should want this */168- cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08);169- /* Initial value 1 at start of acq */170- cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10);171- /* current value 1 */172- break;173 case INVERSION_AUTO:174- cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe);175- /* AcqSpectrInvDis off. Leave initial & current states as is */176- break;177 default:178 return -EINVAL;179 }···185{186/* fixme (low): error handling */187188- static const int rate[]={-1,1,2,3,5,7,-1};189- static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1};190- static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1};191192- /* Well, the AutoAcq engine of the cx24106 and 24110 automatically193- searches all enabled viterbi rates, and can handle non-standard194- rates as well. */195196- if (fec>FEC_AUTO)197- fec=FEC_AUTO;198199- if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */200 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xdf);201 /* clear AcqVitDis bit */202 cx24110_writereg(state,0x18,0xae);···208 cx24110_writereg(state,0x1a,0x05); cx24110_writereg(state,0x1b,0x06);209 /* set the puncture registers for code rate 3/4 */210 return 0;211- } else {212 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x20);213 /* set AcqVitDis bit */214 if(rate[fec]>0) {···219 cx24110_writereg(state,0x1a,g1[fec]);220 cx24110_writereg(state,0x1b,g2[fec]);221 /* not sure if this is the right way: I always used AutoAcq mode */222- } else223 return -EOPNOTSUPP;224/* fixme (low): which is the correct return code? */225- };226 return 0;227}228···245static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)246{247/* fixme (low): add error handling */248- u32 ratio;249- u32 tmp, fclk, BDRI;250251- static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};252- int i;253254dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate);255- if (srate>90999000UL/2)256- srate=90999000UL/2;257- if (srate<500000)258- srate=500000;259260- for(i=0;(i<sizeof(bands)/sizeof(bands[0]))&&(srate>bands[i]);i++)261 ;262- /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz,263- and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult,264- R06[3:0] PLLphaseDetGain */265- tmp=cx24110_readreg(state,0x07)&0xfc;266- if(srate<90999000UL/4) { /* sample rate 45MHz*/267 cx24110_writereg(state,0x07,tmp);268 cx24110_writereg(state,0x06,0x78);269 fclk=90999000UL/2;270- } else if(srate<60666000UL/2) { /* sample rate 60MHz */271 cx24110_writereg(state,0x07,tmp|0x1);272 cx24110_writereg(state,0x06,0xa5);273 fclk=60666000UL;274- } else if(srate<80888000UL/2) { /* sample rate 80MHz */275 cx24110_writereg(state,0x07,tmp|0x2);276 cx24110_writereg(state,0x06,0x87);277 fclk=80888000UL;278- } else { /* sample rate 90MHz */279 cx24110_writereg(state,0x07,tmp|0x3);280 cx24110_writereg(state,0x06,0x78);281 fclk=90999000UL;282- };283- dprintk("cx24110 debug: fclk %d Hz\n",fclk);284- /* we need to divide two integers with approx. 27 bits in 32 bit285- arithmetic giving a 25 bit result */286- /* the maximum dividend is 90999000/2, 0x02b6446c, this number is287- also the most complex divisor. Hence, the dividend has,288- assuming 32bit unsigned arithmetic, 6 clear bits on top, the289- divisor 2 unused bits at the bottom. Also, the quotient is290- always less than 1/2. Borrowed from VES1893.c, of course */291292- tmp=srate<<6;293- BDRI=fclk>>2;294- ratio=(tmp/BDRI);295296- tmp=(tmp%BDRI)<<8;297- ratio=(ratio<<8)+(tmp/BDRI);298299- tmp=(tmp%BDRI)<<8;300- ratio=(ratio<<8)+(tmp/BDRI);301302- tmp=(tmp%BDRI)<<1;303- ratio=(ratio<<1)+(tmp/BDRI);304305- dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]);306- dprintk("fclk = %d\n", fclk);307- dprintk("ratio= %08x\n", ratio);308309- cx24110_writereg(state, 0x1, (ratio>>16)&0xff);310- cx24110_writereg(state, 0x2, (ratio>>8)&0xff);311- cx24110_writereg(state, 0x3, (ratio)&0xff);312313- return 0;314315}316···324325 dprintk("cx24110 debug: cx24108_write(%8.8x)\n",data);326327- cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */328- cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */329330- /* if the auto tuner writer is still busy, clear it out */331- while (cx24110_readreg(state,0x6d)&0x80)332 cx24110_writereg(state,0x72,0);333334- /* write the topmost 8 bits */335- cx24110_writereg(state,0x72,(data>>24)&0xff);336337- /* wait for the send to be completed */338- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)339 ;340341- /* send another 8 bytes */342- cx24110_writereg(state,0x72,(data>>16)&0xff);343- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)344 ;345346- /* and the topmost 5 bits of this byte */347- cx24110_writereg(state,0x72,(data>>8)&0xff);348- while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)349 ;350351- /* now strobe the enable line once */352- cx24110_writereg(state,0x6d,0x32);353- cx24110_writereg(state,0x6d,0x30);354355- return 0;356}357358static int cx24110_initfe(struct dvb_frontend* fe)359{360 struct cx24110_state *state = fe->demodulator_priv;361/* fixme (low): error handling */362- int i;363364 dprintk("%s: init chip\n", __FUNCTION__);365366- for(i=0;i<sizeof(cx24110_regdata)/sizeof(cx24110_regdata[0]);i++) {367 cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data);368- };369370 if (state->config->pll_init) state->config->pll_init(fe);371
···55 } while (0)5657static struct {u8 reg; u8 data;} cx24110_regdata[]=58+ /* Comments beginning with @ denote this value should59+ be the default */60+ {{0x09,0x01}, /* SoftResetAll */61+ {0x09,0x00}, /* release reset */62+ {0x01,0xe8}, /* MSB of code rate 27.5MS/s */63+ {0x02,0x17}, /* middle byte " */64+ {0x03,0x29}, /* LSB " */65+ {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */66+ {0x06,0xa5}, /* @ PLL 60MHz */67+ {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */68+ {0x0a,0x00}, /* @ partial chip disables, do not set */69+ {0x0b,0x01}, /* set output clock in gapped mode, start signal low70+ active for first byte */71+ {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */72+ {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */73+ {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 174+ to avoid starting the BER counter. Reset the75+ CRC test bit. Finite counting selected */76+ {0x15,0xff}, /* @ size of the limited time window for RS BER77+ estimation. It is <value>*256 RS blocks, this78+ gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */79+ {0x16,0x00}, /* @ enable all RS output ports */80+ {0x17,0x04}, /* @ time window allowed for the RS to sync */81+ {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned82+ for automatically */83+ /* leave the current code rate and normalization84+ registers as they are after reset... */85+ {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting86+ only once */87+ {0x23,0x18}, /* @ size of the limited time window for Viterbi BER88+ estimation. It is <value>*65536 channel bits, i.e.89+ approx. 38ms at 27.5MS/s, rate 3/4 */90+ {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */91+ /* leave front-end AGC parameters at default values */92+ /* leave decimation AGC parameters at default values */93+ {0x35,0x40}, /* disable all interrupts. They are not connected anyway */94+ {0x36,0xff}, /* clear all interrupt pending flags */95+ {0x37,0x00}, /* @ fully enable AutoAcqq state machine */96+ {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */97+ /* leave the equalizer parameters on their default values */98+ /* leave the final AGC parameters on their default values */99+ {0x41,0x00}, /* @ MSB of front-end derotator frequency */100+ {0x42,0x00}, /* @ middle bytes " */101+ {0x43,0x00}, /* @ LSB " */102+ /* leave the carrier tracking loop parameters on default */103+ /* leave the bit timing loop parameters at gefault */104+ {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */105+ /* the cx24108 data sheet for symbol rates above 15MS/s */106+ {0x57,0x00}, /* @ Filter sigma delta enabled, positive */107+ {0x61,0x95}, /* GPIO pins 1-4 have special function */108+ {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */109+ {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */110+ {0x64,0x20}, /* GPIO 6 is input, all others are outputs */111+ {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */112+ {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */113+ {0x73,0x00}, /* @ disable several demod bypasses */114+ {0x74,0x00}, /* @ " */115+ {0x75,0x00} /* @ " */116+ /* the remaining registers are for SEC */117 };118119120static int cx24110_writereg (struct cx24110_state* state, int reg, int data)121{122+ u8 buf [] = { reg, data };123 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };124 int err;125126+ if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {127 dprintk ("%s: writereg error (err == %i, reg == 0x%02x,"128 " data == 0x%02x)\n", __FUNCTION__, err, reg, data);129 return -EREMOTEIO;130 }131132+ return 0;133}134135static int cx24110_readreg (struct cx24110_state* state, u8 reg)···153154 switch (inversion) {155 case INVERSION_OFF:156+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);157+ /* AcqSpectrInvDis on. No idea why someone should want this */158+ cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)&0xf7);159+ /* Initial value 0 at start of acq */160+ cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)&0xef);161+ /* current value 0 */162+ /* The cx24110 manual tells us this reg is read-only.163+ But what the heck... set it ayways */164+ break;165 case INVERSION_ON:166+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x1);167+ /* AcqSpectrInvDis on. No idea why someone should want this */168+ cx24110_writereg(state,0x5,cx24110_readreg(state,0x5)|0x08);169+ /* Initial value 1 at start of acq */170+ cx24110_writereg(state,0x22,cx24110_readreg(state,0x22)|0x10);171+ /* current value 1 */172+ break;173 case INVERSION_AUTO:174+ cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xfe);175+ /* AcqSpectrInvDis off. Leave initial & current states as is */176+ break;177 default:178 return -EINVAL;179 }···185{186/* fixme (low): error handling */187188+ static const int rate[]={-1,1,2,3,5,7,-1};189+ static const int g1[]={-1,0x01,0x02,0x05,0x15,0x45,-1};190+ static const int g2[]={-1,0x01,0x03,0x06,0x1a,0x7a,-1};191192+ /* Well, the AutoAcq engine of the cx24106 and 24110 automatically193+ searches all enabled viterbi rates, and can handle non-standard194+ rates as well. */195196+ if (fec>FEC_AUTO)197+ fec=FEC_AUTO;198199+ if (fec==FEC_AUTO) { /* (re-)establish AutoAcq behaviour */200 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)&0xdf);201 /* clear AcqVitDis bit */202 cx24110_writereg(state,0x18,0xae);···208 cx24110_writereg(state,0x1a,0x05); cx24110_writereg(state,0x1b,0x06);209 /* set the puncture registers for code rate 3/4 */210 return 0;211+ } else {212 cx24110_writereg(state,0x37,cx24110_readreg(state,0x37)|0x20);213 /* set AcqVitDis bit */214 if(rate[fec]>0) {···219 cx24110_writereg(state,0x1a,g1[fec]);220 cx24110_writereg(state,0x1b,g2[fec]);221 /* not sure if this is the right way: I always used AutoAcq mode */222+ } else223 return -EOPNOTSUPP;224/* fixme (low): which is the correct return code? */225+ };226 return 0;227}228···245static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)246{247/* fixme (low): add error handling */248+ u32 ratio;249+ u32 tmp, fclk, BDRI;250251+ static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};252+ int i;253254dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate);255+ if (srate>90999000UL/2)256+ srate=90999000UL/2;257+ if (srate<500000)258+ srate=500000;259260+ for(i=0;(i<sizeof(bands)/sizeof(bands[0]))&&(srate>bands[i]);i++)261 ;262+ /* first, check which sample rate is appropriate: 45, 60 80 or 90 MHz,263+ and set the PLL accordingly (R07[1:0] Fclk, R06[7:4] PLLmult,264+ R06[3:0] PLLphaseDetGain */265+ tmp=cx24110_readreg(state,0x07)&0xfc;266+ if(srate<90999000UL/4) { /* sample rate 45MHz*/267 cx24110_writereg(state,0x07,tmp);268 cx24110_writereg(state,0x06,0x78);269 fclk=90999000UL/2;270+ } else if(srate<60666000UL/2) { /* sample rate 60MHz */271 cx24110_writereg(state,0x07,tmp|0x1);272 cx24110_writereg(state,0x06,0xa5);273 fclk=60666000UL;274+ } else if(srate<80888000UL/2) { /* sample rate 80MHz */275 cx24110_writereg(state,0x07,tmp|0x2);276 cx24110_writereg(state,0x06,0x87);277 fclk=80888000UL;278+ } else { /* sample rate 90MHz */279 cx24110_writereg(state,0x07,tmp|0x3);280 cx24110_writereg(state,0x06,0x78);281 fclk=90999000UL;282+ };283+ dprintk("cx24110 debug: fclk %d Hz\n",fclk);284+ /* we need to divide two integers with approx. 27 bits in 32 bit285+ arithmetic giving a 25 bit result */286+ /* the maximum dividend is 90999000/2, 0x02b6446c, this number is287+ also the most complex divisor. Hence, the dividend has,288+ assuming 32bit unsigned arithmetic, 6 clear bits on top, the289+ divisor 2 unused bits at the bottom. Also, the quotient is290+ always less than 1/2. Borrowed from VES1893.c, of course */291292+ tmp=srate<<6;293+ BDRI=fclk>>2;294+ ratio=(tmp/BDRI);295296+ tmp=(tmp%BDRI)<<8;297+ ratio=(ratio<<8)+(tmp/BDRI);298299+ tmp=(tmp%BDRI)<<8;300+ ratio=(ratio<<8)+(tmp/BDRI);301302+ tmp=(tmp%BDRI)<<1;303+ ratio=(ratio<<1)+(tmp/BDRI);304305+ dprintk("srate= %d (range %d, up to %d)\n", srate,i,bands[i]);306+ dprintk("fclk = %d\n", fclk);307+ dprintk("ratio= %08x\n", ratio);308309+ cx24110_writereg(state, 0x1, (ratio>>16)&0xff);310+ cx24110_writereg(state, 0x2, (ratio>>8)&0xff);311+ cx24110_writereg(state, 0x3, (ratio)&0xff);312313+ return 0;314315}316···324325 dprintk("cx24110 debug: cx24108_write(%8.8x)\n",data);326327+ cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */328+ cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */329330+ /* if the auto tuner writer is still busy, clear it out */331+ while (cx24110_readreg(state,0x6d)&0x80)332 cx24110_writereg(state,0x72,0);333334+ /* write the topmost 8 bits */335+ cx24110_writereg(state,0x72,(data>>24)&0xff);336337+ /* wait for the send to be completed */338+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)339 ;340341+ /* send another 8 bytes */342+ cx24110_writereg(state,0x72,(data>>16)&0xff);343+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)344 ;345346+ /* and the topmost 5 bits of this byte */347+ cx24110_writereg(state,0x72,(data>>8)&0xff);348+ while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)349 ;350351+ /* now strobe the enable line once */352+ cx24110_writereg(state,0x6d,0x32);353+ cx24110_writereg(state,0x6d,0x30);354355+ return 0;356}357358static int cx24110_initfe(struct dvb_frontend* fe)359{360 struct cx24110_state *state = fe->demodulator_priv;361/* fixme (low): error handling */362+ int i;363364 dprintk("%s: init chip\n", __FUNCTION__);365366+ for(i=0;i<sizeof(cx24110_regdata)/sizeof(cx24110_regdata[0]);i++) {367 cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data);368+ };369370 if (state->config->pll_init) state->config->pll_init(fe);371
+13-13
drivers/media/dvb/frontends/l64781.c
···2 driver for LSI L64781 COFDM demodulator34 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH5- Marko Kohtala <marko.kohtala@luukku.com>67 This program is free software; you can redistribute it and/or modify8 it under the terms of the GNU General Public License as published by···433{434 struct l64781_state* state = fe->demodulator_priv;435436- reset_and_configure (state);437438 /* Power up */439 l64781_writereg (state, 0x3e, 0xa5);···456 l64781_writereg (state, 0x0d, 0x8c);457458 /* With ppm=8000, it seems the DTR_SENSITIVITY will result in459- value of 2 with all possible bandwidths and guard460- intervals, which is the initial value anyway. */461- /*l64781_writereg (state, 0x19, 0x92);*/462463 /* Everything is two's complement, soft bit and CSI_OUT too */464 l64781_writereg (state, 0x1e, 0x09);···477static int l64781_get_tune_settings(struct dvb_frontend* fe,478 struct dvb_frontend_tune_settings* fesettings)479{480- fesettings->min_delay_ms = 4000;481- fesettings->step_size = 0;482- fesettings->max_drift = 0;483- return 0;484}485486static void l64781_release(struct dvb_frontend* fe)···522523 /* The chip always responds to reads */524 if (i2c_transfer(state->i2c, msg, 2) != 2) {525- dprintk("No response to read on I2C bus\n");526 goto error;527 }528···531532 /* Reading the POWER_DOWN register always returns 0 */533 if (reg0x3e != 0) {534- dprintk("Device doesn't look like L64781\n");535 goto error;536 }537···540541 /* Responds to all reads with 0 */542 if (l64781_readreg(state, 0x1a) != 0) {543- dprintk("Read 1 returned unexpcted value\n");544 goto error;545 }546···549550 /* Responds with register default value */551 if (l64781_readreg(state, 0x1a) != 0xa1) {552- dprintk("Read 2 returned unexpcted value\n");553 goto error;554 }555
···2 driver for LSI L64781 COFDM demodulator34 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH5+ Marko Kohtala <marko.kohtala@luukku.com>67 This program is free software; you can redistribute it and/or modify8 it under the terms of the GNU General Public License as published by···433{434 struct l64781_state* state = fe->demodulator_priv;435436+ reset_and_configure (state);437438 /* Power up */439 l64781_writereg (state, 0x3e, 0xa5);···456 l64781_writereg (state, 0x0d, 0x8c);457458 /* With ppm=8000, it seems the DTR_SENSITIVITY will result in459+ value of 2 with all possible bandwidths and guard460+ intervals, which is the initial value anyway. */461+ /*l64781_writereg (state, 0x19, 0x92);*/462463 /* Everything is two's complement, soft bit and CSI_OUT too */464 l64781_writereg (state, 0x1e, 0x09);···477static int l64781_get_tune_settings(struct dvb_frontend* fe,478 struct dvb_frontend_tune_settings* fesettings)479{480+ fesettings->min_delay_ms = 4000;481+ fesettings->step_size = 0;482+ fesettings->max_drift = 0;483+ return 0;484}485486static void l64781_release(struct dvb_frontend* fe)···522523 /* The chip always responds to reads */524 if (i2c_transfer(state->i2c, msg, 2) != 2) {525+ dprintk("No response to read on I2C bus\n");526 goto error;527 }528···531532 /* Reading the POWER_DOWN register always returns 0 */533 if (reg0x3e != 0) {534+ dprintk("Device doesn't look like L64781\n");535 goto error;536 }537···540541 /* Responds to all reads with 0 */542 if (l64781_readreg(state, 0x1a) != 0) {543+ dprintk("Read 1 returned unexpcted value\n");544 goto error;545 }546···549550 /* Responds with register default value */551 if (l64781_readreg(state, 0x1a) != 0xa1) {552+ dprintk("Read 2 returned unexpcted value\n");553 goto error;554 }555
+1-1
drivers/media/dvb/frontends/l64781.h
···2 driver for LSI L64781 COFDM demodulator34 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH5- Marko Kohtala <marko.kohtala@luukku.com>67 This program is free software; you can redistribute it and/or modify8 it under the terms of the GNU General Public License as published by
···2 driver for LSI L64781 COFDM demodulator34 Copyright (C) 2001 Holger Waechtler for Convergence Integrated Media GmbH5+ Marko Kohtala <marko.kohtala@luukku.com>67 This program is free software; you can redistribute it and/or modify8 it under the terms of the GNU General Public License as published by
···503 rcvr_stat = rec_buf[1];504 usK = (rcvr_stat & 0x10) ? 3 : 0;505506- /* The value reported back from the frontend will be FFFF=100% 0000=0% */507 signal_strength = (((8952 - i20Log10(snr_equ) - usK*100)/3+5)*65535)/1000;508 if (signal_strength > 0xffff)509 *strength = 0xffff;
···503 rcvr_stat = rec_buf[1];504 usK = (rcvr_stat & 0x10) ? 3 : 0;505506+ /* The value reported back from the frontend will be FFFF=100% 0000=0% */507 signal_strength = (((8952 - i20Log10(snr_equ) - usK*100)/3+5)*65535)/1000;508 if (signal_strength > 0xffff)509 *strength = 0xffff;
···9596int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data)97{98- struct stv0299_state* state = fe->demodulator_priv;99100 return stv0299_writeregI(state, reg, data);101}···220221static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate)222{223- struct stv0299_state* state = fe->demodulator_priv;224 u64 big = srate;225 u32 ratio;226···271static int stv0299_send_diseqc_msg (struct dvb_frontend* fe,272 struct dvb_diseqc_master_cmd *m)273{274- struct stv0299_state* state = fe->demodulator_priv;275 u8 val;276 int i;277···301302static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)303{304- struct stv0299_state* state = fe->demodulator_priv;305 u8 val;306307 dprintk ("%s\n", __FUNCTION__);···328329static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)330{331- struct stv0299_state* state = fe->demodulator_priv;332 u8 val;333334 if (stv0299_wait_diseqc_idle (state, 100) < 0)···350351static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage)352{353- struct stv0299_state* state = fe->demodulator_priv;354 u8 reg0x08;355 u8 reg0x0c;356···442443static int stv0299_init (struct dvb_frontend* fe)444{445- struct stv0299_state* state = fe->demodulator_priv;446 int i;447448 dprintk("stv0299: init chip\n");···461462static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status)463{464- struct stv0299_state* state = fe->demodulator_priv;465466 u8 signal = 0xff - stv0299_readreg (state, 0x18);467 u8 sync = stv0299_readreg (state, 0x1b);···489490static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)491{492- struct stv0299_state* state = fe->demodulator_priv;493494 if (state->errmode != STATUS_BER) return 0;495 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···499500static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength)501{502- struct stv0299_state* state = fe->demodulator_priv;503504 s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8)505 | stv0299_readreg (state, 0x19));···516517static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr)518{519- struct stv0299_state* state = fe->demodulator_priv;520521 s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8)522 | stv0299_readreg (state, 0x25));···528529static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)530{531- struct stv0299_state* state = fe->demodulator_priv;532533 if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;534 else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···538539static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)540{541- struct stv0299_state* state = fe->demodulator_priv;542 int invval = 0;543544 dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__);···571572static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)573{574- struct stv0299_state* state = fe->demodulator_priv;575 s32 derot_freq;576 int invval;577···596597static int stv0299_sleep(struct dvb_frontend* fe)598{599- struct stv0299_state* state = fe->demodulator_priv;600601 stv0299_writeregI(state, 0x02, 0x80);602 state->initialised = 0;···606607static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)608{609- struct stv0299_state* state = fe->demodulator_priv;610611 fesettings->min_delay_ms = state->config->min_delay_ms;612 if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) {···658659 /* create dvb_frontend */660 state->frontend.ops = &state->ops;661- state->frontend.demodulator_priv = state;662 return &state->frontend;663664error:···714715MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver");716MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, "717- "Andreas Oberritter, Andrew de Quincey, Kenneth Aafl�y");718MODULE_LICENSE("GPL");719720EXPORT_SYMBOL(stv0299_writereg);
···9596int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data)97{98+ struct stv0299_state* state = fe->demodulator_priv;99100 return stv0299_writeregI(state, reg, data);101}···220221static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate)222{223+ struct stv0299_state* state = fe->demodulator_priv;224 u64 big = srate;225 u32 ratio;226···271static int stv0299_send_diseqc_msg (struct dvb_frontend* fe,272 struct dvb_diseqc_master_cmd *m)273{274+ struct stv0299_state* state = fe->demodulator_priv;275 u8 val;276 int i;277···301302static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)303{304+ struct stv0299_state* state = fe->demodulator_priv;305 u8 val;306307 dprintk ("%s\n", __FUNCTION__);···328329static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)330{331+ struct stv0299_state* state = fe->demodulator_priv;332 u8 val;333334 if (stv0299_wait_diseqc_idle (state, 100) < 0)···350351static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage)352{353+ struct stv0299_state* state = fe->demodulator_priv;354 u8 reg0x08;355 u8 reg0x0c;356···442443static int stv0299_init (struct dvb_frontend* fe)444{445+ struct stv0299_state* state = fe->demodulator_priv;446 int i;447448 dprintk("stv0299: init chip\n");···461462static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status)463{464+ struct stv0299_state* state = fe->demodulator_priv;465466 u8 signal = 0xff - stv0299_readreg (state, 0x18);467 u8 sync = stv0299_readreg (state, 0x1b);···489490static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber)491{492+ struct stv0299_state* state = fe->demodulator_priv;493494 if (state->errmode != STATUS_BER) return 0;495 *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···499500static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength)501{502+ struct stv0299_state* state = fe->demodulator_priv;503504 s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8)505 | stv0299_readreg (state, 0x19));···516517static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr)518{519+ struct stv0299_state* state = fe->demodulator_priv;520521 s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8)522 | stv0299_readreg (state, 0x25));···528529static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)530{531+ struct stv0299_state* state = fe->demodulator_priv;532533 if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0;534 else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e);···538539static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)540{541+ struct stv0299_state* state = fe->demodulator_priv;542 int invval = 0;543544 dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__);···571572static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p)573{574+ struct stv0299_state* state = fe->demodulator_priv;575 s32 derot_freq;576 int invval;577···596597static int stv0299_sleep(struct dvb_frontend* fe)598{599+ struct stv0299_state* state = fe->demodulator_priv;600601 stv0299_writeregI(state, 0x02, 0x80);602 state->initialised = 0;···606607static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)608{609+ struct stv0299_state* state = fe->demodulator_priv;610611 fesettings->min_delay_ms = state->config->min_delay_ms;612 if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) {···658659 /* create dvb_frontend */660 state->frontend.ops = &state->ops;661+ state->frontend.demodulator_priv = state;662 return &state->frontend;663664error:···714715MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver");716MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, "717+ "Andreas Oberritter, Andrew de Quincey, Kenneth Aafl�y");718MODULE_LICENSE("GPL");719720EXPORT_SYMBOL(stv0299_writereg);
+5-5
drivers/media/dvb/frontends/tda10021.c
···1/*2 TDA10021 - Single Chip Cable Channel Receiver driver module3- used on the the Siemens DVB-C cards45 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>6 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>7- Support for TDA1002189 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by···7677static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data)78{79- u8 buf[] = { reg, data };80 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };81- int ret;8283 ret = i2c_transfer (state->i2c, &msg, 1);84 if (ret != 1)···95 u8 b0 [] = { reg };96 u8 b1 [] = { 0 };97 struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },98- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };99 int ret;100101 ret = i2c_transfer (state->i2c, msg, 2);
···1/*2 TDA10021 - Single Chip Cable Channel Receiver driver module3+ used on the the Siemens DVB-C cards45 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>6 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>7+ Support for TDA1002189 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by···7677static int tda10021_writereg (struct tda10021_state* state, u8 reg, u8 data)78{79+ u8 buf[] = { reg, data };80 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 };81+ int ret;8283 ret = i2c_transfer (state->i2c, &msg, 1);84 if (ret != 1)···95 u8 b0 [] = { reg };96 u8 b1 [] = { 0 };97 struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },98+ { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };99 int ret;100101 ret = i2c_transfer (state->i2c, msg, 2);
+2-2
drivers/media/dvb/frontends/tda10021.h
···1/*2 TDA10021 - Single Chip Cable Channel Receiver driver module3- used on the the Siemens DVB-C cards45 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>6 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>7- Support for TDA1002189 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by
···1/*2 TDA10021 - Single Chip Cable Channel Receiver driver module3+ used on the the Siemens DVB-C cards45 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>6 Copyright (C) 2004 Markus Schulz <msc@antzsystem.de>7+ Support for TDA1002189 This program is free software; you can redistribute it and/or modify10 it under the terms of the GNU General Public License as published by
+1-1
drivers/media/dvb/frontends/tda1004x.c
···475 ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);476 if (ret) {477 printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");478- return ret;479 }480 tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST481 ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
···475 ret = state->config->request_firmware(fe, &fw, TDA10046_DEFAULT_FIRMWARE);476 if (ret) {477 printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");478+ return ret;479 }480 tda1004x_write_mask(state, TDA1004X_CONFC4, 8, 8); // going to boot from HOST481 ret = tda1004x_do_upload(state, fw->data, fw->size, TDA10046H_CODE_CPT, TDA10046H_CODE_IN);
···1203 input_dev->keycode = rc_keys;12041205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++)1206- set_bit(rc_keys[i], input_dev->keybit);12071208 input_register_device(input_dev);1209···1529 usb_free_urb(dec->irq_urb);15301531 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,1532- dec->irq_buffer, dec->irq_dma_handle);15331534 if (dec->rc_input_dev) {1535 input_unregister_device(dec->rc_input_dev);
···1203 input_dev->keycode = rc_keys;12041205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++)1206+ set_bit(rc_keys[i], input_dev->keybit);12071208 input_register_device(input_dev);1209···1529 usb_free_urb(dec->irq_urb);15301531 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,1532+ dec->irq_buffer, dec->irq_dma_handle);15331534 if (dec->rc_input_dev) {1535 input_unregister_device(dec->rc_input_dev);
+7-7
drivers/media/video/Kconfig
···188189 To compile this driver as a module, choose M here: the190 module will be called zr36067.191-192config VIDEO_ZORAN_BUZ193 tristate "Iomega Buz support"194 depends on VIDEO_ZORAN···204205config VIDEO_ZORAN_DC30206 tristate "Pinnacle/Miro DC30(+) support"207- depends on VIDEO_ZORAN208- help209 Support for the Pinnacle/Miro DC30(+) MJPEG capture/playback210 card. This also supports really old DC10 cards based on the211 zr36050 MJPEG codec and zr36016 VFE.···260 ---help---261 This is a video4linux driver for the 'Multimedia eXtension Board'262 TV card by Siemens-Nixdorf.263-264 To compile this driver as a module, choose M here: the265 module will be called mxb.266···274 for SAA7146 bases boards, so if you have some unsupported275 saa7146 based, analog video card, chances are good that it276 will work with this skeleton driver.277-278 To compile this driver as a module, choose M here: the279 module will be called dpc7146.280···285 ---help---286 This is a video4linux driver for the Hexium HV-PCI6 and287 Orion frame grabber cards by Hexium.288-289 To compile this driver as a module, choose M here: the290 module will be called hexium_orion.291···297 This is a video4linux driver for the Hexium Gemini frame298 grabber card by Hexium. Please note that the Gemini Dual299 card is *not* fully supported.300-301 To compile this driver as a module, choose M here: the302 module will be called hexium_gemini.303
···188189 To compile this driver as a module, choose M here: the190 module will be called zr36067.191+192config VIDEO_ZORAN_BUZ193 tristate "Iomega Buz support"194 depends on VIDEO_ZORAN···204205config VIDEO_ZORAN_DC30206 tristate "Pinnacle/Miro DC30(+) support"207+ depends on VIDEO_ZORAN208+ help209 Support for the Pinnacle/Miro DC30(+) MJPEG capture/playback210 card. This also supports really old DC10 cards based on the211 zr36050 MJPEG codec and zr36016 VFE.···260 ---help---261 This is a video4linux driver for the 'Multimedia eXtension Board'262 TV card by Siemens-Nixdorf.263+264 To compile this driver as a module, choose M here: the265 module will be called mxb.266···274 for SAA7146 bases boards, so if you have some unsupported275 saa7146 based, analog video card, chances are good that it276 will work with this skeleton driver.277+278 To compile this driver as a module, choose M here: the279 module will be called dpc7146.280···285 ---help---286 This is a video4linux driver for the Hexium HV-PCI6 and287 Orion frame grabber cards by Hexium.288+289 To compile this driver as a module, choose M here: the290 module will be called hexium_orion.291···297 This is a video4linux driver for the Hexium Gemini frame298 grabber card by Hexium. Please note that the Gemini Dual299 card is *not* fully supported.300+301 To compile this driver as a module, choose M here: the302 module will be called hexium_gemini.303
···542543void scsi_next_command(struct scsi_cmnd *cmd)544{545+ struct scsi_device *sdev = cmd->device;546+ struct request_queue *q = sdev->request_queue;547+548+ /* need to hold a reference on the device before we let go of the cmd */549+ get_device(&sdev->sdev_gendev);550551 scsi_put_command(cmd);552 scsi_run_queue(q);553+554+ /* ok to remove device now */555+ put_device(&sdev->sdev_gendev);556}557558void scsi_run_host_queues(struct Scsi_Host *shost)
+10-3
fs/inotify.c
···364/*365 * find_inode - resolve a user-given path to a specific inode and return a nd366 */367-static int find_inode(const char __user *dirname, struct nameidata *nd)0368{369 int error;370371- error = __user_walk(dirname, LOOKUP_FOLLOW, nd);372 if (error)373 return error;374 /* you can only watch an inode if you have read permissions on it */···934 struct file *filp;935 int ret, fput_needed;936 int mask_add = 0;0937938 filp = fget_light(fd, &fput_needed);939 if (unlikely(!filp))···946 goto fput_and_out;947 }948949- ret = find_inode(path, &nd);00000950 if (unlikely(ret))951 goto fput_and_out;952
···364/*365 * find_inode - resolve a user-given path to a specific inode and return a nd366 */367+static int find_inode(const char __user *dirname, struct nameidata *nd,368+ unsigned flags)369{370 int error;371372+ error = __user_walk(dirname, flags, nd);373 if (error)374 return error;375 /* you can only watch an inode if you have read permissions on it */···933 struct file *filp;934 int ret, fput_needed;935 int mask_add = 0;936+ unsigned flags = 0;937938 filp = fget_light(fd, &fput_needed);939 if (unlikely(!filp))···944 goto fput_and_out;945 }946947+ if (!(mask & IN_DONT_FOLLOW))948+ flags |= LOOKUP_FOLLOW;949+ if (mask & IN_ONLYDIR)950+ flags |= LOOKUP_DIRECTORY;951+952+ ret = find_inode(path, &nd, flags);953 if (unlikely(ret))954 goto fput_and_out;955
···220 unsigned int local);221struct mm_struct;222extern int hash_huge_page(struct mm_struct *mm, unsigned long access,223- unsigned long ea, unsigned long vsid, int local);0224225extern void htab_finish_init(void);226extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
···220 unsigned int local);221struct mm_struct;222extern int hash_huge_page(struct mm_struct *mm, unsigned long access,223+ unsigned long ea, unsigned long vsid, int local,224+ unsigned long trap);225226extern void htab_finish_init(void);227extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
+2
include/linux/cn_proc.h
···26#define CN_PROC_H2728#include <linux/types.h>029#include <linux/connector.h>3031/*···66 PROC_EVENT_EXIT = 0x8000000067 } what;68 __u32 cpu;069 union { /* must be last field of proc_event struct */70 struct {71 __u32 err;
···26#define CN_PROC_H2728#include <linux/types.h>29+#include <linux/time.h>30#include <linux/connector.h>3132/*···65 PROC_EVENT_EXIT = 0x8000000066 } what;67 __u32 cpu;68+ struct timespec timestamp;69 union { /* must be last field of proc_event struct */70 struct {71 __u32 err;
+14-14
include/linux/dvb/audio.h
···323334typedef enum {35- AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */36 AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */37} audio_stream_source_t;383940typedef enum {41 AUDIO_STOPPED, /* Device is stopped */42- AUDIO_PLAYING, /* Device is currently playing */43 AUDIO_PAUSED /* Device is paused */44} audio_play_state_t;454647typedef enum {48- AUDIO_STEREO,49- AUDIO_MONO_LEFT,50 AUDIO_MONO_RIGHT51} audio_channel_select_t;525354typedef struct audio_mixer {55- unsigned int volume_left;56- unsigned int volume_right;57 // what else do we need? bass, pass-through, ...58} audio_mixer_t;596061typedef struct audio_status {62- int AV_sync_state; /* sync audio and video? */63- int mute_state; /* audio is muted */64- audio_play_state_t play_state; /* current playback state */65- audio_stream_source_t stream_source; /* current stream source */66- audio_channel_select_t channel_select; /* currently selected channel */67- int bypass_mode; /* pass on audio data to */68 audio_mixer_t mixer_state; /* current mixer state */69} audio_status_t; /* separate decoder hardware */70···74 int vocal1; /* into left and right t at 70% each */75 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/76 int melody; /* mixed into the left channel and */77- /* Vocal2 into the right channel at 100% each. */78- /* if Melody is non-zero, the melody channel gets mixed*/79} audio_karaoke_t; /* into left and right */8081
···323334typedef enum {35+ AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */36 AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */37} audio_stream_source_t;383940typedef enum {41 AUDIO_STOPPED, /* Device is stopped */42+ AUDIO_PLAYING, /* Device is currently playing */43 AUDIO_PAUSED /* Device is paused */44} audio_play_state_t;454647typedef enum {48+ AUDIO_STEREO,49+ AUDIO_MONO_LEFT,50 AUDIO_MONO_RIGHT51} audio_channel_select_t;525354typedef struct audio_mixer {55+ unsigned int volume_left;56+ unsigned int volume_right;57 // what else do we need? bass, pass-through, ...58} audio_mixer_t;596061typedef struct audio_status {62+ int AV_sync_state; /* sync audio and video? */63+ int mute_state; /* audio is muted */64+ audio_play_state_t play_state; /* current playback state */65+ audio_stream_source_t stream_source; /* current stream source */66+ audio_channel_select_t channel_select; /* currently selected channel */67+ int bypass_mode; /* pass on audio data to */68 audio_mixer_t mixer_state; /* current mixer state */69} audio_status_t; /* separate decoder hardware */70···74 int vocal1; /* into left and right t at 70% each */75 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/76 int melody; /* mixed into the left channel and */77+ /* Vocal2 into the right channel at 100% each. */78+ /* if Melody is non-zero, the melody channel gets mixed*/79} audio_karaoke_t; /* into left and right */8081
+18-18
include/linux/dvb/ca.h
···27/* slot interface types and info */2829typedef struct ca_slot_info {30- int num; /* slot number */3132- int type; /* CA interface this slot supports */33#define CA_CI 1 /* CI high level interface */34#define CA_CI_LINK 2 /* CI link layer level interface */35#define CA_CI_PHYS 4 /* CI physical layer level interface */36#define CA_DESCR 8 /* built-in descrambler */37#define CA_SC 128 /* simple smart card interface */3839- unsigned int flags;40#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */41#define CA_CI_MODULE_READY 242} ca_slot_info_t;···45/* descrambler types and info */4647typedef struct ca_descr_info {48- unsigned int num; /* number of available descramblers (keys) */49- unsigned int type; /* type of supported scrambling system */50#define CA_ECD 151#define CA_NDS 252#define CA_DSS 453} ca_descr_info_t;5455typedef struct ca_caps {56- unsigned int slot_num; /* total number of CA card and module slots */57- unsigned int slot_type; /* OR of all supported types */58- unsigned int descr_num; /* total number of descrambler slots (keys) */59- unsigned int descr_type; /* OR of all supported types */60} ca_caps_t;6162/* a message to/from a CI-CAM */63typedef struct ca_msg {64- unsigned int index;65- unsigned int type;66- unsigned int length;67- unsigned char msg[256];68} ca_msg_t;6970typedef struct ca_descr {71- unsigned int index;72- unsigned int parity; /* 0 == even, 1 == odd */73- unsigned char cw[8];74} ca_descr_t;7576typedef struct ca_pid {77- unsigned int pid;78- int index; /* -1 == disable*/79} ca_pid_t;8081#define CA_RESET _IO('o', 128)
···27/* slot interface types and info */2829typedef struct ca_slot_info {30+ int num; /* slot number */3132+ int type; /* CA interface this slot supports */33#define CA_CI 1 /* CI high level interface */34#define CA_CI_LINK 2 /* CI link layer level interface */35#define CA_CI_PHYS 4 /* CI physical layer level interface */36#define CA_DESCR 8 /* built-in descrambler */37#define CA_SC 128 /* simple smart card interface */3839+ unsigned int flags;40#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */41#define CA_CI_MODULE_READY 242} ca_slot_info_t;···45/* descrambler types and info */4647typedef struct ca_descr_info {48+ unsigned int num; /* number of available descramblers (keys) */49+ unsigned int type; /* type of supported scrambling system */50#define CA_ECD 151#define CA_NDS 252#define CA_DSS 453} ca_descr_info_t;5455typedef struct ca_caps {56+ unsigned int slot_num; /* total number of CA card and module slots */57+ unsigned int slot_type; /* OR of all supported types */58+ unsigned int descr_num; /* total number of descrambler slots (keys) */59+ unsigned int descr_type; /* OR of all supported types */60} ca_caps_t;6162/* a message to/from a CI-CAM */63typedef struct ca_msg {64+ unsigned int index;65+ unsigned int type;66+ unsigned int length;67+ unsigned char msg[256];68} ca_msg_t;6970typedef struct ca_descr {71+ unsigned int index;72+ unsigned int parity; /* 0 == even, 1 == odd */73+ unsigned char cw[8];74} ca_descr_t;7576typedef struct ca_pid {77+ unsigned int pid;78+ int index; /* -1 == disable*/79} ca_pid_t;8081#define CA_RESET _IO('o', 128)
+10-10
include/linux/dvb/dmx.h
···1-/* 2 * dmx.h3 *4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>···38{39 DMX_OUT_DECODER, /* Streaming directly to decoder. */40 DMX_OUT_TAP, /* Output going to a memory buffer */41- /* (to be retrieved via the read command).*/42 DMX_OUT_TS_TAP /* Output multiplexed into a new TS */43- /* (to be retrieved by reading from the */44- /* logical DVR device). */45} dmx_output_t;4647···5455typedef enum56{57- DMX_PES_AUDIO0,58 DMX_PES_VIDEO0,59 DMX_PES_TELETEXT0,60 DMX_PES_SUBTITLE0,61 DMX_PES_PCR0,6263- DMX_PES_AUDIO1,64 DMX_PES_VIDEO1,65 DMX_PES_TELETEXT1,66 DMX_PES_SUBTITLE1,67 DMX_PES_PCR1,6869- DMX_PES_AUDIO2,70 DMX_PES_VIDEO2,71 DMX_PES_TELETEXT2,72 DMX_PES_SUBTITLE2,73 DMX_PES_PCR2,7475- DMX_PES_AUDIO3,76 DMX_PES_VIDEO3,77 DMX_PES_TELETEXT3,78 DMX_PES_SUBTITLE3,···9091typedef enum92{93- DMX_SCRAMBLING_EV,94- DMX_FRONTEND_EV95} dmx_event_t;9697
···1+/*2 * dmx.h3 *4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>···38{39 DMX_OUT_DECODER, /* Streaming directly to decoder. */40 DMX_OUT_TAP, /* Output going to a memory buffer */41+ /* (to be retrieved via the read command).*/42 DMX_OUT_TS_TAP /* Output multiplexed into a new TS */43+ /* (to be retrieved by reading from the */44+ /* logical DVR device). */45} dmx_output_t;4647···5455typedef enum56{57+ DMX_PES_AUDIO0,58 DMX_PES_VIDEO0,59 DMX_PES_TELETEXT0,60 DMX_PES_SUBTITLE0,61 DMX_PES_PCR0,6263+ DMX_PES_AUDIO1,64 DMX_PES_VIDEO1,65 DMX_PES_TELETEXT1,66 DMX_PES_SUBTITLE1,67 DMX_PES_PCR1,6869+ DMX_PES_AUDIO2,70 DMX_PES_VIDEO2,71 DMX_PES_TELETEXT2,72 DMX_PES_SUBTITLE2,73 DMX_PES_PCR2,7475+ DMX_PES_AUDIO3,76 DMX_PES_VIDEO3,77 DMX_PES_TELETEXT3,78 DMX_PES_SUBTITLE3,···9091typedef enum92{93+ DMX_SCRAMBLING_EV,94+ DMX_FRONTEND_EV95} dmx_event_t;9697
+29-29
include/linux/dvb/osd.h
···98} OSD_Command;99100typedef struct osd_cmd_s {101- OSD_Command cmd;102- int x0;103- int y0;104- int x1;105- int y1;106- int color;107- void __user *data;108} osd_cmd_t;109110/* OSD_OpenRaw: set 'color' to desired window type */111typedef enum {112- OSD_BITMAP1, /* 1 bit bitmap */113- OSD_BITMAP2, /* 2 bit bitmap */114- OSD_BITMAP4, /* 4 bit bitmap */115- OSD_BITMAP8, /* 8 bit bitmap */116- OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */117- OSD_BITMAP2HR, /* 2 bit bitmap half resolution */118- OSD_BITMAP4HR, /* 4 bit bitmap half resolution */119- OSD_BITMAP8HR, /* 8 bit bitmap half resolution */120- OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */121- OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */122- OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */123- OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */124- OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */125- OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */126- OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */127- OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */128- OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/129- OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */130- OSD_VIDEONSIZE, /* Full Size MPEG Video Display */131- OSD_CURSOR /* Cursor */132} osd_raw_window_t;133134typedef struct osd_cap_s {135- int cmd;136#define OSD_CAP_MEMSIZE 1 /* memory size */137- long val;138} osd_cap_t;139140
···98} OSD_Command;99100typedef struct osd_cmd_s {101+ OSD_Command cmd;102+ int x0;103+ int y0;104+ int x1;105+ int y1;106+ int color;107+ void __user *data;108} osd_cmd_t;109110/* OSD_OpenRaw: set 'color' to desired window type */111typedef enum {112+ OSD_BITMAP1, /* 1 bit bitmap */113+ OSD_BITMAP2, /* 2 bit bitmap */114+ OSD_BITMAP4, /* 4 bit bitmap */115+ OSD_BITMAP8, /* 8 bit bitmap */116+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */117+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */118+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */119+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */120+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */121+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */122+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */123+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */124+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */125+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */126+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */127+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */128+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/129+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */130+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */131+ OSD_CURSOR /* Cursor */132} osd_raw_window_t;133134typedef struct osd_cap_s {135+ int cmd;136#define OSD_CAP_MEMSIZE 1 /* memory size */137+ long val;138} osd_cap_t;139140
+22-22
include/linux/dvb/video.h
···3637typedef enum {38 VIDEO_FORMAT_4_3, /* Select 4:3 format */39- VIDEO_FORMAT_16_9, /* Select 16:9 format. */40 VIDEO_FORMAT_221_1 /* 2.21:1 */41} video_format_t;42···545556typedef enum {57- VIDEO_PAN_SCAN, /* use pan and scan format */58 VIDEO_LETTER_BOX, /* use letterbox format */59 VIDEO_CENTER_CUT_OUT /* use center cut out format */60} video_displayformat_t;···66} video_size_t;6768typedef enum {69- VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */70 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream71 comes from the user through the write72 system call */···7576typedef enum {77 VIDEO_STOPPED, /* Video is stopped */78- VIDEO_PLAYING, /* Video is currently playing */79 VIDEO_FREEZED /* Video is freezed */80} video_play_state_t;818283struct video_event {84- int32_t type;85#define VIDEO_EVENT_SIZE_CHANGED 186#define VIDEO_EVENT_FRAME_RATE_CHANGED 287- time_t timestamp;88 union {89- video_size_t size;90 unsigned int frame_rate; /* in frames per 1000sec */91 } u;92};939495struct video_status {96- int video_blank; /* blank video on freeze? */97- video_play_state_t play_state; /* current state of playback */98- video_stream_source_t stream_source; /* current source (demux/memory) */99- video_format_t video_format; /* current aspect ratio of stream*/100- video_displayformat_t display_format;/* selected cropping mode */101};102103104struct video_still_picture {105- char __user *iFrame; /* pointer to a single iframe in memory */106- int32_t size;107};108109···111struct video_highlight {112 int active; /* 1=show highlight, 0=hide highlight */113 uint8_t contrast1; /* 7- 4 Pattern pixel contrast */114- /* 3- 0 Background pixel contrast */115 uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */116- /* 3- 0 Emphasis pixel-1 contrast */117 uint8_t color1; /* 7- 4 Pattern pixel color */118- /* 3- 0 Background pixel color */119 uint8_t color2; /* 7- 4 Emphasis pixel-2 color */120- /* 3- 0 Emphasis pixel-1 color */121 uint32_t ypos; /* 23-22 auto action mode */122- /* 21-12 start y */123- /* 9- 0 end y */124 uint32_t xpos; /* 23-22 button color number */125- /* 21-12 start x */126- /* 9- 0 end x */127} video_highlight_t;128129
···3637typedef enum {38 VIDEO_FORMAT_4_3, /* Select 4:3 format */39+ VIDEO_FORMAT_16_9, /* Select 16:9 format. */40 VIDEO_FORMAT_221_1 /* 2.21:1 */41} video_format_t;42···545556typedef enum {57+ VIDEO_PAN_SCAN, /* use pan and scan format */58 VIDEO_LETTER_BOX, /* use letterbox format */59 VIDEO_CENTER_CUT_OUT /* use center cut out format */60} video_displayformat_t;···66} video_size_t;6768typedef enum {69+ VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */70 VIDEO_SOURCE_MEMORY /* If this source is selected, the stream71 comes from the user through the write72 system call */···7576typedef enum {77 VIDEO_STOPPED, /* Video is stopped */78+ VIDEO_PLAYING, /* Video is currently playing */79 VIDEO_FREEZED /* Video is freezed */80} video_play_state_t;818283struct video_event {84+ int32_t type;85#define VIDEO_EVENT_SIZE_CHANGED 186#define VIDEO_EVENT_FRAME_RATE_CHANGED 287+ time_t timestamp;88 union {89+ video_size_t size;90 unsigned int frame_rate; /* in frames per 1000sec */91 } u;92};939495struct video_status {96+ int video_blank; /* blank video on freeze? */97+ video_play_state_t play_state; /* current state of playback */98+ video_stream_source_t stream_source; /* current source (demux/memory) */99+ video_format_t video_format; /* current aspect ratio of stream*/100+ video_displayformat_t display_format;/* selected cropping mode */101};102103104struct video_still_picture {105+ char __user *iFrame; /* pointer to a single iframe in memory */106+ int32_t size;107};108109···111struct video_highlight {112 int active; /* 1=show highlight, 0=hide highlight */113 uint8_t contrast1; /* 7- 4 Pattern pixel contrast */114+ /* 3- 0 Background pixel contrast */115 uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */116+ /* 3- 0 Emphasis pixel-1 contrast */117 uint8_t color1; /* 7- 4 Pattern pixel color */118+ /* 3- 0 Background pixel color */119 uint8_t color2; /* 7- 4 Emphasis pixel-2 color */120+ /* 3- 0 Emphasis pixel-1 color */121 uint32_t ypos; /* 23-22 auto action mode */122+ /* 21-12 start y */123+ /* 9- 0 end y */124 uint32_t xpos; /* 23-22 button color number */125+ /* 21-12 start x */126+ /* 9- 0 end x */127} video_highlight_t;128129
+1-1
include/linux/i2c-id.h
···108#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */109#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */110#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */111-#define I2C_DRIVERID_I2C_IR 75 /* I2C InfraRed on Video boards */112113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */114#define I2C_DRIVERID_EXP1 0xF1
···108#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */109#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */110#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */111+#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */112113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */114#define I2C_DRIVERID_EXP1 0xF1
+2
include/linux/inotify.h
···47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */4849/* special flags */0050#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */51#define IN_ISDIR 0x40000000 /* event occurred against dir */52#define IN_ONESHOT 0x80000000 /* only send event once */
···47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */4849/* special flags */50+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */51+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */52#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */53#define IN_ISDIR 0x40000000 /* event occurred against dir */54#define IN_ONESHOT 0x80000000 /* only send event once */
+7-1
include/linux/kprobes.h
···37#include <linux/spinlock.h>38#include <linux/rcupdate.h>39040#include <asm/kprobes.h>4142/* kprobe_status settings */···148 struct task_struct *task;149};150151-#ifdef CONFIG_KPROBES152extern spinlock_t kretprobe_lock;153extern int arch_prepare_kprobe(struct kprobe *p);154extern void arch_copy_kprobe(struct kprobe *p);···158extern void show_registers(struct pt_regs *regs);159extern kprobe_opcode_t *get_insn_slot(void);160extern void free_insn_slot(kprobe_opcode_t *slot);0161162/* Get the kprobe at this addr (if any) - called with preemption disabled */163struct kprobe *get_kprobe(void *addr);···196void kprobe_flush_task(struct task_struct *tk);197void recycle_rp_inst(struct kretprobe_instance *ri);198#else /* CONFIG_KPROBES */00000199static inline struct kprobe *kprobe_running(void)200{201 return NULL;
···37#include <linux/spinlock.h>38#include <linux/rcupdate.h>3940+#ifdef CONFIG_KPROBES41#include <asm/kprobes.h>4243/* kprobe_status settings */···147 struct task_struct *task;148};1490150extern spinlock_t kretprobe_lock;151extern int arch_prepare_kprobe(struct kprobe *p);152extern void arch_copy_kprobe(struct kprobe *p);···158extern void show_registers(struct pt_regs *regs);159extern kprobe_opcode_t *get_insn_slot(void);160extern void free_insn_slot(kprobe_opcode_t *slot);161+extern void kprobes_inc_nmissed_count(struct kprobe *p);162163/* Get the kprobe at this addr (if any) - called with preemption disabled */164struct kprobe *get_kprobe(void *addr);···195void kprobe_flush_task(struct task_struct *tk);196void recycle_rp_inst(struct kretprobe_instance *ri);197#else /* CONFIG_KPROBES */198+199+#define __kprobes /**/200+struct jprobe;201+struct kretprobe;202+203static inline struct kprobe *kprobe_running(void)204{205 return NULL;
+25-1
include/linux/list.h
···202 *203 * The old entry will be replaced with the new entry atomically.204 */205-static inline void list_replace_rcu(struct list_head *old, struct list_head *new){00206 new->next = old->next;207 new->prev = old->prev;208 smp_wmb();209 new->next->prev = new;210 new->prev->next = new;0211}212213/**···579 __hlist_del(n);580 INIT_HLIST_NODE(n);581 }000000000000000000000582}583584static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
···202 *203 * The old entry will be replaced with the new entry atomically.204 */205+static inline void list_replace_rcu(struct list_head *old,206+ struct list_head *new)207+{208 new->next = old->next;209 new->prev = old->prev;210 smp_wmb();211 new->next->prev = new;212 new->prev->next = new;213+ old->prev = LIST_POISON2;214}215216/**···576 __hlist_del(n);577 INIT_HLIST_NODE(n);578 }579+}580+581+/*582+ * hlist_replace_rcu - replace old entry by new one583+ * @old : the element to be replaced584+ * @new : the new element to insert585+ *586+ * The old entry will be replaced with the new entry atomically.587+ */588+static inline void hlist_replace_rcu(struct hlist_node *old,589+ struct hlist_node *new)590+{591+ struct hlist_node *next = old->next;592+593+ new->next = next;594+ new->pprev = old->pprev;595+ smp_wmb();596+ if (next)597+ new->next->pprev = &new->next;598+ *new->pprev = new;599+ old->pprev = LIST_POISON2;600}601602static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-1
include/linux/mm.h
···163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */166-#define VM_INCOMPLETE 0x02000000 /* Strange partial PFN mapping marker */167168#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */169#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
···163#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */164#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */165#define VM_MAPPED_COPY 0x01000000 /* T if mapped copy of data (nommu mmap) */0166167#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */168#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
···234extern int decnet_dr_count;235extern int decnet_no_fc_max_cwnd;2360000237#endif /* _NET_DN_H */
···234extern int decnet_dr_count;235extern int decnet_no_fc_max_cwnd;236237+extern int sysctl_decnet_mem[3];238+extern int sysctl_decnet_wmem[3];239+extern int sysctl_decnet_rmem[3];240+241#endif /* _NET_DN_H */
+3-1
kernel/audit.c
···291 set_current_state(TASK_INTERRUPTIBLE);292 add_wait_queue(&kauditd_wait, &wait);293294- if (!skb_queue_len(&audit_skb_queue))0295 schedule();0296297 __set_current_state(TASK_RUNNING);298 remove_wait_queue(&kauditd_wait, &wait);
···246 return ret;247}2480000000000000249/* Called with kretprobe_lock held */250struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp)251{···412 INIT_LIST_HEAD(&ap->list);413 list_add_rcu(&p->list, &ap->list);414415- INIT_HLIST_NODE(&ap->hlist);416- hlist_del_rcu(&p->hlist);417- hlist_add_head_rcu(&ap->hlist,418- &kprobe_table[hash_ptr(ap->addr, KPROBE_HASH_BITS)]);419}420421/*···472 int ret = 0;473 unsigned long flags = 0;474 struct kprobe *old_p;0475476- if ((ret = in_kprobes_functions((unsigned long) p->addr)) != 0)477- return ret;000000478 if ((ret = arch_prepare_kprobe(p)) != 0)479 goto rm_kprobe;480···505rm_kprobe:506 if (ret == -EEXIST)507 arch_remove_kprobe(p);00508 return ret;509}510···514{515 unsigned long flags;516 struct kprobe *old_p;0517518 spin_lock_irqsave(&kprobe_lock, flags);519 old_p = get_kprobe(p->addr);···526 cleanup_kprobe(p, flags);527528 synchronize_sched();0000529 if (old_p->pre_handler == aggr_pre_handler &&530 list_empty(&old_p->list))531 kfree(old_p);
···246 return ret;247}248249+/* Walks the list and increments nmissed count for multiprobe case */250+void __kprobes kprobes_inc_nmissed_count(struct kprobe *p)251+{252+ struct kprobe *kp;253+ if (p->pre_handler != aggr_pre_handler) {254+ p->nmissed++;255+ } else {256+ list_for_each_entry_rcu(kp, &p->list, list)257+ kp->nmissed++;258+ }259+ return;260+}261+262/* Called with kretprobe_lock held */263struct kretprobe_instance __kprobes *get_free_rp_inst(struct kretprobe *rp)264{···399 INIT_LIST_HEAD(&ap->list);400 list_add_rcu(&p->list, &ap->list);401402+ hlist_replace_rcu(&p->hlist, &ap->hlist);000403}404405/*···462 int ret = 0;463 unsigned long flags = 0;464 struct kprobe *old_p;465+ struct module *mod;466467+ if ((!kernel_text_address((unsigned long) p->addr)) ||468+ in_kprobes_functions((unsigned long) p->addr))469+ return -EINVAL;470+471+ if ((mod = module_text_address((unsigned long) p->addr)) &&472+ (unlikely(!try_module_get(mod))))473+ return -EINVAL;474+475 if ((ret = arch_prepare_kprobe(p)) != 0)476 goto rm_kprobe;477···488rm_kprobe:489 if (ret == -EEXIST)490 arch_remove_kprobe(p);491+ if (ret && mod)492+ module_put(mod);493 return ret;494}495···495{496 unsigned long flags;497 struct kprobe *old_p;498+ struct module *mod;499500 spin_lock_irqsave(&kprobe_lock, flags);501 old_p = get_kprobe(p->addr);···506 cleanup_kprobe(p, flags);507508 synchronize_sched();509+510+ if ((mod = module_text_address((unsigned long)p->addr)))511+ module_put(mod);512+513 if (old_p->pre_handler == aggr_pre_handler &&514 list_empty(&old_p->list))515 kfree(old_p);
+54-5
kernel/rcupdate.c
···116 local_irq_restore(flags);117}1180000119/**120 * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.121 * @head: structure to be used for queueing the RCU updates.···165{166 return rcu_ctrlblk.completed;167}000000000000000000000000000000000000168169/*170 * Invoke the completed RCU callbacks. They are expected to be in···257258 if (rcp->next_pending &&259 rcp->completed == rcp->cur) {260- /* Can't change, since spin lock held. */261- cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask);262-263 rcp->next_pending = 0;264- /* next_pending == 0 must be visible in __rcu_process_callbacks()265- * before it can see new value of cur.0266 */267 smp_wmb();268 rcp->cur++;0000000000269 }270}271···505 */506void __init rcu_init(void)507{0508 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE,509 (void *)(long)smp_processor_id());510 /* Register notifier for non-boot CPUs */
···116 local_irq_restore(flags);117}118119+static atomic_t rcu_barrier_cpu_count;120+static struct semaphore rcu_barrier_sema;121+static struct completion rcu_barrier_completion;122+123/**124 * call_rcu_bh - Queue an RCU for invocation after a quicker grace period.125 * @head: structure to be used for queueing the RCU updates.···161{162 return rcu_ctrlblk.completed;163}164+165+static void rcu_barrier_callback(struct rcu_head *notused)166+{167+ if (atomic_dec_and_test(&rcu_barrier_cpu_count))168+ complete(&rcu_barrier_completion);169+}170+171+/*172+ * Called with preemption disabled, and from cross-cpu IRQ context.173+ */174+static void rcu_barrier_func(void *notused)175+{176+ int cpu = smp_processor_id();177+ struct rcu_data *rdp = &per_cpu(rcu_data, cpu);178+ struct rcu_head *head;179+180+ head = &rdp->barrier;181+ atomic_inc(&rcu_barrier_cpu_count);182+ call_rcu(head, rcu_barrier_callback);183+}184+185+/**186+ * rcu_barrier - Wait until all the in-flight RCUs are complete.187+ */188+void rcu_barrier(void)189+{190+ BUG_ON(in_interrupt());191+ /* Take cpucontrol semaphore to protect against CPU hotplug */192+ down(&rcu_barrier_sema);193+ init_completion(&rcu_barrier_completion);194+ atomic_set(&rcu_barrier_cpu_count, 0);195+ on_each_cpu(rcu_barrier_func, NULL, 0, 1);196+ wait_for_completion(&rcu_barrier_completion);197+ up(&rcu_barrier_sema);198+}199+EXPORT_SYMBOL_GPL(rcu_barrier);200201/*202 * Invoke the completed RCU callbacks. They are expected to be in···217218 if (rcp->next_pending &&219 rcp->completed == rcp->cur) {000220 rcp->next_pending = 0;221+ /*222+ * next_pending == 0 must be visible in223+ * __rcu_process_callbacks() before it can see new value of cur.224 */225 smp_wmb();226 rcp->cur++;227+228+ /*229+ * Accessing nohz_cpu_mask before incrementing rcp->cur needs a230+ * Barrier Otherwise it can cause tickless idle CPUs to be231+ * included in rsp->cpumask, which will extend graceperiods232+ * unnecessarily.233+ */234+ smp_mb();235+ cpus_andnot(rsp->cpumask, cpu_online_map, nohz_cpu_mask);236+237 }238}239···457 */458void __init rcu_init(void)459{460+ sema_init(&rcu_barrier_sema, 1);461 rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE,462 (void *)(long)smp_processor_id());463 /* Register notifier for non-boot CPUs */
+1-2
kernel/rcutorture.c
···409 stats_task = NULL;410411 /* Wait for all RCU callbacks to fire. */0412413- for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)414- synchronize_rcu();415 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */416 printk(KERN_ALERT TORTURE_FLAG417 "--- End of test: %s\n",
···409 stats_task = NULL;410411 /* Wait for all RCU callbacks to fire. */412+ rcu_barrier();41300414 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */415 printk(KERN_ALERT TORTURE_FLAG416 "--- End of test: %s\n",
+2-1
kernel/sys.c
···3233#include <linux/compat.h>34#include <linux/syscalls.h>03536#include <asm/uaccess.h>37#include <asm/io.h>···169 * of the last notifier function called.170 */171172-int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)173{174 int ret=NOTIFY_DONE;175 struct notifier_block *nb = *n;
···3233#include <linux/compat.h>34#include <linux/syscalls.h>35+#include <linux/kprobes.h>3637#include <asm/uaccess.h>38#include <asm/io.h>···168 * of the last notifier function called.169 */170171+int __kprobes notifier_call_chain(struct notifier_block **n, unsigned long val, void *v)172{173 int ret=NOTIFY_DONE;174 struct notifier_block *nb = *n;
···204 unsigned long j;205 i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);206 i = ALIGN(i, incr);00207 if (test_bit(i, bdata->node_bootmem_map))208 continue;209 for (j = i + 1; j < i + areasize; ++j) {
···204 unsigned long j;205 i = find_next_zero_bit(bdata->node_bootmem_map, eidx, i);206 i = ALIGN(i, incr);207+ if (i >= eidx)208+ break;209 if (test_bit(i, bdata->node_bootmem_map))210 continue;211 for (j = i + 1; j < i + areasize; ++j) {
+18-49
mm/memory.c
···349 dump_stack();350}35100000352/*353 * This function gets the "struct page" associated with a pte.354 *···381 if (vma->vm_flags & VM_PFNMAP) {382 unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;383 if (pfn == vma->vm_pgoff + off)00384 return NULL;385 }386···444 * If it's a COW mapping, write protect it both445 * in the parent and the child446 */447- if ((vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE) {448 ptep_set_wrprotect(src_mm, addr, src_pte);449 pte = *src_pte;450 }···1233EXPORT_SYMBOL(vm_insert_page);12341235/*1236- * Somebody does a pfn remapping that doesn't actually work as a vma.1237- *1238- * Do it as individual pages instead, and warn about it. It's bad form,1239- * and very inefficient.1240- */1241-static int incomplete_pfn_remap(struct vm_area_struct *vma,1242- unsigned long start, unsigned long end,1243- unsigned long pfn, pgprot_t prot)1244-{1245- static int warn = 10;1246- struct page *page;1247- int retval;1248-1249- if (!(vma->vm_flags & VM_INCOMPLETE)) {1250- if (warn) {1251- warn--;1252- printk("%s does an incomplete pfn remapping", current->comm);1253- dump_stack();1254- }1255- }1256- vma->vm_flags |= VM_INCOMPLETE | VM_IO | VM_RESERVED;1257-1258- if (start < vma->vm_start || end > vma->vm_end)1259- return -EINVAL;1260-1261- if (!pfn_valid(pfn))1262- return -EINVAL;1263-1264- page = pfn_to_page(pfn);1265- if (!PageReserved(page))1266- return -EINVAL;1267-1268- retval = 0;1269- while (start < end) {1270- retval = insert_page(vma->vm_mm, start, page, prot);1271- if (retval < 0)1272- break;1273- start += PAGE_SIZE;1274- page++;1275- }1276- return retval;1277-}1278-1279-/*1280 * maps a range of physical memory into the requested pages. the old1281 * mappings are removed. any references to nonexistent pages results1282 * in null mappings (currently treated as "copy-on-access")···1306 struct mm_struct *mm = vma->vm_mm;1307 int err;13081309- if (addr != vma->vm_start || end != vma->vm_end)1310- return incomplete_pfn_remap(vma, addr, end, pfn, prot);1311-1312 /*1313 * Physically remapped pages are special. Tell the1314 * rest of the world about it:···1319 * VM_PFNMAP tells the core MM that the base pages are just1320 * raw PFN mappings, and do not have a "struct page" associated1321 * with them.00001322 */0000001323 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;1324- vma->vm_pgoff = pfn;13251326 BUG_ON(addr >= end);1327 pfn -= addr >> PAGE_SHIFT;
···349 dump_stack();350}351352+static inline int is_cow_mapping(unsigned int flags)353+{354+ return (flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE;355+}356+357/*358 * This function gets the "struct page" associated with a pte.359 *···376 if (vma->vm_flags & VM_PFNMAP) {377 unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;378 if (pfn == vma->vm_pgoff + off)379+ return NULL;380+ if (!is_cow_mapping(vma->vm_flags))381 return NULL;382 }383···437 * If it's a COW mapping, write protect it both438 * in the parent and the child439 */440+ if (is_cow_mapping(vm_flags)) {441 ptep_set_wrprotect(src_mm, addr, src_pte);442 pte = *src_pte;443 }···1226EXPORT_SYMBOL(vm_insert_page);12271228/*000000000000000000000000000000000000000000001229 * maps a range of physical memory into the requested pages. the old1230 * mappings are removed. any references to nonexistent pages results1231 * in null mappings (currently treated as "copy-on-access")···1343 struct mm_struct *mm = vma->vm_mm;1344 int err;13450001346 /*1347 * Physically remapped pages are special. Tell the1348 * rest of the world about it:···1359 * VM_PFNMAP tells the core MM that the base pages are just1360 * raw PFN mappings, and do not have a "struct page" associated1361 * with them.1362+ *1363+ * There's a horrible special case to handle copy-on-write1364+ * behaviour that some programs depend on. We mark the "original"1365+ * un-COW'ed pages by matching them up with "vma->vm_pgoff".1366 */1367+ if (is_cow_mapping(vma->vm_flags)) {1368+ if (addr != vma->vm_start || end != vma->vm_end)1369+ return -EINVAL;1370+ vma->vm_pgoff = pfn;1371+ }1372+1373 vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;013741375 BUG_ON(addr >= end);1376 pfn -= addr >> PAGE_SHIFT;
···1113void netdev_rx_csum_fault(struct net_device *dev)1114{1115 if (net_ratelimit()) {1116+ printk(KERN_ERR "%s: hw csum failure.\n", 1117+ dev ? dev->name : "<unknown>");1118 dump_stack();1119 }1120}
+1-1
net/core/skbuff.c
···1725 * of the skb if any page alloc fails user this procedure returns -ENOMEM1726 */1727int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,1728- int getfrag(void *from, char *to, int offset,1729 int len, int odd, struct sk_buff *skb),1730 void *from, int length)1731{
···1725 * of the skb if any page alloc fails user this procedure returns -ENOMEM1726 */1727int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,1728+ int (*getfrag)(void *from, char *to, int offset,1729 int len, int odd, struct sk_buff *skb),1730 void *from, int length)1731{
+22-3
net/decnet/af_decnet.c
···153static DEFINE_RWLOCK(dn_hash_lock);154static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE];155static struct hlist_head dn_wild_sk;0156157static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen, int flags);158static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags);···447 dst_release(xchg(&sk->sk_dst_cache, NULL));448}449000000000450static struct proto dn_proto = {451- .name = "DECNET",452- .owner = THIS_MODULE,453- .obj_size = sizeof(struct dn_sock),0000000454};455456static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp)···487 sk->sk_family = PF_DECnet;488 sk->sk_protocol = 0;489 sk->sk_allocation = gfp;00490491 /* Initialization of DECnet Session Control Port */492 scp = DN_SK(sk);
···153static DEFINE_RWLOCK(dn_hash_lock);154static struct hlist_head dn_sk_hash[DN_SK_HASH_SIZE];155static struct hlist_head dn_wild_sk;156+static atomic_t decnet_memory_allocated;157158static int __dn_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen, int flags);159static int __dn_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen, int flags);···446 dst_release(xchg(&sk->sk_dst_cache, NULL));447}448449+static int dn_memory_pressure;450+451+static void dn_enter_memory_pressure(void)452+{453+ if (!dn_memory_pressure) {454+ dn_memory_pressure = 1;455+ }456+}457+458static struct proto dn_proto = {459+ .name = "NSP",460+ .owner = THIS_MODULE,461+ .enter_memory_pressure = dn_enter_memory_pressure,462+ .memory_pressure = &dn_memory_pressure,463+ .memory_allocated = &decnet_memory_allocated,464+ .sysctl_mem = sysctl_decnet_mem,465+ .sysctl_wmem = sysctl_decnet_wmem,466+ .sysctl_rmem = sysctl_decnet_rmem,467+ .max_header = DN_MAX_NSP_DATA_HEADER + 64,468+ .obj_size = sizeof(struct dn_sock),469};470471static struct sock *dn_alloc_sock(struct socket *sock, gfp_t gfp)···470 sk->sk_family = PF_DECnet;471 sk->sk_protocol = 0;472 sk->sk_allocation = gfp;473+ sk->sk_sndbuf = sysctl_decnet_wmem[1];474+ sk->sk_rcvbuf = sysctl_decnet_rmem[1];475476 /* Initialization of DECnet Session Control Port */477 scp = DN_SK(sk);
···56 instead of the individual packets.5758config IP_NF_CONNTRACK_EVENTS59- bool "Connection tracking events"60- depends on IP_NF_CONNTRACK61 help62 If this option is enabled, the connection tracking code will63 provide a notifier chain that can be used by other kernel code···66 IF unsure, say `N'.6768config IP_NF_CONNTRACK_NETLINK69- tristate 'Connection tracking netlink interface'70- depends on IP_NF_CONNTRACK && NETFILTER_NETLINK71 depends on IP_NF_CONNTRACK!=y || NETFILTER_NETLINK!=m72 help73 This option enables support for a netlink-based userspace interface
···56 instead of the individual packets.5758config IP_NF_CONNTRACK_EVENTS59+ bool "Connection tracking events (EXPERIMENTAL)"60+ depends on EXPERIMENTAL && IP_NF_CONNTRACK61 help62 If this option is enabled, the connection tracking code will63 provide a notifier chain that can be used by other kernel code···66 IF unsure, say `N'.6768config IP_NF_CONNTRACK_NETLINK69+ tristate 'Connection tracking netlink interface (EXPERIMENTAL)'70+ depends on EXPERIMENTAL && IP_NF_CONNTRACK && NETFILTER_NETLINK71 depends on IP_NF_CONNTRACK!=y || NETFILTER_NETLINK!=m72 help73 This option enables support for a netlink-based userspace interface
+11-9
net/ipv4/netfilter/ip_conntrack_core.c
···1345 return 1;1346}1347000001348static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)1349{1350 if (vmalloced)···1359 get_order(sizeof(struct list_head) * size));1360}13611362-void ip_conntrack_flush(void)001363{001364 /* This makes sure all current packets have passed through1365 netfilter framework. Roll on, two-stage module1366 delete... */···13721373 ip_ct_event_cache_flush();1374 i_see_dead_people:1375- ip_ct_iterate_cleanup(kill_all, NULL);1376 if (atomic_read(&ip_conntrack_count) != 0) {1377 schedule();1378 goto i_see_dead_people;···1380 /* wait until all references to ip_conntrack_untracked are dropped */1381 while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)1382 schedule();1383-}13841385-/* Mishearing the voices in his head, our hero wonders how he's1386- supposed to kill the mall. */1387-void ip_conntrack_cleanup(void)1388-{1389- ip_ct_attach = NULL;1390- ip_conntrack_flush();1391 kmem_cache_destroy(ip_conntrack_cachep);1392 kmem_cache_destroy(ip_conntrack_expect_cachep);1393 free_conntrack_hash(ip_conntrack_hash, ip_conntrack_vmalloc,
···1345 return 1;1346}13471348+void ip_conntrack_flush(void)1349+{1350+ ip_ct_iterate_cleanup(kill_all, NULL);1351+}1352+1353static void free_conntrack_hash(struct list_head *hash, int vmalloced,int size)1354{1355 if (vmalloced)···1354 get_order(sizeof(struct list_head) * size));1355}13561357+/* Mishearing the voices in his head, our hero wonders how he's1358+ supposed to kill the mall. */1359+void ip_conntrack_cleanup(void)1360{1361+ ip_ct_attach = NULL;1362+1363 /* This makes sure all current packets have passed through1364 netfilter framework. Roll on, two-stage module1365 delete... */···13631364 ip_ct_event_cache_flush();1365 i_see_dead_people:1366+ ip_conntrack_flush();1367 if (atomic_read(&ip_conntrack_count) != 0) {1368 schedule();1369 goto i_see_dead_people;···1371 /* wait until all references to ip_conntrack_untracked are dropped */1372 while (atomic_read(&ip_conntrack_untracked.ct_general.use) > 1)1373 schedule();013740000001375 kmem_cache_destroy(ip_conntrack_cachep);1376 kmem_cache_destroy(ip_conntrack_expect_cachep);1377 free_conntrack_hash(ip_conntrack_hash, ip_conntrack_vmalloc,
···262 * We are working here with either a clone of the original263 * SKB, or a fresh unique copy made by the retransmit engine.264 */265-static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb)266{267- if (skb != NULL) {268- const struct inet_connection_sock *icsk = inet_csk(sk);269- struct inet_sock *inet = inet_sk(sk);270- struct tcp_sock *tp = tcp_sk(sk);271- struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);272- int tcp_header_size = tp->tcp_header_len;273- struct tcphdr *th;274- int sysctl_flags;275- int err;276277- BUG_ON(!tcp_skb_pcount(skb));00000000000000000000278279#define SYSCTL_FLAG_TSTAMPS 0x1280#define SYSCTL_FLAG_WSCALE 0x2281#define SYSCTL_FLAG_SACK 0x4282283- /* If congestion control is doing timestamping */284- if (icsk->icsk_ca_ops->rtt_sample)285- __net_timestamp(skb);286-287- sysctl_flags = 0;288- if (tcb->flags & TCPCB_FLAG_SYN) {289- tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS;290- if(sysctl_tcp_timestamps) {291- tcp_header_size += TCPOLEN_TSTAMP_ALIGNED;292- sysctl_flags |= SYSCTL_FLAG_TSTAMPS;293- }294- if(sysctl_tcp_window_scaling) {295- tcp_header_size += TCPOLEN_WSCALE_ALIGNED;296- sysctl_flags |= SYSCTL_FLAG_WSCALE;297- }298- if(sysctl_tcp_sack) {299- sysctl_flags |= SYSCTL_FLAG_SACK;300- if(!(sysctl_flags & SYSCTL_FLAG_TSTAMPS))301- tcp_header_size += TCPOLEN_SACKPERM_ALIGNED;302- }303- } else if (tp->rx_opt.eff_sacks) {304- /* A SACK is 2 pad bytes, a 2 byte header, plus305- * 2 32-bit sequence numbers for each SACK block.306- */307- tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +308- (tp->rx_opt.eff_sacks * TCPOLEN_SACK_PERBLOCK));309 }310-311- if (tcp_packets_in_flight(tp) == 0)312- tcp_ca_event(sk, CA_EVENT_TX_START);313-314- th = (struct tcphdr *) skb_push(skb, tcp_header_size);315- skb->h.th = th;316- skb_set_owner_w(skb, sk);317-318- /* Build TCP header and checksum it. */319- th->source = inet->sport;320- th->dest = inet->dport;321- th->seq = htonl(tcb->seq);322- th->ack_seq = htonl(tp->rcv_nxt);323- *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | tcb->flags);324- if (tcb->flags & TCPCB_FLAG_SYN) {325- /* RFC1323: The window in SYN & SYN/ACK segments326- * is never scaled.327- */328- th->window = htons(tp->rcv_wnd);329- } else {330- th->window = htons(tcp_select_window(sk));331 }332- th->check = 0;333- th->urg_ptr = 0;334-335- if (tp->urg_mode &&336- between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF)) {337- th->urg_ptr = htons(tp->snd_up-tcb->seq);338- th->urg = 1;339 }340-341- if (tcb->flags & TCPCB_FLAG_SYN) {342- tcp_syn_build_options((__u32 *)(th + 1),343- tcp_advertise_mss(sk),344- (sysctl_flags & SYSCTL_FLAG_TSTAMPS),345- (sysctl_flags & SYSCTL_FLAG_SACK),346- (sysctl_flags & SYSCTL_FLAG_WSCALE),347- tp->rx_opt.rcv_wscale,348- tcb->when,349- tp->rx_opt.ts_recent);350- } else {351- tcp_build_and_update_options((__u32 *)(th + 1),352- tp, tcb->when);353-354- TCP_ECN_send(sk, tp, skb, tcp_header_size);355- }356- tp->af_specific->send_check(sk, th, skb->len, skb);357-358- if (tcb->flags & TCPCB_FLAG_ACK)359- tcp_event_ack_sent(sk, tcp_skb_pcount(skb));360-361- if (skb->len != tcp_header_size)362- tcp_event_data_sent(tp, skb, sk);363-364- TCP_INC_STATS(TCP_MIB_OUTSEGS);365-366- err = tp->af_specific->queue_xmit(skb, 0);367- if (err <= 0)368- return err;369-370- tcp_enter_cwr(sk);371-372- /* NET_XMIT_CN is special. It does not guarantee,373- * that this packet is lost. It tells that device374- * is about to start to drop packets or already375- * drops some packets of the same priority and376- * invokes us to send less aggressively.377 */378- return err == NET_XMIT_CN ? 0 : err;00379 }380- return -ENOBUFS;00000000000000000000000000000000000000000000000000000000000000000000000381#undef SYSCTL_FLAG_TSTAMPS382#undef SYSCTL_FLAG_WSCALE383#undef SYSCTL_FLAG_SACK···10531054 TCP_SKB_CB(skb)->when = tcp_time_stamp;10551056- if (unlikely(tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC))))1057 break;10581059 /* Advance the send_head. This one is sent out.···1126 /* Send it out now. */1127 TCP_SKB_CB(skb)->when = tcp_time_stamp;11281129- if (likely(!tcp_transmit_skb(sk, skb_clone(skb, sk->sk_allocation)))) {1130 update_send_head(sk, tp, skb);1131 tcp_cwnd_validate(sk, tp);1132 return;···1446 */1447 TCP_SKB_CB(skb)->when = tcp_time_stamp;14481449- err = tcp_transmit_skb(sk, (skb_cloned(skb) ?1450- pskb_copy(skb, GFP_ATOMIC):1451- skb_clone(skb, GFP_ATOMIC)));14521453 if (err == 0) {1454 /* Update global TCP statistics. */···1680 TCP_SKB_CB(skb)->seq = tcp_acceptable_seq(sk, tp);1681 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;1682 TCP_SKB_CB(skb)->when = tcp_time_stamp;1683- if (tcp_transmit_skb(sk, skb))1684 NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);1685}1686···1715 TCP_ECN_send_synack(tcp_sk(sk), skb);1716 }1717 TCP_SKB_CB(skb)->when = tcp_time_stamp;1718- return tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));1719}17201721/*···1876 __skb_queue_tail(&sk->sk_write_queue, buff);1877 sk_charge_skb(sk, buff);1878 tp->packets_out += tcp_skb_pcount(buff);1879- tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL));1880 TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);18811882 /* Timer for repeating the SYN until an answer. */···1972 /* Send it off, this clears delayed acks for us. */1973 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk, tp);1974 TCP_SKB_CB(buff)->when = tcp_time_stamp;1975- tcp_transmit_skb(sk, buff);1976 }1977}1978···2012 TCP_SKB_CB(skb)->seq = urgent ? tp->snd_una : tp->snd_una - 1;2013 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;2014 TCP_SKB_CB(skb)->when = tcp_time_stamp;2015- return tcp_transmit_skb(sk, skb);2016}20172018int tcp_write_wakeup(struct sock *sk)···20452046 TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;2047 TCP_SKB_CB(skb)->when = tcp_time_stamp;2048- err = tcp_transmit_skb(sk, skb_clone(skb, GFP_ATOMIC));2049 if (!err) {2050 update_send_head(sk, tp, skb);2051 }
···262 * We are working here with either a clone of the original263 * SKB, or a fresh unique copy made by the retransmit engine.264 */265+static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, gfp_t gfp_mask)266{267+ const struct inet_connection_sock *icsk = inet_csk(sk);268+ struct inet_sock *inet;269+ struct tcp_sock *tp;270+ struct tcp_skb_cb *tcb;271+ int tcp_header_size;272+ struct tcphdr *th;273+ int sysctl_flags;274+ int err;0275276+ BUG_ON(!skb || !tcp_skb_pcount(skb));277+278+ /* If congestion control is doing timestamping, we must279+ * take such a timestamp before we potentially clone/copy.280+ */281+ if (icsk->icsk_ca_ops->rtt_sample)282+ __net_timestamp(skb);283+284+ if (likely(clone_it)) {285+ if (unlikely(skb_cloned(skb)))286+ skb = pskb_copy(skb, gfp_mask);287+ else288+ skb = skb_clone(skb, gfp_mask);289+ if (unlikely(!skb))290+ return -ENOBUFS;291+ }292+293+ inet = inet_sk(sk);294+ tp = tcp_sk(sk);295+ tcb = TCP_SKB_CB(skb);296+ tcp_header_size = tp->tcp_header_len;297298#define SYSCTL_FLAG_TSTAMPS 0x1299#define SYSCTL_FLAG_WSCALE 0x2300#define SYSCTL_FLAG_SACK 0x4301302+ sysctl_flags = 0;303+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {304+ tcp_header_size = sizeof(struct tcphdr) + TCPOLEN_MSS;305+ if(sysctl_tcp_timestamps) {306+ tcp_header_size += TCPOLEN_TSTAMP_ALIGNED;307+ sysctl_flags |= SYSCTL_FLAG_TSTAMPS;00000000000000000000308 }309+ if (sysctl_tcp_window_scaling) {310+ tcp_header_size += TCPOLEN_WSCALE_ALIGNED;311+ sysctl_flags |= SYSCTL_FLAG_WSCALE;000000000000000000312 }313+ if (sysctl_tcp_sack) {314+ sysctl_flags |= SYSCTL_FLAG_SACK;315+ if (!(sysctl_flags & SYSCTL_FLAG_TSTAMPS))316+ tcp_header_size += TCPOLEN_SACKPERM_ALIGNED;000317 }318+ } else if (unlikely(tp->rx_opt.eff_sacks)) {319+ /* A SACK is 2 pad bytes, a 2 byte header, plus320+ * 2 32-bit sequence numbers for each SACK block.0000000000000000000000000000000000321 */322+ tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +323+ (tp->rx_opt.eff_sacks *324+ TCPOLEN_SACK_PERBLOCK));325 }326+327+ if (tcp_packets_in_flight(tp) == 0)328+ tcp_ca_event(sk, CA_EVENT_TX_START);329+330+ th = (struct tcphdr *) skb_push(skb, tcp_header_size);331+ skb->h.th = th;332+ skb_set_owner_w(skb, sk);333+334+ /* Build TCP header and checksum it. */335+ th->source = inet->sport;336+ th->dest = inet->dport;337+ th->seq = htonl(tcb->seq);338+ th->ack_seq = htonl(tp->rcv_nxt);339+ *(((__u16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) |340+ tcb->flags);341+342+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {343+ /* RFC1323: The window in SYN & SYN/ACK segments344+ * is never scaled.345+ */346+ th->window = htons(tp->rcv_wnd);347+ } else {348+ th->window = htons(tcp_select_window(sk));349+ }350+ th->check = 0;351+ th->urg_ptr = 0;352+353+ if (unlikely(tp->urg_mode &&354+ between(tp->snd_up, tcb->seq+1, tcb->seq+0xFFFF))) {355+ th->urg_ptr = htons(tp->snd_up-tcb->seq);356+ th->urg = 1;357+ }358+359+ if (unlikely(tcb->flags & TCPCB_FLAG_SYN)) {360+ tcp_syn_build_options((__u32 *)(th + 1),361+ tcp_advertise_mss(sk),362+ (sysctl_flags & SYSCTL_FLAG_TSTAMPS),363+ (sysctl_flags & SYSCTL_FLAG_SACK),364+ (sysctl_flags & SYSCTL_FLAG_WSCALE),365+ tp->rx_opt.rcv_wscale,366+ tcb->when,367+ tp->rx_opt.ts_recent);368+ } else {369+ tcp_build_and_update_options((__u32 *)(th + 1),370+ tp, tcb->when);371+ TCP_ECN_send(sk, tp, skb, tcp_header_size);372+ }373+374+ tp->af_specific->send_check(sk, th, skb->len, skb);375+376+ if (likely(tcb->flags & TCPCB_FLAG_ACK))377+ tcp_event_ack_sent(sk, tcp_skb_pcount(skb));378+379+ if (skb->len != tcp_header_size)380+ tcp_event_data_sent(tp, skb, sk);381+382+ TCP_INC_STATS(TCP_MIB_OUTSEGS);383+384+ err = tp->af_specific->queue_xmit(skb, 0);385+ if (unlikely(err <= 0))386+ return err;387+388+ tcp_enter_cwr(sk);389+390+ /* NET_XMIT_CN is special. It does not guarantee,391+ * that this packet is lost. It tells that device392+ * is about to start to drop packets or already393+ * drops some packets of the same priority and394+ * invokes us to send less aggressively.395+ */396+ return err == NET_XMIT_CN ? 0 : err;397+398#undef SYSCTL_FLAG_TSTAMPS399#undef SYSCTL_FLAG_WSCALE400#undef SYSCTL_FLAG_SACK···10361037 TCP_SKB_CB(skb)->when = tcp_time_stamp;10381039+ if (unlikely(tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC)))1040 break;10411042 /* Advance the send_head. This one is sent out.···1109 /* Send it out now. */1110 TCP_SKB_CB(skb)->when = tcp_time_stamp;11111112+ if (likely(!tcp_transmit_skb(sk, skb, 1, sk->sk_allocation))) {1113 update_send_head(sk, tp, skb);1114 tcp_cwnd_validate(sk, tp);1115 return;···1429 */1430 TCP_SKB_CB(skb)->when = tcp_time_stamp;14311432+ err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);0014331434 if (err == 0) {1435 /* Update global TCP statistics. */···1665 TCP_SKB_CB(skb)->seq = tcp_acceptable_seq(sk, tp);1666 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;1667 TCP_SKB_CB(skb)->when = tcp_time_stamp;1668+ if (tcp_transmit_skb(sk, skb, 0, priority))1669 NET_INC_STATS(LINUX_MIB_TCPABORTFAILED);1670}1671···1700 TCP_ECN_send_synack(tcp_sk(sk), skb);1701 }1702 TCP_SKB_CB(skb)->when = tcp_time_stamp;1703+ return tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);1704}17051706/*···1861 __skb_queue_tail(&sk->sk_write_queue, buff);1862 sk_charge_skb(sk, buff);1863 tp->packets_out += tcp_skb_pcount(buff);1864+ tcp_transmit_skb(sk, buff, 1, GFP_KERNEL);1865 TCP_INC_STATS(TCP_MIB_ACTIVEOPENS);18661867 /* Timer for repeating the SYN until an answer. */···1957 /* Send it off, this clears delayed acks for us. */1958 TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk, tp);1959 TCP_SKB_CB(buff)->when = tcp_time_stamp;1960+ tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC);1961 }1962}1963···1997 TCP_SKB_CB(skb)->seq = urgent ? tp->snd_una : tp->snd_una - 1;1998 TCP_SKB_CB(skb)->end_seq = TCP_SKB_CB(skb)->seq;1999 TCP_SKB_CB(skb)->when = tcp_time_stamp;2000+ return tcp_transmit_skb(sk, skb, 0, GFP_ATOMIC);2001}20022003int tcp_write_wakeup(struct sock *sk)···20302031 TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;2032 TCP_SKB_CB(skb)->when = tcp_time_stamp;2033+ err = tcp_transmit_skb(sk, skb, 1, GFP_ATOMIC);2034 if (!err) {2035 update_send_head(sk, tp, skb);2036 }
+4-12
net/ipv4/tcp_vegas.c
···215 vegas->beg_snd_nxt = tp->snd_nxt;216 vegas->beg_snd_cwnd = tp->snd_cwnd;217218- /* Take into account the current RTT sample too, to219- * decrease the impact of delayed acks. This double counts220- * this sample since we count it for the next window as well,221- * but that's not too awful, since we're taking the min,222- * rather than averaging.223- */224- tcp_vegas_rtt_calc(sk, seq_rtt * 1000);225-226 /* We do the Vegas calculations only if we got enough RTT227 * samples that we can be reasonably sure that we got228 * at least one RTT sample that wasn't from a delayed ACK.···325 else if (tp->snd_cwnd > tp->snd_cwnd_clamp)326 tp->snd_cwnd = tp->snd_cwnd_clamp;327 }328- }329330- /* Wipe the slate clean for the next RTT. */331- vegas->cntRTT = 0;332- vegas->minRTT = 0x7fffffff;0333}334335/* Extract info for Tcp socket info provided via netlink. */
···215 vegas->beg_snd_nxt = tp->snd_nxt;216 vegas->beg_snd_cwnd = tp->snd_cwnd;21700000000218 /* We do the Vegas calculations only if we got enough RTT219 * samples that we can be reasonably sure that we got220 * at least one RTT sample that wasn't from a delayed ACK.···333 else if (tp->snd_cwnd > tp->snd_cwnd_clamp)334 tp->snd_cwnd = tp->snd_cwnd_clamp;335 }0336337+ /* Wipe the slate clean for the next RTT. */338+ vegas->cntRTT = 0;339+ vegas->minRTT = 0x7fffffff;340+ }341}342343/* Extract info for Tcp socket info provided via netlink. */
+1-1
net/ipv6/esp6.c
···248 if (esp->conf.padlen)249 mtu = ALIGN(mtu, esp->conf.padlen);250251- return mtu + x->props.header_len + esp->auth.icv_full_len;252}253254static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
···248 if (esp->conf.padlen)249 mtu = ALIGN(mtu, esp->conf.padlen);250251+ return mtu + x->props.header_len + esp->auth.icv_trunc_len;252}253254static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
+6-6
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
···68 [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +169 };7071- __u8 type = orig->dst.u.icmp.type - 128;72- if (type >= sizeof(invmap) || !invmap[type])73 return 0;7475 tuple->src.u.icmp.id = orig->src.u.icmp.id;···129 [ICMPV6_ECHO_REQUEST - 128] = 1,130 [ICMPV6_NI_QUERY - 128] = 1131 };0132133- if (conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128 >= sizeof(valid_new)134- || !valid_new[conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128]) {135 /* Can't create a new ICMPv6 `conn' with this. */136- DEBUGP("icmp: can't create new conn with type %u\n",137- conntrack->tuplehash[0].tuple.dst.u.icmp.type);138 NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple);139 return 0;140 }
···68 [ICMPV6_NI_REPLY - 128] = ICMPV6_NI_REPLY +169 };7071+ int type = orig->dst.u.icmp.type - 128;72+ if (type < 0 || type >= sizeof(invmap) || !invmap[type])73 return 0;7475 tuple->src.u.icmp.id = orig->src.u.icmp.id;···129 [ICMPV6_ECHO_REQUEST - 128] = 1,130 [ICMPV6_NI_QUERY - 128] = 1131 };132+ int type = conntrack->tuplehash[0].tuple.dst.u.icmp.type - 128;133134+ if (type < 0 || type >= sizeof(valid_new) || !valid_new[type]) {0135 /* Can't create a new ICMPv6 `conn' with this. */136+ DEBUGP("icmpv6: can't create new conn with type %u\n",137+ type + 128);138 NF_CT_DUMP_TUPLE(&conntrack->tuplehash[0].tuple);139 return 0;140 }
+2-2
net/netfilter/Kconfig
···61 instead of the individual packets.6263config NF_CONNTRACK_EVENTS64- bool "Connection tracking events"65- depends on NF_CONNTRACK66 help67 If this option is enabled, the connection tracking code will68 provide a notifier chain that can be used by other kernel code
···61 instead of the individual packets.6263config NF_CONNTRACK_EVENTS64+ bool "Connection tracking events (EXPERIMENTAL)"65+ depends on EXPERIMENTAL && NF_CONNTRACK66 help67 If this option is enabled, the connection tracking code will68 provide a notifier chain that can be used by other kernel code
+3
net/netfilter/nf_conntrack_core.c
···1383 schedule();1384 goto i_see_dead_people;1385 }00013861387 for (i = 0; i < NF_CT_F_NUM; i++) {1388 if (nf_ct_cache[i].use == 0)
···1383 schedule();1384 goto i_see_dead_people;1385 }1386+ /* wait until all references to nf_conntrack_untracked are dropped */1387+ while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1)1388+ schedule();13891390 for (i = 0; i < NF_CT_F_NUM; i++) {1391 if (nf_ct_cache[i].use == 0)
+2-3
net/netfilter/nfnetlink.c
···162 return -EINVAL;163 }164165- min_len = NLMSG_ALIGN(sizeof(struct nfgenmsg));166 if (unlikely(nlh->nlmsg_len < min_len))167 return -EINVAL;168···236 }237238 /* All the messages must at least contain nfgenmsg */239- if (nlh->nlmsg_len < 240- NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg)))) {241 DEBUGP("received message was too short\n");242 return 0;243 }
···162 return -EINVAL;163 }164165+ min_len = NLMSG_SPACE(sizeof(struct nfgenmsg));166 if (unlikely(nlh->nlmsg_len < min_len))167 return -EINVAL;168···236 }237238 /* All the messages must at least contain nfgenmsg */239+ if (nlh->nlmsg_len < NLMSG_SPACE(sizeof(struct nfgenmsg))) {0240 DEBUGP("received message was too short\n");241 return 0;242 }
+61-54
net/packet/af_packet.c
···1587 return virt_to_page(one_pg_vec + (PAGE_SIZE << order) - 1);1588}15891590-static void free_pg_vec(char **pg_vec, unsigned order, unsigned len)1591{1592 int i;15931594- for (i=0; i<len; i++) {1595- if (pg_vec[i]) {1596- struct page *page, *pend;1597-1598- pend = pg_vec_endpage(pg_vec[i], order);1599- for (page = virt_to_page(pg_vec[i]); page <= pend; page++)1600- ClearPageReserved(page);1601- free_pages((unsigned long)pg_vec[i], order);1602- }1603 }1604 kfree(pg_vec);1605}160600000000000000000000000000000016071608static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing)1609{···16411642 /* Sanity tests and some calculations */16431644- if (po->pg_vec)1645 return -EBUSY;16461647- if ((int)req->tp_block_size <= 0)1648 return -EINVAL;1649- if (req->tp_block_size&(PAGE_SIZE-1))1650 return -EINVAL;1651- if (req->tp_frame_size < TPACKET_HDRLEN)1652 return -EINVAL;1653- if (req->tp_frame_size&(TPACKET_ALIGNMENT-1))1654 return -EINVAL;16551656 po->frames_per_block = req->tp_block_size/req->tp_frame_size;1657- if (po->frames_per_block <= 0)1658 return -EINVAL;1659- if (po->frames_per_block*req->tp_block_nr != req->tp_frame_nr)01660 return -EINVAL;1661- /* OK! */1662-1663- /* Allocate page vector */1664- while ((PAGE_SIZE<<order) < req->tp_block_size)1665- order++;16661667 err = -ENOMEM;1668-1669- pg_vec = kmalloc(req->tp_block_nr*sizeof(char *), GFP_KERNEL);1670- if (pg_vec == NULL)1671 goto out;1672- memset(pg_vec, 0, req->tp_block_nr*sizeof(char **));1673-1674- for (i=0; i<req->tp_block_nr; i++) {1675- struct page *page, *pend;1676- pg_vec[i] = (char *)__get_free_pages(GFP_KERNEL, order);1677- if (!pg_vec[i])1678- goto out_free_pgvec;1679-1680- pend = pg_vec_endpage(pg_vec[i], order);1681- for (page = virt_to_page(pg_vec[i]); page <= pend; page++)1682- SetPageReserved(page);1683- }1684- /* Page vector is allocated */16851686 l = 0;1687- for (i=0; i<req->tp_block_nr; i++) {1688 char *ptr = pg_vec[i];1689 struct tpacket_hdr *header;1690 int k;16911692- for (k=0; k<po->frames_per_block; k++) {1693-1694- header = (struct tpacket_hdr*)ptr;1695 header->tp_status = TP_STATUS_KERNEL;1696 ptr += req->tp_frame_size;1697 }1698 }1699 /* Done */1700 } else {1701- if (req->tp_frame_nr)1702 return -EINVAL;1703 }1704···17071708 spin_lock_bh(&sk->sk_receive_queue.lock);1709 pg_vec = XC(po->pg_vec, pg_vec);1710- po->frame_max = req->tp_frame_nr-1;1711 po->head = 0;1712 po->frame_size = req->tp_frame_size;1713 spin_unlock_bh(&sk->sk_receive_queue.lock);···17341735 release_sock(sk);17361737-out_free_pgvec:1738 if (pg_vec)1739 free_pg_vec(pg_vec, order, req->tp_block_nr);1740out:···1760 if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)1761 goto out;17621763- atomic_inc(&po->mapped);1764 start = vma->vm_start;1765- err = -EAGAIN;1766- for (i=0; i<po->pg_vec_len; i++) {1767- if (remap_pfn_range(vma, start,1768- __pa(po->pg_vec[i]) >> PAGE_SHIFT,1769- po->pg_vec_pages*PAGE_SIZE,1770- vma->vm_page_prot))1771- goto out;1772- start += po->pg_vec_pages*PAGE_SIZE;001773 }01774 vma->vm_ops = &packet_mmap_ops;1775 err = 0;1776
···1587 return virt_to_page(one_pg_vec + (PAGE_SIZE << order) - 1);1588}15891590+static void free_pg_vec(char **pg_vec, unsigned int order, unsigned int len)1591{1592 int i;15931594+ for (i = 0; i < len; i++) {1595+ if (likely(pg_vec[i]))1596+ free_pages((unsigned long) pg_vec[i], order);0000001597 }1598 kfree(pg_vec);1599}16001601+static inline char *alloc_one_pg_vec_page(unsigned long order)1602+{1603+ return (char *) __get_free_pages(GFP_KERNEL | __GFP_COMP | __GFP_ZERO,1604+ order);1605+}1606+1607+static char **alloc_pg_vec(struct tpacket_req *req, int order)1608+{1609+ unsigned int block_nr = req->tp_block_nr;1610+ char **pg_vec;1611+ int i;1612+1613+ pg_vec = kzalloc(block_nr * sizeof(char *), GFP_KERNEL);1614+ if (unlikely(!pg_vec))1615+ goto out;1616+1617+ for (i = 0; i < block_nr; i++) {1618+ pg_vec[i] = alloc_one_pg_vec_page(order);1619+ if (unlikely(!pg_vec[i]))1620+ goto out_free_pgvec;1621+ }1622+1623+out:1624+ return pg_vec;1625+1626+out_free_pgvec:1627+ free_pg_vec(pg_vec, order, block_nr);1628+ pg_vec = NULL;1629+ goto out;1630+}16311632static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing)1633{···16171618 /* Sanity tests and some calculations */16191620+ if (unlikely(po->pg_vec))1621 return -EBUSY;16221623+ if (unlikely((int)req->tp_block_size <= 0))1624 return -EINVAL;1625+ if (unlikely(req->tp_block_size & (PAGE_SIZE - 1)))1626 return -EINVAL;1627+ if (unlikely(req->tp_frame_size < TPACKET_HDRLEN))1628 return -EINVAL;1629+ if (unlikely(req->tp_frame_size & (TPACKET_ALIGNMENT - 1)))1630 return -EINVAL;16311632 po->frames_per_block = req->tp_block_size/req->tp_frame_size;1633+ if (unlikely(po->frames_per_block <= 0))1634 return -EINVAL;1635+ if (unlikely((po->frames_per_block * req->tp_block_nr) !=1636+ req->tp_frame_nr))1637 return -EINVAL;0000016381639 err = -ENOMEM;1640+ order = get_order(req->tp_block_size);1641+ pg_vec = alloc_pg_vec(req, order);1642+ if (unlikely(!pg_vec))1643 goto out;000000000000016441645 l = 0;1646+ for (i = 0; i < req->tp_block_nr; i++) {1647 char *ptr = pg_vec[i];1648 struct tpacket_hdr *header;1649 int k;16501651+ for (k = 0; k < po->frames_per_block; k++) {1652+ header = (struct tpacket_hdr *) ptr;01653 header->tp_status = TP_STATUS_KERNEL;1654 ptr += req->tp_frame_size;1655 }1656 }1657 /* Done */1658 } else {1659+ if (unlikely(req->tp_frame_nr))1660 return -EINVAL;1661 }1662···17011702 spin_lock_bh(&sk->sk_receive_queue.lock);1703 pg_vec = XC(po->pg_vec, pg_vec);1704+ po->frame_max = (req->tp_frame_nr - 1);1705 po->head = 0;1706 po->frame_size = req->tp_frame_size;1707 spin_unlock_bh(&sk->sk_receive_queue.lock);···17281729 release_sock(sk);173001731 if (pg_vec)1732 free_pg_vec(pg_vec, order, req->tp_block_nr);1733out:···1755 if (size != po->pg_vec_len*po->pg_vec_pages*PAGE_SIZE)1756 goto out;175701758 start = vma->vm_start;1759+ for (i = 0; i < po->pg_vec_len; i++) {1760+ struct page *page = virt_to_page(po->pg_vec[i]);1761+ int pg_num;1762+1763+ for (pg_num = 0; pg_num < po->pg_vec_pages; pg_num++, page++) {1764+ err = vm_insert_page(vma, start, page);1765+ if (unlikely(err))1766+ goto out;1767+ start += PAGE_SIZE;1768+ }1769 }1770+ atomic_inc(&po->mapped);1771 vma->vm_ops = &packet_mmap_ops;1772 err = 0;1773