Commit 0d499018 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Replace rx_netdev, st_netdev by a single field

For some unknown reason, isdn_net kept two pointers back from the channel
to the associated isdn_net_dev, one is enough, though.
parent 61fa3328
...@@ -46,8 +46,7 @@ struct isdn_slot { ...@@ -46,8 +46,7 @@ struct isdn_slot {
unsigned long obytes; /* Statistics outgoing bytes */ unsigned long obytes; /* Statistics outgoing bytes */
struct isdn_v110 iv110; /* For V.110 */ struct isdn_v110 iv110; /* For V.110 */
int m_idx; /* Index for mdm.... */ int m_idx; /* Index for mdm.... */
isdn_net_dev *rx_netdev; /* rx netdev-pointers */ isdn_net_dev *idev; /* pointer to isdn_net_dev */
isdn_net_dev *st_netdev; /* stat netdev-pointers */
}; };
static struct isdn_slot slot[ISDN_MAX_CHANNELS]; static struct isdn_slot slot[ISDN_MAX_CHANNELS];
...@@ -2067,35 +2066,19 @@ isdn_slot_num(int sl) ...@@ -2067,35 +2066,19 @@ isdn_slot_num(int sl)
} }
void void
isdn_slot_set_rx_netdev(int sl, isdn_net_dev *nd) isdn_slot_set_idev(int sl, isdn_net_dev *idev)
{ {
BUG_ON(sl < 0); BUG_ON(sl < 0);
slot[sl].rx_netdev = nd; slot[sl].idev = idev;
} }
isdn_net_dev * isdn_net_dev *
isdn_slot_rx_netdev(int sl) isdn_slot_idev(int sl)
{ {
BUG_ON(sl < 0); BUG_ON(sl < 0);
return slot[sl].rx_netdev; return slot[sl].idev;
}
void
isdn_slot_set_st_netdev(int sl, isdn_net_dev *nd)
{
BUG_ON(sl < 0);
slot[sl].st_netdev = nd;
}
isdn_net_dev *
isdn_slot_st_netdev(int sl)
{
BUG_ON(sl < 0);
return slot[sl].st_netdev;
} }
int int
......
...@@ -100,8 +100,6 @@ extern void isdn_slot_set_usage(int slot, int usage); ...@@ -100,8 +100,6 @@ extern void isdn_slot_set_usage(int slot, int usage);
extern char *isdn_slot_num(int slot); extern char *isdn_slot_num(int slot);
extern int isdn_slot_m_idx(int slot); extern int isdn_slot_m_idx(int slot);
extern void isdn_slot_set_m_idx(int slot, int midx); extern void isdn_slot_set_m_idx(int slot, int midx);
extern void isdn_slot_set_rx_netdev(int sl, isdn_net_dev *nd); extern void isdn_slot_set_idev(int sl, isdn_net_dev *);
extern void isdn_slot_set_st_netdev(int sl, isdn_net_dev *nd); extern isdn_net_dev *isdn_slot_idev(int sl);
extern isdn_net_dev *isdn_slot_rx_netdev(int sl);
extern isdn_net_dev *isdn_slot_st_netdev(int sl);
extern int isdn_hard_header_len(void); extern int isdn_hard_header_len(void);
...@@ -216,8 +216,7 @@ isdn_net_unbind_channel(isdn_net_dev *idev) ...@@ -216,8 +216,7 @@ isdn_net_unbind_channel(isdn_net_dev *idev)
idev->dialstate = ST_NULL; idev->dialstate = ST_NULL;
isdn_slot_set_rx_netdev(idev->isdn_slot, NULL); isdn_slot_set_idev(idev->isdn_slot, NULL);
isdn_slot_set_st_netdev(idev->isdn_slot, NULL);
isdn_slot_free(idev->isdn_slot, ISDN_USAGE_NET); isdn_slot_free(idev->isdn_slot, ISDN_USAGE_NET);
idev->isdn_slot = -1; idev->isdn_slot = -1;
...@@ -239,8 +238,7 @@ isdn_net_bind_channel(isdn_net_dev *idev, int idx) ...@@ -239,8 +238,7 @@ isdn_net_bind_channel(isdn_net_dev *idev, int idx)
cli(); cli();
idev->isdn_slot = idx; idev->isdn_slot = idx;
isdn_slot_set_rx_netdev(idev->isdn_slot, idev); isdn_slot_set_idev(idev->isdn_slot, idev);
isdn_slot_set_st_netdev(idev->isdn_slot, idev);
if (mlp->ops->bind) if (mlp->ops->bind)
retval = mlp->ops->bind(idev); retval = mlp->ops->bind(idev);
...@@ -296,7 +294,7 @@ static void isdn_net_connected(isdn_net_dev *idev) ...@@ -296,7 +294,7 @@ static void isdn_net_connected(isdn_net_dev *idev)
int int
isdn_net_stat_callback(int idx, isdn_ctrl *c) isdn_net_stat_callback(int idx, isdn_ctrl *c)
{ {
isdn_net_dev *idev = isdn_slot_st_netdev(idx); isdn_net_dev *idev = isdn_slot_idev(idx);
if (!idev) { if (!idev) {
HERE; HERE;
...@@ -547,7 +545,6 @@ isdn_net_event_in_wait_bconn(isdn_net_dev *idev, int pr, void *arg) ...@@ -547,7 +545,6 @@ isdn_net_event_in_wait_bconn(isdn_net_dev *idev, int pr, void *arg)
break; break;
case ISDN_STAT_BCONN: case ISDN_STAT_BCONN:
del_timer(&idev->dial_timer); del_timer(&idev->dial_timer);
isdn_slot_set_rx_netdev(idev->isdn_slot, idev);
isdn_net_connected(idev); isdn_net_connected(idev);
return 1; return 1;
case ISDN_STAT_DHUP: case ISDN_STAT_DHUP:
...@@ -939,11 +936,12 @@ isdn_net_receive(isdn_net_dev *idev, struct sk_buff *skb) ...@@ -939,11 +936,12 @@ isdn_net_receive(isdn_net_dev *idev, struct sk_buff *skb)
int int
isdn_net_rcv_skb(int idx, struct sk_buff *skb) isdn_net_rcv_skb(int idx, struct sk_buff *skb)
{ {
isdn_net_dev *idev = isdn_slot_rx_netdev(idx); isdn_net_dev *idev = isdn_slot_idev(idx);
if (!idev) if (!idev) {
HERE;
return 0; return 0;
}
if (!isdn_net_online(idev)) if (!isdn_net_online(idev))
return 0; return 0;
......
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