Lines Matching refs:opts
960 const struct ndp_parser_opts *opts = ncm->parser_opts; in package_for_tx() local
962 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in package_for_tx()
976 put_ncm(&ntb_iter, opts->block_length, new_len); in package_for_tx()
977 put_ncm(&ntb_iter, opts->ndp_index, ndp_index); in package_for_tx()
980 new_len = opts->ndp_size + in package_for_tx()
1020 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_wrap_ntb() local
1024 const int dgram_idx_len = 2 * 2 * opts->dgram_item_len; in ncm_wrap_ntb()
1059 ncb_len = opts->nth_size; in ncm_wrap_ntb()
1071 put_unaligned_le32(opts->nth_sign, ntb_data); in ncm_wrap_ntb()
1074 put_unaligned_le16(opts->nth_size, ntb_data++); in ncm_wrap_ntb()
1080 ncm->skb_tx_ndp = alloc_skb((int)(opts->ndp_size in ncm_wrap_ntb()
1081 + opts->dpe_size in ncm_wrap_ntb()
1088 ntb_ndp = skb_put(ncm->skb_tx_ndp, opts->ndp_size); in ncm_wrap_ntb()
1112 put_ncm(&ntb_ndp, opts->dgram_item_len, ncb_len); in ncm_wrap_ntb()
1114 put_ncm(&ntb_ndp, opts->dgram_item_len, skb->len); in ncm_wrap_ntb()
1183 const struct ndp_parser_opts *opts = ncm->parser_opts; in ncm_unwrap_ntb() local
1188 if (get_unaligned_le32(tmp) != opts->nth_sign) { in ncm_unwrap_ntb()
1198 if (get_unaligned_le16(tmp++) != opts->nth_size) { in ncm_unwrap_ntb()
1205 if (get_ncm(&tmp, opts->block_length) > max_size) { in ncm_unwrap_ntb()
1210 ndp_index = get_ncm(&tmp, opts->ndp_index); in ncm_unwrap_ntb()
1216 (ndp_index < opts->nth_size)) { in ncm_unwrap_ntb()
1238 if ((ndp_len < opts->ndp_size in ncm_unwrap_ntb()
1239 + 2 * 2 * (opts->dgram_item_len * 2)) in ncm_unwrap_ntb()
1240 || (ndp_len % opts->ndplen_align != 0)) { in ncm_unwrap_ntb()
1245 tmp += opts->reserved1; in ncm_unwrap_ntb()
1247 ndp_index = get_ncm(&tmp, opts->next_ndp_index); in ncm_unwrap_ntb()
1248 tmp += opts->reserved2; in ncm_unwrap_ntb()
1250 ndp_len -= opts->ndp_size; in ncm_unwrap_ntb()
1251 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1252 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1279 index2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1280 dg_len2 = get_ncm(&tmp, opts->dgram_item_len); in ncm_unwrap_ntb()
1295 ndp_len -= 2 * (opts->dgram_item_len * 2); in ncm_unwrap_ntb()
1301 } while (ndp_len > 2 * (opts->dgram_item_len * 2)); in ncm_unwrap_ntb()
1576 struct f_ncm_opts *opts; in ncm_free_inst() local
1578 opts = container_of(f, struct f_ncm_opts, func_inst); in ncm_free_inst()
1579 if (opts->bound) in ncm_free_inst()
1580 gether_cleanup(netdev_priv(opts->net)); in ncm_free_inst()
1582 free_netdev(opts->net); in ncm_free_inst()
1583 kfree(opts->ncm_interf_group); in ncm_free_inst()
1584 kfree(opts); in ncm_free_inst()
1589 struct f_ncm_opts *opts; in ncm_alloc_inst() local
1594 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in ncm_alloc_inst()
1595 if (!opts) in ncm_alloc_inst()
1597 opts->ncm_os_desc.ext_compat_id = opts->ncm_ext_compat_id; in ncm_alloc_inst()
1599 mutex_init(&opts->lock); in ncm_alloc_inst()
1600 opts->func_inst.free_func_inst = ncm_free_inst; in ncm_alloc_inst()
1601 opts->net = gether_setup_default(); in ncm_alloc_inst()
1602 if (IS_ERR(opts->net)) { in ncm_alloc_inst()
1603 struct net_device *net = opts->net; in ncm_alloc_inst()
1604 kfree(opts); in ncm_alloc_inst()
1607 INIT_LIST_HEAD(&opts->ncm_os_desc.ext_prop); in ncm_alloc_inst()
1609 descs[0] = &opts->ncm_os_desc; in ncm_alloc_inst()
1612 config_group_init_type_name(&opts->func_inst.group, "", &ncm_func_type); in ncm_alloc_inst()
1614 usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs, in ncm_alloc_inst()
1617 ncm_free_inst(&opts->func_inst); in ncm_alloc_inst()
1620 opts->ncm_interf_group = ncm_interf_group; in ncm_alloc_inst()
1622 return &opts->func_inst; in ncm_alloc_inst()
1628 struct f_ncm_opts *opts; in ncm_free() local
1631 opts = container_of(f->fi, struct f_ncm_opts, func_inst); in ncm_free()
1633 mutex_lock(&opts->lock); in ncm_free()
1634 opts->refcnt--; in ncm_free()
1635 mutex_unlock(&opts->lock); in ncm_free()
1659 struct f_ncm_opts *opts; in ncm_alloc() local
1667 opts = container_of(fi, struct f_ncm_opts, func_inst); in ncm_alloc()
1668 mutex_lock(&opts->lock); in ncm_alloc()
1669 opts->refcnt++; in ncm_alloc()
1672 status = gether_get_host_addr_cdc(opts->net, ncm->ethaddr, in ncm_alloc()
1676 mutex_unlock(&opts->lock); in ncm_alloc()
1683 ncm->port.ioport = netdev_priv(opts->net); in ncm_alloc()
1684 mutex_unlock(&opts->lock); in ncm_alloc()