DeviceImpl (USB bus, String drivername, int a)
    throws IOException, SecurityException
    {
	super (null, bus, a);

	usb = bus;
	path = drivername;//f.getPath ();

	// should only fail if the device unplugged before
	// we opened it, or permissions were bogus, or ...
	if ((fd = openNative (path)) < 0) {
	    String	message;

	    message = "can't open device file r/w, " + path;
	    /*
	    if (fd == -USBException.EPERM)
		throw new SecurityException (message);
	    else
	    */
		throw new USBException (message, -fd);
	}

	int			num_descriptor_retries = 0;
	IOException		descriptor_exception = null;

	do {
	    // fd's open; NOW we can get the device descriptor
	    try {
		    byte buf [];

		    buf = ControlMessage.getStandardDescriptor (this,
			    Descriptor.TYPE_DEVICE, (byte) 0, 0, 18);
		    descriptor = new DeviceDescriptor (this, buf);
		    // ... and configuration descriptor
		    getConfiguration ();

		    if (Windows.trace)
			    System.err.println ("new: " + path);
		    return;
	    } catch (USBException ue) {
		    if (Windows.debug)
			    ue.printStackTrace ();
		    else if(Windows.trace)
		    	System.err.println ("get dev descr fail:  "
				+ path + ", " + ue.getMessage ());
		    descriptor_exception = ue;
	    } catch (IOException e) {
		if (Windows.debug)
		    System.err.println ("get dev descr fail:  "
		    	+ path + ", " + e.getMessage ());
		throw e;
	    }
	} while ( num_descriptor_retries++ < 4 );
	    throw descriptor_exception;
	}