Commit 261893d3 authored by Peter Tiedemann's avatar Peter Tiedemann Committed by Jeff Garzik

ctcm: netdev->priv vs. netdev->ml_priv

Use netdev->ml_priv instead of netdev->priv
Signed-off-by: default avatarPeter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 6951df34
...@@ -245,7 +245,7 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg) ...@@ -245,7 +245,7 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct sk_buff *skb; struct sk_buff *skb;
int first = 1; int first = 1;
int i; int i;
...@@ -336,7 +336,7 @@ void ctcm_chx_txidle(fsm_instance *fi, int event, void *arg) ...@@ -336,7 +336,7 @@ void ctcm_chx_txidle(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name);
...@@ -357,7 +357,7 @@ static void chx_rx(fsm_instance *fi, int event, void *arg) ...@@ -357,7 +357,7 @@ static void chx_rx(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
int len = ch->max_bufsize - ch->irb->scsw.cmd.count; int len = ch->max_bufsize - ch->irb->scsw.cmd.count;
struct sk_buff *skb = ch->trans_skb; struct sk_buff *skb = ch->trans_skb;
__u16 block_len = *((__u16 *)skb->data); __u16 block_len = *((__u16 *)skb->data);
...@@ -459,7 +459,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg) ...@@ -459,7 +459,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg)
chx_rxidle(fi, event, arg); chx_rxidle(fi, event, arg);
} else { } else {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
fsm_newstate(fi, CTC_STATE_TXIDLE); fsm_newstate(fi, CTC_STATE_TXIDLE);
fsm_event(priv->fsm, DEV_EVENT_TXUP, dev); fsm_event(priv->fsm, DEV_EVENT_TXUP, dev);
} }
...@@ -496,7 +496,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg) ...@@ -496,7 +496,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg)
if ((CHANNEL_DIRECTION(ch->flags) == READ) && if ((CHANNEL_DIRECTION(ch->flags) == READ) &&
(ch->protocol == CTCM_PROTO_S390)) { (ch->protocol == CTCM_PROTO_S390)) {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
fsm_event(priv->fsm, DEV_EVENT_RXUP, dev); fsm_event(priv->fsm, DEV_EVENT_RXUP, dev);
} }
} }
...@@ -514,7 +514,7 @@ static void chx_rxidle(fsm_instance *fi, int event, void *arg) ...@@ -514,7 +514,7 @@ static void chx_rxidle(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
__u16 buflen; __u16 buflen;
int rc; int rc;
...@@ -699,7 +699,7 @@ static void ctcm_chx_cleanup(fsm_instance *fi, int state, ...@@ -699,7 +699,7 @@ static void ctcm_chx_cleanup(fsm_instance *fi, int state,
struct channel *ch) struct channel *ch)
{ {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCM_DBF_TEXT_(SETUP, CTC_DBF_NOTICE, CTCM_DBF_TEXT_(SETUP, CTC_DBF_NOTICE,
"%s(%s): %s[%d]\n", "%s(%s): %s[%d]\n",
...@@ -784,7 +784,7 @@ static void ctcm_chx_setuperr(fsm_instance *fi, int event, void *arg) ...@@ -784,7 +784,7 @@ static void ctcm_chx_setuperr(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
/* /*
* Special case: Got UC_RCRESET on setmode. * Special case: Got UC_RCRESET on setmode.
...@@ -874,7 +874,7 @@ static void ctcm_chx_rxiniterr(fsm_instance *fi, int event, void *arg) ...@@ -874,7 +874,7 @@ static void ctcm_chx_rxiniterr(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
if (event == CTC_EVENT_TIMER) { if (event == CTC_EVENT_TIMER) {
if (!IS_MPCDEV(dev)) if (!IS_MPCDEV(dev))
...@@ -902,7 +902,7 @@ static void ctcm_chx_rxinitfail(fsm_instance *fi, int event, void *arg) ...@@ -902,7 +902,7 @@ static void ctcm_chx_rxinitfail(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
"%s(%s): RX %s busy, init. fail", "%s(%s): RX %s busy, init. fail",
...@@ -923,7 +923,7 @@ static void ctcm_chx_rxdisc(fsm_instance *fi, int event, void *arg) ...@@ -923,7 +923,7 @@ static void ctcm_chx_rxdisc(fsm_instance *fi, int event, void *arg)
struct channel *ch = arg; struct channel *ch = arg;
struct channel *ch2; struct channel *ch2;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCM_DBF_TEXT_(TRACE, CTC_DBF_NOTICE, CTCM_DBF_TEXT_(TRACE, CTC_DBF_NOTICE,
"%s: %s: remote disconnect - re-init ...", "%s: %s: remote disconnect - re-init ...",
...@@ -954,7 +954,7 @@ static void ctcm_chx_txiniterr(fsm_instance *fi, int event, void *arg) ...@@ -954,7 +954,7 @@ static void ctcm_chx_txiniterr(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
if (event == CTC_EVENT_TIMER) { if (event == CTC_EVENT_TIMER) {
fsm_deltimer(&ch->timer); fsm_deltimer(&ch->timer);
...@@ -984,7 +984,7 @@ static void ctcm_chx_txretry(fsm_instance *fi, int event, void *arg) ...@@ -984,7 +984,7 @@ static void ctcm_chx_txretry(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct sk_buff *skb; struct sk_buff *skb;
CTCM_PR_DEBUG("Enter: %s: cp=%i ch=0x%p id=%s\n", CTCM_PR_DEBUG("Enter: %s: cp=%i ch=0x%p id=%s\n",
...@@ -1057,7 +1057,7 @@ static void ctcm_chx_iofatal(fsm_instance *fi, int event, void *arg) ...@@ -1057,7 +1057,7 @@ static void ctcm_chx_iofatal(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
int rd = CHANNEL_DIRECTION(ch->flags); int rd = CHANNEL_DIRECTION(ch->flags);
fsm_deltimer(&ch->timer); fsm_deltimer(&ch->timer);
...@@ -1207,7 +1207,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg) ...@@ -1207,7 +1207,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct sk_buff *skb; struct sk_buff *skb;
int first = 1; int first = 1;
...@@ -1368,7 +1368,7 @@ static void ctcmpc_chx_rx(fsm_instance *fi, int event, void *arg) ...@@ -1368,7 +1368,7 @@ static void ctcmpc_chx_rx(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct sk_buff *skb = ch->trans_skb; struct sk_buff *skb = ch->trans_skb;
struct sk_buff *new_skb; struct sk_buff *new_skb;
...@@ -1471,7 +1471,7 @@ static void ctcmpc_chx_firstio(fsm_instance *fi, int event, void *arg) ...@@ -1471,7 +1471,7 @@ static void ctcmpc_chx_firstio(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *gptr = priv->mpcg; struct mpc_group *gptr = priv->mpcg;
CTCM_PR_DEBUG("Enter %s: id=%s, ch=0x%p\n", CTCM_PR_DEBUG("Enter %s: id=%s, ch=0x%p\n",
...@@ -1525,7 +1525,7 @@ void ctcmpc_chx_rxidle(fsm_instance *fi, int event, void *arg) ...@@ -1525,7 +1525,7 @@ void ctcmpc_chx_rxidle(fsm_instance *fi, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
int rc; int rc;
unsigned long saveflags = 0; /* avoids compiler warning */ unsigned long saveflags = 0; /* avoids compiler warning */
...@@ -1580,7 +1580,7 @@ static void ctcmpc_chx_attn(fsm_instance *fsm, int event, void *arg) ...@@ -1580,7 +1580,7 @@ static void ctcmpc_chx_attn(fsm_instance *fsm, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("%s(%s): %s(ch=0x%p), cp=%i, ChStat:%s, GrpStat:%s\n", CTCM_PR_DEBUG("%s(%s): %s(ch=0x%p), cp=%i, ChStat:%s, GrpStat:%s\n",
...@@ -1639,7 +1639,7 @@ static void ctcmpc_chx_attnbusy(fsm_instance *fsm, int event, void *arg) ...@@ -1639,7 +1639,7 @@ static void ctcmpc_chx_attnbusy(fsm_instance *fsm, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("%s(%s): %s\n ChState:%s GrpState:%s\n", CTCM_PR_DEBUG("%s(%s): %s\n ChState:%s GrpState:%s\n",
...@@ -1724,7 +1724,7 @@ static void ctcmpc_chx_resend(fsm_instance *fsm, int event, void *arg) ...@@ -1724,7 +1724,7 @@ static void ctcmpc_chx_resend(fsm_instance *fsm, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch); fsm_event(grp->fsm, MPCG_EVENT_XID0DO, ch);
...@@ -1740,7 +1740,7 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg) ...@@ -1740,7 +1740,7 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg)
{ {
struct channel *ach = arg; struct channel *ach = arg;
struct net_device *dev = ach->netdev; struct net_device *dev = ach->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct channel *wch = priv->channel[WRITE]; struct channel *wch = priv->channel[WRITE];
struct channel *rch = priv->channel[READ]; struct channel *rch = priv->channel[READ];
...@@ -2050,7 +2050,7 @@ int mpc_ch_fsm_len = ARRAY_SIZE(ctcmpc_ch_fsm); ...@@ -2050,7 +2050,7 @@ int mpc_ch_fsm_len = ARRAY_SIZE(ctcmpc_ch_fsm);
static void dev_action_start(fsm_instance *fi, int event, void *arg) static void dev_action_start(fsm_instance *fi, int event, void *arg)
{ {
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
int direction; int direction;
CTCMY_DBF_DEV_NAME(SETUP, dev, ""); CTCMY_DBF_DEV_NAME(SETUP, dev, "");
...@@ -2076,7 +2076,7 @@ static void dev_action_stop(fsm_instance *fi, int event, void *arg) ...@@ -2076,7 +2076,7 @@ static void dev_action_stop(fsm_instance *fi, int event, void *arg)
{ {
int direction; int direction;
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCMY_DBF_DEV_NAME(SETUP, dev, ""); CTCMY_DBF_DEV_NAME(SETUP, dev, "");
...@@ -2096,7 +2096,7 @@ static void dev_action_restart(fsm_instance *fi, int event, void *arg) ...@@ -2096,7 +2096,7 @@ static void dev_action_restart(fsm_instance *fi, int event, void *arg)
{ {
int restart_timer; int restart_timer;
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCMY_DBF_DEV_NAME(TRACE, dev, ""); CTCMY_DBF_DEV_NAME(TRACE, dev, "");
...@@ -2133,12 +2133,12 @@ static void dev_action_restart(fsm_instance *fi, int event, void *arg) ...@@ -2133,12 +2133,12 @@ static void dev_action_restart(fsm_instance *fi, int event, void *arg)
static void dev_action_chup(fsm_instance *fi, int event, void *arg) static void dev_action_chup(fsm_instance *fi, int event, void *arg)
{ {
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
int dev_stat = fsm_getstate(fi); int dev_stat = fsm_getstate(fi);
CTCM_DBF_TEXT_(SETUP, CTC_DBF_NOTICE, CTCM_DBF_TEXT_(SETUP, CTC_DBF_NOTICE,
"%s(%s): priv = %p [%d,%d]\n ", CTCM_FUNTAIL, "%s(%s): priv = %p [%d,%d]\n ", CTCM_FUNTAIL,
dev->name, dev->priv, dev_stat, event); dev->name, dev->ml_priv, dev_stat, event);
switch (fsm_getstate(fi)) { switch (fsm_getstate(fi)) {
case DEV_STATE_STARTWAIT_RXTX: case DEV_STATE_STARTWAIT_RXTX:
...@@ -2195,7 +2195,7 @@ static void dev_action_chdown(fsm_instance *fi, int event, void *arg) ...@@ -2195,7 +2195,7 @@ static void dev_action_chdown(fsm_instance *fi, int event, void *arg)
{ {
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCMY_DBF_DEV_NAME(SETUP, dev, ""); CTCMY_DBF_DEV_NAME(SETUP, dev, "");
......
...@@ -69,7 +69,7 @@ struct channel *channels; ...@@ -69,7 +69,7 @@ struct channel *channels;
void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb) void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
{ {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
__u16 len = *((__u16 *) pskb->data); __u16 len = *((__u16 *) pskb->data);
skb_put(pskb, 2 + LL_HEADER_LENGTH); skb_put(pskb, 2 + LL_HEADER_LENGTH);
...@@ -414,7 +414,7 @@ int ctcm_ch_alloc_buffer(struct channel *ch) ...@@ -414,7 +414,7 @@ int ctcm_ch_alloc_buffer(struct channel *ch)
*/ */
int ctcm_open(struct net_device *dev) int ctcm_open(struct net_device *dev)
{ {
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCMY_DBF_DEV_NAME(SETUP, dev, ""); CTCMY_DBF_DEV_NAME(SETUP, dev, "");
if (!IS_MPC(priv)) if (!IS_MPC(priv))
...@@ -432,7 +432,7 @@ int ctcm_open(struct net_device *dev) ...@@ -432,7 +432,7 @@ int ctcm_open(struct net_device *dev)
*/ */
int ctcm_close(struct net_device *dev) int ctcm_close(struct net_device *dev)
{ {
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
CTCMY_DBF_DEV_NAME(SETUP, dev, ""); CTCMY_DBF_DEV_NAME(SETUP, dev, "");
if (!IS_MPC(priv)) if (!IS_MPC(priv))
...@@ -573,7 +573,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb) ...@@ -573,7 +573,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
skb_pull(skb, LL_HEADER_LENGTH + 2); skb_pull(skb, LL_HEADER_LENGTH + 2);
} else if (ccw_idx == 0) { } else if (ccw_idx == 0) {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
priv->stats.tx_packets++; priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len - LL_HEADER_LENGTH; priv->stats.tx_bytes += skb->len - LL_HEADER_LENGTH;
} }
...@@ -592,7 +592,7 @@ static void ctcmpc_send_sweep_req(struct channel *rch) ...@@ -592,7 +592,7 @@ static void ctcmpc_send_sweep_req(struct channel *rch)
struct channel *ch; struct channel *ch;
/* int rc = 0; */ /* int rc = 0; */
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
ch = priv->channel[WRITE]; ch = priv->channel[WRITE];
...@@ -652,7 +652,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb) ...@@ -652,7 +652,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
{ {
struct pdu *p_header; struct pdu *p_header;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct th_header *header; struct th_header *header;
struct sk_buff *nskb; struct sk_buff *nskb;
...@@ -867,7 +867,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb) ...@@ -867,7 +867,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
/* first merge version - leaving both functions separated */ /* first merge version - leaving both functions separated */
static int ctcm_tx(struct sk_buff *skb, struct net_device *dev) static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
{ {
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
if (skb == NULL) { if (skb == NULL) {
CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
...@@ -911,7 +911,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -911,7 +911,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
static int ctcmpc_tx(struct sk_buff *skb, struct net_device *dev) static int ctcmpc_tx(struct sk_buff *skb, struct net_device *dev)
{ {
int len = 0; int len = 0;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct sk_buff *newskb = NULL; struct sk_buff *newskb = NULL;
...@@ -1025,7 +1025,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1025,7 +1025,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu)
if (new_mtu < 576 || new_mtu > 65527) if (new_mtu < 576 || new_mtu > 65527)
return -EINVAL; return -EINVAL;
priv = dev->priv; priv = dev->ml_priv;
max_bufsize = priv->channel[READ]->max_bufsize; max_bufsize = priv->channel[READ]->max_bufsize;
if (IS_MPC(priv)) { if (IS_MPC(priv)) {
...@@ -1050,7 +1050,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1050,7 +1050,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu)
*/ */
static struct net_device_stats *ctcm_stats(struct net_device *dev) static struct net_device_stats *ctcm_stats(struct net_device *dev)
{ {
return &((struct ctcm_priv *)dev->priv)->stats; return &((struct ctcm_priv *)dev->ml_priv)->stats;
} }
static void ctcm_free_netdevice(struct net_device *dev) static void ctcm_free_netdevice(struct net_device *dev)
...@@ -1060,7 +1060,7 @@ static void ctcm_free_netdevice(struct net_device *dev) ...@@ -1060,7 +1060,7 @@ static void ctcm_free_netdevice(struct net_device *dev)
CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO,
"%s(%s)", CTCM_FUNTAIL, dev->name); "%s(%s)", CTCM_FUNTAIL, dev->name);
priv = dev->priv; priv = dev->ml_priv;
if (priv) { if (priv) {
grp = priv->mpcg; grp = priv->mpcg;
if (grp) { if (grp) {
...@@ -1125,7 +1125,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv) ...@@ -1125,7 +1125,7 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv)
CTCM_FUNTAIL); CTCM_FUNTAIL);
return NULL; return NULL;
} }
dev->priv = priv; dev->ml_priv = priv;
priv->fsm = init_fsm("ctcmdev", dev_state_names, dev_event_names, priv->fsm = init_fsm("ctcmdev", dev_state_names, dev_event_names,
CTCM_NR_DEV_STATES, CTCM_NR_DEV_EVENTS, CTCM_NR_DEV_STATES, CTCM_NR_DEV_EVENTS,
dev_fsm, dev_fsm_len, GFP_KERNEL); dev_fsm, dev_fsm_len, GFP_KERNEL);
......
...@@ -229,14 +229,14 @@ void ctcm_remove_files(struct device *dev); ...@@ -229,14 +229,14 @@ void ctcm_remove_files(struct device *dev);
*/ */
static inline void ctcm_clear_busy_do(struct net_device *dev) static inline void ctcm_clear_busy_do(struct net_device *dev)
{ {
clear_bit(0, &(((struct ctcm_priv *)dev->priv)->tbusy)); clear_bit(0, &(((struct ctcm_priv *)dev->ml_priv)->tbusy));
netif_wake_queue(dev); netif_wake_queue(dev);
} }
static inline void ctcm_clear_busy(struct net_device *dev) static inline void ctcm_clear_busy(struct net_device *dev)
{ {
struct mpc_group *grp; struct mpc_group *grp;
grp = ((struct ctcm_priv *)dev->priv)->mpcg; grp = ((struct ctcm_priv *)dev->ml_priv)->mpcg;
if (!(grp && grp->in_sweep)) if (!(grp && grp->in_sweep))
ctcm_clear_busy_do(dev); ctcm_clear_busy_do(dev);
...@@ -246,7 +246,8 @@ static inline void ctcm_clear_busy(struct net_device *dev) ...@@ -246,7 +246,8 @@ static inline void ctcm_clear_busy(struct net_device *dev)
static inline int ctcm_test_and_set_busy(struct net_device *dev) static inline int ctcm_test_and_set_busy(struct net_device *dev)
{ {
netif_stop_queue(dev); netif_stop_queue(dev);
return test_and_set_bit(0, &(((struct ctcm_priv *)dev->priv)->tbusy)); return test_and_set_bit(0,
&(((struct ctcm_priv *)dev->ml_priv)->tbusy));
} }
extern int loglevel; extern int loglevel;
...@@ -292,7 +293,7 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv); ...@@ -292,7 +293,7 @@ struct mpc_group *ctcmpc_init_mpc_group(struct ctcm_priv *priv);
#define IS_MPC(p) ((p)->protocol == CTCM_PROTO_MPC) #define IS_MPC(p) ((p)->protocol == CTCM_PROTO_MPC)
/* test if struct ctcm_priv of struct net_device has MPC protocol setting */ /* test if struct ctcm_priv of struct net_device has MPC protocol setting */
#define IS_MPCDEV(d) IS_MPC((struct ctcm_priv *)d->priv) #define IS_MPCDEV(dev) IS_MPC((struct ctcm_priv *)dev->ml_priv)
static inline gfp_t gfp_type(void) static inline gfp_t gfp_type(void)
{ {
......
...@@ -313,10 +313,10 @@ static struct net_device *ctcmpc_get_dev(int port_num) ...@@ -313,10 +313,10 @@ static struct net_device *ctcmpc_get_dev(int port_num)
CTCM_FUNTAIL, device); CTCM_FUNTAIL, device);
return NULL; return NULL;
} }
priv = dev->priv; priv = dev->ml_priv;
if (priv == NULL) { if (priv == NULL) {
CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR, CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR,
"%s(%s): dev->priv is NULL", "%s(%s): dev->ml_priv is NULL",
CTCM_FUNTAIL, device); CTCM_FUNTAIL, device);
return NULL; return NULL;
} }
...@@ -345,7 +345,7 @@ int ctc_mpc_alloc_channel(int port_num, void (*callback)(int, int)) ...@@ -345,7 +345,7 @@ int ctc_mpc_alloc_channel(int port_num, void (*callback)(int, int))
dev = ctcmpc_get_dev(port_num); dev = ctcmpc_get_dev(port_num);
if (dev == NULL) if (dev == NULL)
return 1; return 1;
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
grp->allochanfunc = callback; grp->allochanfunc = callback;
...@@ -417,7 +417,7 @@ void ctc_mpc_establish_connectivity(int port_num, ...@@ -417,7 +417,7 @@ void ctc_mpc_establish_connectivity(int port_num,
dev = ctcmpc_get_dev(port_num); dev = ctcmpc_get_dev(port_num);
if (dev == NULL) if (dev == NULL)
return; return;
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
rch = priv->channel[READ]; rch = priv->channel[READ];
wch = priv->channel[WRITE]; wch = priv->channel[WRITE];
...@@ -535,7 +535,7 @@ void ctc_mpc_dealloc_ch(int port_num) ...@@ -535,7 +535,7 @@ void ctc_mpc_dealloc_ch(int port_num)
dev = ctcmpc_get_dev(port_num); dev = ctcmpc_get_dev(port_num);
if (dev == NULL) if (dev == NULL)
return; return;
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_DEBUG, CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_DEBUG,
...@@ -571,7 +571,7 @@ void ctc_mpc_flow_control(int port_num, int flowc) ...@@ -571,7 +571,7 @@ void ctc_mpc_flow_control(int port_num, int flowc)
dev = ctcmpc_get_dev(port_num); dev = ctcmpc_get_dev(port_num);
if (dev == NULL) if (dev == NULL)
return; return;
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_DEBUG, CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_DEBUG,
...@@ -620,7 +620,7 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo) ...@@ -620,7 +620,7 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
{ {
struct channel *rch = mpcginfo->ch; struct channel *rch = mpcginfo->ch;
struct net_device *dev = rch->netdev; struct net_device *dev = rch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct channel *ch = priv->channel[WRITE]; struct channel *ch = priv->channel[WRITE];
...@@ -651,7 +651,7 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo) ...@@ -651,7 +651,7 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo)
static void ctcmpc_send_sweep_resp(struct channel *rch) static void ctcmpc_send_sweep_resp(struct channel *rch)
{ {
struct net_device *dev = rch->netdev; struct net_device *dev = rch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
int rc = 0; int rc = 0;
struct th_sweep *header; struct th_sweep *header;
...@@ -713,7 +713,7 @@ static void mpc_rcvd_sweep_req(struct mpcg_info *mpcginfo) ...@@ -713,7 +713,7 @@ static void mpc_rcvd_sweep_req(struct mpcg_info *mpcginfo)
{ {
struct channel *rch = mpcginfo->ch; struct channel *rch = mpcginfo->ch;
struct net_device *dev = rch->netdev; struct net_device *dev = rch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct channel *ch = priv->channel[WRITE]; struct channel *ch = priv->channel[WRITE];
...@@ -847,7 +847,7 @@ static int mpcg_fsm_len = ARRAY_SIZE(mpcg_fsm); ...@@ -847,7 +847,7 @@ static int mpcg_fsm_len = ARRAY_SIZE(mpcg_fsm);
static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg) static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg)
{ {
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
if (grp == NULL) { if (grp == NULL) {
...@@ -891,7 +891,7 @@ static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg) ...@@ -891,7 +891,7 @@ static void mpc_action_go_ready(fsm_instance *fsm, int event, void *arg)
void mpc_group_ready(unsigned long adev) void mpc_group_ready(unsigned long adev)
{ {
struct net_device *dev = (struct net_device *)adev; struct net_device *dev = (struct net_device *)adev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct channel *ch = NULL; struct channel *ch = NULL;
...@@ -947,7 +947,7 @@ void mpc_group_ready(unsigned long adev) ...@@ -947,7 +947,7 @@ void mpc_group_ready(unsigned long adev)
void mpc_channel_action(struct channel *ch, int direction, int action) void mpc_channel_action(struct channel *ch, int direction, int action)
{ {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
if (grp == NULL) { if (grp == NULL) {
...@@ -1057,7 +1057,7 @@ void mpc_channel_action(struct channel *ch, int direction, int action) ...@@ -1057,7 +1057,7 @@ void mpc_channel_action(struct channel *ch, int direction, int action)
static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
{ {
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct pdu *curr_pdu; struct pdu *curr_pdu;
struct mpcg_info *mpcginfo; struct mpcg_info *mpcginfo;
...@@ -1255,7 +1255,7 @@ void ctcmpc_bh(unsigned long thischan) ...@@ -1255,7 +1255,7 @@ void ctcmpc_bh(unsigned long thischan)
struct channel *ch = (struct channel *)thischan; struct channel *ch = (struct channel *)thischan;
struct sk_buff *skb; struct sk_buff *skb;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("%s cp:%i enter: %s() %s\n", CTCM_PR_DEBUG("%s cp:%i enter: %s() %s\n",
...@@ -1377,7 +1377,7 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg) ...@@ -1377,7 +1377,7 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg)
BUG_ON(dev == NULL); BUG_ON(dev == NULL);
CTCM_PR_DEBUG("Enter %s: %s\n", __func__, dev->name); CTCM_PR_DEBUG("Enter %s: %s\n", __func__, dev->name);
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
grp->flow_off_called = 0; grp->flow_off_called = 0;
fsm_deltimer(&grp->timer); fsm_deltimer(&grp->timer);
...@@ -1483,7 +1483,7 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg) ...@@ -1483,7 +1483,7 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg)
BUG_ON(dev == NULL); BUG_ON(dev == NULL);
priv = dev->priv; priv = dev->ml_priv;
grp = priv->mpcg; grp = priv->mpcg;
wch = priv->channel[WRITE]; wch = priv->channel[WRITE];
rch = priv->channel[READ]; rch = priv->channel[READ];
...@@ -1521,7 +1521,7 @@ void mpc_action_discontact(fsm_instance *fi, int event, void *arg) ...@@ -1521,7 +1521,7 @@ void mpc_action_discontact(fsm_instance *fi, int event, void *arg)
if (ch) { if (ch) {
dev = ch->netdev; dev = ch->netdev;
if (dev) { if (dev) {
priv = dev->priv; priv = dev->ml_priv;
if (priv) { if (priv) {
CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_NOTICE, CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_NOTICE,
"%s: %s: %s\n", "%s: %s: %s\n",
...@@ -1569,7 +1569,7 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo) ...@@ -1569,7 +1569,7 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo)
{ {
struct channel *ch = mpcginfo->ch; struct channel *ch = mpcginfo->ch;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
struct xid2 *xid = mpcginfo->xid; struct xid2 *xid = mpcginfo->xid;
int rc = 0; int rc = 0;
...@@ -1866,7 +1866,7 @@ static void mpc_action_doxid0(fsm_instance *fsm, int event, void *arg) ...@@ -1866,7 +1866,7 @@ static void mpc_action_doxid0(fsm_instance *fsm, int event, void *arg)
{ {
struct channel *ch = arg; struct channel *ch = arg;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n", CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n",
...@@ -1906,7 +1906,7 @@ static void mpc_action_doxid0(fsm_instance *fsm, int event, void *arg) ...@@ -1906,7 +1906,7 @@ static void mpc_action_doxid0(fsm_instance *fsm, int event, void *arg)
static void mpc_action_doxid7(fsm_instance *fsm, int event, void *arg) static void mpc_action_doxid7(fsm_instance *fsm, int event, void *arg)
{ {
struct net_device *dev = arg; struct net_device *dev = arg;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = NULL; struct mpc_group *grp = NULL;
int direction; int direction;
int send = 0; int send = 0;
...@@ -1983,7 +1983,7 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg) ...@@ -1983,7 +1983,7 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg)
struct mpcg_info *mpcginfo = arg; struct mpcg_info *mpcginfo = arg;
struct channel *ch = mpcginfo->ch; struct channel *ch = mpcginfo->ch;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("%s: ch-id:%s xid2:%i xid7:%i xidt_p2:%i \n", CTCM_PR_DEBUG("%s: ch-id:%s xid2:%i xid7:%i xidt_p2:%i \n",
...@@ -2045,7 +2045,7 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg) ...@@ -2045,7 +2045,7 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg)
struct mpcg_info *mpcginfo = arg; struct mpcg_info *mpcginfo = arg;
struct channel *ch = mpcginfo->ch; struct channel *ch = mpcginfo->ch;
struct net_device *dev = ch->netdev; struct net_device *dev = ch->netdev;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n", CTCM_PR_DEBUG("Enter %s: cp=%i ch=0x%p id=%s\n",
...@@ -2097,7 +2097,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev) ...@@ -2097,7 +2097,7 @@ static int mpc_send_qllc_discontact(struct net_device *dev)
__u32 new_len = 0; __u32 new_len = 0;
struct sk_buff *skb; struct sk_buff *skb;
struct qllc *qllcptr; struct qllc *qllcptr;
struct ctcm_priv *priv = dev->priv; struct ctcm_priv *priv = dev->ml_priv;
struct mpc_group *grp = priv->mpcg; struct mpc_group *grp = priv->mpcg;
CTCM_PR_DEBUG("%s: GROUP STATE: %s\n", CTCM_PR_DEBUG("%s: GROUP STATE: %s\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment