sys/hp300/stand/autoconf.c
/*
 * Convert HP MSUS to a valid bootdev layout:
 *	TYPE comes from MSUS device type as mapped by rom2mdev
 *	PARTITION is set to 0 ('a')
 *	UNIT comes from MSUS unit (almost always 0)
 *	CONTROLLER comes from MSUS primary address
 *	ADAPTOR comes from SCSI/HPIB driver logical unit number
 *		(passed back via unused hw_pa field)
 */
Convert HP MSUS to a valid bootdev layout:
TYPE comes from MSUS device type as mapped by rom2mdev
PARTITION is set to 0 ('a')
UNIT comes from MSUS unit (almost always 0)
CONTROLLER comes from MSUS primary address
ADAPTOR comes from SCSI/HPIB driver logical unit number
(passed back via unused hw_pa field)
Convert HP MSUS to a valid bootdev layout : TYPE comes from MSUS device type as mapped by rom2mdev PARTITION is set to 0 ( ' a ' ) UNIT comes from MSUS unit ( almost always 0 ) CONTROLLER comes from MSUS primary address ADAPTOR comes from SCSI / HPIB driver logical unit number ( passed back via unused hw_pa field )
u_long
msustobdev()
{
	struct rominfo *rp = (struct rominfo *) ROMADDR;
	u_long bdev = 0;
	register struct hp_hw *hw;
	int sc;
	sc = (rp->msus >> 8) & 0xFF;
	for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++)
		if (hw->hw_sc == sc)
			break;
	bdev |= rom2mdev[(rp->msus >> 24) & 0x1F] << B_TYPESHIFT;
	bdev |= 0 << B_PARTITIONSHIFT;
	bdev |= ((rp->msus >> 16) & 0xFF) << B_UNITSHIFT;
	bdev |= (rp->msus & 0xFF) << B_CONTROLLERSHIFT;
	bdev |= (int)hw->hw_pa << B_ADAPTORSHIFT;
	bdev |= B_DEVMAGIC;
#if 0
	printf("msus %x -> bdev %x\n", rp->msus, bdev);
#endif
	return (bdev);
}
u_long msustobdev ( ) { struct rominfo * rp = ( struct rominfo * ) ROMADDR ; u_long bdev = 0 ; register struct hp_hw * hw ; int sc ; sc = ( rp -> msus >> 8 ) & 0xFF ; for ( hw = sc_table ; hw < & sc_table [ MAXCTLRS ] ; hw ++ ) if ( hw -> hw_sc == sc ) break ; bdev |= rom2mdev [ ( rp -> msus >> 24 ) & 0x1F ] << B_TYPESHIFT ; bdev |= 0 << B_PARTITIONSHIFT ; bdev |= ( ( rp -> msus >> 16 ) & 0xFF ) << B_UNITSHIFT ; bdev |= ( rp -> msus & 0xFF ) << B_CONTROLLERSHIFT ; bdev |= ( int ) hw -> hw_pa << B_ADAPTORSHIFT ; bdev |= B_DEVMAGIC ; #if 0 printf ( " \n " , rp -> msus , bdev ) ; #endif return ( bdev ) ; }
Convert HP MSUS to a valid bootdev layout:
      TYPE comes from MSUS device type as mapped by rom2mdev
      PARTITION is set to 0 ('a')
      UNIT comes from MSUS unit (almost always 0)
      CONTROLLER comes from MSUS primary address
      ADAPTOR comes from SCSI/HPIB driver logical unit number
              (passed back via unused hw_pa field)
Convert HP MSUS to a valid bootdev layout : TYPE comes from MSUS device type as mapped by rom2mdev PARTITION is set to 0 ( ' a ' ) UNIT comes from MSUS unit ( almost always 0 ) CONTROLLER comes from MSUS primary address ADAPTOR comes from SCSI / HPIB driver logical unit number ( passed back via unused hw_pa field )