Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103245
b: refs/heads/master
c: 141766c
h: refs/heads/master
i:
  103243: 072b5e2
v: v3
  • Loading branch information
Krzysztof Halasa authored and Jeff Garzik committed Jul 4, 2008
1 parent 816e726 commit cba2e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 198191c4a7ce4daba379608fb38b9bc5a4eedc61
refs/heads/master: 141766cf9755e773b980238da52f5f5da5c69abe
25 changes: 8 additions & 17 deletions trunk/drivers/net/wan/hdlc_fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ typedef struct pvc_device_struct {
}state;
}pvc_device;

struct pvc_desc {
pvc_device *pvc;
};

struct frad_state {
fr_proto settings;
pvc_device *first_pvc;
Expand Down Expand Up @@ -178,10 +174,6 @@ static inline struct frad_state* state(hdlc_device *hdlc)
return(struct frad_state *)(hdlc->state);
}

static inline struct pvc_desc* pvcdev_to_desc(struct net_device *dev)
{
return dev->priv;
}

static inline pvc_device* find_pvc(hdlc_device *hdlc, u16 dlci)
{
Expand Down Expand Up @@ -351,7 +343,7 @@ static int fr_hard_header(struct sk_buff **skb_p, u16 dlci)

static int pvc_open(struct net_device *dev)
{
pvc_device *pvc = pvcdev_to_desc(dev)->pvc;
pvc_device *pvc = dev->priv;

if ((pvc->frad->flags & IFF_UP) == 0)
return -EIO; /* Frad must be UP in order to activate PVC */
Expand All @@ -371,7 +363,7 @@ static int pvc_open(struct net_device *dev)

static int pvc_close(struct net_device *dev)
{
pvc_device *pvc = pvcdev_to_desc(dev)->pvc;
pvc_device *pvc = dev->priv;

if (--pvc->open_count == 0) {
hdlc_device *hdlc = dev_to_hdlc(pvc->frad);
Expand All @@ -390,7 +382,7 @@ static int pvc_close(struct net_device *dev)

static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
pvc_device *pvc = pvcdev_to_desc(dev)->pvc;
pvc_device *pvc = dev->priv;
fr_proto_pvc_info info;

if (ifr->ifr_settings.type == IF_GET_PROTO) {
Expand Down Expand Up @@ -418,7 +410,7 @@ static int pvc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)

static int pvc_xmit(struct sk_buff *skb, struct net_device *dev)
{
pvc_device *pvc = pvcdev_to_desc(dev)->pvc;
pvc_device *pvc = dev->priv;

if (pvc->state.active) {
if (dev->type == ARPHRD_ETHER) {
Expand Down Expand Up @@ -1079,7 +1071,7 @@ static void pvc_setup(struct net_device *dev)
static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
{
hdlc_device *hdlc = dev_to_hdlc(frad);
pvc_device *pvc = NULL;
pvc_device *pvc;
struct net_device *dev;
int result, used;

Expand All @@ -1095,10 +1087,9 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
used = pvc_is_used(pvc);

if (type == ARPHRD_ETHER)
dev = alloc_netdev(sizeof(struct pvc_desc), "pvceth%d",
ether_setup);
dev = alloc_netdev(0, "pvceth%d", ether_setup);
else
dev = alloc_netdev(sizeof(struct pvc_desc), "pvc%d", pvc_setup);
dev = alloc_netdev(0, "pvc%d", pvc_setup);

if (!dev) {
printk(KERN_WARNING "%s: Memory squeeze on fr_pvc()\n",
Expand All @@ -1120,7 +1111,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
dev->change_mtu = pvc_change_mtu;
dev->mtu = HDLC_MAX_MTU;
dev->tx_queue_len = 0;
pvcdev_to_desc(dev)->pvc = pvc;
dev->priv = pvc;

result = dev_alloc_name(dev, dev->name);
if (result < 0) {
Expand Down

0 comments on commit cba2e6a

Please sign in to comment.