xnbu.c revision d62bc4badc1c1f1549c961cfb8b420e650e1272b
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Xen inter-domain backend - GLDv3 driver edition. 2N/A * A traditional GLDv3 driver used to communicate with a guest 2N/A * domain. This driver is typically plumbed underneath the IP stack 2N/A * or a software ethernet bridge. 2N/A/* Required driver entry points for GLDv3 */ 2N/A * If a transmit attempt failed because we ran out of ring 2N/A * space and there is now some space, re-enable the transmit 2N/A * Take a conservative approach - if the checksum is blank 2N/A * then we fill it in. 2N/A * If the consumer of the packet is IP then we might actually 2N/A * only need fill it in if the data is not validated, but how 2N/A * do we know who might end up with the packet? 2N/A * The checksum is blank. We must fill it in here. 2N/A * Because we calculated the checksum ourselves we 2N/A * know that it must be good, so we assert this. 2N/A * The checksum is asserted valid. 2N/A * The hardware checksum offload specification says 2N/A * that we must provide the actual checksum as well as 2N/A * an assertion that it is valid, but the protocol 2N/A * stack doesn't actually use it so we don't bother. 2N/A * If it was necessary we could grovel in the packet 2N/A * If the protocol stack has requested checksum 2N/A * offload, inform the peer that we have not 2N/A * calculated the checksum. 2N/A * We are able to send packets now - bring them on. 2N/A /* XXPV dme: playing with need_sched without txlock? */ 2N/A * If we consumed all of the mblk_t's offered, perhaps we need 2N/A * to indicate that we can accept more. Otherwise we are full 2N/A * and need to wait for space. 2N/A * If a previous transmit attempt failed because the ring 2N/A * was full, try again now. * xnbu_m_set_mac_addr() -- set the physical network address on the board * xnbu_m_set_multicast() -- set (enable) or disable a multicast address * We always accept all packets from the peer, so nothing to * do for enable or disable. * xnbu_m_set_promiscuous() -- set or reset promiscuous mode on the board * We always accept all packets from the peer, so nothing to * do for enable or disable. * xnbu_m_start() -- start the board receiving and enable interrupts. * xnbu_m_stop() - disable hardware * XXPV dme: blanking is not currently implemented. /* Just return B_TRUE. */ * Initialize pointers to device specific functions which will be * used by the generic layer. * xnbu is a virtual device, and it is not associated with any * physical device. Its margin size is determined by the maximum * packet size it can handle, which is PAGESIZE. * Register ourselves with the GLDv3 interface. * Attempt to unregister the mac.