int bp_10g9;
int bp_i80;
int bp_540;
-
-// selftest stanza
int (*hard_start_xmit_save) (struct sk_buff *skb,
struct net_device *dev);
const struct net_device_ops *old_ops;
struct net_device_ops new_ops;
int bp_self_test_flag;
char *bp_tx_data;
-// end selftest stanza
-//
struct bypass_pfs_sd bypass_pfs_set;
} bpctl_dev_t;
struct net_device *dev = ptr;
static bpctl_dev_t *pbpctl_dev = NULL, *pbpctl_dev_m = NULL;
int dev_num = 0, ret = 0, ret_d = 0, time_left = 0;
- //printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex );
- //return NOTIFY_DONE;
+ /* printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex ); */
+ /* return NOTIFY_DONE; */
if (!dev)
return NOTIFY_DONE;
if (event == NETDEV_REGISTER) {
{
struct ethtool_drvinfo drvinfo;
- // char *str=NULL;
char cbuf[32];
char *buf = NULL;
char res[10];
memcpy(&cbuf, drvinfo.bus_info, 32);
buf = &cbuf[0];
- // while(*buf++){
-
- /*if(*buf==':'){
- buf++;
- break;
- } */
- //}
while (*buf++ != ':') ;
for (i = 0; i < 10; i++, buf++) {
if (*buf == ':')
}
if (event == NETDEV_UNREGISTER) {
int idx_dev = 0;
- //if_scan();
for (idx_dev = 0;
((bpctl_dev_arr[idx_dev].pdev != NULL)
&& (idx_dev < device_num)); idx_dev++) {
}
if (event == NETDEV_CHANGENAME) {
int idx_dev = 0;
- //if_scan();
for (idx_dev = 0;
((bpctl_dev_arr[idx_dev].pdev != NULL)
&& (idx_dev < device_num)); idx_dev++) {
return NOTIFY_DONE;
}
- //return NOTIFY_DONE;
switch (event) {
if (netif_carrier_ok(dev))
return NOTIFY_DONE;
- //if_scan();
if (((dev_num = get_dev_idx(dev->ifindex)) == -1) ||
(!(pbpctl_dev = &bpctl_dev_arr[dev_num])))
return NOTIFY_DONE;
BPCTLI_CTRL_EXT_MCLK_DATA));
else {
-/* To start management : MCLK 1, MDIO 1, output*/
- //writel((0x2|0x8), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
+ /* To start management : MCLK 1, MDIO 1, output*/
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext | BP10G_MCLK_DATA_OUT
| BP10G_MDIO_DATA_OUT));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, (ctrl | BP10G_MDIO_DATA | BP10G_MDIO_DIR));
}
(BPCTLI_CTRL_EXT_MCLK_DATA)));
else {
- //writel((0x2), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
((ctrl_ext |
BP10G_MDIO_DATA_OUT) &
~(BP10G_MCLK_DATA_OUT)));
- // BP10G_WRITE_REG(pbpctl_dev, ESDP, (ctrl |BP10G_MDIO_DIR|BP10G_MDIO_DATA));
}
usec_delay(PULSE_TIME);
(BPCTLI_CTRL_EXT_MDIO_DATA)));
else {
- // writel((0x8), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
((ctrl_ext |
BP10G_MCLK_DATA_OUT) &
~BP10G_MDIO_DATA_OUT));
- // BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
usec_delay(PULSE_TIME);
BPCTLI_CTRL_EXT_MDIO_DATA)));
else {
- //writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT |
BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
usec_delay(PULSE_TIME);
ctrl = BP10G_READ_REG(pbpctl_dev_c, ESDP);
}
- //ctrl_ext=BP10G_READ_REG(pbpctl_dev,EODSDP);
while (i--) {
if (pbpctl_dev->bp_10g9) {
BPCTLI_CTRL_EXT_MCLK_DATA)));
else {
- // writel(( 0/*0x1*/), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP, ((ctrl_ext | BP10G_MDIO_DATA_OUT) & ~BP10G_MCLK_DATA_OUT)); /* ? */
- // printk("0x28=0x%x\n",BP10G_READ_REG(pbpctl_dev,EODSDP););
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, (ctrl &~BP10G_MDIO_DIR));
+ /* printk("0x28=0x%x\n",BP10G_READ_REG(pbpctl_dev,EODSDP);); */
}
(BPCTLI_CTRL_EXT_MDIO_DIR)));
else {
- // writel((0x8 /*|0x1*/ ), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext | BP10G_MCLK_DATA_OUT |
BP10G_MDIO_DATA_OUT));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, (ctrl &~BP10G_MDIO_DIR));
}
if (pbpctl_dev->bp_10g9) {
ctrl_ext = BPCTL_READ_REG(pbpctl_dev, CTRL_EXT);
else
ctrl_ext = BP10G_READ_REG(pbpctl_dev, EODSDP);
- //ctrl_ext =readl((void *)((pbpctl_dev)->mem_map) + 0x28);
usec_delay(PULSE_TIME);
if (pbpctl_dev->bp_10g9) {
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
- //writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
}
usec_delay(CMND_INTERVAL);
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- // BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
- // writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
}
usec_delay(CMND_INTERVAL * 4);
ctrl_ext = BP10GB_READ_REG(pbpctl_dev, MISC_REG_SPIO);
- //printk("2reg=%x\n", ctrl_ext);
+ printk("2reg=%x\n", ctrl_ext);
#ifdef BP_SYNC_FLAG
spin_unlock_irqrestore(&pbpctl_dev->bypass_wr_lock, flags);
BPCTLI_CTRL_EXT_MCLK_DATA)));
} else {
- // writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
ctrl = BP10G_READ_REG(pbpctl_dev, ESDP);
ctrl_ext = BP10G_READ_REG(pbpctl_dev, EODSDP);
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
BPCTLI_CTRL_EXT_MDIO_DATA)));
else {
- // writel((0x8), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext | BP10G_MCLK_DATA_OUT |
BP10G_MDIO_DATA_OUT));
- // BP10G_WRITE_REG(pbpctl_dev, ESDP, (ctrl &~(BP10G_MDIO_DATA|BP10G_MDIO_DIR)));
}
usec_delay(PULSE_TIME);
BPCTLI_CTRL_EXT_MCLK_DATA)));
} else {
- //writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
ctrl = BP10G_READ_REG(pbpctl_dev, ESDP);
ctrl_ext = BP10G_READ_REG(pbpctl_dev, EODSDP);
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
BPCTLI_CTRL_EXT_MCLK_DATA)));
} else {
- // writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
ctrl = BP10G_READ_REG(pbpctl_dev, ESDP);
ctrl_ext = BP10G_READ_REG(pbpctl_dev, EODSDP);
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
if (pbpctl_dev->bp_10g9) {
(BPCTLI_CTRL_EXT_MDIO_DATA)));
else {
- //writel((0x8), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
((ctrl_ext | BP10G_MCLK_DATA_OUT) &
~BP10G_MDIO_DATA_OUT));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
BPCTLI_CTRL_EXT_MDIO_DATA)));
else {
- //writel((0x0), (void *)(((pbpctl_dev)->mem_map) + 0x28)) ;
BP10G_WRITE_REG(pbpctl_dev, EODSDP,
(ctrl_ext &
~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT)));
- //BP10G_WRITE_REG(pbpctl_dev, ESDP, ((ctrl |BP10G_MDIO_DIR)&~BP10G_MDIO_DATA));
}
if ((pbpctl_dev->wdt_status == WDT_STATUS_EN) /*&&
(pbpctl_dev->bp_ext_ver<PXG4BPFI_VER) */ )
else if (!pbpctl_dev->bp_10g)
ctrl = BPCTL_READ_REG(pbpctl_dev, CTRL);
else
- //ctrl =readl((void *)((pbpctl_dev)->mem_map) + 0x20);
ctrl = BP10G_READ_REG(pbpctl_dev, ESDP);
if (!tx_state)
BPCTLI_CTRL_SWDPIN0));
else
- //writel((ctrl|(0x1|0x100)), (void *)(((pbpctl_dev)->mem_map) + 0x20)) ;
BP10G_WRITE_REG(pbpctl_dev, ESDP,
(ctrl | BP10G_SDP0_DATA |
BP10G_SDP0_DIR));
BPCTLI_CTRL_SDP0_DIR)));
}
} else
- //writel(((ctrl|0x100)&~0x1), (void *)(((pbpctl_dev)->mem_map) + 0x20)) ;
BP10G_WRITE_REG(pbpctl_dev, ESDP,
((ctrl | BP10G_SDP0_DIR) &
~BP10G_SDP0_DATA));
int wdt_time_left(bpctl_dev_t *pbpctl_dev)
{
- //unsigned long curr_time=((long long)(jiffies*1000))/HZ, delta_time=0,wdt_on_time=((long long)(pbpctl_dev->bypass_wdt_on_time*1000))/HZ;
+ /* unsigned long curr_time=((long long)(jiffies*1000))/HZ, delta_time=0,wdt_on_time=((long long)(pbpctl_dev->bypass_wdt_on_time*1000))/HZ; */
unsigned long curr_time = jiffies, delta_time = 0, wdt_on_time =
pbpctl_dev->bypass_wdt_on_time, delta_time_msec = 0;
int time_left = 0;
ret = wdt_pulse_int(pbpctl_dev);
else
ret = send_wdt_pulse(pbpctl_dev);
- //if (ret==-1)
- // mod_timer(&pbpctl_dev->bp_timer, jiffies+1);
+ /* if (ret==-1)
+ mod_timer(&pbpctl_dev->bp_timer, jiffies+1);*/
return 1;
}
return BP_NOT_CAP;
}
}
-//#ifdef PMC_FIX_FLAG
/*WAIT_AT_PWRUP 0x80 */
int bp_wait_at_pwup_en(bpctl_dev_t *pbpctl_dev)
{
return BP_NOT_CAP;
}
-//#endif /*PMC_FIX_FLAG*/
int wdt_exp_mode(bpctl_dev_t *pbpctl_dev, int mode)
{
}
if (pbpctl_dev->bp_ext_ver >= 0x8) {
- //BPCTL_BP_WRITE_REG(pbpctl_dev, CTRL_EXT, (BPCTL_READ_REG(pbpctl_dev_b, CTRL_EXT))&~BPCTLI_CTRL_EXT_SDP7_DIR);
if (pbpctl_dev->bp_10g9) {
ctrl_ext = BP10G_READ_REG(pbpctl_dev_b, I2CCTL);
BP10G_WRITE_REG(pbpctl_dev_b, I2CCTL,
(ctrl_ext | BP10G_I2C_CLK_OUT));
- //return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28))&0x4)!=0?0:1);
return ((BP10G_READ_REG(pbpctl_dev_b, I2CCTL) &
BP10G_I2C_CLK_IN) != 0 ? 0 : 1);
BP10G_WRITE_REG(pbpctl_dev_b, EODSDP,
(ctrl_ext |
BP10G_SDP7_DATA_OUT));
- //return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28))&0x4)!=0?0:1);
return ((BP10G_READ_REG(pbpctl_dev_b, EODSDP) &
BP10G_SDP7_DATA_IN) != 0 ? 0 : 1);
}
BP10G_WRITE_REG(pbpctl_dev_b, EODSDP,
(ctrl_ext |
BP10G_SDP6_DATA_OUT));
- // return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28))&0x1)!=0?0:1);
return ((BP10G_READ_REG(pbpctl_dev_b, EODSDP) &
BP10G_SDP6_DATA_IN) != 0 ? 0 : 1);
}
DISC_OFF_MASK) == DISC_OFF_MASK) ? 1 : 0);
if (pbpctl_dev->bp_i80) {
- // return((((read_reg(pbpctl_dev,STATUS_DISC_REG_ADDR)) & DISC_OFF_MASK)==DISC_OFF_MASK)?1:0);
return (((BPCTL_READ_REG(pbpctl_dev_b, CTRL_EXT)) &
BPCTLI_CTRL_EXT_SDP6_DATA) != 0 ? 1 : 0);
}
if (pbpctl_dev->bp_540) {
ctrl_ext = BP10G_READ_REG(pbpctl_dev_b, ESDP);
- //return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28))&0x4)!=0?0:1);
return ((BP10G_READ_REG(pbpctl_dev_b, ESDP) &
BP10G_SDP2_DATA) != 0 ? 1 : 0);
}
- //if (pbpctl_dev->device==SILICOM_PXG2TBI_SSID) {
if (pbpctl_dev->media_type == bp_copper) {
#if 0
return (((BPCTL_READ_REG(pbpctl_dev_b, CTRL)) &
BPCTLI_CTRL_SWDPIN1) != 0 ? 1 : 0);
else
- // return(((readl((void *)((pbpctl_dev)->mem_map) + 0x20)) & 0x2)!=0?1:0);
return ((BP10G_READ_REG(pbpctl_dev_b, ESDP) &
BP10G_SDP1_DATA) != 0 ? 1 : 0);
BP10G_WRITE_REG(pbpctl_dev_b, I2CCTL,
(ctrl_ext |
BP10G_I2C_DATA_OUT));
- //return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28))&0x4)!=0?0:1);
return ((BP10G_READ_REG(pbpctl_dev_b, I2CCTL) &
BP10G_I2C_DATA_IN) != 0 ? 1 : 0);
BP10G_WRITE_REG(pbpctl_dev_b, EODSDP,
(ctrl_ext |
BP10G_SDP6_DATA_OUT));
- // temp= (((BP10G_READ_REG(pbpctl_dev_b,EODSDP))&BP10G_SDP6_DATA_IN)!=0?1:0);
- //return(((readl((void *)((pbpctl_dev)->mem_map) + 0x28)) & 0x1)!=0?1:0);
return (((BP10G_READ_REG(pbpctl_dev_b, EODSDP))
& BP10G_SDP6_DATA_IN) != 0 ? 1 : 0);
}
if (pbpctl_dev_m->bp_caps_ex & DISC_PORT_CAP_EX) {
if (is_bypass_fn(pbpctl_dev) == 1)
return ret;
- // return((((read_reg(pbpctl_dev,STATUS_TAP_REG_ADDR)) & TX_DISA_MASK)==TX_DISA_MASK)?1:0);
+ /* return((((read_reg(pbpctl_dev,STATUS_TAP_REG_ADDR)) & TX_DISA_MASK)==TX_DISA_MASK)?1:0); */
else
return ret;
- // return((((read_reg(pbpctl_dev,STATUS_TAP_REG_ADDR)) & TX_DISA_MASK)==TX_DISA_MASK)?1:0);
+ /* return((((read_reg(pbpctl_dev,STATUS_TAP_REG_ADDR)) & TX_DISA_MASK)==TX_DISA_MASK)?1:0); */
}
return ret;
return BP_NOT_CAP;
}
-//#ifdef PMC_FIX_FLAG
int bp_wait_at_pwup_status(bpctl_dev_t *pbpctl_dev)
{
return BP_NOT_CAP;
}
-//#endif /*PMC_FIX_FLAG*/
int std_nic_status(bpctl_dev_t *pbpctl_dev)
{
else
pbpctl_dev->media_type = bp_fiber;
- }
- //if (!pbpctl_dev->bp_10g)
- // pbpctl_dev->media_type=((BPCTL_READ_REG(pbpctl_dev, STATUS))&BPCTLI_STATUS_TBIMODE)?bp_fiber:bp_copper;
- else {
+ } else {
if (BP10G_CX4_SERIES(pbpctl_dev->subdevice))
pbpctl_dev->media_type = bp_cx4;
else
pbpctl_dev->media_type = bp_fiber;
}
- //pbpctl_dev->bp_fw_ver=0xa8;
if (is_bypass_fn(pbpctl_dev)) {
pbpctl_dev->bp_caps |= BP_PWOFF_ON_CAP;
return -1;
if (pbpctl_dev->bp_caps & SW_CTL_CAP) {
- //bp_lock(pbp_device_block);
+ /* bp_lock(pbp_device_block); */
cmnd_on(pbpctl_dev);
if (!tap_mode)
bp_wait_at_pwup_dis(pbpctl_dev);
bp_wait_at_pwup_en(pbpctl_dev);
cmnd_off(pbpctl_dev);
- // bp_unlock(pbp_device_block);
+ /* bp_unlock(pbp_device_block); */
return BP_OK;
}
return BP_NOT_CAP;
if (!pbpctl_dev)
return -1;
- // bp_lock(pbp_device_block);
+ /* bp_lock(pbp_device_block); */
ret = bp_wait_at_pwup_status(pbpctl_dev);
- // bp_unlock(pbp_device_block);
+ /* bp_unlock(pbp_device_block); */
return ret;
}
return -1;
if (pbpctl_dev->bp_caps & SW_CTL_CAP) {
- // bp_lock(pbp_device_block);
+ /* bp_lock(pbp_device_block); */
cmnd_on(pbpctl_dev);
if (!tap_mode)
else
bp_hw_reset_en(pbpctl_dev);
cmnd_off(pbpctl_dev);
- // bp_unlock(pbp_device_block);
+ /* bp_unlock(pbp_device_block); */
return BP_OK;
}
return BP_NOT_CAP;
if (!pbpctl_dev)
return -1;
- //bp_lock(pbp_device_block);
+ /* bp_lock(pbp_device_block); */
ret = bp_hw_reset_status(pbpctl_dev);
- //bp_unlock(pbp_device_block);
+ /* bp_unlock(pbp_device_block); */
return ret;
}
int get_dev_idx_bsf(int bus, int slot, int func)
{
int idx_dev = 0;
- //if_scan();
for (idx_dev = 0;
((bpctl_dev_arr[idx_dev].pdev != NULL) && (idx_dev < device_num));
idx_dev++) {
int idx_dev = 0;
struct net_device *dev;
int ifindex;
- //rcu_read_lock();
- //rtnl_lock();
- //rcu_read_lock();
+ /* rcu_read_lock(); */
+ /* rtnl_lock(); */
+ /* rcu_read_lock(); */
#if 1
#if (LINUX_VERSION_CODE >= 0x020618)
for_each_netdev(&init_net, dev)
{
struct ethtool_drvinfo drvinfo;
- // char *str=NULL;
char cbuf[32];
char *buf = NULL;
char res[10];
memcpy(&cbuf, drvinfo.bus_info, 32);
buf = &cbuf[0];
- // while(*buf++){
-
- /*if(*buf==':'){
- buf++;
- break;
- } */
- //}
while (*buf++ != ':') ;
for (i = 0; i < 10; i++, buf++) {
if (*buf == ':')
}
#endif
- //rtnl_unlock();
- //rcu_read_unlock();
+ /* rtnl_unlock(); */
+ /* rcu_read_unlock(); */
}
static bpctl_dev_t *pbpctl_dev;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
- //lock_kernel();
+ /* lock_kernel(); */
#endif
lock_bpctl();
- //local_irq_save(flags);
- /*if(!spin_trylock_irqsave(&bpvm_lock)){
+ /* local_irq_save(flags); */
+ /* if(!spin_trylock_irqsave(&bpvm_lock)){
local_irq_restore(flags);
- //unlock_bpctl();
- //unlock_kernel();
+ unlock_bpctl();
+ unlock_kernel();
return -1;
} */
- //spin_lock_irqsave(&bpvm_lock, flags);
+ /* spin_lock_irqsave(&bpvm_lock, flags); */
/*
* Switch according to the ioctl called
goto bp_exit;
}
- //lock_bpctl();
- //preempt_disable();
+ /* lock_bpctl(); */
+ /* preempt_disable(); */
local_irq_save(flags);
if (!spin_trylock(&bpvm_lock)) {
local_irq_restore(flags);
unlock_bpctl();
- //unlock_kernel();
return -1;
}
-// preempt_disable();
- //rcu_read_lock();
-// spin_lock_irqsave(&bpvm_lock, flags);
+
+/* preempt_disable();
+ rcu_read_lock();
+ spin_lock_irqsave(&bpvm_lock, flags);
+*/
if ((bpctl_cmd.in_param[5]) ||
(bpctl_cmd.in_param[6]) || (bpctl_cmd.in_param[7]))
dev_idx = get_dev_idx_bsf(bpctl_cmd.in_param[5],
dev_idx = get_dev_idx(bpctl_cmd.in_param[1]);
if (dev_idx < 0 || dev_idx > device_num) {
- //unlock_bpctl();
- //preempt_enable();
+ /* unlock_bpctl();
+ preempt_enable(); */
ret = -EOPNOTSUPP;
- //preempt_enable();
- //rcu_read_unlock();
+ /* preempt_enable();
+ rcu_read_unlock(); */
spin_unlock_irqrestore(&bpvm_lock, flags);
goto bp_exit;
}
bpctl_dev_arr[dev_idx].name);
bpctl_cmd.status = -1;
ret = SUCCESS;
- /*preempt_enable(); */
- //rcu_read_unlock();
+ /* preempt_enable(); */
+ /* rcu_read_unlock(); */
spin_unlock_irqrestore(&bpvm_lock, flags);
goto bp_exit;
bpctl_dev_arr[dev_idx].name);
bpctl_cmd.status = -1;
ret = SUCCESS;
- /*preempt_enable(); */
- //rcu_read_unlock();
+ /* preempt_enable(); */
+ /* rcu_read_unlock(); */
spin_unlock_irqrestore(&bpvm_lock, flags);
goto bp_exit;
}
case IOCTL_TX_MSG(GET_BYPASS_CAPS):
bpctl_cmd.status = get_bypass_caps_fn(pbpctl_dev);
/*preempt_enable(); */
- //rcu_read_unlock();
+ /*rcu_read_unlock();*/
spin_unlock_irqrestore(&bpvm_lock, flags);
if (copy_to_user
(argp, (void *)&bpctl_cmd, sizeof(struct bpctl_cmd))) {
- //unlock_bpctl();
- //preempt_enable();
+ /*unlock_bpctl(); */
+ /*preempt_enable(); */
ret = -EFAULT;
goto bp_exit;
}
case IOCTL_TX_MSG(GET_TPL):
bpctl_cmd.status = get_tpl_fn(pbpctl_dev);
break;
-//#ifdef PMC_FIX_FLAG
case IOCTL_TX_MSG(SET_BP_WAIT_AT_PWUP):
bpctl_cmd.status =
set_bp_wait_at_pwup_fn(pbpctl_dev, bpctl_cmd.in_param[2]);
case IOCTL_TX_MSG(GET_BP_HW_RESET):
bpctl_cmd.status = get_bp_hw_reset_fn(pbpctl_dev);
break;
-//#endif
#ifdef BP_SELF_TEST
case IOCTL_TX_MSG(SET_BP_SELF_TEST):
bpctl_cmd.status =
break;
default:
- // unlock_bpctl();
+ /* unlock_bpctl(); */
ret = -EOPNOTSUPP;
- /*preempt_enable(); */
- //rcu_read_unlock();
+ /* preempt_enable(); */
+ /* rcu_read_unlock();*/
spin_unlock_irqrestore(&bpvm_lock, flags);
goto bp_exit;
}
- //unlock_bpctl();
- /*preempt_enable(); */
+ /* unlock_bpctl(); */
+ /* preempt_enable(); */
bpcmd_exit:
- //rcu_read_unlock();
+ /* rcu_read_unlock(); */
spin_unlock_irqrestore(&bpvm_lock, flags);
if (copy_to_user(argp, (void *)&bpctl_cmd, sizeof(struct bpctl_cmd)))
ret = -EFAULT;
ret = SUCCESS;
bp_exit:
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
- //unlock_kernel();
+ /* unlock_kernel(); */
#endif
- //spin_unlock_irqrestore(&bpvm_lock, flags);
+ /* spin_unlock_irqrestore(&bpvm_lock, flags); */
unlock_bpctl();
- //unlock_kernel();
+ /* unlock_kernel(); */
return ret;
}
{BROADCOM_VID, BROADCOM_PE10G2_PID, SILICOM_SVID,
SILICOM_PE10G2BPTT_SSID, PE10G2BPTT, "PE10G2BPTT"},
- //{BROADCOM_VID, BROADCOM_PE10G2_PID, PCI_ANY_ID, PCI_ANY_ID, PE10G2BPTCX4, "PE10G2BPTCX4"},
+ /* {BROADCOM_VID, BROADCOM_PE10G2_PID, PCI_ANY_ID, PCI_ANY_ID, PE10G2BPTCX4, "PE10G2BPTCX4"}, */
{0x8086, 0x10c9, SILICOM_SVID /*PCI_ANY_ID */ ,
SILICOM_PEG4BPI6_SSID /*PCI_ANY_ID */ , PEG4BPI6, "PEG4BPI6"},
{0x8086, 0x10F9, SILICOM_SVID /*PCI_ANY_ID */ ,
SILICOM_PE210G2DBi9SR_SSID, PE210G2DBi9SR, "PE210G2DBi9SR"},
- //{0x8086, 0x10F9, SILICOM_SVID /*PCI_ANY_ID*/, SILICOM_PE210G2DBi9SRRB_SSID , PE210G2DBi9SRRB, "PE210G2DBi9SRRB"},
{0x8086, 0x10F9, SILICOM_SVID /*PCI_ANY_ID */ ,
SILICOM_PE210G2DBi9LR_SSID, PE210G2DBi9LR, "PE210G2DBi9LR"},
- // {0x8086, 0x10F9, SILICOM_SVID /*PCI_ANY_ID*/, SILICOM_PE210G2DBi9LRRB_SSID , PE210G2DBi9LRRB, "PE210G2DBi9LRRB"},
{0x8086, 0x10F9, SILICOM_SVID /*PCI_ANY_ID */ ,
SILICOM_PE310G4DBi940SR_SSID, PE310G4DBi940SR, "PE310G4DBi9SR"},
{0x8086, PCI_ANY_ID, SILICOM_SVID /*PCI_ANY_ID */ ,
SILICOM_PE2G6BPi35_SSID /*PCI_ANY_ID */ , PE2G6BPi35, "PE2G6BPi35"},
- // {0x8086, PCI_ANY_ID, SILICOM_SVID /*PCI_ANY_ID*/,0xaa0,PE2G6BPi35CX,"PE2G6BPi35CX"},
- // {0x8086, PCI_ANY_ID, SILICOM_SVID /*PCI_ANY_ID*/,0xaa1,PE2G6BPi35CX,"PE2G6BPi35CX"},
- // {0x8086, PCI_ANY_ID, SILICOM_SVID /*PCI_ANY_ID*/,0xaa2,PE2G6BPi35CX,"PE2G6BPi35CX"},
{0x8086, PCI_ANY_ID, SILICOM_SVID /*PCI_ANY_ID */ , 0xaa0, PE2G6BPi35CX,
"PE2G6BPi35CX"},
tx_ctl_pci_tbl[idx].subdevice;
bpctl_dev_arr[idx_dev].subvendor =
tx_ctl_pci_tbl[idx].subvendor;
- //bpctl_dev_arr[idx_dev].pdev=pdev1;
+ /* bpctl_dev_arr[idx_dev].pdev=pdev1; */
bpctl_dev_arr[idx_dev].func = PCI_FUNC(pdev1->devfn);
bpctl_dev_arr[idx_dev].slot = PCI_SLOT(pdev1->devfn);
bpctl_dev_arr[idx_dev].bus = pdev1->bus->number;
}
}
- //bpctl_dev_arr[idx_dev].bp_fw_ver=0xa8;
+ /* bpctl_dev_arr[idx_dev].bp_fw_ver=0xa8; */
printk("firmware version: 0x%x\n",
bpctl_dev_arr[idx_dev].
bp_fw_ver);
#ifdef BP_PROC_SUPPORT
{
int i = 0;
- //unsigned long flags;
- //rcu_read_lock();
+ /* unsigned long flags; */
+ /* rcu_read_lock(); */
bp_proc_create();
for (i = 0; i < device_num; i++) {
if (bpctl_dev_arr[i].ifindex) {
- //spin_lock_irqsave(&bpvm_lock, flags);
+ /* spin_lock_irqsave(&bpvm_lock, flags); */
bypass_proc_remove_dev_sd(&bpctl_dev_arr[i]);
bypass_proc_create_dev_sd(&bpctl_dev_arr[i]);
- //spin_unlock_irqrestore(&bpvm_lock, flags);
+ /* spin_unlock_irqrestore(&bpvm_lock, flags); */
}
}
- //rcu_read_unlock();
+ /* rcu_read_unlock(); */
}
#endif
- //register_netdevice_notifier(&bp_notifier_block);
return 0;
}
#endif
for (i = 0; i < device_num; i++) {
- //unsigned long flags;
+ /* unsigned long flags; */
#ifdef BP_PROC_SUPPORT
-//spin_lock_irqsave(&bpvm_lock, flags);
-//rcu_read_lock();
+/* spin_lock_irqsave(&bpvm_lock, flags);
+ rcu_read_lock(); */
bypass_proc_remove_dev_sd(&bpctl_dev_arr[i]);
-//spin_unlock_irqrestore(&bpvm_lock, flags);
-//rcu_read_unlock();
+/* spin_unlock_irqrestore(&bpvm_lock, flags);
+ rcu_read_unlock(); */
#endif
remove_bypass_wd_auto(&bpctl_dev_arr[i]);
bpctl_dev_arr[i].reset_time = 0;