From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.4 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FCFCC43331 for ; Tue, 12 Nov 2019 18:18:07 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1AD421A49 for ; Tue, 12 Nov 2019 18:18:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jXg/C4N9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1AD421A49 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1iUaj5-0005LU-Ba; Tue, 12 Nov 2019 13:17:15 -0500 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1iUaj1-0005LM-KJ for kernelnewbies@kernelnewbies.org; Tue, 12 Nov 2019 13:17:11 -0500 Received: by mail-il1-x130.google.com with SMTP id a7so15979107ild.6 for ; Tue, 12 Nov 2019 10:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=TGFaF18viP4L0pthmpzWG7O4G3JhniacOdHhnyf7C0U=; b=jXg/C4N9SR5IOPsMajANxVsKcVGDebmB9c7QMs9/6TC9gju+lFdjESd6do9+V9MGCM dcuL/mtY/Nz3NW387nvSLES0GArgSFZFOtZAW/St0R4ZmJg5nRCdpg/jTTv9WZnfSLyG /gX/hd/yKBjlykS4/JdshEDX1I7YFfLB+uMW7H+e9lehDmw23jg9yzAixjATCQCFsQvK /ciS4j0LdotyA7K9Pik6uCADKttJ+mf7srGz5BoMAXIBrmtgVYmFNWakaXhK7MnBwL+1 KUJdHDl+hE52mEThFfjkgaWoz5OrbdndqWCXgFXPwULZXxtlt/1fE5+fOVU8/dd0rrD3 LdlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=TGFaF18viP4L0pthmpzWG7O4G3JhniacOdHhnyf7C0U=; b=VZwpj57aqRGSrrjgQKwmPuTEUd321KRVhKgKn20idTMw3Obvp3gIcWoGgwXGd1mxY0 0I7uyFHKvA1PORFeu+mCNXQfHDD34QbrnAERVHWDsssm3GQvH2H3SCc6oBkpYWfoIQ4+ 0707rgIDtcENQ16Fqff2omYCsTBdKQC2ZMg7MMaICSA8avkLXPnoC+z84ue0ATFefQ+u i7cl+rD/i0turq5TP5DCt+JrCr3+f7AVR7wI073pzlkiFnzOjnSYOfn4mDZtGp3IRk8+ xhWwVg9RMwUf8IYNN/xIBUKqQ96A7+jHxqz2JCWNT/qKdCUGU2BEHv5OY+lbsmYvYIIQ 3xOg== X-Gm-Message-State: APjAAAWggEUvnECjkeD8Q6VwRa4wABCZZbQmF2fyJZyvhFS0HAkMNCTO jssep7i4XnePHTEWSKvDTgN2Sa0+ufzq0B5VBR9Gd8wn X-Google-Smtp-Source: APXvYqwVEoy2RJdBbO2jJOc0vq3SNaPCHMmDczdqQDZ2zrZfMXIBsNa6Qxs/UJJUXR33sUcQ9pQtL4vPygiiNJDLlBs= X-Received: by 2002:a92:b70c:: with SMTP id k12mr33843760ili.55.1573582628457; Tue, 12 Nov 2019 10:17:08 -0800 (PST) MIME-Version: 1.0 References: <20191111163131.GB1017642@kroah.com> <20191111172442.GC1077444@kroah.com> <20191112053754.GB1210104@kroah.com> In-Reply-To: From: Jeffrey Walton Date: Tue, 12 Nov 2019 13:15:52 -0500 Message-ID: Subject: Re: How to log USB modem data for a specific device? To: Greg KH Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: noloader@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Tue, Nov 12, 2019 at 1:20 AM Jeffrey Walton wrote: > > On Tue, Nov 12, 2019 at 12:37 AM Greg KH wrote: > > ... > > > > > Here's why I want to specify a device number: > > > > > > $ cat /sys/kernel/debug/usb/devices | grep -i -c 'Bus=01' > > > 13 > > > > > > It is too much information for me to sift through. I'll do it if I > > > have to, but I prefer the tools do the work for me (rather than me do > > > the work of the tools). > > > > That explains why you only want one device's data, but does not answer > > why you want that data at all :) > > I have a pet project like NoMoRobo. It is essentially a call blocking > service that depends on Caller ID. My pet project takes things a step > further by initiating a call trace on suspicious numbers, and also > files FCC and FTC complaints. > > The program works well with Conexant, Accura/Hayes and MultiTech > modems. The program chokes on USR modems. For USR I get the RING > message, but not the Caller ID information. From my program's > perspective, it looks like the Caller ID information is never sent. > > So I want to perform some low level traces to understand why I am > mishandling things. > > The GNU screen program receives the information as expected. The > problem is, GNU screen does not show me individual messages. I don't > know where one message ends and another begins. (One of my theories is > the USR modem is batching RING and Caller ID into a single message). I think I tracked down the problem. The Caller ID information was not sent from the USR modem to my program. It seems reading the ring count from the S1 register after a RING is destructive for USR modems. My program fetches the ring count for each RING message. GNU's screen did not witness the problem because screen did not fetch ring count when it encountered a RING message. Getting the ring count is as simple as 'write(fd, "ATS1?\r", 6);' and then parsing the result of 'read(fd, buff, size);'. The ASCII result will be 001, 002, 003, etc. There's not much to it. Fetching the ring count from the modem was a simple way to track state. I guess I have to rethink the way I track state and perform state transitions. Jeff _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies