Received: by 10.192.165.148 with SMTP id m20csp2167683imm; Thu, 3 May 2018 11:30:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr2Cq7+Q0yKs3zSiG/6IxBC+afrgvO5mFbAkGXfSR+gLNSAkMguRwnMHGrdTC3SWrTn6Hy3 X-Received: by 2002:a63:4383:: with SMTP id q125-v6mr20471315pga.412.1525372214988; Thu, 03 May 2018 11:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525372214; cv=none; d=google.com; s=arc-20160816; b=qC0GXF2BXZpm3nL3/A0zW05xBm4HyW2fuLMjj5gpNNjs2lBHt6EEC0/Zx02p+bABY9 DJ413D/YADBKMebQBIADYaCznTWSZDJ2LmUX1MSv+/A1Wd5Fux4wtwhO8JmzyY1Gambo y2KeFaThyUmgS6AHcDomUXHGEZdgk0fTghzWOPchCtVgA+XWphO4bnoOmb/A59UMOION 9M+NzMWdeCAK3BG7kGyeUVHSSDmS03HYakiNl+wFxvIJXG7Bkst2XLQcKLFqsQSQwS7o IV2ZfTCqJZRoUtjxy6nrkgvqZmlcBLKcsqSCFPTF90fyWhjxA0DgTbaMZS7ftHV6sK7H HuEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:user-agent:references:message-id:lines :date:subject:from:to:arc-authentication-results; bh=zsV6mA9IPPZDObQvHwJR1C691qnvhn75vvZStZTXfnA=; b=p52LBBr7EYFYqd3bRwBuKr5UTygVKVmZwh407bENzE5Hvh7vUHAD5UNvESnrjSLddF EPbdHLWeSycS4suYCxu0+7iqUhBp1zD0SrFC7N+mLjYmyjErPqUAr+cRaYlwets3Ucv9 wC/WvMHgC2DG+AlW9c3NRmTYFtJftkiYaovL6XBNpDcUG3AxCloRm4sK5po+v4HPcWtD 19m+uIS1IQFpnk/ZHLEbWx8ddKNbJuBdXaYqu4pBXXoz5SIR0xc8RBNrZi9HR544wkkX aR/iidg6p2w1JxxyWgI8zfWP8Q9Wh8Q3gTZjm2U6hj42gnxfMStDaEjQXD5d+OA8sLPM 3edg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12-v6si1264995pls.37.2018.05.03.11.30.00; Thu, 03 May 2018 11:30:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbeECS3n (ORCPT + 99 others); Thu, 3 May 2018 14:29:43 -0400 Received: from [195.159.176.226] ([195.159.176.226]:49872 "EHLO blaine.gmane.org" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751075AbeECS3k (ORCPT ); Thu, 3 May 2018 14:29:40 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fEIwr-00047w-UO for linux-kernel@vger.kernel.org; Thu, 03 May 2018 20:27:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Grant Edwards Subject: Re: serial: custom baud rate Date: Thu, 3 May 2018 18:27:14 +0000 (UTC) Lines: 26 Message-ID: References: X-Complaints-To: usenet@blaine.gmane.org User-Agent: slrn/1.0.2 (Linux) Cc: linux-serial@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-03, Muni Sekhar wrote: > If I need to set a custom baud rates(e.g. 14400, 128000, 256000), does > Linux serial framework has any supporting method? Sure, use the termios2 structure instead of the termios structure: #include struct termios2 t; ioctl(fd, TCGETS2, &t) t.c_cflag &= ~CBAUD; t.c_cflag |= BOTHER; t.c_ispeed = baud; t.c_ospeed = baud; ioctl(fd, TCSETS2, &t) [Not all devices/drivers support termios2] -- Grant Edwards grant.b.edwards Yow! Are we live or on at tape? gmail.com