s390: claw and ctcm patches
Subsystems (4)
cover s390: claw and ctcm patches
Dave,
these patches repair warnings seen with the linux-2.6.git 2.6.35 caused by the used constants READ / WRITE.
The patches apply on linux-2.6.git and net-next-2.6.git.
shortlog:
Heiko Carstens (1)
claw: rename READ/WRITE defines to avoid redefinitions
Ursula Braun (1)
ctcm: rename READ/WRITE defines to avoid redefinitions
Thanks,
Ursula
PATCH 1/2 claw: rename READ/WRITE defines to avoid redefinitions
From: Heiko Carstens <[email protected]>
READ/WRITE seems to be a bit too generic for defines in a device driver. Just rename them to READ_CHANNEL/WRITE_CHANNEL which should suffice.
Fixes this:
In file included from drivers/s390/net/claw.c:93:drivers/s390/net/claw.h:78:1: warning: "WRITE" redefined
In file included from /home2/heicarst/linux-2.6/arch/s390/include/asm/debug.h:12,
from drivers/s390/net/claw.c:68:
include/linux/fs.h:156:1: warning: this is the location of the previous definition
---
drivers/s390/net/claw.c | 118 ++++++++++++++++++++++++------------------------ drivers/s390/net/claw.h | 4 - 2 files changed, 61 insertions(+), 61 deletions(-)
drivers/s390/net/claw.c +59 -59
@@ -386,7 +386,7 @@ claw_tx(struct sk_buff *skb, struct net_struct chbk *p_ch;CLAW_DBF_TEXT (4 , trace,"claw_tx" ); - p_ch=&privptr->channel[WRITE ]; + p_ch = &privptr->channel[WRITE_CHANNEL ];spin_lock_irqsave (get_ccwdev_lock (p_ch->cdev), saveflags); rc=claw_hw_tx ( skb, dev,1 );spin_unlock_irqrestore (get_ccwdev_lock (p_ch->cdev), saveflags);
@@ -407,7 +407,7 @@ static struct sk_buff * claw_pack_skb(struct claw_privbk *privptr) {struct sk_buff *new_skb,*held_skb; -struct chbk *p_ch = &privptr->channel[WRITE ]; +struct chbk *p_ch = &privptr->channel[WRITE_CHANNEL ];struct claw_env *p_env = privptr->p_env;int pkt_cnt,pk_ind,so_far;
@@ -515,15 +515,15 @@ claw_open(struct net_device *dev) privptr->p_env->write_size=CLAW_FRAME_SIZE ; }claw_set_busy (dev); -tasklet_init (&privptr->channel[READ ].tasklet, claw_irq_tasklet, - (unsigned long ) &privptr->channel[READ ]); +tasklet_init (&privptr->channel[READ_CHANNEL ].tasklet, claw_irq_tasklet, + (unsigned long ) &privptr->channel[READ_CHANNEL ]);for ( i =0 ; i <2 ; i++) {CLAW_DBF_TEXT_ (2 , trace,"opn_ch%d" , i);init_waitqueue_head (&privptr->channel[i].wait);/* skb_queue_head_init(&p_ch->io_queue); */ -if (i ==WRITE ) +if (i ==WRITE_CHANNEL )skb_queue_head_init ( - &privptr->channel[WRITE ].collect_queue); + &privptr->channel[WRITE_CHANNEL ].collect_queue); privptr->channel[i].flag_a =0 ; privptr->channel[i].IO_active =0 ; privptr->channel[i].flag &= ~CLAW_TIMER ;
@@ -551,12 +551,12 @@ claw_open(struct net_device *dev)if ((privptr->channel[i].flag &CLAW_TIMER ) ==0x00 )del_timer (&timer); } -if ((((privptr->channel[READ ].last_dstat | - privptr->channel[WRITE ].last_dstat) & +if ((((privptr->channel[READ_CHANNEL ].last_dstat | + privptr->channel[WRITE_CHANNEL ].last_dstat) & ~(DEV_STAT_CHN_END |DEV_STAT_DEV_END )) !=0x00 ) || - (((privptr->channel[READ ].flag | - privptr->channel[WRITE ].flag) &CLAW_TIMER ) !=0x00 )) { -dev_info (&privptr->channel[READ ].cdev->dev, + (((privptr->channel[READ_CHANNEL ].flag | + privptr->channel[WRITE_CHANNEL ].flag) &CLAW_TIMER ) !=0x00 )) { +dev_info (&privptr->channel[READ_CHANNEL ].cdev->dev,"%s: remote side is not ready\n" , dev->name);CLAW_DBF_TEXT (2 , trace,"notrdy" );
@@ -608,8 +608,8 @@ claw_open(struct net_device *dev) } } privptr->buffs_alloc =0 ; - privptr->channel[READ ].flag=0x00 ; - privptr->channel[WRITE ].flag =0x00 ; + privptr->channel[READ_CHANNEL ].flag =0x00 ; + privptr->channel[WRITE_CHANNEL ].flag =0x00 ; privptr->p_buff_ccw=NULL ; privptr->p_buff_read=NULL ; privptr->p_buff_write=NULL ;
@@ -652,10 +652,10 @@ claw_irq_handler(struct ccw_device *cdev }/* Try to extract channel from driver data. */ -if (privptr->channel[READ ].cdev == cdev) - p_ch = &privptr->channel[READ ]; -else if (privptr->channel[WRITE ].cdev == cdev) - p_ch = &privptr->channel[WRITE ]; +if (privptr->channel[READ_CHANNEL ].cdev == cdev) + p_ch = &privptr->channel[READ_CHANNEL ]; +else if (privptr->channel[WRITE_CHANNEL ].cdev == cdev) + p_ch = &privptr->channel[WRITE_CHANNEL ];else {dev_warn (&cdev->dev,"The device is not a CLAW device\n" );CLAW_DBF_TEXT (2 , trace,"badchan" );
@@ -813,7 +813,7 @@ claw_irq_handler(struct ccw_device *cdevclaw_clearbit_busy (TB_TX , dev);claw_clear_busy (dev); } - p_ch_r = (struct chbk *)&privptr->channel[READ ]; + p_ch_r = (struct chbk *)&privptr->channel[READ_CHANNEL ];if (test_and_set_bit (CLAW_BH_ACTIVE , (void *)&p_ch_r->flag_a) ==0 )tasklet_schedule (&p_ch_r->tasklet);
@@ -878,13 +878,13 @@ claw_release(struct net_device *dev)for ( i =1 ; i >=0 ; i--) {spin_lock_irqsave (get_ccwdev_lock (privptr->channel[i].cdev), saveflags); -/* del_timer(&privptr->channel[READ].timer); */ +/* del_timer(&privptr->channel[READ_CHANNEL].timer); */ privptr->channel[i].claw_state =CLAW_STOP ; privptr->channel[i].IO_active =0 ; parm = (unsigned long ) &privptr->channel[i]; -if (i ==WRITE ) +if (i ==WRITE_CHANNEL )claw_purge_skb_queue ( - &privptr->channel[WRITE ].collect_queue); + &privptr->channel[WRITE_CHANNEL ].collect_queue); rc =ccw_device_halt (privptr->channel[i].cdev, parm);if (privptr->system_validate_comp==0x00 )/* never opened? */ init_waitqueue_head (&privptr->channel[i].wait);
@@ -971,16 +971,16 @@ claw_release(struct net_device *dev) privptr->mtc_skipping =1 ; privptr->mtc_offset=0 ; -if (((privptr->channel[READ ].last_dstat | - privptr->channel[WRITE ].last_dstat) & +if (((privptr->channel[READ_CHANNEL ].last_dstat | + privptr->channel[WRITE_CHANNEL ].last_dstat) & ~(DEV_STAT_CHN_END |DEV_STAT_DEV_END )) !=0x00 ) { -dev_warn (&privptr->channel[READ ].cdev->dev, +dev_warn (&privptr->channel[READ_CHANNEL ].cdev->dev,"Deactivating %s completed with incorrect" " subchannel status " "(read %02x, write %02x)\n" , dev->name, - privptr->channel[READ ].last_dstat, - privptr->channel[WRITE ].last_dstat); + privptr->channel[READ_CHANNEL ].last_dstat, + privptr->channel[WRITE_CHANNEL ].last_dstat);CLAW_DBF_TEXT (2 , trace,"badclose" ); }CLAW_DBF_TEXT (4 , trace,"rlsexit" );
@@ -1324,7 +1324,7 @@ claw_hw_tx(struct sk_buff *skb, struct nCLAW_DBF_TEXT (4 , trace,"hw_tx" ); privptr = (struct claw_privbk *)(dev->ml_priv); - p_ch=(struct chbk *)&privptr->channel[WRITE ]; + p_ch = (struct chbk *)&privptr->channel[WRITE_CHANNEL ]; p_env =privptr->p_env;claw_free_wrt_buf (dev);/* Clean up free chain if posible */ /* scan the write queue to free any completed write packets */
@@ -1357,7 +1357,7 @@ claw_hw_tx(struct sk_buff *skb, struct nclaw_strt_out_IO (dev );claw_free_wrt_buf ( dev );if (privptr->write_free_count==0 ) { - ch = &privptr->channel[WRITE ]; + ch = &privptr->channel[WRITE_CHANNEL ];atomic_inc (&skb->users);skb_queue_tail (&ch->collect_queue, skb); goto Done;
@@ -1369,7 +1369,7 @@ claw_hw_tx(struct sk_buff *skb, struct n }/* tx lock */ if (claw_test_and_setbit_busy (TB_TX ,dev)) {/* set to busy */ - ch = &privptr->channel[WRITE ]; + ch = &privptr->channel[WRITE_CHANNEL ];atomic_inc (&skb->users);skb_queue_tail (&ch->collect_queue, skb);claw_strt_out_IO (dev );
@@ -1385,7 +1385,7 @@ claw_hw_tx(struct sk_buff *skb, struct n privptr->p_write_free_chain == NULL ) {claw_setbit_busy (TB_NOBUFFER ,dev); - ch = &privptr->channel[WRITE ]; + ch = &privptr->channel[WRITE_CHANNEL ];atomic_inc (&skb->users);skb_queue_tail (&ch->collect_queue, skb);CLAW_DBF_TEXT (2 , trace,"clawbusy" );
@@ -1397,7 +1397,7 @@ claw_hw_tx(struct sk_buff *skb, struct nwhile (len_of_data >0 ) { p_this_ccw=privptr->p_write_free_chain;/* get a block */ if (p_this_ccw ==NULL ) {/* lost the race */ - ch = &privptr->channel[WRITE ]; + ch = &privptr->channel[WRITE_CHANNEL ];atomic_inc (&skb->users);skb_queue_tail (&ch->collect_queue, skb); goto Done2;
@@ -2067,7 +2067,7 @@ claw_process_control( struct net_device*catch up to each other */ privptr = dev->ml_priv; p_env=privptr->p_env; - tdev = &privptr->channel[READ ].cdev->dev; + tdev = &privptr->channel[READ_CHANNEL ].cdev->dev;memcpy ( &temp_host_name, p_env->host_name,8 );memcpy ( &temp_ws_name, p_env->adapter_name ,8 ); dev_info(tdev, "%s: CLAW device %.8s: "
@@ -2245,7 +2245,7 @@ claw_process_control( struct net_device dev->name, temp_ws_name, p_ctlbk->linkid); privptr->active_link_ID = p_ctlbk->linkid; - p_ch = &privptr->channel[WRITE ]; + p_ch = &privptr->channel[WRITE_CHANNEL ];wake_up (&p_ch->wait);/* wake up claw_open ( WRITE) */ break ;case CONNECTION_RESPONSE :
@@ -2296,7 +2296,7 @@ claw_process_control( struct net_device "%s: Confirmed Now packing\n", dev->name); p_env->packing =DO_PACKED ; } - p_ch = &privptr->channel[WRITE ]; + p_ch = &privptr->channel[WRITE_CHANNEL ];wake_up (&p_ch->wait); }else { dev_warn(tdev, "Activating %s failed because of"
@@ -2556,7 +2556,7 @@ unpack_read(struct net_device *dev ) p_packd=NULL ; privptr = dev->ml_priv; - p_dev = &privptr->channel[READ ].cdev->dev; + p_dev = &privptr->channel[READ_CHANNEL ].cdev->dev; p_env = privptr->p_env; p_this_ccw=privptr->p_read_active_first;while (p_this_ccw!=NULL && p_this_ccw->header.flag!=CLAW_PENDING ) {
@@ -2728,7 +2728,7 @@ claw_strt_read (struct net_device *dev,struct ccwbk *p_ccwbk;struct chbk *p_ch;struct clawh *p_clawh; - p_ch=&privptr->channel[READ ]; + p_ch = &privptr->channel[READ_CHANNEL ];CLAW_DBF_TEXT (4 , trace,"StRdNter" ); p_clawh=(struct clawh *)privptr->p_claw_signal_blk;
@@ -2782,7 +2782,7 @@ claw_strt_out_IO( struct net_device *devreturn ; } privptr = (struct claw_privbk *)dev->ml_priv; - p_ch=&privptr->channel[WRITE ]; + p_ch = &privptr->channel[WRITE_CHANNEL ];CLAW_DBF_TEXT (4 , trace,"strt_io" ); p_first_ccw=privptr->p_write_active_first;
@@ -2875,7 +2875,7 @@ claw_free_netdevice(struct net_device *if (dev->flags &IFF_RUNNING )claw_release (dev);if (privptr) { - privptr->channel[READ ].ndev =NULL ;/* say it's free */ + privptr->channel[READ_CHANNEL ].ndev =NULL ;/* say it's free */ } dev->ml_priv =NULL ;#ifdef MODULE
@@ -2960,18 +2960,18 @@ claw_new_device(struct ccwgroup_device *struct ccw_dev_id dev_id;dev_info (&cgdev->dev,"add for %s\n" , -dev_name (&cgdev->cdev[READ ]->dev)); +dev_name (&cgdev->cdev[READ_CHANNEL ]->dev));CLAW_DBF_TEXT (2 , setup,"new_dev" ); privptr =dev_get_drvdata (&cgdev->dev); -dev_set_drvdata (&cgdev->cdev[READ ]->dev, privptr); -dev_set_drvdata (&cgdev->cdev[WRITE ]->dev, privptr); +dev_set_drvdata (&cgdev->cdev[READ_CHANNEL ]->dev, privptr); +dev_set_drvdata (&cgdev->cdev[WRITE_CHANNEL ]->dev, privptr);if (!privptr)return -ENODEV ; p_env = privptr->p_env; -ccw_device_get_id (cgdev->cdev[READ ], &dev_id); - p_env->devno[READ ] = dev_id.devno; -ccw_device_get_id (cgdev->cdev[WRITE ], &dev_id); - p_env->devno[WRITE ] = dev_id.devno; +ccw_device_get_id (cgdev->cdev[READ_CHANNEL ], &dev_id); + p_env->devno[READ_CHANNEL ] = dev_id.devno; +ccw_device_get_id (cgdev->cdev[WRITE_CHANNEL ], &dev_id); + p_env->devno[WRITE_CHANNEL ] = dev_id.devno; ret =add_channel (cgdev->cdev[0 ],0 ,privptr);if (ret ==0 ) ret =add_channel (cgdev->cdev[1 ],1 ,privptr);
@@ -2980,14 +2980,14 @@ claw_new_device(struct ccwgroup_device * " failed with error code %d\n", ret); goto out; } - ret =ccw_device_set_online (cgdev->cdev[READ ]); + ret =ccw_device_set_online (cgdev->cdev[READ_CHANNEL ]);if (ret !=0 ) {dev_warn (&cgdev->dev,"Setting the read subchannel online" " failed with error code %d\n" , ret); goto out; } - ret =ccw_device_set_online (cgdev->cdev[WRITE ]); + ret =ccw_device_set_online (cgdev->cdev[WRITE_CHANNEL ]);if (ret !=0 ) {dev_warn (&cgdev->dev, "Setting the write subchannel online "
@@ -3002,8 +3002,8 @@ claw_new_device(struct ccwgroup_device * } dev->ml_priv = privptr;dev_set_drvdata (&cgdev->dev, privptr); -dev_set_drvdata (&cgdev->cdev[READ ]->dev, privptr); -dev_set_drvdata (&cgdev->cdev[WRITE ]->dev, privptr); +dev_set_drvdata (&cgdev->cdev[READ_CHANNEL ]->dev, privptr); +dev_set_drvdata (&cgdev->cdev[WRITE_CHANNEL ]->dev, privptr);/* sysfs magic */ SET_NETDEV_DEV (dev, &cgdev->dev);if (register_netdev (dev) !=0 ) {
@@ -3021,16 +3021,16 @@ claw_new_device(struct ccwgroup_device * goto out; } } - privptr->channel[READ ].ndev = dev; - privptr->channel[WRITE ].ndev = dev; + privptr->channel[READ_CHANNEL ].ndev = dev; + privptr->channel[WRITE_CHANNEL ].ndev = dev; privptr->p_env->ndev = dev;dev_info (&cgdev->dev,"%s:readsize=%d writesize=%d " "readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n" , dev->name, p_env->read_size, p_env->write_size, p_env->read_buffers, - p_env->write_buffers, p_env->devno[READ ], - p_env->devno[WRITE ]); + p_env->write_buffers, p_env->devno[READ_CHANNEL ], + p_env->devno[WRITE_CHANNEL ]); dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name " ":%.8s api_type: %.8s\n", dev->name, p_env->host_name,
@@ -3072,10 +3072,10 @@ claw_shutdown_device(struct ccwgroup_dev priv =dev_get_drvdata (&cgdev->dev);if (!priv)return -ENODEV ; - ndev = priv->channel[READ ].ndev; + ndev = priv->channel[READ_CHANNEL ].ndev;if (ndev) {/* Close the device */ -dev_info (&cgdev->dev,"%s: shutting down \n" , +dev_info (&cgdev->dev,"%s: shutting down\n" , ndev->name);if (ndev->flags &IFF_RUNNING ) ret =claw_release (ndev);
@@ -3083,8 +3083,8 @@ claw_shutdown_device(struct ccwgroup_devunregister_netdev (ndev); ndev->ml_priv =NULL ;/* cgdev data, not ndev's to free */ claw_free_netdevice (ndev,1 ); - priv->channel[READ ].ndev =NULL ; - priv->channel[WRITE ].ndev =NULL ; + priv->channel[READ_CHANNEL ].ndev =NULL ; + priv->channel[WRITE_CHANNEL ].ndev =NULL ; priv->p_env->ndev =NULL ; }ccw_device_set_offline (cgdev->cdev[1 ]);
@@ -3115,8 +3115,8 @@ claw_remove_device(struct ccwgroup_devic priv->channel[1 ].irb=NULL ;kfree (priv);dev_set_drvdata (&cgdev->dev,NULL ); -dev_set_drvdata (&cgdev->cdev[READ ]->dev,NULL ); -dev_set_drvdata (&cgdev->cdev[WRITE ]->dev,NULL ); +dev_set_drvdata (&cgdev->cdev[READ_CHANNEL ]->dev,NULL ); +dev_set_drvdata (&cgdev->cdev[WRITE_CHANNEL ]->dev,NULL );put_device (&cgdev->dev);return ;
drivers/s390/net/claw.h +2 -2
@@ -74,8 +74,8 @@#define MAX_ENVELOPE_SIZE 65536#define CLAW_DEFAULT_MTU_SIZE 4096#define DEF_PACK_BUFSIZE 32768 -#define READ 0 -#define WRITE 1 +#define READ_CHANNEL 0 +#define WRITE_CHANNEL 1#define TB_TX 0/* sk buffer handling in process */ #define TB_STOP 1/* network device stop in process */
PATCH 2/2 ctcm: rename READ/WRITE defines to avoid redefinitions
In reply to Ursula BraunFrom: Ursula Braun <[email protected]>
READ/WRITE seems to be a bit too generic for defines in a device driver. Just rename them to CTCM_READ/CTCM_WRITE to avoid warnings.
---
drivers/s390/net/ctcm_fsms.c | 60 ++++++++++++++++--------------- drivers/s390/net/ctcm_main.c | 80 +++++++++++++++++++++--------------------- drivers/s390/net/ctcm_main.h | 4 +- drivers/s390/net/ctcm_mpc.c | 64 +++++++++++++++++---------------- drivers/s390/net/ctcm_sysfs.c | 20 +++++----- 5 files changed, 118 insertions(+), 110 deletions(-)
drivers/s390/net/ctcm_fsms.c +31 -29
@@ -454,7 +454,7 @@ static void chx_firstio(fsm_instance *fiif ((fsmstate ==CTC_STATE_SETUPWAIT ) && (ch->protocol ==CTCM_PROTO_OS390 )) {/* OS/390 resp. z/OS */ -if (CHANNEL_DIRECTION (ch->flags) ==READ ) { +if (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) { *((__u16 *)ch->trans_skb->data) =CTCM_INITIAL_BLOCKLEN ;fsm_addtimer (&ch->timer,CTCM_TIME_5_SEC ,CTC_EVENT_TIMER , ch);
@@ -472,14 +472,14 @@ static void chx_firstio(fsm_instance *fi* if in compatibility mode, since VM TCP delays the initial * frame until it has some data to send. */ -if ((CHANNEL_DIRECTION (ch->flags) ==WRITE ) || +if ((CHANNEL_DIRECTION (ch->flags) ==CTCM_WRITE ) || (ch->protocol !=CTCM_PROTO_S390 ))fsm_addtimer (&ch->timer,CTCM_TIME_5_SEC ,CTC_EVENT_TIMER , ch); *((__u16 *)ch->trans_skb->data) =CTCM_INITIAL_BLOCKLEN ; ch->ccw[1 ].count =2 ;/* Transfer only length */ -fsm_newstate (fi, (CHANNEL_DIRECTION (ch->flags) ==READ ) +fsm_newstate (fi, (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) ?CTC_STATE_RXINIT :CTC_STATE_TXINIT ); rc =ccw_device_start (ch->cdev, &ch->ccw[0 ], (unsigned long )ch,0xff ,0 );
@@ -495,7 +495,7 @@ static void chx_firstio(fsm_instance *fi* reply from VM TCP which brings up the RX channel to it's * final state. */ -if ((CHANNEL_DIRECTION (ch->flags) ==READ ) && +if ((CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) && (ch->protocol ==CTCM_PROTO_S390 )) {struct net_device *dev = ch->netdev;struct ctcm_priv *priv = dev->ml_priv;
@@ -600,15 +600,15 @@ static void ctcm_chx_start(fsm_instanceint rc;CTCM_DBF_TEXT_ (SETUP ,CTC_DBF_INFO ,"%s(%s): %s" , -CTCM_FUNTAIL , ch->id, - (CHANNEL_DIRECTION (ch->flags) ==READ ) ?"RX" :"TX" ); +CTCM_FUNTAIL , ch->id, + (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) ?"RX" :"TX" );if (ch->trans_skb !=NULL ) {clear_normalized_cda (&ch->ccw[1 ]);dev_kfree_skb (ch->trans_skb); ch->trans_skb =NULL ; } -if (CHANNEL_DIRECTION (ch->flags) ==READ ) { +if (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) { ch->ccw[1 ].cmd_code =CCW_CMD_READ ; ch->ccw[1 ].flags =CCW_FLAG_SLI ; ch->ccw[1 ].count =0 ;
@@ -622,7 +622,8 @@ static void ctcm_chx_start(fsm_instance"%s(%s): %s trans_skb alloc delayed " "until first transfer" ,CTCM_FUNTAIL , ch->id, - (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); + (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) ? + "RX" : "TX"); } ch->ccw[0 ].cmd_code =CCW_CMD_PREPARE ; ch->ccw[0 ].flags =CCW_FLAG_SLI |CCW_FLAG_CC ;
@@ -720,7 +721,7 @@ static void ctcm_chx_cleanup(fsm_instanc ch->th_seg =0x00 ; ch->th_seq_num =0x00 ; -if (CHANNEL_DIRECTION (ch->flags) ==READ ) { +if (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) {skb_queue_purge (&ch->io_queue);fsm_event (priv->fsm,DEV_EVENT_RXDOWN , dev); }else {
@@ -799,7 +800,8 @@ static void ctcm_chx_setuperr(fsm_instanfsm_newstate (fi,CTC_STATE_STARTRETRY );fsm_deltimer (&ch->timer);fsm_addtimer (&ch->timer,CTCM_TIME_5_SEC ,CTC_EVENT_TIMER , ch); -if (!IS_MPC (ch) && (CHANNEL_DIRECTION (ch->flags) ==READ )) { +if (!IS_MPC (ch) && + (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ )) {int rc =ccw_device_halt (ch->cdev, (unsigned long )ch);if (rc !=0 ) ctcm_ccw_check_rc(ch, rc,
@@ -811,10 +813,10 @@ static void ctcm_chx_setuperr(fsm_instanCTCM_DBF_TEXT_ (ERROR ,CTC_DBF_CRIT ,"%s(%s) : %s error during %s channel setup state=%s\n" ,CTCM_FUNTAIL , dev->name, ctc_ch_event_names[event], - (CHANNEL_DIRECTION (ch->flags) ==READ ) ?"RX" :"TX" , + (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) ?"RX" :"TX" ,fsm_getstate_str (fi)); -if (CHANNEL_DIRECTION (ch->flags) ==READ ) { +if (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) {fsm_newstate (fi,CTC_STATE_RXERR );fsm_event (priv->fsm,DEV_EVENT_RXDOWN , dev); }else {
@@ -945,7 +947,7 @@ static void ctcm_chx_rxdisc(fsm_instancefsm_event (priv->fsm,DEV_EVENT_TXDOWN , dev);fsm_newstate (fi,CTC_STATE_DTERM ); - ch2 = priv->channel[WRITE ]; + ch2 = priv->channel[CTCM_WRITE ];fsm_newstate (ch2->fsm,CTC_STATE_DTERM );ccw_device_halt (ch->cdev, (unsigned long )ch);
@@ -1074,13 +1076,13 @@ static void ctcm_chx_iofatal(fsm_instancfsm_deltimer (&ch->timer);CTCM_DBF_TEXT_ (ERROR ,CTC_DBF_ERROR ,"%s: %s: %s unrecoverable channel error" , -CTCM_FUNTAIL , ch->id, rd ==READ ?"RX" :"TX" ); +CTCM_FUNTAIL , ch->id, rd ==CTCM_READ ?"RX" :"TX" );if (IS_MPC (ch)) { priv->stats.tx_dropped++; priv->stats.tx_errors++; } -if (rd ==READ ) { +if (rd ==CTCM_READ ) {fsm_newstate (fi,CTC_STATE_RXERR );fsm_event (priv->fsm,DEV_EVENT_RXDOWN , dev); }else {
@@ -1503,7 +1505,7 @@ static void ctcmpc_chx_firstio(fsm_instaswitch (fsm_getstate (fi)) {case CTC_STATE_STARTRETRY :case CTC_STATE_SETUPWAIT : -if (CHANNEL_DIRECTION (ch->flags) ==READ ) { +if (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) {ctcmpc_chx_rxidle (fi, event, arg); }else {fsm_newstate (fi,CTC_STATE_TXIDLE );
@@ -1514,7 +1516,7 @@ static void ctcmpc_chx_firstio(fsm_instabreak ; }; -fsm_newstate (fi, (CHANNEL_DIRECTION (ch->flags) ==READ ) +fsm_newstate (fi, (CHANNEL_DIRECTION (ch->flags) ==CTCM_READ ) ?CTC_STATE_RXINIT :CTC_STATE_TXINIT ); done:
@@ -1753,8 +1755,8 @@ static void ctcmpc_chx_send_sweep(fsm_instruct net_device *dev = ach->netdev;struct ctcm_priv *priv = dev->ml_priv;struct mpc_group *grp = priv->mpcg; -struct channel *wch = priv->channel[WRITE ]; -struct channel *rch = priv->channel[READ ]; +struct channel *wch = priv->channel[CTCM_WRITE ]; +struct channel *rch = priv->channel[CTCM_READ ];struct sk_buff *skb;struct th_sweep *header;int rc =0 ;
@@ -2070,7 +2072,7 @@ static void dev_action_start(fsm_instancfsm_newstate (fi,DEV_STATE_STARTWAIT_RXTX );if (IS_MPC (priv)) priv->mpcg->channels_terminating =0 ; -for (direction =READ ; direction <=WRITE ; direction++) { +for (direction =CTCM_READ ; direction <=CTCM_WRITE ; direction++) {struct channel *ch = priv->channel[direction];fsm_event (ch->fsm,CTC_EVENT_START , ch); }
@@ -2092,7 +2094,7 @@ static void dev_action_stop(fsm_instanceCTCMY_DBF_DEV_NAME (SETUP , dev,"" );fsm_newstate (fi,DEV_STATE_STOPWAIT_RXTX ); -for (direction =READ ; direction <=WRITE ; direction++) { +for (direction =CTCM_READ ; direction <=CTCM_WRITE ; direction++) {struct channel *ch = priv->channel[direction];fsm_event (ch->fsm,CTC_EVENT_STOP , ch); ch->th_seq_num =0x00 ;
@@ -2183,11 +2185,11 @@ static void dev_action_chup(fsm_instanceif (IS_MPC (priv)) {if (event ==DEV_EVENT_RXUP ) -mpc_channel_action (priv->channel[READ ], -READ ,MPC_CHANNEL_ADD ); +mpc_channel_action (priv->channel[CTCM_READ ], +CTCM_READ ,MPC_CHANNEL_ADD );else -mpc_channel_action (priv->channel[WRITE ], -WRITE ,MPC_CHANNEL_ADD ); +mpc_channel_action (priv->channel[CTCM_WRITE ], +CTCM_WRITE ,MPC_CHANNEL_ADD ); } }
@@ -2239,11 +2241,11 @@ static void dev_action_chdown(fsm_instan }if (IS_MPC (priv)) {if (event ==DEV_EVENT_RXDOWN ) -mpc_channel_action (priv->channel[READ ], -READ ,MPC_CHANNEL_REMOVE ); +mpc_channel_action (priv->channel[CTCM_READ ], +CTCM_READ ,MPC_CHANNEL_REMOVE );else -mpc_channel_action (priv->channel[WRITE ], -WRITE ,MPC_CHANNEL_REMOVE ); +mpc_channel_action (priv->channel[CTCM_WRITE ], +CTCM_WRITE ,MPC_CHANNEL_REMOVE ); } }
drivers/s390/net/ctcm_main.c +41 -39
193 lines not on this page · raw message
drivers/s390/net/ctcm_main.h +2 -2
@@ -111,8 +111,8 @@ enum ctcm_channel_types {#define CTCM_INITIAL_BLOCKLEN 2 -#define READ 0 -#define WRITE 1 +#define CTCM_READ 0 +#define CTCM_WRITE 1#define CTCM_ID_SIZE 20+3
drivers/s390/net/ctcm_mpc.c +34 -30
178 lines not on this page · raw message
drivers/s390/net/ctcm_sysfs.c +10 -10
@@ -38,8 +38,8 @@ static ssize_t ctcm_buffer_write(structint bs1;struct ctcm_priv *priv =dev_get_drvdata (dev); -if (!(priv && priv->channel[READ ] && - (ndev = priv->channel[READ ]->netdev))) { + ndev = priv->channel[CTCM_READ ]->netdev; +if (!(priv && priv->channel[CTCM_READ ] && ndev)) {CTCM_DBF_TEXT (SETUP ,CTC_DBF_ERROR ,"bfnondev" );return -ENODEV ; }
@@ -55,12 +55,12 @@ static ssize_t ctcm_buffer_write(struct (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2))) goto einval; - priv->channel[READ ]->max_bufsize = bs1; - priv->channel[WRITE ]->max_bufsize = bs1; + priv->channel[CTCM_READ ]->max_bufsize = bs1; + priv->channel[CTCM_WRITE ]->max_bufsize = bs1;if (!(ndev->flags &IFF_RUNNING )) ndev->mtu = bs1 -LL_HEADER_LENGTH -2 ; - priv->channel[READ ]->flags |=CHANNEL_FLAGS_BUFSIZE_CHANGED ; - priv->channel[WRITE ]->flags |=CHANNEL_FLAGS_BUFSIZE_CHANGED ; + priv->channel[CTCM_READ ]->flags |=CHANNEL_FLAGS_BUFSIZE_CHANGED ; + priv->channel[CTCM_WRITE ]->flags |=CHANNEL_FLAGS_BUFSIZE_CHANGED ;CTCM_DBF_DEV (SETUP , ndev, buf);return count;
@@ -85,9 +85,9 @@ static void ctcm_print_statistics(struct p +=sprintf (p," Device FSM state: %s\n" ,fsm_getstate_str (priv->fsm)); p +=sprintf (p," RX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[READ ]->fsm)); +fsm_getstate_str (priv->channel[CTCM_READ ]->fsm)); p +=sprintf (p," TX channel FSM state: %s\n" , -fsm_getstate_str (priv->channel[WRITE ]->fsm)); +fsm_getstate_str (priv->channel[CTCM_WRITE ]->fsm)); p +=sprintf (p," Max. TX buffer used: %ld\n" , priv->channel[WRITE ]->prof.maxmulti); p += sprintf(p, " Max. chained SKBs: %ld\n",
@@ -102,7 +102,7 @@ static void ctcm_print_statistics(struct priv->channel[WRITE]->prof.tx_time);printk (KERN_INFO "Statistics for %s:\n%s" , - priv->channel[WRITE ]->netdev->name, sbuf); + priv->channel[CTCM_WRITE ]->netdev->name, sbuf);kfree (sbuf);return ; }
@@ -125,7 +125,7 @@ static ssize_t stats_write(struct devicereturn -ENODEV ;/* Reset statistics */ memset (&priv->channel[WRITE ]->prof,0 , -sizeof (priv->channel[WRITE ]->prof)); +sizeof (priv->channel[CTCM_WRITE ]->prof));return count; }
David Miller
maintainerFrom: Ursula Braun <[email protected]>
Date: Thu, 12 Aug 2010 13:58:26 +0200
Quoted 4 lines
these patches repair warnings seen with the linux-2.6.git 2.6.35 caused by the used constants READ / WRITE.
The patches apply on linux-2.6.git and net-next-2.6.git.
Both applied, thanks.