summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Bolle <pebolle@tiscali.nl>2014-06-01 17:47:24 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-05 02:13:41 -0400
commitca05e3a7551b71891d42d637d3a1e443c6bbd781 (patch)
treeb1e3ed16facd0b2ddd19ae45b12ad2339ce62027
parent00d115fc758c6ef331553a9c6aa34b7bd79116a5 (diff)
isdn/capi: move capi_info2str to capidrv.c
capi_info2str() is apparently meant to be of general utility. It is actually only used in capidrv.c. So move it from capiutil.c to capidrv.c and (obviously) stop exporting it. And, since we're touching this, merge the two versions of this function. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/capi/capidrv.c195
-rw-r--r--drivers/isdn/capi/capiutil.c200
-rw-r--r--include/linux/isdn/capiutil.h5
3 files changed, 195 insertions, 205 deletions
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index cc9f1927a322..70e67f6a22ff 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -763,6 +763,201 @@ static inline int new_bchan(capidrv_contr *card)
763} 763}
764 764
765/* ------------------------------------------------------------------- */ 765/* ------------------------------------------------------------------- */
766static char *capi_info2str(u16 reason)
767{
768#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
769 return "..";
770#else
771 switch (reason) {
772
773/*-- informative values (corresponding message was processed) -----*/
774 case 0x0001:
775 return "NCPI not supported by current protocol, NCPI ignored";
776 case 0x0002:
777 return "Flags not supported by current protocol, flags ignored";
778 case 0x0003:
779 return "Alert already sent by another application";
780
781/*-- error information concerning CAPI_REGISTER -----*/
782 case 0x1001:
783 return "Too many applications";
784 case 0x1002:
785 return "Logical block size too small, must be at least 128 Bytes";
786 case 0x1003:
787 return "Buffer exceeds 64 kByte";
788 case 0x1004:
789 return "Message buffer size too small, must be at least 1024 Bytes";
790 case 0x1005:
791 return "Max. number of logical connections not supported";
792 case 0x1006:
793 return "Reserved";
794 case 0x1007:
795 return "The message could not be accepted because of an internal busy condition";
796 case 0x1008:
797 return "OS resource error (no memory ?)";
798 case 0x1009:
799 return "CAPI not installed";
800 case 0x100A:
801 return "Controller does not support external equipment";
802 case 0x100B:
803 return "Controller does only support external equipment";
804
805/*-- error information concerning message exchange functions -----*/
806 case 0x1101:
807 return "Illegal application number";
808 case 0x1102:
809 return "Illegal command or subcommand or message length less than 12 bytes";
810 case 0x1103:
811 return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
812 case 0x1104:
813 return "Queue is empty";
814 case 0x1105:
815 return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
816 case 0x1106:
817 return "Unknown notification parameter";
818 case 0x1107:
819 return "The Message could not be accepted because of an internal busy condition";
820 case 0x1108:
821 return "OS Resource error (no memory ?)";
822 case 0x1109:
823 return "CAPI not installed";
824 case 0x110A:
825 return "Controller does not support external equipment";
826 case 0x110B:
827 return "Controller does only support external equipment";
828
829/*-- error information concerning resource / coding problems -----*/
830 case 0x2001:
831 return "Message not supported in current state";
832 case 0x2002:
833 return "Illegal Controller / PLCI / NCCI";
834 case 0x2003:
835 return "Out of PLCI";
836 case 0x2004:
837 return "Out of NCCI";
838 case 0x2005:
839 return "Out of LISTEN";
840 case 0x2006:
841 return "Out of FAX resources (protocol T.30)";
842 case 0x2007:
843 return "Illegal message parameter coding";
844
845/*-- error information concerning requested services -----*/
846 case 0x3001:
847 return "B1 protocol not supported";
848 case 0x3002:
849 return "B2 protocol not supported";
850 case 0x3003:
851 return "B3 protocol not supported";
852 case 0x3004:
853 return "B1 protocol parameter not supported";
854 case 0x3005:
855 return "B2 protocol parameter not supported";
856 case 0x3006:
857 return "B3 protocol parameter not supported";
858 case 0x3007:
859 return "B protocol combination not supported";
860 case 0x3008:
861 return "NCPI not supported";
862 case 0x3009:
863 return "CIP Value unknown";
864 case 0x300A:
865 return "Flags not supported (reserved bits)";
866 case 0x300B:
867 return "Facility not supported";
868 case 0x300C:
869 return "Data length not supported by current protocol";
870 case 0x300D:
871 return "Reset procedure not supported by current protocol";
872
873/*-- informations about the clearing of a physical connection -----*/
874 case 0x3301:
875 return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
876 case 0x3302:
877 return "Protocol error layer 2";
878 case 0x3303:
879 return "Protocol error layer 3";
880 case 0x3304:
881 return "Another application got that call";
882/*-- T.30 specific reasons -----*/
883 case 0x3311:
884 return "Connecting not successful (remote station is no FAX G3 machine)";
885 case 0x3312:
886 return "Connecting not successful (training error)";
887 case 0x3313:
888 return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
889 case 0x3314:
890 return "Disconnected during transfer (remote abort)";
891 case 0x3315:
892 return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
893 case 0x3316:
894 return "Disconnected during transfer (local tx data underrun)";
895 case 0x3317:
896 return "Disconnected during transfer (local rx data overflow)";
897 case 0x3318:
898 return "Disconnected during transfer (local abort)";
899 case 0x3319:
900 return "Illegal parameter coding (e.g. SFF coding error)";
901
902/*-- disconnect causes from the network according to ETS 300 102-1/Q.931 -----*/
903 case 0x3481: return "Unallocated (unassigned) number";
904 case 0x3482: return "No route to specified transit network";
905 case 0x3483: return "No route to destination";
906 case 0x3486: return "Channel unacceptable";
907 case 0x3487:
908 return "Call awarded and being delivered in an established channel";
909 case 0x3490: return "Normal call clearing";
910 case 0x3491: return "User busy";
911 case 0x3492: return "No user responding";
912 case 0x3493: return "No answer from user (user alerted)";
913 case 0x3495: return "Call rejected";
914 case 0x3496: return "Number changed";
915 case 0x349A: return "Non-selected user clearing";
916 case 0x349B: return "Destination out of order";
917 case 0x349C: return "Invalid number format";
918 case 0x349D: return "Facility rejected";
919 case 0x349E: return "Response to STATUS ENQUIRY";
920 case 0x349F: return "Normal, unspecified";
921 case 0x34A2: return "No circuit / channel available";
922 case 0x34A6: return "Network out of order";
923 case 0x34A9: return "Temporary failure";
924 case 0x34AA: return "Switching equipment congestion";
925 case 0x34AB: return "Access information discarded";
926 case 0x34AC: return "Requested circuit / channel not available";
927 case 0x34AF: return "Resources unavailable, unspecified";
928 case 0x34B1: return "Quality of service unavailable";
929 case 0x34B2: return "Requested facility not subscribed";
930 case 0x34B9: return "Bearer capability not authorized";
931 case 0x34BA: return "Bearer capability not presently available";
932 case 0x34BF: return "Service or option not available, unspecified";
933 case 0x34C1: return "Bearer capability not implemented";
934 case 0x34C2: return "Channel type not implemented";
935 case 0x34C5: return "Requested facility not implemented";
936 case 0x34C6: return "Only restricted digital information bearer capability is available";
937 case 0x34CF: return "Service or option not implemented, unspecified";
938 case 0x34D1: return "Invalid call reference value";
939 case 0x34D2: return "Identified channel does not exist";
940 case 0x34D3: return "A suspended call exists, but this call identity does not";
941 case 0x34D4: return "Call identity in use";
942 case 0x34D5: return "No call suspended";
943 case 0x34D6: return "Call having the requested call identity has been cleared";
944 case 0x34D8: return "Incompatible destination";
945 case 0x34DB: return "Invalid transit network selection";
946 case 0x34DF: return "Invalid message, unspecified";
947 case 0x34E0: return "Mandatory information element is missing";
948 case 0x34E1: return "Message type non-existent or not implemented";
949 case 0x34E2: return "Message not compatible with call state or message type non-existent or not implemented";
950 case 0x34E3: return "Information element non-existent or not implemented";
951 case 0x34E4: return "Invalid information element contents";
952 case 0x34E5: return "Message not compatible with call state";
953 case 0x34E6: return "Recovery on timer expiry";
954 case 0x34EF: return "Protocol error, unspecified";
955 case 0x34FF: return "Interworking, unspecified";
956
957 default: return "No additional information";
958 }
959#endif
960}
766 961
767static void handle_controller(_cmsg *cmsg) 962static void handle_controller(_cmsg *cmsg)
768{ 963{
diff --git a/drivers/isdn/capi/capiutil.c b/drivers/isdn/capi/capiutil.c
index d26f17033b68..6e797e502cfa 100644
--- a/drivers/isdn/capi/capiutil.c
+++ b/drivers/isdn/capi/capiutil.c
@@ -22,205 +22,6 @@
22 22
23/* from CAPI2.0 DDK AVM Berlin GmbH */ 23/* from CAPI2.0 DDK AVM Berlin GmbH */
24 24
25#ifndef CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON
26char *capi_info2str(u16 reason)
27{
28 return "..";
29}
30#else
31char *capi_info2str(u16 reason)
32{
33 switch (reason) {
34
35/*-- informative values (corresponding message was processed) -----*/
36 case 0x0001:
37 return "NCPI not supported by current protocol, NCPI ignored";
38 case 0x0002:
39 return "Flags not supported by current protocol, flags ignored";
40 case 0x0003:
41 return "Alert already sent by another application";
42
43/*-- error information concerning CAPI_REGISTER -----*/
44 case 0x1001:
45 return "Too many applications";
46 case 0x1002:
47 return "Logical block size too small, must be at least 128 Bytes";
48 case 0x1003:
49 return "Buffer exceeds 64 kByte";
50 case 0x1004:
51 return "Message buffer size too small, must be at least 1024 Bytes";
52 case 0x1005:
53 return "Max. number of logical connections not supported";
54 case 0x1006:
55 return "Reserved";
56 case 0x1007:
57 return "The message could not be accepted because of an internal busy condition";
58 case 0x1008:
59 return "OS resource error (no memory ?)";
60 case 0x1009:
61 return "CAPI not installed";
62 case 0x100A:
63 return "Controller does not support external equipment";
64 case 0x100B:
65 return "Controller does only support external equipment";
66
67/*-- error information concerning message exchange functions -----*/
68 case 0x1101:
69 return "Illegal application number";
70 case 0x1102:
71 return "Illegal command or subcommand or message length less than 12 bytes";
72 case 0x1103:
73 return "The message could not be accepted because of a queue full condition !! The error code does not imply that CAPI cannot receive messages directed to another controller, PLCI or NCCI";
74 case 0x1104:
75 return "Queue is empty";
76 case 0x1105:
77 return "Queue overflow, a message was lost !! This indicates a configuration error. The only recovery from this error is to perform a CAPI_RELEASE";
78 case 0x1106:
79 return "Unknown notification parameter";
80 case 0x1107:
81 return "The Message could not be accepted because of an internal busy condition";
82 case 0x1108:
83 return "OS Resource error (no memory ?)";
84 case 0x1109:
85 return "CAPI not installed";
86 case 0x110A:
87 return "Controller does not support external equipment";
88 case 0x110B:
89 return "Controller does only support external equipment";
90
91/*-- error information concerning resource / coding problems -----*/
92 case 0x2001:
93 return "Message not supported in current state";
94 case 0x2002:
95 return "Illegal Controller / PLCI / NCCI";
96 case 0x2003:
97 return "Out of PLCI";
98 case 0x2004:
99 return "Out of NCCI";
100 case 0x2005:
101 return "Out of LISTEN";
102 case 0x2006:
103 return "Out of FAX resources (protocol T.30)";
104 case 0x2007:
105 return "Illegal message parameter coding";
106
107/*-- error information concerning requested services -----*/
108 case 0x3001:
109 return "B1 protocol not supported";
110 case 0x3002:
111 return "B2 protocol not supported";
112 case 0x3003:
113 return "B3 protocol not supported";
114 case 0x3004:
115 return "B1 protocol parameter not supported";
116 case 0x3005:
117 return "B2 protocol parameter not supported";
118 case 0x3006:
119 return "B3 protocol parameter not supported";
120 case 0x3007:
121 return "B protocol combination not supported";
122 case 0x3008:
123 return "NCPI not supported";
124 case 0x3009:
125 return "CIP Value unknown";
126 case 0x300A:
127 return "Flags not supported (reserved bits)";
128 case 0x300B:
129 return "Facility not supported";
130 case 0x300C:
131 return "Data length not supported by current protocol";
132 case 0x300D:
133 return "Reset procedure not supported by current protocol";
134
135/*-- informations about the clearing of a physical connection -----*/
136 case 0x3301:
137 return "Protocol error layer 1 (broken line or B-channel removed by signalling protocol)";
138 case 0x3302:
139 return "Protocol error layer 2";
140 case 0x3303:
141 return "Protocol error layer 3";
142 case 0x3304:
143 return "Another application got that call";
144/*-- T.30 specific reasons -----*/
145 case 0x3311:
146 return "Connecting not successful (remote station is no FAX G3 machine)";
147 case 0x3312:
148 return "Connecting not successful (training error)";
149 case 0x3313:
150 return "Disconnected before transfer (remote station does not support transfer mode, e.g. resolution)";
151 case 0x3314:
152 return "Disconnected during transfer (remote abort)";
153 case 0x3315:
154 return "Disconnected during transfer (remote procedure error, e.g. unsuccessful repetition of T.30 commands)";
155 case 0x3316:
156 return "Disconnected during transfer (local tx data underrun)";
157 case 0x3317:
158 return "Disconnected during transfer (local rx data overflow)";
159 case 0x3318:
160 return "Disconnected during transfer (local abort)";
161 case 0x3319:
162 return "Illegal parameter coding (e.g. SFF coding error)";
163
164/*-- disconnect causes from the network according to ETS 300 102-1/Q.931 -----*/
165 case 0x3481: return "Unallocated (unassigned) number";
166 case 0x3482: return "No route to specified transit network";
167 case 0x3483: return "No route to destination";
168 case 0x3486: return "Channel unacceptable";
169 case 0x3487:
170 return "Call awarded and being delivered in an established channel";
171 case 0x3490: return "Normal call clearing";
172 case 0x3491: return "User busy";
173 case 0x3492: return "No user responding";
174 case 0x3493: return "No answer from user (user alerted)";
175 case 0x3495: return "Call rejected";
176 case 0x3496: return "Number changed";
177 case 0x349A: return "Non-selected user clearing";
178 case 0x349B: return "Destination out of order";
179 case 0x349C: return "Invalid number format";
180 case 0x349D: return "Facility rejected";
181 case 0x349E: return "Response to STATUS ENQUIRY";
182 case 0x349F: return "Normal, unspecified";
183 case 0x34A2: return "No circuit / channel available";
184 case 0x34A6: return "Network out of order";
185 case 0x34A9: return "Temporary failure";
186 case 0x34AA: return "Switching equipment congestion";
187 case 0x34AB: return "Access information discarded";
188 case 0x34AC: return "Requested circuit / channel not available";
189 case 0x34AF: return "Resources unavailable, unspecified";
190 case 0x34B1: return "Quality of service unavailable";
191 case 0x34B2: return "Requested facility not subscribed";
192 case 0x34B9: return "Bearer capability not authorized";
193 case 0x34BA: return "Bearer capability not presently available";
194 case 0x34BF: return "Service or option not available, unspecified";
195 case 0x34C1: return "Bearer capability not implemented";
196 case 0x34C2: return "Channel type not implemented";
197 case 0x34C5: return "Requested facility not implemented";
198 case 0x34C6: return "Only restricted digital information bearer capability is available";
199 case 0x34CF: return "Service or option not implemented, unspecified";
200 case 0x34D1: return "Invalid call reference value";
201 case 0x34D2: return "Identified channel does not exist";
202 case 0x34D3: return "A suspended call exists, but this call identity does not";
203 case 0x34D4: return "Call identity in use";
204 case 0x34D5: return "No call suspended";
205 case 0x34D6: return "Call having the requested call identity has been cleared";
206 case 0x34D8: return "Incompatible destination";
207 case 0x34DB: return "Invalid transit network selection";
208 case 0x34DF: return "Invalid message, unspecified";
209 case 0x34E0: return "Mandatory information element is missing";
210 case 0x34E1: return "Message type non-existent or not implemented";
211 case 0x34E2: return "Message not compatible with call state or message type non-existent or not implemented";
212 case 0x34E3: return "Information element non-existent or not implemented";
213 case 0x34E4: return "Invalid information element contents";
214 case 0x34E5: return "Message not compatible with call state";
215 case 0x34E6: return "Recovery on timer expiry";
216 case 0x34EF: return "Protocol error, unspecified";
217 case 0x34FF: return "Interworking, unspecified";
218
219 default: return "No additional information";
220 }
221}
222#endif
223
224typedef struct { 25typedef struct {
225 int typ; 26 int typ;
226 size_t off; 27 size_t off;
@@ -1073,4 +874,3 @@ EXPORT_SYMBOL(capi_cmsg_header);
1073EXPORT_SYMBOL(capi_cmd2str); 874EXPORT_SYMBOL(capi_cmd2str);
1074EXPORT_SYMBOL(capi_cmsg2str); 875EXPORT_SYMBOL(capi_cmsg2str);
1075EXPORT_SYMBOL(capi_message2str); 876EXPORT_SYMBOL(capi_message2str);
1076EXPORT_SYMBOL(capi_info2str);
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h
index 5a52f2c94f3f..44bd6046e6e2 100644
--- a/include/linux/isdn/capiutil.h
+++ b/include/linux/isdn/capiutil.h
@@ -164,11 +164,6 @@ unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId,
164 __u8 _Command, __u8 _Subcommand, 164 __u8 _Command, __u8 _Subcommand,
165 __u16 _Messagenumber, __u32 _Controller); 165 __u16 _Messagenumber, __u32 _Controller);
166 166
167/*
168 * capi_info2str generated a readable string for Capi2.0 reasons.
169 */
170char *capi_info2str(__u16 reason);
171
172/*-----------------------------------------------------------------------*/ 167/*-----------------------------------------------------------------------*/
173 168
174/* 169/*