Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Feb 2007 09:47:29 +0000 (GMT)
From:      aji abraham <abraham_aji@yahoo.co.in>
To:        freebsd-questions@freebsd.org
Subject:   Doubts in "softc" and  "device_get_softc(dev)" 
Message-ID:  <152353.99611.qm@web8325.mail.in.yahoo.com>

next in thread | raw e-mail | index | archive | help

--- aji abraham <abraham_aji@yahoo.co.in> wrote:


 hi
 
    My name is Aji Abraham, now working with device
 drivers. the word
 "softc" and the function "device_get_softc(dev)"
 getting confuse me a
 lot. am listing some query below ..  pls help me ..
 
 
 Q1 In a free BSD driver Code, there are two device
 depended structures
 
      struct xx_softc {
      .......
      ......
 
 
      };
 
      struct xx_if_softc {
      .......
      ......
 
 
      };
 
 sizeof(struct xx_softc ) is 68
 sizeof(struct xx_if_softc ) is 1186
 
 And in device attach function
 
      xx_attach(dev){
 
      struct xx_softc    *sc;
      struct xx_if_softc *if_sc;
 
      sc_if = device_get_softc(dev);
      sc = device_get_softc(device_get_parent(dev));
 
      sc_if-> .....
      sc-> ....
      .......
      ......
 
      }
 
 
 Both allocation uses the same function. How it
 possible ?  can we 
 access
 all structure member ?
 
 Regards
 
 Aji Abraham



		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?152353.99611.qm>