diff options
Diffstat (limited to 'linux/dev/glue')
-rw-r--r-- | linux/dev/glue/net.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/linux/dev/glue/net.c b/linux/dev/glue/net.c index b76e098..20ce754 100644 --- a/linux/dev/glue/net.c +++ b/linux/dev/glue/net.c @@ -533,6 +533,17 @@ static io_return_t device_get_status (void *d, dev_flavor_t flavor, dev_status_t status, mach_msg_type_number_t *count) { + if (flavor == NET_FLAGS) + { + struct net_data *net = (struct net_data *) d; + + if (*count != sizeof(short)) + return D_INVALID_SIZE; + + *(short *) status = net->dev->flags; + return D_SUCCESS; + } + if(flavor >= SIOCIWFIRST && flavor <= SIOCIWLAST) { /* handle wireless ioctl */ @@ -592,6 +603,21 @@ static io_return_t device_set_status(void *d, dev_flavor_t flavor, dev_status_t status, mach_msg_type_number_t count) { + if (flavor == NET_FLAGS) + { + if (count != sizeof(short)) + return D_INVALID_SIZE; + + short flags = *(short *) status; + struct net_data *net = (struct net_data *) d; + + dev_change_flags (net->dev, flags); + + /* Change the flags of the Mach device, too. */ + net->ifnet.if_flags = net->dev->flags; + return D_SUCCESS; + } + if(flavor < SIOCIWFIRST || flavor > SIOCIWLAST) return D_INVALID_OPERATION; |