Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: cxt1e1: remove all code dependent on LINUX_VERSION_CODE

Remove all code which is dead for in-kernel driver due to being
ifdefed by LINUX_VERSION_CODE.

While at it, also remove surrounding code which is commented out,
or '#if 1' nops.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Jiri Kosina and committed by
Greg Kroah-Hartman
5749df14 41a38d9e

-524
-12
drivers/staging/cxt1e1/functions.c
··· 122 122 pr_warning("%s: drvr not available (%x)\n", __func__, drvr_state); 123 123 return; 124 124 } 125 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 126 - /* Initialize the tq entry only the first time */ 127 - if (wd->init_tq) 128 - { 129 - wd->init_tq = 0; 130 - wd->tq.routine = wd->func; 131 - wd->tq.sync = 0; 132 - wd->tq.data = wd->softc; 133 - } 134 - schedule_task (&wd->tq); 135 - #else 136 125 schedule_work (&wd->work); 137 - #endif 138 126 mod_timer (&wd->h, jiffies + wd->ticks); 139 127 } 140 128
-6
drivers/staging/cxt1e1/hwprobe.c
··· 305 305 error_flag = 0; 306 306 prep_hdw_info (); 307 307 /*** scan PCI bus for all possible boards */ 308 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 309 308 while ((pdev = pci_get_device (PCI_VENDOR_ID_CONEXANT, 310 - PCI_DEVICE_ID_CN8474, 311 - pdev))) 312 - #else 313 - while ((pdev = pci_find_device (PCI_VENDOR_ID_CONEXANT, 314 309 PCI_DEVICE_ID_CN8474, 315 310 pdev))) 316 - #endif 317 311 { 318 312 if (c4_hdw_init (pdev, found)) 319 313 found++;
-123
drivers/staging/cxt1e1/linux.c
··· 142 142 } 143 143 144 144 145 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 146 - #define DEV_TO_PRIV(dev) ( * (struct c4_priv **) ((hdlc_device*)(dev)+1)) 147 - #else 148 - 149 145 char * 150 146 get_hdlc_name (hdlc_device * hdlc) 151 147 { ··· 150 154 151 155 return dev->name; 152 156 } 153 - #endif 154 157 155 158 156 159 static status_t ··· 162 167 } 163 168 164 169 /***************************************************************************/ 165 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 166 170 #include <linux/workqueue.h> 167 171 168 172 /*** ··· 253 259 pi->wq_port = 0; 254 260 } 255 261 } 256 - #endif 257 262 258 263 /***************************************************************************/ 259 264 ··· 284 291 } 285 292 286 293 287 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 288 - #if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) 289 - 290 - /** Linux 2.4.18-19 **/ 291 - STATIC int 292 - chan_open (hdlc_device * hdlc) 293 - { 294 - status_t ret; 295 - 296 - if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum))) 297 - return -ret; 298 - MOD_INC_USE_COUNT; 299 - netif_start_queue (hdlc_to_dev (hdlc)); 300 - return 0; /* no error = success */ 301 - } 302 - 303 - #else 304 - 305 - /** Linux 2.4.20 and higher **/ 306 - STATIC int 307 - chan_open (struct net_device * ndev) 308 - { 309 - hdlc_device *hdlc = dev_to_hdlc (ndev); 310 - status_t ret; 311 - 312 - hdlc->proto = IF_PROTO_HDLC; 313 - if ((ret = hdlc_open (hdlc))) 314 - { 315 - pr_info("hdlc_open failure, err %d.\n", ret); 316 - return ret; 317 - } 318 - if ((ret = c4_chan_up (DEV_TO_PRIV (hdlc)->ci, DEV_TO_PRIV (hdlc)->channum))) 319 - return -ret; 320 - MOD_INC_USE_COUNT; 321 - netif_start_queue (hdlc_to_dev (hdlc)); 322 - return 0; /* no error = success */ 323 - } 324 - #endif 325 - 326 - #else 327 - 328 - /** Linux 2.6 **/ 329 294 STATIC int 330 295 chan_open (struct net_device * ndev) 331 296 { ··· 302 351 netif_start_queue (ndev); 303 352 return 0; /* no error = success */ 304 353 } 305 - #endif 306 354 307 355 308 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 309 - #if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) 310 - 311 - /** Linux 2.4.18-19 **/ 312 - STATIC void 313 - chan_close (hdlc_device * hdlc) 314 - { 315 - netif_stop_queue (hdlc_to_dev (hdlc)); 316 - musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum); 317 - MOD_DEC_USE_COUNT; 318 - } 319 - #else 320 - 321 - /** Linux 2.4.20 and higher **/ 322 - STATIC int 323 - chan_close (struct net_device * ndev) 324 - { 325 - hdlc_device *hdlc = dev_to_hdlc (ndev); 326 - 327 - netif_stop_queue (hdlc_to_dev (hdlc)); 328 - musycc_chan_down ((ci_t *) 0, DEV_TO_PRIV (hdlc)->channum); 329 - hdlc_close (hdlc); 330 - MOD_DEC_USE_COUNT; 331 - return 0; 332 - } 333 - #endif 334 - 335 - #else 336 - 337 - /** Linux 2.6 **/ 338 356 STATIC int 339 357 chan_close (struct net_device * ndev) 340 358 { ··· 316 396 module_put (THIS_MODULE); 317 397 return 0; 318 398 } 319 - #endif 320 399 321 400 322 401 #if !defined(GENERIC_HDLC_VERSION) || (GENERIC_HDLC_VERSION < 4) ··· 354 435 355 436 356 437 STATIC int 357 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 358 - chan_attach_noop (hdlc_device * hdlc, unsigned short foo_1, unsigned short foo_2) 359 - #else 360 438 chan_attach_noop (struct net_device * ndev, unsigned short foo_1, unsigned short foo_2) 361 - #endif 362 439 { 363 440 return 0; /* our driver has nothing to do here, show's 364 441 * over, go home */ ··· 370 455 struct sbecom_chan_stats *stats; 371 456 int channum; 372 457 373 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 374 - channum = DEV_TO_PRIV (ndev)->channum; 375 - #else 376 458 { 377 459 struct c4_priv *priv; 378 460 379 461 priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv; 380 462 channum = priv->channum; 381 463 } 382 - #endif 383 464 384 465 ch = c4_find_chan (channum); 385 466 if (ch == NULL) ··· 438 527 const struct c4_priv *priv; 439 528 int rval; 440 529 441 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 442 - priv = DEV_TO_PRIV (ndev); 443 - #else 444 530 hdlc_device *hdlc = dev_to_hdlc (ndev); 445 531 446 532 priv = hdlc->priv; 447 - #endif 448 533 449 534 rval = musycc_start_xmit (priv->ci, priv->channum, skb); 450 535 return -rval; ··· 730 823 ret = mkret (c4_new_chan (ci, cp.port, cp.channum, dev)); 731 824 if (ret) 732 825 { 733 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 734 - rtnl_unlock (); /* needed due to Ioctl calling sequence */ 735 - V7 (unregister_hdlc_device) (dev_to_hdlc (dev)); 736 - rtnl_lock (); /* needed due to Ioctl calling sequence */ 737 - OS_kfree (DEV_TO_PRIV (dev)); 738 - OS_kfree (dev); 739 - #else 740 826 rtnl_unlock (); /* needed due to Ioctl calling sequence */ 741 827 unregister_hdlc_device (dev); 742 828 rtnl_lock (); /* needed due to Ioctl calling sequence */ 743 829 free_netdev (dev); 744 - #endif 745 830 } 746 831 return ret; 747 832 } ··· 782 883 const struct c4_priv *priv; 783 884 int channum; 784 885 785 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 786 - priv = DEV_TO_PRIV (ndev); 787 - #else 788 886 priv = (struct c4_priv *) dev_to_hdlc (ndev)->priv; 789 - #endif 790 887 ci = priv->ci; 791 888 channum = priv->channum; 792 889 ··· 792 897 ch->user = 0; /* will be freed, below */ 793 898 } 794 899 795 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 796 - if (lockit) 797 - rtnl_unlock (); /* needed if Ioctl calling sequence */ 798 - V7 (unregister_hdlc_device) (dev_to_hdlc (ndev)); 799 - if (lockit) 800 - rtnl_lock (); /* needed if Ioctl calling sequence */ 801 - OS_kfree (DEV_TO_PRIV (ndev)); 802 - OS_kfree (ndev); 803 - #else 804 900 if (lockit) 805 901 rtnl_unlock (); /* needed if Ioctl calling sequence */ 806 902 unregister_hdlc_device (ndev); 807 903 if (lockit) 808 904 rtnl_lock (); /* needed if Ioctl calling sequence */ 809 905 free_netdev (ndev); 810 - #endif 811 906 return 0; 812 907 } 813 908 ··· 1223 1338 1224 1339 module_init (c4_mod_init); 1225 1340 module_exit (c4_mod_remove); 1226 - 1227 - #ifndef SBE_INCLUDE_SYMBOLS 1228 - #ifndef CONFIG_SBE_WANC24_NCOMM 1229 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1230 - EXPORT_NO_SYMBOLS; 1231 - #endif 1232 - #endif 1233 - #endif 1234 1341 1235 1342 MODULE_AUTHOR ("SBE Technical Services <support@sbei.com>"); 1236 1343 MODULE_DESCRIPTION ("wanPCI-CxT1E1 Generic HDLC WAN Driver module");
-204
drivers/staging/cxt1e1/musycc.c
··· 405 405 } 406 406 407 407 408 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 409 408 /* 410 409 * This is the workq task executed by the OS when our queue_work() is 411 410 * scheduled and run. It can fire off either RX or TX ACTIVATION depending ··· 514 515 #endif 515 516 } 516 517 } 517 - #endif 518 518 519 519 520 520 /* ··· 529 531 ch->channum, ch->txd_irq_srv, ch->txd_irq_srv->status); 530 532 #endif 531 533 532 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 533 534 /* 2.6 - find next unprocessed message, then set TX thp to it */ 534 535 #ifdef RLD_RESTART_DEBUG 535 536 pr_info(">> musycc_chan_restart: scheduling Chan %x workQ @ %p\n", ch->channum, &ch->ch_work); ··· 536 539 c4_wk_chan_restart (ch); /* work queue mechanism fires off: Ref: 537 540 * musycc_wq_chan_restart () */ 538 541 539 - #else 540 - 541 - 542 - /* 2.4 - find next unprocessed message, then set TX thp to it */ 543 - #ifdef RLD_RESTART_DEBUG 544 - pr_info(">> musycc_chan_restart: scheduling Chan %x start_tx %x\n", ch->channum, ch->ch_start_tx); 545 - #endif 546 - /* restart transmission from background loop */ 547 - ch->up->up->wd_notify = WD_NOTIFY_1TX; 548 - #endif 549 542 } 550 543 551 - 552 - #if 0 553 - void 554 - musycc_cleanup (ci_t * ci) 555 - { 556 - mpi_t *pi; 557 - int i, j; 558 - 559 - /* free up driver resources */ 560 - ci->state = C_INIT; /* mark as hardware not available */ 561 - 562 - for (i = 0; i < ci->max_ports; i++) 563 - { 564 - pi = &ci->port[i]; 565 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 566 - c4_wq_port_cleanup (pi); 567 - #endif 568 - for (j = 0; j < MUSYCC_NCHANS; j++) 569 - { 570 - if (pi->chan[j]) 571 - OS_kfree (pi->chan[j]); /* free mch_t struct */ 572 - } 573 - OS_kfree (pi->regram_saved); 574 - } 575 - #if 0 576 - /* obsolete - watchdog is now static w/in ci_t */ 577 - OS_free_watchdog (ci->wd); 578 - #endif 579 - OS_kfree (ci->iqd_p_saved); 580 - OS_kfree (ci); 581 - } 582 - #endif 583 544 584 545 void 585 546 rld_put_led (mpi_t * pi, u_int32_t ledval) ··· 1963 2008 atomic_add (len, &ci->tx_pending); 1964 2009 ch->s.tx_packets++; 1965 2010 ch->s.tx_bytes += len; 1966 - #if 0 1967 - spin_unlock_irqrestore (&ch->ch_txlock, flags); /* allow pending 1968 - * interrupt to sneak 1969 - * thru */ 1970 - #endif 1971 - 1972 2011 /* 1973 2012 * If an ONR was seen, then channel requires poking to restart 1974 2013 * transmission. 1975 2014 */ 1976 2015 if (ch->ch_start_tx) 1977 2016 { 1978 - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,41) 1979 - SD_SEM_TAKE (&ci->sem_wdbusy, "_wd_"); /* only 1 thru here, per 1980 - * board */ 1981 - if ((ch->ch_start_tx == CH_START_TX_ONR) && (ch->p.chan_mode == CFG_CH_PROTO_TRANS)) 1982 - { 1983 - /* ONR restart transmission from background loop */ 1984 - ci->wd_notify = WD_NOTIFY_ONR; /* enabled global watchdog 1985 - * scan-thru */ 1986 - } else 1987 - { 1988 - /* start first transmission from background loop */ 1989 - ci->wd_notify = WD_NOTIFY_1TX; /* enabled global watchdog 1990 - * scan-thru */ 1991 - } 1992 2017 musycc_chan_restart (ch); 1993 - SD_SEM_GIVE (&ci->sem_wdbusy); 1994 - #else 1995 - musycc_chan_restart (ch); 1996 - #endif 1997 2018 } 1998 2019 #ifdef SBE_WAN256T3_ENABLE 1999 2020 wan256t3_led (ci, LED_TX, LEDV_G); ··· 1977 2046 return 0; 1978 2047 } 1979 2048 1980 - 1981 - #if 0 1982 - int 1983 - musycc_set_chan (ci_t * ci, int channum, struct sbecom_chan_param * p) 1984 - { 1985 - mch_t *ch; 1986 - int rok = 0; 1987 - int n = 0; 1988 - 1989 - if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */ 1990 - return ECHRNG; 1991 - if (!(ch = sd_find_chan (ci, channum))) 1992 - return ENOENT; 1993 - if (ch->channum != p->channum) 1994 - return EINVAL; 1995 - if (sd_line_is_ok (ch->user)) 1996 - { 1997 - rok = 1; 1998 - sd_line_is_down (ch->user); 1999 - } 2000 - if (ch->state == UP && /* bring down in current configuration */ 2001 - (ch->p.status != p->status || 2002 - ch->p.chan_mode != p->chan_mode || 2003 - ch->p.intr_mask != p->intr_mask || 2004 - ch->txd_free < ch->txd_num)) 2005 - { 2006 - if ((n = musycc_chan_down (ci, channum))) 2007 - return n; 2008 - if (ch->p.mode_56k != p->mode_56k) 2009 - { 2010 - ch->p = *p; /* copy in new parameters */ 2011 - musycc_update_timeslots (&ci->port[ch->channum / MUSYCC_NCHANS]); 2012 - } else 2013 - ch->p = *p; /* copy in new parameters */ 2014 - if ((n = musycc_chan_up (ci, channum))) 2015 - return n; 2016 - sd_enable_xmit (ch->user); /* re-enable to catch flow controlled 2017 - * channel */ 2018 - } else 2019 - { 2020 - if (ch->p.mode_56k != p->mode_56k) 2021 - { 2022 - ch->p = *p; /* copy in new parameters */ 2023 - musycc_update_timeslots (&ci->port[ch->channum / MUSYCC_NCHANS]); 2024 - } else 2025 - ch->p = *p; /* copy in new parameters */ 2026 - } 2027 - 2028 - if (rok) 2029 - sd_line_is_up (ch->user); 2030 - return 0; 2031 - } 2032 - #endif 2033 - 2034 - 2035 - int 2036 - musycc_get_chan (ci_t * ci, int channum, struct sbecom_chan_param * p) 2037 - { 2038 - mch_t *ch; 2039 - 2040 - #if 0 2041 - if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */ 2042 - return ECHRNG; 2043 - #endif 2044 - if (!(ch = sd_find_chan (ci, channum))) 2045 - return ENOENT; 2046 - *p = ch->p; 2047 - return 0; 2048 - } 2049 - 2050 - 2051 - int 2052 - musycc_get_chan_stats (ci_t * ci, int channum, struct sbecom_chan_stats * p) 2053 - { 2054 - mch_t *ch; 2055 - 2056 - if (channum < 0 || channum >= (MUSYCC_NPORTS * MUSYCC_NCHANS)) /* sanity chk param */ 2057 - return ECHRNG; 2058 - if (!(ch = sd_find_chan (ci, channum))) 2059 - return ENOENT; 2060 - *p = ch->s; 2061 - p->tx_pending = atomic_read (&ch->tx_pending); 2062 - return 0; 2063 - } 2064 - 2065 - 2066 - 2067 - #ifdef SBE_WAN256T3_ENABLE 2068 - int 2069 - musycc_chan_down (ci_t * ci, int channum) 2070 - { 2071 - mch_t *ch; 2072 - mpi_t *pi; 2073 - int i, gchan; 2074 - 2075 - if (!(ch = sd_find_chan (ci, channum))) 2076 - return EINVAL; 2077 - pi = ch->up; 2078 - gchan = ch->gchan; 2079 - 2080 - /* Deactivate the channel */ 2081 - musycc_serv_req (pi, SR_CHANNEL_DEACTIVATE | SR_RX_DIRECTION | gchan); 2082 - ch->ch_start_rx = 0; 2083 - musycc_serv_req (pi, SR_CHANNEL_DEACTIVATE | SR_TX_DIRECTION | gchan); 2084 - ch->ch_start_tx = 0; 2085 - 2086 - if (ch->state == DOWN) 2087 - return 0; 2088 - ch->state = DOWN; 2089 - 2090 - pi->regram->thp[gchan] = 0; 2091 - pi->regram->tmp[gchan] = 0; 2092 - pi->regram->rhp[gchan] = 0; 2093 - pi->regram->rmp[gchan] = 0; 2094 - FLUSH_MEM_WRITE (); 2095 - for (i = 0; i < ch->txd_num; i++) 2096 - { 2097 - if (ch->mdt[i].mem_token != 0) 2098 - OS_mem_token_free (ch->mdt[i].mem_token); 2099 - } 2100 - 2101 - for (i = 0; i < ch->rxd_num; i++) 2102 - { 2103 - if (ch->mdr[i].mem_token != 0) 2104 - OS_mem_token_free (ch->mdr[i].mem_token); 2105 - } 2106 - 2107 - OS_kfree (ch->mdt); 2108 - ch->mdt = 0; 2109 - OS_kfree (ch->mdr); 2110 - ch->mdr = 0; 2111 - 2112 - return 0; 2113 - } 2114 - #endif 2115 2049 2116 2050 /*** End-of-File ***/
-4
drivers/staging/cxt1e1/pmc93x6_eeprom.c
··· 500 500 time_t createTime; 501 501 int i; 502 502 503 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 504 - createTime = CURRENT_TIME; 505 - #else 506 503 createTime = get_seconds (); 507 - #endif 508 504 509 505 /* use template data */ 510 506 for (i = 0; i < sizeof (FLD_TYPE2); ++i)
-6
drivers/staging/cxt1e1/pmcc4.h
··· 117 117 118 118 #include "pmcc4_private.h" 119 119 120 - #if !(LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 121 - char *get_hdlc_name (hdlc_device *); 122 - 123 - #endif 124 - 125 - 126 120 /* 127 121 * external interface 128 122 */
-158
drivers/staging/cxt1e1/pmcc4_drv.c
··· 119 119 #define KERN_WARN KERN_WARNING 120 120 121 121 /* forward references */ 122 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 123 122 status_t c4_wk_chan_init (mpi_t *, mch_t *); 124 123 void c4_wq_port_cleanup (mpi_t *); 125 124 status_t c4_wq_port_init (mpi_t *); 126 125 127 - #endif 128 126 int c4_loop_port (ci_t *, int, u_int8_t); 129 127 status_t c4_set_port (ci_t *, int); 130 128 status_t musycc_chan_down (ci_t *, int); ··· 531 533 STATIC void 532 534 c4_watchdog (ci_t * ci) 533 535 { 534 - #if 0 535 - //unsigned long flags; 536 - #endif 537 - 538 536 if (drvr_state != SBE_DRVR_AVAILABLE) 539 537 { 540 538 if (log_level >= LOG_MONITOR) 541 539 pr_info("drvr not available (%x)\n", drvr_state); 542 540 return; 543 541 } 544 - #if 0 545 - SD_SEM_TAKE (&ci->sem_wdbusy, "_wd_"); /* only 1 thru here, per 546 - * board */ 547 - #endif 548 - 549 542 ci->wdcount++; 550 543 checkPorts (ci); 551 - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,41) 552 - if (ci->wd_notify) 553 - { /* is there a state change to search for */ 554 - int port, gchan; 555 - 556 - ci->wd_notify = 0; /* reset notification */ 557 - for (gchan = 0; gchan < MUSYCC_NCHANS; gchan++) 558 - { 559 - for (port = 0; port < ci->max_port; port++) 560 - { 561 - mch_t *ch = ci->port[port].chan[gchan]; 562 - 563 - if (!ch || ci->state != C_RUNNING) /* state changed while 564 - * acquiring semaphore */ 565 - break; 566 - if (ch->state == UP)/* channel must be set up */ 567 - { 568 - #if 0 569 - #ifdef RLD_TRANS_DEBUG 570 - if (1 || log_level >= LOG_MONITOR) 571 - #else 572 - if (log_level >= LOG_MONITOR) 573 - #endif 574 - pr_info("%s: watchdog reviving Port %d Channel %d [%d] sts %x/%x, start_TX %x free %x start_RX %x\n", 575 - ci->devname, ch->channum, port, gchan, ch->channum, 576 - ch->p.status, ch->status, 577 - ch->ch_start_tx, ch->txd_free, ch->ch_start_rx); 578 - #endif 579 - 580 - /**********************************/ 581 - /** check for RX restart request **/ 582 - /**********************************/ 583 - 584 - if (ch->ch_start_rx && 585 - (ch->status & RX_ENABLED)) /* requires start on 586 - * enabled RX */ 587 - { 588 - ch->ch_start_rx = 0; /* we are restarting RX... */ 589 - #ifdef RLD_TRANS_DEBUG 590 - pr_info("++ c4_watchdog() CHAN RX ACTIVATE: chan %d\n", 591 - ch->channum); 592 - #endif 593 - #ifdef RLD_RXACT_DEBUG 594 - { 595 - struct mdesc *md; 596 - static int hereb4 = 7; 597 - 598 - if (hereb4) 599 - { 600 - hereb4--; 601 - md = &ch->mdr[ch->rxix_irq_srv]; 602 - pr_info("++ c4_watchdog[%d] CHAN RX ACTIVATE: rxix_irq_srv %d, md %p sts %x, rxpkt %lu\n", 603 - ch->channum, ch->rxix_irq_srv, md, le32_to_cpu (md->status), ch->s.rx_packets); 604 - musycc_dump_rxbuffer_ring (ch, 1); /* RLD DEBUG */ 605 - } 606 - } 607 - #endif 608 - musycc_serv_req (ch->up, SR_CHANNEL_ACTIVATE | SR_RX_DIRECTION | gchan); 609 - } 610 - /**********************************/ 611 - /** check for TX restart request **/ 612 - /**********************************/ 613 - 614 - if (ch->ch_start_tx && 615 - (ch->status & TX_ENABLED)) /* requires start on 616 - * enabled TX */ 617 - { 618 - struct mdesc *md; 619 - 620 - /* 621 - * find next unprocessed message, then set TX thp to 622 - * it 623 - */ 624 - musycc_update_tx_thp (ch); 625 - 626 - #if 0 627 - spin_lock_irqsave (&ch->ch_txlock, flags); 628 - #endif 629 - md = ch->txd_irq_srv; 630 - if (!md) 631 - { 632 - pr_info("-- c4_watchdog[%d]: WARNING, starting NULL md\n", 633 - ch->channum); 634 - pr_info("-- chan %d txd_irq_srv %p sts %x usr_add %p sts %x, txpkt %lu\n", 635 - ch->channum, ch->txd_irq_srv, le32_to_cpu ((struct mdesc *) (ch->txd_irq_srv)->status), 636 - ch->txd_usr_add, le32_to_cpu ((struct mdesc *) (ch->txd_usr_add)->status), 637 - ch->s.tx_packets); 638 - #if 0 639 - spin_unlock_irqrestore (&ch->ch_txlock, flags); 640 - #endif 641 - } else if (md->data && ((le32_to_cpu (md->status)) & MUSYCC_TX_OWNED)) 642 - { 643 - #ifdef RLD_TRANS_DEBUG 644 - pr_info("++ c4_watchdog[%d] CHAN TX ACTIVATE: start_tx %x\n", 645 - ch->channum, ch->ch_start_tx); 646 - #endif 647 - ch->ch_start_tx = 0; /* we are restarting 648 - * TX... */ 649 - #if 0 650 - spin_unlock_irqrestore (&ch->ch_txlock, flags); /* allow interrupts for 651 - * service request */ 652 - #endif 653 - musycc_serv_req (ch->up, SR_CHANNEL_ACTIVATE | SR_TX_DIRECTION | gchan); 654 - #ifdef RLD_TRANS_DEBUG 655 - if (1 || log_level >= LOG_MONITOR) 656 - #else 657 - if (log_level >= LOG_MONITOR) 658 - #endif 659 - pr_info("++ SACK[P%d/C%d] ack'd, continuing...\n", 660 - ch->up->portnum, ch->channum); 661 - } 662 - } 663 - } 664 - } 665 - } 666 - } 667 - #else 668 544 ci->wd_notify = 0; 669 - #endif 670 - #if 0 671 - SD_SEM_GIVE (&ci->sem_wdbusy);/* release per-board hold */ 672 - #endif 673 545 } 674 546 675 547 ··· 558 690 for (portnum = 0; portnum < ci->max_port; portnum++) 559 691 { 560 692 pi = &ci->port[portnum]; 561 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 562 693 c4_wq_port_cleanup (pi); 563 - #endif 564 694 for (j = 0; j < MUSYCC_NCHANS; j++) 565 695 { 566 696 if (pi->chan[j]) ··· 566 700 } 567 701 OS_kfree (pi->regram_saved); 568 702 } 569 - #if 0 570 - /* obsolete - watchdog is now static w/in ci_t */ 571 - OS_free_watchdog (ci->wd); 572 - #endif 573 703 OS_kfree (ci->iqd_p_saved); 574 704 OS_kfree (ci); 575 705 ci = next; /* cleanup next board, if any */ ··· 1007 1145 return EBUSY; /* group needs initialization only for 1008 1146 * first channel of a group */ 1009 1147 1010 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 1011 1148 { 1012 1149 status_t ret; 1013 1150 ··· 1014 1153 * workqueue_struct */ 1015 1154 return (ret); 1016 1155 } 1017 - #endif 1018 1156 1019 1157 init_comet (ci, pi->cometbase, pp->port_mode, 1 /* clockmaster == true */ , pp->portP); 1020 1158 clck = pci_read_32 ((u_int32_t *) &ci->cpldbase->mclk) & PMCC4_CPLD_MCLK_MASK; ··· 1129 1269 spin_lock_init (&ch->ch_rxlock); 1130 1270 spin_lock_init (&ch->ch_txlock); 1131 1271 1132 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) 1133 1272 { 1134 1273 status_t ret; 1135 1274 1136 1275 if ((ret = c4_wk_chan_init (pi, ch))) 1137 1276 return ret; 1138 1277 } 1139 - #endif 1140 1278 1141 1279 /* save off interface assignments which bound a board */ 1142 1280 if (ci->first_if == 0) /* first channel registered is assumed to ··· 1563 1705 1564 1706 if (ci->first_if) 1565 1707 { 1566 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1567 - np = (char *) hdlc_to_name (ci->first_if); 1568 - #else 1569 1708 { 1570 1709 struct net_device *dev; 1571 1710 1572 1711 dev = (struct net_device *) ci->first_if; 1573 1712 np = (char *) dev->name; 1574 1713 } 1575 - #endif 1576 1714 strncpy (bip->first_iname, np, CHNM_STRLEN - 1); 1577 1715 } else 1578 1716 strcpy (bip->first_iname, "<NULL>"); 1579 1717 if (ci->last_if) 1580 1718 { 1581 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1582 - np = (char *) hdlc_to_name (ci->last_if); 1583 - #else 1584 1719 { 1585 1720 struct net_device *dev; 1586 1721 1587 1722 dev = (struct net_device *) ci->last_if; 1588 1723 np = (char *) dev->name; 1589 1724 } 1590 - #endif 1591 1725 strncpy (bip->last_iname, np, CHNM_STRLEN - 1); 1592 1726 } else 1593 1727 strcpy (bip->last_iname, "<NULL>"); ··· 1613 1763 if (!(dev = getuserbychan (iip->channum))) 1614 1764 return ENOENT; 1615 1765 1616 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1617 - np = (char *) hdlc_to_name (dev_to_hdlc (dev)); 1618 - #else 1619 1766 np = dev->name; 1620 - #endif 1621 1767 strncpy (iip->iname, np, CHNM_STRLEN - 1); 1622 1768 return 0; 1623 1769 } ··· 1672 1826 pci_write_32 ((u_int32_t *) &ci->reg->glcd, GCD_MAGIC | MUSYCC_GCD_INTB_DISABLE); 1673 1827 #endif 1674 1828 1675 - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,20) 1676 - return; 1677 - #else 1678 1829 return IRQ_RETVAL (handled); 1679 - #endif 1680 1830 } 1681 1831 1682 1832
-11
drivers/staging/cxt1e1/sbecom_inline_linux.h
··· 48 48 #else 49 49 #include <linux/types.h> 50 50 #include <linux/version.h> 51 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) 52 - #include <linux/config.h> 53 - #endif 54 51 #if defined(CONFIG_SMP) && ! defined(__SMP__) 55 52 #define __SMP__ 56 53 #endif ··· 57 60 58 61 #ifdef MODULE 59 62 #ifdef MODVERSIONS 60 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 61 - #include <linux/modversions.h> 62 - #else 63 63 #include <config/modversions.h> 64 - #endif 65 64 #endif 66 65 #include <linux/module.h> 67 66 #endif ··· 253 260 struct watchdog 254 261 { 255 262 struct timer_list h; 256 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 257 - struct tq_struct tq; 258 - #else 259 263 struct work_struct work; 260 - #endif 261 264 void *softc; 262 265 void (*func) (void *softc); 263 266 int ticks;