Пример #1
0
  /** @see org.jnode.driver.Driver#stopDevice() */
  protected void stopDevice() throws DriverException {
    super.stopDevice();

    abstractDeviceCore.disable();
    abstractDeviceCore.release();
    abstractDeviceCore = null;
  }
Пример #2
0
  /** @see org.jnode.driver.Driver#startDevice() */
  protected void startDevice() throws DriverException {
    try {
      log.info("Starting " + flags.getName());
      abstractDeviceCore = newCore(getDevice(), flags);
      try {
        abstractDeviceCore.initialize();
      } catch (DriverException ex) {
        abstractDeviceCore.release();
        throw ex;
      }

      super.startDevice();
    } catch (ResourceNotFreeException ex) {
      throw new DriverException("Cannot claim " + flags.getName() + " resources", ex);
    }
  }
Пример #3
0
  /** @see org.jnode.driver.net.spi.AbstractNetDriver#doTransmit(SocketBuffer, HardwareAddress) */
  protected void doTransmitEthernet(SocketBuffer skbuf, HardwareAddress destination)
      throws NetworkException {
    try {
      // Pad
      if (skbuf.getSize() < ETH_ZLEN) {
        skbuf.append(ETH_ZLEN - skbuf.getSize());
      }

      abstractDeviceCore.transmit(skbuf, destination, TRANSMIT_TIMEOUT);
    } catch (InterruptedException ex) {
      throw new NetworkException("Interrupted", ex);
    } catch (TimeoutException ex) {
      throw new NetworkException("Timeout", ex);
    }
  }
Пример #4
0
 /** Gets the hardware address of this device */
 public HardwareAddress getAddress() {
   return abstractDeviceCore.getHwAddress();
 }