pnp.c (139271) | pnp.c (150687) |
---|---|
1/* 2 * Copyright (c) 1996, Sujal M. Patel 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 * 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 * from: pnp.c,v 1.11 1999/05/06 22:11:19 peter Exp 27 */ 28 29#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1996, Sujal M. Patel 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 * 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 * from: pnp.c,v 1.11 1999/05/06 22:11:19 peter Exp 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/isa/pnp.c 139271 2004-12-24 22:18:19Z imp $"); | 30__FBSDID("$FreeBSD: head/sys/isa/pnp.c 150687 2005-09-28 15:01:58Z marius $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36#include <sys/bus.h> | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/kernel.h> 35#include <sys/module.h> 36#include <sys/bus.h> |
37#include <sys/endian.h> |
|
37#include <sys/malloc.h> 38#include <isa/isavar.h> 39#include <isa/pnpreg.h> 40#include <isa/pnpvar.h> 41#include <machine/bus.h> 42 43typedef struct _pnp_id { 44 uint32_t vendor_id; --- 64 unchanged lines hidden (view full) --- 109 110static void pnp_send_initiation_key(void); 111static int pnp_get_serial(pnp_id *p); 112static int pnp_isolation_protocol(device_t parent); 113 114char * 115pnp_eisaformat(uint32_t id) 116{ | 38#include <sys/malloc.h> 39#include <isa/isavar.h> 40#include <isa/pnpreg.h> 41#include <isa/pnpvar.h> 42#include <machine/bus.h> 43 44typedef struct _pnp_id { 45 uint32_t vendor_id; --- 64 unchanged lines hidden (view full) --- 110 111static void pnp_send_initiation_key(void); 112static int pnp_get_serial(pnp_id *p); 113static int pnp_isolation_protocol(device_t parent); 114 115char * 116pnp_eisaformat(uint32_t id) 117{ |
117 uint8_t *data = (uint8_t *) &id; | 118 uint8_t *data; |
118 static char idbuf[8]; 119 const char hextoascii[] = "0123456789abcdef"; 120 | 119 static char idbuf[8]; 120 const char hextoascii[] = "0123456789abcdef"; 121 |
122 id = htole32(id); 123 data = (uint8_t *)&id; |
|
121 idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); 122 idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); 123 idbuf[2] = '@' + (data[1] & 0x1f); 124 idbuf[3] = hextoascii[(data[2] >> 4)]; 125 idbuf[4] = hextoascii[(data[2] & 0xf)]; 126 idbuf[5] = hextoascii[(data[3] >> 4)]; 127 idbuf[6] = hextoascii[(data[3] & 0xf)]; 128 idbuf[7] = 0; --- 694 unchanged lines hidden --- | 124 idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); 125 idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); 126 idbuf[2] = '@' + (data[1] & 0x1f); 127 idbuf[3] = hextoascii[(data[2] >> 4)]; 128 idbuf[4] = hextoascii[(data[2] & 0xf)]; 129 idbuf[5] = hextoascii[(data[3] >> 4)]; 130 idbuf[6] = hextoascii[(data[3] & 0xf)]; 131 idbuf[7] = 0; --- 694 unchanged lines hidden --- |