Lines Matching defs:opts

968 	const struct ndp_parser_opts *opts = ncm->parser_opts;
970 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len;
984 put_ncm(&ntb_iter, opts->block_length, new_len);
985 put_ncm(&ntb_iter, opts->ndp_index, ndp_index);
988 new_len = opts->ndp_size +
1028 const struct ndp_parser_opts *opts = ncm->parser_opts;
1032 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len;
1067 ncb_len = opts->nth_size;
1079 put_unaligned_le32(opts->nth_sign, ntb_data);
1082 put_unaligned_le16(opts->nth_size, ntb_data++);
1088 ncm->skb_tx_ndp = alloc_skb((int)(opts->ndp_size
1089 + opts->dpe_size
1096 ntb_ndp = skb_put(ncm->skb_tx_ndp, opts->ndp_size);
1105 /* Note: we skip opts->next_ndp_index */
1120 put_ncm(&ntb_ndp, opts->dgram_item_len, ncb_len);
1122 put_ncm(&ntb_ndp, opts->dgram_item_len, skb->len);
1194 const struct ndp_parser_opts *opts = ncm->parser_opts;
1203 if (get_unaligned_le32(tmp) != opts->nth_sign) {
1213 if (get_unaligned_le16(tmp++) != opts->nth_size) {
1219 block_len = get_ncm(&tmp, opts->block_length);
1226 ndp_index = get_ncm(&tmp, opts->ndp_index);
1235 (ndp_index < opts->nth_size) ||
1237 opts->ndp_size))) {
1259 * item size is 16/32 bits, opts->dgram_item_len * 2 bytes
1263 if ((ndp_len < opts->ndp_size
1264 + 2 * 2 * (opts->dgram_item_len * 2)) ||
1265 (ndp_len % opts->ndplen_align != 0)) {
1270 tmp += opts->reserved1;
1272 ndp_index = get_ncm(&tmp, opts->next_ndp_index);
1273 tmp += opts->reserved2;
1275 ndp_len -= opts->ndp_size;
1276 index2 = get_ncm(&tmp, opts->dgram_item_len);
1277 dg_len2 = get_ncm(&tmp, opts->dgram_item_len);
1283 if ((index < opts->nth_size) ||
1284 (index > block_len - opts->dpe_size)) {
1317 index2 = get_ncm(&tmp, opts->dgram_item_len);
1318 dg_len2 = get_ncm(&tmp, opts->dgram_item_len);
1321 if (index2 > block_len - opts->dpe_size) {
1340 ndp_len -= 2 * (opts->dgram_item_len * 2);
1345 } while (ndp_len > 2 * (opts->dgram_item_len * 2));
1622 struct f_ncm_opts *opts;
1624 opts = container_of(f, struct f_ncm_opts, func_inst);
1625 if (opts->bound)
1626 gether_cleanup(netdev_priv(opts->net));
1628 free_netdev(opts->net);
1629 kfree(opts->ncm_interf_group);
1630 kfree(opts);
1635 struct f_ncm_opts *opts;
1640 opts = kzalloc(sizeof(*opts), GFP_KERNEL);
1641 if (!opts)
1643 opts->ncm_os_desc.ext_compat_id = opts->ncm_ext_compat_id;
1645 mutex_init(&opts->lock);
1646 opts->func_inst.free_func_inst = ncm_free_inst;
1647 opts->net = gether_setup_default();
1648 if (IS_ERR(opts->net)) {
1649 struct net_device *net = opts->net;
1650 kfree(opts);
1653 INIT_LIST_HEAD(&opts->ncm_os_desc.ext_prop);
1655 descs[0] = &opts->ncm_os_desc;
1658 config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type);
1660 usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
1663 ncm_free_inst(&opts->func_inst);
1666 opts->ncm_interf_group = ncm_interf_group;
1668 return &opts->func_inst;
1674 struct f_ncm_opts *opts;
1677 opts = container_of(f->fi, struct f_ncm_opts, func_inst);
1679 mutex_lock(&opts->lock);
1680 opts->refcnt--;
1681 mutex_unlock(&opts->lock);
1710 struct f_ncm_opts *opts;
1718 opts = container_of(fi, struct f_ncm_opts, func_inst);
1719 mutex_lock(&opts->lock);
1720 opts->refcnt++;
1723 status = gether_get_host_addr_cdc(opts->net, ncm->ethaddr,
1727 mutex_unlock(&opts->lock);
1734 ncm->port.ioport = netdev_priv(opts->net);
1735 mutex_unlock(&opts->lock);