phonet.h (4f2c0a4acffbec01079c28f839422e64ddeff004) phonet.h (e1d001fa5b477c4da46a29be1fcece91db7c7c6f)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * File: af_phonet.h
4 *
5 * Phonet sockets kernel definitions
6 *
7 * Copyright (C) 2008 Nokia Corporation.
8 */

--- 95 unchanged lines hidden (view full) ---

104void phonet_proto_unregister(unsigned int protocol,
105 const struct phonet_protocol *pp);
106
107int phonet_sysctl_init(void);
108void phonet_sysctl_exit(void);
109int isi_register(void);
110void isi_unregister(void);
111
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * File: af_phonet.h
4 *
5 * Phonet sockets kernel definitions
6 *
7 * Copyright (C) 2008 Nokia Corporation.
8 */

--- 95 unchanged lines hidden (view full) ---

104void phonet_proto_unregister(unsigned int protocol,
105 const struct phonet_protocol *pp);
106
107int phonet_sysctl_init(void);
108void phonet_sysctl_exit(void);
109int isi_register(void);
110void isi_unregister(void);
111
112static inline bool sk_is_phonet(struct sock *sk)
113{
114 return sk->sk_family == PF_PHONET;
115}
116
117static inline int phonet_sk_ioctl(struct sock *sk, unsigned int cmd,
118 void __user *arg)
119{
120 int karg;
121
122 switch (cmd) {
123 case SIOCPNADDRESOURCE:
124 case SIOCPNDELRESOURCE:
125 if (get_user(karg, (int __user *)arg))
126 return -EFAULT;
127
128 return sk->sk_prot->ioctl(sk, cmd, &karg);
129 }
130 /* A positive return value means that the ioctl was not processed */
131 return 1;
132}
112#endif
133#endif