Deleted Added
full compact
if_iso88025subr.c (67164) if_iso88025subr.c (69152)
1/*
2 * Copyright (c) 1998, Larry Lile
3 * All rights reserved.
4 *
5 * For latest sources and information on this driver, please
6 * go to http://anarchy.stdio.com.
7 *
8 * Questions, comments or suggestions should be directed to

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*
2 * Copyright (c) 1998, Larry Lile
3 * All rights reserved.
4 *
5 * For latest sources and information on this driver, please
6 * go to http://anarchy.stdio.com.
7 *
8 * Questions, comments or suggestions should be directed to

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * $FreeBSD: head/sys/net/if_iso88025subr.c 67164 2000-10-15 14:19:01Z phk $
33 * $FreeBSD: head/sys/net/if_iso88025subr.c 69152 2000-11-25 07:35:38Z jlemon $
34 *
35 */
36
37/*
38 *
39 * General ISO 802.5 (Token Ring) support routines
40 *
41 */

--- 115 unchanged lines hidden (view full) ---

157int
158iso88025_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt0)
159{
160 register struct iso88025_header *th;
161 struct iso88025_header gen_th;
162 register struct iso88025_sockaddr_data *sd = (struct iso88025_sockaddr_data *)dst->sa_data;
163 register struct llc *l;
164 register struct sockaddr_dl *sdl = NULL;
34 *
35 */
36
37/*
38 *
39 * General ISO 802.5 (Token Ring) support routines
40 *
41 */

--- 115 unchanged lines hidden (view full) ---

157int
158iso88025_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, struct rtentry *rt0)
159{
160 register struct iso88025_header *th;
161 struct iso88025_header gen_th;
162 register struct iso88025_sockaddr_data *sd = (struct iso88025_sockaddr_data *)dst->sa_data;
163 register struct llc *l;
164 register struct sockaddr_dl *sdl = NULL;
165 int s, error = 0, rif_len = 0;
165 int error = 0, rif_len = 0;
166 u_char edst[6];
167 register struct rtentry *rt;
166 u_char edst[6];
167 register struct rtentry *rt;
168 int len = m->m_pkthdr.len, loop_copy = 0;
168 int loop_copy = 0;
169 struct arpcom *ac = (struct arpcom *)ifp;
170
171 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
172 senderr(ENETDOWN);
173 rt = rt0;
174 if (rt) {
175 if ((rt->rt_flags & RTF_UP) == 0) {
176 rt0 = rt = rtalloc1(dst, 1, 0UL);

--- 112 unchanged lines hidden (view full) ---

289 } else if (bcmp(th->iso88025_dhost,
290 th->iso88025_shost, ETHER_ADDR_LEN) == 0) {
291 (void) if_simloop(ifp,
292 m, dst->sa_family, ISO88025_HDR_LEN);
293 return(0); /* XXX */
294 }
295 }
296
169 struct arpcom *ac = (struct arpcom *)ifp;
170
171 if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
172 senderr(ENETDOWN);
173 rt = rt0;
174 if (rt) {
175 if ((rt->rt_flags & RTF_UP) == 0) {
176 rt0 = rt = rtalloc1(dst, 1, 0UL);

--- 112 unchanged lines hidden (view full) ---

289 } else if (bcmp(th->iso88025_dhost,
290 th->iso88025_shost, ETHER_ADDR_LEN) == 0) {
291 (void) if_simloop(ifp,
292 m, dst->sa_family, ISO88025_HDR_LEN);
293 return(0); /* XXX */
294 }
295 }
296
297 s = splimp();
298 /*
299 * Queue message on interface, and start output if interface
300 * not yet active.
301 */
302 if (IF_QFULL(&ifp->if_snd)) {
303 printf("iso88025_output: packet dropped QFULL.\n");
304 IF_DROP(&ifp->if_snd);
305 splx(s);
297 if (! IF_HANDOFF_ADJ(&ifp->if_snd, m, ifp, ISO88025_HDR_LEN + 8)) {
298 printf("iso88025_output: packet dropped QFULL.\n");
306 senderr(ENOBUFS);
307 }
299 senderr(ENOBUFS);
300 }
308 if (m->m_flags & M_MCAST)
309 ifp->if_omcasts++;
310 IF_ENQUEUE(&ifp->if_snd, m);
311 if ((ifp->if_flags & IFF_OACTIVE) == 0)
312 (*ifp->if_start)(ifp);
313 splx(s);
314 ifp->if_obytes += len + ISO88025_HDR_LEN + 8;
315 return (error);
316
317bad:
318 if (m)
319 m_freem(m);
320 return (error);
321}
322
323/*
324 * ISO 88025 de-encapsulation
325 */
326void
327iso88025_input(struct ifnet *ifp, struct iso88025_header *th, struct mbuf *m)
328{
329 register struct ifqueue *inq;
330 u_short ether_type;
301 return (error);
302
303bad:
304 if (m)
305 m_freem(m);
306 return (error);
307}
308
309/*
310 * ISO 88025 de-encapsulation
311 */
312void
313iso88025_input(struct ifnet *ifp, struct iso88025_header *th, struct mbuf *m)
314{
315 register struct ifqueue *inq;
316 u_short ether_type;
331 int s;
332 register struct llc *l = mtod(m, struct llc *);
333
334 if ((ifp->if_flags & IFF_UP) == 0) {
335 m_freem(m);
336 return;
337 }
338
339 switch (l->llc_control) {

--- 68 unchanged lines hidden (view full) ---

408 inq = &arpintrq;
409 break;
410#endif
411 default:
412 m_freem(m);
413 return;
414 }
415
317 register struct llc *l = mtod(m, struct llc *);
318
319 if ((ifp->if_flags & IFF_UP) == 0) {
320 m_freem(m);
321 return;
322 }
323
324 switch (l->llc_control) {

--- 68 unchanged lines hidden (view full) ---

393 inq = &arpintrq;
394 break;
395#endif
396 default:
397 m_freem(m);
398 return;
399 }
400
416 s = splimp();
417 if (IF_QFULL(inq)) {
418 IF_DROP(inq);
419 m_freem(m);
401 if (! IF_HANDOFF(inq, m, NULL))
420 printf("iso88025_input: Packet dropped (Queue full).\n");
402 printf("iso88025_input: Packet dropped (Queue full).\n");
421 } else
422 IF_ENQUEUE(inq, m);
423 splx(s);
424}
403}