if_fwip.c (130411) | if_fwip.c (130460) |
---|---|
1/* 2 * Copyright (c) 2004 3 * Doug Rabson 4 * Copyright (c) 2002-2003 5 * Hidetoshi Shimokawa. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * | 1/* 2 * Copyright (c) 2004 3 * Doug Rabson 4 * Copyright (c) 2002-2003 5 * Hidetoshi Shimokawa. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 19 unchanged lines hidden (view full) --- 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * |
36 * $FreeBSD: head/sys/dev/firewire/if_fwip.c 130411 2004-06-13 13:58:00Z dfr $ | 36 * $FreeBSD: head/sys/dev/firewire/if_fwip.c 130460 2004-06-14 09:34:20Z dfr $ |
37 */ 38 39#include "opt_inet.h" 40 41#include <sys/param.h> 42#include <sys/kernel.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> --- 502 unchanged lines hidden (view full) --- 547 struct firewire_comm *fc = fwip->fd.fc; 548 struct mbuf *m; 549 struct m_tag *mtag; 550 struct fw_hwaddr *destfw; 551 struct fw_xfer *xfer; 552 struct fw_xferq *xferq; 553 struct fw_pkt *fp; 554 uint16_t nodeid; | 37 */ 38 39#include "opt_inet.h" 40 41#include <sys/param.h> 42#include <sys/kernel.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> --- 502 unchanged lines hidden (view full) --- 547 struct firewire_comm *fc = fwip->fd.fc; 548 struct mbuf *m; 549 struct m_tag *mtag; 550 struct fw_hwaddr *destfw; 551 struct fw_xfer *xfer; 552 struct fw_xferq *xferq; 553 struct fw_pkt *fp; 554 uint16_t nodeid; |
555 int error; |
|
555 int i = 0; 556 557 GIANT_REQUIRED; 558 559 xfer = NULL; 560 xferq = fwip->fd.fc->atq; 561 while (xferq->queued < xferq->maxq - 1) { 562 xfer = STAILQ_FIRST(&fwip->xferlist); --- 98 unchanged lines hidden (view full) --- 661 662 fp->mode.wreqb = fwip->last_hdr.mode.wreqb; 663 fp->mode.wreqb.len = m->m_pkthdr.len; 664 xfer->send.spd = min(destfw->sspd, fc->speed); 665 } 666 667 xfer->send.pay_len = m->m_pkthdr.len; 668 | 556 int i = 0; 557 558 GIANT_REQUIRED; 559 560 xfer = NULL; 561 xferq = fwip->fd.fc->atq; 562 while (xferq->queued < xferq->maxq - 1) { 563 xfer = STAILQ_FIRST(&fwip->xferlist); --- 98 unchanged lines hidden (view full) --- 662 663 fp->mode.wreqb = fwip->last_hdr.mode.wreqb; 664 fp->mode.wreqb.len = m->m_pkthdr.len; 665 xfer->send.spd = min(destfw->sspd, fc->speed); 666 } 667 668 xfer->send.pay_len = m->m_pkthdr.len; 669 |
669 if (fw_asyreq(fc, -1, xfer) != 0) { | 670 error = fw_asyreq(fc, -1, xfer); 671 if (error == EAGAIN) { 672 /* 673 * We ran out of tlabels - requeue the packet 674 * for later transmission. 675 */ 676 xfer->mbuf = 0; 677 STAILQ_INSERT_TAIL(&fwip->xferlist, xfer, link); 678 IF_PREPEND(&ifp->if_snd, m); 679 break; 680 } 681 if (error) { |
670 /* error */ 671 ifp->if_oerrors ++; 672 /* XXX set error code */ 673 fwip_output_callback(xfer); 674 continue; 675 } else { 676 ifp->if_opackets ++; 677 i++; --- 262 unchanged lines hidden --- | 682 /* error */ 683 ifp->if_oerrors ++; 684 /* XXX set error code */ 685 fwip_output_callback(xfer); 686 continue; 687 } else { 688 ifp->if_opackets ++; 689 i++; --- 262 unchanged lines hidden --- |