@@ -161,36 +161,6 @@ int lmc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
ret = 0;
break;
- case LMCIOCIFTYPE:
- {
- u16 old_type = sc->if_type;
- u16 new_type;
-
- if (!capable(CAP_NET_ADMIN)) {
- ret = -EPERM;
- break;
- }
-
- if (copy_from_user(&new_type, ifr->ifr_data, sizeof(u16))) {
- ret = -EFAULT;
- break;
- }
-
- if (new_type == old_type) {
- ret = 0 ;
- break; /* no change */
- }
-
- spin_lock_irqsave(&sc->lmc_lock, flags);
- lmc_proto_close(sc);
-
- sc->if_type = new_type;
- lmc_proto_attach(sc);
- ret = lmc_proto_open(sc);
- spin_unlock_irqrestore(&sc->lmc_lock, flags);
- break;
- }
-
case LMCIOCGETXINFO:
spin_lock_irqsave(&sc->lmc_lock, flags);
sc->lmc_xinfo.Magic0 = 0xBEEFCAFE;
@@ -819,7 +789,6 @@ static int __devinit lmc_init_one(struct pci_dev *pdev,
dev->tx_queue_len = 100;
sc->lmc_device = dev;
sc->name = dev->name;
- sc->if_type = LMC_PPP;
sc->check = 0xBEAFCAFE;
dev->base_addr = pci_resource_start(pdev, 0);
dev->irq = pdev->irq;
@@ -49,22 +49,13 @@
void lmc_proto_attach(struct card *sc)
{
lmc_trace(sc->lmc_device, "lmc_proto_attach in");
- if (sc->if_type == LMC_NET) {
- struct net_device *dev = sc->lmc_device;
- /* They set a few basics because they don't use HDLC */
- dev->flags |= IFF_POINTOPOINT;
- dev->hard_header_len = 0;
- dev->addr_len = 0;
- }
lmc_trace(sc->lmc_device, "lmc_proto_attach out");
}
int lmc_proto_ioctl(struct card *sc, struct ifreq *ifr, int cmd)
{
lmc_trace(sc->lmc_device, "lmc_proto_ioctl");
- if (sc->if_type == LMC_PPP)
- return hdlc_ioctl(sc->lmc_device, ifr, cmd);
- return -EOPNOTSUPP;
+ return hdlc_ioctl(sc->lmc_device, ifr, cmd);
}
int lmc_proto_open(struct card *sc)
@@ -73,12 +64,10 @@ int lmc_proto_open(struct card *sc)
lmc_trace(sc->lmc_device, "lmc_proto_open in");
- if (sc->if_type == LMC_PPP) {
- ret = hdlc_open(sc->lmc_device);
- if (ret < 0)
- printk(KERN_WARNING "%s: HDLC open failed: %d\n",
- sc->name, ret);
- }
+ ret = hdlc_open(sc->lmc_device);
+ if (ret < 0)
+ printk(KERN_WARNING "%s: HDLC open failed: %d\n",
+ sc->name, ret);
lmc_trace(sc->lmc_device, "lmc_proto_open out");
return ret;
@@ -87,48 +76,20 @@ int lmc_proto_open(struct card *sc)
void lmc_proto_close(struct card *sc)
{
lmc_trace(sc->lmc_device, "lmc_proto_close in");
-
- if (sc->if_type == LMC_PPP)
- hdlc_close(sc->lmc_device);
-
+ hdlc_close(sc->lmc_device);
lmc_trace(sc->lmc_device, "lmc_proto_close out");
}
__be16 lmc_proto_type(struct card *sc, struct sk_buff *skb)
{
lmc_trace(sc->lmc_device, "lmc_proto_type in");
- switch (sc->if_type) {
- case LMC_PPP:
- return hdlc_type_trans(skb, sc->lmc_device);
- break;
- case LMC_NET:
- return htons(ETH_P_802_2);
- break;
- case LMC_RAW: /* Packet type for skbuff kind of useless */
- return htons(ETH_P_802_2);
- break;
- default:
- printk(KERN_WARNING
- "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n",
- sc->name);
- return htons(ETH_P_802_2);
- break;
- }
+ return hdlc_type_trans(skb, sc->lmc_device);
lmc_trace(sc->lmc_device, "lmc_proto_tye out");
-
}
void lmc_proto_netif(struct card *sc, struct sk_buff *skb)
{
lmc_trace(sc->lmc_device, "lmc_proto_netif in");
- switch (sc->if_type) {
- case LMC_PPP:
- case LMC_NET:
- default:
- netif_rx(skb);
- break;
- case LMC_RAW:
- break;
- }
+ netif_rx(skb);
lmc_trace(sc->lmc_device, "lmc_proto_netif out");
}
@@ -321,7 +321,6 @@ struct card {
u32 num_int;
spinlock_t lmc_lock;
- u16 if_type; /* HDLC/PPP or NET */
u8 failed_ring; /* Failure cases */
u8 failed_recv_alloc;