libsmart.c
/* Map SMART READ DATA threshold attributes */
Map SMART READ DATA threshold attributes
Map SMART READ DATA threshold attributes
static smart_map_t *
__smart_map_ata_thresh(uint8_t *b)
{
	smart_map_t *sm = NULL;
	sm = malloc(sizeof(smart_map_t) + (4 * sizeof(smart_attr_t)));
	if (sm) {
		uint32_t i;
		sm->count = 4;
		sm->attr[0].page = 0;
		sm->attr[0].id = 0;
		sm->attr[0].bytes = 2;
		sm->attr[0].flags = 0;
		sm->attr[0].raw = b;
		sm->attr[0].thresh = NULL;
		b +=2;
		for (i = 1; i < sm->count; i++) {
			sm->attr[i].page = 0;
			sm->attr[i].id = i;
			sm->attr[i].bytes = 1;
			sm->attr[i].flags = 0;
			sm->attr[i].raw = b;
			sm->attr[i].thresh = NULL;
			b ++;
			if (i == 2)
				b += 6;
		}
	}
	return sm;
}
static smart_map_t * __smart_map_ata_thresh ( uint8_t * b ) { smart_map_t * sm = NULL ; sm = malloc ( sizeof ( smart_map_t ) + ( 4 * sizeof ( smart_attr_t ) ) ) ; if ( sm ) { uint32_t i ; sm -> count = 4 ; sm -> attr [ 0 ] . page = 0 ; sm -> attr [ 0 ] . id = 0 ; sm -> attr [ 0 ] . bytes = 2 ; sm -> attr [ 0 ] . flags = 0 ; sm -> attr [ 0 ] . raw = b ; sm -> attr [ 0 ] . thresh = NULL ; b += 2 ; for ( i = 1 ; i < sm -> count ; i ++ ) { sm -> attr [ i ] . page = 0 ; sm -> attr [ i ] . id = i ; sm -> attr [ i ] . bytes = 1 ; sm -> attr [ i ] . flags = 0 ; sm -> attr [ i ] . raw = b ; sm -> attr [ i ] . thresh = NULL ; b ++ ; if ( i == 2 ) b += 6 ; } } return sm ; }
Map SMART READ DATA threshold attributes
Map SMART READ DATA threshold attributes