firewire.c (264482) | firewire.c (277622) |
---|---|
1/*- 2 * Copyright (c) 2004 Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> 3 * 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 Hidetoshi Shimokawa <simokawa@FreeBSD.ORG> 3 * 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 --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/boot/i386/libfirewire/firewire.c 264482 2014-04-14 22:49:37Z brueffer $"); | 28__FBSDID("$FreeBSD: head/sys/boot/i386/libfirewire/firewire.c 277622 2015-01-23 23:53:56Z will $"); |
29 30/* 31 * FireWire disk device handling. 32 * 33 */ 34 35#include <stand.h> 36 --- 191 unchanged lines hidden (view full) --- 228 src->businfo.irmc = 1; 229 src->businfo.cmc = 1; 230 src->businfo.isc = 1; 231 src->businfo.bmc = 1; 232 src->businfo.pmc = 0; 233 src->businfo.cyc_clk_acc = 100; 234 src->businfo.max_rec = sc->maxrec; 235 src->businfo.max_rom = MAXROM_4; | 29 30/* 31 * FireWire disk device handling. 32 * 33 */ 34 35#include <stand.h> 36 --- 191 unchanged lines hidden (view full) --- 228 src->businfo.irmc = 1; 229 src->businfo.cmc = 1; 230 src->businfo.isc = 1; 231 src->businfo.bmc = 1; 232 src->businfo.pmc = 0; 233 src->businfo.cyc_clk_acc = 100; 234 src->businfo.max_rec = sc->maxrec; 235 src->businfo.max_rom = MAXROM_4; |
236 src->businfo.generation = 1; | 236#define FW_GENERATION_CHANGEABLE 2 237 src->businfo.generation = FW_GENERATION_CHANGEABLE; |
237 src->businfo.link_spd = sc->speed; 238 239 src->businfo.eui64.hi = sc->eui.hi; 240 src->businfo.eui64.lo = sc->eui.lo; 241 242 STAILQ_INIT(&src->chunk_list); 243 244 sc->crom_src = src; --- 63 unchanged lines hidden (view full) --- 308 309 fw_reset_crom(sc); 310 dcons_crom(sc); 311 312 newrom = malloc(CROMSIZE); 313 src = &sc->crom_src_buf->src; 314 crom_load(src, (uint32_t *)newrom, CROMSIZE); 315 if (bcmp(newrom, sc->config_rom, CROMSIZE) != 0) { | 238 src->businfo.link_spd = sc->speed; 239 240 src->businfo.eui64.hi = sc->eui.hi; 241 src->businfo.eui64.lo = sc->eui.lo; 242 243 STAILQ_INIT(&src->chunk_list); 244 245 sc->crom_src = src; --- 63 unchanged lines hidden (view full) --- 309 310 fw_reset_crom(sc); 311 dcons_crom(sc); 312 313 newrom = malloc(CROMSIZE); 314 src = &sc->crom_src_buf->src; 315 crom_load(src, (uint32_t *)newrom, CROMSIZE); 316 if (bcmp(newrom, sc->config_rom, CROMSIZE) != 0) { |
316 /* bump generation and reload */ 317 src->businfo.generation ++; 318 /* generation must be between 0x2 and 0xF */ | 317 /* Bump generation and reload. */ 318 src->businfo.generation++; 319 320 /* Handle generation count wraps. */ |
319 if (src->businfo.generation < 2) | 321 if (src->businfo.generation < 2) |
320 src->businfo.generation ++; | 322 src->businfo.generation = 2; 323 324 /* Recalculate CRC to account for generation change. */ |
321 crom_load(src, (uint32_t *)newrom, CROMSIZE); 322 bcopy(newrom, (void *)sc->config_rom, CROMSIZE); 323 } 324 free(newrom); 325} 326 327static int 328fw_busreset(struct fwohci_softc *sc) --- 142 unchanged lines hidden --- | 325 crom_load(src, (uint32_t *)newrom, CROMSIZE); 326 bcopy(newrom, (void *)sc->config_rom, CROMSIZE); 327 } 328 free(newrom); 329} 330 331static int 332fw_busreset(struct fwohci_softc *sc) --- 142 unchanged lines hidden --- |