• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/media/video/pvrusb2/

Lines Matching refs:sfp

86 	struct pvr2_sysfs *sfp;
89 sfp = (struct pvr2_sysfs *)class_dev->class_data;
90 if (!sfp) return -EINVAL;
91 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
95 pvr2_sysfs_trace("pvr2_sysfs(%p) show_name(cid=%d) is %s",sfp,id,name);
105 struct pvr2_sysfs *sfp;
109 sfp = (struct pvr2_sysfs *)class_dev->class_data;
110 if (!sfp) return -EINVAL;
111 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
122 pvr2_sysfs_trace("pvr2_sysfs(%p) show_type(cid=%d) is %s",sfp,id,name);
132 struct pvr2_sysfs *sfp;
135 sfp = (struct pvr2_sysfs *)class_dev->class_data;
136 if (!sfp) return -EINVAL;
137 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
141 pvr2_sysfs_trace("pvr2_sysfs(%p) show_min(cid=%d) is %ld",sfp,id,val);
149 struct pvr2_sysfs *sfp;
152 sfp = (struct pvr2_sysfs *)class_dev->class_data;
153 if (!sfp) return -EINVAL;
154 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
158 pvr2_sysfs_trace("pvr2_sysfs(%p) show_max(cid=%d) is %ld",sfp,id,val);
166 struct pvr2_sysfs *sfp;
170 sfp = (struct pvr2_sysfs *)class_dev->class_data;
171 if (!sfp) return -EINVAL;
172 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
182 sfp,id,cnt,buf,val);
190 struct pvr2_sysfs *sfp;
194 sfp = (struct pvr2_sysfs *)class_dev->class_data;
195 if (!sfp) return -EINVAL;
196 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
206 sfp,id,cnt,buf,val);
214 struct pvr2_sysfs *sfp;
218 sfp = (struct pvr2_sysfs *)class_dev->class_data;
219 if (!sfp) return -EINVAL;
220 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
232 pvr2_sysfs_trace("pvr2_sysfs(%p) show_enum(cid=%d)",sfp,id);
239 struct pvr2_sysfs *sfp;
243 sfp = (struct pvr2_sysfs *)class_dev->class_data;
244 if (!sfp) return -EINVAL;
245 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
258 pvr2_sysfs_trace("pvr2_sysfs(%p) show_bits(cid=%d)",sfp,id);
262 static int store_val_any(int id,int customfl,struct pvr2_sysfs *sfp,
269 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id);
277 pvr2_hdw_commit_ctl(sfp->channel.hdw);
284 struct pvr2_sysfs *sfp;
286 sfp = (struct pvr2_sysfs *)class_dev->class_data;
287 ret = store_val_any(id,0,sfp,buf,count);
295 struct pvr2_sysfs *sfp;
297 sfp = (struct pvr2_sysfs *)class_dev->class_data;
298 ret = store_val_any(id,1,sfp,buf,count);
478 static void pvr2_sysfs_add_control(struct pvr2_sysfs *sfp,int ctl_id)
491 cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,ctl_id);
500 cip->chptr = sfp;
502 if (sfp->item_last) {
503 sfp->item_last->item_next = cip;
505 sfp->item_first = cip;
507 sfp->item_last = cip;
578 ret = sysfs_create_group(&sfp->class_dev->kobj,&cip->grp);
592 static void pvr2_sysfs_add_debugifc(struct pvr2_sysfs *sfp)
606 sfp->debugifc = dip;
607 ret = class_device_create_file(sfp->class_dev,&dip->attr_debugcmd);
614 ret = class_device_create_file(sfp->class_dev,&dip->attr_debuginfo);
624 static void pvr2_sysfs_tear_down_debugifc(struct pvr2_sysfs *sfp)
626 if (!sfp->debugifc) return;
627 if (sfp->debugifc->debuginfo_created_ok) {
628 class_device_remove_file(sfp->class_dev,
629 &sfp->debugifc->attr_debuginfo);
631 if (sfp->debugifc->debugcmd_created_ok) {
632 class_device_remove_file(sfp->class_dev,
633 &sfp->debugifc->attr_debugcmd);
635 kfree(sfp->debugifc);
636 sfp->debugifc = NULL;
641 static void pvr2_sysfs_add_controls(struct pvr2_sysfs *sfp)
644 cnt = pvr2_hdw_get_ctrl_count(sfp->channel.hdw);
646 pvr2_sysfs_add_control(sfp,idx);
651 static void pvr2_sysfs_tear_down_controls(struct pvr2_sysfs *sfp)
654 for (cip1 = sfp->item_first; cip1; cip1 = cip2) {
657 sysfs_remove_group(&sfp->class_dev->kobj,&cip1->grp);
681 static void class_dev_destroy(struct pvr2_sysfs *sfp)
683 if (!sfp->class_dev) return;
685 pvr2_sysfs_tear_down_debugifc(sfp);
687 pvr2_sysfs_tear_down_controls(sfp);
688 if (sfp->bus_info_created_ok) {
689 class_device_remove_file(sfp->class_dev,
690 &sfp->attr_bus_info);
692 if (sfp->v4l_minor_number_created_ok) {
693 class_device_remove_file(sfp->class_dev,
694 &sfp->attr_v4l_minor_number);
696 if (sfp->v4l_radio_minor_number_created_ok) {
697 class_device_remove_file(sfp->class_dev,
698 &sfp->attr_v4l_radio_minor_number);
700 if (sfp->unit_number_created_ok) {
701 class_device_remove_file(sfp->class_dev,
702 &sfp->attr_unit_number);
704 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
705 sfp->class_dev->class_data = NULL;
706 class_device_unregister(sfp->class_dev);
707 sfp->class_dev = NULL;
713 struct pvr2_sysfs *sfp;
714 sfp = (struct pvr2_sysfs *)class_dev->class_data;
715 if (!sfp) return -EINVAL;
717 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw,
724 struct pvr2_sysfs *sfp;
725 sfp = (struct pvr2_sysfs *)class_dev->class_data;
726 if (!sfp) return -EINVAL;
728 pvr2_hdw_get_bus_info(sfp->channel.hdw));
735 struct pvr2_sysfs *sfp;
736 sfp = (struct pvr2_sysfs *)class_dev->class_data;
737 if (!sfp) return -EINVAL;
739 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw,
746 struct pvr2_sysfs *sfp;
747 sfp = (struct pvr2_sysfs *)class_dev->class_data;
748 if (!sfp) return -EINVAL;
750 pvr2_hdw_get_unit_number(sfp->channel.hdw));
754 static void class_dev_create(struct pvr2_sysfs *sfp,
761 usb_dev = pvr2_hdw_get_dev(sfp->channel.hdw);
769 if (pvr2_hdw_get_sn(sfp->channel.hdw)) {
771 pvr2_hdw_get_sn(sfp->channel.hdw));
772 } else if (pvr2_hdw_get_unit_number(sfp->channel.hdw) >= 0) {
774 pvr2_hdw_get_unit_number(sfp->channel.hdw) + 'a');
782 sfp->class_dev = class_dev;
783 class_dev->class_data = sfp;
792 sfp->attr_v4l_minor_number.attr.name = "v4l_minor_number";
793 sfp->attr_v4l_minor_number.attr.mode = S_IRUGO;
794 sfp->attr_v4l_minor_number.show = v4l_minor_number_show;
795 sfp->attr_v4l_minor_number.store = NULL;
796 ret = class_device_create_file(sfp->class_dev,
797 &sfp->attr_v4l_minor_number);
802 sfp->v4l_minor_number_created_ok = !0;
805 sfp->attr_v4l_radio_minor_number.attr.name = "v4l_radio_minor_number";
806 sfp->attr_v4l_radio_minor_number.attr.mode = S_IRUGO;
807 sfp->attr_v4l_radio_minor_number.show = v4l_radio_minor_number_show;
808 sfp->attr_v4l_radio_minor_number.store = NULL;
809 ret = class_device_create_file(sfp->class_dev,
810 &sfp->attr_v4l_radio_minor_number);
815 sfp->v4l_radio_minor_number_created_ok = !0;
818 sfp->attr_unit_number.attr.name = "unit_number";
819 sfp->attr_unit_number.attr.mode = S_IRUGO;
820 sfp->attr_unit_number.show = unit_number_show;
821 sfp->attr_unit_number.store = NULL;
822 ret = class_device_create_file(sfp->class_dev,&sfp->attr_unit_number);
827 sfp->unit_number_created_ok = !0;
830 sfp->attr_bus_info.attr.name = "bus_info_str";
831 sfp->attr_bus_info.attr.mode = S_IRUGO;
832 sfp->attr_bus_info.show = bus_info_show;
833 sfp->attr_bus_info.store = NULL;
834 ret = class_device_create_file(sfp->class_dev,
835 &sfp->attr_bus_info);
840 sfp->bus_info_created_ok = !0;
843 pvr2_sysfs_add_controls(sfp);
845 pvr2_sysfs_add_debugifc(sfp);
852 struct pvr2_sysfs *sfp;
853 sfp = container_of(chp,struct pvr2_sysfs,channel);
854 if (!sfp->channel.mc_head->disconnect_flag) return;
855 pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_sysfs id=%p",sfp);
856 class_dev_destroy(sfp);
857 pvr2_channel_done(&sfp->channel);
858 kfree(sfp);
865 struct pvr2_sysfs *sfp;
866 sfp = kzalloc(sizeof(*sfp),GFP_KERNEL);
867 if (!sfp) return sfp;
868 pvr2_trace(PVR2_TRACE_STRUCT,"Creating pvr2_sysfs id=%p",sfp);
869 pvr2_channel_init(&sfp->channel,mp);
870 sfp->channel.check_func = pvr2_sysfs_internal_check;
872 class_dev_create(sfp,class_ptr);
873 return sfp;
914 struct pvr2_sysfs *sfp;
915 sfp = (struct pvr2_sysfs *)class_dev->class_data;
916 if (!sfp) return -EINVAL;
917 pvr2_hdw_trigger_module_log(sfp->channel.hdw);
918 return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE);
924 struct pvr2_sysfs *sfp;
925 sfp = (struct pvr2_sysfs *)class_dev->class_data;
926 if (!sfp) return -EINVAL;
927 return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE);
934 struct pvr2_sysfs *sfp;
937 sfp = (struct pvr2_sysfs *)class_dev->class_data;
938 if (!sfp) return -EINVAL;
940 ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count);