if_fwe.c (109623) | if_fwe.c (109814) |
---|---|
1/* 2 * Copyright (C) 2002 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * | 1/* 2 * Copyright (C) 2002 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/firewire/if_fwe.c 109623 2003-01-21 08:56:16Z alfred $ | 34 * $FreeBSD: head/sys/dev/firewire/if_fwe.c 109814 2003-01-25 14:47:33Z simokawa $ |
35 */ 36 37#include "opt_inet.h" 38 39#include <sys/param.h> 40#include <sys/conf.h> 41#include <sys/kernel.h> 42#include <sys/malloc.h> --- 98 unchanged lines hidden (view full) --- 141 142static int 143fwe_attach(device_t dev) 144{ 145 struct fwe_softc *fwe; 146 struct ifnet *ifp; 147 int unit, s; 148 u_char *eaddr; | 35 */ 36 37#include "opt_inet.h" 38 39#include <sys/param.h> 40#include <sys/conf.h> 41#include <sys/kernel.h> 42#include <sys/malloc.h> --- 98 unchanged lines hidden (view full) --- 141 142static int 143fwe_attach(device_t dev) 144{ 145 struct fwe_softc *fwe; 146 struct ifnet *ifp; 147 int unit, s; 148 u_char *eaddr; |
149 struct fw_eui64 *eui; |
|
149 150 fwe = ((struct fwe_softc *)device_get_softc(dev)); 151 unit = device_get_unit(dev); 152 153 bzero(fwe, sizeof(struct fwe_softc)); 154 /* XXX */ 155 fwe->stream_ch = stream_ch; 156 fwe->dma_ch = -1; --- 6 unchanged lines hidden (view full) --- 163 fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM; 164 fwe->pkt_hdr.mode.stream.sy = 0; 165 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; 166 167 /* generate fake MAC address: first and last 3bytes from eui64 */ 168#define LOCAL (0x02) 169#define GROUP (0x01) 170 eaddr = &fwe->eth_softc.arpcom.ac_enaddr[0]; | 150 151 fwe = ((struct fwe_softc *)device_get_softc(dev)); 152 unit = device_get_unit(dev); 153 154 bzero(fwe, sizeof(struct fwe_softc)); 155 /* XXX */ 156 fwe->stream_ch = stream_ch; 157 fwe->dma_ch = -1; --- 6 unchanged lines hidden (view full) --- 164 fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM; 165 fwe->pkt_hdr.mode.stream.sy = 0; 166 fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch; 167 168 /* generate fake MAC address: first and last 3bytes from eui64 */ 169#define LOCAL (0x02) 170#define GROUP (0x01) 171 eaddr = &fwe->eth_softc.arpcom.ac_enaddr[0]; |
171 eaddr[0] = (fwe->fd.fc->eui[0] | LOCAL) & ~GROUP; 172 eaddr[1] = fwe->fd.fc->eui[1]; 173 eaddr[2] = fwe->fd.fc->eui[2]; 174 eaddr[3] = fwe->fd.fc->eui[5]; 175 eaddr[4] = fwe->fd.fc->eui[6]; 176 eaddr[5] = fwe->fd.fc->eui[7]; | 172 173 eui = &fwe->fd.fc->eui; 174 eaddr[0] = (FW_EUI64_BYTE(eui, 0) | LOCAL) & ~GROUP; 175 eaddr[1] = FW_EUI64_BYTE(eui, 1); 176 eaddr[2] = FW_EUI64_BYTE(eui, 2); 177 eaddr[3] = FW_EUI64_BYTE(eui, 5); 178 eaddr[4] = FW_EUI64_BYTE(eui, 6); 179 eaddr[5] = FW_EUI64_BYTE(eui, 7); |
177 printf("if_fwe%d: Fake Ethernet address: " 178 "%02x:%02x:%02x:%02x:%02x:%02x\n", unit, 179 eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]); 180 181 /* fill the rest and attach interface */ 182 ifp = &fwe->fwe_if; 183 ifp->if_softc = &fwe->eth_softc; 184 --- 442 unchanged lines hidden --- | 180 printf("if_fwe%d: Fake Ethernet address: " 181 "%02x:%02x:%02x:%02x:%02x:%02x\n", unit, 182 eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]); 183 184 /* fill the rest and attach interface */ 185 ifp = &fwe->fwe_if; 186 ifp->if_softc = &fwe->eth_softc; 187 --- 442 unchanged lines hidden --- |