#include "ascsi.h"
#include "acdata.h"

int S_READCAP2(unlong id,unlong *allsec,unlong *sec1)
// 容量情報読み出し
{
static unchar ReadCap[]={
	 0x25
	,0x00
	,0x00,0x00,0x00,0x00
	,0x00
	,0x00
	,0x00
	,0x00
};
unchar capdata[8];
int ret;
	ret=S_CMD(id,sizeof(ReadCap), ReadCap, 8 , capdata );
	if (!ret) {
		if (allsec!=(unlong *)NULL) *allsec=ctol(capdata);
		if (sec1  !=(unlong *)NULL) *sec1  =ctol(&capdata[4]);
	}
	return(ret);
}
