Deleted Added
full compact
if_fwip.c (188394) if_fwip.c (193096)
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 188394 2009-02-09 16:58:18Z fjoe $
36 * $FreeBSD: head/sys/dev/firewire/if_fwip.c 193096 2009-05-30 15:14:44Z attilio $
37 */
38
39#ifdef HAVE_KERNEL_OPTION_HEADERS
40#include "opt_device_polling.h"
41#include "opt_inet.h"
42#endif
43
44#include <sys/param.h>

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

107SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len,
108 0, "Length of the receive queue");
109
110TUNABLE_INT("hw.firewire.fwip.rx_queue_len", &rx_queue_len);
111
112#ifdef DEVICE_POLLING
113static poll_handler_t fwip_poll;
114
37 */
38
39#ifdef HAVE_KERNEL_OPTION_HEADERS
40#include "opt_device_polling.h"
41#include "opt_inet.h"
42#endif
43
44#include <sys/param.h>

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

107SYSCTL_INT(_hw_firewire_fwip, OID_AUTO, rx_queue_len, CTLFLAG_RW, &rx_queue_len,
108 0, "Length of the receive queue");
109
110TUNABLE_INT("hw.firewire.fwip.rx_queue_len", &rx_queue_len);
111
112#ifdef DEVICE_POLLING
113static poll_handler_t fwip_poll;
114
115static void
115static int
116fwip_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
117{
118 struct fwip_softc *fwip;
119 struct firewire_comm *fc;
120
121 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
116fwip_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
117{
118 struct fwip_softc *fwip;
119 struct firewire_comm *fc;
120
121 if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
122 return;
122 return (0);
123
124 fwip = ((struct fwip_eth_softc *)ifp->if_softc)->fwip;
125 fc = fwip->fd.fc;
126 fc->poll(fc, (cmd == POLL_AND_CHECK_STATUS)?0:1, count);
123
124 fwip = ((struct fwip_eth_softc *)ifp->if_softc)->fwip;
125 fc = fwip->fd.fc;
126 fc->poll(fc, (cmd == POLL_AND_CHECK_STATUS)?0:1, count);
127 return (0);
127}
128#endif /* DEVICE_POLLING */
129
130static void
131fwip_identify(driver_t *driver, device_t parent)
132{
133 BUS_ADD_CHILD(parent, 0, "fwip", device_get_unit(parent));
134}

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

431
432 if (ifr->ifr_reqcap & IFCAP_POLLING &&
433 !(ifp->if_capenable & IFCAP_POLLING)) {
434 error = ether_poll_register(fwip_poll, ifp);
435 if (error)
436 return(error);
437 /* Disable interrupts */
438 fc->set_intr(fc, 0);
128}
129#endif /* DEVICE_POLLING */
130
131static void
132fwip_identify(driver_t *driver, device_t parent)
133{
134 BUS_ADD_CHILD(parent, 0, "fwip", device_get_unit(parent));
135}

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

432
433 if (ifr->ifr_reqcap & IFCAP_POLLING &&
434 !(ifp->if_capenable & IFCAP_POLLING)) {
435 error = ether_poll_register(fwip_poll, ifp);
436 if (error)
437 return(error);
438 /* Disable interrupts */
439 fc->set_intr(fc, 0);
439 ifp->if_capenable |= IFCAP_POLLING;
440 ifp->if_capenable |= IFCAP_POLLING |
441 IFCAP_POLLING_NOCOUNT;
440 return (error);
441
442 }
443 if (!(ifr->ifr_reqcap & IFCAP_POLLING) &&
444 ifp->if_capenable & IFCAP_POLLING) {
445 error = ether_poll_deregister(ifp);
446 /* Enable interrupts. */
447 fc->set_intr(fc, 1);
448 ifp->if_capenable &= ~IFCAP_POLLING;
442 return (error);
443
444 }
445 if (!(ifr->ifr_reqcap & IFCAP_POLLING) &&
446 ifp->if_capenable & IFCAP_POLLING) {
447 error = ether_poll_deregister(ifp);
448 /* Enable interrupts. */
449 fc->set_intr(fc, 1);
450 ifp->if_capenable &= ~IFCAP_POLLING;
451 ifp->if_capenable &= ~IFCAP_POLLING_NOCOUNT;
449 return (error);
450 }
451 }
452#endif /* DEVICE_POLLING */
453 break;
454#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
455 default:
456#else

--- 527 unchanged lines hidden ---
452 return (error);
453 }
454 }
455#endif /* DEVICE_POLLING */
456 break;
457#if defined(__FreeBSD__) && __FreeBSD_version >= 500000
458 default:
459#else

--- 527 unchanged lines hidden ---