1
0

patch-tn7atm_c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. --- sangam-atm-1.0.orig/tn7atm.c 2007-05-18 09:45:50.000000000 +0200
  2. +++ sangam-atm-1.0/tn7atm.c 2009-12-17 19:10:27.616421480 +0100
  3. @@ -61,7 +61,6 @@
  4. * UR8_MERGE_END CQ11057*
  5. *********************************************************************************************/
  6. -#include <linux/config.h>
  7. #include <linux/kernel.h>
  8. #include <linux/module.h>
  9. #include <linux/init.h>
  10. @@ -69,11 +68,20 @@
  11. #include <linux/delay.h>
  12. #include <linux/spinlock.h>
  13. #include <linux/smp_lock.h>
  14. -#include <asm/io.h>
  15. -#include <asm/mips-boards/prom.h>
  16. #include <linux/proc_fs.h>
  17. #include <linux/string.h>
  18. #include <linux/ctype.h>
  19. +#include <linux/version.h>
  20. +
  21. +#include <asm/io.h>
  22. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
  23. +#include <asm/ar7/ar7.h>
  24. +#include <asm/ar7/prom.h>
  25. +#else
  26. +#include <asm/mach-ar7/ar7.h>
  27. +#include <asm/mach-ar7/prom.h>
  28. +#endif
  29. +
  30. #include "dsl_hal_api.h"
  31. #include "tn7atm.h"
  32. #include "tn7api.h"
  33. @@ -82,8 +90,149 @@
  34. #include "dsl_hal_register.h"
  35. #ifdef MODULE
  36. +MODULE_LICENSE("GPL");
  37. MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver");
  38. MODULE_AUTHOR ("Zhicheng Tang");
  39. +
  40. +int mp_sar_ipacemax = -1;
  41. +module_param_named(ipacemax, mp_sar_ipacemax, int, 0);
  42. +MODULE_PARM_DESC(ipacemax, "Interrupt pacing");
  43. +
  44. +char *mp_macc = NULL;
  45. +module_param_named(macc, mp_macc, charp, 0);
  46. +MODULE_PARM_DESC(macc, "MAC address");
  47. +
  48. +int mp_dsp_noboost = -1;
  49. +module_param_named(dsp_noboost, mp_dsp_noboost, int, 0);
  50. +MODULE_PARM_DESC(dsp_noboost, "Suppress DSP frequency boost");
  51. +
  52. +int mp_dsp_freq = -1;
  53. +module_param_named(dsp_freq, mp_dsp_freq, int, 0);
  54. +MODULE_PARM_DESC(dsp_freq, "Frequency to boost the DSP to");
  55. +
  56. +char *mp_featctl0 = NULL;
  57. +module_param_named(featctl0, mp_featctl0, charp, 0);
  58. +MODULE_PARM_DESC(featctl0, "DSL feature control 0");
  59. +
  60. +char *mp_featctl1 = NULL;
  61. +module_param_named(featctl1, mp_featctl1, charp, 0);
  62. +MODULE_PARM_DESC(featctl1, "DSL feature control 1");
  63. +
  64. +char *mp_phyctl0 = NULL;
  65. +module_param_named(phyctl0, mp_phyctl0, charp, 0);
  66. +MODULE_PARM_DESC(phyctl0, "DSL PHY control 0");
  67. +
  68. +char *mp_phyctl1 = NULL;
  69. +module_param_named(phyctl1, mp_phyctl1, charp, 0);
  70. +MODULE_PARM_DESC(phyctl1, "DSL PHY control 1");
  71. +
  72. +int mp_turbodsl = -1;
  73. +module_param_named(turbodsl, mp_turbodsl, int, 0);
  74. +MODULE_PARM_DESC(turbodsl, "Enable TurboDSL");
  75. +
  76. +int mp_sar_rxbuf = -1;
  77. +module_param_named(sar_rxbuf, mp_sar_rxbuf, int, 0);
  78. +MODULE_PARM_DESC(sar_rxbuf, "SAR RxBuf size");
  79. +
  80. +int mp_sar_rxmax = -1;
  81. +module_param_named(sar_rxmax, mp_sar_rxmax, int, 0);
  82. +MODULE_PARM_DESC(sar_rxmax, "SAR RxMax size");
  83. +
  84. +int mp_sar_txbuf = -1;
  85. +module_param_named(sar_txbuf, mp_sar_txbuf, int, 0);
  86. +MODULE_PARM_DESC(sar_txbuf, "SAR TxBuf size");
  87. +
  88. +int mp_sar_txmax = -1;
  89. +module_param_named(sar_txmax, mp_sar_txmax, int, 0);
  90. +MODULE_PARM_DESC(sar_txmax, "SAR TxMax size");
  91. +
  92. +char *mp_modulation = NULL;
  93. +module_param_named(modulation, mp_modulation, charp, 0);
  94. +MODULE_PARM_DESC(modulation, "Modulation");
  95. +
  96. +int mp_fine_gain_control = -1;
  97. +module_param_named(fine_gain_control, mp_fine_gain_control, int, 0);
  98. +MODULE_PARM_DESC(fine_gain_control, "Fine gain control");
  99. +
  100. +int mp_fine_gain_value = -1;
  101. +module_param_named(fine_gain_value, mp_fine_gain_value, int, 0);
  102. +MODULE_PARM_DESC(fine_gain_value, "Fine gain value");
  103. +
  104. +int mp_enable_margin_retrain = -1;
  105. +module_param_named(enable_margin_retrain, mp_enable_margin_retrain, int, 0);
  106. +MODULE_PARM_DESC(enable_margin_retrain, "Enable margin retrain");
  107. +
  108. +int mp_margin_threshold = -1;
  109. +module_param_named(margin_threshold, mp_margin_threshold, int, 0);
  110. +MODULE_PARM_DESC(margin_threshold, "Margin retrain treshold");
  111. +
  112. +int mp_enable_rate_adapt = -1;
  113. +module_param_named(enable_rate_adapt, mp_enable_rate_adapt, int, 0);
  114. +MODULE_PARM_DESC(enable_rate_adapt, "Enable rate adaption");
  115. +
  116. +int mp_powercutback = -1;
  117. +module_param_named(powercutback, mp_powercutback, int, 0);
  118. +MODULE_PARM_DESC(powercutback, "Enable / disable powercutback");
  119. +
  120. +int mp_trellis = -1;
  121. +module_param_named(trellis, mp_trellis, int, 0);
  122. +MODULE_PARM_DESC(trellis, "Enable / disable trellis coding");
  123. +
  124. +int mp_bitswap = -1;
  125. +module_param_named(bitswap, mp_bitswap, int, 0);
  126. +MODULE_PARM_DESC(bitswap, "Enable / disable bitswap");
  127. +
  128. +int mp_maximum_bits_per_carrier = -1;
  129. +module_param_named(maximum_bits_per_carrier, mp_maximum_bits_per_carrier, int, 0);
  130. +MODULE_PARM_DESC(maximum_bits_per_carrier, "Maximum bits per carrier");
  131. +
  132. +int mp_maximum_interleave_depth = -1;
  133. +module_param_named(maximum_interleave_depth, mp_maximum_interleave_depth, int, 0);
  134. +MODULE_PARM_DESC(maximum_interleave_depth, "Maximum interleave depth");
  135. +
  136. +int mp_pair_selection = -1;
  137. +module_param_named(pair_selection, mp_pair_selection, int, 0);
  138. +MODULE_PARM_DESC(pair_selection, "Pair selection");
  139. +
  140. +int mp_dgas_polarity = -1;
  141. +module_param_named(dgas_polarity, mp_dgas_polarity, int, 0);
  142. +MODULE_PARM_DESC(dgas_polarity, "DGAS polarity");
  143. +
  144. +int mp_los_alarm = -1;
  145. +module_param_named(los_alarm, mp_los_alarm, int, 0);
  146. +MODULE_PARM_DESC(los_alarm, "LOS alarm");
  147. +
  148. +char *mp_eoc_vendor_id = NULL;
  149. +module_param_named(eoc_vendor_id, mp_eoc_vendor_id, charp, 0);
  150. +MODULE_PARM_DESC(eoc_vendor_id, "EOC vendor id");
  151. +
  152. +int mp_eoc_vendor_revision = -1;
  153. +module_param_named(eoc_vendor_revision, mp_eoc_vendor_revision, int, 0);
  154. +MODULE_PARM_DESC(eoc_vendor_revision, "EOC vendor revision");
  155. +
  156. +char *mp_eoc_vendor_serialnum = NULL;
  157. +module_param_named(eoc_vendor_serialnum, mp_eoc_vendor_serialnum, charp, 0);
  158. +MODULE_PARM_DESC(eoc_vendor_serialnum, "EOC vendor serial number");
  159. +
  160. +char *mp_invntry_vernum = NULL;
  161. +module_param_named(invntry_vernum, mp_invntry_vernum, charp, 0);
  162. +MODULE_PARM_DESC(invntry_vernum, "Inventory revision number");
  163. +
  164. +int mp_dsl_bit_tmode = -1;
  165. +module_param_named(dsl_bit_tmode, mp_dsl_bit_tmode, int, 0);
  166. +MODULE_PARM_DESC(dsl_bit_tmode, "DSL bit training mode");
  167. +
  168. +int mp_high_precision = -1;
  169. +module_param_named(high_precision, mp_high_precision, int, 0);
  170. +MODULE_PARM_DESC(high_precision, "High precision");
  171. +
  172. +int mp_autopvc_enable = -1;
  173. +module_param_named(autopvc_enable, mp_autopvc_enable, int, 0);
  174. +MODULE_PARM_DESC(autopvc_enable, "Enable / disable automatic PVC");
  175. +
  176. +int mp_oam_lb_timeout = -1;
  177. +module_param_named(oam_lb_timeout, mp_oam_lb_timeout, int, 0);
  178. +MODULE_PARM_DESC(oam_lb_timeout, "OAM LB timeout");
  179. #endif
  180. #ifndef TRUE
  181. @@ -100,9 +249,9 @@ MODULE_AUTHOR ("Zhicheng Tang");
  182. /*end of externs */
  183. -#ifndef TI_STATIC_ALLOCATIONS
  184. -#define TI_STATIC_ALLOCATIONS
  185. -#endif
  186. +//#ifndef TI_STATIC_ALLOCATIONS
  187. +//#define TI_STATIC_ALLOCATIONS
  188. +//#endif
  189. #define tn7atm_kfree_skb(x) dev_kfree_skb(x)
  190. @@ -114,7 +263,7 @@ static int EnableQoS = FALSE;
  191. /* prototypes */
  192. static int tn7atm_set_can_support_adsl2 (int can);
  193. -static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci);
  194. +static int tn7atm_open (struct atm_vcc *vcc);
  195. static void tn7atm_close (struct atm_vcc *vcc);
  196. @@ -257,13 +406,12 @@ static const struct atmdev_ops tn7atm_op
  197. getsockopt: NULL,
  198. setsockopt: NULL,
  199. send: tn7atm_send,
  200. - sg_send: NULL,
  201. phy_put: NULL,
  202. phy_get: NULL,
  203. change_qos: tn7atm_change_qos,
  204. };
  205. -const char drv_proc_root_folder[] = "avalanche/";
  206. +const char drv_proc_root_folder[] = "avalanche";
  207. static struct proc_dir_entry *root_proc_dir_entry = NULL;
  208. #define DRV_PROC_MODE 0644
  209. static int proc_root_already_exists = TRUE;
  210. @@ -559,62 +707,12 @@ static int turbodsl_check_priority_type(
  211. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212. *
  213. - * Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci)
  214. - *
  215. - * Description: retrieve VPI/VCI for connection
  216. - *
  217. - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  218. -static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci)
  219. -{
  220. - struct atm_vcc *walk;
  221. -
  222. - /*
  223. - * find a free VPI
  224. - */
  225. - if (*vpi == ATM_VPI_ANY)
  226. - {
  227. -
  228. - for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next)
  229. - {
  230. -
  231. - if ((walk->vci == *vci) && (walk->vpi == *vpi))
  232. - {
  233. - (*vpi)++;
  234. - walk = vcc->dev->vccs;
  235. - }
  236. - }
  237. - }
  238. -
  239. - /*
  240. - * find a free VCI
  241. - */
  242. - if (*vci == ATM_VCI_ANY)
  243. - {
  244. -
  245. - for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk;
  246. - walk = walk->next)
  247. - {
  248. -
  249. - if ((walk->vpi = *vpi) && (walk->vci == *vci))
  250. - {
  251. - *vci = walk->vci + 1;
  252. - walk = vcc->dev->vccs;
  253. - }
  254. - }
  255. - }
  256. -
  257. - return 0;
  258. -}
  259. -
  260. -
  261. -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  262. - *
  263. * Function: int tn7atm_sar_irq(void)
  264. *
  265. * Description: tnetd73xx SAR interrupt.
  266. *
  267. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  268. -static void tn7atm_sar_irq (int irq, void *voiddev, struct pt_regs *regs)
  269. +static irqreturn_t tn7atm_sar_irq (int irq, void *voiddev)
  270. {
  271. struct atm_dev *atmdev;
  272. Tn7AtmPrivate *priv;
  273. @@ -641,6 +739,7 @@ static void tn7atm_sar_irq (int irq, voi
  274. #ifdef TIATM_INST_SUPP
  275. psp_trace_par (ATM_DRV_SAR_ISR_EXIT, retval);
  276. #endif
  277. + return IRQ_HANDLED;
  278. }
  279. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  280. @@ -650,7 +749,7 @@ static void tn7atm_sar_irq (int irq, voi
  281. * Description: tnetd73xx DSL interrupt.
  282. *
  283. *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  284. -static void tn7atm_dsl_irq (int irq, void *voiddev, struct pt_regs *regs)
  285. +static irqreturn_t tn7atm_dsl_irq (int irq, void *voiddev)
  286. {
  287. struct atm_dev *atmdev;
  288. Tn7AtmPrivate *priv;
  289. @@ -672,6 +771,8 @@ static void tn7atm_dsl_irq (int irq, voi
  290. #ifdef TIATM_INST_SUPP
  291. psp_trace_par (ATM_DRV_DSL_ISR_EXIT, retval);
  292. #endif
  293. +
  294. + return IRQ_HANDLED;
  295. }
  296. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  297. @@ -693,25 +794,25 @@ static int __init tn7atm_irq_request (st
  298. * Register SAR interrupt
  299. */
  300. priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */
  301. - if (request_irq (priv->sar_irq, tn7atm_sar_irq, SA_INTERRUPT, "SAR ", dev))
  302. + if (request_irq (priv->sar_irq, tn7atm_sar_irq, IRQF_DISABLED, "SAR ", dev))
  303. printk ("Could not register tn7atm_sar_irq\n");
  304. /*
  305. * interrupt pacing
  306. */
  307. ptr = prom_getenv ("sar_ipacemax");
  308. - if (ptr)
  309. + if (ptr || mp_sar_ipacemax != -1)
  310. {
  311. - def_sar_inter_pace = os_atoi (ptr);
  312. + def_sar_inter_pace = mp_sar_ipacemax == -1 ? os_atoi (ptr) : mp_sar_ipacemax;
  313. }
  314. - avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM,
  315. - def_sar_inter_pace);
  316. +/* avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM,
  317. + def_sar_inter_pace);*/
  318. /*
  319. * Reigster Receive interrupt A
  320. */
  321. priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */
  322. - if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, SA_INTERRUPT, "DSL ", dev))
  323. + if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, IRQF_DISABLED, "DSL ", dev))
  324. printk ("Could not register tn7atm_dsl_irq\n");
  325. /***** VRB Tasklet Mode ****/
  326. @@ -842,7 +943,7 @@ static int __init tn7atm_get_ESI (struct
  327. char esi_addr[ESI_LEN] = { 0x00, 0x00, 0x11, 0x22, 0x33, 0x44 };
  328. char *esiaddr_str = NULL;
  329. - esiaddr_str = prom_getenv ("maca");
  330. + esiaddr_str = mp_macc ? mp_macc : prom_getenv ("maca");
  331. if (!esiaddr_str)
  332. {
  333. @@ -875,11 +976,15 @@ static int __init tn7atm_get_ESI (struct
  334. #define ATM_VBR_RT 5
  335. #endif
  336. -int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci)
  337. +int tn7atm_open (struct atm_vcc *vcc)
  338. {
  339. tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm;
  340. int rc;
  341. //int flags;
  342. + tn7atm_activate_vc_parm.pcr = 0x20000;
  343. + tn7atm_activate_vc_parm.scr = 0x20000;
  344. + tn7atm_activate_vc_parm.mbs = 0x20000;
  345. + tn7atm_activate_vc_parm.cdvt = 10000;
  346. dgprintf(1, "tn7atm_open()\n");
  347. @@ -891,24 +996,18 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  348. return -1;
  349. }
  350. - MOD_INC_USE_COUNT;
  351. -
  352. - /* find a free VPI/VCI */
  353. - tn7atm_walk_vccs(vcc, &vpi, &vci);
  354. -
  355. - vcc->vpi = vpi;
  356. - vcc->vci = vci;
  357. +// MOD_INC_USE_COUNT;
  358. - if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC))
  359. + if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC))
  360. {
  361. - MOD_DEC_USE_COUNT;
  362. +// MOD_DEC_USE_COUNT;
  363. return -EBUSY;
  364. }
  365. - tn7atm_activate_vc_parm.vpi = vpi;
  366. - tn7atm_activate_vc_parm.vci = vci;
  367. + tn7atm_activate_vc_parm.vpi = vcc->vpi;
  368. + tn7atm_activate_vc_parm.vci = vcc->vci;
  369. - if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI))
  370. + if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI))
  371. {
  372. /* always use (max_dma_chan+1) for clear eoc */
  373. tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN;
  374. @@ -916,7 +1015,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  375. /* check to see whether clear eoc is opened or not */
  376. if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse)
  377. {
  378. - MOD_DEC_USE_COUNT;
  379. +// MOD_DEC_USE_COUNT;
  380. printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan);
  381. return -EBUSY;
  382. }
  383. @@ -925,7 +1024,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  384. if (rc)
  385. {
  386. printk("tn7atm_open: failed to setup clear_eoc\n");
  387. - MOD_DEC_USE_COUNT;
  388. +// MOD_DEC_USE_COUNT;
  389. return -EBUSY;
  390. }
  391. tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan);
  392. @@ -934,17 +1033,17 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  393. }
  394. else /* PVC channel setup */
  395. {
  396. - if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI))
  397. + if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI))
  398. {
  399. tn7atm_activate_vc_parm.chan = 14; /* always use chan 14 for MII PVC-base romote mgmt */
  400. }
  401. else
  402. {
  403. - rc = tn7atm_lut_find(vpi, vci);
  404. + rc = tn7atm_lut_find(vcc->vpi, vcc->vci);
  405. /* check to see whether PVC is opened or not */
  406. if(ATM_NO_DMA_CHAN != rc)
  407. {
  408. - MOD_DEC_USE_COUNT;
  409. +// MOD_DEC_USE_COUNT;
  410. printk("PVC already opened. dmachan = %d\n", rc);
  411. return -EBUSY;
  412. }
  413. @@ -976,6 +1075,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  414. tn7atm_activate_vc_parm.priority = 2;
  415. break;
  416. +#if 0
  417. case ATM_VBR: /* Variable Bit Rate-Non RealTime*/
  418. tn7atm_activate_vc_parm.qos = 1;
  419. tn7atm_activate_vc_parm.priority = 1;
  420. @@ -997,6 +1097,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  421. tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr;
  422. tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv;
  423. break;
  424. +#endif
  425. default:
  426. tn7atm_activate_vc_parm.qos = 2;
  427. @@ -1024,7 +1125,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  428. if (rc < 0)
  429. {
  430. printk("failed to activate hw channel\n");
  431. - MOD_DEC_USE_COUNT;
  432. +// MOD_DEC_USE_COUNT;
  433. tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan);
  434. //spin_unlock_irqrestore(&chan_init_lock, flags);
  435. return -EBUSY;
  436. @@ -1114,7 +1215,7 @@ void tn7atm_close (struct atm_vcc *vcc)
  437. tn7atm_lut_clear (vcc, dmachan);
  438. //spin_unlock_irqrestore (&closeLock, closeFlag);
  439. - MOD_DEC_USE_COUNT;
  440. +// MOD_DEC_USE_COUNT;
  441. dgprintf (1, "Leave tn7atm_close\n");
  442. }
  443. @@ -1528,8 +1629,7 @@ int tn7atm_receive (void *os_dev, int ch
  444. * firewall is on */
  445. dgprintf (3, "pushing the skb...\n");
  446. -
  447. - skb->stamp = vcc->timestamp = xtime;
  448. + __net_timestamp(skb);
  449. xdump ((unsigned char *) skb->data, skb->len, 5);
  450. @@ -1725,8 +1825,7 @@ static void tn7atm_exit (void)
  451. kfree (dev->dev_data);
  452. - // atm_dev_deregister (dev);
  453. - shutdown_atm_dev (dev);
  454. + atm_dev_deregister (dev);
  455. /*
  456. * remove proc entries
  457. @@ -1885,9 +1984,6 @@ static int __init tn7atm_detect (void)
  458. /*
  459. * Set up proc entry for atm stats
  460. */
  461. - if (tn7atm_xlate_proc_name
  462. - (drv_proc_root_folder, &root_proc_dir_entry, &residual))
  463. - {
  464. printk ("Creating new root folder %s in the proc for the driver stats \n",
  465. drv_proc_root_folder);
  466. root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL);
  467. @@ -1897,7 +1993,6 @@ static int __init tn7atm_detect (void)
  468. return -ENOMEM;
  469. }
  470. proc_root_already_exists = FALSE;
  471. - }
  472. /*
  473. * AV: Clean-up. Moved all the definitions to the data structure.
  474. @@ -1981,15 +2076,15 @@ static int tn7atm_autoDetectDspBoost (vo
  475. //UR8_MERGE_END CQ10450*
  476. cp = prom_getenv ("dsp_noboost");
  477. - if (cp)
  478. + if (cp || mp_dsp_noboost != -1)
  479. {
  480. - dsp_noboost = os_atoi (cp);
  481. + dsp_noboost = mp_dsp_noboost == -1 ? os_atoi (cp) : mp_dsp_noboost;
  482. }
  483. cp = (char *) prom_getenv ("dsp_freq");
  484. - if (cp)
  485. + if (cp || mp_dsp_freq != -1)
  486. {
  487. - dspfreq = os_atoi (cp);
  488. + dspfreq = mp_dsp_freq == -1 ? os_atoi (cp) : mp_dsp_freq;
  489. if (dspfreq == 250)
  490. {
  491. boostDsp = 1;
  492. @@ -2238,8 +2333,9 @@ static int __init tn7atm_init (struct at
  493. // Inter-Op DSL phy Control
  494. // Note the setting of _dsl_Feature_0 and _dsl_Feature_1 must before
  495. // dslhal_api_dslStartup (in tn7dsl_init()).
  496. - if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL)
  497. + if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL || mp_featctl0 != NULL)
  498. {
  499. + if (mp_featctl0 != NULL) ptr = mp_featctl0;
  500. if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to
  501. // os_atoh
  502. ptr += 2;
  503. @@ -2247,8 +2343,9 @@ static int __init tn7atm_init (struct at
  504. _dsl_Feature_0_defined = 1;
  505. }
  506. - if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL)
  507. + if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL || mp_featctl1 != NULL)
  508. {
  509. + if (mp_featctl1 != NULL) ptr = mp_featctl1;
  510. if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to
  511. // os_atoh
  512. ptr += 2;
  513. @@ -2260,8 +2357,9 @@ static int __init tn7atm_init (struct at
  514. // DSL phy Feature Control
  515. // Note the setting of _dsl_PhyControl_0 and _dsl_PhyControl_1 must before
  516. // dslhal_api_dslStartup (in tn7dsl_init()).
  517. - if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL)
  518. + if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL || mp_phyctl0 != NULL)
  519. {
  520. + if (mp_phyctl0 != NULL) ptr = mp_phyctl0;
  521. if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to
  522. // os_atoh
  523. ptr += 2;
  524. @@ -2269,8 +2367,9 @@ static int __init tn7atm_init (struct at
  525. _dsl_PhyControl_0_defined = 1;
  526. }
  527. - if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL)
  528. + if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL || mp_phyctl1 != NULL)
  529. {
  530. + if (mp_phyctl1 != NULL) ptr = mp_phyctl1;
  531. if ((ptr[0] == '0') && (ptr[1] == 'x')) // skip 0x before pass to
  532. // os_atoh
  533. ptr += 2;
  534. @@ -2298,9 +2397,9 @@ static int __init tn7atm_init (struct at
  535. priv->bTurboDsl = 1;
  536. // read config for turbo dsl
  537. ptr = prom_getenv ("TurboDSL");
  538. - if (ptr)
  539. + if (ptr || mp_turbodsl != -1)
  540. {
  541. - priv->bTurboDsl = os_atoi (ptr);
  542. + priv->bTurboDsl = mp_turbodsl == -1 ? os_atoi (ptr) : mp_turbodsl;
  543. }
  544. // @Added to make Rx buffer number & Service max configurable through
  545. @@ -2308,30 +2407,30 @@ static int __init tn7atm_init (struct at
  546. priv->sarRxBuf = RX_BUFFER_NUM;
  547. ptr = NULL;
  548. ptr = prom_getenv ("SarRxBuf");
  549. - if (ptr)
  550. + if (ptr || mp_sar_rxbuf != -1)
  551. {
  552. - priv->sarRxBuf = os_atoi (ptr);
  553. + priv->sarRxBuf = mp_sar_rxbuf == -1 ? os_atoi (ptr) : mp_sar_rxbuf;
  554. }
  555. priv->sarRxMax = RX_SERVICE_MAX;
  556. ptr = NULL;
  557. ptr = prom_getenv ("SarRxMax");
  558. - if (ptr)
  559. + if (ptr || mp_sar_rxmax != -1)
  560. {
  561. - priv->sarRxMax = os_atoi (ptr);
  562. + priv->sarRxMax = mp_sar_rxmax == -1 ? os_atoi (ptr) : mp_sar_rxmax;
  563. }
  564. priv->sarTxBuf = TX_BUFFER_NUM;
  565. ptr = NULL;
  566. ptr = prom_getenv ("SarTxBuf");
  567. - if (ptr)
  568. + if (ptr || mp_sar_txbuf != -1)
  569. {
  570. - priv->sarTxBuf = os_atoi (ptr);
  571. + priv->sarTxBuf = mp_sar_txbuf == -1 ? os_atoi (ptr) : mp_sar_txbuf;
  572. }
  573. priv->sarTxMax = TX_SERVICE_MAX;
  574. ptr = NULL;
  575. ptr = prom_getenv ("SarTxMax");
  576. - if (ptr)
  577. + if (ptr || mp_sar_txmax != -1)
  578. {
  579. - priv->sarTxMax = os_atoi (ptr);
  580. + priv->sarTxMax = mp_sar_txmax == -1 ? os_atoi (ptr) : mp_sar_txmax;
  581. }
  582. return 0;
  583. @@ -2479,7 +2578,5 @@ static int tn7atm_proc_qos_write(struct
  584. return count;
  585. }
  586. -#ifdef MODULE
  587. module_init (tn7atm_detect);
  588. module_exit (tn7atm_exit);
  589. -#endif /* MODULE */