if_cs.c (179620) | if_cs.c (179621) |
---|---|
1/*- 2 * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. 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 --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. 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 --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/cs/if_cs.c 179620 2008-06-06 17:22:07Z imp $"); | 30__FBSDID("$FreeBSD: head/sys/dev/cs/if_cs.c 179621 2008-06-06 17:27:19Z imp $"); |
31 32/* 33 * 34 * Device driver for Crystal Semiconductor CS8920 based ethernet 35 * adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997 36 */ 37 38/* --- 139 unchanged lines hidden (view full) --- 178 * for the SIBUSY bit (Register 16, SelfST, bit 8) to clear. After 179 * each command has been issued, the host must wait again for SIBUSY 180 * to clear." 181 * 182 * Before we issue the command, we should be !busy, so that will 183 * be fast. The datasheet suggests that clock out from the part 184 * per word will be on the order of 25us, which is consistant with 185 * the 1MHz serial clock and 16bits... We should never hit 100, | 31 32/* 33 * 34 * Device driver for Crystal Semiconductor CS8920 based ethernet 35 * adapters. By Maxim Bolotin and Oleg Sharoiko, 27-April-1997 36 */ 37 38/* --- 139 unchanged lines hidden (view full) --- 178 * for the SIBUSY bit (Register 16, SelfST, bit 8) to clear. After 179 * each command has been issued, the host must wait again for SIBUSY 180 * to clear." 181 * 182 * Before we issue the command, we should be !busy, so that will 183 * be fast. The datasheet suggests that clock out from the part 184 * per word will be on the order of 25us, which is consistant with 185 * the 1MHz serial clock and 16bits... We should never hit 100, |
186 * let alone 30,000 here. The original code did an unconditional 187 * 30ms DELAY here. Bad Kharma. | 186 * let alone 15,000 here. The original code did an unconditional 187 * 30ms DELAY here. Bad Kharma. cs_readreg takes ~2us. |
188 */ | 188 */ |
189 for (i = 0; i < 30000; i++) /* 30ms max */ | 189 for (i = 0; i < 15000; i++) /* 30ms max */ |
190 if (!(cs_readreg(sc, PP_SelfST) & SI_BUSY)) 191 return (0); 192 return (1); 193} 194 195static void 196control_dc_dc(struct cs_softc *sc, int on_not_off) 197{ --- 1046 unchanged lines hidden --- | 190 if (!(cs_readreg(sc, PP_SelfST) & SI_BUSY)) 191 return (0); 192 return (1); 193} 194 195static void 196control_dc_dc(struct cs_softc *sc, int on_not_off) 197{ --- 1046 unchanged lines hidden --- |