diff options
author | Joe Perches <joe@perches.com> | 2015-01-28 13:05:51 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-02-03 15:24:29 -0500 |
commit | 5c7c0ca02f01df4345fcf6c0b60281928d3e775e (patch) | |
tree | 144f9da2af33f9e8a74abc3e038ce321e4a1a3aa /drivers/media | |
parent | be87b90f8c70bd1f28c5680a4f9f88b4ac3b0503 (diff) |
[media] dvb_net: Use standard debugging facilities
Convert dprintk to netdev_dbg where appropriate.
Remove dvb_net_debug module_param.
Remove __func__ from output as that can be added by dynamic_debug.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-core/dvb_net.c | 57 |
1 files changed, 24 insertions, 33 deletions
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c index ff79b0b82354..0b0f97af65d2 100644 --- a/drivers/media/dvb-core/dvb_net.c +++ b/drivers/media/dvb-core/dvb_net.c | |||
@@ -68,13 +68,6 @@ | |||
68 | #include "dvb_demux.h" | 68 | #include "dvb_demux.h" |
69 | #include "dvb_net.h" | 69 | #include "dvb_net.h" |
70 | 70 | ||
71 | static int dvb_net_debug; | ||
72 | module_param(dvb_net_debug, int, 0444); | ||
73 | MODULE_PARM_DESC(dvb_net_debug, "enable debug messages"); | ||
74 | |||
75 | #define dprintk(x...) do { if (dvb_net_debug) printk(x); } while (0) | ||
76 | |||
77 | |||
78 | static inline __u32 iov_crc32( __u32 c, struct kvec *iov, unsigned int cnt ) | 71 | static inline __u32 iov_crc32( __u32 c, struct kvec *iov, unsigned int cnt ) |
79 | { | 72 | { |
80 | unsigned int j; | 73 | unsigned int j; |
@@ -312,9 +305,9 @@ static int handle_ule_extensions( struct dvb_net_priv *p ) | |||
312 | return l; /* Stop extension header processing and discard SNDU. */ | 305 | return l; /* Stop extension header processing and discard SNDU. */ |
313 | total_ext_len += l; | 306 | total_ext_len += l; |
314 | #ifdef ULE_DEBUG | 307 | #ifdef ULE_DEBUG |
315 | dprintk("handle_ule_extensions: ule_next_hdr=%p, ule_sndu_type=%i, " | 308 | pr_debug("ule_next_hdr=%p, ule_sndu_type=%i, l=%i, total_ext_len=%i\n", |
316 | "l=%i, total_ext_len=%i\n", p->ule_next_hdr, | 309 | p->ule_next_hdr, (int)p->ule_sndu_type, |
317 | (int) p->ule_sndu_type, l, total_ext_len); | 310 | l, total_ext_len); |
318 | #endif | 311 | #endif |
319 | 312 | ||
320 | } while (p->ule_sndu_type < ETH_P_802_3_MIN); | 313 | } while (p->ule_sndu_type < ETH_P_802_3_MIN); |
@@ -697,8 +690,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) | |||
697 | 690 | ||
698 | if (drop) { | 691 | if (drop) { |
699 | #ifdef ULE_DEBUG | 692 | #ifdef ULE_DEBUG |
700 | dprintk("Dropping SNDU: MAC destination address does not match: dest addr: %pM, dev addr: %pM\n", | 693 | netdev_dbg(dev, "Dropping SNDU: MAC destination address does not match: dest addr: %pM, dev addr: %pM\n", |
701 | priv->ule_skb->data, dev->dev_addr); | 694 | priv->ule_skb->data, dev->dev_addr); |
702 | #endif | 695 | #endif |
703 | dev_kfree_skb(priv->ule_skb); | 696 | dev_kfree_skb(priv->ule_skb); |
704 | goto sndu_done; | 697 | goto sndu_done; |
@@ -961,8 +954,7 @@ static int dvb_net_filter_sec_set(struct net_device *dev, | |||
961 | (*secfilter)->filter_mask[10] = mac_mask[1]; | 954 | (*secfilter)->filter_mask[10] = mac_mask[1]; |
962 | (*secfilter)->filter_mask[11]=mac_mask[0]; | 955 | (*secfilter)->filter_mask[11]=mac_mask[0]; |
963 | 956 | ||
964 | dprintk("%s: filter mac=%pM\n", dev->name, mac); | 957 | netdev_dbg(dev, "filter mac=%pM mask=%pM\n", mac, mac_mask); |
965 | dprintk("%s: filter mask=%pM\n", dev->name, mac_mask); | ||
966 | 958 | ||
967 | return 0; | 959 | return 0; |
968 | } | 960 | } |
@@ -974,7 +966,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
974 | struct dmx_demux *demux = priv->demux; | 966 | struct dmx_demux *demux = priv->demux; |
975 | unsigned char *mac = (unsigned char *) dev->dev_addr; | 967 | unsigned char *mac = (unsigned char *) dev->dev_addr; |
976 | 968 | ||
977 | dprintk("%s: rx_mode %i\n", __func__, priv->rx_mode); | 969 | netdev_dbg(dev, "rx_mode %i\n", priv->rx_mode); |
978 | mutex_lock(&priv->mutex); | 970 | mutex_lock(&priv->mutex); |
979 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) | 971 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) |
980 | printk("%s: BUG %d\n", __func__, __LINE__); | 972 | printk("%s: BUG %d\n", __func__, __LINE__); |
@@ -984,7 +976,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
984 | priv->tsfeed = NULL; | 976 | priv->tsfeed = NULL; |
985 | 977 | ||
986 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { | 978 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { |
987 | dprintk("%s: alloc secfeed\n", __func__); | 979 | netdev_dbg(dev, "alloc secfeed\n"); |
988 | ret=demux->allocate_section_feed(demux, &priv->secfeed, | 980 | ret=demux->allocate_section_feed(demux, &priv->secfeed, |
989 | dvb_net_sec_callback); | 981 | dvb_net_sec_callback); |
990 | if (ret<0) { | 982 | if (ret<0) { |
@@ -1002,38 +994,38 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
1002 | } | 994 | } |
1003 | 995 | ||
1004 | if (priv->rx_mode != RX_MODE_PROMISC) { | 996 | if (priv->rx_mode != RX_MODE_PROMISC) { |
1005 | dprintk("%s: set secfilter\n", __func__); | 997 | netdev_dbg(dev, "set secfilter\n"); |
1006 | dvb_net_filter_sec_set(dev, &priv->secfilter, mac, mask_normal); | 998 | dvb_net_filter_sec_set(dev, &priv->secfilter, mac, mask_normal); |
1007 | } | 999 | } |
1008 | 1000 | ||
1009 | switch (priv->rx_mode) { | 1001 | switch (priv->rx_mode) { |
1010 | case RX_MODE_MULTI: | 1002 | case RX_MODE_MULTI: |
1011 | for (i = 0; i < priv->multi_num; i++) { | 1003 | for (i = 0; i < priv->multi_num; i++) { |
1012 | dprintk("%s: set multi_secfilter[%d]\n", __func__, i); | 1004 | netdev_dbg(dev, "set multi_secfilter[%d]\n", i); |
1013 | dvb_net_filter_sec_set(dev, &priv->multi_secfilter[i], | 1005 | dvb_net_filter_sec_set(dev, &priv->multi_secfilter[i], |
1014 | priv->multi_macs[i], mask_normal); | 1006 | priv->multi_macs[i], mask_normal); |
1015 | } | 1007 | } |
1016 | break; | 1008 | break; |
1017 | case RX_MODE_ALL_MULTI: | 1009 | case RX_MODE_ALL_MULTI: |
1018 | priv->multi_num=1; | 1010 | priv->multi_num=1; |
1019 | dprintk("%s: set multi_secfilter[0]\n", __func__); | 1011 | netdev_dbg(dev, "set multi_secfilter[0]\n"); |
1020 | dvb_net_filter_sec_set(dev, &priv->multi_secfilter[0], | 1012 | dvb_net_filter_sec_set(dev, &priv->multi_secfilter[0], |
1021 | mac_allmulti, mask_allmulti); | 1013 | mac_allmulti, mask_allmulti); |
1022 | break; | 1014 | break; |
1023 | case RX_MODE_PROMISC: | 1015 | case RX_MODE_PROMISC: |
1024 | priv->multi_num=0; | 1016 | priv->multi_num=0; |
1025 | dprintk("%s: set secfilter\n", __func__); | 1017 | netdev_dbg(dev, "set secfilter\n"); |
1026 | dvb_net_filter_sec_set(dev, &priv->secfilter, mac, mask_promisc); | 1018 | dvb_net_filter_sec_set(dev, &priv->secfilter, mac, mask_promisc); |
1027 | break; | 1019 | break; |
1028 | } | 1020 | } |
1029 | 1021 | ||
1030 | dprintk("%s: start filtering\n", __func__); | 1022 | netdev_dbg(dev, "start filtering\n"); |
1031 | priv->secfeed->start_filtering(priv->secfeed); | 1023 | priv->secfeed->start_filtering(priv->secfeed); |
1032 | } else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) { | 1024 | } else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) { |
1033 | struct timespec timeout = { 0, 10000000 }; // 10 msec | 1025 | struct timespec timeout = { 0, 10000000 }; // 10 msec |
1034 | 1026 | ||
1035 | /* we have payloads encapsulated in TS */ | 1027 | /* we have payloads encapsulated in TS */ |
1036 | dprintk("%s: alloc tsfeed\n", __func__); | 1028 | netdev_dbg(dev, "alloc tsfeed\n"); |
1037 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); | 1029 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); |
1038 | if (ret < 0) { | 1030 | if (ret < 0) { |
1039 | printk("%s: could not allocate ts feed\n", dev->name); | 1031 | printk("%s: could not allocate ts feed\n", dev->name); |
@@ -1057,7 +1049,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
1057 | goto error; | 1049 | goto error; |
1058 | } | 1050 | } |
1059 | 1051 | ||
1060 | dprintk("%s: start filtering\n", __func__); | 1052 | netdev_dbg(dev, "start filtering\n"); |
1061 | priv->tsfeed->start_filtering(priv->tsfeed); | 1053 | priv->tsfeed->start_filtering(priv->tsfeed); |
1062 | } else | 1054 | } else |
1063 | ret = -EINVAL; | 1055 | ret = -EINVAL; |
@@ -1072,17 +1064,16 @@ static int dvb_net_feed_stop(struct net_device *dev) | |||
1072 | struct dvb_net_priv *priv = netdev_priv(dev); | 1064 | struct dvb_net_priv *priv = netdev_priv(dev); |
1073 | int i, ret = 0; | 1065 | int i, ret = 0; |
1074 | 1066 | ||
1075 | dprintk("%s\n", __func__); | ||
1076 | mutex_lock(&priv->mutex); | 1067 | mutex_lock(&priv->mutex); |
1077 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { | 1068 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { |
1078 | if (priv->secfeed) { | 1069 | if (priv->secfeed) { |
1079 | if (priv->secfeed->is_filtering) { | 1070 | if (priv->secfeed->is_filtering) { |
1080 | dprintk("%s: stop secfeed\n", __func__); | 1071 | netdev_dbg(dev, "stop secfeed\n"); |
1081 | priv->secfeed->stop_filtering(priv->secfeed); | 1072 | priv->secfeed->stop_filtering(priv->secfeed); |
1082 | } | 1073 | } |
1083 | 1074 | ||
1084 | if (priv->secfilter) { | 1075 | if (priv->secfilter) { |
1085 | dprintk("%s: release secfilter\n", __func__); | 1076 | netdev_dbg(dev, "release secfilter\n"); |
1086 | priv->secfeed->release_filter(priv->secfeed, | 1077 | priv->secfeed->release_filter(priv->secfeed, |
1087 | priv->secfilter); | 1078 | priv->secfilter); |
1088 | priv->secfilter=NULL; | 1079 | priv->secfilter=NULL; |
@@ -1090,8 +1081,8 @@ static int dvb_net_feed_stop(struct net_device *dev) | |||
1090 | 1081 | ||
1091 | for (i=0; i<priv->multi_num; i++) { | 1082 | for (i=0; i<priv->multi_num; i++) { |
1092 | if (priv->multi_secfilter[i]) { | 1083 | if (priv->multi_secfilter[i]) { |
1093 | dprintk("%s: release multi_filter[%d]\n", | 1084 | netdev_dbg(dev, "release multi_filter[%d]\n", |
1094 | __func__, i); | 1085 | i); |
1095 | priv->secfeed->release_filter(priv->secfeed, | 1086 | priv->secfeed->release_filter(priv->secfeed, |
1096 | priv->multi_secfilter[i]); | 1087 | priv->multi_secfilter[i]); |
1097 | priv->multi_secfilter[i] = NULL; | 1088 | priv->multi_secfilter[i] = NULL; |
@@ -1105,7 +1096,7 @@ static int dvb_net_feed_stop(struct net_device *dev) | |||
1105 | } else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) { | 1096 | } else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) { |
1106 | if (priv->tsfeed) { | 1097 | if (priv->tsfeed) { |
1107 | if (priv->tsfeed->is_filtering) { | 1098 | if (priv->tsfeed->is_filtering) { |
1108 | dprintk("%s: stop tsfeed\n", __func__); | 1099 | netdev_dbg(dev, "stop tsfeed\n"); |
1109 | priv->tsfeed->stop_filtering(priv->tsfeed); | 1100 | priv->tsfeed->stop_filtering(priv->tsfeed); |
1110 | } | 1101 | } |
1111 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); | 1102 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); |
@@ -1145,16 +1136,16 @@ static void wq_set_multicast_list (struct work_struct *work) | |||
1145 | netif_addr_lock_bh(dev); | 1136 | netif_addr_lock_bh(dev); |
1146 | 1137 | ||
1147 | if (dev->flags & IFF_PROMISC) { | 1138 | if (dev->flags & IFF_PROMISC) { |
1148 | dprintk("%s: promiscuous mode\n", dev->name); | 1139 | netdev_dbg(dev, "promiscuous mode\n"); |
1149 | priv->rx_mode = RX_MODE_PROMISC; | 1140 | priv->rx_mode = RX_MODE_PROMISC; |
1150 | } else if ((dev->flags & IFF_ALLMULTI)) { | 1141 | } else if ((dev->flags & IFF_ALLMULTI)) { |
1151 | dprintk("%s: allmulti mode\n", dev->name); | 1142 | netdev_dbg(dev, "allmulti mode\n"); |
1152 | priv->rx_mode = RX_MODE_ALL_MULTI; | 1143 | priv->rx_mode = RX_MODE_ALL_MULTI; |
1153 | } else if (!netdev_mc_empty(dev)) { | 1144 | } else if (!netdev_mc_empty(dev)) { |
1154 | struct netdev_hw_addr *ha; | 1145 | struct netdev_hw_addr *ha; |
1155 | 1146 | ||
1156 | dprintk("%s: set_mc_list, %d entries\n", | 1147 | netdev_dbg(dev, "set_mc_list, %d entries\n", |
1157 | dev->name, netdev_mc_count(dev)); | 1148 | netdev_mc_count(dev)); |
1158 | 1149 | ||
1159 | priv->rx_mode = RX_MODE_MULTI; | 1150 | priv->rx_mode = RX_MODE_MULTI; |
1160 | priv->multi_num = 0; | 1151 | priv->multi_num = 0; |