version 1.70, 2020/04/16 12:26:55 |
version 1.71, 2020/04/24 11:33:28 |
|
|
dev_reopen(struct dev *d) |
dev_reopen(struct dev *d) |
{ |
{ |
struct slot *s; |
struct slot *s; |
struct ctl *c, **pc; |
|
long long pos; |
long long pos; |
unsigned int pstate; |
unsigned int pstate; |
int delta; |
int delta; |
|
|
} |
} |
} |
} |
|
|
/* remove controls of old device */ |
/* remove old controls and add new ones */ |
pc = &d->ctl_list; |
dev_sioctl_close(d); |
while ((c = *pc) != NULL) { |
|
if (c->addr >= CTLADDR_END) { |
|
c->refs_mask &= ~CTL_DEVMASK; |
|
if (c->refs_mask == 0) { |
|
*pc = c->next; |
|
xfree(c); |
|
continue; |
|
} |
|
c->type = CTL_NONE; |
|
c->desc_mask = ~0; |
|
} |
|
pc = &c->next; |
|
} |
|
|
|
/* add new device controls */ |
|
dev_sioctl_open(d); |
dev_sioctl_open(d); |
|
|
/* start the device if needed */ |
/* start the device if needed */ |