def create_radio(self, n_channels=None, use_chanctx=False, use_p2p_device=False): attrs = [] if n_channels: attrs.append(netlink.U32Attr(HWSIM_ATTR_CHANNELS, n_channels)) if use_chanctx: attrs.append(netlink.FlagAttr(HWSIM_ATTR_USE_CHANCTX)) if use_p2p_device: attrs.append(netlink.FlagAttr(HWSIM_ATTR_SUPPORT_P2P_DEVICE)) msg = netlink.GenlMessage(self._fid, HWSIM_CMD_CREATE_RADIO, flags = netlink.NLM_F_REQUEST | netlink.NLM_F_ACK, attrs = attrs) return msg.send_and_recv(self._conn).ret
def create_radio(self, n_channels=None, use_chanctx=False, hwname=None, no_vdev=False): attrs = [] if n_channels: attrs.append(netlink.U32Attr(HWSIM_ATTR_CHANNELS, n_channels)) if use_chanctx: attrs.append(netlink.FlagAttr(HWSIM_ATTR_USE_CHANCTX)) if hwname: attrs.append(netlink.NulStrAttr(HWSIM_ATTR_RADIO_NAME, hwname)) if no_vdev: attrs.append(netlink.FlagAttr(HWSIM_ATTR_NO_VDEV)) msg = netlink.GenlMessage(self._fid, HWSIM_CMD_CREATE_RADIO, flags = netlink.NLM_F_REQUEST | netlink.NLM_F_ACK, attrs = attrs) return msg.send_and_recv(self._conn).ret