bzero(tb, DEV_BSIZE);
bzero(tb, sizeof(tb));
ata_get_params(drvp, flags, prms)	struct ata_drive_datas *drvp;	u_int8_t flags;	struct ataparams *prms;{	char tb[DEV_BSIZE];	struct wdc_command wdc_c;#if BYTE_ORDER == LITTLE_ENDIAN	int i;	u_int16_t *p;#endif	WDCDEBUG_PRINT(("wdc_ata_get_parms\n"), DEBUG_FUNCS);	bzero(tb, DEV_BSIZE);	bzero(prms, sizeof(struct ataparams));	bzero(&wdc_c, sizeof(struct wdc_command));	if (drvp->drive_flags & DRIVE_ATA) {		wdc_c.r_command = WDCC_IDENTIFY;		wdc_c.r_st_bmask = WDCS_DRDY;		wdc_c.r_st_pmask = WDCS_DRQ;		wdc_c.timeout = 1000; /* 1s */	} else if (drvp->drive_flags & DRIVE_ATAPI) {		wdc_c.r_command = ATAPI_IDENTIFY_DEVICE;		wdc_c.r_st_bmask = 0;		wdc_c.r_st_pmask = WDCS_DRQ;		wdc_c.timeout = 10000; /* 10s */	} else {		return CMD_ERR;	}	wdc_c.flags = AT_READ | flags;	wdc_c.data = tb;	wdc_c.bcount = DEV_BSIZE;	{		int ret;		if ((ret = wdc_exec_command(drvp, &wdc_c)) != WDC_COMPLETE) {			printf ("WDC_EXEC_COMMAND: %d\n");			return CMD_AGAIN;		}	}	if (wdc_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {		return CMD_ERR;	} else {		/* Read in parameter block. */		bcopy(tb, prms, sizeof(struct ataparams));#if BYTE_ORDER == LITTLE_ENDIAN		/*		 * Shuffle string byte order.		 * ATAPI Mitsumi and NEC drives don't need this.		 */		if ((prms->atap_config & WDC_CFG_ATAPI_MASK) ==		    WDC_CFG_ATAPI &&		    ((prms->atap_model[0] == 'N' &&			prms->atap_model[1] == 'E') ||		     (prms->atap_model[0] == 'F' &&			 prms->atap_model[1] == 'X')))			return 0;		for (i = 0; i < sizeof(prms->atap_model); i += 2) {			p = (u_short *)(prms->atap_model + i);			*p = ntohs(*p);		}		for (i = 0; i < sizeof(prms->atap_serial); i += 2) {			p = (u_short *)(prms->atap_serial + i);			*p = ntohs(*p);		}		for (i = 0; i < sizeof(prms->atap_revision); i += 2) {			p = (u_short *)(prms->atap_revision + i);			*p = ntohs(*p);		}#endif		return CMD_OK;	}}