/**
* @see org.jnode.driver.Driver#startDevice()
*/
protected void startDevice() throws DriverException {
final Device device = getDevice();
try {
final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
if (renameToDevicePrefixOnly()) {
dm.rename(device, getDevicePrefix(), true);
} else {
final String prefix = getDevicePrefix() + '-';
if (!device.getId().startsWith(prefix)) {
dm.rename(device, getDevicePrefix() + '-' + device.getId(), false);
}
}
} catch (DeviceAlreadyRegisteredException ex) {
log.error("Cannot rename device", ex);
} catch (NameNotFoundException ex) {
throw new DriverException("Cannot find DeviceManager", ex);
}
device.registerAPI(DeviceInfoAPI.class, this);
device.registerAPI(NetDeviceAPI.class, this);
txThread = new QueueProcessorThread<Object[]>(device.getId() + "-tx", txQueue, this);
txThread.start();
}