D'oh! I was definitely confused there. I reverted the bumping of the ref count. But I think you were still seeing problems here.
As to the device mode thing, it's definitely not quite right. The issue is how much you want to avoid reopening the device at the COM layer, i.e. calling the driver's open routine. This could matter in case the driver doesn't allow multiple opens, or multiple writers, or whatever. Right now it avoids it except in the case that the needed access wasn't requested the first time, at the cost you noted of not enforcing access on open ports. The simple change you can do is make dev_hash_lookup just match mode == device->mode. Then there can be up to three driver open calls (read, write, read/write). The hairier change would be to make it create a new device_t when the mode doesn't match, but instead of reopening the COM device just clone its open state (the type-specific stuff in struct device, could be done with another hook in struct device_ops). _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd