Exemplo n.º 1
0
  /** @see org.jnode.driver.Driver#stopDevice() */
  protected void stopDevice() throws DriverException {
    super.stopDevice();

    abstractDeviceCore.disable();
    abstractDeviceCore.release();
    abstractDeviceCore = null;
  }
Exemplo n.º 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);
    }
  }
Exemplo n.º 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);
    }
  }
Exemplo n.º 4
0
 /** Gets the hardware address of this device */
 public HardwareAddress getAddress() {
   return abstractDeviceCore.getHwAddress();
 }