| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 1997-2000 LAN Media Corporation (LMC) |
|---|
| 3 | 4 | * All rights reserved. www.lanmedia.com |
|---|
| .. | .. |
|---|
| 12 | 13 | * David Boggs |
|---|
| 13 | 14 | * Ron Crane |
|---|
| 14 | 15 | * Allan Cox |
|---|
| 15 | | - * |
|---|
| 16 | | - * This software may be used and distributed according to the terms |
|---|
| 17 | | - * of the GNU General Public License version 2, incorporated herein by reference. |
|---|
| 18 | 16 | * |
|---|
| 19 | 17 | * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards. |
|---|
| 20 | 18 | */ |
|---|
| .. | .. |
|---|
| 49 | 47 | // attach |
|---|
| 50 | 48 | void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/ |
|---|
| 51 | 49 | { |
|---|
| 52 | | - lmc_trace(sc->lmc_device, "lmc_proto_attach in"); |
|---|
| 53 | 50 | if (sc->if_type == LMC_NET) { |
|---|
| 54 | 51 | struct net_device *dev = sc->lmc_device; |
|---|
| 55 | 52 | /* |
|---|
| .. | .. |
|---|
| 59 | 56 | dev->hard_header_len = 0; |
|---|
| 60 | 57 | dev->addr_len = 0; |
|---|
| 61 | 58 | } |
|---|
| 62 | | - lmc_trace(sc->lmc_device, "lmc_proto_attach out"); |
|---|
| 63 | 59 | } |
|---|
| 64 | 60 | |
|---|
| 65 | 61 | int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd) |
|---|
| 66 | 62 | { |
|---|
| 67 | | - lmc_trace(sc->lmc_device, "lmc_proto_ioctl"); |
|---|
| 68 | 63 | if (sc->if_type == LMC_PPP) |
|---|
| 69 | 64 | return hdlc_ioctl(sc->lmc_device, ifr, cmd); |
|---|
| 70 | 65 | return -EOPNOTSUPP; |
|---|
| .. | .. |
|---|
| 74 | 69 | { |
|---|
| 75 | 70 | int ret = 0; |
|---|
| 76 | 71 | |
|---|
| 77 | | - lmc_trace(sc->lmc_device, "lmc_proto_open in"); |
|---|
| 78 | | - |
|---|
| 79 | 72 | if (sc->if_type == LMC_PPP) { |
|---|
| 80 | 73 | ret = hdlc_open(sc->lmc_device); |
|---|
| 81 | 74 | if (ret < 0) |
|---|
| 82 | 75 | printk(KERN_WARNING "%s: HDLC open failed: %d\n", |
|---|
| 83 | 76 | sc->name, ret); |
|---|
| 84 | 77 | } |
|---|
| 85 | | - |
|---|
| 86 | | - lmc_trace(sc->lmc_device, "lmc_proto_open out"); |
|---|
| 87 | 78 | return ret; |
|---|
| 88 | 79 | } |
|---|
| 89 | 80 | |
|---|
| 90 | 81 | void lmc_proto_close(lmc_softc_t *sc) |
|---|
| 91 | 82 | { |
|---|
| 92 | | - lmc_trace(sc->lmc_device, "lmc_proto_close in"); |
|---|
| 93 | | - |
|---|
| 94 | 83 | if (sc->if_type == LMC_PPP) |
|---|
| 95 | 84 | hdlc_close(sc->lmc_device); |
|---|
| 96 | | - |
|---|
| 97 | | - lmc_trace(sc->lmc_device, "lmc_proto_close out"); |
|---|
| 98 | 85 | } |
|---|
| 99 | 86 | |
|---|
| 100 | 87 | __be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ |
|---|
| 101 | 88 | { |
|---|
| 102 | | - lmc_trace(sc->lmc_device, "lmc_proto_type in"); |
|---|
| 103 | 89 | switch(sc->if_type){ |
|---|
| 104 | 90 | case LMC_PPP: |
|---|
| 105 | 91 | return hdlc_type_trans(skb, sc->lmc_device); |
|---|
| 106 | | - break; |
|---|
| 107 | 92 | case LMC_NET: |
|---|
| 108 | 93 | return htons(ETH_P_802_2); |
|---|
| 109 | | - break; |
|---|
| 110 | 94 | case LMC_RAW: /* Packet type for skbuff kind of useless */ |
|---|
| 111 | 95 | return htons(ETH_P_802_2); |
|---|
| 112 | | - break; |
|---|
| 113 | 96 | default: |
|---|
| 114 | 97 | printk(KERN_WARNING "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc->name); |
|---|
| 115 | 98 | return htons(ETH_P_802_2); |
|---|
| 116 | | - break; |
|---|
| 117 | 99 | } |
|---|
| 118 | | - lmc_trace(sc->lmc_device, "lmc_proto_tye out"); |
|---|
| 119 | | - |
|---|
| 120 | 100 | } |
|---|
| 121 | 101 | |
|---|
| 122 | 102 | void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/ |
|---|
| 123 | 103 | { |
|---|
| 124 | | - lmc_trace(sc->lmc_device, "lmc_proto_netif in"); |
|---|
| 125 | 104 | switch(sc->if_type){ |
|---|
| 126 | 105 | case LMC_PPP: |
|---|
| 127 | 106 | case LMC_NET: |
|---|
| .. | .. |
|---|
| 131 | 110 | case LMC_RAW: |
|---|
| 132 | 111 | break; |
|---|
| 133 | 112 | } |
|---|
| 134 | | - lmc_trace(sc->lmc_device, "lmc_proto_netif out"); |
|---|
| 135 | 113 | } |
|---|