| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /*****************************************************************************/ |
|---|
| 2 | 3 | |
|---|
| 3 | 4 | /* |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (C) 1996-2000 Thomas Sailer (sailer@ife.ee.ethz.ch) |
|---|
| 7 | 8 | * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 10 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 | | - * (at your option) any later version. |
|---|
| 12 | | - * |
|---|
| 13 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 | | - * GNU General Public License for more details. |
|---|
| 17 | | - * |
|---|
| 18 | | - * You should have received a copy of the GNU General Public License |
|---|
| 19 | | - * along with this program; if not, write to the Free Software |
|---|
| 20 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 21 | | - * |
|---|
| 22 | 9 | * Please note that the GPL allows you to use the driver, NOT the radio. |
|---|
| 23 | 10 | * In order to use the radio, you need a license from the communications |
|---|
| 24 | 11 | * authority of your country. |
|---|
| 25 | | - * |
|---|
| 26 | 12 | * |
|---|
| 27 | 13 | * Supported modems |
|---|
| 28 | 14 | * |
|---|
| .. | .. |
|---|
| 52 | 38 | * iobase base address of the port; common values are 0x3f8, 0x2f8, 0x3e8, 0x2e8 |
|---|
| 53 | 39 | * baud baud rate (between 300 and 4800) |
|---|
| 54 | 40 | * irq interrupt line of the port; common values are 4,3 |
|---|
| 55 | | - * |
|---|
| 56 | 41 | * |
|---|
| 57 | 42 | * History: |
|---|
| 58 | 43 | * 0.1 26.06.1996 Adapted from baycom.c and made network driver interface |
|---|
| .. | .. |
|---|
| 202 | 187 | * Reported by: Ignacio.Arenaza@studi.epfl.ch (Ignacio Arenaza Nuno) |
|---|
| 203 | 188 | */ |
|---|
| 204 | 189 | } |
|---|
| 205 | | - |
|---|
| 206 | | -/* --------------------------------------------------------------------- */ |
|---|
| 207 | | - |
|---|
| 208 | | -#if 0 |
|---|
| 209 | | -static inline unsigned int hweight16(unsigned int w) |
|---|
| 210 | | - __attribute__ ((unused)); |
|---|
| 211 | | -static inline unsigned int hweight8(unsigned int w) |
|---|
| 212 | | - __attribute__ ((unused)); |
|---|
| 213 | | - |
|---|
| 214 | | -static inline unsigned int hweight16(unsigned int w) |
|---|
| 215 | | -{ |
|---|
| 216 | | - unsigned short res = (w & 0x5555) + ((w >> 1) & 0x5555); |
|---|
| 217 | | - res = (res & 0x3333) + ((res >> 2) & 0x3333); |
|---|
| 218 | | - res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F); |
|---|
| 219 | | - return (res & 0x00FF) + ((res >> 8) & 0x00FF); |
|---|
| 220 | | -} |
|---|
| 221 | | - |
|---|
| 222 | | -static inline unsigned int hweight8(unsigned int w) |
|---|
| 223 | | -{ |
|---|
| 224 | | - unsigned short res = (w & 0x55) + ((w >> 1) & 0x55); |
|---|
| 225 | | - res = (res & 0x33) + ((res >> 2) & 0x33); |
|---|
| 226 | | - return (res & 0x0F) + ((res >> 4) & 0x0F); |
|---|
| 227 | | -} |
|---|
| 228 | | -#endif |
|---|
| 229 | | - |
|---|
| 230 | | -/* --------------------------------------------------------------------- */ |
|---|
| 231 | 190 | |
|---|
| 232 | 191 | static __inline__ void ser12_rx(struct net_device *dev, struct baycom_state *bc, struct timespec64 *ts, unsigned char curs) |
|---|
| 233 | 192 | { |
|---|