History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next

Pull networking merge from David Miller: "1) Move ixgbe driver over to purely page based buffering on receive. From Alexander Duyck. 2) Add receive packet steering support to e1000e, from Bruce Allan. 3) Convert TCP MD5 support over to RCU, from Eric Dumazet. 4) Reduce cpu usage in handling out-of-order TCP packets on modern systems, also from Eric Dumazet. 5) Support the IP{,V6}_UNICAST_IF socket options, making the wine folks happy, from Erich Hoover. 6) Support VLAN trunking from guests in hyperv driver, from Haiyang Zhang. 7) Support byte-queue-limtis in r8169, from Igor Maravic. 8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but was never properly implemented, Jiri Benc fixed that. 9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang. 10) Support kernel side dump filtering by ctmark in netfilter ctnetlink, from Pablo Neira Ayuso. 11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker. 12) Add new peek socket options to assist with socket migration, from Pavel Emelyanov. 13) Add sch_plug packet scheduler whose queue is controlled by userland daemons using explicit freeze and release commands. From Shriram Rajagopalan. 14) Fix FCOE checksum offload handling on transmit, from Yi Zou." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits) Fix pppol2tp getsockname() Remove printk from rds_sendmsg ipv6: fix incorrent ipv6 ipsec packet fragment cpsw: Hook up default ndo_change_mtu. net: qmi_wwan: fix build error due to cdc-wdm dependecy netdev: driver: ethernet: Add TI CPSW driver netdev: driver: ethernet: add cpsw address lookup engine support phy: add am79c874 PHY support mlx4_core: fix race on comm channel bonding: send igmp report for its master fs_enet: Add MPC5125 FEC support and PHY interface selection net: bpf_jit: fix BPF_S_LDX_B_MSH compilation net: update the usage of CHECKSUM_UNNECESSARY fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso ixgbe: Fix issues with SR-IOV loopback when flow control is disabled net/hyperv: Fix the code handling tx busy ixgbe: fix namespace issues when FCoE/DCB is not enabled rtlwifi: Remove unused ETH_ADDR_LEN defines igbvf: Use ETH_ALEN ... Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.

Linus Torvalds committed 14 years ago

Commit 3b59bf02 parents e45836f bbdb32c1687 files · +126010 −98971Browse files

Unified · Split

1025 files
  1. Documentation/ABI/testing/sysfs-class-net-mesh +7 −0
  2. Documentation/DocBook/80211.tmpl +0 −1
  3. Documentation/devicetree/bindings/net/stmmac.txt +28 −0
  4. Documentation/ioctl/ioctl-number.txt +1 −1
  5. Documentation/magic-number.txt +1 −1
  6. Documentation/networking/LICENSE.qlge +285 −43
  7. Documentation/networking/l2tp.txt +1 −1
  8. Documentation/networking/mac80211-auth-assoc-deauth.txt +99 −0
  9. Documentation/networking/netdev-features.txt +13 −0
  10. Documentation/networking/phy.txt +2 −1
  11. Documentation/networking/ppp_generic.txt +3 −3
  12. Documentation/zh_CN/magic-number.txt +1 −1
  13. MAINTAINERS +21 −5
  14. arch/alpha/include/asm/socket.h +4 −0
  15. arch/arm/include/asm/socket.h +4 −0
  16. arch/avr32/include/asm/socket.h +4 −0
  17. arch/blackfin/mach-bf518/boards/ezbrd.c +2 −1
  18. arch/blackfin/mach-bf518/boards/tcm-bf518.c +2 −3
  19. arch/blackfin/mach-bf527/boards/ad7160eval.c +2 −1
  20. arch/blackfin/mach-bf527/boards/cm_bf527.c +2 −3
  21. arch/blackfin/mach-bf527/boards/ezbrd.c +2 −1
  22. arch/blackfin/mach-bf527/boards/ezkit.c +2 −1
  23. arch/blackfin/mach-bf527/boards/tll6527m.c +2 −1
  24. arch/blackfin/mach-bf537/boards/cm_bf537e.c +2 −3
  25. arch/blackfin/mach-bf537/boards/cm_bf537u.c +2 −3
  26. arch/blackfin/mach-bf537/boards/dnp5370.c +2 −1
  27. arch/blackfin/mach-bf537/boards/pnav10.c +2 −3
  28. arch/blackfin/mach-bf537/boards/stamp.c +2 −1
  29. arch/blackfin/mach-bf537/boards/tcm_bf537.c +2 −3
  30. arch/cris/include/asm/socket.h +4 −0
  31. arch/frv/include/asm/socket.h +4 −0
  32. arch/h8300/include/asm/socket.h +4 −0
  33. arch/ia64/hp/sim/simeth.c +3 −7
  34. arch/ia64/include/asm/socket.h +4 −0
  35. arch/m32r/include/asm/socket.h +4 −0
  36. arch/m68k/include/asm/socket.h +4 −0
  37. arch/mips/bcm47xx/Makefile +1 −1
  38. arch/mips/bcm47xx/nvram.c +1 −2
  39. arch/mips/bcm47xx/setup.c +35 −153
  40. arch/mips/bcm47xx/sprom.c +620 −0
  41. arch/mips/include/asm/mach-bcm47xx/bcm47xx.h +3 −0
  42. arch/mips/include/asm/mach-bcm47xx/nvram.h +1 −1
  43. arch/mips/include/asm/socket.h +4 −0
  44. arch/mips/pci/pci-bcm47xx.c +44 −5
  45. arch/mn10300/include/asm/socket.h +4 −0
  46. arch/parisc/include/asm/socket.h +5 −0
  47. arch/powerpc/boot/dts/bluestone.dts +1 −1
  48. arch/powerpc/include/asm/socket.h +4 −0
  49. arch/s390/include/asm/qeth.h +7 −0
  50. arch/s390/include/asm/socket.h +4 −0
  51. arch/sparc/include/asm/socket.h +5 −0
  52. arch/um/drivers/net_kern.c +8 −3
  53. arch/x86/net/bpf_jit_comp.c +5 −9
  54. arch/xtensa/include/asm/socket.h +4 −0
  55. crypto/crypto_user.c +7 −3
  56. drivers/atm/eni.c +64 −36
  57. drivers/atm/eni.h +5 −0
  58. drivers/atm/lanai.c +1 −1
  59. drivers/bcma/bcma_private.h +6 −2
  60. drivers/bcma/driver_chipcommon_pmu.c +1 −0
  61. drivers/bcma/driver_pci.c +78 −90
  62. drivers/bcma/driver_pci_host.c +576 −2
  63. drivers/bcma/host_pci.c +2 −2
  64. drivers/bcma/main.c +14 −3
  65. drivers/bcma/scan.c +21 −3
  66. drivers/bcma/sprom.c +279 −76
  67. drivers/bluetooth/ath3k.c +3 −0
  68. drivers/bluetooth/bfusb.c +6 −17
  69. drivers/bluetooth/bluecard_cs.c +6 −14
  70. drivers/bluetooth/bpa10x.c +12 −23
  71. drivers/bluetooth/bt3c_cs.c +3 −11
  72. drivers/bluetooth/btmrvl_debugfs.c +14 −16
  73. drivers/bluetooth/btmrvl_main.c +6 −11
  74. drivers/bluetooth/btsdio.c +6 −17
  75. drivers/bluetooth/btuart_cs.c +3 −11
  76. drivers/bluetooth/btusb.c +18 −31
  77. drivers/bluetooth/btwilink.c +4 −14
  78. drivers/bluetooth/dtl1_cs.c +6 −28
  79. drivers/bluetooth/hci_ath.c +1 −1
  80. drivers/bluetooth/hci_bcsp.c +1 −1
  81. drivers/bluetooth/hci_h4.c +1 −1
  82. drivers/bluetooth/hci_ldisc.c +12 −22
  83. drivers/bluetooth/hci_ll.c +1 −1
  84. drivers/bluetooth/hci_uart.h +2 −0
  85. drivers/bluetooth/hci_vhci.c +5 −12
  86. drivers/infiniband/core/addr.c +9 −5
  87. drivers/infiniband/core/netlink.c +7 −3
  88. drivers/infiniband/hw/cxgb4/cm.c +6 −4
  89. drivers/infiniband/hw/nes/nes_cm.c +6 −2
  90. drivers/isdn/act2000/act2000.h +14 −14
  91. drivers/isdn/act2000/act2000_isa.c +197 −197
  92. drivers/isdn/act2000/act2000_isa.h +16 −16
  93. drivers/isdn/act2000/capi.c +499 −499
  94. drivers/isdn/act2000/capi.h +25 −25
  95. drivers/isdn/act2000/module.c +403 −403
  96. drivers/isdn/capi/capi.c +90 −90
  97. drivers/isdn/capi/capidrv.c +478 −478
  98. drivers/isdn/capi/capidrv.h +21 −21
  99. drivers/isdn/capi/capilib.c +8 −8
  100. drivers/isdn/capi/capiutil.c +314 −314
  101. drivers/isdn/capi/kcapi.c +58 −58
  102. drivers/isdn/capi/kcapi.h +5 −6
  103. drivers/isdn/capi/kcapi_proc.c +7 −7
  104. drivers/isdn/divert/divert_init.c +37 −38
  105. drivers/isdn/divert/divert_procfs.c +76 −76
  106. drivers/isdn/divert/isdn_divert.c +737 −738
  107. drivers/isdn/divert/isdn_divert.h +58 −58
  108. drivers/isdn/gigaset/asyncdata.c +2 −2
  109. drivers/isdn/gigaset/bas-gigaset.c +21 −21
  110. drivers/isdn/gigaset/capi.c +114 −114
  111. drivers/isdn/gigaset/common.c +7 −7
  112. drivers/isdn/gigaset/ev-layer.c +164 −164
  113. drivers/isdn/gigaset/gigaset.h +15 −15
  114. drivers/isdn/gigaset/i4l.c +4 −4
  115. drivers/isdn/gigaset/interface.c +9 −9
  116. drivers/isdn/gigaset/isocdata.c +96 −96
  117. drivers/isdn/gigaset/proc.c +2 −2
  118. drivers/isdn/gigaset/ser-gigaset.c +3 −3
  119. drivers/isdn/gigaset/usb-gigaset.c +4 −4
  120. drivers/isdn/hardware/avm/avm_cs.c +67 −67
  121. drivers/isdn/hardware/avm/avmcard.h +143 −143
  122. drivers/isdn/hardware/avm/b1.c +96 −96
  123. drivers/isdn/hardware/avm/b1dma.c +89 −89
  124. drivers/isdn/hardware/avm/b1isa.c +9 −9
  125. drivers/isdn/hardware/avm/b1pci.c +22 −22
  126. drivers/isdn/hardware/avm/b1pcmcia.c +14 −14
  127. drivers/isdn/hardware/avm/c4.c +174 −174
  128. drivers/isdn/hardware/avm/t1isa.c +50 −50
  129. drivers/isdn/hardware/avm/t1pci.c +16 −16
  130. drivers/isdn/hardware/eicon/capi20.h +257 −257
  131. drivers/isdn/hardware/eicon/capidtmf.c +547 −547
  132. drivers/isdn/hardware/eicon/capidtmf.h +39 −39
  133. drivers/isdn/hardware/eicon/capifunc.c +111 −111
  134. drivers/isdn/hardware/eicon/capifunc.h +2 −2
  135. drivers/isdn/hardware/eicon/capimain.c +5 −5
  136. drivers/isdn/hardware/eicon/cardtype.h +738 −738
  137. drivers/isdn/hardware/eicon/cp_vers.h +16 −16
  138. drivers/isdn/hardware/eicon/dadapter.c +287 −289
  139. drivers/isdn/hardware/eicon/dadapter.h +18 −18
  140. drivers/isdn/hardware/eicon/debug.c +1759 −1760
  141. drivers/isdn/hardware/eicon/debug_if.h +40 −42
  142. drivers/isdn/hardware/eicon/debuglib.c +88 −88
  143. drivers/isdn/hardware/eicon/debuglib.h +136 −136
  144. drivers/isdn/hardware/eicon/dfifo.h +28 −28
  145. drivers/isdn/hardware/eicon/di.c +715 −715
  146. drivers/isdn/hardware/eicon/di.h +78 −78
  147. drivers/isdn/hardware/eicon/di_dbg.h +17 −17
  148. drivers/isdn/hardware/eicon/di_defs.h +72 −72
  149. drivers/isdn/hardware/eicon/did_vers.h +16 −16
  150. drivers/isdn/hardware/eicon/diddfunc.c +11 −11
  151. drivers/isdn/hardware/eicon/diva.c +80 −80
  152. drivers/isdn/hardware/eicon/diva_didd.c +8 −8
  153. drivers/isdn/hardware/eicon/diva_dma.c +58 −58
  154. drivers/isdn/hardware/eicon/diva_dma.h +31 −31
  155. drivers/isdn/hardware/eicon/diva_pci.h +3 −3
  156. drivers/isdn/hardware/eicon/divacapi.h +315 −315
  157. drivers/isdn/hardware/eicon/divamnt.c +7 −8
  158. drivers/isdn/hardware/eicon/divasfunc.c +17 −17
  159. drivers/isdn/hardware/eicon/divasi.c +28 −28
  160. drivers/isdn/hardware/eicon/divasmain.c +59 −59
  161. drivers/isdn/hardware/eicon/divasproc.c +29 −29
  162. drivers/isdn/hardware/eicon/divasync.h +281 −281
  163. drivers/isdn/hardware/eicon/dqueue.c +7 −7
  164. drivers/isdn/hardware/eicon/dqueue.h +7 −7
  165. drivers/isdn/hardware/eicon/dsp_defs.h +128 −128
  166. drivers/isdn/hardware/eicon/dsp_tst.h +4 −4
  167. drivers/isdn/hardware/eicon/dspdids.h +15 −15
  168. drivers/isdn/hardware/eicon/dsrv4bri.h +17 −17
  169. drivers/isdn/hardware/eicon/dsrv_bri.h +22 −22
  170. drivers/isdn/hardware/eicon/dsrv_pri.h +23 −23
  171. drivers/isdn/hardware/eicon/entity.h +7 −7
  172. drivers/isdn/hardware/eicon/helpers.h +34 −34
  173. drivers/isdn/hardware/eicon/idifunc.c +11 −11
  174. drivers/isdn/hardware/eicon/io.c +707 −707
  175. drivers/isdn/hardware/eicon/io.h +257 −257
  176. drivers/isdn/hardware/eicon/istream.c +176 −176
  177. drivers/isdn/hardware/eicon/kst_ifc.h +113 −114
  178. drivers/isdn/hardware/eicon/maintidi.c +1138 −1139
  179. drivers/isdn/hardware/eicon/maintidi.h +52 −53
  180. drivers/isdn/hardware/eicon/man_defs.h +18 −18
  181. drivers/isdn/hardware/eicon/mdm_msg.h +36 −36
  182. drivers/isdn/hardware/eicon/message.c +14150 −14150
  183. drivers/isdn/hardware/eicon/mi_pc.h +43 −43
  184. drivers/isdn/hardware/eicon/mntfunc.c +93 −93
  185. drivers/isdn/hardware/eicon/os_4bri.c +176 −176
  186. drivers/isdn/hardware/eicon/os_4bri.h +1 −1
  187. drivers/isdn/hardware/eicon/os_bri.c +131 −131
  188. drivers/isdn/hardware/eicon/os_bri.h +1 −1
  189. drivers/isdn/hardware/eicon/os_capi.h +5 −5
  190. drivers/isdn/hardware/eicon/os_pri.c +195 −195
  191. drivers/isdn/hardware/eicon/os_pri.h +1 −1
  192. drivers/isdn/hardware/eicon/pc.h +134 −134
  193. drivers/isdn/hardware/eicon/pc_init.h +24 −24
  194. drivers/isdn/hardware/eicon/pc_maint.h +79 −79
  195. drivers/isdn/hardware/eicon/pkmaint.h +21 −22
  196. drivers/isdn/hardware/eicon/platform.h +78 −78
  197. drivers/isdn/hardware/eicon/pr_pc.h +58 −58
  198. drivers/isdn/hardware/eicon/s_4bri.c +244 −244
  199. drivers/isdn/hardware/eicon/s_bri.c +144 −144
  200. drivers/isdn/hardware/eicon/s_pri.c +157 −157
  201. drivers/isdn/hardware/eicon/sdp_hdr.h +65 −65
  202. drivers/isdn/hardware/eicon/um_idi.c +112 −112
  203. drivers/isdn/hardware/eicon/um_idi.h +1 −1
  204. drivers/isdn/hardware/eicon/xdi_adapter.h +6 −6
  205. drivers/isdn/hardware/eicon/xdi_msg.h +1 −1
  206. drivers/isdn/hardware/eicon/xdi_vers.h +16 −16
  207. drivers/isdn/hardware/mISDN/avmfritz.c +34 −34
  208. drivers/isdn/hardware/mISDN/hfc_multi.h +23 −24
  209. drivers/isdn/hardware/mISDN/hfc_multi_8xx.h +14 −14
  210. drivers/isdn/hardware/mISDN/hfc_pci.h +9 −9
  211. drivers/isdn/hardware/mISDN/hfcmulti.c +682 −682
  212. drivers/isdn/hardware/mISDN/hfcpci.c +178 −178
  213. drivers/isdn/hardware/mISDN/hfcsusb.c +207 −208
  214. drivers/isdn/hardware/mISDN/hfcsusb.h +60 −60
  215. drivers/isdn/hardware/mISDN/iohelper.h +68 −68
  216. drivers/isdn/hardware/mISDN/isar.h +1 −1
  217. drivers/isdn/hardware/mISDN/mISDNinfineon.c +18 −18
  218. drivers/isdn/hardware/mISDN/mISDNipac.c +56 −56
  219. drivers/isdn/hardware/mISDN/mISDNisar.c +104 −104
  220. drivers/isdn/hardware/mISDN/netjet.c +49 −49
  221. drivers/isdn/hardware/mISDN/netjet.h +0 −1
  222. drivers/isdn/hardware/mISDN/speedfax.c +11 −11
  223. drivers/isdn/hardware/mISDN/w6692.c +43 −43
  224. drivers/isdn/hisax/amd7930_fn.c +393 −393
  225. drivers/isdn/hisax/arcofi.c +44 −44
  226. drivers/isdn/hisax/arcofi.h +1 −1
  227. drivers/isdn/hisax/asuscom.c +55 −55
  228. drivers/isdn/hisax/avm_a1.c +21 −21
  229. drivers/isdn/hisax/avm_a1p.c +76 −76
  230. drivers/isdn/hisax/avm_pci.c +162 −162
  231. drivers/isdn/hisax/avma1_cs.c +62 −62
  232. drivers/isdn/hisax/bkm_a4t.c +46 −46
  233. drivers/isdn/hisax/bkm_a8.c +92 −92
  234. drivers/isdn/hisax/bkm_ax.h +39 −39
  235. drivers/isdn/hisax/callc.c +537 −537
  236. drivers/isdn/hisax/config.c +63 −63
  237. drivers/isdn/hisax/diva.c +167 −167
  238. drivers/isdn/hisax/elsa.c +250 −250
  239. drivers/isdn/hisax/elsa_cs.c +82 −82
  240. drivers/isdn/hisax/elsa_ser.c +89 −89
  241. drivers/isdn/hisax/enternow_pci.c +100 −100
  242. drivers/isdn/hisax/fsm.c +19 −19
  243. drivers/isdn/hisax/fsm.h +2 −2
  244. drivers/isdn/hisax/gazel.c +259 −259
  245. drivers/isdn/hisax/hfc4s8s_l1.c +324 −324
  246. drivers/isdn/hisax/hfc4s8s_l1.h +4 −4
  247. drivers/isdn/hisax/hfc_2bds0.c +242 −242
  248. drivers/isdn/hisax/hfc_2bds0.h +14 −14
  249. drivers/isdn/hisax/hfc_2bs0.c +142 −142
  250. drivers/isdn/hisax/hfc_2bs0.h +3 −3
  251. drivers/isdn/hisax/hfc_pci.c +357 −357
  252. drivers/isdn/hisax/hfc_pci.h +48 −48
  253. drivers/isdn/hisax/hfc_sx.c +563 −563
  254. drivers/isdn/hisax/hfc_sx.h +15 −15
  255. drivers/isdn/hisax/hfc_usb.c +293 −293
  256. drivers/isdn/hisax/hfc_usb.h +5 −5
  257. drivers/isdn/hisax/hfcscard.c +48 −48
  258. drivers/isdn/hisax/hisax.h +86 −86
  259. drivers/isdn/hisax/hisax_cfg.h +3 −3
  260. drivers/isdn/hisax/hisax_debug.h +21 −21
  261. drivers/isdn/hisax/hisax_fcpcipnp.c +46 −46
  262. drivers/isdn/hisax/hisax_fcpcipnp.h +1 −2
  263. drivers/isdn/hisax/hisax_if.h +2 −2
  264. drivers/isdn/hisax/hisax_isac.c +22 −22
  265. drivers/isdn/hisax/hscx.c +68 −68
  266. drivers/isdn/hisax/hscx.h +1 −1
  267. drivers/isdn/hisax/hscx_irq.c +9 −9
  268. drivers/isdn/hisax/icc.c +157 −157
  269. drivers/isdn/hisax/icc.h +3 −3
  270. drivers/isdn/hisax/ipac.h +1 −1
  271. drivers/isdn/hisax/ipacx.c +337 −338
  272. drivers/isdn/hisax/isac.c +160 −160
  273. drivers/isdn/hisax/isac.h +1 −1
  274. drivers/isdn/hisax/isar.c +898 −898
  275. drivers/isdn/hisax/isar.h +7 −7
  276. drivers/isdn/hisax/isdnl1.c +131 −131
  277. drivers/isdn/hisax/isdnl2.c +171 −171
  278. drivers/isdn/hisax/isdnl2.h +0 −1
  279. drivers/isdn/hisax/isdnl3.c +87 −87
  280. drivers/isdn/hisax/isdnl3.h +1 −2
  281. drivers/isdn/hisax/isurf.c +59 −59
  282. drivers/isdn/hisax/ix1_micro.c +50 −50
  283. drivers/isdn/hisax/jade.c +104 −105
  284. drivers/isdn/hisax/jade.h +78 −78
  285. drivers/isdn/hisax/jade_irq.c +24 −24
  286. drivers/isdn/hisax/l3_1tr6.c +98 −98
  287. drivers/isdn/hisax/l3dss1.c +950 −950
  288. drivers/isdn/hisax/l3dss1.h +10 −10
  289. drivers/isdn/hisax/l3ni1.c +919 −919
  290. drivers/isdn/hisax/l3ni1.h +14 −14
  291. drivers/isdn/hisax/lmgr.c +14 −14
  292. drivers/isdn/hisax/mic.c +32 −32
  293. drivers/isdn/hisax/netjet.c +311 −312
  294. drivers/isdn/hisax/netjet.h +2 −3
  295. drivers/isdn/hisax/niccy.c +39 −39
  296. drivers/isdn/hisax/nj_s.c +56 −56
  297. drivers/isdn/hisax/nj_u.c +50 −50
  298. drivers/isdn/hisax/q931.c +120 −120
  299. drivers/isdn/hisax/s0box.c +66 −66
  300. drivers/isdn/hisax/saphir.c +61 −61
  301. drivers/isdn/hisax/sedlbauer.c +164 −164
  302. drivers/isdn/hisax/sedlbauer_cs.c +88 −88
  303. drivers/isdn/hisax/sportster.c +63 −63
  304. drivers/isdn/hisax/st5481.h +49 −49
  305. drivers/isdn/hisax/st5481_b.c +62 −62
  306. drivers/isdn/hisax/st5481_d.c +97 −97
  307. drivers/isdn/hisax/st5481_init.c +32 −32
  308. drivers/isdn/hisax/st5481_usb.c +134 −135
  309. drivers/isdn/hisax/tei.c +38 −38
  310. drivers/isdn/hisax/teleint.c +63 −63
  311. drivers/isdn/hisax/teles0.c +63 −63
  312. drivers/isdn/hisax/teles3.c +78 −78
  313. drivers/isdn/hisax/teles_cs.c +67 −67
  314. drivers/isdn/hisax/telespci.c +40 −40
  315. drivers/isdn/hisax/w6692.c +206 −206
  316. drivers/isdn/hisax/w6692.h +5 −5
  317. drivers/isdn/hysdn/boardergo.c +14 −14
  318. drivers/isdn/hysdn/boardergo.h +15 −15
  319. drivers/isdn/hysdn/hycapi.c +187 −187
  320. drivers/isdn/hysdn/hysdn_boot.c +151 −151
  321. drivers/isdn/hysdn/hysdn_defs.h +15 −15
  322. drivers/isdn/hysdn/hysdn_init.c +2 −2
  323. drivers/isdn/hysdn/hysdn_net.c +10 −10
  324. drivers/isdn/hysdn/hysdn_pof.h +13 −13
  325. drivers/isdn/hysdn/hysdn_procconf.c +5 −5
  326. drivers/isdn/hysdn/hysdn_proclog.c +13 −13
  327. drivers/isdn/hysdn/hysdn_sched.c +27 −27
  328. drivers/isdn/hysdn/ince1pc.h +36 −36
  329. drivers/isdn/i4l/isdn_audio.c +63 −63
  330. drivers/isdn/i4l/isdn_bsdcomp.c +187 −187
  331. drivers/isdn/i4l/isdn_common.c +751 −751
  332. drivers/isdn/i4l/isdn_common.h +9 −9
  333. drivers/isdn/i4l/isdn_concap.c +18 −18
  334. drivers/isdn/i4l/isdn_concap.h +1 −3
  335. drivers/isdn/i4l/isdn_net.c +749 −749
  336. drivers/isdn/i4l/isdn_net.h +5 −6
  337. drivers/isdn/i4l/isdn_ppp.c +723 −723
  338. drivers/isdn/i4l/isdn_ppp.h +0 −2
  339. drivers/isdn/i4l/isdn_tty.c +1221 −1221
  340. drivers/isdn/i4l/isdn_tty.h +5 −5
  341. drivers/isdn/i4l/isdn_ttyfax.c +546 −546
  342. drivers/isdn/i4l/isdn_ttyfax.h +0 −1
  343. drivers/isdn/i4l/isdn_v110.c +147 −147
  344. drivers/isdn/i4l/isdn_v110.h +4 −4
  345. drivers/isdn/i4l/isdn_x25iface.c +113 −113
  346. drivers/isdn/i4l/isdn_x25iface.h +4 −12
  347. drivers/isdn/i4l/isdnhdlc.c +27 −27
  348. drivers/isdn/icn/icn.c +403 −403
  349. drivers/isdn/icn/icn.h +16 −16
  350. drivers/isdn/isdnloop/isdnloop.c +479 −479
  351. drivers/isdn/isdnloop/isdnloop.h +3 −3
  352. drivers/isdn/mISDN/clock.c +12 −13
  353. drivers/isdn/mISDN/core.c +18 −19
  354. drivers/isdn/mISDN/core.h +4 −4
  355. drivers/isdn/mISDN/dsp.h +12 −13
  356. drivers/isdn/mISDN/dsp_audio.c +2 −3
  357. drivers/isdn/mISDN/dsp_biquad.h +3 −3
  358. drivers/isdn/mISDN/dsp_blowfish.c +56 −56
  359. drivers/isdn/mISDN/dsp_cmx.c +519 −521
  360. drivers/isdn/mISDN/dsp_core.c +91 −92
  361. drivers/isdn/mISDN/dsp_dtmf.c +32 −34
  362. drivers/isdn/mISDN/dsp_ecdis.h +13 −13
  363. drivers/isdn/mISDN/dsp_hwec.c +5 −6
  364. drivers/isdn/mISDN/dsp_hwec.h +0 −1
  365. drivers/isdn/mISDN/dsp_pipeline.c +27 −29
  366. drivers/isdn/mISDN/dsp_tones.c +80 −85
  367. drivers/isdn/mISDN/fsm.c +21 −21
  368. drivers/isdn/mISDN/hwchannel.c +11 −11
  369. drivers/isdn/mISDN/l1oip.h +10 −11
  370. drivers/isdn/mISDN/l1oip_codec.c +17 −19
  371. drivers/isdn/mISDN/l1oip_core.c +293 −304
  372. drivers/isdn/mISDN/layer1.c +8 −8
  373. drivers/isdn/mISDN/layer1.h +0 −1
  374. drivers/isdn/mISDN/layer2.c +48 −49
  375. drivers/isdn/mISDN/layer2.h +6 −6
  376. drivers/isdn/mISDN/socket.c +44 −45
  377. drivers/isdn/mISDN/stack.c +62 −62
  378. drivers/isdn/mISDN/tei.c +57 −57
  379. drivers/isdn/mISDN/timerdev.c +6 −6
  380. drivers/isdn/pcbit/callbacks.c +150 −153
  381. drivers/isdn/pcbit/callbacks.h +13 −15
  382. drivers/isdn/pcbit/capi.c +290 −295
  383. drivers/isdn/pcbit/capi.h +20 −26
  384. drivers/isdn/pcbit/drv.c +124 −124
  385. drivers/isdn/pcbit/edss1.c +205 −209
  386. drivers/isdn/pcbit/edss1.h +5 −8
  387. drivers/isdn/pcbit/layer2.c +18 −18
  388. drivers/isdn/pcbit/layer2.h +129 −136
  389. drivers/isdn/pcbit/module.c +17 −18
  390. drivers/isdn/pcbit/pcbit.h +16 −16
  391. drivers/isdn/sc/card.h +1 −1
  392. drivers/isdn/sc/command.c +66 −66
  393. drivers/isdn/sc/event.c +12 −12
  394. drivers/isdn/sc/hardware.h +1 −1
  395. drivers/isdn/sc/init.c +61 −61
  396. drivers/isdn/sc/interrupt.c +72 −72
  397. drivers/isdn/sc/ioctl.c +110 −110
  398. drivers/isdn/sc/message.c +63 −63
  399. drivers/isdn/sc/message.h +9 −9
  400. drivers/isdn/sc/packet.c +64 −65
  401. drivers/isdn/sc/scioc.h +2 −3
  402. drivers/isdn/sc/shmem.c +26 −26
  403. drivers/isdn/sc/timer.c +12 −13
  404. drivers/net/bonding/bond_3ad.c +1 −1
  405. drivers/net/bonding/bond_alb.c +4 −8
  406. drivers/net/bonding/bond_main.c +15 −3
  407. drivers/net/caif/caif_hsi.c +103 −42
  408. drivers/net/can/Kconfig +3 −3
  409. drivers/net/can/bfin_can.c +23 −13
  410. drivers/net/can/cc770/cc770.c +0 −1
  411. drivers/net/can/dev.c +20 −13
  412. drivers/net/can/flexcan.c +28 −33
  413. drivers/net/can/mcp251x.c +1 −2
  414. drivers/net/can/mscan/mscan.c +23 −10
  415. drivers/net/can/pch_can.c +1 −1
  416. drivers/net/can/sja1000/Kconfig +25 −3
  417. drivers/net/can/sja1000/Makefile +1 −0
  418. drivers/net/can/sja1000/peak_pci.c +491 −14
  419. drivers/net/can/sja1000/peak_pcmcia.c +753 −0
  420. drivers/net/can/sja1000/plx_pci.c +21 −1
  421. drivers/net/can/sja1000/sja1000.c +9 −10
  422. drivers/net/can/slcan.c +2 −4
  423. drivers/net/can/ti_hecc.c +22 −10
  424. drivers/net/can/usb/Kconfig +6 −0
  425. drivers/net/can/usb/Makefile +1 −0
  426. drivers/net/can/usb/ems_usb.c +27 −36
  427. drivers/net/can/usb/esd_usb2.c +12 −15
  428. drivers/net/can/usb/peak_usb/Makefile +2 −0
  429. drivers/net/can/usb/peak_usb/pcan_usb.c +899 −0
  430. drivers/net/can/usb/peak_usb/pcan_usb_core.c +951 −0
  431. drivers/net/can/usb/peak_usb/pcan_usb_core.h +146 −0
  432. drivers/net/can/usb/peak_usb/pcan_usb_pro.c +1036 −0
  433. drivers/net/can/usb/peak_usb/pcan_usb_pro.h +178 −0
  434. drivers/net/dummy.c +2 −1
  435. drivers/net/ethernet/3com/3c501.c +1 −1
  436. drivers/net/ethernet/3com/3c509.c +1 −1
  437. drivers/net/ethernet/3com/3c515.c +4 −6
  438. drivers/net/ethernet/3com/3c574_cs.c +1 −1
  439. drivers/net/ethernet/3com/3c589_cs.c +1 −1
  440. drivers/net/ethernet/3com/3c59x.c +5 −5
  441. drivers/net/ethernet/3com/Kconfig +1 −1
  442. drivers/net/ethernet/3com/typhoon.c +3 −16
  443. drivers/net/ethernet/8390/ax88796.c +1 −1
  444. drivers/net/ethernet/8390/axnet_cs.c +2 −2
  445. drivers/net/ethernet/8390/lib8390.c +1 −1
  446. drivers/net/ethernet/8390/pcnet_cs.c +1 −1
  447. drivers/net/ethernet/Kconfig +1 −0
  448. drivers/net/ethernet/Makefile +1 −0
  449. drivers/net/ethernet/adaptec/starfire.c +5 −8
  450. drivers/net/ethernet/adi/bfin_mac.c +14 −13
  451. drivers/net/ethernet/adi/bfin_mac.h +1 −1
  452. drivers/net/ethernet/aeroflex/greth.c +2 −3
  453. drivers/net/ethernet/alteon/acenic.c +1 −4
  454. drivers/net/ethernet/amd/7990.c +1 −1
  455. drivers/net/ethernet/amd/Kconfig +1 −1
  456. drivers/net/ethernet/amd/a2065.c +1 −1
  457. drivers/net/ethernet/amd/am79c961a.c +2 −2
  458. drivers/net/ethernet/amd/am79c961a.h +1 −1
  459. drivers/net/ethernet/amd/amd8111e.c +4 −3
  460. drivers/net/ethernet/amd/ariadne.c +1 −1
  461. drivers/net/ethernet/amd/atarilance.c +1 −1
  462. drivers/net/ethernet/amd/au1000_eth.c +6 −6
  463. drivers/net/ethernet/amd/declance.c +1 −3
  464. drivers/net/ethernet/amd/depca.c +1 −1
  465. drivers/net/ethernet/amd/hplance.c +2 −8
  466. drivers/net/ethernet/amd/ni65.c +2 −4
  467. drivers/net/ethernet/amd/nmclan_cs.c +1 −1
  468. drivers/net/ethernet/amd/pcnet32.c +7 −9
  469. drivers/net/ethernet/amd/sun3lance.c +1 −1
  470. drivers/net/ethernet/amd/sunlance.c +2 −2
  471. drivers/net/ethernet/apple/bmac.c +8 −11
  472. drivers/net/ethernet/apple/mace.c +3 −6
  473. drivers/net/ethernet/apple/macmace.c +1 −1
  474. drivers/net/ethernet/atheros/atl1c/atl1c_hw.c +1 −1
  475. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +5 −7
  476. drivers/net/ethernet/atheros/atl1e/atl1e_main.c +0 −1
  477. drivers/net/ethernet/atheros/atlx/atl1.c +9 −3
  478. drivers/net/ethernet/atheros/atlx/atl2.c +5 −8
  479. drivers/net/ethernet/atheros/atlx/atl2.h +2 −3
  480. drivers/net/ethernet/atheros/atlx/atlx.c +1 −0
  481. drivers/net/ethernet/atheros/atlx/atlx.h +0 −1
  482. drivers/net/ethernet/broadcom/b44.c +0 −1
  483. drivers/net/ethernet/broadcom/bnx2.c +95 −13
  484. drivers/net/ethernet/broadcom/bnx2.h +3 −0
  485. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +54 −22
  486. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +294 −192
  487. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +142 −42
  488. drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +154 −165
  489. drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h +1 −1
  490. drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h +1 −1
  491. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +211 −99
  492. drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +1 −13
  493. drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_file_hdr.h +1 −1
  494. drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +34 −28
  495. drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h +1 −1
  496. drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +31 −24
  497. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +237 −87
  498. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +3 −3
  499. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +497 −477
  500. drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +15 −6
  501. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +90 −90
  502. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +20 −6
  503. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +155 −277
  504. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +146 −1
  505. drivers/net/ethernet/broadcom/cnic.c +38 −4
  506. drivers/net/ethernet/broadcom/cnic_defs.h +14 −13
  507. drivers/net/ethernet/broadcom/cnic_if.h +2 −2
  508. drivers/net/ethernet/broadcom/sb1250-mac.c +0 −2
  509. drivers/net/ethernet/broadcom/tg3.c +975 −970
  510. drivers/net/ethernet/broadcom/tg3.h +2 −12
  511. drivers/net/ethernet/brocade/bna/bfa_cee.c +4 −4
  512. drivers/net/ethernet/brocade/bna/bfa_defs.h +1 −0
  513. drivers/net/ethernet/brocade/bna/bfa_ioc.c +1 −1
  514. drivers/net/ethernet/brocade/bna/bnad.c +0 −1
  515. drivers/net/ethernet/brocade/bna/bnad_debugfs.c +3 −18
  516. drivers/net/ethernet/brocade/bna/bnad_ethtool.c +42 −0
  517. drivers/net/ethernet/cadence/at91_ether.c +1 −1
  518. drivers/net/ethernet/cadence/macb.c +3 −5
  519. drivers/net/ethernet/calxeda/xgmac.c +2 −1
  520. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +1 −1
  521. drivers/net/ethernet/chelsio/cxgb3/version.h +2 −2
  522. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 −1
  523. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 −3
  524. drivers/net/ethernet/cirrus/cs89x0.c +2 −2
  525. drivers/net/ethernet/cirrus/ep93xx_eth.c +2 −2
  526. drivers/net/ethernet/cirrus/mac89x0.c +8 −4
  527. drivers/net/ethernet/cisco/enic/enic.h +2 −2
  528. drivers/net/ethernet/cisco/enic/enic_main.c +33 −19
  529. drivers/net/ethernet/cisco/enic/enic_pp.c +2 −2
  530. drivers/net/ethernet/cisco/enic/enic_res.c +1 −1
  531. drivers/net/ethernet/cisco/enic/vnic_dev.c +46 −30
  532. drivers/net/ethernet/cisco/enic/vnic_dev.h +2 −1
  533. drivers/net/ethernet/cisco/enic/vnic_devcmd.h +10 −1
  534. drivers/net/ethernet/cisco/enic/vnic_rq.c +1 −3
  535. drivers/net/ethernet/cisco/enic/vnic_wq.c +1 −3
  536. drivers/net/ethernet/davicom/dm9000.c +3 −5
  537. drivers/net/ethernet/dec/ewrk3.c +3 −1
  538. drivers/net/ethernet/dec/tulip/21142.c +1 −1
  539. drivers/net/ethernet/dec/tulip/de2104x.c +2 −4
  540. drivers/net/ethernet/dec/tulip/de4x5.c +3 −7
  541. drivers/net/ethernet/dec/tulip/dmfe.c +11 −9
  542. drivers/net/ethernet/dec/tulip/eeprom.c +1 −1
  543. drivers/net/ethernet/dec/tulip/interrupt.c +5 −5
  544. drivers/net/ethernet/dec/tulip/media.c +1 −1
  545. drivers/net/ethernet/dec/tulip/pnic.c +1 −1
  546. drivers/net/ethernet/dec/tulip/pnic2.c +1 −1
  547. drivers/net/ethernet/dec/tulip/timer.c +1 −1
  548. drivers/net/ethernet/dec/tulip/tulip.h +1 −1
  549. drivers/net/ethernet/dec/tulip/tulip_core.c +3 −6
  550. drivers/net/ethernet/dec/tulip/uli526x.c +12 −9
  551. drivers/net/ethernet/dec/tulip/winbond-840.c +3 −3
  552. drivers/net/ethernet/dec/tulip/xircom_cb.c +3 −4
  553. drivers/net/ethernet/dlink/de600.c +1 −1
  554. drivers/net/ethernet/dlink/de620.c +1 −1
  555. drivers/net/ethernet/dlink/sundance.c +5 −6
  556. drivers/net/ethernet/dnet.c +3 −5
  557. drivers/net/ethernet/emulex/benet/be.h +75 −36
  558. drivers/net/ethernet/emulex/benet/be_cmds.c +205 −40
  559. drivers/net/ethernet/emulex/benet/be_cmds.h +116 −21
  560. drivers/net/ethernet/emulex/benet/be_ethtool.c +96 −91
  561. drivers/net/ethernet/emulex/benet/be_main.c +517 −522
  562. drivers/net/ethernet/ethoc.c +19 −4
  563. drivers/net/ethernet/faraday/ftgmac100.c +1 −1
  564. drivers/net/ethernet/faraday/ftmac100.c +1 −1
  565. drivers/net/ethernet/fealnx.c +3 −5
  566. drivers/net/ethernet/freescale/fec.c +3 −18
  567. drivers/net/ethernet/freescale/fec_mpc52xx.c +2 −2
  568. drivers/net/ethernet/freescale/fec_mpc52xx.h +1 −1
  569. drivers/net/ethernet/freescale/fs_enet/fec.h +4 −2
  570. drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +24 −8
  571. drivers/net/ethernet/freescale/fs_enet/mac-fec.c +6 −3
  572. drivers/net/ethernet/freescale/gianfar.c +17 −7
  573. drivers/net/ethernet/freescale/gianfar.h +1 −4
  574. drivers/net/ethernet/freescale/gianfar_ethtool.c +2 −2
  575. drivers/net/ethernet/freescale/gianfar_ptp.c +1 −1
  576. drivers/net/ethernet/freescale/gianfar_sysfs.c +1 −1
  577. drivers/net/ethernet/freescale/ucc_geth.c +260 −200
  578. drivers/net/ethernet/fujitsu/at1700.c +1 −1
  579. drivers/net/ethernet/fujitsu/eth16i.c +1 −1
  580. drivers/net/ethernet/fujitsu/fmvj18x_cs.c +1 −1
  581. drivers/net/ethernet/hp/hp100.c +2 −4
  582. drivers/net/ethernet/i825xx/3c505.c +1 −1
  583. drivers/net/ethernet/i825xx/3c507.c +1 −1
  584. drivers/net/ethernet/i825xx/3c523.c +1 −1
  585. drivers/net/ethernet/i825xx/3c527.c +2 −2
  586. drivers/net/ethernet/i825xx/82596.c +3 −5
  587. drivers/net/ethernet/i825xx/eepro.c +1 −1
  588. drivers/net/ethernet/i825xx/eexpress.c +1 −1
  589. drivers/net/ethernet/i825xx/ether1.c +1 −1
  590. drivers/net/ethernet/i825xx/lp486e.c +1 −3
  591. drivers/net/ethernet/i825xx/ni52.c +1 −1
  592. drivers/net/ethernet/i825xx/sun3_82586.c +1 −26
  593. drivers/net/ethernet/i825xx/znet.c +1 −1
  594. drivers/net/ethernet/ibm/Kconfig +0 −4
  595. drivers/net/ethernet/ibm/Makefile +0 −1
  596. drivers/net/ethernet/ibm/ehea/ehea.h +1 −1
  597. drivers/net/ethernet/ibm/ehea/ehea_ethtool.c +1 −1
  598. drivers/net/ethernet/ibm/ehea/ehea_hw.h +1 −1
  599. drivers/net/ethernet/ibm/ehea/ehea_main.c +1 −2
  600. drivers/net/ethernet/ibm/ehea/ehea_phyp.c +1 −1
  601. drivers/net/ethernet/ibm/ehea/ehea_phyp.h +1 −1
  602. drivers/net/ethernet/ibm/ehea/ehea_qmr.c +1 −1
  603. drivers/net/ethernet/ibm/ehea/ehea_qmr.h +1 −1
  604. drivers/net/ethernet/ibm/emac/core.c +31 −6
  605. drivers/net/ethernet/ibm/emac/core.h +12 −3
  606. drivers/net/ethernet/ibm/emac/debug.c +1 −1
  607. drivers/net/ethernet/ibm/emac/debug.h +1 −1
  608. drivers/net/ethernet/ibm/emac/emac.h +3 −1
  609. drivers/net/ethernet/ibm/emac/mal.c +1 −1
  610. drivers/net/ethernet/ibm/emac/mal.h +1 −1
  611. drivers/net/ethernet/ibm/emac/phy.c +1 −1
  612. drivers/net/ethernet/ibm/emac/phy.h +1 −1
  613. drivers/net/ethernet/ibm/emac/rgmii.c +2 −5
  614. drivers/net/ethernet/ibm/emac/rgmii.h +1 −1
  615. drivers/net/ethernet/ibm/emac/tah.c +2 −5
  616. drivers/net/ethernet/ibm/emac/tah.h +1 −1
  617. drivers/net/ethernet/ibm/emac/zmii.c +2 −5
  618. drivers/net/ethernet/ibm/emac/zmii.h +1 −1
  619. drivers/net/ethernet/ibm/iseries_veth.c +0 −1710
  620. drivers/net/ethernet/icplus/ipg.c +0 −4
  621. drivers/net/ethernet/intel/e100.c +73 −11
  622. drivers/net/ethernet/intel/e1000/e1000.h +1 −0
  623. drivers/net/ethernet/intel/e1000/e1000_hw.c +73 −83
  624. drivers/net/ethernet/intel/e1000/e1000_hw.h +10 −0
  625. drivers/net/ethernet/intel/e1000/e1000_main.c +236 −13
  626. drivers/net/ethernet/intel/e1000e/80003es2lan.c +35 −64
  627. drivers/net/ethernet/intel/e1000e/82571.c +64 −83
  628. drivers/net/ethernet/intel/e1000e/Makefile +3 −2
  629. drivers/net/ethernet/intel/e1000e/defines.h +10 −1
  630. drivers/net/ethernet/intel/e1000e/e1000.h +23 −29
  631. drivers/net/ethernet/intel/e1000e/ethtool.c +138 −69
  632. drivers/net/ethernet/intel/e1000e/hw.h +10 −3
  633. drivers/net/ethernet/intel/e1000e/ich8lan.c +207 −226
  634. drivers/net/ethernet/intel/e1000e/mac.c +74 −1058
  635. drivers/net/ethernet/intel/e1000e/manage.c +367 −0
  636. drivers/net/ethernet/intel/e1000e/netdev.c +420 −302
  637. drivers/net/ethernet/intel/e1000e/nvm.c +643 −0
  638. drivers/net/ethernet/intel/e1000e/param.c +46 −9
  639. drivers/net/ethernet/intel/e1000e/phy.c +136 −191
  640. drivers/net/ethernet/intel/igb/e1000_defines.h +2 −0
  641. drivers/net/ethernet/intel/igb/igb_ethtool.c +7 −0
  642. drivers/net/ethernet/intel/igb/igb_main.c +41 −3
  643. drivers/net/ethernet/intel/igbvf/defines.h +0 −4
  644. drivers/net/ethernet/intel/igbvf/ethtool.c +10 −9
  645. drivers/net/ethernet/intel/igbvf/igbvf.h +15 −12
  646. drivers/net/ethernet/intel/igbvf/netdev.c +82 −61
  647. drivers/net/ethernet/intel/igbvf/vf.c +2 −5
  648. drivers/net/ethernet/intel/ixgb/ixgb.h +0 −12
  649. drivers/net/ethernet/intel/ixgb/ixgb_ee.c +5 −7
  650. drivers/net/ethernet/intel/ixgb/ixgb_main.c +3 −5
  651. drivers/net/ethernet/intel/ixgbe/Makefile +1 −1
  652. drivers/net/ethernet/intel/ixgbe/ixgbe.h +128 −97
  653. drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +5 −5
  654. drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +7 −25
  655. drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +64 −5
  656. drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +2 −0
  657. drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +20 −10
  658. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +220 −69
  659. drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +55 −34
  660. drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +929 −0
  661. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +1308 −1893
  662. drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +11 −3
  663. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +1 −1
  664. drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +8 −3
  665. drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +3 −1
  666. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +19 −23
  667. drivers/net/ethernet/jme.c +0 −1
  668. drivers/net/ethernet/korina.c +2 −4
  669. drivers/net/ethernet/lantiq_etop.c +13 −2
  670. drivers/net/ethernet/marvell/mv643xx_eth.c +2 −2
  671. drivers/net/ethernet/marvell/pxa168_eth.c +8 −10
  672. drivers/net/ethernet/marvell/skge.c +1 −3
  673. drivers/net/ethernet/marvell/sky2.c +1 −3
  674. drivers/net/ethernet/mellanox/mlx4/cmd.c +10 −1
  675. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +2 −3
  676. drivers/net/ethernet/mellanox/mlx4/en_rx.c +9 −15
  677. drivers/net/ethernet/mellanox/mlx4/en_tx.c +12 −24
  678. drivers/net/ethernet/mellanox/mlx4/fw.c +0 −10
  679. drivers/net/ethernet/mellanox/mlx4/main.c +1 −3
  680. drivers/net/ethernet/mellanox/mlx4/mcg.c +14 −24
  681. drivers/net/ethernet/mellanox/mlx4/mlx4.h +0 −1
  682. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +2 −5
  683. drivers/net/ethernet/mellanox/mlx4/mr.c +2 −79
  684. drivers/net/ethernet/mellanox/mlx4/port.c +6 −6
  685. drivers/net/ethernet/micrel/ks8695net.c +3 −5
  686. drivers/net/ethernet/micrel/ks8842.c +2 −1
  687. drivers/net/ethernet/micrel/ks8851.c +5 −6
  688. drivers/net/ethernet/micrel/ks8851.h +1 −1
  689. drivers/net/ethernet/micrel/ks8851_mll.c +5 −6
  690. drivers/net/ethernet/micrel/ksz884x.c +4 −4
  691. drivers/net/ethernet/microchip/enc28j60.c +3 −6
  692. drivers/net/ethernet/mipsnet.c +2 −2
  693. drivers/net/ethernet/myricom/myri10ge/myri10ge.c +1 −3
  694. drivers/net/ethernet/natsemi/ibmlana.c +1 −1
  695. drivers/net/ethernet/natsemi/macsonic.c +1 −1
  696. drivers/net/ethernet/natsemi/natsemi.c +2 −3
  697. drivers/net/ethernet/natsemi/sonic.c +2 −2
  698. drivers/net/ethernet/neterion/s2io.c +4 −5
  699. drivers/net/ethernet/netx-eth.c +2 −3
  700. drivers/net/ethernet/nuvoton/w90p910_ether.c +1 −1
  701. drivers/net/ethernet/nvidia/forcedeth.c +6 −5
  702. drivers/net/ethernet/nxp/Kconfig +8 −0
  703. drivers/net/ethernet/nxp/Makefile +1 −0
  704. drivers/net/ethernet/nxp/lpc_eth.c +1604 −0
  705. drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +13 −0
  706. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +13 −0
  707. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +218 −12
  708. drivers/net/ethernet/packetengines/hamachi.c +3 −5
  709. drivers/net/ethernet/packetengines/yellowfin.c +5 −8
  710. drivers/net/ethernet/pasemi/pasemi_mac.c +2 −4
  711. drivers/net/ethernet/qlogic/netxen/netxen_nic.h +436 −5
  712. drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c +224 −72
  713. drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c +109 −0
  714. drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h +1 −0
  715. drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c +632 −5
  716. drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +5 −12
  717. drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +109 −29
  718. drivers/net/ethernet/qlogic/qla3xxx.c +1 −2
  719. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +1 −1
  720. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +5 −9
  721. drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +8 −2
  722. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +14 −5
  723. drivers/net/ethernet/qlogic/qlge/qlge.h +1 −1
  724. drivers/net/ethernet/qlogic/qlge/qlge_dbg.c +1 −3
  725. drivers/net/ethernet/qlogic/qlge/qlge_main.c +10 −76
  726. drivers/net/ethernet/racal/ni5010.c +1 −1
  727. drivers/net/ethernet/rdc/r6040.c +1 −2
  728. drivers/net/ethernet/realtek/8139too.c +97 −12
  729. drivers/net/ethernet/realtek/Kconfig +5 −5
  730. drivers/net/ethernet/realtek/atp.c +1 −1
  731. drivers/net/ethernet/realtek/r8169.c +1903 −1831
  732. drivers/net/ethernet/renesas/sh_eth.c +385 −54
  733. drivers/net/ethernet/renesas/sh_eth.h +14 −1
  734. drivers/net/ethernet/s6gmac.c +8 −7
  735. drivers/net/ethernet/seeq/ether3.c +1 −1
  736. drivers/net/ethernet/seeq/seeq8005.c +1 −1
  737. drivers/net/ethernet/seeq/sgiseeq.c +0 −1
  738. drivers/net/ethernet/sfc/Kconfig +18 −3
  739. drivers/net/ethernet/sfc/Makefile +2 −1
  740. drivers/net/ethernet/sfc/bitfield.h +11 −11
  741. drivers/net/ethernet/sfc/efx.c +535 −396
  742. drivers/net/ethernet/sfc/efx.h +9 −2
  743. drivers/net/ethernet/sfc/ethtool.c +108 −92
  744. drivers/net/ethernet/sfc/falcon.c +28 −26
  745. drivers/net/ethernet/sfc/falcon_boards.c +6 −19
  746. drivers/net/ethernet/sfc/falcon_xmac.c +4 −11
  747. drivers/net/ethernet/sfc/filter.c +223 −32
  748. drivers/net/ethernet/sfc/filter.h +19 −1
  749. drivers/net/ethernet/sfc/mac.h +0 −21
  750. drivers/net/ethernet/sfc/mcdi.c +82 −67
  751. drivers/net/ethernet/sfc/mcdi.h +35 −1
  752. drivers/net/ethernet/sfc/mcdi_mac.c +25 −40
  753. drivers/net/ethernet/sfc/mcdi_mon.c +415 −0
  754. drivers/net/ethernet/sfc/mcdi_pcol.h +2085 −1457
  755. drivers/net/ethernet/sfc/mcdi_phy.c +18 −18
  756. drivers/net/ethernet/sfc/mdio_10g.c +1 −1
  757. drivers/net/ethernet/sfc/mtd.c +7 −8
  758. drivers/net/ethernet/sfc/net_driver.h +190 −135
  759. drivers/net/ethernet/sfc/nic.c +347 −255
  760. drivers/net/ethernet/sfc/nic.h +126 −15
  761. drivers/net/ethernet/sfc/qt202x_phy.c +3 −3
  762. drivers/net/ethernet/sfc/regs.h +10 −10
  763. drivers/net/ethernet/sfc/rx.c +68 −65
  764. drivers/net/ethernet/sfc/selftest.c +144 −74
  765. drivers/net/ethernet/sfc/selftest.h +3 −1
  766. drivers/net/ethernet/sfc/siena.c +31 −19
  767. drivers/net/ethernet/sfc/siena_sriov.c +1643 −0
  768. drivers/net/ethernet/sfc/spi.h +1 −1
  769. drivers/net/ethernet/sfc/tenxpress.c +1 −1
  770. drivers/net/ethernet/sfc/tx.c +3 −5
  771. drivers/net/ethernet/sfc/txc43128_phy.c +1 −1
  772. drivers/net/ethernet/sfc/vfdi.h +255 −0
  773. drivers/net/ethernet/sis/sis190.c +0 −2
  774. drivers/net/ethernet/sis/sis900.c +4 −5
  775. drivers/net/ethernet/smsc/epic100.c +5 −6
  776. drivers/net/ethernet/smsc/smc911x.c +1 −2
  777. drivers/net/ethernet/smsc/smc9194.c +1 −1
  778. drivers/net/ethernet/smsc/smc91c92_cs.c +1 −1
  779. drivers/net/ethernet/smsc/smc91x.c +1 −2
  780. drivers/net/ethernet/smsc/smsc911x.c +2 −2
  781. drivers/net/ethernet/smsc/smsc9420.c +3 −8
  782. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +4 −7
  783. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +1 −1
  784. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +72 −2
  785. drivers/net/ethernet/sun/cassini.c +1 −3
  786. drivers/net/ethernet/sun/niu.c +2 −4
  787. drivers/net/ethernet/sun/sunbmac.c +1 −1
  788. drivers/net/ethernet/sun/sungem.c +0 −1
  789. drivers/net/ethernet/sun/sunhme.c +1 −1
  790. drivers/net/ethernet/sun/sunqe.c +3 −9
  791. drivers/net/ethernet/sun/sunvnet.c +4 −9
  792. drivers/net/ethernet/tehuti/tehuti.c +3 −5
  793. drivers/net/ethernet/ti/Kconfig +11 −0
  794. drivers/net/ethernet/ti/Makefile +2 −0
  795. drivers/net/ethernet/ti/cpmac.c +1 −4
  796. drivers/net/ethernet/ti/cpsw.c +1019 −0
  797. drivers/net/ethernet/ti/cpsw_ale.c +641 −0
  798. drivers/net/ethernet/ti/cpsw_ale.h +93 −0
  799. drivers/net/ethernet/ti/davinci_cpdma.c +1 −1
  800. drivers/net/ethernet/ti/davinci_emac.c +5 −6
  801. drivers/net/ethernet/ti/davinci_mdio.c +1 −1
  802. drivers/net/ethernet/ti/tlan.c +0 −1
  803. drivers/net/ethernet/tile/tilepro.c +5 −4
  804. drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +2 −3
  805. drivers/net/ethernet/toshiba/tc35815.c +4 −5
  806. drivers/net/ethernet/tundra/tsi108_eth.c +2 −4
  807. drivers/net/ethernet/via/via-rhine.c +1 −4
  808. drivers/net/ethernet/via/via-velocity.c +2 −4
  809. drivers/net/ethernet/xilinx/Kconfig +8 −0
  810. drivers/net/ethernet/xilinx/Makefile +2 −0
  811. drivers/net/ethernet/xilinx/ll_temac_main.c +5 −4
  812. drivers/net/ethernet/xilinx/xilinx_axienet.h +508 −0
  813. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1669 −0
  814. drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +238 −0
  815. drivers/net/ethernet/xilinx/xilinx_emaclite.c +2 −4
  816. drivers/net/ethernet/xircom/xirc2ps_cs.c +2 −1
  817. drivers/net/ethernet/xscale/ixp2000/ixpdev.c +2 −5
  818. drivers/net/hamradio/baycom_epp.c +1 −1
  819. drivers/net/hamradio/baycom_par.c +1 −1
  820. drivers/net/hamradio/yam.c +0 −1
  821. drivers/net/hippi/rrunner.c +1 −7
  822. drivers/net/hyperv/hyperv_net.h +33 −1
  823. drivers/net/hyperv/netvsc.c +2 −1
  824. drivers/net/hyperv/netvsc_drv.c +9 −11
  825. drivers/net/hyperv/rndis_filter.c +101 −58
  826. drivers/net/ifb.c +1 −1
  827. drivers/net/irda/ali-ircc.c +1 −1
  828. drivers/net/irda/donauboe.c +0 −2
  829. drivers/net/irda/pxaficp_ir.c +3 −3
  830. drivers/net/irda/via-ircc.c +2 −2
  831. drivers/net/irda/w83977af_ir.c +1 −1
  832. drivers/net/macvlan.c +2 −1
  833. drivers/net/mdio.c +3 −0
  834. drivers/net/mii.c +2 −2
  835. drivers/net/netconsole.c +2 −6
  836. drivers/net/phy/Kconfig +5 −0
  837. drivers/net/phy/Makefile +1 −0
  838. drivers/net/phy/amd.c +102 −0
  839. drivers/net/phy/broadcom.c +2 −4
  840. drivers/net/phy/dp83640.c +1 −1
  841. drivers/net/plip/plip.c +1 −3
  842. drivers/net/ppp/ppp_async.c +1 −1
  843. drivers/net/ppp/ppp_deflate.c +4 −26
  844. drivers/net/ppp/ppp_generic.c +3 −3
  845. drivers/net/ppp/ppp_synctty.c +1 −1
  846. drivers/net/ppp/pppoe.c +1 −1
  847. drivers/net/ppp/pppox.c +1 −1
  848. drivers/net/ppp/pptp.c +3 −5
  849. drivers/net/rionet.c +0 −2
  850. drivers/net/slip/slip.c +1 −3
  851. drivers/net/team/team.c +2 −1
  852. drivers/net/tokenring/3c359.c +0 −4
  853. drivers/net/tokenring/madgemc.c +0 −1
  854. drivers/net/tokenring/tms380tr.c +67 −112
  855. drivers/net/tun.c +1 −1
  856. drivers/net/usb/Kconfig +1 −0
  857. drivers/net/usb/asix.c +20 −68
  858. drivers/net/usb/cdc_ncm.c +115 −121
  859. drivers/net/usb/kaweth.c +1 −7
  860. drivers/net/usb/mcs7830.c +1 −1
  861. drivers/net/usb/pegasus.c +1 −3
  862. drivers/net/usb/rtl8150.c +1 −3
  863. drivers/net/usb/smsc75xx.c +1 −1
  864. drivers/net/usb/smsc95xx.c +1 −1
  865. drivers/net/usb/usbnet.c +2 −4
  866. drivers/net/veth.c +2 −2
  867. drivers/net/virtio_net.c +4 −5
  868. drivers/net/vmxnet3/vmxnet3_drv.c +26 −37
  869. drivers/net/wan/c101.c +1 −3
  870. drivers/net/wan/dscc4.c +2 −6
  871. drivers/net/wan/hdlc_fr.c +1 −1
  872. drivers/net/wan/hdlc_raw_eth.c +1 −1
  873. drivers/net/wan/lmc/lmc_main.c +0 −1
  874. drivers/net/wan/n2.c +1 −3
  875. drivers/net/wan/pc300too.c +0 −1
  876. drivers/net/wan/pci200syn.c +0 −1
  877. drivers/net/wan/wanxl.c +0 −1
  878. drivers/net/wan/x25_asy.c +1 −3
  879. drivers/net/wireless/airo.c +1 −1
  880. drivers/net/wireless/ath/ath.h +11 −15
  881. drivers/net/wireless/ath/ath5k/ahb.c +10 −10
  882. drivers/net/wireless/ath/ath5k/ani.c +4 −4
  883. drivers/net/wireless/ath/ath5k/ath5k.h +3 −2
  884. drivers/net/wireless/ath/ath5k/base.c +10 −15
  885. drivers/net/wireless/ath/ath5k/mac80211-ops.c +12 −0
  886. drivers/net/wireless/ath/ath5k/phy.c +9 −25
  887. drivers/net/wireless/ath/ath5k/reset.c +5 −5
  888. drivers/net/wireless/ath/ath6kl/Kconfig +21 −4
  889. drivers/net/wireless/ath/ath6kl/Makefile +19 −14
  890. drivers/net/wireless/ath/ath6kl/bmi.c +12 −5
  891. drivers/net/wireless/ath/ath6kl/bmi.h +24 −0
  892. drivers/net/wireless/ath/ath6kl/cfg80211.c +698 −304
  893. drivers/net/wireless/ath/ath6kl/cfg80211.h +9 −4
  894. drivers/net/wireless/ath/ath6kl/common.h +1 −3
  895. drivers/net/wireless/ath/ath6kl/core.c +299 −0
  896. drivers/net/wireless/ath/ath6kl/core.h +132 −37
  897. drivers/net/wireless/ath/ath6kl/debug.c +260 −171
  898. drivers/net/wireless/ath/ath6kl/debug.h +13 −25
  899. drivers/net/wireless/ath/ath6kl/hif-ops.h +1 −0
  900. drivers/net/wireless/ath/ath6kl/hif.c +19 −8
  901. drivers/net/wireless/ath/ath6kl/hif.h +4 −0
  902. drivers/net/wireless/ath/ath6kl/htc.c +155 −58
  903. drivers/net/wireless/ath/ath6kl/htc.h +15 −1
  904. drivers/net/wireless/ath/ath6kl/init.c +262 −374
  905. drivers/net/wireless/ath/ath6kl/main.c +204 −30
  906. drivers/net/wireless/ath/ath6kl/sdio.c +131 −52
  907. drivers/net/wireless/ath/ath6kl/target.h +2 −0
  908. drivers/net/wireless/ath/ath6kl/testmode.c +18 −85
  909. drivers/net/wireless/ath/ath6kl/testmode.h +4 −3
  910. drivers/net/wireless/ath/ath6kl/txrx.c +444 −148
  911. drivers/net/wireless/ath/ath6kl/usb.c +432 −0
  912. drivers/net/wireless/ath/ath6kl/wmi.c +312 −139
  913. drivers/net/wireless/ath/ath6kl/wmi.h +77 −13
  914. drivers/net/wireless/ath/ath9k/Kconfig +16 −8
  915. drivers/net/wireless/ath/ath9k/Makefile +5 −5
  916. drivers/net/wireless/ath/ath9k/ani.c +3 −3
  917. drivers/net/wireless/ath/ath9k/ar5008_phy.c +6 −15
  918. drivers/net/wireless/ath/ath9k/ar9001_initvals.h +0 −270
  919. drivers/net/wireless/ath/ath9k/ar9002_hw.c +50 −99
  920. drivers/net/wireless/ath/ath9k/ar9002_initvals.h +0 −104
  921. drivers/net/wireless/ath/ath9k/ar9002_mac.c +1 −4
  922. drivers/net/wireless/ath/ath9k/ar9002_phy.h +2 −0
  923. drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +0 −302
  924. drivers/net/wireless/ath/ath9k/ar9003_calib.c +4 −38
  925. drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +0 −4
  926. drivers/net/wireless/ath/ath9k/ar9003_hw.c +16 −97
  927. drivers/net/wireless/ath/ath9k/ar9003_mac.c +22 −52
  928. drivers/net/wireless/ath/ath9k/ar9003_mac.h +2 −1
  929. drivers/net/wireless/ath/ath9k/ar9003_mci.c +578 −672
  930. drivers/net/wireless/ath/ath9k/ar9003_mci.h +233 −0
  931. drivers/net/wireless/ath/ath9k/ar9003_phy.c +18 −16
  932. drivers/net/wireless/ath/ath9k/ar9003_phy.h +13 −10
  933. drivers/net/wireless/ath/ath9k/ar9462_1p0_initvals.h +0 −1833
  934. drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +0 −465
  935. drivers/net/wireless/ath/ath9k/ath9k.h +41 −18
  936. drivers/net/wireless/ath/ath9k/beacon.c +4 −10
  937. drivers/net/wireless/ath/ath9k/btcoex.c +57 −20
  938. drivers/net/wireless/ath/ath9k/btcoex.h +2 −2
  939. drivers/net/wireless/ath/ath9k/debug.c +155 −245
  940. drivers/net/wireless/ath/ath9k/debug.h +15 −12
  941. drivers/net/wireless/ath/ath9k/gpio.c +114 −10
  942. drivers/net/wireless/ath/ath9k/hif_usb.c +100 −56
  943. drivers/net/wireless/ath/ath9k/hif_usb.h +2 −1
  944. drivers/net/wireless/ath/ath9k/htc.h +18 −3
  945. drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +61 −12
  946. drivers/net/wireless/ath/ath9k/htc_drv_init.c +3 −31
  947. drivers/net/wireless/ath/ath9k/htc_drv_main.c +18 −13
  948. drivers/net/wireless/ath/ath9k/htc_hst.c +1 −4
  949. drivers/net/wireless/ath/ath9k/hw-ops.h +1 −1
  950. drivers/net/wireless/ath/ath9k/hw.c +110 −213
  951. drivers/net/wireless/ath/ath9k/hw.h +23 −201
  952. drivers/net/wireless/ath/ath9k/init.c +8 −79
  953. drivers/net/wireless/ath/ath9k/mac.c +17 −25
  954. drivers/net/wireless/ath/ath9k/mac.h +1 −3
  955. drivers/net/wireless/ath/ath9k/main.c +16 −80
  956. drivers/net/wireless/ath/ath9k/mci.c +81 −209
  957. drivers/net/wireless/ath/ath9k/mci.h +2 −3
  958. drivers/net/wireless/ath/ath9k/rc.c +9 −11
  959. drivers/net/wireless/ath/ath9k/rc.h +0 −2
  960. drivers/net/wireless/ath/ath9k/recv.c +33 −37
  961. drivers/net/wireless/ath/ath9k/reg.h +1 −5
  962. drivers/net/wireless/ath/ath9k/xmit.c +29 −30
  963. drivers/net/wireless/ath/carl9170/carl9170.h +1 −1
  964. drivers/net/wireless/ath/carl9170/fw.c +0 −33
  965. drivers/net/wireless/ath/carl9170/mac.c +35 −0
  966. drivers/net/wireless/ath/carl9170/main.c +9 −9
  967. drivers/net/wireless/ath/carl9170/phy.c +6 −30
  968. drivers/net/wireless/ath/carl9170/tx.c +3 −1
  969. drivers/net/wireless/ath/main.c +7 −2
  970. drivers/net/wireless/atmel.c +2 −3
  971. drivers/net/wireless/b43/b43.h +15 −0
  972. drivers/net/wireless/b43/main.c +53 −75
  973. drivers/net/wireless/b43/phy_n.c +427 −105
  974. drivers/net/wireless/b43/phy_n.h +1 −0
  975. drivers/net/wireless/b43/tables_nphy.c +64 −12
  976. drivers/net/wireless/b43/tables_nphy.h +4 −10
  977. drivers/net/wireless/b43legacy/b43legacy.h +3 −0
  978. drivers/net/wireless/b43legacy/main.c +20 −13
  979. drivers/net/wireless/b43legacy/phy.c +1 −1
  980. drivers/net/wireless/brcm80211/Kconfig +13 −4
  981. drivers/net/wireless/brcm80211/Makefile +1 −1
  982. drivers/net/wireless/brcm80211/brcmfmac/Makefile +4 −2
  983. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +2 −0
  984. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +9 −10
  985. drivers/net/wireless/brcm80211/brcmfmac/dhd.h +2 −2
  986. drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +15 −2
  987. drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c +2 −0
  988. drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +10 −7
  989. drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +13 −7
  990. drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +52 −19
  991. drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +105 −159
  992. drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +2 −0
  993. drivers/net/wireless/brcm80211/brcmfmac/usb.c +1621 −0
  994. drivers/net/wireless/brcm80211/brcmfmac/usb.h +61 −0
  995. drivers/net/wireless/brcm80211/brcmfmac/usb_rdl.h +75 −0
  996. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +14 −15
  997. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +18 −18
  998. drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +2 −2
  999. drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +10 −12
  1000. drivers/net/wireless/brcm80211/brcmsmac/dma.c +4 −4
  1001. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +31 −24
  1002. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +1 −1
  1003. drivers/net/wireless/brcm80211/brcmsmac/main.c +92 −107
  1004. drivers/net/wireless/brcm80211/brcmsmac/main.h +4 −2
  1005. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +8 −27
  1006. drivers/net/wireless/brcm80211/brcmsmac/srom.c +12 −2
  1007. drivers/net/wireless/brcm80211/brcmutil/utils.c +23 −3
  1008. drivers/net/wireless/brcm80211/include/brcmu_utils.h +13 −2
  1009. drivers/net/wireless/hostap/hostap_hw.c +6 −12
  1010. drivers/net/wireless/ipw2x00/ipw2100.c +38 −70
  1011. drivers/net/wireless/ipw2x00/ipw2200.h +0 −14
  1012. drivers/net/wireless/ipw2x00/libipw_module.c +2 −3
  1013. drivers/net/wireless/ipw2x00/libipw_rx.c +1 −1
  1014. drivers/net/wireless/iwlegacy/3945-debug.c +6 −0
  1015. drivers/net/wireless/iwlegacy/3945-mac.c +125 −161
  1016. drivers/net/wireless/iwlegacy/3945-rs.c +3 −4
  1017. drivers/net/wireless/iwlegacy/3945.c +101 −127
  1018. drivers/net/wireless/iwlegacy/3945.h +4 −10
  1019. drivers/net/wireless/iwlegacy/4965-calib.c +11 −25
  1020. drivers/net/wireless/iwlegacy/4965-debug.c +6 −0
  1021. drivers/net/wireless/iwlegacy/4965-mac.c +680 −378
  1022. drivers/net/wireless/iwlegacy/4965-rs.c +15 −33
  1023. drivers/net/wireless/iwlegacy/4965.c +125 −573
  1024. drivers/net/wireless/iwlegacy/4965.h +13 −30
  1025. drivers/net/wireless/iwlegacy/Kconfig +39 −39
Documentation/ABI/testing/sysfs-class-net-mesh+7−0
@@ -65,6 +65,13 @@ Description: · 64 unmodified lines
6565 Defines the penalty which will be applied to an
6666 originator message's tq-field on every hop.
6767
68+What: /sys/class/net/<mesh_iface>/mesh/routing_algo
69+Date: Dec 2011
70+Contact: Marek Lindner <lindner_marek@yahoo.de>
71+Description:
72+ Defines the routing procotol this mesh instance
73+ uses to find the optimal paths through the mesh.
74+
6875 What: /sys/class/net/<mesh_iface>/mesh/vis_mode
6976 Date: May 2010
7077 Contact: Marek Lindner <lindner_marek@yahoo.de>
Documentation/DocBook/80211.tmpl+0−1
@@ -129,7 +129,6 @@ · 128 unmodified lines
129129 !Finclude/net/cfg80211.h cfg80211_pmksa
130130 !Finclude/net/cfg80211.h cfg80211_send_rx_auth
131131 !Finclude/net/cfg80211.h cfg80211_send_auth_timeout
132−!Finclude/net/cfg80211.h __cfg80211_auth_canceled
133132 !Finclude/net/cfg80211.h cfg80211_send_rx_assoc
134133 !Finclude/net/cfg80211.h cfg80211_send_assoc_timeout
135134 !Finclude/net/cfg80211.h cfg80211_send_deauth
Documentation/devicetree/bindings/net/stmmac.txt+28−0
@@ -0,0 +1,28 @@
1+* STMicroelectronics 10/100/1000 Ethernet driver (GMAC)
2+
3+Required properties:
4+- compatible: Should be "st,spear600-gmac"
5+- reg: Address and length of the register set for the device
6+- interrupt-parent: Should be the phandle for the interrupt controller
7+ that services interrupts for this device
8+- interrupts: Should contain the STMMAC interrupts
9+- interrupt-names: Should contain the interrupt names "macirq"
10+ "eth_wake_irq" if this interrupt is supported in the "interrupts"
11+ property
12+- phy-mode: String, operation mode of the PHY interface.
13+ Supported values are: "mii", "rmii", "gmii", "rgmii".
14+
15+Optional properties:
16+- mac-address: 6 bytes, mac address
17+
18+Examples:
19+
20+ gmac0: ethernet@e0800000 {
21+ compatible = "st,spear600-gmac";
22+ reg = <0xe0800000 0x8000>;
23+ interrupt-parent = <&vic1>;
24+ interrupts = <24 23>;
25+ interrupt-names = "macirq", "eth_wake_irq";
26+ mac-address = [000000000000]; /* Filled in by U-Boot */
27+ phy-mode = "gmii";
28+ };
Documentation/ioctl/ioctl-number.txt+1−1
@@ -255,7 +255,7 @@ Code Seq#(hex) Include File Comments · 254 unmodified lines
255255 linux/ixjuser.h <http://web.archive.org/web/*/http://www.quicknet.net>
256256 'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
257257 's' all linux/cdk.h
258−'t' 00-7F linux/if_ppp.h
258+'t' 00-7F linux/ppp-ioctl.h
259259 't' 80-8F linux/isdn_ppp.h
260260 't' 90 linux/toshiba.h
261261 'u' 00-1F linux/smb_fs.h gone
Documentation/magic-number.txt+1−1
@@ -89,7 +89,7 @@ TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h · 88 unmodified lines
8989 MGSLPC_MAGIC 0x5402 mgslpc_info drivers/char/pcmcia/synclink_cs.c
9090 TTY_LDISC_MAGIC 0x5403 tty_ldisc include/linux/tty_ldisc.h
9191 USB_SERIAL_MAGIC 0x6702 usb_serial drivers/usb/serial/usb-serial.h
92−FULL_DUPLEX_MAGIC 0x6969 drivers/net/tulip/de2104x.c
92+FULL_DUPLEX_MAGIC 0x6969 drivers/net/ethernet/dec/tulip/de2104x.c
9393 USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c
9494 RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c
9595 USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h
Documentation/networking/LICENSE.qlge+285−43
@@ -1,46 +1,288 @@
1−Copyright (c) 2003-2008 QLogic Corporation
2−QLogic Linux Networking HBA Driver
1+Copyright (c) 2003-2011 QLogic Corporation
2+QLogic Linux qlge NIC Driver
33
4−This program includes a device driver for Linux 2.6 that may be
5−distributed with QLogic hardware specific firmware binary file.
64 You may modify and redistribute the device driver code under the
7−GNU General Public License as published by the Free Software
8−Foundation (version 2 or a later version).
9−
10−You may redistribute the hardware specific firmware binary file
11−under the following terms:
12−
13− 1. Redistribution of source code (only if applicable),
14− must retain the above copyright notice, this list of
15− conditions and the following disclaimer.
16−
17− 2. Redistribution in binary form must reproduce the above
18− copyright notice, this list of conditions and the
19− following disclaimer in the documentation and/or other
20− materials provided with the distribution.
21−
22− 3. The name of QLogic Corporation may not be used to
23− endorse or promote products derived from this software
24− without specific prior written permission
25−
26−REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
27−THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
28−EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29−IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
30−PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
31−BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32−EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
33−TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34−DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35−ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36−OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37−OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38−POSSIBILITY OF SUCH DAMAGE.
39−
40−USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
41−CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
42−OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
43−TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
44−ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
45−COMBINATION WITH THIS PROGRAM.
5+GNU General Public License (a copy of which is attached hereto as
6+Exhibit A) published by the Free Software Foundation (version 2).
467
8+
9+EXHIBIT A
10+
11+ GNU GENERAL PUBLIC LICENSE
12+ Version 2, June 1991
13+
14+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
15+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16+ Everyone is permitted to copy and distribute verbatim copies
17+ of this license document, but changing it is not allowed.
18+
19+ Preamble
20+
21+ The licenses for most software are designed to take away your
22+freedom to share and change it. By contrast, the GNU General Public
23+License is intended to guarantee your freedom to share and change free
24+software--to make sure the software is free for all its users. This
25+General Public License applies to most of the Free Software
26+Foundation's software and to any other program whose authors commit to
27+using it. (Some other Free Software Foundation software is covered by
28+the GNU Lesser General Public License instead.) You can apply it to
29+your programs, too.
30+
31+ When we speak of free software, we are referring to freedom, not
32+price. Our General Public Licenses are designed to make sure that you
33+have the freedom to distribute copies of free software (and charge for
34+this service if you wish), that you receive source code or can get it
35+if you want it, that you can change the software or use pieces of it
36+in new free programs; and that you know you can do these things.
37+
38+ To protect your rights, we need to make restrictions that forbid
39+anyone to deny you these rights or to ask you to surrender the rights.
40+These restrictions translate to certain responsibilities for you if you
41+distribute copies of the software, or if you modify it.
42+
43+ For example, if you distribute copies of such a program, whether
44+gratis or for a fee, you must give the recipients all the rights that
45+you have. You must make sure that they, too, receive or can get the
46+source code. And you must show them these terms so they know their
47+rights.
48+
49+ We protect your rights with two steps: (1) copyright the software, and
50+(2) offer you this license which gives you legal permission to copy,
51+distribute and/or modify the software.
52+
53+ Also, for each author's protection and ours, we want to make certain
54+that everyone understands that there is no warranty for this free
55+software. If the software is modified by someone else and passed on, we
56+want its recipients to know that what they have is not the original, so
57+that any problems introduced by others will not reflect on the original
58+authors' reputations.
59+
60+ Finally, any free program is threatened constantly by software
61+patents. We wish to avoid the danger that redistributors of a free
62+program will individually obtain patent licenses, in effect making the
63+program proprietary. To prevent this, we have made it clear that any
64+patent must be licensed for everyone's free use or not licensed at all.
65+
66+ The precise terms and conditions for copying, distribution and
67+modification follow.
68+
69+ GNU GENERAL PUBLIC LICENSE
70+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
71+
72+ 0. This License applies to any program or other work which contains
73+a notice placed by the copyright holder saying it may be distributed
74+under the terms of this General Public License. The "Program", below,
75+refers to any such program or work, and a "work based on the Program"
76+means either the Program or any derivative work under copyright law:
77+that is to say, a work containing the Program or a portion of it,
78+either verbatim or with modifications and/or translated into another
79+language. (Hereinafter, translation is included without limitation in
80+the term "modification".) Each licensee is addressed as "you".
81+
82+Activities other than copying, distribution and modification are not
83+covered by this License; they are outside its scope. The act of
84+running the Program is not restricted, and the output from the Program
85+is covered only if its contents constitute a work based on the
86+Program (independent of having been made by running the Program).
87+Whether that is true depends on what the Program does.
88+
89+ 1. You may copy and distribute verbatim copies of the Program's
90+source code as you receive it, in any medium, provided that you
91+conspicuously and appropriately publish on each copy an appropriate
92+copyright notice and disclaimer of warranty; keep intact all the
93+notices that refer to this License and to the absence of any warranty;
94+and give any other recipients of the Program a copy of this License
95+along with the Program.
96+
97+You may charge a fee for the physical act of transferring a copy, and
98+you may at your option offer warranty protection in exchange for a fee.
99+
100+ 2. You may modify your copy or copies of the Program or any portion
101+of it, thus forming a work based on the Program, and copy and
102+distribute such modifications or work under the terms of Section 1
103+above, provided that you also meet all of these conditions:
104+
105+ a) You must cause the modified files to carry prominent notices
106+ stating that you changed the files and the date of any change.
107+
108+ b) You must cause any work that you distribute or publish, that in
109+ whole or in part contains or is derived from the Program or any
110+ part thereof, to be licensed as a whole at no charge to all third
111+ parties under the terms of this License.
112+
113+ c) If the modified program normally reads commands interactively
114+ when run, you must cause it, when started running for such
115+ interactive use in the most ordinary way, to print or display an
116+ announcement including an appropriate copyright notice and a
117+ notice that there is no warranty (or else, saying that you provide
118+ a warranty) and that users may redistribute the program under
119+ these conditions, and telling the user how to view a copy of this
120+ License. (Exception: if the Program itself is interactive but
121+ does not normally print such an announcement, your work based on
122+ the Program is not required to print an announcement.)
123+
124+These requirements apply to the modified work as a whole. If
125+identifiable sections of that work are not derived from the Program,
126+and can be reasonably considered independent and separate works in
127+themselves, then this License, and its terms, do not apply to those
128+sections when you distribute them as separate works. But when you
129+distribute the same sections as part of a whole which is a work based
130+on the Program, the distribution of the whole must be on the terms of
131+this License, whose permissions for other licensees extend to the
132+entire whole, and thus to each and every part regardless of who wrote it.
133+
134+Thus, it is not the intent of this section to claim rights or contest
135+your rights to work written entirely by you; rather, the intent is to
136+exercise the right to control the distribution of derivative or
137+collective works based on the Program.
138+
139+In addition, mere aggregation of another work not based on the Program
140+with the Program (or with a work based on the Program) on a volume of
141+a storage or distribution medium does not bring the other work under
142+the scope of this License.
143+
144+ 3. You may copy and distribute the Program (or a work based on it,
145+under Section 2) in object code or executable form under the terms of
146+Sections 1 and 2 above provided that you also do one of the following:
147+
148+ a) Accompany it with the complete corresponding machine-readable
149+ source code, which must be distributed under the terms of Sections
150+ 1 and 2 above on a medium customarily used for software interchange; or,
151+
152+ b) Accompany it with a written offer, valid for at least three
153+ years, to give any third party, for a charge no more than your
154+ cost of physically performing source distribution, a complete
155+ machine-readable copy of the corresponding source code, to be
156+ distributed under the terms of Sections 1 and 2 above on a medium
157+ customarily used for software interchange; or,
158+
159+ c) Accompany it with the information you received as to the offer
160+ to distribute corresponding source code. (This alternative is
161+ allowed only for noncommercial distribution and only if you
162+ received the program in object code or executable form with such
163+ an offer, in accord with Subsection b above.)
164+
165+The source code for a work means the preferred form of the work for
166+making modifications to it. For an executable work, complete source
167+code means all the source code for all modules it contains, plus any
168+associated interface definition files, plus the scripts used to
169+control compilation and installation of the executable. However, as a
170+special exception, the source code distributed need not include
171+anything that is normally distributed (in either source or binary
172+form) with the major components (compiler, kernel, and so on) of the
173+operating system on which the executable runs, unless that component
174+itself accompanies the executable.
175+
176+If distribution of executable or object code is made by offering
177+access to copy from a designated place, then offering equivalent
178+access to copy the source code from the same place counts as
179+distribution of the source code, even though third parties are not
180+compelled to copy the source along with the object code.
181+
182+ 4. You may not copy, modify, sublicense, or distribute the Program
183+except as expressly provided under this License. Any attempt
184+otherwise to copy, modify, sublicense or distribute the Program is
185+void, and will automatically terminate your rights under this License.
186+However, parties who have received copies, or rights, from you under
187+this License will not have their licenses terminated so long as such
188+parties remain in full compliance.
189+
190+ 5. You are not required to accept this License, since you have not
191+signed it. However, nothing else grants you permission to modify or
192+distribute the Program or its derivative works. These actions are
193+prohibited by law if you do not accept this License. Therefore, by
194+modifying or distributing the Program (or any work based on the
195+Program), you indicate your acceptance of this License to do so, and
196+all its terms and conditions for copying, distributing or modifying
197+the Program or works based on it.
198+
199+ 6. Each time you redistribute the Program (or any work based on the
200+Program), the recipient automatically receives a license from the
201+original licensor to copy, distribute or modify the Program subject to
202+these terms and conditions. You may not impose any further
203+restrictions on the recipients' exercise of the rights granted herein.
204+You are not responsible for enforcing compliance by third parties to
205+this License.
206+
207+ 7. If, as a consequence of a court judgment or allegation of patent
208+infringement or for any other reason (not limited to patent issues),
209+conditions are imposed on you (whether by court order, agreement or
210+otherwise) that contradict the conditions of this License, they do not
211+excuse you from the conditions of this License. If you cannot
212+distribute so as to satisfy simultaneously your obligations under this
213+License and any other pertinent obligations, then as a consequence you
214+may not distribute the Program at all. For example, if a patent
215+license would not permit royalty-free redistribution of the Program by
216+all those who receive copies directly or indirectly through you, then
217+the only way you could satisfy both it and this License would be to
218+refrain entirely from distribution of the Program.
219+
220+If any portion of this section is held invalid or unenforceable under
221+any particular circumstance, the balance of the section is intended to
222+apply and the section as a whole is intended to apply in other
223+circumstances.
224+
225+It is not the purpose of this section to induce you to infringe any
226+patents or other property right claims or to contest validity of any
227+such claims; this section has the sole purpose of protecting the
228+integrity of the free software distribution system, which is
229+implemented by public license practices. Many people have made
230+generous contributions to the wide range of software distributed
231+through that system in reliance on consistent application of that
232+system; it is up to the author/donor to decide if he or she is willing
233+to distribute software through any other system and a licensee cannot
234+impose that choice.
235+
236+This section is intended to make thoroughly clear what is believed to
237+be a consequence of the rest of this License.
238+
239+ 8. If the distribution and/or use of the Program is restricted in
240+certain countries either by patents or by copyrighted interfaces, the
241+original copyright holder who places the Program under this License
242+may add an explicit geographical distribution limitation excluding
243+those countries, so that distribution is permitted only in or among
244+countries not thus excluded. In such case, this License incorporates
245+the limitation as if written in the body of this License.
246+
247+ 9. The Free Software Foundation may publish revised and/or new versions
248+of the General Public License from time to time. Such new versions will
249+be similar in spirit to the present version, but may differ in detail to
250+address new problems or concerns.
251+
252+Each version is given a distinguishing version number. If the Program
253+specifies a version number of this License which applies to it and "any
254+later version", you have the option of following the terms and conditions
255+either of that version or of any later version published by the Free
256+Software Foundation. If the Program does not specify a version number of
257+this License, you may choose any version ever published by the Free Software
258+Foundation.
259+
260+ 10. If you wish to incorporate parts of the Program into other free
261+programs whose distribution conditions are different, write to the author
262+to ask for permission. For software which is copyrighted by the Free
263+Software Foundation, write to the Free Software Foundation; we sometimes
264+make exceptions for this. Our decision will be guided by the two goals
265+of preserving the free status of all derivatives of our free software and
266+of promoting the sharing and reuse of software generally.
267+
268+ NO WARRANTY
269+
270+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
271+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
272+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
273+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
274+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
275+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
276+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
277+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
278+REPAIR OR CORRECTION.
279+
280+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
281+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
282+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
283+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
284+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
285+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
286+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
287+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
288+POSSIBILITY OF SUCH DAMAGES.
Documentation/networking/l2tp.txt+1−1
@@ -111,7 +111,7 @@ When creating PPPoL2TP sockets, the application provides information · 110 unmodified lines
111111 to the driver about the socket in a socket connect() call. Source and
112112 destination tunnel and session ids are provided, as well as the file
113113 descriptor of a UDP socket. See struct pppol2tp_addr in
114−include/linux/if_ppp.h. Note that zero tunnel / session ids are
114+include/linux/if_pppol2tp.h. Note that zero tunnel / session ids are
115115 treated specially. When creating the per-tunnel PPPoL2TP management
116116 socket in Step 2 above, zero source and destination session ids are
117117 specified, which tells the driver to prepare the supplied UDP file
Documentation/networking/mac80211-auth-assoc-deauth.txt+99−0
@@ -0,0 +1,99 @@
1+#
2+# This outlines the Linux authentication/association and
3+# deauthentication/disassociation flows.
4+#
5+# This can be converted into a diagram using the service
6+# at http://www.websequencediagrams.com/
7+#
8+
9+participant userspace
10+participant mac80211
11+participant driver
12+
13+alt authentication needed (not FT)
14+userspace->mac80211: authenticate
15+
16+alt authenticated/authenticating already
17+mac80211->driver: sta_state(AP, not-exists)
18+mac80211->driver: bss_info_changed(clear BSSID)
19+else associated
20+note over mac80211,driver
21+like deauth/disassoc, without sending the
22+BA session stop & deauth/disassoc frames
23+end note
24+end
25+
26+mac80211->driver: config(channel, non-HT)
27+mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
28+mac80211->driver: sta_state(AP, exists)
29+
30+alt no probe request data known
31+mac80211->driver: TX directed probe request
32+driver->mac80211: RX probe response
33+end
34+
35+mac80211->driver: TX auth frame
36+driver->mac80211: RX auth frame
37+
38+alt WEP shared key auth
39+mac80211->driver: TX auth frame
40+driver->mac80211: RX auth frame
41+end
42+
43+mac80211->driver: sta_state(AP, authenticated)
44+mac80211->userspace: RX auth frame
45+
46+end
47+
48+userspace->mac80211: associate
49+alt authenticated or associated
50+note over mac80211,driver: cleanup like for authenticate
51+end
52+
53+alt not previously authenticated (FT)
54+mac80211->driver: config(channel, non-HT)
55+mac80211->driver: bss_info_changed(set BSSID, basic rate bitmap)
56+mac80211->driver: sta_state(AP, exists)
57+mac80211->driver: sta_state(AP, authenticated)
58+end
59+mac80211->driver: TX assoc
60+driver->mac80211: RX assoc response
61+note over mac80211: init rate control
62+mac80211->driver: sta_state(AP, associated)
63+
64+alt not using WPA
65+mac80211->driver: sta_state(AP, authorized)
66+end
67+
68+mac80211->driver: set up QoS parameters
69+
70+alt is HT channel
71+mac80211->driver: config(channel, HT params)
72+end
73+
74+mac80211->driver: bss_info_changed(QoS, HT, associated with AID)
75+mac80211->userspace: associated
76+
77+note left of userspace: associated now
78+
79+alt using WPA
80+note over userspace
81+do 4-way-handshake
82+(data frames)
83+end note
84+userspace->mac80211: authorized
85+mac80211->driver: sta_state(AP, authorized)
86+end
87+
88+userspace->mac80211: deauthenticate/disassociate
89+mac80211->driver: stop BA sessions
90+mac80211->driver: TX deauth/disassoc
91+mac80211->driver: flush frames
92+mac80211->driver: sta_state(AP,associated)
93+mac80211->driver: sta_state(AP,authenticated)
94+mac80211->driver: sta_state(AP,exists)
95+mac80211->driver: sta_state(AP,not-exists)
96+mac80211->driver: turn off powersave
97+mac80211->driver: bss_info_changed(clear BSSID, not associated, no QoS, ...)
98+mac80211->driver: config(non-HT channel type)
99+mac80211->userspace: disconnected
Documentation/networking/netdev-features.txt+13−0
@@ -152,3 +152,16 @@ NETIF_F_VLAN_CHALLENGED should be set for devices which can't cope with VLAN · 151 unmodified lines
152152 headers. Some drivers set this because the cards can't handle the bigger MTU.
153153 [FIXME: Those cases could be fixed in VLAN code by allowing only reduced-MTU
154154 VLANs. This may be not useful, though.]
155+
156+* rx-fcs
157+
158+This requests that the NIC append the Ethernet Frame Checksum (FCS)
159+to the end of the skb data. This allows sniffers and other tools to
160+read the CRC recorded by the NIC on receipt of the packet.
161+
162+* rx-all
163+
164+This requests that the NIC receive all possible frames, including errored
165+frames (such as bad FCS, etc). This can be helpful when sniffing a link with
166+bad packets on it. Some NICs may receive more packets if also put into normal
167+PROMISC mdoe.
Documentation/networking/phy.txt+2−1
@@ -62,7 +62,8 @@ The MDIO bus · 61 unmodified lines
6262 5) The bus must also be declared somewhere as a device, and registered.
6363
6464 As an example for how one driver implemented an mdio bus driver, see
65− drivers/net/gianfar_mii.c and arch/ppc/syslib/mpc85xx_devices.c
65+ drivers/net/ethernet/freescale/fsl_pq_mdio.c and an associated DTS file
66+ for one of the users. (e.g. "git grep fsl,.*-mdio arch/powerpc/boot/dts/")
6667
6768 Connecting to a PHY
6869
Documentation/networking/ppp_generic.txt+3−3
@@ -342,7 +342,7 @@ an interface unit are: · 341 unmodified lines
342342 numbers on received multilink fragments
343343 SC_MP_XSHORTSEQ transmit short multilink sequence nos.
344344
345− The values of these flags are defined in <linux/if_ppp.h>. Note
345+ The values of these flags are defined in <linux/ppp-ioctl.h>. Note
346346 that the values of the SC_MULTILINK, SC_MP_SHORTSEQ and
347347 SC_MP_XSHORTSEQ bits are ignored if the CONFIG_PPP_MULTILINK option
348348 is not selected.
@@ -358,7 +358,7 @@ an interface unit are: · 9 unmodified lines
358358
359359 * PPPIOCSCOMPRESS sets the parameters for packet compression or
360360 decompression. The argument should point to a ppp_option_data
361− structure (defined in <linux/if_ppp.h>), which contains a
361+ structure (defined in <linux/ppp-ioctl.h>), which contains a
362362 pointer/length pair which should describe a block of memory
363363 containing a CCP option specifying a compression method and its
364364 parameters. The ppp_option_data struct also contains a `transmit'
@@ -395,7 +395,7 @@ an interface unit are: · 30 unmodified lines
395395
396396 * PPPIOCSNPMODE sets the network-protocol mode for a given network
397397 protocol. The argument should point to an npioctl struct (defined
398− in <linux/if_ppp.h>). The `protocol' field gives the PPP protocol
398+ in <linux/ppp-ioctl.h>). The `protocol' field gives the PPP protocol
399399 number for the protocol to be affected, and the `mode' field
400400 specifies what to do with packets for that protocol:
401401
Documentation/zh_CN/magic-number.txt+1−1
@@ -89,7 +89,7 @@ TTY_DRIVER_MAGIC 0x5402 tty_driver include/linux/tty_driver.h · 88 unmodified lines
8989 MGSLPC_MAGIC 0x5402 mgslpc_info drivers/char/pcmcia/synclink_cs.c
9090 TTY_LDISC_MAGIC 0x5403 tty_ldisc include/linux/tty_ldisc.h
9191 USB_SERIAL_MAGIC 0x6702 usb_serial drivers/usb/serial/usb-serial.h
92−FULL_DUPLEX_MAGIC 0x6969 drivers/net/tulip/de2104x.c
92+FULL_DUPLEX_MAGIC 0x6969 drivers/net/ethernet/dec/tulip/de2104x.c
9393 USB_BLUETOOTH_MAGIC 0x6d02 usb_bluetooth drivers/usb/class/bluetty.c
9494 RFCOMM_TTY_MAGIC 0x6d02 net/bluetooth/rfcomm/tty.c
9595 USB_SERIAL_PORT_MAGIC 0x7301 usb_serial_port drivers/usb/serial/usb-serial.h
MAINTAINERS+21−5
@@ -1405,7 +1405,7 @@ F: net/ax25/ · 1404 unmodified lines
14051405 B43 WIRELESS DRIVER
14061406 M: Stefano Brivio <stefano.brivio@polimi.it>
14071407 L: linux-wireless@vger.kernel.org
1408−L: b43-dev@lists.infradead.org (moderated for non-subscribers)
1408+L: b43-dev@lists.infradead.org
14091409 W: http://linuxwireless.org/en/users/Drivers/b43
14101410 S: Maintained
14111411 F: drivers/net/wireless/b43/
@@ -1414,6 +1414,7 @@ B43LEGACY WIRELESS DRIVER · 2 unmodified lines
14141414 M: Larry Finger <Larry.Finger@lwfinger.net>
14151415 M: Stefano Brivio <stefano.brivio@polimi.it>
14161416 L: linux-wireless@vger.kernel.org
1417+L: b43-dev@lists.infradead.org
14171418 W: http://linuxwireless.org/en/users/Drivers/b43
14181419 S: Maintained
14191420 F: drivers/net/wireless/b43legacy/
@@ -1571,7 +1572,6 @@ F: drivers/net/ethernet/broadcom/tg3.* · 151 unmodified lines
15711572
15721573 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
15731574 M: Brett Rudley <brudley@broadcom.com>
1574−M: Henry Ptasinski <henryp@broadcom.com>
15751575 M: Roland Vossen <rvossen@broadcom.com>
15761576 M: Arend van Spriel <arend@broadcom.com>
15771577 M: Franky (Zhenhui) Lin <frankyl@broadcom.com>
@@ -1809,7 +1809,8 @@ F: Documentation/zh_CN/ · 231 unmodified lines
18091809 CISCO VIC ETHERNET NIC DRIVER
18101810 M: Christian Benvenuti <benve@cisco.com>
18111811 M: Roopa Prabhu <roprabhu@cisco.com>
1812−M: David Wang <dwang2@cisco.com>
1812+M: Neel Patel <neepatel@cisco.com>
1813+M: Nishank Trivedi <nistrive@cisco.com>
18131814 S: Supported
18141815 F: drivers/net/ethernet/cisco/enic/
18151816
@@ -4937,8 +4938,6 @@ F: fs/ocfs2/ · 3121 unmodified lines
49374938
49384939 ORINOCO DRIVER
49394940 L: linux-wireless@vger.kernel.org
4940−L: orinoco-users@lists.sourceforge.net
4941−L: orinoco-devel@lists.sourceforge.net
49424941 W: http://linuxwireless.org/en/users/Drivers/orinoco
49434942 W: http://www.nongnu.org/orinoco/
49444943 S: Orphan
@@ -5345,6 +5344,17 @@ L: cbe-oss-dev@lists.ozlabs.org · 400 unmodified lines
53455344 S: Maintained
53465345 F: drivers/block/ps3vram.c
53475346
5347+PTP HARDWARE CLOCK SUPPORT
5348+M: Richard Cochran <richardcochran@gmail.com>
5349+S: Maintained
5350+W: http://linuxptp.sourceforge.net/
5351+F: Documentation/ABI/testing/sysfs-ptp
5352+F: Documentation/ptp/*
5353+F: drivers/net/gianfar_ptp.c
5354+F: drivers/net/phy/dp83640*
5355+F: drivers/ptp/*
5356+F: include/linux/ptp_cl*
5357+
53485358 PTRACE SUPPORT
53495359 M: Roland McGrath <roland@redhat.com>
53505360 M: Oleg Nesterov <oleg@redhat.com>
@@ -7501,6 +7511,12 @@ S: Supported · 2150 unmodified lines
75017511 F: Documentation/filesystems/xfs.txt
75027512 F: fs/xfs/
75037513
7514+XILINX AXI ETHERNET DRIVER
7515+M: Ariane Keller <ariane.keller@tik.ee.ethz.ch>
7516+M: Daniel Borkmann <daniel.borkmann@tik.ee.ethz.ch>
7517+S: Maintained
7518+F: drivers/net/ethernet/xilinx/xilinx_axienet*
7519+
75047520 XILINX SYSTEMACE DRIVER
75057521 M: Grant Likely <grant.likely@secretlab.ca>
75067522 W: http://www.secretlab.ca/
arch/alpha/include/asm/socket.h+4−0
@@ -71,6 +71,10 @@ · 70 unmodified lines
7171
7272 #define SO_WIFI_STATUS 41
7373 #define SCM_WIFI_STATUS SO_WIFI_STATUS
74+#define SO_PEEK_OFF 42
75+
76+/* Instruct lower device to use last 4-bytes of skb data as FCS */
77+#define SO_NOFCS 43
7478
7579 /* O_NONBLOCK clashes with the bits used for socket types. Therefore we
7680 * have to define SOCK_NONBLOCK to a different value here.
arch/arm/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_SOCKET_H */
arch/avr32/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* __ASM_AVR32_SOCKET_H */
arch/blackfin/mach-bf518/boards/ezbrd.c+2−1
@@ -821,7 +821,7 @@ void native_machine_restart(char *cmd) · 820 unmodified lines
821821 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
822822 }
823823
824−void bfin_get_ether_addr(char *addr)
824+int bfin_get_ether_addr(char *addr)
825825 {
826826 /* the MAC is stored in OTP memory page 0xDF */
827827 u32 ret;
@@ -834,5 +834,6 @@ void bfin_get_ether_addr(char *addr) · 6 unmodified lines
834834 for (ret = 0; ret < 6; ++ret)
835835 addr[ret] = otp_mac_p[5 - ret];
836836 }
837+ return 0;
837838 }
838839 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf518/boards/tcm-bf518.c+2−3
@@ -730,9 +730,8 @@ void native_machine_restart(char *cmd) · 729 unmodified lines
730730 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
731731 }
732732
733−void bfin_get_ether_addr(char *addr)
733+int bfin_get_ether_addr(char *addr)
734734 {
735− random_ether_addr(addr);
736− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
735+ return 1;
737736 }
738737 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf527/boards/ad7160eval.c+2−1
@@ -846,7 +846,7 @@ void native_machine_restart(char *cmd) · 845 unmodified lines
846846 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
847847 }
848848
849−void bfin_get_ether_addr(char *addr)
849+int bfin_get_ether_addr(char *addr)
850850 {
851851 /* the MAC is stored in OTP memory page 0xDF */
852852 u32 ret;
@@ -859,5 +859,6 @@ void bfin_get_ether_addr(char *addr) · 6 unmodified lines
859859 for (ret = 0; ret < 6; ++ret)
860860 addr[ret] = otp_mac_p[5 - ret];
861861 }
862+ return 0;
862863 }
863864 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf527/boards/cm_bf527.c+2−3
@@ -983,9 +983,8 @@ void native_machine_restart(char *cmd) · 982 unmodified lines
983983 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
984984 }
985985
986−void bfin_get_ether_addr(char *addr)
986+int bfin_get_ether_addr(char *addr)
987987 {
988− random_ether_addr(addr);
989− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
988+ return 1;
990989 }
991990 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf527/boards/ezbrd.c+2−1
@@ -870,7 +870,7 @@ void native_machine_restart(char *cmd) · 869 unmodified lines
870870 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
871871 }
872872
873−void bfin_get_ether_addr(char *addr)
873+int bfin_get_ether_addr(char *addr)
874874 {
875875 /* the MAC is stored in OTP memory page 0xDF */
876876 u32 ret;
@@ -883,5 +883,6 @@ void bfin_get_ether_addr(char *addr) · 6 unmodified lines
883883 for (ret = 0; ret < 6; ++ret)
884884 addr[ret] = otp_mac_p[5 - ret];
885885 }
886+ return 0;
886887 }
887888 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf527/boards/ezkit.c+2−1
@@ -1311,7 +1311,7 @@ void native_machine_restart(char *cmd) · 1310 unmodified lines
13111311 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
13121312 }
13131313
1314−void bfin_get_ether_addr(char *addr)
1314+int bfin_get_ether_addr(char *addr)
13151315 {
13161316 /* the MAC is stored in OTP memory page 0xDF */
13171317 u32 ret;
@@ -1324,5 +1324,6 @@ void bfin_get_ether_addr(char *addr) · 6 unmodified lines
13241324 for (ret = 0; ret < 6; ++ret)
13251325 addr[ret] = otp_mac_p[5 - ret];
13261326 }
1327+ return 0;
13271328 }
13281329 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf527/boards/tll6527m.c+2−1
@@ -931,7 +931,7 @@ void native_machine_restart(char *cmd) · 930 unmodified lines
931931 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
932932 }
933933
934−void bfin_get_ether_addr(char *addr)
934+int bfin_get_ether_addr(char *addr)
935935 {
936936 /* the MAC is stored in OTP memory page 0xDF */
937937 u32 ret;
@@ -945,5 +945,6 @@ void bfin_get_ether_addr(char *addr) · 7 unmodified lines
945945 for (ret = 0; ret < 6; ++ret)
946946 addr[ret] = otp_mac_p[5 - ret];
947947 }
948+ return 0;
948949 }
949950 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/cm_bf537e.c+2−3
@@ -813,9 +813,8 @@ void __init native_machine_early_platform_add_devices(void) · 812 unmodified lines
813813 ARRAY_SIZE(cm_bf537e_early_devices));
814814 }
815815
816−void bfin_get_ether_addr(char *addr)
816+int bfin_get_ether_addr(char *addr)
817817 {
818− random_ether_addr(addr);
819− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
818+ return 1;
820819 }
821820 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/cm_bf537u.c+2−3
@@ -790,9 +790,8 @@ void __init native_machine_early_platform_add_devices(void) · 789 unmodified lines
790790 ARRAY_SIZE(cm_bf537u_early_devices));
791791 }
792792
793−void bfin_get_ether_addr(char *addr)
793+int bfin_get_ether_addr(char *addr)
794794 {
795− random_ether_addr(addr);
796− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
795+ return 1;
797796 }
798797 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/dnp5370.c+2−1
@@ -399,9 +399,10 @@ arch_initcall(dnp5370_init); · 398 unmodified lines
399399 /*
400400 * Currently the MAC address is saved in Flash by U-Boot
401401 */
402−void bfin_get_ether_addr(char *addr)
402+int bfin_get_ether_addr(char *addr)
403403 {
404404 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
405405 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
406+ return 0;
406407 }
407408 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/pnav10.c+2−3
@@ -535,9 +535,8 @@ void __init native_machine_early_platform_add_devices(void) · 534 unmodified lines
535535 ARRAY_SIZE(stamp_early_devices));
536536 }
537537
538−void bfin_get_ether_addr(char *addr)
538+int bfin_get_ether_addr(char *addr)
539539 {
540− random_ether_addr(addr);
541− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
540+ return 1;
542541 }
543542 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/stamp.c+2−1
@@ -2993,9 +2993,10 @@ void native_machine_restart(char *cmd) · 2992 unmodified lines
29932993 * Currently the MAC address is saved in Flash by U-Boot
29942994 */
29952995 #define FLASH_MAC 0x203f0000
2996−void bfin_get_ether_addr(char *addr)
2996+int bfin_get_ether_addr(char *addr)
29972997 {
29982998 *(u32 *)(&(addr[0])) = bfin_read32(FLASH_MAC);
29992999 *(u16 *)(&(addr[4])) = bfin_read16(FLASH_MAC + 4);
3000+ return 0;
30003001 }
30013002 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/blackfin/mach-bf537/boards/tcm_bf537.c+2−3
@@ -780,9 +780,8 @@ void __init native_machine_early_platform_add_devices(void) · 779 unmodified lines
780780 ARRAY_SIZE(cm_bf537_early_devices));
781781 }
782782
783−void bfin_get_ether_addr(char *addr)
783+int bfin_get_ether_addr(char *addr)
784784 {
785− random_ether_addr(addr);
786− printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
785+ return 1;
787786 }
788787 EXPORT_SYMBOL(bfin_get_ether_addr);
arch/cris/include/asm/socket.h+4−0
@@ -66,6 +66,10 @@ · 65 unmodified lines
6666
6767 #define SO_WIFI_STATUS 41
6868 #define SCM_WIFI_STATUS SO_WIFI_STATUS
69+#define SO_PEEK_OFF 42
70+
71+/* Instruct lower device to use last 4-bytes of skb data as FCS */
72+#define SO_NOFCS 43
6973
7074 #endif /* _ASM_SOCKET_H */
7175
arch/frv/include/asm/socket.h+4−0
@@ -64,6 +64,10 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_SOCKET_H */
6973
arch/h8300/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_SOCKET_H */
arch/ia64/hp/sim/simeth.c+3−7
@@ -182,7 +182,7 @@ simeth_probe1(void) · 181 unmodified lines
182182 unsigned char mac_addr[ETH_ALEN];
183183 struct simeth_local *local;
184184 struct net_device *dev;
185− int fd, i, err, rc;
185+ int fd, err, rc;
186186
187187 /*
188188 * XXX Fix me
@@ -223,12 +223,8 @@ simeth_probe1(void) · 34 unmodified lines
223223 panic("%s: out of interrupt vectors!\n", __func__);
224224 dev->irq = rc;
225225
226− printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr",
227− dev->name, simeth_device, local->simfd);
228− for(i = 0; i < ETH_ALEN; i++) {
229− printk(" %2.2x", dev->dev_addr[i]);
230− }
231− printk(", IRQ %d\n", dev->irq);
226+ printk(KERN_INFO "%s: hosteth=%s simfd=%d, HwAddr=%pm, IRQ %d\n",
227+ dev->name, simeth_device, local->simfd, dev->dev_addr, dev->irq);
232228
233229 return 0;
234230 }
arch/ia64/include/asm/socket.h+4−0
@@ -73,5 +73,9 @@ · 72 unmodified lines
7373
7474 #define SO_WIFI_STATUS 41
7575 #define SCM_WIFI_STATUS SO_WIFI_STATUS
76+#define SO_PEEK_OFF 42
77+
78+/* Instruct lower device to use last 4-bytes of skb data as FCS */
79+#define SO_NOFCS 43
7680
7781 #endif /* _ASM_IA64_SOCKET_H */
arch/m32r/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_M32R_SOCKET_H */
arch/m68k/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_SOCKET_H */
arch/mips/bcm47xx/Makefile+1−1
@@ -3,5 +3,5 @@ · 2 unmodified lines
33 # under Linux.
44 #
55
6−obj-y += gpio.o irq.o nvram.o prom.o serial.o setup.o time.o
6+obj-y += gpio.o irq.o nvram.o prom.o serial.o setup.o time.o sprom.o
77 obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
arch/mips/bcm47xx/nvram.c+1−2
@@ -107,8 +107,7 @@ int nvram_getenv(char *name, char *val, size_t val_len) · 106 unmodified lines
107107 value = eq + 1;
108108 if ((eq - var) == strlen(name) &&
109109 strncmp(var, name, (eq - var)) == 0) {
110− snprintf(val, val_len, "%s", value);
111− return 0;
110+ return snprintf(val, val_len, "%s", value);
112111 }
113112 }
114113 return NVRAM_ERR_ENVNOTFOUND;
arch/mips/bcm47xx/setup.c+35−153
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
44 * Copyright (C) 2006 Michael Buesch <m@bues.ch>
55 * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
6− * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de>
6+ * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
77 *
88 * This program is free software; you can redistribute it and/or modify it
99 * under the terms of the GNU General Public License as published by the
@@ -85,156 +85,7 @@ static void bcm47xx_machine_halt(void) · 75 unmodified lines
8585 }
8686
8787 #ifdef CONFIG_BCM47XX_SSB
88−#define READ_FROM_NVRAM(_outvar, name, buf) \
89− if (nvram_getprefix(prefix, name, buf, sizeof(buf)) >= 0)\
90− sprom->_outvar = simple_strtoul(buf, NULL, 0);
91−
92−#define READ_FROM_NVRAM2(_outvar, name1, name2, buf) \
93− if (nvram_getprefix(prefix, name1, buf, sizeof(buf)) >= 0 || \
94− nvram_getprefix(prefix, name2, buf, sizeof(buf)) >= 0)\
95− sprom->_outvar = simple_strtoul(buf, NULL, 0);
96−
97−static inline int nvram_getprefix(const char *prefix, char *name,
98− char *buf, int len)
99−{
100− if (prefix) {
101− char key[100];
102−
103− snprintf(key, sizeof(key), "%s%s", prefix, name);
104− return nvram_getenv(key, buf, len);
105− }
106−
107− return nvram_getenv(name, buf, len);
108−}
109−
110−static u32 nvram_getu32(const char *name, char *buf, int len)
111−{
112− int rv;
113− char key[100];
114− u16 var0, var1;
115−
116− snprintf(key, sizeof(key), "%s0", name);
117− rv = nvram_getenv(key, buf, len);
118− /* return 0 here so this looks like unset */
119− if (rv < 0)
120− return 0;
121− var0 = simple_strtoul(buf, NULL, 0);
122−
123− snprintf(key, sizeof(key), "%s1", name);
124− rv = nvram_getenv(key, buf, len);
125− if (rv < 0)
126− return 0;
127− var1 = simple_strtoul(buf, NULL, 0);
128− return var1 << 16 | var0;
129−}
130−
131−static void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
132−{
133− char buf[100];
134− u32 boardflags;
135−
136− memset(sprom, 0, sizeof(struct ssb_sprom));
137−
138− sprom->revision = 1; /* Fallback: Old hardware does not define this. */
139− READ_FROM_NVRAM(revision, "sromrev", buf);
140− if (nvram_getprefix(prefix, "il0macaddr", buf, sizeof(buf)) >= 0 ||
141− nvram_getprefix(prefix, "macaddr", buf, sizeof(buf)) >= 0)
142− nvram_parse_macaddr(buf, sprom->il0mac);
143− if (nvram_getprefix(prefix, "et0macaddr", buf, sizeof(buf)) >= 0)
144− nvram_parse_macaddr(buf, sprom->et0mac);
145− if (nvram_getprefix(prefix, "et1macaddr", buf, sizeof(buf)) >= 0)
146− nvram_parse_macaddr(buf, sprom->et1mac);
147− READ_FROM_NVRAM(et0phyaddr, "et0phyaddr", buf);
148− READ_FROM_NVRAM(et1phyaddr, "et1phyaddr", buf);
149− READ_FROM_NVRAM(et0mdcport, "et0mdcport", buf);
150− READ_FROM_NVRAM(et1mdcport, "et1mdcport", buf);
151− READ_FROM_NVRAM(board_rev, "boardrev", buf);
152− READ_FROM_NVRAM(country_code, "ccode", buf);
153− READ_FROM_NVRAM(ant_available_a, "aa5g", buf);
154− READ_FROM_NVRAM(ant_available_bg, "aa2g", buf);
155− READ_FROM_NVRAM(pa0b0, "pa0b0", buf);
156− READ_FROM_NVRAM(pa0b1, "pa0b1", buf);
157− READ_FROM_NVRAM(pa0b2, "pa0b2", buf);
158− READ_FROM_NVRAM(pa1b0, "pa1b0", buf);
159− READ_FROM_NVRAM(pa1b1, "pa1b1", buf);
160− READ_FROM_NVRAM(pa1b2, "pa1b2", buf);
161− READ_FROM_NVRAM(pa1lob0, "pa1lob0", buf);
162− READ_FROM_NVRAM(pa1lob2, "pa1lob1", buf);
163− READ_FROM_NVRAM(pa1lob1, "pa1lob2", buf);
164− READ_FROM_NVRAM(pa1hib0, "pa1hib0", buf);
165− READ_FROM_NVRAM(pa1hib2, "pa1hib1", buf);
166− READ_FROM_NVRAM(pa1hib1, "pa1hib2", buf);
167− READ_FROM_NVRAM2(gpio0, "ledbh0", "wl0gpio0", buf);
168− READ_FROM_NVRAM2(gpio1, "ledbh1", "wl0gpio1", buf);
169− READ_FROM_NVRAM2(gpio2, "ledbh2", "wl0gpio2", buf);
170− READ_FROM_NVRAM2(gpio3, "ledbh3", "wl0gpio3", buf);
171− READ_FROM_NVRAM2(maxpwr_bg, "maxp2ga0", "pa0maxpwr", buf);
172− READ_FROM_NVRAM2(maxpwr_al, "maxp5gla0", "pa1lomaxpwr", buf);
173− READ_FROM_NVRAM2(maxpwr_a, "maxp5ga0", "pa1maxpwr", buf);
174− READ_FROM_NVRAM2(maxpwr_ah, "maxp5gha0", "pa1himaxpwr", buf);
175− READ_FROM_NVRAM2(itssi_bg, "itt5ga0", "pa0itssit", buf);
176− READ_FROM_NVRAM2(itssi_a, "itt2ga0", "pa1itssit", buf);
177− READ_FROM_NVRAM(tri2g, "tri2g", buf);
178− READ_FROM_NVRAM(tri5gl, "tri5gl", buf);
179− READ_FROM_NVRAM(tri5g, "tri5g", buf);
180− READ_FROM_NVRAM(tri5gh, "tri5gh", buf);
181− READ_FROM_NVRAM(txpid2g[0], "txpid2ga0", buf);
182− READ_FROM_NVRAM(txpid2g[1], "txpid2ga1", buf);
183− READ_FROM_NVRAM(txpid2g[2], "txpid2ga2", buf);
184− READ_FROM_NVRAM(txpid2g[3], "txpid2ga3", buf);
185− READ_FROM_NVRAM(txpid5g[0], "txpid5ga0", buf);
186− READ_FROM_NVRAM(txpid5g[1], "txpid5ga1", buf);
187− READ_FROM_NVRAM(txpid5g[2], "txpid5ga2", buf);
188− READ_FROM_NVRAM(txpid5g[3], "txpid5ga3", buf);
189− READ_FROM_NVRAM(txpid5gl[0], "txpid5gla0", buf);
190− READ_FROM_NVRAM(txpid5gl[1], "txpid5gla1", buf);
191− READ_FROM_NVRAM(txpid5gl[2], "txpid5gla2", buf);
192− READ_FROM_NVRAM(txpid5gl[3], "txpid5gla3", buf);
193− READ_FROM_NVRAM(txpid5gh[0], "txpid5gha0", buf);
194− READ_FROM_NVRAM(txpid5gh[1], "txpid5gha1", buf);
195− READ_FROM_NVRAM(txpid5gh[2], "txpid5gha2", buf);
196− READ_FROM_NVRAM(txpid5gh[3], "txpid5gha3", buf);
197− READ_FROM_NVRAM(rxpo2g, "rxpo2g", buf);
198− READ_FROM_NVRAM(rxpo5g, "rxpo5g", buf);
199− READ_FROM_NVRAM(rssisav2g, "rssisav2g", buf);
200− READ_FROM_NVRAM(rssismc2g, "rssismc2g", buf);
201− READ_FROM_NVRAM(rssismf2g, "rssismf2g", buf);
202− READ_FROM_NVRAM(bxa2g, "bxa2g", buf);
203− READ_FROM_NVRAM(rssisav5g, "rssisav5g", buf);
204− READ_FROM_NVRAM(rssismc5g, "rssismc5g", buf);
205− READ_FROM_NVRAM(rssismf5g, "rssismf5g", buf);
206− READ_FROM_NVRAM(bxa5g, "bxa5g", buf);
207− READ_FROM_NVRAM(cck2gpo, "cck2gpo", buf);
208−
209− sprom->ofdm2gpo = nvram_getu32("ofdm2gpo", buf, sizeof(buf));
210− sprom->ofdm5glpo = nvram_getu32("ofdm5glpo", buf, sizeof(buf));
211− sprom->ofdm5gpo = nvram_getu32("ofdm5gpo", buf, sizeof(buf));
212− sprom->ofdm5ghpo = nvram_getu32("ofdm5ghpo", buf, sizeof(buf));
213−
214− READ_FROM_NVRAM(antenna_gain.ghz24.a0, "ag0", buf);
215− READ_FROM_NVRAM(antenna_gain.ghz24.a1, "ag1", buf);
216− READ_FROM_NVRAM(antenna_gain.ghz24.a2, "ag2", buf);
217− READ_FROM_NVRAM(antenna_gain.ghz24.a3, "ag3", buf);
218− memcpy(&sprom->antenna_gain.ghz5, &sprom->antenna_gain.ghz24,
219− sizeof(sprom->antenna_gain.ghz5));
220−
221− if (nvram_getprefix(prefix, "boardflags", buf, sizeof(buf)) >= 0) {
222− boardflags = simple_strtoul(buf, NULL, 0);
223− if (boardflags) {
224− sprom->boardflags_lo = (boardflags & 0x0000FFFFU);
225− sprom->boardflags_hi = (boardflags & 0xFFFF0000U) >> 16;
226− }
227− }
228− if (nvram_getprefix(prefix, "boardflags2", buf, sizeof(buf)) >= 0) {
229− boardflags = simple_strtoul(buf, NULL, 0);
230− if (boardflags) {
231− sprom->boardflags2_lo = (boardflags & 0x0000FFFFU);
232− sprom->boardflags2_hi = (boardflags & 0xFFFF0000U) >> 16;
233− }
234− }
235−}
236−
237−int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
88+static int bcm47xx_get_sprom_ssb(struct ssb_bus *bus, struct ssb_sprom *out)
23889 {
23990 char prefix[10];
24091
@@ -251,7 +102,7 @@ int bcm47xx_get_sprom(struct ssb_bus *bus, struct ssb_sprom *out) · 10 unmodified lines
251102 }
252103
253104 static int bcm47xx_get_invariants(struct ssb_bus *bus,
254− struct ssb_init_invariants *iv)
105+ struct ssb_init_invariants *iv)
255106 {
256107 char buf[20];
257108
@@ -281,7 +132,7 @@ static void __init bcm47xx_register_ssb(void) · 23 unmodified lines
281132 char buf[100];
282133 struct ssb_mipscore *mcore;
283134
284− err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom);
135+ err = ssb_arch_register_fallback_sprom(&bcm47xx_get_sprom_ssb);
285136 if (err)
286137 printk(KERN_WARNING "bcm47xx: someone else already registered"
287138 " a ssb SPROM callback handler (err %d)\n", err);
@@ -308,10 +159,41 @@ static void __init bcm47xx_register_ssb(void) · 20 unmodified lines
308159 #endif
309160
310161 #ifdef CONFIG_BCM47XX_BCMA
162+static int bcm47xx_get_sprom_bcma(struct bcma_bus *bus, struct ssb_sprom *out)
163+{
164+ char prefix[10];
165+ struct bcma_device *core;
166+
167+ switch (bus->hosttype) {
168+ case BCMA_HOSTTYPE_PCI:
169+ snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
170+ bus->host_pci->bus->number + 1,
171+ PCI_SLOT(bus->host_pci->devfn));
172+ bcm47xx_fill_sprom(out, prefix);
173+ return 0;
174+ case BCMA_HOSTTYPE_SOC:
175+ bcm47xx_fill_sprom_ethernet(out, NULL);
176+ core = bcma_find_core(bus, BCMA_CORE_80211);
177+ if (core) {
178+ snprintf(prefix, sizeof(prefix), "sb/%u/",
179+ core->core_index);
180+ bcm47xx_fill_sprom(out, prefix);
181+ }
182+ return 0;
183+ default:
184+ pr_warn("bcm47xx: unable to fill SPROM for given bustype.\n");
185+ return -EINVAL;
186+ }
187+}
188+
311189 static void __init bcm47xx_register_bcma(void)
312190 {
313191 int err;
314192
193+ err = bcma_arch_register_fallback_sprom(&bcm47xx_get_sprom_bcma);
194+ if (err)
195+ pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err);
196+
315197 err = bcma_host_soc_register(&bcm47xx_bus.bcma);
316198 if (err)
317199 panic("Failed to initialize BCMA bus (err %d)", err);
arch/mips/bcm47xx/sprom.c+620−0
@@ -0,0 +1,620 @@
1+/*
2+ * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3+ * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
4+ * Copyright (C) 2006 Michael Buesch <m@bues.ch>
5+ * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org>
6+ * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de>
7+ *
8+ * This program is free software; you can redistribute it and/or modify it
9+ * under the terms of the GNU General Public License as published by the
10+ * Free Software Foundation; either version 2 of the License, or (at your
11+ * option) any later version.
12+ *
13+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23+ *
24+ * You should have received a copy of the GNU General Public License along
25+ * with this program; if not, write to the Free Software Foundation, Inc.,
26+ * 675 Mass Ave, Cambridge, MA 02139, USA.
27+ */
28+
29+#include <bcm47xx.h>
30+#include <nvram.h>
31+
32+static void create_key(const char *prefix, const char *postfix,
33+ const char *name, char *buf, int len)
34+{
35+ if (prefix && postfix)
36+ snprintf(buf, len, "%s%s%s", prefix, name, postfix);
37+ else if (prefix)
38+ snprintf(buf, len, "%s%s", prefix, name);
39+ else if (postfix)
40+ snprintf(buf, len, "%s%s", name, postfix);
41+ else
42+ snprintf(buf, len, "%s", name);
43+}
44+
45+#define NVRAM_READ_VAL(type) \
46+static void nvram_read_ ## type (const char *prefix, \
47+ const char *postfix, const char *name, \
48+ type *val, type allset) \
49+{ \
50+ char buf[100]; \
51+ char key[40]; \
52+ int err; \
53+ type var; \
54+ \
55+ create_key(prefix, postfix, name, key, sizeof(key)); \
56+ \
57+ err = nvram_getenv(key, buf, sizeof(buf)); \
58+ if (err < 0) \
59+ return; \
60+ err = kstrto ## type (buf, 0, &var); \
61+ if (err) { \
62+ pr_warn("can not parse nvram name %s with value %s" \
63+ " got %i", key, buf, err); \
64+ return; \
65+ } \
66+ if (allset && var == allset) \
67+ return; \
68+ *val = var; \
69+}
70+
71+NVRAM_READ_VAL(u8)
72+NVRAM_READ_VAL(s8)
73+NVRAM_READ_VAL(u16)
74+NVRAM_READ_VAL(u32)
75+
76+#undef NVRAM_READ_VAL
77+
78+static void nvram_read_u32_2(const char *prefix, const char *name,
79+ u16 *val_lo, u16 *val_hi)
80+{
81+ char buf[100];
82+ char key[40];
83+ int err;
84+ u32 val;
85+
86+ create_key(prefix, NULL, name, key, sizeof(key));
87+
88+ err = nvram_getenv(key, buf, sizeof(buf));
89+ if (err < 0)
90+ return;
91+ err = kstrtou32(buf, 0, &val);
92+ if (err) {
93+ pr_warn("can not parse nvram name %s with value %s got %i",
94+ key, buf, err);
95+ return;
96+ }
97+ *val_lo = (val & 0x0000FFFFU);
98+ *val_hi = (val & 0xFFFF0000U) >> 16;
99+}
100+
101+static void nvram_read_leddc(const char *prefix, const char *name,
102+ u8 *leddc_on_time, u8 *leddc_off_time)
103+{
104+ char buf[100];
105+ char key[40];
106+ int err;
107+ u32 val;
108+
109+ create_key(prefix, NULL, name, key, sizeof(key));
110+
111+ err = nvram_getenv(key, buf, sizeof(buf));
112+ if (err < 0)
113+ return;
114+ err = kstrtou32(buf, 0, &val);
115+ if (err) {
116+ pr_warn("can not parse nvram name %s with value %s got %i",
117+ key, buf, err);
118+ return;
119+ }
120+
121+ if (val == 0xffff || val == 0xffffffff)
122+ return;
123+
124+ *leddc_on_time = val & 0xff;
125+ *leddc_off_time = (val >> 16) & 0xff;
126+}
127+
128+static void nvram_read_macaddr(const char *prefix, const char *name,
129+ u8 (*val)[6])
130+{
131+ char buf[100];
132+ char key[40];
133+ int err;
134+
135+ create_key(prefix, NULL, name, key, sizeof(key));
136+
137+ err = nvram_getenv(key, buf, sizeof(buf));
138+ if (err < 0)
139+ return;
140+ nvram_parse_macaddr(buf, *val);
141+}
142+
143+static void nvram_read_alpha2(const char *prefix, const char *name,
144+ char (*val)[2])
145+{
146+ char buf[10];
147+ char key[40];
148+ int err;
149+
150+ create_key(prefix, NULL, name, key, sizeof(key));
151+
152+ err = nvram_getenv(key, buf, sizeof(buf));
153+ if (err < 0)
154+ return;
155+ if (buf[0] == '0')
156+ return;
157+ if (strlen(buf) > 2) {
158+ pr_warn("alpha2 is too long %s", buf);
159+ return;
160+ }
161+ memcpy(val, buf, sizeof(val));
162+}
163+
164+static void bcm47xx_fill_sprom_r1234589(struct ssb_sprom *sprom,
165+ const char *prefix)
166+{
167+ nvram_read_u16(prefix, NULL, "boardrev", &sprom->board_rev, 0);
168+ nvram_read_u16(prefix, NULL, "boardnum", &sprom->board_num, 0);
169+ nvram_read_u8(prefix, NULL, "ledbh0", &sprom->gpio0, 0xff);
170+ nvram_read_u8(prefix, NULL, "ledbh1", &sprom->gpio1, 0xff);
171+ nvram_read_u8(prefix, NULL, "ledbh2", &sprom->gpio2, 0xff);
172+ nvram_read_u8(prefix, NULL, "ledbh3", &sprom->gpio3, 0xff);
173+ nvram_read_u8(prefix, NULL, "aa2g", &sprom->ant_available_bg, 0);
174+ nvram_read_u8(prefix, NULL, "aa5g", &sprom->ant_available_a, 0);
175+ nvram_read_s8(prefix, NULL, "ag0", &sprom->antenna_gain.a0, 0);
176+ nvram_read_s8(prefix, NULL, "ag1", &sprom->antenna_gain.a1, 0);
177+ nvram_read_alpha2(prefix, "ccode", &sprom->alpha2);
178+}
179+
180+static void bcm47xx_fill_sprom_r12389(struct ssb_sprom *sprom,
181+ const char *prefix)
182+{
183+ nvram_read_u16(prefix, NULL, "pa0b0", &sprom->pa0b0, 0);
184+ nvram_read_u16(prefix, NULL, "pa0b1", &sprom->pa0b1, 0);
185+ nvram_read_u16(prefix, NULL, "pa0b2", &sprom->pa0b2, 0);
186+ nvram_read_u8(prefix, NULL, "pa0itssit", &sprom->itssi_bg, 0);
187+ nvram_read_u8(prefix, NULL, "pa0maxpwr", &sprom->maxpwr_bg, 0);
188+ nvram_read_u16(prefix, NULL, "pa1b0", &sprom->pa1b0, 0);
189+ nvram_read_u16(prefix, NULL, "pa1b1", &sprom->pa1b1, 0);
190+ nvram_read_u16(prefix, NULL, "pa1b2", &sprom->pa1b2, 0);
191+ nvram_read_u8(prefix, NULL, "pa1itssit", &sprom->itssi_a, 0);
192+ nvram_read_u8(prefix, NULL, "pa1maxpwr", &sprom->maxpwr_a, 0);
193+}
194+
195+static void bcm47xx_fill_sprom_r1(struct ssb_sprom *sprom, const char *prefix)
196+{
197+ nvram_read_u16(prefix, NULL, "boardflags", &sprom->boardflags_lo, 0);
198+ nvram_read_u8(prefix, NULL, "cc", &sprom->country_code, 0);
199+}
200+
201+static void bcm47xx_fill_sprom_r2389(struct ssb_sprom *sprom,
202+ const char *prefix)
203+{
204+ nvram_read_u8(prefix, NULL, "opo", &sprom->opo, 0);
205+ nvram_read_u16(prefix, NULL, "pa1lob0", &sprom->pa1lob0, 0);
206+ nvram_read_u16(prefix, NULL, "pa1lob1", &sprom->pa1lob1, 0);
207+ nvram_read_u16(prefix, NULL, "pa1lob2", &sprom->pa1lob2, 0);
208+ nvram_read_u16(prefix, NULL, "pa1hib0", &sprom->pa1hib0, 0);
209+ nvram_read_u16(prefix, NULL, "pa1hib1", &sprom->pa1hib1, 0);
210+ nvram_read_u16(prefix, NULL, "pa1hib2", &sprom->pa1hib2, 0);
211+ nvram_read_u8(prefix, NULL, "pa1lomaxpwr", &sprom->maxpwr_al, 0);
212+ nvram_read_u8(prefix, NULL, "pa1himaxpwr", &sprom->maxpwr_ah, 0);
213+}
214+
215+static void bcm47xx_fill_sprom_r2(struct ssb_sprom *sprom, const char *prefix)
216+{
217+ nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo,
218+ &sprom->boardflags_hi);
219+ nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0);
220+}
221+
222+static void bcm47xx_fill_sprom_r389(struct ssb_sprom *sprom, const char *prefix)
223+{
224+ nvram_read_u8(prefix, NULL, "bxa2g", &sprom->bxa2g, 0);
225+ nvram_read_u8(prefix, NULL, "rssisav2g", &sprom->rssisav2g, 0);
226+ nvram_read_u8(prefix, NULL, "rssismc2g", &sprom->rssismc2g, 0);
227+ nvram_read_u8(prefix, NULL, "rssismf2g", &sprom->rssismf2g, 0);
228+ nvram_read_u8(prefix, NULL, "bxa5g", &sprom->bxa5g, 0);
229+ nvram_read_u8(prefix, NULL, "rssisav5g", &sprom->rssisav5g, 0);
230+ nvram_read_u8(prefix, NULL, "rssismc5g", &sprom->rssismc5g, 0);
231+ nvram_read_u8(prefix, NULL, "rssismf5g", &sprom->rssismf5g, 0);
232+ nvram_read_u8(prefix, NULL, "tri2g", &sprom->tri2g, 0);
233+ nvram_read_u8(prefix, NULL, "tri5g", &sprom->tri5g, 0);
234+ nvram_read_u8(prefix, NULL, "tri5gl", &sprom->tri5gl, 0);
235+ nvram_read_u8(prefix, NULL, "tri5gh", &sprom->tri5gh, 0);
236+ nvram_read_s8(prefix, NULL, "rxpo2g", &sprom->rxpo2g, 0);
237+ nvram_read_s8(prefix, NULL, "rxpo5g", &sprom->rxpo5g, 0);
238+}
239+
240+static void bcm47xx_fill_sprom_r3(struct ssb_sprom *sprom, const char *prefix)
241+{
242+ nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo,
243+ &sprom->boardflags_hi);
244+ nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0);
245+ nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0);
246+ nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time,
247+ &sprom->leddc_off_time);
248+}
249+
250+static void bcm47xx_fill_sprom_r4589(struct ssb_sprom *sprom,
251+ const char *prefix)
252+{
253+ nvram_read_u32_2(prefix, "boardflags", &sprom->boardflags_lo,
254+ &sprom->boardflags_hi);
255+ nvram_read_u32_2(prefix, "boardflags2", &sprom->boardflags2_lo,
256+ &sprom->boardflags2_hi);
257+ nvram_read_u16(prefix, NULL, "boardtype", &sprom->board_type, 0);
258+ nvram_read_u8(prefix, NULL, "regrev", &sprom->regrev, 0);
259+ nvram_read_s8(prefix, NULL, "ag2", &sprom->antenna_gain.a2, 0);
260+ nvram_read_s8(prefix, NULL, "ag3", &sprom->antenna_gain.a3, 0);
261+ nvram_read_u8(prefix, NULL, "txchain", &sprom->txchain, 0xf);
262+ nvram_read_u8(prefix, NULL, "rxchain", &sprom->rxchain, 0xf);
263+ nvram_read_u8(prefix, NULL, "antswitch", &sprom->antswitch, 0xff);
264+ nvram_read_leddc(prefix, "leddc", &sprom->leddc_on_time,
265+ &sprom->leddc_off_time);
266+}
267+
268+static void bcm47xx_fill_sprom_r458(struct ssb_sprom *sprom, const char *prefix)
269+{
270+ nvram_read_u16(prefix, NULL, "cck2gpo", &sprom->cck2gpo, 0);
271+ nvram_read_u32(prefix, NULL, "ofdm2gpo", &sprom->ofdm2gpo, 0);
272+ nvram_read_u32(prefix, NULL, "ofdm5gpo", &sprom->ofdm5gpo, 0);
273+ nvram_read_u32(prefix, NULL, "ofdm5glpo", &sprom->ofdm5glpo, 0);
274+ nvram_read_u32(prefix, NULL, "ofdm5ghpo", &sprom->ofdm5ghpo, 0);
275+ nvram_read_u16(prefix, NULL, "cddpo", &sprom->cddpo, 0);
276+ nvram_read_u16(prefix, NULL, "stbcpo", &sprom->stbcpo, 0);
277+ nvram_read_u16(prefix, NULL, "bw40po", &sprom->bw40po, 0);
278+ nvram_read_u16(prefix, NULL, "bwduppo", &sprom->bwduppo, 0);
279+ nvram_read_u16(prefix, NULL, "mcs2gpo0", &sprom->mcs2gpo[0], 0);
280+ nvram_read_u16(prefix, NULL, "mcs2gpo1", &sprom->mcs2gpo[1], 0);
281+ nvram_read_u16(prefix, NULL, "mcs2gpo2", &sprom->mcs2gpo[2], 0);
282+ nvram_read_u16(prefix, NULL, "mcs2gpo3", &sprom->mcs2gpo[3], 0);
283+ nvram_read_u16(prefix, NULL, "mcs2gpo4", &sprom->mcs2gpo[4], 0);
284+ nvram_read_u16(prefix, NULL, "mcs2gpo5", &sprom->mcs2gpo[5], 0);
285+ nvram_read_u16(prefix, NULL, "mcs2gpo6", &sprom->mcs2gpo[6], 0);
286+ nvram_read_u16(prefix, NULL, "mcs2gpo7", &sprom->mcs2gpo[7], 0);
287+ nvram_read_u16(prefix, NULL, "mcs5gpo0", &sprom->mcs5gpo[0], 0);
288+ nvram_read_u16(prefix, NULL, "mcs5gpo1", &sprom->mcs5gpo[1], 0);
289+ nvram_read_u16(prefix, NULL, "mcs5gpo2", &sprom->mcs5gpo[2], 0);
290+ nvram_read_u16(prefix, NULL, "mcs5gpo3", &sprom->mcs5gpo[3], 0);
291+ nvram_read_u16(prefix, NULL, "mcs5gpo4", &sprom->mcs5gpo[4], 0);
292+ nvram_read_u16(prefix, NULL, "mcs5gpo5", &sprom->mcs5gpo[5], 0);
293+ nvram_read_u16(prefix, NULL, "mcs5gpo6", &sprom->mcs5gpo[6], 0);
294+ nvram_read_u16(prefix, NULL, "mcs5gpo7", &sprom->mcs5gpo[7], 0);
295+ nvram_read_u16(prefix, NULL, "mcs5glpo0", &sprom->mcs5glpo[0], 0);
296+ nvram_read_u16(prefix, NULL, "mcs5glpo1", &sprom->mcs5glpo[1], 0);
297+ nvram_read_u16(prefix, NULL, "mcs5glpo2", &sprom->mcs5glpo[2], 0);
298+ nvram_read_u16(prefix, NULL, "mcs5glpo3", &sprom->mcs5glpo[3], 0);
299+ nvram_read_u16(prefix, NULL, "mcs5glpo4", &sprom->mcs5glpo[4], 0);
300+ nvram_read_u16(prefix, NULL, "mcs5glpo5", &sprom->mcs5glpo[5], 0);
301+ nvram_read_u16(prefix, NULL, "mcs5glpo6", &sprom->mcs5glpo[6], 0);
302+ nvram_read_u16(prefix, NULL, "mcs5glpo7", &sprom->mcs5glpo[7], 0);
303+ nvram_read_u16(prefix, NULL, "mcs5ghpo0", &sprom->mcs5ghpo[0], 0);
304+ nvram_read_u16(prefix, NULL, "mcs5ghpo1", &sprom->mcs5ghpo[1], 0);
305+ nvram_read_u16(prefix, NULL, "mcs5ghpo2", &sprom->mcs5ghpo[2], 0);
306+ nvram_read_u16(prefix, NULL, "mcs5ghpo3", &sprom->mcs5ghpo[3], 0);
307+ nvram_read_u16(prefix, NULL, "mcs5ghpo4", &sprom->mcs5ghpo[4], 0);
308+ nvram_read_u16(prefix, NULL, "mcs5ghpo5", &sprom->mcs5ghpo[5], 0);
309+ nvram_read_u16(prefix, NULL, "mcs5ghpo6", &sprom->mcs5ghpo[6], 0);
310+ nvram_read_u16(prefix, NULL, "mcs5ghpo7", &sprom->mcs5ghpo[7], 0);
311+}
312+
313+static void bcm47xx_fill_sprom_r45(struct ssb_sprom *sprom, const char *prefix)
314+{
315+ nvram_read_u8(prefix, NULL, "txpid2ga0", &sprom->txpid2g[0], 0);
316+ nvram_read_u8(prefix, NULL, "txpid2ga1", &sprom->txpid2g[1], 0);
317+ nvram_read_u8(prefix, NULL, "txpid2ga2", &sprom->txpid2g[2], 0);
318+ nvram_read_u8(prefix, NULL, "txpid2ga3", &sprom->txpid2g[3], 0);
319+ nvram_read_u8(prefix, NULL, "txpid5ga0", &sprom->txpid5g[0], 0);
320+ nvram_read_u8(prefix, NULL, "txpid5ga1", &sprom->txpid5g[1], 0);
321+ nvram_read_u8(prefix, NULL, "txpid5ga2", &sprom->txpid5g[2], 0);
322+ nvram_read_u8(prefix, NULL, "txpid5ga3", &sprom->txpid5g[3], 0);
323+ nvram_read_u8(prefix, NULL, "txpid5gla0", &sprom->txpid5gl[0], 0);
324+ nvram_read_u8(prefix, NULL, "txpid5gla1", &sprom->txpid5gl[1], 0);
325+ nvram_read_u8(prefix, NULL, "txpid5gla2", &sprom->txpid5gl[2], 0);
326+ nvram_read_u8(prefix, NULL, "txpid5gla3", &sprom->txpid5gl[3], 0);
327+ nvram_read_u8(prefix, NULL, "txpid5gha0", &sprom->txpid5gh[0], 0);
328+ nvram_read_u8(prefix, NULL, "txpid5gha1", &sprom->txpid5gh[1], 0);
329+ nvram_read_u8(prefix, NULL, "txpid5gha2", &sprom->txpid5gh[2], 0);
330+ nvram_read_u8(prefix, NULL, "txpid5gha3", &sprom->txpid5gh[3], 0);
331+}
332+
333+static void bcm47xx_fill_sprom_r89(struct ssb_sprom *sprom, const char *prefix)
334+{
335+ nvram_read_u8(prefix, NULL, "tssipos2g", &sprom->fem.ghz2.tssipos, 0);
336+ nvram_read_u8(prefix, NULL, "extpagain2g",
337+ &sprom->fem.ghz2.extpa_gain, 0);
338+ nvram_read_u8(prefix, NULL, "pdetrange2g",
339+ &sprom->fem.ghz2.pdet_range, 0);
340+ nvram_read_u8(prefix, NULL, "triso2g", &sprom->fem.ghz2.tr_iso, 0);
341+ nvram_read_u8(prefix, NULL, "antswctl2g", &sprom->fem.ghz2.antswlut, 0);
342+ nvram_read_u8(prefix, NULL, "tssipos5g", &sprom->fem.ghz5.tssipos, 0);
343+ nvram_read_u8(prefix, NULL, "extpagain5g",
344+ &sprom->fem.ghz5.extpa_gain, 0);
345+ nvram_read_u8(prefix, NULL, "pdetrange5g",
346+ &sprom->fem.ghz5.pdet_range, 0);
347+ nvram_read_u8(prefix, NULL, "triso5g", &sprom->fem.ghz5.tr_iso, 0);
348+ nvram_read_u8(prefix, NULL, "antswctl5g", &sprom->fem.ghz5.antswlut, 0);
349+ nvram_read_u8(prefix, NULL, "tempthresh", &sprom->tempthresh, 0);
350+ nvram_read_u8(prefix, NULL, "tempoffset", &sprom->tempoffset, 0);
351+ nvram_read_u16(prefix, NULL, "rawtempsense", &sprom->rawtempsense, 0);
352+ nvram_read_u8(prefix, NULL, "measpower", &sprom->measpower, 0);
353+ nvram_read_u8(prefix, NULL, "tempsense_slope",
354+ &sprom->tempsense_slope, 0);
355+ nvram_read_u8(prefix, NULL, "tempcorrx", &sprom->tempcorrx, 0);
356+ nvram_read_u8(prefix, NULL, "tempsense_option",
357+ &sprom->tempsense_option, 0);
358+ nvram_read_u8(prefix, NULL, "freqoffset_corr",
359+ &sprom->freqoffset_corr, 0);
360+ nvram_read_u8(prefix, NULL, "iqcal_swp_dis", &sprom->iqcal_swp_dis, 0);
361+ nvram_read_u8(prefix, NULL, "hw_iqcal_en", &sprom->hw_iqcal_en, 0);
362+ nvram_read_u8(prefix, NULL, "elna2g", &sprom->elna2g, 0);
363+ nvram_read_u8(prefix, NULL, "elna5g", &sprom->elna5g, 0);
364+ nvram_read_u8(prefix, NULL, "phycal_tempdelta",
365+ &sprom->phycal_tempdelta, 0);
366+ nvram_read_u8(prefix, NULL, "temps_period", &sprom->temps_period, 0);
367+ nvram_read_u8(prefix, NULL, "temps_hysteresis",
368+ &sprom->temps_hysteresis, 0);
369+ nvram_read_u8(prefix, NULL, "measpower1", &sprom->measpower1, 0);
370+ nvram_read_u8(prefix, NULL, "measpower2", &sprom->measpower2, 0);
371+ nvram_read_u8(prefix, NULL, "rxgainerr2ga0",
372+ &sprom->rxgainerr2ga[0], 0);
373+ nvram_read_u8(prefix, NULL, "rxgainerr2ga1",
374+ &sprom->rxgainerr2ga[1], 0);
375+ nvram_read_u8(prefix, NULL, "rxgainerr2ga2",
376+ &sprom->rxgainerr2ga[2], 0);
377+ nvram_read_u8(prefix, NULL, "rxgainerr5gla0",
378+ &sprom->rxgainerr5gla[0], 0);
379+ nvram_read_u8(prefix, NULL, "rxgainerr5gla1",
380+ &sprom->rxgainerr5gla[1], 0);
381+ nvram_read_u8(prefix, NULL, "rxgainerr5gla2",
382+ &sprom->rxgainerr5gla[2], 0);
383+ nvram_read_u8(prefix, NULL, "rxgainerr5gma0",
384+ &sprom->rxgainerr5gma[0], 0);
385+ nvram_read_u8(prefix, NULL, "rxgainerr5gma1",
386+ &sprom->rxgainerr5gma[1], 0);
387+ nvram_read_u8(prefix, NULL, "rxgainerr5gma2",
388+ &sprom->rxgainerr5gma[2], 0);
389+ nvram_read_u8(prefix, NULL, "rxgainerr5gha0",
390+ &sprom->rxgainerr5gha[0], 0);
391+ nvram_read_u8(prefix, NULL, "rxgainerr5gha1",
392+ &sprom->rxgainerr5gha[1], 0);
393+ nvram_read_u8(prefix, NULL, "rxgainerr5gha2",
394+ &sprom->rxgainerr5gha[2], 0);
395+ nvram_read_u8(prefix, NULL, "rxgainerr5gua0",
396+ &sprom->rxgainerr5gua[0], 0);
397+ nvram_read_u8(prefix, NULL, "rxgainerr5gua1",
398+ &sprom->rxgainerr5gua[1], 0);
399+ nvram_read_u8(prefix, NULL, "rxgainerr5gua2",
400+ &sprom->rxgainerr5gua[2], 0);
401+ nvram_read_u8(prefix, NULL, "noiselvl2ga0", &sprom->noiselvl2ga[0], 0);
402+ nvram_read_u8(prefix, NULL, "noiselvl2ga1", &sprom->noiselvl2ga[1], 0);
403+ nvram_read_u8(prefix, NULL, "noiselvl2ga2", &sprom->noiselvl2ga[2], 0);
404+ nvram_read_u8(prefix, NULL, "noiselvl5gla0",
405+ &sprom->noiselvl5gla[0], 0);
406+ nvram_read_u8(prefix, NULL, "noiselvl5gla1",
407+ &sprom->noiselvl5gla[1], 0);
408+ nvram_read_u8(prefix, NULL, "noiselvl5gla2",
409+ &sprom->noiselvl5gla[2], 0);
410+ nvram_read_u8(prefix, NULL, "noiselvl5gma0",
411+ &sprom->noiselvl5gma[0], 0);
412+ nvram_read_u8(prefix, NULL, "noiselvl5gma1",
413+ &sprom->noiselvl5gma[1], 0);
414+ nvram_read_u8(prefix, NULL, "noiselvl5gma2",
415+ &sprom->noiselvl5gma[2], 0);
416+ nvram_read_u8(prefix, NULL, "noiselvl5gha0",
417+ &sprom->noiselvl5gha[0], 0);
418+ nvram_read_u8(prefix, NULL, "noiselvl5gha1",
419+ &sprom->noiselvl5gha[1], 0);
420+ nvram_read_u8(prefix, NULL, "noiselvl5gha2",
421+ &sprom->noiselvl5gha[2], 0);
422+ nvram_read_u8(prefix, NULL, "noiselvl5gua0",
423+ &sprom->noiselvl5gua[0], 0);
424+ nvram_read_u8(prefix, NULL, "noiselvl5gua1",
425+ &sprom->noiselvl5gua[1], 0);
426+ nvram_read_u8(prefix, NULL, "noiselvl5gua2",
427+ &sprom->noiselvl5gua[2], 0);
428+ nvram_read_u8(prefix, NULL, "pcieingress_war",
429+ &sprom->pcieingress_war, 0);
430+}
431+
432+static void bcm47xx_fill_sprom_r9(struct ssb_sprom *sprom, const char *prefix)
433+{
434+ nvram_read_u16(prefix, NULL, "cckbw202gpo", &sprom->cckbw202gpo, 0);
435+ nvram_read_u16(prefix, NULL, "cckbw20ul2gpo", &sprom->cckbw20ul2gpo, 0);
436+ nvram_read_u32(prefix, NULL, "legofdmbw202gpo",
437+ &sprom->legofdmbw202gpo, 0);
438+ nvram_read_u32(prefix, NULL, "legofdmbw20ul2gpo",
439+ &sprom->legofdmbw20ul2gpo, 0);
440+ nvram_read_u32(prefix, NULL, "legofdmbw205glpo",
441+ &sprom->legofdmbw205glpo, 0);
442+ nvram_read_u32(prefix, NULL, "legofdmbw20ul5glpo",
443+ &sprom->legofdmbw20ul5glpo, 0);
444+ nvram_read_u32(prefix, NULL, "legofdmbw205gmpo",
445+ &sprom->legofdmbw205gmpo, 0);
446+ nvram_read_u32(prefix, NULL, "legofdmbw20ul5gmpo",
447+ &sprom->legofdmbw20ul5gmpo, 0);
448+ nvram_read_u32(prefix, NULL, "legofdmbw205ghpo",
449+ &sprom->legofdmbw205ghpo, 0);
450+ nvram_read_u32(prefix, NULL, "legofdmbw20ul5ghpo",
451+ &sprom->legofdmbw20ul5ghpo, 0);
452+ nvram_read_u32(prefix, NULL, "mcsbw202gpo", &sprom->mcsbw202gpo, 0);
453+ nvram_read_u32(prefix, NULL, "mcsbw20ul2gpo", &sprom->mcsbw20ul2gpo, 0);
454+ nvram_read_u32(prefix, NULL, "mcsbw402gpo", &sprom->mcsbw402gpo, 0);
455+ nvram_read_u32(prefix, NULL, "mcsbw205glpo", &sprom->mcsbw205glpo, 0);
456+ nvram_read_u32(prefix, NULL, "mcsbw20ul5glpo",
457+ &sprom->mcsbw20ul5glpo, 0);
458+ nvram_read_u32(prefix, NULL, "mcsbw405glpo", &sprom->mcsbw405glpo, 0);
459+ nvram_read_u32(prefix, NULL, "mcsbw205gmpo", &sprom->mcsbw205gmpo, 0);
460+ nvram_read_u32(prefix, NULL, "mcsbw20ul5gmpo",
461+ &sprom->mcsbw20ul5gmpo, 0);
462+ nvram_read_u32(prefix, NULL, "mcsbw405gmpo", &sprom->mcsbw405gmpo, 0);
463+ nvram_read_u32(prefix, NULL, "mcsbw205ghpo", &sprom->mcsbw205ghpo, 0);
464+ nvram_read_u32(prefix, NULL, "mcsbw20ul5ghpo",
465+ &sprom->mcsbw20ul5ghpo, 0);
466+ nvram_read_u32(prefix, NULL, "mcsbw405ghpo", &sprom->mcsbw405ghpo, 0);
467+ nvram_read_u16(prefix, NULL, "mcs32po", &sprom->mcs32po, 0);
468+ nvram_read_u16(prefix, NULL, "legofdm40duppo",
469+ &sprom->legofdm40duppo, 0);
470+ nvram_read_u8(prefix, NULL, "sar2g", &sprom->sar2g, 0);
471+ nvram_read_u8(prefix, NULL, "sar5g", &sprom->sar5g, 0);
472+}
473+
474+static void bcm47xx_fill_sprom_path_r4589(struct ssb_sprom *sprom,
475+ const char *prefix)
476+{
477+ char postfix[2];
478+ int i;
479+
480+ for (i = 0; i < ARRAY_SIZE(sprom->core_pwr_info); i++) {
481+ struct ssb_sprom_core_pwr_info *pwr_info = &sprom->core_pwr_info[i];
482+ snprintf(postfix, sizeof(postfix), "%i", i);
483+ nvram_read_u8(prefix, postfix, "maxp2ga",
484+ &pwr_info->maxpwr_2g, 0);
485+ nvram_read_u8(prefix, postfix, "itt2ga",
486+ &pwr_info->itssi_2g, 0);
487+ nvram_read_u8(prefix, postfix, "itt5ga",
488+ &pwr_info->itssi_5g, 0);
489+ nvram_read_u16(prefix, postfix, "pa2gw0a",
490+ &pwr_info->pa_2g[0], 0);
491+ nvram_read_u16(prefix, postfix, "pa2gw1a",
492+ &pwr_info->pa_2g[1], 0);
493+ nvram_read_u16(prefix, postfix, "pa2gw2a",
494+ &pwr_info->pa_2g[2], 0);
495+ nvram_read_u8(prefix, postfix, "maxp5ga",
496+ &pwr_info->maxpwr_5g, 0);
497+ nvram_read_u8(prefix, postfix, "maxp5gha",
498+ &pwr_info->maxpwr_5gh, 0);
499+ nvram_read_u8(prefix, postfix, "maxp5gla",
500+ &pwr_info->maxpwr_5gl, 0);
501+ nvram_read_u16(prefix, postfix, "pa5gw0a",
502+ &pwr_info->pa_5g[0], 0);
503+ nvram_read_u16(prefix, postfix, "pa5gw1a",
504+ &pwr_info->pa_5g[1], 0);
505+ nvram_read_u16(prefix, postfix, "pa5gw2a",
506+ &pwr_info->pa_5g[2], 0);
507+ nvram_read_u16(prefix, postfix, "pa5glw0a",
508+ &pwr_info->pa_5gl[0], 0);
509+ nvram_read_u16(prefix, postfix, "pa5glw1a",
510+ &pwr_info->pa_5gl[1], 0);
511+ nvram_read_u16(prefix, postfix, "pa5glw2a",
512+ &pwr_info->pa_5gl[2], 0);
513+ nvram_read_u16(prefix, postfix, "pa5ghw0a",
514+ &pwr_info->pa_5gh[0], 0);
515+ nvram_read_u16(prefix, postfix, "pa5ghw1a",
516+ &pwr_info->pa_5gh[1], 0);
517+ nvram_read_u16(prefix, postfix, "pa5ghw2a",
518+ &pwr_info->pa_5gh[2], 0);
519+ }
520+}
521+
522+static void bcm47xx_fill_sprom_path_r45(struct ssb_sprom *sprom,
523+ const char *prefix)
524+{
525+ char postfix[2];
526+ int i;
527+
528+ for (i = 0; i < ARRAY_SIZE(sprom->core_pwr_info); i++) {
529+ struct ssb_sprom_core_pwr_info *pwr_info = &sprom->core_pwr_info[i];
530+ snprintf(postfix, sizeof(postfix), "%i", i);
531+ nvram_read_u16(prefix, postfix, "pa2gw3a",
532+ &pwr_info->pa_2g[3], 0);
533+ nvram_read_u16(prefix, postfix, "pa5gw3a",
534+ &pwr_info->pa_5g[3], 0);
535+ nvram_read_u16(prefix, postfix, "pa5glw3a",
536+ &pwr_info->pa_5gl[3], 0);
537+ nvram_read_u16(prefix, postfix, "pa5ghw3a",
538+ &pwr_info->pa_5gh[3], 0);
539+ }
540+}
541+
542+void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix)
543+{
544+ nvram_read_macaddr(prefix, "et0macaddr", &sprom->et0mac);
545+ nvram_read_u8(prefix, NULL, "et0mdcport", &sprom->et0mdcport, 0);
546+ nvram_read_u8(prefix, NULL, "et0phyaddr", &sprom->et0phyaddr, 0);
547+
548+ nvram_read_macaddr(prefix, "et1macaddr", &sprom->et1mac);
549+ nvram_read_u8(prefix, NULL, "et1mdcport", &sprom->et1mdcport, 0);
550+ nvram_read_u8(prefix, NULL, "et1phyaddr", &sprom->et1phyaddr, 0);
551+
552+ nvram_read_macaddr(prefix, "macaddr", &sprom->il0mac);
553+ nvram_read_macaddr(prefix, "il0macaddr", &sprom->il0mac);
554+}
555+
556+void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
557+{
558+ memset(sprom, 0, sizeof(struct ssb_sprom));
559+
560+ bcm47xx_fill_sprom_ethernet(sprom, prefix);
561+
562+ nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0);
563+
564+ switch (sprom->revision) {
565+ case 1:
566+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
567+ bcm47xx_fill_sprom_r12389(sprom, prefix);
568+ bcm47xx_fill_sprom_r1(sprom, prefix);
569+ break;
570+ case 2:
571+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
572+ bcm47xx_fill_sprom_r12389(sprom, prefix);
573+ bcm47xx_fill_sprom_r2389(sprom, prefix);
574+ bcm47xx_fill_sprom_r2(sprom, prefix);
575+ break;
576+ case 3:
577+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
578+ bcm47xx_fill_sprom_r12389(sprom, prefix);
579+ bcm47xx_fill_sprom_r2389(sprom, prefix);
580+ bcm47xx_fill_sprom_r389(sprom, prefix);
581+ bcm47xx_fill_sprom_r3(sprom, prefix);
582+ break;
583+ case 4:
584+ case 5:
585+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
586+ bcm47xx_fill_sprom_r4589(sprom, prefix);
587+ bcm47xx_fill_sprom_r458(sprom, prefix);
588+ bcm47xx_fill_sprom_r45(sprom, prefix);
589+ bcm47xx_fill_sprom_path_r4589(sprom, prefix);
590+ bcm47xx_fill_sprom_path_r45(sprom, prefix);
591+ break;
592+ case 8:
593+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
594+ bcm47xx_fill_sprom_r12389(sprom, prefix);
595+ bcm47xx_fill_sprom_r2389(sprom, prefix);
596+ bcm47xx_fill_sprom_r389(sprom, prefix);
597+ bcm47xx_fill_sprom_r4589(sprom, prefix);
598+ bcm47xx_fill_sprom_r458(sprom, prefix);
599+ bcm47xx_fill_sprom_r89(sprom, prefix);
600+ bcm47xx_fill_sprom_path_r4589(sprom, prefix);
601+ break;
602+ case 9:
603+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
604+ bcm47xx_fill_sprom_r12389(sprom, prefix);
605+ bcm47xx_fill_sprom_r2389(sprom, prefix);
606+ bcm47xx_fill_sprom_r389(sprom, prefix);
607+ bcm47xx_fill_sprom_r4589(sprom, prefix);
608+ bcm47xx_fill_sprom_r89(sprom, prefix);
609+ bcm47xx_fill_sprom_r9(sprom, prefix);
610+ bcm47xx_fill_sprom_path_r4589(sprom, prefix);
611+ break;
612+ default:
613+ pr_warn("Unsupported SPROM revision %d detected. Will extract"
614+ " v1\n", sprom->revision);
615+ sprom->revision = 1;
616+ bcm47xx_fill_sprom_r1234589(sprom, prefix);
617+ bcm47xx_fill_sprom_r12389(sprom, prefix);
618+ bcm47xx_fill_sprom_r1(sprom, prefix);
619+ }
620+}
arch/mips/include/asm/mach-bcm47xx/bcm47xx.h+3−0
@@ -44,4 +44,7 @@ union bcm47xx_bus { · 43 unmodified lines
4444 extern union bcm47xx_bus bcm47xx_bus;
4545 extern enum bcm47xx_bus_type bcm47xx_bus_type;
4646
47+void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix);
48+void bcm47xx_fill_sprom_ethernet(struct ssb_sprom *sprom, const char *prefix);
49+
4750 #endif /* __ASM_BCM47XX_H */
arch/mips/include/asm/mach-bcm47xx/nvram.h+1−1
@@ -37,7 +37,7 @@ struct nvram_header { · 36 unmodified lines
3737
3838 extern int nvram_getenv(char *name, char *val, size_t val_len);
3939
40−static inline void nvram_parse_macaddr(char *buf, u8 *macaddr)
40+static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6])
4141 {
4242 if (strchr(buf, ':'))
4343 sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &macaddr[0],
arch/mips/include/asm/socket.h+4−0
@@ -84,6 +84,10 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ · 83 unmodified lines
8484
8585 #define SO_WIFI_STATUS 41
8686 #define SCM_WIFI_STATUS SO_WIFI_STATUS
87+#define SO_PEEK_OFF 42
88+
89+/* Instruct lower device to use last 4-bytes of skb data as FCS */
90+#define SO_NOFCS 43
8791
8892 #ifdef __KERNEL__
8993
arch/mips/pci/pci-bcm47xx.c+44−5
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/types.h>
2626 #include <linux/pci.h>
2727 #include <linux/ssb/ssb.h>
28+#include <linux/bcma/bcma.h>
2829 #include <bcm47xx.h>
2930
3031 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
@@ -32,15 +33,12 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) · 1 unmodified line
3233 return 0;
3334 }
3435
35−int pcibios_plat_dev_init(struct pci_dev *dev)
36−{
3736 #ifdef CONFIG_BCM47XX_SSB
37+static int bcm47xx_pcibios_plat_dev_init_ssb(struct pci_dev *dev)
38+{
3839 int res;
3940 u8 slot, pin;
4041
41− if (bcm47xx_bus_type != BCM47XX_BUS_TYPE_SSB)
42− return 0;
43−
4442 res = ssb_pcibios_plat_dev_init(dev);
4543 if (res < 0) {
4644 printk(KERN_ALERT "PCI: Failed to init device %s\n",
@@ -60,6 +58,47 @@ int pcibios_plat_dev_init(struct pci_dev *dev) · 13 unmodified lines
6058 }
6159
6260 dev->irq = res;
61+ return 0;
62+}
6363 #endif
64+
65+#ifdef CONFIG_BCM47XX_BCMA
66+static int bcm47xx_pcibios_plat_dev_init_bcma(struct pci_dev *dev)
67+{
68+ int res;
69+
70+ res = bcma_core_pci_plat_dev_init(dev);
71+ if (res < 0) {
72+ printk(KERN_ALERT "PCI: Failed to init device %s\n",
73+ pci_name(dev));
74+ return res;
75+ }
76+
77+ res = bcma_core_pci_pcibios_map_irq(dev);
78+
79+ /* IRQ-0 and IRQ-1 are software interrupts. */
80+ if (res < 2) {
81+ printk(KERN_ALERT "PCI: Failed to map IRQ of device %s\n",
82+ pci_name(dev));
83+ return res;
84+ }
85+
86+ dev->irq = res;
6487 return 0;
6588 }
89+#endif
90+
91+int pcibios_plat_dev_init(struct pci_dev *dev)
92+{
93+#ifdef CONFIG_BCM47XX_SSB
94+ if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_SSB)
95+ return bcm47xx_pcibios_plat_dev_init_ssb(dev);
96+ else
97+#endif
98+#ifdef CONFIG_BCM47XX_BCMA
99+ if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA)
100+ return bcm47xx_pcibios_plat_dev_init_bcma(dev);
101+ else
102+#endif
103+ return 0;
104+}
arch/mn10300/include/asm/socket.h+4−0
@@ -64,5 +64,9 @@ · 63 unmodified lines
6464
6565 #define SO_WIFI_STATUS 41
6666 #define SCM_WIFI_STATUS SO_WIFI_STATUS
67+#define SO_PEEK_OFF 42
68+
69+/* Instruct lower device to use last 4-bytes of skb data as FCS */
70+#define SO_NOFCS 43
6771
6872 #endif /* _ASM_SOCKET_H */
arch/parisc/include/asm/socket.h+5−0
@@ -63,6 +63,11 @@ · 62 unmodified lines
6363
6464 #define SO_WIFI_STATUS 0x4022
6565 #define SCM_WIFI_STATUS SO_WIFI_STATUS
66+#define SO_PEEK_OFF 0x4023
67+
68+/* Instruct lower device to use last 4-bytes of skb data as FCS */
69+#define SO_NOFCS 0x4024
70+
6671
6772 /* O_NONBLOCK clashes with the bits used for socket types. Therefore we
6873 * have to define SOCK_NONBLOCK to a different value here.
arch/powerpc/boot/dts/bluestone.dts+1−1
@@ -222,7 +222,7 @@ · 221 unmodified lines
222222
223223 EMAC0: ethernet@ef600c00 {
224224 device_type = "network";
225− compatible = "ibm,emac4sync";
225+ compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
226226 interrupt-parent = <&EMAC0>;
227227 interrupts = <0x0 0x1>;
228228 #interrupt-cells = <1>;
arch/powerpc/include/asm/socket.h+4−0
@@ -71,5 +71,9 @@ · 70 unmodified lines
7171
7272 #define SO_WIFI_STATUS 41
7373 #define SCM_WIFI_STATUS SO_WIFI_STATUS
74+#define SO_PEEK_OFF 42
75+
76+/* Instruct lower device to use last 4-bytes of skb data as FCS */
77+#define SO_NOFCS 43
7478
7579 #endif /* _ASM_POWERPC_SOCKET_H */
arch/s390/include/asm/qeth.h+7−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #define SIOC_QETH_ARP_FLUSH_CACHE (SIOCDEVPRIVATE + 4)
2121 #define SIOC_QETH_ADP_SET_SNMP_CONTROL (SIOCDEVPRIVATE + 5)
2222 #define SIOC_QETH_GET_CARD_TYPE (SIOCDEVPRIVATE + 6)
23+#define SIOC_QETH_QUERY_OAT (SIOCDEVPRIVATE + 7)
2324
2425 struct qeth_arp_cache_entry {
2526 __u8 macaddr[6];
@@ -107,4 +108,10 @@ struct qeth_arp_query_user_data { · 81 unmodified lines
107108 char *entries;
108109 } __attribute__((packed));
109110
111+struct qeth_query_oat_data {
112+ __u32 command;
113+ __u32 buffer_len;
114+ __u32 response_len;
115+ __u64 ptr;
116+};
110117 #endif /* __ASM_S390_QETH_IOCTL_H__ */
arch/s390/include/asm/socket.h+4−0
@@ -72,5 +72,9 @@ · 71 unmodified lines
7272
7373 #define SO_WIFI_STATUS 41
7474 #define SCM_WIFI_STATUS SO_WIFI_STATUS
75+#define SO_PEEK_OFF 42
76+
77+/* Instruct lower device to use last 4-bytes of skb data as FCS */
78+#define SO_NOFCS 43
7579
7680 #endif /* _ASM_SOCKET_H */
arch/sparc/include/asm/socket.h+5−0
@@ -60,6 +60,11 @@ · 59 unmodified lines
6060
6161 #define SO_WIFI_STATUS 0x0025
6262 #define SCM_WIFI_STATUS SO_WIFI_STATUS
63+#define SO_PEEK_OFF 0x0026
64+
65+/* Instruct lower device to use last 4-bytes of skb data as FCS */
66+#define SO_NOFCS 0x0027
67+
6368
6469 /* Security levels - as per NRL IPv6 - don't actually do anything */
6570 #define SO_SECURITY_AUTHENTICATION 0x5001
arch/um/drivers/net_kern.c+8−3
@@ -293,7 +293,7 @@ static void uml_net_user_timer_expire(unsigned long _conn) · 292 unmodified lines
293293 #endif
294294 }
295295
296−static void setup_etheraddr(char *str, unsigned char *addr, char *name)
296+static int setup_etheraddr(char *str, unsigned char *addr, char *name)
297297 {
298298 char *end;
299299 int i;
@@ -334,12 +334,13 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name) · 34 unmodified lines
334334 addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
335335 addr[5]);
336336 }
337− return;
337+ return 0;
338338
339339 random:
340340 printk(KERN_INFO
341341 "Choosing a random ethernet address for device %s\n", name);
342342 random_ether_addr(addr);
343+ return 1;
343344 }
344345
345346 static DEFINE_SPINLOCK(devices_lock);
@@ -391,6 +392,7 @@ static void eth_configure(int n, void *init, char *mac, · 45 unmodified lines
391392 struct net_device *dev;
392393 struct uml_net_private *lp;
393394 int err, size;
395+ int random_mac;
394396
395397 size = transport->private_size + sizeof(struct uml_net_private);
396398
@@ -417,7 +419,7 @@ static void eth_configure(int n, void *init, char *mac, · 20 unmodified lines
417419 */
418420 snprintf(dev->name, sizeof(dev->name), "eth%d", n);
419421
420− setup_etheraddr(mac, device->mac, dev->name);
422+ random_mac = setup_etheraddr(mac, device->mac, dev->name);
421423
422424 printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);
423425
@@ -474,6 +476,9 @@ static void eth_configure(int n, void *init, char *mac, · 50 unmodified lines
474476
475477 /* don't use eth_mac_addr, it will not work here */
476478 memcpy(dev->dev_addr, device->mac, ETH_ALEN);
479+ if (random_mac)
480+ dev->addr_assign_type |= NET_ADDR_RANDOM;
481+
477482 dev->mtu = transport->user->mtu;
478483 dev->netdev_ops = &uml_netdev_ops;
479484 dev->ethtool_ops = &uml_net_ethtool_ops;
arch/x86/net/bpf_jit_comp.c+5−9
@@ -475,8 +475,10 @@ void bpf_jit_compile(struct sk_filter *fp) · 474 unmodified lines
475475 case BPF_S_LD_W_ABS:
476476 func = sk_load_word;
477477 common_load: seen |= SEEN_DATAREF;
478− if ((int)K < 0)
478+ if ((int)K < 0) {
479+ /* Abort the JIT because __load_pointer() is needed. */
479480 goto out;
481+ }
480482 t_offset = func - (image + addrs[i]);
481483 EMIT1_off32(0xbe, K); /* mov imm32,%esi */
482484 EMIT1_off32(0xe8, t_offset); /* call */
@@ -489,14 +491,8 @@ common_load: seen |= SEEN_DATAREF; · 6 unmodified lines
489491 goto common_load;
490492 case BPF_S_LDX_B_MSH:
491493 if ((int)K < 0) {
492− if (pc_ret0 > 0) {
493− /* addrs[pc_ret0 - 1] is the start address */
494− EMIT_JMP(addrs[pc_ret0 - 1] - addrs[i]);
495− break;
496− }
497− CLEAR_A();
498− EMIT_JMP(cleanup_addr - addrs[i]);
499− break;
494+ /* Abort the JIT because __load_pointer() is needed. */
495+ goto out;
500496 }
501497 seen |= SEEN_DATAREF | SEEN_XREG;
502498 t_offset = sk_load_byte_msh - (image + addrs[i]);
arch/xtensa/include/asm/socket.h+4−0
@@ -75,5 +75,9 @@ · 74 unmodified lines
7575
7676 #define SO_WIFI_STATUS 41
7777 #define SCM_WIFI_STATUS SO_WIFI_STATUS
78+#define SO_PEEK_OFF 42
79+
80+/* Instruct lower device to use last 4-bytes of skb data as FCS */
81+#define SO_NOFCS 43
7882
7983 #endif /* _XTENSA_SOCKET_H */
crypto/crypto_user.c+7−3
@@ -389,9 +389,13 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) · 388 unmodified lines
389389 (nlh->nlmsg_flags & NLM_F_DUMP))) {
390390 if (link->dump == NULL)
391391 return -EINVAL;
392−
393− return netlink_dump_start(crypto_nlsk, skb, nlh,
394− link->dump, link->done, 0);
392+ {
393+ struct netlink_dump_control c = {
394+ .dump = link->dump,
395+ .done = link->done,
396+ };
397+ return netlink_dump_start(crypto_nlsk, skb, nlh, &c);
398+ }
395399 }
396400
397401 err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,
drivers/atm/eni.c+64−36
@@ -156,9 +156,6 @@ static int tx_complete = 0,dma_complete = 0,queued = 0,requeued = 0, · 155 unmodified lines
156156
157157 static struct atm_dev *eni_boards = NULL;
158158
159−static u32 *cpu_zeroes = NULL; /* aligned "magic" zeroes */
160−static dma_addr_t zeroes;
161−
162159 /* Read/write registers on card */
163160 #define eni_in(r) readl(eni_dev->reg+(r)*4)
164161 #define eni_out(v,r) writel((v),eni_dev->reg+(r)*4)
@@ -1138,8 +1135,10 @@ DPRINTK("doing direct send\n"); /* @@@ well, this doesn't work anyway */ · 973 unmodified lines
11381135 skb_shinfo(skb)->frags[i].page_offset,
11391136 skb_frag_size(&skb_shinfo(skb)->frags[i]));
11401137 }
1141− if (skb->len & 3)
1142− put_dma(tx->index,eni_dev->dma,&j,zeroes,4-(skb->len & 3));
1138+ if (skb->len & 3) {
1139+ put_dma(tx->index, eni_dev->dma, &j, eni_dev->zero.dma,
1140+ 4 - (skb->len & 3));
1141+ }
11431142 /* JK for AAL5 trailer - AAL0 doesn't need it, but who cares ... */
11441143 eni_dev->dma[j++] = (((tx->tx_pos+size) & (tx->words-1)) <<
11451144 MID_DMA_COUNT_SHIFT) | (tx->index << MID_DMA_CHAN_SHIFT) |
@@ -1728,6 +1727,7 @@ static int __devinit eni_do_init(struct atm_dev *dev) · 582 unmodified lines
17281727 "mapping\n",dev->number);
17291728 return error;
17301729 }
1730+ eni_dev->ioaddr = base;
17311731 eni_dev->base_diff = real_base - (unsigned long) base;
17321732 /* id may not be present in ASIC Tonga boards - check this @@@ */
17331733 if (!eni_dev->asic) {
@@ -1789,6 +1789,14 @@ unmap: · 55 unmodified lines
17891789 goto out;
17901790 }
17911791
1792+static void eni_do_release(struct atm_dev *dev)
1793+{
1794+ struct eni_dev *ed = ENI_DEV(dev);
1795+
1796+ dev->phy->stop(dev);
1797+ dev->phy = NULL;
1798+ iounmap(ed->ioaddr);
1799+}
17921800
17931801 static int __devinit eni_start(struct atm_dev *dev)
17941802 {
@@ -1873,7 +1881,7 @@ free_list: · 78 unmodified lines
18731881 kfree(eni_dev->free_list);
18741882
18751883 free_irq:
1876− free_irq(eni_dev->irq, eni_dev);
1884+ free_irq(eni_dev->irq, dev);
18771885
18781886 out:
18791887 return error;
@@ -2220,48 +2228,60 @@ static const struct atmdev_ops ops = { · 340 unmodified lines
22202228
22212229
22222230 static int __devinit eni_init_one(struct pci_dev *pci_dev,
2223− const struct pci_device_id *ent)
2231+ const struct pci_device_id *ent)
22242232 {
22252233 struct atm_dev *dev;
22262234 struct eni_dev *eni_dev;
2227− int error = -ENOMEM;
2235+ struct eni_zero *zero;
2236+ int rc;
2237+
2238+ rc = pci_enable_device(pci_dev);
2239+ if (rc < 0)
2240+ goto out;
22282241
2229− DPRINTK("eni_init_one\n");
2242+ rc = -ENOMEM;
2243+ eni_dev = kmalloc(sizeof(struct eni_dev), GFP_KERNEL);
2244+ if (!eni_dev)
2245+ goto err_disable;
22302246
2231− if (pci_enable_device(pci_dev)) {
2232− error = -EIO;
2233− goto out0;
2234− }
2247+ zero = &eni_dev->zero;
2248+ zero->addr = pci_alloc_consistent(pci_dev, ENI_ZEROES_SIZE, &zero->dma);
2249+ if (!zero->addr)
2250+ goto err_kfree;
22352251
2236− eni_dev = kmalloc(sizeof(struct eni_dev),GFP_KERNEL);
2237− if (!eni_dev) goto out0;
2238− if (!cpu_zeroes) {
2239− cpu_zeroes = pci_alloc_consistent(pci_dev,ENI_ZEROES_SIZE,
2240− &zeroes);
2241− if (!cpu_zeroes) goto out1;
2242− }
22432252 dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL);
2244− if (!dev) goto out2;
2253+ if (!dev)
2254+ goto err_free_consistent;
2255+
2256+ dev->dev_data = eni_dev;
22452257 pci_set_drvdata(pci_dev, dev);
22462258 eni_dev->pci_dev = pci_dev;
2247− dev->dev_data = eni_dev;
22482259 eni_dev->asic = ent->driver_data;
2249− error = eni_do_init(dev);
2250− if (error) goto out3;
2251− error = eni_start(dev);
2252− if (error) goto out3;
2260+
2261+ rc = eni_do_init(dev);
2262+ if (rc < 0)
2263+ goto err_unregister;
2264+
2265+ rc = eni_start(dev);
2266+ if (rc < 0)
2267+ goto err_eni_release;
2268+
22532269 eni_dev->more = eni_boards;
22542270 eni_boards = dev;
2255− return 0;
2256−out3:
2271+out:
2272+ return rc;
2273+
2274+err_eni_release:
2275+ eni_do_release(dev);
2276+err_unregister:
22572277 atm_dev_deregister(dev);
2258−out2:
2259− pci_free_consistent(eni_dev->pci_dev,ENI_ZEROES_SIZE,cpu_zeroes,zeroes);
2260− cpu_zeroes = NULL;
2261−out1:
2278+err_free_consistent:
2279+ pci_free_consistent(pci_dev, ENI_ZEROES_SIZE, zero->addr, zero->dma);
2280+err_kfree:
22622281 kfree(eni_dev);
2263−out0:
2264− return error;
2282+err_disable:
2283+ pci_disable_device(pci_dev);
2284+ goto out;
22652285 }
22662286
22672287
@@ -2273,9 +2293,17 @@ static struct pci_device_id eni_pci_tbl[] = { · 5 unmodified lines
22732293 MODULE_DEVICE_TABLE(pci,eni_pci_tbl);
22742294
22752295
2276−static void __devexit eni_remove_one(struct pci_dev *pci_dev)
2296+static void __devexit eni_remove_one(struct pci_dev *pdev)
22772297 {
2278− /* grrr */
2298+ struct atm_dev *dev = pci_get_drvdata(pdev);
2299+ struct eni_dev *ed = ENI_DEV(dev);
2300+ struct eni_zero *zero = &ed->zero;
2301+
2302+ eni_do_release(dev);
2303+ atm_dev_deregister(dev);
2304+ pci_free_consistent(pdev, ENI_ZEROES_SIZE, zero->addr, zero->dma);
2305+ kfree(ed);
2306+ pci_disable_device(pdev);
22792307 }
22802308
22812309
drivers/atm/eni.h+5−0
@@ -72,6 +72,7 @@ struct eni_dev { · 71 unmodified lines
7272 u32 events; /* pending events */
7373 /*-------------------------------- base pointers into Midway address
7474 space */
75+ void __iomem *ioaddr;
7576 void __iomem *phy; /* PHY interface chip registers */
7677 void __iomem *reg; /* register base */
7778 void __iomem *ram; /* RAM base */
@@ -86,6 +87,10 @@ struct eni_dev { · 8 unmodified lines
8687 wait_queue_head_t tx_wait; /* for close */
8788 int tx_bw; /* remaining bandwidth */
8889 u32 dma[TX_DMA_BUF*2]; /* DMA request scratch area */
90+ struct eni_zero { /* aligned "magic" zeroes */
91+ u32 *addr;
92+ dma_addr_t dma;
93+ } zero;
8994 int tx_mult; /* buffer size multiplier (percent) */
9095 /*-------------------------------- RX part */
9196 u32 serv_read; /* host service read index */
drivers/atm/lanai.c+1−1
@@ -1572,7 +1572,7 @@ static inline void host_vcc_unbind(struct lanai_dev *lanai, · 1571 unmodified lines
15721572
15731573 static void lanai_reset(struct lanai_dev *lanai)
15741574 {
1575− printk(KERN_CRIT DEV_LABEL "(itf %d): *NOT* reseting - not "
1575+ printk(KERN_CRIT DEV_LABEL "(itf %d): *NOT* resetting - not "
15761576 "implemented\n", lanai->number);
15771577 /* TODO */
15781578 /* The following is just a hack until we write the real
drivers/bcma/bcma_private.h+6−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 struct bcma_bus;
1414
1515 /* main.c */
16−int bcma_bus_register(struct bcma_bus *bus);
16+int __devinit bcma_bus_register(struct bcma_bus *bus);
1717 void bcma_bus_unregister(struct bcma_bus *bus);
1818 int __init bcma_bus_early_register(struct bcma_bus *bus,
1919 struct bcma_device *core_cc,
@@ -48,8 +48,12 @@ extern int __init bcma_host_pci_init(void); · 28 unmodified lines
4848 extern void __exit bcma_host_pci_exit(void);
4949 #endif /* CONFIG_BCMA_HOST_PCI */
5050
51+/* driver_pci.c */
52+u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
53+
5154 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
52−void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
55+bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
56+void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
5357 #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
5458
5559 #endif
drivers/bcma/driver_chipcommon_pmu.c+1−0
@@ -80,6 +80,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc) · 79 unmodified lines
8080 min_msk = 0x200D;
8181 max_msk = 0xFFFF;
8282 break;
83+ case 0x4331:
8384 case 43224:
8485 case 43225:
8586 break;
drivers/bcma/driver_pci.c+78−90
@@ -2,8 +2,9 @@ · 1 unmodified line
22 * Broadcom specific AMBA
33 * PCI Core
44 *
5− * Copyright 2005, Broadcom Corporation
5+ * Copyright 2005, 2011, Broadcom Corporation
66 * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7+ * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
78 *
89 * Licensed under the GNU/GPL. See COPYING for details.
910 */
@@ -16,40 +17,41 @@ · 6 unmodified lines
1617 * R/W ops.
1718 **************************************************/
1819
19−static u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
20+u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address)
2021 {
21− pcicore_write32(pc, 0x130, address);
22− pcicore_read32(pc, 0x130);
23− return pcicore_read32(pc, 0x134);
22+ pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
23+ pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
24+ return pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_DATA);
2425 }
2526
2627 #if 0
2728 static void bcma_pcie_write(struct bcma_drv_pci *pc, u32 address, u32 data)
2829 {
29− pcicore_write32(pc, 0x130, address);
30− pcicore_read32(pc, 0x130);
31− pcicore_write32(pc, 0x134, data);
30+ pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_ADDR, address);
31+ pcicore_read32(pc, BCMA_CORE_PCI_PCIEIND_ADDR);
32+ pcicore_write32(pc, BCMA_CORE_PCI_PCIEIND_DATA, data);
3233 }
3334 #endif
3435
3536 static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
3637 {
37− const u16 mdio_control = 0x128;
38− const u16 mdio_data = 0x12C;
3938 u32 v;
4039 int i;
4140
42− v = (1 << 30); /* Start of Transaction */
43− v |= (1 << 28); /* Write Transaction */
44− v |= (1 << 17); /* Turnaround */
45− v |= (0x1F << 18);
41+ v = BCMA_CORE_PCI_MDIODATA_START;
42+ v |= BCMA_CORE_PCI_MDIODATA_WRITE;
43+ v |= (BCMA_CORE_PCI_MDIODATA_DEV_ADDR <<
44+ BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF);
45+ v |= (BCMA_CORE_PCI_MDIODATA_BLK_ADDR <<
46+ BCMA_CORE_PCI_MDIODATA_REGADDR_SHF);
47+ v |= BCMA_CORE_PCI_MDIODATA_TA;
4648 v |= (phy << 4);
47− pcicore_write32(pc, mdio_data, v);
49+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v);
4850
4951 udelay(10);
5052 for (i = 0; i < 200; i++) {
51− v = pcicore_read32(pc, mdio_control);
52− if (v & 0x100 /* Trans complete */)
53+ v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL);
54+ if (v & BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE)
5355 break;
5456 msleep(1);
5557 }
@@ -57,79 +59,84 @@ static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy) · 1 unmodified line
5759
5860 static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
5961 {
60− const u16 mdio_control = 0x128;
61− const u16 mdio_data = 0x12C;
6262 int max_retries = 10;
6363 u16 ret = 0;
6464 u32 v;
6565 int i;
6666
67− v = 0x80; /* Enable Preamble Sequence */
68− v |= 0x2; /* MDIO Clock Divisor */
69− pcicore_write32(pc, mdio_control, v);
67+ /* enable mdio access to SERDES */
68+ v = BCMA_CORE_PCI_MDIOCTL_PREAM_EN;
69+ v |= BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL;
70+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, v);
7071
7172 if (pc->core->id.rev >= 10) {
7273 max_retries = 200;
7374 bcma_pcie_mdio_set_phy(pc, device);
75+ v = (BCMA_CORE_PCI_MDIODATA_DEV_ADDR <<
76+ BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF);
77+ v |= (address << BCMA_CORE_PCI_MDIODATA_REGADDR_SHF);
78+ } else {
79+ v = (device << BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD);
80+ v |= (address << BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD);
7481 }
7582
76− v = (1 << 30); /* Start of Transaction */
77− v |= (1 << 29); /* Read Transaction */
78− v |= (1 << 17); /* Turnaround */
79− if (pc->core->id.rev < 10)
80− v |= (u32)device << 22;
81− v |= (u32)address << 18;
82− pcicore_write32(pc, mdio_data, v);
83+ v = BCMA_CORE_PCI_MDIODATA_START;
84+ v |= BCMA_CORE_PCI_MDIODATA_READ;
85+ v |= BCMA_CORE_PCI_MDIODATA_TA;
86+
87+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v);
8388 /* Wait for the device to complete the transaction */
8489 udelay(10);
8590 for (i = 0; i < max_retries; i++) {
86− v = pcicore_read32(pc, mdio_control);
87− if (v & 0x100 /* Trans complete */) {
91+ v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL);
92+ if (v & BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE) {
8893 udelay(10);
89− ret = pcicore_read32(pc, mdio_data);
94+ ret = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_DATA);
9095 break;
9196 }
9297 msleep(1);
9398 }
94− pcicore_write32(pc, mdio_control, 0);
99+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0);
95100 return ret;
96101 }
97102
98103 static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device,
99104 u8 address, u16 data)
100105 {
101− const u16 mdio_control = 0x128;
102− const u16 mdio_data = 0x12C;
103106 int max_retries = 10;
104107 u32 v;
105108 int i;
106109
107− v = 0x80; /* Enable Preamble Sequence */
108− v |= 0x2; /* MDIO Clock Divisor */
109− pcicore_write32(pc, mdio_control, v);
110+ /* enable mdio access to SERDES */
111+ v = BCMA_CORE_PCI_MDIOCTL_PREAM_EN;
112+ v |= BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL;
113+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, v);
110114
111115 if (pc->core->id.rev >= 10) {
112116 max_retries = 200;
113117 bcma_pcie_mdio_set_phy(pc, device);
118+ v = (BCMA_CORE_PCI_MDIODATA_DEV_ADDR <<
119+ BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF);
120+ v |= (address << BCMA_CORE_PCI_MDIODATA_REGADDR_SHF);
121+ } else {
122+ v = (device << BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD);
123+ v |= (address << BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD);
114124 }
115125
116− v = (1 << 30); /* Start of Transaction */
117− v |= (1 << 28); /* Write Transaction */
118− v |= (1 << 17); /* Turnaround */
119− if (pc->core->id.rev < 10)
120− v |= (u32)device << 22;
121− v |= (u32)address << 18;
126+ v = BCMA_CORE_PCI_MDIODATA_START;
127+ v |= BCMA_CORE_PCI_MDIODATA_WRITE;
128+ v |= BCMA_CORE_PCI_MDIODATA_TA;
122129 v |= data;
123− pcicore_write32(pc, mdio_data, v);
130+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_DATA, v);
124131 /* Wait for the device to complete the transaction */
125132 udelay(10);
126133 for (i = 0; i < max_retries; i++) {
127− v = pcicore_read32(pc, mdio_control);
128− if (v & 0x100 /* Trans complete */)
134+ v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL);
135+ if (v & BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE)
129136 break;
130137 msleep(1);
131138 }
132− pcicore_write32(pc, mdio_control, 0);
139+ pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0);
133140 }
134141
135142 /**************************************************
@@ -138,72 +145,53 @@ static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device, · 2 unmodified lines
138145
139146 static u8 bcma_pcicore_polarity_workaround(struct bcma_drv_pci *pc)
140147 {
141− return (bcma_pcie_read(pc, 0x204) & 0x10) ? 0xC0 : 0x80;
148+ u32 tmp;
149+
150+ tmp = bcma_pcie_read(pc, BCMA_CORE_PCI_PLP_STATUSREG);
151+ if (tmp & BCMA_CORE_PCI_PLP_POLARITYINV_STAT)
152+ return BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE |
153+ BCMA_CORE_PCI_SERDES_RX_CTRL_POLARITY;
154+ else
155+ return BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE;
142156 }
143157
144158 static void bcma_pcicore_serdes_workaround(struct bcma_drv_pci *pc)
145159 {
146− const u8 serdes_pll_device = 0x1D;
147− const u8 serdes_rx_device = 0x1F;
148160 u16 tmp;
149161
150− bcma_pcie_mdio_write(pc, serdes_rx_device, 1 /* Control */,
151− bcma_pcicore_polarity_workaround(pc));
152− tmp = bcma_pcie_mdio_read(pc, serdes_pll_device, 1 /* Control */);
153− if (tmp & 0x4000)
154− bcma_pcie_mdio_write(pc, serdes_pll_device, 1, tmp & ~0x4000);
162+ bcma_pcie_mdio_write(pc, BCMA_CORE_PCI_MDIODATA_DEV_RX,
163+ BCMA_CORE_PCI_SERDES_RX_CTRL,
164+ bcma_pcicore_polarity_workaround(pc));
165+ tmp = bcma_pcie_mdio_read(pc, BCMA_CORE_PCI_MDIODATA_DEV_PLL,
166+ BCMA_CORE_PCI_SERDES_PLL_CTRL);
167+ if (tmp & BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN)
168+ bcma_pcie_mdio_write(pc, BCMA_CORE_PCI_MDIODATA_DEV_PLL,
169+ BCMA_CORE_PCI_SERDES_PLL_CTRL,
170+ tmp & ~BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN);
155171 }
156172
157173 /**************************************************
158174 * Init.
159175 **************************************************/
160176
161−static void bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
177+static void __devinit bcma_core_pci_clientmode_init(struct bcma_drv_pci *pc)
162178 {
163179 bcma_pcicore_serdes_workaround(pc);
164180 }
165181
166−static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
167−{
168− struct bcma_bus *bus = pc->core->bus;
169− u16 chipid_top;
170−
171− chipid_top = (bus->chipinfo.id & 0xFF00);
172− if (chipid_top != 0x4700 &&
173− chipid_top != 0x5300)
174− return false;
175−
176−#ifdef CONFIG_SSB_DRIVER_PCICORE
177− if (bus->sprom.boardflags_lo & SSB_BFL_NOPCI)
178− return false;
179−#endif /* CONFIG_SSB_DRIVER_PCICORE */
180−
181−#if 0
182− /* TODO: on BCMA we use address from EROM instead of magic formula */
183− u32 tmp;
184− return !mips_busprobe32(tmp, (bus->mmio +
185− (pc->core->core_index * BCMA_CORE_SIZE)));
186−#endif
187−
188− return true;
189−}
190−
191−void bcma_core_pci_init(struct bcma_drv_pci *pc)
182+void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc)
192183 {
193184 if (pc->setup_done)
194185 return;
195186
196− if (bcma_core_pci_is_in_hostmode(pc)) {
197187 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
188+ pc->hostmode = bcma_core_pci_is_in_hostmode(pc);
189+ if (pc->hostmode)
198190 bcma_core_pci_hostmode_init(pc);
199−#else
200− pr_err("Driver compiled without support for hostmode PCI\n");
201191 #endif /* CONFIG_BCMA_DRIVER_PCI_HOSTMODE */
202− } else {
203− bcma_core_pci_clientmode_init(pc);
204− }
205192
206− pc->setup_done = true;
193+ if (!pc->hostmode)
194+ bcma_core_pci_clientmode_init(pc);
207195 }
208196
209197 int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
drivers/bcma/driver_pci_host.c+576−2
@@ -2,13 +2,587 @@ · 1 unmodified line
22 * Broadcom specific AMBA
33 * PCI Core in hostmode
44 *
5+ * Copyright 2005 - 2011, Broadcom Corporation
6+ * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7+ * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
8+ *
59 * Licensed under the GNU/GPL. See COPYING for details.
610 */
711
812 #include "bcma_private.h"
13+#include <linux/export.h>
914 #include <linux/bcma/bcma.h>
15+#include <asm/paccess.h>
16+
17+/* Probe a 32bit value on the bus and catch bus exceptions.
18+ * Returns nonzero on a bus exception.
19+ * This is MIPS specific */
20+#define mips_busprobe32(val, addr) get_dbe((val), ((u32 *)(addr)))
21+
22+/* Assume one-hot slot wiring */
23+#define BCMA_PCI_SLOT_MAX 16
24+#define PCI_CONFIG_SPACE_SIZE 256
25+
26+bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
27+{
28+ struct bcma_bus *bus = pc->core->bus;
29+ u16 chipid_top;
30+ u32 tmp;
31+
32+ chipid_top = (bus->chipinfo.id & 0xFF00);
33+ if (chipid_top != 0x4700 &&
34+ chipid_top != 0x5300)
35+ return false;
36+
37+ if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
38+ pr_info("This PCI core is disabled and not working\n");
39+ return false;
40+ }
41+
42+ bcma_core_enable(pc->core, 0);
43+
44+ return !mips_busprobe32(tmp, pc->core->io_addr);
45+}
46+
47+static u32 bcma_pcie_read_config(struct bcma_drv_pci *pc, u32 address)
48+{
49+ pcicore_write32(pc, BCMA_CORE_PCI_CONFIG_ADDR, address);
50+ pcicore_read32(pc, BCMA_CORE_PCI_CONFIG_ADDR);
51+ return pcicore_read32(pc, BCMA_CORE_PCI_CONFIG_DATA);
52+}
53+
54+static void bcma_pcie_write_config(struct bcma_drv_pci *pc, u32 address,
55+ u32 data)
56+{
57+ pcicore_write32(pc, BCMA_CORE_PCI_CONFIG_ADDR, address);
58+ pcicore_read32(pc, BCMA_CORE_PCI_CONFIG_ADDR);
59+ pcicore_write32(pc, BCMA_CORE_PCI_CONFIG_DATA, data);
60+}
61+
62+static u32 bcma_get_cfgspace_addr(struct bcma_drv_pci *pc, unsigned int dev,
63+ unsigned int func, unsigned int off)
64+{
65+ u32 addr = 0;
66+
67+ /* Issue config commands only when the data link is up (atleast
68+ * one external pcie device is present).
69+ */
70+ if (dev >= 2 || !(bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_LSREG)
71+ & BCMA_CORE_PCI_DLLP_LSREG_LINKUP))
72+ goto out;
73+
74+ /* Type 0 transaction */
75+ /* Slide the PCI window to the appropriate slot */
76+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI1, BCMA_CORE_PCI_SBTOPCI_CFG0);
77+ /* Calculate the address */
78+ addr = pc->host_controller->host_cfg_addr;
79+ addr |= (dev << BCMA_CORE_PCI_CFG_SLOT_SHIFT);
80+ addr |= (func << BCMA_CORE_PCI_CFG_FUN_SHIFT);
81+ addr |= (off & ~3);
82+
83+out:
84+ return addr;
85+}
1086
11−void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
87+static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
88+ unsigned int func, unsigned int off,
89+ void *buf, int len)
1290 {
13− pr_err("No support for PCI core in hostmode yet\n");
91+ int err = -EINVAL;
92+ u32 addr, val;
93+ void __iomem *mmio = 0;
94+
95+ WARN_ON(!pc->hostmode);
96+ if (unlikely(len != 1 && len != 2 && len != 4))
97+ goto out;
98+ if (dev == 0) {
99+ /* we support only two functions on device 0 */
100+ if (func > 1)
101+ return -EINVAL;
102+
103+ /* accesses to config registers with offsets >= 256
104+ * requires indirect access.
105+ */
106+ if (off >= PCI_CONFIG_SPACE_SIZE) {
107+ addr = (func << 12);
108+ addr |= (off & 0x0FFF);
109+ val = bcma_pcie_read_config(pc, addr);
110+ } else {
111+ addr = BCMA_CORE_PCI_PCICFG0;
112+ addr |= (func << 8);
113+ addr |= (off & 0xfc);
114+ val = pcicore_read32(pc, addr);
115+ }
116+ } else {
117+ addr = bcma_get_cfgspace_addr(pc, dev, func, off);
118+ if (unlikely(!addr))
119+ goto out;
120+ err = -ENOMEM;
121+ mmio = ioremap_nocache(addr, len);
122+ if (!mmio)
123+ goto out;
124+
125+ if (mips_busprobe32(val, mmio)) {
126+ val = 0xffffffff;
127+ goto unmap;
128+ }
129+
130+ val = readl(mmio);
131+ }
132+ val >>= (8 * (off & 3));
133+
134+ switch (len) {
135+ case 1:
136+ *((u8 *)buf) = (u8)val;
137+ break;
138+ case 2:
139+ *((u16 *)buf) = (u16)val;
140+ break;
141+ case 4:
142+ *((u32 *)buf) = (u32)val;
143+ break;
144+ }
145+ err = 0;
146+unmap:
147+ if (mmio)
148+ iounmap(mmio);
149+out:
150+ return err;
151+}
152+
153+static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
154+ unsigned int func, unsigned int off,
155+ const void *buf, int len)
156+{
157+ int err = -EINVAL;
158+ u32 addr = 0, val = 0;
159+ void __iomem *mmio = 0;
160+ u16 chipid = pc->core->bus->chipinfo.id;
161+
162+ WARN_ON(!pc->hostmode);
163+ if (unlikely(len != 1 && len != 2 && len != 4))
164+ goto out;
165+ if (dev == 0) {
166+ /* accesses to config registers with offsets >= 256
167+ * requires indirect access.
168+ */
169+ if (off < PCI_CONFIG_SPACE_SIZE) {
170+ addr = pc->core->addr + BCMA_CORE_PCI_PCICFG0;
171+ addr |= (func << 8);
172+ addr |= (off & 0xfc);
173+ mmio = ioremap_nocache(addr, len);
174+ if (!mmio)
175+ goto out;
176+ }
177+ } else {
178+ addr = bcma_get_cfgspace_addr(pc, dev, func, off);
179+ if (unlikely(!addr))
180+ goto out;
181+ err = -ENOMEM;
182+ mmio = ioremap_nocache(addr, len);
183+ if (!mmio)
184+ goto out;
185+
186+ if (mips_busprobe32(val, mmio)) {
187+ val = 0xffffffff;
188+ goto unmap;
189+ }
190+ }
191+
192+ switch (len) {
193+ case 1:
194+ val = readl(mmio);
195+ val &= ~(0xFF << (8 * (off & 3)));
196+ val |= *((const u8 *)buf) << (8 * (off & 3));
197+ break;
198+ case 2:
199+ val = readl(mmio);
200+ val &= ~(0xFFFF << (8 * (off & 3)));
201+ val |= *((const u16 *)buf) << (8 * (off & 3));
202+ break;
203+ case 4:
204+ val = *((const u32 *)buf);
205+ break;
206+ }
207+ if (dev == 0 && !addr) {
208+ /* accesses to config registers with offsets >= 256
209+ * requires indirect access.
210+ */
211+ addr = (func << 12);
212+ addr |= (off & 0x0FFF);
213+ bcma_pcie_write_config(pc, addr, val);
214+ } else {
215+ writel(val, mmio);
216+
217+ if (chipid == 0x4716 || chipid == 0x4748)
218+ readl(mmio);
219+ }
220+
221+ err = 0;
222+unmap:
223+ if (mmio)
224+ iounmap(mmio);
225+out:
226+ return err;
227+}
228+
229+static int bcma_core_pci_hostmode_read_config(struct pci_bus *bus,
230+ unsigned int devfn,
231+ int reg, int size, u32 *val)
232+{
233+ unsigned long flags;
234+ int err;
235+ struct bcma_drv_pci *pc;
236+ struct bcma_drv_pci_host *pc_host;
237+
238+ pc_host = container_of(bus->ops, struct bcma_drv_pci_host, pci_ops);
239+ pc = pc_host->pdev;
240+
241+ spin_lock_irqsave(&pc_host->cfgspace_lock, flags);
242+ err = bcma_extpci_read_config(pc, PCI_SLOT(devfn),
243+ PCI_FUNC(devfn), reg, val, size);
244+ spin_unlock_irqrestore(&pc_host->cfgspace_lock, flags);
245+
246+ return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
247+}
248+
249+static int bcma_core_pci_hostmode_write_config(struct pci_bus *bus,
250+ unsigned int devfn,
251+ int reg, int size, u32 val)
252+{
253+ unsigned long flags;
254+ int err;
255+ struct bcma_drv_pci *pc;
256+ struct bcma_drv_pci_host *pc_host;
257+
258+ pc_host = container_of(bus->ops, struct bcma_drv_pci_host, pci_ops);
259+ pc = pc_host->pdev;
260+
261+ spin_lock_irqsave(&pc_host->cfgspace_lock, flags);
262+ err = bcma_extpci_write_config(pc, PCI_SLOT(devfn),
263+ PCI_FUNC(devfn), reg, &val, size);
264+ spin_unlock_irqrestore(&pc_host->cfgspace_lock, flags);
265+
266+ return err ? PCIBIOS_DEVICE_NOT_FOUND : PCIBIOS_SUCCESSFUL;
267+}
268+
269+/* return cap_offset if requested capability exists in the PCI config space */
270+static u8 __devinit bcma_find_pci_capability(struct bcma_drv_pci *pc,
271+ unsigned int dev,
272+ unsigned int func, u8 req_cap_id,
273+ unsigned char *buf, u32 *buflen)
274+{
275+ u8 cap_id;
276+ u8 cap_ptr = 0;
277+ u32 bufsize;
278+ u8 byte_val;
279+
280+ /* check for Header type 0 */
281+ bcma_extpci_read_config(pc, dev, func, PCI_HEADER_TYPE, &byte_val,
282+ sizeof(u8));
283+ if ((byte_val & 0x7f) != PCI_HEADER_TYPE_NORMAL)
284+ return cap_ptr;
285+
286+ /* check if the capability pointer field exists */
287+ bcma_extpci_read_config(pc, dev, func, PCI_STATUS, &byte_val,
288+ sizeof(u8));
289+ if (!(byte_val & PCI_STATUS_CAP_LIST))
290+ return cap_ptr;
291+
292+ /* check if the capability pointer is 0x00 */
293+ bcma_extpci_read_config(pc, dev, func, PCI_CAPABILITY_LIST, &cap_ptr,
294+ sizeof(u8));
295+ if (cap_ptr == 0x00)
296+ return cap_ptr;
297+
298+ /* loop thr'u the capability list and see if the requested capabilty
299+ * exists */
300+ bcma_extpci_read_config(pc, dev, func, cap_ptr, &cap_id, sizeof(u8));
301+ while (cap_id != req_cap_id) {
302+ bcma_extpci_read_config(pc, dev, func, cap_ptr + 1, &cap_ptr,
303+ sizeof(u8));
304+ if (cap_ptr == 0x00)
305+ return cap_ptr;
306+ bcma_extpci_read_config(pc, dev, func, cap_ptr, &cap_id,
307+ sizeof(u8));
308+ }
309+
310+ /* found the caller requested capability */
311+ if ((buf != NULL) && (buflen != NULL)) {
312+ u8 cap_data;
313+
314+ bufsize = *buflen;
315+ if (!bufsize)
316+ return cap_ptr;
317+
318+ *buflen = 0;
319+
320+ /* copy the cpability data excluding cap ID and next ptr */
321+ cap_data = cap_ptr + 2;
322+ if ((bufsize + cap_data) > PCI_CONFIG_SPACE_SIZE)
323+ bufsize = PCI_CONFIG_SPACE_SIZE - cap_data;
324+ *buflen = bufsize;
325+ while (bufsize--) {
326+ bcma_extpci_read_config(pc, dev, func, cap_data, buf,
327+ sizeof(u8));
328+ cap_data++;
329+ buf++;
330+ }
331+ }
332+
333+ return cap_ptr;
334+}
335+
336+/* If the root port is capable of returning Config Request
337+ * Retry Status (CRS) Completion Status to software then
338+ * enable the feature.
339+ */
340+static void __devinit bcma_core_pci_enable_crs(struct bcma_drv_pci *pc)
341+{
342+ u8 cap_ptr, root_ctrl, root_cap, dev;
343+ u16 val16;
344+ int i;
345+
346+ cap_ptr = bcma_find_pci_capability(pc, 0, 0, PCI_CAP_ID_EXP, NULL,
347+ NULL);
348+ root_cap = cap_ptr + PCI_EXP_RTCAP;
349+ bcma_extpci_read_config(pc, 0, 0, root_cap, &val16, sizeof(u16));
350+ if (val16 & BCMA_CORE_PCI_RC_CRS_VISIBILITY) {
351+ /* Enable CRS software visibility */
352+ root_ctrl = cap_ptr + PCI_EXP_RTCTL;
353+ val16 = PCI_EXP_RTCTL_CRSSVE;
354+ bcma_extpci_read_config(pc, 0, 0, root_ctrl, &val16,
355+ sizeof(u16));
356+
357+ /* Initiate a configuration request to read the vendor id
358+ * field of the device function's config space header after
359+ * 100 ms wait time from the end of Reset. If the device is
360+ * not done with its internal initialization, it must at
361+ * least return a completion TLP, with a completion status
362+ * of "Configuration Request Retry Status (CRS)". The root
363+ * complex must complete the request to the host by returning
364+ * a read-data value of 0001h for the Vendor ID field and
365+ * all 1s for any additional bytes included in the request.
366+ * Poll using the config reads for max wait time of 1 sec or
367+ * until we receive the successful completion status. Repeat
368+ * the procedure for all the devices.
369+ */
370+ for (dev = 1; dev < BCMA_PCI_SLOT_MAX; dev++) {
371+ for (i = 0; i < 100000; i++) {
372+ bcma_extpci_read_config(pc, dev, 0,
373+ PCI_VENDOR_ID, &val16,
374+ sizeof(val16));
375+ if (val16 != 0x1)
376+ break;
377+ udelay(10);
378+ }
379+ if (val16 == 0x1)
380+ pr_err("PCI: Broken device in slot %d\n", dev);
381+ }
382+ }
383+}
384+
385+void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
386+{
387+ struct bcma_bus *bus = pc->core->bus;
388+ struct bcma_drv_pci_host *pc_host;
389+ u32 tmp;
390+ u32 pci_membase_1G;
391+ unsigned long io_map_base;
392+
393+ pr_info("PCIEcore in host mode found\n");
394+
395+ pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL);
396+ if (!pc_host) {
397+ pr_err("can not allocate memory");
398+ return;
399+ }
400+
401+ pc->host_controller = pc_host;
402+ pc_host->pci_controller.io_resource = &pc_host->io_resource;
403+ pc_host->pci_controller.mem_resource = &pc_host->mem_resource;
404+ pc_host->pci_controller.pci_ops = &pc_host->pci_ops;
405+ pc_host->pdev = pc;
406+
407+ pci_membase_1G = BCMA_SOC_PCI_DMA;
408+ pc_host->host_cfg_addr = BCMA_SOC_PCI_CFG;
409+
410+ pc_host->pci_ops.read = bcma_core_pci_hostmode_read_config;
411+ pc_host->pci_ops.write = bcma_core_pci_hostmode_write_config;
412+
413+ pc_host->mem_resource.name = "BCMA PCIcore external memory",
414+ pc_host->mem_resource.start = BCMA_SOC_PCI_DMA;
415+ pc_host->mem_resource.end = BCMA_SOC_PCI_DMA + BCMA_SOC_PCI_DMA_SZ - 1;
416+ pc_host->mem_resource.flags = IORESOURCE_MEM | IORESOURCE_PCI_FIXED;
417+
418+ pc_host->io_resource.name = "BCMA PCIcore external I/O",
419+ pc_host->io_resource.start = 0x100;
420+ pc_host->io_resource.end = 0x7FF;
421+ pc_host->io_resource.flags = IORESOURCE_IO | IORESOURCE_PCI_FIXED;
422+
423+ /* Reset RC */
424+ udelay(3000);
425+ pcicore_write32(pc, BCMA_CORE_PCI_CTL, BCMA_CORE_PCI_CTL_RST_OE);
426+ udelay(1000);
427+ pcicore_write32(pc, BCMA_CORE_PCI_CTL, BCMA_CORE_PCI_CTL_RST |
428+ BCMA_CORE_PCI_CTL_RST_OE);
429+
430+ /* 64 MB I/O access window. On 4716, use
431+ * sbtopcie0 to access the device registers. We
432+ * can't use address match 2 (1 GB window) region
433+ * as mips can't generate 64-bit address on the
434+ * backplane.
435+ */
436+ if (bus->chipinfo.id == 0x4716 || bus->chipinfo.id == 0x4748) {
437+ pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
438+ pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
439+ BCMA_SOC_PCI_MEM_SZ - 1;
440+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
441+ BCMA_CORE_PCI_SBTOPCI_MEM | BCMA_SOC_PCI_MEM);
442+ } else if (bus->chipinfo.id == 0x5300) {
443+ tmp = BCMA_CORE_PCI_SBTOPCI_MEM;
444+ tmp |= BCMA_CORE_PCI_SBTOPCI_PREF;
445+ tmp |= BCMA_CORE_PCI_SBTOPCI_BURST;
446+ if (pc->core->core_unit == 0) {
447+ pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
448+ pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
449+ BCMA_SOC_PCI_MEM_SZ - 1;
450+ pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;
451+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
452+ tmp | BCMA_SOC_PCI_MEM);
453+ } else if (pc->core->core_unit == 1) {
454+ pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;
455+ pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +
456+ BCMA_SOC_PCI_MEM_SZ - 1;
457+ pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;
458+ pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;
459+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
460+ tmp | BCMA_SOC_PCI1_MEM);
461+ }
462+ } else
463+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
464+ BCMA_CORE_PCI_SBTOPCI_IO);
465+
466+ /* 64 MB configuration access window */
467+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI1, BCMA_CORE_PCI_SBTOPCI_CFG0);
468+
469+ /* 1 GB memory access window */
470+ pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI2,
471+ BCMA_CORE_PCI_SBTOPCI_MEM | pci_membase_1G);
472+
473+
474+ /* As per PCI Express Base Spec 1.1 we need to wait for
475+ * at least 100 ms from the end of a reset (cold/warm/hot)
476+ * before issuing configuration requests to PCI Express
477+ * devices.
478+ */
479+ udelay(100000);
480+
481+ bcma_core_pci_enable_crs(pc);
482+
483+ /* Enable PCI bridge BAR0 memory & master access */
484+ tmp = PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
485+ bcma_extpci_write_config(pc, 0, 0, PCI_COMMAND, &tmp, sizeof(tmp));
486+
487+ /* Enable PCI interrupts */
488+ pcicore_write32(pc, BCMA_CORE_PCI_IMASK, BCMA_CORE_PCI_IMASK_INTA);
489+
490+ /* Ok, ready to run, register it to the system.
491+ * The following needs change, if we want to port hostmode
492+ * to non-MIPS platform. */
493+ io_map_base = (unsigned long)ioremap_nocache(BCMA_SOC_PCI_MEM,
494+ 0x04000000);
495+ pc_host->pci_controller.io_map_base = io_map_base;
496+ set_io_port_base(pc_host->pci_controller.io_map_base);
497+ /* Give some time to the PCI controller to configure itself with the new
498+ * values. Not waiting at this point causes crashes of the machine. */
499+ mdelay(10);
500+ register_pci_controller(&pc_host->pci_controller);
501+ return;
502+}
503+
504+/* Early PCI fixup for a device on the PCI-core bridge. */
505+static void bcma_core_pci_fixup_pcibridge(struct pci_dev *dev)
506+{
507+ if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
508+ /* This is not a device on the PCI-core bridge. */
509+ return;
510+ }
511+ if (PCI_SLOT(dev->devfn) != 0)
512+ return;
513+
514+ pr_info("PCI: Fixing up bridge %s\n", pci_name(dev));
515+
516+ /* Enable PCI bridge bus mastering and memory space */
517+ pci_set_master(dev);
518+ if (pcibios_enable_device(dev, ~0) < 0) {
519+ pr_err("PCI: BCMA bridge enable failed\n");
520+ return;
521+ }
522+
523+ /* Enable PCI bridge BAR1 prefetch and burst */
524+ pci_write_config_dword(dev, BCMA_PCI_BAR1_CONTROL, 3);
525+}
526+DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_pcibridge);
527+
528+/* Early PCI fixup for all PCI-cores to set the correct memory address. */
529+static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)
530+{
531+ struct resource *res;
532+ int pos;
533+
534+ if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
535+ /* This is not a device on the PCI-core bridge. */
536+ return;
537+ }
538+ if (PCI_SLOT(dev->devfn) == 0)
539+ return;
540+
541+ pr_info("PCI: Fixing up addresses %s\n", pci_name(dev));
542+
543+ for (pos = 0; pos < 6; pos++) {
544+ res = &dev->resource[pos];
545+ if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM))
546+ pci_assign_resource(dev, pos);
547+ }
548+}
549+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_addresses);
550+
551+/* This function is called when doing a pci_enable_device().
552+ * We must first check if the device is a device on the PCI-core bridge. */
553+int bcma_core_pci_plat_dev_init(struct pci_dev *dev)
554+{
555+ struct bcma_drv_pci_host *pc_host;
556+
557+ if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
558+ /* This is not a device on the PCI-core bridge. */
559+ return -ENODEV;
560+ }
561+ pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host,
562+ pci_ops);
563+
564+ pr_info("PCI: Fixing up device %s\n", pci_name(dev));
565+
566+ /* Fix up interrupt lines */
567+ dev->irq = bcma_core_mips_irq(pc_host->pdev->core) + 2;
568+ pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
569+
570+ return 0;
571+}
572+EXPORT_SYMBOL(bcma_core_pci_plat_dev_init);
573+
574+/* PCI device IRQ mapping. */
575+int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev)
576+{
577+ struct bcma_drv_pci_host *pc_host;
578+
579+ if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
580+ /* This is not a device on the PCI-core bridge. */
581+ return -ENODEV;
582+ }
583+
584+ pc_host = container_of(dev->bus->ops, struct bcma_drv_pci_host,
585+ pci_ops);
586+ return bcma_core_mips_irq(pc_host->pdev->core) + 2;
14587 }
588+EXPORT_SYMBOL(bcma_core_pci_pcibios_map_irq);
drivers/bcma/host_pci.c+2−2
@@ -154,8 +154,8 @@ const struct bcma_host_ops bcma_host_pci_ops = { · 153 unmodified lines
154154 .awrite32 = bcma_host_pci_awrite32,
155155 };
156156
157−static int bcma_host_pci_probe(struct pci_dev *dev,
158− const struct pci_device_id *id)
157+static int __devinit bcma_host_pci_probe(struct pci_dev *dev,
158+ const struct pci_device_id *id)
159159 {
160160 struct bcma_bus *bus;
161161 int err = -ENOMEM;
drivers/bcma/main.c+14−3
@@ -13,6 +13,12 @@ · 12 unmodified lines
1313 MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
1414 MODULE_LICENSE("GPL");
1515
16+/* contains the number the next bus should get. */
17+static unsigned int bcma_bus_next_num = 0;
18+
19+/* bcma_buses_mutex locks the bcma_bus_next_num */
20+static DEFINE_MUTEX(bcma_buses_mutex);
21+
1622 static int bcma_bus_match(struct device *dev, struct device_driver *drv);
1723 static int bcma_device_probe(struct device *dev);
1824 static int bcma_device_remove(struct device *dev);
@@ -55,7 +61,7 @@ static struct bus_type bcma_bus_type = { · 36 unmodified lines
5561 .dev_attrs = bcma_device_attrs,
5662 };
5763
58−static struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
64+struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
5965 {
6066 struct bcma_device *core;
6167
@@ -65,6 +71,7 @@ static struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid) · 3 unmodified lines
6571 }
6672 return NULL;
6773 }
74+EXPORT_SYMBOL_GPL(bcma_find_core);
6875
6976 static void bcma_release_core_dev(struct device *dev)
7077 {
@@ -93,7 +100,7 @@ static int bcma_register_cores(struct bcma_bus *bus) · 22 unmodified lines
93100
94101 core->dev.release = bcma_release_core_dev;
95102 core->dev.bus = &bcma_bus_type;
96− dev_set_name(&core->dev, "bcma%d:%d", 0/*bus->num*/, dev_id);
103+ dev_set_name(&core->dev, "bcma%d:%d", bus->num, dev_id);
97104
98105 switch (bus->hosttype) {
99106 case BCMA_HOSTTYPE_PCI:
@@ -132,11 +139,15 @@ static void bcma_unregister_cores(struct bcma_bus *bus) · 32 unmodified lines
132139 }
133140 }
134141
135−int bcma_bus_register(struct bcma_bus *bus)
142+int __devinit bcma_bus_register(struct bcma_bus *bus)
136143 {
137144 int err;
138145 struct bcma_device *core;
139146
147+ mutex_lock(&bcma_buses_mutex);
148+ bus->num = bcma_bus_next_num++;
149+ mutex_unlock(&bcma_buses_mutex);
150+
140151 /* Scan for devices (cores) */
141152 err = bcma_bus_scan(bus);
142153 if (err) {
drivers/bcma/scan.c+21−3
@@ -212,6 +212,17 @@ static struct bcma_device *bcma_find_core_by_index(struct bcma_bus *bus, · 211 unmodified lines
212212 return NULL;
213213 }
214214
215+static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 coreid)
216+{
217+ struct bcma_device *core;
218+
219+ list_for_each_entry_reverse(core, &bus->cores, list) {
220+ if (core->id.id == coreid)
221+ return core;
222+ }
223+ return NULL;
224+}
225+
215226 static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
216227 struct bcma_device_id *match, int core_num,
217228 struct bcma_device *core)
@@ -353,6 +364,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, · 135 unmodified lines
353364 void bcma_init_bus(struct bcma_bus *bus)
354365 {
355366 s32 tmp;
367+ struct bcma_chipinfo *chipinfo = &(bus->chipinfo);
356368
357369 if (bus->init_done)
358370 return;
@@ -363,9 +375,12 @@ void bcma_init_bus(struct bcma_bus *bus) · 4 unmodified lines
363375 bcma_scan_switch_core(bus, BCMA_ADDR_BASE);
364376
365377 tmp = bcma_scan_read32(bus, 0, BCMA_CC_ID);
366− bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
367− bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
368− bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
378+ chipinfo->id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
379+ chipinfo->rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
380+ chipinfo->pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
381+ pr_info("Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n",
382+ chipinfo->id, chipinfo->rev, chipinfo->pkg);
383+
369384 bus->init_done = true;
370385 }
371386
@@ -392,6 +407,7 @@ int bcma_bus_scan(struct bcma_bus *bus) · 20 unmodified lines
392407 bcma_scan_switch_core(bus, erombase);
393408
394409 while (eromptr < eromend) {
410+ struct bcma_device *other_core;
395411 struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL);
396412 if (!core)
397413 return -ENOMEM;
@@ -414,6 +430,8 @@ int bcma_bus_scan(struct bcma_bus *bus) · 16 unmodified lines
414430
415431 core->core_index = core_num++;
416432 bus->nr_cores++;
433+ other_core = bcma_find_core_reverse(bus, core->id.id);
434+ core->core_unit = (other_core == NULL) ? 0 : other_core->core_unit + 1;
417435
418436 pr_info("Core %d found: %s "
419437 "(manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
drivers/bcma/sprom.c+279−76
@@ -2,6 +2,8 @@ · 1 unmodified line
22 * Broadcom specific AMBA
33 * SPROM reading
44 *
5+ * Copyright 2011, 2012, Hauke Mehrtens <hauke@hauke-m.de>
6+ *
57 * Licensed under the GNU/GPL. See COPYING for details.
68 */
79
@@ -14,7 +16,57 @@ · 6 unmodified lines
1416 #include <linux/dma-mapping.h>
1517 #include <linux/slab.h>
1618
17−#define SPOFF(offset) ((offset) / sizeof(u16))
19+static int(*get_fallback_sprom)(struct bcma_bus *dev, struct ssb_sprom *out);
20+
21+/**
22+ * bcma_arch_register_fallback_sprom - Registers a method providing a
23+ * fallback SPROM if no SPROM is found.
24+ *
25+ * @sprom_callback: The callback function.
26+ *
27+ * With this function the architecture implementation may register a
28+ * callback handler which fills the SPROM data structure. The fallback is
29+ * used for PCI based BCMA devices, where no valid SPROM can be found
30+ * in the shadow registers and to provide the SPROM for SoCs where BCMA is
31+ * to controll the system bus.
32+ *
33+ * This function is useful for weird architectures that have a half-assed
34+ * BCMA device hardwired to their PCI bus.
35+ *
36+ * This function is available for architecture code, only. So it is not
37+ * exported.
38+ */
39+int bcma_arch_register_fallback_sprom(int (*sprom_callback)(struct bcma_bus *bus,
40+ struct ssb_sprom *out))
41+{
42+ if (get_fallback_sprom)
43+ return -EEXIST;
44+ get_fallback_sprom = sprom_callback;
45+
46+ return 0;
47+}
48+
49+static int bcma_fill_sprom_with_fallback(struct bcma_bus *bus,
50+ struct ssb_sprom *out)
51+{
52+ int err;
53+
54+ if (!get_fallback_sprom) {
55+ err = -ENOENT;
56+ goto fail;
57+ }
58+
59+ err = get_fallback_sprom(bus, out);
60+ if (err)
61+ goto fail;
62+
63+ pr_debug("Using SPROM revision %d provided by"
64+ " platform.\n", bus->sprom.revision);
65+ return 0;
66+fail:
67+ pr_warn("Using fallback SPROM failed (err %d)\n", err);
68+ return err;
69+}
1870
1971 /**************************************************
2072 * R/W ops.
@@ -124,10 +176,21 @@ static int bcma_sprom_valid(const u16 *sprom) · 103 unmodified lines
124176 * SPROM extraction.
125177 **************************************************/
126178
179+#define SPOFF(offset) ((offset) / sizeof(u16))
180+
181+#define SPEX(_field, _offset, _mask, _shift) \
182+ bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))
183+
127184 static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
128185 {
129− u16 v;
186+ u16 v, o;
130187 int i;
188+ u16 pwr_info_offset[] = {
189+ SSB_SROM8_PWR_INFO_CORE0, SSB_SROM8_PWR_INFO_CORE1,
190+ SSB_SROM8_PWR_INFO_CORE2, SSB_SROM8_PWR_INFO_CORE3
191+ };
192+ BUILD_BUG_ON(ARRAY_SIZE(pwr_info_offset) !=
193+ ARRAY_SIZE(bus->sprom.core_pwr_info));
131194
132195 bus->sprom.revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] &
133196 SSB_SPROM_REVISION_REV;
@@ -137,85 +200,229 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) · 3 unmodified lines
137200 *(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v);
138201 }
139202
140− bus->sprom.board_rev = sprom[SPOFF(SSB_SPROM8_BOARDREV)];
141−
142− bus->sprom.txpid2g[0] = (sprom[SPOFF(SSB_SPROM4_TXPID2G01)] &
143− SSB_SPROM4_TXPID2G0) >> SSB_SPROM4_TXPID2G0_SHIFT;
144− bus->sprom.txpid2g[1] = (sprom[SPOFF(SSB_SPROM4_TXPID2G01)] &
145− SSB_SPROM4_TXPID2G1) >> SSB_SPROM4_TXPID2G1_SHIFT;
146− bus->sprom.txpid2g[2] = (sprom[SPOFF(SSB_SPROM4_TXPID2G23)] &
147− SSB_SPROM4_TXPID2G2) >> SSB_SPROM4_TXPID2G2_SHIFT;
148− bus->sprom.txpid2g[3] = (sprom[SPOFF(SSB_SPROM4_TXPID2G23)] &
149− SSB_SPROM4_TXPID2G3) >> SSB_SPROM4_TXPID2G3_SHIFT;
150−
151− bus->sprom.txpid5gl[0] = (sprom[SPOFF(SSB_SPROM4_TXPID5GL01)] &
152− SSB_SPROM4_TXPID5GL0) >> SSB_SPROM4_TXPID5GL0_SHIFT;
153− bus->sprom.txpid5gl[1] = (sprom[SPOFF(SSB_SPROM4_TXPID5GL01)] &
154− SSB_SPROM4_TXPID5GL1) >> SSB_SPROM4_TXPID5GL1_SHIFT;
155− bus->sprom.txpid5gl[2] = (sprom[SPOFF(SSB_SPROM4_TXPID5GL23)] &
156− SSB_SPROM4_TXPID5GL2) >> SSB_SPROM4_TXPID5GL2_SHIFT;
157− bus->sprom.txpid5gl[3] = (sprom[SPOFF(SSB_SPROM4_TXPID5GL23)] &
158− SSB_SPROM4_TXPID5GL3) >> SSB_SPROM4_TXPID5GL3_SHIFT;
159−
160− bus->sprom.txpid5g[0] = (sprom[SPOFF(SSB_SPROM4_TXPID5G01)] &
161− SSB_SPROM4_TXPID5G0) >> SSB_SPROM4_TXPID5G0_SHIFT;
162− bus->sprom.txpid5g[1] = (sprom[SPOFF(SSB_SPROM4_TXPID5G01)] &
163− SSB_SPROM4_TXPID5G1) >> SSB_SPROM4_TXPID5G1_SHIFT;
164− bus->sprom.txpid5g[2] = (sprom[SPOFF(SSB_SPROM4_TXPID5G23)] &
165− SSB_SPROM4_TXPID5G2) >> SSB_SPROM4_TXPID5G2_SHIFT;
166− bus->sprom.txpid5g[3] = (sprom[SPOFF(SSB_SPROM4_TXPID5G23)] &
167− SSB_SPROM4_TXPID5G3) >> SSB_SPROM4_TXPID5G3_SHIFT;
168−
169− bus->sprom.txpid5gh[0] = (sprom[SPOFF(SSB_SPROM4_TXPID5GH01)] &
170− SSB_SPROM4_TXPID5GH0) >> SSB_SPROM4_TXPID5GH0_SHIFT;
171− bus->sprom.txpid5gh[1] = (sprom[SPOFF(SSB_SPROM4_TXPID5GH01)] &
172− SSB_SPROM4_TXPID5GH1) >> SSB_SPROM4_TXPID5GH1_SHIFT;
173− bus->sprom.txpid5gh[2] = (sprom[SPOFF(SSB_SPROM4_TXPID5GH23)] &
174− SSB_SPROM4_TXPID5GH2) >> SSB_SPROM4_TXPID5GH2_SHIFT;
175− bus->sprom.txpid5gh[3] = (sprom[SPOFF(SSB_SPROM4_TXPID5GH23)] &
176− SSB_SPROM4_TXPID5GH3) >> SSB_SPROM4_TXPID5GH3_SHIFT;
177−
178− bus->sprom.boardflags_lo = sprom[SPOFF(SSB_SPROM8_BFLLO)];
179− bus->sprom.boardflags_hi = sprom[SPOFF(SSB_SPROM8_BFLHI)];
180− bus->sprom.boardflags2_lo = sprom[SPOFF(SSB_SPROM8_BFL2LO)];
181− bus->sprom.boardflags2_hi = sprom[SPOFF(SSB_SPROM8_BFL2HI)];
182−
183− bus->sprom.country_code = sprom[SPOFF(SSB_SPROM8_CCODE)];
184−
185− bus->sprom.fem.ghz2.tssipos = (sprom[SPOFF(SSB_SPROM8_FEM2G)] &
186− SSB_SROM8_FEM_TSSIPOS) >> SSB_SROM8_FEM_TSSIPOS_SHIFT;
187− bus->sprom.fem.ghz2.extpa_gain = (sprom[SPOFF(SSB_SPROM8_FEM2G)] &
188− SSB_SROM8_FEM_EXTPA_GAIN) >> SSB_SROM8_FEM_EXTPA_GAIN_SHIFT;
189− bus->sprom.fem.ghz2.pdet_range = (sprom[SPOFF(SSB_SPROM8_FEM2G)] &
190− SSB_SROM8_FEM_PDET_RANGE) >> SSB_SROM8_FEM_PDET_RANGE_SHIFT;
191− bus->sprom.fem.ghz2.tr_iso = (sprom[SPOFF(SSB_SPROM8_FEM2G)] &
192− SSB_SROM8_FEM_TR_ISO) >> SSB_SROM8_FEM_TR_ISO_SHIFT;
193− bus->sprom.fem.ghz2.antswlut = (sprom[SPOFF(SSB_SPROM8_FEM2G)] &
194− SSB_SROM8_FEM_ANTSWLUT) >> SSB_SROM8_FEM_ANTSWLUT_SHIFT;
195−
196− bus->sprom.fem.ghz5.tssipos = (sprom[SPOFF(SSB_SPROM8_FEM5G)] &
197− SSB_SROM8_FEM_TSSIPOS) >> SSB_SROM8_FEM_TSSIPOS_SHIFT;
198− bus->sprom.fem.ghz5.extpa_gain = (sprom[SPOFF(SSB_SPROM8_FEM5G)] &
199− SSB_SROM8_FEM_EXTPA_GAIN) >> SSB_SROM8_FEM_EXTPA_GAIN_SHIFT;
200− bus->sprom.fem.ghz5.pdet_range = (sprom[SPOFF(SSB_SPROM8_FEM5G)] &
201− SSB_SROM8_FEM_PDET_RANGE) >> SSB_SROM8_FEM_PDET_RANGE_SHIFT;
202− bus->sprom.fem.ghz5.tr_iso = (sprom[SPOFF(SSB_SPROM8_FEM5G)] &
203− SSB_SROM8_FEM_TR_ISO) >> SSB_SROM8_FEM_TR_ISO_SHIFT;
204− bus->sprom.fem.ghz5.antswlut = (sprom[SPOFF(SSB_SPROM8_FEM5G)] &
205− SSB_SROM8_FEM_ANTSWLUT) >> SSB_SROM8_FEM_ANTSWLUT_SHIFT;
203+ SPEX(board_rev, SSB_SPROM8_BOARDREV, ~0, 0);
204+
205+ SPEX(txpid2g[0], SSB_SPROM4_TXPID2G01, SSB_SPROM4_TXPID2G0,
206+ SSB_SPROM4_TXPID2G0_SHIFT);
207+ SPEX(txpid2g[1], SSB_SPROM4_TXPID2G01, SSB_SPROM4_TXPID2G1,
208+ SSB_SPROM4_TXPID2G1_SHIFT);
209+ SPEX(txpid2g[2], SSB_SPROM4_TXPID2G23, SSB_SPROM4_TXPID2G2,
210+ SSB_SPROM4_TXPID2G2_SHIFT);
211+ SPEX(txpid2g[3], SSB_SPROM4_TXPID2G23, SSB_SPROM4_TXPID2G3,
212+ SSB_SPROM4_TXPID2G3_SHIFT);
213+
214+ SPEX(txpid5gl[0], SSB_SPROM4_TXPID5GL01, SSB_SPROM4_TXPID5GL0,
215+ SSB_SPROM4_TXPID5GL0_SHIFT);
216+ SPEX(txpid5gl[1], SSB_SPROM4_TXPID5GL01, SSB_SPROM4_TXPID5GL1,
217+ SSB_SPROM4_TXPID5GL1_SHIFT);
218+ SPEX(txpid5gl[2], SSB_SPROM4_TXPID5GL23, SSB_SPROM4_TXPID5GL2,
219+ SSB_SPROM4_TXPID5GL2_SHIFT);
220+ SPEX(txpid5gl[3], SSB_SPROM4_TXPID5GL23, SSB_SPROM4_TXPID5GL3,
221+ SSB_SPROM4_TXPID5GL3_SHIFT);
222+
223+ SPEX(txpid5g[0], SSB_SPROM4_TXPID5G01, SSB_SPROM4_TXPID5G0,
224+ SSB_SPROM4_TXPID5G0_SHIFT);
225+ SPEX(txpid5g[1], SSB_SPROM4_TXPID5G01, SSB_SPROM4_TXPID5G1,
226+ SSB_SPROM4_TXPID5G1_SHIFT);
227+ SPEX(txpid5g[2], SSB_SPROM4_TXPID5G23, SSB_SPROM4_TXPID5G2,
228+ SSB_SPROM4_TXPID5G2_SHIFT);
229+ SPEX(txpid5g[3], SSB_SPROM4_TXPID5G23, SSB_SPROM4_TXPID5G3,
230+ SSB_SPROM4_TXPID5G3_SHIFT);
231+
232+ SPEX(txpid5gh[0], SSB_SPROM4_TXPID5GH01, SSB_SPROM4_TXPID5GH0,
233+ SSB_SPROM4_TXPID5GH0_SHIFT);
234+ SPEX(txpid5gh[1], SSB_SPROM4_TXPID5GH01, SSB_SPROM4_TXPID5GH1,
235+ SSB_SPROM4_TXPID5GH1_SHIFT);
236+ SPEX(txpid5gh[2], SSB_SPROM4_TXPID5GH23, SSB_SPROM4_TXPID5GH2,
237+ SSB_SPROM4_TXPID5GH2_SHIFT);
238+ SPEX(txpid5gh[3], SSB_SPROM4_TXPID5GH23, SSB_SPROM4_TXPID5GH3,
239+ SSB_SPROM4_TXPID5GH3_SHIFT);
240+
241+ SPEX(boardflags_lo, SSB_SPROM8_BFLLO, ~0, 0);
242+ SPEX(boardflags_hi, SSB_SPROM8_BFLHI, ~0, 0);
243+ SPEX(boardflags2_lo, SSB_SPROM8_BFL2LO, ~0, 0);
244+ SPEX(boardflags2_hi, SSB_SPROM8_BFL2HI, ~0, 0);
245+
246+ SPEX(country_code, SSB_SPROM8_CCODE, ~0, 0);
247+
248+ /* Extract cores power info info */
249+ for (i = 0; i < ARRAY_SIZE(pwr_info_offset); i++) {
250+ o = pwr_info_offset[i];
251+ SPEX(core_pwr_info[i].itssi_2g, o + SSB_SROM8_2G_MAXP_ITSSI,
252+ SSB_SPROM8_2G_ITSSI, SSB_SPROM8_2G_ITSSI_SHIFT);
253+ SPEX(core_pwr_info[i].maxpwr_2g, o + SSB_SROM8_2G_MAXP_ITSSI,
254+ SSB_SPROM8_2G_MAXP, 0);
255+
256+ SPEX(core_pwr_info[i].pa_2g[0], o + SSB_SROM8_2G_PA_0, ~0, 0);
257+ SPEX(core_pwr_info[i].pa_2g[1], o + SSB_SROM8_2G_PA_1, ~0, 0);
258+ SPEX(core_pwr_info[i].pa_2g[2], o + SSB_SROM8_2G_PA_2, ~0, 0);
259+
260+ SPEX(core_pwr_info[i].itssi_5g, o + SSB_SROM8_5G_MAXP_ITSSI,
261+ SSB_SPROM8_5G_ITSSI, SSB_SPROM8_5G_ITSSI_SHIFT);
262+ SPEX(core_pwr_info[i].maxpwr_5g, o + SSB_SROM8_5G_MAXP_ITSSI,
263+ SSB_SPROM8_5G_MAXP, 0);
264+ SPEX(core_pwr_info[i].maxpwr_5gh, o + SSB_SPROM8_5GHL_MAXP,
265+ SSB_SPROM8_5GH_MAXP, 0);
266+ SPEX(core_pwr_info[i].maxpwr_5gl, o + SSB_SPROM8_5GHL_MAXP,
267+ SSB_SPROM8_5GL_MAXP, SSB_SPROM8_5GL_MAXP_SHIFT);
268+
269+ SPEX(core_pwr_info[i].pa_5gl[0], o + SSB_SROM8_5GL_PA_0, ~0, 0);
270+ SPEX(core_pwr_info[i].pa_5gl[1], o + SSB_SROM8_5GL_PA_1, ~0, 0);
271+ SPEX(core_pwr_info[i].pa_5gl[2], o + SSB_SROM8_5GL_PA_2, ~0, 0);
272+ SPEX(core_pwr_info[i].pa_5g[0], o + SSB_SROM8_5G_PA_0, ~0, 0);
273+ SPEX(core_pwr_info[i].pa_5g[1], o + SSB_SROM8_5G_PA_1, ~0, 0);
274+ SPEX(core_pwr_info[i].pa_5g[2], o + SSB_SROM8_5G_PA_2, ~0, 0);
275+ SPEX(core_pwr_info[i].pa_5gh[0], o + SSB_SROM8_5GH_PA_0, ~0, 0);
276+ SPEX(core_pwr_info[i].pa_5gh[1], o + SSB_SROM8_5GH_PA_1, ~0, 0);
277+ SPEX(core_pwr_info[i].pa_5gh[2], o + SSB_SROM8_5GH_PA_2, ~0, 0);
278+ }
279+
280+ SPEX(fem.ghz2.tssipos, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_TSSIPOS,
281+ SSB_SROM8_FEM_TSSIPOS_SHIFT);
282+ SPEX(fem.ghz2.extpa_gain, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_EXTPA_GAIN,
283+ SSB_SROM8_FEM_EXTPA_GAIN_SHIFT);
284+ SPEX(fem.ghz2.pdet_range, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_PDET_RANGE,
285+ SSB_SROM8_FEM_PDET_RANGE_SHIFT);
286+ SPEX(fem.ghz2.tr_iso, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_TR_ISO,
287+ SSB_SROM8_FEM_TR_ISO_SHIFT);
288+ SPEX(fem.ghz2.antswlut, SSB_SPROM8_FEM2G, SSB_SROM8_FEM_ANTSWLUT,
289+ SSB_SROM8_FEM_ANTSWLUT_SHIFT);
290+
291+ SPEX(fem.ghz5.tssipos, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_TSSIPOS,
292+ SSB_SROM8_FEM_TSSIPOS_SHIFT);
293+ SPEX(fem.ghz5.extpa_gain, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_EXTPA_GAIN,
294+ SSB_SROM8_FEM_EXTPA_GAIN_SHIFT);
295+ SPEX(fem.ghz5.pdet_range, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_PDET_RANGE,
296+ SSB_SROM8_FEM_PDET_RANGE_SHIFT);
297+ SPEX(fem.ghz5.tr_iso, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_TR_ISO,
298+ SSB_SROM8_FEM_TR_ISO_SHIFT);
299+ SPEX(fem.ghz5.antswlut, SSB_SPROM8_FEM5G, SSB_SROM8_FEM_ANTSWLUT,
300+ SSB_SROM8_FEM_ANTSWLUT_SHIFT);
301+}
302+
303+/*
304+ * Indicates the presence of external SPROM.
305+ */
306+static bool bcma_sprom_ext_available(struct bcma_bus *bus)
307+{
308+ u32 chip_status;
309+ u32 srom_control;
310+ u32 present_mask;
311+
312+ if (bus->drv_cc.core->id.rev >= 31) {
313+ if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
314+ return false;
315+
316+ srom_control = bcma_read32(bus->drv_cc.core,
317+ BCMA_CC_SROM_CONTROL);
318+ return srom_control & BCMA_CC_SROM_CONTROL_PRESENT;
319+ }
320+
321+ /* older chipcommon revisions use chip status register */
322+ chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT);
323+ switch (bus->chipinfo.id) {
324+ case 0x4313:
325+ present_mask = BCMA_CC_CHIPST_4313_SPROM_PRESENT;
326+ break;
327+
328+ case 0x4331:
329+ present_mask = BCMA_CC_CHIPST_4331_SPROM_PRESENT;
330+ break;
331+
332+ default:
333+ return true;
334+ }
335+
336+ return chip_status & present_mask;
337+}
338+
339+/*
340+ * Indicates that on-chip OTP memory is present and enabled.
341+ */
342+static bool bcma_sprom_onchip_available(struct bcma_bus *bus)
343+{
344+ u32 chip_status;
345+ u32 otpsize = 0;
346+ bool present;
347+
348+ chip_status = bcma_read32(bus->drv_cc.core, BCMA_CC_CHIPSTAT);
349+ switch (bus->chipinfo.id) {
350+ case 0x4313:
351+ present = chip_status & BCMA_CC_CHIPST_4313_OTP_PRESENT;
352+ break;
353+
354+ case 0x4331:
355+ present = chip_status & BCMA_CC_CHIPST_4331_OTP_PRESENT;
356+ break;
357+
358+ case 43224:
359+ case 43225:
360+ /* for these chips OTP is always available */
361+ present = true;
362+ break;
363+
364+ default:
365+ present = false;
366+ break;
367+ }
368+
369+ if (present) {
370+ otpsize = bus->drv_cc.capabilities & BCMA_CC_CAP_OTPS;
371+ otpsize >>= BCMA_CC_CAP_OTPS_SHIFT;
372+ }
373+
374+ return otpsize != 0;
375+}
376+
377+/*
378+ * Verify OTP is filled and determine the byte
379+ * offset where SPROM data is located.
380+ *
381+ * On error, returns 0; byte offset otherwise.
382+ */
383+static int bcma_sprom_onchip_offset(struct bcma_bus *bus)
384+{
385+ struct bcma_device *cc = bus->drv_cc.core;
386+ u32 offset;
387+
388+ /* verify OTP status */
389+ if ((bcma_read32(cc, BCMA_CC_OTPS) & BCMA_CC_OTPS_GU_PROG_HW) == 0)
390+ return 0;
391+
392+ /* obtain bit offset from otplayout register */
393+ offset = (bcma_read32(cc, BCMA_CC_OTPL) & BCMA_CC_OTPL_GURGN_OFFSET);
394+ return BCMA_CC_SPROM + (offset >> 3);
206395 }
207396
208397 int bcma_sprom_get(struct bcma_bus *bus)
209398 {
210− u16 offset;
399+ u16 offset = BCMA_CC_SPROM;
211400 u16 *sprom;
212401 int err = 0;
213402
214403 if (!bus->drv_cc.core)
215404 return -EOPNOTSUPP;
216405
217− if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
218− return -ENOENT;
406+ if (!bcma_sprom_ext_available(bus)) {
407+ /*
408+ * External SPROM takes precedence so check
409+ * on-chip OTP only when no external SPROM
410+ * is present.
411+ */
412+ if (bcma_sprom_onchip_available(bus)) {
413+ /* determine offset */
414+ offset = bcma_sprom_onchip_offset(bus);
415+ }
416+ if (!offset) {
417+ /*
418+ * Maybe there is no SPROM on the device?
419+ * Now we ask the arch code if there is some sprom
420+ * available for this device in some other storage.
421+ */
422+ err = bcma_fill_sprom_with_fallback(bus, &bus->sprom);
423+ return err;
424+ }
425+ }
219426
220427 sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
221428 GFP_KERNEL);
@@ -225,11 +432,7 @@ int bcma_sprom_get(struct bcma_bus *bus) · 3 unmodified lines
225432 if (bus->chipinfo.id == 0x4331)
226433 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, false);
227434
228− /* Most cards have SPROM moved by additional offset 0x30 (48 dwords).
229− * According to brcm80211 this applies to cards with PCIe rev >= 6
230− * TODO: understand this condition and use it */
231− offset = (bus->chipinfo.id == 0x4331) ? BCMA_CC_SPROM :
232− BCMA_CC_SPROM_PCIE6;
435+ pr_debug("SPROM offset 0x%x\n", offset);
233436 bcma_sprom_read(bus, offset, sprom);
234437
235438 if (bus->chipinfo.id == 0x4331)
drivers/bluetooth/ath3k.c+3−0
@@ -65,12 +65,14 @@ static struct usb_device_id ath3k_table[] = { · 64 unmodified lines
6565 { USB_DEVICE(0x0CF3, 0x3002) },
6666 { USB_DEVICE(0x13d3, 0x3304) },
6767 { USB_DEVICE(0x0930, 0x0215) },
68+ { USB_DEVICE(0x0489, 0xE03D) },
6869
6970 /* Atheros AR9285 Malbec with sflash firmware */
7071 { USB_DEVICE(0x03F0, 0x311D) },
7172
7273 /* Atheros AR3012 with sflash firmware*/
7374 { USB_DEVICE(0x0CF3, 0x3004) },
75+ { USB_DEVICE(0x13d3, 0x3375) },
7476
7577 /* Atheros AR5BBU12 with sflash firmware */
7678 { USB_DEVICE(0x0489, 0xE02C) },
@@ -87,6 +89,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 10 unmodified lines
8789
8890 /* Atheros AR3012 with sflash firmware*/
8991 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
92+ { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
9093
9194 { } /* Terminating entry */
9295 };
drivers/bluetooth/bfusb.c+6−17
@@ -411,7 +411,7 @@ unlock: · 410 unmodified lines
411411
412412 static int bfusb_open(struct hci_dev *hdev)
413413 {
414− struct bfusb_data *data = hdev->driver_data;
414+ struct bfusb_data *data = hci_get_drvdata(hdev);
415415 unsigned long flags;
416416 int i, err;
417417
@@ -437,7 +437,7 @@ static int bfusb_open(struct hci_dev *hdev) · 19 unmodified lines
437437
438438 static int bfusb_flush(struct hci_dev *hdev)
439439 {
440− struct bfusb_data *data = hdev->driver_data;
440+ struct bfusb_data *data = hci_get_drvdata(hdev);
441441
442442 BT_DBG("hdev %p bfusb %p", hdev, data);
443443
@@ -448,7 +448,7 @@ static int bfusb_flush(struct hci_dev *hdev) · 4 unmodified lines
448448
449449 static int bfusb_close(struct hci_dev *hdev)
450450 {
451− struct bfusb_data *data = hdev->driver_data;
451+ struct bfusb_data *data = hci_get_drvdata(hdev);
452452 unsigned long flags;
453453
454454 BT_DBG("hdev %p bfusb %p", hdev, data);
@@ -483,7 +483,7 @@ static int bfusb_send_frame(struct sk_buff *skb) · 28 unmodified lines
483483 if (!test_bit(HCI_RUNNING, &hdev->flags))
484484 return -EBUSY;
485485
486− data = hdev->driver_data;
486+ data = hci_get_drvdata(hdev);
487487
488488 switch (bt_cb(skb)->pkt_type) {
489489 case HCI_COMMAND_PKT:
@@ -544,15 +544,6 @@ static int bfusb_send_frame(struct sk_buff *skb) · 54 unmodified lines
544544 return 0;
545545 }
546546
547−static void bfusb_destruct(struct hci_dev *hdev)
548−{
549− struct bfusb_data *data = hdev->driver_data;
550−
551− BT_DBG("hdev %p bfusb %p", hdev, data);
552−
553− kfree(data);
554−}
555−
556547 static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
557548 {
558549 return -ENOIOCTLCMD;
@@ -705,18 +696,15 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i · 146 unmodified lines
705696 data->hdev = hdev;
706697
707698 hdev->bus = HCI_USB;
708− hdev->driver_data = data;
699+ hci_set_drvdata(hdev, data);
709700 SET_HCIDEV_DEV(hdev, &intf->dev);
710701
711702 hdev->open = bfusb_open;
712703 hdev->close = bfusb_close;
713704 hdev->flush = bfusb_flush;
714705 hdev->send = bfusb_send_frame;
715− hdev->destruct = bfusb_destruct;
716706 hdev->ioctl = bfusb_ioctl;
717707
718− hdev->owner = THIS_MODULE;
719−
720708 if (hci_register_dev(hdev) < 0) {
721709 BT_ERR("Can't register HCI device");
722710 hci_free_dev(hdev);
@@ -753,6 +741,7 @@ static void bfusb_disconnect(struct usb_interface *intf) · 30 unmodified lines
753741
754742 hci_unregister_dev(hdev);
755743 hci_free_dev(hdev);
744+ kfree(data);
756745 }
757746
758747 static struct usb_driver bfusb_driver = {
drivers/bluetooth/bluecard_cs.c+6−14
@@ -561,7 +561,7 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst) · 560 unmodified lines
561561
562562 static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
563563 {
564− bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
564+ bluecard_info_t *info = hci_get_drvdata(hdev);
565565 struct sk_buff *skb;
566566
567567 /* Ericsson baud rate command */
@@ -609,7 +609,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) · 41 unmodified lines
609609
610610 static int bluecard_hci_flush(struct hci_dev *hdev)
611611 {
612− bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
612+ bluecard_info_t *info = hci_get_drvdata(hdev);
613613
614614 /* Drop TX queue */
615615 skb_queue_purge(&(info->txq));
@@ -620,7 +620,7 @@ static int bluecard_hci_flush(struct hci_dev *hdev) · 4 unmodified lines
620620
621621 static int bluecard_hci_open(struct hci_dev *hdev)
622622 {
623− bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
623+ bluecard_info_t *info = hci_get_drvdata(hdev);
624624 unsigned int iobase = info->p_dev->resource[0]->start;
625625
626626 if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
@@ -640,7 +640,7 @@ static int bluecard_hci_open(struct hci_dev *hdev) · 13 unmodified lines
640640
641641 static int bluecard_hci_close(struct hci_dev *hdev)
642642 {
643− bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
643+ bluecard_info_t *info = hci_get_drvdata(hdev);
644644 unsigned int iobase = info->p_dev->resource[0]->start;
645645
646646 if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
@@ -667,7 +667,7 @@ static int bluecard_hci_send_frame(struct sk_buff *skb) · 20 unmodified lines
667667 return -ENODEV;
668668 }
669669
670− info = (bluecard_info_t *)(hdev->driver_data);
670+ info = hci_get_drvdata(hdev);
671671
672672 switch (bt_cb(skb)->pkt_type) {
673673 case HCI_COMMAND_PKT:
@@ -691,11 +691,6 @@ static int bluecard_hci_send_frame(struct sk_buff *skb) · 17 unmodified lines
691691 }
692692
693693
694−static void bluecard_hci_destruct(struct hci_dev *hdev)
695−{
696−}
697−
698−
699694 static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
700695 {
701696 return -ENOIOCTLCMD;
@@ -734,18 +729,15 @@ static int bluecard_open(bluecard_info_t *info) · 32 unmodified lines
734729 info->hdev = hdev;
735730
736731 hdev->bus = HCI_PCCARD;
737− hdev->driver_data = info;
732+ hci_set_drvdata(hdev, info);
738733 SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
739734
740735 hdev->open = bluecard_hci_open;
741736 hdev->close = bluecard_hci_close;
742737 hdev->flush = bluecard_hci_flush;
743738 hdev->send = bluecard_hci_send_frame;
744− hdev->destruct = bluecard_hci_destruct;
745739 hdev->ioctl = bluecard_hci_ioctl;
746740
747− hdev->owner = THIS_MODULE;
748−
749741 id = inb(iobase + 0x30);
750742
751743 if ((id & 0x0f) == 0x02)
drivers/bluetooth/bpa10x.c+12−23
@@ -66,7 +66,7 @@ struct hci_vendor_hdr { · 65 unmodified lines
6666
6767 static int bpa10x_recv(struct hci_dev *hdev, int queue, void *buf, int count)
6868 {
69− struct bpa10x_data *data = hdev->driver_data;
69+ struct bpa10x_data *data = hci_get_drvdata(hdev);
7070
7171 BT_DBG("%s queue %d buffer %p count %d", hdev->name,
7272 queue, buf, count);
@@ -189,7 +189,7 @@ done: · 116 unmodified lines
189189 static void bpa10x_rx_complete(struct urb *urb)
190190 {
191191 struct hci_dev *hdev = urb->context;
192− struct bpa10x_data *data = hdev->driver_data;
192+ struct bpa10x_data *data = hci_get_drvdata(hdev);
193193 int err;
194194
195195 BT_DBG("%s urb %p status %d count %d", hdev->name,
@@ -219,7 +219,7 @@ static void bpa10x_rx_complete(struct urb *urb) · 23 unmodified lines
219219
220220 static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev)
221221 {
222− struct bpa10x_data *data = hdev->driver_data;
222+ struct bpa10x_data *data = hci_get_drvdata(hdev);
223223 struct urb *urb;
224224 unsigned char *buf;
225225 unsigned int pipe;
@@ -260,7 +260,7 @@ static inline int bpa10x_submit_intr_urb(struct hci_dev *hdev) · 34 unmodified lines
260260
261261 static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev)
262262 {
263− struct bpa10x_data *data = hdev->driver_data;
263+ struct bpa10x_data *data = hci_get_drvdata(hdev);
264264 struct urb *urb;
265265 unsigned char *buf;
266266 unsigned int pipe;
@@ -301,7 +301,7 @@ static inline int bpa10x_submit_bulk_urb(struct hci_dev *hdev) · 34 unmodified lines
301301
302302 static int bpa10x_open(struct hci_dev *hdev)
303303 {
304− struct bpa10x_data *data = hdev->driver_data;
304+ struct bpa10x_data *data = hci_get_drvdata(hdev);
305305 int err;
306306
307307 BT_DBG("%s", hdev->name);
@@ -329,7 +329,7 @@ error: · 21 unmodified lines
329329
330330 static int bpa10x_close(struct hci_dev *hdev)
331331 {
332− struct bpa10x_data *data = hdev->driver_data;
332+ struct bpa10x_data *data = hci_get_drvdata(hdev);
333333
334334 BT_DBG("%s", hdev->name);
335335
@@ -343,7 +343,7 @@ static int bpa10x_close(struct hci_dev *hdev) · 7 unmodified lines
343343
344344 static int bpa10x_flush(struct hci_dev *hdev)
345345 {
346− struct bpa10x_data *data = hdev->driver_data;
346+ struct bpa10x_data *data = hci_get_drvdata(hdev);
347347
348348 BT_DBG("%s", hdev->name);
349349
@@ -355,7 +355,7 @@ static int bpa10x_flush(struct hci_dev *hdev) · 5 unmodified lines
355355 static int bpa10x_send_frame(struct sk_buff *skb)
356356 {
357357 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
358− struct bpa10x_data *data = hdev->driver_data;
358+ struct bpa10x_data *data = hci_get_drvdata(hdev);
359359 struct usb_ctrlrequest *dr;
360360 struct urb *urb;
361361 unsigned int pipe;
@@ -432,17 +432,6 @@ static int bpa10x_send_frame(struct sk_buff *skb) · 70 unmodified lines
432432 return 0;
433433 }
434434
435−static void bpa10x_destruct(struct hci_dev *hdev)
436−{
437− struct bpa10x_data *data = hdev->driver_data;
438−
439− BT_DBG("%s", hdev->name);
440−
441− kfree_skb(data->rx_skb[0]);
442− kfree_skb(data->rx_skb[1]);
443− kfree(data);
444−}
445−
446435 static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *id)
447436 {
448437 struct bpa10x_data *data;
@@ -470,7 +459,7 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id * · 21 unmodified lines
470459 }
471460
472461 hdev->bus = HCI_USB;
473− hdev->driver_data = data;
462+ hci_set_drvdata(hdev, data);
474463
475464 data->hdev = hdev;
476465
@@ -480,9 +469,6 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id * · 3 unmodified lines
480469 hdev->close = bpa10x_close;
481470 hdev->flush = bpa10x_flush;
482471 hdev->send = bpa10x_send_frame;
483− hdev->destruct = bpa10x_destruct;
484−
485− hdev->owner = THIS_MODULE;
486472
487473 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
488474
@@ -512,6 +498,9 @@ static void bpa10x_disconnect(struct usb_interface *intf) · 23 unmodified lines
512498 hci_unregister_dev(data->hdev);
513499
514500 hci_free_dev(data->hdev);
501+ kfree_skb(data->rx_skb[0]);
502+ kfree_skb(data->rx_skb[1]);
503+ kfree(data);
515504 }
516505
517506 static struct usb_driver bpa10x_driver = {
drivers/bluetooth/bt3c_cs.c+3−11
@@ -389,7 +389,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst) · 388 unmodified lines
389389
390390 static int bt3c_hci_flush(struct hci_dev *hdev)
391391 {
392− bt3c_info_t *info = (bt3c_info_t *)(hdev->driver_data);
392+ bt3c_info_t *info = hci_get_drvdata(hdev);
393393
394394 /* Drop TX queue */
395395 skb_queue_purge(&(info->txq));
@@ -428,7 +428,7 @@ static int bt3c_hci_send_frame(struct sk_buff *skb) · 32 unmodified lines
428428 return -ENODEV;
429429 }
430430
431− info = (bt3c_info_t *) (hdev->driver_data);
431+ info = hci_get_drvdata(hdev);
432432
433433 switch (bt_cb(skb)->pkt_type) {
434434 case HCI_COMMAND_PKT:
@@ -456,11 +456,6 @@ static int bt3c_hci_send_frame(struct sk_buff *skb) · 21 unmodified lines
456456 }
457457
458458
459−static void bt3c_hci_destruct(struct hci_dev *hdev)
460−{
461−}
462−
463−
464459 static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
465460 {
466461 return -ENOIOCTLCMD;
@@ -580,18 +575,15 @@ static int bt3c_open(bt3c_info_t *info) · 113 unmodified lines
580575 info->hdev = hdev;
581576
582577 hdev->bus = HCI_PCCARD;
583− hdev->driver_data = info;
578+ hci_set_drvdata(hdev, info);
584579 SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
585580
586581 hdev->open = bt3c_hci_open;
587582 hdev->close = bt3c_hci_close;
588583 hdev->flush = bt3c_hci_flush;
589584 hdev->send = bt3c_hci_send_frame;
590− hdev->destruct = bt3c_hci_destruct;
591585 hdev->ioctl = bt3c_hci_ioctl;
592586
593− hdev->owner = THIS_MODULE;
594−
595587 /* Load firmware */
596588 err = request_firmware(&firmware, "BT3CPCC.bin", &info->p_dev->dev);
597589 if (err < 0) {
drivers/bluetooth/btmrvl_debugfs.c+14−16
@@ -384,7 +384,7 @@ static const struct file_operations btmrvl_txdnldready_fops = { · 383 unmodified lines
384384
385385 void btmrvl_debugfs_init(struct hci_dev *hdev)
386386 {
387− struct btmrvl_private *priv = hdev->driver_data;
387+ struct btmrvl_private *priv = hci_get_drvdata(hdev);
388388 struct btmrvl_debugfs_data *dbg;
389389
390390 if (!hdev->debugfs)
@@ -401,36 +401,34 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) · 10 unmodified lines
401401 dbg->config_dir = debugfs_create_dir("config", hdev->debugfs);
402402
403403 dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir,
404− hdev->driver_data, &btmrvl_psmode_fops);
404+ priv, &btmrvl_psmode_fops);
405405 dbg->pscmd = debugfs_create_file("pscmd", 0644, dbg->config_dir,
406− hdev->driver_data, &btmrvl_pscmd_fops);
406+ priv, &btmrvl_pscmd_fops);
407407 dbg->gpiogap = debugfs_create_file("gpiogap", 0644, dbg->config_dir,
408− hdev->driver_data, &btmrvl_gpiogap_fops);
408+ priv, &btmrvl_gpiogap_fops);
409409 dbg->hsmode = debugfs_create_file("hsmode", 0644, dbg->config_dir,
410− hdev->driver_data, &btmrvl_hsmode_fops);
410+ priv, &btmrvl_hsmode_fops);
411411 dbg->hscmd = debugfs_create_file("hscmd", 0644, dbg->config_dir,
412− hdev->driver_data, &btmrvl_hscmd_fops);
412+ priv, &btmrvl_hscmd_fops);
413413 dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
414− hdev->driver_data, &btmrvl_hscfgcmd_fops);
414+ priv, &btmrvl_hscfgcmd_fops);
415415
416416 dbg->status_dir = debugfs_create_dir("status", hdev->debugfs);
417417 dbg->curpsmode = debugfs_create_file("curpsmode", 0444,
418− dbg->status_dir,
419− hdev->driver_data,
420− &btmrvl_curpsmode_fops);
418+ dbg->status_dir, priv,
419+ &btmrvl_curpsmode_fops);
421420 dbg->psstate = debugfs_create_file("psstate", 0444, dbg->status_dir,
422− hdev->driver_data, &btmrvl_psstate_fops);
421+ priv, &btmrvl_psstate_fops);
423422 dbg->hsstate = debugfs_create_file("hsstate", 0444, dbg->status_dir,
424− hdev->driver_data, &btmrvl_hsstate_fops);
423+ priv, &btmrvl_hsstate_fops);
425424 dbg->txdnldready = debugfs_create_file("txdnldready", 0444,
426− dbg->status_dir,
427− hdev->driver_data,
428− &btmrvl_txdnldready_fops);
425+ dbg->status_dir, priv,
426+ &btmrvl_txdnldready_fops);
429427 }
430428
431429 void btmrvl_debugfs_remove(struct hci_dev *hdev)
432430 {
433− struct btmrvl_private *priv = hdev->driver_data;
431+ struct btmrvl_private *priv = hci_get_drvdata(hdev);
434432 struct btmrvl_debugfs_data *dbg = priv->debugfs_data;
435433
436434 if (!dbg)
drivers/bluetooth/btmrvl_main.c+6−11
@@ -387,10 +387,6 @@ static int btmrvl_ioctl(struct hci_dev *hdev, · 386 unmodified lines
387387 return -ENOIOCTLCMD;
388388 }
389389
390−static void btmrvl_destruct(struct hci_dev *hdev)
391−{
392−}
393−
394390 static int btmrvl_send_frame(struct sk_buff *skb)
395391 {
396392 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
@@ -398,12 +394,13 @@ static int btmrvl_send_frame(struct sk_buff *skb) · 1 unmodified line
398394
399395 BT_DBG("type=%d, len=%d", skb->pkt_type, skb->len);
400396
401− if (!hdev || !hdev->driver_data) {
397+ if (!hdev) {
402398 BT_ERR("Frame for unknown HCI device");
403399 return -ENODEV;
404400 }
405401
406− priv = (struct btmrvl_private *) hdev->driver_data;
402+ priv = hci_get_drvdata(hdev);
403+
407404 if (!test_bit(HCI_RUNNING, &hdev->flags)) {
408405 BT_ERR("Failed testing HCI_RUNING, flags=%lx", hdev->flags);
409406 print_hex_dump_bytes("data: ", DUMP_PREFIX_OFFSET,
@@ -434,7 +431,7 @@ static int btmrvl_send_frame(struct sk_buff *skb) · 24 unmodified lines
434431
435432 static int btmrvl_flush(struct hci_dev *hdev)
436433 {
437− struct btmrvl_private *priv = hdev->driver_data;
434+ struct btmrvl_private *priv = hci_get_drvdata(hdev);
438435
439436 skb_queue_purge(&priv->adapter->tx_queue);
440437
@@ -443,7 +440,7 @@ static int btmrvl_flush(struct hci_dev *hdev) · 2 unmodified lines
443440
444441 static int btmrvl_close(struct hci_dev *hdev)
445442 {
446− struct btmrvl_private *priv = hdev->driver_data;
443+ struct btmrvl_private *priv = hci_get_drvdata(hdev);
447444
448445 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
449446 return 0;
@@ -546,16 +543,14 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) · 96 unmodified lines
546543 }
547544
548545 priv->btmrvl_dev.hcidev = hdev;
549− hdev->driver_data = priv;
546+ hci_set_drvdata(hdev, priv);
550547
551548 hdev->bus = HCI_SDIO;
552549 hdev->open = btmrvl_open;
553550 hdev->close = btmrvl_close;
554551 hdev->flush = btmrvl_flush;
555552 hdev->send = btmrvl_send_frame;
556− hdev->destruct = btmrvl_destruct;
557553 hdev->ioctl = btmrvl_ioctl;
558− hdev->owner = THIS_MODULE;
559554
560555 btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
561556
drivers/bluetooth/btsdio.c+6−17
@@ -189,7 +189,7 @@ static void btsdio_interrupt(struct sdio_func *func) · 188 unmodified lines
189189
190190 static int btsdio_open(struct hci_dev *hdev)
191191 {
192− struct btsdio_data *data = hdev->driver_data;
192+ struct btsdio_data *data = hci_get_drvdata(hdev);
193193 int err;
194194
195195 BT_DBG("%s", hdev->name);
@@ -225,7 +225,7 @@ release: · 29 unmodified lines
225225
226226 static int btsdio_close(struct hci_dev *hdev)
227227 {
228− struct btsdio_data *data = hdev->driver_data;
228+ struct btsdio_data *data = hci_get_drvdata(hdev);
229229
230230 BT_DBG("%s", hdev->name);
231231
@@ -246,7 +246,7 @@ static int btsdio_close(struct hci_dev *hdev) · 14 unmodified lines
246246
247247 static int btsdio_flush(struct hci_dev *hdev)
248248 {
249− struct btsdio_data *data = hdev->driver_data;
249+ struct btsdio_data *data = hci_get_drvdata(hdev);
250250
251251 BT_DBG("%s", hdev->name);
252252
@@ -258,7 +258,7 @@ static int btsdio_flush(struct hci_dev *hdev) · 5 unmodified lines
258258 static int btsdio_send_frame(struct sk_buff *skb)
259259 {
260260 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
261− struct btsdio_data *data = hdev->driver_data;
261+ struct btsdio_data *data = hci_get_drvdata(hdev);
262262
263263 BT_DBG("%s", hdev->name);
264264
@@ -289,15 +289,6 @@ static int btsdio_send_frame(struct sk_buff *skb) · 24 unmodified lines
289289 return 0;
290290 }
291291
292−static void btsdio_destruct(struct hci_dev *hdev)
293−{
294− struct btsdio_data *data = hdev->driver_data;
295−
296− BT_DBG("%s", hdev->name);
297−
298− kfree(data);
299−}
300−
301292 static int btsdio_probe(struct sdio_func *func,
302293 const struct sdio_device_id *id)
303294 {
@@ -330,7 +321,7 @@ static int btsdio_probe(struct sdio_func *func, · 26 unmodified lines
330321 }
331322
332323 hdev->bus = HCI_SDIO;
333− hdev->driver_data = data;
324+ hci_set_drvdata(hdev, data);
334325
335326 if (id->class == SDIO_CLASS_BT_AMP)
336327 hdev->dev_type = HCI_AMP;
@@ -345,9 +336,6 @@ static int btsdio_probe(struct sdio_func *func, · 8 unmodified lines
345336 hdev->close = btsdio_close;
346337 hdev->flush = btsdio_flush;
347338 hdev->send = btsdio_send_frame;
348− hdev->destruct = btsdio_destruct;
349−
350− hdev->owner = THIS_MODULE;
351339
352340 err = hci_register_dev(hdev);
353341 if (err < 0) {
@@ -378,6 +366,7 @@ static void btsdio_remove(struct sdio_func *func) · 24 unmodified lines
378366 hci_unregister_dev(hdev);
379367
380368 hci_free_dev(hdev);
369+ kfree(data);
381370 }
382371
383372 static struct sdio_driver btsdio_driver = {
drivers/bluetooth/btuart_cs.c+3−11
@@ -397,7 +397,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed) · 396 unmodified lines
397397
398398 static int btuart_hci_flush(struct hci_dev *hdev)
399399 {
400− btuart_info_t *info = (btuart_info_t *)(hdev->driver_data);
400+ btuart_info_t *info = hci_get_drvdata(hdev);
401401
402402 /* Drop TX queue */
403403 skb_queue_purge(&(info->txq));
@@ -435,7 +435,7 @@ static int btuart_hci_send_frame(struct sk_buff *skb) · 31 unmodified lines
435435 return -ENODEV;
436436 }
437437
438− info = (btuart_info_t *)(hdev->driver_data);
438+ info = hci_get_drvdata(hdev);
439439
440440 switch (bt_cb(skb)->pkt_type) {
441441 case HCI_COMMAND_PKT:
@@ -459,11 +459,6 @@ static int btuart_hci_send_frame(struct sk_buff *skb) · 17 unmodified lines
459459 }
460460
461461
462−static void btuart_hci_destruct(struct hci_dev *hdev)
463−{
464−}
465−
466−
467462 static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
468463 {
469464 return -ENOIOCTLCMD;
@@ -498,18 +493,15 @@ static int btuart_open(btuart_info_t *info) · 28 unmodified lines
498493 info->hdev = hdev;
499494
500495 hdev->bus = HCI_PCCARD;
501− hdev->driver_data = info;
496+ hci_set_drvdata(hdev, info);
502497 SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
503498
504499 hdev->open = btuart_hci_open;
505500 hdev->close = btuart_hci_close;
506501 hdev->flush = btuart_hci_flush;
507502 hdev->send = btuart_hci_send_frame;
508− hdev->destruct = btuart_hci_destruct;
509503 hdev->ioctl = btuart_hci_ioctl;
510504
511− hdev->owner = THIS_MODULE;
512−
513505 spin_lock_irqsave(&(info->lock), flags);
514506
515507 /* Reset UART */
drivers/bluetooth/btusb.c+18−31
@@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { · 101 unmodified lines
102102
103103 /* Broadcom BCM20702A0 */
104104 { USB_DEVICE(0x0a5c, 0x21e3) },
105+ { USB_DEVICE(0x0a5c, 0x21e6) },
105106 { USB_DEVICE(0x0a5c, 0x21f3) },
106107 { USB_DEVICE(0x413c, 0x8197) },
107108
@@ -121,12 +122,14 @@ static struct usb_device_id blacklist_table[] = { · 13 unmodified lines
121122 { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
122123 { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
123124 { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
125+ { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
124126
125127 /* Atheros AR9285 Malbec with sflash firmware */
126128 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
127129
128130 /* Atheros 3012 with sflash firmware */
129131 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
132+ { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
130133
131134 /* Atheros AR5BBU12 with sflash firmware */
132135 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
@@ -243,7 +246,7 @@ static int inc_tx(struct btusb_data *data) · 110 unmodified lines
243246 static void btusb_intr_complete(struct urb *urb)
244247 {
245248 struct hci_dev *hdev = urb->context;
246− struct btusb_data *data = hdev->driver_data;
249+ struct btusb_data *data = hci_get_drvdata(hdev);
247250 int err;
248251
249252 BT_DBG("%s urb %p status %d count %d", hdev->name,
@@ -282,7 +285,7 @@ static void btusb_intr_complete(struct urb *urb) · 32 unmodified lines
282285
283286 static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
284287 {
285− struct btusb_data *data = hdev->driver_data;
288+ struct btusb_data *data = hci_get_drvdata(hdev);
286289 struct urb *urb;
287290 unsigned char *buf;
288291 unsigned int pipe;
@@ -331,7 +334,7 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags) · 42 unmodified lines
331334 static void btusb_bulk_complete(struct urb *urb)
332335 {
333336 struct hci_dev *hdev = urb->context;
334− struct btusb_data *data = hdev->driver_data;
337+ struct btusb_data *data = hci_get_drvdata(hdev);
335338 int err;
336339
337340 BT_DBG("%s urb %p status %d count %d", hdev->name,
@@ -370,7 +373,7 @@ static void btusb_bulk_complete(struct urb *urb) · 32 unmodified lines
370373
371374 static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags)
372375 {
373− struct btusb_data *data = hdev->driver_data;
376+ struct btusb_data *data = hci_get_drvdata(hdev);
374377 struct urb *urb;
375378 unsigned char *buf;
376379 unsigned int pipe;
@@ -417,7 +420,7 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags) · 40 unmodified lines
417420 static void btusb_isoc_complete(struct urb *urb)
418421 {
419422 struct hci_dev *hdev = urb->context;
420− struct btusb_data *data = hdev->driver_data;
423+ struct btusb_data *data = hci_get_drvdata(hdev);
421424 int i, err;
422425
423426 BT_DBG("%s urb %p status %d count %d", hdev->name,
@@ -484,7 +487,7 @@ static inline void __fill_isoc_descriptor(struct urb *urb, int len, int mtu) · 60 unmodified lines
484487
485488 static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags)
486489 {
487− struct btusb_data *data = hdev->driver_data;
490+ struct btusb_data *data = hci_get_drvdata(hdev);
488491 struct urb *urb;
489492 unsigned char *buf;
490493 unsigned int pipe;
@@ -537,7 +540,7 @@ static void btusb_tx_complete(struct urb *urb) · 46 unmodified lines
537540 {
538541 struct sk_buff *skb = urb->context;
539542 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
540− struct btusb_data *data = hdev->driver_data;
543+ struct btusb_data *data = hci_get_drvdata(hdev);
541544
542545 BT_DBG("%s urb %p status %d count %d", hdev->name,
543546 urb, urb->status, urb->actual_length);
@@ -584,7 +587,7 @@ done: · 40 unmodified lines
584587
585588 static int btusb_open(struct hci_dev *hdev)
586589 {
587− struct btusb_data *data = hdev->driver_data;
590+ struct btusb_data *data = hci_get_drvdata(hdev);
588591 int err;
589592
590593 BT_DBG("%s", hdev->name);
@@ -634,7 +637,7 @@ static void btusb_stop_traffic(struct btusb_data *data) · 43 unmodified lines
634637
635638 static int btusb_close(struct hci_dev *hdev)
636639 {
637− struct btusb_data *data = hdev->driver_data;
640+ struct btusb_data *data = hci_get_drvdata(hdev);
638641 int err;
639642
640643 BT_DBG("%s", hdev->name);
@@ -664,7 +667,7 @@ failed: · 23 unmodified lines
664667
665668 static int btusb_flush(struct hci_dev *hdev)
666669 {
667− struct btusb_data *data = hdev->driver_data;
670+ struct btusb_data *data = hci_get_drvdata(hdev);
668671
669672 BT_DBG("%s", hdev->name);
670673
@@ -676,7 +679,7 @@ static int btusb_flush(struct hci_dev *hdev) · 5 unmodified lines
676679 static int btusb_send_frame(struct sk_buff *skb)
677680 {
678681 struct hci_dev *hdev = (struct hci_dev *) skb->dev;
679− struct btusb_data *data = hdev->driver_data;
682+ struct btusb_data *data = hci_get_drvdata(hdev);
680683 struct usb_ctrlrequest *dr;
681684 struct urb *urb;
682685 unsigned int pipe;
@@ -784,18 +787,9 @@ done: · 101 unmodified lines
784787 return err;
785788 }
786789
787−static void btusb_destruct(struct hci_dev *hdev)
788−{
789− struct btusb_data *data = hdev->driver_data;
790−
791− BT_DBG("%s", hdev->name);
792−
793− kfree(data);
794−}
795−
796790 static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
797791 {
798− struct btusb_data *data = hdev->driver_data;
792+ struct btusb_data *data = hci_get_drvdata(hdev);
799793
800794 BT_DBG("%s evt %d", hdev->name, evt);
801795
@@ -807,7 +801,7 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt) · 5 unmodified lines
807801
808802 static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting)
809803 {
810− struct btusb_data *data = hdev->driver_data;
804+ struct btusb_data *data = hci_get_drvdata(hdev);
811805 struct usb_interface *intf = data->isoc;
812806 struct usb_endpoint_descriptor *ep_desc;
813807 int i, err;
@@ -995,7 +989,7 @@ static int btusb_probe(struct usb_interface *intf, · 181 unmodified lines
995989 }
996990
997991 hdev->bus = HCI_USB;
998− hdev->driver_data = data;
992+ hci_set_drvdata(hdev, data);
999993
1000994 data->hdev = hdev;
1001995
@@ -1005,11 +999,8 @@ static int btusb_probe(struct usb_interface *intf, · 3 unmodified lines
1005999 hdev->close = btusb_close;
10061000 hdev->flush = btusb_flush;
10071001 hdev->send = btusb_send_frame;
1008− hdev->destruct = btusb_destruct;
10091002 hdev->notify = btusb_notify;
10101003
1011− hdev->owner = THIS_MODULE;
1012−
10131004 /* Interface numbers are hardcoded in the specification */
10141005 data->isoc = usb_ifnum_to_if(data->udev, 1);
10151006
@@ -1091,9 +1082,6 @@ static void btusb_disconnect(struct usb_interface *intf) · 75 unmodified lines
10911082 return;
10921083
10931084 hdev = data->hdev;
1094−
1095− __hci_dev_hold(hdev);
1096−
10971085 usb_set_intfdata(data->intf, NULL);
10981086
10991087 if (data->isoc)
@@ -1106,9 +1094,8 @@ static void btusb_disconnect(struct usb_interface *intf) · 6 unmodified lines
11061094 else if (data->isoc)
11071095 usb_driver_release_interface(&btusb_driver, data->isoc);
11081096
1109− __hci_dev_put(hdev);
1110−
11111097 hci_free_dev(hdev);
1098+ kfree(data);
11121099 }
11131100
11141101 #ifdef CONFIG_PM
drivers/bluetooth/btwilink.c+4−14
@@ -161,7 +161,7 @@ static int ti_st_open(struct hci_dev *hdev) · 160 unmodified lines
161161 return -EBUSY;
162162
163163 /* provide contexts for callbacks from ST */
164− hst = hdev->driver_data;
164+ hst = hci_get_drvdata(hdev);
165165
166166 for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
167167 ti_st_proto[i].priv_data = hst;
@@ -236,7 +236,7 @@ done: · 68 unmodified lines
236236 static int ti_st_close(struct hci_dev *hdev)
237237 {
238238 int err, i;
239− struct ti_st *hst = hdev->driver_data;
239+ struct ti_st *hst = hci_get_drvdata(hdev);
240240
241241 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
242242 return 0;
@@ -264,7 +264,7 @@ static int ti_st_send_frame(struct sk_buff *skb) · 21 unmodified lines
264264 if (!test_bit(HCI_RUNNING, &hdev->flags))
265265 return -EBUSY;
266266
267− hst = hdev->driver_data;
267+ hst = hci_get_drvdata(hdev);
268268
269269 /* Prepend skb with frame type */
270270 memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
@@ -291,14 +291,6 @@ static int ti_st_send_frame(struct sk_buff *skb) · 20 unmodified lines
291291 return 0;
292292 }
293293
294−static void ti_st_destruct(struct hci_dev *hdev)
295−{
296− BT_DBG("%s", hdev->name);
297− /* do nothing here, since platform remove
298− * would free the hdev->driver_data
299− */
300−}
301−
302294 static int bt_ti_probe(struct platform_device *pdev)
303295 {
304296 static struct ti_st *hst;
@@ -320,13 +312,11 @@ static int bt_ti_probe(struct platform_device *pdev) · 15 unmodified lines
320312
321313 hst->hdev = hdev;
322314 hdev->bus = HCI_UART;
323− hdev->driver_data = hst;
315+ hci_set_drvdata(hdev, hst);
324316 hdev->open = ti_st_open;
325317 hdev->close = ti_st_close;
326318 hdev->flush = NULL;
327319 hdev->send = ti_st_send_frame;
328− hdev->destruct = ti_st_destruct;
329− hdev->owner = THIS_MODULE;
330320
331321 err = hci_register_dev(hdev);
332322 if (err < 0) {
drivers/bluetooth/dtl1_cs.c+6−28
@@ -83,9 +83,6 @@ typedef struct dtl1_info_t { · 82 unmodified lines
8383
8484
8585 static int dtl1_config(struct pcmcia_device *link);
86−static void dtl1_release(struct pcmcia_device *link);
87−
88−static void dtl1_detach(struct pcmcia_device *p_dev);
8986
9087
9188 /* Transmit states */
@@ -367,7 +364,7 @@ static int dtl1_hci_open(struct hci_dev *hdev) · 275 unmodified lines
367364
368365 static int dtl1_hci_flush(struct hci_dev *hdev)
369366 {
370− dtl1_info_t *info = (dtl1_info_t *)(hdev->driver_data);
367+ dtl1_info_t *info = hci_get_drvdata(hdev);
371368
372369 /* Drop TX queue */
373370 skb_queue_purge(&(info->txq));
@@ -399,7 +396,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb) · 25 unmodified lines
399396 return -ENODEV;
400397 }
401398
402− info = (dtl1_info_t *)(hdev->driver_data);
399+ info = hci_get_drvdata(hdev);
403400
404401 switch (bt_cb(skb)->pkt_type) {
405402 case HCI_COMMAND_PKT:
@@ -442,11 +439,6 @@ static int dtl1_hci_send_frame(struct sk_buff *skb) · 36 unmodified lines
442439 }
443440
444441
445−static void dtl1_hci_destruct(struct hci_dev *hdev)
446−{
447−}
448−
449−
450442 static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
451443 {
452444 return -ENOIOCTLCMD;
@@ -483,18 +475,15 @@ static int dtl1_open(dtl1_info_t *info) · 30 unmodified lines
483475 info->hdev = hdev;
484476
485477 hdev->bus = HCI_PCCARD;
486− hdev->driver_data = info;
478+ hci_set_drvdata(hdev, info);
487479 SET_HCIDEV_DEV(hdev, &info->p_dev->dev);
488480
489481 hdev->open = dtl1_hci_open;
490482 hdev->close = dtl1_hci_close;
491483 hdev->flush = dtl1_hci_flush;
492484 hdev->send = dtl1_hci_send_frame;
493− hdev->destruct = dtl1_hci_destruct;
494485 hdev->ioctl = dtl1_hci_ioctl;
495486
496− hdev->owner = THIS_MODULE;
497−
498487 spin_lock_irqsave(&(info->lock), flags);
499488
500489 /* Reset UART */
@@ -579,8 +568,8 @@ static void dtl1_detach(struct pcmcia_device *link) · 78 unmodified lines
579568 {
580569 dtl1_info_t *info = link->priv;
581570
582− dtl1_release(link);
583−
571+ dtl1_close(info);
572+ pcmcia_disable_device(link);
584573 kfree(info);
585574 }
586575
@@ -619,21 +608,10 @@ static int dtl1_config(struct pcmcia_device *link) · 32 unmodified lines
619608 return 0;
620609
621610 failed:
622− dtl1_release(link);
611+ dtl1_detach(link);
623612 return -ENODEV;
624613 }
625614
626−
627−static void dtl1_release(struct pcmcia_device *link)
628−{
629− dtl1_info_t *info = link->priv;
630−
631− dtl1_close(info);
632−
633− pcmcia_disable_device(link);
634−}
635−
636−
637615 static const struct pcmcia_device_id dtl1_ids[] = {
638616 PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
639617 PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-4", 0xe1bfdd64, 0x9102bc82),
drivers/bluetooth/hci_ath.c+1−1
@@ -112,7 +112,7 @@ static int ath_open(struct hci_uart *hu) · 111 unmodified lines
112112
113113 BT_DBG("hu %p", hu);
114114
115− ath = kzalloc(sizeof(*ath), GFP_ATOMIC);
115+ ath = kzalloc(sizeof(*ath), GFP_KERNEL);
116116 if (!ath)
117117 return -ENOMEM;
118118
drivers/bluetooth/hci_bcsp.c+1−1
@@ -692,7 +692,7 @@ static int bcsp_open(struct hci_uart *hu) · 691 unmodified lines
692692
693693 BT_DBG("hu %p", hu);
694694
695− bcsp = kzalloc(sizeof(*bcsp), GFP_ATOMIC);
695+ bcsp = kzalloc(sizeof(*bcsp), GFP_KERNEL);
696696 if (!bcsp)
697697 return -ENOMEM;
698698
drivers/bluetooth/hci_h4.c+1−1
@@ -69,7 +69,7 @@ static int h4_open(struct hci_uart *hu) · 68 unmodified lines
6969
7070 BT_DBG("hu %p", hu);
7171
72− h4 = kzalloc(sizeof(*h4), GFP_ATOMIC);
72+ h4 = kzalloc(sizeof(*h4), GFP_KERNEL);
7373 if (!h4)
7474 return -ENOMEM;
7575
drivers/bluetooth/hci_ldisc.c+12−22
@@ -48,8 +48,6 @@ · 47 unmodified lines
4848
4949 #define VERSION "2.2"
5050
51−static bool reset = 0;
52−
5351 static struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];
5452
5553 int hci_uart_register_proto(struct hci_uart_proto *p)
@@ -174,7 +172,7 @@ static int hci_uart_open(struct hci_dev *hdev) · 118 unmodified lines
174172 /* Reset device */
175173 static int hci_uart_flush(struct hci_dev *hdev)
176174 {
177− struct hci_uart *hu = (struct hci_uart *) hdev->driver_data;
175+ struct hci_uart *hu = hci_get_drvdata(hdev);
178176 struct tty_struct *tty = hu->tty;
179177
180178 BT_DBG("hdev %p tty %p", hdev, tty);
@@ -220,7 +218,7 @@ static int hci_uart_send_frame(struct sk_buff *skb) · 39 unmodified lines
220218 if (!test_bit(HCI_RUNNING, &hdev->flags))
221219 return -EBUSY;
222220
223− hu = (struct hci_uart *) hdev->driver_data;
221+ hu = hci_get_drvdata(hdev);
224222
225223 BT_DBG("%s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
226224
@@ -231,15 +229,6 @@ static int hci_uart_send_frame(struct sk_buff *skb) · 4 unmodified lines
231229 return 0;
232230 }
233231
234−static void hci_uart_destruct(struct hci_dev *hdev)
235−{
236− if (!hdev)
237− return;
238−
239− BT_DBG("%s", hdev->name);
240− kfree(hdev->driver_data);
241−}
242−
243232 /* ------ LDISC part ------ */
244233 /* hci_uart_tty_open
245234 *
@@ -316,6 +305,8 @@ static void hci_uart_tty_close(struct tty_struct *tty) · 70 unmodified lines
316305 hci_free_dev(hdev);
317306 }
318307 }
308+
309+ kfree(hu);
319310 }
320311 }
321312
@@ -391,22 +382,24 @@ static int hci_uart_register_dev(struct hci_uart *hu) · 69 unmodified lines
391382 hu->hdev = hdev;
392383
393384 hdev->bus = HCI_UART;
394− hdev->driver_data = hu;
385+ hci_set_drvdata(hdev, hu);
395386
396387 hdev->open = hci_uart_open;
397388 hdev->close = hci_uart_close;
398389 hdev->flush = hci_uart_flush;
399390 hdev->send = hci_uart_send_frame;
400− hdev->destruct = hci_uart_destruct;
401391 hdev->parent = hu->tty->dev;
402392
403− hdev->owner = THIS_MODULE;
393+ if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
394+ set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
404395
405− if (!reset)
396+ if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
406397 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
407398
408− if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
409− set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
399+ if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
400+ hdev->dev_type = HCI_AMP;
401+ else
402+ hdev->dev_type = HCI_BREDR;
410403
411404 if (hci_register_dev(hdev) < 0) {
412405 BT_ERR("Can't register HCI device");
@@ -594,9 +587,6 @@ static void __exit hci_uart_exit(void) · 181 unmodified lines
594587 module_init(hci_uart_init);
595588 module_exit(hci_uart_exit);
596589
597−module_param(reset, bool, 0644);
598−MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
599−
600590 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
601591 MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
602592 MODULE_VERSION(VERSION);
drivers/bluetooth/hci_ll.c+1−1
@@ -125,7 +125,7 @@ static int ll_open(struct hci_uart *hu) · 124 unmodified lines
125125
126126 BT_DBG("hu %p", hu);
127127
128− ll = kzalloc(sizeof(*ll), GFP_ATOMIC);
128+ ll = kzalloc(sizeof(*ll), GFP_KERNEL);
129129 if (!ll)
130130 return -ENOMEM;
131131
drivers/bluetooth/hci_uart.h+2−0
@@ -45,6 +45,8 @@ · 44 unmodified lines
4545 #define HCI_UART_ATH3K 5
4646
4747 #define HCI_UART_RAW_DEVICE 0
48+#define HCI_UART_RESET_ON_INIT 1
49+#define HCI_UART_CREATE_AMP 2
4850
4951 struct hci_uart;
5052
drivers/bluetooth/hci_vhci.c+5−12
@@ -61,7 +61,7 @@ static int vhci_open_dev(struct hci_dev *hdev) · 60 unmodified lines
6161
6262 static int vhci_close_dev(struct hci_dev *hdev)
6363 {
64− struct vhci_data *data = hdev->driver_data;
64+ struct vhci_data *data = hci_get_drvdata(hdev);
6565
6666 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
6767 return 0;
@@ -73,7 +73,7 @@ static int vhci_close_dev(struct hci_dev *hdev) · 5 unmodified lines
7373
7474 static int vhci_flush(struct hci_dev *hdev)
7575 {
76− struct vhci_data *data = hdev->driver_data;
76+ struct vhci_data *data = hci_get_drvdata(hdev);
7777
7878 skb_queue_purge(&data->readq);
7979
@@ -93,7 +93,7 @@ static int vhci_send_frame(struct sk_buff *skb) · 13 unmodified lines
9393 if (!test_bit(HCI_RUNNING, &hdev->flags))
9494 return -EBUSY;
9595
96− data = hdev->driver_data;
96+ data = hci_get_drvdata(hdev);
9797
9898 memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
9999 skb_queue_tail(&data->readq, skb);
@@ -103,11 +103,6 @@ static int vhci_send_frame(struct sk_buff *skb) · 3 unmodified lines
103103 return 0;
104104 }
105105
106−static void vhci_destruct(struct hci_dev *hdev)
107−{
108− kfree(hdev->driver_data);
109−}
110−
111106 static inline ssize_t vhci_get_user(struct vhci_data *data,
112107 const char __user *buf, size_t count)
113108 {
@@ -239,7 +234,7 @@ static int vhci_open(struct inode *inode, struct file *file) · 125 unmodified lines
239234 data->hdev = hdev;
240235
241236 hdev->bus = HCI_VIRTUAL;
242− hdev->driver_data = data;
237+ hci_set_drvdata(hdev, data);
243238
244239 if (amp)
245240 hdev->dev_type = HCI_AMP;
@@ -248,9 +243,6 @@ static int vhci_open(struct inode *inode, struct file *file) · 2 unmodified lines
248243 hdev->close = vhci_close_dev;
249244 hdev->flush = vhci_flush;
250245 hdev->send = vhci_send_frame;
251− hdev->destruct = vhci_destruct;
252−
253− hdev->owner = THIS_MODULE;
254246
255247 if (hci_register_dev(hdev) < 0) {
256248 BT_ERR("Can't register HCI device");
@@ -273,6 +265,7 @@ static int vhci_release(struct inode *inode, struct file *file) · 16 unmodified lines
273265 hci_free_dev(hdev);
274266
275267 file->private_data = NULL;
268+ kfree(data);
276269
277270 return 0;
278271 }
drivers/infiniband/core/addr.c+9−5
@@ -178,22 +178,26 @@ static void queue_req(struct addr_req *req) · 177 unmodified lines
178178 mutex_unlock(&lock);
179179 }
180180
181−static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *addr)
181+static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr, void *daddr)
182182 {
183183 struct neighbour *n;
184184 int ret;
185185
186+ n = dst_neigh_lookup(dst, daddr);
187+
186188 rcu_read_lock();
187− n = dst_get_neighbour_noref(dst);
188189 if (!n || !(n->nud_state & NUD_VALID)) {
189190 if (n)
190191 neigh_event_send(n, NULL);
191192 ret = -ENODATA;
192193 } else {
193− ret = rdma_copy_addr(addr, dst->dev, n->ha);
194+ ret = rdma_copy_addr(dev_addr, dst->dev, n->ha);
194195 }
195196 rcu_read_unlock();
196197
198+ if (n)
199+ neigh_release(n);
200+
197201 return ret;
198202 }
199203
@@ -232,7 +236,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, · 32 unmodified lines
232236 goto put;
233237 }
234238
235− ret = dst_fetch_ha(&rt->dst, addr);
239+ ret = dst_fetch_ha(&rt->dst, addr, &fl4.daddr);
236240 put:
237241 ip_rt_put(rt);
238242 out:
@@ -280,7 +284,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, · 41 unmodified lines
280284 goto put;
281285 }
282286
283− ret = dst_fetch_ha(dst, addr);
287+ ret = dst_fetch_ha(dst, addr, &fl6.daddr);
284288 put:
285289 dst_release(dst);
286290 return ret;
drivers/infiniband/core/netlink.c+7−3
@@ -147,9 +147,13 @@ static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) · 146 unmodified lines
147147 if (op < 0 || op >= client->nops ||
148148 !client->cb_table[RDMA_NL_GET_OP(op)].dump)
149149 return -EINVAL;
150− return netlink_dump_start(nls, skb, nlh,
151− client->cb_table[op].dump,
152− NULL, 0);
150+
151+ {
152+ struct netlink_dump_control c = {
153+ .dump = client->cb_table[op].dump,
154+ };
155+ return netlink_dump_start(nls, skb, nlh, &c);
156+ }
153157 }
154158 }
155159
drivers/infiniband/hw/cxgb4/cm.c+6−4
@@ -1562,11 +1562,11 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst, · 1561 unmodified lines
15621562 struct neighbour *n;
15631563 int err, step;
15641564
1565− rcu_read_lock();
1566− n = dst_get_neighbour_noref(dst);
1567− err = -ENODEV;
1565+ n = dst_neigh_lookup(dst, &peer_ip);
15681566 if (!n)
1569− goto out;
1567+ return -ENODEV;
1568+
1569+ rcu_read_lock();
15701570 err = -ENOMEM;
15711571 if (n->dev->flags & IFF_LOOPBACK) {
15721572 struct net_device *pdev;
@@ -1614,6 +1614,8 @@ static int import_ep(struct c4iw_ep *ep, __be32 peer_ip, struct dst_entry *dst, · 41 unmodified lines
16141614 out:
16151615 rcu_read_unlock();
16161616
1617+ neigh_release(n);
1618+
16171619 return err;
16181620 }
16191621
drivers/infiniband/hw/nes/nes_cm.c+6−2
@@ -1351,8 +1351,9 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi · 1350 unmodified lines
13511351 else
13521352 netdev = nesvnic->netdev;
13531353
1354+ neigh = dst_neigh_lookup(&rt->dst, &dst_ip);
1355+
13541356 rcu_read_lock();
1355− neigh = dst_get_neighbour_noref(&rt->dst);
13561357 if (neigh) {
13571358 if (neigh->nud_state & NUD_VALID) {
13581359 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
@@ -1379,9 +1380,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi · 20 unmodified lines
13791380 neigh_event_send(neigh, NULL);
13801381 }
13811382 }
1382−
13831383 out:
13841384 rcu_read_unlock();
1385+
1386+ if (neigh)
1387+ neigh_release(neigh);
1388+
13851389 ip_rt_put(rt);
13861390 return rc;
13871391 }
drivers/isdn/act2000/act2000.h+14−14
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Author Fritz Elfert
66 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -40,21 +40,21 @@ · 29 unmodified lines
4040 /* Struct for adding new cards */
4141 typedef struct act2000_cdef {
4242 int bus;
43− int port;
44− int irq;
45− char id[10];
43+ int port;
44+ int irq;
45+ char id[10];
4646 } act2000_cdef;
4747
4848 /* Struct for downloading firmware */
4949 typedef struct act2000_ddef {
50− int length; /* Length of code */
51− char __user *buffer; /* Ptr. to code */
50+ int length; /* Length of code */
51+ char __user *buffer; /* Ptr. to code */
5252 } act2000_ddef;
5353
5454 typedef struct act2000_fwid {
55− char isdn[4];
56− char revlen[2];
57− char revision[504];
55+ char isdn[4];
56+ char revlen[2];
57+ char revision[504];
5858 } act2000_fwid;
5959
6060 #if defined(__KERNEL__) || defined(__DEBUGVAR__)
@@ -128,8 +128,8 @@ typedef struct act2000_chan { · 67 unmodified lines
128128
129129 typedef struct msn_entry {
130130 char eaz;
131− char msn[16];
132− struct msn_entry * next;
131+ char msn[16];
132+ struct msn_entry *next;
133133 } msn_entry;
134134
135135 typedef struct irq_data_isa {
@@ -183,17 +183,17 @@ typedef struct act2000_card { · 47 unmodified lines
183183
184184 static inline void act2000_schedule_tx(act2000_card *card)
185185 {
186− schedule_work(&card->snd_tq);
186+ schedule_work(&card->snd_tq);
187187 }
188188
189189 static inline void act2000_schedule_rx(act2000_card *card)
190190 {
191− schedule_work(&card->rcv_tq);
191+ schedule_work(&card->rcv_tq);
192192 }
193193
194194 static inline void act2000_schedule_poll(act2000_card *card)
195195 {
196− schedule_work(&card->poll_tq);
196+ schedule_work(&card->poll_tq);
197197 }
198198
199199 extern char *act2000_find_eaz(act2000_card *, char);
drivers/isdn/act2000/act2000_isa.c+197−197
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Author Fritz Elfert
66 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -25,99 +25,99 @@ · 14 unmodified lines
2525 static int
2626 act2000_isa_reset(unsigned short portbase)
2727 {
28− unsigned char reg;
29− int i;
30− int found;
31− int serial = 0;
32−
33− found = 0;
34− if ((reg = inb(portbase + ISA_COR)) != 0xff) {
35− outb(reg | ISA_COR_RESET, portbase + ISA_COR);
36− mdelay(10);
37− outb(reg, portbase + ISA_COR);
38− mdelay(10);
39−
40− for (i = 0; i < 16; i++) {
41− if (inb(portbase + ISA_ISR) & ISA_ISR_SERIAL)
42− serial |= 0x10000;
43− serial >>= 1;
44− }
45− if (serial == ISA_SER_ID)
46− found++;
47− }
48− return found;
28+ unsigned char reg;
29+ int i;
30+ int found;
31+ int serial = 0;
32+
33+ found = 0;
34+ if ((reg = inb(portbase + ISA_COR)) != 0xff) {
35+ outb(reg | ISA_COR_RESET, portbase + ISA_COR);
36+ mdelay(10);
37+ outb(reg, portbase + ISA_COR);
38+ mdelay(10);
39+
40+ for (i = 0; i < 16; i++) {
41+ if (inb(portbase + ISA_ISR) & ISA_ISR_SERIAL)
42+ serial |= 0x10000;
43+ serial >>= 1;
44+ }
45+ if (serial == ISA_SER_ID)
46+ found++;
47+ }
48+ return found;
4949 }
5050
5151 int
5252 act2000_isa_detect(unsigned short portbase)
5353 {
54− int ret = 0;
54+ int ret = 0;
5555
5656 if (request_region(portbase, ACT2000_PORTLEN, "act2000isa")) {
57− ret = act2000_isa_reset(portbase);
57+ ret = act2000_isa_reset(portbase);
5858 release_region(portbase, ISA_REGION);
5959 }
60− return ret;
60+ return ret;
6161 }
6262
6363 static irqreturn_t
6464 act2000_isa_interrupt(int dummy, void *dev_id)
6565 {
66− act2000_card *card = dev_id;
67− u_char istatus;
66+ act2000_card *card = dev_id;
67+ u_char istatus;
6868
69− istatus = (inb(ISA_PORT_ISR) & 0x07);
70− if (istatus & ISA_ISR_OUT) {
71− /* RX fifo has data */
69+ istatus = (inb(ISA_PORT_ISR) & 0x07);
70+ if (istatus & ISA_ISR_OUT) {
71+ /* RX fifo has data */
7272 istatus &= ISA_ISR_OUT_MASK;
7373 outb(0, ISA_PORT_SIS);
7474 act2000_isa_receive(card);
7575 outb(ISA_SIS_INT, ISA_PORT_SIS);
76− }
77− if (istatus & ISA_ISR_ERR) {
78− /* Error Interrupt */
76+ }
77+ if (istatus & ISA_ISR_ERR) {
78+ /* Error Interrupt */
7979 istatus &= ISA_ISR_ERR_MASK;
80− printk(KERN_WARNING "act2000: errIRQ\n");
81− }
80+ printk(KERN_WARNING "act2000: errIRQ\n");
81+ }
8282 if (istatus)
8383 printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus);
8484 return IRQ_HANDLED;
8585 }
8686
8787 static void
88−act2000_isa_select_irq(act2000_card * card)
88+act2000_isa_select_irq(act2000_card *card)
8989 {
9090 unsigned char reg;
9191
9292 reg = (inb(ISA_PORT_COR) & ~ISA_COR_IRQOFF) | ISA_COR_PERR;
9393 switch (card->irq) {
94− case 3:
95− reg = ISA_COR_IRQ03;
96− break;
97− case 5:
98− reg = ISA_COR_IRQ05;
99− break;
100− case 7:
101− reg = ISA_COR_IRQ07;
102− break;
103− case 10:
104− reg = ISA_COR_IRQ10;
105− break;
106− case 11:
107− reg = ISA_COR_IRQ11;
108− break;
109− case 12:
110− reg = ISA_COR_IRQ12;
111− break;
112− case 15:
113− reg = ISA_COR_IRQ15;
114− break;
94+ case 3:
95+ reg = ISA_COR_IRQ03;
96+ break;
97+ case 5:
98+ reg = ISA_COR_IRQ05;
99+ break;
100+ case 7:
101+ reg = ISA_COR_IRQ07;
102+ break;
103+ case 10:
104+ reg = ISA_COR_IRQ10;
105+ break;
106+ case 11:
107+ reg = ISA_COR_IRQ11;
108+ break;
109+ case 12:
110+ reg = ISA_COR_IRQ12;
111+ break;
112+ case 15:
113+ reg = ISA_COR_IRQ15;
114+ break;
115115 }
116116 outb(reg, ISA_PORT_COR);
117117 }
118118
119119 static void
120−act2000_isa_enable_irq(act2000_card * card)
120+act2000_isa_enable_irq(act2000_card *card)
121121 {
122122 act2000_isa_select_irq(card);
123123 /* Enable READ irq */
@@ -129,102 +129,102 @@ act2000_isa_enable_irq(act2000_card * card) · 5 unmodified lines
129129 * If irq is -1, choose next free irq, else irq is given explicitly.
130130 */
131131 int
132−act2000_isa_config_irq(act2000_card * card, short irq)
132+act2000_isa_config_irq(act2000_card *card, short irq)
133133 {
134134 int old_irq;
135135
136− if (card->flags & ACT2000_FLAGS_IVALID) {
137− free_irq(card->irq, card);
138− }
139− card->flags &= ~ACT2000_FLAGS_IVALID;
140− outb(ISA_COR_IRQOFF, ISA_PORT_COR);
141− if (!irq)
142− return 0;
136+ if (card->flags & ACT2000_FLAGS_IVALID) {
137+ free_irq(card->irq, card);
138+ }
139+ card->flags &= ~ACT2000_FLAGS_IVALID;
140+ outb(ISA_COR_IRQOFF, ISA_PORT_COR);
141+ if (!irq)
142+ return 0;
143143
144144 old_irq = card->irq;
145145 card->irq = irq;
146146 if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
147147 card->irq = old_irq;
148148 card->flags |= ACT2000_FLAGS_IVALID;
149− printk(KERN_WARNING
150− "act2000: Could not request irq %d\n",irq);
151− return -EBUSY;
152− } else {
149+ printk(KERN_WARNING
150+ "act2000: Could not request irq %d\n", irq);
151+ return -EBUSY;
152+ } else {
153153 act2000_isa_select_irq(card);
154− /* Disable READ and WRITE irq */
155− outb(0, ISA_PORT_SIS);
156− outb(0, ISA_PORT_SOS);
157− }
158− return 0;
154+ /* Disable READ and WRITE irq */
155+ outb(0, ISA_PORT_SIS);
156+ outb(0, ISA_PORT_SOS);
157+ }
158+ return 0;
159159 }
160160
161161 int
162−act2000_isa_config_port(act2000_card * card, unsigned short portbase)
162+act2000_isa_config_port(act2000_card *card, unsigned short portbase)
163163 {
164− if (card->flags & ACT2000_FLAGS_PVALID) {
165− release_region(card->port, ISA_REGION);
166− card->flags &= ~ACT2000_FLAGS_PVALID;
167− }
164+ if (card->flags & ACT2000_FLAGS_PVALID) {
165+ release_region(card->port, ISA_REGION);
166+ card->flags &= ~ACT2000_FLAGS_PVALID;
167+ }
168168 if (request_region(portbase, ACT2000_PORTLEN, card->regname) == NULL)
169169 return -EBUSY;
170170 else {
171− card->port = portbase;
172− card->flags |= ACT2000_FLAGS_PVALID;
173− return 0;
174− }
171+ card->port = portbase;
172+ card->flags |= ACT2000_FLAGS_PVALID;
173+ return 0;
174+ }
175175 }
176176
177177 /*
178178 * Release ressources, used by an adaptor.
179179 */
180180 void
181−act2000_isa_release(act2000_card * card)
181+act2000_isa_release(act2000_card *card)
182182 {
183− unsigned long flags;
183+ unsigned long flags;
184184
185− spin_lock_irqsave(&card->lock, flags);
186− if (card->flags & ACT2000_FLAGS_IVALID)
187− free_irq(card->irq, card);
185+ spin_lock_irqsave(&card->lock, flags);
186+ if (card->flags & ACT2000_FLAGS_IVALID)
187+ free_irq(card->irq, card);
188188
189− card->flags &= ~ACT2000_FLAGS_IVALID;
190− if (card->flags & ACT2000_FLAGS_PVALID)
191− release_region(card->port, ISA_REGION);
192− card->flags &= ~ACT2000_FLAGS_PVALID;
193− spin_unlock_irqrestore(&card->lock, flags);
189+ card->flags &= ~ACT2000_FLAGS_IVALID;
190+ if (card->flags & ACT2000_FLAGS_PVALID)
191+ release_region(card->port, ISA_REGION);
192+ card->flags &= ~ACT2000_FLAGS_PVALID;
193+ spin_unlock_irqrestore(&card->lock, flags);
194194 }
195195
196196 static int
197−act2000_isa_writeb(act2000_card * card, u_char data)
197+act2000_isa_writeb(act2000_card *card, u_char data)
198198 {
199− u_char timeout = 40;
200−
201− while (timeout) {
202− if (inb(ISA_PORT_SOS) & ISA_SOS_READY) {
203− outb(data, ISA_PORT_SDO);
204− return 0;
205− } else {
206− timeout--;
207− udelay(10);
208− }
209− }
210− return 1;
199+ u_char timeout = 40;
200+
201+ while (timeout) {
202+ if (inb(ISA_PORT_SOS) & ISA_SOS_READY) {
203+ outb(data, ISA_PORT_SDO);
204+ return 0;
205+ } else {
206+ timeout--;
207+ udelay(10);
208+ }
209+ }
210+ return 1;
211211 }
212212
213213 static int
214−act2000_isa_readb(act2000_card * card, u_char * data)
214+act2000_isa_readb(act2000_card *card, u_char *data)
215215 {
216− u_char timeout = 40;
217−
218− while (timeout) {
219− if (inb(ISA_PORT_SIS) & ISA_SIS_READY) {
220− *data = inb(ISA_PORT_SDI);
221− return 0;
222− } else {
223− timeout--;
224− udelay(10);
225− }
226− }
227− return 1;
216+ u_char timeout = 40;
217+
218+ while (timeout) {
219+ if (inb(ISA_PORT_SIS) & ISA_SIS_READY) {
220+ *data = inb(ISA_PORT_SDI);
221+ return 0;
222+ } else {
223+ timeout--;
224+ udelay(10);
225+ }
226+ }
227+ return 1;
228228 }
229229
230230 void
@@ -232,11 +232,11 @@ act2000_isa_receive(act2000_card *card) · 1 unmodified line
232232 {
233233 u_char c;
234234
235− if (test_and_set_bit(ACT2000_LOCK_RX, (void *) &card->ilock) != 0)
235+ if (test_and_set_bit(ACT2000_LOCK_RX, (void *) &card->ilock) != 0)
236236 return;
237237 while (!act2000_isa_readb(card, &c)) {
238238 if (card->idat.isa.rcvidx < 8) {
239− card->idat.isa.rcvhdr[card->idat.isa.rcvidx++] = c;
239+ card->idat.isa.rcvhdr[card->idat.isa.rcvidx++] = c;
240240 if (card->idat.isa.rcvidx == 8) {
241241 int valid = actcapi_chkhdr(card, (actcapi_msghdr *)&card->idat.isa.rcvhdr);
242242
@@ -291,14 +291,14 @@ act2000_isa_receive(act2000_card *card) · 48 unmodified lines
291291 }
292292
293293 void
294−act2000_isa_send(act2000_card * card)
294+act2000_isa_send(act2000_card *card)
295295 {
296296 unsigned long flags;
297297 struct sk_buff *skb;
298298 actcapi_msg *msg;
299299 int l;
300300
301− if (test_and_set_bit(ACT2000_LOCK_TX, (void *) &card->ilock) != 0)
301+ if (test_and_set_bit(ACT2000_LOCK_TX, (void *) &card->ilock) != 0)
302302 return;
303303 while (1) {
304304 spin_lock_irqsave(&card->lock, flags);
@@ -307,7 +307,7 @@ act2000_isa_send(act2000_card * card) · 2 unmodified lines
307307 card->ack_msg = card->sbuf->data;
308308 msg = (actcapi_msg *)card->sbuf->data;
309309 if ((msg->hdr.cmd.cmd == 0x86) &&
310− (msg->hdr.cmd.subcmd == 0) ) {
310+ (msg->hdr.cmd.subcmd == 0)) {
311311 /* Save flags in message */
312312 card->need_b3ack = msg->msg.data_b3_req.flags;
313313 msg->msg.data_b3_req.flags = 0;
@@ -335,7 +335,7 @@ act2000_isa_send(act2000_card * card) · 21 unmodified lines
335335 }
336336 msg = (actcapi_msg *)card->ack_msg;
337337 if ((msg->hdr.cmd.cmd == 0x86) &&
338− (msg->hdr.cmd.subcmd == 0) ) {
338+ (msg->hdr.cmd.subcmd == 0)) {
339339 /*
340340 * If it's user data, reset data-ptr
341341 * and put skb into ackq.
@@ -354,90 +354,90 @@ act2000_isa_send(act2000_card * card) · 12 unmodified lines
354354 * Get firmware ID, check for 'ISDN' signature.
355355 */
356356 static int
357−act2000_isa_getid(act2000_card * card)
357+act2000_isa_getid(act2000_card *card)
358358 {
359359
360− act2000_fwid fid;
361− u_char *p = (u_char *) & fid;
362− int count = 0;
363−
364− while (1) {
365− if (count > 510)
366− return -EPROTO;
367− if (act2000_isa_readb(card, p++))
368− break;
369− count++;
370− }
371− if (count <= 20) {
372− printk(KERN_WARNING "act2000: No Firmware-ID!\n");
373− return -ETIME;
374− }
375− *p = '\0';
376− fid.revlen[0] = '\0';
377− if (strcmp(fid.isdn, "ISDN")) {
378− printk(KERN_WARNING "act2000: Wrong Firmware-ID!\n");
379− return -EPROTO;
380− }
360+ act2000_fwid fid;
361+ u_char *p = (u_char *)&fid;
362+ int count = 0;
363+
364+ while (1) {
365+ if (count > 510)
366+ return -EPROTO;
367+ if (act2000_isa_readb(card, p++))
368+ break;
369+ count++;
370+ }
371+ if (count <= 20) {
372+ printk(KERN_WARNING "act2000: No Firmware-ID!\n");
373+ return -ETIME;
374+ }
375+ *p = '\0';
376+ fid.revlen[0] = '\0';
377+ if (strcmp(fid.isdn, "ISDN")) {
378+ printk(KERN_WARNING "act2000: Wrong Firmware-ID!\n");
379+ return -EPROTO;
380+ }
381381 if ((p = strchr(fid.revision, '\n')))
382382 *p = '\0';
383− printk(KERN_INFO "act2000: Firmware-ID: %s\n", fid.revision);
383+ printk(KERN_INFO "act2000: Firmware-ID: %s\n", fid.revision);
384384 if (card->flags & ACT2000_FLAGS_IVALID) {
385385 printk(KERN_DEBUG "Enabling Interrupts ...\n");
386386 act2000_isa_enable_irq(card);
387387 }
388− return 0;
388+ return 0;
389389 }
390390
391391 /*
392392 * Download microcode into card, check Firmware signature.
393393 */
394394 int
395−act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
395+act2000_isa_download(act2000_card *card, act2000_ddef __user *cb)
396396 {
397− unsigned int length;
398− int l;
399− int c;
400− long timeout;
401− u_char *b;
402− u_char __user *p;
403− u_char *buf;
404− act2000_ddef cblock;
405−
406− if (!act2000_isa_reset(card->port))
407− return -ENXIO;
408− msleep_interruptible(500);
409− if (copy_from_user(&cblock, cb, sizeof(cblock)))
410− return -EFAULT;
411− length = cblock.length;
412− p = cblock.buffer;
413− if (!access_ok(VERIFY_READ, p, length))
414− return -EFAULT;
415− buf = kmalloc(1024, GFP_KERNEL);
416− if (!buf)
417− return -ENOMEM;
418− timeout = 0;
419− while (length) {
420− l = (length > 1024) ? 1024 : length;
421− c = 0;
422− b = buf;
423− if (copy_from_user(buf, p, l)) {
424− kfree(buf);
425− return -EFAULT;
426− }
427− while (c < l) {
428− if (act2000_isa_writeb(card, *b++)) {
429− printk(KERN_WARNING
430− "act2000: loader timed out"
431− " len=%d c=%d\n", length, c);
432− kfree(buf);
433− return -ETIME;
434− }
435− c++;
436− }
437− length -= l;
438− p += l;
439− }
440− kfree(buf);
441− msleep_interruptible(500);
442− return (act2000_isa_getid(card));
397+ unsigned int length;
398+ int l;
399+ int c;
400+ long timeout;
401+ u_char *b;
402+ u_char __user *p;
403+ u_char *buf;
404+ act2000_ddef cblock;
405+
406+ if (!act2000_isa_reset(card->port))
407+ return -ENXIO;
408+ msleep_interruptible(500);
409+ if (copy_from_user(&cblock, cb, sizeof(cblock)))
410+ return -EFAULT;
411+ length = cblock.length;
412+ p = cblock.buffer;
413+ if (!access_ok(VERIFY_READ, p, length))
414+ return -EFAULT;
415+ buf = kmalloc(1024, GFP_KERNEL);
416+ if (!buf)
417+ return -ENOMEM;
418+ timeout = 0;
419+ while (length) {
420+ l = (length > 1024) ? 1024 : length;
421+ c = 0;
422+ b = buf;
423+ if (copy_from_user(buf, p, l)) {
424+ kfree(buf);
425+ return -EFAULT;
426+ }
427+ while (c < l) {
428+ if (act2000_isa_writeb(card, *b++)) {
429+ printk(KERN_WARNING
430+ "act2000: loader timed out"
431+ " len=%d c=%d\n", length, c);
432+ kfree(buf);
433+ return -ETIME;
434+ }
435+ c++;
436+ }
437+ length -= l;
438+ p += l;
439+ }
440+ kfree(buf);
441+ msleep_interruptible(500);
442+ return (act2000_isa_getid(card));
443443 }
drivers/isdn/act2000/act2000_isa.h+16−16
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Author Fritz Elfert
66 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -18,9 +18,9 @@ · 7 unmodified lines
1818 #define ISA_POLL_LOOP 40 /* Try to read-write before give up */
1919
2020 typedef enum {
21− INT_NO_CHANGE = 0, /* Do not change the Mask */
22− INT_ON = 1, /* Set to Enable */
23− INT_OFF = 2, /* Set to Disable */
21+ INT_NO_CHANGE = 0, /* Do not change the Mask */
22+ INT_ON = 1, /* Set to Enable */
23+ INT_OFF = 2, /* Set to Disable */
2424 } ISA_INT_T;
2525
2626 /**************************************************************************/
@@ -114,22 +114,22 @@ typedef enum { · 87 unmodified lines
114114
115115
116116 /* Macros for accessing ports */
117−#define ISA_PORT_COR (card->port+ISA_COR)
118−#define ISA_PORT_ISR (card->port+ISA_ISR)
119−#define ISA_PORT_EPR (card->port+ISA_EPR)
120−#define ISA_PORT_EER (card->port+ISA_EER)
121−#define ISA_PORT_SDI (card->port+ISA_SDI)
122−#define ISA_PORT_SDO (card->port+ISA_SDO)
123−#define ISA_PORT_SIS (card->port+ISA_SIS)
124−#define ISA_PORT_SOS (card->port+ISA_SOS)
117+#define ISA_PORT_COR (card->port + ISA_COR)
118+#define ISA_PORT_ISR (card->port + ISA_ISR)
119+#define ISA_PORT_EPR (card->port + ISA_EPR)
120+#define ISA_PORT_EER (card->port + ISA_EER)
121+#define ISA_PORT_SDI (card->port + ISA_SDI)
122+#define ISA_PORT_SDO (card->port + ISA_SDO)
123+#define ISA_PORT_SIS (card->port + ISA_SIS)
124+#define ISA_PORT_SOS (card->port + ISA_SOS)
125125
126126 /* Prototypes */
127127
128128 extern int act2000_isa_detect(unsigned short portbase);
129−extern int act2000_isa_config_irq(act2000_card * card, short irq);
130−extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase);
131−extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb);
132−extern void act2000_isa_release(act2000_card * card);
129+extern int act2000_isa_config_irq(act2000_card *card, short irq);
130+extern int act2000_isa_config_port(act2000_card *card, unsigned short portbase);
131+extern int act2000_isa_download(act2000_card *card, act2000_ddef __user *cb);
132+extern void act2000_isa_release(act2000_card *card);
133133 extern void act2000_isa_receive(act2000_card *card);
134134 extern void act2000_isa_send(act2000_card *card);
135135
drivers/isdn/act2000/capi.c+499−499
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 *
66 * Author Fritz Elfert
77 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
8− *
8+ *
99 * This software may be used and distributed according to the terms
1010 * of the GNU General Public License, incorporated herein by reference.
1111 *
@@ -64,14 +64,14 @@ static actcapi_msgdsc valid_msg[] = { · 52 unmodified lines
6464 {{ 0x86, 0x00}, "DATA_B3_REQ"},
6565 {{ 0xff, 0x00}, "MANUFACTURER_REQ"},
6666 /* Responses */
67− {{ 0x01, 0x03}, "RESET_B3_RESP"},
68− {{ 0x02, 0x03}, "CONNECT_RESP"},
69− {{ 0x03, 0x03}, "CONNECT_ACTIVE_RESP"},
70− {{ 0x04, 0x03}, "DISCONNECT_RESP"},
71− {{ 0x07, 0x03}, "INFO_RESP"},
72− {{ 0x08, 0x03}, "DATA_RESP"},
73− {{ 0x82, 0x03}, "CONNECT_B3_RESP"},
74− {{ 0x83, 0x03}, "CONNECT_B3_ACTIVE_RESP"},
67+ {{ 0x01, 0x03}, "RESET_B3_RESP"},
68+ {{ 0x02, 0x03}, "CONNECT_RESP"},
69+ {{ 0x03, 0x03}, "CONNECT_ACTIVE_RESP"},
70+ {{ 0x04, 0x03}, "DISCONNECT_RESP"},
71+ {{ 0x07, 0x03}, "INFO_RESP"},
72+ {{ 0x08, 0x03}, "DATA_RESP"},
73+ {{ 0x82, 0x03}, "CONNECT_B3_RESP"},
74+ {{ 0x83, 0x03}, "CONNECT_B3_ACTIVE_RESP"},
7575 {{ 0x84, 0x03}, "DISCONNECT_B3_RESP"},
7676 {{ 0x86, 0x03}, "DATA_B3_RESP"},
7777 {{ 0xff, 0x03}, "MANUFACTURER_RESP"},
@@ -88,7 +88,7 @@ static actcapi_msgdsc valid_msg[] = { · 10 unmodified lines
8888 * 2 = Valid message, B-Channel-data
8989 */
9090 int
91−actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr)
91+actcapi_chkhdr(act2000_card *card, actcapi_msghdr *hdr)
9292 {
9393 int i;
9494
@@ -99,33 +99,33 @@ actcapi_chkhdr(act2000_card * card, actcapi_msghdr *hdr) · 4 unmodified lines
9999 for (i = 0; i < num_valid_imsg; i++)
100100 if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) &&
101101 (hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) {
102− return (i?1:2);
102+ return (i ? 1 : 2);
103103 }
104104 return 0;
105105 }
106106
107−#define ACTCAPI_MKHDR(l, c, s) { \
108− skb = alloc_skb(l + 8, GFP_ATOMIC); \
109− if (skb) { \
110− m = (actcapi_msg *)skb_put(skb, l + 8); \
111− m->hdr.len = l + 8; \
112− m->hdr.applicationID = 1; \
113− m->hdr.cmd.cmd = c; \
114− m->hdr.cmd.subcmd = s; \
115− m->hdr.msgnum = actcapi_nextsmsg(card); \
116− } else m = NULL;\
117−}
107+#define ACTCAPI_MKHDR(l, c, s) { \
108+ skb = alloc_skb(l + 8, GFP_ATOMIC); \
109+ if (skb) { \
110+ m = (actcapi_msg *)skb_put(skb, l + 8); \
111+ m->hdr.len = l + 8; \
112+ m->hdr.applicationID = 1; \
113+ m->hdr.cmd.cmd = c; \
114+ m->hdr.cmd.subcmd = s; \
115+ m->hdr.msgnum = actcapi_nextsmsg(card); \
116+ } else m = NULL; \
117+ }
118118
119−#define ACTCAPI_CHKSKB if (!skb) { \
120− printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \
121− return; \
122−}
119+#define ACTCAPI_CHKSKB if (!skb) { \
120+ printk(KERN_WARNING "actcapi: alloc_skb failed\n"); \
121+ return; \
122+ }
123123
124−#define ACTCAPI_QUEUE_TX { \
125− actcapi_debug_msg(skb, 1); \
126− skb_queue_tail(&card->sndq, skb); \
127− act2000_schedule_tx(card); \
128−}
124+#define ACTCAPI_QUEUE_TX { \
125+ actcapi_debug_msg(skb, 1); \
126+ skb_queue_tail(&card->sndq, skb); \
127+ act2000_schedule_tx(card); \
128+ }
129129
130130 int
131131 actcapi_listen_req(act2000_card *card)
@@ -138,16 +138,16 @@ actcapi_listen_req(act2000_card *card) · 6 unmodified lines
138138 for (i = 0; i < ACT2000_BCH; i++)
139139 eazmask |= card->bch[i].eazmask;
140140 ACTCAPI_MKHDR(9, 0x05, 0x00);
141− if (!skb) {
142− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
143− return -ENOMEM;
144− }
141+ if (!skb) {
142+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
143+ return -ENOMEM;
144+ }
145145 m->msg.listen_req.controller = 0;
146146 m->msg.listen_req.infomask = 0x3f; /* All information */
147147 m->msg.listen_req.eazmask = eazmask;
148− m->msg.listen_req.simask = (eazmask)?0x86:0; /* All SI's */
148+ m->msg.listen_req.simask = (eazmask) ? 0x86 : 0; /* All SI's */
149149 ACTCAPI_QUEUE_TX;
150− return 0;
150+ return 0;
151151 }
152152
153153 int
@@ -159,7 +159,7 @@ actcapi_connect_req(act2000_card *card, act2000_chan *chan, char *phone, · 5 unmodified lines
159159
160160 ACTCAPI_MKHDR((11 + strlen(phone)), 0x02, 0x00);
161161 if (!skb) {
162− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
162+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
163163 chan->fsm_state = ACT2000_STATE_NULL;
164164 return -ENOMEM;
165165 }
@@ -168,7 +168,7 @@ actcapi_connect_req(act2000_card *card, act2000_chan *chan, char *phone, · 2 unmodified lines
168168 m->msg.connect_req.infomask = 0x3f;
169169 m->msg.connect_req.si1 = si1;
170170 m->msg.connect_req.si2 = si2;
171− m->msg.connect_req.eaz = eaz?eaz:'0';
171+ m->msg.connect_req.eaz = eaz ? eaz : '0';
172172 m->msg.connect_req.addr.len = strlen(phone) + 1;
173173 m->msg.connect_req.addr.tnp = 0x81;
174174 memcpy(m->msg.connect_req.addr.num, phone, strlen(phone));
@@ -203,21 +203,21 @@ actcapi_manufacturer_req_net(act2000_card *card) · 28 unmodified lines
203203 struct sk_buff *skb;
204204
205205 ACTCAPI_MKHDR(5, 0xff, 0x00);
206− if (!skb) {
207− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
208− return -ENOMEM;
209− }
206+ if (!skb) {
207+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
208+ return -ENOMEM;
209+ }
210210 m->msg.manufacturer_req_net.manuf_msg = 0x11;
211211 m->msg.manufacturer_req_net.controller = 1;
212− m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO)?1:0;
212+ m->msg.manufacturer_req_net.nettype = (card->ptype == ISDN_PTYPE_EURO) ? 1 : 0;
213213 ACTCAPI_QUEUE_TX;
214214 printk(KERN_INFO "act2000 %s: D-channel protocol now %s\n",
215− card->interface.id, (card->ptype == ISDN_PTYPE_EURO)?"euro":"1tr6");
215+ card->interface.id, (card->ptype == ISDN_PTYPE_EURO) ? "euro" : "1tr6");
216216 card->interface.features &=
217217 ~(ISDN_FEATURE_P_UNKNOWN | ISDN_FEATURE_P_EURO | ISDN_FEATURE_P_1TR6);
218218 card->interface.features |=
219− ((card->ptype == ISDN_PTYPE_EURO)?ISDN_FEATURE_P_EURO:ISDN_FEATURE_P_1TR6);
220− return 0;
219+ ((card->ptype == ISDN_PTYPE_EURO) ? ISDN_FEATURE_P_EURO : ISDN_FEATURE_P_1TR6);
220+ return 0;
221221 }
222222
223223 /*
@@ -231,16 +231,16 @@ actcapi_manufacturer_req_v42(act2000_card *card, ulong arg) · 7 unmodified lines
231231 struct sk_buff *skb;
232232
233233 ACTCAPI_MKHDR(8, 0xff, 0x00);
234− if (!skb) {
234+ if (!skb) {
235235
236− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
237− return -ENOMEM;
238− }
236+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
237+ return -ENOMEM;
238+ }
239239 m->msg.manufacturer_req_v42.manuf_msg = 0x10;
240240 m->msg.manufacturer_req_v42.controller = 0;
241− m->msg.manufacturer_req_v42.v42control = (arg?1:0);
241+ m->msg.manufacturer_req_v42.v42control = (arg ? 1 : 0);
242242 ACTCAPI_QUEUE_TX;
243− return 0;
243+ return 0;
244244 }
245245 #endif /* 0 */
246246
@@ -254,15 +254,15 @@ actcapi_manufacturer_req_errh(act2000_card *card) · 7 unmodified lines
254254 struct sk_buff *skb;
255255
256256 ACTCAPI_MKHDR(4, 0xff, 0x00);
257− if (!skb) {
257+ if (!skb) {
258258
259− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
260− return -ENOMEM;
261− }
259+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
260+ return -ENOMEM;
261+ }
262262 m->msg.manufacturer_req_err.manuf_msg = 0x03;
263263 m->msg.manufacturer_req_err.controller = 0;
264264 ACTCAPI_QUEUE_TX;
265− return 0;
265+ return 0;
266266 }
267267
268268 /*
@@ -295,7 +295,7 @@ actcapi_manufacturer_req_msn(act2000_card *card) · 26 unmodified lines
295295 }
296296 p = p->next;
297297 }
298− return 0;
298+ return 0;
299299 }
300300
301301 void
@@ -311,24 +311,24 @@ actcapi_select_b2_protocol_req(act2000_card *card, act2000_chan *chan) · 9 unmodified lines
311311 sizeof(m->msg.select_b2_protocol_req.dlpd));
312312 m->msg.select_b2_protocol_req.dlpd.len = 6;
313313 switch (chan->l2prot) {
314− case ISDN_PROTO_L2_TRANS:
315− m->msg.select_b2_protocol_req.protocol = 0x03;
316− m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
317− break;
318− case ISDN_PROTO_L2_HDLC:
319− m->msg.select_b2_protocol_req.protocol = 0x02;
320− m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
321− break;
322− case ISDN_PROTO_L2_X75I:
323− case ISDN_PROTO_L2_X75UI:
324− case ISDN_PROTO_L2_X75BUI:
325− m->msg.select_b2_protocol_req.protocol = 0x01;
326− m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
327− m->msg.select_b2_protocol_req.dlpd.laa = 3;
328− m->msg.select_b2_protocol_req.dlpd.lab = 1;
329− m->msg.select_b2_protocol_req.dlpd.win = 7;
330− m->msg.select_b2_protocol_req.dlpd.modulo = 8;
331− break;
314+ case ISDN_PROTO_L2_TRANS:
315+ m->msg.select_b2_protocol_req.protocol = 0x03;
316+ m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
317+ break;
318+ case ISDN_PROTO_L2_HDLC:
319+ m->msg.select_b2_protocol_req.protocol = 0x02;
320+ m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
321+ break;
322+ case ISDN_PROTO_L2_X75I:
323+ case ISDN_PROTO_L2_X75UI:
324+ case ISDN_PROTO_L2_X75BUI:
325+ m->msg.select_b2_protocol_req.protocol = 0x01;
326+ m->msg.select_b2_protocol_req.dlpd.dlen = 4000;
327+ m->msg.select_b2_protocol_req.dlpd.laa = 3;
328+ m->msg.select_b2_protocol_req.dlpd.lab = 1;
329+ m->msg.select_b2_protocol_req.dlpd.win = 7;
330+ m->msg.select_b2_protocol_req.dlpd.modulo = 8;
331+ break;
332332 }
333333 ACTCAPI_QUEUE_TX;
334334 }
@@ -345,11 +345,11 @@ actcapi_select_b3_protocol_req(act2000_card *card, act2000_chan *chan) · 10 unmodified lines
345345 memset(&m->msg.select_b3_protocol_req.ncpd, 0,
346346 sizeof(m->msg.select_b3_protocol_req.ncpd));
347347 switch (chan->l3prot) {
348− case ISDN_PROTO_L3_TRANS:
349− m->msg.select_b3_protocol_req.protocol = 0x04;
350− m->msg.select_b3_protocol_req.ncpd.len = 13;
351− m->msg.select_b3_protocol_req.ncpd.modulo = 8;
352− break;
348+ case ISDN_PROTO_L3_TRANS:
349+ m->msg.select_b3_protocol_req.protocol = 0x04;
350+ m->msg.select_b3_protocol_req.ncpd.len = 13;
351+ m->msg.select_b3_protocol_req.ncpd.modulo = 8;
352+ break;
353353 }
354354 ACTCAPI_QUEUE_TX;
355355 }
@@ -434,7 +434,7 @@ actcapi_connect_b3_resp(act2000_card *card, act2000_chan *chan, __u8 rejectcause · 78 unmodified lines
434434 actcapi_msg *m;
435435 struct sk_buff *skb;
436436
437− ACTCAPI_MKHDR((rejectcause?3:17), 0x82, 0x03);
437+ ACTCAPI_MKHDR((rejectcause ? 3 : 17), 0x82, 0x03);
438438 ACTCAPI_CHKSKB;
439439 m->msg.connect_b3_resp.ncci = chan->ncci;
440440 m->msg.connect_b3_resp.rejectcause = rejectcause;
@@ -563,10 +563,10 @@ actcapi_data_b3_ind(act2000_card *card, struct sk_buff *skb) { · 122 unmodified lines
563563 blocknr = msg->msg.data_b3_ind.blocknr;
564564 skb_pull(skb, 19);
565565 card->interface.rcvcallb_skb(card->myid, chan, skb);
566− if (!(skb = alloc_skb(11, GFP_ATOMIC))) {
567− printk(KERN_WARNING "actcapi: alloc_skb failed\n");
568− return 1;
569− }
566+ if (!(skb = alloc_skb(11, GFP_ATOMIC))) {
567+ printk(KERN_WARNING "actcapi: alloc_skb failed\n");
568+ return 1;
569+ }
570570 msg = (actcapi_msg *)skb_put(skb, 11);
571571 msg->hdr.len = 11;
572572 msg->hdr.applicationID = 1;
@@ -595,34 +595,34 @@ handle_ack(act2000_card *card, act2000_chan *chan, __u8 blocknr) { · 22 unmodified lines
595595 spin_lock_irqsave(&card->lock, flags);
596596 skb = skb_peek(&card->ackq);
597597 spin_unlock_irqrestore(&card->lock, flags);
598− if (!skb) {
598+ if (!skb) {
599599 printk(KERN_WARNING "act2000: handle_ack nothing found!\n");
600600 return 0;
601601 }
602− tmp = skb;
603− while (1) {
604− m = (actcapi_msg *)tmp->data;
605− if ((((m->msg.data_b3_req.fakencci >> 8) & 0xff) == chan->ncci) &&
602+ tmp = skb;
603+ while (1) {
604+ m = (actcapi_msg *)tmp->data;
605+ if ((((m->msg.data_b3_req.fakencci >> 8) & 0xff) == chan->ncci) &&
606606 (m->msg.data_b3_req.blocknr == blocknr)) {
607607 /* found corresponding DATA_B3_REQ */
608− skb_unlink(tmp, &card->ackq);
608+ skb_unlink(tmp, &card->ackq);
609609 chan->queued -= m->msg.data_b3_req.datalen;
610610 if (m->msg.data_b3_req.flags)
611611 ret = m->msg.data_b3_req.datalen;
612612 dev_kfree_skb(tmp);
613613 if (chan->queued < 0)
614614 chan->queued = 0;
615− return ret;
616− }
617− spin_lock_irqsave(&card->lock, flags);
618− tmp = skb_peek((struct sk_buff_head *)tmp);
619− spin_unlock_irqrestore(&card->lock, flags);
620− if ((tmp == skb) || (tmp == NULL)) {
615+ return ret;
616+ }
617+ spin_lock_irqsave(&card->lock, flags);
618+ tmp = skb_peek((struct sk_buff_head *)tmp);
619+ spin_unlock_irqrestore(&card->lock, flags);
620+ if ((tmp == skb) || (tmp == NULL)) {
621621 /* reached end of queue */
622622 printk(KERN_WARNING "act2000: handle_ack nothing found!\n");
623− return 0;
623+ return 0;
624624 }
625− }
625+ }
626626 }
627627
628628 void
@@ -644,294 +644,294 @@ actcapi_dispatch(struct work_struct *work) · 15 unmodified lines
644644 msg = (actcapi_msg *)skb->data;
645645 ccmd = ((msg->hdr.cmd.cmd << 8) | msg->hdr.cmd.subcmd);
646646 switch (ccmd) {
647− case 0x8602:
648− /* DATA_B3_IND */
649− if (actcapi_data_b3_ind(card, skb))
650− return;
651− break;
652− case 0x8601:
653− /* DATA_B3_CONF */
654− chan = find_ncci(card, msg->msg.data_b3_conf.ncci);
655− if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_ACTIVE)) {
656− if (msg->msg.data_b3_conf.info != 0)
657− printk(KERN_WARNING "act2000: DATA_B3_CONF: %04x\n",
658− msg->msg.data_b3_conf.info);
659− len = handle_ack(card, &card->bch[chan],
660− msg->msg.data_b3_conf.blocknr);
661− if (len) {
647+ case 0x8602:
648+ /* DATA_B3_IND */
649+ if (actcapi_data_b3_ind(card, skb))
650+ return;
651+ break;
652+ case 0x8601:
653+ /* DATA_B3_CONF */
654+ chan = find_ncci(card, msg->msg.data_b3_conf.ncci);
655+ if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_ACTIVE)) {
656+ if (msg->msg.data_b3_conf.info != 0)
657+ printk(KERN_WARNING "act2000: DATA_B3_CONF: %04x\n",
658+ msg->msg.data_b3_conf.info);
659+ len = handle_ack(card, &card->bch[chan],
660+ msg->msg.data_b3_conf.blocknr);
661+ if (len) {
662+ cmd.driver = card->myid;
663+ cmd.command = ISDN_STAT_BSENT;
664+ cmd.arg = chan;
665+ cmd.parm.length = len;
666+ card->interface.statcallb(&cmd);
667+ }
668+ }
669+ break;
670+ case 0x0201:
671+ /* CONNECT_CONF */
672+ chan = find_dialing(card, msg->hdr.msgnum);
673+ if (chan >= 0) {
674+ if (msg->msg.connect_conf.info) {
675+ card->bch[chan].fsm_state = ACT2000_STATE_NULL;
676+ cmd.driver = card->myid;
677+ cmd.command = ISDN_STAT_DHUP;
678+ cmd.arg = chan;
679+ card->interface.statcallb(&cmd);
680+ } else {
681+ card->bch[chan].fsm_state = ACT2000_STATE_OWAIT;
682+ card->bch[chan].plci = msg->msg.connect_conf.plci;
683+ }
684+ }
685+ break;
686+ case 0x0202:
687+ /* CONNECT_IND */
688+ chan = new_plci(card, msg->msg.connect_ind.plci);
689+ if (chan < 0) {
690+ ctmp = (act2000_chan *)tmp;
691+ ctmp->plci = msg->msg.connect_ind.plci;
692+ actcapi_connect_resp(card, ctmp, 0x11); /* All Card-Cannels busy */
693+ } else {
694+ card->bch[chan].fsm_state = ACT2000_STATE_ICALL;
695+ cmd.driver = card->myid;
696+ cmd.command = ISDN_STAT_ICALL;
697+ cmd.arg = chan;
698+ cmd.parm.setup.si1 = msg->msg.connect_ind.si1;
699+ cmd.parm.setup.si2 = msg->msg.connect_ind.si2;
700+ if (card->ptype == ISDN_PTYPE_EURO)
701+ strcpy(cmd.parm.setup.eazmsn,
702+ act2000_find_eaz(card, msg->msg.connect_ind.eaz));
703+ else {
704+ cmd.parm.setup.eazmsn[0] = msg->msg.connect_ind.eaz;
705+ cmd.parm.setup.eazmsn[1] = 0;
706+ }
707+ memset(cmd.parm.setup.phone, 0, sizeof(cmd.parm.setup.phone));
708+ memcpy(cmd.parm.setup.phone, msg->msg.connect_ind.addr.num,
709+ msg->msg.connect_ind.addr.len - 1);
710+ cmd.parm.setup.plan = msg->msg.connect_ind.addr.tnp;
711+ cmd.parm.setup.screen = 0;
712+ if (card->interface.statcallb(&cmd) == 2)
713+ actcapi_connect_resp(card, &card->bch[chan], 0x15); /* Reject Call */
714+ }
715+ break;
716+ case 0x0302:
717+ /* CONNECT_ACTIVE_IND */
718+ chan = find_plci(card, msg->msg.connect_active_ind.plci);
719+ if (chan >= 0)
720+ switch (card->bch[chan].fsm_state) {
721+ case ACT2000_STATE_IWAIT:
722+ actcapi_connect_active_resp(card, &card->bch[chan]);
723+ break;
724+ case ACT2000_STATE_OWAIT:
725+ actcapi_connect_active_resp(card, &card->bch[chan]);
726+ actcapi_select_b2_protocol_req(card, &card->bch[chan]);
727+ break;
728+ }
729+ break;
730+ case 0x8202:
731+ /* CONNECT_B3_IND */
732+ chan = find_plci(card, msg->msg.connect_b3_ind.plci);
733+ if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_IBWAIT)) {
734+ card->bch[chan].ncci = msg->msg.connect_b3_ind.ncci;
735+ actcapi_connect_b3_resp(card, &card->bch[chan], 0);
736+ } else {
737+ ctmp = (act2000_chan *)tmp;
738+ ctmp->ncci = msg->msg.connect_b3_ind.ncci;
739+ actcapi_connect_b3_resp(card, ctmp, 0x11); /* All Card-Cannels busy */
740+ }
741+ break;
742+ case 0x8302:
743+ /* CONNECT_B3_ACTIVE_IND */
744+ chan = find_ncci(card, msg->msg.connect_b3_active_ind.ncci);
745+ if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BWAIT)) {
746+ actcapi_connect_b3_active_resp(card, &card->bch[chan]);
747+ cmd.driver = card->myid;
748+ cmd.command = ISDN_STAT_BCONN;
749+ cmd.arg = chan;
750+ card->interface.statcallb(&cmd);
751+ }
752+ break;
753+ case 0x8402:
754+ /* DISCONNECT_B3_IND */
755+ chan = find_ncci(card, msg->msg.disconnect_b3_ind.ncci);
756+ if (chan >= 0) {
757+ ctmp = &card->bch[chan];
758+ actcapi_disconnect_b3_resp(card, ctmp);
759+ switch (ctmp->fsm_state) {
760+ case ACT2000_STATE_ACTIVE:
761+ ctmp->fsm_state = ACT2000_STATE_DHWAIT2;
762+ cmd.driver = card->myid;
763+ cmd.command = ISDN_STAT_BHUP;
764+ cmd.arg = chan;
765+ card->interface.statcallb(&cmd);
766+ break;
767+ case ACT2000_STATE_BHWAIT2:
768+ actcapi_disconnect_req(card, ctmp);
769+ ctmp->fsm_state = ACT2000_STATE_DHWAIT;
770+ cmd.driver = card->myid;
771+ cmd.command = ISDN_STAT_BHUP;
772+ cmd.arg = chan;
773+ card->interface.statcallb(&cmd);
774+ break;
775+ }
776+ }
777+ break;
778+ case 0x0402:
779+ /* DISCONNECT_IND */
780+ chan = find_plci(card, msg->msg.disconnect_ind.plci);
781+ if (chan >= 0) {
782+ ctmp = &card->bch[chan];
783+ actcapi_disconnect_resp(card, ctmp);
784+ ctmp->fsm_state = ACT2000_STATE_NULL;
785+ cmd.driver = card->myid;
786+ cmd.command = ISDN_STAT_DHUP;
787+ cmd.arg = chan;
788+ card->interface.statcallb(&cmd);
789+ } else {
790+ ctmp = (act2000_chan *)tmp;
791+ ctmp->plci = msg->msg.disconnect_ind.plci;
792+ actcapi_disconnect_resp(card, ctmp);
793+ }
794+ break;
795+ case 0x4001:
796+ /* SELECT_B2_PROTOCOL_CONF */
797+ chan = find_plci(card, msg->msg.select_b2_protocol_conf.plci);
798+ if (chan >= 0)
799+ switch (card->bch[chan].fsm_state) {
800+ case ACT2000_STATE_ICALL:
801+ case ACT2000_STATE_OWAIT:
802+ ctmp = &card->bch[chan];
803+ if (msg->msg.select_b2_protocol_conf.info == 0)
804+ actcapi_select_b3_protocol_req(card, ctmp);
805+ else {
806+ ctmp->fsm_state = ACT2000_STATE_NULL;
662807 cmd.driver = card->myid;
663− cmd.command = ISDN_STAT_BSENT;
808+ cmd.command = ISDN_STAT_DHUP;
664809 cmd.arg = chan;
665− cmd.parm.length = len;
666810 card->interface.statcallb(&cmd);
667811 }
812+ break;
668813 }
669− break;
670− case 0x0201:
671− /* CONNECT_CONF */
672− chan = find_dialing(card, msg->hdr.msgnum);
673− if (chan >= 0) {
674− if (msg->msg.connect_conf.info) {
675− card->bch[chan].fsm_state = ACT2000_STATE_NULL;
814+ break;
815+ case 0x8001:
816+ /* SELECT_B3_PROTOCOL_CONF */
817+ chan = find_plci(card, msg->msg.select_b3_protocol_conf.plci);
818+ if (chan >= 0)
819+ switch (card->bch[chan].fsm_state) {
820+ case ACT2000_STATE_ICALL:
821+ case ACT2000_STATE_OWAIT:
822+ ctmp = &card->bch[chan];
823+ if (msg->msg.select_b3_protocol_conf.info == 0)
824+ actcapi_listen_b3_req(card, ctmp);
825+ else {
826+ ctmp->fsm_state = ACT2000_STATE_NULL;
676827 cmd.driver = card->myid;
677828 cmd.command = ISDN_STAT_DHUP;
678829 cmd.arg = chan;
679830 card->interface.statcallb(&cmd);
680− } else {
681− card->bch[chan].fsm_state = ACT2000_STATE_OWAIT;
682− card->bch[chan].plci = msg->msg.connect_conf.plci;
683831 }
684832 }
685− break;
686− case 0x0202:
687− /* CONNECT_IND */
688− chan = new_plci(card, msg->msg.connect_ind.plci);
689− if (chan < 0) {
690− ctmp = (act2000_chan *)tmp;
691− ctmp->plci = msg->msg.connect_ind.plci;
692− actcapi_connect_resp(card, ctmp, 0x11); /* All Card-Cannels busy */
693− } else {
694− card->bch[chan].fsm_state = ACT2000_STATE_ICALL;
695− cmd.driver = card->myid;
696− cmd.command = ISDN_STAT_ICALL;
697− cmd.arg = chan;
698− cmd.parm.setup.si1 = msg->msg.connect_ind.si1;
699− cmd.parm.setup.si2 = msg->msg.connect_ind.si2;
700− if (card->ptype == ISDN_PTYPE_EURO)
701− strcpy(cmd.parm.setup.eazmsn,
702− act2000_find_eaz(card, msg->msg.connect_ind.eaz));
833+ break;
834+ case 0x8101:
835+ /* LISTEN_B3_CONF */
836+ chan = find_plci(card, msg->msg.listen_b3_conf.plci);
837+ if (chan >= 0)
838+ switch (card->bch[chan].fsm_state) {
839+ case ACT2000_STATE_ICALL:
840+ ctmp = &card->bch[chan];
841+ if (msg->msg.listen_b3_conf.info == 0)
842+ actcapi_connect_resp(card, ctmp, 0);
703843 else {
704− cmd.parm.setup.eazmsn[0] = msg->msg.connect_ind.eaz;
705− cmd.parm.setup.eazmsn[1] = 0;
706− }
707− memset(cmd.parm.setup.phone, 0, sizeof(cmd.parm.setup.phone));
708− memcpy(cmd.parm.setup.phone, msg->msg.connect_ind.addr.num,
709− msg->msg.connect_ind.addr.len - 1);
710− cmd.parm.setup.plan = msg->msg.connect_ind.addr.tnp;
711− cmd.parm.setup.screen = 0;
712− if (card->interface.statcallb(&cmd) == 2)
713− actcapi_connect_resp(card, &card->bch[chan], 0x15); /* Reject Call */
714− }
715− break;
716− case 0x0302:
717− /* CONNECT_ACTIVE_IND */
718− chan = find_plci(card, msg->msg.connect_active_ind.plci);
719− if (chan >= 0)
720− switch (card->bch[chan].fsm_state) {
721− case ACT2000_STATE_IWAIT:
722− actcapi_connect_active_resp(card, &card->bch[chan]);
723− break;
724− case ACT2000_STATE_OWAIT:
725− actcapi_connect_active_resp(card, &card->bch[chan]);
726− actcapi_select_b2_protocol_req(card, &card->bch[chan]);
727− break;
844+ ctmp->fsm_state = ACT2000_STATE_NULL;
845+ cmd.driver = card->myid;
846+ cmd.command = ISDN_STAT_DHUP;
847+ cmd.arg = chan;
848+ card->interface.statcallb(&cmd);
728849 }
729− break;
730− case 0x8202:
731− /* CONNECT_B3_IND */
732− chan = find_plci(card, msg->msg.connect_b3_ind.plci);
733− if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_IBWAIT)) {
734− card->bch[chan].ncci = msg->msg.connect_b3_ind.ncci;
735− actcapi_connect_b3_resp(card, &card->bch[chan], 0);
736− } else {
737− ctmp = (act2000_chan *)tmp;
738− ctmp->ncci = msg->msg.connect_b3_ind.ncci;
739− actcapi_connect_b3_resp(card, ctmp, 0x11); /* All Card-Cannels busy */
740− }
741− break;
742− case 0x8302:
743− /* CONNECT_B3_ACTIVE_IND */
744− chan = find_ncci(card, msg->msg.connect_b3_active_ind.ncci);
745− if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BWAIT)) {
746− actcapi_connect_b3_active_resp(card, &card->bch[chan]);
747− cmd.driver = card->myid;
748− cmd.command = ISDN_STAT_BCONN;
749− cmd.arg = chan;
750− card->interface.statcallb(&cmd);
751− }
752− break;
753− case 0x8402:
754− /* DISCONNECT_B3_IND */
755− chan = find_ncci(card, msg->msg.disconnect_b3_ind.ncci);
756− if (chan >= 0) {
850+ break;
851+ case ACT2000_STATE_OWAIT:
757852 ctmp = &card->bch[chan];
758− actcapi_disconnect_b3_resp(card, ctmp);
759− switch (ctmp->fsm_state) {
760− case ACT2000_STATE_ACTIVE:
761− ctmp->fsm_state = ACT2000_STATE_DHWAIT2;
762− cmd.driver = card->myid;
763− cmd.command = ISDN_STAT_BHUP;
764− cmd.arg = chan;
765− card->interface.statcallb(&cmd);
766− break;
767− case ACT2000_STATE_BHWAIT2:
768− actcapi_disconnect_req(card, ctmp);
769− ctmp->fsm_state = ACT2000_STATE_DHWAIT;
770− cmd.driver = card->myid;
771− cmd.command = ISDN_STAT_BHUP;
772− cmd.arg = chan;
773− card->interface.statcallb(&cmd);
774− break;
853+ if (msg->msg.listen_b3_conf.info == 0) {
854+ actcapi_connect_b3_req(card, ctmp);
855+ ctmp->fsm_state = ACT2000_STATE_OBWAIT;
856+ cmd.driver = card->myid;
857+ cmd.command = ISDN_STAT_DCONN;
858+ cmd.arg = chan;
859+ card->interface.statcallb(&cmd);
860+ } else {
861+ ctmp->fsm_state = ACT2000_STATE_NULL;
862+ cmd.driver = card->myid;
863+ cmd.command = ISDN_STAT_DHUP;
864+ cmd.arg = chan;
865+ card->interface.statcallb(&cmd);
775866 }
867+ break;
776868 }
777− break;
778− case 0x0402:
779− /* DISCONNECT_IND */
780− chan = find_plci(card, msg->msg.disconnect_ind.plci);
781− if (chan >= 0) {
782− ctmp = &card->bch[chan];
783− actcapi_disconnect_resp(card, ctmp);
869+ break;
870+ case 0x8201:
871+ /* CONNECT_B3_CONF */
872+ chan = find_plci(card, msg->msg.connect_b3_conf.plci);
873+ if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_OBWAIT)) {
874+ ctmp = &card->bch[chan];
875+ if (msg->msg.connect_b3_conf.info) {
784876 ctmp->fsm_state = ACT2000_STATE_NULL;
785877 cmd.driver = card->myid;
786878 cmd.command = ISDN_STAT_DHUP;
787879 cmd.arg = chan;
788880 card->interface.statcallb(&cmd);
789881 } else {
790− ctmp = (act2000_chan *)tmp;
791− ctmp->plci = msg->msg.disconnect_ind.plci;
792− actcapi_disconnect_resp(card, ctmp);
882+ ctmp->ncci = msg->msg.connect_b3_conf.ncci;
883+ ctmp->fsm_state = ACT2000_STATE_BWAIT;
793884 }
794− break;
795− case 0x4001:
796− /* SELECT_B2_PROTOCOL_CONF */
797− chan = find_plci(card, msg->msg.select_b2_protocol_conf.plci);
798− if (chan >= 0)
799− switch (card->bch[chan].fsm_state) {
800− case ACT2000_STATE_ICALL:
801− case ACT2000_STATE_OWAIT:
802− ctmp = &card->bch[chan];
803− if (msg->msg.select_b2_protocol_conf.info == 0)
804− actcapi_select_b3_protocol_req(card, ctmp);
805− else {
806− ctmp->fsm_state = ACT2000_STATE_NULL;
807− cmd.driver = card->myid;
808− cmd.command = ISDN_STAT_DHUP;
809− cmd.arg = chan;
810− card->interface.statcallb(&cmd);
811− }
812− break;
813− }
814− break;
815− case 0x8001:
816− /* SELECT_B3_PROTOCOL_CONF */
817− chan = find_plci(card, msg->msg.select_b3_protocol_conf.plci);
818− if (chan >= 0)
819− switch (card->bch[chan].fsm_state) {
820− case ACT2000_STATE_ICALL:
821− case ACT2000_STATE_OWAIT:
822− ctmp = &card->bch[chan];
823− if (msg->msg.select_b3_protocol_conf.info == 0)
824− actcapi_listen_b3_req(card, ctmp);
825− else {
826− ctmp->fsm_state = ACT2000_STATE_NULL;
827− cmd.driver = card->myid;
828− cmd.command = ISDN_STAT_DHUP;
829− cmd.arg = chan;
830− card->interface.statcallb(&cmd);
831− }
832− }
833− break;
834− case 0x8101:
835− /* LISTEN_B3_CONF */
836− chan = find_plci(card, msg->msg.listen_b3_conf.plci);
837− if (chan >= 0)
838− switch (card->bch[chan].fsm_state) {
839− case ACT2000_STATE_ICALL:
840− ctmp = &card->bch[chan];
841− if (msg->msg.listen_b3_conf.info == 0)
842− actcapi_connect_resp(card, ctmp, 0);
843− else {
844− ctmp->fsm_state = ACT2000_STATE_NULL;
845− cmd.driver = card->myid;
846− cmd.command = ISDN_STAT_DHUP;
847− cmd.arg = chan;
848− card->interface.statcallb(&cmd);
849− }
850− break;
851− case ACT2000_STATE_OWAIT:
852− ctmp = &card->bch[chan];
853− if (msg->msg.listen_b3_conf.info == 0) {
854− actcapi_connect_b3_req(card, ctmp);
855− ctmp->fsm_state = ACT2000_STATE_OBWAIT;
856− cmd.driver = card->myid;
857− cmd.command = ISDN_STAT_DCONN;
858− cmd.arg = chan;
859− card->interface.statcallb(&cmd);
860− } else {
861− ctmp->fsm_state = ACT2000_STATE_NULL;
862− cmd.driver = card->myid;
863− cmd.command = ISDN_STAT_DHUP;
864− cmd.arg = chan;
865− card->interface.statcallb(&cmd);
866− }
867− break;
868− }
869− break;
870− case 0x8201:
871− /* CONNECT_B3_CONF */
872− chan = find_plci(card, msg->msg.connect_b3_conf.plci);
873− if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_OBWAIT)) {
874− ctmp = &card->bch[chan];
875− if (msg->msg.connect_b3_conf.info) {
876− ctmp->fsm_state = ACT2000_STATE_NULL;
885+ }
886+ break;
887+ case 0x8401:
888+ /* DISCONNECT_B3_CONF */
889+ chan = find_ncci(card, msg->msg.disconnect_b3_conf.ncci);
890+ if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BHWAIT))
891+ card->bch[chan].fsm_state = ACT2000_STATE_BHWAIT2;
892+ break;
893+ case 0x0702:
894+ /* INFO_IND */
895+ chan = find_plci(card, msg->msg.info_ind.plci);
896+ if (chan >= 0)
897+ /* TODO: Eval Charging info / cause */
898+ actcapi_info_resp(card, &card->bch[chan]);
899+ break;
900+ case 0x0401:
901+ /* LISTEN_CONF */
902+ case 0x0501:
903+ /* LISTEN_CONF */
904+ case 0xff01:
905+ /* MANUFACTURER_CONF */
906+ break;
907+ case 0xff02:
908+ /* MANUFACTURER_IND */
909+ if (msg->msg.manuf_msg == 3) {
910+ memset(tmp, 0, sizeof(tmp));
911+ strncpy(tmp,
912+ &msg->msg.manufacturer_ind_err.errstring,
913+ msg->hdr.len - 16);
914+ if (msg->msg.manufacturer_ind_err.errcode)
915+ printk(KERN_WARNING "act2000: %s\n", tmp);
916+ else {
917+ printk(KERN_DEBUG "act2000: %s\n", tmp);
918+ if ((!strncmp(tmp, "INFO: Trace buffer con", 22)) ||
919+ (!strncmp(tmp, "INFO: Compile Date/Tim", 22))) {
920+ card->flags |= ACT2000_FLAGS_RUNNING;
921+ cmd.command = ISDN_STAT_RUN;
877922 cmd.driver = card->myid;
878− cmd.command = ISDN_STAT_DHUP;
879− cmd.arg = chan;
923+ cmd.arg = 0;
924+ actcapi_manufacturer_req_net(card);
925+ actcapi_manufacturer_req_msn(card);
926+ actcapi_listen_req(card);
880927 card->interface.statcallb(&cmd);
881− } else {
882− ctmp->ncci = msg->msg.connect_b3_conf.ncci;
883− ctmp->fsm_state = ACT2000_STATE_BWAIT;
884928 }
885929 }
886− break;
887− case 0x8401:
888− /* DISCONNECT_B3_CONF */
889− chan = find_ncci(card, msg->msg.disconnect_b3_conf.ncci);
890− if ((chan >= 0) && (card->bch[chan].fsm_state == ACT2000_STATE_BHWAIT))
891− card->bch[chan].fsm_state = ACT2000_STATE_BHWAIT2;
892− break;
893− case 0x0702:
894− /* INFO_IND */
895− chan = find_plci(card, msg->msg.info_ind.plci);
896− if (chan >= 0)
897− /* TODO: Eval Charging info / cause */
898− actcapi_info_resp(card, &card->bch[chan]);
899− break;
900− case 0x0401:
901− /* LISTEN_CONF */
902− case 0x0501:
903− /* LISTEN_CONF */
904− case 0xff01:
905− /* MANUFACTURER_CONF */
906− break;
907− case 0xff02:
908− /* MANUFACTURER_IND */
909− if (msg->msg.manuf_msg == 3) {
910− memset(tmp, 0, sizeof(tmp));
911− strncpy(tmp,
912− &msg->msg.manufacturer_ind_err.errstring,
913− msg->hdr.len - 16);
914− if (msg->msg.manufacturer_ind_err.errcode)
915− printk(KERN_WARNING "act2000: %s\n", tmp);
916− else {
917− printk(KERN_DEBUG "act2000: %s\n", tmp);
918− if ((!strncmp(tmp, "INFO: Trace buffer con", 22)) ||
919− (!strncmp(tmp, "INFO: Compile Date/Tim", 22))) {
920− card->flags |= ACT2000_FLAGS_RUNNING;
921− cmd.command = ISDN_STAT_RUN;
922− cmd.driver = card->myid;
923− cmd.arg = 0;
924− actcapi_manufacturer_req_net(card);
925− actcapi_manufacturer_req_msn(card);
926− actcapi_listen_req(card);
927− card->interface.statcallb(&cmd);
928− }
929− }
930− }
931− break;
932− default:
933− printk(KERN_WARNING "act2000: UNHANDLED Message %04x\n", ccmd);
934− break;
930+ }
931+ break;
932+ default:
933+ printk(KERN_WARNING "act2000: UNHANDLED Message %04x\n", ccmd);
934+ break;
935935 }
936936 dev_kfree_skb(skb);
937937 }
@@ -1015,7 +1015,7 @@ actcapi_debug_msg(struct sk_buff *skb, int direction) · 77 unmodified lines
10151015 char *descr;
10161016 int i;
10171017 char tmp[170];
1018−
1018+
10191019 #ifndef DEBUG_DATA_MSG
10201020 if (msg->hdr.cmd.cmd == 0x86)
10211021 return;
@@ -1030,151 +1030,151 @@ actcapi_debug_msg(struct sk_buff *skb, int direction) · 8 unmodified lines
10301030 descr = valid_msg[i].description;
10311031 break;
10321032 }
1033− printk(KERN_DEBUG "%s %s msg\n", direction?"Outgoing":"Incoming", descr);
1033+ printk(KERN_DEBUG "%s %s msg\n", direction ? "Outgoing" : "Incoming", descr);
10341034 printk(KERN_DEBUG " ApplID = %d\n", msg->hdr.applicationID);
10351035 printk(KERN_DEBUG " Len = %d\n", msg->hdr.len);
10361036 printk(KERN_DEBUG " MsgNum = 0x%04x\n", msg->hdr.msgnum);
10371037 printk(KERN_DEBUG " Cmd = 0x%02x\n", msg->hdr.cmd.cmd);
10381038 printk(KERN_DEBUG " SubCmd = 0x%02x\n", msg->hdr.cmd.subcmd);
10391039 switch (i) {
1040− case 0:
1041− /* DATA B3 IND */
1042− printk(KERN_DEBUG " BLOCK = 0x%02x\n",
1043− msg->msg.data_b3_ind.blocknr);
1044− break;
1045− case 2:
1046− /* CONNECT CONF */
1047− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1048− msg->msg.connect_conf.plci);
1049− printk(KERN_DEBUG " Info = 0x%04x\n",
1050− msg->msg.connect_conf.info);
1051− break;
1040+ case 0:
1041+ /* DATA B3 IND */
1042+ printk(KERN_DEBUG " BLOCK = 0x%02x\n",
1043+ msg->msg.data_b3_ind.blocknr);
1044+ break;
1045+ case 2:
1046+ /* CONNECT CONF */
1047+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1048+ msg->msg.connect_conf.plci);
1049+ printk(KERN_DEBUG " Info = 0x%04x\n",
1050+ msg->msg.connect_conf.info);
1051+ break;
1052+ case 3:
1053+ /* CONNECT IND */
1054+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1055+ msg->msg.connect_ind.plci);
1056+ printk(KERN_DEBUG " Contr = %d\n",
1057+ msg->msg.connect_ind.controller);
1058+ printk(KERN_DEBUG " SI1 = %d\n",
1059+ msg->msg.connect_ind.si1);
1060+ printk(KERN_DEBUG " SI2 = %d\n",
1061+ msg->msg.connect_ind.si2);
1062+ printk(KERN_DEBUG " EAZ = '%c'\n",
1063+ msg->msg.connect_ind.eaz);
1064+ actcapi_debug_caddr(&msg->msg.connect_ind.addr);
1065+ break;
1066+ case 5:
1067+ /* CONNECT ACTIVE IND */
1068+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1069+ msg->msg.connect_active_ind.plci);
1070+ actcapi_debug_caddr(&msg->msg.connect_active_ind.addr);
1071+ break;
1072+ case 8:
1073+ /* LISTEN CONF */
1074+ printk(KERN_DEBUG " Contr = %d\n",
1075+ msg->msg.listen_conf.controller);
1076+ printk(KERN_DEBUG " Info = 0x%04x\n",
1077+ msg->msg.listen_conf.info);
1078+ break;
1079+ case 11:
1080+ /* INFO IND */
1081+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1082+ msg->msg.info_ind.plci);
1083+ printk(KERN_DEBUG " Imsk = 0x%04x\n",
1084+ msg->msg.info_ind.nr.mask);
1085+ if (msg->hdr.len > 12) {
1086+ int l = msg->hdr.len - 12;
1087+ int j;
1088+ char *p = tmp;
1089+ for (j = 0; j < l; j++)
1090+ p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]);
1091+ printk(KERN_DEBUG " D = '%s'\n", tmp);
1092+ }
1093+ break;
1094+ case 14:
1095+ /* SELECT B2 PROTOCOL CONF */
1096+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1097+ msg->msg.select_b2_protocol_conf.plci);
1098+ printk(KERN_DEBUG " Info = 0x%04x\n",
1099+ msg->msg.select_b2_protocol_conf.info);
1100+ break;
1101+ case 15:
1102+ /* SELECT B3 PROTOCOL CONF */
1103+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1104+ msg->msg.select_b3_protocol_conf.plci);
1105+ printk(KERN_DEBUG " Info = 0x%04x\n",
1106+ msg->msg.select_b3_protocol_conf.info);
1107+ break;
1108+ case 16:
1109+ /* LISTEN B3 CONF */
1110+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1111+ msg->msg.listen_b3_conf.plci);
1112+ printk(KERN_DEBUG " Info = 0x%04x\n",
1113+ msg->msg.listen_b3_conf.info);
1114+ break;
1115+ case 18:
1116+ /* CONNECT B3 IND */
1117+ printk(KERN_DEBUG " NCCI = 0x%04x\n",
1118+ msg->msg.connect_b3_ind.ncci);
1119+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1120+ msg->msg.connect_b3_ind.plci);
1121+ actcapi_debug_ncpi(&msg->msg.connect_b3_ind.ncpi);
1122+ break;
1123+ case 19:
1124+ /* CONNECT B3 ACTIVE IND */
1125+ printk(KERN_DEBUG " NCCI = 0x%04x\n",
1126+ msg->msg.connect_b3_active_ind.ncci);
1127+ actcapi_debug_ncpi(&msg->msg.connect_b3_active_ind.ncpi);
1128+ break;
1129+ case 26:
1130+ /* MANUFACTURER IND */
1131+ printk(KERN_DEBUG " Mmsg = 0x%02x\n",
1132+ msg->msg.manufacturer_ind_err.manuf_msg);
1133+ switch (msg->msg.manufacturer_ind_err.manuf_msg) {
10521134 case 3:
1053− /* CONNECT IND */
1054− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1055− msg->msg.connect_ind.plci);
10561135 printk(KERN_DEBUG " Contr = %d\n",
1057− msg->msg.connect_ind.controller);
1058− printk(KERN_DEBUG " SI1 = %d\n",
1059− msg->msg.connect_ind.si1);
1060− printk(KERN_DEBUG " SI2 = %d\n",
1061− msg->msg.connect_ind.si2);
1062− printk(KERN_DEBUG " EAZ = '%c'\n",
1063− msg->msg.connect_ind.eaz);
1064− actcapi_debug_caddr(&msg->msg.connect_ind.addr);
1065− break;
1066− case 5:
1067− /* CONNECT ACTIVE IND */
1068− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1069− msg->msg.connect_active_ind.plci);
1070− actcapi_debug_caddr(&msg->msg.connect_active_ind.addr);
1071− break;
1072− case 8:
1073− /* LISTEN CONF */
1074− printk(KERN_DEBUG " Contr = %d\n",
1075− msg->msg.listen_conf.controller);
1076− printk(KERN_DEBUG " Info = 0x%04x\n",
1077− msg->msg.listen_conf.info);
1078− break;
1079− case 11:
1080− /* INFO IND */
1081− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1082− msg->msg.info_ind.plci);
1083− printk(KERN_DEBUG " Imsk = 0x%04x\n",
1084− msg->msg.info_ind.nr.mask);
1085− if (msg->hdr.len > 12) {
1086− int l = msg->hdr.len - 12;
1087− int j;
1088− char *p = tmp;
1089− for (j = 0; j < l ; j++)
1090− p += sprintf(p, "%02x ", msg->msg.info_ind.el.display[j]);
1091− printk(KERN_DEBUG " D = '%s'\n", tmp);
1092− }
1093− break;
1094− case 14:
1095− /* SELECT B2 PROTOCOL CONF */
1096− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1097− msg->msg.select_b2_protocol_conf.plci);
1098− printk(KERN_DEBUG " Info = 0x%04x\n",
1099− msg->msg.select_b2_protocol_conf.info);
1100− break;
1101− case 15:
1102− /* SELECT B3 PROTOCOL CONF */
1103− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1104− msg->msg.select_b3_protocol_conf.plci);
1105− printk(KERN_DEBUG " Info = 0x%04x\n",
1106− msg->msg.select_b3_protocol_conf.info);
1107− break;
1108− case 16:
1109− /* LISTEN B3 CONF */
1110− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1111− msg->msg.listen_b3_conf.plci);
1112− printk(KERN_DEBUG " Info = 0x%04x\n",
1113− msg->msg.listen_b3_conf.info);
1114− break;
1115− case 18:
1116− /* CONNECT B3 IND */
1117− printk(KERN_DEBUG " NCCI = 0x%04x\n",
1118− msg->msg.connect_b3_ind.ncci);
1119− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1120− msg->msg.connect_b3_ind.plci);
1121− actcapi_debug_ncpi(&msg->msg.connect_b3_ind.ncpi);
1122− break;
1123− case 19:
1124− /* CONNECT B3 ACTIVE IND */
1125− printk(KERN_DEBUG " NCCI = 0x%04x\n",
1126− msg->msg.connect_b3_active_ind.ncci);
1127− actcapi_debug_ncpi(&msg->msg.connect_b3_active_ind.ncpi);
1128− break;
1129− case 26:
1130− /* MANUFACTURER IND */
1131− printk(KERN_DEBUG " Mmsg = 0x%02x\n",
1132− msg->msg.manufacturer_ind_err.manuf_msg);
1133− switch (msg->msg.manufacturer_ind_err.manuf_msg) {
1134− case 3:
1135− printk(KERN_DEBUG " Contr = %d\n",
1136− msg->msg.manufacturer_ind_err.controller);
1137− printk(KERN_DEBUG " Code = 0x%08x\n",
1138− msg->msg.manufacturer_ind_err.errcode);
1139− memset(tmp, 0, sizeof(tmp));
1140− strncpy(tmp, &msg->msg.manufacturer_ind_err.errstring,
1141− msg->hdr.len - 16);
1142− printk(KERN_DEBUG " Emsg = '%s'\n", tmp);
1143− break;
1144− }
1145− break;
1146− case 30:
1147− /* LISTEN REQ */
1148− printk(KERN_DEBUG " Imsk = 0x%08x\n",
1149− msg->msg.listen_req.infomask);
1150− printk(KERN_DEBUG " Emsk = 0x%04x\n",
1151− msg->msg.listen_req.eazmask);
1152− printk(KERN_DEBUG " Smsk = 0x%04x\n",
1153− msg->msg.listen_req.simask);
1154− break;
1155− case 35:
1156− /* SELECT_B2_PROTOCOL_REQ */
1157− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1158− msg->msg.select_b2_protocol_req.plci);
1159− printk(KERN_DEBUG " prot = 0x%02x\n",
1160− msg->msg.select_b2_protocol_req.protocol);
1161− if (msg->hdr.len >= 11)
1162− printk(KERN_DEBUG "No dlpd\n");
1163− else
1164− actcapi_debug_dlpd(&msg->msg.select_b2_protocol_req.dlpd);
1165− break;
1166− case 44:
1167− /* CONNECT RESP */
1168− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1169− msg->msg.connect_resp.plci);
1170− printk(KERN_DEBUG " CAUSE = 0x%02x\n",
1171− msg->msg.connect_resp.rejectcause);
1172− break;
1173− case 45:
1174− /* CONNECT ACTIVE RESP */
1175− printk(KERN_DEBUG " PLCI = 0x%04x\n",
1176− msg->msg.connect_active_resp.plci);
1136+ msg->msg.manufacturer_ind_err.controller);
1137+ printk(KERN_DEBUG " Code = 0x%08x\n",
1138+ msg->msg.manufacturer_ind_err.errcode);
1139+ memset(tmp, 0, sizeof(tmp));
1140+ strncpy(tmp, &msg->msg.manufacturer_ind_err.errstring,
1141+ msg->hdr.len - 16);
1142+ printk(KERN_DEBUG " Emsg = '%s'\n", tmp);
11771143 break;
1144+ }
1145+ break;
1146+ case 30:
1147+ /* LISTEN REQ */
1148+ printk(KERN_DEBUG " Imsk = 0x%08x\n",
1149+ msg->msg.listen_req.infomask);
1150+ printk(KERN_DEBUG " Emsk = 0x%04x\n",
1151+ msg->msg.listen_req.eazmask);
1152+ printk(KERN_DEBUG " Smsk = 0x%04x\n",
1153+ msg->msg.listen_req.simask);
1154+ break;
1155+ case 35:
1156+ /* SELECT_B2_PROTOCOL_REQ */
1157+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1158+ msg->msg.select_b2_protocol_req.plci);
1159+ printk(KERN_DEBUG " prot = 0x%02x\n",
1160+ msg->msg.select_b2_protocol_req.protocol);
1161+ if (msg->hdr.len >= 11)
1162+ printk(KERN_DEBUG "No dlpd\n");
1163+ else
1164+ actcapi_debug_dlpd(&msg->msg.select_b2_protocol_req.dlpd);
1165+ break;
1166+ case 44:
1167+ /* CONNECT RESP */
1168+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1169+ msg->msg.connect_resp.plci);
1170+ printk(KERN_DEBUG " CAUSE = 0x%02x\n",
1171+ msg->msg.connect_resp.rejectcause);
1172+ break;
1173+ case 45:
1174+ /* CONNECT ACTIVE RESP */
1175+ printk(KERN_DEBUG " PLCI = 0x%04x\n",
1176+ msg->msg.connect_active_resp.plci);
1177+ break;
11781178 }
11791179 }
11801180 #endif
drivers/isdn/act2000/capi.h+25−25
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Author Fritz Elfert
66 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -46,10 +46,10 @@ typedef struct actcapi_addr { · 35 unmodified lines
4646 typedef union actcapi_infonr { /* info number */
4747 __u16 mask; /* info-mask field */
4848 struct bmask { /* bit definitions */
49− unsigned codes : 3; /* code set */
50− unsigned rsvd : 5; /* reserved */
51− unsigned svind : 1; /* single, variable length ind. */
52− unsigned wtype : 7; /* W-element type */
49+ unsigned codes:3; /* code set */
50+ unsigned rsvd:5; /* reserved */
51+ unsigned svind:1; /* single, variable length ind. */
52+ unsigned wtype:7; /* W-element type */
5353 } bmask;
5454 } actcapi_infonr;
5555
@@ -59,13 +59,13 @@ typedef union actcapi_infoel { /* info element */ · 3 unmodified lines
5959 __u8 display[40]; /* display contents */
6060 __u8 uuinfo[40]; /* User-user info field */
6161 struct cause { /* Cause information */
62− unsigned ext2 : 1; /* extension */
63− unsigned cod : 2; /* coding standard */
64− unsigned spare : 1; /* spare */
65− unsigned loc : 4; /* location */
66− unsigned ext1 : 1; /* extension */
67− unsigned cval : 7; /* Cause value */
68− } cause;
62+ unsigned ext2:1; /* extension */
63+ unsigned cod:2; /* coding standard */
64+ unsigned spare:1; /* spare */
65+ unsigned loc:4; /* location */
66+ unsigned ext1:1; /* extension */
67+ unsigned cval:7; /* Cause value */
68+ } cause;
6969 struct charge { /* Charging information */
7070 __u8 toc; /* type of charging info */
7171 __u8 unit[10]; /* charging units */
@@ -111,14 +111,14 @@ typedef struct actcapi_ncpd { · 39 unmodified lines
111111 * Bit 5-7 = Controller
112112 * Bit 8-15 = NCCI
113113 */
114−#define MAKE_NCCI(plci,contr,ncci) \
115− ((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
114+#define MAKE_NCCI(plci, contr, ncci) \
115+ ((plci & 0x1f) | ((contr & 0x7) << 5) | ((ncci & 0xff) << 8))
116116
117−#define EVAL_NCCI(fakencci,plci,contr,ncci) { \
118− plci = fakencci & 0x1f; \
119− contr = (fakencci >> 5) & 0x7; \
120− ncci = (fakencci >> 8) & 0xff; \
121−}
117+#define EVAL_NCCI(fakencci, plci, contr, ncci) { \
118+ plci = fakencci & 0x1f; \
119+ contr = (fakencci >> 5) & 0x7; \
120+ ncci = (fakencci >> 8) & 0xff; \
121+ }
122122
123123 /*
124124 * Layout of PLCI field in a B3 DATA CAPI message is different from
@@ -128,13 +128,13 @@ typedef struct actcapi_ncpd { · 3 unmodified lines
128128 * Bit 5-7 = Controller
129129 * Bit 8-15 = reserved (must be 0)
130130 */
131−#define MAKE_PLCI(plci,contr) \
132− ((plci & 0x1f) | ((contr & 0x7) << 5))
131+#define MAKE_PLCI(plci, contr) \
132+ ((plci & 0x1f) | ((contr & 0x7) << 5))
133133
134−#define EVAL_PLCI(fakeplci,plci,contr) { \
135− plci = fakeplci & 0x1f; \
136− contr = (fakeplci >> 5) & 0x7; \
137−}
134+#define EVAL_PLCI(fakeplci, plci, contr) { \
135+ plci = fakeplci & 0x1f; \
136+ contr = (fakeplci >> 5) & 0x7; \
137+ }
138138
139139 typedef struct actcapi_msg {
140140 actcapi_msghdr hdr;
drivers/isdn/act2000/module.c+403−403
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Author Fritz Elfert
66 * Copyright by Fritz Elfert <fritz@isdn4linux.de>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -21,8 +21,8 @@ · 10 unmodified lines
2121
2222 static unsigned short act2000_isa_ports[] =
2323 {
24− 0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
25− 0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
24+ 0x0200, 0x0240, 0x0280, 0x02c0, 0x0300, 0x0340, 0x0380,
25+ 0xcfe0, 0xcfa0, 0xcf60, 0xcf20, 0xcee0, 0xcea0, 0xce60,
2626 };
2727
2828 static act2000_card *cards = (act2000_card *) NULL;
@@ -33,14 +33,14 @@ static int act_port = -1; /* -1 = Autoprobe */ · 4 unmodified lines
3333 static int act_irq = -1;
3434 static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
3535
36−MODULE_DESCRIPTION( "ISDN4Linux: Driver for IBM Active 2000 ISDN card");
37−MODULE_AUTHOR( "Fritz Elfert");
38−MODULE_LICENSE( "GPL");
36+MODULE_DESCRIPTION("ISDN4Linux: Driver for IBM Active 2000 ISDN card");
37+MODULE_AUTHOR("Fritz Elfert");
38+MODULE_LICENSE("GPL");
3939 MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA");
4040 MODULE_PARM_DESC(membase, "Base port address of first card");
4141 MODULE_PARM_DESC(act_irq, "IRQ of first card");
42−MODULE_PARM_DESC(act_id, "ID-String of first card");
43−module_param(act_bus, int, 0);
42+MODULE_PARM_DESC(act_id, "ID-String of first card");
43+module_param(act_bus, int, 0);
4444 module_param(act_port, int, 0);
4545 module_param(act_irq, int, 0);
4646 module_param(act_id, charp, 0);
@@ -51,7 +51,7 @@ static act2000_chan * · 4 unmodified lines
5151 find_channel(act2000_card *card, int channel)
5252 {
5353 if ((channel >= 0) && (channel < ACT2000_BCH))
54− return &(card->bch[channel]);
54+ return &(card->bch[channel]);
5555 printk(KERN_WARNING "act2000: Invalid channel %d\n", channel);
5656 return NULL;
5757 }
@@ -84,7 +84,7 @@ act2000_clear_msn(act2000_card *card) · 26 unmodified lines
8484 static __u16
8585 act2000_find_msn(act2000_card *card, char *msn, int ia5)
8686 {
87− struct msn_entry *p = card->msn_list;
87+ struct msn_entry *p = card->msn_list;
8888 __u8 eaz = '0';
8989
9090 while (p) {
@@ -107,14 +107,14 @@ act2000_find_msn(act2000_card *card, char *msn, int ia5) · 16 unmodified lines
107107 char *
108108 act2000_find_eaz(act2000_card *card, char eaz)
109109 {
110− struct msn_entry *p = card->msn_list;
110+ struct msn_entry *p = card->msn_list;
111111
112112 while (p) {
113113 if (p->eaz == eaz)
114− return(p->msn);
114+ return (p->msn);
115115 p = p->next;
116116 }
117− return("\0");
117+ return ("\0");
118118 }
119119
120120 /*
@@ -126,11 +126,11 @@ act2000_find_eaz(act2000_card *card, char eaz) · 5 unmodified lines
126126 static int
127127 act2000_set_msn(act2000_card *card, char *eazmsn)
128128 {
129− struct msn_entry *p = card->msn_list;
130− struct msn_entry *q = NULL;
129+ struct msn_entry *p = card->msn_list;
130+ struct msn_entry *q = NULL;
131131 unsigned long flags;
132132 int i;
133−
133+
134134 if (!strlen(eazmsn))
135135 return 0;
136136 if (strlen(eazmsn) > 16)
@@ -138,7 +138,7 @@ act2000_set_msn(act2000_card *card, char *eazmsn) · 1 unmodified line
138138 for (i = 0; i < strlen(eazmsn); i++)
139139 if (!isdigit(eazmsn[i]))
140140 return -EINVAL;
141− if (strlen(eazmsn) == 1) {
141+ if (strlen(eazmsn) == 1) {
142142 /* Delete a single MSN */
143143 while (p) {
144144 if (p->eaz == eazmsn[0]) {
@@ -158,7 +158,7 @@ act2000_set_msn(act2000_card *card, char *eazmsn) · 13 unmodified lines
158158 p = p->next;
159159 }
160160 return 0;
161− }
161+ }
162162 /* Add a single MSN */
163163 while (p) {
164164 /* Found in list, replace MSN */
@@ -198,14 +198,14 @@ act2000_transmit(struct work_struct *work) · 33 unmodified lines
198198 container_of(work, struct act2000_card, snd_tq);
199199
200200 switch (card->bus) {
201− case ACT2000_BUS_ISA:
202− act2000_isa_send(card);
203− break;
204− case ACT2000_BUS_PCMCIA:
205− case ACT2000_BUS_MCA:
206− default:
207− printk(KERN_WARNING
208− "act2000_transmit: Illegal bustype %d\n", card->bus);
201+ case ACT2000_BUS_ISA:
202+ act2000_isa_send(card);
203+ break;
204+ case ACT2000_BUS_PCMCIA:
205+ case ACT2000_BUS_MCA:
206+ default:
207+ printk(KERN_WARNING
208+ "act2000_transmit: Illegal bustype %d\n", card->bus);
209209 }
210210 }
211211
@@ -216,221 +216,221 @@ act2000_receive(struct work_struct *work) · 4 unmodified lines
216216 container_of(work, struct act2000_card, poll_tq);
217217
218218 switch (card->bus) {
219− case ACT2000_BUS_ISA:
220− act2000_isa_receive(card);
221− break;
222− case ACT2000_BUS_PCMCIA:
223− case ACT2000_BUS_MCA:
224− default:
225− printk(KERN_WARNING
226− "act2000_receive: Illegal bustype %d\n", card->bus);
219+ case ACT2000_BUS_ISA:
220+ act2000_isa_receive(card);
221+ break;
222+ case ACT2000_BUS_PCMCIA:
223+ case ACT2000_BUS_MCA:
224+ default:
225+ printk(KERN_WARNING
226+ "act2000_receive: Illegal bustype %d\n", card->bus);
227227 }
228228 }
229229
230230 static void
231231 act2000_poll(unsigned long data)
232232 {
233− act2000_card * card = (act2000_card *)data;
233+ act2000_card *card = (act2000_card *)data;
234234 unsigned long flags;
235235
236236 act2000_receive(&card->poll_tq);
237237 spin_lock_irqsave(&card->lock, flags);
238− mod_timer(&card->ptimer, jiffies+3);
238+ mod_timer(&card->ptimer, jiffies + 3);
239239 spin_unlock_irqrestore(&card->lock, flags);
240240 }
241241
242242 static int
243−act2000_command(act2000_card * card, isdn_ctrl * c)
243+act2000_command(act2000_card *card, isdn_ctrl *c)
244244 {
245− ulong a;
246− act2000_chan *chan;
245+ ulong a;
246+ act2000_chan *chan;
247247 act2000_cdef cdef;
248248 isdn_ctrl cmd;
249249 char tmp[17];
250250 int ret;
251251 unsigned long flags;
252252 void __user *arg;
253−
254− switch (c->command) {
255− case ISDN_CMD_IOCTL:
256− memcpy(&a, c->parm.num, sizeof(ulong));
257− arg = (void __user *)a;
258− switch (c->arg) {
259− case ACT2000_IOCTL_LOADBOOT:
260− switch (card->bus) {
261− case ACT2000_BUS_ISA:
262− ret = act2000_isa_download(card,
263− arg);
264− if (!ret) {
265− card->flags |= ACT2000_FLAGS_LOADED;
266− if (!(card->flags & ACT2000_FLAGS_IVALID)) {
267− card->ptimer.expires = jiffies + 3;
268− card->ptimer.function = act2000_poll;
269− card->ptimer.data = (unsigned long)card;
270− add_timer(&card->ptimer);
271− }
272− actcapi_manufacturer_req_errh(card);
273− }
274− break;
275− default:
276− printk(KERN_WARNING
277− "act2000: Illegal BUS type %d\n",
278− card->bus);
279− ret = -EIO;
253+
254+ switch (c->command) {
255+ case ISDN_CMD_IOCTL:
256+ memcpy(&a, c->parm.num, sizeof(ulong));
257+ arg = (void __user *)a;
258+ switch (c->arg) {
259+ case ACT2000_IOCTL_LOADBOOT:
260+ switch (card->bus) {
261+ case ACT2000_BUS_ISA:
262+ ret = act2000_isa_download(card,
263+ arg);
264+ if (!ret) {
265+ card->flags |= ACT2000_FLAGS_LOADED;
266+ if (!(card->flags & ACT2000_FLAGS_IVALID)) {
267+ card->ptimer.expires = jiffies + 3;
268+ card->ptimer.function = act2000_poll;
269+ card->ptimer.data = (unsigned long)card;
270+ add_timer(&card->ptimer);
280271 }
281− return ret;
282− case ACT2000_IOCTL_SETPROTO:
283− card->ptype = a?ISDN_PTYPE_EURO:ISDN_PTYPE_1TR6;
284− if (!(card->flags & ACT2000_FLAGS_RUNNING))
285− return 0;
286− actcapi_manufacturer_req_net(card);
287− return 0;
288− case ACT2000_IOCTL_SETMSN:
289− if (copy_from_user(tmp, arg,
290− sizeof(tmp)))
291− return -EFAULT;
292− if ((ret = act2000_set_msn(card, tmp)))
293− return ret;
294− if (card->flags & ACT2000_FLAGS_RUNNING)
295− return(actcapi_manufacturer_req_msn(card));
296− return 0;
297− case ACT2000_IOCTL_ADDCARD:
298− if (copy_from_user(&cdef, arg,
299− sizeof(cdef)))
300− return -EFAULT;
301− if (act2000_addcard(cdef.bus, cdef.port, cdef.irq, cdef.id))
302− return -EIO;
303− return 0;
304− case ACT2000_IOCTL_TEST:
305− if (!(card->flags & ACT2000_FLAGS_RUNNING))
306− return -ENODEV;
307− return 0;
308− default:
309− return -EINVAL;
310− }
311− break;
312− case ISDN_CMD_DIAL:
313− if (!(card->flags & ACT2000_FLAGS_RUNNING))
314− return -ENODEV;
315− if (!(chan = find_channel(card, c->arg & 0x0f)))
272+ actcapi_manufacturer_req_errh(card);
273+ }
316274 break;
317− spin_lock_irqsave(&card->lock, flags);
318− if (chan->fsm_state != ACT2000_STATE_NULL) {
319− spin_unlock_irqrestore(&card->lock, flags);
320− printk(KERN_WARNING "Dial on channel with state %d\n",
321− chan->fsm_state);
322− return -EBUSY;
323− }
324− if (card->ptype == ISDN_PTYPE_EURO)
325− tmp[0] = act2000_find_msn(card, c->parm.setup.eazmsn, 1);
326− else
327− tmp[0] = c->parm.setup.eazmsn[0];
328− chan->fsm_state = ACT2000_STATE_OCALL;
329− chan->callref = 0xffff;
330− spin_unlock_irqrestore(&card->lock, flags);
331− ret = actcapi_connect_req(card, chan, c->parm.setup.phone,
332− tmp[0], c->parm.setup.si1,
333− c->parm.setup.si2);
334− if (ret) {
335− cmd.driver = card->myid;
336− cmd.command = ISDN_STAT_DHUP;
337− cmd.arg &= 0x0f;
338− card->interface.statcallb(&cmd);
275+ default:
276+ printk(KERN_WARNING
277+ "act2000: Illegal BUS type %d\n",
278+ card->bus);
279+ ret = -EIO;
339280 }
340281 return ret;
341− case ISDN_CMD_ACCEPTD:
342− if (!(card->flags & ACT2000_FLAGS_RUNNING))
343− return -ENODEV;
344− if (!(chan = find_channel(card, c->arg & 0x0f)))
345− break;
346− if (chan->fsm_state == ACT2000_STATE_ICALL)
347− actcapi_select_b2_protocol_req(card, chan);
348− return 0;
349− case ISDN_CMD_ACCEPTB:
350− if (!(card->flags & ACT2000_FLAGS_RUNNING))
351− return -ENODEV;
352− return 0;
353− case ISDN_CMD_HANGUP:
282+ case ACT2000_IOCTL_SETPROTO:
283+ card->ptype = a ? ISDN_PTYPE_EURO : ISDN_PTYPE_1TR6;
354284 if (!(card->flags & ACT2000_FLAGS_RUNNING))
355− return -ENODEV;
356− if (!(chan = find_channel(card, c->arg & 0x0f)))
357− break;
358− switch (chan->fsm_state) {
359− case ACT2000_STATE_ICALL:
360− case ACT2000_STATE_BSETUP:
361− actcapi_connect_resp(card, chan, 0x15);
362− break;
363− case ACT2000_STATE_ACTIVE:
364− actcapi_disconnect_b3_req(card, chan);
365− break;
366− }
285+ return 0;
286+ actcapi_manufacturer_req_net(card);
367287 return 0;
368− case ISDN_CMD_SETEAZ:
369− if (!(card->flags & ACT2000_FLAGS_RUNNING))
370− return -ENODEV;
371− if (!(chan = find_channel(card, c->arg & 0x0f)))
372− break;
373− if (strlen(c->parm.num)) {
374− if (card->ptype == ISDN_PTYPE_EURO) {
375− chan->eazmask = act2000_find_msn(card, c->parm.num, 0);
376− }
377− if (card->ptype == ISDN_PTYPE_1TR6) {
378− int i;
379− chan->eazmask = 0;
380− for (i = 0; i < strlen(c->parm.num); i++)
381− if (isdigit(c->parm.num[i]))
382− chan->eazmask |= (1 << (c->parm.num[i] - '0'));
383− }
384− } else
385− chan->eazmask = 0x3ff;
386− actcapi_listen_req(card);
288+ case ACT2000_IOCTL_SETMSN:
289+ if (copy_from_user(tmp, arg,
290+ sizeof(tmp)))
291+ return -EFAULT;
292+ if ((ret = act2000_set_msn(card, tmp)))
293+ return ret;
294+ if (card->flags & ACT2000_FLAGS_RUNNING)
295+ return (actcapi_manufacturer_req_msn(card));
387296 return 0;
388− case ISDN_CMD_CLREAZ:
389− if (!(card->flags & ACT2000_FLAGS_RUNNING))
390− return -ENODEV;
391− if (!(chan = find_channel(card, c->arg & 0x0f)))
392− break;
393− chan->eazmask = 0;
394− actcapi_listen_req(card);
297+ case ACT2000_IOCTL_ADDCARD:
298+ if (copy_from_user(&cdef, arg,
299+ sizeof(cdef)))
300+ return -EFAULT;
301+ if (act2000_addcard(cdef.bus, cdef.port, cdef.irq, cdef.id))
302+ return -EIO;
395303 return 0;
396− case ISDN_CMD_SETL2:
304+ case ACT2000_IOCTL_TEST:
397305 if (!(card->flags & ACT2000_FLAGS_RUNNING))
398306 return -ENODEV;
399− if (!(chan = find_channel(card, c->arg & 0x0f)))
400− break;
401− chan->l2prot = (c->arg >> 8);
402307 return 0;
403− case ISDN_CMD_SETL3:
404− if (!(card->flags & ACT2000_FLAGS_RUNNING))
405− return -ENODEV;
406− if ((c->arg >> 8) != ISDN_PROTO_L3_TRANS) {
407− printk(KERN_WARNING "L3 protocol unknown\n");
408− return -1;
308+ default:
309+ return -EINVAL;
310+ }
311+ break;
312+ case ISDN_CMD_DIAL:
313+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
314+ return -ENODEV;
315+ if (!(chan = find_channel(card, c->arg & 0x0f)))
316+ break;
317+ spin_lock_irqsave(&card->lock, flags);
318+ if (chan->fsm_state != ACT2000_STATE_NULL) {
319+ spin_unlock_irqrestore(&card->lock, flags);
320+ printk(KERN_WARNING "Dial on channel with state %d\n",
321+ chan->fsm_state);
322+ return -EBUSY;
323+ }
324+ if (card->ptype == ISDN_PTYPE_EURO)
325+ tmp[0] = act2000_find_msn(card, c->parm.setup.eazmsn, 1);
326+ else
327+ tmp[0] = c->parm.setup.eazmsn[0];
328+ chan->fsm_state = ACT2000_STATE_OCALL;
329+ chan->callref = 0xffff;
330+ spin_unlock_irqrestore(&card->lock, flags);
331+ ret = actcapi_connect_req(card, chan, c->parm.setup.phone,
332+ tmp[0], c->parm.setup.si1,
333+ c->parm.setup.si2);
334+ if (ret) {
335+ cmd.driver = card->myid;
336+ cmd.command = ISDN_STAT_DHUP;
337+ cmd.arg &= 0x0f;
338+ card->interface.statcallb(&cmd);
339+ }
340+ return ret;
341+ case ISDN_CMD_ACCEPTD:
342+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
343+ return -ENODEV;
344+ if (!(chan = find_channel(card, c->arg & 0x0f)))
345+ break;
346+ if (chan->fsm_state == ACT2000_STATE_ICALL)
347+ actcapi_select_b2_protocol_req(card, chan);
348+ return 0;
349+ case ISDN_CMD_ACCEPTB:
350+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
351+ return -ENODEV;
352+ return 0;
353+ case ISDN_CMD_HANGUP:
354+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
355+ return -ENODEV;
356+ if (!(chan = find_channel(card, c->arg & 0x0f)))
357+ break;
358+ switch (chan->fsm_state) {
359+ case ACT2000_STATE_ICALL:
360+ case ACT2000_STATE_BSETUP:
361+ actcapi_connect_resp(card, chan, 0x15);
362+ break;
363+ case ACT2000_STATE_ACTIVE:
364+ actcapi_disconnect_b3_req(card, chan);
365+ break;
366+ }
367+ return 0;
368+ case ISDN_CMD_SETEAZ:
369+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
370+ return -ENODEV;
371+ if (!(chan = find_channel(card, c->arg & 0x0f)))
372+ break;
373+ if (strlen(c->parm.num)) {
374+ if (card->ptype == ISDN_PTYPE_EURO) {
375+ chan->eazmask = act2000_find_msn(card, c->parm.num, 0);
409376 }
410− if (!(chan = find_channel(card, c->arg & 0x0f)))
411− break;
412− chan->l3prot = (c->arg >> 8);
413− return 0;
414− }
415−
416− return -EINVAL;
377+ if (card->ptype == ISDN_PTYPE_1TR6) {
378+ int i;
379+ chan->eazmask = 0;
380+ for (i = 0; i < strlen(c->parm.num); i++)
381+ if (isdigit(c->parm.num[i]))
382+ chan->eazmask |= (1 << (c->parm.num[i] - '0'));
383+ }
384+ } else
385+ chan->eazmask = 0x3ff;
386+ actcapi_listen_req(card);
387+ return 0;
388+ case ISDN_CMD_CLREAZ:
389+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
390+ return -ENODEV;
391+ if (!(chan = find_channel(card, c->arg & 0x0f)))
392+ break;
393+ chan->eazmask = 0;
394+ actcapi_listen_req(card);
395+ return 0;
396+ case ISDN_CMD_SETL2:
397+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
398+ return -ENODEV;
399+ if (!(chan = find_channel(card, c->arg & 0x0f)))
400+ break;
401+ chan->l2prot = (c->arg >> 8);
402+ return 0;
403+ case ISDN_CMD_SETL3:
404+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
405+ return -ENODEV;
406+ if ((c->arg >> 8) != ISDN_PROTO_L3_TRANS) {
407+ printk(KERN_WARNING "L3 protocol unknown\n");
408+ return -1;
409+ }
410+ if (!(chan = find_channel(card, c->arg & 0x0f)))
411+ break;
412+ chan->l3prot = (c->arg >> 8);
413+ return 0;
414+ }
415+
416+ return -EINVAL;
417417 }
418418
419419 static int
420420 act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb)
421421 {
422− struct sk_buff *xmit_skb;
423− int len;
424− act2000_chan *chan;
422+ struct sk_buff *xmit_skb;
423+ int len;
424+ act2000_chan *chan;
425425 actcapi_msg *msg;
426426
427− if (!(chan = find_channel(card, channel)))
427+ if (!(chan = find_channel(card, channel)))
428+ return -1;
429+ if (chan->fsm_state != ACT2000_STATE_ACTIVE)
428430 return -1;
429− if (chan->fsm_state != ACT2000_STATE_ACTIVE)
430− return -1;
431− len = skb->len;
432− if ((chan->queued + len) >= ACT2000_MAX_QUEUED)
433− return 0;
431+ len = skb->len;
432+ if ((chan->queued + len) >= ACT2000_MAX_QUEUED)
433+ return 0;
434434 if (!len)
435435 return 0;
436436 if (skb_headroom(skb) < 19) {
@@ -462,28 +462,28 @@ act2000_sendbuf(act2000_card *card, int channel, int ack, struct sk_buff *skb) · 25 unmodified lines
462462 msg->msg.data_b3_req.fakencci = MAKE_NCCI(chan->plci, 0, chan->ncci);
463463 msg->msg.data_b3_req.flags = ack; /* Will be set to 0 on actual sending */
464464 actcapi_debug_msg(xmit_skb, 1);
465− chan->queued += len;
465+ chan->queued += len;
466466 skb_queue_tail(&card->sndq, xmit_skb);
467467 act2000_schedule_tx(card);
468− return len;
468+ return len;
469469 }
470470
471471
472472 /* Read the Status-replies from the Interface */
473473 static int
474−act2000_readstatus(u_char __user * buf, int len, act2000_card * card)
474+act2000_readstatus(u_char __user *buf, int len, act2000_card *card)
475475 {
476− int count;
477− u_char __user *p;
476+ int count;
477+ u_char __user *p;
478478
479− for (p = buf, count = 0; count < len; p++, count++) {
480− if (card->status_buf_read == card->status_buf_write)
481− return count;
479+ for (p = buf, count = 0; count < len; p++, count++) {
480+ if (card->status_buf_read == card->status_buf_write)
481+ return count;
482482 put_user(*card->status_buf_read++, p);
483− if (card->status_buf_read > card->status_buf_end)
484− card->status_buf_read = card->status_buf;
485− }
486− return count;
483+ if (card->status_buf_read > card->status_buf_end)
484+ card->status_buf_read = card->status_buf;
485+ }
486+ return count;
487487 }
488488
489489 /*
@@ -492,75 +492,75 @@ act2000_readstatus(u_char __user * buf, int len, act2000_card * card) · 2 unmodified lines
492492 static inline act2000_card *
493493 act2000_findcard(int driverid)
494494 {
495− act2000_card *p = cards;
496−
497− while (p) {
498− if (p->myid == driverid)
499− return p;
500− p = p->next;
501− }
502− return (act2000_card *) 0;
495+ act2000_card *p = cards;
496+
497+ while (p) {
498+ if (p->myid == driverid)
499+ return p;
500+ p = p->next;
501+ }
502+ return (act2000_card *) 0;
503503 }
504504
505505 /*
506506 * Wrapper functions for interface to linklevel
507507 */
508508 static int
509−if_command(isdn_ctrl * c)
509+if_command(isdn_ctrl *c)
510510 {
511− act2000_card *card = act2000_findcard(c->driver);
512−
513− if (card)
514− return (act2000_command(card, c));
515− printk(KERN_ERR
516− "act2000: if_command %d called with invalid driverId %d!\n",
517− c->command, c->driver);
518− return -ENODEV;
511+ act2000_card *card = act2000_findcard(c->driver);
512+
513+ if (card)
514+ return (act2000_command(card, c));
515+ printk(KERN_ERR
516+ "act2000: if_command %d called with invalid driverId %d!\n",
517+ c->command, c->driver);
518+ return -ENODEV;
519519 }
520520
521521 static int
522522 if_writecmd(const u_char __user *buf, int len, int id, int channel)
523523 {
524− act2000_card *card = act2000_findcard(id);
525−
526− if (card) {
527− if (!(card->flags & ACT2000_FLAGS_RUNNING))
528− return -ENODEV;
529− return (len);
530− }
531− printk(KERN_ERR
532− "act2000: if_writecmd called with invalid driverId!\n");
533− return -ENODEV;
524+ act2000_card *card = act2000_findcard(id);
525+
526+ if (card) {
527+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
528+ return -ENODEV;
529+ return (len);
530+ }
531+ printk(KERN_ERR
532+ "act2000: if_writecmd called with invalid driverId!\n");
533+ return -ENODEV;
534534 }
535535
536536 static int
537−if_readstatus(u_char __user * buf, int len, int id, int channel)
537+if_readstatus(u_char __user *buf, int len, int id, int channel)
538538 {
539− act2000_card *card = act2000_findcard(id);
540−
541− if (card) {
542− if (!(card->flags & ACT2000_FLAGS_RUNNING))
543− return -ENODEV;
544− return (act2000_readstatus(buf, len, card));
545− }
546− printk(KERN_ERR
547− "act2000: if_readstatus called with invalid driverId!\n");
548− return -ENODEV;
539+ act2000_card *card = act2000_findcard(id);
540+
541+ if (card) {
542+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
543+ return -ENODEV;
544+ return (act2000_readstatus(buf, len, card));
545+ }
546+ printk(KERN_ERR
547+ "act2000: if_readstatus called with invalid driverId!\n");
548+ return -ENODEV;
549549 }
550550
551551 static int
552552 if_sendbuf(int id, int channel, int ack, struct sk_buff *skb)
553553 {
554− act2000_card *card = act2000_findcard(id);
555−
556− if (card) {
557− if (!(card->flags & ACT2000_FLAGS_RUNNING))
558− return -ENODEV;
554+ act2000_card *card = act2000_findcard(id);
555+
556+ if (card) {
557+ if (!(card->flags & ACT2000_FLAGS_RUNNING))
558+ return -ENODEV;
559559 return (act2000_sendbuf(card, channel, ack, skb));
560− }
561− printk(KERN_ERR
562− "act2000: if_sendbuf called with invalid driverId!\n");
563− return -ENODEV;
560+ }
561+ printk(KERN_ERR
562+ "act2000: if_sendbuf called with invalid driverId!\n");
563+ return -ENODEV;
564564 }
565565
566566
@@ -572,14 +572,14 @@ static void · 5 unmodified lines
572572 act2000_alloccard(int bus, int port, int irq, char *id)
573573 {
574574 int i;
575− act2000_card *card;
576− if (!(card = kzalloc(sizeof(act2000_card), GFP_KERNEL))) {
577− printk(KERN_WARNING
575+ act2000_card *card;
576+ if (!(card = kzalloc(sizeof(act2000_card), GFP_KERNEL))) {
577+ printk(KERN_WARNING
578578 "act2000: (%s) Could not allocate card-struct.\n", id);
579− return;
580− }
581− spin_lock_init(&card->lock);
582− spin_lock_init(&card->mnlock);
579+ return;
580+ }
581+ spin_lock_init(&card->lock);
582+ spin_lock_init(&card->mnlock);
583583 skb_queue_head_init(&card->sndq);
584584 skb_queue_head_init(&card->rcvq);
585585 skb_queue_head_init(&card->ackq);
@@ -588,82 +588,82 @@ act2000_alloccard(int bus, int port, int irq, char *id) · 2 unmodified lines
588588 INIT_WORK(&card->poll_tq, act2000_receive);
589589 init_timer(&card->ptimer);
590590 card->interface.owner = THIS_MODULE;
591− card->interface.channels = ACT2000_BCH;
592− card->interface.maxbufsize = 4000;
593− card->interface.command = if_command;
594− card->interface.writebuf_skb = if_sendbuf;
595− card->interface.writecmd = if_writecmd;
596− card->interface.readstat = if_readstatus;
597− card->interface.features =
591+ card->interface.channels = ACT2000_BCH;
592+ card->interface.maxbufsize = 4000;
593+ card->interface.command = if_command;
594+ card->interface.writebuf_skb = if_sendbuf;
595+ card->interface.writecmd = if_writecmd;
596+ card->interface.readstat = if_readstatus;
597+ card->interface.features =
598598 ISDN_FEATURE_L2_X75I |
599599 ISDN_FEATURE_L2_HDLC |
600600 ISDN_FEATURE_L3_TRANS |
601601 ISDN_FEATURE_P_UNKNOWN;
602− card->interface.hl_hdrlen = 20;
603− card->ptype = ISDN_PTYPE_EURO;
604− strlcpy(card->interface.id, id, sizeof(card->interface.id));
605− for (i=0; i<ACT2000_BCH; i++) {
606− card->bch[i].plci = 0x8000;
607− card->bch[i].ncci = 0x8000;
608− card->bch[i].l2prot = ISDN_PROTO_L2_X75I;
609− card->bch[i].l3prot = ISDN_PROTO_L3_TRANS;
610− }
611− card->myid = -1;
612− card->bus = bus;
613− card->port = port;
614− card->irq = irq;
615− card->next = cards;
616− cards = card;
602+ card->interface.hl_hdrlen = 20;
603+ card->ptype = ISDN_PTYPE_EURO;
604+ strlcpy(card->interface.id, id, sizeof(card->interface.id));
605+ for (i = 0; i < ACT2000_BCH; i++) {
606+ card->bch[i].plci = 0x8000;
607+ card->bch[i].ncci = 0x8000;
608+ card->bch[i].l2prot = ISDN_PROTO_L2_X75I;
609+ card->bch[i].l3prot = ISDN_PROTO_L3_TRANS;
610+ }
611+ card->myid = -1;
612+ card->bus = bus;
613+ card->port = port;
614+ card->irq = irq;
615+ card->next = cards;
616+ cards = card;
617617 }
618618
619619 /*
620620 * register card at linklevel
621621 */
622622 static int
623−act2000_registercard(act2000_card * card)
623+act2000_registercard(act2000_card *card)
624624 {
625− switch (card->bus) {
626− case ACT2000_BUS_ISA:
627− break;
628− case ACT2000_BUS_MCA:
629− case ACT2000_BUS_PCMCIA:
630− default:
631− printk(KERN_WARNING
632− "act2000: Illegal BUS type %d\n",
633− card->bus);
634− return -1;
635− }
636− if (!register_isdn(&card->interface)) {
637− printk(KERN_WARNING
638− "act2000: Unable to register %s\n",
639− card->interface.id);
640− return -1;
641− }
642− card->myid = card->interface.channels;
643− sprintf(card->regname, "act2000-isdn (%s)", card->interface.id);
644− return 0;
625+ switch (card->bus) {
626+ case ACT2000_BUS_ISA:
627+ break;
628+ case ACT2000_BUS_MCA:
629+ case ACT2000_BUS_PCMCIA:
630+ default:
631+ printk(KERN_WARNING
632+ "act2000: Illegal BUS type %d\n",
633+ card->bus);
634+ return -1;
635+ }
636+ if (!register_isdn(&card->interface)) {
637+ printk(KERN_WARNING
638+ "act2000: Unable to register %s\n",
639+ card->interface.id);
640+ return -1;
641+ }
642+ card->myid = card->interface.channels;
643+ sprintf(card->regname, "act2000-isdn (%s)", card->interface.id);
644+ return 0;
645645 }
646646
647647 static void
648−unregister_card(act2000_card * card)
648+unregister_card(act2000_card *card)
649649 {
650− isdn_ctrl cmd;
650+ isdn_ctrl cmd;
651651
652− cmd.command = ISDN_STAT_UNLOAD;
653− cmd.driver = card->myid;
654− card->interface.statcallb(&cmd);
655− switch (card->bus) {
656− case ACT2000_BUS_ISA:
657− act2000_isa_release(card);
658− break;
659− case ACT2000_BUS_MCA:
660− case ACT2000_BUS_PCMCIA:
661− default:
662− printk(KERN_WARNING
663− "act2000: Invalid BUS type %d\n",
664− card->bus);
665− break;
666− }
652+ cmd.command = ISDN_STAT_UNLOAD;
653+ cmd.driver = card->myid;
654+ card->interface.statcallb(&cmd);
655+ switch (card->bus) {
656+ case ACT2000_BUS_ISA:
657+ act2000_isa_release(card);
658+ break;
659+ case ACT2000_BUS_MCA:
660+ case ACT2000_BUS_PCMCIA:
661+ default:
662+ printk(KERN_WARNING
663+ "act2000: Invalid BUS type %d\n",
664+ card->bus);
665+ break;
666+ }
667667 }
668668
669669 static int
@@ -690,23 +690,23 @@ act2000_addcard(int bus, int port, int irq, char *id) · 20 unmodified lines
690690 for (i = 0; i < ARRAY_SIZE(act2000_isa_ports); i++)
691691 if (act2000_isa_detect(act2000_isa_ports[i])) {
692692 printk(KERN_INFO "act2000: Detected "
693− "ISA card at port 0x%x\n",
694− act2000_isa_ports[i]);
693+ "ISA card at port 0x%x\n",
694+ act2000_isa_ports[i]);
695695 act2000_alloccard(bus,
696− act2000_isa_ports[i], irq, id);
696+ act2000_isa_ports[i], irq, id);
697697 }
698698 break;
699699 case ACT2000_BUS_MCA:
700700 case ACT2000_BUS_PCMCIA:
701701 default:
702702 printk(KERN_WARNING
703− "act2000: addcard: Invalid BUS type %d\n", bus);
703+ "act2000: addcard: Invalid BUS type %d\n", bus);
704704 }
705705 }
706706 if (!cards)
707707 return 1;
708− p = cards;
709− while (p) {
708+ p = cards;
709+ while (p) {
710710 initialized = 0;
711711 if (!p->interface.statcallb) {
712712 /* Not yet registered.
@@ -714,99 +714,99 @@ act2000_addcard(int bus, int port, int irq, char *id) · 1 unmodified line
714714 */
715715 added++;
716716 switch (p->bus) {
717− case ACT2000_BUS_ISA:
718− if (act2000_isa_detect(p->port)) {
719− if (act2000_registercard(p))
720− break;
721− if (act2000_isa_config_port(p, p->port)) {
722− printk(KERN_WARNING
723− "act2000: Could not request port 0x%04x\n",
724− p->port);
725− unregister_card(p);
726− p->interface.statcallb = NULL;
727− break;
728− }
729− if (act2000_isa_config_irq(p, p->irq)) {
730− printk(KERN_INFO
731− "act2000: No IRQ available, fallback to polling\n");
732− /* Fall back to polled operation */
733− p->irq = 0;
734− }
735− printk(KERN_INFO
736− "act2000: ISA"
737− "-type card at port "
738− "0x%04x ",
717+ case ACT2000_BUS_ISA:
718+ if (act2000_isa_detect(p->port)) {
719+ if (act2000_registercard(p))
720+ break;
721+ if (act2000_isa_config_port(p, p->port)) {
722+ printk(KERN_WARNING
723+ "act2000: Could not request port 0x%04x\n",
739724 p->port);
740− if (p->irq)
741− printk("irq %d\n", p->irq);
742− else
743− printk("polled\n");
744− initialized = 1;
725+ unregister_card(p);
726+ p->interface.statcallb = NULL;
727+ break;
728+ }
729+ if (act2000_isa_config_irq(p, p->irq)) {
730+ printk(KERN_INFO
731+ "act2000: No IRQ available, fallback to polling\n");
732+ /* Fall back to polled operation */
733+ p->irq = 0;
745734 }
746− break;
747− case ACT2000_BUS_MCA:
748− case ACT2000_BUS_PCMCIA:
749− default:
750− printk(KERN_WARNING
751− "act2000: addcard: Invalid BUS type %d\n",
752− p->bus);
735+ printk(KERN_INFO
736+ "act2000: ISA"
737+ "-type card at port "
738+ "0x%04x ",
739+ p->port);
740+ if (p->irq)
741+ printk("irq %d\n", p->irq);
742+ else
743+ printk("polled\n");
744+ initialized = 1;
745+ }
746+ break;
747+ case ACT2000_BUS_MCA:
748+ case ACT2000_BUS_PCMCIA:
749+ default:
750+ printk(KERN_WARNING
751+ "act2000: addcard: Invalid BUS type %d\n",
752+ p->bus);
753753 }
754754 } else
755755 /* Card already initialized */
756756 initialized = 1;
757− if (initialized) {
757+ if (initialized) {
758758 /* Init OK, next card ... */
759− q = p;
760− p = p->next;
761− } else {
762− /* Init failed, remove card from list, free memory */
763− printk(KERN_WARNING
764− "act2000: Initialization of %s failed\n",
765− p->interface.id);
766− if (q) {
767− q->next = p->next;
768− kfree(p);
769− p = q->next;
770− } else {
771− cards = p->next;
772− kfree(p);
773− p = cards;
774− }
759+ q = p;
760+ p = p->next;
761+ } else {
762+ /* Init failed, remove card from list, free memory */
763+ printk(KERN_WARNING
764+ "act2000: Initialization of %s failed\n",
765+ p->interface.id);
766+ if (q) {
767+ q->next = p->next;
768+ kfree(p);
769+ p = q->next;
770+ } else {
771+ cards = p->next;
772+ kfree(p);
773+ p = cards;
774+ }
775775 failed++;
776− }
776+ }
777777 }
778− return (added - failed);
778+ return (added - failed);
779779 }
780780
781781 #define DRIVERNAME "IBM Active 2000 ISDN driver"
782782
783783 static int __init act2000_init(void)
784784 {
785− printk(KERN_INFO "%s\n", DRIVERNAME);
786− if (!cards)
785+ printk(KERN_INFO "%s\n", DRIVERNAME);
786+ if (!cards)
787787 act2000_addcard(act_bus, act_port, act_irq, act_id);
788− if (!cards)
789− printk(KERN_INFO "act2000: No cards defined yet\n");
790− return 0;
788+ if (!cards)
789+ printk(KERN_INFO "act2000: No cards defined yet\n");
790+ return 0;
791791 }
792792
793793 static void __exit act2000_exit(void)
794794 {
795− act2000_card *card = cards;
796− act2000_card *last;
797− while (card) {
798− unregister_card(card);
795+ act2000_card *card = cards;
796+ act2000_card *last;
797+ while (card) {
798+ unregister_card(card);
799799 del_timer(&card->ptimer);
800− card = card->next;
801− }
802− card = cards;
803− while (card) {
804− last = card;
805− card = card->next;
800+ card = card->next;
801+ }
802+ card = cards;
803+ while (card) {
804+ last = card;
805+ card = card->next;
806806 act2000_clear_msn(last);
807− kfree(last);
808− }
809− printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
807+ kfree(last);
808+ }
809+ printk(KERN_INFO "%s unloaded\n", DRIVERNAME);
810810 }
811811
812812 module_init(act2000_init);
drivers/isdn/capi/capi.c+90−90
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 #include <linux/tty.h>
2626 #include <linux/netdevice.h>
2727 #include <linux/ppp_defs.h>
28−#include <linux/if_ppp.h>
28+#include <linux/ppp-ioctl.h>
2929 #include <linux/skbuff.h>
3030 #include <linux/proc_fs.h>
3131 #include <linux/seq_file.h>
@@ -164,7 +164,7 @@ static int capiminor_del_ack(struct capiminor *mp, u16 datahandle) · 132 unmodified lines
164164
165165 spin_lock_bh(&mp->ackqlock);
166166 list_for_each_entry_safe(p, tmp, &mp->ackqueue, list) {
167− if (p->datahandle == datahandle) {
167+ if (p->datahandle == datahandle) {
168168 list_del(&p->list);
169169 mp->nack--;
170170 spin_unlock_bh(&mp->ackqlock);
@@ -199,8 +199,8 @@ static struct capiminor *capiminor_alloc(struct capi20_appl *ap, u32 ncci) · 28 unmodified lines
199199 unsigned int minor;
200200
201201 mp = kzalloc(sizeof(*mp), GFP_KERNEL);
202− if (!mp) {
203− printk(KERN_ERR "capi: can't alloc capiminor\n");
202+ if (!mp) {
203+ printk(KERN_ERR "capi: can't alloc capiminor\n");
204204 return NULL;
205205 }
206206
@@ -391,7 +391,7 @@ gen_data_b3_resp_for(struct capiminor *mp, struct sk_buff *skb) · 184 unmodified lines
391391 struct sk_buff *nskb;
392392 nskb = alloc_skb(CAPI_DATA_B3_RESP_LEN, GFP_KERNEL);
393393 if (nskb) {
394− u16 datahandle = CAPIMSG_U16(skb->data,CAPIMSG_BASELEN+4+4+2);
394+ u16 datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
395395 unsigned char *s = skb_put(nskb, CAPI_DATA_B3_RESP_LEN);
396396 capimsg_setu16(s, 0, CAPI_DATA_B3_RESP_LEN);
397397 capimsg_setu16(s, 2, mp->ap->applid);
@@ -418,7 +418,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb) · 20 unmodified lines
418418 pr_debug("capi: currently no receiver\n");
419419 return -1;
420420 }
421−
421+
422422 ld = tty_ldisc_ref(tty);
423423 if (!ld) {
424424 /* fatal error, do not requeue */
@@ -459,7 +459,7 @@ static int handle_recv_skb(struct capiminor *mp, struct sk_buff *skb) · 34 unmodified lines
459459 ld->ops->receive_buf(tty, skb->data, NULL, skb->len);
460460 } else {
461461 printk(KERN_ERR "capi: send DATA_B3_RESP failed=%x\n",
462− errcode);
462+ errcode);
463463 kfree_skb(nskb);
464464
465465 if (errcode == CAPI_SENDQUEUEFULL)
@@ -618,7 +618,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) · 152 unmodified lines
618618 goto unlock_out;
619619 }
620620 if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_IND) {
621− datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+4+2);
621+ datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 4 + 2);
622622 pr_debug("capi_signal: DATA_B3_IND %u len=%d\n",
623623 datahandle, skb->len-CAPIMSG_LEN(skb->data));
624624 skb_queue_tail(&mp->inqueue, skb);
@@ -627,10 +627,10 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) · 2 unmodified lines
627627
628628 } else if (CAPIMSG_SUBCOMMAND(skb->data) == CAPI_CONF) {
629629
630− datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4);
630+ datahandle = CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4);
631631 pr_debug("capi_signal: DATA_B3_CONF %u 0x%x\n",
632632 datahandle,
633− CAPIMSG_U16(skb->data, CAPIMSG_BASELEN+4+2));
633+ CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
634634 kfree_skb(skb);
635635 capiminor_del_ack(mp, datahandle);
636636 tty = tty_port_tty_get(&mp->port);
@@ -669,7 +669,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) · 32 unmodified lines
669669 if (file->f_flags & O_NONBLOCK)
670670 return -EAGAIN;
671671 err = wait_event_interruptible(cdev->recvwait,
672− (skb = skb_dequeue(&cdev->recvqueue)));
672+ (skb = skb_dequeue(&cdev->recvqueue)));
673673 if (err)
674674 return err;
675675 }
@@ -736,7 +736,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos · 60 unmodified lines
736736 }
737737
738738 static unsigned int
739−capi_poll(struct file *file, poll_table * wait)
739+capi_poll(struct file *file, poll_table *wait)
740740 {
741741 struct capidev *cdev = file->private_data;
742742 unsigned int mask = 0;
@@ -786,75 +786,75 @@ register_out: · 43 unmodified lines
786786 return retval;
787787
788788 case CAPI_GET_VERSION:
789− {
790− if (copy_from_user(&data.contr, argp,
791− sizeof(data.contr)))
792− return -EFAULT;
793− cdev->errcode = capi20_get_version(data.contr, &data.version);
794− if (cdev->errcode)
795− return -EIO;
796− if (copy_to_user(argp, &data.version,
797− sizeof(data.version)))
798− return -EFAULT;
799− }
800− return 0;
789+ {
790+ if (copy_from_user(&data.contr, argp,
791+ sizeof(data.contr)))
792+ return -EFAULT;
793+ cdev->errcode = capi20_get_version(data.contr, &data.version);
794+ if (cdev->errcode)
795+ return -EIO;
796+ if (copy_to_user(argp, &data.version,
797+ sizeof(data.version)))
798+ return -EFAULT;
799+ }
800+ return 0;
801801
802802 case CAPI_GET_SERIAL:
803− {
804− if (copy_from_user(&data.contr, argp,
805− sizeof(data.contr)))
806− return -EFAULT;
807− cdev->errcode = capi20_get_serial (data.contr, data.serial);
808− if (cdev->errcode)
809− return -EIO;
810− if (copy_to_user(argp, data.serial,
811− sizeof(data.serial)))
812− return -EFAULT;
813− }
814− return 0;
803+ {
804+ if (copy_from_user(&data.contr, argp,
805+ sizeof(data.contr)))
806+ return -EFAULT;
807+ cdev->errcode = capi20_get_serial(data.contr, data.serial);
808+ if (cdev->errcode)
809+ return -EIO;
810+ if (copy_to_user(argp, data.serial,
811+ sizeof(data.serial)))
812+ return -EFAULT;
813+ }
814+ return 0;
815815 case CAPI_GET_PROFILE:
816− {
817− if (copy_from_user(&data.contr, argp,
818− sizeof(data.contr)))
819− return -EFAULT;
816+ {
817+ if (copy_from_user(&data.contr, argp,
818+ sizeof(data.contr)))
819+ return -EFAULT;
820820
821− if (data.contr == 0) {
822− cdev->errcode = capi20_get_profile(data.contr, &data.profile);
823− if (cdev->errcode)
824− return -EIO;
821+ if (data.contr == 0) {
822+ cdev->errcode = capi20_get_profile(data.contr, &data.profile);
823+ if (cdev->errcode)
824+ return -EIO;
825825
826− retval = copy_to_user(argp,
827− &data.profile.ncontroller,
828− sizeof(data.profile.ncontroller));
826+ retval = copy_to_user(argp,
827+ &data.profile.ncontroller,
828+ sizeof(data.profile.ncontroller));
829829
830− } else {
831− cdev->errcode = capi20_get_profile(data.contr, &data.profile);
832− if (cdev->errcode)
833− return -EIO;
830+ } else {
831+ cdev->errcode = capi20_get_profile(data.contr, &data.profile);
832+ if (cdev->errcode)
833+ return -EIO;
834834
835− retval = copy_to_user(argp, &data.profile,
836− sizeof(data.profile));
837− }
838− if (retval)
839− return -EFAULT;
835+ retval = copy_to_user(argp, &data.profile,
836+ sizeof(data.profile));
840837 }
841− return 0;
838+ if (retval)
839+ return -EFAULT;
840+ }
841+ return 0;
842842
843843 case CAPI_GET_MANUFACTURER:
844− {
845− if (copy_from_user(&data.contr, argp,
846− sizeof(data.contr)))
847− return -EFAULT;
848− cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
849− if (cdev->errcode)
850− return -EIO;
844+ {
845+ if (copy_from_user(&data.contr, argp,
846+ sizeof(data.contr)))
847+ return -EFAULT;
848+ cdev->errcode = capi20_get_manufacturer(data.contr, data.manufacturer);
849+ if (cdev->errcode)
850+ return -EIO;
851851
852− if (copy_to_user(argp, data.manufacturer,
853− sizeof(data.manufacturer)))
854− return -EFAULT;
852+ if (copy_to_user(argp, data.manufacturer,
853+ sizeof(data.manufacturer)))
854+ return -EFAULT;
855855
856− }
857− return 0;
856+ }
857+ return 0;
858858 case CAPI_GET_ERRCODE:
859859 data.errcode = cdev->errcode;
860860 cdev->errcode = CAPI_NOERROR;
@@ -871,15 +871,15 @@ register_out: · 10 unmodified lines
871871 return -ENXIO;
872872
873873 case CAPI_MANUFACTURER_CMD:
874− {
875− struct capi_manufacturer_cmd mcmd;
876− if (!capable(CAP_SYS_ADMIN))
877− return -EPERM;
878− if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
879− return -EFAULT;
880− return capi20_manufacturer(mcmd.cmd, mcmd.data);
881− }
882− return 0;
874+ {
875+ struct capi_manufacturer_cmd mcmd;
876+ if (!capable(CAP_SYS_ADMIN))
877+ return -EPERM;
878+ if (copy_from_user(&mcmd, argp, sizeof(mcmd)))
879+ return -EFAULT;
880+ return capi20_manufacturer(mcmd.cmd, mcmd.data);
881+ }
882+ return 0;
883883
884884 case CAPI_SET_FLAGS:
885885 case CAPI_CLR_FLAGS: {
@@ -1066,7 +1066,7 @@ static int capinc_tty_write(struct tty_struct *tty, · 180 unmodified lines
10661066 mp->outbytes += skb->len;
10671067 }
10681068
1069− skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_ATOMIC);
1069+ skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + count, GFP_ATOMIC);
10701070 if (!skb) {
10711071 printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n");
10721072 spin_unlock_bh(&mp->outlock);
@@ -1107,7 +1107,7 @@ static int capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) · 34 unmodified lines
11071107 invoke_send = true;
11081108 }
11091109
1110− skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+CAPI_MAX_BLKSIZE, GFP_ATOMIC);
1110+ skb = alloc_skb(CAPI_DATA_B3_REQ_LEN + CAPI_MAX_BLKSIZE, GFP_ATOMIC);
11111111 if (skb) {
11121112 skb_reserve(skb, CAPI_DATA_B3_REQ_LEN);
11131113 *(skb_put(skb, 1)) = ch;
@@ -1171,12 +1171,12 @@ static int capinc_tty_chars_in_buffer(struct tty_struct *tty) · 57 unmodified lines
11711171 }
11721172
11731173 static int capinc_tty_ioctl(struct tty_struct *tty,
1174− unsigned int cmd, unsigned long arg)
1174+ unsigned int cmd, unsigned long arg)
11751175 {
11761176 return -ENOIOCTLCMD;
11771177 }
11781178
1179−static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios * old)
1179+static void capinc_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
11801180 {
11811181 pr_debug("capinc_tty_set_termios\n");
11821182 }
@@ -1339,18 +1339,18 @@ static inline void capinc_tty_exit(void) { } · 156 unmodified lines
13391339 */
13401340 static int capi20_proc_show(struct seq_file *m, void *v)
13411341 {
1342− struct capidev *cdev;
1342+ struct capidev *cdev;
13431343 struct list_head *l;
13441344
13451345 mutex_lock(&capidev_list_lock);
13461346 list_for_each(l, &capidev_list) {
13471347 cdev = list_entry(l, struct capidev, list);
13481348 seq_printf(m, "0 %d %lu %lu %lu %lu\n",
1349− cdev->ap.applid,
1350− cdev->ap.nrecvctlpkt,
1351− cdev->ap.nrecvdatapkt,
1352− cdev->ap.nsentctlpkt,
1353− cdev->ap.nsentdatapkt);
1349+ cdev->ap.applid,
1350+ cdev->ap.nrecvctlpkt,
1351+ cdev->ap.nrecvdatapkt,
1352+ cdev->ap.nsentctlpkt,
1353+ cdev->ap.nsentdatapkt);
13541354 }
13551355 mutex_unlock(&capidev_list_lock);
13561356 return 0;
@@ -1445,9 +1445,9 @@ static int __init capi_init(void) · 88 unmodified lines
14451445 proc_init();
14461446
14471447 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1448− compileinfo = " (middleware)";
1448+ compileinfo = " (middleware)";
14491449 #else
1450− compileinfo = " (no middleware)";
1450+ compileinfo = " (no middleware)";
14511451 #endif
14521452 printk(KERN_NOTICE "CAPI 2.0 started up with major %d%s\n",
14531453 capi_major, compileinfo);
drivers/isdn/capi/capidrv.c+478−478
@@ -40,7 +40,7 @@ static int debugmode = 0; · 39 unmodified lines
4040 MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
4141 MODULE_AUTHOR("Carsten Paeth");
4242 MODULE_LICENSE("GPL");
43−module_param(debugmode, uint, S_IRUGO|S_IWUSR);
43+module_param(debugmode, uint, S_IRUGO | S_IWUSR);
4444
4545 /* -------- type definitions ----------------------------------------- */
4646
@@ -64,7 +64,7 @@ struct capidrv_contr { · 17 unmodified lines
6464 int state;
6565 u32 cipmask;
6666 u32 cipmask2;
67− struct timer_list listentimer;
67+ struct timer_list listentimer;
6868
6969 /*
7070 * ID of capi message sent
@@ -105,9 +105,9 @@ struct capidrv_contr { · 34 unmodified lines
105105 /* */
106106 u16 datahandle;
107107 struct ncci_datahandle_queue {
108− struct ncci_datahandle_queue *next;
109− u16 datahandle;
110− int len;
108+ struct ncci_datahandle_queue *next;
109+ u16 datahandle;
110+ int len;
111111 } *ackqueue;
112112 } *ncci_list;
113113 } *plcip;
@@ -142,7 +142,7 @@ static capidrv_data global; · 28 unmodified lines
142142 static DEFINE_SPINLOCK(global_lock);
143143
144144 static void handle_dtrace_data(capidrv_contr *card,
145− int send, int level2, u8 *data, u16 len);
145+ int send, int level2, u8 *data, u16 len);
146146
147147 /* -------- convert functions ---------------------------------------- */
148148
@@ -158,11 +158,11 @@ static inline u32 b1prot(int l2, int l3) · 9 unmodified lines
158158 return 0;
159159 case ISDN_PROTO_L2_TRANS:
160160 return 1;
161− case ISDN_PROTO_L2_V11096:
162− case ISDN_PROTO_L2_V11019:
163− case ISDN_PROTO_L2_V11038:
161+ case ISDN_PROTO_L2_V11096:
162+ case ISDN_PROTO_L2_V11019:
163+ case ISDN_PROTO_L2_V11038:
164164 return 2;
165− case ISDN_PROTO_L2_FAX:
165+ case ISDN_PROTO_L2_FAX:
166166 return 4;
167167 case ISDN_PROTO_L2_MODEM:
168168 return 8;
@@ -179,12 +179,12 @@ static inline u32 b2prot(int l2, int l3) · 10 unmodified lines
179179 return 0;
180180 case ISDN_PROTO_L2_HDLC:
181181 case ISDN_PROTO_L2_TRANS:
182− case ISDN_PROTO_L2_V11096:
183− case ISDN_PROTO_L2_V11019:
184− case ISDN_PROTO_L2_V11038:
182+ case ISDN_PROTO_L2_V11096:
183+ case ISDN_PROTO_L2_V11019:
184+ case ISDN_PROTO_L2_V11038:
185185 case ISDN_PROTO_L2_MODEM:
186186 return 1;
187− case ISDN_PROTO_L2_FAX:
187+ case ISDN_PROTO_L2_FAX:
188188 return 4;
189189 }
190190 }
@@ -197,13 +197,13 @@ static inline u32 b3prot(int l2, int l3) · 6 unmodified lines
197197 case ISDN_PROTO_L2_X75BUI:
198198 case ISDN_PROTO_L2_HDLC:
199199 case ISDN_PROTO_L2_TRANS:
200− case ISDN_PROTO_L2_V11096:
201− case ISDN_PROTO_L2_V11019:
202− case ISDN_PROTO_L2_V11038:
200+ case ISDN_PROTO_L2_V11096:
201+ case ISDN_PROTO_L2_V11019:
202+ case ISDN_PROTO_L2_V11038:
203203 case ISDN_PROTO_L2_MODEM:
204204 default:
205205 return 0;
206− case ISDN_PROTO_L2_FAX:
206+ case ISDN_PROTO_L2_FAX:
207207 return 4;
208208 }
209209 }
@@ -231,38 +231,38 @@ static _cstruct b1config(int l2, int l3) · 21 unmodified lines
231231 case ISDN_PROTO_L2_TRANS:
232232 default:
233233 return NULL;
234− case ISDN_PROTO_L2_V11096:
235− return b1config_async_v110(9600);
236− case ISDN_PROTO_L2_V11019:
237− return b1config_async_v110(19200);
238− case ISDN_PROTO_L2_V11038:
239− return b1config_async_v110(38400);
234+ case ISDN_PROTO_L2_V11096:
235+ return b1config_async_v110(9600);
236+ case ISDN_PROTO_L2_V11019:
237+ return b1config_async_v110(19200);
238+ case ISDN_PROTO_L2_V11038:
239+ return b1config_async_v110(38400);
240240 }
241241 }
242242
243243 static inline u16 si2cip(u8 si1, u8 si2)
244244 {
245245 static const u8 cip[17][5] =
246− {
247− /* 0 1 2 3 4 */
248− {0, 0, 0, 0, 0}, /*0 */
249− {16, 16, 4, 26, 16}, /*1 */
250− {17, 17, 17, 4, 4}, /*2 */
251− {2, 2, 2, 2, 2}, /*3 */
252− {18, 18, 18, 18, 18}, /*4 */
253− {2, 2, 2, 2, 2}, /*5 */
254− {0, 0, 0, 0, 0}, /*6 */
255− {2, 2, 2, 2, 2}, /*7 */
256− {2, 2, 2, 2, 2}, /*8 */
257− {21, 21, 21, 21, 21}, /*9 */
258− {19, 19, 19, 19, 19}, /*10 */
259− {0, 0, 0, 0, 0}, /*11 */
260− {0, 0, 0, 0, 0}, /*12 */
261− {0, 0, 0, 0, 0}, /*13 */
262− {0, 0, 0, 0, 0}, /*14 */
263− {22, 22, 22, 22, 22}, /*15 */
264− {27, 27, 27, 28, 27} /*16 */
265− };
246+ {
247+ /* 0 1 2 3 4 */
248+ {0, 0, 0, 0, 0}, /*0 */
249+ {16, 16, 4, 26, 16}, /*1 */
250+ {17, 17, 17, 4, 4}, /*2 */
251+ {2, 2, 2, 2, 2}, /*3 */
252+ {18, 18, 18, 18, 18}, /*4 */
253+ {2, 2, 2, 2, 2}, /*5 */
254+ {0, 0, 0, 0, 0}, /*6 */
255+ {2, 2, 2, 2, 2}, /*7 */
256+ {2, 2, 2, 2, 2}, /*8 */
257+ {21, 21, 21, 21, 21}, /*9 */
258+ {19, 19, 19, 19, 19}, /*10 */
259+ {0, 0, 0, 0, 0}, /*11 */
260+ {0, 0, 0, 0, 0}, /*12 */
261+ {0, 0, 0, 0, 0}, /*13 */
262+ {0, 0, 0, 0, 0}, /*14 */
263+ {22, 22, 22, 22, 22}, /*15 */
264+ {27, 27, 27, 28, 27} /*16 */
265+ };
266266 if (si1 > 16)
267267 si1 = 0;
268268 if (si2 > 4)
@@ -274,10 +274,10 @@ static inline u16 si2cip(u8 si1, u8 si2) · 5 unmodified lines
274274 static inline u8 cip2si1(u16 cipval)
275275 {
276276 static const u8 si[32] =
277− {7, 1, 7, 7, 1, 1, 7, 7, /*0-7 */
278− 7, 1, 0, 0, 0, 0, 0, 0, /*8-15 */
279− 1, 2, 4, 10, 9, 9, 15, 7, /*16-23 */
280− 7, 7, 1, 16, 16, 0, 0, 0}; /*24-31 */
277+ {7, 1, 7, 7, 1, 1, 7, 7, /*0-7 */
278+ 7, 1, 0, 0, 0, 0, 0, 0, /*8-15 */
279+ 1, 2, 4, 10, 9, 9, 15, 7, /*16-23 */
280+ 7, 7, 1, 16, 16, 0, 0, 0}; /*24-31 */
281281
282282 if (cipval > 31)
283283 cipval = 0; /* .... */
@@ -287,10 +287,10 @@ static inline u8 cip2si1(u16 cipval) · 3 unmodified lines
287287 static inline u8 cip2si2(u16 cipval)
288288 {
289289 static const u8 si[32] =
290− {0, 0, 0, 0, 2, 3, 0, 0, /*0-7 */
291− 0, 3, 0, 0, 0, 0, 0, 0, /*8-15 */
292− 1, 2, 0, 0, 9, 0, 0, 0, /*16-23 */
293− 0, 0, 3, 2, 3, 0, 0, 0}; /*24-31 */
290+ {0, 0, 0, 0, 2, 3, 0, 0, /*0-7 */
291+ 0, 3, 0, 0, 0, 0, 0, 0, /*8-15 */
292+ 1, 2, 0, 0, 9, 0, 0, 0, /*16-23 */
293+ 0, 0, 3, 2, 3, 0, 0, 0}; /*24-31 */
294294
295295 if (cipval > 31)
296296 cipval = 0; /* .... */
@@ -302,7 +302,7 @@ static inline u8 cip2si2(u16 cipval) · 5 unmodified lines
302302
303303 static inline capidrv_contr *findcontrbydriverid(int driverid)
304304 {
305− unsigned long flags;
305+ unsigned long flags;
306306 capidrv_contr *p;
307307
308308 spin_lock_irqsave(&global_lock, flags);
@@ -329,7 +329,7 @@ static capidrv_contr *findcontrbynumber(u32 contr) · 20 unmodified lines
329329
330330 /* -------- plci management ------------------------------------------ */
331331
332−static capidrv_plci *new_plci(capidrv_contr * card, int chan)
332+static capidrv_plci *new_plci(capidrv_contr *card, int chan)
333333 {
334334 capidrv_plci *plcip;
335335
@@ -349,7 +349,7 @@ static capidrv_plci *new_plci(capidrv_contr * card, int chan) · 13 unmodified lines
349349 return plcip;
350350 }
351351
352−static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci)
352+static capidrv_plci *find_plci_by_plci(capidrv_contr *card, u32 plci)
353353 {
354354 capidrv_plci *p;
355355 for (p = card->plci_list; p; p = p->next)
@@ -358,7 +358,7 @@ static capidrv_plci *find_plci_by_plci(capidrv_contr * card, u32 plci) · 2 unmodified lines
358358 return NULL;
359359 }
360360
361−static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
361+static capidrv_plci *find_plci_by_msgid(capidrv_contr *card, u16 msgid)
362362 {
363363 capidrv_plci *p;
364364 for (p = card->plci_list; p; p = p->next)
@@ -367,7 +367,7 @@ static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid) · 2 unmodified lines
367367 return NULL;
368368 }
369369
370−static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
370+static capidrv_plci *find_plci_by_ncci(capidrv_contr *card, u32 ncci)
371371 {
372372 capidrv_plci *p;
373373 for (p = card->plci_list; p; p = p->next)
@@ -376,7 +376,7 @@ static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci) · 2 unmodified lines
376376 return NULL;
377377 }
378378
379−static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
379+static void free_plci(capidrv_contr *card, capidrv_plci *plcip)
380380 {
381381 capidrv_plci **pp;
382382
@@ -396,8 +396,8 @@ static void free_plci(capidrv_contr * card, capidrv_plci * plcip) · 13 unmodified lines
396396
397397 /* -------- ncci management ------------------------------------------ */
398398
399−static inline capidrv_ncci *new_ncci(capidrv_contr * card,
400− capidrv_plci * plcip,
399+static inline capidrv_ncci *new_ncci(capidrv_contr *card,
400+ capidrv_plci *plcip,
401401 u32 ncci)
402402 {
403403 capidrv_ncci *nccip;
@@ -421,7 +421,7 @@ static inline capidrv_ncci *new_ncci(capidrv_contr * card, · 17 unmodified lines
421421 return nccip;
422422 }
423423
424−static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci)
424+static inline capidrv_ncci *find_ncci(capidrv_contr *card, u32 ncci)
425425 {
426426 capidrv_plci *plcip;
427427 capidrv_ncci *p;
@@ -435,7 +435,7 @@ static inline capidrv_ncci *find_ncci(capidrv_contr * card, u32 ncci) · 7 unmodified lines
435435 return NULL;
436436 }
437437
438−static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
438+static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr *card,
439439 u32 ncci, u16 msgid)
440440 {
441441 capidrv_plci *plcip;
@@ -450,7 +450,7 @@ static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card, · 8 unmodified lines
450450 return NULL;
451451 }
452452
453−static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
453+static void free_ncci(capidrv_contr *card, struct capidrv_ncci *nccip)
454454 {
455455 struct capidrv_ncci **pp;
456456
@@ -465,20 +465,20 @@ static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip) · 8 unmodified lines
465465 }
466466
467467 static int capidrv_add_ack(struct capidrv_ncci *nccip,
468− u16 datahandle, int len)
468+ u16 datahandle, int len)
469469 {
470470 struct ncci_datahandle_queue *n, **pp;
471471
472472 n = (struct ncci_datahandle_queue *)
473473 kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
474474 if (!n) {
475− printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
476− return -1;
475+ printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
476+ return -1;
477477 }
478478 n->next = NULL;
479479 n->datahandle = datahandle;
480480 n->len = len;
481− for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
481+ for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next);
482482 *pp = n;
483483 return 0;
484484 }
@@ -489,11 +489,11 @@ static int capidrv_del_ack(struct capidrv_ncci *nccip, u16 datahandle) · 4 unmodified lines
489489 int len;
490490
491491 for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) {
492− if ((*pp)->datahandle == datahandle) {
492+ if ((*pp)->datahandle == datahandle) {
493493 p = *pp;
494494 len = p->len;
495495 *pp = (*pp)->next;
496− kfree(p);
496+ kfree(p);
497497 return len;
498498 }
499499 }
@@ -502,7 +502,7 @@ static int capidrv_del_ack(struct capidrv_ncci *nccip, u16 datahandle) · 2 unmodified lines
502502
503503 /* -------- convert and send capi message ---------------------------- */
504504
505−static void send_message(capidrv_contr * card, _cmsg * cmsg)
505+static void send_message(capidrv_contr *card, _cmsg *cmsg)
506506 {
507507 struct sk_buff *skb;
508508 size_t len;
@@ -529,18 +529,18 @@ struct listenstatechange { · 20 unmodified lines
529529
530530 static struct listenstatechange listentable[] =
531531 {
532− {ST_LISTEN_NONE, ST_LISTEN_WAIT_CONF, EV_LISTEN_REQ},
533− {ST_LISTEN_ACTIVE, ST_LISTEN_ACTIVE_WAIT_CONF, EV_LISTEN_REQ},
534− {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_ERROR},
535− {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_ERROR},
536− {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY},
537− {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY},
538− {ST_LISTEN_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK},
539− {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK},
540− {},
532+ {ST_LISTEN_NONE, ST_LISTEN_WAIT_CONF, EV_LISTEN_REQ},
533+ {ST_LISTEN_ACTIVE, ST_LISTEN_ACTIVE_WAIT_CONF, EV_LISTEN_REQ},
534+ {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_ERROR},
535+ {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_ERROR},
536+ {ST_LISTEN_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY},
537+ {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_NONE, EV_LISTEN_CONF_EMPTY},
538+ {ST_LISTEN_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK},
539+ {ST_LISTEN_ACTIVE_WAIT_CONF, ST_LISTEN_ACTIVE, EV_LISTEN_CONF_OK},
540+ {},
541541 };
542542
543−static void listen_change_state(capidrv_contr * card, int event)
543+static void listen_change_state(capidrv_contr *card, int event)
544544 {
545545 struct listenstatechange *p = listentable;
546546 while (p->event) {
@@ -560,7 +560,7 @@ static void listen_change_state(capidrv_contr * card, int event) · 13 unmodified lines
560560
561561 /* ------------------------------------------------------------------ */
562562
563−static void p0(capidrv_contr * card, capidrv_plci * plci)
563+static void p0(capidrv_contr *card, capidrv_plci *plci)
564564 {
565565 isdn_ctrl cmd;
566566
@@ -578,71 +578,71 @@ struct plcistatechange { · 11 unmodified lines
578578 int actstate;
579579 int nextstate;
580580 int event;
581− void (*changefunc) (capidrv_contr * card, capidrv_plci * plci);
581+ void (*changefunc)(capidrv_contr *card, capidrv_plci *plci);
582582 };
583583
584584 static struct plcistatechange plcitable[] =
585585 {
586− /* P-0 */
587− {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL},
588− {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL},
589− {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL},
590− {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL},
591− /* P-0.1 */
592− {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0},
593− {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL},
594− /* P-1 */
595− {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
596− {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
597− {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
598− {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
599− /* P-ACT */
600− {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
601− {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
602− {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
603− {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL},
604− {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL},
605− /* P-2 */
606− {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
607− {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL},
608− {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL},
609− {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
610− {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
611− {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
612− {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL},
613− /* P-3 */
614− {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
615− {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
616− {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
617− {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
618− {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
619− /* P-4 */
620− {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
621− {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
622− {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
623− {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
624− /* P-5 */
625− {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
626− /* P-6 */
627− {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0},
628− /* P-0.Res */
629− {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0},
630− {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL},
631− /* P-RES */
632− {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL},
633− /* P-HELD */
634− {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL},
635− {},
586+ /* P-0 */
587+ {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL},
588+ {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL},
589+ {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL},
590+ {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL},
591+ /* P-0.1 */
592+ {ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0},
593+ {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL},
594+ /* P-1 */
595+ {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
596+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
597+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
598+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
599+ /* P-ACT */
600+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
601+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
602+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
603+ {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL},
604+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL},
605+ /* P-2 */
606+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
607+ {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL},
608+ {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL},
609+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
610+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
611+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
612+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL},
613+ /* P-3 */
614+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
615+ {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
616+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
617+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
618+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
619+ /* P-4 */
620+ {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
621+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
622+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
623+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
624+ /* P-5 */
625+ {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
626+ /* P-6 */
627+ {ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0},
628+ /* P-0.Res */
629+ {ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0},
630+ {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL},
631+ /* P-RES */
632+ {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL},
633+ /* P-HELD */
634+ {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL},
635+ {},
636636 };
637637
638−static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int event)
638+static void plci_change_state(capidrv_contr *card, capidrv_plci *plci, int event)
639639 {
640640 struct plcistatechange *p = plcitable;
641641 while (p->event) {
642642 if (plci->state == p->actstate && p->event == event) {
643643 if (debugmode)
644644 printk(KERN_DEBUG "capidrv-%d: plci_change_state:0x%x %d -> %d\n",
645− card->contrnr, plci->plci, plci->state, p->nextstate);
645+ card->contrnr, plci->plci, plci->state, p->nextstate);
646646 plci->state = p->nextstate;
647647 if (p->changefunc)
648648 p->changefunc(card, plci);
@@ -658,7 +658,7 @@ static void plci_change_state(capidrv_contr * card, capidrv_plci * plci, int eve · 9 unmodified lines
658658
659659 static _cmsg cmsg;
660660
661−static void n0(capidrv_contr * card, capidrv_ncci * ncci)
661+static void n0(capidrv_contr *card, capidrv_ncci *ncci)
662662 {
663663 isdn_ctrl cmd;
664664
@@ -670,7 +670,7 @@ static void n0(capidrv_contr * card, capidrv_ncci * ncci) · 5 unmodified lines
670670 NULL, /* Keypadfacility */
671671 NULL, /* Useruserdata */ /* $$$$ */
672672 NULL /* Facilitydataarray */
673− );
673+ );
674674 plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ);
675675 send_message(card, &cmsg);
676676
@@ -687,51 +687,51 @@ struct nccistatechange { · 10 unmodified lines
687687 int actstate;
688688 int nextstate;
689689 int event;
690− void (*changefunc) (capidrv_contr * card, capidrv_ncci * ncci);
690+ void (*changefunc)(capidrv_contr *card, capidrv_ncci *ncci);
691691 };
692692
693693 static struct nccistatechange nccitable[] =
694694 {
695− /* N-0 */
696− {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL},
697− {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL},
698− /* N-0.1 */
699− {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL},
700− {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0},
701− /* N-1 */
702− {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL},
703− {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL},
704− {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
705− {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
706− /* N-2 */
707− {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL},
708− {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
709− {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
710− /* N-ACT */
711− {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
712− {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL},
713− {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
714− {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
715− /* N-3 */
716− {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
717− {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
718− {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
719− /* N-4 */
720− {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
721− {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL},
722− /* N-5 */
723− {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
724− {},
695+ /* N-0 */
696+ {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL},
697+ {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL},
698+ /* N-0.1 */
699+ {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL},
700+ {ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0},
701+ /* N-1 */
702+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL},
703+ {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL},
704+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
705+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
706+ /* N-2 */
707+ {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL},
708+ {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
709+ {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
710+ /* N-ACT */
711+ {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
712+ {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL},
713+ {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
714+ {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
715+ /* N-3 */
716+ {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
717+ {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
718+ {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
719+ /* N-4 */
720+ {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
721+ {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR, NULL},
722+ /* N-5 */
723+ {ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
724+ {},
725725 };
726726
727−static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int event)
727+static void ncci_change_state(capidrv_contr *card, capidrv_ncci *ncci, int event)
728728 {
729729 struct nccistatechange *p = nccitable;
730730 while (p->event) {
731731 if (ncci->state == p->actstate && p->event == event) {
732732 if (debugmode)
733733 printk(KERN_DEBUG "capidrv-%d: ncci_change_state:0x%x %d -> %d\n",
734− card->contrnr, ncci->ncci, ncci->state, p->nextstate);
734+ card->contrnr, ncci->ncci, ncci->state, p->nextstate);
735735 if (p->nextstate == ST_NCCI_PREVIOUS) {
736736 ncci->state = ncci->oldstate;
737737 ncci->oldstate = p->actstate;
@@ -751,7 +751,7 @@ static void ncci_change_state(capidrv_contr * card, capidrv_ncci * ncci, int eve · 13 unmodified lines
751751
752752 /* ------------------------------------------------------------------- */
753753
754−static inline int new_bchan(capidrv_contr * card)
754+static inline int new_bchan(capidrv_contr *card)
755755 {
756756 int i;
757757 for (i = 0; i < card->nbchan; i++) {
@@ -765,7 +765,7 @@ static inline int new_bchan(capidrv_contr * card) · 7 unmodified lines
765765
766766 /* ------------------------------------------------------------------- */
767767
768−static void handle_controller(_cmsg * cmsg)
768+static void handle_controller(_cmsg *cmsg)
769769 {
770770 capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
771771
@@ -791,54 +791,54 @@ static void handle_controller(_cmsg * cmsg) · 19 unmodified lines
791791 break;
792792
793793 case CAPI_MANUFACTURER_IND: /* Controller */
794− if ( cmsg->ManuID == 0x214D5641
794+ if (cmsg->ManuID == 0x214D5641
795795 && cmsg->Class == 0
796796 && cmsg->Function == 1) {
797− u8 *data = cmsg->ManuData+3;
798− u16 len = cmsg->ManuData[0];
799− u16 layer;
800− int direction;
801− if (len == 255) {
802− len = (cmsg->ManuData[1] | (cmsg->ManuData[2] << 8));
803− data += 2;
804− }
805− len -= 2;
806− layer = ((*(data-1)) << 8) | *(data-2);
807− if (layer & 0x300)
808− direction = (layer & 0x200) ? 0 : 1;
809− else direction = (layer & 0x800) ? 0 : 1;
810− if (layer & 0x0C00) {
811− if ((layer & 0xff) == 0x80) {
812− handle_dtrace_data(card, direction, 1, data, len);
813− break;
814− }
815− } else if ((layer & 0xff) < 0x80) {
816− handle_dtrace_data(card, direction, 0, data, len);
817− break;
818− }
819− printk(KERN_INFO "capidrv-%d: %s from controller 0x%x layer 0x%x, ignored\n",
820− card->contrnr,
821− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
822− cmsg->adr.adrController, layer);
823− break;
797+ u8 *data = cmsg->ManuData + 3;
798+ u16 len = cmsg->ManuData[0];
799+ u16 layer;
800+ int direction;
801+ if (len == 255) {
802+ len = (cmsg->ManuData[1] | (cmsg->ManuData[2] << 8));
803+ data += 2;
804+ }
805+ len -= 2;
806+ layer = ((*(data - 1)) << 8) | *(data - 2);
807+ if (layer & 0x300)
808+ direction = (layer & 0x200) ? 0 : 1;
809+ else direction = (layer & 0x800) ? 0 : 1;
810+ if (layer & 0x0C00) {
811+ if ((layer & 0xff) == 0x80) {
812+ handle_dtrace_data(card, direction, 1, data, len);
813+ break;
814+ }
815+ } else if ((layer & 0xff) < 0x80) {
816+ handle_dtrace_data(card, direction, 0, data, len);
817+ break;
818+ }
819+ printk(KERN_INFO "capidrv-%d: %s from controller 0x%x layer 0x%x, ignored\n",
820+ card->contrnr,
821+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
822+ cmsg->adr.adrController, layer);
823+ break;
824824 }
825825 goto ignored;
826826 case CAPI_MANUFACTURER_CONF: /* Controller */
827827 if (cmsg->ManuID == 0x214D5641) {
828− char *s = NULL;
829− switch (cmsg->Class) {
830− case 0: break;
831− case 1: s = "unknown class"; break;
832− case 2: s = "unknown function"; break;
833− default: s = "unknown error"; break;
834− }
835− if (s)
836− printk(KERN_INFO "capidrv-%d: %s from controller 0x%x function %d: %s\n",
837− card->contrnr,
838− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
839− cmsg->adr.adrController,
840− cmsg->Function, s);
841− break;
828+ char *s = NULL;
829+ switch (cmsg->Class) {
830+ case 0: break;
831+ case 1: s = "unknown class"; break;
832+ case 2: s = "unknown function"; break;
833+ default: s = "unknown error"; break;
834+ }
835+ if (s)
836+ printk(KERN_INFO "capidrv-%d: %s from controller 0x%x function %d: %s\n",
837+ card->contrnr,
838+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
839+ cmsg->adr.adrController,
840+ cmsg->Function, s);
841+ break;
842842 }
843843 goto ignored;
844844 case CAPI_FACILITY_IND: /* Controller/plci/ncci */
@@ -858,14 +858,14 @@ static void handle_controller(_cmsg * cmsg) · 13 unmodified lines
858858 }
859859 return;
860860
861− ignored:
861+ignored:
862862 printk(KERN_INFO "capidrv-%d: %s from controller 0x%x ignored\n",
863863 card->contrnr,
864864 capi_cmd2str(cmsg->Command, cmsg->Subcommand),
865865 cmsg->adr.adrController);
866866 }
867867
868−static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg)
868+static void handle_incoming_call(capidrv_contr *card, _cmsg *cmsg)
869869 {
870870 capidrv_plci *plcip;
871871 capidrv_bchan *bchan;
@@ -890,27 +890,27 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) · 18 unmodified lines
890890 cmd.arg = chan;
891891 memset(&cmd.parm.setup, 0, sizeof(cmd.parm.setup));
892892 strncpy(cmd.parm.setup.phone,
893− cmsg->CallingPartyNumber + 3,
893+ cmsg->CallingPartyNumber + 3,
894894 cmsg->CallingPartyNumber[0] - 2);
895895 strncpy(cmd.parm.setup.eazmsn,
896− cmsg->CalledPartyNumber + 2,
896+ cmsg->CalledPartyNumber + 2,
897897 cmsg->CalledPartyNumber[0] - 1);
898898 cmd.parm.setup.si1 = cip2si1(cmsg->CIPValue);
899899 cmd.parm.setup.si2 = cip2si2(cmsg->CIPValue);
900900 cmd.parm.setup.plan = cmsg->CallingPartyNumber[1];
901901 cmd.parm.setup.screen = cmsg->CallingPartyNumber[2];
902902
903− printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s\n",
904− card->contrnr,
905− cmd.parm.setup.phone,
906− cmd.parm.setup.si1,
907− cmd.parm.setup.si2,
908− cmd.parm.setup.eazmsn);
903+ printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s\n",
904+ card->contrnr,
905+ cmd.parm.setup.phone,
906+ cmd.parm.setup.si1,
907+ cmd.parm.setup.si2,
908+ cmd.parm.setup.eazmsn);
909909
910910 if (cmd.parm.setup.si1 == 1 && cmd.parm.setup.si2 != 0) {
911− printk(KERN_INFO "capidrv-%d: patching si2=%d to 0 for VBOX\n",
912− card->contrnr,
913− cmd.parm.setup.si2);
911+ printk(KERN_INFO "capidrv-%d: patching si2=%d to 0 for VBOX\n",
912+ card->contrnr,
913+ cmd.parm.setup.si2);
914914 cmd.parm.setup.si2 = 0;
915915 }
916916
@@ -927,11 +927,11 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) · 10 unmodified lines
927927 plci_change_state(card, plcip, EV_PLCI_CONNECT_REJECT);
928928 send_message(card, cmsg);
929929 printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s ignored\n",
930− card->contrnr,
931− cmd.parm.setup.phone,
932− cmd.parm.setup.si1,
933− cmd.parm.setup.si2,
934− cmd.parm.setup.eazmsn);
930+ card->contrnr,
931+ cmd.parm.setup.phone,
932+ cmd.parm.setup.si1,
933+ cmd.parm.setup.si2,
934+ cmd.parm.setup.eazmsn);
935935 break;
936936 case 1:
937937 /* At least one device matching this call (RING on ttyI)
@@ -945,11 +945,11 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) · 7 unmodified lines
945945 */
946946 if (plcip->state == ST_PLCI_INCOMING) {
947947 printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s tty alerting\n",
948− card->contrnr,
949− cmd.parm.setup.phone,
950− cmd.parm.setup.si1,
951− cmd.parm.setup.si2,
952− cmd.parm.setup.eazmsn);
948+ card->contrnr,
949+ cmd.parm.setup.phone,
950+ cmd.parm.setup.si1,
951+ cmd.parm.setup.si2,
952+ cmd.parm.setup.eazmsn);
953953 capi_fill_ALERT_REQ(cmsg,
954954 global.ap.applid,
955955 card->msgid++,
@@ -958,16 +958,16 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) · 2 unmodified lines
958958 NULL,/* Keypadfacility */
959959 NULL,/* Useruserdata */
960960 NULL /* Facilitydataarray */
961− );
961+ );
962962 plcip->msgid = cmsg->Messagenumber;
963963 send_message(card, cmsg);
964964 } else {
965965 printk(KERN_INFO "capidrv-%d: incoming call %s,%d,%d,%s on netdev\n",
966− card->contrnr,
967− cmd.parm.setup.phone,
968− cmd.parm.setup.si1,
969− cmd.parm.setup.si2,
970− cmd.parm.setup.eazmsn);
966+ card->contrnr,
967+ cmd.parm.setup.phone,
968+ cmd.parm.setup.si1,
969+ cmd.parm.setup.si2,
970+ cmd.parm.setup.eazmsn);
971971 }
972972 break;
973973
@@ -990,7 +990,7 @@ static void handle_incoming_call(capidrv_contr * card, _cmsg * cmsg) · 16 unmodified lines
990990 return;
991991 }
992992
993−static void handle_plci(_cmsg * cmsg)
993+static void handle_plci(_cmsg *cmsg)
994994 {
995995 capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
996996 capidrv_plci *plcip;
@@ -1008,8 +1008,8 @@ static void handle_plci(_cmsg * cmsg) · 11 unmodified lines
10081008 case CAPI_DISCONNECT_IND: /* plci */
10091009 if (cmsg->Reason) {
10101010 printk(KERN_INFO "capidrv-%d: %s reason 0x%x (%s) for plci 0x%x\n",
1011− card->contrnr,
1012− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1011+ card->contrnr,
1012+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
10131013 cmsg->Reason, capi_info2str(cmsg->Reason), cmsg->adr.adrPLCI);
10141014 }
10151015 if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI))) {
@@ -1027,9 +1027,9 @@ static void handle_plci(_cmsg * cmsg) · 11 unmodified lines
10271027 case CAPI_DISCONNECT_CONF: /* plci */
10281028 if (cmsg->Info) {
10291029 printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n",
1030− card->contrnr,
1031− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1032− cmsg->Info, capi_info2str(cmsg->Info),
1030+ card->contrnr,
1031+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1032+ cmsg->Info, capi_info2str(cmsg->Info),
10331033 cmsg->adr.adrPLCI);
10341034 }
10351035 if (!(plcip = find_plci_by_plci(card, cmsg->adr.adrPLCI)))
@@ -1041,9 +1041,9 @@ static void handle_plci(_cmsg * cmsg) · 5 unmodified lines
10411041 case CAPI_ALERT_CONF: /* plci */
10421042 if (cmsg->Info) {
10431043 printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n",
1044− card->contrnr,
1045− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1046− cmsg->Info, capi_info2str(cmsg->Info),
1044+ card->contrnr,
1045+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1046+ cmsg->Info, capi_info2str(cmsg->Info),
10471047 cmsg->adr.adrPLCI);
10481048 }
10491049 break;
@@ -1055,9 +1055,9 @@ static void handle_plci(_cmsg * cmsg) · 5 unmodified lines
10551055 case CAPI_CONNECT_CONF: /* plci */
10561056 if (cmsg->Info) {
10571057 printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for plci 0x%x\n",
1058− card->contrnr,
1059− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1060− cmsg->Info, capi_info2str(cmsg->Info),
1058+ card->contrnr,
1059+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1060+ cmsg->Info, capi_info2str(cmsg->Info),
10611061 cmsg->adr.adrPLCI);
10621062 }
10631063 if (!(plcip = find_plci_by_msgid(card, cmsg->Messagenumber)))
@@ -1096,7 +1096,7 @@ static void handle_plci(_cmsg * cmsg) · 32 unmodified lines
10961096 card->msgid++,
10971097 plcip->plci, /* adr */
10981098 NULL /* NCPI */
1099− );
1099+ );
11001100 nccip->msgid = cmsg->Messagenumber;
11011101 plci_change_state(card, plcip,
11021102 EV_PLCI_CONNECT_ACTIVE_IND);
@@ -1122,8 +1122,8 @@ static void handle_plci(_cmsg * cmsg) · 19 unmodified lines
11221122 sprintf(cmd.parm.num, "%lu",
11231123 (unsigned long)
11241124 ((u32) cmsg->InfoElement[1]
1125− | ((u32) (cmsg->InfoElement[2]) << 8)
1126− | ((u32) (cmsg->InfoElement[3]) << 16)
1125+ | ((u32) (cmsg->InfoElement[2]) << 8)
1126+ | ((u32) (cmsg->InfoElement[3]) << 16)
11271127 | ((u32) (cmsg->InfoElement[4]) << 24)));
11281128 card->interface.statcallb(&cmd);
11291129 break;
@@ -1132,11 +1132,11 @@ static void handle_plci(_cmsg * cmsg) · 2 unmodified lines
11321132 cdb = capi_cmsg2str(cmsg);
11331133 if (cdb) {
11341134 printk(KERN_WARNING "capidrv-%d: %s\n",
1135− card->contrnr, cdb->buf);
1135+ card->contrnr, cdb->buf);
11361136 cdebbuf_free(cdb);
11371137 } else
11381138 printk(KERN_WARNING "capidrv-%d: CAPI_INFO_IND InfoNumber %x not handled\n",
1139− card->contrnr, cmsg->InfoNumber);
1139+ card->contrnr, cmsg->InfoNumber);
11401140
11411141 break;
11421142
@@ -1159,13 +1159,13 @@ static void handle_plci(_cmsg * cmsg) · 16 unmodified lines
11591159 cmsg->adr.adrPLCI);
11601160 }
11611161 return;
1162− ignored:
1162+ignored:
11631163 printk(KERN_INFO "capidrv-%d: %s for plci 0x%x ignored\n",
11641164 card->contrnr,
11651165 capi_cmd2str(cmsg->Command, cmsg->Subcommand),
11661166 cmsg->adr.adrPLCI);
11671167 return;
1168− notfound:
1168+notfound:
11691169 printk(KERN_ERR "capidrv-%d: %s: plci 0x%x not found\n",
11701170 card->contrnr,
11711171 capi_cmd2str(cmsg->Command, cmsg->Subcommand),
@@ -1173,7 +1173,7 @@ static void handle_plci(_cmsg * cmsg) · 1 unmodified line
11731173 return;
11741174 }
11751175
1176−static void handle_ncci(_cmsg * cmsg)
1176+static void handle_ncci(_cmsg *cmsg)
11771177 {
11781178 capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
11791179 capidrv_plci *plcip;
@@ -1222,7 +1222,7 @@ static void handle_ncci(_cmsg * cmsg) · 42 unmodified lines
12221222 nccip->ncci, /* adr */
12231223 0, /* Reject */
12241224 NULL /* NCPI */
1225− );
1225+ );
12261226 ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP);
12271227 send_message(card, cmsg);
12281228 break;
@@ -1230,8 +1230,8 @@ static void handle_ncci(_cmsg * cmsg) · 1 unmodified line
12301230 printk(KERN_ERR "capidrv-%d: no mem for ncci, sorry\n", card->contrnr);
12311231 } else {
12321232 printk(KERN_ERR "capidrv-%d: %s: plci for ncci 0x%x not found\n",
1233− card->contrnr,
1234− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1233+ card->contrnr,
1234+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
12351235 cmsg->adr.adrNCCI);
12361236 }
12371237 capi_fill_CONNECT_B3_RESP(cmsg,
@@ -1240,7 +1240,7 @@ static void handle_ncci(_cmsg * cmsg) · 2 unmodified lines
12401240 cmsg->adr.adrNCCI,
12411241 2, /* Reject */
12421242 NULL /* NCPI */
1243− );
1243+ );
12441244 send_message(card, cmsg);
12451245 break;
12461246
@@ -1254,9 +1254,9 @@ static void handle_ncci(_cmsg * cmsg) · 7 unmodified lines
12541254 nccip->ncci = cmsg->adr.adrNCCI;
12551255 if (cmsg->Info) {
12561256 printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n",
1257− card->contrnr,
1258− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1259− cmsg->Info, capi_info2str(cmsg->Info),
1257+ card->contrnr,
1258+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1259+ cmsg->Info, capi_info2str(cmsg->Info),
12601260 cmsg->adr.adrNCCI);
12611261 }
12621262
@@ -1278,7 +1278,7 @@ static void handle_ncci(_cmsg * cmsg) · 15 unmodified lines
12781278 case CAPI_DATA_B3_CONF: /* ncci */
12791279 if (cmsg->Info) {
12801280 printk(KERN_WARNING "CAPI_DATA_B3_CONF: Info %x - %s\n",
1281− cmsg->Info, capi_info2str(cmsg->Info));
1281+ cmsg->Info, capi_info2str(cmsg->Info));
12821282 }
12831283 if (!(nccip = find_ncci(card, cmsg->adr.adrNCCI)))
12841284 goto notfound;
@@ -1286,11 +1286,11 @@ static void handle_ncci(_cmsg * cmsg) · 1 unmodified line
12861286 len = capidrv_del_ack(nccip, cmsg->DataHandle);
12871287 if (len < 0)
12881288 break;
1289− cmd.command = ISDN_STAT_BSENT;
1290− cmd.driver = card->myid;
1291− cmd.arg = nccip->chan;
1289+ cmd.command = ISDN_STAT_BSENT;
1290+ cmd.driver = card->myid;
1291+ cmd.arg = nccip->chan;
12921292 cmd.parm.length = len;
1293− card->interface.statcallb(&cmd);
1293+ card->interface.statcallb(&cmd);
12941294 break;
12951295
12961296 case CAPI_DISCONNECT_B3_IND: /* ncci */
@@ -1309,9 +1309,9 @@ static void handle_ncci(_cmsg * cmsg) · 12 unmodified lines
13091309 goto notfound;
13101310 if (cmsg->Info) {
13111311 printk(KERN_INFO "capidrv-%d: %s info 0x%x (%s) for ncci 0x%x\n",
1312− card->contrnr,
1313− capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1314− cmsg->Info, capi_info2str(cmsg->Info),
1312+ card->contrnr,
1313+ capi_cmd2str(cmsg->Command, cmsg->Subcommand),
1314+ cmsg->Info, capi_info2str(cmsg->Info),
13151315 cmsg->adr.adrNCCI);
13161316 ncci_change_state(card, nccip, EV_NCCI_DISCONNECT_B3_CONF_ERROR);
13171317 }
@@ -1340,13 +1340,13 @@ static void handle_ncci(_cmsg * cmsg) · 22 unmodified lines
13401340 cmsg->adr.adrNCCI);
13411341 }
13421342 return;
1343− ignored:
1343+ignored:
13441344 printk(KERN_INFO "capidrv-%d: %s for ncci 0x%x ignored\n",
13451345 card->contrnr,
13461346 capi_cmd2str(cmsg->Command, cmsg->Subcommand),
13471347 cmsg->adr.adrNCCI);
13481348 return;
1349− notfound:
1349+notfound:
13501350 printk(KERN_ERR "capidrv-%d: %s: ncci 0x%x not found\n",
13511351 card->contrnr,
13521352 capi_cmd2str(cmsg->Command, cmsg->Subcommand),
@@ -1354,7 +1354,7 @@ static void handle_ncci(_cmsg * cmsg) · 1 unmodified line
13541354 }
13551355
13561356
1357−static void handle_data(_cmsg * cmsg, struct sk_buff *skb)
1357+static void handle_data(_cmsg *cmsg, struct sk_buff *skb)
13581358 {
13591359 capidrv_contr *card = findcontrbynumber(cmsg->adr.adrController & 0x7f);
13601360 capidrv_ncci *nccip;
@@ -1390,12 +1390,12 @@ static void capidrv_recv_message(struct capi20_appl *ap, struct sk_buff *skb) · 29 unmodified lines
13901390
13911391 if (cdb) {
13921392 printk(KERN_DEBUG "%s: applid=%d %s\n", __func__,
1393− ap->applid, cdb->buf);
1393+ ap->applid, cdb->buf);
13941394 cdebbuf_free(cdb);
13951395 } else
13961396 printk(KERN_DEBUG "%s: applid=%d %s not traced\n",
1397− __func__, ap->applid,
1398− capi_cmd2str(s_cmsg.Command, s_cmsg.Subcommand));
1397+ __func__, ap->applid,
1398+ capi_cmd2str(s_cmsg.Command, s_cmsg.Subcommand));
13991399 }
14001400 if (s_cmsg.Command == CAPI_DATA_B3
14011401 && s_cmsg.Subcommand == CAPI_IND) {
@@ -1418,38 +1418,38 @@ static void capidrv_recv_message(struct capi20_appl *ap, struct sk_buff *skb) · 16 unmodified lines
14181418
14191419 /* ------------------------------------------------------------------- */
14201420
1421−#define PUTBYTE_TO_STATUS(card, byte) \
1422− do { \
1423− *(card)->q931_write++ = (byte); \
1424− if ((card)->q931_write > (card)->q931_end) \
1425− (card)->q931_write = (card)->q931_buf; \
1421+#define PUTBYTE_TO_STATUS(card, byte) \
1422+ do { \
1423+ *(card)->q931_write++ = (byte); \
1424+ if ((card)->q931_write > (card)->q931_end) \
1425+ (card)->q931_write = (card)->q931_buf; \
14261426 } while (0)
14271427
14281428 static void handle_dtrace_data(capidrv_contr *card,
1429− int send, int level2, u8 *data, u16 len)
1429+ int send, int level2, u8 *data, u16 len)
14301430 {
1431− u8 *p, *end;
1432− isdn_ctrl cmd;
1431+ u8 *p, *end;
1432+ isdn_ctrl cmd;
14331433
1434− if (!len) {
1434+ if (!len) {
14351435 printk(KERN_DEBUG "capidrv-%d: avmb1_q931_data: len == %d\n",
1436− card->contrnr, len);
1436+ card->contrnr, len);
14371437 return;
14381438 }
14391439
14401440 if (level2) {
14411441 PUTBYTE_TO_STATUS(card, 'D');
14421442 PUTBYTE_TO_STATUS(card, '2');
1443− PUTBYTE_TO_STATUS(card, send ? '>' : '<');
1444− PUTBYTE_TO_STATUS(card, ':');
1443+ PUTBYTE_TO_STATUS(card, send ? '>' : '<');
1444+ PUTBYTE_TO_STATUS(card, ':');
14451445 } else {
1446− PUTBYTE_TO_STATUS(card, 'D');
1447− PUTBYTE_TO_STATUS(card, '3');
1448− PUTBYTE_TO_STATUS(card, send ? '>' : '<');
1449− PUTBYTE_TO_STATUS(card, ':');
1450− }
1446+ PUTBYTE_TO_STATUS(card, 'D');
1447+ PUTBYTE_TO_STATUS(card, '3');
1448+ PUTBYTE_TO_STATUS(card, send ? '>' : '<');
1449+ PUTBYTE_TO_STATUS(card, ':');
1450+ }
14511451
1452− for (p = data, end = data+len; p < end; p++) {
1452+ for (p = data, end = data + len; p < end; p++) {
14531453 PUTBYTE_TO_STATUS(card, ' ');
14541454 PUTBYTE_TO_STATUS(card, hex_asc_hi(*p));
14551455 PUTBYTE_TO_STATUS(card, hex_asc_lo(*p));
@@ -1458,7 +1458,7 @@ static void handle_dtrace_data(capidrv_contr *card, · 2 unmodified lines
14581458
14591459 cmd.command = ISDN_STAT_STAVAIL;
14601460 cmd.driver = card->myid;
1461− cmd.arg = len*3+5;
1461+ cmd.arg = len * 3 + 5;
14621462 card->interface.statcallb(&cmd);
14631463 }
14641464
@@ -1466,17 +1466,17 @@ static void handle_dtrace_data(capidrv_contr *card, · 1 unmodified line
14661466
14671467 static _cmsg cmdcmsg;
14681468
1469−static int capidrv_ioctl(isdn_ctrl * c, capidrv_contr * card)
1469+static int capidrv_ioctl(isdn_ctrl *c, capidrv_contr *card)
14701470 {
14711471 switch (c->arg) {
14721472 case 1:
14731473 debugmode = (int)(*((unsigned int *)c->parm.num));
14741474 printk(KERN_DEBUG "capidrv-%d: debugmode=%d\n",
1475− card->contrnr, debugmode);
1475+ card->contrnr, debugmode);
14761476 return 0;
14771477 default:
14781478 printk(KERN_DEBUG "capidrv-%d: capidrv_ioctl(%ld) called ??\n",
1479− card->contrnr, c->arg);
1479+ card->contrnr, c->arg);
14801480 return -EINVAL;
14811481 }
14821482 return -EINVAL;
@@ -1487,9 +1487,9 @@ static int capidrv_ioctl(isdn_ctrl * c, capidrv_contr * card) · 4 unmodified lines
14871487 */
14881488
14891489 struct internal_bchannelinfo {
1490− unsigned short channelalloc;
1491− unsigned short operation;
1492− unsigned char cmask[31];
1490+ unsigned short channelalloc;
1491+ unsigned short operation;
1492+ unsigned char cmask[31];
14931493 };
14941494
14951495 static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep)
@@ -1540,10 +1540,10 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) · 44 unmodified lines
15401540 if (digit2 <= 0 || digit2 > 30) return -4;
15411541 if (*s == 0 || *s == ',' || *s == ' ') {
15421542 if (digit1 > digit2)
1543− for (i = digit2; i <= digit1 ; i++)
1543+ for (i = digit2; i <= digit1; i++)
15441544 bmask |= (1 << i);
1545− else
1546− for (i = digit1; i <= digit2 ; i++)
1545+ else
1546+ for (i = digit1; i <= digit2; i++)
15471547 bmask |= (1 << i);
15481548 digit1 = digit2 = 0;
15491549 if (*s) s++;
@@ -1556,131 +1556,131 @@ static int decodeFVteln(char *teln, unsigned long *bmaskp, int *activep) · 6 unmodified lines
15561556 return 0;
15571557 }
15581558
1559−static int FVteln2capi20(char *teln, u8 AdditionalInfo[1+2+2+31])
1559+static int FVteln2capi20(char *teln, u8 AdditionalInfo[1 + 2 + 2 + 31])
15601560 {
15611561 unsigned long bmask;
15621562 int active;
15631563 int rc, i;
1564−
1564+
15651565 rc = decodeFVteln(teln, &bmask, &active);
15661566 if (rc) return rc;
15671567 /* Length */
1568− AdditionalInfo[0] = 2+2+31;
1569− /* Channel: 3 => use channel allocation */
1570− AdditionalInfo[1] = 3; AdditionalInfo[2] = 0;
1568+ AdditionalInfo[0] = 2 + 2 + 31;
1569+ /* Channel: 3 => use channel allocation */
1570+ AdditionalInfo[1] = 3; AdditionalInfo[2] = 0;
15711571 /* Operation: 0 => DTE mode, 1 => DCE mode */
1572− if (active) {
1573− AdditionalInfo[3] = 0; AdditionalInfo[4] = 0;
1574− } else {
1575− AdditionalInfo[3] = 1; AdditionalInfo[4] = 0;
1572+ if (active) {
1573+ AdditionalInfo[3] = 0; AdditionalInfo[4] = 0;
1574+ } else {
1575+ AdditionalInfo[3] = 1; AdditionalInfo[4] = 0;
15761576 }
15771577 /* Channel mask array */
15781578 AdditionalInfo[5] = 0; /* no D-Channel */
1579− for (i=1; i <= 30; i++)
1580− AdditionalInfo[5+i] = (bmask & (1 << i)) ? 0xff : 0;
1579+ for (i = 1; i <= 30; i++)
1580+ AdditionalInfo[5 + i] = (bmask & (1 << i)) ? 0xff : 0;
15811581 return 0;
15821582 }
15831583
1584−static int capidrv_command(isdn_ctrl * c, capidrv_contr * card)
1584+static int capidrv_command(isdn_ctrl *c, capidrv_contr *card)
15851585 {
15861586 isdn_ctrl cmd;
15871587 struct capidrv_bchan *bchan;
15881588 struct capidrv_plci *plcip;
1589− u8 AdditionalInfo[1+2+2+31];
1590− int rc, isleasedline = 0;
1589+ u8 AdditionalInfo[1 + 2 + 2 + 31];
1590+ int rc, isleasedline = 0;
15911591
15921592 if (c->command == ISDN_CMD_IOCTL)
15931593 return capidrv_ioctl(c, card);
15941594
15951595 switch (c->command) {
15961596 case ISDN_CMD_DIAL:{
1597− u8 calling[ISDN_MSNLEN + 3];
1598− u8 called[ISDN_MSNLEN + 2];
1597+ u8 calling[ISDN_MSNLEN + 3];
1598+ u8 called[ISDN_MSNLEN + 2];
15991599
1600− if (debugmode)
1601− printk(KERN_DEBUG "capidrv-%d: ISDN_CMD_DIAL(ch=%ld,\"%s,%d,%d,%s\")\n",
1602− card->contrnr,
1603− c->arg,
1604− c->parm.setup.phone,
1605− c->parm.setup.si1,
1606− c->parm.setup.si2,
1607− c->parm.setup.eazmsn);
1608−
1609− bchan = &card->bchans[c->arg % card->nbchan];
1610−
1611− if (bchan->plcip) {
1612− printk(KERN_ERR "capidrv-%d: dail ch=%ld,\"%s,%d,%d,%s\" in use (plci=0x%x)\n",
1613− card->contrnr,
1614− c->arg,
1615− c->parm.setup.phone,
1616− c->parm.setup.si1,
1617− c->parm.setup.si2,
1618− c->parm.setup.eazmsn,
1619− bchan->plcip->plci);
1620− return 0;
1621− }
1622− bchan->si1 = c->parm.setup.si1;
1623− bchan->si2 = c->parm.setup.si2;
1624−
1625− strncpy(bchan->num, c->parm.setup.phone, sizeof(bchan->num));
1626− strncpy(bchan->mynum, c->parm.setup.eazmsn, sizeof(bchan->mynum));
1627− rc = FVteln2capi20(bchan->num, AdditionalInfo);
1628− isleasedline = (rc == 0);
1629− if (rc < 0)
1630− printk(KERN_ERR "capidrv-%d: WARNING: invalid leased linedefinition \"%s\"\n", card->contrnr, bchan->num);
1631−
1632− if (isleasedline) {
1633− calling[0] = 0;
1634− called[0] = 0;
1635− if (debugmode)
1636− printk(KERN_DEBUG "capidrv-%d: connecting leased line\n", card->contrnr);
1637− } else {
1638− calling[0] = strlen(bchan->mynum) + 2;
1639− calling[1] = 0;
1640− calling[2] = 0x80;
1641− strncpy(calling + 3, bchan->mynum, ISDN_MSNLEN);
1642− called[0] = strlen(bchan->num) + 1;
1643− called[1] = 0x80;
1644− strncpy(called + 2, bchan->num, ISDN_MSNLEN);
1645− }
1600+ if (debugmode)
1601+ printk(KERN_DEBUG "capidrv-%d: ISDN_CMD_DIAL(ch=%ld,\"%s,%d,%d,%s\")\n",
1602+ card->contrnr,
1603+ c->arg,
1604+ c->parm.setup.phone,
1605+ c->parm.setup.si1,
1606+ c->parm.setup.si2,
1607+ c->parm.setup.eazmsn);
16461608
1647− capi_fill_CONNECT_REQ(&cmdcmsg,
1648− global.ap.applid,
1649− card->msgid++,
1650− card->contrnr, /* adr */
1651− si2cip(bchan->si1, bchan->si2), /* cipvalue */
1652− called, /* CalledPartyNumber */
1653− calling, /* CallingPartyNumber */
1654− NULL, /* CalledPartySubaddress */
1655− NULL, /* CallingPartySubaddress */
1656− b1prot(bchan->l2, bchan->l3), /* B1protocol */
1657− b2prot(bchan->l2, bchan->l3), /* B2protocol */
1658− b3prot(bchan->l2, bchan->l3), /* B3protocol */
1659− b1config(bchan->l2, bchan->l3), /* B1configuration */
1660− NULL, /* B2configuration */
1661− NULL, /* B3configuration */
1662− NULL, /* BC */
1663− NULL, /* LLC */
1664− NULL, /* HLC */
1665− /* BChannelinformation */
1666− isleasedline ? AdditionalInfo : NULL,
1667− NULL, /* Keypadfacility */
1668− NULL, /* Useruserdata */
1669− NULL /* Facilitydataarray */
1670− );
1671− if ((plcip = new_plci(card, (c->arg % card->nbchan))) == NULL) {
1672− cmd.command = ISDN_STAT_DHUP;
1673− cmd.driver = card->myid;
1674− cmd.arg = (c->arg % card->nbchan);
1675− card->interface.statcallb(&cmd);
1676− return -1;
1677− }
1678− plcip->msgid = cmdcmsg.Messagenumber;
1679− plcip->leasedline = isleasedline;
1680− plci_change_state(card, plcip, EV_PLCI_CONNECT_REQ);
1681− send_message(card, &cmdcmsg);
1609+ bchan = &card->bchans[c->arg % card->nbchan];
1610+
1611+ if (bchan->plcip) {
1612+ printk(KERN_ERR "capidrv-%d: dail ch=%ld,\"%s,%d,%d,%s\" in use (plci=0x%x)\n",
1613+ card->contrnr,
1614+ c->arg,
1615+ c->parm.setup.phone,
1616+ c->parm.setup.si1,
1617+ c->parm.setup.si2,
1618+ c->parm.setup.eazmsn,
1619+ bchan->plcip->plci);
16821620 return 0;
16831621 }
1622+ bchan->si1 = c->parm.setup.si1;
1623+ bchan->si2 = c->parm.setup.si2;
1624+
1625+ strncpy(bchan->num, c->parm.setup.phone, sizeof(bchan->num));
1626+ strncpy(bchan->mynum, c->parm.setup.eazmsn, sizeof(bchan->mynum));
1627+ rc = FVteln2capi20(bchan->num, AdditionalInfo);
1628+ isleasedline = (rc == 0);
1629+ if (rc < 0)
1630+ printk(KERN_ERR "capidrv-%d: WARNING: invalid leased linedefinition \"%s\"\n", card->contrnr, bchan->num);
1631+
1632+ if (isleasedline) {
1633+ calling[0] = 0;
1634+ called[0] = 0;
1635+ if (debugmode)
1636+ printk(KERN_DEBUG "capidrv-%d: connecting leased line\n", card->contrnr);
1637+ } else {
1638+ calling[0] = strlen(bchan->mynum) + 2;
1639+ calling[1] = 0;
1640+ calling[2] = 0x80;
1641+ strncpy(calling + 3, bchan->mynum, ISDN_MSNLEN);
1642+ called[0] = strlen(bchan->num) + 1;
1643+ called[1] = 0x80;
1644+ strncpy(called + 2, bchan->num, ISDN_MSNLEN);
1645+ }
1646+
1647+ capi_fill_CONNECT_REQ(&cmdcmsg,
1648+ global.ap.applid,
1649+ card->msgid++,
1650+ card->contrnr, /* adr */
1651+ si2cip(bchan->si1, bchan->si2), /* cipvalue */
1652+ called, /* CalledPartyNumber */
1653+ calling, /* CallingPartyNumber */
1654+ NULL, /* CalledPartySubaddress */
1655+ NULL, /* CallingPartySubaddress */
1656+ b1prot(bchan->l2, bchan->l3), /* B1protocol */
1657+ b2prot(bchan->l2, bchan->l3), /* B2protocol */
1658+ b3prot(bchan->l2, bchan->l3), /* B3protocol */
1659+ b1config(bchan->l2, bchan->l3), /* B1configuration */
1660+ NULL, /* B2configuration */
1661+ NULL, /* B3configuration */
1662+ NULL, /* BC */
1663+ NULL, /* LLC */
1664+ NULL, /* HLC */
1665+ /* BChannelinformation */
1666+ isleasedline ? AdditionalInfo : NULL,
1667+ NULL, /* Keypadfacility */
1668+ NULL, /* Useruserdata */
1669+ NULL /* Facilitydataarray */
1670+ );
1671+ if ((plcip = new_plci(card, (c->arg % card->nbchan))) == NULL) {
1672+ cmd.command = ISDN_STAT_DHUP;
1673+ cmd.driver = card->myid;
1674+ cmd.arg = (c->arg % card->nbchan);
1675+ card->interface.statcallb(&cmd);
1676+ return -1;
1677+ }
1678+ plcip->msgid = cmdcmsg.Messagenumber;
1679+ plcip->leasedline = isleasedline;
1680+ plci_change_state(card, plcip, EV_PLCI_CONNECT_REQ);
1681+ send_message(card, &cmdcmsg);
1682+ return 0;
1683+ }
16841684
16851685 case ISDN_CMD_ACCEPTD:
16861686
@@ -1708,7 +1708,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) · 21 unmodified lines
17081708 NULL, /* Keypadfacility */
17091709 NULL, /* Useruserdata */
17101710 NULL /* Facilitydataarray */
1711− );
1711+ );
17121712 capi_cmsg2message(&cmdcmsg, cmdcmsg.buf);
17131713 plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP);
17141714 send_message(card, &cmdcmsg);
@@ -1742,7 +1742,7 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) · 27 unmodified lines
17421742 card->msgid++,
17431743 bchan->nccip->ncci,
17441744 NULL /* NCPI */
1745− );
1745+ );
17461746 ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ);
17471747 send_message(card, &cmdcmsg);
17481748 return 0;
@@ -1761,12 +1761,12 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) · 12 unmodified lines
17611761 capi_fill_DISCONNECT_REQ(&cmdcmsg,
17621762 global.ap.applid,
17631763 card->msgid++,
1764− bchan->plcip->plci,
1764+ bchan->plcip->plci,
17651765 NULL, /* BChannelinformation */
17661766 NULL, /* Keypadfacility */
17671767 NULL, /* Useruserdata */
17681768 NULL /* Facilitydataarray */
1769− );
1769+ );
17701770 plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ);
17711771 send_message(card, &cmdcmsg);
17721772 return 0;
@@ -1778,8 +1778,8 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) · 5 unmodified lines
17781778 }
17791779 }
17801780 printk(KERN_ERR "capidrv-%d: chan %ld disconnect request on free channel\n",
1781− card->contrnr,
1782− c->arg);
1781+ card->contrnr,
1782+ c->arg);
17831783 return -EINVAL;
17841784 /* ready */
17851785
@@ -1813,20 +1813,20 @@ static int capidrv_command(isdn_ctrl * c, capidrv_contr * card) · 27 unmodified lines
18131813 case ISDN_CMD_CLREAZ:
18141814 if (debugmode)
18151815 printk(KERN_DEBUG "capidrv-%d: clearing EAZ on chan %ld\n",
1816− card->contrnr, c->arg);
1816+ card->contrnr, c->arg);
18171817 bchan = &card->bchans[c->arg % card->nbchan];
18181818 bchan->msn[0] = 0;
18191819 return 0;
18201820
18211821 default:
18221822 printk(KERN_ERR "capidrv-%d: ISDN_CMD_%d, Huh?\n",
1823− card->contrnr, c->command);
1823+ card->contrnr, c->command);
18241824 return -EINVAL;
18251825 }
18261826 return 0;
18271827 }
18281828
1829−static int if_command(isdn_ctrl * c)
1829+static int if_command(isdn_ctrl *c)
18301830 {
18311831 capidrv_contr *card = findcontrbydriverid(c->driver);
18321832
@@ -1834,8 +1834,8 @@ static int if_command(isdn_ctrl * c) · 1 unmodified line
18341834 return capidrv_command(c, card);
18351835
18361836 printk(KERN_ERR
1837− "capidrv: if_command %d called with invalid driverId %d!\n",
1838− c->command, c->driver);
1837+ "capidrv: if_command %d called with invalid driverId %d!\n",
1838+ c->command, c->driver);
18391839 return -ENODEV;
18401840 }
18411841
@@ -1859,7 +1859,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) · 17 unmodified lines
18591859 }
18601860 if (debugmode > 4)
18611861 printk(KERN_DEBUG "capidrv-%d: sendbuf len=%d skb=%p doack=%d\n",
1862− card->contrnr, len, skb, doack);
1862+ card->contrnr, len, skb, doack);
18631863 bchan = &card->bchans[channel % card->nbchan];
18641864 nccip = bchan->nccip;
18651865 if (!nccip || nccip->state != ST_NCCI_ACTIVE) {
@@ -1891,10 +1891,10 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) · 25 unmodified lines
18911891 skb->len, /* DataLength */
18921892 datahandle, /* DataHandle */
18931893 0 /* Flags */
1894− );
1894+ );
18951895
18961896 if (capidrv_add_ack(nccip, datahandle, doack ? (int)skb->len : -1) < 0)
1897− return 0;
1897+ return 0;
18981898
18991899 capi_cmsg2message(&sendcmsg, sendcmsg.buf);
19001900 msglen = CAPIMSG_LEN(sendcmsg.buf);
@@ -1902,8 +1902,8 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) · 1 unmodified line
19021902 struct sk_buff *nskb = skb_realloc_headroom(skb, msglen);
19031903 if (!nskb) {
19041904 printk(KERN_ERR "capidrv-%d: if_sendbuf: no memory\n",
1905− card->contrnr);
1906− (void)capidrv_del_ack(nccip, datahandle);
1905+ card->contrnr);
1906+ (void)capidrv_del_ack(nccip, datahandle);
19071907 return 0;
19081908 }
19091909 printk(KERN_DEBUG "capidrv-%d: only %d bytes headroom, need %d\n",
@@ -1917,9 +1917,9 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) · 7 unmodified lines
19171917 }
19181918 if (debugmode > 3)
19191919 printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n",
1920− card->contrnr, errcode, capi_info2str(errcode));
1921− (void)capidrv_del_ack(nccip, datahandle);
1922− dev_kfree_skb(nskb);
1920+ card->contrnr, errcode, capi_info2str(errcode));
1921+ (void)capidrv_del_ack(nccip, datahandle);
1922+ dev_kfree_skb(nskb);
19231923 return errcode == CAPI_SENDQUEUEFULL ? 0 : -1;
19241924 } else {
19251925 memcpy(skb_push(skb, msglen), sendcmsg.buf, msglen);
@@ -1930,9 +1930,9 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) · 4 unmodified lines
19301930 }
19311931 if (debugmode > 3)
19321932 printk(KERN_DEBUG "capidrv-%d: sendbuf putmsg ret(%x) - %s\n",
1933− card->contrnr, errcode, capi_info2str(errcode));
1933+ card->contrnr, errcode, capi_info2str(errcode));
19341934 skb_pull(skb, msglen);
1935− (void)capidrv_del_ack(nccip, datahandle);
1935+ (void)capidrv_del_ack(nccip, datahandle);
19361936 return errcode == CAPI_SENDQUEUEFULL ? 0 : -1;
19371937 }
19381938 }
@@ -1949,11 +1949,11 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel) · 10 unmodified lines
19491949 return -ENODEV;
19501950 }
19511951
1952− for (p=buf, count=0; count < len; p++, count++) {
1952+ for (p = buf, count = 0; count < len; p++, count++) {
19531953 if (put_user(*card->q931_read++, p))
19541954 return -EFAULT;
1955− if (card->q931_read > card->q931_end)
1956− card->q931_read = card->q931_buf;
1955+ if (card->q931_read > card->q931_end)
1956+ card->q931_read = card->q931_buf;
19571957 }
19581958 return count;
19591959
@@ -1961,35 +1961,35 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel) · 1 unmodified line
19611961
19621962 static void enable_dchannel_trace(capidrv_contr *card)
19631963 {
1964− u8 manufacturer[CAPI_MANUFACTURER_LEN];
1965− capi_version version;
1964+ u8 manufacturer[CAPI_MANUFACTURER_LEN];
1965+ capi_version version;
19661966 u16 contr = card->contrnr;
19671967 u16 errcode;
19681968 u16 avmversion[3];
19691969
1970− errcode = capi20_get_manufacturer(contr, manufacturer);
1971− if (errcode != CAPI_NOERROR) {
1972− printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
1973− card->name, errcode);
1974− return;
1970+ errcode = capi20_get_manufacturer(contr, manufacturer);
1971+ if (errcode != CAPI_NOERROR) {
1972+ printk(KERN_ERR "%s: can't get manufacturer (0x%x)\n",
1973+ card->name, errcode);
1974+ return;
19751975 }
19761976 if (strstr(manufacturer, "AVM") == NULL) {
1977− printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
1978− card->name, manufacturer);
1979− return;
1977+ printk(KERN_ERR "%s: not from AVM, no d-channel trace possible (%s)\n",
1978+ card->name, manufacturer);
1979+ return;
19801980 }
1981− errcode = capi20_get_version(contr, &version);
1982− if (errcode != CAPI_NOERROR) {
1983− printk(KERN_ERR "%s: can't get version (0x%x)\n",
1984− card->name, errcode);
1985− return;
1981+ errcode = capi20_get_version(contr, &version);
1982+ if (errcode != CAPI_NOERROR) {
1983+ printk(KERN_ERR "%s: can't get version (0x%x)\n",
1984+ card->name, errcode);
1985+ return;
19861986 }
19871987 avmversion[0] = (version.majormanuversion >> 4) & 0x0f;
19881988 avmversion[1] = (version.majormanuversion << 4) & 0xf0;
19891989 avmversion[1] |= (version.minormanuversion >> 4) & 0x0f;
19901990 avmversion[2] |= version.minormanuversion & 0x0f;
19911991
1992− if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
1992+ if (avmversion[0] > 3 || (avmversion[0] == 3 && avmversion[1] > 5)) {
19931993 printk(KERN_INFO "%s: D2 trace enabled\n", card->name);
19941994 capi_fill_MANUFACTURER_REQ(&cmdcmsg, global.ap.applid,
19951995 card->msgid++,
@@ -2030,8 +2030,8 @@ static void listentimerfunc(unsigned long x) · 34 unmodified lines
20302030 capidrv_contr *card = (capidrv_contr *)x;
20312031 if (card->state != ST_LISTEN_NONE && card->state != ST_LISTEN_ACTIVE)
20322032 printk(KERN_ERR "%s: controller dead ??\n", card->name);
2033− send_listen(card);
2034− mod_timer(&card->listentimer, jiffies + 60*HZ);
2033+ send_listen(card);
2034+ mod_timer(&card->listentimer, jiffies + 60 * HZ);
20352035 }
20362036
20372037
@@ -2050,7 +2050,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) · 12 unmodified lines
20502050 }
20512051 if (!(card = kzalloc(sizeof(capidrv_contr), GFP_ATOMIC))) {
20522052 printk(KERN_WARNING
2053− "capidrv: (%s) Could not allocate contr-struct.\n", id);
2053+ "capidrv: (%s) Could not allocate contr-struct.\n", id);
20542054 return -1;
20552055 }
20562056 card->owner = THIS_MODULE;
@@ -2061,7 +2061,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) · 4 unmodified lines
20612061 card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC);
20622062 if (!card->bchans) {
20632063 printk(KERN_WARNING
2064− "capidrv: (%s) Could not allocate bchan-structs.\n", id);
2064+ "capidrv: (%s) Could not allocate bchan-structs.\n", id);
20652065 module_put(card->owner);
20662066 kfree(card);
20672067 return -1;
@@ -2073,17 +2073,17 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) · 5 unmodified lines
20732073 card->interface.writecmd = NULL;
20742074 card->interface.readstat = if_readstat;
20752075 card->interface.features = ISDN_FEATURE_L2_HDLC |
2076− ISDN_FEATURE_L2_TRANS |
2077− ISDN_FEATURE_L3_TRANS |
2078− ISDN_FEATURE_P_UNKNOWN |
2079− ISDN_FEATURE_L2_X75I |
2080− ISDN_FEATURE_L2_X75UI |
2081− ISDN_FEATURE_L2_X75BUI;
2082− if (profp->support1 & (1<<2))
2076+ ISDN_FEATURE_L2_TRANS |
2077+ ISDN_FEATURE_L3_TRANS |
2078+ ISDN_FEATURE_P_UNKNOWN |
2079+ ISDN_FEATURE_L2_X75I |
2080+ ISDN_FEATURE_L2_X75UI |
2081+ ISDN_FEATURE_L2_X75BUI;
2082+ if (profp->support1 & (1 << 2))
20832083 card->interface.features |= ISDN_FEATURE_L2_V11096 |
2084− ISDN_FEATURE_L2_V11019 |
2085− ISDN_FEATURE_L2_V11038;
2086− if (profp->support1 & (1<<8))
2084+ ISDN_FEATURE_L2_V11019 |
2085+ ISDN_FEATURE_L2_V11038;
2086+ if (profp->support1 & (1 << 8))
20872087 card->interface.features |= ISDN_FEATURE_L2_MODEM;
20882088 card->interface.hl_hdrlen = 22; /* len of DATA_B3_REQ */
20892089 strncpy(card->interface.id, id, sizeof(card->interface.id) - 1);
@@ -2122,10 +2122,10 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) · 32 unmodified lines
21222122 card->listentimer.data = (unsigned long)card;
21232123 card->listentimer.function = listentimerfunc;
21242124 send_listen(card);
2125− mod_timer(&card->listentimer, jiffies + 60*HZ);
2125+ mod_timer(&card->listentimer, jiffies + 60 * HZ);
21262126
21272127 printk(KERN_INFO "%s: now up (%d B channels)\n",
2128− card->name, card->nbchan);
2128+ card->name, card->nbchan);
21292129
21302130 enable_dchannel_trace(card);
21312131
@@ -2158,7 +2158,7 @@ static int capidrv_delcontr(u16 contr) · 26 unmodified lines
21582158
21592159 if (debugmode)
21602160 printk(KERN_DEBUG "capidrv-%d: id=%d unloading\n",
2161− card->contrnr, card->myid);
2161+ card->contrnr, card->myid);
21622162
21632163 cmd.command = ISDN_STAT_STOP;
21642164 cmd.driver = card->myid;
@@ -2168,17 +2168,17 @@ static int capidrv_delcontr(u16 contr) · 3 unmodified lines
21682168
21692169 cmd.command = ISDN_STAT_DISCH;
21702170 cmd.driver = card->myid;
2171− cmd.arg = card->nbchan-1;
2172− cmd.parm.num[0] = 0;
2171+ cmd.arg = card->nbchan - 1;
2172+ cmd.parm.num[0] = 0;
21732173 if (debugmode)
21742174 printk(KERN_DEBUG "capidrv-%d: id=%d disable chan=%ld\n",
2175− card->contrnr, card->myid, cmd.arg);
2175+ card->contrnr, card->myid, cmd.arg);
21762176 card->interface.statcallb(&cmd);
21772177
2178− if (card->bchans[card->nbchan-1].nccip)
2179− free_ncci(card, card->bchans[card->nbchan-1].nccip);
2180− if (card->bchans[card->nbchan-1].plcip)
2181− free_plci(card, card->bchans[card->nbchan-1].plcip);
2178+ if (card->bchans[card->nbchan - 1].nccip)
2179+ free_ncci(card, card->bchans[card->nbchan - 1].nccip);
2180+ if (card->bchans[card->nbchan - 1].plcip)
2181+ free_plci(card, card->bchans[card->nbchan - 1].plcip);
21822182 if (card->plci_list)
21832183 printk(KERN_ERR "capidrv: bug in free_plci()\n");
21842184 card->nbchan--;
@@ -2188,7 +2188,7 @@ static int capidrv_delcontr(u16 contr) · 3 unmodified lines
21882188
21892189 if (debugmode)
21902190 printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n",
2191− card->contrnr, card->myid);
2191+ card->contrnr, card->myid);
21922192
21932193 cmd.command = ISDN_STAT_UNLOAD;
21942194 cmd.driver = card->myid;
@@ -2196,7 +2196,7 @@ static int capidrv_delcontr(u16 contr) · 1 unmodified line
21962196
21972197 if (debugmode)
21982198 printk(KERN_DEBUG "capidrv-%d: id=%d remove contr from list\n",
2199− card->contrnr, card->myid);
2199+ card->contrnr, card->myid);
22002200
22012201 spin_lock_irqsave(&global_lock, flags);
22022202 for (pp = &global.contr_list; *pp; pp = &(*pp)->next) {
@@ -2243,10 +2243,10 @@ lower_callback(struct notifier_block *nb, unsigned long val, void *v) · 40 unmodified lines
22432243 static int capidrv_proc_show(struct seq_file *m, void *v)
22442244 {
22452245 seq_printf(m, "%lu %lu %lu %lu\n",
2246− global.ap.nrecvctlpkt,
2247− global.ap.nrecvdatapkt,
2248− global.ap.nsentctlpkt,
2249− global.ap.nsentdatapkt);
2246+ global.ap.nrecvctlpkt,
2247+ global.ap.nrecvdatapkt,
2248+ global.ap.nsentctlpkt,
2249+ global.ap.nsentdatapkt);
22502250 return 0;
22512251 }
22522252
drivers/isdn/capi/capidrv.h+21−21
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 * per plci state machine
3535 */
3636 #define ST_PLCI_NONE 0 /* P-0 */
37−#define ST_PLCI_OUTGOING 1 /* P-0.1 */
37+#define ST_PLCI_OUTGOING 1 /* P-0.1 */
3838 #define ST_PLCI_ALLOCATED 2 /* P-1 */
3939 #define ST_PLCI_ACTIVE 3 /* P-ACT */
4040 #define ST_PLCI_INCOMING 4 /* P-2 */
@@ -47,20 +47,20 @@ · 6 unmodified lines
4747 #define ST_PLCI_HELD 11 /* P-HELD */
4848
4949 #define EV_PLCI_CONNECT_REQ 1 /* P-0 -> P-0.1
50− */
50+ */
5151 #define EV_PLCI_CONNECT_CONF_ERROR 2 /* P-0.1 -> P-0
52− */
52+ */
5353 #define EV_PLCI_CONNECT_CONF_OK 3 /* P-0.1 -> P-1
54− */
54+ */
5555 #define EV_PLCI_FACILITY_IND_UP 4 /* P-0 -> P-1
56− */
56+ */
5757 #define EV_PLCI_CONNECT_IND 5 /* P-0 -> P-2
58− */
58+ */
5959 #define EV_PLCI_CONNECT_ACTIVE_IND 6 /* P-1 -> P-ACT
60− */
60+ */
6161 #define EV_PLCI_CONNECT_REJECT 7 /* P-2 -> P-5
6262 P-3 -> P-5
63− */
63+ */
6464 #define EV_PLCI_DISCONNECT_REQ 8 /* P-1 -> P-5
6565 P-2 -> P-5
6666 P-3 -> P-5
@@ -68,7 +68,7 @@ · 1 unmodified line
6868 P-ACT -> P-5
6969 P-Res -> P-5 (*)
7070 P-HELD -> P-5 (*)
71− */
71+ */
7272 #define EV_PLCI_DISCONNECT_IND 9 /* P-1 -> P-6
7373 P-2 -> P-6
7474 P-3 -> P-6
@@ -77,35 +77,35 @@ · 2 unmodified lines
7777 P-ACT -> P-6
7878 P-Res -> P-6 (*)
7979 P-HELD -> P-6 (*)
80− */
80+ */
8181 #define EV_PLCI_FACILITY_IND_DOWN 10 /* P-0.1 -> P-5
8282 P-1 -> P-5
8383 P-ACT -> P-5
8484 P-2 -> P-5
8585 P-3 -> P-5
8686 P-4 -> P-5
87− */
87+ */
8888 #define EV_PLCI_DISCONNECT_RESP 11 /* P-6 -> P-0
89− */
89+ */
9090 #define EV_PLCI_CONNECT_RESP 12 /* P-6 -> P-0
91− */
91+ */
9292
9393 #define EV_PLCI_RESUME_REQ 13 /* P-0 -> P-0.Res
94− */
94+ */
9595 #define EV_PLCI_RESUME_CONF_OK 14 /* P-0.Res -> P-Res
96− */
96+ */
9797 #define EV_PLCI_RESUME_CONF_ERROR 15 /* P-0.Res -> P-0
98− */
98+ */
9999 #define EV_PLCI_RESUME_IND 16 /* P-Res -> P-ACT
100− */
100+ */
101101 #define EV_PLCI_HOLD_IND 17 /* P-ACT -> P-HELD
102− */
102+ */
103103 #define EV_PLCI_RETRIEVE_IND 18 /* P-HELD -> P-ACT
104− */
104+ */
105105 #define EV_PLCI_SUSPEND_IND 19 /* P-ACT -> P-5
106− */
106+ */
107107 #define EV_PLCI_CD_IND 20 /* P-2 -> P-5
108− */
108+ */
109109
110110 /*
111111 * per ncci state machine
drivers/isdn/capi/capilib.c+8−8
@@ -4,9 +4,9 @@ · 3 unmodified lines
44 #include <linux/module.h>
55 #include <linux/isdn/capilli.h>
66
7−#define DBG(format, arg...) do { \
8−printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
9−} while (0)
7+#define DBG(format, arg...) do { \
8+ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
9+ } while (0)
1010
1111 struct capilib_msgidqueue {
1212 struct capilib_msgidqueue *next;
@@ -28,7 +28,7 @@ struct capilib_ncci { · 15 unmodified lines
2828 // ---------------------------------------------------------------------------
2929 // NCCI Handling
3030
31−static inline void mq_init(struct capilib_ncci * np)
31+static inline void mq_init(struct capilib_ncci *np)
3232 {
3333 u_int i;
3434 np->msgidqueue = NULL;
@@ -42,7 +42,7 @@ static inline void mq_init(struct capilib_ncci * np) · 7 unmodified lines
4242 }
4343 }
4444
45−static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid)
45+static inline int mq_enqueue(struct capilib_ncci *np, u16 msgid)
4646 {
4747 struct capilib_msgidqueue *mq;
4848 if ((mq = np->msgidfree) == NULL)
@@ -59,7 +59,7 @@ static inline int mq_enqueue(struct capilib_ncci * np, u16 msgid) · 10 unmodified lines
5959 return 1;
6060 }
6161
62−static inline int mq_dequeue(struct capilib_ncci * np, u16 msgid)
62+static inline int mq_dequeue(struct capilib_ncci *np, u16 msgid)
6363 {
6464 struct capilib_msgidqueue **pp;
6565 for (pp = &np->msgidqueue; *pp; pp = &(*pp)->next) {
@@ -165,7 +165,7 @@ u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid) · 99 unmodified lines
165165 continue;
166166 if (np->ncci != ncci)
167167 continue;
168−
168+
169169 if (mq_enqueue(np, msgid) == 0)
170170 return CAPI_SENDQUEUEFULL;
171171
@@ -188,7 +188,7 @@ void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgi · 16 unmodified lines
188188 continue;
189189 if (np->ncci != ncci)
190190 continue;
191−
191+
192192 if (mq_dequeue(np, msgid) == 0) {
193193 printk(KERN_ERR "kcapi: msgid %hu ncci 0x%x not on queue\n",
194194 msgid, ncci);
drivers/isdn/capi/capiutil.c+314−314
@@ -25,149 +25,149 @@ · 24 unmodified lines
2525 #ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
2626 char *capi_info2str(u16 reason)
2727 {
28− return "..";
28+ return "..";
2929 }
3030 #else
3131 char *capi_info2str(u16 reason)
3232 {
33− switch (reason) {
33+ switch (reason) {
3434
3535 /*-- informative values (corresponding message was processed) -----*/
3636 case 0x0001:
37− return "NCPI not supported by current protocol, NCPI ignored";
37+ return "NCPI not supported by current protocol, NCPI ignored";
3838 case 0x0002:
39− return "Flags not supported by current protocol, flags ignored";
39+ return "Flags not supported by current protocol, flags ignored";
4040 case 0x0003:
41− return "Alert already sent by another application";
41+ return "Alert already sent by another application";
4242
4343 /*-- error information concerning CAPI_REGISTER -----*/
4444 case 0x1001:
45− return "Too many applications";
45+ return "Too many applications";
4646 case 0x1002:
47− return "Logical block size too small, must be at least 128 Bytes";
47+ return "Logical block size too small, must be at least 128 Bytes";
4848 case 0x1003:
49− return "Buffer exceeds 64 kByte";
49+ return "Buffer exceeds 64 kByte";
5050 case 0x1004:
51− return "Message buffer size too small, must be at least 1024 Bytes";
51+ return "Message buffer size too small, must be at least 1024 Bytes";
5252 case 0x1005:
53− return "Max. number of logical connections not supported";
53+ return "Max. number of logical connections not supported";
5454 case 0x1006:
55− return "Reserved";
55+ return "Reserved";
5656 case 0x1007:
57− return "The message could not be accepted because of an internal busy condition";
57+ return "The message could not be accepted because of an internal busy condition";
5858 case 0x1008:
59− return "OS resource error (no memory ?)";
59+ return "OS resource error (no memory ?)";
6060 case 0x1009:
61− return "CAPI not installed";
61+ return "CAPI not installed";
6262 case 0x100A:
63− return "Controller does not support external equipment";
63+ return "Controller does not support external equipment";
6464 case 0x100B:
65− return "Controller does only support external equipment";
65+ return "Controller does only support external equipment";
6666
6767 /*-- error information concerning message exchange functions -----*/
6868 case 0x1101:
69− return "Illegal application number";
69+ return "Illegal application number";
7070 case 0x1102:
71− return "Illegal command or subcommand or message length less than 12 bytes";
71+ return "Illegal command or subcommand or message length less than 12 bytes";
7272 case 0x1103:
73− return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
73+ return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
7474 case 0x1104:
75− return "Queue is empty";
75+ return "Queue is empty";
7676 case 0x1105:
77− return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
77+ return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
7878 case 0x1106:
79− return "Unknown notification parameter";
79+ return "Unknown notification parameter";
8080 case 0x1107:
81− return "The Message could not be accepted because of an internal busy condition";
81+ return "The Message could not be accepted because of an internal busy condition";
8282 case 0x1108:
83− return "OS Resource error (no memory ?)";
83+ return "OS Resource error (no memory ?)";
8484 case 0x1109:
85− return "CAPI not installed";
85+ return "CAPI not installed";
8686 case 0x110A:
87− return "Controller does not support external equipment";
87+ return "Controller does not support external equipment";
8888 case 0x110B:
89− return "Controller does only support external equipment";
89+ return "Controller does only support external equipment";
9090
9191 /*-- error information concerning resource / coding problems -----*/
9292 case 0x2001:
93− return "Message not supported in current state";
93+ return "Message not supported in current state";
9494 case 0x2002:
95− return "Illegal Controller / PLCI / NCCI";
95+ return "Illegal Controller / PLCI / NCCI";
9696 case 0x2003:
97− return "Out of PLCI";
97+ return "Out of PLCI";
9898 case 0x2004:
99− return "Out of NCCI";
99+ return "Out of NCCI";
100100 case 0x2005:
101− return "Out of LISTEN";
101+ return "Out of LISTEN";
102102 case 0x2006:
103− return "Out of FAX resources (protocol T.30)";
103+ return "Out of FAX resources (protocol T.30)";
104104 case 0x2007:
105− return "Illegal message parameter coding";
105+ return "Illegal message parameter coding";
106106
107107 /*-- error information concerning requested services -----*/
108108 case 0x3001:
109− return "B1 protocol not supported";
110− case 0x3002:
111− return "B2 protocol not supported";
112− case 0x3003:
113− return "B3 protocol not supported";
114− case 0x3004:
115− return "B1 protocol parameter not supported";
116− case 0x3005:
117− return "B2 protocol parameter not supported";
118− case 0x3006:
119− return "B3 protocol parameter not supported";
120− case 0x3007:
121− return "B protocol combination not supported";
122− case 0x3008:
123− return "NCPI not supported";
124− case 0x3009:
125− return "CIP Value unknown";
126− case 0x300A:
127− return "Flags not supported (reserved bits)";
128− case 0x300B:
129− return "Facility not supported";
130− case 0x300C:
131− return "Data length not supported by current protocol";
132− case 0x300D:
133− return "Reset procedure not supported by current protocol";
109+ return "B1 protocol not supported";
110+ case 0x3002:
111+ return "B2 protocol not supported";
112+ case 0x3003:
113+ return "B3 protocol not supported";
114+ case 0x3004:
115+ return "B1 protocol parameter not supported";
116+ case 0x3005:
117+ return "B2 protocol parameter not supported";
118+ case 0x3006:
119+ return "B3 protocol parameter not supported";
120+ case 0x3007:
121+ return "B protocol combination not supported";
122+ case 0x3008:
123+ return "NCPI not supported";
124+ case 0x3009:
125+ return "CIP Value unknown";
126+ case 0x300A:
127+ return "Flags not supported (reserved bits)";
128+ case 0x300B:
129+ return "Facility not supported";
130+ case 0x300C:
131+ return "Data length not supported by current protocol";
132+ case 0x300D:
133+ return "Reset procedure not supported by current protocol";
134134
135135 /*-- informations about the clearing of a physical connection -----*/
136− case 0x3301:
137− return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
138− case 0x3302:
139− return "Protocol error layer 2";
140− case 0x3303:
141− return "Protocol error layer 3";
142− case 0x3304:
143− return "Another application got that call";
136+ case 0x3301:
137+ return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
138+ case 0x3302:
139+ return "Protocol error layer 2";
140+ case 0x3303:
141+ return "Protocol error layer 3";
142+ case 0x3304:
143+ return "Another application got that call";
144144 /*-- T.30 specific reasons -----*/
145− case 0x3311:
146− return "Connecting not successful (remote station is no FAX G3 machine)";
147− case 0x3312:
148− return "Connecting not successful (training error)";
149− case 0x3313:
150− return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
151− case 0x3314:
152− return "Disconnected during transfer (remote abort)";
153− case 0x3315:
154− return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
155− case 0x3316:
156− return "Disconnected during transfer (local tx data underrun)";
157− case 0x3317:
158− return "Disconnected during transfer (local rx data overflow)";
159− case 0x3318:
160− return "Disconnected during transfer (local abort)";
161− case 0x3319:
162− return "Illegal parameter coding (e.g. SFF coding error)";
145+ case 0x3311:
146+ return "Connecting not successful (remote station is no FAX G3 machine)";
147+ case 0x3312:
148+ return "Connecting not successful (training error)";
149+ case 0x3313:
150+ return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
151+ case 0x3314:
152+ return "Disconnected during transfer (remote abort)";
153+ case 0x3315:
154+ return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
155+ case 0x3316:
156+ return "Disconnected during transfer (local tx data underrun)";
157+ case 0x3317:
158+ return "Disconnected during transfer (local rx data overflow)";
159+ case 0x3318:
160+ return "Disconnected during transfer (local abort)";
161+ case 0x3319:
162+ return "Illegal parameter coding (e.g. SFF coding error)";
163163
164164 /*-- disconnect causes from the network according to ETS 300 102-1/Q.931 -----*/
165165 case 0x3481: return "Unallocated (unassigned) number";
166166 case 0x3482: return "No route to specified transit network";
167167 case 0x3483: return "No route to destination";
168168 case 0x3486: return "Channel unacceptable";
169− case 0x3487:
170− return "Call awarded and being delivered in an established channel";
169+ case 0x3487:
170+ return "Call awarded and being delivered in an established channel";
171171 case 0x3490: return "Normal call clearing";
172172 case 0x3491: return "User busy";
173173 case 0x3492: return "No user responding";
@@ -217,7 +217,7 @@ char *capi_info2str(u16 reason) · 43 unmodified lines
217217 case 0x34FF: return "Interworking, unspecified";
218218
219219 default: return "No additional information";
220− }
220+ }
221221 }
222222 #endif
223223
@@ -235,169 +235,169 @@ typedef struct { · 11 unmodified lines
235235
236236 static _cdef cdef[] =
237237 {
238− /*00 */
239− {_CEND},
240− /*01 */
241− {_CEND},
242− /*02 */
243− {_CEND},
244− /*03 */
245− {_CDWORD, offsetof(_cmsg, adr.adrController)},
246− /*04 */
247− {_CMSTRUCT, offsetof(_cmsg, AdditionalInfo)},
248− /*05 */
249− {_CSTRUCT, offsetof(_cmsg, B1configuration)},
250− /*06 */
251− {_CWORD, offsetof(_cmsg, B1protocol)},
252− /*07 */
253− {_CSTRUCT, offsetof(_cmsg, B2configuration)},
254− /*08 */
255− {_CWORD, offsetof(_cmsg, B2protocol)},
256− /*09 */
257− {_CSTRUCT, offsetof(_cmsg, B3configuration)},
258− /*0a */
259− {_CWORD, offsetof(_cmsg, B3protocol)},
260− /*0b */
261− {_CSTRUCT, offsetof(_cmsg, BC)},
262− /*0c */
263− {_CSTRUCT, offsetof(_cmsg, BChannelinformation)},
264− /*0d */
265− {_CMSTRUCT, offsetof(_cmsg, BProtocol)},
266− /*0e */
267− {_CSTRUCT, offsetof(_cmsg, CalledPartyNumber)},
268− /*0f */
269− {_CSTRUCT, offsetof(_cmsg, CalledPartySubaddress)},
270− /*10 */
271− {_CSTRUCT, offsetof(_cmsg, CallingPartyNumber)},
272− /*11 */
273− {_CSTRUCT, offsetof(_cmsg, CallingPartySubaddress)},
274− /*12 */
275− {_CDWORD, offsetof(_cmsg, CIPmask)},
276− /*13 */
277− {_CDWORD, offsetof(_cmsg, CIPmask2)},
278− /*14 */
279− {_CWORD, offsetof(_cmsg, CIPValue)},
280− /*15 */
281− {_CDWORD, offsetof(_cmsg, Class)},
282− /*16 */
283− {_CSTRUCT, offsetof(_cmsg, ConnectedNumber)},
284− /*17 */
285− {_CSTRUCT, offsetof(_cmsg, ConnectedSubaddress)},
286− /*18 */
287− {_CDWORD, offsetof(_cmsg, Data)},
288− /*19 */
289− {_CWORD, offsetof(_cmsg, DataHandle)},
290− /*1a */
291− {_CWORD, offsetof(_cmsg, DataLength)},
292− /*1b */
293− {_CSTRUCT, offsetof(_cmsg, FacilityConfirmationParameter)},
294− /*1c */
295− {_CSTRUCT, offsetof(_cmsg, Facilitydataarray)},
296− /*1d */
297− {_CSTRUCT, offsetof(_cmsg, FacilityIndicationParameter)},
298− /*1e */
299− {_CSTRUCT, offsetof(_cmsg, FacilityRequestParameter)},
300− /*1f */
301− {_CWORD, offsetof(_cmsg, FacilitySelector)},
302− /*20 */
303− {_CWORD, offsetof(_cmsg, Flags)},
304− /*21 */
305− {_CDWORD, offsetof(_cmsg, Function)},
306− /*22 */
307− {_CSTRUCT, offsetof(_cmsg, HLC)},
308− /*23 */
309− {_CWORD, offsetof(_cmsg, Info)},
310− /*24 */
311− {_CSTRUCT, offsetof(_cmsg, InfoElement)},
312− /*25 */
313− {_CDWORD, offsetof(_cmsg, InfoMask)},
314− /*26 */
315− {_CWORD, offsetof(_cmsg, InfoNumber)},
316− /*27 */
317− {_CSTRUCT, offsetof(_cmsg, Keypadfacility)},
318− /*28 */
319− {_CSTRUCT, offsetof(_cmsg, LLC)},
320− /*29 */
321− {_CSTRUCT, offsetof(_cmsg, ManuData)},
322− /*2a */
323− {_CDWORD, offsetof(_cmsg, ManuID)},
324− /*2b */
325− {_CSTRUCT, offsetof(_cmsg, NCPI)},
326− /*2c */
327− {_CWORD, offsetof(_cmsg, Reason)},
328− /*2d */
329− {_CWORD, offsetof(_cmsg, Reason_B3)},
330− /*2e */
331− {_CWORD, offsetof(_cmsg, Reject)},
332− /*2f */
333− {_CSTRUCT, offsetof(_cmsg, Useruserdata)}
238+ /*00 */
239+ {_CEND},
240+ /*01 */
241+ {_CEND},
242+ /*02 */
243+ {_CEND},
244+ /*03 */
245+ {_CDWORD, offsetof(_cmsg, adr.adrController)},
246+ /*04 */
247+ {_CMSTRUCT, offsetof(_cmsg, AdditionalInfo)},
248+ /*05 */
249+ {_CSTRUCT, offsetof(_cmsg, B1configuration)},
250+ /*06 */
251+ {_CWORD, offsetof(_cmsg, B1protocol)},
252+ /*07 */
253+ {_CSTRUCT, offsetof(_cmsg, B2configuration)},
254+ /*08 */
255+ {_CWORD, offsetof(_cmsg, B2protocol)},
256+ /*09 */
257+ {_CSTRUCT, offsetof(_cmsg, B3configuration)},
258+ /*0a */
259+ {_CWORD, offsetof(_cmsg, B3protocol)},
260+ /*0b */
261+ {_CSTRUCT, offsetof(_cmsg, BC)},
262+ /*0c */
263+ {_CSTRUCT, offsetof(_cmsg, BChannelinformation)},
264+ /*0d */
265+ {_CMSTRUCT, offsetof(_cmsg, BProtocol)},
266+ /*0e */
267+ {_CSTRUCT, offsetof(_cmsg, CalledPartyNumber)},
268+ /*0f */
269+ {_CSTRUCT, offsetof(_cmsg, CalledPartySubaddress)},
270+ /*10 */
271+ {_CSTRUCT, offsetof(_cmsg, CallingPartyNumber)},
272+ /*11 */
273+ {_CSTRUCT, offsetof(_cmsg, CallingPartySubaddress)},
274+ /*12 */
275+ {_CDWORD, offsetof(_cmsg, CIPmask)},
276+ /*13 */
277+ {_CDWORD, offsetof(_cmsg, CIPmask2)},
278+ /*14 */
279+ {_CWORD, offsetof(_cmsg, CIPValue)},
280+ /*15 */
281+ {_CDWORD, offsetof(_cmsg, Class)},
282+ /*16 */
283+ {_CSTRUCT, offsetof(_cmsg, ConnectedNumber)},
284+ /*17 */
285+ {_CSTRUCT, offsetof(_cmsg, ConnectedSubaddress)},
286+ /*18 */
287+ {_CDWORD, offsetof(_cmsg, Data)},
288+ /*19 */
289+ {_CWORD, offsetof(_cmsg, DataHandle)},
290+ /*1a */
291+ {_CWORD, offsetof(_cmsg, DataLength)},
292+ /*1b */
293+ {_CSTRUCT, offsetof(_cmsg, FacilityConfirmationParameter)},
294+ /*1c */
295+ {_CSTRUCT, offsetof(_cmsg, Facilitydataarray)},
296+ /*1d */
297+ {_CSTRUCT, offsetof(_cmsg, FacilityIndicationParameter)},
298+ /*1e */
299+ {_CSTRUCT, offsetof(_cmsg, FacilityRequestParameter)},
300+ /*1f */
301+ {_CWORD, offsetof(_cmsg, FacilitySelector)},
302+ /*20 */
303+ {_CWORD, offsetof(_cmsg, Flags)},
304+ /*21 */
305+ {_CDWORD, offsetof(_cmsg, Function)},
306+ /*22 */
307+ {_CSTRUCT, offsetof(_cmsg, HLC)},
308+ /*23 */
309+ {_CWORD, offsetof(_cmsg, Info)},
310+ /*24 */
311+ {_CSTRUCT, offsetof(_cmsg, InfoElement)},
312+ /*25 */
313+ {_CDWORD, offsetof(_cmsg, InfoMask)},
314+ /*26 */
315+ {_CWORD, offsetof(_cmsg, InfoNumber)},
316+ /*27 */
317+ {_CSTRUCT, offsetof(_cmsg, Keypadfacility)},
318+ /*28 */
319+ {_CSTRUCT, offsetof(_cmsg, LLC)},
320+ /*29 */
321+ {_CSTRUCT, offsetof(_cmsg, ManuData)},
322+ /*2a */
323+ {_CDWORD, offsetof(_cmsg, ManuID)},
324+ /*2b */
325+ {_CSTRUCT, offsetof(_cmsg, NCPI)},
326+ /*2c */
327+ {_CWORD, offsetof(_cmsg, Reason)},
328+ /*2d */
329+ {_CWORD, offsetof(_cmsg, Reason_B3)},
330+ /*2e */
331+ {_CWORD, offsetof(_cmsg, Reject)},
332+ /*2f */
333+ {_CSTRUCT, offsetof(_cmsg, Useruserdata)}
334334 };
335335
336336 static unsigned char *cpars[] =
337337 {
338− /* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
339− /* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
340− /* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
341− /* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
342− /* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
343− /* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
344− /* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
345− /* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
346− /* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
347− /* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
348− /* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
349− /* ALERT_CONF */ [0x13] = "\x03\x23\x01",
350− /* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
351− /* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
352− /* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
353− /* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
354− /* INFO_CONF */ [0x1a] = "\x03\x23\x01",
355− /* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
356− /* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
357− /* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
358− /* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
359− /* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
360− /* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
361− /* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
362− /* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
363− /* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
364− /* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
365− /* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
366− /* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
367− /* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
368− /* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
369− /* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
370− /* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
371− /* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
372− /* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
373− /* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
374− /* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
375− /* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
376− /* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
377− /* INFO_RESP */ [0x3e] = "\x03\x01",
378− /* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
379− /* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
380− /* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
381− /* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
382− /* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
383− /* RESET_B3_RESP */ [0x46] = "\x03\x01",
384− /* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
385− /* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
338+ /* ALERT_REQ */ [0x01] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
339+ /* CONNECT_REQ */ [0x02] = "\x03\x14\x0e\x10\x0f\x11\x0d\x06\x08\x0a\x05\x07\x09\x01\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
340+ /* DISCONNECT_REQ */ [0x04] = "\x03\x04\x0c\x27\x2f\x1c\x01\x01",
341+ /* LISTEN_REQ */ [0x05] = "\x03\x25\x12\x13\x10\x11\x01",
342+ /* INFO_REQ */ [0x08] = "\x03\x0e\x04\x0c\x27\x2f\x1c\x01\x01",
343+ /* FACILITY_REQ */ [0x09] = "\x03\x1f\x1e\x01",
344+ /* SELECT_B_PROTOCOL_REQ */ [0x0a] = "\x03\x0d\x06\x08\x0a\x05\x07\x09\x01\x01",
345+ /* CONNECT_B3_REQ */ [0x0b] = "\x03\x2b\x01",
346+ /* DISCONNECT_B3_REQ */ [0x0d] = "\x03\x2b\x01",
347+ /* DATA_B3_REQ */ [0x0f] = "\x03\x18\x1a\x19\x20\x01",
348+ /* RESET_B3_REQ */ [0x10] = "\x03\x2b\x01",
349+ /* ALERT_CONF */ [0x13] = "\x03\x23\x01",
350+ /* CONNECT_CONF */ [0x14] = "\x03\x23\x01",
351+ /* DISCONNECT_CONF */ [0x16] = "\x03\x23\x01",
352+ /* LISTEN_CONF */ [0x17] = "\x03\x23\x01",
353+ /* MANUFACTURER_REQ */ [0x18] = "\x03\x2a\x15\x21\x29\x01",
354+ /* INFO_CONF */ [0x1a] = "\x03\x23\x01",
355+ /* FACILITY_CONF */ [0x1b] = "\x03\x23\x1f\x1b\x01",
356+ /* SELECT_B_PROTOCOL_CONF */ [0x1c] = "\x03\x23\x01",
357+ /* CONNECT_B3_CONF */ [0x1d] = "\x03\x23\x01",
358+ /* DISCONNECT_B3_CONF */ [0x1f] = "\x03\x23\x01",
359+ /* DATA_B3_CONF */ [0x21] = "\x03\x19\x23\x01",
360+ /* RESET_B3_CONF */ [0x22] = "\x03\x23\x01",
361+ /* CONNECT_IND */ [0x26] = "\x03\x14\x0e\x10\x0f\x11\x0b\x28\x22\x04\x0c\x27\x2f\x1c\x01\x01",
362+ /* CONNECT_ACTIVE_IND */ [0x27] = "\x03\x16\x17\x28\x01",
363+ /* DISCONNECT_IND */ [0x28] = "\x03\x2c\x01",
364+ /* MANUFACTURER_CONF */ [0x2a] = "\x03\x2a\x15\x21\x29\x01",
365+ /* INFO_IND */ [0x2c] = "\x03\x26\x24\x01",
366+ /* FACILITY_IND */ [0x2d] = "\x03\x1f\x1d\x01",
367+ /* CONNECT_B3_IND */ [0x2f] = "\x03\x2b\x01",
368+ /* CONNECT_B3_ACTIVE_IND */ [0x30] = "\x03\x2b\x01",
369+ /* DISCONNECT_B3_IND */ [0x31] = "\x03\x2d\x2b\x01",
370+ /* DATA_B3_IND */ [0x33] = "\x03\x18\x1a\x19\x20\x01",
371+ /* RESET_B3_IND */ [0x34] = "\x03\x2b\x01",
372+ /* CONNECT_B3_T90_ACTIVE_IND */ [0x35] = "\x03\x2b\x01",
373+ /* CONNECT_RESP */ [0x38] = "\x03\x2e\x0d\x06\x08\x0a\x05\x07\x09\x01\x16\x17\x28\x04\x0c\x27\x2f\x1c\x01\x01",
374+ /* CONNECT_ACTIVE_RESP */ [0x39] = "\x03\x01",
375+ /* DISCONNECT_RESP */ [0x3a] = "\x03\x01",
376+ /* MANUFACTURER_IND */ [0x3c] = "\x03\x2a\x15\x21\x29\x01",
377+ /* INFO_RESP */ [0x3e] = "\x03\x01",
378+ /* FACILITY_RESP */ [0x3f] = "\x03\x1f\x01",
379+ /* CONNECT_B3_RESP */ [0x41] = "\x03\x2e\x2b\x01",
380+ /* CONNECT_B3_ACTIVE_RESP */ [0x42] = "\x03\x01",
381+ /* DISCONNECT_B3_RESP */ [0x43] = "\x03\x01",
382+ /* DATA_B3_RESP */ [0x45] = "\x03\x19\x01",
383+ /* RESET_B3_RESP */ [0x46] = "\x03\x01",
384+ /* CONNECT_B3_T90_ACTIVE_RESP */ [0x47] = "\x03\x01",
385+ /* MANUFACTURER_RESP */ [0x4e] = "\x03\x2a\x15\x21\x29\x01",
386386 };
387387
388388 /*-------------------------------------------------------*/
389389
390−#define byteTLcpy(x,y) *(u8 *)(x)=*(u8 *)(y);
391−#define wordTLcpy(x,y) *(u16 *)(x)=*(u16 *)(y);
392−#define dwordTLcpy(x,y) memcpy(x,y,4);
393−#define structTLcpy(x,y,l) memcpy (x,y,l)
394−#define structTLcpyovl(x,y,l) memmove (x,y,l)
390+#define byteTLcpy(x, y) *(u8 *)(x) = *(u8 *)(y);
391+#define wordTLcpy(x, y) *(u16 *)(x) = *(u16 *)(y);
392+#define dwordTLcpy(x, y) memcpy(x, y, 4);
393+#define structTLcpy(x, y, l) memcpy(x, y, l)
394+#define structTLcpyovl(x, y, l) memmove(x, y, l)
395395
396−#define byteTRcpy(x,y) *(u8 *)(y)=*(u8 *)(x);
397−#define wordTRcpy(x,y) *(u16 *)(y)=*(u16 *)(x);
398−#define dwordTRcpy(x,y) memcpy(y,x,4);
399−#define structTRcpy(x,y,l) memcpy (y,x,l)
400−#define structTRcpyovl(x,y,l) memmove (y,x,l)
396+#define byteTRcpy(x, y) *(u8 *)(y) = *(u8 *)(x);
397+#define wordTRcpy(x, y) *(u16 *)(y) = *(u16 *)(x);
398+#define dwordTRcpy(x, y) memcpy(y, x, 4);
399+#define structTRcpy(x, y, l) memcpy(y, x, l)
400+#define structTRcpyovl(x, y, l) memmove(y, x, l)
401401
402402 /*-------------------------------------------------------*/
403403 static unsigned command_2_index(unsigned c, unsigned sc)
@@ -414,9 +414,9 @@ static unsigned command_2_index(unsigned c, unsigned sc) · 10 unmodified lines
414414
415415 /*-------------------------------------------------------*/
416416 #define TYP (cdef[cmsg->par[cmsg->p]].typ)
417−#define OFF (((u8 *)cmsg)+cdef[cmsg->par[cmsg->p]].off)
417+#define OFF (((u8 *)cmsg) + cdef[cmsg->par[cmsg->p]].off)
418418
419−static void jumpcstruct(_cmsg * cmsg)
419+static void jumpcstruct(_cmsg *cmsg)
420420 {
421421 unsigned layer;
422422 for (cmsg->p++, layer = 1; layer;) {
@@ -433,7 +433,7 @@ static void jumpcstruct(_cmsg * cmsg) · 10 unmodified lines
433433 }
434434 }
435435 /*-------------------------------------------------------*/
436−static void pars_2_message(_cmsg * cmsg)
436+static void pars_2_message(_cmsg *cmsg)
437437 {
438438
439439 for (; TYP != _CEND; cmsg->p++) {
@@ -499,7 +499,7 @@ static void pars_2_message(_cmsg * cmsg) · 59 unmodified lines
499499 * Return value: 0 for success
500500 */
501501
502−unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg)
502+unsigned capi_cmsg2message(_cmsg *cmsg, u8 *msg)
503503 {
504504 cmsg->m = msg;
505505 cmsg->l = 8;
@@ -518,7 +518,7 @@ unsigned capi_cmsg2message(_cmsg * cmsg, u8 * msg) · 12 unmodified lines
518518 }
519519
520520 /*-------------------------------------------------------*/
521−static void message_2_pars(_cmsg * cmsg)
521+static void message_2_pars(_cmsg *cmsg)
522522 {
523523 for (; TYP != _CEND; cmsg->p++) {
524524
@@ -569,7 +569,7 @@ static void message_2_pars(_cmsg * cmsg) · 44 unmodified lines
569569 * Return value: 0 for success
570570 */
571571
572−unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg)
572+unsigned capi_message2cmsg(_cmsg *cmsg, u8 *msg)
573573 {
574574 memset(cmsg, 0, sizeof(_cmsg));
575575 cmsg->m = msg;
@@ -600,7 +600,7 @@ unsigned capi_message2cmsg(_cmsg * cmsg, u8 * msg) · 24 unmodified lines
600600 * Return value: 0 for success
601601 */
602602
603−unsigned capi_cmsg_header(_cmsg * cmsg, u16 _ApplId,
603+unsigned capi_cmsg_header(_cmsg *cmsg, u16 _ApplId,
604604 u8 _Command, u8 _Subcommand,
605605 u16 _Messagenumber, u32 _Controller)
606606 {
@@ -689,54 +689,54 @@ char *capi_cmd2str(u8 cmd, u8 subcmd) · 82 unmodified lines
689689
690690 static char *pnames[] =
691691 {
692− /*00 */ NULL,
693− /*01 */ NULL,
694− /*02 */ NULL,
695− /*03 */ "Controller/PLCI/NCCI",
696− /*04 */ "AdditionalInfo",
697− /*05 */ "B1configuration",
698− /*06 */ "B1protocol",
699− /*07 */ "B2configuration",
700− /*08 */ "B2protocol",
701− /*09 */ "B3configuration",
702− /*0a */ "B3protocol",
703− /*0b */ "BC",
704− /*0c */ "BChannelinformation",
705− /*0d */ "BProtocol",
706− /*0e */ "CalledPartyNumber",
707− /*0f */ "CalledPartySubaddress",
708− /*10 */ "CallingPartyNumber",
709− /*11 */ "CallingPartySubaddress",
710− /*12 */ "CIPmask",
711− /*13 */ "CIPmask2",
712− /*14 */ "CIPValue",
713− /*15 */ "Class",
714− /*16 */ "ConnectedNumber",
715− /*17 */ "ConnectedSubaddress",
716− /*18 */ "Data32",
717− /*19 */ "DataHandle",
718− /*1a */ "DataLength",
719− /*1b */ "FacilityConfirmationParameter",
720− /*1c */ "Facilitydataarray",
721− /*1d */ "FacilityIndicationParameter",
722− /*1e */ "FacilityRequestParameter",
723− /*1f */ "FacilitySelector",
724− /*20 */ "Flags",
725− /*21 */ "Function",
726− /*22 */ "HLC",
727− /*23 */ "Info",
728− /*24 */ "InfoElement",
729− /*25 */ "InfoMask",
730− /*26 */ "InfoNumber",
731− /*27 */ "Keypadfacility",
732− /*28 */ "LLC",
733− /*29 */ "ManuData",
734− /*2a */ "ManuID",
735− /*2b */ "NCPI",
736− /*2c */ "Reason",
737− /*2d */ "Reason_B3",
738− /*2e */ "Reject",
739− /*2f */ "Useruserdata"
692+ /*00 */ NULL,
693+ /*01 */ NULL,
694+ /*02 */ NULL,
695+ /*03 */ "Controller/PLCI/NCCI",
696+ /*04 */ "AdditionalInfo",
697+ /*05 */ "B1configuration",
698+ /*06 */ "B1protocol",
699+ /*07 */ "B2configuration",
700+ /*08 */ "B2protocol",
701+ /*09 */ "B3configuration",
702+ /*0a */ "B3protocol",
703+ /*0b */ "BC",
704+ /*0c */ "BChannelinformation",
705+ /*0d */ "BProtocol",
706+ /*0e */ "CalledPartyNumber",
707+ /*0f */ "CalledPartySubaddress",
708+ /*10 */ "CallingPartyNumber",
709+ /*11 */ "CallingPartySubaddress",
710+ /*12 */ "CIPmask",
711+ /*13 */ "CIPmask2",
712+ /*14 */ "CIPValue",
713+ /*15 */ "Class",
714+ /*16 */ "ConnectedNumber",
715+ /*17 */ "ConnectedSubaddress",
716+ /*18 */ "Data32",
717+ /*19 */ "DataHandle",
718+ /*1a */ "DataLength",
719+ /*1b */ "FacilityConfirmationParameter",
720+ /*1c */ "Facilitydataarray",
721+ /*1d */ "FacilityIndicationParameter",
722+ /*1e */ "FacilityRequestParameter",
723+ /*1f */ "FacilitySelector",
724+ /*20 */ "Flags",
725+ /*21 */ "Function",
726+ /*22 */ "HLC",
727+ /*23 */ "Info",
728+ /*24 */ "InfoElement",
729+ /*25 */ "InfoMask",
730+ /*26 */ "InfoNumber",
731+ /*27 */ "Keypadfacility",
732+ /*28 */ "LLC",
733+ /*29 */ "ManuData",
734+ /*2a */ "ManuID",
735+ /*2b */ "NCPI",
736+ /*2c */ "Reason",
737+ /*2d */ "Reason_B3",
738+ /*2e */ "Reject",
739+ /*2f */ "Useruserdata"
740740 };
741741
742742
@@ -744,10 +744,10 @@ static char *pnames[] = · 1 unmodified line
744744 #include <stdarg.h>
745745
746746 /*-------------------------------------------------------*/
747−static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...)
747+static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt, ...)
748748 {
749749 va_list f;
750− size_t n,r;
750+ size_t n, r;
751751
752752 if (!cdb)
753753 return NULL;
@@ -783,7 +783,7 @@ static _cdebbuf *bufprint(_cdebbuf *cdb, char *fmt,...) · 29 unmodified lines
783783 return cdb;
784784 }
785785
786−static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len)
786+static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 *m, unsigned len)
787787 {
788788 unsigned hex = 0;
789789
@@ -807,7 +807,7 @@ static _cdebbuf *printstructlen(_cdebbuf *cdb, u8 * m, unsigned len) · 17 unmodified lines
807807 return cdb;
808808 }
809809
810−static _cdebbuf *printstruct(_cdebbuf *cdb, u8 * m)
810+static _cdebbuf *printstruct(_cdebbuf *cdb, u8 *m)
811811 {
812812 unsigned len;
813813
@@ -940,7 +940,7 @@ void cdebbuf_free(_cdebbuf *cdb) · 126 unmodified lines
940940 * The returned buffer should be freed by a call to cdebbuf_free() after use.
941941 */
942942
943−_cdebbuf *capi_message2str(u8 * msg)
943+_cdebbuf *capi_message2str(u8 *msg)
944944 {
945945 _cdebbuf *cdb;
946946 _cmsg *cmsg;
@@ -964,10 +964,10 @@ _cdebbuf *capi_message2str(u8 * msg) · 17 unmodified lines
964964 cmsg->par = cpars[command_2_index(cmsg->Command, cmsg->Subcommand)];
965965
966966 cdb = bufprint(cdb, "%-26s ID=%03d #0x%04x LEN=%04d\n",
967− mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
968− ((unsigned short *) msg)[1],
969− ((unsigned short *) msg)[3],
970− ((unsigned short *) msg)[0]);
967+ mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
968+ ((unsigned short *) msg)[1],
969+ ((unsigned short *) msg)[3],
970+ ((unsigned short *) msg)[0]);
971971
972972 cdb = protocol_message_2_pars(cdb, cmsg, 1);
973973 if (unlikely(cmsg != g_cmsg))
@@ -986,7 +986,7 @@ _cdebbuf *capi_message2str(u8 * msg) · 12 unmodified lines
986986 * The returned buffer should be freed by a call to cdebbuf_free() after use.
987987 */
988988
989−_cdebbuf *capi_cmsg2str(_cmsg * cmsg)
989+_cdebbuf *capi_cmsg2str(_cmsg *cmsg)
990990 {
991991 _cdebbuf *cdb;
992992
@@ -998,17 +998,17 @@ _cdebbuf *capi_cmsg2str(_cmsg * cmsg) · 5 unmodified lines
998998 cmsg->l = 8;
999999 cmsg->p = 0;
10001000 cdb = bufprint(cdb, "%s ID=%03d #0x%04x LEN=%04d\n",
1001− mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
1002− ((u16 *) cmsg->m)[1],
1003− ((u16 *) cmsg->m)[3],
1004− ((u16 *) cmsg->m)[0]);
1001+ mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
1002+ ((u16 *) cmsg->m)[1],
1003+ ((u16 *) cmsg->m)[3],
1004+ ((u16 *) cmsg->m)[0]);
10051005 cdb = protocol_message_2_pars(cdb, cmsg, 1);
10061006 return cdb;
10071007 }
10081008
10091009 int __init cdebug_init(void)
10101010 {
1011− g_cmsg= kmalloc(sizeof(_cmsg), GFP_KERNEL);
1011+ g_cmsg = kmalloc(sizeof(_cmsg), GFP_KERNEL);
10121012 if (!g_cmsg)
10131013 return -ENOMEM;
10141014 g_debbuf = kmalloc(sizeof(_cdebbuf), GFP_KERNEL);
@@ -1041,12 +1041,12 @@ void __exit cdebug_exit(void) · 26 unmodified lines
10411041
10421042 static _cdebbuf g_debbuf = {"CONFIG_CAPI_TRACE not enabled", NULL, 0, 0};
10431043
1044−_cdebbuf *capi_message2str(u8 * msg)
1044+_cdebbuf *capi_message2str(u8 *msg)
10451045 {
10461046 return &g_debbuf;
10471047 }
10481048
1049−_cdebbuf *capi_cmsg2str(_cmsg * cmsg)
1049+_cdebbuf *capi_cmsg2str(_cmsg *cmsg)
10501050 {
10511051 return &g_debbuf;
10521052 }
drivers/isdn/capi/kcapi.c+58−58
@@ -1,10 +1,10 @@
11 /* $Id: kcapi.c,v 1.1.2.8 2004/03/26 19:57:20 armin Exp $
2− *
2+ *
33 * Kernel CAPI 2.0 Module
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
66 * Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
7− *
7+ *
88 * This software may be used and distributed according to the terms
99 * of the GNU General Public License, incorporated herein by reference.
1010 *
@@ -55,7 +55,7 @@ struct capictr_event { · 44 unmodified lines
5555
5656 /* ------------------------------------------------------------- */
5757
58−static struct capi_version driver_version = {2, 0, 1, 1<<4};
58+static struct capi_version driver_version = {2, 0, 1, 1 << 4};
5959 static char driver_serial[CAPI_SERIAL_LEN] = "0004711";
6060 static char capi_manufakturer[64] = "AVM Berlin";
6161
@@ -172,7 +172,7 @@ register_appl(struct capi_ctr *ctr, u16 applid, capi_register_params *rparam) · 110 unmodified lines
172172 static void release_appl(struct capi_ctr *ctr, u16 applid)
173173 {
174174 DBG("applid %#x", applid);
175−
175+
176176 ctr->release_appl(ctr, applid);
177177 capi_ctr_put(ctr);
178178 }
@@ -186,7 +186,7 @@ static void notify_up(u32 contr) · 7 unmodified lines
186186 mutex_lock(&capi_controller_lock);
187187
188188 if (showcapimsgs & 1)
189− printk(KERN_DEBUG "kcapi: notify up contr %d\n", contr);
189+ printk(KERN_DEBUG "kcapi: notify up contr %d\n", contr);
190190
191191 ctr = get_capi_ctr_by_nr(contr);
192192 if (ctr) {
@@ -352,16 +352,16 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl, · 159 unmodified lines
352352 cdb = capi_message2str(skb->data);
353353 if (cdb) {
354354 printk(KERN_INFO "kcapi: controller [%03d] not active, got: %s",
355− ctr->cnr, cdb->buf);
355+ ctr->cnr, cdb->buf);
356356 cdebbuf_free(cdb);
357357 } else
358358 printk(KERN_INFO "kcapi: controller [%03d] not active, cannot trace\n",
359− ctr->cnr);
359+ ctr->cnr);
360360 goto error;
361361 }
362362
363363 cmd = CAPIMSG_COMMAND(skb->data);
364− subcmd = CAPIMSG_SUBCOMMAND(skb->data);
364+ subcmd = CAPIMSG_SUBCOMMAND(skb->data);
365365 if (cmd == CAPI_DATA_B3 && subcmd == CAPI_IND) {
366366 ctr->nrecvdatapkt++;
367367 if (ctr->traceflag > 2)
@@ -382,13 +382,13 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl, · 14 unmodified lines
382382 cdb = capi_message2str(skb->data);
383383 if (cdb) {
384384 printk(KERN_DEBUG "kcapi: got [%03d] %s\n",
385− ctr->cnr, cdb->buf);
385+ ctr->cnr, cdb->buf);
386386 cdebbuf_free(cdb);
387387 } else
388388 printk(KERN_DEBUG "kcapi: got [%03d] id#%d %s len=%u, cannot trace\n",
389− ctr->cnr, CAPIMSG_APPID(skb->data),
390− capi_cmd2str(cmd, subcmd),
391− CAPIMSG_LEN(skb->data));
389+ ctr->cnr, CAPIMSG_APPID(skb->data),
390+ capi_cmd2str(cmd, subcmd),
391+ CAPIMSG_LEN(skb->data));
392392 }
393393
394394 }
@@ -400,12 +400,12 @@ void capi_ctr_handle_message(struct capi_ctr *ctr, u16 appl, · 5 unmodified lines
400400 cdb = capi_message2str(skb->data);
401401 if (cdb) {
402402 printk(KERN_ERR "kcapi: handle_message: applid %d state released (%s)\n",
403− CAPIMSG_APPID(skb->data), cdb->buf);
403+ CAPIMSG_APPID(skb->data), cdb->buf);
404404 cdebbuf_free(cdb);
405405 } else
406406 printk(KERN_ERR "kcapi: handle_message: applid %d state released (%s) cannot trace\n",
407− CAPIMSG_APPID(skb->data),
408− capi_cmd2str(cmd, subcmd));
407+ CAPIMSG_APPID(skb->data),
408+ capi_cmd2str(cmd, subcmd));
409409 goto error;
410410 }
411411 skb_queue_tail(&ap->recv_queue, skb);
@@ -519,7 +519,7 @@ int attach_capi_ctr(struct capi_ctr *ctr) · 107 unmodified lines
519519 if (i == CAPI_MAXCONTR) {
520520 mutex_unlock(&capi_controller_lock);
521521 printk(KERN_ERR "kcapi: out of controller slots\n");
522− return -EBUSY;
522+ return -EBUSY;
523523 }
524524 capi_controller[i] = ctr;
525525
@@ -541,7 +541,7 @@ int attach_capi_ctr(struct capi_ctr *ctr) · 15 unmodified lines
541541 mutex_unlock(&capi_controller_lock);
542542
543543 printk(KERN_NOTICE "kcapi: controller [%03d]: %s attached\n",
544− ctr->cnr, ctr->name);
544+ ctr->cnr, ctr->name);
545545 return 0;
546546 }
547547
@@ -772,7 +772,7 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb) · 224 unmodified lines
772772 u8 cmd, subcmd;
773773
774774 DBG("applid %#x", ap->applid);
775−
775+
776776 if (ncontrollers == 0)
777777 return CAPI_REGNOTINSTALLED;
778778 if ((ap->applid == 0) || ap->release_in_progress)
@@ -794,9 +794,9 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb) · 15 unmodified lines
794794 return CAPI_SENDQUEUEFULL;
795795
796796 cmd = CAPIMSG_COMMAND(skb->data);
797− subcmd = CAPIMSG_SUBCOMMAND(skb->data);
797+ subcmd = CAPIMSG_SUBCOMMAND(skb->data);
798798
799− if (cmd == CAPI_DATA_B3 && subcmd== CAPI_REQ) {
799+ if (cmd == CAPI_DATA_B3 && subcmd == CAPI_REQ) {
800800 ctr->nsentdatapkt++;
801801 ap->nsentdatapkt++;
802802 if (ctr->traceflag > 2)
@@ -819,15 +819,15 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb) · 16 unmodified lines
819819 _cdebbuf *cdb = capi_message2str(skb->data);
820820 if (cdb) {
821821 printk(KERN_DEBUG "kcapi: put [%03d] %s\n",
822− CAPIMSG_CONTROLLER(skb->data),
823− cdb->buf);
822+ CAPIMSG_CONTROLLER(skb->data),
823+ cdb->buf);
824824 cdebbuf_free(cdb);
825825 } else
826826 printk(KERN_DEBUG "kcapi: put [%03d] id#%d %s len=%u cannot trace\n",
827− CAPIMSG_CONTROLLER(skb->data),
828− CAPIMSG_APPID(skb->data),
829− capi_cmd2str(cmd, subcmd),
830− CAPIMSG_LEN(skb->data));
827+ CAPIMSG_CONTROLLER(skb->data),
828+ CAPIMSG_APPID(skb->data),
829+ capi_cmd2str(cmd, subcmd),
830+ CAPIMSG_LEN(skb->data));
831831 }
832832 }
833833 return ctr->send_message(ctr, skb);
@@ -1028,14 +1028,14 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) · 194 unmodified lines
10281028 case AVMB1_ADDCARD:
10291029 case AVMB1_ADDCARD_WITH_TYPE:
10301030 if (cmd == AVMB1_ADDCARD) {
1031− if ((retval = copy_from_user(&cdef, data,
1032− sizeof(avmb1_carddef))))
1033− return -EFAULT;
1034− cdef.cardtype = AVM_CARDTYPE_B1;
1031+ if ((retval = copy_from_user(&cdef, data,
1032+ sizeof(avmb1_carddef))))
1033+ return -EFAULT;
1034+ cdef.cardtype = AVM_CARDTYPE_B1;
10351035 } else {
1036− if ((retval = copy_from_user(&cdef, data,
1037− sizeof(avmb1_extcarddef))))
1038− return -EFAULT;
1036+ if ((retval = copy_from_user(&cdef, data,
1037+ sizeof(avmb1_extcarddef))))
1038+ return -EFAULT;
10391039 }
10401040 cparams.port = cdef.port;
10411041 cparams.irq = cdef.irq;
@@ -1043,24 +1043,24 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) · 1 unmodified line
10431043
10441044 mutex_lock(&capi_drivers_lock);
10451045
1046− switch (cdef.cardtype) {
1047− case AVM_CARDTYPE_B1:
1048− list_for_each(l, &capi_drivers) {
1049− driver = list_entry(l, struct capi_driver, list);
1050− if (strcmp(driver->name, "b1isa") == 0)
1051− break;
1052− }
1053− break;
1054− case AVM_CARDTYPE_T1:
1055− list_for_each(l, &capi_drivers) {
1056− driver = list_entry(l, struct capi_driver, list);
1057− if (strcmp(driver->name, "t1isa") == 0)
1058− break;
1059− }
1060− break;
1061− default:
1062− driver = NULL;
1063− break;
1046+ switch (cdef.cardtype) {
1047+ case AVM_CARDTYPE_B1:
1048+ list_for_each(l, &capi_drivers) {
1049+ driver = list_entry(l, struct capi_driver, list);
1050+ if (strcmp(driver->name, "b1isa") == 0)
1051+ break;
1052+ }
1053+ break;
1054+ case AVM_CARDTYPE_T1:
1055+ list_for_each(l, &capi_drivers) {
1056+ driver = list_entry(l, struct capi_driver, list);
1057+ if (strcmp(driver->name, "t1isa") == 0)
1058+ break;
1059+ }
1060+ break;
1061+ default:
1062+ driver = NULL;
1063+ break;
10641064 }
10651065 if (!driver) {
10661066 printk(KERN_ERR "kcapi: driver not loaded.\n");
@@ -1136,7 +1136,7 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) · 69 unmodified lines
11361136
11371137 retval = wait_on_ctr_state(ctr, CAPI_CTR_RUNNING);
11381138
1139−load_unlock_out:
1139+ load_unlock_out:
11401140 mutex_unlock(&capi_controller_lock);
11411141 return retval;
11421142
@@ -1167,7 +1167,7 @@ load_unlock_out: · 24 unmodified lines
11671167
11681168 retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
11691169
1170−reset_unlock_out:
1170+ reset_unlock_out:
11711171 mutex_unlock(&capi_controller_lock);
11721172 return retval;
11731173 }
@@ -1235,7 +1235,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data) · 61 unmodified lines
12351235 cparams.membase = cdef.membase;
12361236 cparams.cardnr = cdef.cardnr;
12371237 cparams.cardtype = 0;
1238− cdef.driver[sizeof(cdef.driver)-1] = 0;
1238+ cdef.driver[sizeof(cdef.driver) - 1] = 0;
12391239
12401240 mutex_lock(&capi_drivers_lock);
12411241
@@ -1246,7 +1246,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data) · 4 unmodified lines
12461246 }
12471247 if (driver == NULL) {
12481248 printk(KERN_ERR "kcapi: driver \"%s\" not loaded.\n",
1249− cdef.driver);
1249+ cdef.driver);
12501250 retval = -ESRCH;
12511251 } else if (!driver->add_card) {
12521252 printk(KERN_ERR "kcapi: driver \"%s\" has no add card function.\n", cdef.driver);
@@ -1260,7 +1260,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data) · 7 unmodified lines
12601260
12611261 default:
12621262 printk(KERN_ERR "kcapi: manufacturer command %d unknown.\n",
1263− cmd);
1263+ cmd);
12641264 break;
12651265
12661266 }
@@ -1305,7 +1305,7 @@ static int __init kcapi_init(void) · 38 unmodified lines
13051305
13061306 static void __exit kcapi_exit(void)
13071307 {
1308− kcapi_proc_exit();
1308+ kcapi_proc_exit();
13091309
13101310 unregister_capictr_notifier(&capictr_nb);
13111311 cdebug_exit();
drivers/isdn/capi/kcapi.h+5−6
@@ -1,9 +1,9 @@
11 /*
22 * Kernel CAPI 2.0 Module
3− *
3+ *
44 * Copyright 1999 by Carsten Paeth <calle@calle.de>
55 * Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -16,9 +16,9 @@ · 6 unmodified lines
1616 #include <linux/isdn/capilli.h>
1717
1818 #ifdef KCAPI_DEBUG
19−#define DBG(format, arg...) do { \
20−printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
21−} while (0)
19+#define DBG(format, arg...) do { \
20+ printk(KERN_DEBUG "%s: " format "\n" , __func__ , ## arg); \
21+ } while (0)
2222 #else
2323 #define DBG(format, arg...) /* */
2424 #endif
@@ -49,4 +49,3 @@ static inline void kcapi_proc_init(void) { }; · 24 unmodified lines
4949 static inline void kcapi_proc_exit(void) { };
5050
5151 #endif
52−
drivers/isdn/capi/kcapi_proc.c+7−7
@@ -1,9 +1,9 @@
11 /*
22 * Kernel CAPI 2.0 Module - /proc/capi handling
3− *
3+ *
44 * Copyright 1999 by Carsten Paeth <calle@calle.de>
55 * Copyright 2002 by Kai Germaschewski <kai@germaschewski.name>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -29,7 +29,7 @@ static char *state2str(unsigned short state) · 19 unmodified lines
2929 // /proc/capi
3030 // ===========================================================================
3131
32−// /proc/capi/controller:
32+// /proc/capi/controller:
3333 // cnr driver cardstate name driverinfo
3434 // /proc/capi/contrstats:
3535 // cnr nrecvctlpkt nrecvdatapkt nsentctlpkt nsentdatapkt
@@ -85,7 +85,7 @@ static int contrstats_show(struct seq_file *seq, void *v) · 49 unmodified lines
8585 return 0;
8686
8787 seq_printf(seq, "%d %lu %lu %lu %lu\n",
88− ctr->cnr,
88+ ctr->cnr,
8989 ctr->nrecvctlpkt,
9090 ctr->nrecvdatapkt,
9191 ctr->nsentctlpkt,
@@ -134,9 +134,9 @@ static const struct file_operations proc_contrstats_ops = { · 42 unmodified lines
134134 .release = seq_release,
135135 };
136136
137−// /proc/capi/applications:
137+// /proc/capi/applications:
138138 // applid l3cnt dblkcnt dblklen #ncci recvqueuelen
139−// /proc/capi/applstats:
139+// /proc/capi/applstats:
140140 // applid nrecvctlpkt nrecvdatapkt nsentctlpkt nsentdatapkt
141141 // ---------------------------------------------------------------------------
142142
@@ -297,7 +297,7 @@ static const struct file_operations proc_driver_ops = { · 154 unmodified lines
297297
298298 // ---------------------------------------------------------------------------
299299
300−void __init
300+void __init
301301 kcapi_proc_init(void)
302302 {
303303 proc_mkdir("capi", NULL);
drivers/isdn/divert/divert_init.c+37−38
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 * Module init for DSS1 diversion services for i4l.
44 *
55 * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -23,13 +23,13 @@ MODULE_LICENSE("GPL"); · 13 unmodified lines
2323 /* structure containing interface to hl */
2424 /****************************************/
2525 isdn_divert_if divert_if =
26− { DIVERT_IF_MAGIC, /* magic value */
27− DIVERT_CMD_REG, /* register cmd */
28− ll_callback, /* callback routine from ll */
29− NULL, /* command still not specified */
30− NULL, /* drv_to_name */
31− NULL, /* name_to_drv */
32− };
26+{ DIVERT_IF_MAGIC, /* magic value */
27+ DIVERT_CMD_REG, /* register cmd */
28+ ll_callback, /* callback routine from ll */
29+ NULL, /* command still not specified */
30+ NULL, /* drv_to_name */
31+ NULL, /* name_to_drv */
32+};
3333
3434 /*************************/
3535 /* Module interface code */
@@ -38,17 +38,17 @@ isdn_divert_if divert_if = · 2 unmodified lines
3838 static int __init divert_init(void)
3939 { int i;
4040
41− if (divert_dev_init())
42− { printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n");
43− return(-EIO);
44− }
45− if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
46− { divert_dev_deinit();
47− printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n",i);
48− return(-EIO);
49− }
50− printk(KERN_INFO "dss1_divert module successfully installed\n");
51− return(0);
41+ if (divert_dev_init())
42+ { printk(KERN_WARNING "dss1_divert: cannot install device, not loaded\n");
43+ return (-EIO);
44+ }
45+ if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
46+ { divert_dev_deinit();
47+ printk(KERN_WARNING "dss1_divert: error %d registering module, not loaded\n", i);
48+ return (-EIO);
49+ }
50+ printk(KERN_INFO "dss1_divert module successfully installed\n");
51+ return (0);
5252 }
5353
5454 /**********************/
@@ -56,27 +56,26 @@ static int __init divert_init(void) · 1 unmodified line
5656 /**********************/
5757 static void __exit divert_exit(void)
5858 {
59− unsigned long flags;
60− int i;
59+ unsigned long flags;
60+ int i;
6161
62− spin_lock_irqsave(&divert_lock, flags);
63− divert_if.cmd = DIVERT_CMD_REL; /* release */
64− if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
65− { printk(KERN_WARNING "dss1_divert: error %d releasing module\n",i);
66− spin_unlock_irqrestore(&divert_lock, flags);
67− return;
68− }
69− if (divert_dev_deinit())
70− { printk(KERN_WARNING "dss1_divert: device busy, remove cancelled\n");
71− spin_unlock_irqrestore(&divert_lock, flags);
72− return;
73− }
74− spin_unlock_irqrestore(&divert_lock, flags);
75− deleterule(-1); /* delete all rules and free mem */
76− deleteprocs();
77− printk(KERN_INFO "dss1_divert module successfully removed \n");
62+ spin_lock_irqsave(&divert_lock, flags);
63+ divert_if.cmd = DIVERT_CMD_REL; /* release */
64+ if ((i = DIVERT_REG_NAME(&divert_if)) != DIVERT_NO_ERR)
65+ { printk(KERN_WARNING "dss1_divert: error %d releasing module\n", i);
66+ spin_unlock_irqrestore(&divert_lock, flags);
67+ return;
68+ }
69+ if (divert_dev_deinit())
70+ { printk(KERN_WARNING "dss1_divert: device busy, remove cancelled\n");
71+ spin_unlock_irqrestore(&divert_lock, flags);
72+ return;
73+ }
74+ spin_unlock_irqrestore(&divert_lock, flags);
75+ deleterule(-1); /* delete all rules and free mem */
76+ deleteprocs();
77+ printk(KERN_INFO "dss1_divert module successfully removed \n");
7878 }
7979
8080 module_init(divert_init);
8181 module_exit(divert_exit);
82−
drivers/isdn/divert/divert_procfs.c+76−76
@@ -50,10 +50,10 @@ put_info_buffer(char *cp) · 49 unmodified lines
5050 if (!*cp)
5151 return;
5252 if (!(ib = kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
53− return; /* no memory */
53+ return; /* no memory */
5454 strcpy(ib->info_start, cp); /* set output string */
5555 ib->next = NULL;
56− spin_lock_irqsave( &divert_info_lock, flags );
56+ spin_lock_irqsave(&divert_info_lock, flags);
5757 ib->usage_cnt = if_used;
5858 if (!divert_info_head)
5959 divert_info_head = ib; /* new head */
@@ -71,7 +71,7 @@ put_info_buffer(char *cp) · 11 unmodified lines
7171 } else
7272 break;
7373 } /* divert_info_head->next */
74− spin_unlock_irqrestore( &divert_info_lock, flags );
74+ spin_unlock_irqrestore(&divert_info_lock, flags);
7575 wake_up_interruptible(&(rd_queue));
7676 } /* put_info_buffer */
7777
@@ -81,7 +81,7 @@ put_info_buffer(char *cp) · 3 unmodified lines
8181 /* deflection device read routine */
8282 /**********************************/
8383 static ssize_t
84−isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t * off)
84+isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t *off)
8585 {
8686 struct divert_info *inf;
8787 int len;
@@ -109,7 +109,7 @@ isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t * off · 21 unmodified lines
109109 /* deflection device write routine */
110110 /**********************************/
111111 static ssize_t
112−isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
112+isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
113113 {
114114 return (-ENODEV);
115115 } /* isdn_divert_write */
@@ -119,7 +119,7 @@ isdn_divert_write(struct file *file, const char __user *buf, size_t count, loff_ · 3 unmodified lines
119119 /* select routines for various kernels */
120120 /***************************************/
121121 static unsigned int
122−isdn_divert_poll(struct file *file, poll_table * wait)
122+isdn_divert_poll(struct file *file, poll_table *wait)
123123 {
124124 unsigned int mask = 0;
125125
@@ -139,13 +139,13 @@ isdn_divert_open(struct inode *ino, struct file *filep) · 13 unmodified lines
139139 {
140140 unsigned long flags;
141141
142− spin_lock_irqsave( &divert_info_lock, flags );
143− if_used++;
142+ spin_lock_irqsave(&divert_info_lock, flags);
143+ if_used++;
144144 if (divert_info_head)
145145 filep->private_data = &(divert_info_tail->next);
146146 else
147147 filep->private_data = &divert_info_head;
148− spin_unlock_irqrestore( &divert_info_lock, flags );
148+ spin_unlock_irqrestore(&divert_info_lock, flags);
149149 /* start_divert(); */
150150 return nonseekable_open(ino, filep);
151151 } /* isdn_divert_open */
@@ -159,7 +159,7 @@ isdn_divert_close(struct inode *ino, struct file *filep) · 7 unmodified lines
159159 struct divert_info *inf;
160160 unsigned long flags;
161161
162− spin_lock_irqsave( &divert_info_lock, flags );
162+ spin_lock_irqsave(&divert_info_lock, flags);
163163 if_used--;
164164 inf = *((struct divert_info **) filep->private_data);
165165 while (inf) {
@@ -172,7 +172,7 @@ isdn_divert_close(struct inode *ino, struct file *filep) · 6 unmodified lines
172172 divert_info_head = divert_info_head->next;
173173 kfree(inf);
174174 }
175− spin_unlock_irqrestore( &divert_info_lock, flags );
175+ spin_unlock_irqrestore(&divert_info_lock, flags);
176176 return (0);
177177 } /* isdn_divert_close */
178178
@@ -191,75 +191,75 @@ static int isdn_divert_ioctl_unlocked(struct file *file, uint cmd, ulong arg) · 12 unmodified lines
191191 return -EFAULT;
192192
193193 switch (cmd) {
194− case IIOCGETVER:
195− dioctl.drv_version = DIVERT_IIOC_VERSION; /* set version */
196− break;
197−
198− case IIOCGETDRV:
199− if ((dioctl.getid.drvid = divert_if.name_to_drv(dioctl.getid.drvnam)) < 0)
200− return (-EINVAL);
201− break;
202−
203− case IIOCGETNAM:
204− cp = divert_if.drv_to_name(dioctl.getid.drvid);
205− if (!cp)
206− return (-EINVAL);
207− if (!*cp)
208− return (-EINVAL);
209− strcpy(dioctl.getid.drvnam, cp);
210− break;
211−
212− case IIOCGETRULE:
213− if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
214− return (-EINVAL);
215− dioctl.getsetrule.rule = *rulep; /* copy data */
216− break;
217−
218− case IIOCMODRULE:
219− if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
220− return (-EINVAL);
221− spin_lock_irqsave(&divert_lock, flags);
222− *rulep = dioctl.getsetrule.rule; /* copy data */
223− spin_unlock_irqrestore(&divert_lock, flags);
224− return (0); /* no copy required */
225− break;
194+ case IIOCGETVER:
195+ dioctl.drv_version = DIVERT_IIOC_VERSION; /* set version */
196+ break;
226197
227− case IIOCINSRULE:
228− return (insertrule(dioctl.getsetrule.ruleidx, &dioctl.getsetrule.rule));
229− break;
198+ case IIOCGETDRV:
199+ if ((dioctl.getid.drvid = divert_if.name_to_drv(dioctl.getid.drvnam)) < 0)
200+ return (-EINVAL);
201+ break;
230202
231− case IIOCDELRULE:
232− return (deleterule(dioctl.getsetrule.ruleidx));
233− break;
203+ case IIOCGETNAM:
204+ cp = divert_if.drv_to_name(dioctl.getid.drvid);
205+ if (!cp)
206+ return (-EINVAL);
207+ if (!*cp)
208+ return (-EINVAL);
209+ strcpy(dioctl.getid.drvnam, cp);
210+ break;
234211
235− case IIOCDODFACT:
236− return (deflect_extern_action(dioctl.fwd_ctrl.subcmd,
237− dioctl.fwd_ctrl.callid,
238− dioctl.fwd_ctrl.to_nr));
239−
240− case IIOCDOCFACT:
241− case IIOCDOCFDIS:
242− case IIOCDOCFINT:
243− if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid))
244− return (-EINVAL); /* invalid driver */
245− if (strnlen(dioctl.cf_ctrl.msn, sizeof(dioctl.cf_ctrl.msn)) ==
246− sizeof(dioctl.cf_ctrl.msn))
247− return -EINVAL;
248− if (strnlen(dioctl.cf_ctrl.fwd_nr, sizeof(dioctl.cf_ctrl.fwd_nr)) ==
249− sizeof(dioctl.cf_ctrl.fwd_nr))
250− return -EINVAL;
251− if ((i = cf_command(dioctl.cf_ctrl.drvid,
252− (cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2,
253− dioctl.cf_ctrl.cfproc,
254− dioctl.cf_ctrl.msn,
255− dioctl.cf_ctrl.service,
256− dioctl.cf_ctrl.fwd_nr,
257− &dioctl.cf_ctrl.procid)))
258− return (i);
259− break;
212+ case IIOCGETRULE:
213+ if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
214+ return (-EINVAL);
215+ dioctl.getsetrule.rule = *rulep; /* copy data */
216+ break;
260217
261− default:
218+ case IIOCMODRULE:
219+ if (!(rulep = getruleptr(dioctl.getsetrule.ruleidx)))
262220 return (-EINVAL);
221+ spin_lock_irqsave(&divert_lock, flags);
222+ *rulep = dioctl.getsetrule.rule; /* copy data */
223+ spin_unlock_irqrestore(&divert_lock, flags);
224+ return (0); /* no copy required */
225+ break;
226+
227+ case IIOCINSRULE:
228+ return (insertrule(dioctl.getsetrule.ruleidx, &dioctl.getsetrule.rule));
229+ break;
230+
231+ case IIOCDELRULE:
232+ return (deleterule(dioctl.getsetrule.ruleidx));
233+ break;
234+
235+ case IIOCDODFACT:
236+ return (deflect_extern_action(dioctl.fwd_ctrl.subcmd,
237+ dioctl.fwd_ctrl.callid,
238+ dioctl.fwd_ctrl.to_nr));
239+
240+ case IIOCDOCFACT:
241+ case IIOCDOCFDIS:
242+ case IIOCDOCFINT:
243+ if (!divert_if.drv_to_name(dioctl.cf_ctrl.drvid))
244+ return (-EINVAL); /* invalid driver */
245+ if (strnlen(dioctl.cf_ctrl.msn, sizeof(dioctl.cf_ctrl.msn)) ==
246+ sizeof(dioctl.cf_ctrl.msn))
247+ return -EINVAL;
248+ if (strnlen(dioctl.cf_ctrl.fwd_nr, sizeof(dioctl.cf_ctrl.fwd_nr)) ==
249+ sizeof(dioctl.cf_ctrl.fwd_nr))
250+ return -EINVAL;
251+ if ((i = cf_command(dioctl.cf_ctrl.drvid,
252+ (cmd == IIOCDOCFACT) ? 1 : (cmd == IIOCDOCFDIS) ? 0 : 2,
253+ dioctl.cf_ctrl.cfproc,
254+ dioctl.cf_ctrl.msn,
255+ dioctl.cf_ctrl.service,
256+ dioctl.cf_ctrl.fwd_nr,
257+ &dioctl.cf_ctrl.procid)))
258+ return (i);
259+ break;
260+
261+ default:
262+ return (-EINVAL);
263263 } /* switch cmd */
264264 return copy_to_user((void __user *)arg, &dioctl, sizeof(dioctl)) ? -EFAULT : 0;
265265 } /* isdn_divert_ioctl */
@@ -284,7 +284,7 @@ static const struct file_operations isdn_fops = · 18 unmodified lines
284284 .poll = isdn_divert_poll,
285285 .unlocked_ioctl = isdn_divert_ioctl,
286286 .open = isdn_divert_open,
287− .release = isdn_divert_close,
287+ .release = isdn_divert_close,
288288 };
289289
290290 /****************************/
drivers/isdn/divert/isdn_divert.c+737−738
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 * DSS1 main diversion supplementary handling for i4l.
44 *
55 * Copyright 1999 by Werner Cornelius (werner@isdn4linux.de)
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -20,24 +20,24 @@ · 10 unmodified lines
2020 /* structure keeping calling info */
2121 /**********************************/
2222 struct call_struc
23− { isdn_ctrl ics; /* delivered setup + driver parameters */
24− ulong divert_id; /* Id delivered to user */
25− unsigned char akt_state; /* actual state */
26− char deflect_dest[35]; /* deflection destination */
27− struct timer_list timer; /* timer control structure */
28− char info[90]; /* device info output */
29− struct call_struc *next; /* pointer to next entry */
30− struct call_struc *prev;
31− };
23+{ isdn_ctrl ics; /* delivered setup + driver parameters */
24+ ulong divert_id; /* Id delivered to user */
25+ unsigned char akt_state; /* actual state */
26+ char deflect_dest[35]; /* deflection destination */
27+ struct timer_list timer; /* timer control structure */
28+ char info[90]; /* device info output */
29+ struct call_struc *next; /* pointer to next entry */
30+ struct call_struc *prev;
31+};
3232
3333
3434 /********************************************/
3535 /* structure keeping deflection table entry */
3636 /********************************************/
3737 struct deflect_struc
38− { struct deflect_struc *next,*prev;
39− divert_rule rule; /* used rule */
40− };
38+{ struct deflect_struc *next, *prev;
39+ divert_rule rule; /* used rule */
40+};
4141
4242
4343 /*****************************************/
@@ -45,10 +45,10 @@ struct deflect_struc · 1 unmodified line
4545 /*****************************************/
4646 /* diversion/deflection processes */
4747 static struct call_struc *divert_head = NULL; /* head of remembered entrys */
48−static ulong next_id = 1; /* next info id */
48+static ulong next_id = 1; /* next info id */
4949 static struct deflect_struc *table_head = NULL;
50−static struct deflect_struc *table_tail = NULL;
51−static unsigned char extern_wait_max = 4; /* maximum wait in s for external process */
50+static struct deflect_struc *table_tail = NULL;
51+static unsigned char extern_wait_max = 4; /* maximum wait in s for external process */
5252
5353 DEFINE_SPINLOCK(divert_lock);
5454
@@ -57,50 +57,50 @@ DEFINE_SPINLOCK(divert_lock); · 2 unmodified lines
5757 /***************************/
5858 static void deflect_timer_expire(ulong arg)
5959 {
60− unsigned long flags;
61− struct call_struc *cs = (struct call_struc *) arg;
62−
63− spin_lock_irqsave(&divert_lock, flags);
64− del_timer(&cs->timer); /* delete active timer */
65− spin_unlock_irqrestore(&divert_lock, flags);
66−
67− switch(cs->akt_state)
68− { case DEFLECT_PROCEED:
69− cs->ics.command = ISDN_CMD_HANGUP; /* cancel action */
70− divert_if.ll_cmd(&cs->ics);
71− spin_lock_irqsave(&divert_lock, flags);
72− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
73− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
74− add_timer(&cs->timer);
75− spin_unlock_irqrestore(&divert_lock, flags);
76− break;
77−
78− case DEFLECT_ALERT:
79− cs->ics.command = ISDN_CMD_REDIR; /* protocol */
80− strlcpy(cs->ics.parm.setup.phone, cs->deflect_dest, sizeof(cs->ics.parm.setup.phone));
81− strcpy(cs->ics.parm.setup.eazmsn,"Testtext delayed");
82− divert_if.ll_cmd(&cs->ics);
83− spin_lock_irqsave(&divert_lock, flags);
84− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
85− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
86− add_timer(&cs->timer);
87− spin_unlock_irqrestore(&divert_lock, flags);
88− break;
89−
90− case DEFLECT_AUTODEL:
91− default:
92− spin_lock_irqsave(&divert_lock, flags);
93− if (cs->prev)
94− cs->prev->next = cs->next; /* forward link */
95− else
96− divert_head = cs->next;
97− if (cs->next)
98− cs->next->prev = cs->prev; /* back link */
99− spin_unlock_irqrestore(&divert_lock, flags);
100− kfree(cs);
101− return;
102−
103− } /* switch */
60+ unsigned long flags;
61+ struct call_struc *cs = (struct call_struc *) arg;
62+
63+ spin_lock_irqsave(&divert_lock, flags);
64+ del_timer(&cs->timer); /* delete active timer */
65+ spin_unlock_irqrestore(&divert_lock, flags);
66+
67+ switch (cs->akt_state)
68+ { case DEFLECT_PROCEED:
69+ cs->ics.command = ISDN_CMD_HANGUP; /* cancel action */
70+ divert_if.ll_cmd(&cs->ics);
71+ spin_lock_irqsave(&divert_lock, flags);
72+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
73+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
74+ add_timer(&cs->timer);
75+ spin_unlock_irqrestore(&divert_lock, flags);
76+ break;
77+
78+ case DEFLECT_ALERT:
79+ cs->ics.command = ISDN_CMD_REDIR; /* protocol */
80+ strlcpy(cs->ics.parm.setup.phone, cs->deflect_dest, sizeof(cs->ics.parm.setup.phone));
81+ strcpy(cs->ics.parm.setup.eazmsn, "Testtext delayed");
82+ divert_if.ll_cmd(&cs->ics);
83+ spin_lock_irqsave(&divert_lock, flags);
84+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
85+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
86+ add_timer(&cs->timer);
87+ spin_unlock_irqrestore(&divert_lock, flags);
88+ break;
89+
90+ case DEFLECT_AUTODEL:
91+ default:
92+ spin_lock_irqsave(&divert_lock, flags);
93+ if (cs->prev)
94+ cs->prev->next = cs->next; /* forward link */
95+ else
96+ divert_head = cs->next;
97+ if (cs->next)
98+ cs->next->prev = cs->prev; /* back link */
99+ spin_unlock_irqrestore(&divert_lock, flags);
100+ kfree(cs);
101+ return;
102+
103+ } /* switch */
104104 } /* deflect_timer_func */
105105
106106
@@ -108,94 +108,94 @@ static void deflect_timer_expire(ulong arg) · 1 unmodified line
108108 /* handle call forwarding de/activations */
109109 /* 0 = deact, 1 = act, 2 = interrogate */
110110 /*****************************************/
111−int cf_command(int drvid, int mode,
112− u_char proc, char *msn,
113− u_char service, char *fwd_nr, ulong *procid)
111+int cf_command(int drvid, int mode,
112+ u_char proc, char *msn,
113+ u_char service, char *fwd_nr, ulong *procid)
114114 { unsigned long flags;
115− int retval,msnlen;
116− int fwd_len;
117− char *p,*ielenp,tmp[60];
118− struct call_struc *cs;
119−
120− if (strchr(msn,'.')) return(-EINVAL); /* subaddress not allowed in msn */
121− if ((proc & 0x7F) > 2) return(-EINVAL);
122− proc &= 3;
123− p = tmp;
124− *p++ = 0x30; /* enumeration */
125− ielenp = p++; /* remember total length position */
126− *p++ = 0xa; /* proc tag */
127− *p++ = 1; /* length */
128− *p++ = proc & 0x7F; /* procedure to de/activate/interrogate */
129− *p++ = 0xa; /* service tag */
130− *p++ = 1; /* length */
131− *p++ = service; /* service to handle */
132−
133− if (mode == 1)
134− { if (!*fwd_nr) return(-EINVAL); /* destination missing */
135− if (strchr(fwd_nr,'.')) return(-EINVAL); /* subaddress not allowed */
136− fwd_len = strlen(fwd_nr);
137− *p++ = 0x30; /* number enumeration */
138− *p++ = fwd_len + 2; /* complete forward to len */
139− *p++ = 0x80; /* fwd to nr */
140− *p++ = fwd_len; /* length of number */
141− strcpy(p,fwd_nr); /* copy number */
142− p += fwd_len; /* pointer beyond fwd */
143− } /* activate */
144−
145− msnlen = strlen(msn);
146− *p++ = 0x80; /* msn number */
147− if (msnlen > 1)
148− { *p++ = msnlen; /* length */
149− strcpy(p,msn);
150− p += msnlen;
151− }
152− else *p++ = 0;
153−
154− *ielenp = p - ielenp - 1; /* set total IE length */
155−
156− /* allocate mem for information struct */
157− if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
158− return(-ENOMEM); /* no memory */
159− init_timer(&cs->timer);
160− cs->info[0] = '\0';
161− cs->timer.function = deflect_timer_expire;
162− cs->timer.data = (ulong) cs; /* pointer to own structure */
163− cs->ics.driver = drvid;
164− cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */
165− cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */
166− cs->ics.parm.dss1_io.proc = (mode == 1) ? 7: (mode == 2) ? 11:8; /* operation */
167− cs->ics.parm.dss1_io.timeout = 4000; /* from ETS 300 207-1 */
168− cs->ics.parm.dss1_io.datalen = p - tmp; /* total len */
169− cs->ics.parm.dss1_io.data = tmp; /* start of buffer */
170−
171− spin_lock_irqsave(&divert_lock, flags);
172− cs->ics.parm.dss1_io.ll_id = next_id++; /* id for callback */
173− spin_unlock_irqrestore(&divert_lock, flags);
174− *procid = cs->ics.parm.dss1_io.ll_id;
175−
176− sprintf(cs->info,"%d 0x%lx %s%s 0 %s %02x %d%s%s\n",
177− (!mode ) ? DIVERT_DEACTIVATE : (mode == 1) ? DIVERT_ACTIVATE : DIVERT_REPORT,
178− cs->ics.parm.dss1_io.ll_id,
179− (mode != 2) ? "" : "0 ",
180− divert_if.drv_to_name(cs->ics.driver),
181− msn,
182− service & 0xFF,
183− proc,
184− (mode != 1) ? "" : " 0 ",
185− (mode != 1) ? "" : fwd_nr);
186−
187− retval = divert_if.ll_cmd(&cs->ics); /* execute command */
188−
189− if (!retval)
190− { cs->prev = NULL;
191− spin_lock_irqsave(&divert_lock, flags);
192− cs->next = divert_head;
193− divert_head = cs;
194− spin_unlock_irqrestore(&divert_lock, flags);
195− }
196− else
197− kfree(cs);
198− return(retval);
115+ int retval, msnlen;
116+ int fwd_len;
117+ char *p, *ielenp, tmp[60];
118+ struct call_struc *cs;
119+
120+ if (strchr(msn, '.')) return (-EINVAL); /* subaddress not allowed in msn */
121+ if ((proc & 0x7F) > 2) return (-EINVAL);
122+ proc &= 3;
123+ p = tmp;
124+ *p++ = 0x30; /* enumeration */
125+ ielenp = p++; /* remember total length position */
126+ *p++ = 0xa; /* proc tag */
127+ *p++ = 1; /* length */
128+ *p++ = proc & 0x7F; /* procedure to de/activate/interrogate */
129+ *p++ = 0xa; /* service tag */
130+ *p++ = 1; /* length */
131+ *p++ = service; /* service to handle */
132+
133+ if (mode == 1)
134+ { if (!*fwd_nr) return (-EINVAL); /* destination missing */
135+ if (strchr(fwd_nr, '.')) return (-EINVAL); /* subaddress not allowed */
136+ fwd_len = strlen(fwd_nr);
137+ *p++ = 0x30; /* number enumeration */
138+ *p++ = fwd_len + 2; /* complete forward to len */
139+ *p++ = 0x80; /* fwd to nr */
140+ *p++ = fwd_len; /* length of number */
141+ strcpy(p, fwd_nr); /* copy number */
142+ p += fwd_len; /* pointer beyond fwd */
143+ } /* activate */
144+
145+ msnlen = strlen(msn);
146+ *p++ = 0x80; /* msn number */
147+ if (msnlen > 1)
148+ { *p++ = msnlen; /* length */
149+ strcpy(p, msn);
150+ p += msnlen;
151+ }
152+ else *p++ = 0;
153+
154+ *ielenp = p - ielenp - 1; /* set total IE length */
155+
156+ /* allocate mem for information struct */
157+ if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
158+ return (-ENOMEM); /* no memory */
159+ init_timer(&cs->timer);
160+ cs->info[0] = '\0';
161+ cs->timer.function = deflect_timer_expire;
162+ cs->timer.data = (ulong) cs; /* pointer to own structure */
163+ cs->ics.driver = drvid;
164+ cs->ics.command = ISDN_CMD_PROT_IO; /* protocol specific io */
165+ cs->ics.arg = DSS1_CMD_INVOKE; /* invoke supplementary service */
166+ cs->ics.parm.dss1_io.proc = (mode == 1) ? 7 : (mode == 2) ? 11 : 8; /* operation */
167+ cs->ics.parm.dss1_io.timeout = 4000; /* from ETS 300 207-1 */
168+ cs->ics.parm.dss1_io.datalen = p - tmp; /* total len */
169+ cs->ics.parm.dss1_io.data = tmp; /* start of buffer */
170+
171+ spin_lock_irqsave(&divert_lock, flags);
172+ cs->ics.parm.dss1_io.ll_id = next_id++; /* id for callback */
173+ spin_unlock_irqrestore(&divert_lock, flags);
174+ *procid = cs->ics.parm.dss1_io.ll_id;
175+
176+ sprintf(cs->info, "%d 0x%lx %s%s 0 %s %02x %d%s%s\n",
177+ (!mode) ? DIVERT_DEACTIVATE : (mode == 1) ? DIVERT_ACTIVATE : DIVERT_REPORT,
178+ cs->ics.parm.dss1_io.ll_id,
179+ (mode != 2) ? "" : "0 ",
180+ divert_if.drv_to_name(cs->ics.driver),
181+ msn,
182+ service & 0xFF,
183+ proc,
184+ (mode != 1) ? "" : " 0 ",
185+ (mode != 1) ? "" : fwd_nr);
186+
187+ retval = divert_if.ll_cmd(&cs->ics); /* execute command */
188+
189+ if (!retval)
190+ { cs->prev = NULL;
191+ spin_lock_irqsave(&divert_lock, flags);
192+ cs->next = divert_head;
193+ divert_head = cs;
194+ spin_unlock_irqrestore(&divert_lock, flags);
195+ }
196+ else
197+ kfree(cs);
198+ return (retval);
199199 } /* cf_command */
200200
201201
@@ -204,165 +204,165 @@ int cf_command(int drvid, int mode, · 2 unmodified lines
204204 /****************************************/
205205 int deflect_extern_action(u_char cmd, ulong callid, char *to_nr)
206206 { struct call_struc *cs;
207− isdn_ctrl ic;
208− unsigned long flags;
209− int i;
210−
211− if ((cmd & 0x7F) > 2) return(-EINVAL); /* invalid command */
212− cs = divert_head; /* start of parameter list */
213− while (cs)
214− { if (cs->divert_id == callid) break; /* found */
215− cs = cs->next;
216− } /* search entry */
217− if (!cs) return(-EINVAL); /* invalid callid */
218−
219− ic.driver = cs->ics.driver;
220− ic.arg = cs->ics.arg;
221− i = -EINVAL;
222− if (cs->akt_state == DEFLECT_AUTODEL) return(i); /* no valid call */
223− switch (cmd & 0x7F)
224− { case 0: /* hangup */
225− del_timer(&cs->timer);
226− ic.command = ISDN_CMD_HANGUP;
227− i = divert_if.ll_cmd(&ic);
228− spin_lock_irqsave(&divert_lock, flags);
229− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
230− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
231− add_timer(&cs->timer);
232− spin_unlock_irqrestore(&divert_lock, flags);
233− break;
234−
235− case 1: /* alert */
236− if (cs->akt_state == DEFLECT_ALERT) return(0);
237− cmd &= 0x7F; /* never wait */
238− del_timer(&cs->timer);
239− ic.command = ISDN_CMD_ALERT;
240− if ((i = divert_if.ll_cmd(&ic)))
241− {
242− spin_lock_irqsave(&divert_lock, flags);
243− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
244− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
245− add_timer(&cs->timer);
246− spin_unlock_irqrestore(&divert_lock, flags);
247− }
248− else
249− cs->akt_state = DEFLECT_ALERT;
250− break;
251−
252− case 2: /* redir */
253− del_timer(&cs->timer);
254− strlcpy(cs->ics.parm.setup.phone, to_nr, sizeof(cs->ics.parm.setup.phone));
255− strcpy(cs->ics.parm.setup.eazmsn, "Testtext manual");
256− ic.command = ISDN_CMD_REDIR;
257− if ((i = divert_if.ll_cmd(&ic)))
258− {
259− spin_lock_irqsave(&divert_lock, flags);
260− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
261− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
262− add_timer(&cs->timer);
263− spin_unlock_irqrestore(&divert_lock, flags);
264− }
265− else
266− cs->akt_state = DEFLECT_ALERT;
267− break;
268−
269− } /* switch */
270− return(i);
207+ isdn_ctrl ic;
208+ unsigned long flags;
209+ int i;
210+
211+ if ((cmd & 0x7F) > 2) return (-EINVAL); /* invalid command */
212+ cs = divert_head; /* start of parameter list */
213+ while (cs)
214+ { if (cs->divert_id == callid) break; /* found */
215+ cs = cs->next;
216+ } /* search entry */
217+ if (!cs) return (-EINVAL); /* invalid callid */
218+
219+ ic.driver = cs->ics.driver;
220+ ic.arg = cs->ics.arg;
221+ i = -EINVAL;
222+ if (cs->akt_state == DEFLECT_AUTODEL) return (i); /* no valid call */
223+ switch (cmd & 0x7F)
224+ { case 0: /* hangup */
225+ del_timer(&cs->timer);
226+ ic.command = ISDN_CMD_HANGUP;
227+ i = divert_if.ll_cmd(&ic);
228+ spin_lock_irqsave(&divert_lock, flags);
229+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
230+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
231+ add_timer(&cs->timer);
232+ spin_unlock_irqrestore(&divert_lock, flags);
233+ break;
234+
235+ case 1: /* alert */
236+ if (cs->akt_state == DEFLECT_ALERT) return (0);
237+ cmd &= 0x7F; /* never wait */
238+ del_timer(&cs->timer);
239+ ic.command = ISDN_CMD_ALERT;
240+ if ((i = divert_if.ll_cmd(&ic)))
241+ {
242+ spin_lock_irqsave(&divert_lock, flags);
243+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
244+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
245+ add_timer(&cs->timer);
246+ spin_unlock_irqrestore(&divert_lock, flags);
247+ }
248+ else
249+ cs->akt_state = DEFLECT_ALERT;
250+ break;
251+
252+ case 2: /* redir */
253+ del_timer(&cs->timer);
254+ strlcpy(cs->ics.parm.setup.phone, to_nr, sizeof(cs->ics.parm.setup.phone));
255+ strcpy(cs->ics.parm.setup.eazmsn, "Testtext manual");
256+ ic.command = ISDN_CMD_REDIR;
257+ if ((i = divert_if.ll_cmd(&ic)))
258+ {
259+ spin_lock_irqsave(&divert_lock, flags);
260+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
261+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
262+ add_timer(&cs->timer);
263+ spin_unlock_irqrestore(&divert_lock, flags);
264+ }
265+ else
266+ cs->akt_state = DEFLECT_ALERT;
267+ break;
268+
269+ } /* switch */
270+ return (i);
271271 } /* deflect_extern_action */
272272
273273 /********************************/
274274 /* insert a new rule before idx */
275275 /********************************/
276276 int insertrule(int idx, divert_rule *newrule)
277−{ struct deflect_struc *ds,*ds1=NULL;
278− unsigned long flags;
279−
280− if (!(ds = kmalloc(sizeof(struct deflect_struc),
281− GFP_KERNEL)))
282− return(-ENOMEM); /* no memory */
283−
284− ds->rule = *newrule; /* set rule */
285−
286− spin_lock_irqsave(&divert_lock, flags);
287−
288− if (idx >= 0)
289− { ds1 = table_head;
290− while ((ds1) && (idx > 0))
291− { idx--;
292− ds1 = ds1->next;
293− }
294− if (!ds1) idx = -1;
295− }
296−
297− if (idx < 0)
298− { ds->prev = table_tail; /* previous entry */
299− ds->next = NULL; /* end of chain */
300− if (ds->prev)
301− ds->prev->next = ds; /* last forward */
302− else
303− table_head = ds; /* is first entry */
304− table_tail = ds; /* end of queue */
305− }
306− else
307− { ds->next = ds1; /* next entry */
308− ds->prev = ds1->prev; /* prev entry */
309− ds1->prev = ds; /* backward chain old element */
310− if (!ds->prev)
311− table_head = ds; /* first element */
312− }
313−
314− spin_unlock_irqrestore(&divert_lock, flags);
315− return(0);
277+{ struct deflect_struc *ds, *ds1 = NULL;
278+ unsigned long flags;
279+
280+ if (!(ds = kmalloc(sizeof(struct deflect_struc),
281+ GFP_KERNEL)))
282+ return (-ENOMEM); /* no memory */
283+
284+ ds->rule = *newrule; /* set rule */
285+
286+ spin_lock_irqsave(&divert_lock, flags);
287+
288+ if (idx >= 0)
289+ { ds1 = table_head;
290+ while ((ds1) && (idx > 0))
291+ { idx--;
292+ ds1 = ds1->next;
293+ }
294+ if (!ds1) idx = -1;
295+ }
296+
297+ if (idx < 0)
298+ { ds->prev = table_tail; /* previous entry */
299+ ds->next = NULL; /* end of chain */
300+ if (ds->prev)
301+ ds->prev->next = ds; /* last forward */
302+ else
303+ table_head = ds; /* is first entry */
304+ table_tail = ds; /* end of queue */
305+ }
306+ else
307+ { ds->next = ds1; /* next entry */
308+ ds->prev = ds1->prev; /* prev entry */
309+ ds1->prev = ds; /* backward chain old element */
310+ if (!ds->prev)
311+ table_head = ds; /* first element */
312+ }
313+
314+ spin_unlock_irqrestore(&divert_lock, flags);
315+ return (0);
316316 } /* insertrule */
317317
318318 /***********************************/
319319 /* delete the rule at position idx */
320320 /***********************************/
321321 int deleterule(int idx)
322−{ struct deflect_struc *ds,*ds1;
323− unsigned long flags;
324−
325− if (idx < 0)
326− { spin_lock_irqsave(&divert_lock, flags);
327− ds = table_head;
328− table_head = NULL;
329− table_tail = NULL;
330− spin_unlock_irqrestore(&divert_lock, flags);
331− while (ds)
332− { ds1 = ds;
333− ds = ds->next;
334− kfree(ds1);
335− }
336− return(0);
337− }
338−
339− spin_lock_irqsave(&divert_lock, flags);
340− ds = table_head;
341−
342− while ((ds) && (idx > 0))
343− { idx--;
344− ds = ds->next;
345− }
346−
347− if (!ds)
348− {
349− spin_unlock_irqrestore(&divert_lock, flags);
350− return(-EINVAL);
351− }
352−
353− if (ds->next)
354− ds->next->prev = ds->prev; /* backward chain */
355− else
356− table_tail = ds->prev; /* end of chain */
357−
358− if (ds->prev)
359− ds->prev->next = ds->next; /* forward chain */
360− else
361− table_head = ds->next; /* start of chain */
362−
363− spin_unlock_irqrestore(&divert_lock, flags);
364− kfree(ds);
365− return(0);
322+{ struct deflect_struc *ds, *ds1;
323+ unsigned long flags;
324+
325+ if (idx < 0)
326+ { spin_lock_irqsave(&divert_lock, flags);
327+ ds = table_head;
328+ table_head = NULL;
329+ table_tail = NULL;
330+ spin_unlock_irqrestore(&divert_lock, flags);
331+ while (ds)
332+ { ds1 = ds;
333+ ds = ds->next;
334+ kfree(ds1);
335+ }
336+ return (0);
337+ }
338+
339+ spin_lock_irqsave(&divert_lock, flags);
340+ ds = table_head;
341+
342+ while ((ds) && (idx > 0))
343+ { idx--;
344+ ds = ds->next;
345+ }
346+
347+ if (!ds)
348+ {
349+ spin_unlock_irqrestore(&divert_lock, flags);
350+ return (-EINVAL);
351+ }
352+
353+ if (ds->next)
354+ ds->next->prev = ds->prev; /* backward chain */
355+ else
356+ table_tail = ds->prev; /* end of chain */
357+
358+ if (ds->prev)
359+ ds->prev->next = ds->next; /* forward chain */
360+ else
361+ table_head = ds->next; /* start of chain */
362+
363+ spin_unlock_irqrestore(&divert_lock, flags);
364+ kfree(ds);
365+ return (0);
366366 } /* deleterule */
367367
368368 /*******************************************/
@@ -370,16 +370,16 @@ int deleterule(int idx) · 1 unmodified line
370370 /*******************************************/
371371 divert_rule *getruleptr(int idx)
372372 { struct deflect_struc *ds = table_head;
373−
374− if (idx < 0) return(NULL);
375− while ((ds) && (idx >= 0))
376− { if (!(idx--))
377− { return(&ds->rule);
378− break;
379− }
380− ds = ds->next;
381− }
382− return(NULL);
373+
374+ if (idx < 0) return (NULL);
375+ while ((ds) && (idx >= 0))
376+ { if (!(idx--))
377+ { return (&ds->rule);
378+ break;
379+ }
380+ ds = ds->next;
381+ }
382+ return (NULL);
383383 } /* getruleptr */
384384
385385 /*************************************************/
@@ -387,168 +387,168 @@ divert_rule *getruleptr(int idx) · 1 unmodified line
387387 /*************************************************/
388388 static int isdn_divert_icall(isdn_ctrl *ic)
389389 { int retval = 0;
390− unsigned long flags;
391− struct call_struc *cs = NULL;
392− struct deflect_struc *dv;
393− char *p,*p1;
394− u_char accept;
395−
396− /* first check the internal deflection table */
397− for (dv = table_head; dv ; dv = dv->next )
398− { /* scan table */
399− if (((dv->rule.callopt == 1) && (ic->command == ISDN_STAT_ICALLW)) ||
400− ((dv->rule.callopt == 2) && (ic->command == ISDN_STAT_ICALL)))
401− continue; /* call option check */
402− if (!(dv->rule.drvid & (1L << ic->driver)))
403− continue; /* driver not matching */
404− if ((dv->rule.si1) && (dv->rule.si1 != ic->parm.setup.si1))
405− continue; /* si1 not matching */
406− if ((dv->rule.si2) && (dv->rule.si2 != ic->parm.setup.si2))
407− continue; /* si2 not matching */
408−
409− p = dv->rule.my_msn;
410− p1 = ic->parm.setup.eazmsn;
411− accept = 0;
412− while (*p)
413− { /* complete compare */
414− if (*p == '-')
415− { accept = 1; /* call accepted */
416− break;
417− }
418− if (*p++ != *p1++)
419− break; /* not accepted */
420− if ((!*p) && (!*p1))
421− accept = 1;
422− } /* complete compare */
423− if (!accept) continue; /* not accepted */
424−
425− if ((strcmp(dv->rule.caller,"0")) || (ic->parm.setup.phone[0]))
426− { p = dv->rule.caller;
427− p1 = ic->parm.setup.phone;
428− accept = 0;
429− while (*p)
430− { /* complete compare */
431− if (*p == '-')
432− { accept = 1; /* call accepted */
433− break;
434− }
435− if (*p++ != *p1++)
436− break; /* not accepted */
437− if ((!*p) && (!*p1))
438− accept = 1;
439− } /* complete compare */
440− if (!accept) continue; /* not accepted */
441− }
442−
443− switch (dv->rule.action)
444− { case DEFLECT_IGNORE:
445− return(0);
446− break;
447−
448− case DEFLECT_ALERT:
449− case DEFLECT_PROCEED:
450− case DEFLECT_REPORT:
451− case DEFLECT_REJECT:
452− if (dv->rule.action == DEFLECT_PROCEED)
453− if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
454− return(0); /* no external deflection needed */
455− if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
456− return(0); /* no memory */
457− init_timer(&cs->timer);
458− cs->info[0] = '\0';
459− cs->timer.function = deflect_timer_expire;
460− cs->timer.data = (ulong) cs; /* pointer to own structure */
461−
462− cs->ics = *ic; /* copy incoming data */
463− if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone,"0");
464− if (!cs->ics.parm.setup.eazmsn[0]) strcpy(cs->ics.parm.setup.eazmsn,"0");
465− cs->ics.parm.setup.screen = dv->rule.screen;
466− if (dv->rule.waittime)
467− cs->timer.expires = jiffies + (HZ * dv->rule.waittime);
468− else
469− if (dv->rule.action == DEFLECT_PROCEED)
470− cs->timer.expires = jiffies + (HZ * extern_wait_max);
471− else
472− cs->timer.expires = 0;
473− cs->akt_state = dv->rule.action;
474− spin_lock_irqsave(&divert_lock, flags);
475− cs->divert_id = next_id++; /* new sequence number */
476− spin_unlock_irqrestore(&divert_lock, flags);
477− cs->prev = NULL;
478− if (cs->akt_state == DEFLECT_ALERT)
479− { strcpy(cs->deflect_dest,dv->rule.to_nr);
480− if (!cs->timer.expires)
481− { strcpy(ic->parm.setup.eazmsn,"Testtext direct");
482− ic->parm.setup.screen = dv->rule.screen;
483− strlcpy(ic->parm.setup.phone, dv->rule.to_nr, sizeof(ic->parm.setup.phone));
484− cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
485− cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
486− retval = 5;
487− }
488− else
489− retval = 1; /* alerting */
490− }
491− else
492− { cs->deflect_dest[0] = '\0';
493− retval = 4; /* only proceed */
494− }
495− sprintf(cs->info,"%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
496− cs->akt_state,
497− cs->divert_id,
498− divert_if.drv_to_name(cs->ics.driver),
499− (ic->command == ISDN_STAT_ICALLW) ? "1":"0",
500− cs->ics.parm.setup.phone,
501− cs->ics.parm.setup.eazmsn,
502− cs->ics.parm.setup.si1,
503− cs->ics.parm.setup.si2,
504− cs->ics.parm.setup.screen,
505− dv->rule.waittime,
506− cs->deflect_dest);
507− if ((dv->rule.action == DEFLECT_REPORT) ||
508− (dv->rule.action == DEFLECT_REJECT))
509− { put_info_buffer(cs->info);
510− kfree(cs); /* remove */
511− return((dv->rule.action == DEFLECT_REPORT) ? 0:2); /* nothing to do */
512− }
513− break;
514−
515− default:
516− return(0); /* ignore call */
517− break;
518− } /* switch action */
519− break;
520− } /* scan_table */
521−
522− if (cs)
523− { cs->prev = NULL;
524− spin_lock_irqsave(&divert_lock, flags);
525− cs->next = divert_head;
526− divert_head = cs;
527− if (cs->timer.expires) add_timer(&cs->timer);
528− spin_unlock_irqrestore(&divert_lock, flags);
529−
530− put_info_buffer(cs->info);
531− return(retval);
532− }
533− else
534− return(0);
390+ unsigned long flags;
391+ struct call_struc *cs = NULL;
392+ struct deflect_struc *dv;
393+ char *p, *p1;
394+ u_char accept;
395+
396+ /* first check the internal deflection table */
397+ for (dv = table_head; dv; dv = dv->next)
398+ { /* scan table */
399+ if (((dv->rule.callopt == 1) && (ic->command == ISDN_STAT_ICALLW)) ||
400+ ((dv->rule.callopt == 2) && (ic->command == ISDN_STAT_ICALL)))
401+ continue; /* call option check */
402+ if (!(dv->rule.drvid & (1L << ic->driver)))
403+ continue; /* driver not matching */
404+ if ((dv->rule.si1) && (dv->rule.si1 != ic->parm.setup.si1))
405+ continue; /* si1 not matching */
406+ if ((dv->rule.si2) && (dv->rule.si2 != ic->parm.setup.si2))
407+ continue; /* si2 not matching */
408+
409+ p = dv->rule.my_msn;
410+ p1 = ic->parm.setup.eazmsn;
411+ accept = 0;
412+ while (*p)
413+ { /* complete compare */
414+ if (*p == '-')
415+ { accept = 1; /* call accepted */
416+ break;
417+ }
418+ if (*p++ != *p1++)
419+ break; /* not accepted */
420+ if ((!*p) && (!*p1))
421+ accept = 1;
422+ } /* complete compare */
423+ if (!accept) continue; /* not accepted */
424+
425+ if ((strcmp(dv->rule.caller, "0")) || (ic->parm.setup.phone[0]))
426+ { p = dv->rule.caller;
427+ p1 = ic->parm.setup.phone;
428+ accept = 0;
429+ while (*p)
430+ { /* complete compare */
431+ if (*p == '-')
432+ { accept = 1; /* call accepted */
433+ break;
434+ }
435+ if (*p++ != *p1++)
436+ break; /* not accepted */
437+ if ((!*p) && (!*p1))
438+ accept = 1;
439+ } /* complete compare */
440+ if (!accept) continue; /* not accepted */
441+ }
442+
443+ switch (dv->rule.action)
444+ { case DEFLECT_IGNORE:
445+ return (0);
446+ break;
447+
448+ case DEFLECT_ALERT:
449+ case DEFLECT_PROCEED:
450+ case DEFLECT_REPORT:
451+ case DEFLECT_REJECT:
452+ if (dv->rule.action == DEFLECT_PROCEED)
453+ if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime)))
454+ return (0); /* no external deflection needed */
455+ if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
456+ return (0); /* no memory */
457+ init_timer(&cs->timer);
458+ cs->info[0] = '\0';
459+ cs->timer.function = deflect_timer_expire;
460+ cs->timer.data = (ulong) cs; /* pointer to own structure */
461+
462+ cs->ics = *ic; /* copy incoming data */
463+ if (!cs->ics.parm.setup.phone[0]) strcpy(cs->ics.parm.setup.phone, "0");
464+ if (!cs->ics.parm.setup.eazmsn[0]) strcpy(cs->ics.parm.setup.eazmsn, "0");
465+ cs->ics.parm.setup.screen = dv->rule.screen;
466+ if (dv->rule.waittime)
467+ cs->timer.expires = jiffies + (HZ * dv->rule.waittime);
468+ else
469+ if (dv->rule.action == DEFLECT_PROCEED)
470+ cs->timer.expires = jiffies + (HZ * extern_wait_max);
471+ else
472+ cs->timer.expires = 0;
473+ cs->akt_state = dv->rule.action;
474+ spin_lock_irqsave(&divert_lock, flags);
475+ cs->divert_id = next_id++; /* new sequence number */
476+ spin_unlock_irqrestore(&divert_lock, flags);
477+ cs->prev = NULL;
478+ if (cs->akt_state == DEFLECT_ALERT)
479+ { strcpy(cs->deflect_dest, dv->rule.to_nr);
480+ if (!cs->timer.expires)
481+ { strcpy(ic->parm.setup.eazmsn, "Testtext direct");
482+ ic->parm.setup.screen = dv->rule.screen;
483+ strlcpy(ic->parm.setup.phone, dv->rule.to_nr, sizeof(ic->parm.setup.phone));
484+ cs->akt_state = DEFLECT_AUTODEL; /* delete after timeout */
485+ cs->timer.expires = jiffies + (HZ * AUTODEL_TIME);
486+ retval = 5;
487+ }
488+ else
489+ retval = 1; /* alerting */
490+ }
491+ else
492+ { cs->deflect_dest[0] = '\0';
493+ retval = 4; /* only proceed */
494+ }
495+ sprintf(cs->info, "%d 0x%lx %s %s %s %s 0x%x 0x%x %d %d %s\n",
496+ cs->akt_state,
497+ cs->divert_id,
498+ divert_if.drv_to_name(cs->ics.driver),
499+ (ic->command == ISDN_STAT_ICALLW) ? "1" : "0",
500+ cs->ics.parm.setup.phone,
501+ cs->ics.parm.setup.eazmsn,
502+ cs->ics.parm.setup.si1,
503+ cs->ics.parm.setup.si2,
504+ cs->ics.parm.setup.screen,
505+ dv->rule.waittime,
506+ cs->deflect_dest);
507+ if ((dv->rule.action == DEFLECT_REPORT) ||
508+ (dv->rule.action == DEFLECT_REJECT))
509+ { put_info_buffer(cs->info);
510+ kfree(cs); /* remove */
511+ return ((dv->rule.action == DEFLECT_REPORT) ? 0 : 2); /* nothing to do */
512+ }
513+ break;
514+
515+ default:
516+ return (0); /* ignore call */
517+ break;
518+ } /* switch action */
519+ break;
520+ } /* scan_table */
521+
522+ if (cs)
523+ { cs->prev = NULL;
524+ spin_lock_irqsave(&divert_lock, flags);
525+ cs->next = divert_head;
526+ divert_head = cs;
527+ if (cs->timer.expires) add_timer(&cs->timer);
528+ spin_unlock_irqrestore(&divert_lock, flags);
529+
530+ put_info_buffer(cs->info);
531+ return (retval);
532+ }
533+ else
534+ return (0);
535535 } /* isdn_divert_icall */
536536
537537
538538 void deleteprocs(void)
539−{ struct call_struc *cs, *cs1;
540− unsigned long flags;
541−
542− spin_lock_irqsave(&divert_lock, flags);
543− cs = divert_head;
544− divert_head = NULL;
545− while (cs)
546− { del_timer(&cs->timer);
547− cs1 = cs;
548− cs = cs->next;
549− kfree(cs1);
550− }
551− spin_unlock_irqrestore(&divert_lock, flags);
539+{ struct call_struc *cs, *cs1;
540+ unsigned long flags;
541+
542+ spin_lock_irqsave(&divert_lock, flags);
543+ cs = divert_head;
544+ divert_head = NULL;
545+ while (cs)
546+ { del_timer(&cs->timer);
547+ cs1 = cs;
548+ cs = cs->next;
549+ kfree(cs1);
550+ }
551+ spin_unlock_irqrestore(&divert_lock, flags);
552552 } /* deleteprocs */
553553
554554 /****************************************************/
@@ -556,42 +556,42 @@ void deleteprocs(void) · 1 unmodified line
556556 /****************************************************/
557557 static int put_address(char *st, u_char *p, int len)
558558 { u_char retval = 0;
559− u_char adr_typ = 0; /* network standard */
560−
561− if (len < 2) return(retval);
562− if (*p == 0xA1)
563− { retval = *(++p) + 2; /* total length */
564− if (retval > len) return(0); /* too short */
565− len = retval - 2; /* remaining length */
566− if (len < 3) return(0);
567− if ((*(++p) != 0x0A) || (*(++p) != 1)) return(0);
568− adr_typ = *(++p);
569− len -= 3;
570− p++;
571− if (len < 2) return(0);
572− if (*p++ != 0x12) return(0);
573− if (*p > len) return(0); /* check number length */
574− len = *p++;
575− }
576− else
577− if (*p == 0x80)
578− { retval = *(++p) + 2; /* total length */
579− if (retval > len) return(0);
580− len = retval - 2;
581− p++;
582− }
583− else
584− return(0); /* invalid address information */
585−
586− sprintf(st,"%d ",adr_typ);
587− st += strlen(st);
588− if (!len)
589− *st++ = '-';
590− else
591− while (len--)
592− *st++ = *p++;
593− *st = '\0';
594− return(retval);
559+ u_char adr_typ = 0; /* network standard */
560+
561+ if (len < 2) return (retval);
562+ if (*p == 0xA1)
563+ { retval = *(++p) + 2; /* total length */
564+ if (retval > len) return (0); /* too short */
565+ len = retval - 2; /* remaining length */
566+ if (len < 3) return (0);
567+ if ((*(++p) != 0x0A) || (*(++p) != 1)) return (0);
568+ adr_typ = *(++p);
569+ len -= 3;
570+ p++;
571+ if (len < 2) return (0);
572+ if (*p++ != 0x12) return (0);
573+ if (*p > len) return (0); /* check number length */
574+ len = *p++;
575+ }
576+ else
577+ if (*p == 0x80)
578+ { retval = *(++p) + 2; /* total length */
579+ if (retval > len) return (0);
580+ len = retval - 2;
581+ p++;
582+ }
583+ else
584+ return (0); /* invalid address information */
585+
586+ sprintf(st, "%d ", adr_typ);
587+ st += strlen(st);
588+ if (!len)
589+ *st++ = '-';
590+ else
591+ while (len--)
592+ *st++ = *p++;
593+ *st = '\0';
594+ return (retval);
595595 } /* put_address */
596596
597597 /*************************************/
@@ -599,93 +599,93 @@ static int put_address(char *st, u_char *p, int len) · 1 unmodified line
599599 /*************************************/
600600 static int interrogate_success(isdn_ctrl *ic, struct call_struc *cs)
601601 { char *src = ic->parm.dss1_io.data;
602− int restlen = ic->parm.dss1_io.datalen;
603− int cnt = 1;
604− u_char n,n1;
605− char st[90], *p, *stp;
606−
607− if (restlen < 2) return(-100); /* frame too short */
608− if (*src++ != 0x30) return(-101);
609− if ((n = *src++) > 0x81) return(-102); /* invalid length field */
610− restlen -= 2; /* remaining bytes */
611− if (n == 0x80)
612− { if (restlen < 2) return(-103);
613− if ((*(src+restlen-1)) || (*(src+restlen-2))) return(-104);
614− restlen -= 2;
615− }
616− else
617− if ( n == 0x81)
618− { n = *src++;
619− restlen--;
620− if (n > restlen) return(-105);
621− restlen = n;
622− }
623− else
624− if (n > restlen) return(-106);
625− else
626− restlen = n; /* standard format */
627− if (restlen < 3) return(-107); /* no procedure */
628− if ((*src++ != 2) || (*src++ != 1) || (*src++ != 0x0B)) return(-108);
629− restlen -= 3;
630− if (restlen < 2) return(-109); /* list missing */
631− if (*src == 0x31)
632− { src++;
633− if ((n = *src++) > 0x81) return(-110); /* invalid length field */
634− restlen -= 2; /* remaining bytes */
635− if (n == 0x80)
636− { if (restlen < 2) return(-111);
637− if ((*(src+restlen-1)) || (*(src+restlen-2))) return(-112);
638− restlen -= 2;
639− }
640− else
641− if ( n == 0x81)
642− { n = *src++;
643− restlen--;
644− if (n > restlen) return(-113);
645− restlen = n;
646− }
647− else
648− if (n > restlen) return(-114);
649− else
650− restlen = n; /* standard format */
651− } /* result list header */
652−
653− while (restlen >= 2)
654− { stp = st;
655− sprintf(stp,"%d 0x%lx %d %s ",DIVERT_REPORT, ic->parm.dss1_io.ll_id,
656− cnt++,divert_if.drv_to_name(ic->driver));
657− stp += strlen(stp);
658− if (*src++ != 0x30) return(-115); /* invalid enum */
659− n = *src++;
660− restlen -= 2;
661− if (n > restlen) return(-116); /* enum length wrong */
662− restlen -= n;
663− p = src; /* one entry */
664− src += n;
665− if (!(n1 = put_address(stp,p,n & 0xFF))) continue;
666− stp += strlen(stp);
667− p += n1;
668− n -= n1;
669− if (n < 6) continue; /* no service and proc */
670− if ((*p++ != 0x0A) || (*p++ != 1)) continue;
671− sprintf(stp," 0x%02x ",(*p++) & 0xFF);
672− stp += strlen(stp);
673− if ((*p++ != 0x0A) || (*p++ != 1)) continue;
674− sprintf(stp,"%d ",(*p++) & 0xFF);
675− stp += strlen(stp);
676− n -= 6;
677− if (n > 2)
678− { if (*p++ != 0x30) continue;
679− if (*p > (n-2)) continue;
680− n = *p++;
681− if (!(n1 = put_address(stp,p,n & 0xFF))) continue;
682− stp += strlen(stp);
683− }
684− sprintf(stp,"\n");
685− put_info_buffer(st);
686− } /* while restlen */
687− if (restlen) return(-117);
688− return(0);
602+ int restlen = ic->parm.dss1_io.datalen;
603+ int cnt = 1;
604+ u_char n, n1;
605+ char st[90], *p, *stp;
606+
607+ if (restlen < 2) return (-100); /* frame too short */
608+ if (*src++ != 0x30) return (-101);
609+ if ((n = *src++) > 0x81) return (-102); /* invalid length field */
610+ restlen -= 2; /* remaining bytes */
611+ if (n == 0x80)
612+ { if (restlen < 2) return (-103);
613+ if ((*(src + restlen - 1)) || (*(src + restlen - 2))) return (-104);
614+ restlen -= 2;
615+ }
616+ else
617+ if (n == 0x81)
618+ { n = *src++;
619+ restlen--;
620+ if (n > restlen) return (-105);
621+ restlen = n;
622+ }
623+ else
624+ if (n > restlen) return (-106);
625+ else
626+ restlen = n; /* standard format */
627+ if (restlen < 3) return (-107); /* no procedure */
628+ if ((*src++ != 2) || (*src++ != 1) || (*src++ != 0x0B)) return (-108);
629+ restlen -= 3;
630+ if (restlen < 2) return (-109); /* list missing */
631+ if (*src == 0x31)
632+ { src++;
633+ if ((n = *src++) > 0x81) return (-110); /* invalid length field */
634+ restlen -= 2; /* remaining bytes */
635+ if (n == 0x80)
636+ { if (restlen < 2) return (-111);
637+ if ((*(src + restlen - 1)) || (*(src + restlen - 2))) return (-112);
638+ restlen -= 2;
639+ }
640+ else
641+ if (n == 0x81)
642+ { n = *src++;
643+ restlen--;
644+ if (n > restlen) return (-113);
645+ restlen = n;
646+ }
647+ else
648+ if (n > restlen) return (-114);
649+ else
650+ restlen = n; /* standard format */
651+ } /* result list header */
652+
653+ while (restlen >= 2)
654+ { stp = st;
655+ sprintf(stp, "%d 0x%lx %d %s ", DIVERT_REPORT, ic->parm.dss1_io.ll_id,
656+ cnt++, divert_if.drv_to_name(ic->driver));
657+ stp += strlen(stp);
658+ if (*src++ != 0x30) return (-115); /* invalid enum */
659+ n = *src++;
660+ restlen -= 2;
661+ if (n > restlen) return (-116); /* enum length wrong */
662+ restlen -= n;
663+ p = src; /* one entry */
664+ src += n;
665+ if (!(n1 = put_address(stp, p, n & 0xFF))) continue;
666+ stp += strlen(stp);
667+ p += n1;
668+ n -= n1;
669+ if (n < 6) continue; /* no service and proc */
670+ if ((*p++ != 0x0A) || (*p++ != 1)) continue;
671+ sprintf(stp, " 0x%02x ", (*p++) & 0xFF);
672+ stp += strlen(stp);
673+ if ((*p++ != 0x0A) || (*p++ != 1)) continue;
674+ sprintf(stp, "%d ", (*p++) & 0xFF);
675+ stp += strlen(stp);
676+ n -= 6;
677+ if (n > 2)
678+ { if (*p++ != 0x30) continue;
679+ if (*p > (n - 2)) continue;
680+ n = *p++;
681+ if (!(n1 = put_address(stp, p, n & 0xFF))) continue;
682+ stp += strlen(stp);
683+ }
684+ sprintf(stp, "\n");
685+ put_info_buffer(st);
686+ } /* while restlen */
687+ if (restlen) return (-117);
688+ return (0);
689689 } /* interrogate_success */
690690
691691 /*********************************************/
@@ -693,90 +693,90 @@ static int interrogate_success(isdn_ctrl *ic, struct call_struc *cs) · 1 unmodified line
693693 /*********************************************/
694694 static int prot_stat_callback(isdn_ctrl *ic)
695695 { struct call_struc *cs, *cs1;
696− int i;
697− unsigned long flags;
698−
699− cs = divert_head; /* start of list */
700− cs1 = NULL;
701− while (cs)
702− { if (ic->driver == cs->ics.driver)
703− { switch (cs->ics.arg)
704− { case DSS1_CMD_INVOKE:
705− if ((cs->ics.parm.dss1_io.ll_id == ic->parm.dss1_io.ll_id) &&
706− (cs->ics.parm.dss1_io.hl_id == ic->parm.dss1_io.hl_id))
707− { switch (ic->arg)
708− { case DSS1_STAT_INVOKE_ERR:
709− sprintf(cs->info,"128 0x%lx 0x%x\n",
710− ic->parm.dss1_io.ll_id,
711− ic->parm.dss1_io.timeout);
712− put_info_buffer(cs->info);
713− break;
714−
715− case DSS1_STAT_INVOKE_RES:
716− switch (cs->ics.parm.dss1_io.proc)
717− { case 7:
718− case 8:
719− put_info_buffer(cs->info);
720− break;
721−
722− case 11:
723− i = interrogate_success(ic,cs);
724− if (i)
725− sprintf(cs->info,"%d 0x%lx %d\n",DIVERT_REPORT,
726− ic->parm.dss1_io.ll_id,i);
727− put_info_buffer(cs->info);
728− break;
729−
730− default:
731− printk(KERN_WARNING "dss1_divert: unknown proc %d\n",cs->ics.parm.dss1_io.proc);
732− break;
733− }
734−
735−
736− break;
737−
738− default:
739− printk(KERN_WARNING "dss1_divert unknown invoke answer %lx\n",ic->arg);
740− break;
741− }
742− cs1 = cs; /* remember structure */
743− cs = NULL;
744− continue; /* abort search */
745− } /* id found */
746− break;
747−
748− case DSS1_CMD_INVOKE_ABORT:
749− printk(KERN_WARNING "dss1_divert unhandled invoke abort\n");
750− break;
751−
752− default:
753− printk(KERN_WARNING "dss1_divert unknown cmd 0x%lx\n",cs->ics.arg);
754− break;
755− } /* switch ics.arg */
756− cs = cs->next;
757− } /* driver ok */
758− }
759−
760− if (!cs1)
761− { printk(KERN_WARNING "dss1_divert unhandled process\n");
762− return(0);
763− }
764−
765− if (cs1->ics.driver == -1)
766− {
767− spin_lock_irqsave(&divert_lock, flags);
768− del_timer(&cs1->timer);
769− if (cs1->prev)
770− cs1->prev->next = cs1->next; /* forward link */
771− else
772− divert_head = cs1->next;
773− if (cs1->next)
774− cs1->next->prev = cs1->prev; /* back link */
775− spin_unlock_irqrestore(&divert_lock, flags);
776− kfree(cs1);
777− }
778−
779− return(0);
696+ int i;
697+ unsigned long flags;
698+
699+ cs = divert_head; /* start of list */
700+ cs1 = NULL;
701+ while (cs)
702+ { if (ic->driver == cs->ics.driver)
703+ { switch (cs->ics.arg)
704+ { case DSS1_CMD_INVOKE:
705+ if ((cs->ics.parm.dss1_io.ll_id == ic->parm.dss1_io.ll_id) &&
706+ (cs->ics.parm.dss1_io.hl_id == ic->parm.dss1_io.hl_id))
707+ { switch (ic->arg)
708+ { case DSS1_STAT_INVOKE_ERR:
709+ sprintf(cs->info, "128 0x%lx 0x%x\n",
710+ ic->parm.dss1_io.ll_id,
711+ ic->parm.dss1_io.timeout);
712+ put_info_buffer(cs->info);
713+ break;
714+
715+ case DSS1_STAT_INVOKE_RES:
716+ switch (cs->ics.parm.dss1_io.proc)
717+ { case 7:
718+ case 8:
719+ put_info_buffer(cs->info);
720+ break;
721+
722+ case 11:
723+ i = interrogate_success(ic, cs);
724+ if (i)
725+ sprintf(cs->info, "%d 0x%lx %d\n", DIVERT_REPORT,
726+ ic->parm.dss1_io.ll_id, i);
727+ put_info_buffer(cs->info);
728+ break;
729+
730+ default:
731+ printk(KERN_WARNING "dss1_divert: unknown proc %d\n", cs->ics.parm.dss1_io.proc);
732+ break;
733+ }
734+
735+
736+ break;
737+
738+ default:
739+ printk(KERN_WARNING "dss1_divert unknown invoke answer %lx\n", ic->arg);
740+ break;
741+ }
742+ cs1 = cs; /* remember structure */
743+ cs = NULL;
744+ continue; /* abort search */
745+ } /* id found */
746+ break;
747+
748+ case DSS1_CMD_INVOKE_ABORT:
749+ printk(KERN_WARNING "dss1_divert unhandled invoke abort\n");
750+ break;
751+
752+ default:
753+ printk(KERN_WARNING "dss1_divert unknown cmd 0x%lx\n", cs->ics.arg);
754+ break;
755+ } /* switch ics.arg */
756+ cs = cs->next;
757+ } /* driver ok */
758+ }
759+
760+ if (!cs1)
761+ { printk(KERN_WARNING "dss1_divert unhandled process\n");
762+ return (0);
763+ }
764+
765+ if (cs1->ics.driver == -1)
766+ {
767+ spin_lock_irqsave(&divert_lock, flags);
768+ del_timer(&cs1->timer);
769+ if (cs1->prev)
770+ cs1->prev->next = cs1->next; /* forward link */
771+ else
772+ divert_head = cs1->next;
773+ if (cs1->next)
774+ cs1->next->prev = cs1->prev; /* back link */
775+ spin_unlock_irqrestore(&divert_lock, flags);
776+ kfree(cs1);
777+ }
778+
779+ return (0);
780780 } /* prot_stat_callback */
781781
782782
@@ -785,79 +785,78 @@ static int prot_stat_callback(isdn_ctrl *ic) · 2 unmodified lines
785785 /***************************/
786786 static int isdn_divert_stat_callback(isdn_ctrl *ic)
787787 { struct call_struc *cs, *cs1;
788− unsigned long flags;
789− int retval;
790−
791− retval = -1;
792− cs = divert_head; /* start of list */
793− while (cs)
794− { if ((ic->driver == cs->ics.driver) && (ic->arg == cs->ics.arg))
795− { switch (ic->command)
796− { case ISDN_STAT_DHUP:
797− sprintf(cs->info,"129 0x%lx\n",cs->divert_id);
798− del_timer(&cs->timer);
799− cs->ics.driver = -1;
800− break;
801−
802− case ISDN_STAT_CAUSE:
803− sprintf(cs->info,"130 0x%lx %s\n",cs->divert_id,ic->parm.num);
804− break;
805−
806− case ISDN_STAT_REDIR:
807− sprintf(cs->info,"131 0x%lx\n",cs->divert_id);
808− del_timer(&cs->timer);
809− cs->ics.driver = -1;
810− break;
811−
812− default:
813− sprintf(cs->info,"999 0x%lx 0x%x\n",cs->divert_id,(int)(ic->command));
814− break;
815− }
816− put_info_buffer(cs->info);
817− retval = 0;
818− }
819− cs1 = cs;
820− cs = cs->next;
821− if (cs1->ics.driver == -1)
822− {
823− spin_lock_irqsave(&divert_lock, flags);
824− if (cs1->prev)
825− cs1->prev->next = cs1->next; /* forward link */
826− else
827− divert_head = cs1->next;
828− if (cs1->next)
829− cs1->next->prev = cs1->prev; /* back link */
830− spin_unlock_irqrestore(&divert_lock, flags);
831− kfree(cs1);
832− }
833− }
834− return(retval); /* not found */
835−} /* isdn_divert_stat_callback */
788+ unsigned long flags;
789+ int retval;
790+
791+ retval = -1;
792+ cs = divert_head; /* start of list */
793+ while (cs)
794+ { if ((ic->driver == cs->ics.driver) && (ic->arg == cs->ics.arg))
795+ { switch (ic->command)
796+ { case ISDN_STAT_DHUP:
797+ sprintf(cs->info, "129 0x%lx\n", cs->divert_id);
798+ del_timer(&cs->timer);
799+ cs->ics.driver = -1;
800+ break;
801+
802+ case ISDN_STAT_CAUSE:
803+ sprintf(cs->info, "130 0x%lx %s\n", cs->divert_id, ic->parm.num);
804+ break;
805+
806+ case ISDN_STAT_REDIR:
807+ sprintf(cs->info, "131 0x%lx\n", cs->divert_id);
808+ del_timer(&cs->timer);
809+ cs->ics.driver = -1;
810+ break;
811+
812+ default:
813+ sprintf(cs->info, "999 0x%lx 0x%x\n", cs->divert_id, (int)(ic->command));
814+ break;
815+ }
816+ put_info_buffer(cs->info);
817+ retval = 0;
818+ }
819+ cs1 = cs;
820+ cs = cs->next;
821+ if (cs1->ics.driver == -1)
822+ {
823+ spin_lock_irqsave(&divert_lock, flags);
824+ if (cs1->prev)
825+ cs1->prev->next = cs1->next; /* forward link */
826+ else
827+ divert_head = cs1->next;
828+ if (cs1->next)
829+ cs1->next->prev = cs1->prev; /* back link */
830+ spin_unlock_irqrestore(&divert_lock, flags);
831+ kfree(cs1);
832+ }
833+ }
834+ return (retval); /* not found */
835+} /* isdn_divert_stat_callback */
836836
837837
838838 /********************/
839839 /* callback from ll */
840−/********************/
840+/********************/
841841 int ll_callback(isdn_ctrl *ic)
842842 {
843− switch (ic->command)
844− { case ISDN_STAT_ICALL:
845− case ISDN_STAT_ICALLW:
846− return(isdn_divert_icall(ic));
847− break;
848−
849− case ISDN_STAT_PROT:
850− if ((ic->arg & 0xFF) == ISDN_PTYPE_EURO)
851− { if (ic->arg != DSS1_STAT_INVOKE_BRD)
852− return(prot_stat_callback(ic));
853− else
854− return(0); /* DSS1 invoke broadcast */
855− }
856− else
857− return(-1); /* protocol not euro */
858−
859− default:
860− return(isdn_divert_stat_callback(ic));
861− }
843+ switch (ic->command)
844+ { case ISDN_STAT_ICALL:
845+ case ISDN_STAT_ICALLW:
846+ return (isdn_divert_icall(ic));
847+ break;
848+
849+ case ISDN_STAT_PROT:
850+ if ((ic->arg & 0xFF) == ISDN_PTYPE_EURO)
851+ { if (ic->arg != DSS1_STAT_INVOKE_BRD)
852+ return (prot_stat_callback(ic));
853+ else
854+ return (0); /* DSS1 invoke broadcast */
855+ }
856+ else
857+ return (-1); /* protocol not euro */
858+
859+ default:
860+ return (isdn_divert_stat_callback(ic));
861+ }
862862 } /* ll_callback */
863−
drivers/isdn/divert/isdn_divert.h+58−58
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 * Header for the diversion supplementary ioctl interface.
44 *
55 * Copyright 1998 by Werner Cornelius (werner@ikt.de)
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -20,13 +20,13 @@ · 10 unmodified lines
2020 #define IIOCGETDRV _IO('I', 2) /* get driver number */
2121 #define IIOCGETNAM _IO('I', 3) /* get driver name */
2222 #define IIOCGETRULE _IO('I', 4) /* read one rule */
23−#define IIOCMODRULE _IO('I', 5) /* modify/replace a rule */
23+#define IIOCMODRULE _IO('I', 5) /* modify/replace a rule */
2424 #define IIOCINSRULE _IO('I', 6) /* insert/append one rule */
2525 #define IIOCDELRULE _IO('I', 7) /* delete a rule */
2626 #define IIOCDODFACT _IO('I', 8) /* hangup/reject/alert/immediately deflect a call */
2727 #define IIOCDOCFACT _IO('I', 9) /* activate control forwarding in PBX */
28−#define IIOCDOCFDIS _IO('I',10) /* deactivate control forwarding in PBX */
29−#define IIOCDOCFINT _IO('I',11) /* interrogate control forwarding in PBX */
28+#define IIOCDOCFDIS _IO('I', 10) /* deactivate control forwarding in PBX */
29+#define IIOCDOCFINT _IO('I', 11) /* interrogate control forwarding in PBX */
3030
3131 /*************************************/
3232 /* states reported through interface */
@@ -34,65 +34,65 @@ · 1 unmodified line
3434 #define DEFLECT_IGNORE 0 /* ignore incoming call */
3535 #define DEFLECT_REPORT 1 /* only report */
3636 #define DEFLECT_PROCEED 2 /* deflect when externally triggered */
37−#define DEFLECT_ALERT 3 /* alert and deflect after delay */
37+#define DEFLECT_ALERT 3 /* alert and deflect after delay */
3838 #define DEFLECT_REJECT 4 /* reject immediately */
3939 #define DIVERT_ACTIVATE 5 /* diversion activate */
4040 #define DIVERT_DEACTIVATE 6 /* diversion deactivate */
41−#define DIVERT_REPORT 7 /* interrogation result */
42−#define DEFLECT_AUTODEL 255 /* only for internal use */
41+#define DIVERT_REPORT 7 /* interrogation result */
42+#define DEFLECT_AUTODEL 255 /* only for internal use */
4343
4444 #define DEFLECT_ALL_IDS 0xFFFFFFFF /* all drivers selected */
4545
4646 typedef struct
47− { ulong drvid; /* driver ids, bit mapped */
48− char my_msn[35]; /* desired msn, subaddr allowed */
49− char caller[35]; /* caller id, partial string with * + subaddr allowed */
50− char to_nr[35]; /* deflected to number incl. subaddress */
51− u_char si1,si2; /* service indicators, si1=bitmask, si1+2 0 = all */
52− u_char screen; /* screening: 0 = no info, 1 = info, 2 = nfo with nr */
53− u_char callopt; /* option for call handling:
54− 0 = all calls
55− 1 = only non waiting calls
56− 2 = only waiting calls */
57− u_char action; /* desired action:
58− 0 = don't report call -> ignore
59− 1 = report call, do not allow/proceed for deflection
60− 2 = report call, send proceed, wait max waittime secs
61− 3 = report call, alert and deflect after waittime
62− 4 = report call, reject immediately
63− actions 1-2 only take place if interface is opened
64− */
65− u_char waittime; /* maximum wait time for proceeding */
66− } divert_rule;
47+{ ulong drvid; /* driver ids, bit mapped */
48+ char my_msn[35]; /* desired msn, subaddr allowed */
49+ char caller[35]; /* caller id, partial string with * + subaddr allowed */
50+ char to_nr[35]; /* deflected to number incl. subaddress */
51+ u_char si1, si2; /* service indicators, si1=bitmask, si1+2 0 = all */
52+ u_char screen; /* screening: 0 = no info, 1 = info, 2 = nfo with nr */
53+ u_char callopt; /* option for call handling:
54+ 0 = all calls
55+ 1 = only non waiting calls
56+ 2 = only waiting calls */
57+ u_char action; /* desired action:
58+ 0 = don't report call -> ignore
59+ 1 = report call, do not allow/proceed for deflection
60+ 2 = report call, send proceed, wait max waittime secs
61+ 3 = report call, alert and deflect after waittime
62+ 4 = report call, reject immediately
63+ actions 1-2 only take place if interface is opened
64+ */
65+ u_char waittime; /* maximum wait time for proceeding */
66+} divert_rule;
6767
6868 typedef union
69− { int drv_version; /* return of driver version */
70− struct
71− { int drvid; /* id of driver */
72− char drvnam[30]; /* name of driver */
73− } getid;
74− struct
75− { int ruleidx; /* index of rule */
76− divert_rule rule; /* rule parms */
77− } getsetrule;
78− struct
79− { u_char subcmd; /* 0 = hangup/reject,
80− 1 = alert,
81− 2 = deflect */
82− ulong callid; /* id of call delivered by ascii output */
83− char to_nr[35]; /* destination when deflect,
84− else uus1 string (maxlen 31),
85− data from rule used if empty */
86− } fwd_ctrl;
87− struct
88− { int drvid; /* id of driver */
89− u_char cfproc; /* cfu = 0, cfb = 1, cfnr = 2 */
90− ulong procid; /* process id returned when no error */
91− u_char service; /* basically coded service, 0 = all */
92− char msn[25]; /* desired msn, empty = all */
93− char fwd_nr[35];/* forwarded to number + subaddress */
94− } cf_ctrl;
95− } divert_ioctl;
69+{ int drv_version; /* return of driver version */
70+ struct
71+ { int drvid; /* id of driver */
72+ char drvnam[30]; /* name of driver */
73+ } getid;
74+ struct
75+ { int ruleidx; /* index of rule */
76+ divert_rule rule; /* rule parms */
77+ } getsetrule;
78+ struct
79+ { u_char subcmd; /* 0 = hangup/reject,
80+ 1 = alert,
81+ 2 = deflect */
82+ ulong callid; /* id of call delivered by ascii output */
83+ char to_nr[35]; /* destination when deflect,
84+ else uus1 string (maxlen 31),
85+ data from rule used if empty */
86+ } fwd_ctrl;
87+ struct
88+ { int drvid; /* id of driver */
89+ u_char cfproc; /* cfu = 0, cfb = 1, cfnr = 2 */
90+ ulong procid; /* process id returned when no error */
91+ u_char service; /* basically coded service, 0 = all */
92+ char msn[25]; /* desired msn, empty = all */
93+ char fwd_nr[35];/* forwarded to number + subaddress */
94+ } cf_ctrl;
95+} divert_ioctl;
9696
9797 #ifdef __KERNEL__
9898
@@ -105,10 +105,10 @@ typedef union · 6 unmodified lines
105105 /* structure keeping ascii info for device output */
106106 /**************************************************/
107107 struct divert_info
108− { struct divert_info *next;
109− ulong usage_cnt; /* number of files still to work */
110− char info_start[2]; /* info string start */
111− };
108+{ struct divert_info *next;
109+ ulong usage_cnt; /* number of files still to work */
110+ char info_start[2]; /* info string start */
111+};
112112
113113
114114 /**************/
drivers/isdn/gigaset/asyncdata.c+2−2
@@ -214,7 +214,7 @@ byte_stuff: · 213 unmodified lines
214214 } else if (fcs != PPP_GOODFCS) {
215215 /* frame check error */
216216 dev_err(cs->dev,
217− "Checksum failed, %u bytes corrupted!\n",
217+ "Checksum failed, %u bytes corrupted!\n",
218218 skb->len);
219219 gigaset_isdn_rcv_err(bcs);
220220 dev_kfree_skb_any(skb);
@@ -543,7 +543,7 @@ static struct sk_buff *iraw_encode(struct sk_buff *skb) · 322 unmodified lines
543543 /* size of new buffer (worst case = every byte must be stuffed):
544544 * 2 * original size + room for link layer header
545545 */
546− iraw_skb = dev_alloc_skb(2*skb->len + skb->mac_len);
546+ iraw_skb = dev_alloc_skb(2 * skb->len + skb->mac_len);
547547 if (!iraw_skb) {
548548 dev_kfree_skb_any(skb);
549549 return NULL;
drivers/isdn/gigaset/bas-gigaset.c+21−21
@@ -410,10 +410,10 @@ static void check_pending(struct bas_cardstate *ucs) · 409 unmodified lines
410410 if (!(ucs->basstate & BS_RESETTING))
411411 ucs->pending = 0;
412412 break;
413− /*
414− * HD_READ_ATMESSAGE and HD_WRITE_ATMESSAGE are handled separately
415− * and should never end up here
416− */
413+ /*
414+ * HD_READ_ATMESSAGE and HD_WRITE_ATMESSAGE are handled separately
415+ * and should never end up here
416+ */
417417 default:
418418 dev_warn(&ucs->interface->dev,
419419 "unknown pending request 0x%02x cleared\n",
@@ -491,7 +491,7 @@ static void read_ctrl_callback(struct urb *urb) · 71 unmodified lines
491491 numbytes = urb->actual_length;
492492 if (unlikely(numbytes != ucs->rcvbuf_size)) {
493493 dev_warn(cs->dev,
494− "control read: received %d chars, expected %d\n",
494+ "control read: received %d chars, expected %d\n",
495495 numbytes, ucs->rcvbuf_size);
496496 if (numbytes > ucs->rcvbuf_size)
497497 numbytes = ucs->rcvbuf_size;
@@ -710,7 +710,7 @@ static void read_int_callback(struct urb *urb) · 212 unmodified lines
710710 }
711711
712712 l = (unsigned) ucs->int_in_buf[1] +
713− (((unsigned) ucs->int_in_buf[2]) << 8);
713+ (((unsigned) ucs->int_in_buf[2]) << 8);
714714
715715 gig_dbg(DEBUG_USBREQ, "<-------%d: 0x%02x (%u [0x%02x 0x%02x])",
716716 urb->actual_length, (int)ucs->int_in_buf[0], l,
@@ -770,14 +770,14 @@ static void read_int_callback(struct urb *urb) · 53 unmodified lines
770770 case HD_RECEIVEATDATA_ACK: /* AT response ready to be received */
771771 if (!l) {
772772 dev_warn(cs->dev,
773− "HD_RECEIVEATDATA_ACK with length 0 ignored\n");
773+ "HD_RECEIVEATDATA_ACK with length 0 ignored\n");
774774 break;
775775 }
776776 spin_lock_irqsave(&cs->lock, flags);
777777 if (ucs->basstate & BS_ATRDPEND) {
778778 spin_unlock_irqrestore(&cs->lock, flags);
779779 dev_warn(cs->dev,
780− "HD_RECEIVEATDATA_ACK(%d) during HD_READ_ATMESSAGE(%d) ignored\n",
780+ "HD_RECEIVEATDATA_ACK(%d) during HD_READ_ATMESSAGE(%d) ignored\n",
781781 l, ucs->rcvbuf_size);
782782 break;
783783 }
@@ -878,7 +878,7 @@ static void read_iso_callback(struct urb *urb) · 94 unmodified lines
878878 ubc->isoinlost += urb->iso_frame_desc[i].actual_length;
879879 if (unlikely(urb->iso_frame_desc[i].status != 0 &&
880880 urb->iso_frame_desc[i].status !=
881− -EINPROGRESS))
881+ -EINPROGRESS))
882882 ubc->loststatus = urb->iso_frame_desc[i].status;
883883 urb->iso_frame_desc[i].status = 0;
884884 urb->iso_frame_desc[i].actual_length = 0;
@@ -891,7 +891,7 @@ static void read_iso_callback(struct urb *urb) · 6 unmodified lines
891891 rc = usb_submit_urb(urb, GFP_ATOMIC);
892892 if (unlikely(rc != 0 && rc != -ENODEV)) {
893893 dev_err(bcs->cs->dev,
894− "could not resubmit isoc read URB: %s\n",
894+ "could not resubmit isoc read URB: %s\n",
895895 get_usb_rcmsg(rc));
896896 dump_urb(DEBUG_ISO, "isoc read", urb);
897897 error_hangup(bcs);
@@ -1017,17 +1017,17 @@ static int starturbs(struct bc_state *bcs) · 119 unmodified lines
10171017 }
10181018
10191019 /* keep one URB free, submit the others */
1020− for (k = 0; k < BAS_OUTURBS-1; ++k) {
1020+ for (k = 0; k < BAS_OUTURBS - 1; ++k) {
10211021 dump_urb(DEBUG_ISO, "Initial isoc write", urb);
10221022 rc = usb_submit_urb(ubc->isoouturbs[k].urb, GFP_ATOMIC);
10231023 if (rc != 0)
10241024 goto error;
10251025 }
10261026 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb);
1027− ubc->isooutfree = &ubc->isoouturbs[BAS_OUTURBS-1];
1027+ ubc->isooutfree = &ubc->isoouturbs[BAS_OUTURBS - 1];
10281028 ubc->isooutdone = ubc->isooutovfl = NULL;
10291029 return 0;
1030− error:
1030+error:
10311031 stopurbs(ubc);
10321032 return rc;
10331033 }
@@ -1229,7 +1229,7 @@ static void write_iso_tasklet(unsigned long data) · 195 unmodified lines
12291229 if (ifd->status ||
12301230 ifd->actual_length != ifd->length) {
12311231 dev_warn(cs->dev,
1232− "isoc write: frame %d[%d/%d]: %s\n",
1232+ "isoc write: frame %d[%d/%d]: %s\n",
12331233 i, ifd->actual_length,
12341234 ifd->length,
12351235 get_usb_statmsg(ifd->status));
@@ -1316,7 +1316,7 @@ static void read_iso_tasklet(unsigned long data) · 80 unmodified lines
13161316 ubc->isoindone = NULL;
13171317 if (unlikely(ubc->loststatus != -EINPROGRESS)) {
13181318 dev_warn(cs->dev,
1319− "isoc read overrun, URB dropped (status: %s, %d bytes)\n",
1319+ "isoc read overrun, URB dropped (status: %s, %d bytes)\n",
13201320 get_usb_statmsg(ubc->loststatus),
13211321 ubc->isoinlost);
13221322 ubc->loststatus = -EINPROGRESS;
@@ -1965,7 +1965,7 @@ static int gigaset_write_cmd(struct cardstate *cs, struct cmdbuf_t *cb) · 642 unmodified lines
19651965 int rc;
19661966
19671967 gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
1968− DEBUG_TRANSCMD : DEBUG_LOCKCMD,
1968+ DEBUG_TRANSCMD : DEBUG_LOCKCMD,
19691969 "CMD Transmit", cb->len, cb->buf);
19701970
19711971 /* translate "+++" escape sequence sent as a single separate command
@@ -2453,13 +2453,13 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) · 481 unmodified lines
24532453
24542454 /* wait a bit for blocking conditions to go away */
24552455 rc = wait_event_timeout(ucs->waitqueue,
2456− !(ucs->basstate &
2457− (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)),
2458− BAS_TIMEOUT*HZ/10);
2456+ !(ucs->basstate &
2457+ (BS_B1OPEN | BS_B2OPEN | BS_ATRDPEND | BS_ATWRPEND)),
2458+ BAS_TIMEOUT * HZ / 10);
24592459 gig_dbg(DEBUG_SUSPEND, "wait_event_timeout() -> %d", rc);
24602460
24612461 /* check for conditions preventing suspend */
2462− if (ucs->basstate & (BS_B1OPEN|BS_B2OPEN|BS_ATRDPEND|BS_ATWRPEND)) {
2462+ if (ucs->basstate & (BS_B1OPEN | BS_B2OPEN | BS_ATRDPEND | BS_ATWRPEND)) {
24632463 dev_warn(cs->dev, "cannot suspend:\n");
24642464 if (ucs->basstate & BS_B1OPEN)
24652465 dev_warn(cs->dev, " B channel 1 open\n");
@@ -2482,7 +2482,7 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) · 16 unmodified lines
24822482 return rc;
24832483 }
24842484 wait_event_timeout(ucs->waitqueue, !ucs->pending,
2485− BAS_TIMEOUT*HZ/10);
2485+ BAS_TIMEOUT * HZ / 10);
24862486 /* in case of timeout, proceed anyway */
24872487 }
24882488
drivers/isdn/gigaset/capi.c+114−114
@@ -26,17 +26,17 @@ · 25 unmodified lines
2626 #define CapiFacilitySpecificFunctionNotSupported 0x3011
2727
2828 /* missing from capicmd.h */
29−#define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN+4+2+8*1)
30−#define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+3*1)
31−#define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+1)
32−#define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN+4+1)
33−#define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN+4+4+2+2+2+8)
34−#define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN+4+2+2)
35−#define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN+4+2)
36−#define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN+4+2+1)
37−#define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN+4+2+2+1)
29+#define CAPI_CONNECT_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 8 * 1)
30+#define CAPI_CONNECT_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 3 * 1)
31+#define CAPI_CONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
32+#define CAPI_CONNECT_B3_ACTIVE_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 1)
33+#define CAPI_DATA_B3_REQ_LEN64 (CAPI_MSG_BASELEN + 4 + 4 + 2 + 2 + 2 + 8)
34+#define CAPI_DATA_B3_CONF_LEN (CAPI_MSG_BASELEN + 4 + 2 + 2)
35+#define CAPI_DISCONNECT_IND_LEN (CAPI_MSG_BASELEN + 4 + 2)
36+#define CAPI_DISCONNECT_B3_IND_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 1)
37+#define CAPI_FACILITY_CONF_BASELEN (CAPI_MSG_BASELEN + 4 + 2 + 2 + 1)
3838 /* most _CONF messages contain only Controller/PLCI/NCCI and Info parameters */
39−#define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN+4+2)
39+#define CAPI_STDCONF_LEN (CAPI_MSG_BASELEN + 4 + 2)
4040
4141 #define CAPI_FACILITY_HANDSET 0x0000
4242 #define CAPI_FACILITY_DTMF 0x0001
@@ -97,10 +97,10 @@ struct gigaset_capi_ctr { · 54 unmodified lines
9797 /* two _cmsg structures possibly used concurrently: */
9898 _cmsg hcmsg; /* for message composition triggered from hardware */
9999 _cmsg acmsg; /* for dissection of messages sent from application */
100− u8 bc_buf[MAX_BC_OCTETS+1];
101− u8 hlc_buf[MAX_HLC_OCTETS+1];
102− u8 cgpty_buf[MAX_NUMBER_DIGITS+3];
103− u8 cdpty_buf[MAX_NUMBER_DIGITS+2];
100+ u8 bc_buf[MAX_BC_OCTETS + 1];
101+ u8 hlc_buf[MAX_HLC_OCTETS + 1];
102+ u8 cgpty_buf[MAX_NUMBER_DIGITS + 3];
103+ u8 cdpty_buf[MAX_NUMBER_DIGITS + 2];
104104 };
105105
106106 /* CIP Value table (from CAPI 2.0 standard, ch. 6.1) */
@@ -109,50 +109,50 @@ static struct { · 2 unmodified lines
109109 u8 *hlc;
110110 } cip2bchlc[] = {
111111 [1] = { "8090A3", NULL },
112− /* Speech (A-law) */
112+ /* Speech (A-law) */
113113 [2] = { "8890", NULL },
114− /* Unrestricted digital information */
114+ /* Unrestricted digital information */
115115 [3] = { "8990", NULL },
116− /* Restricted digital information */
116+ /* Restricted digital information */
117117 [4] = { "9090A3", NULL },
118− /* 3,1 kHz audio (A-law) */
118+ /* 3,1 kHz audio (A-law) */
119119 [5] = { "9190", NULL },
120− /* 7 kHz audio */
120+ /* 7 kHz audio */
121121 [6] = { "9890", NULL },
122− /* Video */
122+ /* Video */
123123 [7] = { "88C0C6E6", NULL },
124− /* Packet mode */
124+ /* Packet mode */
125125 [8] = { "8890218F", NULL },
126− /* 56 kbit/s rate adaptation */
126+ /* 56 kbit/s rate adaptation */
127127 [9] = { "9190A5", NULL },
128− /* Unrestricted digital information with tones/announcements */
128+ /* Unrestricted digital information with tones/announcements */
129129 [16] = { "8090A3", "9181" },
130− /* Telephony */
130+ /* Telephony */
131131 [17] = { "9090A3", "9184" },
132− /* Group 2/3 facsimile */
132+ /* Group 2/3 facsimile */
133133 [18] = { "8890", "91A1" },
134− /* Group 4 facsimile Class 1 */
134+ /* Group 4 facsimile Class 1 */
135135 [19] = { "8890", "91A4" },
136− /* Teletex service basic and mixed mode
137− and Group 4 facsimile service Classes II and III */
136+ /* Teletex service basic and mixed mode
137+ and Group 4 facsimile service Classes II and III */
138138 [20] = { "8890", "91A8" },
139− /* Teletex service basic and processable mode */
139+ /* Teletex service basic and processable mode */
140140 [21] = { "8890", "91B1" },
141− /* Teletex service basic mode */
141+ /* Teletex service basic mode */
142142 [22] = { "8890", "91B2" },
143− /* International interworking for Videotex */
143+ /* International interworking for Videotex */
144144 [23] = { "8890", "91B5" },
145− /* Telex */
145+ /* Telex */
146146 [24] = { "8890", "91B8" },
147− /* Message Handling Systems in accordance with X.400 */
147+ /* Message Handling Systems in accordance with X.400 */
148148 [25] = { "8890", "91C1" },
149− /* OSI application in accordance with X.200 */
149+ /* OSI application in accordance with X.200 */
150150 [26] = { "9190A5", "9181" },
151− /* 7 kHz telephony */
151+ /* 7 kHz telephony */
152152 [27] = { "9190A5", "916001" },
153− /* Video telephony, first connection */
153+ /* Video telephony, first connection */
154154 [28] = { "8890", "916002" },
155− /* Video telephony, second connection */
155+ /* Video telephony, second connection */
156156 };
157157
158158 /*
@@ -164,7 +164,7 @@ static struct { · 5 unmodified lines
164164 * emit unsupported parameter warning
165165 */
166166 static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
167− char *msgname, char *paramname)
167+ char *msgname, char *paramname)
168168 {
169169 if (param && *param)
170170 dev_warn(cs->dev, "%s: ignoring unsupported parameter: %s\n",
@@ -259,15 +259,15 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag, · 88 unmodified lines
259259 CAPIMSG_APPID(data), CAPIMSG_MSGID(data), l,
260260 CAPIMSG_CONTROL(data));
261261 l -= 12;
262− dbgline = kmalloc(3*l, GFP_ATOMIC);
262+ dbgline = kmalloc(3 * l, GFP_ATOMIC);
263263 if (!dbgline)
264264 return;
265265 for (i = 0; i < l; i++) {
266− dbgline[3*i] = hex_asc_hi(data[12+i]);
267− dbgline[3*i+1] = hex_asc_lo(data[12+i]);
268− dbgline[3*i+2] = ' ';
266+ dbgline[3 * i] = hex_asc_hi(data[12 + i]);
267+ dbgline[3 * i + 1] = hex_asc_lo(data[12 + i]);
268+ dbgline[3 * i + 2] = ' ';
269269 }
270− dbgline[3*l-1] = '\0';
270+ dbgline[3 * l - 1] = '\0';
271271 gig_dbg(level, " %s", dbgline);
272272 kfree(dbgline);
273273 if (CAPIMSG_COMMAND(data) == CAPI_DATA_B3 &&
@@ -279,16 +279,16 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag, · 5 unmodified lines
279279 return;
280280 if (l > 64)
281281 l = 64; /* arbitrary limit */
282− dbgline = kmalloc(3*l, GFP_ATOMIC);
282+ dbgline = kmalloc(3 * l, GFP_ATOMIC);
283283 if (!dbgline)
284284 return;
285285 data += CAPIMSG_LEN(data);
286286 for (i = 0; i < l; i++) {
287− dbgline[3*i] = hex_asc_hi(data[i]);
288− dbgline[3*i+1] = hex_asc_lo(data[i]);
289− dbgline[3*i+2] = ' ';
287+ dbgline[3 * i] = hex_asc_hi(data[i]);
288+ dbgline[3 * i + 1] = hex_asc_lo(data[i]);
289+ dbgline[3 * i + 2] = ' ';
290290 }
291− dbgline[3*l-1] = '\0';
291+ dbgline[3 * l - 1] = '\0';
292292 gig_dbg(level, " %s", dbgline);
293293 kfree(dbgline);
294294 }
@@ -301,7 +301,7 @@ static inline void dump_rawmsg(enum debuglevel level, const char *tag, · 6 unmodified lines
301301
302302 static const char *format_ie(const char *ie)
303303 {
304− static char result[3*MAX_FMT_IE_LEN];
304+ static char result[3 * MAX_FMT_IE_LEN];
305305 int len, count;
306306 char *pout = result;
307307
@@ -310,7 +310,7 @@ static const char *format_ie(const char *ie) · 2 unmodified lines
310310
311311 count = len = ie[0];
312312 if (count > MAX_FMT_IE_LEN)
313− count = MAX_FMT_IE_LEN-1;
313+ count = MAX_FMT_IE_LEN - 1;
314314 while (count--) {
315315 *pout++ = hex_asc_hi(*++ie);
316316 *pout++ = hex_asc_lo(*ie);
@@ -403,8 +403,8 @@ void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *dskb) · 86 unmodified lines
403403 send_data_b3_conf(cs, &iif->ctr, ap->id, CAPIMSG_MSGID(req),
404404 bcs->channel + 1, CAPIMSG_HANDLE_REQ(req),
405405 (flags & ~CAPI_FLAGS_DELIVERY_CONFIRMATION) ?
406− CapiFlagsNotSupportedByProtocol :
407− CAPI_NOERROR);
406+ CapiFlagsNotSupportedByProtocol :
407+ CAPI_NOERROR);
408408 }
409409 EXPORT_SYMBOL_GPL(gigaset_skb_sent);
410410
@@ -589,7 +589,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) · 178 unmodified lines
589589 }
590590 iif->cdpty_buf[0] = i + 1;
591591 iif->cdpty_buf[1] = 0x80; /* type / numbering plan unknown */
592− memcpy(iif->cdpty_buf+2, at_state->str_var[STR_ZCPN], i);
592+ memcpy(iif->cdpty_buf + 2, at_state->str_var[STR_ZCPN], i);
593593 iif->hcmsg.CalledPartyNumber = iif->cdpty_buf;
594594 msgsize += iif->hcmsg.CalledPartyNumber[0];
595595 }
@@ -605,7 +605,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) · 9 unmodified lines
605605 iif->cgpty_buf[0] = i + 2;
606606 iif->cgpty_buf[1] = 0x00; /* type / numbering plan unknown */
607607 iif->cgpty_buf[2] = 0x80; /* pres. allowed, not screened */
608− memcpy(iif->cgpty_buf+3, at_state->str_var[STR_NMBR], i);
608+ memcpy(iif->cgpty_buf + 3, at_state->str_var[STR_NMBR], i);
609609 iif->hcmsg.CallingPartyNumber = iif->cgpty_buf;
610610 msgsize += iif->hcmsg.CallingPartyNumber[0];
611611 }
@@ -977,7 +977,7 @@ void gigaset_isdn_stop(struct cardstate *cs) · 365 unmodified lines
977977 * register CAPI application
978978 */
979979 static void gigaset_register_appl(struct capi_ctr *ctr, u16 appl,
980− capi_register_params *rp)
980+ capi_register_params *rp)
981981 {
982982 struct gigaset_capi_ctr *iif
983983 = container_of(ctr, struct gigaset_capi_ctr, ctr);
@@ -1181,21 +1181,21 @@ static void do_facility_req(struct gigaset_capi_ctr *iif, · 197 unmodified lines
11811181 }
11821182 if (CAPIMSG_U32(pparam, 4) != 0) {
11831183 dev_notice(cs->dev,
1184− "%s: unsupported supplementary service notification mask 0x%x\n",
1185− "FACILITY_REQ", CAPIMSG_U32(pparam, 4));
1184+ "%s: unsupported supplementary service notification mask 0x%x\n",
1185+ "FACILITY_REQ", CAPIMSG_U32(pparam, 4));
11861186 info = CapiFacilitySpecificFunctionNotSupported;
11871187 confparam[3] = 2; /* length */
11881188 capimsg_setu16(confparam, 4,
1189− CapiSupplementaryServiceNotSupported);
1189+ CapiSupplementaryServiceNotSupported);
11901190 }
11911191 info = CapiSuccess;
11921192 confparam[3] = 2; /* length */
11931193 capimsg_setu16(confparam, 4, CapiSuccess);
11941194 break;
1195− /* ToDo: add supported services */
1195+ /* ToDo: add supported services */
11961196 default:
11971197 dev_notice(cs->dev,
1198− "%s: unsupported supplementary service function 0x%04x\n",
1198+ "%s: unsupported supplementary service function 0x%04x\n",
11991199 "FACILITY_REQ", function);
12001200 info = CapiFacilitySpecificFunctionNotSupported;
12011201 /* Supplementary Service specific parameter */
@@ -1318,7 +1318,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 116 unmodified lines
13181318 cmsg->adr.adrPLCI |= (bcs->channel + 1) << 8;
13191319
13201320 /* build command table */
1321− commands = kzalloc(AT_NUM*(sizeof *commands), GFP_KERNEL);
1321+ commands = kzalloc(AT_NUM * (sizeof *commands), GFP_KERNEL);
13221322 if (!commands)
13231323 goto oom;
13241324
@@ -1353,10 +1353,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 28 unmodified lines
13531353 commands[AT_TYPE] = kstrdup(s, GFP_KERNEL);
13541354 if (!commands[AT_TYPE])
13551355 goto oom;
1356− commands[AT_DIAL] = kmalloc(l+3, GFP_KERNEL);
1356+ commands[AT_DIAL] = kmalloc(l + 3, GFP_KERNEL);
13571357 if (!commands[AT_DIAL])
13581358 goto oom;
1359− snprintf(commands[AT_DIAL], l+3, "D%.*s\r", l, pp);
1359+ snprintf(commands[AT_DIAL], l + 3, "D%.*s\r", l, pp);
13601360
13611361 /* encode parameter: Calling party number */
13621362 pp = cmsg->CallingPartyNumber;
@@ -1406,10 +1406,10 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 43 unmodified lines
14061406
14071407 if (l) {
14081408 /* number */
1409− commands[AT_MSN] = kmalloc(l+8, GFP_KERNEL);
1409+ commands[AT_MSN] = kmalloc(l + 8, GFP_KERNEL);
14101410 if (!commands[AT_MSN])
14111411 goto oom;
1412− snprintf(commands[AT_MSN], l+8, "^SMSN=%*s\r", l, pp);
1412+ snprintf(commands[AT_MSN], l + 8, "^SMSN=%*s\r", l, pp);
14131413 }
14141414 }
14151415
@@ -1430,13 +1430,13 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 14 unmodified lines
14301430
14311431 /* determine lengths */
14321432 if (cmsg->BC && cmsg->BC[0]) /* BC specified explicitly */
1433− lbc = 2*cmsg->BC[0];
1433+ lbc = 2 * cmsg->BC[0];
14341434 else if (cip2bchlc[cmsg->CIPValue].bc) /* BC derived from CIP */
14351435 lbc = strlen(cip2bchlc[cmsg->CIPValue].bc);
14361436 else /* no BC */
14371437 lbc = 0;
14381438 if (cmsg->HLC && cmsg->HLC[0]) /* HLC specified explicitly */
1439− lhlc = 2*cmsg->HLC[0];
1439+ lhlc = 2 * cmsg->HLC[0];
14401440 else if (cip2bchlc[cmsg->CIPValue].hlc) /* HLC derived from CIP */
14411441 lhlc = strlen(cip2bchlc[cmsg->CIPValue].hlc);
14421442 else /* no HLC */
@@ -1481,7 +1481,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 38 unmodified lines
14811481 if (cmsg->BProtocol == CAPI_DEFAULT) {
14821482 bcs->proto2 = L2_HDLC;
14831483 dev_warn(cs->dev,
1484− "B2 Protocol X.75 SLP unsupported, using Transparent\n");
1484+ "B2 Protocol X.75 SLP unsupported, using Transparent\n");
14851485 } else {
14861486 switch (cmsg->B1protocol) {
14871487 case 0:
@@ -1492,24 +1492,24 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 4 unmodified lines
14921492 break;
14931493 default:
14941494 dev_warn(cs->dev,
1495− "B1 Protocol %u unsupported, using Transparent\n",
1495+ "B1 Protocol %u unsupported, using Transparent\n",
14961496 cmsg->B1protocol);
14971497 bcs->proto2 = L2_VOICE;
14981498 }
14991499 if (cmsg->B2protocol != 1)
15001500 dev_warn(cs->dev,
1501− "B2 Protocol %u unsupported, using Transparent\n",
1501+ "B2 Protocol %u unsupported, using Transparent\n",
15021502 cmsg->B2protocol);
15031503 if (cmsg->B3protocol != 0)
15041504 dev_warn(cs->dev,
1505− "B3 Protocol %u unsupported, using Transparent\n",
1505+ "B3 Protocol %u unsupported, using Transparent\n",
15061506 cmsg->B3protocol);
15071507 ignore_cstruct_param(cs, cmsg->B1configuration,
1508− "CONNECT_REQ", "B1 Configuration");
1508+ "CONNECT_REQ", "B1 Configuration");
15091509 ignore_cstruct_param(cs, cmsg->B2configuration,
1510− "CONNECT_REQ", "B2 Configuration");
1510+ "CONNECT_REQ", "B2 Configuration");
15111511 ignore_cstruct_param(cs, cmsg->B3configuration,
1512− "CONNECT_REQ", "B3 Configuration");
1512+ "CONNECT_REQ", "B3 Configuration");
15131513 }
15141514 commands[AT_PROTO] = kmalloc(9, GFP_KERNEL);
15151515 if (!commands[AT_PROTO])
@@ -1518,20 +1518,20 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, · 2 unmodified lines
15181518
15191519 /* ToDo: check/encode remaining parameters */
15201520 ignore_cstruct_param(cs, cmsg->CalledPartySubaddress,
1521− "CONNECT_REQ", "Called pty subaddr");
1521+ "CONNECT_REQ", "Called pty subaddr");
15221522 ignore_cstruct_param(cs, cmsg->CallingPartySubaddress,
1523− "CONNECT_REQ", "Calling pty subaddr");
1523+ "CONNECT_REQ", "Calling pty subaddr");
15241524 ignore_cstruct_param(cs, cmsg->LLC,
1525− "CONNECT_REQ", "LLC");
1525+ "CONNECT_REQ", "LLC");
15261526 if (cmsg->AdditionalInfo != CAPI_DEFAULT) {
15271527 ignore_cstruct_param(cs, cmsg->BChannelinformation,
1528− "CONNECT_REQ", "B Channel Information");
1528+ "CONNECT_REQ", "B Channel Information");
15291529 ignore_cstruct_param(cs, cmsg->Keypadfacility,
1530− "CONNECT_REQ", "Keypad Facility");
1530+ "CONNECT_REQ", "Keypad Facility");
15311531 ignore_cstruct_param(cs, cmsg->Useruserdata,
1532− "CONNECT_REQ", "User-User Data");
1532+ "CONNECT_REQ", "User-User Data");
15331533 ignore_cstruct_param(cs, cmsg->Facilitydataarray,
1534− "CONNECT_REQ", "Facility Data Array");
1534+ "CONNECT_REQ", "Facility Data Array");
15351535 }
15361536
15371537 /* encode parameter: B channel to use */
@@ -1602,7 +1602,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif, · 64 unmodified lines
16021602 if (oap != ap) {
16031603 spin_unlock_irqrestore(&bcs->aplock, flags);
16041604 send_disconnect_ind(bcs, oap,
1605− CapiCallGivenToOtherApplication);
1605+ CapiCallGivenToOtherApplication);
16061606 spin_lock_irqsave(&bcs->aplock, flags);
16071607 }
16081608 }
@@ -1619,7 +1619,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif, · 10 unmodified lines
16191619 if (cmsg->BProtocol == CAPI_DEFAULT) {
16201620 bcs->proto2 = L2_HDLC;
16211621 dev_warn(cs->dev,
1622− "B2 Protocol X.75 SLP unsupported, using Transparent\n");
1622+ "B2 Protocol X.75 SLP unsupported, using Transparent\n");
16231623 } else {
16241624 switch (cmsg->B1protocol) {
16251625 case 0:
@@ -1630,46 +1630,46 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif, · 4 unmodified lines
16301630 break;
16311631 default:
16321632 dev_warn(cs->dev,
1633− "B1 Protocol %u unsupported, using Transparent\n",
1633+ "B1 Protocol %u unsupported, using Transparent\n",
16341634 cmsg->B1protocol);
16351635 bcs->proto2 = L2_VOICE;
16361636 }
16371637 if (cmsg->B2protocol != 1)
16381638 dev_warn(cs->dev,
1639− "B2 Protocol %u unsupported, using Transparent\n",
1639+ "B2 Protocol %u unsupported, using Transparent\n",
16401640 cmsg->B2protocol);
16411641 if (cmsg->B3protocol != 0)
16421642 dev_warn(cs->dev,
1643− "B3 Protocol %u unsupported, using Transparent\n",
1643+ "B3 Protocol %u unsupported, using Transparent\n",
16441644 cmsg->B3protocol);
16451645 ignore_cstruct_param(cs, cmsg->B1configuration,
1646− "CONNECT_RESP", "B1 Configuration");
1646+ "CONNECT_RESP", "B1 Configuration");
16471647 ignore_cstruct_param(cs, cmsg->B2configuration,
1648− "CONNECT_RESP", "B2 Configuration");
1648+ "CONNECT_RESP", "B2 Configuration");
16491649 ignore_cstruct_param(cs, cmsg->B3configuration,
1650− "CONNECT_RESP", "B3 Configuration");
1650+ "CONNECT_RESP", "B3 Configuration");
16511651 }
16521652
16531653 /* ToDo: check/encode remaining parameters */
16541654 ignore_cstruct_param(cs, cmsg->ConnectedNumber,
1655− "CONNECT_RESP", "Connected Number");
1655+ "CONNECT_RESP", "Connected Number");
16561656 ignore_cstruct_param(cs, cmsg->ConnectedSubaddress,
1657− "CONNECT_RESP", "Connected Subaddress");
1657+ "CONNECT_RESP", "Connected Subaddress");
16581658 ignore_cstruct_param(cs, cmsg->LLC,
1659− "CONNECT_RESP", "LLC");
1659+ "CONNECT_RESP", "LLC");
16601660 if (cmsg->AdditionalInfo != CAPI_DEFAULT) {
16611661 ignore_cstruct_param(cs, cmsg->BChannelinformation,
1662− "CONNECT_RESP", "BChannel Information");
1662+ "CONNECT_RESP", "BChannel Information");
16631663 ignore_cstruct_param(cs, cmsg->Keypadfacility,
1664− "CONNECT_RESP", "Keypad Facility");
1664+ "CONNECT_RESP", "Keypad Facility");
16651665 ignore_cstruct_param(cs, cmsg->Useruserdata,
1666− "CONNECT_RESP", "User-User Data");
1666+ "CONNECT_RESP", "User-User Data");
16671667 ignore_cstruct_param(cs, cmsg->Facilitydataarray,
1668− "CONNECT_RESP", "Facility Data Array");
1668+ "CONNECT_RESP", "Facility Data Array");
16691669 }
16701670
16711671 /* Accept call */
1672− if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state,
1672+ if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
16731673 EV_ACCEPT, NULL, 0, NULL))
16741674 return;
16751675 gigaset_schedule_event(cs);
@@ -1712,7 +1712,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif, · 36 unmodified lines
17121712 if (oap != ap) {
17131713 spin_unlock_irqrestore(&bcs->aplock, flags);
17141714 send_disconnect_ind(bcs, oap,
1715− CapiCallGivenToOtherApplication);
1715+ CapiCallGivenToOtherApplication);
17161716 spin_lock_irqsave(&bcs->aplock, flags);
17171717 }
17181718 }
@@ -1723,7 +1723,7 @@ static void do_connect_resp(struct gigaset_capi_ctr *iif, · 4 unmodified lines
17231723 /* reject call - will trigger DISCONNECT_IND for this app */
17241724 dev_info(cs->dev, "%s: Reject=%x\n",
17251725 "CONNECT_RESP", cmsg->Reject);
1726− if (!gigaset_add_event(cs, &cs->bcs[channel-1].at_state,
1726+ if (!gigaset_add_event(cs, &cs->bcs[channel - 1].at_state,
17271727 EV_HUP, NULL, 0, NULL))
17281728 return;
17291729 gigaset_schedule_event(cs);
@@ -1756,7 +1756,7 @@ static void do_connect_b3_req(struct gigaset_capi_ctr *iif, · 26 unmodified lines
17561756 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
17571757 return;
17581758 }
1759− bcs = &cs->bcs[channel-1];
1759+ bcs = &cs->bcs[channel - 1];
17601760
17611761 /* mark logical connection active */
17621762 bcs->apconnstate = APCONN_ACTIVE;
@@ -1767,7 +1767,7 @@ static void do_connect_b3_req(struct gigaset_capi_ctr *iif, · 4 unmodified lines
17671767 /* NCPI parameter: not applicable for B3 Transparent */
17681768 ignore_cstruct_param(cs, cmsg->NCPI, "CONNECT_B3_REQ", "NCPI");
17691769 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ?
1770− CapiNcpiNotSupportedByProtocol : CapiSuccess);
1770+ CapiNcpiNotSupportedByProtocol : CapiSuccess);
17711771 }
17721772
17731773 /*
@@ -1801,7 +1801,7 @@ static void do_connect_b3_resp(struct gigaset_capi_ctr *iif, · 27 unmodified lines
18011801 dev_kfree_skb_any(skb);
18021802 return;
18031803 }
1804− bcs = &cs->bcs[channel-1];
1804+ bcs = &cs->bcs[channel - 1];
18051805
18061806 if (cmsg->Reject) {
18071807 /* Reject: clear B3 connect received flag */
@@ -1905,7 +1905,7 @@ static void do_disconnect_req(struct gigaset_capi_ctr *iif, · 97 unmodified lines
19051905 return;
19061906 }
19071907 capi_cmsg2message(b3cmsg,
1908− __skb_put(b3skb, CAPI_DISCONNECT_B3_IND_BASELEN));
1908+ __skb_put(b3skb, CAPI_DISCONNECT_B3_IND_BASELEN));
19091909 kfree(b3cmsg);
19101910 capi_ctr_handle_message(&iif->ctr, ap->id, b3skb);
19111911 }
@@ -1947,7 +1947,7 @@ static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif, · 35 unmodified lines
19471947 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
19481948 return;
19491949 }
1950− bcs = &cs->bcs[channel-1];
1950+ bcs = &cs->bcs[channel - 1];
19511951
19521952 /* reject if logical connection not active */
19531953 if (bcs->apconnstate < APCONN_ACTIVE) {
@@ -1965,9 +1965,9 @@ static void do_disconnect_b3_req(struct gigaset_capi_ctr *iif, · 11 unmodified lines
19651965
19661966 /* NCPI parameter: not applicable for B3 Transparent */
19671967 ignore_cstruct_param(cs, cmsg->NCPI,
1968− "DISCONNECT_B3_REQ", "NCPI");
1968+ "DISCONNECT_B3_REQ", "NCPI");
19691969 send_conf(iif, ap, skb, (cmsg->NCPI && cmsg->NCPI[0]) ?
1970− CapiNcpiNotSupportedByProtocol : CapiSuccess);
1970+ CapiNcpiNotSupportedByProtocol : CapiSuccess);
19711971 }
19721972
19731973 /*
@@ -1997,7 +1997,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif, · 23 unmodified lines
19971997 send_conf(iif, ap, skb, CapiIllContrPlciNcci);
19981998 return;
19991999 }
2000− bcs = &cs->bcs[channel-1];
2000+ bcs = &cs->bcs[channel - 1];
20012001 if (msglen != CAPI_DATA_B3_REQ_LEN && msglen != CAPI_DATA_B3_REQ_LEN64)
20022002 dev_notice(cs->dev, "%s: unexpected length %d\n",
20032003 "DATA_B3_REQ", msglen);
@@ -2040,7 +2040,7 @@ static void do_data_b3_req(struct gigaset_capi_ctr *iif, · 36 unmodified lines
20402040 if (!(flags & CAPI_FLAGS_DELIVERY_CONFIRMATION))
20412041 send_data_b3_conf(cs, &iif->ctr, ap->id, msgid, channel, handle,
20422042 flags ? CapiFlagsNotSupportedByProtocol
2043− : CAPI_NOERROR);
2043+ : CAPI_NOERROR);
20442044 }
20452045
20462046 /*
@@ -2258,11 +2258,11 @@ static int gigaset_proc_show(struct seq_file *m, void *v) · 211 unmodified lines
22582258
22592259 seq_printf(m, "%-16s %s\n", "name", ctr->name);
22602260 seq_printf(m, "%-16s %s %s\n", "dev",
2261− dev_driver_string(cs->dev), dev_name(cs->dev));
2261+ dev_driver_string(cs->dev), dev_name(cs->dev));
22622262 seq_printf(m, "%-16s %d\n", "id", cs->myid);
22632263 if (cs->gotfwver)
22642264 seq_printf(m, "%-16s %d.%d.%d.%d\n", "firmware",
2265− cs->fwver[0], cs->fwver[1], cs->fwver[2], cs->fwver[3]);
2265+ cs->fwver[0], cs->fwver[1], cs->fwver[2], cs->fwver[3]);
22662266 seq_printf(m, "%-16s %d\n", "channels", cs->channels);
22672267 seq_printf(m, "%-16s %s\n", "onechannel", cs->onechannel ? "yes" : "no");
22682268
@@ -2315,13 +2315,13 @@ static int gigaset_proc_show(struct seq_file *m, void *v) · 46 unmodified lines
23152315
23162316 for (i = 0; i < cs->channels; i++) {
23172317 seq_printf(m, "[%d]%-13s %d\n", i, "corrupted",
2318− cs->bcs[i].corrupted);
2318+ cs->bcs[i].corrupted);
23192319 seq_printf(m, "[%d]%-13s %d\n", i, "trans_down",
2320− cs->bcs[i].trans_down);
2320+ cs->bcs[i].trans_down);
23212321 seq_printf(m, "[%d]%-13s %d\n", i, "trans_up",
2322− cs->bcs[i].trans_up);
2322+ cs->bcs[i].trans_up);
23232323 seq_printf(m, "[%d]%-13s %d\n", i, "chstate",
2324− cs->bcs[i].chstate);
2324+ cs->bcs[i].chstate);
23252325 switch (cs->bcs[i].proto2) {
23262326 case L2_BITSYNC:
23272327 s = "bitsync";
drivers/isdn/gigaset/common.c+7−7
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 /* Module parameters */
3131 int gigaset_debuglevel;
3232 EXPORT_SYMBOL_GPL(gigaset_debuglevel);
33−module_param_named(debug, gigaset_debuglevel, int, S_IRUGO|S_IWUSR);
33+module_param_named(debug, gigaset_debuglevel, int, S_IRUGO | S_IWUSR);
3434 MODULE_PARM_DESC(debug, "debug level");
3535
3636 /* driver state flags */
@@ -123,7 +123,7 @@ int gigaset_enterconfigmode(struct cardstate *cs) · 86 unmodified lines
123123 if (r < 0)
124124 goto error;
125125 }
126− r = setflags(cs, TIOCM_RTS|TIOCM_DTR, 800);
126+ r = setflags(cs, TIOCM_RTS | TIOCM_DTR, 800);
127127 if (r < 0)
128128 goto error;
129129
@@ -131,8 +131,8 @@ int gigaset_enterconfigmode(struct cardstate *cs) · 1 unmodified line
131131
132132 error:
133133 dev_err(cs->dev, "error %d on setuartbits\n", -r);
134− cs->control_state = TIOCM_RTS|TIOCM_DTR;
135− cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS|TIOCM_DTR);
134+ cs->control_state = TIOCM_RTS | TIOCM_DTR;
135+ cs->ops->set_modem_ctrl(cs, 0, TIOCM_RTS | TIOCM_DTR);
136136
137137 return -1;
138138 }
@@ -591,7 +591,7 @@ int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src, · 452 unmodified lines
591591 if (head > tail)
592592 n = head - 1 - tail;
593593 else if (head == 0)
594− n = (RBUFSIZE-1) - tail;
594+ n = (RBUFSIZE - 1) - tail;
595595 else
596596 n = RBUFSIZE - tail;
597597 if (!n) {
@@ -910,10 +910,10 @@ int gigaset_start(struct cardstate *cs) · 312 unmodified lines
910910 spin_unlock_irqrestore(&cs->lock, flags);
911911
912912 if (cs->mstate != MS_LOCKED) {
913− cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS);
913+ cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR | TIOCM_RTS);
914914 cs->ops->baud_rate(cs, B115200);
915915 cs->ops->set_line_ctrl(cs, CS8);
916− cs->control_state = TIOCM_DTR|TIOCM_RTS;
916+ cs->control_state = TIOCM_DTR | TIOCM_RTS;
917917 }
918918
919919 cs->waiting = 1;
drivers/isdn/gigaset/ev-layer.c+164−164
@@ -153,104 +153,104 @@ struct reply_t gigaset_tab_nocid[] = · 152 unmodified lines
153153 * action, command */
154154
155155 /* initialize device, set cid mode if possible */
156−{RSP_INIT, -1, -1, SEQ_INIT, 100, 1, {ACT_TIMEOUT} },
156+ {RSP_INIT, -1, -1, SEQ_INIT, 100, 1, {ACT_TIMEOUT} },
157157
158−{EV_TIMEOUT, 100, 100, -1, 101, 3, {0}, "Z\r"},
159−{RSP_OK, 101, 103, -1, 120, 5, {ACT_GETSTRING},
160− "+GMR\r"},
158+ {EV_TIMEOUT, 100, 100, -1, 101, 3, {0}, "Z\r"},
159+ {RSP_OK, 101, 103, -1, 120, 5, {ACT_GETSTRING},
160+ "+GMR\r"},
161161
162−{EV_TIMEOUT, 101, 101, -1, 102, 5, {0}, "Z\r"},
163−{RSP_ERROR, 101, 101, -1, 102, 5, {0}, "Z\r"},
162+ {EV_TIMEOUT, 101, 101, -1, 102, 5, {0}, "Z\r"},
163+ {RSP_ERROR, 101, 101, -1, 102, 5, {0}, "Z\r"},
164164
165−{EV_TIMEOUT, 102, 102, -1, 108, 5, {ACT_SETDLE1},
166− "^SDLE=0\r"},
167−{RSP_OK, 108, 108, -1, 104, -1},
168−{RSP_ZDLE, 104, 104, 0, 103, 5, {0}, "Z\r"},
169−{EV_TIMEOUT, 104, 104, -1, 0, 0, {ACT_FAILINIT} },
170−{RSP_ERROR, 108, 108, -1, 0, 0, {ACT_FAILINIT} },
165+ {EV_TIMEOUT, 102, 102, -1, 108, 5, {ACT_SETDLE1},
166+ "^SDLE=0\r"},
167+ {RSP_OK, 108, 108, -1, 104, -1},
168+ {RSP_ZDLE, 104, 104, 0, 103, 5, {0}, "Z\r"},
169+ {EV_TIMEOUT, 104, 104, -1, 0, 0, {ACT_FAILINIT} },
170+ {RSP_ERROR, 108, 108, -1, 0, 0, {ACT_FAILINIT} },
171171
172−{EV_TIMEOUT, 108, 108, -1, 105, 2, {ACT_SETDLE0,
173− ACT_HUPMODEM,
174− ACT_TIMEOUT} },
175−{EV_TIMEOUT, 105, 105, -1, 103, 5, {0}, "Z\r"},
172+ {EV_TIMEOUT, 108, 108, -1, 105, 2, {ACT_SETDLE0,
173+ ACT_HUPMODEM,
174+ ACT_TIMEOUT} },
175+ {EV_TIMEOUT, 105, 105, -1, 103, 5, {0}, "Z\r"},
176176
177−{RSP_ERROR, 102, 102, -1, 107, 5, {0}, "^GETPRE\r"},
178−{RSP_OK, 107, 107, -1, 0, 0, {ACT_CONFIGMODE} },
179−{RSP_ERROR, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
180−{EV_TIMEOUT, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
177+ {RSP_ERROR, 102, 102, -1, 107, 5, {0}, "^GETPRE\r"},
178+ {RSP_OK, 107, 107, -1, 0, 0, {ACT_CONFIGMODE} },
179+ {RSP_ERROR, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
180+ {EV_TIMEOUT, 107, 107, -1, 0, 0, {ACT_FAILINIT} },
181181
182−{RSP_ERROR, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
183−{EV_TIMEOUT, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
182+ {RSP_ERROR, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
183+ {EV_TIMEOUT, 103, 103, -1, 0, 0, {ACT_FAILINIT} },
184184
185−{RSP_STRING, 120, 120, -1, 121, -1, {ACT_SETVER} },
185+ {RSP_STRING, 120, 120, -1, 121, -1, {ACT_SETVER} },
186186
187−{EV_TIMEOUT, 120, 121, -1, 0, 0, {ACT_FAILVER,
188− ACT_INIT} },
189−{RSP_ERROR, 120, 121, -1, 0, 0, {ACT_FAILVER,
190− ACT_INIT} },
191−{RSP_OK, 121, 121, -1, 0, 0, {ACT_GOTVER,
192− ACT_INIT} },
187+ {EV_TIMEOUT, 120, 121, -1, 0, 0, {ACT_FAILVER,
188+ ACT_INIT} },
189+ {RSP_ERROR, 120, 121, -1, 0, 0, {ACT_FAILVER,
190+ ACT_INIT} },
191+ {RSP_OK, 121, 121, -1, 0, 0, {ACT_GOTVER,
192+ ACT_INIT} },
193193
194194 /* leave dle mode */
195−{RSP_INIT, 0, 0, SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
196−{RSP_OK, 201, 201, -1, 202, -1},
197−{RSP_ZDLE, 202, 202, 0, 0, 0, {ACT_DLE0} },
198−{RSP_NODEV, 200, 249, -1, 0, 0, {ACT_FAKEDLE0} },
199−{RSP_ERROR, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
200−{EV_TIMEOUT, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
195+ {RSP_INIT, 0, 0, SEQ_DLE0, 201, 5, {0}, "^SDLE=0\r"},
196+ {RSP_OK, 201, 201, -1, 202, -1},
197+ {RSP_ZDLE, 202, 202, 0, 0, 0, {ACT_DLE0} },
198+ {RSP_NODEV, 200, 249, -1, 0, 0, {ACT_FAKEDLE0} },
199+ {RSP_ERROR, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
200+ {EV_TIMEOUT, 200, 249, -1, 0, 0, {ACT_FAILDLE0} },
201201
202202 /* enter dle mode */
203−{RSP_INIT, 0, 0, SEQ_DLE1, 251, 5, {0}, "^SDLE=1\r"},
204−{RSP_OK, 251, 251, -1, 252, -1},
205−{RSP_ZDLE, 252, 252, 1, 0, 0, {ACT_DLE1} },
206−{RSP_ERROR, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
207−{EV_TIMEOUT, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
203+ {RSP_INIT, 0, 0, SEQ_DLE1, 251, 5, {0}, "^SDLE=1\r"},
204+ {RSP_OK, 251, 251, -1, 252, -1},
205+ {RSP_ZDLE, 252, 252, 1, 0, 0, {ACT_DLE1} },
206+ {RSP_ERROR, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
207+ {EV_TIMEOUT, 250, 299, -1, 0, 0, {ACT_FAILDLE1} },
208208
209209 /* incoming call */
210−{RSP_RING, -1, -1, -1, -1, -1, {ACT_RING} },
210+ {RSP_RING, -1, -1, -1, -1, -1, {ACT_RING} },
211211
212212 /* get cid */
213−{RSP_INIT, 0, 0, SEQ_CID, 301, 5, {0}, "^SGCI?\r"},
214−{RSP_OK, 301, 301, -1, 302, -1},
215−{RSP_ZGCI, 302, 302, -1, 0, 0, {ACT_CID} },
216−{RSP_ERROR, 301, 349, -1, 0, 0, {ACT_FAILCID} },
217−{EV_TIMEOUT, 301, 349, -1, 0, 0, {ACT_FAILCID} },
213+ {RSP_INIT, 0, 0, SEQ_CID, 301, 5, {0}, "^SGCI?\r"},
214+ {RSP_OK, 301, 301, -1, 302, -1},
215+ {RSP_ZGCI, 302, 302, -1, 0, 0, {ACT_CID} },
216+ {RSP_ERROR, 301, 349, -1, 0, 0, {ACT_FAILCID} },
217+ {EV_TIMEOUT, 301, 349, -1, 0, 0, {ACT_FAILCID} },
218218
219219 /* enter cid mode */
220−{RSP_INIT, 0, 0, SEQ_CIDMODE, 150, 5, {0}, "^SGCI=1\r"},
221−{RSP_OK, 150, 150, -1, 0, 0, {ACT_CMODESET} },
222−{RSP_ERROR, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
223−{EV_TIMEOUT, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
220+ {RSP_INIT, 0, 0, SEQ_CIDMODE, 150, 5, {0}, "^SGCI=1\r"},
221+ {RSP_OK, 150, 150, -1, 0, 0, {ACT_CMODESET} },
222+ {RSP_ERROR, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
223+ {EV_TIMEOUT, 150, 150, -1, 0, 0, {ACT_FAILCMODE} },
224224
225225 /* leave cid mode */
226−{RSP_INIT, 0, 0, SEQ_UMMODE, 160, 5, {0}, "Z\r"},
227−{RSP_OK, 160, 160, -1, 0, 0, {ACT_UMODESET} },
228−{RSP_ERROR, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
229−{EV_TIMEOUT, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
226+ {RSP_INIT, 0, 0, SEQ_UMMODE, 160, 5, {0}, "Z\r"},
227+ {RSP_OK, 160, 160, -1, 0, 0, {ACT_UMODESET} },
228+ {RSP_ERROR, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
229+ {EV_TIMEOUT, 160, 160, -1, 0, 0, {ACT_FAILUMODE} },
230230
231231 /* abort getting cid */
232−{RSP_INIT, 0, 0, SEQ_NOCID, 0, 0, {ACT_ABORTCID} },
232+ {RSP_INIT, 0, 0, SEQ_NOCID, 0, 0, {ACT_ABORTCID} },
233233
234234 /* reset */
235−{RSP_INIT, 0, 0, SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
236−{RSP_OK, 504, 504, -1, 0, 0, {ACT_SDOWN} },
237−{RSP_ERROR, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
238−{EV_TIMEOUT, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
239−{RSP_NODEV, 501, 599, -1, 0, 0, {ACT_FAKESDOWN} },
240−
241−{EV_PROC_CIDMODE, -1, -1, -1, -1, -1, {ACT_PROC_CIDMODE} },
242−{EV_IF_LOCK, -1, -1, -1, -1, -1, {ACT_IF_LOCK} },
243−{EV_IF_VER, -1, -1, -1, -1, -1, {ACT_IF_VER} },
244−{EV_START, -1, -1, -1, -1, -1, {ACT_START} },
245−{EV_STOP, -1, -1, -1, -1, -1, {ACT_STOP} },
246−{EV_SHUTDOWN, -1, -1, -1, -1, -1, {ACT_SHUTDOWN} },
235+ {RSP_INIT, 0, 0, SEQ_SHUTDOWN, 504, 5, {0}, "Z\r"},
236+ {RSP_OK, 504, 504, -1, 0, 0, {ACT_SDOWN} },
237+ {RSP_ERROR, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
238+ {EV_TIMEOUT, 501, 599, -1, 0, 0, {ACT_FAILSDOWN} },
239+ {RSP_NODEV, 501, 599, -1, 0, 0, {ACT_FAKESDOWN} },
240+
241+ {EV_PROC_CIDMODE, -1, -1, -1, -1, -1, {ACT_PROC_CIDMODE} },
242+ {EV_IF_LOCK, -1, -1, -1, -1, -1, {ACT_IF_LOCK} },
243+ {EV_IF_VER, -1, -1, -1, -1, -1, {ACT_IF_VER} },
244+ {EV_START, -1, -1, -1, -1, -1, {ACT_START} },
245+ {EV_STOP, -1, -1, -1, -1, -1, {ACT_STOP} },
246+ {EV_SHUTDOWN, -1, -1, -1, -1, -1, {ACT_SHUTDOWN} },
247247
248248 /* misc. */
249−{RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} },
250−{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
251−{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
252−{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
253−{RSP_LAST}
249+ {RSP_ERROR, -1, -1, -1, -1, -1, {ACT_ERROR} },
250+ {RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
251+ {RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
252+ {RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
253+ {RSP_LAST}
254254 };
255255
256256 /* 600: start dialing, 650: dial in progress, 800: connection is up, 700: ring,
@@ -261,91 +261,91 @@ struct reply_t gigaset_tab_cid[] = · 4 unmodified lines
261261 * action, command */
262262
263263 /* dial */
264−{EV_DIAL, -1, -1, -1, -1, -1, {ACT_DIAL} },
265−{RSP_INIT, 0, 0, SEQ_DIAL, 601, 5, {ACT_CMD+AT_BC} },
266−{RSP_OK, 601, 601, -1, 603, 5, {ACT_CMD+AT_PROTO} },
267−{RSP_OK, 603, 603, -1, 604, 5, {ACT_CMD+AT_TYPE} },
268−{RSP_OK, 604, 604, -1, 605, 5, {ACT_CMD+AT_MSN} },
269−{RSP_NULL, 605, 605, -1, 606, 5, {ACT_CMD+AT_CLIP} },
270−{RSP_OK, 605, 605, -1, 606, 5, {ACT_CMD+AT_CLIP} },
271−{RSP_NULL, 606, 606, -1, 607, 5, {ACT_CMD+AT_ISO} },
272−{RSP_OK, 606, 606, -1, 607, 5, {ACT_CMD+AT_ISO} },
273−{RSP_OK, 607, 607, -1, 608, 5, {0}, "+VLS=17\r"},
274−{RSP_OK, 608, 608, -1, 609, -1},
275−{RSP_ZSAU, 609, 609, ZSAU_PROCEEDING, 610, 5, {ACT_CMD+AT_DIAL} },
276−{RSP_OK, 610, 610, -1, 650, 0, {ACT_DIALING} },
277−
278−{RSP_ERROR, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
279−{EV_TIMEOUT, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
264+ {EV_DIAL, -1, -1, -1, -1, -1, {ACT_DIAL} },
265+ {RSP_INIT, 0, 0, SEQ_DIAL, 601, 5, {ACT_CMD + AT_BC} },
266+ {RSP_OK, 601, 601, -1, 603, 5, {ACT_CMD + AT_PROTO} },
267+ {RSP_OK, 603, 603, -1, 604, 5, {ACT_CMD + AT_TYPE} },
268+ {RSP_OK, 604, 604, -1, 605, 5, {ACT_CMD + AT_MSN} },
269+ {RSP_NULL, 605, 605, -1, 606, 5, {ACT_CMD + AT_CLIP} },
270+ {RSP_OK, 605, 605, -1, 606, 5, {ACT_CMD + AT_CLIP} },
271+ {RSP_NULL, 606, 606, -1, 607, 5, {ACT_CMD + AT_ISO} },
272+ {RSP_OK, 606, 606, -1, 607, 5, {ACT_CMD + AT_ISO} },
273+ {RSP_OK, 607, 607, -1, 608, 5, {0}, "+VLS=17\r"},
274+ {RSP_OK, 608, 608, -1, 609, -1},
275+ {RSP_ZSAU, 609, 609, ZSAU_PROCEEDING, 610, 5, {ACT_CMD + AT_DIAL} },
276+ {RSP_OK, 610, 610, -1, 650, 0, {ACT_DIALING} },
277+
278+ {RSP_ERROR, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
279+ {EV_TIMEOUT, 601, 610, -1, 0, 0, {ACT_ABORTDIAL} },
280280
281281 /* optional dialing responses */
282−{EV_BC_OPEN, 650, 650, -1, 651, -1},
283−{RSP_ZVLS, 609, 651, 17, -1, -1, {ACT_DEBUG} },
284−{RSP_ZCTP, 610, 651, -1, -1, -1, {ACT_DEBUG} },
285−{RSP_ZCPN, 610, 651, -1, -1, -1, {ACT_DEBUG} },
286−{RSP_ZSAU, 650, 651, ZSAU_CALL_DELIVERED, -1, -1, {ACT_DEBUG} },
282+ {EV_BC_OPEN, 650, 650, -1, 651, -1},
283+ {RSP_ZVLS, 609, 651, 17, -1, -1, {ACT_DEBUG} },
284+ {RSP_ZCTP, 610, 651, -1, -1, -1, {ACT_DEBUG} },
285+ {RSP_ZCPN, 610, 651, -1, -1, -1, {ACT_DEBUG} },
286+ {RSP_ZSAU, 650, 651, ZSAU_CALL_DELIVERED, -1, -1, {ACT_DEBUG} },
287287
288288 /* connect */
289−{RSP_ZSAU, 650, 650, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
290−{RSP_ZSAU, 651, 651, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
291− ACT_NOTIFY_BC_UP} },
292−{RSP_ZSAU, 750, 750, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
293−{RSP_ZSAU, 751, 751, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
294− ACT_NOTIFY_BC_UP} },
295−{EV_BC_OPEN, 800, 800, -1, 800, -1, {ACT_NOTIFY_BC_UP} },
289+ {RSP_ZSAU, 650, 650, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
290+ {RSP_ZSAU, 651, 651, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
291+ ACT_NOTIFY_BC_UP} },
292+ {RSP_ZSAU, 750, 750, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT} },
293+ {RSP_ZSAU, 751, 751, ZSAU_ACTIVE, 800, -1, {ACT_CONNECT,
294+ ACT_NOTIFY_BC_UP} },
295+ {EV_BC_OPEN, 800, 800, -1, 800, -1, {ACT_NOTIFY_BC_UP} },
296296
297297 /* remote hangup */
298−{RSP_ZSAU, 650, 651, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT} },
299−{RSP_ZSAU, 750, 751, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
300−{RSP_ZSAU, 800, 800, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
298+ {RSP_ZSAU, 650, 651, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT} },
299+ {RSP_ZSAU, 750, 751, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
300+ {RSP_ZSAU, 800, 800, ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP} },
301301
302302 /* hangup */
303−{EV_HUP, -1, -1, -1, -1, -1, {ACT_HUP} },
304−{RSP_INIT, -1, -1, SEQ_HUP, 401, 5, {0}, "+VLS=0\r"},
305−{RSP_OK, 401, 401, -1, 402, 5},
306−{RSP_ZVLS, 402, 402, 0, 403, 5},
307−{RSP_ZSAU, 403, 403, ZSAU_DISCONNECT_REQ, -1, -1, {ACT_DEBUG} },
308−{RSP_ZSAU, 403, 403, ZSAU_NULL, 0, 0, {ACT_DISCONNECT} },
309−{RSP_NODEV, 401, 403, -1, 0, 0, {ACT_FAKEHUP} },
310−{RSP_ERROR, 401, 401, -1, 0, 0, {ACT_ABORTHUP} },
311−{EV_TIMEOUT, 401, 403, -1, 0, 0, {ACT_ABORTHUP} },
312−
313−{EV_BC_CLOSED, 0, 0, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
303+ {EV_HUP, -1, -1, -1, -1, -1, {ACT_HUP} },
304+ {RSP_INIT, -1, -1, SEQ_HUP, 401, 5, {0}, "+VLS=0\r"},
305+ {RSP_OK, 401, 401, -1, 402, 5},
306+ {RSP_ZVLS, 402, 402, 0, 403, 5},
307+ {RSP_ZSAU, 403, 403, ZSAU_DISCONNECT_REQ, -1, -1, {ACT_DEBUG} },
308+ {RSP_ZSAU, 403, 403, ZSAU_NULL, 0, 0, {ACT_DISCONNECT} },
309+ {RSP_NODEV, 401, 403, -1, 0, 0, {ACT_FAKEHUP} },
310+ {RSP_ERROR, 401, 401, -1, 0, 0, {ACT_ABORTHUP} },
311+ {EV_TIMEOUT, 401, 403, -1, 0, 0, {ACT_ABORTHUP} },
312+
313+ {EV_BC_CLOSED, 0, 0, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
314314
315315 /* ring */
316−{RSP_ZBC, 700, 700, -1, -1, -1, {0} },
317−{RSP_ZHLC, 700, 700, -1, -1, -1, {0} },
318−{RSP_NMBR, 700, 700, -1, -1, -1, {0} },
319−{RSP_ZCPN, 700, 700, -1, -1, -1, {0} },
320−{RSP_ZCTP, 700, 700, -1, -1, -1, {0} },
321−{EV_TIMEOUT, 700, 700, -1, 720, 720, {ACT_ICALL} },
322−{EV_BC_CLOSED, 720, 720, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
316+ {RSP_ZBC, 700, 700, -1, -1, -1, {0} },
317+ {RSP_ZHLC, 700, 700, -1, -1, -1, {0} },
318+ {RSP_NMBR, 700, 700, -1, -1, -1, {0} },
319+ {RSP_ZCPN, 700, 700, -1, -1, -1, {0} },
320+ {RSP_ZCTP, 700, 700, -1, -1, -1, {0} },
321+ {EV_TIMEOUT, 700, 700, -1, 720, 720, {ACT_ICALL} },
322+ {EV_BC_CLOSED, 720, 720, -1, 0, -1, {ACT_NOTIFY_BC_DOWN} },
323323
324324 /*accept icall*/
325−{EV_ACCEPT, -1, -1, -1, -1, -1, {ACT_ACCEPT} },
326−{RSP_INIT, 720, 720, SEQ_ACCEPT, 721, 5, {ACT_CMD+AT_PROTO} },
327−{RSP_OK, 721, 721, -1, 722, 5, {ACT_CMD+AT_ISO} },
328−{RSP_OK, 722, 722, -1, 723, 5, {0}, "+VLS=17\r"},
329−{RSP_OK, 723, 723, -1, 724, 5, {0} },
330−{RSP_ZVLS, 724, 724, 17, 750, 50, {ACT_ACCEPTED} },
331−{RSP_ERROR, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
332−{EV_TIMEOUT, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
333−{RSP_ZSAU, 700, 729, ZSAU_NULL, 0, 0, {ACT_ABORTACCEPT} },
334−{RSP_ZSAU, 700, 729, ZSAU_ACTIVE, 0, 0, {ACT_ABORTACCEPT} },
335−{RSP_ZSAU, 700, 729, ZSAU_DISCONNECT_IND, 0, 0, {ACT_ABORTACCEPT} },
336−
337−{EV_BC_OPEN, 750, 750, -1, 751, -1},
338−{EV_TIMEOUT, 750, 751, -1, 0, 0, {ACT_CONNTIMEOUT} },
325+ {EV_ACCEPT, -1, -1, -1, -1, -1, {ACT_ACCEPT} },
326+ {RSP_INIT, 720, 720, SEQ_ACCEPT, 721, 5, {ACT_CMD + AT_PROTO} },
327+ {RSP_OK, 721, 721, -1, 722, 5, {ACT_CMD + AT_ISO} },
328+ {RSP_OK, 722, 722, -1, 723, 5, {0}, "+VLS=17\r"},
329+ {RSP_OK, 723, 723, -1, 724, 5, {0} },
330+ {RSP_ZVLS, 724, 724, 17, 750, 50, {ACT_ACCEPTED} },
331+ {RSP_ERROR, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
332+ {EV_TIMEOUT, 721, 729, -1, 0, 0, {ACT_ABORTACCEPT} },
333+ {RSP_ZSAU, 700, 729, ZSAU_NULL, 0, 0, {ACT_ABORTACCEPT} },
334+ {RSP_ZSAU, 700, 729, ZSAU_ACTIVE, 0, 0, {ACT_ABORTACCEPT} },
335+ {RSP_ZSAU, 700, 729, ZSAU_DISCONNECT_IND, 0, 0, {ACT_ABORTACCEPT} },
336+
337+ {EV_BC_OPEN, 750, 750, -1, 751, -1},
338+ {EV_TIMEOUT, 750, 751, -1, 0, 0, {ACT_CONNTIMEOUT} },
339339
340340 /* B channel closed (general case) */
341−{EV_BC_CLOSED, -1, -1, -1, -1, -1, {ACT_NOTIFY_BC_DOWN} },
341+ {EV_BC_CLOSED, -1, -1, -1, -1, -1, {ACT_NOTIFY_BC_DOWN} },
342342
343343 /* misc. */
344−{RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} },
345−{RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
346−{RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
347−{RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
348−{RSP_LAST}
344+ {RSP_ZCON, -1, -1, -1, -1, -1, {ACT_DEBUG} },
345+ {RSP_ZCAU, -1, -1, -1, -1, -1, {ACT_ZCAU} },
346+ {RSP_NONE, -1, -1, -1, -1, -1, {ACT_DEBUG} },
347+ {RSP_ANY, -1, -1, -1, -1, -1, {ACT_WARN} },
348+ {RSP_LAST}
349349 };
350350
351351
@@ -453,7 +453,7 @@ void gigaset_handle_modem_response(struct cardstate *cs) · 101 unmodified lines
453453 case '=':
454454 if (params > MAX_REC_PARAMS) {
455455 dev_warn(cs->dev,
456− "too many parameters in response\n");
456+ "too many parameters in response\n");
457457 /* need last parameter (might be CID) */
458458 params--;
459459 }
@@ -461,7 +461,7 @@ void gigaset_handle_modem_response(struct cardstate *cs) · 1 unmodified line
461461 }
462462
463463 rawstring = 0;
464− cid = params > 1 ? cid_of_response(argv[params-1]) : 0;
464+ cid = params > 1 ? cid_of_response(argv[params - 1]) : 0;
465465 if (cid < 0) {
466466 gigaset_add_event(cs, &cs->at_state, RSP_INVAL,
467467 NULL, 0, NULL);
@@ -550,7 +550,7 @@ void gigaset_handle_modem_response(struct cardstate *cs) · 82 unmodified lines
550550 event->parameter = zr->code;
551551 if (!zr->str)
552552 dev_warn(cs->dev,
553− "%s: unknown parameter %s after ZSAU\n",
553+ "%s: unknown parameter %s after ZSAU\n",
554554 __func__, argv[curarg]);
555555 ++curarg;
556556 break;
@@ -648,8 +648,8 @@ static void disconnect(struct at_state_t **at_state_p) · 91 unmodified lines
648648 static inline struct at_state_t *get_free_channel(struct cardstate *cs,
649649 int cid)
650650 /* cids: >0: siemens-cid
651− 0: without cid
652− -1: no cid assigned yet
651+ 0: without cid
652+ -1: no cid assigned yet
653653 */
654654 {
655655 unsigned long flags;
@@ -722,12 +722,12 @@ static void send_command(struct cardstate *cs, const char *cmd, int cid, · 66 unmodified lines
722722 }
723723 if (cid > 0 && cid <= 65535)
724724 cb->len = snprintf(cb->buf, buflen,
725− dle ? "\020(AT%d%s\020)" : "AT%d%s",
726− cid, cmd);
725+ dle ? "\020(AT%d%s\020)" : "AT%d%s",
726+ cid, cmd);
727727 else
728728 cb->len = snprintf(cb->buf, buflen,
729− dle ? "\020(AT%s\020)" : "AT%s",
730− cmd);
729+ dle ? "\020(AT%s\020)" : "AT%s",
730+ cmd);
731731 cb->offset = 0;
732732 cb->next = NULL;
733733 cb->wake_tasklet = NULL;
@@ -790,7 +790,7 @@ static void bchannel_up(struct bc_state *bcs) · 56 unmodified lines
790790 }
791791
792792 static void start_dial(struct at_state_t *at_state, void *data,
793− unsigned seq_index)
793+ unsigned seq_index)
794794 {
795795 struct bc_state *bcs = at_state->bcs;
796796 struct cardstate *cs = at_state->cs;
@@ -937,10 +937,10 @@ static int reinit_and_retry(struct cardstate *cs, int channel) · 140 unmodified lines
937937
938938 if (channel < 0)
939939 dev_warn(cs->dev,
940− "Could not enter cid mode. Reinit device and try again.\n");
940+ "Could not enter cid mode. Reinit device and try again.\n");
941941 else {
942942 dev_warn(cs->dev,
943− "Could not get a call id. Reinit device and try again.\n");
943+ "Could not get a call id. Reinit device and try again.\n");
944944 cs->bcs[channel].at_state.pending_commands |= PC_CID;
945945 }
946946 schedule_init(cs, MS_INIT);
@@ -1155,7 +1155,7 @@ static void do_action(int action, struct cardstate *cs, · 208 unmodified lines
11551155 at_state2 = get_free_channel(cs, ev->parameter);
11561156 if (!at_state2) {
11571157 dev_warn(cs->dev,
1158− "RING ignored: could not allocate channel structure\n");
1158+ "RING ignored: could not allocate channel structure\n");
11591159 break;
11601160 }
11611161
@@ -1372,7 +1372,7 @@ static void do_action(int action, struct cardstate *cs, · 210 unmodified lines
13721372 ev->parameter, at_state->ConState);
13731373 break;
13741374
1375− /* events from the LL */
1375+ /* events from the LL */
13761376 case ACT_DIAL:
13771377 start_dial(at_state, ev->ptr, ev->parameter);
13781378 break;
@@ -1385,7 +1385,7 @@ static void do_action(int action, struct cardstate *cs, · 6 unmodified lines
13851385 cs->commands_pending = 1;
13861386 break;
13871387
1388− /* hotplug events */
1388+ /* hotplug events */
13891389 case ACT_STOP:
13901390 do_stop(cs);
13911391 break;
@@ -1393,7 +1393,7 @@ static void do_action(int action, struct cardstate *cs, · 1 unmodified line
13931393 do_start(cs);
13941394 break;
13951395
1396− /* events from the interface */
1396+ /* events from the interface */
13971397 case ACT_IF_LOCK:
13981398 cs->cmd_result = ev->parameter ? do_lock(cs) : do_unlock(cs);
13991399 cs->waiting = 0;
@@ -1412,7 +1412,7 @@ static void do_action(int action, struct cardstate *cs, · 12 unmodified lines
14121412 wake_up(&cs->waitqueue);
14131413 break;
14141414
1415− /* events from the proc file system */
1415+ /* events from the proc file system */
14161416 case ACT_PROC_CIDMODE:
14171417 spin_lock_irqsave(&cs->lock, flags);
14181418 if (ev->parameter != cs->cidmode) {
@@ -1431,7 +1431,7 @@ static void do_action(int action, struct cardstate *cs, · 12 unmodified lines
14311431 wake_up(&cs->waitqueue);
14321432 break;
14331433
1434− /* events from the hardware drivers */
1434+ /* events from the hardware drivers */
14351435 case ACT_NOTIFY_BC_DOWN:
14361436 bchannel_down(bcs);
14371437 break;
@@ -1533,15 +1533,15 @@ static void process_event(struct cardstate *cs, struct event_t *ev) · 95 unmodified lines
15331533 if (rcode == RSP_LAST) {
15341534 /* found nothing...*/
15351535 dev_warn(cs->dev, "%s: rcode=RSP_LAST: "
1536− "resp_code %d in ConState %d!\n",
1536+ "resp_code %d in ConState %d!\n",
15371537 __func__, ev->type, at_state->ConState);
15381538 return;
15391539 }
15401540 if ((rcode == RSP_ANY || rcode == ev->type)
1541− && ((int) at_state->ConState >= rep->min_ConState)
1542− && (rep->max_ConState < 0
1543− || (int) at_state->ConState <= rep->max_ConState)
1544− && (rep->parameter < 0 || rep->parameter == ev->parameter))
1541+ && ((int) at_state->ConState >= rep->min_ConState)
1542+ && (rep->max_ConState < 0
1543+ || (int) at_state->ConState <= rep->max_ConState)
1544+ && (rep->parameter < 0 || rep->parameter == ev->parameter))
15451545 break;
15461546 }
15471547
drivers/isdn/gigaset/gigaset.h+15−15
@@ -91,11 +91,11 @@ enum debuglevel { · 90 unmodified lines
9191
9292 #ifdef CONFIG_GIGASET_DEBUG
9393
94−#define gig_dbg(level, format, arg...) \
95− do { \
94+#define gig_dbg(level, format, arg...) \
95+ do { \
9696 if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
9797 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
98− ## arg); \
98+ ## arg); \
9999 } while (0)
100100 #define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
101101
@@ -164,7 +164,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg, · 62 unmodified lines
164164 #define BAS_CORRFRAMES 4 /* flow control multiplicator */
165165
166166 #define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
167− /* size of isoc in buf per URB */
167+/* size of isoc in buf per URB */
168168 #define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
169169 #define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
170170
@@ -472,17 +472,17 @@ struct cardstate { · 301 unmodified lines
472472 int commands_pending; /* flag(s) in xxx.commands_pending have
473473 been set */
474474 struct tasklet_struct event_tasklet;
475− /* tasklet for serializing AT commands.
476− * Scheduled
477− * -> for modem reponses (and
478− * incoming data for M10x)
479− * -> on timeout
480− * -> after setting bits in
481− * xxx.at_state.pending_command
482− * (e.g. command from LL) */
475+ /* tasklet for serializing AT commands.
476+ * Scheduled
477+ * -> for modem reponses (and
478+ * incoming data for M10x)
479+ * -> on timeout
480+ * -> after setting bits in
481+ * xxx.at_state.pending_command
482+ * (e.g. command from LL) */
483483 struct tasklet_struct write_tasklet;
484− /* tasklet for serial output
485− * (not used in base driver) */
484+ /* tasklet for serial output
485+ * (not used in base driver) */
486486
487487 /* event queue */
488488 struct event_t events[MAX_EVENTS];
@@ -490,7 +490,7 @@ struct cardstate { · 1 unmodified line
490490 spinlock_t ev_lock;
491491
492492 /* current modem response */
493− unsigned char respdata[MAX_RESP_SIZE+1];
493+ unsigned char respdata[MAX_RESP_SIZE + 1];
494494 unsigned cbytes;
495495
496496 /* private data of hardware drivers */
drivers/isdn/gigaset/i4l.c+4−4
@@ -243,7 +243,7 @@ static int command_from_LL(isdn_ctrl *cntrl) · 242 unmodified lines
243243 dev_kfree_skb(bcs->rx_skb);
244244 gigaset_new_rx_skb(bcs);
245245
246− commands = kzalloc(AT_NUM*(sizeof *commands), GFP_ATOMIC);
246+ commands = kzalloc(AT_NUM * (sizeof *commands), GFP_ATOMIC);
247247 if (!commands) {
248248 gigaset_free_channel(bcs);
249249 dev_err(cs->dev, "ISDN_CMD_DIAL: out of memory\n");
@@ -261,7 +261,7 @@ static int command_from_LL(isdn_ctrl *cntrl) · 11 unmodified lines
261261 if (!commands[AT_TYPE])
262262 goto oom;
263263 snprintf(commands[AT_DIAL], l,
264− "D%s\r", cntrl->parm.setup.phone+2);
264+ "D%s\r", cntrl->parm.setup.phone + 2);
265265 } else {
266266 commands[AT_TYPE] = kstrdup("^SCTP=1\r", GFP_ATOMIC);
267267 if (!commands[AT_TYPE])
@@ -482,7 +482,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) · 214 unmodified lines
482482 response.parm.setup.si2 = 2;
483483 } else {
484484 dev_warn(cs->dev, "RING ignored - unsupported BC %s\n",
485− at_state->str_var[STR_ZBC]);
485+ at_state->str_var[STR_ZBC]);
486486 return ICALL_IGNORE;
487487 }
488488 if (at_state->str_var[STR_NMBR]) {
@@ -518,7 +518,7 @@ int gigaset_isdn_icall(struct at_state_t *at_state) · 29 unmodified lines
518518 return ICALL_REJECT;
519519 case 3: /* incomplete */
520520 dev_warn(cs->dev,
521− "LL requested unsupported feature: Incomplete Number\n");
521+ "LL requested unsupported feature: Incomplete Number\n");
522522 return ICALL_IGNORE;
523523 case 4: /* proceeding */
524524 /* Gigaset will send ALERTING anyway.
drivers/isdn/gigaset/interface.c+9−9
@@ -33,10 +33,10 @@ static int if_lock(struct cardstate *cs, int *arg) · 32 unmodified lines
3333 }
3434
3535 if (!cmd && cs->mstate == MS_LOCKED && cs->connected) {
36− cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS);
36+ cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR | TIOCM_RTS);
3737 cs->ops->baud_rate(cs, B115200);
3838 cs->ops->set_line_ctrl(cs, CS8);
39− cs->control_state = TIOCM_DTR|TIOCM_RTS;
39+ cs->control_state = TIOCM_DTR | TIOCM_RTS;
4040 }
4141
4242 cs->waiting = 1;
@@ -232,17 +232,17 @@ static int if_ioctl(struct tty_struct *tty, · 189 unmodified lines
232232 break;
233233 case GIGASET_BRKCHARS:
234234 retval = copy_from_user(&buf,
235− (const unsigned char __user *) arg, 6)
235+ (const unsigned char __user *) arg, 6)
236236 ? -EFAULT : 0;
237237 if (retval >= 0) {
238238 gigaset_dbg_buffer(DEBUG_IF, "GIGASET_BRKCHARS",
239− 6, (const unsigned char *) arg);
239+ 6, (const unsigned char *) arg);
240240 retval = cs->ops->brkchars(cs, buf);
241241 }
242242 break;
243243 case GIGASET_VERSION:
244244 retval = copy_from_user(version,
245− (unsigned __user *) arg, sizeof version)
245+ (unsigned __user *) arg, sizeof version)
246246 ? -EFAULT : 0;
247247 if (retval >= 0)
248248 retval = if_version(cs, version);
@@ -273,7 +273,7 @@ static int if_tiocmget(struct tty_struct *tty) · 24 unmodified lines
273273 if (mutex_lock_interruptible(&cs->mutex))
274274 return -ERESTARTSYS;
275275
276− retval = cs->control_state & (TIOCM_RTS|TIOCM_DTR);
276+ retval = cs->control_state & (TIOCM_RTS | TIOCM_DTR);
277277
278278 mutex_unlock(&cs->mutex);
279279
@@ -297,7 +297,7 @@ static int if_tiocmset(struct tty_struct *tty, · 17 unmodified lines
297297 gig_dbg(DEBUG_IF, "not connected");
298298 retval = -ENODEV;
299299 } else {
300− mc = (cs->control_state | set) & ~clear & (TIOCM_RTS|TIOCM_DTR);
300+ mc = (cs->control_state | set) & ~clear & (TIOCM_RTS | TIOCM_DTR);
301301 retval = cs->ops->set_modem_ctrl(cs, cs->control_state, mc);
302302 cs->control_state = mc;
303303 }
@@ -593,8 +593,8 @@ void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname, · 289 unmodified lines
593593 if (tty == NULL)
594594 goto enomem;
595595
596− tty->type = TTY_DRIVER_TYPE_SERIAL,
597− tty->subtype = SERIAL_TYPE_NORMAL,
596+ tty->type = TTY_DRIVER_TYPE_SERIAL;
597+ tty->subtype = SERIAL_TYPE_NORMAL;
598598 tty->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
599599
600600 tty->driver_name = procname;
drivers/isdn/gigaset/isocdata.c+96−96
@@ -250,94 +250,94 @@ static inline void dump_bytes(enum debuglevel level, const char *tag, · 249 unmodified lines
250250 */
251251 static const u16 stufftab[5 * 256] = {
252252 /* previous 1s = 0: */
253− 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
254− 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x201f,
255− 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
256− 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x205f,
257− 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
258− 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x209f,
259− 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
260− 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20df,
261− 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x048f,
262− 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x0497, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x251f,
263− 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x04a7, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x04af,
264− 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x04b7, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x255f,
265− 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x08c7, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x08cf,
266− 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x08d7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x299f,
267− 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x0ce7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x0cef,
268− 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x2ddf,
253+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
254+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x201f,
255+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
256+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x205f,
257+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f,
258+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x209f,
259+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
260+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20df,
261+ 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x048f,
262+ 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x0497, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x251f,
263+ 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x04a7, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x04af,
264+ 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x04b7, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x255f,
265+ 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x08c7, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x08cf,
266+ 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x08d7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x299f,
267+ 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x0ce7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x0cef,
268+ 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x2ddf,
269269
270270 /* previous 1s = 1: */
271− 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x200f,
272− 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x202f,
273− 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x204f,
274− 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x206f,
275− 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x208f,
276− 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x20af,
277− 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x20cf,
278− 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20ef,
279− 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x250f,
280− 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x0497, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x252f,
281− 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x04a7, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x254f,
282− 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x04b7, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x256f,
283− 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x08c7, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x298f,
284− 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x08d7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x29af,
285− 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x0ce7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x2dcf,
286− 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x31ef,
271+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x200f,
272+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x202f,
273+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x204f,
274+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x206f,
275+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x208f,
276+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x20af,
277+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x20cf,
278+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20ef,
279+ 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x250f,
280+ 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x0497, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x252f,
281+ 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x04a7, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x254f,
282+ 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x04b7, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x256f,
283+ 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x08c7, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x298f,
284+ 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x08d7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x29af,
285+ 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x0ce7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x2dcf,
286+ 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x31ef,
287287
288288 /* previous 1s = 2: */
289− 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x2007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x2017,
290− 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x2027, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x2037,
291− 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2047, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x2057,
292− 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x2067, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x2077,
293− 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x2087, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x2097,
294− 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x20a7, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x20b7,
295− 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x20c7, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x20d7,
296− 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x20e7, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20f7,
297− 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x2507, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x2517,
298− 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x2527, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x2537,
299− 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x2547, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x2557,
300− 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x2567, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x2577,
301− 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x2987, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x2997,
302− 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x29a7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x29b7,
303− 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x2dc7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x2dd7,
304− 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x31e7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x41f7,
289+ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x2007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x2017,
290+ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x2027, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x2037,
291+ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x2047, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x2057,
292+ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x2067, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x203e, 0x2077,
293+ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x2087, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x2097,
294+ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x20a7, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x20b7,
295+ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x20c7, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x20d7,
296+ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x20e7, 0x0078, 0x0079, 0x007a, 0x007b, 0x207c, 0x207d, 0x20be, 0x20f7,
297+ 0x0480, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x2507, 0x0488, 0x0489, 0x048a, 0x048b, 0x048c, 0x048d, 0x048e, 0x2517,
298+ 0x0490, 0x0491, 0x0492, 0x0493, 0x0494, 0x0495, 0x0496, 0x2527, 0x0498, 0x0499, 0x049a, 0x049b, 0x049c, 0x049d, 0x049e, 0x2537,
299+ 0x04a0, 0x04a1, 0x04a2, 0x04a3, 0x04a4, 0x04a5, 0x04a6, 0x2547, 0x04a8, 0x04a9, 0x04aa, 0x04ab, 0x04ac, 0x04ad, 0x04ae, 0x2557,
300+ 0x04b0, 0x04b1, 0x04b2, 0x04b3, 0x04b4, 0x04b5, 0x04b6, 0x2567, 0x04b8, 0x04b9, 0x04ba, 0x04bb, 0x04bc, 0x04bd, 0x253e, 0x2577,
301+ 0x08c0, 0x08c1, 0x08c2, 0x08c3, 0x08c4, 0x08c5, 0x08c6, 0x2987, 0x08c8, 0x08c9, 0x08ca, 0x08cb, 0x08cc, 0x08cd, 0x08ce, 0x2997,
302+ 0x08d0, 0x08d1, 0x08d2, 0x08d3, 0x08d4, 0x08d5, 0x08d6, 0x29a7, 0x08d8, 0x08d9, 0x08da, 0x08db, 0x08dc, 0x08dd, 0x08de, 0x29b7,
303+ 0x0ce0, 0x0ce1, 0x0ce2, 0x0ce3, 0x0ce4, 0x0ce5, 0x0ce6, 0x2dc7, 0x0ce8, 0x0ce9, 0x0cea, 0x0ceb, 0x0cec, 0x0ced, 0x0cee, 0x2dd7,
304+ 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x31e7, 0x20f8, 0x20f9, 0x20fa, 0x20fb, 0x257c, 0x257d, 0x29be, 0x41f7,
305305
306306 /* previous 1s = 3: */
307− 0x0000, 0x0001, 0x0002, 0x2003, 0x0004, 0x0005, 0x0006, 0x200b, 0x0008, 0x0009, 0x000a, 0x2013, 0x000c, 0x000d, 0x000e, 0x201b,
308− 0x0010, 0x0011, 0x0012, 0x2023, 0x0014, 0x0015, 0x0016, 0x202b, 0x0018, 0x0019, 0x001a, 0x2033, 0x001c, 0x001d, 0x001e, 0x203b,
309− 0x0020, 0x0021, 0x0022, 0x2043, 0x0024, 0x0025, 0x0026, 0x204b, 0x0028, 0x0029, 0x002a, 0x2053, 0x002c, 0x002d, 0x002e, 0x205b,
310− 0x0030, 0x0031, 0x0032, 0x2063, 0x0034, 0x0035, 0x0036, 0x206b, 0x0038, 0x0039, 0x003a, 0x2073, 0x003c, 0x003d, 0x203e, 0x207b,
311− 0x0040, 0x0041, 0x0042, 0x2083, 0x0044, 0x0045, 0x0046, 0x208b, 0x0048, 0x0049, 0x004a, 0x2093, 0x004c, 0x004d, 0x004e, 0x209b,
312− 0x0050, 0x0051, 0x0052, 0x20a3, 0x0054, 0x0055, 0x0056, 0x20ab, 0x0058, 0x0059, 0x005a, 0x20b3, 0x005c, 0x005d, 0x005e, 0x20bb,
313− 0x0060, 0x0061, 0x0062, 0x20c3, 0x0064, 0x0065, 0x0066, 0x20cb, 0x0068, 0x0069, 0x006a, 0x20d3, 0x006c, 0x006d, 0x006e, 0x20db,
314− 0x0070, 0x0071, 0x0072, 0x20e3, 0x0074, 0x0075, 0x0076, 0x20eb, 0x0078, 0x0079, 0x007a, 0x20f3, 0x207c, 0x207d, 0x20be, 0x40fb,
315− 0x0480, 0x0481, 0x0482, 0x2503, 0x0484, 0x0485, 0x0486, 0x250b, 0x0488, 0x0489, 0x048a, 0x2513, 0x048c, 0x048d, 0x048e, 0x251b,
316− 0x0490, 0x0491, 0x0492, 0x2523, 0x0494, 0x0495, 0x0496, 0x252b, 0x0498, 0x0499, 0x049a, 0x2533, 0x049c, 0x049d, 0x049e, 0x253b,
317− 0x04a0, 0x04a1, 0x04a2, 0x2543, 0x04a4, 0x04a5, 0x04a6, 0x254b, 0x04a8, 0x04a9, 0x04aa, 0x2553, 0x04ac, 0x04ad, 0x04ae, 0x255b,
318− 0x04b0, 0x04b1, 0x04b2, 0x2563, 0x04b4, 0x04b5, 0x04b6, 0x256b, 0x04b8, 0x04b9, 0x04ba, 0x2573, 0x04bc, 0x04bd, 0x253e, 0x257b,
319− 0x08c0, 0x08c1, 0x08c2, 0x2983, 0x08c4, 0x08c5, 0x08c6, 0x298b, 0x08c8, 0x08c9, 0x08ca, 0x2993, 0x08cc, 0x08cd, 0x08ce, 0x299b,
320− 0x08d0, 0x08d1, 0x08d2, 0x29a3, 0x08d4, 0x08d5, 0x08d6, 0x29ab, 0x08d8, 0x08d9, 0x08da, 0x29b3, 0x08dc, 0x08dd, 0x08de, 0x29bb,
321− 0x0ce0, 0x0ce1, 0x0ce2, 0x2dc3, 0x0ce4, 0x0ce5, 0x0ce6, 0x2dcb, 0x0ce8, 0x0ce9, 0x0cea, 0x2dd3, 0x0cec, 0x0ced, 0x0cee, 0x2ddb,
322− 0x10f0, 0x10f1, 0x10f2, 0x31e3, 0x10f4, 0x10f5, 0x10f6, 0x31eb, 0x20f8, 0x20f9, 0x20fa, 0x41f3, 0x257c, 0x257d, 0x29be, 0x46fb,
307+ 0x0000, 0x0001, 0x0002, 0x2003, 0x0004, 0x0005, 0x0006, 0x200b, 0x0008, 0x0009, 0x000a, 0x2013, 0x000c, 0x000d, 0x000e, 0x201b,
308+ 0x0010, 0x0011, 0x0012, 0x2023, 0x0014, 0x0015, 0x0016, 0x202b, 0x0018, 0x0019, 0x001a, 0x2033, 0x001c, 0x001d, 0x001e, 0x203b,
309+ 0x0020, 0x0021, 0x0022, 0x2043, 0x0024, 0x0025, 0x0026, 0x204b, 0x0028, 0x0029, 0x002a, 0x2053, 0x002c, 0x002d, 0x002e, 0x205b,
310+ 0x0030, 0x0031, 0x0032, 0x2063, 0x0034, 0x0035, 0x0036, 0x206b, 0x0038, 0x0039, 0x003a, 0x2073, 0x003c, 0x003d, 0x203e, 0x207b,
311+ 0x0040, 0x0041, 0x0042, 0x2083, 0x0044, 0x0045, 0x0046, 0x208b, 0x0048, 0x0049, 0x004a, 0x2093, 0x004c, 0x004d, 0x004e, 0x209b,
312+ 0x0050, 0x0051, 0x0052, 0x20a3, 0x0054, 0x0055, 0x0056, 0x20ab, 0x0058, 0x0059, 0x005a, 0x20b3, 0x005c, 0x005d, 0x005e, 0x20bb,
313+ 0x0060, 0x0061, 0x0062, 0x20c3, 0x0064, 0x0065, 0x0066, 0x20cb, 0x0068, 0x0069, 0x006a, 0x20d3, 0x006c, 0x006d, 0x006e, 0x20db,
314+ 0x0070, 0x0071, 0x0072, 0x20e3, 0x0074, 0x0075, 0x0076, 0x20eb, 0x0078, 0x0079, 0x007a, 0x20f3, 0x207c, 0x207d, 0x20be, 0x40fb,
315+ 0x0480, 0x0481, 0x0482, 0x2503, 0x0484, 0x0485, 0x0486, 0x250b, 0x0488, 0x0489, 0x048a, 0x2513, 0x048c, 0x048d, 0x048e, 0x251b,
316+ 0x0490, 0x0491, 0x0492, 0x2523, 0x0494, 0x0495, 0x0496, 0x252b, 0x0498, 0x0499, 0x049a, 0x2533, 0x049c, 0x049d, 0x049e, 0x253b,
317+ 0x04a0, 0x04a1, 0x04a2, 0x2543, 0x04a4, 0x04a5, 0x04a6, 0x254b, 0x04a8, 0x04a9, 0x04aa, 0x2553, 0x04ac, 0x04ad, 0x04ae, 0x255b,
318+ 0x04b0, 0x04b1, 0x04b2, 0x2563, 0x04b4, 0x04b5, 0x04b6, 0x256b, 0x04b8, 0x04b9, 0x04ba, 0x2573, 0x04bc, 0x04bd, 0x253e, 0x257b,
319+ 0x08c0, 0x08c1, 0x08c2, 0x2983, 0x08c4, 0x08c5, 0x08c6, 0x298b, 0x08c8, 0x08c9, 0x08ca, 0x2993, 0x08cc, 0x08cd, 0x08ce, 0x299b,
320+ 0x08d0, 0x08d1, 0x08d2, 0x29a3, 0x08d4, 0x08d5, 0x08d6, 0x29ab, 0x08d8, 0x08d9, 0x08da, 0x29b3, 0x08dc, 0x08dd, 0x08de, 0x29bb,
321+ 0x0ce0, 0x0ce1, 0x0ce2, 0x2dc3, 0x0ce4, 0x0ce5, 0x0ce6, 0x2dcb, 0x0ce8, 0x0ce9, 0x0cea, 0x2dd3, 0x0cec, 0x0ced, 0x0cee, 0x2ddb,
322+ 0x10f0, 0x10f1, 0x10f2, 0x31e3, 0x10f4, 0x10f5, 0x10f6, 0x31eb, 0x20f8, 0x20f9, 0x20fa, 0x41f3, 0x257c, 0x257d, 0x29be, 0x46fb,
323323
324324 /* previous 1s = 4: */
325− 0x0000, 0x2001, 0x0002, 0x2005, 0x0004, 0x2009, 0x0006, 0x200d, 0x0008, 0x2011, 0x000a, 0x2015, 0x000c, 0x2019, 0x000e, 0x201d,
326− 0x0010, 0x2021, 0x0012, 0x2025, 0x0014, 0x2029, 0x0016, 0x202d, 0x0018, 0x2031, 0x001a, 0x2035, 0x001c, 0x2039, 0x001e, 0x203d,
327− 0x0020, 0x2041, 0x0022, 0x2045, 0x0024, 0x2049, 0x0026, 0x204d, 0x0028, 0x2051, 0x002a, 0x2055, 0x002c, 0x2059, 0x002e, 0x205d,
328− 0x0030, 0x2061, 0x0032, 0x2065, 0x0034, 0x2069, 0x0036, 0x206d, 0x0038, 0x2071, 0x003a, 0x2075, 0x003c, 0x2079, 0x203e, 0x407d,
329− 0x0040, 0x2081, 0x0042, 0x2085, 0x0044, 0x2089, 0x0046, 0x208d, 0x0048, 0x2091, 0x004a, 0x2095, 0x004c, 0x2099, 0x004e, 0x209d,
330− 0x0050, 0x20a1, 0x0052, 0x20a5, 0x0054, 0x20a9, 0x0056, 0x20ad, 0x0058, 0x20b1, 0x005a, 0x20b5, 0x005c, 0x20b9, 0x005e, 0x20bd,
331− 0x0060, 0x20c1, 0x0062, 0x20c5, 0x0064, 0x20c9, 0x0066, 0x20cd, 0x0068, 0x20d1, 0x006a, 0x20d5, 0x006c, 0x20d9, 0x006e, 0x20dd,
332− 0x0070, 0x20e1, 0x0072, 0x20e5, 0x0074, 0x20e9, 0x0076, 0x20ed, 0x0078, 0x20f1, 0x007a, 0x20f5, 0x207c, 0x40f9, 0x20be, 0x417d,
333− 0x0480, 0x2501, 0x0482, 0x2505, 0x0484, 0x2509, 0x0486, 0x250d, 0x0488, 0x2511, 0x048a, 0x2515, 0x048c, 0x2519, 0x048e, 0x251d,
334− 0x0490, 0x2521, 0x0492, 0x2525, 0x0494, 0x2529, 0x0496, 0x252d, 0x0498, 0x2531, 0x049a, 0x2535, 0x049c, 0x2539, 0x049e, 0x253d,
335− 0x04a0, 0x2541, 0x04a2, 0x2545, 0x04a4, 0x2549, 0x04a6, 0x254d, 0x04a8, 0x2551, 0x04aa, 0x2555, 0x04ac, 0x2559, 0x04ae, 0x255d,
336− 0x04b0, 0x2561, 0x04b2, 0x2565, 0x04b4, 0x2569, 0x04b6, 0x256d, 0x04b8, 0x2571, 0x04ba, 0x2575, 0x04bc, 0x2579, 0x253e, 0x467d,
337− 0x08c0, 0x2981, 0x08c2, 0x2985, 0x08c4, 0x2989, 0x08c6, 0x298d, 0x08c8, 0x2991, 0x08ca, 0x2995, 0x08cc, 0x2999, 0x08ce, 0x299d,
338− 0x08d0, 0x29a1, 0x08d2, 0x29a5, 0x08d4, 0x29a9, 0x08d6, 0x29ad, 0x08d8, 0x29b1, 0x08da, 0x29b5, 0x08dc, 0x29b9, 0x08de, 0x29bd,
339− 0x0ce0, 0x2dc1, 0x0ce2, 0x2dc5, 0x0ce4, 0x2dc9, 0x0ce6, 0x2dcd, 0x0ce8, 0x2dd1, 0x0cea, 0x2dd5, 0x0cec, 0x2dd9, 0x0cee, 0x2ddd,
340− 0x10f0, 0x31e1, 0x10f2, 0x31e5, 0x10f4, 0x31e9, 0x10f6, 0x31ed, 0x20f8, 0x41f1, 0x20fa, 0x41f5, 0x257c, 0x46f9, 0x29be, 0x4b7d
325+ 0x0000, 0x2001, 0x0002, 0x2005, 0x0004, 0x2009, 0x0006, 0x200d, 0x0008, 0x2011, 0x000a, 0x2015, 0x000c, 0x2019, 0x000e, 0x201d,
326+ 0x0010, 0x2021, 0x0012, 0x2025, 0x0014, 0x2029, 0x0016, 0x202d, 0x0018, 0x2031, 0x001a, 0x2035, 0x001c, 0x2039, 0x001e, 0x203d,
327+ 0x0020, 0x2041, 0x0022, 0x2045, 0x0024, 0x2049, 0x0026, 0x204d, 0x0028, 0x2051, 0x002a, 0x2055, 0x002c, 0x2059, 0x002e, 0x205d,
328+ 0x0030, 0x2061, 0x0032, 0x2065, 0x0034, 0x2069, 0x0036, 0x206d, 0x0038, 0x2071, 0x003a, 0x2075, 0x003c, 0x2079, 0x203e, 0x407d,
329+ 0x0040, 0x2081, 0x0042, 0x2085, 0x0044, 0x2089, 0x0046, 0x208d, 0x0048, 0x2091, 0x004a, 0x2095, 0x004c, 0x2099, 0x004e, 0x209d,
330+ 0x0050, 0x20a1, 0x0052, 0x20a5, 0x0054, 0x20a9, 0x0056, 0x20ad, 0x0058, 0x20b1, 0x005a, 0x20b5, 0x005c, 0x20b9, 0x005e, 0x20bd,
331+ 0x0060, 0x20c1, 0x0062, 0x20c5, 0x0064, 0x20c9, 0x0066, 0x20cd, 0x0068, 0x20d1, 0x006a, 0x20d5, 0x006c, 0x20d9, 0x006e, 0x20dd,
332+ 0x0070, 0x20e1, 0x0072, 0x20e5, 0x0074, 0x20e9, 0x0076, 0x20ed, 0x0078, 0x20f1, 0x007a, 0x20f5, 0x207c, 0x40f9, 0x20be, 0x417d,
333+ 0x0480, 0x2501, 0x0482, 0x2505, 0x0484, 0x2509, 0x0486, 0x250d, 0x0488, 0x2511, 0x048a, 0x2515, 0x048c, 0x2519, 0x048e, 0x251d,
334+ 0x0490, 0x2521, 0x0492, 0x2525, 0x0494, 0x2529, 0x0496, 0x252d, 0x0498, 0x2531, 0x049a, 0x2535, 0x049c, 0x2539, 0x049e, 0x253d,
335+ 0x04a0, 0x2541, 0x04a2, 0x2545, 0x04a4, 0x2549, 0x04a6, 0x254d, 0x04a8, 0x2551, 0x04aa, 0x2555, 0x04ac, 0x2559, 0x04ae, 0x255d,
336+ 0x04b0, 0x2561, 0x04b2, 0x2565, 0x04b4, 0x2569, 0x04b6, 0x256d, 0x04b8, 0x2571, 0x04ba, 0x2575, 0x04bc, 0x2579, 0x253e, 0x467d,
337+ 0x08c0, 0x2981, 0x08c2, 0x2985, 0x08c4, 0x2989, 0x08c6, 0x298d, 0x08c8, 0x2991, 0x08ca, 0x2995, 0x08cc, 0x2999, 0x08ce, 0x299d,
338+ 0x08d0, 0x29a1, 0x08d2, 0x29a5, 0x08d4, 0x29a9, 0x08d6, 0x29ad, 0x08d8, 0x29b1, 0x08da, 0x29b5, 0x08dc, 0x29b9, 0x08de, 0x29bd,
339+ 0x0ce0, 0x2dc1, 0x0ce2, 0x2dc5, 0x0ce4, 0x2dc9, 0x0ce6, 0x2dcd, 0x0ce8, 0x2dd1, 0x0cea, 0x2dd5, 0x0cec, 0x2dd9, 0x0cee, 0x2ddd,
340+ 0x10f0, 0x31e1, 0x10f2, 0x31e5, 0x10f4, 0x31e9, 0x10f6, 0x31ed, 0x20f8, 0x41f1, 0x20fa, 0x41f5, 0x257c, 0x46f9, 0x29be, 0x4b7d
341341 };
342342
343343 /* hdlc_bitstuff_byte
@@ -598,22 +598,22 @@ static inline void hdlc_frag(struct bc_state *bcs, unsigned inbits) · 254 unmodified lines
598598 * bit 7 set if there are 5 or more "interior" consecutive '1' bits
599599 */
600600 static const unsigned char bitcounts[256] = {
601− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
602− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05,
603− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
604− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x80, 0x06,
605− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
606− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05,
607− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
608− 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x80, 0x81, 0x80, 0x07,
609− 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x14,
610− 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x15,
611− 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x14,
612− 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x90, 0x16,
613− 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x23, 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x24,
614− 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x23, 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x25,
615− 0x30, 0x31, 0x30, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x31, 0x30, 0x32, 0x30, 0x31, 0x30, 0x34,
616− 0x40, 0x41, 0x40, 0x42, 0x40, 0x41, 0x40, 0x43, 0x50, 0x51, 0x50, 0x52, 0x60, 0x61, 0x70, 0x78
601+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
602+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05,
603+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
604+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x80, 0x06,
605+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
606+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x05,
607+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x04,
608+ 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x80, 0x81, 0x80, 0x07,
609+ 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x14,
610+ 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x15,
611+ 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x14,
612+ 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x10, 0x13, 0x10, 0x11, 0x10, 0x12, 0x10, 0x11, 0x90, 0x16,
613+ 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x23, 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x24,
614+ 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x23, 0x20, 0x21, 0x20, 0x22, 0x20, 0x21, 0x20, 0x25,
615+ 0x30, 0x31, 0x30, 0x32, 0x30, 0x31, 0x30, 0x33, 0x30, 0x31, 0x30, 0x32, 0x30, 0x31, 0x30, 0x34,
616+ 0x40, 0x41, 0x40, 0x42, 0x40, 0x41, 0x40, 0x43, 0x50, 0x51, 0x50, 0x52, 0x60, 0x61, 0x70, 0x78
617617 };
618618
619619 /* hdlc_unpack
drivers/isdn/gigaset/proc.c+2−2
@@ -35,7 +35,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, · 34 unmodified lines
3535 if (!isspace(*end++))
3636 return -EINVAL;
3737 if (value < 0 || value > 1)
38− return -EINVAL;
38+ return -EINVAL;
3939
4040 if (mutex_lock_interruptible(&cs->mutex))
4141 return -ERESTARTSYS;
@@ -56,7 +56,7 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, · 14 unmodified lines
5656 return count;
5757 }
5858
59−static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode);
59+static DEVICE_ATTR(cidmode, S_IRUGO | S_IWUSR, show_cidmode, set_cidmode);
6060
6161 /* free sysfs for device */
6262 void gigaset_free_dev_sysfs(struct cardstate *cs)
drivers/isdn/gigaset/ser-gigaset.c+3−3
@@ -246,7 +246,7 @@ static int gigaset_write_cmd(struct cardstate *cs, struct cmdbuf_t *cb) · 245 unmodified lines
246246 unsigned long flags;
247247
248248 gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
249− DEBUG_TRANSCMD : DEBUG_LOCKCMD,
249+ DEBUG_TRANSCMD : DEBUG_LOCKCMD,
250250 "CMD Transmit", cb->len, cb->buf);
251251
252252 spin_lock_irqsave(&cs->cmdlock, flags);
@@ -773,8 +773,8 @@ static int __init ser_gigaset_init(void) · 520 unmodified lines
773773
774774 /* allocate memory for our driver state and initialize it */
775775 driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
776− GIGASET_MODULENAME, GIGASET_DEVNAME,
777− &ops, THIS_MODULE);
776+ GIGASET_MODULENAME, GIGASET_DEVNAME,
777+ &ops, THIS_MODULE);
778778 if (!driver)
779779 goto error;
780780
drivers/isdn/gigaset/usb-gigaset.c+4−4
@@ -184,7 +184,7 @@ static int set_value(struct cardstate *cs, u8 req, u16 val) · 183 unmodified lines
184184 (unsigned)req, (unsigned)val);
185185 r = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x12, 0x41,
186186 0xf /*?*/, 0, NULL, 0, 2000 /*?*/);
187− /* no idea what this does */
187+ /* no idea what this does */
188188 if (r < 0) {
189189 dev_err(&udev->dev, "error %d on request 0x12\n", -r);
190190 return r;
@@ -365,7 +365,7 @@ static void gigaset_read_int_callback(struct urb *urb) · 174 unmodified lines
365365 src = cs->hw.usb->rcvbuf;
366366 if (unlikely(*src))
367367 dev_warn(cs->dev,
368− "%s: There was no leading 0, but 0x%02x!\n",
368+ "%s: There was no leading 0, but 0x%02x!\n",
369369 __func__, (unsigned) *src);
370370 ++src; /* skip leading 0x00 */
371371 --numbytes;
@@ -465,7 +465,7 @@ static int send_cb(struct cardstate *cs, struct cmdbuf_t *cb) · 93 unmodified lines
465465
466466 usb_fill_bulk_urb(ucs->bulk_out_urb, ucs->udev,
467467 usb_sndbulkpipe(ucs->udev,
468− ucs->bulk_out_endpointAddr & 0x0f),
468+ ucs->bulk_out_endpointAddr & 0x0f),
469469 cb->buf + cb->offset, count,
470470 gigaset_write_bulk_callback, cs);
471471
@@ -499,7 +499,7 @@ static int gigaset_write_cmd(struct cardstate *cs, struct cmdbuf_t *cb) · 27 unmodified lines
499499 unsigned long flags;
500500
501501 gigaset_dbg_buffer(cs->mstate != MS_LOCKED ?
502− DEBUG_TRANSCMD : DEBUG_LOCKCMD,
502+ DEBUG_TRANSCMD : DEBUG_LOCKCMD,
503503 "CMD Transmit", cb->len, cb->buf);
504504
505505 spin_lock_irqsave(&cs->cmdlock, flags);
drivers/isdn/hardware/avm/avm_cs.c+67−67
@@ -44,12 +44,12 @@ static void avmcs_detach(struct pcmcia_device *p_dev); · 43 unmodified lines
4444
4545 static int avmcs_probe(struct pcmcia_device *p_dev)
4646 {
47− /* General socket configuration */
48− p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
49− p_dev->config_index = 1;
50− p_dev->config_regs = PRESENT_OPTION;
47+ /* General socket configuration */
48+ p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
49+ p_dev->config_index = 1;
50+ p_dev->config_regs = PRESENT_OPTION;
5151
52− return avmcs_config(p_dev);
52+ return avmcs_config(p_dev);
5353 } /* avmcs_attach */
5454
5555
@@ -69,75 +69,75 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev, void *priv_data) · 13 unmodified lines
6969
7070 static int avmcs_config(struct pcmcia_device *link)
7171 {
72− int i = -1;
73− char devname[128];
74− int cardtype;
75− int (*addcard)(unsigned int port, unsigned irq);
76−
77− devname[0] = 0;
78− if (link->prod_id[1])
79− strlcpy(devname, link->prod_id[1], sizeof(devname));
80−
81− /*
82− * find IO port
83− */
84− if (pcmcia_loop_config(link, avmcs_configcheck, NULL))
85− return -ENODEV;
86−
87− do {
88− if (!link->irq) {
89− /* undo */
90− pcmcia_disable_device(link);
91− break;
92− }
72+ int i = -1;
73+ char devname[128];
74+ int cardtype;
75+ int (*addcard)(unsigned int port, unsigned irq);
76+
77+ devname[0] = 0;
78+ if (link->prod_id[1])
79+ strlcpy(devname, link->prod_id[1], sizeof(devname));
9380
9481 /*
95− * configure the PCMCIA socket
96− */
97− i = pcmcia_enable_device(link);
82+ * find IO port
83+ */
84+ if (pcmcia_loop_config(link, avmcs_configcheck, NULL))
85+ return -ENODEV;
86+
87+ do {
88+ if (!link->irq) {
89+ /* undo */
90+ pcmcia_disable_device(link);
91+ break;
92+ }
93+
94+ /*
95+ * configure the PCMCIA socket
96+ */
97+ i = pcmcia_enable_device(link);
98+ if (i != 0) {
99+ pcmcia_disable_device(link);
100+ break;
101+ }
102+
103+ } while (0);
104+
105+ if (devname[0]) {
106+ char *s = strrchr(devname, ' ');
107+ if (!s)
108+ s = devname;
109+ else s++;
110+ if (strcmp("M1", s) == 0) {
111+ cardtype = AVM_CARDTYPE_M1;
112+ } else if (strcmp("M2", s) == 0) {
113+ cardtype = AVM_CARDTYPE_M2;
114+ } else {
115+ cardtype = AVM_CARDTYPE_B1;
116+ }
117+ } else
118+ cardtype = AVM_CARDTYPE_B1;
119+
120+ /* If any step failed, release any partially configured state */
98121 if (i != 0) {
99− pcmcia_disable_device(link);
100− break;
101− }
102−
103− } while (0);
104−
105− if (devname[0]) {
106− char *s = strrchr(devname, ' ');
107− if (!s)
108− s = devname;
109− else s++;
110− if (strcmp("M1", s) == 0) {
111− cardtype = AVM_CARDTYPE_M1;
112− } else if (strcmp("M2", s) == 0) {
113− cardtype = AVM_CARDTYPE_M2;
114− } else {
115− cardtype = AVM_CARDTYPE_B1;
122+ avmcs_release(link);
123+ return -ENODEV;
116124 }
117− } else
118− cardtype = AVM_CARDTYPE_B1;
119−
120− /* If any step failed, release any partially configured state */
121− if (i != 0) {
122− avmcs_release(link);
123− return -ENODEV;
124− }
125125
126126
127− switch (cardtype) {
128− case AVM_CARDTYPE_M1: addcard = b1pcmcia_addcard_m1; break;
129− case AVM_CARDTYPE_M2: addcard = b1pcmcia_addcard_m2; break;
127+ switch (cardtype) {
128+ case AVM_CARDTYPE_M1: addcard = b1pcmcia_addcard_m1; break;
129+ case AVM_CARDTYPE_M2: addcard = b1pcmcia_addcard_m2; break;
130130 default:
131− case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
132− }
133− if ((i = (*addcard)(link->resource[0]->start, link->irq)) < 0) {
134− dev_err(&link->dev,
135− "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n",
136− (unsigned int) link->resource[0]->start, link->irq);
137− avmcs_release(link);
138− return -ENODEV;
139− }
140− return 0;
131+ case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break;
132+ }
133+ if ((i = (*addcard)(link->resource[0]->start, link->irq)) < 0) {
134+ dev_err(&link->dev,
135+ "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n",
136+ (unsigned int) link->resource[0]->start, link->irq);
137+ avmcs_release(link);
138+ return -ENODEV;
139+ }
140+ return 0;
141141
142142 } /* avmcs_config */
143143
drivers/isdn/hardware/avm/avmcard.h+143−143
@@ -44,16 +44,16 @@ enum avmcardtype { · 43 unmodified lines
4444 };
4545
4646 typedef struct avmcard_dmabuf {
47− long size;
48− u8 *dmabuf;
49− dma_addr_t dmaaddr;
47+ long size;
48+ u8 *dmabuf;
49+ dma_addr_t dmaaddr;
5050 } avmcard_dmabuf;
5151
5252 typedef struct avmcard_dmainfo {
5353 u32 recvlen;
54− avmcard_dmabuf recvbuf;
54+ avmcard_dmabuf recvbuf;
5555
56− avmcard_dmabuf sendbuf;
56+ avmcard_dmabuf sendbuf;
5757 struct sk_buff_head send_queue;
5858
5959 struct pci_dev *pcidev;
@@ -61,22 +61,22 @@ typedef struct avmcard_dmainfo { · 1 unmodified line
6161
6262 typedef struct avmctrl_info {
6363 char cardname[32];
64−
64+
6565 int versionlen;
6666 char versionbuf[1024];
6767 char *version[AVM_MAXVERSION];
68−
68+
6969 char infobuf[128]; /* for function procinfo */
70−
70+
7171 struct avmcard *card;
7272 struct capi_ctr capi_ctrl;
73−
73+
7474 struct list_head ncci_head;
7575 } avmctrl_info;
7676
7777 typedef struct avmcard {
7878 char name[32];
79−
79+
8080 spinlock_t lock;
8181 unsigned int port;
8282 unsigned irq;
@@ -103,95 +103,95 @@ typedef struct avmcard { · 20 unmodified lines
103103 extern int b1_irq_table[16];
104104
105105 /*
106− * LLI Messages to the ISDN-ControllerISDN Controller
106+ * LLI Messages to the ISDN-ControllerISDN Controller
107107 */
108108
109109 #define SEND_POLL 0x72 /*
110− * after load <- RECEIVE_POLL
110+ * after load <- RECEIVE_POLL
111111 */
112112 #define SEND_INIT 0x11 /*
113− * first message <- RECEIVE_INIT
114− * int32 NumApplications int32
115− * NumNCCIs int32 BoardNumber
113+ * first message <- RECEIVE_INIT
114+ * int32 NumApplications int32
115+ * NumNCCIs int32 BoardNumber
116116 */
117117 #define SEND_REGISTER 0x12 /*
118− * register an application int32
119− * ApplIDId int32 NumMessages
120− * int32 NumB3Connections int32
121− * NumB3Blocks int32 B3Size
122− *
123− * AnzB3Connection != 0 &&
124− * AnzB3Blocks >= 1 && B3Size >= 1
118+ * register an application int32
119+ * ApplIDId int32 NumMessages
120+ * int32 NumB3Connections int32
121+ * NumB3Blocks int32 B3Size
122+ *
123+ * AnzB3Connection != 0 &&
124+ * AnzB3Blocks >= 1 && B3Size >= 1
125125 */
126126 #define SEND_RELEASE 0x14 /*
127− * deregister an application int32
128− * ApplID
127+ * deregister an application int32
128+ * ApplID
129129 */
130130 #define SEND_MESSAGE 0x15 /*
131− * send capi-message int32 length
132− * capi-data ...
131+ * send capi-message int32 length
132+ * capi-data ...
133133 */
134134 #define SEND_DATA_B3_REQ 0x13 /*
135− * send capi-data-message int32
136− * MsgLength capi-data ... int32
137− * B3Length data ....
135+ * send capi-data-message int32
136+ * MsgLength capi-data ... int32
137+ * B3Length data ....
138138 */
139139
140140 #define SEND_CONFIG 0x21 /*
141− */
141+ */
142142
143143 #define SEND_POLLACK 0x73 /* T1 Watchdog */
144144
145145 /*
146− * LLI Messages from the ISDN-ControllerISDN Controller
146+ * LLI Messages from the ISDN-ControllerISDN Controller
147147 */
148148
149149 #define RECEIVE_POLL 0x32 /*
150− * <- after SEND_POLL
150+ * <- after SEND_POLL
151151 */
152152 #define RECEIVE_INIT 0x27 /*
153− * <- after SEND_INIT int32 length
154− * byte total length b1struct board
155− * driver revision b1struct card
156− * type b1struct reserved b1struct
157− * serial number b1struct driver
158− * capability b1struct d-channel
159− * protocol b1struct CAPI-2.0
160− * profile b1struct capi version
153+ * <- after SEND_INIT int32 length
154+ * byte total length b1struct board
155+ * driver revision b1struct card
156+ * type b1struct reserved b1struct
157+ * serial number b1struct driver
158+ * capability b1struct d-channel
159+ * protocol b1struct CAPI-2.0
160+ * profile b1struct capi version
161161 */
162162 #define RECEIVE_MESSAGE 0x21 /*
163− * <- after SEND_MESSAGE int32
164− * AppllID int32 Length capi-data
165− * ....
163+ * <- after SEND_MESSAGE int32
164+ * AppllID int32 Length capi-data
165+ * ....
166166 */
167167 #define RECEIVE_DATA_B3_IND 0x22 /*
168− * received data int32 AppllID
169− * int32 Length capi-data ...
170− * int32 B3Length data ...
168+ * received data int32 AppllID
169+ * int32 Length capi-data ...
170+ * int32 B3Length data ...
171171 */
172172 #define RECEIVE_START 0x23 /*
173− * Handshake
173+ * Handshake
174174 */
175175 #define RECEIVE_STOP 0x24 /*
176− * Handshake
176+ * Handshake
177177 */
178178 #define RECEIVE_NEW_NCCI 0x25 /*
179− * int32 AppllID int32 NCCI int32
180− * WindowSize
179+ * int32 AppllID int32 NCCI int32
180+ * WindowSize
181181 */
182182 #define RECEIVE_FREE_NCCI 0x26 /*
183− * int32 AppllID int32 NCCI
183+ * int32 AppllID int32 NCCI
184184 */
185185 #define RECEIVE_RELEASE 0x26 /*
186− * int32 AppllID int32 0xffffffff
186+ * int32 AppllID int32 0xffffffff
187187 */
188188 #define RECEIVE_TASK_READY 0x31 /*
189− * int32 tasknr
190− * int32 Length Taskname ...
189+ * int32 tasknr
190+ * int32 Length Taskname ...
191191 */
192192 #define RECEIVE_DEBUGMSG 0x71 /*
193− * int32 Length message
194− *
193+ * int32 Length message
194+ *
195195 */
196196 #define RECEIVE_POLLDWORD 0x75 /* t1pci in dword mode */
197197
@@ -264,7 +264,7 @@ static inline void b1_put_byte(unsigned int base, unsigned char val) · 66 unmodified lines
264264 static inline int b1_save_put_byte(unsigned int base, unsigned char val)
265265 {
266266 unsigned long stop = jiffies + 2 * HZ;
267− while (!b1_tx_empty(base) && time_before(jiffies,stop));
267+ while (!b1_tx_empty(base) && time_before(jiffies, stop));
268268 if (!b1_tx_empty(base)) return -1;
269269 b1outp(base, B1_WRITE, val);
270270 return 0;
@@ -298,21 +298,21 @@ static inline void b1_put_slice(unsigned int base, · 27 unmodified lines
298298 }
299299
300300 static void b1_wr_reg(unsigned int base,
301− unsigned int reg,
301+ unsigned int reg,
302302 unsigned int value)
303303 {
304304 b1_put_byte(base, WRITE_REGISTER);
305− b1_put_word(base, reg);
306− b1_put_word(base, value);
305+ b1_put_word(base, reg);
306+ b1_put_word(base, value);
307307 }
308308
309309 static inline unsigned int b1_rd_reg(unsigned int base,
310− unsigned int reg)
310+ unsigned int reg)
311311 {
312312 b1_put_byte(base, READ_REGISTER);
313− b1_put_word(base, reg);
314− return b1_get_word(base);
315−
313+ b1_put_word(base, reg);
314+ return b1_get_word(base);
315+
316316 }
317317
318318 static inline void b1_reset(unsigned int base)
@@ -338,13 +338,13 @@ static inline void b1_set_test_bit(unsigned int base, · 19 unmodified lines
338338 enum avmcardtype cardtype,
339339 int onoff)
340340 {
341− b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20);
341+ b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20);
342342 }
343343
344344 static inline int b1_get_test_bit(unsigned int base,
345− enum avmcardtype cardtype)
345+ enum avmcardtype cardtype)
346346 {
347− return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0;
347+ return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0;
348348 }
349349
350350 /* ---------------------------------------------------------------- */
@@ -391,7 +391,7 @@ static inline void t1outp(unsigned int base, · 40 unmodified lines
391391 }
392392
393393 static inline unsigned char t1inp(unsigned int base,
394− unsigned short offset)
394+ unsigned short offset)
395395 {
396396 return inb(base + offset);
397397 }
@@ -415,42 +415,42 @@ static inline unsigned int t1_get_slice(unsigned int base, · 17 unmodified lines
415415 #endif
416416
417417 len = i = b1_get_word(base);
418− if (t1_isfastlink(base)) {
418+ if (t1_isfastlink(base)) {
419419 int status;
420420 while (i > 0) {
421− status = t1_fifostatus(base) & (T1F_IREADY|T1F_IHALF);
421+ status = t1_fifostatus(base) & (T1F_IREADY | T1F_IHALF);
422422 if (i >= FIFO_INPBSIZE) status |= T1F_IFULL;
423423
424424 switch (status) {
425− case T1F_IREADY|T1F_IHALF|T1F_IFULL:
426− insb(base+B1_READ, dp, FIFO_INPBSIZE);
427− dp += FIFO_INPBSIZE;
428− i -= FIFO_INPBSIZE;
425+ case T1F_IREADY | T1F_IHALF | T1F_IFULL:
426+ insb(base + B1_READ, dp, FIFO_INPBSIZE);
427+ dp += FIFO_INPBSIZE;
428+ i -= FIFO_INPBSIZE;
429429 #ifdef FASTLINK_DEBUG
430− wcnt += FIFO_INPBSIZE;
430+ wcnt += FIFO_INPBSIZE;
431431 #endif
432− break;
433− case T1F_IREADY|T1F_IHALF:
434− insb(base+B1_READ,dp, i);
432+ break;
433+ case T1F_IREADY | T1F_IHALF:
434+ insb(base + B1_READ, dp, i);
435435 #ifdef FASTLINK_DEBUG
436− wcnt += i;
436+ wcnt += i;
437437 #endif
438− dp += i;
439− i = 0;
440− break;
441− default:
442− *dp++ = b1_get_byte(base);
443− i--;
438+ dp += i;
439+ i = 0;
440+ break;
441+ default:
442+ *dp++ = b1_get_byte(base);
443+ i--;
444444 #ifdef FASTLINK_DEBUG
445− bcnt++;
445+ bcnt++;
446446 #endif
447− break;
447+ break;
448448 }
449− }
449+ }
450450 #ifdef FASTLINK_DEBUG
451− if (wcnt)
452− printk(KERN_DEBUG "b1lli(0x%x): get_slice l=%d w=%d b=%d\n",
453− base, len, wcnt, bcnt);
451+ if (wcnt)
452+ printk(KERN_DEBUG "b1lli(0x%x): get_slice l=%d w=%d b=%d\n",
453+ base, len, wcnt, bcnt);
454454 #endif
455455 } else {
456456 while (i-- > 0)
@@ -464,26 +464,26 @@ static inline void t1_put_slice(unsigned int base, · 7 unmodified lines
464464 {
465465 unsigned i = len;
466466 b1_put_word(base, i);
467− if (t1_isfastlink(base)) {
467+ if (t1_isfastlink(base)) {
468468 int status;
469469 while (i > 0) {
470− status = t1_fifostatus(base) & (T1F_OREADY|T1F_OHALF);
470+ status = t1_fifostatus(base) & (T1F_OREADY | T1F_OHALF);
471471 if (i >= FIFO_OUTBSIZE) status |= T1F_OEMPTY;
472472 switch (status) {
473− case T1F_OREADY|T1F_OHALF|T1F_OEMPTY:
474− outsb(base+B1_WRITE, dp, FIFO_OUTBSIZE);
475− dp += FIFO_OUTBSIZE;
476− i -= FIFO_OUTBSIZE;
477− break;
478− case T1F_OREADY|T1F_OHALF:
479− outsb(base+B1_WRITE, dp, i);
480− dp += i;
481− i = 0;
482− break;
483− default:
484− b1_put_byte(base, *dp++);
485− i--;
486− break;
473+ case T1F_OREADY | T1F_OHALF | T1F_OEMPTY:
474+ outsb(base + B1_WRITE, dp, FIFO_OUTBSIZE);
475+ dp += FIFO_OUTBSIZE;
476+ i -= FIFO_OUTBSIZE;
477+ break;
478+ case T1F_OREADY | T1F_OHALF:
479+ outsb(base + B1_WRITE, dp, i);
480+ dp += i;
481+ i = 0;
482+ break;
483+ default:
484+ b1_put_byte(base, *dp++);
485+ i--;
486+ break;
487487 }
488488 }
489489 } else {
@@ -494,18 +494,18 @@ static inline void t1_put_slice(unsigned int base, · 4 unmodified lines
494494
495495 static inline void t1_disable_irq(unsigned int base)
496496 {
497− t1outp(base, T1_IRQMASTER, 0x00);
497+ t1outp(base, T1_IRQMASTER, 0x00);
498498 }
499499
500500 static inline void t1_reset(unsigned int base)
501501 {
502− /* reset T1 Controller */
503− b1_reset(base);
504− /* disable irq on HEMA */
505− t1outp(base, B1_INSTAT, 0x00);
506− t1outp(base, B1_OUTSTAT, 0x00);
507− t1outp(base, T1_IRQMASTER, 0x00);
508− /* reset HEMA board configuration */
502+ /* reset T1 Controller */
503+ b1_reset(base);
504+ /* disable irq on HEMA */
505+ t1outp(base, B1_INSTAT, 0x00);
506+ t1outp(base, B1_OUTSTAT, 0x00);
507+ t1outp(base, T1_IRQMASTER, 0x00);
508+ /* reset HEMA board configuration */
509509 t1outp(base, T1_RESETBOARD, 0xf);
510510 }
511511
@@ -513,29 +513,29 @@ static inline void b1_setinterrupt(unsigned int base, unsigned irq, · 1 unmodified line
513513 enum avmcardtype cardtype)
514514 {
515515 switch (cardtype) {
516− case avm_t1isa:
517− t1outp(base, B1_INSTAT, 0x00);
518− t1outp(base, B1_INSTAT, 0x02);
519− t1outp(base, T1_IRQMASTER, 0x08);
520− break;
521− case avm_b1isa:
522− b1outp(base, B1_INSTAT, 0x00);
523− b1outp(base, B1_RESET, b1_irq_table[irq]);
524− b1outp(base, B1_INSTAT, 0x02);
525− break;
526− default:
527− case avm_m1:
528− case avm_m2:
529− case avm_b1pci:
530− b1outp(base, B1_INSTAT, 0x00);
531− b1outp(base, B1_RESET, 0xf0);
532− b1outp(base, B1_INSTAT, 0x02);
533− break;
534− case avm_c4:
535− case avm_t1pci:
536− b1outp(base, B1_RESET, 0xf0);
537− break;
538− }
516+ case avm_t1isa:
517+ t1outp(base, B1_INSTAT, 0x00);
518+ t1outp(base, B1_INSTAT, 0x02);
519+ t1outp(base, T1_IRQMASTER, 0x08);
520+ break;
521+ case avm_b1isa:
522+ b1outp(base, B1_INSTAT, 0x00);
523+ b1outp(base, B1_RESET, b1_irq_table[irq]);
524+ b1outp(base, B1_INSTAT, 0x02);
525+ break;
526+ default:
527+ case avm_m1:
528+ case avm_m2:
529+ case avm_b1pci:
530+ b1outp(base, B1_INSTAT, 0x00);
531+ b1outp(base, B1_RESET, 0xf0);
532+ b1outp(base, B1_INSTAT, 0x02);
533+ break;
534+ case avm_c4:
535+ case avm_t1pci:
536+ b1outp(base, B1_RESET, 0xf0);
537+ break;
538+ }
539539 }
540540
541541 /* b1.c */
@@ -543,14 +543,14 @@ avmcard *b1_alloc_card(int nr_controllers); · 1 unmodified line
543543 void b1_free_card(avmcard *card);
544544 int b1_detect(unsigned int base, enum avmcardtype cardtype);
545545 void b1_getrevision(avmcard *card);
546−int b1_load_t4file(avmcard *card, capiloaddatapart * t4file);
547−int b1_load_config(avmcard *card, capiloaddatapart * config);
546+int b1_load_t4file(avmcard *card, capiloaddatapart *t4file);
547+int b1_load_config(avmcard *card, capiloaddatapart *config);
548548 int b1_loaded(avmcard *card);
549549
550550 int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data);
551551 void b1_reset_ctr(struct capi_ctr *ctrl);
552552 void b1_register_appl(struct capi_ctr *ctrl, u16 appl,
553− capi_register_params *rp);
553+ capi_register_params *rp);
554554 void b1_release_appl(struct capi_ctr *ctrl, u16 appl);
555555 u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
556556 void b1_parse_version(avmctrl_info *card);
@@ -572,8 +572,8 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); · 15 unmodified lines
572572 void b1dma_reset_ctr(struct capi_ctr *ctrl);
573573 void b1dma_remove_ctr(struct capi_ctr *ctrl);
574574 void b1dma_register_appl(struct capi_ctr *ctrl,
575− u16 appl,
576− capi_register_params *rp);
575+ u16 appl,
576+ capi_register_params *rp);
577577 void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl);
578578 u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb);
579579 extern const struct file_operations b1dmactl_proc_fops;
drivers/isdn/hardware/avm/b1.c+96−96
@@ -1,7 +1,7 @@
11 /* $Id: b1.c,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2− *
2+ *
33 * Common module for AVM B1 cards.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
66 *
77 * This software may be used and distributed according to the terms
@@ -60,7 +60,7 @@ int b1_irq_table[16] = · 52 unmodified lines
6060 112, /* irq 15 */
6161 };
6262
63−/* ------------------------------------------------------------- */
63+/* ------------------------------------------------------------- */
6464
6565 avmcard *b1_alloc_card(int nr_controllers)
6666 {
@@ -104,13 +104,13 @@ int b1_detect(unsigned int base, enum avmcardtype cardtype) · 37 unmodified lines
104104 int onoff, i;
105105
106106 /*
107− * Statusregister 0000 00xx
107+ * Statusregister 0000 00xx
108108 */
109109 if ((inb(base + B1_INSTAT) & 0xfc)
110110 || (inb(base + B1_OUTSTAT) & 0xfc))
111111 return 1;
112112 /*
113− * Statusregister 0000 001x
113+ * Statusregister 0000 001x
114114 */
115115 b1outp(base, B1_INSTAT, 0x2); /* enable irq */
116116 /* b1outp(base, B1_OUTSTAT, 0x2); */
@@ -118,38 +118,38 @@ int b1_detect(unsigned int base, enum avmcardtype cardtype) · 1 unmodified line
118118 /* || (inb(base + B1_OUTSTAT) & 0xfe) != 0x2 */)
119119 return 2;
120120 /*
121− * Statusregister 0000 000x
121+ * Statusregister 0000 000x
122122 */
123123 b1outp(base, B1_INSTAT, 0x0); /* disable irq */
124124 b1outp(base, B1_OUTSTAT, 0x0);
125125 if ((inb(base + B1_INSTAT) & 0xfe)
126126 || (inb(base + B1_OUTSTAT) & 0xfe))
127127 return 3;
128−
129− for (onoff = !0, i= 0; i < 10 ; i++) {
128+
129+ for (onoff = !0, i = 0; i < 10; i++) {
130130 b1_set_test_bit(base, cardtype, onoff);
131131 if (b1_get_test_bit(base, cardtype) != onoff)
132− return 4;
132+ return 4;
133133 onoff = !onoff;
134134 }
135135
136136 if (cardtype == avm_m1)
137− return 0;
137+ return 0;
138138
139− if ((b1_rd_reg(base, B1_STAT1(cardtype)) & 0x0f) != 0x01)
140− return 5;
139+ if ((b1_rd_reg(base, B1_STAT1(cardtype)) & 0x0f) != 0x01)
140+ return 5;
141141
142142 return 0;
143143 }
144144
145145 void b1_getrevision(avmcard *card)
146146 {
147− card->class = inb(card->port + B1_ANALYSE);
148− card->revision = inb(card->port + B1_REVISION);
147+ card->class = inb(card->port + B1_ANALYSE);
148+ card->revision = inb(card->port + B1_REVISION);
149149 }
150150
151151 #define FWBUF_SIZE 256
152−int b1_load_t4file(avmcard *card, capiloaddatapart * t4file)
152+int b1_load_t4file(avmcard *card, capiloaddatapart *t4file)
153153 {
154154 unsigned char buf[FWBUF_SIZE];
155155 unsigned char *dp;
@@ -168,7 +168,7 @@ int b1_load_t4file(avmcard *card, capiloaddatapart * t4file) · 12 unmodified lines
168168 for (i = 0; i < FWBUF_SIZE; i++)
169169 if (b1_save_put_byte(base, buf[i]) < 0) {
170170 printk(KERN_ERR "%s: corrupted firmware file ?\n",
171− card->name);
171+ card->name);
172172 return -EIO;
173173 }
174174 left -= FWBUF_SIZE;
@@ -184,14 +184,14 @@ int b1_load_t4file(avmcard *card, capiloaddatapart * t4file) · 9 unmodified lines
184184 for (i = 0; i < left; i++)
185185 if (b1_save_put_byte(base, buf[i]) < 0) {
186186 printk(KERN_ERR "%s: corrupted firmware file ?\n",
187− card->name);
187+ card->name);
188188 return -EIO;
189189 }
190190 }
191191 return 0;
192192 }
193193
194−int b1_load_config(avmcard *card, capiloaddatapart * config)
194+int b1_load_config(avmcard *card, capiloaddatapart *config)
195195 {
196196 unsigned char buf[FWBUF_SIZE];
197197 unsigned char *dp;
@@ -202,9 +202,9 @@ int b1_load_config(avmcard *card, capiloaddatapart * config) · 4 unmodified lines
202202 left = config->len;
203203 if (left) {
204204 b1_put_byte(base, SEND_CONFIG);
205− b1_put_word(base, 1);
205+ b1_put_word(base, 1);
206206 b1_put_byte(base, SEND_CONFIG);
207− b1_put_word(base, left);
207+ b1_put_word(base, left);
208208 }
209209 while (left > FWBUF_SIZE) {
210210 if (config->user) {
@@ -215,7 +215,7 @@ int b1_load_config(avmcard *card, capiloaddatapart * config) · 4 unmodified lines
215215 }
216216 for (i = 0; i < FWBUF_SIZE; ) {
217217 b1_put_byte(base, SEND_CONFIG);
218− for (j=0; j < 4; j++) {
218+ for (j = 0; j < 4; j++) {
219219 b1_put_byte(base, buf[i++]);
220220 }
221221 }
@@ -231,7 +231,7 @@ int b1_load_config(avmcard *card, capiloaddatapart * config) · 9 unmodified lines
231231 }
232232 for (i = 0; i < left; ) {
233233 b1_put_byte(base, SEND_CONFIG);
234− for (j=0; j < 4; j++) {
234+ for (j = 0; j < 4; j++) {
235235 if (i < left)
236236 b1_put_byte(base, buf[i++]);
237237 else
@@ -255,7 +255,7 @@ int b1_loaded(avmcard *card) · 17 unmodified lines
255255 }
256256 if (!b1_tx_empty(base)) {
257257 printk(KERN_ERR "%s: b1_loaded: tx err, corrupted t4 file ?\n",
258− card->name);
258+ card->name);
259259 return 0;
260260 }
261261 b1_put_byte(base, SEND_POLL);
@@ -265,7 +265,7 @@ int b1_loaded(avmcard *card) · 3 unmodified lines
265265 return 1;
266266 }
267267 printk(KERN_ERR "%s: b1_loaded: got 0x%x, firmware not running\n",
268− card->name, ans);
268+ card->name, ans);
269269 return 0;
270270 }
271271 }
@@ -288,7 +288,7 @@ int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 16 unmodified lines
288288 if ((retval = b1_load_t4file(card, &data->firmware))) {
289289 b1_reset(port);
290290 printk(KERN_ERR "%s: failed to load t4file!!\n",
291− card->name);
291+ card->name);
292292 return retval;
293293 }
294294
@@ -298,7 +298,7 @@ int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 3 unmodified lines
298298 if ((retval = b1_load_config(card, &data->configuration))) {
299299 b1_reset(port);
300300 printk(KERN_ERR "%s: failed to load config!!\n",
301− card->name);
301+ card->name);
302302 return retval;
303303 }
304304 }
@@ -312,7 +312,7 @@ int b1_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 7 unmodified lines
312312 b1_setinterrupt(port, card->irq, card->cardtype);
313313 b1_put_byte(port, SEND_INIT);
314314 b1_put_word(port, CAPI_MAXAPPL);
315− b1_put_word(port, AVM_NCCI_PER_CHANNEL*2);
315+ b1_put_word(port, AVM_NCCI_PER_CHANNEL * 2);
316316 b1_put_word(port, ctrl->cnr - 1);
317317 spin_unlock_irqrestore(&card->lock, flags);
318318
@@ -337,8 +337,8 @@ void b1_reset_ctr(struct capi_ctr *ctrl) · 18 unmodified lines
337337 }
338338
339339 void b1_register_appl(struct capi_ctr *ctrl,
340− u16 appl,
341− capi_register_params *rp)
340+ u16 appl,
341+ capi_register_params *rp)
342342 {
343343 avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
344344 avmcard *card = cinfo->card;
@@ -353,7 +353,7 @@ void b1_register_appl(struct capi_ctr *ctrl, · 8 unmodified lines
353353 spin_lock_irqsave(&card->lock, flags);
354354 b1_put_byte(port, SEND_REGISTER);
355355 b1_put_word(port, appl);
356− b1_put_word(port, 1024 * (nconn+1));
356+ b1_put_word(port, 1024 * (nconn + 1));
357357 b1_put_word(port, nconn);
358358 b1_put_word(port, rp->datablkcnt);
359359 b1_put_word(port, rp->datablklen);
@@ -430,7 +430,7 @@ void b1_parse_version(avmctrl_info *cinfo) · 70 unmodified lines
430430 cinfo->version[j] = &cinfo->versionbuf[i + 1];
431431
432432 strlcpy(ctrl->serial, cinfo->version[VER_SERIAL], sizeof(ctrl->serial));
433− memcpy(&ctrl->profile, cinfo->version[VER_PROFILE],sizeof(capi_profile));
433+ memcpy(&ctrl->profile, cinfo->version[VER_PROFILE], sizeof(capi_profile));
434434 strlcpy(ctrl->manu, "AVM GmbH", sizeof(ctrl->manu));
435435 dversion = cinfo->version[VER_DRIVER];
436436 ctrl->version.majorversion = 2;
@@ -439,49 +439,49 @@ void b1_parse_version(avmctrl_info *cinfo) · 2 unmodified lines
439439 ctrl->version.majormanuversion |= ((dversion[2] - '0') & 0xf);
440440 ctrl->version.minormanuversion = (dversion[3] - '0') << 4;
441441 ctrl->version.minormanuversion |=
442− (dversion[5] - '0') * 10 + ((dversion[6] - '0') & 0xf);
442+ (dversion[5] - '0') * 10 + ((dversion[6] - '0') & 0xf);
443443
444444 profp = &ctrl->profile;
445445
446446 flag = ((u8 *)(profp->manu))[1];
447447 switch (flag) {
448448 case 0: if (cinfo->version[VER_CARDTYPE])
449− strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]);
450− else strcpy(cinfo->cardname, "B1");
449+ strcpy(cinfo->cardname, cinfo->version[VER_CARDTYPE]);
450+ else strcpy(cinfo->cardname, "B1");
451451 break;
452− case 3: strcpy(cinfo->cardname,"PCMCIA B"); break;
453− case 4: strcpy(cinfo->cardname,"PCMCIA M1"); break;
454− case 5: strcpy(cinfo->cardname,"PCMCIA M2"); break;
455− case 6: strcpy(cinfo->cardname,"B1 V3.0"); break;
456− case 7: strcpy(cinfo->cardname,"B1 PCI"); break;
452+ case 3: strcpy(cinfo->cardname, "PCMCIA B"); break;
453+ case 4: strcpy(cinfo->cardname, "PCMCIA M1"); break;
454+ case 5: strcpy(cinfo->cardname, "PCMCIA M2"); break;
455+ case 6: strcpy(cinfo->cardname, "B1 V3.0"); break;
456+ case 7: strcpy(cinfo->cardname, "B1 PCI"); break;
457457 default: sprintf(cinfo->cardname, "AVM?%u", (unsigned int)flag); break;
458− }
459− printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n",
460− card->name, ctrl->cnr, cinfo->cardname);
458+ }
459+ printk(KERN_NOTICE "%s: card %d \"%s\" ready.\n",
460+ card->name, ctrl->cnr, cinfo->cardname);
461461
462− flag = ((u8 *)(profp->manu))[3];
463− if (flag)
462+ flag = ((u8 *)(profp->manu))[3];
463+ if (flag)
464464 printk(KERN_NOTICE "%s: card %d Protocol:%s%s%s%s%s%s%s\n",
465− card->name,
466− ctrl->cnr,
467− (flag & 0x01) ? " DSS1" : "",
468− (flag & 0x02) ? " CT1" : "",
469− (flag & 0x04) ? " VN3" : "",
470− (flag & 0x08) ? " NI1" : "",
471− (flag & 0x10) ? " AUSTEL" : "",
472− (flag & 0x20) ? " ESS" : "",
473− (flag & 0x40) ? " 1TR6" : ""
465+ card->name,
466+ ctrl->cnr,
467+ (flag & 0x01) ? " DSS1" : "",
468+ (flag & 0x02) ? " CT1" : "",
469+ (flag & 0x04) ? " VN3" : "",
470+ (flag & 0x08) ? " NI1" : "",
471+ (flag & 0x10) ? " AUSTEL" : "",
472+ (flag & 0x20) ? " ESS" : "",
473+ (flag & 0x40) ? " 1TR6" : ""
474474 );
475475
476− flag = ((u8 *)(profp->manu))[5];
476+ flag = ((u8 *)(profp->manu))[5];
477477 if (flag)
478478 printk(KERN_NOTICE "%s: card %d Linetype:%s%s%s%s\n",
479− card->name,
480− ctrl->cnr,
481− (flag & 0x01) ? " point to point" : "",
482− (flag & 0x02) ? " point to multipoint" : "",
483− (flag & 0x08) ? " leased line without D-channel" : "",
484− (flag & 0x04) ? " leased line with D-channel" : ""
479+ card->name,
480+ ctrl->cnr,
481+ (flag & 0x01) ? " point to point" : "",
482+ (flag & 0x02) ? " point to multipoint" : "",
483+ (flag & 0x08) ? " leased line without D-channel" : "",
484+ (flag & 0x04) ? " leased line with D-channel" : ""
485485 );
486486 }
487487
@@ -521,13 +521,13 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) · 33 unmodified lines
521521 spin_unlock_irqrestore(&card->lock, flags);
522522
523523 if (MsgLen < 30) { /* not CAPI 64Bit */
524− memset(card->msgbuf+MsgLen, 0, 30-MsgLen);
524+ memset(card->msgbuf + MsgLen, 0, 30-MsgLen);
525525 MsgLen = 30;
526526 CAPIMSG_SETLEN(card->msgbuf, 30);
527527 }
528528 if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
529529 printk(KERN_ERR "%s: incoming packet dropped\n",
530− card->name);
530+ card->name);
531531 } else {
532532 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
533533 memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
@@ -541,7 +541,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) · 7 unmodified lines
541541 MsgLen = b1_get_slice(card->port, card->msgbuf);
542542 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
543543 printk(KERN_ERR "%s: incoming packet dropped\n",
544− card->name);
544+ card->name);
545545 spin_unlock_irqrestore(&card->lock, flags);
546546 } else {
547547 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
@@ -573,7 +573,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) · 25 unmodified lines
573573 break;
574574
575575 case RECEIVE_START:
576− /* b1_put_byte(card->port, SEND_POLLACK); */
576+ /* b1_put_byte(card->port, SEND_POLLACK); */
577577 spin_unlock_irqrestore(&card->lock, flags);
578578 capi_ctr_resume_output(ctrl);
579579 break;
@@ -600,24 +600,24 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) · 20 unmodified lines
600600 MsgLen = b1_get_slice(card->port, card->msgbuf);
601601 spin_unlock_irqrestore(&card->lock, flags);
602602 card->msgbuf[MsgLen] = 0;
603− while ( MsgLen > 0
604− && ( card->msgbuf[MsgLen-1] == '\n'
605− || card->msgbuf[MsgLen-1] == '\r')) {
606− card->msgbuf[MsgLen-1] = 0;
603+ while (MsgLen > 0
604+ && (card->msgbuf[MsgLen - 1] == '\n'
605+ || card->msgbuf[MsgLen - 1] == '\r')) {
606+ card->msgbuf[MsgLen - 1] = 0;
607607 MsgLen--;
608608 }
609609 printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
610− card->name, ApplId, card->msgbuf);
610+ card->name, ApplId, card->msgbuf);
611611 break;
612612
613613 case RECEIVE_DEBUGMSG:
614614 MsgLen = b1_get_slice(card->port, card->msgbuf);
615615 spin_unlock_irqrestore(&card->lock, flags);
616616 card->msgbuf[MsgLen] = 0;
617− while ( MsgLen > 0
618− && ( card->msgbuf[MsgLen-1] == '\n'
619− || card->msgbuf[MsgLen-1] == '\r')) {
620− card->msgbuf[MsgLen-1] = 0;
617+ while (MsgLen > 0
618+ && (card->msgbuf[MsgLen - 1] == '\n'
619+ || card->msgbuf[MsgLen - 1] == '\r')) {
620+ card->msgbuf[MsgLen - 1] = 0;
621621 MsgLen--;
622622 }
623623 printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -630,7 +630,7 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) · 6 unmodified lines
630630 default:
631631 spin_unlock_irqrestore(&card->lock, flags);
632632 printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
633− card->name, b1cmd);
633+ card->name, b1cmd);
634634 return IRQ_HANDLED;
635635 }
636636 return IRQ_HANDLED;
@@ -671,29 +671,29 @@ static int b1ctl_proc_show(struct seq_file *m, void *v) · 34 unmodified lines
671671 seq_printf(m, "%-16s %s\n", "ver_serial", s);
672672
673673 if (card->cardtype != avm_m1) {
674− flag = ((u8 *)(ctrl->profile.manu))[3];
675− if (flag)
674+ flag = ((u8 *)(ctrl->profile.manu))[3];
675+ if (flag)
676676 seq_printf(m, "%-16s%s%s%s%s%s%s%s\n",
677− "protocol",
678− (flag & 0x01) ? " DSS1" : "",
679− (flag & 0x02) ? " CT1" : "",
680− (flag & 0x04) ? " VN3" : "",
681− (flag & 0x08) ? " NI1" : "",
682− (flag & 0x10) ? " AUSTEL" : "",
683− (flag & 0x20) ? " ESS" : "",
684− (flag & 0x40) ? " 1TR6" : ""
685− );
677+ "protocol",
678+ (flag & 0x01) ? " DSS1" : "",
679+ (flag & 0x02) ? " CT1" : "",
680+ (flag & 0x04) ? " VN3" : "",
681+ (flag & 0x08) ? " NI1" : "",
682+ (flag & 0x10) ? " AUSTEL" : "",
683+ (flag & 0x20) ? " ESS" : "",
684+ (flag & 0x40) ? " 1TR6" : ""
685+ );
686686 }
687687 if (card->cardtype != avm_m1) {
688− flag = ((u8 *)(ctrl->profile.manu))[5];
688+ flag = ((u8 *)(ctrl->profile.manu))[5];
689689 if (flag)
690690 seq_printf(m, "%-16s%s%s%s%s\n",
691− "linetype",
692− (flag & 0x01) ? " point to point" : "",
693− (flag & 0x02) ? " point to multipoint" : "",
694− (flag & 0x08) ? " leased line without D-channel" : "",
695− (flag & 0x04) ? " leased line with D-channel" : ""
696− );
691+ "linetype",
692+ (flag & 0x01) ? " point to point" : "",
693+ (flag & 0x02) ? " point to multipoint" : "",
694+ (flag & 0x08) ? " leased line without D-channel" : "",
695+ (flag & 0x04) ? " leased line with D-channel" : ""
696+ );
697697 }
698698 seq_printf(m, "%-16s %s\n", "cardname", cinfo->cardname);
699699
@@ -750,12 +750,12 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize) · 50 unmodified lines
750750
751751 return p;
752752
753− err_free_consistent:
753+err_free_consistent:
754754 pci_free_consistent(p->pcidev, p->recvbuf.size,
755755 p->recvbuf.dmabuf, p->recvbuf.dmaaddr);
756− err_kfree:
756+err_kfree:
757757 kfree(p);
758− err:
758+err:
759759 return NULL;
760760 }
761761
@@ -800,7 +800,7 @@ static int __init b1_init(void) · 38 unmodified lines
800800 if ((p = strchr(revision, ':')) != NULL && p[1]) {
801801 strlcpy(rev, p + 2, 32);
802802 if ((p = strchr(rev, '$')) != NULL && p > rev)
803− *(p-1) = 0;
803+ *(p - 1) = 0;
804804 } else
805805 strcpy(rev, "1.0");
806806
drivers/isdn/hardware/avm/b1dma.c+89−89
@@ -1,9 +1,9 @@
11 /* $Id: b1dma.c,v 1.1.2.3 2004/02/10 01:07:12 keil Exp $
2− *
2+ *
33 * Common module for AVM B1 cards that support dma with AMCC
4− *
4+ *
55 * Copyright 2000 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -110,11 +110,11 @@ static int b1dma_tolink(avmcard *card, void *buf, unsigned int len) · 100 unmodified lines
110110 unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */
111111 unsigned char *s = (unsigned char *)buf;
112112 while (len--) {
113− while ( !b1dma_tx_empty(card->port)
113+ while (!b1dma_tx_empty(card->port)
114114 && time_before(jiffies, stop));
115− if (!b1dma_tx_empty(card->port))
115+ if (!b1dma_tx_empty(card->port))
116116 return -1;
117− t1outp(card->port, 0x01, *s++);
117+ t1outp(card->port, 0x01, *s++);
118118 }
119119 return 0;
120120 }
@@ -124,11 +124,11 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len) · 3 unmodified lines
124124 unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */
125125 unsigned char *s = (unsigned char *)buf;
126126 while (len--) {
127− while ( !b1dma_rx_full(card->port)
127+ while (!b1dma_rx_full(card->port)
128128 && time_before(jiffies, stop));
129− if (!b1dma_rx_full(card->port))
129+ if (!b1dma_rx_full(card->port))
130130 return -1;
131− *s++ = t1inp(card->port, 0x00);
131+ *s++ = t1inp(card->port, 0x00);
132132 }
133133 return 0;
134134 }
@@ -136,7 +136,7 @@ static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len) · 1 unmodified line
136136 static int WriteReg(avmcard *card, u32 reg, u8 val)
137137 {
138138 u8 cmd = 0x00;
139− if ( b1dma_tolink(card, &cmd, 1) == 0
139+ if (b1dma_tolink(card, &cmd, 1) == 0
140140 && b1dma_tolink(card, &reg, 4) == 0) {
141141 u32 tmp = val;
142142 return b1dma_tolink(card, &tmp, 4);
@@ -147,7 +147,7 @@ static int WriteReg(avmcard *card, u32 reg, u8 val) · 4 unmodified lines
147147 static u8 ReadReg(avmcard *card, u32 reg)
148148 {
149149 u8 cmd = 0x01;
150− if ( b1dma_tolink(card, &cmd, 1) == 0
150+ if (b1dma_tolink(card, &cmd, 1) == 0
151151 && b1dma_tolink(card, &reg, 4) == 0) {
152152 u32 tmp;
153153 if (b1dma_fromlink(card, &tmp, 4) == 0)
@@ -258,30 +258,30 @@ static int b1dma_detect(avmcard *card) · 104 unmodified lines
258258
259259 b1dma_writel(card, 0xffffffff, AMCC_RXPTR);
260260 b1dma_writel(card, 0xffffffff, AMCC_TXPTR);
261− if ( b1dma_readl(card, AMCC_RXPTR) != 0xfffffffc
261+ if (b1dma_readl(card, AMCC_RXPTR) != 0xfffffffc
262262 || b1dma_readl(card, AMCC_TXPTR) != 0xfffffffc)
263263 return 2;
264264
265265 b1dma_writel(card, 0x0, AMCC_RXPTR);
266266 b1dma_writel(card, 0x0, AMCC_TXPTR);
267− if ( b1dma_readl(card, AMCC_RXPTR) != 0x0
267+ if (b1dma_readl(card, AMCC_RXPTR) != 0x0
268268 || b1dma_readl(card, AMCC_TXPTR) != 0x0)
269269 return 3;
270270
271271 t1outp(card->port, 0x10, 0x00);
272272 t1outp(card->port, 0x07, 0x00);
273−
273+
274274 t1outp(card->port, 0x02, 0x02);
275275 t1outp(card->port, 0x03, 0x02);
276276
277− if ( (t1inp(card->port, 0x02) & 0xFE) != 0x02
277+ if ((t1inp(card->port, 0x02) & 0xFE) != 0x02
278278 || t1inp(card->port, 0x3) != 0x03)
279279 return 4;
280280
281281 t1outp(card->port, 0x02, 0x00);
282282 t1outp(card->port, 0x03, 0x00);
283283
284− if ( (t1inp(card->port, 0x02) & 0xFE) != 0x00
284+ if ((t1inp(card->port, 0x02) & 0xFE) != 0x00
285285 || t1inp(card->port, 0x3) != 0x01)
286286 return 5;
287287
@@ -294,28 +294,28 @@ int t1pci_detect(avmcard *card) · 6 unmodified lines
294294
295295 if ((ret = b1dma_detect(card)) != 0)
296296 return ret;
297−
297+
298298 /* Transputer test */
299−
300− if ( WriteReg(card, 0x80001000, 0x11) != 0
299+
300+ if (WriteReg(card, 0x80001000, 0x11) != 0
301301 || WriteReg(card, 0x80101000, 0x22) != 0
302302 || WriteReg(card, 0x80201000, 0x33) != 0
303303 || WriteReg(card, 0x80301000, 0x44) != 0)
304304 return 6;
305305
306− if ( ReadReg(card, 0x80001000) != 0x11
306+ if (ReadReg(card, 0x80001000) != 0x11
307307 || ReadReg(card, 0x80101000) != 0x22
308308 || ReadReg(card, 0x80201000) != 0x33
309309 || ReadReg(card, 0x80301000) != 0x44)
310310 return 7;
311311
312− if ( WriteReg(card, 0x80001000, 0x55) != 0
312+ if (WriteReg(card, 0x80001000, 0x55) != 0
313313 || WriteReg(card, 0x80101000, 0x66) != 0
314314 || WriteReg(card, 0x80201000, 0x77) != 0
315315 || WriteReg(card, 0x80301000, 0x88) != 0)
316316 return 8;
317317
318− if ( ReadReg(card, 0x80001000) != 0x55
318+ if (ReadReg(card, 0x80001000) != 0x55
319319 || ReadReg(card, 0x80101000) != 0x66
320320 || ReadReg(card, 0x80201000) != 0x77
321321 || ReadReg(card, 0x80301000) != 0x88)
@@ -330,20 +330,20 @@ int b1pciv4_detect(avmcard *card) · 8 unmodified lines
330330
331331 if ((ret = b1dma_detect(card)) != 0)
332332 return ret;
333−
334− for (i=0; i < 5 ; i++) {
333+
334+ for (i = 0; i < 5; i++) {
335335 if (WriteReg(card, 0x80A00000, 0x21) != 0)
336336 return 6;
337337 if ((ReadReg(card, 0x80A00000) & 0x01) != 0x01)
338338 return 7;
339339 }
340− for (i=0; i < 5 ; i++) {
340+ for (i = 0; i < 5; i++) {
341341 if (WriteReg(card, 0x80A00000, 0x20) != 0)
342342 return 8;
343343 if ((ReadReg(card, 0x80A00000) & 0x01) != 0x00)
344344 return 9;
345345 }
346−
346+
347347 return 0;
348348 }
349349
@@ -373,7 +373,7 @@ static void b1dma_dispatch_tx(avmcard *card) · 23 unmodified lines
373373 u16 len;
374374 u32 txlen;
375375 void *p;
376−
376+
377377 skb = skb_dequeue(&dma->send_queue);
378378
379379 len = CAPIMSG_LEN(skb->data);
@@ -398,13 +398,13 @@ static void b1dma_dispatch_tx(avmcard *card) · 18 unmodified lines
398398 printk(KERN_DEBUG "tx: put msg len=%d\n", txlen);
399399 #endif
400400 } else {
401− txlen = skb->len-2;
401+ txlen = skb->len - 2;
402402 #ifdef AVM_B1DMA_POLLDEBUG
403403 if (skb->data[2] == SEND_POLLACK)
404404 printk(KERN_INFO "%s: send ack\n", card->name);
405405 #endif
406406 #ifdef AVM_B1DMA_DEBUG
407− printk(KERN_DEBUG "tx: put 0x%x len=%d\n",
407+ printk(KERN_DEBUG "tx: put 0x%x len=%d\n",
408408 skb->data[2], txlen);
409409 #endif
410410 skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
@@ -430,7 +430,7 @@ static void queue_pollack(avmcard *card) · 19 unmodified lines
430430 skb = alloc_skb(3, GFP_ATOMIC);
431431 if (!skb) {
432432 printk(KERN_CRIT "%s: no memory, lost poll ack\n",
433− card->name);
433+ card->name);
434434 return;
435435 }
436436 p = skb->data;
@@ -450,14 +450,14 @@ static void b1dma_handle_rx(avmcard *card) · 13 unmodified lines
450450 avmcard_dmainfo *dma = card->dma;
451451 struct capi_ctr *ctrl = &cinfo->capi_ctrl;
452452 struct sk_buff *skb;
453− void *p = dma->recvbuf.dmabuf+4;
453+ void *p = dma->recvbuf.dmabuf + 4;
454454 u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize;
455455 u8 b1cmd = _get_byte(&p);
456456
457457 #ifdef AVM_B1DMA_DEBUG
458458 printk(KERN_DEBUG "rx: 0x%x %lu\n", b1cmd, (unsigned long)dma->recvlen);
459459 #endif
460−
460+
461461 switch (b1cmd) {
462462 case RECEIVE_DATA_B3_IND:
463463
@@ -466,13 +466,13 @@ static void b1dma_handle_rx(avmcard *card) · 2 unmodified lines
466466 DataB3Len = _get_slice(&p, card->databuf);
467467
468468 if (MsgLen < 30) { /* not CAPI 64Bit */
469− memset(card->msgbuf+MsgLen, 0, 30-MsgLen);
469+ memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
470470 MsgLen = 30;
471471 CAPIMSG_SETLEN(card->msgbuf, 30);
472472 }
473− if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) {
473+ if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
474474 printk(KERN_ERR "%s: incoming packet dropped\n",
475− card->name);
475+ card->name);
476476 } else {
477477 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
478478 memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
@@ -486,14 +486,14 @@ static void b1dma_handle_rx(avmcard *card) · 7 unmodified lines
486486 MsgLen = _get_slice(&p, card->msgbuf);
487487 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
488488 printk(KERN_ERR "%s: incoming packet dropped\n",
489− card->name);
489+ card->name);
490490 } else {
491491 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
492492 if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) {
493493 spin_lock(&card->lock);
494494 capilib_data_b3_conf(&cinfo->ncci_head, ApplId,
495− CAPIMSG_NCCI(skb->data),
496− CAPIMSG_MSGID(skb->data));
495+ CAPIMSG_NCCI(skb->data),
496+ CAPIMSG_MSGID(skb->data));
497497 spin_unlock(&card->lock);
498498 }
499499 capi_ctr_handle_message(ctrl, ApplId, skb);
@@ -550,23 +550,23 @@ static void b1dma_handle_rx(avmcard *card) · 50 unmodified lines
550550 ApplId = (unsigned) _get_word(&p);
551551 MsgLen = _get_slice(&p, card->msgbuf);
552552 card->msgbuf[MsgLen] = 0;
553− while ( MsgLen > 0
554− && ( card->msgbuf[MsgLen-1] == '\n'
555− || card->msgbuf[MsgLen-1] == '\r')) {
556− card->msgbuf[MsgLen-1] = 0;
553+ while (MsgLen > 0
554+ && (card->msgbuf[MsgLen - 1] == '\n'
555+ || card->msgbuf[MsgLen - 1] == '\r')) {
556+ card->msgbuf[MsgLen - 1] = 0;
557557 MsgLen--;
558558 }
559559 printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
560− card->name, ApplId, card->msgbuf);
560+ card->name, ApplId, card->msgbuf);
561561 break;
562562
563563 case RECEIVE_DEBUGMSG:
564564 MsgLen = _get_slice(&p, card->msgbuf);
565565 card->msgbuf[MsgLen] = 0;
566− while ( MsgLen > 0
567− && ( card->msgbuf[MsgLen-1] == '\n'
568− || card->msgbuf[MsgLen-1] == '\r')) {
569− card->msgbuf[MsgLen-1] = 0;
566+ while (MsgLen > 0
567+ && (card->msgbuf[MsgLen - 1] == '\n'
568+ || card->msgbuf[MsgLen - 1] == '\r')) {
569+ card->msgbuf[MsgLen - 1] = 0;
570570 MsgLen--;
571571 }
572572 printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -574,7 +574,7 @@ static void b1dma_handle_rx(avmcard *card) · 1 unmodified line
574574
575575 default:
576576 printk(KERN_ERR "%s: b1dma_interrupt: 0x%x ???\n",
577− card->name, b1cmd);
577+ card->name, b1cmd);
578578 return;
579579 }
580580 }
@@ -594,7 +594,7 @@ static void b1dma_handle_interrupt(avmcard *card) · 13 unmodified lines
594594 return;
595595 }
596596
597− newcsr = card->csr | (status & ALL_INT);
597+ newcsr = card->csr | (status & ALL_INT);
598598 if (status & TX_TC_INT) newcsr &= ~EN_TX_TC_INT;
599599 if (status & RX_TC_INT) newcsr &= ~EN_RX_TC_INT;
600600 b1dma_writel(card, newcsr, AMCC_INTCSR);
@@ -602,23 +602,23 @@ static void b1dma_handle_interrupt(avmcard *card) · 1 unmodified line
602602 if ((status & RX_TC_INT) != 0) {
603603 struct avmcard_dmainfo *dma = card->dma;
604604 u32 rxlen;
605− if (card->dma->recvlen == 0) {
606− rxlen = b1dma_readl(card, AMCC_RXLEN);
605+ if (card->dma->recvlen == 0) {
606+ rxlen = b1dma_readl(card, AMCC_RXLEN);
607607 if (rxlen == 0) {
608608 dma->recvlen = *((u32 *)dma->recvbuf.dmabuf);
609609 rxlen = (dma->recvlen + 3) & ~3;
610− b1dma_writel(card, dma->recvbuf.dmaaddr+4, AMCC_RXPTR);
610+ b1dma_writel(card, dma->recvbuf.dmaaddr + 4, AMCC_RXPTR);
611611 b1dma_writel(card, rxlen, AMCC_RXLEN);
612612 #ifdef AVM_B1DMA_DEBUG
613613 } else {
614614 printk(KERN_ERR "%s: rx not complete (%d).\n",
615− card->name, rxlen);
615+ card->name, rxlen);
616616 #endif
617617 }
618618 } else {
619619 spin_unlock(&card->lock);
620620 b1dma_handle_rx(card);
621− dma->recvlen = 0;
621+ dma->recvlen = 0;
622622 spin_lock(&card->lock);
623623 b1dma_writel(card, dma->recvbuf.dmaaddr, AMCC_RXPTR);
624624 b1dma_writel(card, 4, AMCC_RXLEN);
@@ -659,7 +659,7 @@ static int b1dma_loaded(avmcard *card) · 34 unmodified lines
659659 }
660660 if (!b1_tx_empty(base)) {
661661 printk(KERN_ERR "%s: b1dma_loaded: tx err, corrupted t4 file ?\n",
662− card->name);
662+ card->name);
663663 return 0;
664664 }
665665 b1_put_byte(base, SEND_POLLACK);
@@ -686,7 +686,7 @@ static void b1dma_send_init(avmcard *card) · 20 unmodified lines
686686 skb = alloc_skb(15, GFP_ATOMIC);
687687 if (!skb) {
688688 printk(KERN_CRIT "%s: no memory, lost register appl.\n",
689− card->name);
689+ card->name);
690690 return;
691691 }
692692 p = skb->data;
@@ -694,7 +694,7 @@ static void b1dma_send_init(avmcard *card) · 1 unmodified line
694694 _put_byte(&p, 0);
695695 _put_byte(&p, SEND_INIT);
696696 _put_word(&p, CAPI_MAXAPPL);
697− _put_word(&p, AVM_NCCI_PER_CHANNEL*30);
697+ _put_word(&p, AVM_NCCI_PER_CHANNEL * 30);
698698 _put_word(&p, card->cardnr - 1);
699699 skb_put(skb, (u8 *)p - (u8 *)skb->data);
700700
@@ -712,7 +712,7 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 11 unmodified lines
712712 if ((retval = b1_load_t4file(card, &data->firmware))) {
713713 b1dma_reset(card);
714714 printk(KERN_ERR "%s: failed to load t4file!!\n",
715− card->name);
715+ card->name);
716716 return retval;
717717 }
718718
@@ -720,7 +720,7 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 1 unmodified line
720720 if ((retval = b1_load_config(card, &data->configuration))) {
721721 b1dma_reset(card);
722722 printk(KERN_ERR "%s: failed to load config!!\n",
723− card->name);
723+ card->name);
724724 return retval;
725725 }
726726 }
@@ -733,8 +733,8 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 6 unmodified lines
733733
734734 card->csr = AVM_FLAG;
735735 b1dma_writel(card, card->csr, AMCC_INTCSR);
736− b1dma_writel(card, EN_A2P_TRANSFERS|EN_P2A_TRANSFERS|A2P_HI_PRIORITY|
737− P2A_HI_PRIORITY|RESET_A2P_FLAGS|RESET_P2A_FLAGS,
736+ b1dma_writel(card, EN_A2P_TRANSFERS | EN_P2A_TRANSFERS | A2P_HI_PRIORITY |
737+ P2A_HI_PRIORITY | RESET_A2P_FLAGS | RESET_P2A_FLAGS,
738738 AMCC_MCSR);
739739 t1outp(card->port, 0x07, 0x30);
740740 t1outp(card->port, 0x10, 0xF0);
@@ -745,7 +745,7 @@ int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 4 unmodified lines
745745 card->csr |= EN_RX_TC_INT;
746746 b1dma_writel(card, card->csr, AMCC_INTCSR);
747747
748− b1dma_send_init(card);
748+ b1dma_send_init(card);
749749
750750 return 0;
751751 }
@@ -757,7 +757,7 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) · 5 unmodified lines
757757 unsigned long flags;
758758
759759 spin_lock_irqsave(&card->lock, flags);
760− b1dma_reset(card);
760+ b1dma_reset(card);
761761
762762 memset(cinfo->version, 0, sizeof(cinfo->version));
763763 capilib_release(&cinfo->ncci_head);
@@ -768,8 +768,8 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) · 4 unmodified lines
768768 /* ------------------------------------------------------------- */
769769
770770 void b1dma_register_appl(struct capi_ctr *ctrl,
771− u16 appl,
772− capi_register_params *rp)
771+ u16 appl,
772+ capi_register_params *rp)
773773 {
774774 avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
775775 avmcard *card = cinfo->card;
@@ -785,7 +785,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl, · 9 unmodified lines
785785 skb = alloc_skb(23, GFP_ATOMIC);
786786 if (!skb) {
787787 printk(KERN_CRIT "%s: no memory, lost register appl.\n",
788− card->name);
788+ card->name);
789789 return;
790790 }
791791 p = skb->data;
@@ -793,7 +793,7 @@ void b1dma_register_appl(struct capi_ctr *ctrl, · 1 unmodified line
793793 _put_byte(&p, 0);
794794 _put_byte(&p, SEND_REGISTER);
795795 _put_word(&p, appl);
796− _put_word(&p, 1024 * (nconn+1));
796+ _put_word(&p, 1024 * (nconn + 1));
797797 _put_word(&p, nconn);
798798 _put_word(&p, rp->datablkcnt);
799799 _put_word(&p, rp->datablklen);
@@ -819,7 +819,7 @@ void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl) · 19 unmodified lines
819819 skb = alloc_skb(7, GFP_ATOMIC);
820820 if (!skb) {
821821 printk(KERN_CRIT "%s: no memory, lost release appl.\n",
822− card->name);
822+ card->name);
823823 return;
824824 }
825825 p = skb->data;
@@ -841,7 +841,7 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) · 15 unmodified lines
841841 avmcard *card = cinfo->card;
842842 u16 retval = CAPI_NOERROR;
843843
844− if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
844+ if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) {
845845 unsigned long flags;
846846 spin_lock_irqsave(&card->lock, flags);
847847 retval = capilib_data_b3_req(&cinfo->ncci_head,
@@ -850,7 +850,7 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) · 2 unmodified lines
850850 CAPIMSG_MSGID(skb->data));
851851 spin_unlock_irqrestore(&card->lock, flags);
852852 }
853− if (retval == CAPI_NOERROR)
853+ if (retval == CAPI_NOERROR)
854854 b1dma_queue_tx(card, skb);
855855
856856 return retval;
@@ -893,29 +893,29 @@ static int b1dmactl_proc_show(struct seq_file *m, void *v) · 36 unmodified lines
893893 seq_printf(m, "%-16s %s\n", "ver_serial", s);
894894
895895 if (card->cardtype != avm_m1) {
896− flag = ((u8 *)(ctrl->profile.manu))[3];
897− if (flag)
896+ flag = ((u8 *)(ctrl->profile.manu))[3];
897+ if (flag)
898898 seq_printf(m, "%-16s%s%s%s%s%s%s%s\n",
899− "protocol",
900− (flag & 0x01) ? " DSS1" : "",
901− (flag & 0x02) ? " CT1" : "",
902− (flag & 0x04) ? " VN3" : "",
903− (flag & 0x08) ? " NI1" : "",
904− (flag & 0x10) ? " AUSTEL" : "",
905− (flag & 0x20) ? " ESS" : "",
906− (flag & 0x40) ? " 1TR6" : ""
907− );
899+ "protocol",
900+ (flag & 0x01) ? " DSS1" : "",
901+ (flag & 0x02) ? " CT1" : "",
902+ (flag & 0x04) ? " VN3" : "",
903+ (flag & 0x08) ? " NI1" : "",
904+ (flag & 0x10) ? " AUSTEL" : "",
905+ (flag & 0x20) ? " ESS" : "",
906+ (flag & 0x40) ? " 1TR6" : ""
907+ );
908908 }
909909 if (card->cardtype != avm_m1) {
910− flag = ((u8 *)(ctrl->profile.manu))[5];
910+ flag = ((u8 *)(ctrl->profile.manu))[5];
911911 if (flag)
912912 seq_printf(m, "%-16s%s%s%s%s\n",
913− "linetype",
914− (flag & 0x01) ? " point to point" : "",
915− (flag & 0x02) ? " point to multipoint" : "",
916− (flag & 0x08) ? " leased line without D-channel" : "",
917− (flag & 0x04) ? " leased line with D-channel" : ""
918− );
913+ "linetype",
914+ (flag & 0x01) ? " point to point" : "",
915+ (flag & 0x02) ? " point to multipoint" : "",
916+ (flag & 0x08) ? " leased line without D-channel" : "",
917+ (flag & 0x04) ? " leased line with D-channel" : ""
918+ );
919919 }
920920 seq_printf(m, "%-16s %s\n", "cardname", cinfo->cardname);
921921
@@ -977,7 +977,7 @@ static int __init b1dma_init(void) · 55 unmodified lines
977977 if ((p = strchr(revision, ':')) != NULL && p[1]) {
978978 strlcpy(rev, p + 2, sizeof(rev));
979979 if ((p = strchr(rev, '$')) != NULL && p > rev)
980− *(p-1) = 0;
980+ *(p - 1) = 0;
981981 } else
982982 strcpy(rev, "1.0");
983983
drivers/isdn/hardware/avm/b1isa.c+9−9
@@ -1,9 +1,9 @@
11 /* $Id: b1isa.c,v 1.1.2.3 2004/02/10 01:07:12 keil Exp $
2− *
2+ *
33 * Module for AVM B1 ISA-card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -80,7 +80,7 @@ static int b1isa_probe(struct pci_dev *pdev) · 70 unmodified lines
8080 card->cardtype = avm_b1isa;
8181 sprintf(card->name, "b1isa-%x", card->port);
8282
83− if ( card->port != 0x150 && card->port != 0x250
83+ if (card->port != 0x150 && card->port != 0x250
8484 && card->port != 0x300 && card->port != 0x340) {
8585 printk(KERN_WARNING "b1isa: invalid port 0x%x.\n", card->port);
8686 retval = -EINVAL;
@@ -136,13 +136,13 @@ static int b1isa_probe(struct pci_dev *pdev) · 49 unmodified lines
136136 pci_set_drvdata(pdev, cinfo);
137137 return 0;
138138
139− err_free_irq:
139+err_free_irq:
140140 free_irq(card->irq, card);
141− err_release_region:
141+err_release_region:
142142 release_region(card->port, AVMB1_PORTLEN);
143− err_free:
143+err_free:
144144 b1_free_card(card);
145− err:
145+err:
146146 return retval;
147147 }
148148
@@ -206,7 +206,7 @@ static int __init b1isa_init(void) · 57 unmodified lines
206206 if ((p = strchr(revision, ':')) != NULL && p[1]) {
207207 strlcpy(rev, p + 2, 32);
208208 if ((p = strchr(rev, '$')) != NULL && p > rev)
209− *(p-1) = 0;
209+ *(p - 1) = 0;
210210 } else
211211 strcpy(rev, "1.0");
212212
drivers/isdn/hardware/avm/b1pci.c+22−22
@@ -1,9 +1,9 @@
11 /* $Id: b1pci.c,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2− *
2+ *
33 * Module for AVM B1 PCI-card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -79,7 +79,7 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev) · 69 unmodified lines
7979 card->port = p->port;
8080 card->irq = p->irq;
8181 card->cardtype = avm_b1pci;
82−
82+
8383 if (!request_region(card->port, AVMB1_PORTLEN, card->name)) {
8484 printk(KERN_WARNING "b1pci: ports 0x%03x-0x%03x in use.\n",
8585 card->port, card->port + AVMB1_PORTLEN);
@@ -96,14 +96,14 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev) · 10 unmodified lines
9696 }
9797 b1_reset(card->port);
9898 b1_getrevision(card);
99−
99+
100100 retval = request_irq(card->irq, b1_interrupt, IRQF_SHARED, card->name, card);
101101 if (retval) {
102102 printk(KERN_ERR "b1pci: unable to get IRQ %d.\n", card->irq);
103103 retval = -EBUSY;
104104 goto err_release_region;
105105 }
106−
106+
107107 cinfo->capi_ctrl.driver_name = "b1pci";
108108 cinfo->capi_ctrl.driverdata = cinfo;
109109 cinfo->capi_ctrl.register_appl = b1_register_appl;
@@ -133,13 +133,13 @@ static int b1pci_probe(struct capicardparams *p, struct pci_dev *pdev) · 23 unmodified lines
133133 pci_set_drvdata(pdev, card);
134134 return 0;
135135
136− err_free_irq:
136+err_free_irq:
137137 free_irq(card->irq, card);
138− err_release_region:
138+err_release_region:
139139 release_region(card->port, AVMB1_PORTLEN);
140− err_free:
140+err_free:
141141 b1_free_card(card);
142− err:
142+err:
143143 return retval;
144144 }
145145
@@ -193,7 +193,7 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev) · 47 unmodified lines
193193 goto err;
194194 }
195195
196− card->dma = avmcard_dma_alloc("b1pci", pdev, 2048+128, 2048+128);
196+ card->dma = avmcard_dma_alloc("b1pci", pdev, 2048 + 128, 2048 + 128);
197197 if (!card->dma) {
198198 printk(KERN_WARNING "b1pci: dma alloc.\n");
199199 retval = -ENOMEM;
@@ -267,17 +267,17 @@ static int b1pciv4_probe(struct capicardparams *p, struct pci_dev *pdev) · 67 unmodified lines
267267 pci_set_drvdata(pdev, card);
268268 return 0;
269269
270− err_free_irq:
270+err_free_irq:
271271 free_irq(card->irq, card);
272− err_unmap:
272+err_unmap:
273273 iounmap(card->mbase);
274− err_release_region:
274+err_release_region:
275275 release_region(card->port, AVMB1_PORTLEN);
276− err_free_dma:
276+err_free_dma:
277277 avmcard_dma_free(card->dma);
278− err_free:
278+err_free:
279279 b1_free_card(card);
280− err:
280+err:
281281 return retval;
282282
283283 }
@@ -287,13 +287,13 @@ static void b1pciv4_remove(struct pci_dev *pdev) · 3 unmodified lines
287287 avmcard *card = pci_get_drvdata(pdev);
288288 avmctrl_info *cinfo = card->ctrlinfo;
289289
290− b1dma_reset(card);
290+ b1dma_reset(card);
291291
292292 detach_capi_ctr(&cinfo->capi_ctrl);
293293 free_irq(card->irq, card);
294294 iounmap(card->mbase);
295295 release_region(card->port, AVMB1_PORTLEN);
296− avmcard_dma_free(card->dma);
296+ avmcard_dma_free(card->dma);
297297 b1_free_card(card);
298298 }
299299
@@ -326,7 +326,7 @@ static int __devinit b1pci_pci_probe(struct pci_dev *pdev, · 26 unmodified lines
326326 retval = b1pci_probe(&param, pdev);
327327 #endif
328328 if (retval != 0) {
329− printk(KERN_ERR "b1pci: no AVM-B1 V4 at i/o %#x, irq %d, mem %#x detected\n",
329+ printk(KERN_ERR "b1pci: no AVM-B1 V4 at i/o %#x, irq %d, mem %#x detected\n",
330330 param.port, param.irq, param.membase);
331331 }
332332 } else {
@@ -337,7 +337,7 @@ static int __devinit b1pci_pci_probe(struct pci_dev *pdev, · 4 unmodified lines
337337 param.port, param.irq);
338338 retval = b1pci_probe(&param, pdev);
339339 if (retval != 0) {
340− printk(KERN_ERR "b1pci: no AVM-B1 at i/o %#x, irq %d detected\n",
340+ printk(KERN_ERR "b1pci: no AVM-B1 at i/o %#x, irq %d detected\n",
341341 param.port, param.irq);
342342 }
343343 }
@@ -385,7 +385,7 @@ static int __init b1pci_init(void) · 41 unmodified lines
385385 if ((p = strchr(revision, ':')) != NULL && p[1]) {
386386 strlcpy(rev, p + 2, 32);
387387 if ((p = strchr(rev, '$')) != NULL && p > rev)
388− *(p-1) = 0;
388+ *(p - 1) = 0;
389389 } else
390390 strcpy(rev, "1.0");
391391
drivers/isdn/hardware/avm/b1pcmcia.c+14−14
@@ -1,9 +1,9 @@
11 /* $Id: b1pcmcia.c,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2− *
2+ *
33 * Module for AVM B1/M1/M2 PCMCIA-card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -74,9 +74,9 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, · 64 unmodified lines
7474 cinfo = card->ctrlinfo;
7575
7676 switch (cardtype) {
77− case avm_m1: sprintf(card->name, "m1-%x", port); break;
78− case avm_m2: sprintf(card->name, "m2-%x", port); break;
79− default: sprintf(card->name, "b1pcmcia-%x", port); break;
77+ case avm_m1: sprintf(card->name, "m1-%x", port); break;
78+ case avm_m2: sprintf(card->name, "m2-%x", port); break;
79+ default: sprintf(card->name, "b1pcmcia-%x", port); break;
8080 }
8181 card->port = port;
8282 card->irq = irq;
@@ -117,9 +117,9 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, · 34 unmodified lines
117117 goto err_free_irq;
118118 }
119119 switch (cardtype) {
120− case avm_m1: cardname = "M1"; break;
121− case avm_m2: cardname = "M2"; break;
122− default : cardname = "B1 PCMCIA"; break;
120+ case avm_m1: cardname = "M1"; break;
121+ case avm_m2: cardname = "M2"; break;
122+ default: cardname = "B1 PCMCIA"; break;
123123 }
124124
125125 printk(KERN_INFO "b1pcmcia: AVM %s at i/o %#x, irq %d, revision %d\n",
@@ -128,11 +128,11 @@ static int b1pcmcia_add_card(unsigned int port, unsigned irq, · 2 unmodified lines
128128 list_add(&card->list, &cards);
129129 return cinfo->capi_ctrl.cnr;
130130
131− err_free_irq:
131+err_free_irq:
132132 free_irq(card->irq, card);
133− err_free:
133+err_free:
134134 b1_free_card(card);
135− err:
135+err:
136136 return retval;
137137 }
138138
@@ -175,7 +175,7 @@ int b1pcmcia_delcard(unsigned int port, unsigned irq) · 36 unmodified lines
175175 {
176176 struct list_head *l;
177177 avmcard *card;
178−
178+
179179 list_for_each(l, &cards) {
180180 card = list_entry(l, avmcard, list);
181181 if (card->port == port && card->irq == irq) {
@@ -204,7 +204,7 @@ static int __init b1pcmcia_init(void) · 22 unmodified lines
204204 if ((p = strchr(revision, ':')) != NULL && p[1]) {
205205 strlcpy(rev, p + 2, 32);
206206 if ((p = strchr(rev, '$')) != NULL && p > rev)
207− *(p-1) = 0;
207+ *(p - 1) = 0;
208208 } else
209209 strcpy(rev, "1.0");
210210
drivers/isdn/hardware/avm/c4.c+174−174
@@ -1,7 +1,7 @@
11 /* $Id: c4.c,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2− *
2+ *
33 * Module for AVM C4 & C2 card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
66 *
77 * This software may be used and distributed according to the terms
@@ -129,8 +129,8 @@ static void c4_dispatch_tx(avmcard *card); · 121 unmodified lines
129129
130130 /* ------------------------------------------------------------- */
131131
132−#define RESET_TIMEOUT (15*HZ) /* 15 sec */
133−#define PEEK_POKE_TIMEOUT (HZ/10) /* 0.1 sec */
132+#define RESET_TIMEOUT (15 * HZ) /* 15 sec */
133+#define PEEK_POKE_TIMEOUT (HZ / 10) /* 0.1 sec */
134134
135135 /* ------------------------------------------------------------- */
136136
@@ -148,7 +148,7 @@ static inline int wait_for_doorbell(avmcard *card, unsigned long t) · 11 unmodified lines
148148 unsigned long stop;
149149
150150 stop = jiffies + t;
151− while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) {
151+ while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
152152 if (!time_before(jiffies, stop))
153153 return -1;
154154 mb();
@@ -159,40 +159,40 @@ static inline int wait_for_doorbell(avmcard *card, unsigned long t) · 4 unmodified lines
159159 static int c4_poke(avmcard *card, unsigned long off, unsigned long value)
160160 {
161161
162− if (wait_for_doorbell(card, HZ/10) < 0)
162+ if (wait_for_doorbell(card, HZ / 10) < 0)
163163 return -1;
164−
165− c4outmeml(card->mbase+MBOX_PEEK_POKE, off);
166− c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
167164
168− if (wait_for_doorbell(card, HZ/10) < 0)
165+ c4outmeml(card->mbase + MBOX_PEEK_POKE, off);
166+ c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
167+
168+ if (wait_for_doorbell(card, HZ / 10) < 0)
169169 return -1;
170170
171− c4outmeml(card->mbase+MBOX_PEEK_POKE, value);
172− c4outmeml(card->mbase+DOORBELL, DBELL_DATA | DBELL_ADDR);
171+ c4outmeml(card->mbase + MBOX_PEEK_POKE, value);
172+ c4outmeml(card->mbase + DOORBELL, DBELL_DATA | DBELL_ADDR);
173173
174174 return 0;
175175 }
176176
177177 static int c4_peek(avmcard *card, unsigned long off, unsigned long *valuep)
178178 {
179− if (wait_for_doorbell(card, HZ/10) < 0)
179+ if (wait_for_doorbell(card, HZ / 10) < 0)
180180 return -1;
181181
182− c4outmeml(card->mbase+MBOX_PEEK_POKE, off);
183− c4outmeml(card->mbase+DOORBELL, DBELL_RNWR | DBELL_ADDR);
182+ c4outmeml(card->mbase + MBOX_PEEK_POKE, off);
183+ c4outmeml(card->mbase + DOORBELL, DBELL_RNWR | DBELL_ADDR);
184184
185− if (wait_for_doorbell(card, HZ/10) < 0)
185+ if (wait_for_doorbell(card, HZ / 10) < 0)
186186 return -1;
187187
188− *valuep = c4inmeml(card->mbase+MBOX_PEEK_POKE);
188+ *valuep = c4inmeml(card->mbase + MBOX_PEEK_POKE);
189189
190190 return 0;
191191 }
192192
193193 /* ------------------------------------------------------------- */
194194
195−static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file)
195+static int c4_load_t4file(avmcard *card, capiloaddatapart *t4file)
196196 {
197197 u32 val;
198198 unsigned char *dp;
@@ -202,7 +202,7 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) · 3 unmodified lines
202202 dp = t4file->data;
203203 left = t4file->len;
204204 while (left >= sizeof(u32)) {
205− if (t4file->user) {
205+ if (t4file->user) {
206206 if (copy_from_user(&val, dp, sizeof(val)))
207207 return -EFAULT;
208208 } else {
@@ -210,7 +210,7 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) · 1 unmodified line
210210 }
211211 if (c4_poke(card, loadoff, val)) {
212212 printk(KERN_ERR "%s: corrupted firmware file ?\n",
213− card->name);
213+ card->name);
214214 return -EIO;
215215 }
216216 left -= sizeof(u32);
@@ -227,7 +227,7 @@ static int c4_load_t4file(avmcard *card, capiloaddatapart * t4file) · 10 unmodified lines
227227 }
228228 if (c4_poke(card, loadoff, val)) {
229229 printk(KERN_ERR "%s: corrupted firmware file ?\n",
230− card->name);
230+ card->name);
231231 return -EIO;
232232 }
233233 }
@@ -297,13 +297,13 @@ static void c4_reset(avmcard *card) · 63 unmodified lines
297297 {
298298 unsigned long stop;
299299
300− c4outmeml(card->mbase+DOORBELL, DBELL_RESET_ARM);
300+ c4outmeml(card->mbase + DOORBELL, DBELL_RESET_ARM);
301301
302− stop = jiffies + HZ*10;
303− while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) {
302+ stop = jiffies + HZ * 10;
303+ while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
304304 if (!time_before(jiffies, stop))
305305 return;
306− c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
306+ c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
307307 mb();
308308 }
309309
@@ -317,89 +317,89 @@ static int c4_detect(avmcard *card) · 7 unmodified lines
317317 {
318318 unsigned long stop, dummy;
319319
320− c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c);
321− if (c4inmeml(card->mbase+PCI_OUT_INT_MASK) != 0x0c)
320+ c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x0c);
321+ if (c4inmeml(card->mbase + PCI_OUT_INT_MASK) != 0x0c)
322322 return 1;
323323
324− c4outmeml(card->mbase+DOORBELL, DBELL_RESET_ARM);
324+ c4outmeml(card->mbase + DOORBELL, DBELL_RESET_ARM);
325325
326− stop = jiffies + HZ*10;
327− while (c4inmeml(card->mbase+DOORBELL) != 0xffffffff) {
326+ stop = jiffies + HZ * 10;
327+ while (c4inmeml(card->mbase + DOORBELL) != 0xffffffff) {
328328 if (!time_before(jiffies, stop))
329329 return 2;
330− c4outmeml(card->mbase+DOORBELL, DBELL_ADDR);
330+ c4outmeml(card->mbase + DOORBELL, DBELL_ADDR);
331331 mb();
332332 }
333333
334334 c4_poke(card, DC21285_ARMCSR_BASE + CHAN_1_CONTROL, 0);
335335 c4_poke(card, DC21285_ARMCSR_BASE + CHAN_2_CONTROL, 0);
336336
337− c4outmeml(card->mbase+MAILBOX_0, 0x55aa55aa);
338− if (c4inmeml(card->mbase+MAILBOX_0) != 0x55aa55aa) return 3;
337+ c4outmeml(card->mbase + MAILBOX_0, 0x55aa55aa);
338+ if (c4inmeml(card->mbase + MAILBOX_0) != 0x55aa55aa) return 3;
339339
340− c4outmeml(card->mbase+MAILBOX_0, 0xaa55aa55);
341− if (c4inmeml(card->mbase+MAILBOX_0) != 0xaa55aa55) return 4;
340+ c4outmeml(card->mbase + MAILBOX_0, 0xaa55aa55);
341+ if (c4inmeml(card->mbase + MAILBOX_0) != 0xaa55aa55) return 4;
342342
343− if (c4_poke(card, DC21285_ARMCSR_BASE+DBELL_SA_MASK, 0)) return 5;
344− if (c4_poke(card, DC21285_ARMCSR_BASE+DBELL_PCI_MASK, 0)) return 6;
345− if (c4_poke(card, DC21285_ARMCSR_BASE+SA_CONTROL, SA_CTL_ALLRIGHT))
343+ if (c4_poke(card, DC21285_ARMCSR_BASE + DBELL_SA_MASK, 0)) return 5;
344+ if (c4_poke(card, DC21285_ARMCSR_BASE + DBELL_PCI_MASK, 0)) return 6;
345+ if (c4_poke(card, DC21285_ARMCSR_BASE + SA_CONTROL, SA_CTL_ALLRIGHT))
346346 return 7;
347− if (c4_poke(card, DC21285_ARMCSR_BASE+XBUS_CYCLE, INIT_XBUS_CYCLE))
347+ if (c4_poke(card, DC21285_ARMCSR_BASE + XBUS_CYCLE, INIT_XBUS_CYCLE))
348348 return 8;
349− if (c4_poke(card, DC21285_ARMCSR_BASE+XBUS_STROBE, INIT_XBUS_STROBE))
349+ if (c4_poke(card, DC21285_ARMCSR_BASE + XBUS_STROBE, INIT_XBUS_STROBE))
350350 return 8;
351− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_TIMING, 0)) return 9;
351+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_TIMING, 0)) return 9;
352352
353− mdelay(1);
353+ mdelay(1);
354354
355355 if (c4_peek(card, DC21285_DRAM_A0MR, &dummy)) return 10;
356356 if (c4_peek(card, DC21285_DRAM_A1MR, &dummy)) return 11;
357357 if (c4_peek(card, DC21285_DRAM_A2MR, &dummy)) return 12;
358358 if (c4_peek(card, DC21285_DRAM_A3MR, &dummy)) return 13;
359359
360− if (c4_poke(card, DC21285_DRAM_A0MR+CAS_OFFSET, 0)) return 14;
361− if (c4_poke(card, DC21285_DRAM_A1MR+CAS_OFFSET, 0)) return 15;
362− if (c4_poke(card, DC21285_DRAM_A2MR+CAS_OFFSET, 0)) return 16;
363− if (c4_poke(card, DC21285_DRAM_A3MR+CAS_OFFSET, 0)) return 17;
360+ if (c4_poke(card, DC21285_DRAM_A0MR + CAS_OFFSET, 0)) return 14;
361+ if (c4_poke(card, DC21285_DRAM_A1MR + CAS_OFFSET, 0)) return 15;
362+ if (c4_poke(card, DC21285_DRAM_A2MR + CAS_OFFSET, 0)) return 16;
363+ if (c4_poke(card, DC21285_DRAM_A3MR + CAS_OFFSET, 0)) return 17;
364364
365− mdelay(1);
365+ mdelay(1);
366366
367− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_TIMING, DRAM_TIMING_DEF))
367+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_TIMING, DRAM_TIMING_DEF))
368368 return 18;
369369
370− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_0,DRAM_AD_SZ_DEF0))
370+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_0, DRAM_AD_SZ_DEF0))
371371 return 19;
372− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_1,DRAM_AD_SZ_NULL))
372+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_1, DRAM_AD_SZ_NULL))
373373 return 20;
374− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_2,DRAM_AD_SZ_NULL))
374+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_2, DRAM_AD_SZ_NULL))
375375 return 21;
376− if (c4_poke(card, DC21285_ARMCSR_BASE+DRAM_ADDR_SIZE_3,DRAM_AD_SZ_NULL))
376+ if (c4_poke(card, DC21285_ARMCSR_BASE + DRAM_ADDR_SIZE_3, DRAM_AD_SZ_NULL))
377377 return 22;
378378
379379 /* Transputer test */
380−
381− if ( c4_poke(card, 0x000000, 0x11111111)
380+
381+ if (c4_poke(card, 0x000000, 0x11111111)
382382 || c4_poke(card, 0x400000, 0x22222222)
383− || c4_poke(card, 0x800000, 0x33333333)
384− || c4_poke(card, 0xC00000, 0x44444444))
383+ || c4_poke(card, 0x800000, 0x33333333)
384+ || c4_poke(card, 0xC00000, 0x44444444))
385385 return 23;
386386
387− if ( c4_peek(card, 0x000000, &dummy) || dummy != 0x11111111
387+ if (c4_peek(card, 0x000000, &dummy) || dummy != 0x11111111
388388 || c4_peek(card, 0x400000, &dummy) || dummy != 0x22222222
389− || c4_peek(card, 0x800000, &dummy) || dummy != 0x33333333
390− || c4_peek(card, 0xC00000, &dummy) || dummy != 0x44444444)
389+ || c4_peek(card, 0x800000, &dummy) || dummy != 0x33333333
390+ || c4_peek(card, 0xC00000, &dummy) || dummy != 0x44444444)
391391 return 24;
392392
393− if ( c4_poke(card, 0x000000, 0x55555555)
393+ if (c4_poke(card, 0x000000, 0x55555555)
394394 || c4_poke(card, 0x400000, 0x66666666)
395− || c4_poke(card, 0x800000, 0x77777777)
396− || c4_poke(card, 0xC00000, 0x88888888))
395+ || c4_poke(card, 0x800000, 0x77777777)
396+ || c4_poke(card, 0xC00000, 0x88888888))
397397 return 25;
398398
399− if ( c4_peek(card, 0x000000, &dummy) || dummy != 0x55555555
399+ if (c4_peek(card, 0x000000, &dummy) || dummy != 0x55555555
400400 || c4_peek(card, 0x400000, &dummy) || dummy != 0x66666666
401− || c4_peek(card, 0x800000, &dummy) || dummy != 0x77777777
402− || c4_peek(card, 0xC00000, &dummy) || dummy != 0x88888888)
401+ || c4_peek(card, 0x800000, &dummy) || dummy != 0x77777777
402+ || c4_peek(card, 0xC00000, &dummy) || dummy != 0x88888888)
403403 return 26;
404404
405405 return 0;
@@ -451,26 +451,26 @@ static void c4_dispatch_tx(avmcard *card) · 45 unmodified lines
451451 printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen);
452452 #endif
453453 } else {
454− txlen = skb->len-2;
454+ txlen = skb->len - 2;
455455 #ifdef AVM_C4_POLLDEBUG
456456 if (skb->data[2] == SEND_POLLACK)
457457 printk(KERN_INFO "%s: ack to c4\n", card->name);
458458 #endif
459459 #ifdef AVM_C4_DEBUG
460460 printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n",
461− card->name, skb->data[2], txlen);
461+ card->name, skb->data[2], txlen);
462462 #endif
463463 skb_copy_from_linear_data_offset(skb, 2, dma->sendbuf.dmabuf,
464464 skb->len - 2);
465465 }
466466 txlen = (txlen + 3) & ~3;
467467
468− c4outmeml(card->mbase+MBOX_DOWN_ADDR, dma->sendbuf.dmaaddr);
469− c4outmeml(card->mbase+MBOX_DOWN_LEN, txlen);
468+ c4outmeml(card->mbase + MBOX_DOWN_ADDR, dma->sendbuf.dmaaddr);
469+ c4outmeml(card->mbase + MBOX_DOWN_LEN, txlen);
470470
471471 card->csr |= DBELL_DOWN_ARM;
472472
473− c4outmeml(card->mbase+DOORBELL, DBELL_DOWN_ARM);
473+ c4outmeml(card->mbase + DOORBELL, DBELL_DOWN_ARM);
474474
475475 dev_kfree_skb_any(skb);
476476 }
@@ -485,7 +485,7 @@ static void queue_pollack(avmcard *card) · 8 unmodified lines
485485 skb = alloc_skb(3, GFP_ATOMIC);
486486 if (!skb) {
487487 printk(KERN_CRIT "%s: no memory, lost poll ack\n",
488− card->name);
488+ card->name);
489489 return;
490490 }
491491 p = skb->data;
@@ -514,9 +514,9 @@ static void c4_handle_rx(avmcard *card) · 22 unmodified lines
514514
515515 #ifdef AVM_C4_DEBUG
516516 printk(KERN_DEBUG "%s: rx 0x%x len=%lu\n", card->name,
517− b1cmd, (unsigned long)dma->recvlen);
517+ b1cmd, (unsigned long)dma->recvlen);
518518 #endif
519−
519+
520520 switch (b1cmd) {
521521 case RECEIVE_DATA_B3_IND:
522522
@@ -528,13 +528,13 @@ static void c4_handle_rx(avmcard *card) · 5 unmodified lines
528528 ctrl = &card->ctrlinfo[cidx].capi_ctrl;
529529
530530 if (MsgLen < 30) { /* not CAPI 64Bit */
531− memset(card->msgbuf+MsgLen, 0, 30-MsgLen);
531+ memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
532532 MsgLen = 30;
533533 CAPIMSG_SETLEN(card->msgbuf, 30);
534534 }
535− if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) {
535+ if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
536536 printk(KERN_ERR "%s: incoming packet dropped\n",
537− card->name);
537+ card->name);
538538 } else {
539539 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
540540 memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
@@ -553,7 +553,7 @@ static void c4_handle_rx(avmcard *card) · 12 unmodified lines
553553
554554 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
555555 printk(KERN_ERR "%s: incoming packet dropped\n",
556− card->name);
556+ card->name);
557557 } else {
558558 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
559559 if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF)
@@ -570,7 +570,7 @@ static void c4_handle_rx(avmcard *card) · 10 unmodified lines
570570 ApplId = _get_word(&p);
571571 NCCI = _get_word(&p);
572572 WindowSize = _get_word(&p);
573− cidx = (NCCI&0x7f) - card->cardnr;
573+ cidx = (NCCI & 0x7f) - card->cardnr;
574574 if (cidx >= card->nlogcontr) cidx = 0;
575575
576576 capilib_new_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI, WindowSize);
@@ -583,7 +583,7 @@ static void c4_handle_rx(avmcard *card) · 6 unmodified lines
583583 NCCI = _get_word(&p);
584584
585585 if (NCCI != 0xffffffff) {
586− cidx = (NCCI&0x7f) - card->cardnr;
586+ cidx = (NCCI & 0x7f) - card->cardnr;
587587 if (cidx >= card->nlogcontr) cidx = 0;
588588 capilib_free_ncci(&card->ctrlinfo[cidx].ncci_head, ApplId, NCCI);
589589 }
@@ -595,14 +595,14 @@ static void c4_handle_rx(avmcard *card) · 5 unmodified lines
595595 #endif
596596 if (!suppress_pollack)
597597 queue_pollack(card);
598− for (cidx=0; cidx < card->nr_controllers; cidx++) {
598+ for (cidx = 0; cidx < card->nr_controllers; cidx++) {
599599 ctrl = &card->ctrlinfo[cidx].capi_ctrl;
600600 capi_ctr_resume_output(ctrl);
601601 }
602602 break;
603603
604604 case RECEIVE_STOP:
605− for (cidx=0; cidx < card->nr_controllers; cidx++) {
605+ for (cidx = 0; cidx < card->nr_controllers; cidx++) {
606606 ctrl = &card->ctrlinfo[cidx].capi_ctrl;
607607 capi_ctr_suspend_output(ctrl);
608608 }
@@ -610,14 +610,14 @@ static void c4_handle_rx(avmcard *card) · 1 unmodified line
610610
611611 case RECEIVE_INIT:
612612
613− cidx = card->nlogcontr;
613+ cidx = card->nlogcontr;
614614 if (cidx >= card->nr_controllers) {
615615 printk(KERN_ERR "%s: card with %d controllers ??\n",
616− card->name, cidx+1);
616+ card->name, cidx + 1);
617617 break;
618618 }
619− card->nlogcontr++;
620− cinfo = &card->ctrlinfo[cidx];
619+ card->nlogcontr++;
620+ cinfo = &card->ctrlinfo[cidx];
621621 ctrl = &cinfo->capi_ctrl;
622622 cinfo->versionlen = _get_slice(&p, cinfo->versionbuf);
623623 b1_parse_version(cinfo);
@@ -632,23 +632,23 @@ static void c4_handle_rx(avmcard *card) · 8 unmodified lines
632632 ApplId = (unsigned) _get_word(&p);
633633 MsgLen = _get_slice(&p, card->msgbuf);
634634 card->msgbuf[MsgLen] = 0;
635− while ( MsgLen > 0
636− && ( card->msgbuf[MsgLen-1] == '\n'
637− || card->msgbuf[MsgLen-1] == '\r')) {
638− card->msgbuf[MsgLen-1] = 0;
635+ while (MsgLen > 0
636+ && (card->msgbuf[MsgLen - 1] == '\n'
637+ || card->msgbuf[MsgLen - 1] == '\r')) {
638+ card->msgbuf[MsgLen - 1] = 0;
639639 MsgLen--;
640640 }
641641 printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
642− card->name, ApplId, card->msgbuf);
642+ card->name, ApplId, card->msgbuf);
643643 break;
644644
645645 case RECEIVE_DEBUGMSG:
646646 MsgLen = _get_slice(&p, card->msgbuf);
647647 card->msgbuf[MsgLen] = 0;
648− while ( MsgLen > 0
649− && ( card->msgbuf[MsgLen-1] == '\n'
650− || card->msgbuf[MsgLen-1] == '\r')) {
651− card->msgbuf[MsgLen-1] = 0;
648+ while (MsgLen > 0
649+ && (card->msgbuf[MsgLen - 1] == '\n'
650+ || card->msgbuf[MsgLen - 1] == '\r')) {
651+ card->msgbuf[MsgLen - 1] = 0;
652652 MsgLen--;
653653 }
654654 printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -656,7 +656,7 @@ static void c4_handle_rx(avmcard *card) · 1 unmodified line
656656
657657 default:
658658 printk(KERN_ERR "%s: c4_interrupt: 0x%x ???\n",
659− card->name, b1cmd);
659+ card->name, b1cmd);
660660 return;
661661 }
662662 }
@@ -669,16 +669,16 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) · 6 unmodified lines
669669 u32 status;
670670
671671 spin_lock_irqsave(&card->lock, flags);
672− status = c4inmeml(card->mbase+DOORBELL);
672+ status = c4inmeml(card->mbase + DOORBELL);
673673
674674 if (status & DBELL_RESET_HOST) {
675675 u_int i;
676− c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x0c);
676+ c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x0c);
677677 spin_unlock_irqrestore(&card->lock, flags);
678678 if (card->nlogcontr == 0)
679679 return IRQ_HANDLED;
680680 printk(KERN_ERR "%s: unexpected reset\n", card->name);
681− for (i=0; i < card->nr_controllers; i++) {
681+ for (i = 0; i < card->nr_controllers; i++) {
682682 avmctrl_info *cinfo = &card->ctrlinfo[i];
683683 memset(cinfo->version, 0, sizeof(cinfo->version));
684684 spin_lock_irqsave(&card->lock, flags);
@@ -695,23 +695,23 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) · 10 unmodified lines
695695 spin_unlock_irqrestore(&card->lock, flags);
696696 return IRQ_HANDLED;
697697 }
698− c4outmeml(card->mbase+DOORBELL, status);
698+ c4outmeml(card->mbase + DOORBELL, status);
699699
700700 if ((status & DBELL_UP_HOST) != 0) {
701− card->dma->recvlen = c4inmeml(card->mbase+MBOX_UP_LEN);
702− c4outmeml(card->mbase+MBOX_UP_LEN, 0);
701+ card->dma->recvlen = c4inmeml(card->mbase + MBOX_UP_LEN);
702+ c4outmeml(card->mbase + MBOX_UP_LEN, 0);
703703 c4_handle_rx(card);
704704 card->dma->recvlen = 0;
705− c4outmeml(card->mbase+MBOX_UP_LEN, card->dma->recvbuf.size);
706− c4outmeml(card->mbase+DOORBELL, DBELL_UP_ARM);
705+ c4outmeml(card->mbase + MBOX_UP_LEN, card->dma->recvbuf.size);
706+ c4outmeml(card->mbase + DOORBELL, DBELL_UP_ARM);
707707 }
708708
709709 if ((status & DBELL_DOWN_HOST) != 0) {
710710 card->csr &= ~DBELL_DOWN_ARM;
711− c4_dispatch_tx(card);
711+ c4_dispatch_tx(card);
712712 } else if (card->csr & DBELL_DOWN_HOST) {
713− if (c4inmeml(card->mbase+MBOX_DOWN_LEN) == 0) {
714− card->csr &= ~DBELL_DOWN_ARM;
713+ if (c4inmeml(card->mbase + MBOX_DOWN_LEN) == 0) {
714+ card->csr &= ~DBELL_DOWN_ARM;
715715 c4_dispatch_tx(card);
716716 }
717717 }
@@ -737,7 +737,7 @@ static void c4_send_init(avmcard *card) · 19 unmodified lines
737737 skb = alloc_skb(15, GFP_ATOMIC);
738738 if (!skb) {
739739 printk(KERN_CRIT "%s: no memory, lost register appl.\n",
740− card->name);
740+ card->name);
741741 return;
742742 }
743743 p = skb->data;
@@ -745,7 +745,7 @@ static void c4_send_init(avmcard *card) · 1 unmodified line
745745 _put_byte(&p, 0);
746746 _put_byte(&p, SEND_INIT);
747747 _put_word(&p, CAPI_MAXAPPL);
748− _put_word(&p, AVM_NCCI_PER_CHANNEL*30);
748+ _put_word(&p, AVM_NCCI_PER_CHANNEL * 30);
749749 _put_word(&p, card->cardnr - 1);
750750 skb_put(skb, (u8 *)p - (u8 *)skb->data);
751751
@@ -761,10 +761,10 @@ static int queue_sendconfigword(avmcard *card, u32 val) · 9 unmodified lines
761761 unsigned long flags;
762762 void *p;
763763
764− skb = alloc_skb(3+4, GFP_ATOMIC);
764+ skb = alloc_skb(3 + 4, GFP_ATOMIC);
765765 if (!skb) {
766766 printk(KERN_CRIT "%s: no memory, send config\n",
767− card->name);
767+ card->name);
768768 return -ENOMEM;
769769 }
770770 p = skb->data;
@@ -787,10 +787,10 @@ static int queue_sendconfig(avmcard *card, char cval[4]) · 16 unmodified lines
787787 unsigned long flags;
788788 void *p;
789789
790− skb = alloc_skb(3+4, GFP_ATOMIC);
790+ skb = alloc_skb(3 + 4, GFP_ATOMIC);
791791 if (!skb) {
792792 printk(KERN_CRIT "%s: no memory, send config\n",
793− card->name);
793+ card->name);
794794 return -ENOMEM;
795795 }
796796 p = skb->data;
@@ -804,20 +804,20 @@ static int queue_sendconfig(avmcard *card, char cval[4]) · 7 unmodified lines
804804 skb_put(skb, (u8 *)p - (u8 *)skb->data);
805805
806806 skb_queue_tail(&card->dma->send_queue, skb);
807−
807+
808808 spin_lock_irqsave(&card->lock, flags);
809809 c4_dispatch_tx(card);
810810 spin_unlock_irqrestore(&card->lock, flags);
811811 return 0;
812812 }
813813
814−static int c4_send_config(avmcard *card, capiloaddatapart * config)
814+static int c4_send_config(avmcard *card, capiloaddatapart *config)
815815 {
816816 u8 val[4];
817817 unsigned char *dp;
818818 u_int left;
819819 int retval;
820−
820+
821821 if ((retval = queue_sendconfigword(card, 1)) != 0)
822822 return retval;
823823 if ((retval = queue_sendconfigword(card, config->len)) != 0)
@@ -826,7 +826,7 @@ static int c4_send_config(avmcard *card, capiloaddatapart * config) · 2 unmodified lines
826826 dp = config->data;
827827 left = config->len;
828828 while (left >= sizeof(u32)) {
829− if (config->user) {
829+ if (config->user) {
830830 if (copy_from_user(val, dp, sizeof(val)))
831831 return -EFAULT;
832832 } else {
@@ -860,37 +860,37 @@ static int c4_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 27 unmodified lines
860860
861861 if ((retval = c4_load_t4file(card, &data->firmware))) {
862862 printk(KERN_ERR "%s: failed to load t4file!!\n",
863− card->name);
863+ card->name);
864864 c4_reset(card);
865865 return retval;
866866 }
867867
868868 card->csr = 0;
869− c4outmeml(card->mbase+MBOX_UP_LEN, 0);
870− c4outmeml(card->mbase+MBOX_DOWN_LEN, 0);
871− c4outmeml(card->mbase+DOORBELL, DBELL_INIT);
869+ c4outmeml(card->mbase + MBOX_UP_LEN, 0);
870+ c4outmeml(card->mbase + MBOX_DOWN_LEN, 0);
871+ c4outmeml(card->mbase + DOORBELL, DBELL_INIT);
872872 mdelay(1);
873− c4outmeml(card->mbase+DOORBELL,
874− DBELL_UP_HOST | DBELL_DOWN_HOST | DBELL_RESET_HOST);
873+ c4outmeml(card->mbase + DOORBELL,
874+ DBELL_UP_HOST | DBELL_DOWN_HOST | DBELL_RESET_HOST);
875875
876− c4outmeml(card->mbase+PCI_OUT_INT_MASK, 0x08);
876+ c4outmeml(card->mbase + PCI_OUT_INT_MASK, 0x08);
877877
878878 card->dma->recvlen = 0;
879− c4outmeml(card->mbase+MBOX_UP_ADDR, card->dma->recvbuf.dmaaddr);
880− c4outmeml(card->mbase+MBOX_UP_LEN, card->dma->recvbuf.size);
881− c4outmeml(card->mbase+DOORBELL, DBELL_UP_ARM);
879+ c4outmeml(card->mbase + MBOX_UP_ADDR, card->dma->recvbuf.dmaaddr);
880+ c4outmeml(card->mbase + MBOX_UP_LEN, card->dma->recvbuf.size);
881+ c4outmeml(card->mbase + DOORBELL, DBELL_UP_ARM);
882882
883883 if (data->configuration.len > 0 && data->configuration.data) {
884884 retval = c4_send_config(card, &data->configuration);
885885 if (retval) {
886886 printk(KERN_ERR "%s: failed to set config!!\n",
887− card->name);
887+ card->name);
888888 c4_reset(card);
889889 return retval;
890890 }
891891 }
892892
893− c4_send_init(card);
893+ c4_send_init(card);
894894
895895 return 0;
896896 }
@@ -905,11 +905,11 @@ static void c4_reset_ctr(struct capi_ctr *ctrl) · 8 unmodified lines
905905
906906 spin_lock_irqsave(&card->lock, flags);
907907
908− c4_reset(card);
908+ c4_reset(card);
909909
910910 spin_unlock_irqrestore(&card->lock, flags);
911911
912− for (i=0; i < card->nr_controllers; i++) {
912+ for (i = 0; i < card->nr_controllers; i++) {
913913 cinfo = &card->ctrlinfo[i];
914914 memset(cinfo->version, 0, sizeof(cinfo->version));
915915 capi_ctr_down(&cinfo->capi_ctrl);
@@ -926,9 +926,9 @@ static void c4_remove(struct pci_dev *pdev) · 10 unmodified lines
926926 if (!card)
927927 return;
928928
929− c4_reset(card);
929+ c4_reset(card);
930930
931− for (i=0; i < card->nr_controllers; i++) {
931+ for (i = 0; i < card->nr_controllers; i++) {
932932 cinfo = &card->ctrlinfo[i];
933933 detach_capi_ctr(&cinfo->capi_ctrl);
934934 }
@@ -936,8 +936,8 @@ static void c4_remove(struct pci_dev *pdev) · 1 unmodified line
936936 free_irq(card->irq, card);
937937 iounmap(card->mbase);
938938 release_region(card->port, AVMB1_PORTLEN);
939− avmcard_dma_free(card->dma);
940− pci_set_drvdata(pdev, NULL);
939+ avmcard_dma_free(card->dma);
940+ pci_set_drvdata(pdev, NULL);
941941 b1_free_card(card);
942942 }
943943
@@ -945,8 +945,8 @@ static void c4_remove(struct pci_dev *pdev) · 1 unmodified line
945945
946946
947947 static void c4_register_appl(struct capi_ctr *ctrl,
948− u16 appl,
949− capi_register_params *rp)
948+ u16 appl,
949+ capi_register_params *rp)
950950 {
951951 avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata);
952952 avmcard *card = cinfo->card;
@@ -965,7 +965,7 @@ static void c4_register_appl(struct capi_ctr *ctrl, · 12 unmodified lines
965965 skb = alloc_skb(23, GFP_ATOMIC);
966966 if (!skb) {
967967 printk(KERN_CRIT "%s: no memory, lost register appl.\n",
968− card->name);
968+ card->name);
969969 return;
970970 }
971971 p = skb->data;
@@ -973,14 +973,14 @@ static void c4_register_appl(struct capi_ctr *ctrl, · 1 unmodified line
973973 _put_byte(&p, 0);
974974 _put_byte(&p, SEND_REGISTER);
975975 _put_word(&p, appl);
976− _put_word(&p, 1024 * (nconn+1));
976+ _put_word(&p, 1024 * (nconn + 1));
977977 _put_word(&p, nconn);
978978 _put_word(&p, rp->datablkcnt);
979979 _put_word(&p, rp->datablklen);
980980 skb_put(skb, (u8 *)p - (u8 *)skb->data);
981981
982982 skb_queue_tail(&card->dma->send_queue, skb);
983−
983+
984984 spin_lock_irqsave(&card->lock, flags);
985985 c4_dispatch_tx(card);
986986 spin_unlock_irqrestore(&card->lock, flags);
@@ -1005,7 +1005,7 @@ static void c4_release_appl(struct capi_ctr *ctrl, u16 appl) · 18 unmodified lines
10051005 skb = alloc_skb(7, GFP_ATOMIC);
10061006 if (!skb) {
10071007 printk(KERN_CRIT "%s: no memory, lost release appl.\n",
1008− card->name);
1008+ card->name);
10091009 return;
10101010 }
10111011 p = skb->data;
@@ -1098,29 +1098,29 @@ static int c4_proc_show(struct seq_file *m, void *v) · 86 unmodified lines
10981098 seq_printf(m, "%-16s %s\n", "ver_serial", s);
10991099
11001100 if (card->cardtype != avm_m1) {
1101− flag = ((u8 *)(ctrl->profile.manu))[3];
1102− if (flag)
1101+ flag = ((u8 *)(ctrl->profile.manu))[3];
1102+ if (flag)
11031103 seq_printf(m, "%-16s%s%s%s%s%s%s%s\n",
1104− "protocol",
1105− (flag & 0x01) ? " DSS1" : "",
1106− (flag & 0x02) ? " CT1" : "",
1107− (flag & 0x04) ? " VN3" : "",
1108− (flag & 0x08) ? " NI1" : "",
1109− (flag & 0x10) ? " AUSTEL" : "",
1110− (flag & 0x20) ? " ESS" : "",
1111− (flag & 0x40) ? " 1TR6" : ""
1112− );
1104+ "protocol",
1105+ (flag & 0x01) ? " DSS1" : "",
1106+ (flag & 0x02) ? " CT1" : "",
1107+ (flag & 0x04) ? " VN3" : "",
1108+ (flag & 0x08) ? " NI1" : "",
1109+ (flag & 0x10) ? " AUSTEL" : "",
1110+ (flag & 0x20) ? " ESS" : "",
1111+ (flag & 0x40) ? " 1TR6" : ""
1112+ );
11131113 }
11141114 if (card->cardtype != avm_m1) {
1115− flag = ((u8 *)(ctrl->profile.manu))[5];
1115+ flag = ((u8 *)(ctrl->profile.manu))[5];
11161116 if (flag)
11171117 seq_printf(m, "%-16s%s%s%s%s\n",
1118− "linetype",
1119− (flag & 0x01) ? " point to point" : "",
1120− (flag & 0x02) ? " point to multipoint" : "",
1121− (flag & 0x08) ? " leased line without D-channel" : "",
1122− (flag & 0x04) ? " leased line with D-channel" : ""
1123− );
1118+ "linetype",
1119+ (flag & 0x01) ? " point to point" : "",
1120+ (flag & 0x02) ? " point to multipoint" : "",
1121+ (flag & 0x08) ? " leased line without D-channel" : "",
1122+ (flag & 0x04) ? " leased line with D-channel" : ""
1123+ );
11241124 }
11251125 seq_printf(m, "%-16s %s\n", "cardname", cinfo->cardname);
11261126
@@ -1156,7 +1156,7 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev, · 29 unmodified lines
11561156 retval = -ENOMEM;
11571157 goto err;
11581158 }
1159− card->dma = avmcard_dma_alloc("c4", dev, 2048+128, 2048+128);
1159+ card->dma = avmcard_dma_alloc("c4", dev, 2048 + 128, 2048 + 128);
11601160 if (!card->dma) {
11611161 printk(KERN_WARNING "c4: no memory.\n");
11621162 retval = -ENOMEM;
@@ -1195,12 +1195,12 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev, · 32 unmodified lines
11951195
11961196 retval = request_irq(card->irq, c4_interrupt, IRQF_SHARED, card->name, card);
11971197 if (retval) {
1198− printk(KERN_ERR "c4: unable to get IRQ %d.\n",card->irq);
1198+ printk(KERN_ERR "c4: unable to get IRQ %d.\n", card->irq);
11991199 retval = -EBUSY;
12001200 goto err_unmap;
12011201 }
12021202
1203− for (i=0; i < nr_controllers ; i++) {
1203+ for (i = 0; i < nr_controllers; i++) {
12041204 cinfo = &card->ctrlinfo[i];
12051205 cinfo->capi_ctrl.owner = THIS_MODULE;
12061206 cinfo->capi_ctrl.driver_name = "c4";
@@ -1233,17 +1233,17 @@ static int c4_add_card(struct capicardparams *p, struct pci_dev *dev, · 26 unmodified lines
12331233 pci_set_drvdata(dev, card);
12341234 return 0;
12351235
1236− err_free_irq:
1236+err_free_irq:
12371237 free_irq(card->irq, card);
1238− err_unmap:
1238+err_unmap:
12391239 iounmap(card->mbase);
1240− err_release_region:
1240+err_release_region:
12411241 release_region(card->port, AVMB1_PORTLEN);
1242− err_free_dma:
1242+err_free_dma:
12431243 avmcard_dma_free(card->dma);
1244− err_free:
1244+err_free:
12451245 b1_free_card(card);
1246− err:
1246+err:
12471247 return retval;
12481248 }
12491249
@@ -1265,10 +1265,10 @@ static int __devinit c4_probe(struct pci_dev *dev, · 15 unmodified lines
12651265 param.port = pci_resource_start(dev, 1);
12661266 param.irq = dev->irq;
12671267 param.membase = pci_resource_start(dev, 0);
1268−
1268+
12691269 printk(KERN_INFO "c4: PCI BIOS reports AVM-C%d at i/o %#x, irq %d, mem %#x\n",
12701270 nr, param.port, param.irq, param.membase);
1271−
1271+
12721272 retval = c4_add_card(&param, dev, nr);
12731273 if (retval != 0) {
12741274 printk(KERN_ERR "c4: no AVM-C%d at i/o %#x, irq %d detected, mem %#x\n",
@@ -1280,10 +1280,10 @@ static int __devinit c4_probe(struct pci_dev *dev, · 5 unmodified lines
12801280 }
12811281
12821282 static struct pci_driver c4_pci_driver = {
1283− .name = "c4",
1284− .id_table = c4_pci_tbl,
1285− .probe = c4_probe,
1286− .remove = c4_remove,
1283+ .name = "c4",
1284+ .id_table = c4_pci_tbl,
1285+ .probe = c4_probe,
1286+ .remove = c4_remove,
12871287 };
12881288
12891289 static struct capi_driver capi_driver_c2 = {
@@ -1305,7 +1305,7 @@ static int __init c4_init(void) · 15 unmodified lines
13051305 if ((p = strchr(revision, ':')) != NULL && p[1]) {
13061306 strlcpy(rev, p + 2, 32);
13071307 if ((p = strchr(rev, '$')) != NULL && p > rev)
1308− *(p-1) = 0;
1308+ *(p - 1) = 0;
13091309 } else
13101310 strcpy(rev, "1.0");
13111311
drivers/isdn/hardware/avm/t1isa.c+50−50
@@ -1,9 +1,9 @@
11 /* $Id: t1isa.c,v 1.1.2.3 2004/02/10 01:07:12 keil Exp $
2− *
2+ *
33 * Module for AVM T1 HEMA-card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -67,7 +67,7 @@ static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr) · 57 unmodified lines
6767 int i;
6868
6969 reverse_cardnr = ((cardnr & 0x01) << 3) | ((cardnr & 0x02) << 1)
70− | ((cardnr & 0x04) >> 1) | ((cardnr & 0x08) >> 3);
70+ | ((cardnr & 0x04) >> 1) | ((cardnr & 0x08) >> 3);
7171 cregs[0] = (HEMA_VERSION_ID << 4) | (reverse_cardnr & 0xf);
7272 cregs[1] = 0x00; /* fast & slow link connected to CON1 */
7373 cregs[2] = 0x05; /* fast link 20MBit, slow link 20 MBit */
@@ -86,50 +86,50 @@ static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr) · 12 unmodified lines
8686 /* board reset */
8787 t1outp(base, T1_RESETBOARD, 0xf);
8888 mdelay(100);
89− dummy = t1inp(base, T1_FASTLINK+T1_OUTSTAT); /* first read */
89+ dummy = t1inp(base, T1_FASTLINK + T1_OUTSTAT); /* first read */
9090
9191 /* write config */
9292 dummy = (base >> 4) & 0xff;
93− for (i=1;i<=0xf;i++) t1outp(base, i, dummy);
93+ for (i = 1; i <= 0xf; i++) t1outp(base, i, dummy);
9494 t1outp(base, HEMA_PAL_ID & 0xf, dummy);
9595 t1outp(base, HEMA_PAL_ID >> 4, cregs[0]);
96− for(i=1;i<7;i++) t1outp(base, 0, cregs[i]);
96+ for (i = 1; i < 7; i++) t1outp(base, 0, cregs[i]);
9797 t1outp(base, ((base >> 4)) & 0x3, cregs[7]);
9898 /* restore_flags(flags); */
9999
100100 mdelay(100);
101− t1outp(base, T1_FASTLINK+T1_RESETLINK, 0);
102− t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0);
101+ t1outp(base, T1_FASTLINK + T1_RESETLINK, 0);
102+ t1outp(base, T1_SLOWLINK + T1_RESETLINK, 0);
103103 mdelay(10);
104− t1outp(base, T1_FASTLINK+T1_RESETLINK, 1);
105− t1outp(base, T1_SLOWLINK+T1_RESETLINK, 1);
104+ t1outp(base, T1_FASTLINK + T1_RESETLINK, 1);
105+ t1outp(base, T1_SLOWLINK + T1_RESETLINK, 1);
106106 mdelay(100);
107− t1outp(base, T1_FASTLINK+T1_RESETLINK, 0);
108− t1outp(base, T1_SLOWLINK+T1_RESETLINK, 0);
107+ t1outp(base, T1_FASTLINK + T1_RESETLINK, 0);
108+ t1outp(base, T1_SLOWLINK + T1_RESETLINK, 0);
109109 mdelay(10);
110− t1outp(base, T1_FASTLINK+T1_ANALYSE, 0);
110+ t1outp(base, T1_FASTLINK + T1_ANALYSE, 0);
111111 mdelay(5);
112− t1outp(base, T1_SLOWLINK+T1_ANALYSE, 0);
112+ t1outp(base, T1_SLOWLINK + T1_ANALYSE, 0);
113113
114− if (t1inp(base, T1_FASTLINK+T1_OUTSTAT) != 0x1) /* tx empty */
114+ if (t1inp(base, T1_FASTLINK + T1_OUTSTAT) != 0x1) /* tx empty */
115115 return 1;
116− if (t1inp(base, T1_FASTLINK+T1_INSTAT) != 0x0) /* rx empty */
116+ if (t1inp(base, T1_FASTLINK + T1_INSTAT) != 0x0) /* rx empty */
117117 return 2;
118− if (t1inp(base, T1_FASTLINK+T1_IRQENABLE) != 0x0)
118+ if (t1inp(base, T1_FASTLINK + T1_IRQENABLE) != 0x0)
119119 return 3;
120− if ((t1inp(base, T1_FASTLINK+T1_FIFOSTAT) & 0xf0) != 0x70)
120+ if ((t1inp(base, T1_FASTLINK + T1_FIFOSTAT) & 0xf0) != 0x70)
121121 return 4;
122− if ((t1inp(base, T1_FASTLINK+T1_IRQMASTER) & 0x0e) != 0)
122+ if ((t1inp(base, T1_FASTLINK + T1_IRQMASTER) & 0x0e) != 0)
123123 return 5;
124− if ((t1inp(base, T1_FASTLINK+T1_IDENT) & 0x7d) != 1)
124+ if ((t1inp(base, T1_FASTLINK + T1_IDENT) & 0x7d) != 1)
125125 return 6;
126− if (t1inp(base, T1_SLOWLINK+T1_OUTSTAT) != 0x1) /* tx empty */
126+ if (t1inp(base, T1_SLOWLINK + T1_OUTSTAT) != 0x1) /* tx empty */
127127 return 7;
128− if ((t1inp(base, T1_SLOWLINK+T1_IRQMASTER) & 0x0e) != 0)
128+ if ((t1inp(base, T1_SLOWLINK + T1_IRQMASTER) & 0x0e) != 0)
129129 return 8;
130− if ((t1inp(base, T1_SLOWLINK+T1_IDENT) & 0x7d) != 0)
130+ if ((t1inp(base, T1_SLOWLINK + T1_IDENT) & 0x7d) != 0)
131131 return 9;
132− return 0;
132+ return 0;
133133 }
134134
135135 static irqreturn_t t1isa_interrupt(int interrupt, void *devptr)
@@ -163,13 +163,13 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) · 27 unmodified lines
163163 spin_unlock_irqrestore(&card->lock, flags);
164164
165165 if (MsgLen < 30) { /* not CAPI 64Bit */
166− memset(card->msgbuf+MsgLen, 0, 30-MsgLen);
166+ memset(card->msgbuf + MsgLen, 0, 30 - MsgLen);
167167 MsgLen = 30;
168168 CAPIMSG_SETLEN(card->msgbuf, 30);
169169 }
170− if (!(skb = alloc_skb(DataB3Len+MsgLen, GFP_ATOMIC))) {
170+ if (!(skb = alloc_skb(DataB3Len + MsgLen, GFP_ATOMIC))) {
171171 printk(KERN_ERR "%s: incoming packet dropped\n",
172− card->name);
172+ card->name);
173173 } else {
174174 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
175175 memcpy(skb_put(skb, DataB3Len), card->databuf, DataB3Len);
@@ -184,7 +184,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) · 8 unmodified lines
184184 if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) {
185185 spin_unlock_irqrestore(&card->lock, flags);
186186 printk(KERN_ERR "%s: incoming packet dropped\n",
187− card->name);
187+ card->name);
188188 } else {
189189 memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen);
190190 if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3)
@@ -242,24 +242,24 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) · 51 unmodified lines
242242 MsgLen = t1_get_slice(card->port, card->msgbuf);
243243 spin_unlock_irqrestore(&card->lock, flags);
244244 card->msgbuf[MsgLen] = 0;
245− while ( MsgLen > 0
246− && ( card->msgbuf[MsgLen-1] == '\n'
247− || card->msgbuf[MsgLen-1] == '\r')) {
248− card->msgbuf[MsgLen-1] = 0;
245+ while (MsgLen > 0
246+ && (card->msgbuf[MsgLen - 1] == '\n'
247+ || card->msgbuf[MsgLen - 1] == '\r')) {
248+ card->msgbuf[MsgLen - 1] = 0;
249249 MsgLen--;
250250 }
251251 printk(KERN_INFO "%s: task %d \"%s\" ready.\n",
252− card->name, ApplId, card->msgbuf);
252+ card->name, ApplId, card->msgbuf);
253253 break;
254254
255255 case RECEIVE_DEBUGMSG:
256256 MsgLen = t1_get_slice(card->port, card->msgbuf);
257257 spin_unlock_irqrestore(&card->lock, flags);
258258 card->msgbuf[MsgLen] = 0;
259− while ( MsgLen > 0
260− && ( card->msgbuf[MsgLen-1] == '\n'
261− || card->msgbuf[MsgLen-1] == '\r')) {
262− card->msgbuf[MsgLen-1] = 0;
259+ while (MsgLen > 0
260+ && (card->msgbuf[MsgLen - 1] == '\n'
261+ || card->msgbuf[MsgLen - 1] == '\r')) {
262+ card->msgbuf[MsgLen - 1] = 0;
263263 MsgLen--;
264264 }
265265 printk(KERN_INFO "%s: DEBUG: %s\n", card->name, card->msgbuf);
@@ -273,7 +273,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) · 7 unmodified lines
273273 default:
274274 spin_unlock_irqrestore(&card->lock, flags);
275275 printk(KERN_ERR "%s: b1_interrupt: 0x%x ???\n",
276− card->name, b1cmd);
276+ card->name, b1cmd);
277277 return IRQ_NONE;
278278 }
279279 }
@@ -296,7 +296,7 @@ static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 16 unmodified lines
296296 if ((retval = b1_load_t4file(card, &data->firmware))) {
297297 b1_reset(port);
298298 printk(KERN_ERR "%s: failed to load t4file!!\n",
299− card->name);
299+ card->name);
300300 return retval;
301301 }
302302
@@ -304,7 +304,7 @@ static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 1 unmodified line
304304 if ((retval = b1_load_config(card, &data->configuration))) {
305305 b1_reset(port);
306306 printk(KERN_ERR "%s: failed to load config!!\n",
307− card->name);
307+ card->name);
308308 return retval;
309309 }
310310 }
@@ -318,7 +318,7 @@ static int t1isa_load_firmware(struct capi_ctr *ctrl, capiloaddata *data) · 7 unmodified lines
318318 b1_setinterrupt(port, card->irq, card->cardtype);
319319 b1_put_byte(port, SEND_INIT);
320320 b1_put_word(port, CAPI_MAXAPPL);
321− b1_put_word(port, AVM_NCCI_PER_CHANNEL*30);
321+ b1_put_word(port, AVM_NCCI_PER_CHANNEL * 30);
322322 b1_put_word(port, ctrl->cnr - 1);
323323 spin_unlock_irqrestore(&card->lock, flags);
324324
@@ -347,7 +347,7 @@ static void t1isa_remove(struct pci_dev *pdev) · 22 unmodified lines
347347 {
348348 avmctrl_info *cinfo = pci_get_drvdata(pdev);
349349 avmcard *card;
350−
350+
351351 if (!cinfo)
352352 return;
353353
@@ -393,7 +393,7 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr) · 39 unmodified lines
393393 printk(KERN_WARNING "t1isa: invalid port 0x%x.\n", card->port);
394394 retval = -EINVAL;
395395 goto err_free;
396− }
396+ }
397397 if (hema_irq_table[card->irq & 0xf] == 0) {
398398 printk(KERN_WARNING "t1isa: irq %d not valid.\n", card->irq);
399399 retval = -EINVAL;
@@ -412,7 +412,7 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr) · 12 unmodified lines
412412 goto err_release_region;
413413 }
414414
415− if ((retval = t1_detectandinit(card->port, card->irq, card->cardnr)) != 0) {
415+ if ((retval = t1_detectandinit(card->port, card->irq, card->cardnr)) != 0) {
416416 printk(KERN_INFO "t1isa: NO card at 0x%x (%d)\n",
417417 card->port, retval);
418418 retval = -ENODEV;
@@ -445,13 +445,13 @@ static int t1isa_probe(struct pci_dev *pdev, int cardnr) · 26 unmodified lines
445445 pci_set_drvdata(pdev, cinfo);
446446 return 0;
447447
448− err_free_irq:
448+err_free_irq:
449449 free_irq(card->irq, card);
450− err_release_region:
450+err_release_region:
451451 release_region(card->port, AVMB1_PORTLEN);
452− err_free:
452+err_free:
453453 b1_free_card(card);
454− err:
454+err:
455455 return retval;
456456 }
457457
@@ -555,7 +555,7 @@ static int __init t1isa_init(void) · 97 unmodified lines
555555 if ((p = strchr(revision, ':')) != NULL && p[1]) {
556556 strlcpy(rev, p + 2, 32);
557557 if ((p = strchr(rev, '$')) != NULL && p > rev)
558− *(p-1) = 0;
558+ *(p - 1) = 0;
559559 } else
560560 strcpy(rev, "1.0");
561561
drivers/isdn/hardware/avm/t1pci.c+16−16
@@ -1,9 +1,9 @@
11 /* $Id: t1pci.c,v 1.1.2.2 2004/01/16 21:09:27 keil Exp $
2− *
2+ *
33 * Module for AVM T1 PCI-card.
4− *
4+ *
55 * Copyright 1999 by Carsten Paeth <calle@calle.de>
6− *
6+ *
77 * This software may be used and distributed according to the terms
88 * of the GNU General Public License, incorporated herein by reference.
99 *
@@ -59,7 +59,7 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev) · 49 unmodified lines
5959 goto err;
6060 }
6161
62− card->dma = avmcard_dma_alloc("t1pci", pdev, 2048+128, 2048+128);
62+ card->dma = avmcard_dma_alloc("t1pci", pdev, 2048 + 128, 2048 + 128);
6363 if (!card->dma) {
6464 printk(KERN_WARNING "t1pci: no memory.\n");
6565 retval = -ENOMEM;
@@ -136,17 +136,17 @@ static int t1pci_add_card(struct capicardparams *p, struct pci_dev *pdev) · 70 unmodified lines
136136 pci_set_drvdata(pdev, card);
137137 return 0;
138138
139− err_free_irq:
139+err_free_irq:
140140 free_irq(card->irq, card);
141− err_unmap:
141+err_unmap:
142142 iounmap(card->mbase);
143− err_release_region:
143+err_release_region:
144144 release_region(card->port, AVMB1_PORTLEN);
145− err_free_dma:
145+err_free_dma:
146146 avmcard_dma_free(card->dma);
147− err_free:
147+err_free:
148148 b1_free_card(card);
149− err:
149+err:
150150 return retval;
151151 }
152152
@@ -157,7 +157,7 @@ static void t1pci_remove(struct pci_dev *pdev) · 4 unmodified lines
157157 avmcard *card = pci_get_drvdata(pdev);
158158 avmctrl_info *cinfo = card->ctrlinfo;
159159
160− b1dma_reset(card);
160+ b1dma_reset(card);
161161
162162 detach_capi_ctr(&cinfo->capi_ctrl);
163163 free_irq(card->irq, card);
@@ -217,10 +217,10 @@ static int __devinit t1pci_probe(struct pci_dev *dev, · 53 unmodified lines
217217 }
218218
219219 static struct pci_driver t1pci_pci_driver = {
220− .name = "t1pci",
221− .id_table = t1pci_pci_tbl,
222− .probe = t1pci_probe,
223− .remove = t1pci_remove,
220+ .name = "t1pci",
221+ .id_table = t1pci_pci_tbl,
222+ .probe = t1pci_probe,
223+ .remove = t1pci_remove,
224224 };
225225
226226 static struct capi_driver capi_driver_t1pci = {
@@ -237,7 +237,7 @@ static int __init t1pci_init(void) · 10 unmodified lines
237237 if ((p = strchr(revision, ':')) != NULL && p[1]) {
238238 strlcpy(rev, p + 2, 32);
239239 if ((p = strchr(rev, '$')) != NULL && p > rev)
240− *(p-1) = 0;
240+ *(p - 1) = 0;
241241 } else
242242 strcpy(rev, "1.0");
243243
drivers/isdn/hardware/eicon/capi20.h+257−257
@@ -1,74 +1,74 @@
11
22 /*
33 *
4− Copyright (c) Eicon Networks, 2002.
4+ Copyright (c) Eicon Networks, 2002.
55 *
6− This source file is supplied for the use with
7− Eicon Networks range of DIVA Server Adapters.
6+ This source file is supplied for the use with
7+ Eicon Networks range of DIVA Server Adapters.
88 *
9− Eicon File Revision : 2.1
9+ Eicon File Revision : 2.1
1010 *
11− This program is free software; you can redistribute it and/or modify
12− it under the terms of the GNU General Public License as published by
13− the Free Software Foundation; either version 2, or (at your option)
14− any later version.
11+ This program is free software; you can redistribute it and/or modify
12+ it under the terms of the GNU General Public License as published by
13+ the Free Software Foundation; either version 2, or (at your option)
14+ any later version.
1515 *
16− This program is distributed in the hope that it will be useful,
17− but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18− implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19− See the GNU General Public License for more details.
16+ This program is distributed in the hope that it will be useful,
17+ but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19+ See the GNU General Public License for more details.
2020 *
21− You should have received a copy of the GNU General Public License
22− along with this program; if not, write to the Free Software
23− Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21+ You should have received a copy of the GNU General Public License
22+ along with this program; if not, write to the Free Software
23+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2424 *
2525 */
26−#ifndef _INC_CAPI20
26+#ifndef _INC_CAPI20
2727 #define _INC_CAPI20
28− /* operations on message queues */
29− /* the common device type for CAPI20 drivers */
28+/* operations on message queues */
29+/* the common device type for CAPI20 drivers */
3030 #define FILE_DEVICE_CAPI20 0x8001
31− /* DEVICE_CONTROL codes for user and kernel mode applications */
31+/* DEVICE_CONTROL codes for user and kernel mode applications */
3232 #define CAPI20_CTL_REGISTER 0x0801
3333 #define CAPI20_CTL_RELEASE 0x0802
3434 #define CAPI20_CTL_GET_MANUFACTURER 0x0805
3535 #define CAPI20_CTL_GET_VERSION 0x0806
3636 #define CAPI20_CTL_GET_SERIAL 0x0807
3737 #define CAPI20_CTL_GET_PROFILE 0x0808
38− /* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */
38+/* INTERNAL_DEVICE_CONTROL codes for kernel mode applicatios only */
3939 #define CAPI20_CTL_PUT_MESSAGE 0x0803
4040 #define CAPI20_CTL_GET_MESSAGE 0x0804
41− /* the wrapped codes as required by the system */
42−#define CAPI_CTL_CODE(f,m) CTL_CODE(FILE_DEVICE_CAPI20,f,m,FILE_ANY_ACCESS)
43−#define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER,METHOD_BUFFERED)
44−#define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE,METHOD_BUFFERED)
45−#define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER,METHOD_BUFFERED)
46−#define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION,METHOD_BUFFERED)
47−#define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL,METHOD_BUFFERED)
48−#define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE,METHOD_BUFFERED)
49−#define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE,METHOD_BUFFERED)
50−#define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE,METHOD_BUFFERED)
41+/* the wrapped codes as required by the system */
42+#define CAPI_CTL_CODE(f, m) CTL_CODE(FILE_DEVICE_CAPI20, f, m, FILE_ANY_ACCESS)
43+#define IOCTL_CAPI_REGISTER CAPI_CTL_CODE(CAPI20_CTL_REGISTER, METHOD_BUFFERED)
44+#define IOCTL_CAPI_RELEASE CAPI_CTL_CODE(CAPI20_CTL_RELEASE, METHOD_BUFFERED)
45+#define IOCTL_CAPI_GET_MANUFACTURER CAPI_CTL_CODE(CAPI20_CTL_GET_MANUFACTURER, METHOD_BUFFERED)
46+#define IOCTL_CAPI_GET_VERSION CAPI_CTL_CODE(CAPI20_CTL_GET_VERSION, METHOD_BUFFERED)
47+#define IOCTL_CAPI_GET_SERIAL CAPI_CTL_CODE(CAPI20_CTL_GET_SERIAL, METHOD_BUFFERED)
48+#define IOCTL_CAPI_GET_PROFILE CAPI_CTL_CODE(CAPI20_CTL_GET_PROFILE, METHOD_BUFFERED)
49+#define IOCTL_CAPI_PUT_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_PUT_MESSAGE, METHOD_BUFFERED)
50+#define IOCTL_CAPI_GET_MESSAGE CAPI_CTL_CODE(CAPI20_CTL_GET_MESSAGE, METHOD_BUFFERED)
5151 struct divas_capi_register_params {
52− word MessageBufferSize;
53− word maxLogicalConnection;
54− word maxBDataBlocks;
55− word maxBDataLen;
52+ word MessageBufferSize;
53+ word maxLogicalConnection;
54+ word maxBDataBlocks;
55+ word maxBDataLen;
5656 };
5757 struct divas_capi_version {
58− word CapiMajor;
59− word CapiMinor;
60− word ManuMajor;
61− word ManuMinor;
58+ word CapiMajor;
59+ word CapiMinor;
60+ word ManuMajor;
61+ word ManuMinor;
6262 };
6363 typedef struct api_profile_s {
64− word Number;
65− word Channels;
66− dword Global_Options;
67− dword B1_Protocols;
68− dword B2_Protocols;
69− dword B3_Protocols;
64+ word Number;
65+ word Channels;
66+ dword Global_Options;
67+ dword B1_Protocols;
68+ dword B2_Protocols;
69+ dword B3_Protocols;
7070 } API_PROFILE;
71− /* ISDN Common API message types */
71+/* ISDN Common API message types */
7272 #define _ALERT_R 0x8001
7373 #define _CONNECT_R 0x8002
7474 #define _CONNECT_I 0x8202
@@ -93,9 +93,9 @@ typedef struct api_profile_s { · 18 unmodified lines
9393 #define _CONNECT_B3_T90_ACTIVE_I 0x8288
9494 #define _MANUFACTURER_R 0x80ff
9595 #define _MANUFACTURER_I 0x82ff
96− /* OR this to convert a REQUEST to a CONFIRM */
96+/* OR this to convert a REQUEST to a CONFIRM */
9797 #define CONFIRM 0x0100
98− /* OR this to convert a INDICATION to a RESPONSE */
98+/* OR this to convert a INDICATION to a RESPONSE */
9999 #define RESPONSE 0x0100
100100 /*------------------------------------------------------------------*/
101101 /* diehl isdn private MANUFACTURER codes */
@@ -115,248 +115,248 @@ typedef struct api_profile_s { · 13 unmodified lines
115115 /*------------------------------------------------------------------*/
116116 /* parameter structures */
117117 /*------------------------------------------------------------------*/
118− /* ALERT-REQUEST */
118+/* ALERT-REQUEST */
119119 typedef struct {
120− byte structs[1]; /* Additional Info */
120+ byte structs[0]; /* Additional Info */
121121 } _ALT_REQP;
122− /* ALERT-CONFIRM */
122+/* ALERT-CONFIRM */
123123 typedef struct {
124− word Info;
124+ word Info;
125125 } _ALT_CONP;
126− /* CONNECT-REQUEST */
127−typedef struct {
128− word CIP_Value;
129− byte structs[1]; /* Called party number,
130− Called party subaddress,
131− Calling party number,
132− Calling party subaddress,
133− B_protocol,
134− BC,
135− LLC,
136− HLC,
137− Additional Info */
126+/* CONNECT-REQUEST */
127+typedef struct {
128+ word CIP_Value;
129+ byte structs[0]; /* Called party number,
130+ Called party subaddress,
131+ Calling party number,
132+ Calling party subaddress,
133+ B_protocol,
134+ BC,
135+ LLC,
136+ HLC,
137+ Additional Info */
138138 } _CON_REQP;
139− /* CONNECT-CONFIRM */
139+/* CONNECT-CONFIRM */
140140 typedef struct {
141− word Info;
141+ word Info;
142142 } _CON_CONP;
143− /* CONNECT-INDICATION */
144−typedef struct {
145− word CIP_Value;
146− byte structs[1]; /* Called party number,
147− Called party subaddress,
148− Calling party number,
149− Calling party subaddress,
150− BC,
151− LLC,
152− HLC,
153− Additional Info */
143+/* CONNECT-INDICATION */
144+typedef struct {
145+ word CIP_Value;
146+ byte structs[0]; /* Called party number,
147+ Called party subaddress,
148+ Calling party number,
149+ Calling party subaddress,
150+ BC,
151+ LLC,
152+ HLC,
153+ Additional Info */
154154 } _CON_INDP;
155− /* CONNECT-RESPONSE */
155+/* CONNECT-RESPONSE */
156156 typedef struct {
157− word Accept;
158− byte structs[1]; /* B_protocol,
159− Connected party number,
160− Connected party subaddress,
161− LLC */
157+ word Accept;
158+ byte structs[0]; /* B_protocol,
159+ Connected party number,
160+ Connected party subaddress,
161+ LLC */
162162 } _CON_RESP;
163− /* CONNECT-ACTIVE-INDICATION */
163+/* CONNECT-ACTIVE-INDICATION */
164164 typedef struct {
165− byte structs[1]; /* Connected party number,
166− Connected party subaddress,
167− LLC */
165+ byte structs[0]; /* Connected party number,
166+ Connected party subaddress,
167+ LLC */
168168 } _CON_A_INDP;
169− /* CONNECT-ACTIVE-RESPONSE */
169+/* CONNECT-ACTIVE-RESPONSE */
170170 typedef struct {
171− byte structs[1]; /* empty */
171+ byte structs[0]; /* empty */
172172 } _CON_A_RESP;
173− /* DISCONNECT-REQUEST */
173+/* DISCONNECT-REQUEST */
174174 typedef struct {
175− byte structs[1]; /* Additional Info */
175+ byte structs[0]; /* Additional Info */
176176 } _DIS_REQP;
177− /* DISCONNECT-CONFIRM */
177+/* DISCONNECT-CONFIRM */
178178 typedef struct {
179− word Info;
179+ word Info;
180180 } _DIS_CONP;
181− /* DISCONNECT-INDICATION */
181+/* DISCONNECT-INDICATION */
182182 typedef struct {
183− word Info;
183+ word Info;
184184 } _DIS_INDP;
185− /* DISCONNECT-RESPONSE */
185+/* DISCONNECT-RESPONSE */
186186 typedef struct {
187− byte structs[1]; /* empty */
187+ byte structs[0]; /* empty */
188188 } _DIS_RESP;
189− /* LISTEN-REQUEST */
189+/* LISTEN-REQUEST */
190190 typedef struct {
191− dword Info_Mask;
192− dword CIP_Mask;
193− byte structs[1]; /* Calling party number,
194− Calling party subaddress */
191+ dword Info_Mask;
192+ dword CIP_Mask;
193+ byte structs[0]; /* Calling party number,
194+ Calling party subaddress */
195195 } _LIS_REQP;
196− /* LISTEN-CONFIRM */
196+/* LISTEN-CONFIRM */
197197 typedef struct {
198− word Info;
198+ word Info;
199199 } _LIS_CONP;
200− /* INFO-REQUEST */
200+/* INFO-REQUEST */
201201 typedef struct {
202− byte structs[1]; /* Called party number,
203− Additional Info */
202+ byte structs[0]; /* Called party number,
203+ Additional Info */
204204 } _INF_REQP;
205− /* INFO-CONFIRM */
205+/* INFO-CONFIRM */
206206 typedef struct {
207− word Info;
207+ word Info;
208208 } _INF_CONP;
209− /* INFO-INDICATION */
209+/* INFO-INDICATION */
210210 typedef struct {
211− word Number;
212− byte structs[1]; /* Info element */
211+ word Number;
212+ byte structs[0]; /* Info element */
213213 } _INF_INDP;
214− /* INFO-RESPONSE */
214+/* INFO-RESPONSE */
215215 typedef struct {
216− byte structs[1]; /* empty */
216+ byte structs[0]; /* empty */
217217 } _INF_RESP;
218− /* SELECT-B-REQUEST */
218+/* SELECT-B-REQUEST */
219219 typedef struct {
220− byte structs[1]; /* B-protocol */
220+ byte structs[0]; /* B-protocol */
221221 } _SEL_B_REQP;
222− /* SELECT-B-CONFIRM */
222+/* SELECT-B-CONFIRM */
223223 typedef struct {
224− word Info;
224+ word Info;
225225 } _SEL_B_CONP;
226− /* FACILITY-REQUEST */
226+/* FACILITY-REQUEST */
227227 typedef struct {
228− word Selector;
229− byte structs[1]; /* Facility parameters */
228+ word Selector;
229+ byte structs[0]; /* Facility parameters */
230230 } _FAC_REQP;
231− /* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
231+/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
232232 typedef struct {
233− byte struct_length;
234− word function;
235− byte length;
236− word SupplementaryServiceInfo;
237− dword SupportedServices;
233+ byte struct_length;
234+ word function;
235+ byte length;
236+ word SupplementaryServiceInfo;
237+ dword SupportedServices;
238238 } _FAC_CON_STRUCTS;
239− /* FACILITY-CONFIRM */
239+/* FACILITY-CONFIRM */
240240 typedef struct {
241− word Info;
242− word Selector;
243− byte structs[1]; /* Facility parameters */
241+ word Info;
242+ word Selector;
243+ byte structs[0]; /* Facility parameters */
244244 } _FAC_CONP;
245− /* FACILITY-INDICATION */
245+/* FACILITY-INDICATION */
246246 typedef struct {
247− word Selector;
248− byte structs[1]; /* Facility parameters */
247+ word Selector;
248+ byte structs[0]; /* Facility parameters */
249249 } _FAC_INDP;
250− /* FACILITY-RESPONSE */
250+/* FACILITY-RESPONSE */
251251 typedef struct {
252− word Selector;
253− byte structs[1]; /* Facility parameters */
252+ word Selector;
253+ byte structs[0]; /* Facility parameters */
254254 } _FAC_RESP;
255− /* CONNECT-B3-REQUEST */
255+/* CONNECT-B3-REQUEST */
256256 typedef struct {
257− byte structs[1]; /* NCPI */
257+ byte structs[0]; /* NCPI */
258258 } _CON_B3_REQP;
259− /* CONNECT-B3-CONFIRM */
259+/* CONNECT-B3-CONFIRM */
260260 typedef struct {
261− word Info;
261+ word Info;
262262 } _CON_B3_CONP;
263− /* CONNECT-B3-INDICATION */
263+/* CONNECT-B3-INDICATION */
264264 typedef struct {
265− byte structs[1]; /* NCPI */
265+ byte structs[0]; /* NCPI */
266266 } _CON_B3_INDP;
267− /* CONNECT-B3-RESPONSE */
267+/* CONNECT-B3-RESPONSE */
268268 typedef struct {
269− word Accept;
270− byte structs[1]; /* NCPI */
269+ word Accept;
270+ byte structs[0]; /* NCPI */
271271 } _CON_B3_RESP;
272− /* CONNECT-B3-ACTIVE-INDICATION */
272+/* CONNECT-B3-ACTIVE-INDICATION */
273273 typedef struct {
274− byte structs[1]; /* NCPI */
274+ byte structs[0]; /* NCPI */
275275 } _CON_B3_A_INDP;
276− /* CONNECT-B3-ACTIVE-RESPONSE */
276+/* CONNECT-B3-ACTIVE-RESPONSE */
277277 typedef struct {
278− byte structs[1]; /* empty */
278+ byte structs[0]; /* empty */
279279 } _CON_B3_A_RESP;
280− /* DISCONNECT-B3-REQUEST */
280+/* DISCONNECT-B3-REQUEST */
281281 typedef struct {
282− byte structs[1]; /* NCPI */
282+ byte structs[0]; /* NCPI */
283283 } _DIS_B3_REQP;
284− /* DISCONNECT-B3-CONFIRM */
284+/* DISCONNECT-B3-CONFIRM */
285285 typedef struct {
286− word Info;
286+ word Info;
287287 } _DIS_B3_CONP;
288− /* DISCONNECT-B3-INDICATION */
288+/* DISCONNECT-B3-INDICATION */
289289 typedef struct {
290− word Info;
291− byte structs[1]; /* NCPI */
290+ word Info;
291+ byte structs[0]; /* NCPI */
292292 } _DIS_B3_INDP;
293− /* DISCONNECT-B3-RESPONSE */
293+/* DISCONNECT-B3-RESPONSE */
294294 typedef struct {
295− byte structs[1]; /* empty */
295+ byte structs[0]; /* empty */
296296 } _DIS_B3_RESP;
297− /* DATA-B3-REQUEST */
297+/* DATA-B3-REQUEST */
298298 typedef struct {
299− dword Data;
300− word Data_Length;
301− word Number;
302− word Flags;
299+ dword Data;
300+ word Data_Length;
301+ word Number;
302+ word Flags;
303303 } _DAT_B3_REQP;
304− /* DATA-B3-REQUEST 64 BIT Systems */
304+/* DATA-B3-REQUEST 64 BIT Systems */
305305 typedef struct {
306− dword Data;
307− word Data_Length;
308− word Number;
309− word Flags;
310− void *pData;
306+ dword Data;
307+ word Data_Length;
308+ word Number;
309+ word Flags;
310+ void *pData;
311311 } _DAT_B3_REQ64P;
312− /* DATA-B3-CONFIRM */
312+/* DATA-B3-CONFIRM */
313313 typedef struct {
314− word Number;
315− word Info;
314+ word Number;
315+ word Info;
316316 } _DAT_B3_CONP;
317− /* DATA-B3-INDICATION */
317+/* DATA-B3-INDICATION */
318318 typedef struct {
319− dword Data;
320− word Data_Length;
321− word Number;
322− word Flags;
319+ dword Data;
320+ word Data_Length;
321+ word Number;
322+ word Flags;
323323 } _DAT_B3_INDP;
324− /* DATA-B3-INDICATION 64 BIT Systems */
324+/* DATA-B3-INDICATION 64 BIT Systems */
325325 typedef struct {
326− dword Data;
327− word Data_Length;
328− word Number;
329− word Flags;
330− void *pData;
326+ dword Data;
327+ word Data_Length;
328+ word Number;
329+ word Flags;
330+ void *pData;
331331 } _DAT_B3_IND64P;
332− /* DATA-B3-RESPONSE */
332+/* DATA-B3-RESPONSE */
333333 typedef struct {
334− word Number;
334+ word Number;
335335 } _DAT_B3_RESP;
336− /* RESET-B3-REQUEST */
336+/* RESET-B3-REQUEST */
337337 typedef struct {
338− byte structs[1]; /* NCPI */
338+ byte structs[0]; /* NCPI */
339339 } _RES_B3_REQP;
340− /* RESET-B3-CONFIRM */
340+/* RESET-B3-CONFIRM */
341341 typedef struct {
342− word Info;
342+ word Info;
343343 } _RES_B3_CONP;
344− /* RESET-B3-INDICATION */
344+/* RESET-B3-INDICATION */
345345 typedef struct {
346− byte structs[1]; /* NCPI */
346+ byte structs[0]; /* NCPI */
347347 } _RES_B3_INDP;
348− /* RESET-B3-RESPONSE */
348+/* RESET-B3-RESPONSE */
349349 typedef struct {
350− byte structs[1]; /* empty */
350+ byte structs[0]; /* empty */
351351 } _RES_B3_RESP;
352− /* CONNECT-B3-T90-ACTIVE-INDICATION */
352+/* CONNECT-B3-T90-ACTIVE-INDICATION */
353353 typedef struct {
354− byte structs[1]; /* NCPI */
354+ byte structs[0]; /* NCPI */
355355 } _CON_B3_T90_A_INDP;
356− /* CONNECT-B3-T90-ACTIVE-RESPONSE */
356+/* CONNECT-B3-T90-ACTIVE-RESPONSE */
357357 typedef struct {
358− word Reject;
359− byte structs[1]; /* NCPI */
358+ word Reject;
359+ byte structs[0]; /* NCPI */
360360 } _CON_B3_T90_A_RESP;
361361 /*------------------------------------------------------------------*/
362362 /* message structure */
@@ -364,64 +364,64 @@ typedef struct { · 1 unmodified line
364364 typedef struct _API_MSG CAPI_MSG;
365365 typedef struct _MSG_HEADER CAPI_MSG_HEADER;
366366 struct _API_MSG {
367− struct _MSG_HEADER {
368− word length;
369− word appl_id;
370− word command;
371− word number;
372− byte controller;
373− byte plci;
374− word ncci;
375− } header;
376− union {
377− _ALT_REQP alert_req;
378− _ALT_CONP alert_con;
379− _CON_REQP connect_req;
380− _CON_CONP connect_con;
381− _CON_INDP connect_ind;
382− _CON_RESP connect_res;
383− _CON_A_INDP connect_a_ind;
384− _CON_A_RESP connect_a_res;
385− _DIS_REQP disconnect_req;
386− _DIS_CONP disconnect_con;
387− _DIS_INDP disconnect_ind;
388− _DIS_RESP disconnect_res;
389− _LIS_REQP listen_req;
390− _LIS_CONP listen_con;
391− _INF_REQP info_req;
392− _INF_CONP info_con;
393− _INF_INDP info_ind;
394− _INF_RESP info_res;
395− _SEL_B_REQP select_b_req;
396− _SEL_B_CONP select_b_con;
397− _FAC_REQP facility_req;
398− _FAC_CONP facility_con;
399− _FAC_INDP facility_ind;
400− _FAC_RESP facility_res;
401− _CON_B3_REQP connect_b3_req;
402− _CON_B3_CONP connect_b3_con;
403− _CON_B3_INDP connect_b3_ind;
404− _CON_B3_RESP connect_b3_res;
405− _CON_B3_A_INDP connect_b3_a_ind;
406− _CON_B3_A_RESP connect_b3_a_res;
407− _DIS_B3_REQP disconnect_b3_req;
408− _DIS_B3_CONP disconnect_b3_con;
409− _DIS_B3_INDP disconnect_b3_ind;
410− _DIS_B3_RESP disconnect_b3_res;
411− _DAT_B3_REQP data_b3_req;
412− _DAT_B3_REQ64P data_b3_req64;
413− _DAT_B3_CONP data_b3_con;
414− _DAT_B3_INDP data_b3_ind;
415− _DAT_B3_IND64P data_b3_ind64;
416− _DAT_B3_RESP data_b3_res;
417− _RES_B3_REQP reset_b3_req;
418− _RES_B3_CONP reset_b3_con;
419− _RES_B3_INDP reset_b3_ind;
420− _RES_B3_RESP reset_b3_res;
421− _CON_B3_T90_A_INDP connect_b3_t90_a_ind;
422− _CON_B3_T90_A_RESP connect_b3_t90_a_res;
423− byte b[200];
424− } info;
367+ struct _MSG_HEADER {
368+ word length;
369+ word appl_id;
370+ word command;
371+ word number;
372+ byte controller;
373+ byte plci;
374+ word ncci;
375+ } header;
376+ union {
377+ _ALT_REQP alert_req;
378+ _ALT_CONP alert_con;
379+ _CON_REQP connect_req;
380+ _CON_CONP connect_con;
381+ _CON_INDP connect_ind;
382+ _CON_RESP connect_res;
383+ _CON_A_INDP connect_a_ind;
384+ _CON_A_RESP connect_a_res;
385+ _DIS_REQP disconnect_req;
386+ _DIS_CONP disconnect_con;
387+ _DIS_INDP disconnect_ind;
388+ _DIS_RESP disconnect_res;
389+ _LIS_REQP listen_req;
390+ _LIS_CONP listen_con;
391+ _INF_REQP info_req;
392+ _INF_CONP info_con;
393+ _INF_INDP info_ind;
394+ _INF_RESP info_res;
395+ _SEL_B_REQP select_b_req;
396+ _SEL_B_CONP select_b_con;
397+ _FAC_REQP facility_req;
398+ _FAC_CONP facility_con;
399+ _FAC_INDP facility_ind;
400+ _FAC_RESP facility_res;
401+ _CON_B3_REQP connect_b3_req;
402+ _CON_B3_CONP connect_b3_con;
403+ _CON_B3_INDP connect_b3_ind;
404+ _CON_B3_RESP connect_b3_res;
405+ _CON_B3_A_INDP connect_b3_a_ind;
406+ _CON_B3_A_RESP connect_b3_a_res;
407+ _DIS_B3_REQP disconnect_b3_req;
408+ _DIS_B3_CONP disconnect_b3_con;
409+ _DIS_B3_INDP disconnect_b3_ind;
410+ _DIS_B3_RESP disconnect_b3_res;
411+ _DAT_B3_REQP data_b3_req;
412+ _DAT_B3_REQ64P data_b3_req64;
413+ _DAT_B3_CONP data_b3_con;
414+ _DAT_B3_INDP data_b3_ind;
415+ _DAT_B3_IND64P data_b3_ind64;
416+ _DAT_B3_RESP data_b3_res;
417+ _RES_B3_REQP reset_b3_req;
418+ _RES_B3_CONP reset_b3_con;
419+ _RES_B3_INDP reset_b3_ind;
420+ _RES_B3_RESP reset_b3_res;
421+ _CON_B3_T90_A_INDP connect_b3_t90_a_ind;
422+ _CON_B3_T90_A_RESP connect_b3_t90_a_res;
423+ byte b[200];
424+ } info;
425425 };
426426 /*------------------------------------------------------------------*/
427427 /* non-fatal errors */
@@ -696,4 +696,4 @@ struct _API_MSG { · 268 unmodified lines
696696 /* function prototypes */
697697 /*------------------------------------------------------------------*/
698698 /*------------------------------------------------------------------*/
699−#endif /* _INC_CAPI20 */
699+#endif /* _INC_CAPI20 */
drivers/isdn/hardware/eicon/capidtmf.c+547−547
@@ -1,34 +1,34 @@
11
22 /*
33 *
4− Copyright (c) Eicon Networks, 2002.
4+ Copyright (c) Eicon Networks, 2002.
55 *
6− This source file is supplied for the use with
7− Eicon Networks range of DIVA Server Adapters.
6+ This source file is supplied for the use with
7+ Eicon Networks range of DIVA Server Adapters.
88 *
9− Eicon File Revision : 2.1
9+ Eicon File Revision : 2.1
1010 *
11− This program is free software; you can redistribute it and/or modify
12− it under the terms of the GNU General Public License as published by
13− the Free Software Foundation; either version 2, or (at your option)
14− any later version.
11+ This program is free software; you can redistribute it and/or modify
12+ it under the terms of the GNU General Public License as published by
13+ the Free Software Foundation; either version 2, or (at your option)
14+ any later version.
1515 *
16− This program is distributed in the hope that it will be useful,
17− but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18− implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19− See the GNU General Public License for more details.
16+ This program is distributed in the hope that it will be useful,
17+ but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
18+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19+ See the GNU General Public License for more details.
2020 *
21− You should have received a copy of the GNU General Public License
22− along with this program; if not, write to the Free Software
23− Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21+ You should have received a copy of the GNU General Public License
22+ along with this program; if not, write to the Free Software
23+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2424 *
2525 */
2626
2727 #include "platform.h"
2828
2929
30−
31−
30+
31+
3232
3333
3434
@@ -51,74 +51,74 @@ · 16 unmodified lines
5151
5252 static short capidtmf_expand_table_alaw[0x0100] =
5353 {
54− -5504, 5504, -344, 344, -22016, 22016, -1376, 1376,
55− -2752, 2752, -88, 88, -11008, 11008, -688, 688,
56− -7552, 7552, -472, 472, -30208, 30208, -1888, 1888,
57− -3776, 3776, -216, 216, -15104, 15104, -944, 944,
58− -4480, 4480, -280, 280, -17920, 17920, -1120, 1120,
59− -2240, 2240, -24, 24, -8960, 8960, -560, 560,
60− -6528, 6528, -408, 408, -26112, 26112, -1632, 1632,
61− -3264, 3264, -152, 152, -13056, 13056, -816, 816,
62− -6016, 6016, -376, 376, -24064, 24064, -1504, 1504,
63− -3008, 3008, -120, 120, -12032, 12032, -752, 752,
64− -8064, 8064, -504, 504, -32256, 32256, -2016, 2016,
65− -4032, 4032, -248, 248, -16128, 16128, -1008, 1008,
66− -4992, 4992, -312, 312, -19968, 19968, -1248, 1248,
67− -2496, 2496, -56, 56, -9984, 9984, -624, 624,
68− -7040, 7040, -440, 440, -28160, 28160, -1760, 1760,
69− -3520, 3520, -184, 184, -14080, 14080, -880, 880,
70− -5248, 5248, -328, 328, -20992, 20992, -1312, 1312,
71− -2624, 2624, -72, 72, -10496, 10496, -656, 656,
72− -7296, 7296, -456, 456, -29184, 29184, -1824, 1824,
73− -3648, 3648, -200, 200, -14592, 14592, -912, 912,
74− -4224, 4224, -264, 264, -16896, 16896, -1056, 1056,
75− -2112, 2112, -8, 8, -8448, 8448, -528, 528,
76− -6272, 6272, -392, 392, -25088, 25088, -1568, 1568,
77− -3136, 3136, -136, 136, -12544, 12544, -784, 784,
78− -5760, 5760, -360, 360, -23040, 23040, -1440, 1440,
79− -2880, 2880, -104, 104, -11520, 11520, -720, 720,
80− -7808, 7808, -488, 488, -31232, 31232, -1952, 1952,
81− -3904, 3904, -232, 232, -15616, 15616, -976, 976,
82− -4736, 4736, -296, 296, -18944, 18944, -1184, 1184,
83− -2368, 2368, -40, 40, -9472, 9472, -592, 592,
84− -6784, 6784, -424, 424, -27136, 27136, -1696, 1696,
85− -3392, 3392, -168, 168, -13568, 13568, -848, 848
54+ -5504, 5504, -344, 344, -22016, 22016, -1376, 1376,
55+ -2752, 2752, -88, 88, -11008, 11008, -688, 688,
56+ -7552, 7552, -472, 472, -30208, 30208, -1888, 1888,
57+ -3776, 3776, -216, 216, -15104, 15104, -944, 944,
58+ -4480, 4480, -280, 280, -17920, 17920, -1120, 1120,
59+ -2240, 2240, -24, 24, -8960, 8960, -560, 560,
60+ -6528, 6528, -408, 408, -26112, 26112, -1632, 1632,
61+ -3264, 3264, -152, 152, -13056, 13056, -816, 816,
62+ -6016, 6016, -376, 376, -24064, 24064, -1504, 1504,
63+ -3008, 3008, -120, 120, -12032, 12032, -752, 752,
64+ -8064, 8064, -504, 504, -32256, 32256, -2016, 2016,
65+ -4032, 4032, -248, 248, -16128, 16128, -1008, 1008,
66+ -4992, 4992, -312, 312, -19968, 19968, -1248, 1248,
67+ -2496, 2496, -56, 56, -9984, 9984, -624, 624,
68+ -7040, 7040, -440, 440, -28160, 28160, -1760, 1760,
69+ -3520, 3520, -184, 184, -14080, 14080, -880, 880,
70+ -5248, 5248, -328, 328, -20992, 20992, -1312, 1312,
71+ -2624, 2624, -72, 72, -10496, 10496, -656, 656,
72+ -7296, 7296, -456, 456, -29184, 29184, -1824, 1824,
73+ -3648, 3648, -200, 200, -14592, 14592, -912, 912,
74+ -4224, 4224, -264, 264, -16896, 16896, -1056, 1056,
75+ -2112, 2112, -8, 8, -8448, 8448, -528, 528,
76+ -6272, 6272, -392, 392, -25088, 25088, -1568, 1568,
77+ -3136, 3136, -136, 136, -12544, 12544, -784, 784,
78+ -5760, 5760, -360, 360, -23040, 23040, -1440, 1440,
79+ -2880, 2880, -104, 104, -11520, 11520, -720, 720,
80+ -7808, 7808, -488, 488, -31232, 31232, -1952, 1952,
81+ -3904, 3904, -232, 232, -15616, 15616, -976, 976,
82+ -4736, 4736, -296, 296, -18944, 18944, -1184, 1184,
83+ -2368, 2368, -40, 40, -9472, 9472, -592, 592,
84+ -6784, 6784, -424, 424, -27136, 27136, -1696, 1696,
85+ -3392, 3392, -168, 168, -13568, 13568, -848, 848
8686 };
8787
8888 static short capidtmf_expand_table_ulaw[0x0100] =
8989 {
90− -32124, 32124, -1884, 1884, -7932, 7932, -372, 372,
91− -15996, 15996, -876, 876, -3900, 3900, -120, 120,
92− -23932, 23932, -1372, 1372, -5884, 5884, -244, 244,
93− -11900, 11900, -620, 620, -2876, 2876, -56, 56,
94− -28028, 28028, -1628, 1628, -6908, 6908, -308, 308,
95− -13948, 13948, -748, 748, -3388, 3388, -88, 88,
96− -19836, 19836, -1116, 1116, -4860, 4860, -180, 180,
97− -9852, 9852, -492, 492, -2364, 2364, -24, 24,
98− -30076, 30076, -1756, 1756, -7420, 7420, -340, 340,
99− -14972, 14972, -812, 812, -3644, 3644, -104, 104,
100− -21884, 21884, -1244, 1244, -5372, 5372, -212, 212,
101− -10876, 10876, -556, 556, -2620, 2620, -40, 40,
102− -25980, 25980, -1500, 1500, -6396, 6396, -276, 276,
103− -12924, 12924, -684, 684, -3132, 3132, -72, 72,
104− -17788, 17788, -988, 988, -4348, 4348, -148, 148,
105− -8828, 8828, -428, 428, -2108, 2108, -8, 8,
106− -31100, 31100, -1820, 1820, -7676, 7676, -356, 356,
107− -15484, 15484, -844, 844, -3772, 3772, -112, 112,
108− -22908, 22908, -1308, 1308, -5628, 5628, -228, 228,
109− -11388, 11388, -588, 588, -2748, 2748, -48, 48,
110− -27004, 27004, -1564, 1564, -6652, 6652, -292, 292,
111− -13436, 13436, -716, 716, -3260, 3260, -80, 80,
112− -18812, 18812, -1052, 1052, -4604, 4604, -164, 164,
113− -9340, 9340, -460, 460, -2236, 2236, -16, 16,
114− -29052, 29052, -1692, 1692, -7164, 7164, -324, 324,
115− -14460, 14460, -780, 780, -3516, 3516, -96, 96,
116− -20860, 20860, -1180, 1180, -5116, 5116, -196, 196,
117− -10364, 10364, -524, 524, -2492, 2492, -32, 32,
118− -24956, 24956, -1436, 1436, -6140, 6140, -260, 260,
119− -12412, 12412, -652, 652, -3004, 3004, -64, 64,
120− -16764, 16764, -924, 924, -4092, 4092, -132, 132,
121− -8316, 8316, -396, 396, -1980, 1980, 0, 0
90+ -32124, 32124, -1884, 1884, -7932, 7932, -372, 372,
91+ -15996, 15996, -876, 876, -3900, 3900, -120, 120,
92+ -23932, 23932, -1372, 1372, -5884, 5884, -244, 244,
93+ -11900, 11900, -620, 620, -2876, 2876, -56, 56,
94+ -28028, 28028, -1628, 1628, -6908, 6908, -308, 308,
95+ -13948, 13948, -748, 748, -3388, 3388, -88, 88,
96+ -19836, 19836, -1116, 1116, -4860, 4860, -180, 180,
97+ -9852, 9852, -492, 492, -2364, 2364, -24, 24,
98+ -30076, 30076, -1756, 1756, -7420, 7420, -340, 340,
99+ -14972, 14972, -812, 812, -3644, 3644, -104, 104,
100+ -21884, 21884, -1244, 1244, -5372, 5372, -212, 212,
101+ -10876, 10876, -556, 556, -2620, 2620, -40, 40,
102+ -25980, 25980, -1500, 1500, -6396, 6396, -276, 276,
103+ -12924, 12924, -684, 684, -3132, 3132, -72, 72,
104+ -17788, 17788, -988, 988, -4348, 4348, -148, 148,
105+ -8828, 8828, -428, 428, -2108, 2108, -8, 8,
106+ -31100, 31100, -1820, 1820, -7676, 7676, -356, 356,
107+ -15484, 15484, -844, 844, -3772, 3772, -112, 112,
108+ -22908, 22908, -1308, 1308, -5628, 5628, -228, 228,
109+ -11388, 11388, -588, 588, -2748, 2748, -48, 48,
110+ -27004, 27004, -1564, 1564, -6652, 6652, -292, 292,
111+ -13436, 13436, -716, 716, -3260, 3260, -80, 80,
112+ -18812, 18812, -1052, 1052, -4604, 4604, -164, 164,
113+ -9340, 9340, -460, 460, -2236, 2236, -16, 16,
114+ -29052, 29052, -1692, 1692, -7164, 7164, -324, 324,
115+ -14460, 14460, -780, 780, -3516, 3516, -96, 96,
116+ -20860, 20860, -1180, 1180, -5116, 5116, -196, 196,
117+ -10364, 10364, -524, 524, -2492, 2492, -32, 32,
118+ -24956, 24956, -1436, 1436, -6140, 6140, -260, 260,
119+ -12412, 12412, -652, 652, -3004, 3004, -64, 64,
120+ -16764, 16764, -924, 924, -4092, 4092, -132, 132,
121+ -8316, 8316, -396, 396, -1980, 1980, 0, 0
122122 };
123123
124124
@@ -126,52 +126,52 @@ static short capidtmf_expand_table_ulaw[0x0100] = · 1 unmodified line
126126
127127 static short capidtmf_recv_window_function[CAPIDTMF_RECV_ACCUMULATE_CYCLES] =
128128 {
129− -500L, -999L, -1499L, -1998L, -2496L, -2994L, -3491L, -3988L,
130− -4483L, -4978L, -5471L, -5963L, -6454L, -6943L, -7431L, -7917L,
131− -8401L, -8883L, -9363L, -9840L, -10316L, -10789L, -11259L, -11727L,
132− -12193L, -12655L, -13115L, -13571L, -14024L, -14474L, -14921L, -15364L,
133− -15804L, -16240L, -16672L, -17100L, -17524L, -17944L, -18360L, -18772L,
134− -19180L, -19583L, -19981L, -20375L, -20764L, -21148L, -21527L, -21901L,
135− -22270L, -22634L, -22993L, -23346L, -23694L, -24037L, -24374L, -24705L,
136− -25030L, -25350L, -25664L, -25971L, -26273L, -26568L, -26858L, -27141L,
137− -27418L, -27688L, -27952L, -28210L, -28461L, -28705L, -28943L, -29174L,
138− -29398L, -29615L, -29826L, -30029L, -30226L, -30415L, -30598L, -30773L,
139− -30941L, -31102L, -31256L, -31402L, -31541L, -31673L, -31797L, -31914L,
140− -32024L, -32126L, -32221L, -32308L, -32388L, -32460L, -32524L, -32581L,
141− -32631L, -32673L, -32707L, -32734L, -32753L, -32764L, -32768L, -32764L,
142− -32753L, -32734L, -32707L, -32673L, -32631L, -32581L, -32524L, -32460L,
143− -32388L, -32308L, -32221L, -32126L, -32024L, -31914L, -31797L, -31673L,
144− -31541L, -31402L, -31256L, -31102L, -30941L, -30773L, -30598L, -30415L,
145− -30226L, -30029L, -29826L, -29615L, -29398L, -29174L, -28943L, -28705L,
146− -28461L, -28210L, -27952L, -27688L, -27418L, -27141L, -26858L, -26568L,
147− -26273L, -25971L, -25664L, -25350L, -25030L, -24705L, -24374L, -24037L,
148− -23694L, -23346L, -22993L, -22634L, -22270L, -21901L, -21527L, -21148L,
149− -20764L, -20375L, -19981L, -19583L, -19180L, -18772L, -18360L, -17944L,
150− -17524L, -17100L, -16672L, -16240L, -15804L, -15364L, -14921L, -14474L,
151− -14024L, -13571L, -13115L, -12655L, -12193L, -11727L, -11259L, -10789L,
152− -10316L, -9840L, -9363L, -8883L, -8401L, -7917L, -7431L, -6943L,
153− -6454L, -5963L, -5471L, -4978L, -4483L, -3988L, -3491L, -2994L,
154− -2496L, -1998L, -1499L, -999L, -500L,
129+ -500L, -999L, -1499L, -1998L, -2496L, -2994L, -3491L, -3988L,
130+ -4483L, -4978L, -5471L, -5963L, -6454L, -6943L, -7431L, -7917L,
131+ -8401L, -8883L, -9363L, -9840L, -10316L, -10789L, -11259L, -11727L,
132+ -12193L, -12655L, -13115L, -13571L, -14024L, -14474L, -14921L, -15364L,
133+ -15804L, -16240L, -16672L, -17100L, -17524L, -17944L, -18360L, -18772L,
134+ -19180L, -19583L, -19981L, -20375L, -20764L, -21148L, -21527L, -21901L,
135+ -22270L, -22634L, -22993L, -23346L, -23694L, -24037L, -24374L, -24705L,
136+ -25030L, -25350L, -25664L, -25971L, -26273L, -26568L, -26858L, -27141L,
137+ -27418L, -27688L, -27952L, -28210L, -28461L, -28705L, -28943L, -29174L,
138+ -29398L, -29615L, -29826L, -30029L, -30226L, -30415L, -30598L, -30773L,
139+ -30941L, -31102L, -31256L, -31402L, -31541L, -31673L, -31797L, -31914L,
140+ -32024L, -32126L, -32221L, -32308L, -32388L, -32460L, -32524L, -32581L,
141+ -32631L, -32673L, -32707L, -32734L, -32753L, -32764L, -32768L, -32764L,
142+ -32753L, -32734L, -32707L, -32673L, -32631L, -32581L, -32524L, -32460L,
143+ -32388L, -32308L, -32221L, -32126L, -32024L, -31914L, -31797L, -31673L,
144+ -31541L, -31402L, -31256L, -31102L, -30941L, -30773L, -30598L, -30415L,
145+ -30226L, -30029L, -29826L, -29615L, -29398L, -29174L, -28943L, -28705L,
146+ -28461L, -28210L, -27952L, -27688L, -27418L, -27141L, -26858L, -26568L,
147+ -26273L, -25971L, -25664L, -25350L, -25030L, -24705L, -24374L, -24037L,
148+ -23694L, -23346L, -22993L, -22634L, -22270L, -21901L, -21527L, -21148L,
149+ -20764L, -20375L, -19981L, -19583L, -19180L, -18772L, -18360L, -17944L,
150+ -17524L, -17100L, -16672L, -16240L, -15804L, -15364L, -14921L, -14474L,
151+ -14024L, -13571L, -13115L, -12655L, -12193L, -11727L, -11259L, -10789L,
152+ -10316L, -9840L, -9363L, -8883L, -8401L, -7917L, -7431L, -6943L,
153+ -6454L, -5963L, -5471L, -4978L, -4483L, -3988L, -3491L, -2994L,
154+ -2496L, -1998L, -1499L, -999L, -500L,
155155 };
156156
157157 static byte capidtmf_leading_zeroes_table[0x100] =
158158 {
159− 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
160− 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
161− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
162− 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
163− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
164− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
165− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
166− 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
167− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
168− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
170− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
171− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
172− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
173− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
174− 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
159+ 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
160+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
161+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
162+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
163+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
164+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
165+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
166+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
167+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
168+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
170+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
171+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
172+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
173+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
174+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
175175 };
176176
177177 #define capidtmf_byte_leading_zeroes(b) (capidtmf_leading_zeroes_table[(BYTE)(b)])
@@ -182,140 +182,140 @@ static byte capidtmf_leading_zeroes_table[0x100] = · 4 unmodified lines
182182 /*---------------------------------------------------------------------------*/
183183
184184
185−static void capidtmf_goertzel_loop (long *buffer, long *coeffs, short *sample, long count)
185+static void capidtmf_goertzel_loop(long *buffer, long *coeffs, short *sample, long count)
186186 {
187− int i, j;
188− long c, d, q0, q1, q2;
189−
190− for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1; i++)
191− {
192− q1 = buffer[i];
193− q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
194− d = coeffs[i] >> 1;
195− c = d << 1;
196− if (c >= 0)
197− {
198− for (j = 0; j < count; j++)
199− {
200− q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15);
201− q2 = q1;
202− q1 = q0;
203− }
204− }
205− else
206− {
207− c = -c;
208− d = -d;
209− for (j = 0; j < count; j++)
210− {
211− q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15));
212− q2 = q1;
213− q1 = q0;
214− }
215− }
216− buffer[i] = q1;
217− buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2;
218− }
219− q1 = buffer[i];
220− q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
221− c = (coeffs[i] >> 1) << 1;
222− if (c >= 0)
223− {
224− for (j = 0; j < count; j++)
225− {
226− q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15);
227− q2 = q1;
228− q1 = q0;
229− c -= CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT;
230− }
231− }
232− else
233− {
234− c = -c;
235− for (j = 0; j < count; j++)
236− {
237− q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15));
238− q2 = q1;
239− q1 = q0;
240− c += CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT;
241− }
242− }
243− coeffs[i] = c;
244− buffer[i] = q1;
245− buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2;
187+ int i, j;
188+ long c, d, q0, q1, q2;
189+
190+ for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1; i++)
191+ {
192+ q1 = buffer[i];
193+ q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
194+ d = coeffs[i] >> 1;
195+ c = d << 1;
196+ if (c >= 0)
197+ {
198+ for (j = 0; j < count; j++)
199+ {
200+ q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15);
201+ q2 = q1;
202+ q1 = q0;
203+ }
204+ }
205+ else
206+ {
207+ c = -c;
208+ d = -d;
209+ for (j = 0; j < count; j++)
210+ {
211+ q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword) d) * ((dword)(q1 & 0xffff)))) >> 15));
212+ q2 = q1;
213+ q1 = q0;
214+ }
215+ }
216+ buffer[i] = q1;
217+ buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2;
218+ }
219+ q1 = buffer[i];
220+ q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
221+ c = (coeffs[i] >> 1) << 1;
222+ if (c >= 0)
223+ {
224+ for (j = 0; j < count; j++)
225+ {
226+ q0 = sample[j] - q2 + (c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15);
227+ q2 = q1;
228+ q1 = q0;
229+ c -= CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT;
230+ }
231+ }
232+ else
233+ {
234+ c = -c;
235+ for (j = 0; j < count; j++)
236+ {
237+ q0 = sample[j] - q2 - ((c * (q1 >> 16)) + (((dword)(((dword)(c >> 1)) * ((dword)(q1 & 0xffff)))) >> 15));
238+ q2 = q1;
239+ q1 = q0;
240+ c += CAPIDTMF_RECV_FUNDAMENTAL_DECREMENT;
241+ }
242+ }
243+ coeffs[i] = c;
244+ buffer[i] = q1;
245+ buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = q2;
246246 }
247247
248248
249−static void capidtmf_goertzel_result (long *buffer, long *coeffs)
249+static void capidtmf_goertzel_result(long *buffer, long *coeffs)
250250 {
251− int i;
252− long d, e, q1, q2, lo, mid, hi;
253− dword k;
254−
255− for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
256− {
257− q1 = buffer[i];
258− q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
259− d = coeffs[i] >> 1;
260− if (d >= 0)
261− d = ((d << 1) * (-q1 >> 16)) + (((dword)(((dword) d) * ((dword)(-q1 & 0xffff)))) >> 15);
262− else
263− d = ((-d << 1) * (-q1 >> 16)) + (((dword)(((dword) -d) * ((dword)(-q1 & 0xffff)))) >> 15);
264− e = (q2 >= 0) ? q2 : -q2;
265− if (d >= 0)
266− {
267− k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff));
268− lo = k & 0xffff;
269− mid = k >> 16;
270− k = ((dword)(d >> 16)) * ((dword)(e & 0xffff));
271− mid += k & 0xffff;
272− hi = k >> 16;
273− k = ((dword)(d & 0xffff)) * ((dword)(e >> 16));
274− mid += k & 0xffff;
275− hi += k >> 16;
276− hi += ((dword)(d >> 16)) * ((dword)(e >> 16));
277− }
278− else
279− {
280− d = -d;
281− k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff));
282− lo = -((long)(k & 0xffff));
283− mid = -((long)(k >> 16));
284− k = ((dword)(d >> 16)) * ((dword)(e & 0xffff));
285− mid -= k & 0xffff;
286− hi = -((long)(k >> 16));
287− k = ((dword)(d & 0xffff)) * ((dword)(e >> 16));
288− mid -= k & 0xffff;
289− hi -= k >> 16;
290− hi -= ((dword)(d >> 16)) * ((dword)(e >> 16));
291− }
292− if (q2 < 0)
293− {
294− lo = -lo;
295− mid = -mid;
296− hi = -hi;
297− }
298− d = (q1 >= 0) ? q1 : -q1;
299− k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff));
300− lo += k & 0xffff;
301− mid += k >> 16;
302− k = ((dword)(d >> 16)) * ((dword)(d & 0xffff));
303− mid += (k & 0xffff) << 1;
304− hi += (k >> 16) << 1;
305− hi += ((dword)(d >> 16)) * ((dword)(d >> 16));
306− d = (q2 >= 0) ? q2 : -q2;
307− k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff));
308− lo += k & 0xffff;
309− mid += k >> 16;
310− k = ((dword)(d >> 16)) * ((dword)(d & 0xffff));
311− mid += (k & 0xffff) << 1;
312− hi += (k >> 16) << 1;
313− hi += ((dword)(d >> 16)) * ((dword)(d >> 16));
314− mid += lo >> 16;
315− hi += mid >> 16;
316− buffer[i] = (lo & 0xffff) | (mid << 16);
317− buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = hi;
318− }
251+ int i;
252+ long d, e, q1, q2, lo, mid, hi;
253+ dword k;
254+
255+ for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
256+ {
257+ q1 = buffer[i];
258+ q2 = buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
259+ d = coeffs[i] >> 1;
260+ if (d >= 0)
261+ d = ((d << 1) * (-q1 >> 16)) + (((dword)(((dword) d) * ((dword)(-q1 & 0xffff)))) >> 15);
262+ else
263+ d = ((-d << 1) * (-q1 >> 16)) + (((dword)(((dword) -d) * ((dword)(-q1 & 0xffff)))) >> 15);
264+ e = (q2 >= 0) ? q2 : -q2;
265+ if (d >= 0)
266+ {
267+ k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff));
268+ lo = k & 0xffff;
269+ mid = k >> 16;
270+ k = ((dword)(d >> 16)) * ((dword)(e & 0xffff));
271+ mid += k & 0xffff;
272+ hi = k >> 16;
273+ k = ((dword)(d & 0xffff)) * ((dword)(e >> 16));
274+ mid += k & 0xffff;
275+ hi += k >> 16;
276+ hi += ((dword)(d >> 16)) * ((dword)(e >> 16));
277+ }
278+ else
279+ {
280+ d = -d;
281+ k = ((dword)(d & 0xffff)) * ((dword)(e & 0xffff));
282+ lo = -((long)(k & 0xffff));
283+ mid = -((long)(k >> 16));
284+ k = ((dword)(d >> 16)) * ((dword)(e & 0xffff));
285+ mid -= k & 0xffff;
286+ hi = -((long)(k >> 16));
287+ k = ((dword)(d & 0xffff)) * ((dword)(e >> 16));
288+ mid -= k & 0xffff;
289+ hi -= k >> 16;
290+ hi -= ((dword)(d >> 16)) * ((dword)(e >> 16));
291+ }
292+ if (q2 < 0)
293+ {
294+ lo = -lo;
295+ mid = -mid;
296+ hi = -hi;
297+ }
298+ d = (q1 >= 0) ? q1 : -q1;
299+ k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff));
300+ lo += k & 0xffff;
301+ mid += k >> 16;
302+ k = ((dword)(d >> 16)) * ((dword)(d & 0xffff));
303+ mid += (k & 0xffff) << 1;
304+ hi += (k >> 16) << 1;
305+ hi += ((dword)(d >> 16)) * ((dword)(d >> 16));
306+ d = (q2 >= 0) ? q2 : -q2;
307+ k = ((dword)(d & 0xffff)) * ((dword)(d & 0xffff));
308+ lo += k & 0xffff;
309+ mid += k >> 16;
310+ k = ((dword)(d >> 16)) * ((dword)(d & 0xffff));
311+ mid += (k & 0xffff) << 1;
312+ hi += (k >> 16) << 1;
313+ hi += ((dword)(d >> 16)) * ((dword)(d >> 16));
314+ mid += lo >> 16;
315+ hi += mid >> 16;
316+ buffer[i] = (lo & 0xffff) | (mid << 16);
317+ buffer[i + CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] = hi;
318+ }
319319 }
320320
321321
@@ -346,339 +346,339 @@ static void capidtmf_goertzel_result (long *buffer, long *coeffs) · 24 unmodified lines
346346
347347 static long capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] =
348348 {
349− 0xda97L * 2, /* 697 Hz (Low group 697 Hz) */
350− 0xd299L * 2, /* 770 Hz (Low group 770 Hz) */
351− 0xc8cbL * 2, /* 852 Hz (Low group 852 Hz) */
352− 0xbd36L * 2, /* 941 Hz (Low group 941 Hz) */
353− 0x9501L * 2, /* 1209 Hz (High group 1209 Hz) */
354− 0x7f89L * 2, /* 1336 Hz (High group 1336 Hz) */
355− 0x6639L * 2, /* 1477 Hz (High group 1477 Hz) */
356− 0x48c6L * 2, /* 1633 Hz (High group 1633 Hz) */
357− 0xe14cL * 2, /* 630 Hz (Lower guard of low group 631 Hz) */
358− 0xb2e0L * 2, /* 1015 Hz (Upper guard of low group 1039 Hz) */
359− 0xa1a0L * 2, /* 1130 Hz (Lower guard of high group 1140 Hz) */
360− 0x8a87L * 2, /* 1272 Hz (Guard between 1209 Hz and 1336 Hz: 1271 Hz) */
361− 0x7353L * 2, /* 1405 Hz (2nd harmonics of 697 Hz and guard between 1336 Hz and 1477 Hz: 1405 Hz) */
362− 0x583bL * 2, /* 1552 Hz (2nd harmonics of 770 Hz and guard between 1477 Hz and 1633 Hz: 1553 Hz) */
363− 0x37d8L * 2, /* 1720 Hz (2nd harmonics of 852 Hz and upper guard of high group: 1715 Hz) */
364− 0x0000L * 2 /* 100-630 Hz (fundamentals) */
349+ 0xda97L * 2, /* 697 Hz (Low group 697 Hz) */
350+ 0xd299L * 2, /* 770 Hz (Low group 770 Hz) */
351+ 0xc8cbL * 2, /* 852 Hz (Low group 852 Hz) */
352+ 0xbd36L * 2, /* 941 Hz (Low group 941 Hz) */
353+ 0x9501L * 2, /* 1209 Hz (High group 1209 Hz) */
354+ 0x7f89L * 2, /* 1336 Hz (High group 1336 Hz) */
355+ 0x6639L * 2, /* 1477 Hz (High group 1477 Hz) */
356+ 0x48c6L * 2, /* 1633 Hz (High group 1633 Hz) */
357+ 0xe14cL * 2, /* 630 Hz (Lower guard of low group 631 Hz) */
358+ 0xb2e0L * 2, /* 1015 Hz (Upper guard of low group 1039 Hz) */
359+ 0xa1a0L * 2, /* 1130 Hz (Lower guard of high group 1140 Hz) */
360+ 0x8a87L * 2, /* 1272 Hz (Guard between 1209 Hz and 1336 Hz: 1271 Hz) */
361+ 0x7353L * 2, /* 1405 Hz (2nd harmonics of 697 Hz and guard between 1336 Hz and 1477 Hz: 1405 Hz) */
362+ 0x583bL * 2, /* 1552 Hz (2nd harmonics of 770 Hz and guard between 1477 Hz and 1633 Hz: 1553 Hz) */
363+ 0x37d8L * 2, /* 1720 Hz (2nd harmonics of 852 Hz and upper guard of high group: 1715 Hz) */
364+ 0x0000L * 2 /* 100-630 Hz (fundamentals) */
365365 };
366366
367367
368368 static word capidtmf_recv_guard_snr_low_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] =
369369 {
370− 14, /* Low group peak versus 697 Hz */
371− 14, /* Low group peak versus 770 Hz */
372− 16, /* Low group peak versus 852 Hz */
373− 16, /* Low group peak versus 941 Hz */
374− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1209 Hz */
375− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1336 Hz */
376− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1477 Hz */
377− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1633 Hz */
378− 14, /* Low group peak versus 635 Hz */
379− 16, /* Low group peak versus 1010 Hz */
380− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1140 Hz */
381− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1272 Hz */
382− DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 8, /* Low group peak versus 1405 Hz */
383− DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 4, /* Low group peak versus 1555 Hz */
384− DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 4, /* Low group peak versus 1715 Hz */
385− 12 /* Low group peak versus 100-630 Hz */
370+ 14, /* Low group peak versus 697 Hz */
371+ 14, /* Low group peak versus 770 Hz */
372+ 16, /* Low group peak versus 852 Hz */
373+ 16, /* Low group peak versus 941 Hz */
374+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1209 Hz */
375+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1336 Hz */
376+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1477 Hz */
377+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1633 Hz */
378+ 14, /* Low group peak versus 635 Hz */
379+ 16, /* Low group peak versus 1010 Hz */
380+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1140 Hz */
381+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* Low group peak versus 1272 Hz */
382+ DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 8, /* Low group peak versus 1405 Hz */
383+ DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 4, /* Low group peak versus 1555 Hz */
384+ DSPDTMF_RX_HARMONICS_SEL_DEFAULT - 4, /* Low group peak versus 1715 Hz */
385+ 12 /* Low group peak versus 100-630 Hz */
386386 };
387387
388388
389389 static word capidtmf_recv_guard_snr_high_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT] =
390390 {
391− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 697 Hz */
392− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 770 Hz */
393− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 852 Hz */
394− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 941 Hz */
395− 20, /* High group peak versus 1209 Hz */
396− 20, /* High group peak versus 1336 Hz */
397− 20, /* High group peak versus 1477 Hz */
398− 20, /* High group peak versus 1633 Hz */
399− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 635 Hz */
400− CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 1010 Hz */
401− 16, /* High group peak versus 1140 Hz */
402− 4, /* High group peak versus 1272 Hz */
403− 6, /* High group peak versus 1405 Hz */
404− 8, /* High group peak versus 1555 Hz */
405− 16, /* High group peak versus 1715 Hz */
406− 12 /* High group peak versus 100-630 Hz */
391+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 697 Hz */
392+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 770 Hz */
393+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 852 Hz */
394+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 941 Hz */
395+ 20, /* High group peak versus 1209 Hz */
396+ 20, /* High group peak versus 1336 Hz */
397+ 20, /* High group peak versus 1477 Hz */
398+ 20, /* High group peak versus 1633 Hz */
399+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 635 Hz */
400+ CAPIDTMF_RECV_GUARD_SNR_DONTCARE, /* High group peak versus 1010 Hz */
401+ 16, /* High group peak versus 1140 Hz */
402+ 4, /* High group peak versus 1272 Hz */
403+ 6, /* High group peak versus 1405 Hz */
404+ 8, /* High group peak versus 1555 Hz */
405+ 16, /* High group peak versus 1715 Hz */
406+ 12 /* High group peak versus 100-630 Hz */
407407 };
408408
409409
410410 /*---------------------------------------------------------------------------*/
411411
412−static void capidtmf_recv_init (t_capidtmf_state *p_state)
412+static void capidtmf_recv_init(t_capidtmf_state *p_state)
413413 {
414− p_state->recv.min_gap_duration = 1;
415− p_state->recv.min_digit_duration = 1;
416−
417− p_state->recv.cycle_counter = 0;
418− p_state->recv.current_digit_on_time = 0;
419− p_state->recv.current_digit_off_time = 0;
420− p_state->recv.current_digit_value = CAPIDTMF_RECV_NO_DIGIT;
421−
422− p_state->recv.digit_write_pos = 0;
423− p_state->recv.digit_read_pos = 0;
424− p_state->recv.indication_state = 0;
425− p_state->recv.indication_state_ack = 0;
426− p_state->recv.state = CAPIDTMF_RECV_STATE_IDLE;
414+ p_state->recv.min_gap_duration = 1;
415+ p_state->recv.min_digit_duration = 1;
416+
417+ p_state->recv.cycle_counter = 0;
418+ p_state->recv.current_digit_on_time = 0;
419+ p_state->recv.current_digit_off_time = 0;
420+ p_state->recv.current_digit_value = CAPIDTMF_RECV_NO_DIGIT;
421+
422+ p_state->recv.digit_write_pos = 0;
423+ p_state->recv.digit_read_pos = 0;
424+ p_state->recv.indication_state = 0;
425+ p_state->recv.indication_state_ack = 0;
426+ p_state->recv.state = CAPIDTMF_RECV_STATE_IDLE;
427427 }
428428
429429
430−void capidtmf_recv_enable (t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration)
430+void capidtmf_recv_enable(t_capidtmf_state *p_state, word min_digit_duration, word min_gap_duration)
431431 {
432− p_state->recv.indication_state_ack &= CAPIDTMF_RECV_INDICATION_DIGIT;
433− p_state->recv.min_digit_duration = (word)(((((dword) min_digit_duration) * 8) +
434− ((dword)(CAPIDTMF_RECV_TIME_GRANULARITY / 2))) / ((dword) CAPIDTMF_RECV_TIME_GRANULARITY));
435− if (p_state->recv.min_digit_duration <= 1)
436− p_state->recv.min_digit_duration = 1;
437− else
438− (p_state->recv.min_digit_duration)--;
439− p_state->recv.min_gap_duration =
440− (word)((((dword) min_gap_duration) * 8) / ((dword) CAPIDTMF_RECV_TIME_GRANULARITY));
441− if (p_state->recv.min_gap_duration <= 1)
442− p_state->recv.min_gap_duration = 1;
443− else
444− (p_state->recv.min_gap_duration)--;
445− p_state->recv.state |= CAPIDTMF_RECV_STATE_DTMF_ACTIVE;
432+ p_state->recv.indication_state_ack &= CAPIDTMF_RECV_INDICATION_DIGIT;
433+ p_state->recv.min_digit_duration = (word)(((((dword) min_digit_duration) * 8) +
434+ ((dword)(CAPIDTMF_RECV_TIME_GRANULARITY / 2))) / ((dword) CAPIDTMF_RECV_TIME_GRANULARITY));
435+ if (p_state->recv.min_digit_duration <= 1)
436+ p_state->recv.min_digit_duration = 1;
437+ else
438+ (p_state->recv.min_digit_duration)--;
439+ p_state->recv.min_gap_duration =
440+ (word)((((dword) min_gap_duration) * 8) / ((dword) CAPIDTMF_RECV_TIME_GRANULARITY));
441+ if (p_state->recv.min_gap_duration <= 1)
442+ p_state->recv.min_gap_duration = 1;
443+ else
444+ (p_state->recv.min_gap_duration)--;
445+ p_state->recv.state |= CAPIDTMF_RECV_STATE_DTMF_ACTIVE;
446446 }
447447
448448
449−void capidtmf_recv_disable (t_capidtmf_state *p_state)
449+void capidtmf_recv_disable(t_capidtmf_state *p_state)
450450 {
451− p_state->recv.state &= ~CAPIDTMF_RECV_STATE_DTMF_ACTIVE;
452− if (p_state->recv.state == CAPIDTMF_RECV_STATE_IDLE)
453− capidtmf_recv_init (p_state);
454− else
455− {
456− p_state->recv.cycle_counter = 0;
457− p_state->recv.current_digit_on_time = 0;
458− p_state->recv.current_digit_off_time = 0;
459− p_state->recv.current_digit_value = CAPIDTMF_RECV_NO_DIGIT;
460− }
451+ p_state->recv.state &= ~CAPIDTMF_RECV_STATE_DTMF_ACTIVE;
452+ if (p_state->recv.state == CAPIDTMF_RECV_STATE_IDLE)
453+ capidtmf_recv_init(p_state);
454+ else
455+ {
456+ p_state->recv.cycle_counter = 0;
457+ p_state->recv.current_digit_on_time = 0;
458+ p_state->recv.current_digit_off_time = 0;
459+ p_state->recv.current_digit_value = CAPIDTMF_RECV_NO_DIGIT;
460+ }
461461 }
462462
463463
464−word capidtmf_recv_indication (t_capidtmf_state *p_state, byte *buffer)
464+word capidtmf_recv_indication(t_capidtmf_state *p_state, byte *buffer)
465465 {
466− word i, j, k, flags;
467−
468− flags = p_state->recv.indication_state ^ p_state->recv.indication_state_ack;
469− p_state->recv.indication_state_ack ^= flags & CAPIDTMF_RECV_INDICATION_DIGIT;
470− if (p_state->recv.digit_write_pos != p_state->recv.digit_read_pos)
471− {
472− i = 0;
473− k = p_state->recv.digit_write_pos;
474− j = p_state->recv.digit_read_pos;
475− do
476− {
477− buffer[i++] = p_state->recv.digit_buffer[j];
478− j = (j == CAPIDTMF_RECV_DIGIT_BUFFER_SIZE - 1) ? 0 : j + 1;
479− } while (j != k);
480− p_state->recv.digit_read_pos = k;
481− return (i);
482− }
483− p_state->recv.indication_state_ack ^= flags;
484− return (0);
466+ word i, j, k, flags;
467+
468+ flags = p_state->recv.indication_state ^ p_state->recv.indication_state_ack;
469+ p_state->recv.indication_state_ack ^= flags & CAPIDTMF_RECV_INDICATION_DIGIT;
470+ if (p_state->recv.digit_write_pos != p_state->recv.digit_read_pos)
471+ {
472+ i = 0;
473+ k = p_state->recv.digit_write_pos;
474+ j = p_state->recv.digit_read_pos;
475+ do
476+ {
477+ buffer[i++] = p_state->recv.digit_buffer[j];
478+ j = (j == CAPIDTMF_RECV_DIGIT_BUFFER_SIZE - 1) ? 0 : j + 1;
479+ } while (j != k);
480+ p_state->recv.digit_read_pos = k;
481+ return (i);
482+ }
483+ p_state->recv.indication_state_ack ^= flags;
484+ return (0);
485485 }
486486
487487
488488 #define CAPIDTMF_RECV_WINDOWED_SAMPLES 32
489489
490−void capidtmf_recv_block (t_capidtmf_state *p_state, byte *buffer, word length)
490+void capidtmf_recv_block(t_capidtmf_state *p_state, byte *buffer, word length)
491491 {
492− byte result_digit;
493− word sample_number, cycle_counter, n, i;
494− word low_peak, high_peak;
495− dword lo, hi;
496− byte *p;
497− short *q;
498− byte goertzel_result_buffer[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
499− short windowed_sample_buffer[CAPIDTMF_RECV_WINDOWED_SAMPLES];
500−
501−
502− if (p_state->recv.state & CAPIDTMF_RECV_STATE_DTMF_ACTIVE)
503− {
504− cycle_counter = p_state->recv.cycle_counter;
505− sample_number = 0;
506− while (sample_number < length)
507− {
508− if (cycle_counter < CAPIDTMF_RECV_ACCUMULATE_CYCLES)
509− {
510− if (cycle_counter == 0)
511− {
512− for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
513− {
514− p_state->recv.goertzel_buffer[0][i] = 0;
515− p_state->recv.goertzel_buffer[1][i] = 0;
516− }
517− }
518− n = CAPIDTMF_RECV_ACCUMULATE_CYCLES - cycle_counter;
519− if (n > length - sample_number)
520− n = length - sample_number;
521− if (n > CAPIDTMF_RECV_WINDOWED_SAMPLES)
522− n = CAPIDTMF_RECV_WINDOWED_SAMPLES;
523− p = buffer + sample_number;
524− q = capidtmf_recv_window_function + cycle_counter;
525− if (p_state->ulaw)
526− {
527− for (i = 0; i < n; i++)
528− {
529− windowed_sample_buffer[i] =
530− (short)((capidtmf_expand_table_ulaw[p[i]] * ((long)(q[i]))) >> 15);
531− }
532− }
533− else
534− {
535− for (i = 0; i < n; i++)
536− {
537− windowed_sample_buffer[i] =
538− (short)((capidtmf_expand_table_alaw[p[i]] * ((long)(q[i]))) >> 15);
539− }
540− }
541− capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1] = CAPIDTMF_RECV_FUNDAMENTAL_OFFSET;
542− capidtmf_goertzel_loop (p_state->recv.goertzel_buffer[0],
543− capidtmf_recv_goertzel_coef_table, windowed_sample_buffer, n);
544− cycle_counter += n;
545− sample_number += n;
546− }
547− else
548− {
549− capidtmf_goertzel_result (p_state->recv.goertzel_buffer[0],
550− capidtmf_recv_goertzel_coef_table);
551− for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
552− {
553− lo = (dword)(p_state->recv.goertzel_buffer[0][i]);
554− hi = (dword)(p_state->recv.goertzel_buffer[1][i]);
555− if (hi != 0)
556− {
557− n = capidtmf_dword_leading_zeroes (hi);
558− hi = (hi << n) | (lo >> (32 - n));
559− }
560− else
561− {
562− n = capidtmf_dword_leading_zeroes (lo);
563− hi = lo << n;
564− n += 32;
565− }
566− n = 195 - 3 * n;
567− if (hi >= 0xcb300000L)
568− n += 2;
569− else if (hi >= 0xa1450000L)
570− n++;
571− goertzel_result_buffer[i] = (byte) n;
572− }
573− low_peak = DSPDTMF_RX_SENSITIVITY_LOW_DEFAULT;
574− result_digit = CAPIDTMF_RECV_NO_DIGIT;
575− for (i = 0; i < CAPIDTMF_LOW_GROUP_FREQUENCIES; i++)
576− {
577− if (goertzel_result_buffer[i] > low_peak)
578− {
579− low_peak = goertzel_result_buffer[i];
580− result_digit = (byte) i;
581− }
582− }
583− high_peak = DSPDTMF_RX_SENSITIVITY_HIGH_DEFAULT;
584− n = CAPIDTMF_RECV_NO_DIGIT;
585− for (i = CAPIDTMF_LOW_GROUP_FREQUENCIES; i < CAPIDTMF_RECV_BASE_FREQUENCY_COUNT; i++)
586− {
587− if (goertzel_result_buffer[i] > high_peak)
588− {
589− high_peak = goertzel_result_buffer[i];
590− n = (i - CAPIDTMF_LOW_GROUP_FREQUENCIES) << 2;
591− }
592− }
593− result_digit |= (byte) n;
594− if (low_peak + DSPDTMF_RX_HIGH_EXCEEDING_LOW_DEFAULT < high_peak)
595− result_digit = CAPIDTMF_RECV_NO_DIGIT;
596− if (high_peak + DSPDTMF_RX_LOW_EXCEEDING_HIGH_DEFAULT < low_peak)
597− result_digit = CAPIDTMF_RECV_NO_DIGIT;
598− n = 0;
599− for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
600− {
601− if ((((short)(low_peak - goertzel_result_buffer[i] - capidtmf_recv_guard_snr_low_table[i])) < 0)
602− || (((short)(high_peak - goertzel_result_buffer[i] - capidtmf_recv_guard_snr_high_table[i])) < 0))
603− {
604− n++;
605− }
606− }
607− if (n != 2)
608− result_digit = CAPIDTMF_RECV_NO_DIGIT;
609−
610− if (result_digit == CAPIDTMF_RECV_NO_DIGIT)
611− {
612− if (p_state->recv.current_digit_on_time != 0)
613− {
614− if (++(p_state->recv.current_digit_off_time) >= p_state->recv.min_gap_duration)
615− {
616− p_state->recv.current_digit_on_time = 0;
617− p_state->recv.current_digit_off_time = 0;
618− }
619− }
620− else
621− {
622− if (p_state->recv.current_digit_off_time != 0)
623− (p_state->recv.current_digit_off_time)--;
624− }
625− }
626− else
627− {
628− if ((p_state->recv.current_digit_on_time == 0)
629− && (p_state->recv.current_digit_off_time != 0))
630− {
631− (p_state->recv.current_digit_off_time)--;
632− }
633− else
634− {
635− n = p_state->recv.current_digit_off_time;
636− if ((p_state->recv.current_digit_on_time != 0)
637− && (result_digit != p_state->recv.current_digit_value))
638− {
639− p_state->recv.current_digit_on_time = 0;
640− n = 0;
641− }
642− p_state->recv.current_digit_value = result_digit;
643− p_state->recv.current_digit_off_time = 0;
644− if (p_state->recv.current_digit_on_time != 0xffff)
645− {
646− p_state->recv.current_digit_on_time += n + 1;
647− if (p_state->recv.current_digit_on_time >= p_state->recv.min_digit_duration)
648− {
649− p_state->recv.current_digit_on_time = 0xffff;
650− i = (p_state->recv.digit_write_pos == CAPIDTMF_RECV_DIGIT_BUFFER_SIZE - 1) ?
651− 0 : p_state->recv.digit_write_pos + 1;
652− if (i == p_state->recv.digit_read_pos)
653− {
654− trace (dprintf ("%s,%d: Receive digit overrun",
655− (char *)(FILE_), __LINE__));
656− }
657− else
658− {
659− p_state->recv.digit_buffer[p_state->recv.digit_write_pos] = result_digit;
660− p_state->recv.digit_write_pos = i;
661− p_state->recv.indication_state =
662− (p_state->recv.indication_state & ~CAPIDTMF_RECV_INDICATION_DIGIT) |
663− (~p_state->recv.indication_state_ack & CAPIDTMF_RECV_INDICATION_DIGIT);
664− }
665− }
666− }
667− }
668− }
669− cycle_counter = 0;
670− sample_number++;
671− }
672− }
673− p_state->recv.cycle_counter = cycle_counter;
674− }
492+ byte result_digit;
493+ word sample_number, cycle_counter, n, i;
494+ word low_peak, high_peak;
495+ dword lo, hi;
496+ byte *p;
497+ short *q;
498+ byte goertzel_result_buffer[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT];
499+ short windowed_sample_buffer[CAPIDTMF_RECV_WINDOWED_SAMPLES];
500+
501+
502+ if (p_state->recv.state & CAPIDTMF_RECV_STATE_DTMF_ACTIVE)
503+ {
504+ cycle_counter = p_state->recv.cycle_counter;
505+ sample_number = 0;
506+ while (sample_number < length)
507+ {
508+ if (cycle_counter < CAPIDTMF_RECV_ACCUMULATE_CYCLES)
509+ {
510+ if (cycle_counter == 0)
511+ {
512+ for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
513+ {
514+ p_state->recv.goertzel_buffer[0][i] = 0;
515+ p_state->recv.goertzel_buffer[1][i] = 0;
516+ }
517+ }
518+ n = CAPIDTMF_RECV_ACCUMULATE_CYCLES - cycle_counter;
519+ if (n > length - sample_number)
520+ n = length - sample_number;
521+ if (n > CAPIDTMF_RECV_WINDOWED_SAMPLES)
522+ n = CAPIDTMF_RECV_WINDOWED_SAMPLES;
523+ p = buffer + sample_number;
524+ q = capidtmf_recv_window_function + cycle_counter;
525+ if (p_state->ulaw)
526+ {
527+ for (i = 0; i < n; i++)
528+ {
529+ windowed_sample_buffer[i] =
530+ (short)((capidtmf_expand_table_ulaw[p[i]] * ((long)(q[i]))) >> 15);
531+ }
532+ }
533+ else
534+ {
535+ for (i = 0; i < n; i++)
536+ {
537+ windowed_sample_buffer[i] =
538+ (short)((capidtmf_expand_table_alaw[p[i]] * ((long)(q[i]))) >> 15);
539+ }
540+ }
541+ capidtmf_recv_goertzel_coef_table[CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT - 1] = CAPIDTMF_RECV_FUNDAMENTAL_OFFSET;
542+ capidtmf_goertzel_loop(p_state->recv.goertzel_buffer[0],
543+ capidtmf_recv_goertzel_coef_table, windowed_sample_buffer, n);
544+ cycle_counter += n;
545+ sample_number += n;
546+ }
547+ else
548+ {
549+ capidtmf_goertzel_result(p_state->recv.goertzel_buffer[0],
550+ capidtmf_recv_goertzel_coef_table);
551+ for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
552+ {
553+ lo = (dword)(p_state->recv.goertzel_buffer[0][i]);
554+ hi = (dword)(p_state->recv.goertzel_buffer[1][i]);
555+ if (hi != 0)
556+ {
557+ n = capidtmf_dword_leading_zeroes(hi);
558+ hi = (hi << n) | (lo >> (32 - n));
559+ }
560+ else
561+ {
562+ n = capidtmf_dword_leading_zeroes(lo);
563+ hi = lo << n;
564+ n += 32;
565+ }
566+ n = 195 - 3 * n;
567+ if (hi >= 0xcb300000L)
568+ n += 2;
569+ else if (hi >= 0xa1450000L)
570+ n++;
571+ goertzel_result_buffer[i] = (byte) n;
572+ }
573+ low_peak = DSPDTMF_RX_SENSITIVITY_LOW_DEFAULT;
574+ result_digit = CAPIDTMF_RECV_NO_DIGIT;
575+ for (i = 0; i < CAPIDTMF_LOW_GROUP_FREQUENCIES; i++)
576+ {
577+ if (goertzel_result_buffer[i] > low_peak)
578+ {
579+ low_peak = goertzel_result_buffer[i];
580+ result_digit = (byte) i;
581+ }
582+ }
583+ high_peak = DSPDTMF_RX_SENSITIVITY_HIGH_DEFAULT;
584+ n = CAPIDTMF_RECV_NO_DIGIT;
585+ for (i = CAPIDTMF_LOW_GROUP_FREQUENCIES; i < CAPIDTMF_RECV_BASE_FREQUENCY_COUNT; i++)
586+ {
587+ if (goertzel_result_buffer[i] > high_peak)
588+ {
589+ high_peak = goertzel_result_buffer[i];
590+ n = (i - CAPIDTMF_LOW_GROUP_FREQUENCIES) << 2;
591+ }
592+ }
593+ result_digit |= (byte) n;
594+ if (low_peak + DSPDTMF_RX_HIGH_EXCEEDING_LOW_DEFAULT < high_peak)
595+ result_digit = CAPIDTMF_RECV_NO_DIGIT;
596+ if (high_peak + DSPDTMF_RX_LOW_EXCEEDING_HIGH_DEFAULT < low_peak)
597+ result_digit = CAPIDTMF_RECV_NO_DIGIT;
598+ n = 0;
599+ for (i = 0; i < CAPIDTMF_RECV_TOTAL_FREQUENCY_COUNT; i++)
600+ {
601+ if ((((short)(low_peak - goertzel_result_buffer[i] - capidtmf_recv_guard_snr_low_table[i])) < 0)
602+ || (((short)(high_peak - goertzel_result_buffer[i] - capidtmf_recv_guard_snr_high_table[i])) < 0))
603+ {
604+ n++;
605+ }
606+ }
607+ if (n != 2)
608+ result_digit = CAPIDTMF_RECV_NO_DIGIT;
609+
610+ if (result_digit == CAPIDTMF_RECV_NO_DIGIT)
611+ {
612+ if (p_state->recv.current_digit_on_time != 0)
613+ {
614+ if (++(p_state->recv.current_digit_off_time) >= p_state->recv.min_gap_duration)
615+ {
616+ p_state->recv.current_digit_on_time = 0;
617+ p_state->recv.current_digit_off_time = 0;
618+ }
619+ }
620+ else
621+ {
622+ if (p_state->recv.current_digit_off_time != 0)
623+ (p_state->recv.current_digit_off_time)--;
624+ }
625+ }
626+ else
627+ {
628+ if ((p_state->recv.current_digit_on_time == 0)

59 more lines aren’t shown here.

drivers/isdn/hardware/eicon/capidtmf.h+39−39

This diff is large: its 102 lines aren’t shown here.

drivers/isdn/hardware/eicon/capifunc.c+111−111

This diff is large: its 625 lines aren’t shown here.

drivers/isdn/hardware/eicon/capifunc.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/isdn/hardware/eicon/capimain.c+5−5

This diff is large: its 32 lines aren’t shown here.

drivers/isdn/hardware/eicon/cardtype.h+738−738

This diff is large: its 1599 lines aren’t shown here.

drivers/isdn/hardware/eicon/cp_vers.h+16−16

This diff is large: its 43 lines aren’t shown here.

drivers/isdn/hardware/eicon/dadapter.c+287−289

This diff is large: its 652 lines aren’t shown here.

drivers/isdn/hardware/eicon/dadapter.h+18−18

This diff is large: its 52 lines aren’t shown here.

drivers/isdn/hardware/eicon/debug.c+1759−1760

This diff is large: its 3840 lines aren’t shown here.

drivers/isdn/hardware/eicon/debug_if.h+40−42

This diff is large: its 114 lines aren’t shown here.

drivers/isdn/hardware/eicon/debuglib.c+88−88

This diff is large: its 233 lines aren’t shown here.

drivers/isdn/hardware/eicon/debuglib.h+136−136

This diff is large: its 352 lines aren’t shown here.

drivers/isdn/hardware/eicon/dfifo.h+28−28

This diff is large: its 83 lines aren’t shown here.

drivers/isdn/hardware/eicon/di.c+715−715

This diff is large: its 1539 lines aren’t shown here.

drivers/isdn/hardware/eicon/di.h+78−78

This diff is large: its 189 lines aren’t shown here.

drivers/isdn/hardware/eicon/di_dbg.h+17−17

This diff is large: its 52 lines aren’t shown here.

drivers/isdn/hardware/eicon/di_defs.h+72−72

This diff is large: its 216 lines aren’t shown here.

drivers/isdn/hardware/eicon/did_vers.h+16−16

This diff is large: its 43 lines aren’t shown here.

drivers/isdn/hardware/eicon/diddfunc.c+11−11

This diff is large: its 64 lines aren’t shown here.

drivers/isdn/hardware/eicon/diva.c+80−80

This diff is large: its 363 lines aren’t shown here.

drivers/isdn/hardware/eicon/diva_didd.c+8−8

This diff is large: its 45 lines aren’t shown here.

drivers/isdn/hardware/eicon/diva_dma.c+58−58

This diff is large: its 153 lines aren’t shown here.

drivers/isdn/hardware/eicon/diva_dma.h+31−31

This diff is large: its 80 lines aren’t shown here.

drivers/isdn/hardware/eicon/diva_pci.h+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/isdn/hardware/eicon/divacapi.h+315−315

This diff is large: its 774 lines aren’t shown here.

drivers/isdn/hardware/eicon/divamnt.c+7−8

This diff is large: its 63 lines aren’t shown here.

drivers/isdn/hardware/eicon/divasfunc.c+17−17

This diff is large: its 101 lines aren’t shown here.

drivers/isdn/hardware/eicon/divasi.c+28−28

This diff is large: its 174 lines aren’t shown here.

drivers/isdn/hardware/eicon/divasmain.c+59−59

This diff is large: its 352 lines aren’t shown here.

drivers/isdn/hardware/eicon/divasproc.c+29−29

This diff is large: its 163 lines aren’t shown here.

drivers/isdn/hardware/eicon/divasync.h+281−281

This diff is large: its 713 lines aren’t shown here.

drivers/isdn/hardware/eicon/dqueue.c+7−7

This diff is large: its 57 lines aren’t shown here.

drivers/isdn/hardware/eicon/dqueue.h+7−7

This diff is large: its 24 lines aren’t shown here.

drivers/isdn/hardware/eicon/dsp_defs.h+128−128

This diff is large: its 360 lines aren’t shown here.

drivers/isdn/hardware/eicon/dsp_tst.h+4−4

This diff is large: its 23 lines aren’t shown here.

drivers/isdn/hardware/eicon/dspdids.h+15−15

This diff is large: its 42 lines aren’t shown here.

drivers/isdn/hardware/eicon/dsrv4bri.h+17−17

This diff is large: its 51 lines aren’t shown here.

drivers/isdn/hardware/eicon/dsrv_bri.h+22−22

This diff is large: its 60 lines aren’t shown here.

drivers/isdn/hardware/eicon/dsrv_pri.h+23−23

This diff is large: its 62 lines aren’t shown here.

drivers/isdn/hardware/eicon/entity.h+7−7

This diff is large: its 25 lines aren’t shown here.

drivers/isdn/hardware/eicon/helpers.h+34−34

This diff is large: its 86 lines aren’t shown here.

drivers/isdn/hardware/eicon/idifunc.c+11−11

This diff is large: its 81 lines aren’t shown here.

drivers/isdn/hardware/eicon/io.c+707−707

This diff is large: its 1544 lines aren’t shown here.

drivers/isdn/hardware/eicon/io.h+257−257

This diff is large: its 566 lines aren’t shown here.

drivers/isdn/hardware/eicon/istream.c+176−176

This diff is large: its 400 lines aren’t shown here.

drivers/isdn/hardware/eicon/kst_ifc.h+113−114

This diff is large: its 325 lines aren’t shown here.

drivers/isdn/hardware/eicon/maintidi.c+1138−1139

This diff is large: its 3258 lines aren’t shown here.

drivers/isdn/hardware/eicon/maintidi.h+52−53

This diff is large: its 155 lines aren’t shown here.

drivers/isdn/hardware/eicon/man_defs.h+18−18

This diff is large: its 54 lines aren’t shown here.

drivers/isdn/hardware/eicon/mdm_msg.h+36−36

This diff is large: its 138 lines aren’t shown here.

drivers/isdn/hardware/eicon/message.c+14150−14150

This diff is large: its 29086 lines aren’t shown here.

drivers/isdn/hardware/eicon/mi_pc.h+43−43

This diff is large: its 142 lines aren’t shown here.

drivers/isdn/hardware/eicon/mntfunc.c+93−93

This diff is large: its 304 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_4bri.c+176−176

This diff is large: its 840 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_4bri.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_bri.c+131−131

This diff is large: its 660 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_bri.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_capi.h+5−5

This diff is large: its 22 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_pri.c+195−195

This diff is large: its 897 lines aren’t shown here.

drivers/isdn/hardware/eicon/os_pri.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/isdn/hardware/eicon/pc.h+134−134

This diff is large: its 355 lines aren’t shown here.

drivers/isdn/hardware/eicon/pc_init.h+24−24

This diff is large: its 67 lines aren’t shown here.

drivers/isdn/hardware/eicon/pc_maint.h+79−79

This diff is large: its 203 lines aren’t shown here.

drivers/isdn/hardware/eicon/pkmaint.h+21−22

This diff is large: its 66 lines aren’t shown here.

drivers/isdn/hardware/eicon/platform.h+78−78

This diff is large: its 275 lines aren’t shown here.

drivers/isdn/hardware/eicon/pr_pc.h+58−58

This diff is large: its 135 lines aren’t shown here.

drivers/isdn/hardware/eicon/s_4bri.c+244−244

This diff is large: its 732 lines aren’t shown here.

drivers/isdn/hardware/eicon/s_bri.c+144−144

This diff is large: its 326 lines aren’t shown here.

drivers/isdn/hardware/eicon/s_pri.c+157−157

This diff is large: its 353 lines aren’t shown here.

drivers/isdn/hardware/eicon/sdp_hdr.h+65−65

This diff is large: its 178 lines aren’t shown here.

drivers/isdn/hardware/eicon/um_idi.c+112−112

This diff is large: its 516 lines aren’t shown here.

drivers/isdn/hardware/eicon/um_idi.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hardware/eicon/xdi_adapter.h+6−6

This diff is large: its 19 lines aren’t shown here.

drivers/isdn/hardware/eicon/xdi_msg.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hardware/eicon/xdi_vers.h+16−16

This diff is large: its 43 lines aren’t shown here.

drivers/isdn/hardware/mISDN/avmfritz.c+34−34

This diff is large: its 266 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfc_multi.h+23−24

This diff is large: its 133 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfc_multi_8xx.h+14−14

This diff is large: its 78 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfc_pci.h+9−9

This diff is large: its 42 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfcmulti.c+682−682

This diff is large: its 3426 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfcpci.c+178−178

This diff is large: its 1043 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfcsusb.c+207−208

This diff is large: its 1181 lines aren’t shown here.

drivers/isdn/hardware/mISDN/hfcsusb.h+60−60

This diff is large: its 189 lines aren’t shown here.

drivers/isdn/hardware/mISDN/iohelper.h+68−68

This diff is large: its 152 lines aren’t shown here.

drivers/isdn/hardware/mISDN/isar.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hardware/mISDN/mISDNinfineon.c+18−18

This diff is large: its 126 lines aren’t shown here.

drivers/isdn/hardware/mISDN/mISDNipac.c+56−56

This diff is large: its 460 lines aren’t shown here.

drivers/isdn/hardware/mISDN/mISDNisar.c+104−104

This diff is large: its 735 lines aren’t shown here.

drivers/isdn/hardware/mISDN/netjet.c+49−49

This diff is large: its 322 lines aren’t shown here.

drivers/isdn/hardware/mISDN/netjet.h+0−1

This diff is large: its 5 lines aren’t shown here.

drivers/isdn/hardware/mISDN/speedfax.c+11−11

This diff is large: its 89 lines aren’t shown here.

drivers/isdn/hardware/mISDN/w6692.c+43−43

This diff is large: its 356 lines aren’t shown here.

drivers/isdn/hisax/amd7930_fn.c+393−393

This diff is large: its 1033 lines aren’t shown here.

drivers/isdn/hisax/arcofi.c+44−44

This diff is large: its 130 lines aren’t shown here.

drivers/isdn/hisax/arcofi.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hisax/asuscom.c+55−55

This diff is large: its 251 lines aren’t shown here.

drivers/isdn/hisax/avm_a1.c+21−21

This diff is large: its 81 lines aren’t shown here.

drivers/isdn/hisax/avm_a1p.c+76−76

This diff is large: its 253 lines aren’t shown here.

drivers/isdn/hisax/avm_pci.c+162−162

This diff is large: its 552 lines aren’t shown here.

drivers/isdn/hisax/avma1_cs.c+62−62

This diff is large: its 155 lines aren’t shown here.

drivers/isdn/hisax/bkm_a4t.c+46−46

This diff is large: its 154 lines aren’t shown here.

drivers/isdn/hisax/bkm_a8.c+92−92

This diff is large: its 305 lines aren’t shown here.

drivers/isdn/hisax/bkm_ax.h+39−39

This diff is large: its 124 lines aren’t shown here.

drivers/isdn/hisax/callc.c+537−537

This diff is large: its 1404 lines aren’t shown here.

drivers/isdn/hisax/config.c+63−63

This diff is large: its 412 lines aren’t shown here.

drivers/isdn/hisax/diva.c+167−167

This diff is large: its 741 lines aren’t shown here.

drivers/isdn/hisax/elsa.c+250−250

This diff is large: its 861 lines aren’t shown here.

drivers/isdn/hisax/elsa_cs.c+82−82

This diff is large: its 228 lines aren’t shown here.

drivers/isdn/hisax/elsa_ser.c+89−89

This diff is large: its 488 lines aren’t shown here.

drivers/isdn/hisax/enternow_pci.c+100−100

This diff is large: its 338 lines aren’t shown here.

drivers/isdn/hisax/fsm.c+19−19

This diff is large: its 101 lines aren’t shown here.

drivers/isdn/hisax/fsm.h+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/isdn/hisax/gazel.c+259−259

This diff is large: its 688 lines aren’t shown here.

drivers/isdn/hisax/hfc4s8s_l1.c+324−324

This diff is large: its 975 lines aren’t shown here.

drivers/isdn/hisax/hfc4s8s_l1.h+4−4

This diff is large: its 15 lines aren’t shown here.

drivers/isdn/hisax/hfc_2bds0.c+242−242

This diff is large: its 764 lines aren’t shown here.

drivers/isdn/hisax/hfc_2bds0.h+14−14

This diff is large: its 49 lines aren’t shown here.

drivers/isdn/hisax/hfc_2bs0.c+142−142

This diff is large: its 359 lines aren’t shown here.

drivers/isdn/hisax/hfc_2bs0.h+3−3

This diff is large: its 26 lines aren’t shown here.

drivers/isdn/hisax/hfc_pci.c+357−357

This diff is large: its 969 lines aren’t shown here.

drivers/isdn/hisax/hfc_pci.h+48−48

This diff is large: its 157 lines aren’t shown here.

drivers/isdn/hisax/hfc_sx.c+563−563

This diff is large: its 1485 lines aren’t shown here.

drivers/isdn/hisax/hfc_sx.h+15−15

This diff is large: its 78 lines aren’t shown here.

drivers/isdn/hisax/hfc_usb.c+293−293

This diff is large: its 941 lines aren’t shown here.

drivers/isdn/hisax/hfc_usb.h+5−5

This diff is large: its 26 lines aren’t shown here.

drivers/isdn/hisax/hfcscard.c+48−48

This diff is large: its 173 lines aren’t shown here.

drivers/isdn/hisax/hisax.h+86−86

This diff is large: its 385 lines aren’t shown here.

drivers/isdn/hisax/hisax_cfg.h+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/isdn/hisax/hisax_debug.h+21−21

This diff is large: its 89 lines aren’t shown here.

drivers/isdn/hisax/hisax_fcpcipnp.c+46−46

This diff is large: its 343 lines aren’t shown here.

drivers/isdn/hisax/hisax_fcpcipnp.h+1−2

This diff is large: its 14 lines aren’t shown here.

drivers/isdn/hisax/hisax_if.h+2−2

This diff is large: its 13 lines aren’t shown here.

drivers/isdn/hisax/hisax_isac.c+22−22

This diff is large: its 132 lines aren’t shown here.

drivers/isdn/hisax/hscx.c+68−68

This diff is large: its 182 lines aren’t shown here.

drivers/isdn/hisax/hscx.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hisax/hscx_irq.c+9−9

This diff is large: its 74 lines aren’t shown here.

drivers/isdn/hisax/icc.c+157−157

This diff is large: its 454 lines aren’t shown here.

drivers/isdn/hisax/icc.h+3−3

This diff is large: its 16 lines aren’t shown here.

drivers/isdn/hisax/ipac.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hisax/ipacx.c+337−338

This diff is large: its 1019 lines aren’t shown here.

drivers/isdn/hisax/isac.c+160−160

This diff is large: its 456 lines aren’t shown here.

drivers/isdn/hisax/isac.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/hisax/isar.c+898−898

This diff is large: its 2301 lines aren’t shown here.

drivers/isdn/hisax/isar.h+7−7

This diff is large: its 46 lines aren’t shown here.

drivers/isdn/hisax/isdnl1.c+131−131

This diff is large: its 419 lines aren’t shown here.

drivers/isdn/hisax/isdnl2.c+171−171

This diff is large: its 647 lines aren’t shown here.

drivers/isdn/hisax/isdnl2.h+0−1

This diff is large: its 5 lines aren’t shown here.

drivers/isdn/hisax/isdnl3.c+87−87

This diff is large: its 308 lines aren’t shown here.

drivers/isdn/hisax/isdnl3.h+1−2

This diff is large: its 14 lines aren’t shown here.

drivers/isdn/hisax/isurf.c+59−59

This diff is large: its 246 lines aren’t shown here.

drivers/isdn/hisax/ix1_micro.c+50−50

This diff is large: its 225 lines aren’t shown here.

drivers/isdn/hisax/jade.c+104−105

This diff is large: its 293 lines aren’t shown here.

drivers/isdn/hisax/jade.h+78−78

This diff is large: its 198 lines aren’t shown here.

drivers/isdn/hisax/jade_irq.c+24−24

This diff is large: its 131 lines aren’t shown here.

drivers/isdn/hisax/l3_1tr6.c+98−98

This diff is large: its 318 lines aren’t shown here.

drivers/isdn/hisax/l3dss1.c+950−950

This diff is large: its 2736 lines aren’t shown here.

drivers/isdn/hisax/l3dss1.h+10−10

This diff is large: its 29 lines aren’t shown here.

drivers/isdn/hisax/l3ni1.c+919−919

This diff is large: its 2729 lines aren’t shown here.

drivers/isdn/hisax/l3ni1.h+14−14

This diff is large: its 47 lines aren’t shown here.

drivers/isdn/hisax/lmgr.c+14−14

This diff is large: its 51 lines aren’t shown here.

drivers/isdn/hisax/mic.c+32−32

This diff is large: its 145 lines aren’t shown here.

drivers/isdn/hisax/netjet.c+311−312

This diff is large: its 1090 lines aren’t shown here.

drivers/isdn/hisax/netjet.h+2−3

This diff is large: its 21 lines aren’t shown here.

drivers/isdn/hisax/niccy.c+39−39

This diff is large: its 219 lines aren’t shown here.

drivers/isdn/hisax/nj_s.c+56−56

This diff is large: its 228 lines aren’t shown here.

drivers/isdn/hisax/nj_u.c+50−50

This diff is large: its 196 lines aren’t shown here.

drivers/isdn/hisax/q931.c+120−120

This diff is large: its 452 lines aren’t shown here.

drivers/isdn/hisax/s0box.c+66−66

This diff is large: its 205 lines aren’t shown here.

drivers/isdn/hisax/saphir.c+61−61

This diff is large: its 241 lines aren’t shown here.

drivers/isdn/hisax/sedlbauer.c+164−164

This diff is large: its 644 lines aren’t shown here.

drivers/isdn/hisax/sedlbauer_cs.c+88−88

This diff is large: its 220 lines aren’t shown here.

drivers/isdn/hisax/sportster.c+63−63

This diff is large: its 221 lines aren’t shown here.

drivers/isdn/hisax/st5481.h+49−49

This diff is large: its 259 lines aren’t shown here.

drivers/isdn/hisax/st5481_b.c+62−62

This diff is large: its 318 lines aren’t shown here.

drivers/isdn/hisax/st5481_d.c+97−97

This diff is large: its 395 lines aren’t shown here.

drivers/isdn/hisax/st5481_init.c+32−32

This diff is large: its 129 lines aren’t shown here.

drivers/isdn/hisax/st5481_usb.c+134−135

This diff is large: its 572 lines aren’t shown here.

drivers/isdn/hisax/tei.c+38−38

This diff is large: its 222 lines aren’t shown here.

drivers/isdn/hisax/teleint.c+63−63

This diff is large: its 218 lines aren’t shown here.

drivers/isdn/hisax/teles0.c+63−63

This diff is large: its 246 lines aren’t shown here.

drivers/isdn/hisax/teles3.c+78−78

This diff is large: its 309 lines aren’t shown here.

drivers/isdn/hisax/teles_cs.c+67−67

This diff is large: its 195 lines aren’t shown here.

drivers/isdn/hisax/telespci.c+40−40

This diff is large: its 214 lines aren’t shown here.

drivers/isdn/hisax/w6692.c+206−206

This diff is large: its 555 lines aren’t shown here.

drivers/isdn/hisax/w6692.h+5−5

This diff is large: its 25 lines aren’t shown here.

drivers/isdn/hysdn/boardergo.c+14−14

This diff is large: its 109 lines aren’t shown here.

drivers/isdn/hysdn/boardergo.h+15−15

This diff is large: its 78 lines aren’t shown here.

drivers/isdn/hysdn/hycapi.c+187−187

This diff is large: its 692 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_boot.c+151−151

This diff is large: its 361 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_defs.h+15−15

This diff is large: its 82 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_init.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_net.c+10−10

This diff is large: its 84 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_pof.h+13−13

This diff is large: its 62 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_procconf.c+5−5

This diff is large: its 31 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_proclog.c+13−13

This diff is large: its 110 lines aren’t shown here.

drivers/isdn/hysdn/hysdn_sched.c+27−27

This diff is large: its 88 lines aren’t shown here.

drivers/isdn/hysdn/ince1pc.h+36−36

This diff is large: its 130 lines aren’t shown here.

drivers/isdn/i4l/isdn_audio.c+63−63

This diff is large: its 304 lines aren’t shown here.

drivers/isdn/i4l/isdn_bsdcomp.c+187−187

This diff is large: its 800 lines aren’t shown here.

drivers/isdn/i4l/isdn_common.c+751−751

This diff is large: its 1930 lines aren’t shown here.

drivers/isdn/i4l/isdn_common.h+9−9

This diff is large: its 29 lines aren’t shown here.

drivers/isdn/i4l/isdn_concap.c+18−18

This diff is large: its 93 lines aren’t shown here.

drivers/isdn/i4l/isdn_concap.h+1−3

This diff is large: its 8 lines aren’t shown here.

drivers/isdn/i4l/isdn_net.c+749−749

This diff is large: its 2255 lines aren’t shown here.

drivers/isdn/i4l/isdn_net.h+5−6

This diff is large: its 43 lines aren’t shown here.

drivers/isdn/i4l/isdn_ppp.c+723−723

This diff is large: its 2644 lines aren’t shown here.

drivers/isdn/i4l/isdn_ppp.h+0−2

This diff is large: its 6 lines aren’t shown here.

drivers/isdn/i4l/isdn_tty.c+1221−1221

This diff is large: its 3224 lines aren’t shown here.

drivers/isdn/i4l/isdn_tty.h+5−5

This diff is large: its 25 lines aren’t shown here.

drivers/isdn/i4l/isdn_ttyfax.c+546−546

This diff is large: its 1400 lines aren’t shown here.

drivers/isdn/i4l/isdn_ttyfax.h+0−1

This diff is large: its 5 lines aren’t shown here.

drivers/isdn/i4l/isdn_v110.c+147−147

This diff is large: its 430 lines aren’t shown here.

drivers/isdn/i4l/isdn_v110.h+4−4

This diff is large: its 23 lines aren’t shown here.

drivers/isdn/i4l/isdn_x25iface.c+113−113

This diff is large: its 398 lines aren’t shown here.

drivers/isdn/i4l/isdn_x25iface.h+4−12

This diff is large: its 32 lines aren’t shown here.

drivers/isdn/i4l/isdnhdlc.c+27−27

This diff is large: its 106 lines aren’t shown here.

drivers/isdn/icn/icn.c+403−403

This diff is large: its 1054 lines aren’t shown here.

drivers/isdn/icn/icn.h+16−16

This diff is large: its 85 lines aren’t shown here.

drivers/isdn/isdnloop/isdnloop.c+479−479

This diff is large: its 1229 lines aren’t shown here.

drivers/isdn/isdnloop/isdnloop.h+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/isdn/mISDN/clock.c+12−13

This diff is large: its 84 lines aren’t shown here.

drivers/isdn/mISDN/core.c+18−19

This diff is large: its 156 lines aren’t shown here.

drivers/isdn/mISDN/core.h+4−4

This diff is large: its 24 lines aren’t shown here.

drivers/isdn/mISDN/dsp.h+12−13

This diff is large: its 82 lines aren’t shown here.

drivers/isdn/mISDN/dsp_audio.c+2−3

This diff is large: its 23 lines aren’t shown here.

drivers/isdn/mISDN/dsp_biquad.h+3−3

This diff is large: its 20 lines aren’t shown here.

drivers/isdn/mISDN/dsp_blowfish.c+56−56

This diff is large: its 182 lines aren’t shown here.

drivers/isdn/mISDN/dsp_cmx.c+519−521

This diff is large: its 1668 lines aren’t shown here.

drivers/isdn/mISDN/dsp_core.c+91−92

This diff is large: its 636 lines aren’t shown here.

drivers/isdn/mISDN/dsp_dtmf.c+32−34

This diff is large: its 147 lines aren’t shown here.

drivers/isdn/mISDN/dsp_ecdis.h+13−13

This diff is large: its 51 lines aren’t shown here.

drivers/isdn/mISDN/dsp_hwec.c+5−6

This diff is large: its 48 lines aren’t shown here.

drivers/isdn/mISDN/dsp_hwec.h+0−1

This diff is large: its 5 lines aren’t shown here.

drivers/isdn/mISDN/dsp_pipeline.c+27−29

This diff is large: its 150 lines aren’t shown here.

drivers/isdn/mISDN/dsp_tones.c+80−85

This diff is large: its 255 lines aren’t shown here.

drivers/isdn/mISDN/fsm.c+21−21

This diff is large: its 122 lines aren’t shown here.

drivers/isdn/mISDN/hwchannel.c+11−11

This diff is large: its 78 lines aren’t shown here.

drivers/isdn/mISDN/l1oip.h+10−11

This diff is large: its 52 lines aren’t shown here.

drivers/isdn/mISDN/l1oip_codec.c+17−19

This diff is large: its 80 lines aren’t shown here.

drivers/isdn/mISDN/l1oip_core.c+293−304

This diff is large: its 1263 lines aren’t shown here.

drivers/isdn/mISDN/layer1.c+8−8

This diff is large: its 37 lines aren’t shown here.

drivers/isdn/mISDN/layer1.h+0−1

This diff is large: its 5 lines aren’t shown here.

drivers/isdn/mISDN/layer2.c+48−49

This diff is large: its 362 lines aren’t shown here.

drivers/isdn/mISDN/layer2.h+6−6

This diff is large: its 25 lines aren’t shown here.

drivers/isdn/mISDN/socket.c+44−45

This diff is large: its 282 lines aren’t shown here.

drivers/isdn/mISDN/stack.c+62−62

This diff is large: its 333 lines aren’t shown here.

drivers/isdn/mISDN/tei.c+57−57

This diff is large: its 416 lines aren’t shown here.

drivers/isdn/mISDN/timerdev.c+6−6

This diff is large: its 52 lines aren’t shown here.

drivers/isdn/pcbit/callbacks.c+150−153

This diff is large: its 456 lines aren’t shown here.

drivers/isdn/pcbit/callbacks.h+13−15

This diff is large: its 59 lines aren’t shown here.

drivers/isdn/pcbit/capi.c+290−295

This diff is large: its 871 lines aren’t shown here.

drivers/isdn/pcbit/capi.h+20−26

This diff is large: its 97 lines aren’t shown here.

drivers/isdn/pcbit/drv.c+124−124

This diff is large: its 763 lines aren’t shown here.

drivers/isdn/pcbit/edss1.c+205−209

This diff is large: its 501 lines aren’t shown here.

drivers/isdn/pcbit/edss1.h+5−8

This diff is large: its 36 lines aren’t shown here.

drivers/isdn/pcbit/layer2.c+18−18

This diff is large: its 125 lines aren’t shown here.

drivers/isdn/pcbit/layer2.h+129−136

This diff is large: its 357 lines aren’t shown here.

drivers/isdn/pcbit/module.c+17−18

This diff is large: its 112 lines aren’t shown here.

drivers/isdn/pcbit/pcbit.h+16−16

This diff is large: its 94 lines aren’t shown here.

drivers/isdn/sc/card.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/isdn/sc/command.c+66−66

This diff is large: its 318 lines aren’t shown here.

drivers/isdn/sc/event.c+12−12

This diff is large: its 39 lines aren’t shown here.

drivers/isdn/sc/hardware.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/isdn/sc/init.c+61−61

This diff is large: its 371 lines aren’t shown here.

drivers/isdn/sc/interrupt.c+72−72

This diff is large: its 286 lines aren’t shown here.

drivers/isdn/sc/ioctl.c+110−110

This diff is large: its 518 lines aren’t shown here.

drivers/isdn/sc/message.c+63−63

This diff is large: its 221 lines aren’t shown here.

drivers/isdn/sc/message.h+9−9

This diff is large: its 45 lines aren’t shown here.

drivers/isdn/sc/packet.c+64−65

This diff is large: its 235 lines aren’t shown here.

drivers/isdn/sc/scioc.h+2−3

This diff is large: its 17 lines aren’t shown here.

drivers/isdn/sc/shmem.c+26−26

This diff is large: its 120 lines aren’t shown here.

drivers/isdn/sc/timer.c+12−13

This diff is large: its 80 lines aren’t shown here.

drivers/net/bonding/bond_3ad.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/bonding/bond_alb.c+4−8

This diff is large: its 28 lines aren’t shown here.

drivers/net/bonding/bond_main.c+15−3

This diff is large: its 34 lines aren’t shown here.

drivers/net/caif/caif_hsi.c+103−42

This diff is large: its 216 lines aren’t shown here.

drivers/net/can/Kconfig+3−3

This diff is large: its 15 lines aren’t shown here.

drivers/net/can/bfin_can.c+23−13

This diff is large: its 103 lines aren’t shown here.

drivers/net/can/cc770/cc770.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/can/dev.c+20−13

This diff is large: its 100 lines aren’t shown here.

drivers/net/can/flexcan.c+28−33

This diff is large: its 206 lines aren’t shown here.

drivers/net/can/mcp251x.c+1−2

This diff is large: its 10 lines aren’t shown here.

drivers/net/can/mscan/mscan.c+23−10

This diff is large: its 90 lines aren’t shown here.

drivers/net/can/pch_can.c+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/can/sja1000/Kconfig+25−3

This diff is large: its 45 lines aren’t shown here.

drivers/net/can/sja1000/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/can/sja1000/peak_pci.c+491−14

This diff is large: its 593 lines aren’t shown here.

drivers/net/can/sja1000/peak_pcmcia.c+753−0

This diff is large: its 754 lines aren’t shown here.

drivers/net/can/sja1000/plx_pci.c+21−1

This diff is large: its 50 lines aren’t shown here.

drivers/net/can/sja1000/sja1000.c+9−10

This diff is large: its 82 lines aren’t shown here.

drivers/net/can/slcan.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/can/ti_hecc.c+22−10

This diff is large: its 116 lines aren’t shown here.

drivers/net/can/usb/Kconfig+6−0

This diff is large: its 11 lines aren’t shown here.

drivers/net/can/usb/Makefile+1−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/can/usb/ems_usb.c+27−36

This diff is large: its 210 lines aren’t shown here.

drivers/net/can/usb/esd_usb2.c+12−15

This diff is large: its 110 lines aren’t shown here.

drivers/net/can/usb/peak_usb/Makefile+2−0

This diff is large: its 3 lines aren’t shown here.

drivers/net/can/usb/peak_usb/pcan_usb.c+899−0

This diff is large: its 900 lines aren’t shown here.

drivers/net/can/usb/peak_usb/pcan_usb_core.c+951−0

This diff is large: its 952 lines aren’t shown here.

drivers/net/can/usb/peak_usb/pcan_usb_core.h+146−0

This diff is large: its 147 lines aren’t shown here.

drivers/net/can/usb/peak_usb/pcan_usb_pro.c+1036−0

This diff is large: its 1037 lines aren’t shown here.

drivers/net/can/usb/peak_usb/pcan_usb_pro.h+178−0

This diff is large: its 179 lines aren’t shown here.

drivers/net/dummy.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/3com/3c501.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/3com/3c509.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/3com/3c515.c+4−6

This diff is large: its 43 lines aren’t shown here.

drivers/net/ethernet/3com/3c574_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/3com/3c589_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/3com/3c59x.c+5−5

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/3com/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/3com/typhoon.c+3−16

This diff is large: its 54 lines aren’t shown here.

drivers/net/ethernet/8390/ax88796.c+1−1

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/8390/axnet_cs.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/8390/lib8390.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/8390/pcnet_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/adaptec/starfire.c+5−8

This diff is large: its 51 lines aren’t shown here.

drivers/net/ethernet/adi/bfin_mac.c+14−13

This diff is large: its 77 lines aren’t shown here.

drivers/net/ethernet/adi/bfin_mac.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/aeroflex/greth.c+2−3

This diff is large: its 26 lines aren’t shown here.

drivers/net/ethernet/alteon/acenic.c+1−4

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/amd/7990.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/a2065.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/am79c961a.c+2−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/amd/am79c961a.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/amd/amd8111e.c+4−3

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/amd/ariadne.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/atarilance.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/au1000_eth.c+6−6

This diff is large: its 41 lines aren’t shown here.

drivers/net/ethernet/amd/declance.c+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/amd/depca.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/hplance.c+2−8

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/amd/ni65.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/amd/nmclan_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/pcnet32.c+7−9

This diff is large: its 64 lines aren’t shown here.

drivers/net/ethernet/amd/sun3lance.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/amd/sunlance.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/apple/bmac.c+8−11

This diff is large: its 71 lines aren’t shown here.

drivers/net/ethernet/apple/mace.c+3−6

This diff is large: its 38 lines aren’t shown here.

drivers/net/ethernet/apple/macmace.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/atheros/atl1c/atl1c_hw.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/atheros/atl1c/atl1c_main.c+5−7

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/atheros/atl1e/atl1e_main.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/atheros/atlx/atl1.c+9−3

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/atheros/atlx/atl2.c+5−8

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/atheros/atlx/atl2.h+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/atheros/atlx/atlx.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/atheros/atlx/atlx.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/broadcom/b44.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2.c+95−13

This diff is large: its 196 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+54−22

This diff is large: its 215 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+294−192

This diff is large: its 1162 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+142−42

This diff is large: its 385 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c+154−165

This diff is large: its 859 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_dump.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+211−99

This diff is large: its 819 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h+1−13

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_file_hdr.h+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h+34−28

This diff is large: its 187 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h+31−24

This diff is large: its 104 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+237−87

This diff is large: its 454 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h+3−3

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+497−477

This diff is large: its 2499 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h+15−6

This diff is large: its 89 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c+90−90

This diff is large: its 523 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h+20−6

This diff is large: its 83 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+155−277

This diff is large: its 625 lines aren’t shown here.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h+146−1

This diff is large: its 193 lines aren’t shown here.

drivers/net/ethernet/broadcom/cnic.c+38−4

This diff is large: its 90 lines aren’t shown here.

drivers/net/ethernet/broadcom/cnic_defs.h+14−13

This diff is large: its 90 lines aren’t shown here.

drivers/net/ethernet/broadcom/cnic_if.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/broadcom/sb1250-mac.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/broadcom/tg3.c+975−970

This diff is large: its 2543 lines aren’t shown here.

drivers/net/ethernet/broadcom/tg3.h+2−12

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bfa_cee.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bfa_defs.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bfa_ioc.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad_debugfs.c+3−18

This diff is large: its 66 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad_ethtool.c+42−0

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/cadence/at91_ether.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/cadence/macb.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/calxeda/xgmac.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb3/version.h+2−2

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/cirrus/cs89x0.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/cirrus/ep93xx_eth.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/cirrus/mac89x0.c+8−4

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/enic.h+2−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/enic_main.c+33−19

This diff is large: its 110 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/enic_pp.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/enic_res.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/vnic_dev.c+46−30

This diff is large: its 161 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/vnic_dev.h+2−1

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/vnic_devcmd.h+10−1

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/vnic_rq.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/vnic_wq.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/davicom/dm9000.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/dec/ewrk3.c+3−1

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/21142.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/de2104x.c+2−4

This diff is large: its 23 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/de4x5.c+3−7

This diff is large: its 31 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/dmfe.c+11−9

This diff is large: its 77 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/eeprom.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/interrupt.c+5−5

This diff is large: its 43 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/media.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/pnic.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/pnic2.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/timer.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/tulip.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/tulip_core.c+3−6

This diff is large: its 31 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/uli526x.c+12−9

This diff is large: its 78 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/winbond-840.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/xircom_cb.c+3−4

This diff is large: its 22 lines aren’t shown here.

drivers/net/ethernet/dlink/de600.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/dlink/de620.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/dlink/sundance.c+5−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/dnet.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be.h+75−36

This diff is large: its 280 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_cmds.c+205−40

This diff is large: its 372 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_cmds.h+116−21

This diff is large: its 220 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_ethtool.c+96−91

This diff is large: its 281 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_main.c+517−522

This diff is large: its 1838 lines aren’t shown here.

drivers/net/ethernet/ethoc.c+19−4

This diff is large: its 59 lines aren’t shown here.

drivers/net/ethernet/faraday/ftgmac100.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/faraday/ftmac100.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/fealnx.c+3−5

This diff is large: its 42 lines aren’t shown here.

drivers/net/ethernet/freescale/fec.c+3−18

This diff is large: its 41 lines aren’t shown here.

drivers/net/ethernet/freescale/fec_mpc52xx.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/freescale/fec_mpc52xx.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/fec.h+4−2

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c+24−8

This diff is large: its 110 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/mac-fec.c+6−3

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar.c+17−7

This diff is large: its 90 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar.h+1−4

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar_ethtool.c+2−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar_ptp.c+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar_sysfs.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/freescale/ucc_geth.c+260−200

This diff is large: its 517 lines aren’t shown here.

drivers/net/ethernet/fujitsu/at1700.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/fujitsu/eth16i.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/fujitsu/fmvj18x_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/hp/hp100.c+2−4

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/i825xx/3c505.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/3c507.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/3c523.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/3c527.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/i825xx/82596.c+3−5

This diff is large: its 42 lines aren’t shown here.

drivers/net/ethernet/i825xx/eepro.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/eexpress.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/ether1.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/lp486e.c+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/i825xx/ni52.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/sun3_82586.c+1−26

This diff is large: its 52 lines aren’t shown here.

drivers/net/ethernet/i825xx/znet.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/ibm/Kconfig+0−4

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/ibm/Makefile+0−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_ethtool.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_hw.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_main.c+1−2

This diff is large: its 15 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_phyp.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_phyp.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_qmr.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_qmr.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/core.c+31−6

This diff is large: its 92 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/core.h+12−3

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/debug.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/debug.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/emac.h+3−1

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/mal.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/mal.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/phy.c+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/phy.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/rgmii.c+2−5

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/rgmii.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/tah.c+2−5

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/tah.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/zmii.c+2−5

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/zmii.h+1−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/ibm/iseries_veth.c+0−1710

This diff is large: its 1711 lines aren’t shown here.

drivers/net/ethernet/icplus/ipg.c+0−4

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/intel/e100.c+73−11

This diff is large: its 233 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_hw.c+73−83

This diff is large: its 179 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_hw.h+10−0

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_main.c+236−13

This diff is large: its 331 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/80003es2lan.c+35−64

This diff is large: its 282 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/82571.c+64−83

This diff is large: its 348 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/Makefile+3−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/defines.h+10−1

This diff is large: its 39 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/e1000.h+23−29

This diff is large: its 161 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/ethtool.c+138−69

This diff is large: its 326 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/hw.h+10−3

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/ich8lan.c+207−226

This diff is large: its 1256 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/mac.crenamed from drivers/net/ethernet/intel/e1000e/lib.c+74−1058

This diff is large: its 1478 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/manage.c+367−0

This diff is large: its 368 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/netdev.c+420−302

This diff is large: its 1710 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/nvm.c+643−0

This diff is large: its 644 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/param.c+46−9

This diff is large: its 97 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/phy.c+136−191

This diff is large: its 890 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_defines.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb_ethtool.c+7−0

This diff is large: its 29 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb_main.c+41−3

This diff is large: its 126 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/defines.h+0−4

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/ethtool.c+10−9

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/igbvf.h+15−12

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/netdev.c+82−61

This diff is large: its 256 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/vf.c+2−5

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/intel/ixgb/ixgb.h+0−12

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/intel/ixgb/ixgb_ee.c+5−7

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/intel/ixgb/ixgb_main.c+3−5

This diff is large: its 23 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe.h+128−97

This diff is large: its 472 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c+5−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c+7−25

This diff is large: its 61 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c+64−5

This diff is large: its 108 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_common.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c+20−10

This diff is large: its 102 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+220−69

This diff is large: its 431 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c+55−34

This diff is large: its 155 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c+929−0

This diff is large: its 930 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+1308−1893

This diff is large: its 4394 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c+11−3

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h+8−3

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c+3−1

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+19−23

This diff is large: its 91 lines aren’t shown here.

drivers/net/ethernet/jme.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/korina.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/lantiq_etop.c+13−2

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/marvell/mv643xx_eth.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/marvell/pxa168_eth.c+8−10

This diff is large: its 63 lines aren’t shown here.

drivers/net/ethernet/marvell/skge.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/marvell/sky2.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/cmd.c+10−1

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_netdev.c+2−3

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_rx.c+9−15

This diff is large: its 106 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_tx.c+12−24

This diff is large: its 119 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/fw.c+0−10

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/main.c+1−3

This diff is large: its 15 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/mcg.c+14−24

This diff is large: its 132 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/mlx4.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+2−5

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/mr.c+2−79

This diff is large: its 123 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/port.c+6−6

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8695net.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8842.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8851.c+5−6

This diff is large: its 42 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8851.h+1−1

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8851_mll.c+5−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/micrel/ksz884x.c+4−4

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/microchip/enc28j60.c+3−6

This diff is large: its 43 lines aren’t shown here.

drivers/net/ethernet/mipsnet.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/myricom/myri10ge/myri10ge.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/natsemi/ibmlana.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/natsemi/macsonic.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/natsemi/natsemi.c+2−3

This diff is large: its 22 lines aren’t shown here.

drivers/net/ethernet/natsemi/sonic.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/neterion/s2io.c+4−5

This diff is large: its 44 lines aren’t shown here.

drivers/net/ethernet/netx-eth.c+2−3

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/nuvoton/w90p910_ether.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/nvidia/forcedeth.c+6−5

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/nxp/Kconfig+8−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/nxp/Makefile+1−0

This diff is large: its 2 lines aren’t shown here.

drivers/net/ethernet/nxp/lpc_eth.c+1604−0

This diff is large: its 1605 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/Kconfig+13−0

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h+13−0

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c+218−12

This diff is large: its 328 lines aren’t shown here.

drivers/net/ethernet/packetengines/hamachi.c+3−5

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/packetengines/yellowfin.c+5−8

This diff is large: its 48 lines aren’t shown here.

drivers/net/ethernet/pasemi/pasemi_mac.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic.h+436−5

This diff is large: its 503 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.c+224−72

This diff is large: its 406 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c+109−0

This diff is large: its 128 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_hdr.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c+632−5

This diff is large: its 676 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c+5−12

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c+109−29

This diff is large: its 320 lines aren’t shown here.

drivers/net/ethernet/qlogic/qla3xxx.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+5−9

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c+8−2

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+14−5

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlge/qlge.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlge/qlge_dbg.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlge/qlge_main.c+10−76

This diff is large: its 213 lines aren’t shown here.

drivers/net/ethernet/racal/ni5010.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/rdc/r6040.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/realtek/8139too.c+97−12

This diff is large: its 225 lines aren’t shown here.

drivers/net/ethernet/realtek/Kconfig+5−5

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/realtek/atp.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/realtek/r8169.c+1903−1831

This diff is large: its 4591 lines aren’t shown here.

drivers/net/ethernet/renesas/sh_eth.c+385−54

This diff is large: its 628 lines aren’t shown here.

drivers/net/ethernet/renesas/sh_eth.h+14−1

This diff is large: its 50 lines aren’t shown here.

drivers/net/ethernet/s6gmac.c+8−7

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/seeq/ether3.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/seeq/seeq8005.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/seeq/sgiseeq.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/sfc/Kconfig+18−3

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/sfc/Makefile+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/sfc/bitfield.h+11−11

This diff is large: its 61 lines aren’t shown here.

drivers/net/ethernet/sfc/efx.c+535−396

This diff is large: its 1693 lines aren’t shown here.

drivers/net/ethernet/sfc/efx.h+9−2

This diff is large: its 33 lines aren’t shown here.

drivers/net/ethernet/sfc/ethtool.c+108−92

This diff is large: its 316 lines aren’t shown here.

drivers/net/ethernet/sfc/falcon.c+28−26

This diff is large: its 188 lines aren’t shown here.

drivers/net/ethernet/sfc/falcon_boards.c+6−19

This diff is large: its 102 lines aren’t shown here.

drivers/net/ethernet/sfc/falcon_xmac.c+4−11

This diff is large: its 51 lines aren’t shown here.

drivers/net/ethernet/sfc/filter.c+223−32

This diff is large: its 426 lines aren’t shown here.

drivers/net/ethernet/sfc/filter.h+19−1

This diff is large: its 68 lines aren’t shown here.

drivers/net/ethernet/sfc/mac.h+0−21

This diff is large: its 22 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi.c+82−67

This diff is large: its 269 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi.h+35−1

This diff is large: its 75 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi_mac.c+25−40

This diff is large: its 123 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi_mon.c+415−0

This diff is large: its 416 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi_pcol.h+2085−1457

This diff is large: its 3732 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi_phy.c+18−18

This diff is large: its 113 lines aren’t shown here.

drivers/net/ethernet/sfc/mdio_10g.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sfc/mtd.c+7−8

This diff is large: its 59 lines aren’t shown here.

drivers/net/ethernet/sfc/net_driver.h+190−135

This diff is large: its 668 lines aren’t shown here.

drivers/net/ethernet/sfc/nic.c+347−255

This diff is large: its 929 lines aren’t shown here.

drivers/net/ethernet/sfc/nic.h+126−15

This diff is large: its 216 lines aren’t shown here.

drivers/net/ethernet/sfc/qt202x_phy.c+3−3

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/sfc/regs.h+10−10

This diff is large: its 46 lines aren’t shown here.

drivers/net/ethernet/sfc/rx.c+68−65

This diff is large: its 333 lines aren’t shown here.

drivers/net/ethernet/sfc/selftest.c+144−74

This diff is large: its 347 lines aren’t shown here.

drivers/net/ethernet/sfc/selftest.h+3−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/sfc/siena.c+31−19

This diff is large: its 124 lines aren’t shown here.

drivers/net/ethernet/sfc/siena_sriov.c+1643−0

This diff is large: its 1644 lines aren’t shown here.

drivers/net/ethernet/sfc/spi.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sfc/tenxpress.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sfc/tx.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/sfc/txc43128_phy.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sfc/vfdi.h+255−0

This diff is large: its 256 lines aren’t shown here.

drivers/net/ethernet/sis/sis190.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sis/sis900.c+4−5

This diff is large: its 44 lines aren’t shown here.

drivers/net/ethernet/smsc/epic100.c+5−6

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/smsc/smc911x.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/smsc/smc9194.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/smsc/smc91c92_cs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/smsc/smc91x.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/ethernet/smsc/smsc911x.c+2−2

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/smsc/smsc9420.c+3−8

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+4−7

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+72−2

This diff is large: its 118 lines aren’t shown here.

drivers/net/ethernet/sun/cassini.c+1−3

This diff is large: its 25 lines aren’t shown here.

drivers/net/ethernet/sun/niu.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/sun/sunbmac.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sun/sungem.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/sun/sunhme.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sun/sunqe.c+3−9

This diff is large: its 26 lines aren’t shown here.

drivers/net/ethernet/sun/sunvnet.c+4−9

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/tehuti/tehuti.c+3−5

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/ti/Kconfig+11−0

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/ti/Makefile+2−0

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/ti/cpmac.c+1−4

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw.c+1019−0

This diff is large: its 1020 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw_ale.c+641−0

This diff is large: its 642 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw_ale.h+93−0

This diff is large: its 94 lines aren’t shown here.

drivers/net/ethernet/ti/davinci_cpdma.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/ti/davinci_emac.c+5−6

This diff is large: its 48 lines aren’t shown here.

drivers/net/ethernet/ti/davinci_mdio.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/ti/tlan.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/tile/tilepro.c+5−4

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/toshiba/ps3_gelic_wireless.c+2−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/toshiba/tc35815.c+4−5

This diff is large: its 31 lines aren’t shown here.

drivers/net/ethernet/tundra/tsi108_eth.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/via/via-rhine.c+1−4

This diff is large: its 33 lines aren’t shown here.

drivers/net/ethernet/via/via-velocity.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/xilinx/Kconfig+8−0

This diff is large: its 15 lines aren’t shown here.

drivers/net/ethernet/xilinx/Makefile+2−0

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/xilinx/ll_temac_main.c+5−4

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_axienet.h+508−0

This diff is large: its 509 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+1669−0

This diff is large: its 1670 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c+238−0

This diff is large: its 239 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_emaclite.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/xircom/xirc2ps_cs.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/xscale/ixp2000/ixpdev.c+2−5

This diff is large: its 14 lines aren’t shown here.

drivers/net/hamradio/baycom_epp.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/hamradio/baycom_par.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/hamradio/yam.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/hippi/rrunner.c+1−7

This diff is large: its 23 lines aren’t shown here.

drivers/net/hyperv/hyperv_net.h+33−1

This diff is large: its 50 lines aren’t shown here.

drivers/net/hyperv/netvsc.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/hyperv/netvsc_drv.c+9−11

This diff is large: its 67 lines aren’t shown here.

drivers/net/hyperv/rndis_filter.c+101−58

This diff is large: its 272 lines aren’t shown here.

drivers/net/ifb.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/irda/ali-ircc.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/irda/donauboe.c+0−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/irda/pxaficp_ir.c+3−3

This diff is large: its 24 lines aren’t shown here.

drivers/net/irda/via-ircc.c+2−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/irda/w83977af_ir.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/macvlan.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/mdio.c+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/mii.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/netconsole.c+2−6

This diff is large: its 24 lines aren’t shown here.

drivers/net/phy/Kconfig+5−0

This diff is large: its 12 lines aren’t shown here.

drivers/net/phy/Makefile+1−0

This diff is large: its 5 lines aren’t shown here.

drivers/net/phy/amd.c+102−0

This diff is large: its 103 lines aren’t shown here.

drivers/net/phy/broadcom.c+2−4

This diff is large: its 20 lines aren’t shown here.

drivers/net/phy/dp83640.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/plip/plip.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ppp/ppp_async.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ppp/ppp_deflate.c+4−26

This diff is large: its 39 lines aren’t shown here.

drivers/net/ppp/ppp_generic.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ppp/ppp_synctty.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ppp/pppoe.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ppp/pppox.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ppp/pptp.c+3−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/rionet.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/slip/slip.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/team/team.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/tokenring/3c359.c+0−4

This diff is large: its 16 lines aren’t shown here.

drivers/net/tokenring/madgemc.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/tokenring/tms380tr.c+67−112

This diff is large: its 210 lines aren’t shown here.

drivers/net/tun.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/usb/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/usb/asix.c+20−68

This diff is large: its 117 lines aren’t shown here.

drivers/net/usb/cdc_ncm.c+115−121

This diff is large: its 472 lines aren’t shown here.

drivers/net/usb/kaweth.c+1−7

This diff is large: its 15 lines aren’t shown here.

drivers/net/usb/mcs7830.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/usb/pegasus.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/usb/rtl8150.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/usb/smsc75xx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/usb/smsc95xx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/usb/usbnet.c+2−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/veth.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/virtio_net.c+4−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/vmxnet3/vmxnet3_drv.c+26−37

This diff is large: its 160 lines aren’t shown here.

drivers/net/wan/c101.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/wan/dscc4.c+2−6

This diff is large: its 24 lines aren’t shown here.

drivers/net/wan/hdlc_fr.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wan/hdlc_raw_eth.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wan/lmc/lmc_main.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wan/n2.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/wan/pc300too.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wan/pci200syn.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wan/wanxl.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wan/x25_asy.c+1−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/airo.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath.h+11−15

This diff is large: its 48 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/ahb.c+10−10

This diff is large: its 52 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/ani.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/ath5k.h+3−2

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/base.c+10−15

This diff is large: its 68 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/mac80211-ops.c+12−0

This diff is large: its 33 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/phy.c+9−25

This diff is large: its 41 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/reset.c+5−5

This diff is large: its 20 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/Kconfig+21−4

This diff is large: its 34 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/Makefile+19−14

This diff is large: its 43 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/bmi.c+12−5

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/bmi.h+24−0

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/cfg80211.c+698−304

This diff is large: its 1545 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/cfg80211.h+9−4

This diff is large: its 34 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/common.h+1−3

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/core.c+299−0

This diff is large: its 300 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/core.h+132−37

This diff is large: its 396 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/debug.c+260−171

This diff is large: its 662 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/debug.h+13−25

This diff is large: its 78 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/hif-ops.h+1−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/hif.c+19−8

This diff is large: its 104 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/hif.h+4−0

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/htc.c+155−58

This diff is large: its 467 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/htc.h+15−1

This diff is large: its 60 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/init.c+262−374

This diff is large: its 1051 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/main.c+204−30

This diff is large: its 388 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/sdio.c+131−52

This diff is large: its 365 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/target.h+2−0

This diff is large: its 15 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/testmode.c+18−85

This diff is large: its 149 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/testmode.h+4−3

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/txrx.c+444−148

This diff is large: its 968 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/usb.c+432−0

This diff is large: its 433 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/wmi.c+312−139

This diff is large: its 771 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/wmi.h+77−13

This diff is large: its 239 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/Kconfig+16−8

This diff is large: its 45 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/Makefile+5−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ani.c+3−3

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar5008_phy.c+6−15

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9001_initvals.h+0−270

This diff is large: its 291 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9002_hw.c+50−99

This diff is large: its 248 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9002_initvals.h+0−104

This diff is large: its 132 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9002_mac.c+1−4

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9002_phy.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h+0−302

This diff is large: its 316 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_calib.c+4−38

This diff is large: its 63 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_eeprom.c+0−4

This diff is large: its 11 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_hw.c+16−97

This diff is large: its 215 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mac.c+22−52

This diff is large: its 157 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mac.h+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mci.c+578−672

This diff is large: its 1828 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mci.h+233−0

This diff is large: its 238 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_phy.c+18−16

This diff is large: its 65 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_phy.h+13−10

This diff is large: its 44 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9462_1p0_initvals.h+0−1833

This diff is large: its 1834 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h+0−465

This diff is large: its 505 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ath9k.h+41−18

This diff is large: its 104 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/beacon.c+4−10

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/btcoex.c+57−20

This diff is large: its 134 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/btcoex.h+2−2

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/debug.c+155−245

This diff is large: its 558 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/debug.h+15−12

This diff is large: its 62 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/gpio.c+114−10

This diff is large: its 159 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hif_usb.c+100−56

This diff is large: its 248 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hif_usb.h+2−1

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc.h+18−3

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_gpio.c+61−12

This diff is large: its 113 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_init.c+3−31

This diff is large: its 62 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_main.c+18−13

This diff is large: its 59 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_hst.c+1−4

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hw-ops.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hw.c+110−213

This diff is large: its 479 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hw.h+23−201

This diff is large: its 302 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/init.c+8−79

This diff is large: its 141 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mac.c+17−25

This diff is large: its 85 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mac.h+1−3

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/main.c+16−80

This diff is large: its 238 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mci.c+81−209

This diff is large: its 557 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mci.h+2−3

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/rc.c+9−11

This diff is large: its 71 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/rc.h+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/recv.c+33−37

This diff is large: its 164 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/reg.h+1−5

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/xmit.c+29−30

This diff is large: its 139 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/carl9170.h+1−1

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/fw.c+0−33

This diff is large: its 40 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/mac.c+35−0

This diff is large: its 39 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/main.c+9−9

This diff is large: its 46 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/phy.c+6−30

This diff is large: its 63 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/tx.c+3−1

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/ath/main.c+7−2

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/atmel.c+2−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/b43/b43.h+15−0

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/b43/main.c+53−75

This diff is large: its 282 lines aren’t shown here.

drivers/net/wireless/b43/phy_n.c+427−105

This diff is large: its 668 lines aren’t shown here.

drivers/net/wireless/b43/phy_n.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/b43/tables_nphy.c+64−12

This diff is large: its 162 lines aren’t shown here.

drivers/net/wireless/b43/tables_nphy.h+4−10

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/b43legacy/b43legacy.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/b43legacy/main.c+20−13

This diff is large: its 81 lines aren’t shown here.

drivers/net/wireless/b43legacy/phy.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/Kconfig+13−4

This diff is large: its 30 lines aren’t shown here.

drivers/net/wireless/brcm80211/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/Makefile+4−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c+9−10

This diff is large: its 71 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd.h+2−2

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h+15−2

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c+10−7

This diff is large: its 62 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h+13−7

This diff is large: its 50 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c+52−19

This diff is large: its 134 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c+105−159

This diff is large: its 658 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/usb.c+1621−0

This diff is large: its 1622 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/usb.h+61−0

This diff is large: its 62 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/usb_rdl.h+75−0

This diff is large: its 76 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c+14−15

This diff is large: its 125 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h+18−18

This diff is large: its 82 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/aiutils.c+2−2

This diff is large: its 14 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/ampdu.c+10−12

This diff is large: its 54 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/dma.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+31−24

This diff is large: its 140 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/main.c+92−107

This diff is large: its 365 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/main.h+4−2

This diff is large: its 15 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c+8−27

This diff is large: its 114 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/srom.c+12−2

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmutil/utils.c+23−3

This diff is large: its 48 lines aren’t shown here.

drivers/net/wireless/brcm80211/include/brcmu_utils.h+13−2

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/hostap/hostap_hw.c+6−12

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/ipw2x00/ipw2100.c+38−70

This diff is large: its 151 lines aren’t shown here.

drivers/net/wireless/ipw2x00/ipw2200.h+0−14

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/ipw2x00/libipw_module.c+2−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ipw2x00/libipw_rx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945-debug.c+6−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945-mac.c+125−161

This diff is large: its 780 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945-rs.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945.c+101−127

This diff is large: its 498 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945.h+4−10

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965-calib.c+11−25

This diff is large: its 91 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965-debug.c+6−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965-mac.c+680−378

This diff is large: its 2100 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965-rs.c+15−33

This diff is large: its 191 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965.c+125−573

This diff is large: its 999 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965.h+13−30

This diff is large: its 115 lines aren’t shown here.

drivers/net/wireless/iwlegacy/Kconfig+39−39

This diff is large: its 89 lines aren’t shown here.

This diff is larger than a page shows: the files after these aren’t listed. Clone the repository to see all of it.