kernels/linux-2.4.0/arch/ia64/sn/io/eeprom.c
/* the following function converts an EEPROM record to a close facsimile
 * of the string returned by reading a Dallas Semiconductor NIC (see
 * one of the many incarnations of nic.c for details on that driver)
 */
the following function converts an EEPROM record to a close facsimile
of the string returned by reading a Dallas Semiconductor NIC (see
one of the many incarnations of nic.c for details on that driver)
the following function converts an EEPROM record to a close facsimile of the string returned by reading a Dallas Semiconductor NIC ( see one of the many incarnations of nic . c for details on that driver )
int nicify( char *dst, eeprom_brd_record_t *src )
{
    int field_len;
    uint64_t unique_id;
    char *cur_dst = dst;
    eeprom_board_ia_t   *board;
    board   = src->board_ia;
    ASSERT( board );  
    strcpy( cur_dst, "Part:" );
    cur_dst += strlen( cur_dst );
    ASSERT( (board->part_num_tl & FIELD_FORMAT_MASK)
	    == FIELD_FORMAT_ASCII );
    field_len = board->part_num_tl & FIELD_LENGTH_MASK;
    copy_ascii_field( cur_dst, board->part_num, field_len, HYPHEN );
    cur_dst += field_len;
    strcpy( cur_dst, ";Name:" );
    cur_dst += strlen( cur_dst );
    ASSERT( (board->product_tl & FIELD_FORMAT_MASK) == FIELD_FORMAT_ASCII );
    field_len = board->product_tl & FIELD_LENGTH_MASK;
    copy_ascii_field( cur_dst, board->product, field_len, UNDERSCORE );
    cur_dst += field_len;
    strcpy( cur_dst, ";Serial:" );
    cur_dst += strlen( cur_dst );
    ASSERT( (board->serial_num_tl & FIELD_FORMAT_MASK)
	    == FIELD_FORMAT_ASCII );
    field_len = board->serial_num_tl & FIELD_LENGTH_MASK;
    copy_ascii_field( cur_dst, board->serial_num, field_len,
		      HYPHEN);
    cur_dst += field_len;
    strcpy( cur_dst, ";Revision:");
    cur_dst += strlen( cur_dst );
    ASSERT( (board->board_rev_tl & FIELD_FORMAT_MASK)
	    == FIELD_FORMAT_ASCII );
    field_len = board->board_rev_tl & FIELD_LENGTH_MASK;
    copy_ascii_field( cur_dst, board->board_rev, field_len, HYPHEN );
    cur_dst += field_len;
    strcpy( cur_dst, ";Group:ff;Capability:ffffffff;Variety:ff" );
    cur_dst += strlen( cur_dst );
    strcpy( cur_dst, ";Laser:" );
    cur_dst += strlen( cur_dst );
    unique_id = generate_unique_id( board->serial_num,
				    board->serial_num_tl & FIELD_LENGTH_MASK );
    int64_to_hex_string( cur_dst, unique_id );
    strcat( dst, ";" );
    return 1;
}
int nicify ( char * dst , eeprom_brd_record_t * src ) { int field_len ; uint64_t unique_id ; char * cur_dst = dst ; eeprom_board_ia_t * board ; board = src -> board_ia ; ASSERT ( board ) ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; ASSERT ( ( board -> part_num_tl & FIELD_FORMAT_MASK ) == FIELD_FORMAT_ASCII ) ; field_len = board -> part_num_tl & FIELD_LENGTH_MASK ; copy_ascii_field ( cur_dst , board -> part_num , field_len , HYPHEN ) ; cur_dst += field_len ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; ASSERT ( ( board -> product_tl & FIELD_FORMAT_MASK ) == FIELD_FORMAT_ASCII ) ; field_len = board -> product_tl & FIELD_LENGTH_MASK ; copy_ascii_field ( cur_dst , board -> product , field_len , UNDERSCORE ) ; cur_dst += field_len ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; ASSERT ( ( board -> serial_num_tl & FIELD_FORMAT_MASK ) == FIELD_FORMAT_ASCII ) ; field_len = board -> serial_num_tl & FIELD_LENGTH_MASK ; copy_ascii_field ( cur_dst , board -> serial_num , field_len , HYPHEN ) ; cur_dst += field_len ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; ASSERT ( ( board -> board_rev_tl & FIELD_FORMAT_MASK ) == FIELD_FORMAT_ASCII ) ; field_len = board -> board_rev_tl & FIELD_LENGTH_MASK ; copy_ascii_field ( cur_dst , board -> board_rev , field_len , HYPHEN ) ; cur_dst += field_len ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; strcpy ( cur_dst , " " ) ; cur_dst += strlen ( cur_dst ) ; unique_id = generate_unique_id ( board -> serial_num , board -> serial_num_tl & FIELD_LENGTH_MASK ) ; int64_to_hex_string ( cur_dst , unique_id ) ; strcat ( dst , " " ) ; return 1 ; }
the following function converts an EEPROM record to a close facsimile
 of the string returned by reading a Dallas Semiconductor NIC (see
 one of the many incarnations of nic.c for details on that driver)
the following function converts an EEPROM record to a close facsimile of the string returned by reading a Dallas Semiconductor NIC ( see one of the many incarnations of nic . c for details on that driver )
/* there should always be a board info area */ /* copy part number */ /* copy product name */ /* copy serial number */ /* copy revision */ /* EEPROMs don't have equivalents for the Group, Capability and
     * Variety fields, so we pad these with 0's
     */ /* use the board serial number to "fake" a laser id */