Changeset 1582
- Timestamp:
- 11/07/02 14:56:54 (11 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
kernel/busses/dmi_scan.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r1581 r1582 29 29 Makefile: Take kernel source location from /lib/modules/x.x.x/build 30 30 Module adm1021: Add support for MC1066 31 Module dmi_scan: Rename symbol duplicated in kernel 31 Module dmi_scan: Rename symbol duplicated in kernel; Apply fixes from 32 kernel 2.5.43 32 33 Module gl518sm: Iterate allowed only for rev 0x00 33 34 Module i2c-amd756: Configure base address for nForce support; -
lm-sensors/trunk/kernel/busses/dmi_scan.c
r1541 r1582 37 37 return ""; 38 38 s--; 39 while(s>0 )39 while(s>0 && *bp) 40 40 { 41 41 bp+=strlen(bp); … … 56 56 struct dmi_header *dm; 57 57 u8 *data; 58 int i= 1;58 int i=0; 59 59 60 60 buf = ioremap(base, len); … … 65 65 66 66 /* 67 * Stop when we see al the items the table claimed to have67 * Stop when we see all the items the table claimed to have 68 68 * OR we run off the end of the table (also happens) 69 69 */ 70 70 71 while(i<num && (data - buf) <len)71 while(i<num && data-buf+sizeof(struct dmi_header)<=len) 72 72 { 73 73 dm=(struct dmi_header *)data; 74 75 74 /* 76 * Avoid misparsing crud if the length of the last 77 * record is crap 75 * We want to know the total length (formated area and strings) 76 * before decoding to make sure we won't run off the table in 77 * dmi_decode or dmi_string 78 78 */ 79 if((data-buf+dm->length) >= len)80 break;81 decode(dm);82 79 data+=dm->length; 83 /* 84 * Don't go off the end of the data if there is 85 * stuff looking like string fill past the end 86 */ 87 while((data-buf) < len && (*data || data[1])) 80 while(data-buf<len-1 && (data[0] || data[1])) 88 81 data++; 82 if(data-buf<len-1) 83 decode(dm); 89 84 data+=2; 90 85 i++; … … 95 90 96 91 92 inline static int __init dmi_checksum(u8 *buf) 93 { 94 u8 sum=0; 95 int a; 96 97 for(a=0; a<15; a++) 98 sum+=buf[a]; 99 return (sum==0); 100 } 101 97 102 static int __init dmi_iterate(void (*decode)(struct dmi_header *)) 98 103 { 99 unsigned char buf[20]; 100 long fp=0xE0000L; 101 fp -= 16; 104 u8 buf[15]; 105 u32 fp=0xF0000; 102 106 103 107 #ifdef CONFIG_SIMNOW … … 111 115 while( fp < 0xFFFFF) 112 116 { 113 fp+=16; 114 isa_memcpy_fromio(buf, fp, 20); 115 if(memcmp(buf, "_DMI_", 5)==0) 117 isa_memcpy_fromio(buf, fp, 15); 118 if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf)) 116 119 { 117 120 u16 num=buf[13]<<8|buf[12]; … … 119 122 u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]; 120 123 121 dmi_printk((KERN_INFO "DMI %d.%d present.\n", 122 buf[14]>>4, buf[14]&0x0F)); 124 /* 125 * DMI version 0.0 means that the real version is taken from 126 * the SMBIOS version, which we don't know at this point. 127 */ 128 if(buf[14]!=0) 129 dmi_printk((KERN_INFO "DMI %d.%d present.\n", 130 buf[14]>>4, buf[14]&0x0F)); 131 else 132 dmi_printk((KERN_INFO "DMI present.\n")); 123 133 dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n", 124 buf[13]<<8|buf[12], 125 buf[7]<<8|buf[6])); 134 num, len)); 126 135 dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", 127 b uf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]));136 base)); 128 137 if(dmi_table(base,len, num, decode)==0) 129 138 return 0; 130 139 } 140 fp+=16; 131 141 } 132 142 return -1; … … 164 174 { 165 175 u8 *data = (u8 *)dm; 166 char *p;167 176 168 177 switch(dm->type) 169 178 { 170 179 case 0: 171 p=dmi_string(dm,data[4]); 172 if(*p) 173 { 174 dmi_printk(("BIOS Vendor: %s\n", p)); 175 dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); 176 dmi_printk(("BIOS Version: %s\n", 177 dmi_string(dm, data[5]))); 178 dmi_save_ident(dm, DMI_BIOS_VERSION, 5); 179 dmi_printk(("BIOS Release: %s\n", 180 dmi_string(dm, data[8]))); 181 dmi_save_ident(dm, DMI_BIOS_DATE, 8); 182 } 180 dmi_printk(("BIOS Vendor: %s\n", 181 dmi_string(dm, data[4]))); 182 dmi_save_ident(dm, DMI_BIOS_VENDOR, 4); 183 dmi_printk(("BIOS Version: %s\n", 184 dmi_string(dm, data[5]))); 185 dmi_save_ident(dm, DMI_BIOS_VERSION, 5); 186 dmi_printk(("BIOS Release: %s\n", 187 dmi_string(dm, data[8]))); 188 dmi_save_ident(dm, DMI_BIOS_DATE, 8); 183 189 break; 184 185 190 case 1: 186 p=dmi_string(dm,data[4]); 187 if(*p) 188 { 189 dmi_printk(("System Vendor: %s.\n",p)); 190 dmi_save_ident(dm, DMI_SYS_VENDOR, 4); 191 dmi_printk(("Product Name: %s.\n", 192 dmi_string(dm, data[5]))); 193 dmi_save_ident(dm, DMI_PRODUCT_NAME, 5); 194 dmi_printk(("Version %s.\n", 195 dmi_string(dm, data[6]))); 196 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); 197 dmi_printk(("Serial Number %s.\n", 198 dmi_string(dm, data[7]))); 199 } 191 dmi_printk(("System Vendor: %s\n", 192 dmi_string(dm, data[4]))); 193 dmi_save_ident(dm, DMI_SYS_VENDOR, 4); 194 dmi_printk(("Product Name: %s\n", 195 dmi_string(dm, data[5]))); 196 dmi_save_ident(dm, DMI_PRODUCT_NAME, 5); 197 dmi_printk(("Version: %s\n", 198 dmi_string(dm, data[6]))); 199 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6); 200 dmi_printk(("Serial Number: %s\n", 201 dmi_string(dm, data[7]))); 200 202 break; 201 203 case 2: 202 p=dmi_string(dm,data[4]); 203 if(*p) 204 { 205 dmi_printk(("Board Vendor: %s.\n",p)); 206 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4); 207 dmi_printk(("Board Name: %s.\n", 208 dmi_string(dm, data[5]))); 209 dmi_save_ident(dm, DMI_BOARD_NAME, 5); 210 dmi_printk(("Board Version: %s.\n", 211 dmi_string(dm, data[6]))); 212 dmi_save_ident(dm, DMI_BOARD_VERSION, 6); 213 } 214 break; 215 case 3: 216 p=dmi_string(dm,data[8]); 217 if(*p && *p!=' ') 218 dmi_printk(("Asset Tag: %s.\n", p)); 204 dmi_printk(("Board Vendor: %s\n", 205 dmi_string(dm, data[4]))); 206 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4); 207 dmi_printk(("Board Name: %s\n", 208 dmi_string(dm, data[5]))); 209 dmi_save_ident(dm, DMI_BOARD_NAME, 5); 210 dmi_printk(("Board Version: %s\n", 211 dmi_string(dm, data[6]))); 212 dmi_save_ident(dm, DMI_BOARD_VERSION, 6); 219 213 break; 220 214 }
